First-order logic with least fixed points #
FO(LFP) is an instance of the common first-order operator syntax. An arity-k binder adds one
k-ary relation and k first-order variables to its body. Other free variables are parameters,
fixed throughout the iteration. Terms at the application site are evaluated in the outer scope.
RawFormula includes unchecked syntax; its total interpretation takes the intersection of
pre-fixed relations. For nonpositive bodies this need not be a fixed point. Formula bundles
the decidable well-formedness condition, checking positive recursion at every nested binder.
All fixed-point laws explicitly require positivity, which is proved to imply monotonicity.
Negation outside a fixed-point binder and arbitrary nesting remain available.
Main definitions #
shape,policy,interpretation: the LFP instance of the shared operator interface.RawFormula,Formula,lfp,Formula.lfp: raw and checked FO(LFP) constructors.step,stepHom: the induced relation operator with fixed first-order parameters.
Main results #
step_monotone: syntactic positivity implies semantic monotonicity.realize_lfp: LFP semantics agrees with Mathlib'sOrderHom.lfp.step_lfp,lfp_le: fixed-point and leastness laws.iterate_card_pow_eq_lfp: on a domain of sizen, aritykstabilizes at stagen^k.
References #
- N. Immerman, Descriptive Complexity, Chapter 4.
- N. Immerman, Relational Queries Computable in Polynomial Time, Section 1 (positive nested syntax) and Section 2, Fact 2.1 (the finite-stage bound).
This module implements the logic and finite-stage semantics. The native polynomial-time evaluator
is in CslibFrontier.Computability.Complexity.Classes.P.FirstOrder; the ordered characterization
is in CslibFrontier.Computability.Complexity.ImmermanVardi.
A least fixed point binds a relation and a tuple of the same arity.
Instances For
Least fixed points are monotone in their body and require positive self-reference.
Instances For
FO(LFP) syntax before its recursive positivity conditions have been checked.
Instances For
FO(LFP) syntax with positive recursion at every nested binder.
Instances For
Total raw semantics: intersect all pre-fixed relations. The fixed-point laws below require positive bodies; no fixed-point claim is made for invalid raw syntax.
Instances For
Raw LFP interpretation is monotone in the body transformer, even before checking positivity.
Apply a raw least-fixed-point binder to a tuple of terms.
Instances For
Mark just the newly bound relation, leaving all outer relations fixed.
Instances For
A body is syntactically positive in the relation bound by this LFP.
Instances For
Positivity is a decidable syntactic property.
An LFP is well formed exactly when its body is well formed and positive in its own relation.
Realization of a checked FO(LFP) formula.
Instances For
The relation operator induced by a body, with its outer assignment and relations fixed.
Instances For
Positive recursion induces a monotone relation operator.
Bundle the syntactically certified relation operator as a Mathlib order homomorphism.
Instances For
A positive raw LFP has the standard least-fixed-point semantics. This rewrites syntax to the mathematical fixed point without recursively unfolding its defining equation.
The checked constructor exposes the same fixed-point semantics directly to simplification.
The denotation is a fixed point of the body's actual relation operator.
The denotation is contained in every pre-fixed relation: the useful LFP induction rule.
A k-ary positive operator on a domain of size n reaches its least fixed point after
n^k applications from the empty relation. This includes empty domains and nullary relations.