Rewriting #
term/formula morphisms such as rewritings, substitutions, and embeddings are handled by the structure FFL.FirstOrder.Rew.
FFL.FirstOrder.Rew.rewrite fis a rewriting of the free variables occurring in a term byf : ξ₁ → Semiterm L ξ₂ n.FFL.FirstOrder.Rew.subst vis a substitution of the bounded variables occurring in a term byv : Fin n → Semiterm L ξ n'.FFL.FirstOrder.Rew.bShiftis a transformation of the bounded variables occurring in a term by#x ↦ #(Fin.succ x).FFL.FirstOrder.Rew.shiftis a transformation of the free variables occurring in a term by&x ↦ &(x + 1).FFL.FirstOrder.Rew.embis a embedding of a term with no free variables.
Rewritings FFL.FirstOrder.Rew is naturally converted to formula rewritings by FFL.FirstOrder.Rew.hom.
A structure for maps which rewrite the semiterms occurring in a term.
toFun - A function from Semiterm L ξ₁ n₁ to Semiterm L ξ₂ n₂.
func'' - A proof that toFun respects the function symbols of L.
- func'' {k : ℕ} (f : L.Func k) (v : Fin k → Semiterm L ξ₁ n₁) : self.toFun (Semiterm.func f v) = Semiterm.func f fun (i : Fin k) => self.toFun (v i)
Instances For
Equations
- FFL.FirstOrder.SyntacticRew L n₁ n₂ = FFL.FirstOrder.Rew L ℕ n₁ ℕ n₂
Instances For
Equations
- FFL.FirstOrder.Rew.instFunLikeSemiterm = { coe := fun (f : FFL.FirstOrder.Rew L ξ₁ n₁ ξ₂ n₂) => f.toFun, coe_injective := ⋯ }
Equations
- FFL.FirstOrder.Rew.bindAux b e (FFL.FirstOrder.Semiterm.bvar x_1) = b x_1
- FFL.FirstOrder.Rew.bindAux b e (FFL.FirstOrder.Semiterm.fvar x_1) = e x_1
- FFL.FirstOrder.Rew.bindAux b e (FFL.FirstOrder.Semiterm.func f v) = FFL.FirstOrder.Semiterm.func f fun (i : Fin arity) => FFL.FirstOrder.Rew.bindAux b e (v i)
Instances For
FFL.FirstOrder.Rew.bind f is a substitution of the bound variables occurring in a term by b : Fin n₁ → Semiterm L ξ₂ n₂, and the free variables occurring in a term by e : ξ₁ → Semiterm L ξ₂ n₂.
Equations
- FFL.FirstOrder.Rew.bind b e = { toFun := FFL.FirstOrder.Rew.bindAux b e, func'' := ⋯ }
Instances For
FFL.FirstOrder.Rew.rewrite f is a substitution of the free variables occurring in a term by f : ξ₁ → Semiterm L ξ₂ n.
Instances For
FFL.FirstOrder.Rew.rewriteMap f is a substitution of the free variables occurring in a term by e : ξ₁ → ξ₂.
Equations
- FFL.FirstOrder.Rew.rewriteMap e = FFL.FirstOrder.Rew.rewrite fun (m : ξ₁) => FFL.FirstOrder.Semiterm.fvar (e m)
Instances For
Equations
- FFL.FirstOrder.Rew.map b e = FFL.FirstOrder.Rew.bind (fun (n : Fin n₁) => FFL.FirstOrder.Semiterm.bvar (b n)) fun (m : ξ₁) => FFL.FirstOrder.Semiterm.fvar (e m)
Instances For
FFL.FirstOrder.Rew.subst v is a substitution of the bound variables occurring in a term by v : Fin n → Semiterm L ξ n'.
Instances For
FFL.FirstOrder.Rew.emb is a embedding of a term with no free variables. It can be thought of as a cast from Semiterm L Empty n to Semiterm L ξ n for any type ξ.
Equations
- FFL.FirstOrder.Rew.emb = FFL.FirstOrder.Rew.map id fun (a : o) => h.elim a
Instances For
Instances For
Equations
- FFL.FirstOrder.Rew.empty = FFL.FirstOrder.Rew.map Fin.elim0 fun (a : o) => h.elim a
Instances For
FFL.FirstOrder.Rew.bShift is a transformation of the bounded variables occurring in a term by #x ↦ #(Fin.succ x).
Instances For
Equations
- FFL.FirstOrder.Rew.bShiftAdd m = FFL.FirstOrder.Rew.map (fun (x : Fin n) => x.addNat m) id
Instances For
Equations
Instances For
Equations
Instances For
FFL.FirstOrder.Rew.embSubsts v is a substitution of the bound variables occurring in a term with no free variables by v : Fin n → Semiterm L ξ n'.
This closely resembles FFL.FirstOrder.Rew.subst, however the term is required to have free variables of type Empty.
Equations
Instances For
FFL.FirstOrder.Rew.shift is a transformation of the free variables occurring in the term by &x ↦ &(x + 1).
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Rewriting system of terms #
Equations
- (FFL.FirstOrder.Semiterm.bvar x_2).toEmpty x_3 = FFL.FirstOrder.Semiterm.bvar x_2
- (FFL.FirstOrder.Semiterm.fvar x_2).toEmpty h = ⋯.elim
- (FFL.FirstOrder.Semiterm.func f v).toEmpty h = FFL.FirstOrder.Semiterm.func f fun (i : Fin arity) => (v i).toEmpty ⋯
Instances For
Rewriting system of formulae #
A typeclass for Rews which additionally respect quantifiers.
app - A notion of application of Rews to formulas.
app_all - Application preserves universal quantification.
app_exs - Application preserves existential quantification.
Instances
Application of a Rewriting to a formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- φ ⇜ w = (FFL.FirstOrder.Rewriting.app (FFL.FirstOrder.Rew.subst w)) φ
Instances For
Applies the substitution FFL.FirstOrder.Rew.subst w to a formula. This substitutes the bound variables occurring in the formula by w : Fin n₁ → Semiterm L ξ n₂.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Applies the substitution FFL.FirstOrder.Rew.shift to a formula. This substitutes each free variable &x with &(x + 1).
Instances For
Equations
- FFL.FirstOrder.«term_⁺» = Lean.ParserDescr.trailingNode `FFL.FirstOrder.«term_⁺» 1024 1024 (Lean.ParserDescr.symbol "⁺")
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
- comp_app {n₁ n₂ n₃ : ℕ} (ω₁₂ : Rew L ξ₁ n₁ ξ₂ n₂) (ω₂₃ : Rew L ξ₂ n₂ ξ₃ n₃) (φ : F₁ n₁) : (Rewriting.app (ω₂₃.comp ω₁₂)) φ = (Rewriting.app ω₂₃) ((Rewriting.app ω₁₂) φ)
Instances
- smul_map_injective {n₁ n₂ : ℕ} {b : Fin n₁ → Fin n₂} {f : ξ → ζ} (hb : Function.Injective b) (hf : Function.Injective f) : Function.Injective fun (φ : F n₁) => (Rewriting.app (Rew.map b f)) φ
Instances
- comp_app {n₁ n₂ n₃ : ℕ} (ω₁₂ : Rew L ℕ n₁ ℕ n₂) (ω₂₃ : Rew L ℕ n₂ ℕ n₃) (φ : S n₁) : (Rewriting.app (ω₂₃.comp ω₁₂)) φ = (Rewriting.app ω₂₃) ((Rewriting.app ω₁₂) φ)
- smul_map_injective {n₁ n₂ : ℕ} {b : Fin n₁ → Fin n₂} {f : ℕ → ℕ} (hb : Function.Injective b) (hf : Function.Injective f) : Function.Injective fun (φ : S n₁) => (Rewriting.app (Rew.map b f)) φ
Instances
Renaming free variables by predecessor undoes shift (a routine substitution law).
hom_subst_mbar_zero_comp_shift_eq_free
Equations
- FFL.FirstOrder.LawfulSyntacticRewriting.shiftEmb = { toFun := ⇑FFL.FirstOrder.Rewriting.shift, inj' := ⋯ }
Instances For
coe_subst_eq_subst_coe
coe_subst_eq_subst_coe₁