Operations on L∞ω Formulas #
This file defines operations on L∞ω formulas including relabeling, casting, and substitution.
Main Definitions #
BoundedFormulaInf.relabel: Relabels free variables.BoundedFormulaInf.castLE: Increases the number of bound variables.BoundedFormulaInf.subst: Substitutes terms for free variables.BoundedFormula.toLinf: Embeds first-order formulas into L∞ω.BoundedFormulaω.toLinf: Embeds Lω₁ω formulas into L∞ω.
Implementation Notes #
The operations here (castLE, relabel, mapFreeVars, subst) closely mirror those in
Lomega1omega/Operations.lean. The duplication exists because BoundedFormulaInf and
BoundedFormulaω are separate inductive types: the former uses arbitrary {ι : Type uι}
for iSup/iInf while the latter uses ℕ. Factoring into a shared abstraction would
require a typeclass over the formula type, deferred for future work.
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.BoundedFormulaInf.castLE x✝ FirstOrder.Language.BoundedFormulaInf.falsum = FirstOrder.Language.BoundedFormulaInf.falsum
- FirstOrder.Language.BoundedFormulaInf.castLE x✝ (φ.imp ψ) = (FirstOrder.Language.BoundedFormulaInf.castLE x✝ φ).imp (FirstOrder.Language.BoundedFormulaInf.castLE x✝ ψ)
- FirstOrder.Language.BoundedFormulaInf.castLE x✝ φ.all = (FirstOrder.Language.BoundedFormulaInf.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.
A function to help relabel the variables in bounded formulas.
Equations
- FirstOrder.Language.BoundedFormulaInf.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.BoundedFormulaInf.relabel g FirstOrder.Language.BoundedFormulaInf.falsum = FirstOrder.Language.BoundedFormulaInf.falsum
- FirstOrder.Language.BoundedFormulaInf.relabel g (φ.imp ψ) = (FirstOrder.Language.BoundedFormulaInf.relabel g φ).imp (FirstOrder.Language.BoundedFormulaInf.relabel g ψ)
- FirstOrder.Language.BoundedFormulaInf.relabel g φ.all = (FirstOrder.Language.BoundedFormulaInf.castLE ⋯ (FirstOrder.Language.BoundedFormulaInf.relabel g φ)).all
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.BoundedFormulaInf.mapFreeVars f FirstOrder.Language.BoundedFormulaInf.falsum = FirstOrder.Language.BoundedFormulaInf.falsum
- FirstOrder.Language.BoundedFormulaInf.mapFreeVars f (φ.imp ψ) = (FirstOrder.Language.BoundedFormulaInf.mapFreeVars f φ).imp (FirstOrder.Language.BoundedFormulaInf.mapFreeVars f ψ)
- FirstOrder.Language.BoundedFormulaInf.mapFreeVars f φ.all = (FirstOrder.Language.BoundedFormulaInf.mapFreeVars f φ).all
Instances For
Realization commutes with free variable renaming.
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.BoundedFormulaInf.falsum.subst x✝ = FirstOrder.Language.BoundedFormulaInf.falsum
- (φ.imp ψ).subst x✝ = (φ.subst x✝).imp (ψ.subst x✝)
- φ.all.subst x✝ = (φ.subst x✝).all
- (FirstOrder.Language.BoundedFormulaInf.iSup φs).subst x✝ = FirstOrder.Language.BoundedFormulaInf.iSup fun (i : ι) => (φs i).subst x✝
- (FirstOrder.Language.BoundedFormulaInf.iInf φs).subst x✝ = FirstOrder.Language.BoundedFormulaInf.iInf fun (i : ι) => (φs i).subst x✝
Instances For
Universe lifting for index types #
Lift a formula from index universe 0 to index universe w by ULifting each index type.
This maps BoundedFormulaInf.{u,v,u',0} to BoundedFormulaInf.{u,v,u',w}, preserving
semantics and quantifier rank.
Equations
- FirstOrder.Language.BoundedFormulaInf.falsum.liftUI = FirstOrder.Language.BoundedFormulaInf.falsum
- (FirstOrder.Language.BoundedFormulaInf.equal t₁ t₂).liftUI = FirstOrder.Language.BoundedFormulaInf.equal t₁ t₂
- (FirstOrder.Language.BoundedFormulaInf.rel R ts).liftUI = FirstOrder.Language.BoundedFormulaInf.rel R ts
- (φ.imp ψ).liftUI = φ.liftUI.imp ψ.liftUI
- φ.all.liftUI = φ.liftUI.all
- (FirstOrder.Language.BoundedFormulaInf.iSup φs).liftUI = FirstOrder.Language.BoundedFormulaInf.iSup fun (i : ULift.{?u.133, 0} ι) => (φs i.down).liftUI
- (FirstOrder.Language.BoundedFormulaInf.iInf φs).liftUI = FirstOrder.Language.BoundedFormulaInf.iInf fun (i : ULift.{?u.161, 0} ι) => (φs i.down).liftUI
Instances For
Quantifying over the last free variable #
Existentially quantify over the last free variable of an L∞ω formula.
Equations
Instances For
Universally quantify over the last free variable of an L∞ω formula.
Equations
Instances For
Semantics of existsLastVarInf: existentially quantifies over the last variable.
Semantics of forallLastVarInf: universally quantifies over the last variable.
Converts a formula with Fin 0 free variables to a sentence (with Empty free variables).
Since both Fin 0 and Empty are empty types, this is a purely type-theoretic conversion
that does not change the semantics of the formula.
Instances For
toSentenceInf 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.toLinf = FirstOrder.Language.BoundedFormulaInf.falsum
- (FirstOrder.Language.BoundedFormula.equal t₁ t₂).toLinf = FirstOrder.Language.BoundedFormulaInf.equal t₁ t₂
- (FirstOrder.Language.BoundedFormula.rel R ts).toLinf = FirstOrder.Language.BoundedFormulaInf.rel R ts
- (φ.imp ψ).toLinf = φ.toLinf.imp ψ.toLinf
- φ.all.toLinf = φ.toLinf.all
Instances For
Embeds a first-order formula into L∞ω.
Equations
Instances For
Embeds a first-order sentence into L∞ω.