Operations on Lω₁ω Formulas #
This file defines operations on Lω₁ω formulas including relabeling, casting, and substitution.
Main Definitions #
BoundedFormulaω.relabel: Relabels free variables.BoundedFormulaω.castLE: Increases the number of bound variables.BoundedFormulaω.subst: Substitutes terms for free variables.BoundedFormula.toLω: Embeds first-order formulas into Lω₁ω.
Implementation Notes #
The operations here closely mirror those in Linf/Operations.lean. See that file's
implementation notes for discussion of the duplication.
Maps the last variable of Fin (n+1) to a bound variable position,
keeping the first n as free variables. Used for quantifying over the last position.
This function is used by openBounds (for the all case) and by existsLastVar/forallLastVar
in Scott/Formula.lean.
Instances For
Casts a bounded formula to one with more bound variables.
Equations
- One or more equations did not get rendered due to their size.
- FirstOrder.Language.BoundedFormulaω.castLE x✝ FirstOrder.Language.BoundedFormulaω.falsum = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.castLE x✝ (φ.imp ψ) = (FirstOrder.Language.BoundedFormulaω.castLE x✝ φ).imp (FirstOrder.Language.BoundedFormulaω.castLE x✝ ψ)
- FirstOrder.Language.BoundedFormulaω.castLE x✝ φ.all = (FirstOrder.Language.BoundedFormulaω.castLE ⋯ φ).all
Instances For
castLE (le_refl n) is the identity on formulas.
castLE over a proof of m ≤ m preserves semantics.
This is more general than matching on le_refl directly, as it works for any
proof h : m ≤ m regardless of how it was constructed.
castLE over any proof h : n ≤ n preserves semantics.
This handles the case where the proof term is not definitionally le_refl
(e.g., constructed via rewriting or other means).
A function to help relabel the variables in bounded formulas.
Equations
- FirstOrder.Language.BoundedFormulaω.relabelAux g k = Sum.map id ⇑finSumFinEquiv ∘ ⇑(Equiv.sumAssoc β (Fin n) (Fin k)) ∘ Sum.map g id
Instances For
Relabels a bounded formula's free variables.
Equations
- One or more equations did not get rendered due to their size.
- FirstOrder.Language.BoundedFormulaω.relabel g FirstOrder.Language.BoundedFormulaω.falsum = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.relabel g (φ.imp ψ) = (FirstOrder.Language.BoundedFormulaω.relabel g φ).imp (FirstOrder.Language.BoundedFormulaω.relabel g ψ)
- FirstOrder.Language.BoundedFormulaω.relabel g φ.all = (FirstOrder.Language.BoundedFormulaω.castLE ⋯ (FirstOrder.Language.BoundedFormulaω.relabel g φ)).all
Instances For
Realize commutes with relabel Sum.inr: relabeling free variables Fin n into
bound positions via Sum.inr shifts them into the first n bound variable slots.
For φ : L.BoundedFormulaω (Fin n) k:
- The relabeled formula
φ.relabel Sum.inrhas typeL.BoundedFormulaω Empty (n + k) - Realizing with
Empty.elimandxs : Fin (n + k) → Mis equivalent to realizing the original formula withxs ∘ Fin.castAdd kfor free variables andxs ∘ Fin.natAdd nfor bound variables.
Specialization of realize_relabel_sumInr for formulas (k = 0 bound variables).
For φ : L.Formulaω (Fin n) (a formula with n free variables and 0 bound variables):
Substitutes the free variables in a bounded formula with terms.
Equations
- One or more equations did not get rendered due to their size.
- FirstOrder.Language.BoundedFormulaω.falsum.subst x✝ = FirstOrder.Language.BoundedFormulaω.falsum
- (φ.imp ψ).subst x✝ = (φ.subst x✝).imp (ψ.subst x✝)
- φ.all.subst x✝ = (φ.subst x✝).all
- (FirstOrder.Language.BoundedFormulaω.iSup φs).subst x✝ = FirstOrder.Language.BoundedFormulaω.iSup fun (i : ℕ) => (φs i).subst x✝
- (FirstOrder.Language.BoundedFormulaω.iInf φs).subst x✝ = FirstOrder.Language.BoundedFormulaω.iInf fun (i : ℕ) => (φs i).subst x✝
Instances For
Renames free variables in a bounded formula using a function f : α → β.
Unlike relabel, which can move free variables into bound positions, mapFreeVars
simply renames free variables while preserving the bound variable structure.
Equations
- One or more equations did not get rendered due to their size.
- FirstOrder.Language.BoundedFormulaω.mapFreeVars f FirstOrder.Language.BoundedFormulaω.falsum = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.mapFreeVars f (φ.imp ψ) = (FirstOrder.Language.BoundedFormulaω.mapFreeVars f φ).imp (FirstOrder.Language.BoundedFormulaω.mapFreeVars f ψ)
- FirstOrder.Language.BoundedFormulaω.mapFreeVars f φ.all = (FirstOrder.Language.BoundedFormulaω.mapFreeVars f φ).all
Instances For
Realization commutes with free variable renaming.
Realization commutes with free variable substitution.
This is the Lω₁ω analogue of Mathlib's BoundedFormula.realize_subst.
Convert a BoundedFormulaω Empty n to a Formulaω (Fin n) by reinterpreting
bound variables as free variables. Since there are no free variables (Empty),
the bound variables Fin n become the only variables, now treated as free.
For the all case, the last free variable is re-bound using relabel with
insertLastBound.
Equations
- One or more equations did not get rendered due to their size.
- FirstOrder.Language.BoundedFormulaω.falsum.openBounds = FirstOrder.Language.BoundedFormulaω.falsum
- (FirstOrder.Language.BoundedFormulaω.rel R ts).openBounds = FirstOrder.Language.BoundedFormulaω.rel R fun (i : Fin l) => FirstOrder.Language.Term.relabel (Sum.elim Empty.elim Sum.inl) (ts i)
- (φ.imp ψ).openBounds = FirstOrder.Language.BoundedFormulaω.imp φ.openBounds ψ.openBounds
- φ.all.openBounds = (FirstOrder.Language.BoundedFormulaω.relabel FirstOrder.Language.insertLastBound φ.openBounds).all
- (FirstOrder.Language.BoundedFormulaω.iSup φs).openBounds = FirstOrder.Language.BoundedFormulaω.iSup fun (i : ℕ) => (φs i).openBounds
- (FirstOrder.Language.BoundedFormulaω.iInf φs).openBounds = FirstOrder.Language.BoundedFormulaω.iInf fun (i : ℕ) => (φs i).openBounds
Instances For
Bridge: openBounds ∘ relabel Sum.inr roundtrip #
insertLastBound is the inverse of finSumFinEquiv restricted to splitting
the last element of Fin (n+1) into Fin n ⊕ Fin 1.
Roundtrip: openBounds after relabel Sum.inr is the identity on Formulaω (Fin n).
This bridges between the two representations of a formula with one free variable:
BoundedFormulaω Empty 1 (free variable as bound) and Formulaω (Fin 1) (free variable
as free). Used to connect the proof system's all_elim with ConsistencyPropertyEq's C7.
Language Maps #
Lifts a bounded Lω₁ω formula along a language homomorphism L →ᴸ L'.
This maps function and relation symbols in the formula using the language homomorphism,
while preserving the variable structure. It is the Lω₁ω analogue of Mathlib's
LHom.onBoundedFormula.
Equations
- One or more equations did not get rendered due to their size.
- FirstOrder.Language.BoundedFormulaω.mapLanguage g FirstOrder.Language.BoundedFormulaω.falsum = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.mapLanguage g (FirstOrder.Language.BoundedFormulaω.equal t₁ t₂) = FirstOrder.Language.BoundedFormulaω.equal (g.onTerm t₁) (g.onTerm t₂)
- FirstOrder.Language.BoundedFormulaω.mapLanguage g (FirstOrder.Language.BoundedFormulaω.rel R ts) = FirstOrder.Language.BoundedFormulaω.rel (g.onRelation R) fun (i : Fin l) => g.onTerm (ts i)
- FirstOrder.Language.BoundedFormulaω.mapLanguage g (φ.imp ψ) = (FirstOrder.Language.BoundedFormulaω.mapLanguage g φ).imp (FirstOrder.Language.BoundedFormulaω.mapLanguage g ψ)
- FirstOrder.Language.BoundedFormulaω.mapLanguage g φ.all = (FirstOrder.Language.BoundedFormulaω.mapLanguage g φ).all
Instances For
Realization of a formula is preserved by language homomorphisms that are expansions.
If g : L →ᴸ L' is an expansion on M (i.e., g maps symbols to the corresponding
symbols in M's L'-structure), then (φ.mapLanguage g).Realize v xs ↔ φ.Realize v xs
where the left side uses the L'-structure and the right side uses the L-structure.
mapLanguage commutes with not.
mapLanguage commutes with imp.
mapLanguage commutes with ex.
mapLanguage commutes with castLE.
mapLanguage commutes with relabel.
mapLanguage commutes with subst.
toSentenceω preserves semantics: the sentence realizes in M iff the original
formula realizes with the Fin.elim0 assignment.
Embeds a first-order bounded formula into Lω₁ω.
Equations
- FirstOrder.Language.BoundedFormula.falsum.toLω = FirstOrder.Language.BoundedFormulaω.falsum
- (FirstOrder.Language.BoundedFormula.equal t₁ t₂).toLω = FirstOrder.Language.BoundedFormulaω.equal t₁ t₂
- (FirstOrder.Language.BoundedFormula.rel R ts).toLω = FirstOrder.Language.BoundedFormulaω.rel R ts
- (φ.imp ψ).toLω = φ.toLω.imp ψ.toLω
- φ.all.toLω = φ.toLω.all
Instances For
Embeds a first-order formula into Lω₁ω.
Equations
Instances For
Embeds a first-order sentence into Lω₁ω.