Documentation

TTFPI.Untyped

Untyped λ-calculus #

Note that we are not using simp or aesop in this file, even though our code is written in a style that is compatible with these tactics. This is because we want to keep the proofs as explicit as possible, for educational purposes.

inductive Untyped.Λ :
Instances For
    Equations
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        Instances For
          Equations
          Instances For
            Equations
            • L.Subterm M = (L M.Sub)
            Instances For
              Equations
              Equations
              Equations
              Instances For
                instance Untyped.Λ.instDecidableProperSubterm {M : Untyped.Λ} {N : Untyped.Λ} :
                Decidable (M.ProperSubterm N)
                Equations
                Equations
                Equations
                Instances For
                  Equations
                  Instances For
                    Equations
                    Equations
                    Instances For
                      def Untyped.Λ.hasDecHasBindingVar (M : Untyped.Λ) (x : Name) :
                      Decidable (M.hasBindingVar x)
                      Equations
                      Instances For
                        instance Untyped.Λ.instDecidableHasBindingVar {M : Untyped.Λ} {x : Name} :
                        Decidable (M.hasBindingVar x)
                        Equations
                        • Untyped.Λ.instDecidableHasBindingVar = M.hasDecHasBindingVar x
                        Equations
                        Instances For
                          @[simp]
                          theorem Untyped.Λ.rename_size_eq {M : Untyped.Λ} {x : Name} {y : Name} :
                          (M.rename x y).size = M.size
                          Instances For
                            @[simp]
                            theorem Untyped.Λ.renaming_rename {x : Name} {y : Name} {M : Untyped.Λ} {hfv : yM.FV} {hnb : ¬M.hasBindingVar y} :
                            (Untyped.Λ.abs x M).Renaming (Untyped.Λ.abs y (M.rename x y))
                            Instances For
                              instance Untyped.Λ.instCoeRenamingAlphaEq {M : Untyped.Λ} {N : Untyped.Λ} :
                              Coe (M.Renaming N) (M N)
                              Equations
                              • Untyped.Λ.instCoeRenamingAlphaEq = { coe := }
                              @[simp]
                              theorem Untyped.Λ.alpha_eq_rename {M : Untyped.Λ} {N : Untyped.Λ} :
                              M.Renaming NM N
                              @[simp]
                              theorem Untyped.Λ.alpha_eq_compat_app_left {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} (h : M N) :
                              M L N L
                              @[simp]
                              theorem Untyped.Λ.alpha_eq_compat_app_right {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} (h : M N) :
                              L M L N
                              theorem Untyped.Λ.alpha_eq_symm {M : Untyped.Λ} {N : Untyped.Λ} (h : M N) :
                              N M
                              theorem Untyped.Λ.alpha_eq_trans {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} (hlm : L M) (hmn : M N) :
                              L N
                              theorem Untyped.Λ.eq_imp_alpha_eq {M : Untyped.Λ} {N : Untyped.Λ} (h : M = N) :
                              M N
                              @[reducible, inline]
                              Equations
                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[irreducible]
                                  Equations
                                  Instances For
                                    Equations
                                    Instances For
                                      Equations
                                      Instances For
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          theorem Untyped.Λ.subst_noop {M : Untyped.Λ} {N : Untyped.Λ} {x : Name} (h : xM.FV) :
                                          M.subst x N = M
                                          theorem Untyped.Λ.subst_sequence {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} {x : Name} {y : Name} (h : x y) (hxm : xL.FV) :
                                          (M.subst x N).subst y L = (M.subst y L).subst x (N.subst y L)
                                          theorem Untyped.Λ.modulo_alpha_eq_app {M : Untyped.Λ} {N : Untyped.Λ} {P : Untyped.Λ} {Q : Untyped.Λ} (hmn : M N) (hpq : P Q) :
                                          M P N Q
                                          theorem Untyped.Λ.modulo_alpha_eq_subst {M : Untyped.Λ} {N : Untyped.Λ} {P : Untyped.Λ} {Q : Untyped.Λ} {x : Name} (hmn : M N) (hpq : P Q) :
                                          M.subst x P N.subst x Q
                                          Equations
                                          Instances For
                                            Instances For
                                              @[simp]
                                              theorem Untyped.Λ.beta_redex {x : Name} {M : Untyped.Λ} {N : Untyped.Λ} :
                                              Untyped.Λ.abs x M N →β M.subst x N
                                              @[simp]
                                              theorem Untyped.Λ.beta_compat_app_left {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} (h : M →β N) :
                                              M L →β N L
                                              @[simp]
                                              theorem Untyped.Λ.beta_compat_app_right {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} (h : M →β N) :
                                              L M →β L N
                                              Equations
                                              • Untyped.Λ.instCoeBetaBetaChain = { coe := }
                                              Instances For
                                                @[simp]
                                                theorem Untyped.Λ.beta_eq_beta {M : Untyped.Λ} {N : Untyped.Λ} (h : M →β N) :
                                                M N
                                                @[simp]
                                                theorem Untyped.Λ.beta_eq_beta_inv {M : Untyped.Λ} {N : Untyped.Λ} (h : N →β M) :
                                                M N
                                                theorem Untyped.Λ.beta_eq_symm {M : Untyped.Λ} {N : Untyped.Λ} (h : M N) :
                                                N M
                                                theorem Untyped.Λ.beta_eq_trans {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} (hlm : L M) (hmn : M N) :
                                                L N
                                                theorem Untyped.Λ.eq_imp_beta_eq {M : Untyped.Λ} {N : Untyped.Λ} (h : M = N) :
                                                M N
                                                Equations
                                                Instances For
                                                  Equations
                                                  • Untyped.Λ.instDecidableIsRedex = isFalse
                                                  • Untyped.Λ.instDecidableIsRedex = isFalse
                                                  • Untyped.Λ.instDecidableIsRedex = isFalse
                                                  • Untyped.Λ.instDecidableIsRedex = isTrue
                                                  • Untyped.Λ.instDecidableIsRedex = isFalse
                                                  Equations
                                                  Instances For
                                                    Equations
                                                    Instances For
                                                      Equations
                                                      • Untyped.Λ.instDecidableInNormalForm = M.hasDecIsNormalForm
                                                      Equations
                                                      Instances For
                                                        Equations
                                                        Instances For
                                                          Equations
                                                          Instances For
                                                            @[simp]
                                                            theorem Untyped.Λ.nf_beta_imp_eq {M : Untyped.Λ} {N : Untyped.Λ} (h : M.inNormalForm) (hmn : M →β N) :
                                                            M = N
                                                            @[simp]
                                                            theorem Untyped.Λ.nf_beta_chain_imp_eq {M : Untyped.Λ} {N : Untyped.Λ} (h : M.inNormalForm) (hmn : M ↠β N) :
                                                            M = N
                                                            theorem Untyped.Λ.nf_beta_chain_imp_alpha_eq {M : Untyped.Λ} {N : Untyped.Λ} (h : M.inNormalForm) (hmn : M ↠β N) :
                                                            M N
                                                            Equations
                                                            Instances For
                                                              Equations
                                                              Instances For
                                                                theorem Untyped.Λ.church_rosser {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} (hmn : L ↠β M) (hmp : L ↠β N) :
                                                                ∃ (P : Untyped.Λ), M ↠β P N ↠β P
                                                                theorem Untyped.Λ.church_rosser_corollary {L : Untyped.Λ} {M : Untyped.Λ} {N : Untyped.Λ} (hmn : M N) :
                                                                ∃ (L : Untyped.Λ), M ↠β L N ↠β L
                                                                theorem Untyped.Λ.fixpoint {x : Name} (L : Untyped.Λ) (h : xL.FV) :
                                                                ∃ (M : Untyped.Λ), L M M
                                                                Equations
                                                                Instances For
                                                                  Equations
                                                                  • M.toNat! = M.toNat?.getD default
                                                                  Instances For
                                                                    Equations
                                                                    Instances For
                                                                      Equations
                                                                      • M.toBool! = M.toBool?.getD default
                                                                      Instances For
                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For