Documentation

Minimal.Term

Confluence of minimal φ-calculus #

This file contains a formalization of minimal φ-calculus and the proof of its confluence.

References #

Defition of minimal φ-calculus terms #

@[reducible]
def Attr :
Equations
Instances For
    inductive Term :
    Instances For
      @[reducible]
      def Bindings (lst : List String) :
      Equations
      Instances For

        Defition of increment, substitution, its properties, and auxiliary definitions that involve terms #

        def incLocatorsFrom (n : Nat) (term : Term) :

        Locator increment [KS22, Definition 2.5]

        Equations
        Instances For
          def incLocatorsFromLst (n : Nat) {lst : List Attr} (bnds : Bindings lst) :
          Equations
          Instances For
            Equations
            Instances For
              def substitute :
              Nat × TermTermTerm

              Locator substitution [KS22, Fig. 1]

              Equations
              Instances For
                def substituteLst {lst : List Attr} :
                Nat × TermBindings lstBindings lst
                Equations
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[irreducible]
                  def min_free_loc (zeroth_level : Nat) :

                  Minimal free locator in a term, if free locators exist, assuming free locators start at zeroth_level.

                  Equations
                  Instances For
                    Equations
                    Instances For
                      theorem le_min_option {j : Nat} {option_n1 option_n2 : Option Nat} (le_min : le_nat_option_nat j (min option_n1 option_n2)) :
                      le_nat_option_nat j option_n1 le_nat_option_nat j option_n2
                      theorem le_min_option_reverse {j : Nat} {option_n1 option_n2 : Option Nat} (le_and : le_nat_option_nat j option_n1 le_nat_option_nat j option_n2) :
                      le_nat_option_nat j (min option_n1 option_n2)
                      theorem min_free_loc_inc {i j : Nat} {v : Term} (free_locs_v : le_nat_option_nat i (min_free_loc j v)) :

                      IncLocatorsFrom increments minimal free locator if it acts only on free locators.

                      theorem min_free_loc_inc.traverse_bindings {i j : Nat} {lst : List Attr} (bindings : Bindings lst) (free_locs : le_nat_option_nat i (min_free_loc j (Term.obj bindings))) :
                      @[irreducible]
                      theorem subst_inc_cancel (v u : Term) (j k i zeroth_level : Nat) (le_ji : j i + zeroth_level) (le_ki : k i + zeroth_level) (le_0j : zeroth_level j) (le_0k : zeroth_level k) (v_loc : le_nat_option_nat i (min_free_loc zeroth_level v)) :

                      substitute and incLocatorsFrom cancel effect of each other, if they act only on free locators.

                      @[irreducible]
                      theorem subst_inc_cancel_Lst {lst : List Attr} (bindings : Bindings lst) (u : Term) (j k i zeroth_level : Nat) (le_ji : j i + zeroth_level) (le_ki : k i + zeroth_level) (le_0j : zeroth_level j) (le_0k : zeroth_level k) (v_loc : le_nat_option_nat i (min_free_loc zeroth_level (Term.obj bindings))) :
                      bindings = substituteLst (j + 1, incLocators u) (incLocatorsFromLst (k + 1) bindings)
                      def lookup {lst : List Attr} (l : Bindings lst) (a : Attr) :
                      Equations
                      Instances For
                        theorem lookup_none_not_in {lst : List Attr} {l : Bindings lst} {a : Attr} (lookup_none : lookup l a = none) :
                        ¬a lst
                        theorem lookup_none_preserve {lst : List Attr} {l1 : Bindings lst} {a : Attr} (lookup_none : lookup l1 a = none) (l2 : Bindings lst) :
                        def insert_φ {lst : List Attr} (l : Bindings lst) (a : Attr) (u : Option Term) :
                        Equations
                        Instances For
                          inductive IsAttached {lst : List Attr} :
                          AttrTermBindings lstType
                          Instances For
                            theorem isAttachedIsIn {lst : List Attr} {a : Attr} {t : Term} {l : Bindings lst} :
                            ∀ (a✝ : IsAttached a t l), a lst
                            theorem Insert.insertAttachedStep {a b : Attr} {neq : a b} {t : Term} {lst : List Attr} {not_in : ¬b lst} {u : Option Term} {l : Bindings lst} :
                            insert_φ (Record.cons b not_in u l) a (some t) = Record.cons b not_in u (insert_φ l a (some t))
                            theorem Insert.insertAttached {a : Attr} {t : Term} {lst : List Attr} {l : Bindings lst} :
                            ∀ (a✝ : IsAttached a t l), insert_φ l a (some t) = l
                            theorem Insert.insertTwice {lst : List Attr} (l : Bindings lst) (a : Attr) (t t' : Term) :
                            insert_φ (insert_φ l a (some t')) a (some t) = insert_φ l a (some t)
                            def Insert.insert_new_isAttached {lst : List Attr} {l : Bindings lst} {a : Attr} {t t' : Term} :
                            IsAttached a t lIsAttached a t' (insert_φ l a (some t'))
                            Equations
                            Instances For

                              Substitution Lemma #

                              theorem inc_swap (i j : Nat) (le_ij : i j) (t : Term) :

                              Increment swap [KS22, Lemma A.9]

                              theorem inc_swap_Lst (i j : Nat) (le_ij : i j) {lst : List Attr} (o : Bindings lst) :
                              theorem subst_inc_swap (i j : Nat) (le_ji : j i) (t u : Term) :

                              Increment and substitution swap [KS22, Lemma A.8]

                              theorem subst_inc_swap_Lst (i j : Nat) (le_ji : j i) {lst : List Attr} (o : Bindings lst) (u : Term) :
                              theorem inc_subst_swap (i j : Nat) (le_ji : j i) (t u : Term) :

                              Increment and substitution swap, dual to A.8

                              theorem inc_subst_swap_Lst (i j : Nat) (le_ji : j i) {lst : List Attr} (o : Bindings lst) (u : Term) :
                              theorem subst_swap (i j : Nat) (le_ji : j i) (t u v : Term) (free_locs_v : le_nat_option_nat i (min_free_loc 0 v)) :

                              Substitutions swap [KS22, Lemma A.7]

                              theorem subst_swap_Lst (i j : Nat) (le_ji : j i) {lst : List Attr} (o : Bindings lst) (u v : Term) (free_locs_v : le_nat_option_nat i (min_free_loc 0 v)) :
                              theorem lookup_inc_attached (t : Term) (i : Nat) (c : Attr) {lst : List Attr} (l : Bindings lst) (lookup_eq : lookup l c = some (some t)) :
                              theorem lookup_inc_void (i : Nat) (c : Attr) {lst : List Attr} (l : Bindings lst) (lookup_eq : lookup l c = some none) :
                              theorem lookup_inc_none (i : Nat) (c : Attr) {lst : List Attr} (l : Bindings lst) (lookup_eq : lookup l c = none) :
                              theorem inc_insert {i : Nat} {c : Attr} {lst : List Attr} {l : Bindings lst} {v : Term} :
                              theorem lookup_subst_attached (t : Term) {u : Term} (i : Nat) (c : Attr) {lst : List Attr} (l : Bindings lst) (lookup_eq : lookup l c = some (some t)) :
                              theorem lookup_subst_void {u : Term} (i : Nat) (c : Attr) {lst : List Attr} (l : Bindings lst) (lookup_eq : lookup l c = some none) :
                              theorem lookup_subst_none {u : Term} (i : Nat) (c : Attr) {lst : List Attr} (l : Bindings lst) (lookup_eq : lookup l c = none) :
                              theorem subst_insert {i : Nat} {c : Attr} {lst : List Attr} {l : Bindings lst} {u v : Term} :