Documentation

Cslib.Languages.LambdaCalculus.LocallyNameless.Fsub.Opening

λ-calculus #

The λ-calculus with polymorphism and subtyping, with a locally nameless representation of syntax. This file defines opening, local closure, and substitution.

References #

Variable opening (type opening to type) of the ith bound variable.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Variable opening (type opening to type) of the closest binding.

    Equations
    Instances For

      Variable opening (type opening to type) of the closest binding.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Locally closed types.

        Instances For
          @[implicit_reducible]
          Equations
          • One or more equations did not get rendered due to their size.
          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.openRec_neq_eq {Var : Type u_1} {X Y : } {σ τ γ : Ty Var} (neq : X Y) (h : openRec Y τ σ = openRec X γ (openRec Y τ σ)) :
          σ = openRec X γ σ

          An opening appearing in both sides of an equality of types can be removed.

          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.openRec_lc {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {X : } {σ τ : Ty Var} (lc : σ.LC) :
          σ = openRec X τ σ

          A locally closed type is unchanged by opening.

          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.subst_def {Var : Type u_1} [DecidableEq Var] {δ γ : Ty Var} {X : Var} :
          subst X δ γ = γ[X:=δ]
          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.subst_fresh {Var : Type u_1} [DecidableEq Var] {γ : Ty Var} {X : Var} (nmem : Xγ.fv) (δ : Ty Var) :
          γ = γ[X:=δ]

          Substitution of a free variable not present in a type leaves it unchanged.

          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.openRec_subst {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {δ : Ty Var} (Y : ) (σ τ : Ty Var) (lc : δ.LC) (X : Var) :
          (openRec Y τ σ)[X:=δ] = openRec Y (τ[X:=δ]) (σ[X:=δ])

          Substitution of a locally closed type distributes with opening.

          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.open_subst {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {δ : Ty Var} (σ τ : Ty Var) (lc : δ.LC) (X : Var) :
          (σ.open' τ)[X:=δ] = σ[X:=δ].open' (τ[X:=δ])

          Specialize Ty.openRec_subst to the first opening.

          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.open_subst_var {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {δ : Ty Var} {Y X : Var} (σ : Ty Var) (neq : Y X) (lc : δ.LC) :
          (σ.open' (fvar Y))[X:=δ] = σ[X:=δ].open' (fvar Y)

          Specialize Ty.subst_open to free variables.

          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.openRec_subst_intro {Var : Type u_1} [DecidableEq Var] {γ : Ty Var} {X : Var} (Y : ) (δ : Ty Var) (nmem : Xγ.fv) :
          openRec Y δ γ = (openRec Y (fvar X) γ)[X:=δ]

          Opening to a type is equivalent to opening to a free variable and substituting.

          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.open_subst_intro {Var : Type u_1} [DecidableEq Var] {γ : Ty Var} {X : Var} (δ : Ty Var) (nmem : Xγ.fv) :
          γ.open' δ = (γ.open' (fvar X))[X:=δ]

          Specialize Ty.openRec_subst_intro to the first opening.

          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.subst_lc {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {σ τ : Ty Var} (σ_lc : σ.LC) (τ_lc : τ.LC) (X : Var) :
          σ[X:=τ].LC
          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.nmem_fv_openRec {Var : Type u_1} [DecidableEq Var] {σ γ : Ty Var} {k : } {X : Var} (nmem : X(openRec k γ σ).fv) :
          Xσ.fv
          theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Ty.nmem_fv_open {Var : Type u_1} [DecidableEq Var] {σ γ : Ty Var} {X : Var} (nmem : X(σ.open' γ).fv) :
          Xσ.fv

          Variable opening (term opening to type) of the ith bound variable.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTy {Var : Type u_1} (t : Term Var) (δ : Ty Var) :
            Term Var

            Variable opening (term opening to type) of the closest binding.

            Equations
            Instances For

              Variable opening (term opening to type) of the closest binding.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Variable opening (term opening to term) of the ith bound variable.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Variable opening (term opening to term) of the closest binding.

                  Equations
                  Instances For

                    Variable opening (term opening to term) of the closest binding.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Locally closed terms.

                      Instances For
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTy_neq_eq {Var : Type u_1} {t : Term Var} {X Y : } {σ τ : Ty Var} (neq : X Y) (eq : openRecTy Y σ t = openRecTy X τ (openRecTy Y σ t)) :
                        t = openRecTy X τ t

                        An opening (term to type) appearing in both sides of an equality of terms can be removed.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTm_ty_eq {Var : Type u_1} {t : Term Var} {δ : Ty Var} {x : } {s : Term Var} {y : } (eq : openRecTm x s t = openRecTy y δ (openRecTm x s t)) :
                        t = openRecTy y δ t

                        Elimination of mixed term and type opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTy_lc {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {X : } {σ : Ty Var} {t : Term Var} (lc : t.LC) :
                        t = openRecTy X σ t

                        A locally closed term is unchanged by type opening.

                        @[implicit_reducible]
                        Equations
                        • One or more equations did not get rendered due to their size.
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.substTy_def {Var : Type u_1} [DecidableEq Var] {t : Term Var} {δ : Ty Var} {X : Var} :
                        substTy X δ t = t[X:=δ]
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.substTy_fresh {Var : Type u_1} [DecidableEq Var] {t : Term Var} {X : Var} (nmem : Xt.fvTy) (δ : Ty Var) :
                        t = t[X:=δ]

                        Substitution of a free type variable not present in a term leaves it unchanged.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTy_substTy {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {δ : Ty Var} (Y : ) (t : Term Var) (σ : Ty Var) (lc : δ.LC) (X : Var) :
                        (openRecTy Y σ t)[X:=δ] = openRecTy Y (σ[X:=δ]) (t[X:=δ])

                        Substitution of a locally closed type distributes with term opening to a type .

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTy_substTy {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {δ : Ty Var} (t : Term Var) (σ : Ty Var) (lc : δ.LC) (X : Var) :
                        (t.openTy σ)[X:=δ] = t[X:=δ].openTy (σ[X:=δ])

                        Specialize Term.openRecTy_subst to the first opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTy_substTy_var {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {δ : Ty Var} {Y X : Var} (t : Term Var) (neq : Y X) (lc : δ.LC) :
                        (t.openTy (Ty.fvar Y))[X:=δ] = t[X:=δ].openTy (Ty.fvar Y)

                        Specialize Term.openTy_subst to free type variables.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTy_substTy_intro {Var : Type u_1} [DecidableEq Var] {δ : Ty Var} {X : Var} (Y : ) (t : Term Var) (nmem : Xt.fvTy) :
                        openRecTy Y δ t = (openRecTy Y (Ty.fvar X) t)[X:=δ]

                        Opening a term to a type is equivalent to opening to a free variable and substituting.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTy_substTy_intro {Var : Type u_1} [DecidableEq Var] {X : Var} (t : Term Var) (δ : Ty Var) (nmem : Xt.fvTy) :
                        t.openTy δ = (t.openTy (Ty.fvar X))[X:=δ]

                        Specialize Term.openRecTy_substTy_intro to the first opening.

                        @[implicit_reducible]
                        Equations
                        • One or more equations did not get rendered due to their size.
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.substTm_def {Var : Type u_1} [DecidableEq Var] {t : Term Var} {x : Var} {s : Term Var} :
                        substTm x s t = t[x:=s]
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTm_neq_eq {Var : Type u_1} {t : Term Var} {x y : } {s₁ s₂ : Term Var} (neq : x y) (eq : openRecTm y s₁ t = openRecTm x s₂ (openRecTm y s₁ t)) :
                        t = openRecTm x s₂ t

                        An opening (term to term) appearing in both sides of an equality of terms can be removed.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTy_tm_eq {Var : Type u_1} {t : Term Var} {Y : } {σ : Ty Var} {x : } {s : Term Var} (eq : openRecTy Y σ t = openRecTm x s (openRecTy Y σ t)) :
                        t = openRecTm x s t

                        Elimination of mixed term and type opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTm_lc {Var : Type u_1} [DecidableEq Var] {t : Term Var} [HasFresh Var] {x : } {s : Term Var} (lc : t.LC) :
                        t = openRecTm x s t

                        A locally closed term is unchanged by term opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.substTm_fresh {Var : Type u_1} [DecidableEq Var] {t : Term Var} {x : Var} (nmem : xt.fvTm) (s : Term Var) :
                        t = t[x:=s]

                        Substitution of a free term variable not present in a term leaves it unchanged.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTm_substTm {Var : Type u_1} [DecidableEq Var] [HasFresh Var] {s : Term Var} (y : ) (t₁ t₂ : Term Var) (lc : s.LC) (x : Var) :
                        (openRecTm y t₂ t₁)[x:=s] = openRecTm y (t₂[x:=s]) (t₁[x:=s])

                        Substitution of a locally closed term distributes with term opening to a term.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTm_substTm {Var : Type u_1} [DecidableEq Var] [HasFresh Var] {s : Term Var} (t₁ t₂ : Term Var) (lc : s.LC) (x : Var) :
                        (t₁.openTm t₂)[x:=s] = t₁[x:=s].openTm (t₂[x:=s])

                        Specialize Term.openRecTm_substTm to the first opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTm_substTm_var {Var : Type u_1} [DecidableEq Var] [HasFresh Var] {s : Term Var} {x y : Var} (t : Term Var) (neq : y x) (lc : s.LC) :
                        (t.openTm (fvar y))[x:=s] = t[x:=s].openTm (fvar y)

                        Specialize Term.openRecTm_substTm to free term variables.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTm_substTy {Var : Type u_1} [DecidableEq Var] [HasFresh Var] (y : ) (t₁ t₂ : Term Var) (δ : Ty Var) (X : Var) :
                        (openRecTm y t₂ t₁)[X:=δ] = openRecTm y (t₂[X:=δ]) (t₁[X:=δ])

                        Substitution of a locally closed type distributes with term opening to a term.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTm_substTy {Var : Type u_1} [DecidableEq Var] [HasFresh Var] (t₁ t₂ : Term Var) (δ : Ty Var) (X : Var) :
                        (t₁.openTm t₂)[X:=δ] = t₁[X:=δ].openTm (t₂[X:=δ])

                        Specialize Term.openRecTm_substTy to the first opening

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTm_substTy_var {Var : Type u_1} [DecidableEq Var] [HasFresh Var] (t₁ : Term Var) (δ : Ty Var) (X y : Var) :
                        (t₁.openTm (fvar y))[X:=δ] = t₁[X:=δ].openTm (fvar y)

                        Specialize Term.openTm_substTy to free term variables

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTy_substTm {Var : Type u_1} [DecidableEq Var] [HasFresh Var] {s : Term Var} (Y : ) (t : Term Var) (δ : Ty Var) (lc : s.LC) (x : Var) :
                        (openRecTy Y δ t)[x:=s] = openRecTy Y δ (t[x:=s])

                        Substitution of a locally closed term distributes with term opening to a type.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTy_substTm {Var : Type u_1} [DecidableEq Var] [HasFresh Var] {s : Term Var} (t : Term Var) (δ : Ty Var) (lc : s.LC) (x : Var) :
                        (t.openTy δ)[x:=s] = t[x:=s].openTy δ

                        Specialize Term.openRecTy_substTm to the first opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTy_substTm_var {Var : Type u_1} [DecidableEq Var] [HasFresh Var] {s : Term Var} (t : Term Var) (lc : s.LC) (x Y : Var) :

                        Specialize Term.openTy_substTm to free type variables.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRecTm_substTm_intro {Var : Type u_1} [DecidableEq Var] {x : Var} (y : ) (t s : Term Var) (nmem : xt.fvTm) :
                        openRecTm y s t = (openRecTm y (fvar x) t)[x:=s]

                        Opening a term to a term is equivalent to opening to a free variable and substituting.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openTm_substTm_intro {Var : Type u_1} [DecidableEq Var] {x : Var} (t s : Term Var) (nmem : xt.fvTm) :
                        t.openTm s = (t.openTm (fvar x))[x:=s]

                        Specialize Term.openRecTm_substTm_intro to the first opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.substTy_lc {Var : Type u_1} [DecidableEq Var] {t : Term Var} {δ : Ty Var} [HasFresh Var] (t_lc : t.LC) (δ_lc : δ.LC) (X : Var) :
                        t[X:=δ].LC
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.substTm_lc {Var : Type u_1} [DecidableEq Var] {t s : Term Var} [HasFresh Var] (t_lc : t.LC) (s_lc : s.LC) (x : Var) :
                        t[x:=s].LC
                        @[implicit_reducible]
                        Equations
                        • One or more equations did not get rendered due to their size.
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Binding.substSub {Var : Type u_1} [DecidableEq Var] {δ γ : Ty Var} {X : Var} :
                        (sub γ)[X:=δ] = sub (γ[X:=δ])
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Binding.substTy {Var : Type u_1} [DecidableEq Var] {δ γ : Ty Var} {X : Var} :
                        (ty γ)[X:=δ] = ty (γ[X:=δ])
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Binding.subst_fresh {Var : Type u_1} [DecidableEq Var] {X : Var} {γ : Binding Var} (nmem : Xγ.fv) (δ : Ty Var) :
                        γ = γ[X:=δ]

                        Substitution of a free variable not present in a binding leaves it unchanged.