Finite-variable counting logic #
The k-variable counting logic C^k extends FO^k by the counting quantifiers
∃^{≥ m} xᵢ φ, "at least m values of the variable xᵢ satisfy φ" ([CFI92],
Section 3.2). Over a fixed number of variables, counting quantifiers add expressive power: the
sentence ∃^{≥ 3} x₀ ⊤ uses one variable, but no one-variable first-order sentence separates a
three-element set from a two-element one.
Cslib.Logic.FO.FiniteVariable.CountingFormula L k instantiates GenFormula at CountingQuant,
inheriting its derived connectives, quantifier rank, free variables and congruence from
Basic.lean. Truth uses Set.encard, so it is meaningful in infinite structures too:
CountingFormula.atLeast m i φ holds when the set of values of xᵢ satisfying φ has at least
m elements. The existential and universal quantifiers are derived from atLeast 1, and
Formula.toCounting embeds FO^k into C^k preserving truth, quantifier rank and free variables.
Main definitions #
Cslib.Logic.FO.FiniteVariable.CountingQuant: the counting quantifier tags∃^{≥ m}.Cslib.Logic.FO.FiniteVariable.CountingFormula: formulas ofC^kover the relation symbols ofL(GenFormula CountingQuant L k), withCountingFormula.atLeastandCountingFormula.exactly.Cslib.Logic.FO.FiniteVariable.Formula.toCounting: the embedding ofFO^kintoC^k.
Main results #
Cslib.Logic.FO.FiniteVariable.CountingQuant.eval_iff_of_equiv: bijections preserve counting quantifiers.Cslib.Logic.FO.FiniteVariable.CountingFormula.realize_exactly:exactly m i φholds when exactlymvalues ofxᵢsatisfyφ.Cslib.Logic.FO.FiniteVariable.Formula.realize_toCounting,Cslib.Logic.FO.FiniteVariable.Formula.quantifierRank_toCounting,Cslib.Logic.FO.FiniteVariable.Formula.freeVars_toCounting: the embedding preserves truth, quantifier rank and free variables.
References #
- J.-Y. Cai, M. Fürer, N. Immerman, An optimal lower bound on the number of variables for graph identification, Section 3.2.
- N. Immerman, Descriptive Complexity, Section 12.3 (unverified locator).
Counting quantifiers ∃^{≥ m} #
Quantifier tags ∃^{≥ m} of counting logics C^k and C^k_{∞ω}.
- atLeast :: (
- minCount : ℕ
Minimum witness count
m. - )
Instances For
A bijection matching the witnesses of pM and pN preserves every counting quantifier.
C^k: finite-variable counting logic #
Formulas of the k-variable counting logic C^k over the relation symbols of L. The
variables are Fin k, and CountingFormula.atLeast m i φ quantifies the variable i, which may
already be bound or free in an enclosing formula.
The counting quantifier ∃^{≥ m} xᵢ φ: at least m values of xᵢ satisfy φ.
Exactly m values of the variable xᵢ satisfy φ.
On a finite structure, atLeast m i φ holds when at least m values of xᵢ satisfy φ,
counted by Set.ncard.
On a finite structure, exactly m i φ holds when exactly m values of xᵢ satisfy φ,
counted by Set.ncard.
FO^k is a fragment of C^k #
The embedding of FO^k into C^k: the existential quantifier ex i φ becomes
CountingFormula.atLeast 1 i φ.
The embedding preserves truth.
The embedding preserves quantifier rank.
The embedding preserves free variables.