Langlib

Langlib.Grammars.ContextFree.EquivMathlibCFG

Context-Free Definition Equivalence with Mathlib's ContextFreeGrammar #

This file proves that the project's context-free predicate is_CF coincides with Mathlib's Language.IsContextFree. It defines translations mathlib_cfg_of_cfg and cfg_of_mathlib_cfg between the project's CF_grammar and Mathlib's ContextFreeGrammar, shows the generated languages agree (CF_language_eq_mathlib_language, by induction on the derivation relation in each direction), and concludes is_CF_iff_isContextFree.

Main declarations #

noncomputable def mathlib_cfg_of_cfg {T : Type} (g : CF_grammar T) :
Equations
  • One or more equations did not get rendered due to their size.
Instances For
    noncomputable def cfg_of_mathlib_cfg {T : Type} (g : ContextFreeGrammar T) :
    Equations
    Instances For
      def CF_no_epsilon {T : Type} (g : CF_grammar T) :

      A context-free grammar has no ε-productions (every rule has a non-empty right-hand side).

      Equations
      Instances For