Quantifier rank of first-order formulas #
[UPSTREAM] candidate. mathlib's ModelTheory has formula complexity classes
(IsQF, IsPrenex, IsUniversal) but no quantifier-rank function. qr φ is the
maximal nesting depth of quantifiers in φ — the standard measure indexing
Ehrenfeucht–Fraïssé games and ≡ₙ n-equivalence, the foundation of every
first-order inexpressibility result (e.g. Studies.BarwiseCooper1981's
most ∉ FO, whose ad-hoc numQuant this generalizes).
mathlib has the ∞-rank apparatus (ElementarilyEquivalent, the unbounded
back-and-forth IsExtensionPair); qr is the bottom of the missing finite-rank
layer.
Main definitions #
FirstOrder.Language.BoundedFormula.qr— quantifier rank (max quantifier nesting).
Quantifier rank: the maximal nesting depth of quantifiers in a formula.
Atomic formulas have rank 0, imp takes the max, and all adds one.
Equations
Instances For
Quantifier rank is invariant under relabelling free variables along a bijection
(relabelEquiv acts structurally, only on the terms inside atomic formulas).
An atomic formula has quantifier rank 0.
A quantifier-free formula has quantifier rank 0.