Documentation

CslibFrontier.Logics.SecondOrder.Horn.LeastFixedPoint

Existential second-order Horn sentences as least fixed points #

Every SO∃-Horn sentence is equivalent to one FO(LFP) sentence over the same base vocabulary, uniformly over all structures in which two closed terms c₀ and c₁ denote distinct elements.

The construction is the classical simultaneous-induction argument, specialized to Horn programs. The least model of the definite clauses is the least fixed point of their immediate-consequence operator (ESO.Horn.Sentence.leastModel). The finitely many relation variables, of possibly different arities, are packed into a single fixed-point relation. A tuple x for the relation variable i becomes a tagged tuple of width t + a, where t enumerates the relation variables and a bounds their arities: a one-hot tag (c₁ in coordinate i, c₀ elsewhere) followed by x, padded with c₀. Distinctness of c₀ and c₁ makes the tagging injective, and Mathlib's rolling rule for least fixed points (OrderHom.map_lfp_comp) identifies the packed least fixed point with the tagged least model. Goal clauses are then checked outside the fixed-point binder, as allowed by ESO.Horn.Sentence.realize_iff_leastModel.

The translation needs no restriction on the guards: they are carried over as first-order subformulas.

Main results #

References #

Packing several relations into one tagged relation #

Definability of the packed operator #

The equivalent FO(LFP) sentence #

theorem Cslib.Logic.ESO.Horn.Sentence.exists_lfp_realize_iff {L : FirstOrder.Language} {ι : Type t'} {M : ι → Type w} [(m : ι) → L.Structure (M m)] (Φ : Sentence L) (c₀ c₁ : L.Term Empty) (hc : ∀ (m : ι), FirstOrder.Language.Term.realize Empty.elim c₀ ≠ FirstOrder.Language.Term.realize Empty.elim c₁) :
∃ (φ : FO.LFP.Formula L [] Empty), ∀ (m : ι), φ.Realize (fun {k : ℕ} => FO.Operator.RelEnv.empty) Empty.elim ↔ Φ.Realize (M m)

SO∃-Horn sentences are FO(LFP) sentences. For closed terms c₀ and c₁ of the base vocabulary, one checked FO(LFP) sentence is equivalent to Φ on every structure in which c₀ and c₁ denote distinct elements. Two distinct elements are needed for the one-hot tags that pack the relation variables into a single fixed point; on the canonical ordered structures, which have at least two elements, the numeric constants 0 and 1 serve.