Rewriting System #
term/formula morphisms such as Rewritings, substitutions, and embeddings are handled by the structure LO.FirstOrder.Rew
.
LO.FirstOrder.Rew.rewrite f
is a Rewriting of the free variables occurring in the term byf : ξ₁ → Semiterm L ξ₂ n
.LO.FirstOrder.Rew.substs v
is a substitution of the bounded variables occurring in the term byv : Fin n → Semiterm L ξ n'
.LO.FirstOrder.Rew.bShift
is a transformation of the bounded variables occurring in the term by#x ↦ #(Fin.succ x)
.LO.FirstOrder.Rew.shift
is a transformation of the free variables occurring in the term by&x ↦ &(x + 1)
.LO.FirstOrder.Rew.emb
is a embedding of the term with no free variables.
Rewritings LO.FirstOrder.Rew
is naturally converted to formula Rewritings by LO.FirstOrder.Rew.hom
.
structure
LO.FirstOrder.Rew
(L : Language)
(ξ₁ : Type u_1)
(n₁ : ℕ)
(ξ₂ : Type u_2)
(n₂ : ℕ)
:
Type (max (max u_1 u_2) u_3)
- 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)
@[reducible, inline]
Equations
- LO.FirstOrder.SyntacticRew L n₁ n₂ = LO.FirstOrder.Rew L ℕ n₁ ℕ n₂
instance
LO.FirstOrder.Rew.instFunLikeSemiterm
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
:
Equations
- LO.FirstOrder.Rew.instFunLikeSemiterm = { coe := fun (f : LO.FirstOrder.Rew L ξ₁ n₁ ξ₂ n₂) => f.toFun, coe_injective' := ⋯ }
instance
LO.FirstOrder.Rew.instCoeFunForallSemiterm
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
:
theorem
LO.FirstOrder.Rew.func
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
{k : ℕ}
(f : L.Func k)
(v : Fin k → Semiterm L ξ₁ n₁)
:
ω (Semiterm.func f v) = Semiterm.func f fun (i : Fin k) => ω (v i)
theorem
LO.FirstOrder.Rew.func''
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
{k : ℕ}
(f : L.Func k)
(v : Fin k → Semiterm L ξ₁ n₁)
:
ω (Semiterm.func f v) = Semiterm.func f (⇑ω ∘ v)
@[simp]
theorem
LO.FirstOrder.Rew.func0
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
(f : L.Func 0)
(v : Fin 0 → Semiterm L ξ₁ n₁)
:
ω (Semiterm.func f v) = Semiterm.func f ![]
@[simp]
theorem
LO.FirstOrder.Rew.func1
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
(f : L.Func 1)
(t : Semiterm L ξ₁ n₁)
:
ω (Semiterm.func f ![t]) = Semiterm.func f ![ω t]
@[simp]
theorem
LO.FirstOrder.Rew.func2
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
(f : L.Func 2)
(t₁ t₂ : Semiterm L ξ₁ n₁)
:
ω (Semiterm.func f ![t₁, t₂]) = Semiterm.func f ![ω t₁, ω t₂]
@[simp]
theorem
LO.FirstOrder.Rew.func3
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
(f : L.Func 3)
(t₁ t₂ t₃ : Semiterm L ξ₁ n₁)
:
ω (Semiterm.func f ![t₁, t₂, t₃]) = Semiterm.func f ![ω t₁, ω t₂, ω t₃]
theorem
LO.FirstOrder.Rew.ext
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω₁ ω₂ : Rew L ξ₁ n₁ ξ₂ n₂)
(hb : ∀ (x : Fin n₁), ω₁ (Semiterm.bvar x) = ω₂ (Semiterm.bvar x))
(hf : ∀ (x : ξ₁), ω₁ (Semiterm.fvar x) = ω₂ (Semiterm.fvar x))
:
ω₁ = ω₂
Equations
- LO.FirstOrder.Rew.id = { toFun := id, func' := ⋯ }
def
LO.FirstOrder.Rew.bindAux
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(b : Fin n₁ → Semiterm L ξ₂ n₂)
(e : ξ₁ → Semiterm L ξ₂ n₂)
:
Equations
- LO.FirstOrder.Rew.bindAux b e (LO.FirstOrder.Semiterm.bvar x_1) = b x_1
- LO.FirstOrder.Rew.bindAux b e (LO.FirstOrder.Semiterm.fvar x_1) = e x_1
- LO.FirstOrder.Rew.bindAux b e (LO.FirstOrder.Semiterm.func f v) = LO.FirstOrder.Semiterm.func f fun (i : Fin arity) => LO.FirstOrder.Rew.bindAux b e (v i)
def
LO.FirstOrder.Rew.bind
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(b : Fin n₁ → Semiterm L ξ₂ n₂)
(e : ξ₁ → Semiterm L ξ₂ n₂)
:
Rew L ξ₁ n₁ ξ₂ n₂
Equations
- LO.FirstOrder.Rew.bind b e = { toFun := LO.FirstOrder.Rew.bindAux b e, func' := ⋯ }
def
LO.FirstOrder.Rew.rewriteMap
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n : ℕ}
(e : ξ₁ → ξ₂)
:
Rew L ξ₁ n ξ₂ n
Equations
- LO.FirstOrder.Rew.rewriteMap e = LO.FirstOrder.Rew.rewrite fun (m : ξ₁) => LO.FirstOrder.Semiterm.fvar (e m)
def
LO.FirstOrder.Rew.map
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(b : Fin n₁ → Fin n₂)
(e : ξ₁ → ξ₂)
:
Rew L ξ₁ n₁ ξ₂ n₂
Equations
- LO.FirstOrder.Rew.map b e = LO.FirstOrder.Rew.bind (fun (n : Fin n₁) => LO.FirstOrder.Semiterm.bvar (b n)) fun (m : ξ₁) => LO.FirstOrder.Semiterm.fvar (e m)
def
LO.FirstOrder.Rew.emb
{L : Language}
{o : Type v₁}
[h : IsEmpty o]
{ξ : Type v₂}
{n : ℕ}
:
Rew L o n ξ n
Equations
- LO.FirstOrder.Rew.emb = LO.FirstOrder.Rew.map id fun (a : o) => h.elim a
@[reducible, inline]
Equations
def
LO.FirstOrder.Rew.empty
{L : Language}
{o : Type v₁}
[h : IsEmpty o]
{ξ : Type v₂}
{n : ℕ}
:
Rew L o 0 ξ n
Equations
- LO.FirstOrder.Rew.empty = LO.FirstOrder.Rew.map Fin.elim0 fun (a : o) => h.elim a
Equations
- LO.FirstOrder.Rew.bShiftAdd m = LO.FirstOrder.Rew.map (fun (x : Fin n) => x.addNat m) id
Equations
Equations
Equations
- LO.FirstOrder.Rew.toS = LO.FirstOrder.Rew.bind ![] fun (x : Fin n) => LO.FirstOrder.Semiterm.bvar x
Equations
- LO.FirstOrder.Rew.toF = LO.FirstOrder.Rew.bind (fun (x : Fin n) => LO.FirstOrder.Semiterm.fvar x) Empty.elim
theorem
LO.FirstOrder.Rew.eq_id_of_eq
{L : Language}
{ξ : Type u_1}
{n : ℕ}
{ω : Rew L ξ n ξ n}
(hb : ∀ (x : Fin n), ω (Semiterm.bvar x) = Semiterm.bvar x)
(he : ∀ (x : ξ), ω (Semiterm.fvar x) = Semiterm.fvar x)
(t : Semiterm L ξ n)
:
ω t = t
theorem
LO.FirstOrder.Rew.eq_bind
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
:
ω = bind (⇑ω ∘ Semiterm.bvar) (⇑ω ∘ Semiterm.fvar)
@[simp]
theorem
LO.FirstOrder.Rew.bind_eq_id_of_zero
{L : Language}
{ξ₂ : Type u_4}
(f : Fin 0 → Semiterm L ξ₂ 0)
:
@[simp]
theorem
LO.FirstOrder.Rew.map_fvar
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(b : Fin n₁ → Fin n₂)
(e : ξ₁ → ξ₂)
(m : ξ₁)
:
(map b e) (Semiterm.fvar m) = Semiterm.fvar (e m)
@[simp]
theorem
LO.FirstOrder.Rew.map_bvar
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(b : Fin n₁ → Fin n₂)
(e : ξ₁ → ξ₂)
(n : Fin n₁)
:
(map b e) (Semiterm.bvar n) = Semiterm.bvar (b n)
theorem
LO.FirstOrder.Rew.map_inj
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
{b : Fin n₁ → Fin n₂}
{e : ξ₁ → ξ₂}
(hb : Function.Injective b)
(he : Function.Injective e)
:
Function.Injective ⇑(map b e)
@[simp]
theorem
LO.FirstOrder.Rew.rewrite_fvar
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n : ℕ}
(f : ξ₁ → Semiterm L ξ₂ n)
(x : ξ₁)
:
(rewrite f) (Semiterm.fvar x) = f x
@[simp]
theorem
LO.FirstOrder.Rew.rewrite_bvar
{L : Language}
{ξ₁ : Type u_3}
{n : ℕ}
{ξ✝ : Type u_6}
{e : ξ₁ → Semiterm L ξ✝ n}
(x : Fin n)
:
(rewrite e) (Semiterm.bvar x) = Semiterm.bvar x
@[simp]
@[simp]
theorem
LO.FirstOrder.Rew.rewriteMap_fvar
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n : ℕ}
(e : ξ₁ → ξ₂)
(x : ξ₁)
:
(rewriteMap e) (Semiterm.fvar x) = Semiterm.fvar (e x)
@[simp]
theorem
LO.FirstOrder.Rew.rewriteMap_bvar
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n : ℕ}
(e : ξ₁ → ξ₂)
(x : Fin n)
:
(rewriteMap e) (Semiterm.bvar x) = Semiterm.bvar x
@[simp]
theorem
LO.FirstOrder.Rew.eq_rewriteMap_of_funEqOn_fv
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
[DecidableEq ξ₁]
(t : Semiterm L ξ₁ n₁)
(f g : ξ₁ → Semiterm L ξ₂ n₂)
(h : Function.funEqOn t.FVar? f g)
:
(rewriteMap f) t = (rewriteMap g) t
@[simp]
theorem
LO.FirstOrder.Rew.emb_bvar
{L : Language}
{ξ : Type u_1}
{n : ℕ}
{o : Type v₂}
[IsEmpty o]
(x : Fin n)
:
emb (Semiterm.bvar x) = Semiterm.bvar x
@[simp]
theorem
LO.FirstOrder.Rew.bShift_bvar
{L : Language}
{ξ : Type u_1}
{n : ℕ}
(x : Fin n)
:
bShift (Semiterm.bvar x) = Semiterm.bvar x.succ
@[simp]
theorem
LO.FirstOrder.Rew.bShift_fvar
{L : Language}
{ξ : Type u_1}
{n : ℕ}
(x : ξ)
:
bShift (Semiterm.fvar x) = Semiterm.fvar x
@[simp]
theorem
LO.FirstOrder.Rew.bShift_ne_zero
{L : Language}
{ξ : Type u_1}
{n : ℕ}
(t : Semiterm L ξ n)
:
bShift t ≠ Semiterm.bvar 0
@[simp]
@[simp]
@[simp]
theorem
LO.FirstOrder.Rew.bShiftAdd_bvar
{L : Language}
{ξ : Type u_1}
{n : ℕ}
(m : ℕ)
(x : Fin n)
:
(bShiftAdd m) (Semiterm.bvar x) = Semiterm.bvar (x.addNat m)
@[simp]
theorem
LO.FirstOrder.Rew.bShiftAdd_fvar
{L : Language}
{ξ : Type u_1}
{n : ℕ}
(m : ℕ)
(x : ξ)
:
(bShiftAdd m) (Semiterm.fvar x) = Semiterm.fvar x
@[simp]
theorem
LO.FirstOrder.Rew.substs_fvar
{L : Language}
{ξ : Type u_1}
{n n' : ℕ}
(w : Fin n → Semiterm L ξ n')
(x : ξ)
:
(substs w) (Semiterm.fvar x) = Semiterm.fvar x
@[simp]
@[simp]
theorem
LO.FirstOrder.Rew.cast_bvar
{L : Language}
{ξ : Type u_1}
{n n' : ℕ}
(h : n = n')
(x : Fin n)
:
(cast h) (Semiterm.bvar x) = Semiterm.bvar (Fin.cast h x)
@[simp]
theorem
LO.FirstOrder.Rew.cast_fvar
{L : Language}
{ξ : Type u_1}
{n n' : ℕ}
(h : n = n')
(x : ξ)
:
(cast h) (Semiterm.fvar x) = Semiterm.fvar x
@[simp]
theorem
LO.FirstOrder.Rew.castLe_bvar
{L : Language}
{ξ : Type u_1}
{n n' : ℕ}
(h : n ≤ n')
(x : Fin n)
:
(castLE h) (Semiterm.bvar x) = Semiterm.bvar (Fin.castLE h x)
@[simp]
theorem
LO.FirstOrder.Rew.castLe_fvar
{L : Language}
{ξ : Type u_1}
{n n' : ℕ}
(h : n ≤ n')
(x : ξ)
:
(castLE h) (Semiterm.fvar x) = Semiterm.fvar x
@[simp]
theorem
LO.FirstOrder.Rew.toS_fvar
{L : Language}
{n : ℕ}
(x : Fin n)
:
toS (Semiterm.fvar x) = Semiterm.bvar x
@[simp]
@[simp]
theorem
LO.FirstOrder.Rew.q_bvar_zero
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
:
ω.q (Semiterm.bvar 0) = Semiterm.bvar 0
@[simp]
theorem
LO.FirstOrder.Rew.q_bvar_succ
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
(i : Fin n₁)
:
ω.q (Semiterm.bvar i.succ) = bShift (ω (Semiterm.bvar i))
@[simp]
theorem
LO.FirstOrder.Rew.q_fvar
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
(x : ξ₁)
:
ω.q (Semiterm.fvar x) = bShift (ω (Semiterm.fvar x))
@[simp]
theorem
LO.FirstOrder.Rew.q_eq_zero_iff
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
(ω : Rew L ξ₁ n₁ ξ₂ n₂)
{t : Semiterm L ξ₁ (n₁ + 1)}
:
ω.q t = Semiterm.bvar 0 ↔ t = Semiterm.bvar 0
@[simp]
theorem
LO.FirstOrder.Rew.q_rewriteMap
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n : ℕ}
(e : ξ₁ → ξ₂)
:
(rewriteMap e).q = rewriteMap e
theorem
LO.FirstOrder.Rew.q_toS
{L : Language}
{n : ℕ}
:
toS.q = bind ![Semiterm.bvar 0] fun (x : Fin n) => Semiterm.bvar x.succ
Equations
Equations
- LO.FirstOrder.Rew.fix = LO.FirstOrder.Rew.bind (fun (x : Fin n) => LO.FirstOrder.Semiterm.bvar x.castSucc) (LO.FirstOrder.Semiterm.bvar (Fin.last n) :>ₙ LO.FirstOrder.Semiterm.fvar)
@[reducible, inline]
abbrev
LO.FirstOrder.Rew.rewrite1
{L : Language}
{n : ℕ}
(t : SyntacticSemiterm L n)
:
SyntacticRew L n n
@[simp]
theorem
LO.FirstOrder.Rew.shift_bvar
{L : Language}
{n : ℕ}
(x : Fin n)
:
shift (Semiterm.bvar x) = Semiterm.bvar x
@[simp]
theorem
LO.FirstOrder.Rew.shift_fvar
{L : Language}
{n : ℕ}
(x : ℕ)
:
shift (Semiterm.fvar x) = Semiterm.fvar (x + 1)
theorem
LO.FirstOrder.Rew.shift_func
{L : Language}
{n k : ℕ}
(f : L.Func k)
(v : Fin k → SyntacticSemiterm L n)
:
shift (Semiterm.func f v) = Semiterm.func f fun (i : Fin k) => shift (v i)
@[simp]
theorem
LO.FirstOrder.Rew.free_bvar_castSucc
{L : Language}
{n : ℕ}
(x : Fin n)
:
free (Semiterm.bvar x.castSucc) = Semiterm.bvar x
@[simp]
theorem
LO.FirstOrder.Rew.free_bvar_castSucc_zero
{L : Language}
{n : ℕ}
:
free (Semiterm.bvar 0) = Semiterm.bvar 0
@[simp]
theorem
LO.FirstOrder.Rew.free_bvar_last
{L : Language}
{n : ℕ}
:
free (Semiterm.bvar (Fin.last n)) = Semiterm.fvar 0
@[simp]
theorem
LO.FirstOrder.Rew.free_bvar_last_zero
{L : Language}
:
free (Semiterm.bvar 0) = Semiterm.fvar 0
@[simp]
theorem
LO.FirstOrder.Rew.free_fvar
{L : Language}
{n : ℕ}
(x : ℕ)
:
free (Semiterm.fvar x) = Semiterm.fvar (x + 1)
@[simp]
theorem
LO.FirstOrder.Rew.fix_bvar
{L : Language}
{n : ℕ}
(x : Fin n)
:
fix (Semiterm.bvar x) = Semiterm.bvar x.castSucc
@[simp]
theorem
LO.FirstOrder.Rew.fix_fvar_zero
{L : Language}
{n : ℕ}
:
fix (Semiterm.fvar 0) = Semiterm.bvar (Fin.last n)
@[simp]
theorem
LO.FirstOrder.Rew.fix_fvar_succ
{L : Language}
{n : ℕ}
(x : ℕ)
:
fix (Semiterm.fvar (x + 1)) = Semiterm.fvar x
@[simp]
theorem
LO.FirstOrder.Rew.substs_mbar_zero_comp_shift_eq_free
{L : Language}
:
(substs ![Semiterm.fvar 0]).comp shift = free
@[simp]
theorem
LO.FirstOrder.Rew.rewriteMap_comp_rewriteMap
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{ξ₃ : Type u_5}
{n : ℕ}
(f : ξ₁ → ξ₂)
(g : ξ₂ → ξ₃)
:
(rewriteMap g).comp (rewriteMap f) = rewriteMap (g ∘ f)
@[simp]
theorem
LO.FirstOrder.Rew.fix_free_app
{L : Language}
{n : ℕ}
(t : SyntacticSemiterm L (n + 1))
:
fix (free t) = t
@[simp]
theorem
LO.FirstOrder.Rew.free_fix_app
{L : Language}
{n : ℕ}
(t : SyntacticSemiterm L n)
:
free (fix t) = t
@[simp]
theorem
LO.FirstOrder.Rew.free_bShift_app
{L : Language}
(t : SyntacticSemiterm L 0)
:
free (bShift t) = shift t
@[simp]
theorem
LO.FirstOrder.Rew.fixitr_bvar
{L : Language}
(n m : ℕ)
(x : Fin n)
:
(fixitr n m) (Semiterm.bvar x) = Semiterm.bvar (Fin.castAdd m x)
theorem
LO.FirstOrder.Rew.fixitr_fvar
{L : Language}
(n m x : ℕ)
:
(fixitr n m) (Semiterm.fvar x) = if h : x < m then Semiterm.bvar (Fin.natAdd n ⟨x, h⟩) else Semiterm.fvar (x - m)
Rewriting system of terms #
instance
LO.FirstOrder.Semiterm.instCoeEmptySyntacticSemiterm
{L : Language}
{n : ℕ}
:
Coe (Semiterm L Empty n) (SyntacticSemiterm L n)
Equations
theorem
LO.FirstOrder.Semiterm.lMap_shift
{L₁ : Language}
{L₂ : Language}
{n : ℕ}
(Φ : L₁.Hom L₂)
(t : SyntacticSemiterm L₁ n)
:
theorem
LO.FirstOrder.Semiterm.lMap_free
{L₁ : Language}
{L₂ : Language}
{n : ℕ}
(Φ : L₁.Hom L₂)
(t : SyntacticSemiterm L₁ (n + 1))
:
theorem
LO.FirstOrder.Semiterm.lMap_fix
{L₁ : Language}
{L₂ : Language}
{n : ℕ}
(Φ : L₁.Hom L₂)
(t : SyntacticSemiterm L₁ n)
:
theorem
LO.FirstOrder.Semiterm.fvar?_rew
{L : Language}
{ξ₁ : Type u_3}
{ξ₂ : Type u_4}
{n₁ n₂ : ℕ}
[DecidableEq ξ₁]
[DecidableEq ξ₂]
{ω : Rew L ξ₁ n₁ ξ₂ n₂}
{t : Semiterm L ξ₁ n₁}
{x : ξ₂}
:
@[simp]
theorem
LO.FirstOrder.Semiterm.fvar?_bShift
{L : Language}
{ξ : Type u_1}
{n : ℕ}
[DecidableEq ξ]
{t : Semiterm L ξ n}
{x : ξ}
:
(Rew.bShift t).FVar? x ↔ t.FVar? x
def
LO.FirstOrder.Semiterm.toEmpty
{L : Language}
{ξ : Type u_1}
[DecidableEq ξ]
{n : ℕ}
(t : Semiterm L ξ n)
:
Equations
- (LO.FirstOrder.Semiterm.bvar x_2).toEmpty x_3 = LO.FirstOrder.Semiterm.bvar x_2
- (LO.FirstOrder.Semiterm.fvar x_2).toEmpty h = ⋯.elim
- (LO.FirstOrder.Semiterm.func f v).toEmpty h = LO.FirstOrder.Semiterm.func f fun (i : Fin arity) => (v i).toEmpty ⋯
@[simp]
theorem
LO.FirstOrder.Semiterm.emb_toEmpty
{L : Language}
{ξ : Type u_1}
{n : ℕ}
[DecidableEq ξ]
(t : Semiterm L ξ n)
(ht : t.freeVariables = ∅)
:
Rew.emb (t.toEmpty ht) = t
Rewriting system of formulae #
Equations
- One or more equations did not get rendered due to their size.
@[reducible, inline]
abbrev
LO.FirstOrder.Rewriting.substitute
{F : ℕ → Type u_1}
{L : Language}
{ξ : Type u_3}
[LCWQ F]
{n₁ n₂ : ℕ}
[Rewriting L ξ F ξ F]
(φ : F n₁)
(w : Fin n₁ → Semiterm L ξ n₂)
:
F n₂
Equations
- φ ⇜ w = (LO.FirstOrder.Rewriting.app (LO.FirstOrder.Rew.substs w)) φ
Equations
- One or more equations did not get rendered due to their size.
Equations
- LO.FirstOrder.«term_⁺» = Lean.ParserDescr.trailingNode `LO.FirstOrder.«term_⁺» 1024 1024 (Lean.ParserDescr.symbol "⁺")
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
class
LO.FirstOrder.TransitiveRewriting
(L : outParam Language)
(ξ₁ : outParam (Type u_1))
(F₁ : ℕ → Type u_2)
(ξ₂ : Type u_3)
(F₂ : outParam (ℕ → Type u_4))
(ξ₃ : Type u_5)
(F₃ : outParam (ℕ → Type u_6))
[LCWQ F₁]
[LCWQ F₂]
[LCWQ F₃]
[Rewriting L ξ₁ F₁ ξ₂ F₂]
[Rewriting L ξ₂ F₂ ξ₃ F₃]
[Rewriting L ξ₁ F₁ ξ₃ F₃]
:
- comp_app {n₁ n₂ n₃ : ℕ} (ω₁₂ : Rew L ξ₁ n₁ ξ₂ n₂) (ω₂₃ : Rew L ξ₂ n₂ ξ₃ n₃) (φ : F₁ n₁) : (Rewriting.app (ω₂₃.comp ω₁₂)) φ = (Rewriting.app ω₂₃) ((Rewriting.app ω₁₂) φ)
class
LO.FirstOrder.InjMapRewriting
(L : outParam Language)
(ξ : outParam (Type u_1))
(F : ℕ → Type u_2)
(ζ : Type u_3)
(G : outParam (ℕ → Type u_4))
[LCWQ F]
[LCWQ G]
[Rewriting L ξ F ζ G]
:
- 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)) φ
class
LO.FirstOrder.LawfulSyntacticRewriting
(L : outParam Language)
(S : ℕ → Type u_1)
[LCWQ S]
[SyntacticRewriting L S S]
extends LO.FirstOrder.ReflectiveRewriting L ℕ S, LO.FirstOrder.TransitiveRewriting L ℕ S ℕ S ℕ S, LO.FirstOrder.InjMapRewriting L ℕ S ℕ S :
- 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)) φ
theorem
LO.FirstOrder.LawfulSyntacticRewriting.fix_allClosure
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
{n : ℕ}
(φ : S n)
:
∀' Rewriting.fix (∀* φ) = ∀* Rewriting.fix φ
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shifts_cons
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
{n : ℕ}
(φ : S n)
(Γ : List (S n))
:
Rewriting.shifts (φ :: Γ) = Rewriting.shift φ :: Rewriting.shifts Γ
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shifts_nil
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
{n : ℕ}
:
Rewriting.shifts [] = []
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shifts_union
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
{n : ℕ}
(Γ Δ : List (S n))
:
Rewriting.shifts (Γ ++ Δ) = Rewriting.shifts Γ ++ Rewriting.shifts Δ
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shifts_neg
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
{n : ℕ}
(Γ : List (S n))
:
Rewriting.shifts (List.map (fun (x : S n) => ∼x) Γ) = List.map (fun (x : S n) => ∼x) (Rewriting.shifts Γ)
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shift_conj₂
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
{n : ℕ}
(Γ : List (S n))
:
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shift_injective
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
{n : ℕ}
:
Function.Injective fun (φ : S n) => Rewriting.shift φ
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.fix_free
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
{n : ℕ}
(φ : S (n + 1))
:
Rewriting.fix (Rewriting.free φ) = φ
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.free_fix
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
{n : ℕ}
(φ : S n)
:
Rewriting.free (Rewriting.fix φ) = φ
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.substitute_empty
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(φ : S 0)
(v : Fin 0 → Semiterm L ℕ 0)
:
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.app_substs_fbar_zero_comp_shift_eq_free
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(φ : S 1)
:
(Rewriting.shift φ)/[Semiterm.fvar 0] = Rewriting.free φ
hom_substs_mbar_zero_comp_shift_eq_free
theorem
LO.FirstOrder.LawfulSyntacticRewriting.free_rewrite_eq
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(f : ℕ → SyntacticTerm L)
(φ : S 1)
:
Rewriting.free ((Rewriting.app (Rew.rewrite fun (x : ℕ) => Rew.bShift (f x))) φ) = (Rewriting.app (Rew.rewrite (Semiterm.fvar 0 :>ₙ fun (x : ℕ) => Rew.shift (f x)))) (Rewriting.free φ)
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shift_rewrite_eq
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(f : ℕ → SyntacticTerm L)
(φ : S 0)
:
Rewriting.shift ((Rewriting.app (Rew.rewrite f)) φ) = (Rewriting.app (Rew.rewrite (Semiterm.fvar 0 :>ₙ fun (x : ℕ) => Rew.shift (f x)))) (Rewriting.shift φ)
theorem
LO.FirstOrder.LawfulSyntacticRewriting.rewrite_subst_eq
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(f : ℕ → SyntacticTerm L)
(t : Semiterm L ℕ 0)
(φ : S 1)
:
(Rewriting.app (Rew.rewrite f)) (φ/[t]) = ((Rewriting.app (Rew.rewrite (⇑Rew.bShift ∘ f))) φ)/[(Rew.rewrite f) t]
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.free_substs_nil
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(φ : S 0)
:
Rewriting.free (φ/[]) = Rewriting.shift φ
theorem
LO.FirstOrder.LawfulSyntacticRewriting.rewrite_substs_nil
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(f : ℕ → SyntacticTerm L)
(φ : S 0)
:
(Rewriting.app (Rew.rewrite (⇑Rew.bShift ∘ f))) (φ/[]) = ((Rewriting.app (Rew.rewrite f)) φ)/[]
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.cast_substs_eq
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(t : SyntacticTerm L)
(φ : S 0)
:
(φ/[])/[t] = φ
theorem
LO.FirstOrder.LawfulSyntacticRewriting.rewrite_free_eq_subst
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
(t : SyntacticTerm L)
(φ : S 1)
:
(Rewriting.app (Rew.rewrite (t :>ₙ fun (x : ℕ) => Semiterm.fvar x))) (Rewriting.free φ) = φ/[t]
def
LO.FirstOrder.LawfulSyntacticRewriting.shiftEmb
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
{n : ℕ}
:
S n ↪ S n
Equations
- LO.FirstOrder.LawfulSyntacticRewriting.shiftEmb = { toFun := LO.FirstOrder.Rewriting.shift, inj' := ⋯ }
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shiftEmb_def
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
{n : ℕ}
(φ : S n)
:
shiftEmb φ = Rewriting.shift φ
theorem
LO.FirstOrder.LawfulSyntacticRewriting.allClosure_fixitr
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
{m : ℕ}
(φ : S 0)
:
∀* (Rewriting.app (Rew.fixitr 0 (m + 1))) φ = ∀' (Rewriting.app Rew.fix) (∀* (Rewriting.app (Rew.fixitr 0 m)) φ)
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.mem_shifts_iff
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
{n : ℕ}
{φ : S n}
{Γ : List (S n)}
:
Rewriting.shift φ ∈ Rewriting.shifts Γ ↔ φ ∈ Γ
@[simp]
theorem
LO.FirstOrder.LawfulSyntacticRewriting.shifts_ss
{L : Language}
{S : ℕ → Type u_1}
[LCWQ S]
[SyntacticRewriting L S S]
[LawfulSyntacticRewriting L S]
{n : ℕ}
(Γ Δ : List (S n))
:
Rewriting.shifts Γ ⊆ Rewriting.shifts Δ ↔ Γ ⊆ Δ
theorem
LO.FirstOrder.Rewriting.embedding_substitute_eq_substitute_embedding
{ο : Type u_1}
{ξ : Type u_2}
[IsEmpty ο]
{O : ℕ → Type u_3}
{F : ℕ → Type u_4}
[LCWQ O]
[LCWQ F]
{L : Language}
{k n : ℕ}
[Rewriting L ο O ο O]
[Rewriting L ο O ξ F]
[Rewriting L ξ F ξ F]
[TransitiveRewriting L ο O ο O ξ F]
[TransitiveRewriting L ο O ξ F ξ F]
(φ : O k)
(v : Fin k → Semiterm L ο n)
:
coe_substs_eq_substs_coe
theorem
LO.FirstOrder.Rewriting.embedding_substs_eq_substs_coe₁
{ο : Type u_1}
{ξ : Type u_2}
[IsEmpty ο]
{O : ℕ → Type u_3}
{F : ℕ → Type u_4}
[LCWQ O]
[LCWQ F]
{L : Language}
{n : ℕ}
[Rewriting L ο O ο O]
[Rewriting L ο O ξ F]
[Rewriting L ξ F ξ F]
[TransitiveRewriting L ο O ο O ξ F]
[TransitiveRewriting L ο O ξ F ξ F]
(φ : O 1)
(t : Semiterm L ο n)
:
↑(φ/[t]) = ↑φ/[Rew.emb t]
coe_substs_eq_substs_coe₁
@[simp]