Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

RewThree

Abstract

Licensed Foundation.Syntax.Predicate.Rew source selected from the historical first-order pair extension.

This document mirrors the retained declarations from Foundation.Syntax.Predicate.Rew, lines 638-953, at Foundation revision 30a16ffa93d79d73ab4d02427fa00f50e039bf29. The excerpt records the term-rewriting laws and interfaces associated with the concrete first-order pair extension; current downstream consumer usage has not been re-queried.

The immutable source map, modification notices, full Apache-2.0 license and retirement condition are in Library/ConceptDynamics/foundation2026firstorder.md.

Lemma 1.1 (Fixing bound variables preserves the variable with an enlarged finite index).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.fixitr_bvar (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

For every finite bound index x, fixing m variables maps the bound variable to its castAdd representative in the enlarged context.

Lemma 1.2 (Fixing free variables either binds or shifts them).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.fixitr_fvar (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

A free variable below the fixed prefix becomes a bound variable; otherwise its index is decreased by the prefix length.

Lemma 1.3 (Rewrites agree when they agree on the variables visible in a term).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.rew_eq_of_funEqOn (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

Agreement on every bound variable and on the free variables occurring in the term is sufficient for equality after rewriting that term.

Lemma 1.4 (Language maps commute with term binding).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.lMap_bind (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

Mapping function symbols through a language homomorphism commutes with binding both bound and free variables.

Lemma 1.5 (Language maps commute with variable maps).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.lMap_map (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The map that changes variable indices and free-variable labels commutes with the language map on terms.

Lemma 1.6 (Language maps commute with bound-variable shifting).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.lMap_bShift (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

Adding one bound-variable slot before or after a language map gives the same term.

Lemma 1.7 (A free variable after rewriting comes from a source variable (the canonical selector is RewThreeCompat.fvar_rew; the source name is fvar?_rew).).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.fvar_rew (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

If a free variable occurs in a rewritten term, it came either from a rewritten bound variable or from a free variable of the source term.

Lemma 1.8 (Bound-variable shifting preserves free-variable support (the canonical selector is RewThreeCompat.fvar_bShift; the source name is fvar?_bShift).).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.fvar_bShift (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The bShift operation changes only bound indices, so the set of free variables is unchanged.

Definition 1.9 (A term with no free variables is converted to an empty-variable term).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.toEmpty (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The dependent definition recurses by cases: a bound variable is returned unchanged, a free-variable case is impossible from its empty-support proof, and a function node is rebuilt from recursively converted arguments, each carrying the empty-support proof derived from the parent.

Lemma 1.10 (Embedding the empty-variable form recovers the original term).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.emb_toEmpty (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The retained structural induction proves that embedding the term produced by toEmpty recovers the original term.

Definition 1.11 (A rewriting action applies rewrites to formulas and respects quantifiers).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.Rewriting (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

A Rewriting instance supplies an action of term rewrites on formulas, with universal and existential quantification transported through the rewrite. The app field is indexed by both bound-variable sizes; app_all and app_exs each take φ:F(n1+1) and use the lifted rewrite q(ω):Rew(L,ξ,n1+1,ζ,n2+1).

Definition 1.12 (Formula substitution is the substitution rewrite action).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.subst (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

For every indexed formula φ and substitution vector w:Fin(n1)→Semiterm(L,ξ,n2), the abbreviation subst(φ,w) is exactly app(Rew.subst(w),φ) through the Rewriting action.

Definition 1.13 (Formula shift is the shift rewrite action).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.shift (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The shift connective homomorphism applies Rew.shift to formulas while increasing free-variable indices.

Definition 1.14 (Formula free operation removes the last bound-variable slot).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.free (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The free connective homomorphism maps the last bound slot to free variable &0 and shifts each existing free variable &m to &(m+1), taking formulas from the n+1 bound-variable context to the n context.

Definition 1.15 (Formula-list shift maps each member).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.shifts (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The shifts definition maps the shift homomorphism over a finite list of formulas.

Lemma 1.16 (Shifting an empty formula list stays empty).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.shifts_nil (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The ASCII compatibility selector forwards the source shifts_nil theorem, including its exact LCWQ and Rewriting assumptions.

Lemma 1.17 (Shifting a cons list shifts its head and tail).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.shifts_cons (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The ASCII compatibility selector forwards the source shifts_cons theorem pointwise over the head and tail.

Lemma 1.18 (Shifting a negated formula list commutes with negation).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.shifts_neg (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The ASCII compatibility selector forwards the source shifts_neg theorem for list negation.

Definition 1.19 (Empty-label formulas embed as connective homomorphisms).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.emb (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

The ASCII compatibility selector exposes the source emb connective homomorphism from an empty-label family O to a ξ-labelled family F.

Definition 1.20 (Typed substitution selector agrees with slash-vector syntax).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.substNotation (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

Under [LCWQ S] and [SyntacticRewriting L S S], the typed compatibility selector substNotation(φ,w) forwards Rewriting.subst(φ,w). The source slash syntax φ/[t] expands to φ ⇜ ![t]. For the one-entry vector used below, ![&0] is Matrix.vecCons(fvar(0), Matrix.vecEmpty).

Definition 1.21 (The identity rewrite acts as the identity on formulas).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.ReflectiveRewriting (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

Reflectivity records that applying Rew.id leaves every formula unchanged.

Definition 1.22 (Composed rewrites act by successive formula application).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.TransitiveRewriting (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

Transitivity identifies application of a composed rewrite with applying the first rewrite and then the second.

Definition 1.23 (Injective variable and label maps induce an injective formula action).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.InjMapRewriting (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

If both the bound-variable map and free-variable map are injective, the induced map on formulas is injective.

Definition 1.24 (Lawful syntactic rewriting combines identity, composition and injectivity).

Formalization. D5/S3/ConceptDynamics/ZfcTermRewriting/RewThree.LawfulSyntacticRewriting (✓ std3).

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

With [LCWQ S] and [SyntacticRewriting L S S] as its parameters, the class extends ReflectiveRewriting L ℕ S, TransitiveRewriting L ℕ S ℕ S ℕ S, and InjMapRewriting L ℕ S ℕ S. These are inherited interfaces, not a proposition asserted by an equality.

Lemma 1.25 (Shifting a conjunction shifts each formula (the canonical selector is RewThreeCompat.shift_conj_two; the source name is shift_conj₂).).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.shift_conj_two (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

Under [LCWQ S] and [SyntacticRewriting L S S], for Γ:List(S n), the shift of a finite conjunction is the conjunction of the list mapped by shift:S n→S n, including the empty and singleton cases.

Lemma 1.26 (Substituting the first free variable after shifting is free).

Proof. Machine-checked in Lean as D5/S3/ConceptDynamics/ZfcTermRewriting/RewThreeCompat.app_subst_fbar_zero_comp_shift_eq_free (✓ std3). ∎

Citation. FormalizedFormalLogic contributors (2026). Foundation first-order logic and set theory, revision 30a16ffa. URL: https://github.com/FormalizedFormalLogic/Foundation/tree/30a16ffa93d79d73ab4d02427fa00f50e039bf29.

Commentary.

For a one-variable formula, shifting and substituting the zero free variable agrees with the free operation. The substitution vector is the explicit one-entry Matrix.vecCons(fvar(0), Matrix.vecEmpty), and the law is stated under the LCWQ, SyntacticRewriting, and LawfulSyntacticRewriting context.

References