Langlib

Langlib.Classes.Recursive.Inclusion.RecursivelyEnumerable

Recursive Inclusions #

This file proves that recursive languages are Turing-recognisable and hence recursively enumerable.

Main results #

def liftCfg {Γ Λ : Type} [Inhabited Γ] (c : Turing.TM0.Cfg Γ Λ) :

Lift a TM0 configuration from state type Λ to Λ ⊕ Unit by wrapping the state in Sum.inl.

Equations
Instances For
    def decider_to_recognizer {Γ Λ : Type} [Inhabited Λ] (M : Turing.TM0.Machine Γ Λ) (accept : ΛBool) :

    Construct a recogniser TM from a decider TM with acceptance predicate. The recogniser halts iff the decider would halt in an accepting state; when the decider rejects, the recogniser enters an infinite loop.

    Equations
    Instances For
      theorem recognizer_step_of_decider_step {Γ Λ : Type} [Inhabited Γ] [Inhabited Λ] (M : Turing.TM0.Machine Γ Λ) (accept : ΛBool) (c c' : Turing.TM0.Cfg Γ Λ) (hs : c' Turing.TM0.step M c) :
      theorem recognizer_halts_of_accept {Γ Λ : Type} [Inhabited Γ] [Inhabited Λ] (M : Turing.TM0.Machine Γ Λ) (accept : ΛBool) (c : Turing.TM0.Cfg Γ Λ) (hstep : Turing.TM0.step M c = none) (hacc : accept c.q = true) :
      theorem recognizer_inr_reaches_inr {Γ Λ : Type} [Inhabited Γ] [Inhabited Λ] (M : Turing.TM0.Machine Γ Λ) (accept : ΛBool) (tape : Turing.Tape Γ) (c' : Turing.TM0.Cfg Γ (Λ Unit)) (hr : Turing.Reaches (Turing.TM0.step (decider_to_recognizer M accept)) { q := Sum.inr (), Tape := tape } c') :
      theorem recognizer_inr_never_halts {Γ Λ : Type} [Inhabited Γ] [Inhabited Λ] (M : Turing.TM0.Machine Γ Λ) (accept : ΛBool) (tape : Turing.Tape Γ) :
      theorem recognizer_diverges_of_reject {Γ Λ : Type} [Inhabited Γ] [Inhabited Λ] (M : Turing.TM0.Machine Γ Λ) (accept : ΛBool) (c : Turing.TM0.Cfg Γ Λ) (l : List Γ) (hreach : Turing.Reaches (Turing.TM0.step M) (Turing.TM0.init l) c) (hstep : Turing.TM0.step M c = none) (hrej : accept c.q = false) :
      theorem recognizer_tm0_eval_iff {T Γ Λ : Type} [Inhabited Γ] [Inhabited Λ] (L : Language T) (input : List TList Γ) (M : Turing.TM0.Machine Γ Λ) (accept : ΛBool) (halts : ∀ (w : List T), (Turing.eval (Turing.TM0.step M) (Turing.TM0.init (input w))).Dom) (hmem : ∀ (w : List T) (h : (Turing.eval (Turing.TM0.step M) (Turing.TM0.init (input w))).Dom), w L accept ((Turing.eval (Turing.TM0.step M) (Turing.TM0.init (input w))).get h).q = true) (w : List T) :
      w L (Turing.TM0.eval (decider_to_recognizer M accept) (input w)).Dom

      Every recursive language is recursively enumerable.

      The class of recursive languages is a subset of the class of RE languages.