Documentation

GroupoidModel.Syntax.Autosubst

Implementation of simultaneous substitutions following Schäfer/Tebbi/Smolka in Autosubst: Reasoning with de Bruijn Terms and Parallel Substitution.

def Expr.snoc {X : Sort u} (σ : X) (x : X) :
X

Append an element to a substitution or a renaming.

Δ ⊢ σ : Γ  Γ ⊢ A  Δ ⊢ t : A[σ]
------------------------------
Δ ⊢ σ.t : Γ.A
Equations
Instances For
    @[simp]
    theorem Expr.snoc_zero {X : Sort u_1} (σ : X) (x : X) :
    snoc σ x 0 = x
    @[simp]
    theorem Expr.snoc_succ {X : Sort u_1} (σ : X) (x : X) (n : ) :
    snoc σ x (n + 1) = σ n

    Renaming #

    def Expr.upr (ξ : ) :

    Lift a renaming under a binder. See up.

    Equations
    Instances For
      @[simp]
      theorem Expr.upr_id :
      def Expr.rename {χ : Type u_1} (ξ : ) :
      Expr χExpr χ

      Rename the de Bruijn indices in an expression.

      Equations
      Instances For

        Substitution #

        @[irreducible]
        def Expr.up {χ : Type u_1} (σ : Expr χ) :
        Expr χ

        Lift a substitution under a binder.

        Δ ⊢ σ : Γ  Γ ⊢ A
        ------------------------
        Δ.A[σ] ⊢ (↑≫σ).v₀ : Γ.A
        

        Warning: don't unfold this definition! Use up_eq_snoc instead.

        Equations
        Instances For
          @[simp]
          theorem Expr.up_bvar (χ : Type u_2) :
          def Expr.subst {χ : Type u_1} (σ : Expr χ) :
          Expr χExpr χ

          Apply a substitution to an expression.

          Equations
          Instances For
            @[simp]
            theorem Expr.subst_bvar (χ : Type u_2) :
            @[simp]
            theorem Expr.subst_snoc_zero {χ : Type u_1} (σ : Expr χ) (t : Expr χ) :
            subst (snoc σ t) (bvar 0) = t
            def Expr.ofRen (χ : Type u_2) (ξ : ) :
            Expr χ

            Turn a renaming into a substitution.

            Equations
            Instances For
              @[simp]
              theorem Expr.ofRen_id (χ : Type u_2) :
              theorem Expr.ofRen_upr (χ : Type u_2) (ξ : ) :
              ofRen χ (upr ξ) = up (ofRen χ ξ)
              theorem Expr.rename_eq_subst_ofRen (χ : Type u_2) (ξ : ) :
              rename ξ = subst (ofRen χ ξ)
              def Expr.comp {χ : Type u_1} (σ τ : Expr χ) :
              Expr χ

              Compose two substitutions.

              Θ ⊢ σ : Δ  Δ ⊢ τ : Γ
              --------------------
              Θ ⊢ σ≫τ : Γ
              
              Equations
              Instances For
                @[simp]
                theorem Expr.bvar_comp {χ : Type u_1} (σ : Expr χ) :
                comp bvar σ = σ
                @[simp]
                theorem Expr.comp_bvar {χ : Type u_1} (σ : Expr χ) :
                comp σ bvar = σ
                theorem Expr.up_comp_ren_sb {χ : Type u_1} (ξ : ) (σ : Expr χ) :
                up (σ ξ) = up σ upr ξ
                theorem Expr.rename_subst {χ : Type u_1} (σ : Expr χ) (ξ : ) (t : Expr χ) :
                subst σ (rename ξ t) = subst (σ ξ) t
                theorem Expr.up_comp_sb_ren {χ : Type u_1} (σ : Expr χ) (ξ : ) :
                up (rename ξ σ) = rename (upr ξ) up σ
                theorem Expr.subst_rename {χ : Type u_1} (ξ : ) (σ : Expr χ) (t : Expr χ) :
                rename ξ (subst σ t) = subst (rename ξ σ) t
                theorem Expr.up_comp {χ : Type u_1} (σ τ : Expr χ) :
                up (comp σ τ) = comp (up σ) (up τ)
                theorem Expr.subst_subst {χ : Type u_1} (σ τ : Expr χ) (t : Expr χ) :
                subst σ (subst τ t) = subst (comp σ τ) t
                theorem Expr.comp_assoc {χ : Type u_1} (σ τ ρ : Expr χ) :
                comp σ (comp τ ρ) = comp (comp σ τ) ρ
                theorem Expr.comp_snoc {χ : Type u_1} (σ τ : Expr χ) (t : Expr χ) :
                comp σ (snoc τ t) = snoc (comp σ τ) (subst σ t)
                def Expr.wk {χ : Type u_1} :
                Expr χ

                The weakening substitution.

                Γ ⊢ A
                ------------
                Γ.A ⊢ ↑ : Γ
                
                Equations
                Instances For
                  @[simp]
                  theorem Expr.ofRen_succ (χ : Type u_2) :
                  theorem Expr.up_eq_snoc {χ : Type u_1} (σ : Expr χ) :
                  up σ = snoc (comp wk σ) (bvar 0)
                  @[simp]
                  theorem Expr.snoc_comp_wk {χ : Type u_1} (σ : Expr χ) (t : Expr χ) :
                  comp (snoc σ t) wk = σ
                  @[simp]
                  theorem Expr.snoc_wk_zero (χ : Type u_2) :
                  theorem Expr.snoc_comp_wk_succ {χ : Type u_1} (σ : Expr χ) (n : ) :
                  snoc (comp wk σ) (bvar (n + 1)) = comp wk (snoc σ (bvar n))
                  def Expr.toSb {χ : Type u_1} (t : Expr χ) :
                  Expr χ

                  A substitution that instantiates one binder.

                  Γ ⊢ t : A
                  --------------
                  Γ ⊢ id.t : Γ.A
                  
                  Equations
                  Instances For

                    Decision procedure #

                    theorem Expr.snoc_comp_wk_zero_subst {χ : Type u_1} (σ : Expr χ) :
                    snoc (comp σ wk) (subst σ (bvar 0)) = σ
                    theorem Expr.ofRen_comp (χ : Type u_2) (ξ₁ ξ₂ : ) :
                    ofRen χ (ξ₁ ξ₂) = comp (ofRen χ ξ₁) (ofRen χ ξ₂)
                    @[simp]
                    theorem Expr.wk_app (χ : Type u_2) (n : ) :
                    wk n = bvar (n + 1)

                    Decides equality of substitutions applied to expressions.

                    Equations
                    Instances For

                      Use a term modulo autosubst conversion.

                      Equations
                      Instances For

                        Lemmas that come up in a few proofs

                        theorem Expr.subst_toSb_subst {χ : Type u_1} (B a : Expr χ) (σ : Expr χ) :
                        subst σ (subst a.toSb B) = subst (subst σ a).toSb (subst (up σ) B)
                        theorem Expr.subst_snoc_toSb_subst {χ : Type u_1} (B a b : Expr χ) (σ : Expr χ) :
                        subst σ (subst (snoc a.toSb b) B) = subst (snoc (subst σ a).toSb (subst σ b)) (subst (up (up σ)) B)

                        Closed expressions #

                        def Expr.SbIsBvar {χ : Type u_1} (σ : Expr χ) (n : ) :

                        The substitution acts via identity on indices strictly below n.

                        Equations
                        Instances For
                          theorem Expr.SbIsBvar.up {χ : Type u_1} {σ : Expr χ} {n : } :
                          SbIsBvar σ nSbIsBvar (Expr.up σ) (n + 1)
                          theorem Expr.SbIsBvar.zero {χ : Type u_1} (σ : Expr χ) :
                          theorem Expr.subst_of_isClosed' {χ : Type u_1} {e : Expr χ} {k : } {σ : Expr χ} :
                          isClosed k e = trueSbIsBvar σ ksubst σ e = e
                          theorem Expr.subst_of_isClosed {χ : Type u_1} {e : Expr χ} (σ : Expr χ) :
                          isClosed 0 e = truesubst σ e = e