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 #
These are the ω-facing operations, defined over BoundedFormulaInf ℕ. An operation that makes
sense at an arbitrary branching carrier belongs upstream on BoundedFormulaInf; IndexCoding
handles transport between carriers.
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.BoundedFormulaInf.falsum = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.castLE x✝ (FirstOrder.Language.BoundedFormulaInf.all φ) = (FirstOrder.Language.BoundedFormulaω.castLE ⋯ φ).all
Instances For
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.BoundedFormulaInf.falsum = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.relabel g (FirstOrder.Language.BoundedFormulaInf.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ω.subst FirstOrder.Language.BoundedFormulaInf.falsum x✝ = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.subst (FirstOrder.Language.BoundedFormulaInf.imp φ ψ) x✝ = (φ.subst x✝).imp (ψ.subst x✝)
- FirstOrder.Language.BoundedFormulaω.subst (FirstOrder.Language.BoundedFormulaInf.all φ) x✝ = (φ.subst x✝).all
- FirstOrder.Language.BoundedFormulaω.subst (FirstOrder.Language.BoundedFormulaInf.iSup φs) x✝ = FirstOrder.Language.BoundedFormulaω.iSup fun (i : ℕ) => (φs i).subst x✝
- FirstOrder.Language.BoundedFormulaω.subst (FirstOrder.Language.BoundedFormulaInf.iInf φs) x✝ = FirstOrder.Language.BoundedFormulaω.iInf fun (i : ℕ) => (φs i).subst x✝
Instances For
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ω.openBounds FirstOrder.Language.BoundedFormulaInf.falsum = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.openBounds (FirstOrder.Language.BoundedFormulaInf.imp φ ψ) = FirstOrder.Language.BoundedFormulaω.imp φ.openBounds ψ.openBounds
- FirstOrder.Language.BoundedFormulaω.openBounds (FirstOrder.Language.BoundedFormulaInf.all φ) = (FirstOrder.Language.BoundedFormulaω.relabel FirstOrder.Language.insertLastBound φ.openBounds).all
- FirstOrder.Language.BoundedFormulaω.openBounds (FirstOrder.Language.BoundedFormulaInf.iSup φs) = FirstOrder.Language.BoundedFormulaω.iSup fun (i : ℕ) => (φs i).openBounds
- FirstOrder.Language.BoundedFormulaω.openBounds (FirstOrder.Language.BoundedFormulaInf.iInf φs) = FirstOrder.Language.BoundedFormulaω.iInf fun (i : ℕ) => (φs i).openBounds
Instances For
Bridge: openBounds ∘ relabel Sum.inr roundtrip #
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.BoundedFormulaInf.falsum = FirstOrder.Language.BoundedFormulaω.falsum
- FirstOrder.Language.BoundedFormulaω.mapLanguage g (FirstOrder.Language.BoundedFormulaInf.equal t₁ t₂) = FirstOrder.Language.BoundedFormulaω.equal (g.onTerm t₁) (g.onTerm t₂)
- FirstOrder.Language.BoundedFormulaω.mapLanguage g (FirstOrder.Language.BoundedFormulaInf.rel R ts) = FirstOrder.Language.BoundedFormulaω.rel (g.onRelation R) fun (i : Fin l) => g.onTerm (ts i)
- FirstOrder.Language.BoundedFormulaω.mapLanguage g (FirstOrder.Language.BoundedFormulaInf.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.
Closed-term substitution #
Substituting a closed term into a term with no real variables reduces to the plain relabel. Shared by the maximal-consistency term model and the proof-theoretic consistency family; it lives here so that neither needs to import the other.
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ω₁ω.