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
          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.open_ty {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.openRec_ty_neq_eq {Var : Type u_1} {t : Term Var} {X Y : } {σ τ : Ty Var} (neq : X Y) (eq : openRec_ty Y σ t = openRec_ty X τ (openRec_ty Y σ t)) :
                        t = openRec_ty 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.openRec_tm_ty_eq {Var : Type u_1} {t : Term Var} {δ : Ty Var} {x : } {s : Term Var} {y : } (eq : openRec_tm x s t = openRec_ty y δ (openRec_tm x s t)) :
                        t = openRec_ty y δ t

                        Elimination of mixed term and type opening.

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

                        A locally closed term is unchanged by type opening.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.subst_ty_def {Var : Type u_1} [DecidableEq Var] {t : Term Var} {δ : Ty Var} {X : Var} :
                        subst_ty X δ t = t[X:=δ]
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.subst_ty_fresh {Var : Type u_1} [DecidableEq Var] {t : Term Var} {X : Var} (nmem : Xt.fv_ty) (δ : 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.openRec_ty_subst_ty {Var : Type u_1} [HasFresh Var] [DecidableEq Var] {δ : Ty Var} (Y : ) (t : Term Var) (σ : Ty Var) (lc : δ.LC) (X : Var) :
                        (openRec_ty Y σ t)[X:=δ] = openRec_ty Y (σ[X:=δ]) (t[X:=δ])

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

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

                        Specialize Term.openRec_ty_subst to the first opening.

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

                        Specialize Term.open_ty_subst to free type variables.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRec_ty_subst_ty_intro {Var : Type u_1} [DecidableEq Var] {δ : Ty Var} {X : Var} (Y : ) (t : Term Var) (nmem : Xt.fv_ty) :
                        openRec_ty Y δ t = (openRec_ty 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.open_ty_subst_ty_intro {Var : Type u_1} [DecidableEq Var] {X : Var} (t : Term Var) (δ : Ty Var) (nmem : Xt.fv_ty) :
                        t.open_ty δ = (t.open_ty (Ty.fvar X))[X:=δ]

                        Specialize Term.openRec_ty_subst_ty_intro to the first opening.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.subst_tm_def {Var : Type u_1} [DecidableEq Var] {t : Term Var} {x : Var} {s : Term Var} :
                        subst_tm x s t = t[x:=s]
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRec_tm_neq_eq {Var : Type u_1} {t : Term Var} {x y : } {s₁ s₂ : Term Var} (neq : x y) (eq : openRec_tm y s₁ t = openRec_tm x s₂ (openRec_tm y s₁ t)) :
                        t = openRec_tm 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.openRec_ty_tm_eq {Var : Type u_1} {t : Term Var} {Y : } {σ : Ty Var} {x : } {s : Term Var} (eq : openRec_ty Y σ t = openRec_tm x s (openRec_ty Y σ t)) :
                        t = openRec_tm x s t

                        Elimination of mixed term and type opening.

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

                        A locally closed term is unchanged by term opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.subst_tm_fresh {Var : Type u_1} [DecidableEq Var] {t : Term Var} {x : Var} (nmem : xt.fv_tm) (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.openRec_tm_subst_tm {Var : Type u_1} [DecidableEq Var] [HasFresh Var] {s : Term Var} (y : ) (t₁ t₂ : Term Var) (lc : s.LC) (x : Var) :
                        (openRec_tm y t₂ t₁)[x:=s] = openRec_tm 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.open_tm_subst_tm {Var : Type u_1} [DecidableEq Var] [HasFresh Var] {s : Term Var} (t₁ t₂ : Term Var) (lc : s.LC) (x : Var) :
                        (t₁.open_tm t₂)[x:=s] = t₁[x:=s].open_tm (t₂[x:=s])

                        Specialize Term.openRec_tm_subst_tm to the first opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.open_tm_subst_tm_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.open_tm (fvar y))[x:=s] = t[x:=s].open_tm (fvar y)

                        Specialize Term.openRec_tm_subst_tm to free term variables.

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

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

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

                        Specialize Term.openRec_tm_subst_ty to the first opening

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

                        Specialize Term.open_tm_subst_ty to free term variables

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

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

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

                        Specialize Term.openRec_ty_subst_tm to the first opening.

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

                        Specialize Term.open_ty_subst_tm to free type variables.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.openRec_tm_subst_tm_intro {Var : Type u_1} [DecidableEq Var] {x : Var} (y : ) (t s : Term Var) (nmem : xt.fv_tm) :
                        openRec_tm y s t = (openRec_tm 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.open_tm_subst_tm_intro {Var : Type u_1} [DecidableEq Var] {x : Var} (t s : Term Var) (nmem : xt.fv_tm) :
                        t.open_tm s = (t.open_tm (fvar x))[x:=s]

                        Specialize Term.openRec_tm_subst_tm_intro to the first opening.

                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Term.subst_ty_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.subst_tm_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
                        Equations
                        • One or more equations did not get rendered due to their size.
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Binding.subst_sub {Var : Type u_1} [DecidableEq Var] {δ γ : Ty Var} {X : Var} :
                        (sub γ)[X:=δ] = sub (γ[X:=δ])
                        theorem Cslib.LambdaCalculus.LocallyNameless.Fsub.Binding.subst_ty {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.