Langlib

Langlib.Classes.RecursivelyEnumerable.Closure.Reverse

RE Closure Under Reversal #

This file proves closure of recursively enumerable languages under reversal.

The key construction reversal_grammar reverses each rule of an unrestricted grammar. The central result grammar_language_reversal_grammar shows that the language of the reversed grammar equals the reversal of the original language. This fact is then reused by the context-free and context-sensitive reversal proofs, avoiding duplicated derivation arguments.

Main declarations #

def reversal_grule {T N : Type} (r : grule T N) :
grule T N

Reverse a single unrestricted rule by swapping and reversing the left/right context and reversing the output string.

Equations
Instances For
    def reversal_grammar {T : Type} (g : grammar T) :

    Reverse every rule of an unrestricted grammar.

    Equations
    Instances For

      The language of the reversed grammar is exactly the reversal of the original language.

      This is the key lemma that is reused by the context-free and context-sensitive reversal closure proofs, so that the derivation-reversal argument need only be given once.

      theorem RE_of_reverse_RE {T : Type} (L : Language T) :

      The class of recursively-enumerable languages is closed under reversal.

      theorem RE_of_reverse_RE_rev {T : Type} (L : Language T) :

      The converse direction: if the reversal is RE then so is the original.

      @[simp]
      theorem RE_reverse_iff_RE {T : Type} (L : Language T) :

      A language is RE iff its reversal is RE.

      The class of recursively enumerable languages is closed under reversal.