Ordinal-valued depth of Lω₁ω formulas #
The well-founded measure for quantifier recursions over BoundedFormulaω (extracted from
Methods/Henkin/Construction.lean, where it was born as the truthLemma termination measure,
and re-derived privately by Methods/Interpolation/QuotientTruthLemma.lean — this neutral home
serves both). sizeOf is inadequate: sizeOf (φs k) is unbounded while
sizeOf (iSup φs) = 2, and the all case recurses on (φ.openBounds).subst t, not a
structural subterm. depth uses Ordinal.iSup at the countable connectives and is preserved
by castLE, relabel, openBounds, and subst, with strict decrease into every connective.
Ordinal-valued depth for termination of truthLemma #
The standard sizeOf measure is inadequate for truthLemma because:
sizeOf (fun k => φs k) = 1for function types, sosizeOf (iSup φs) = 2, yetsizeOf (φs k)can be arbitrarily large.- The
allcase recurses on(φ.openBounds).subst t, which is not a structural subterm.
We define an Ordinal-valued depth that uses iSup for iSup/iInf cases,
then prove it is preserved by castLE, relabel, openBounds, and subst.
Ordinal-valued depth of a bounded formula. Uses Ordinal.iSup at iSup/iInf nodes
to ensure each component φs k has strictly smaller depth.
Equations
- FirstOrder.Language.BoundedFormulaω.falsum.depth = 0
- (FirstOrder.Language.BoundedFormulaω.equal t₁ t₂).depth = 0
- (FirstOrder.Language.BoundedFormulaω.rel R ts).depth = 0
- (φ.imp ψ).depth = max φ.depth ψ.depth + 1
- φ.all.depth = φ.depth + 1
- (FirstOrder.Language.BoundedFormulaω.iSup φs).depth = (⨆ (k : ℕ), (φs k).depth) + 1
- (FirstOrder.Language.BoundedFormulaω.iInf φs).depth = (⨆ (k : ℕ), (φs k).depth) + 1