Expand description
Lyapunov-function synthesis — don’t search for the proof, discover the measure that collapses the problem, and let the proof fall out as a corollary.
This is the thesis of the whole certified-symmetry campaign made into one procedure. A
symmetry-breaking refutation is a Lyapunov function for the search dynamics: a scalar potential
(“active items remaining”) that strictly descends to the goal. Once you have that potential, the
refutation, its correctness, and its O(n²) complexity certificate are all just readings of it
(crate::complexity). So the engine here inverts the usual game:
- Synthesize — search a bounded, polynomial class of candidate potentials. The class is
“covering layouts”: a factorization of the variables into
items × binsunder which swapping two items is a symmetry of the formula. Testing a candidate is cheap (one automorphism check), so the whole search is polynomial — categorically unlike the exponential graph-automorphism detection it replaces. - Collapse — if a potential is found, drive the steered Heule descent with the discovered
item-swap symmetry (
covering_collapse); every step is PR-self-checked, fail-closed. - Fall out — the result is a
RankedRefutationthat certifies both correctness and its own polynomial size.
When no potential in the class works, the answer is an honest, bounded impossibility: “this
formula has no covering-symmetry collapse” — None, never a wrong answer.
Structs§
- Cardinality
Seams - The cardinality / parity symmetry seams. Each recovered cardinality group is fully symmetric — its
members are interchangeable (
S_mpreserves “at mostkof them true”). In a COUPLED instance only some of those swaps survive as MODEL-SET symmetries; the parity coupling blocks the rest. This partitions the candidate interchangeable pairs intojoint(a transposition that preserves the model set — a free symmetry to break) andseams(a transposition the parity genuinely tears). The check is SEMANTIC (parity SPAN + non-parity clauses via [SemanticSymmetry]), so it recognizes the affine parity symmetry a clause-automorphism test misses. The joint swaps generate the model-preserving symmetry at the seam. - Collapsing
Measure - A discovered collapsing potential: the formula’s variables read as an
items × binsgrid (var(i, b) = i*bins + b) under which item-permutations are symmetries — so the formula is a covering / pigeonhole problem anditems > binsmakes it unsatisfiable. - Covering
Measure - A covering Lyapunov measure:
itemsintobins(var(i,b) = i*bins + b) with item-swap witnesses. ONE measure type that instantiates the theorem for every covering family — PHP (items = n, bins = n-1), clique-coloring (items = n, bins = k), and any other generalized pigeonhole. The “lift”: the family is data, the measure is uniform. - Lyapunov
Certificate - A machine-checked certificate that a refutation’s trajectory carries a valid Lyapunov function, with the four dynamical-systems axioms verified explicitly and the resulting complexity bound.
- Partial
Covering Measure - A covering measure restricted to the absolute rounds
[lo, hi]— it breaks only those covering levels, leaving a residual for a later stage. The tool that makes COMPOSITION non-trivial: a stage that genuinely hands a smaller problem to the next. - Symmetry
Theory - A live symmetry theory for
crate::cdcl::Solver::solve_with— DYNAMIC lex-leader propagation over the whole symmetry group. Each element is an AFFINE mapα(a model-set automorphism) given as a per-output specα(x)[i] = ⊕_{s∈xset_i} x_s ⊕ b_i; permutations are the special case where everyxsetis a single variable. During search it enforcesx ≤_lex α(x): walking positions while the prefix stays equal, computingα(x)[i]from the trail (an XOR of the support), then at the frontier forcingx_i = 0whenα(x)[i] = 0, forcing the last free support bit to makeα(x)[i] = 1whenx_i = 1, or conflicting — AUX-FREE, on the shared trail, fused alongside the parity and cardinality theories. Sound: the orbit’s global lex-minimum satisfiesx ≤_lex α(x)for EVERYα, so the whole group’s predicate keeps exactly one representative per orbit (equisatisfiable), and every reason clause (prefix + support witnesses) is implied by it.
Enums§
- Auto
Collapse - The result of the unified engine: which physics collapsed the formula, with its checkable artifact.
Constants§
- MAX_
RECOVERED_ CARDINALITY - The widest core a fused solve recovers automatically: at-most-
kgroups up to thisk. Beyond it, callrecover_at_most_kdirectly — but theC(group, k)scan cost (budget-bounded) and the diminishing yield of ever-wider exclusion cliques make 4 (5-ary clauses) the default ceiling.
Traits§
- Lyapunov
Measure - The hypothesis of the ⟸ theorem: a Lyapunov measure that generates certified descent steps for a formula, independent of any particular family.
Functions§
- affine_
parity_ symmetries - Detect affine (shear) symmetries of a fused instance that preserve the model set — the affine parity
symmetries a variable-permutation break structurally cannot express (an image bit becomes an XOR of two
variables). For a variable
ithat appears in NO non-parity (cardinality / residual) clause and anyj ≠ i, the shearx_i ↦ x_i ⊕ x_jmoves only positioni, so it leaves the cardinality/residual intact; it is a model-set symmetry iff it maps the parity SOLUTION SPACE to itself (checked on the space’s affine spanning set — particular ⊕ each kernel basis vector). Each valid shear is returned as an SBP affine-map spec (identity except outputi = ⊕{i,j}) forcrate::sym_break::affine_lex_leader_sbp. Gated tonum_vars ≤ 64. - all_
transposition_ symmetries - Every single-transposition model-set symmetry — every variable swap that preserves the model set
([
SemanticSymmetry]): parity-variable permutations, cardinality permutations, and residual-clause permutations alike. Broadens the wreath-tower (cardinality-only) symmetry to the FULL permutation symmetry of the whole instance — in particular the permutations of parity-only variables neither the cardinality detector nor the affine shear detector finds. Budget-bounded (n ≤ 64,C(n,2)checks). - auto_
collapse - The unified, structure-recognizing engine. Given only opaque clauses, decide WHICH collapse physics applies — covering symmetry or parity — and produce the corresponding Lyapunov-certified artifact. One engine; the structure selects the mechanism. Sound and fail-closed on both paths.
- cardinality_
collapse - cardinality_
parity_ seams - Compute the
CardinalitySeamsof a fused instance: for every pair of variables interchangeable in some recovered cardinality group, test whether swapping them is a model-set symmetry ([SemanticSymmetry]) — joint if so, a seam if not. Pair-budget-bounded (a partial joint set still yields sound symmetry breaks). - cardinality_
symmetry_ break - Break the joint cardinality/parity symmetry: union the joint swaps into interchangeable components (a
component is fully symmetric — the group generated by its transpositions is
S, every element an automorphism), then order each component’s variables into a descending chain withvᵢ ≥ vᵢ₊₁clauses(vᵢ ∨ ¬vᵢ₊₁). A lex-leader: equisatisfiable (every orbit keeps its ordered representative), so it shrinks the fused search without changing the verdict. Returns the extra clauses (empty if no joint symmetry). - cardinality_
symmetry_ generators - The generators of the joint parity/cardinality symmetry, UP THE WREATH CHAIN. Two levels:
- compose_
collapses - Compose collapses — the
Polywiring diagram on certified descents. Each stage’s descent runs on the residual database of the previous; the potentials are banded (earlier stages occupy the higher rank band) so the composite strictly descends across every stage boundary; the whole closes by resolution. The result is ONE refutation carrying ONE combined Lyapunov certificate — two (or more) collapses wired into a single descent. Fail-closed: each step is PR-self-checked. - covering_
collapse - Drive the steered Heule descent over a discovered
items × binscovering layout:bins + 1items are a tight pigeonhole, so force them out of the bins one at a time, each¬var(i, bin)certified by “swap itemiwith the last active item.” Returns the ranked refutation; every step is PR-self-checked, so a layout that is not really a covering problem simply fails to refute. - cutting_
planes_ lyapunov - The Lyapunov function for the cardinality / cutting-planes collapse — the THIRD physics. The
Cook–Coullard–Turán refutation of PHP sums
2n-1pseudo-Boolean constraints; each addition cancels a literal against its negation and tightens the accumulated constraint toward the infeasible0 ≥ 1. The potential is the number of constraints still to combine, descending to0exactly as the contradiction is exposed. - extract_
xor - Recover the XOR (parity) constraints latent in a CNF: a constraint
x₁⊕…⊕x_k = bis encoded by exactly the2^(k-1)clauses over{x₁,…,x_k}whose negated-literal count has one fixed parity. We group clauses by their variable set and emit anXorEquationfor each group that is exactly such a gadget. Sound: every emitted equation is logically equivalent to a clause group present in the formula, so a refutation of the extracted (sub)system implies the formula is UNSAT. - fused_
parity_ cardinality_ decide - The fused parity + cardinality decision. When a formula carries BOTH a GF(2) linear substructure
(recovered XOR equations via
extract_xor) AND an at-most-one cardinality substructure (viarecover_at_most_one), decide it with the two live theories reasoning TOGETHER on one trail — Gaussian elimination for the parity, cardinality propagation for the counting — the structural attack on minimal-disagreement parity that neither alone cracks. ReturnsSome(is_sat), orNonewhen either substructure is absent (so a caller falls through to other routes). Sound: the original clauses are solved (Boolean-complete), the theories return only formula-entailed clauses, and a SAT model is re-checked against the clauses (fail-closed). Uses the statelesscrate::xor_engine::XorEngine(notIncXor, whose value-blind trail-sync is unsafe without a backing clausal XOR encoding). - fused_
permutation_ generators - The permutation generators for the DYNAMIC symmetry theory: the wreath-tower cardinality permutations plus every transposition symmetry of the whole instance.
- fused_
symmetry_ group - gaussian_
lyapunov - The Lyapunov function for the algebraic collapse — Gaussian elimination over GF(2). The
potential is the number of pivots still to be found in the unsolved linear system; each
elimination step strictly reduces it, and the trajectory reaches the goal exactly when an
inconsistent row
0 = 1is exposed. Returns the descending potential and whether the goal (contradiction) was reached. - lyapunov_
of_ symmetry - Extract and verify the Lyapunov certificate of a symmetry refutation: its rank annotation is the potential (“active items remaining”), and the refutation closing is the goal-reaching axiom.
- proof_
from_ measure - The constructive proof of the ⟸ theorem. Drive the measure’s descent from
Ldown to0, self-checking every step (fail-closed), then close with unit propagation. Returns a ranked refutation whose descent has≤ L·wsteps — read its certificate withcrate::complexity::RankedRefutation::certify. - proof_
induced_ measure - The ⟹ direction of the characterization: any checkable refutation of
n_stepssteps induces a Lyapunov measure — rank the steps in descending order. The induced trajectory is a valid Lyapunov function of sizen_steps, so the minimum measure costμ*(F) ≤ (min proof size). - recover_
at_ most_ k - Recover the at-most-
kcardinality substructure over arbitrary LITERALS — the generalisation ofrecover_at_most_oneto WIDER and MIXED-POLARITY counting cores (the ternary at-most-two cores of parity-learning instances, and — via negation — at-least-k). Work in literal codes (2·var + sign, negation flips the low bit). A width-(k+1)clauseℓ₀ ∨ … ∨ ℓ_kis violated only when all of{¬ℓ₀,…,¬ℓ_k}are true, so it FORBIDS that literal set; a setSof literals (distinct variables) is an at-most-kgroup iff EVERY(k+1)-subset ofSis some clause’s forbidden set. Greedy maximal extension from each forbidden seed — a literal joinsSonly when everyk-subset ofStogether with it is forbidden, so the invariant keeps every(k+1)-subset forbidden andat_most(S, k)genuinely implied by clauses present (sound to fuse). A clause[¬a,¬b,¬c]⇒ at-most-2 of{a,b,c}; the three clauses[a,b],[a,c],[b,c]⇒ at-most-1 of{¬a,¬b,¬c}= at-least-2 of{a,b,c}.k = 1over all-negative binary clauses reproducesrecover_at_most_one. - recover_
at_ most_ one - Recover the at-most-one cardinality substructure from arbitrary clauses — the substructure twin of
[
discover_covering], which requires the WHOLE formula to be a covering (so a single XOR gadget makes it decline). Binary all-negative clauses¬a ∨ ¬bare at-most-one edges; this returns anat_most(group, 1)PB constraint per maximal exclusion clique of size ≥ 2, IGNORING every other clause. Each emitted group is a verified FULL clique (every pair has its exclusion clause present), so its≤ 1is implied by clauses in the formula — sound to feed a solver alongside a recovered parity system (the par32 fusion). - recover_
cardinality_ constraints - The third physics, made automatic: cardinality / cutting-planes collapse of a discovered
covering. When the formula is a bipartite covering with more items than bins, summing the
“item ≥ 1” rows against the “bin ≤ 1” columns telescopes to
0 ≥ (items − bins) > 0— the Cook–Coullard–Turán refutation, in the cutting-planes proof system. Sound: every summed constraint is implied by clauses present in the formula (full-clique-checked), so a contradiction proves UNSAT. Returns(trajectory, reached_goal, constraints)— the GF(2)-analogue Lyapunov descent (constraints remaining to combine). Crucially this needs no symmetry, so it collapses asymmetric coverings the geometric route cannot. Recover the cardinality structure of an opaque CNF as PB constraints — a≥ 1clause per at-least-one row and a≤ 1per at-most-one clique (the cardinality the pairwise encoding loses). The clause-level recognizer (theextract_xoranalogue for counting) that feeds BOTH the staticcardinality_collapsecut and the livecrate::pseudo_boolean::CardinalityTheory.Nonewhen the formula is not a clean covering, so callers fall through. Each returned constraint is implied by clauses present in the formula (the columns are full-clique-checked by [discover_covering]), so feeding them to a solver is sound. - recover_
cardinality_ substructure - Recover the cardinality substructure a fused solve consumes: every at-most-
kgroup over arbitrary literals,k = 1 …MAX_RECOVERED_CARDINALITY— pairwise, ternary, quaternary, … exclusion cliques of any polarity, so at-most-k, at-least-k(the negated cliques), and mixed counting cores all flow into the fused theory. Eachrecover_at_most_kreturns immediately when the formula has no width-(k+1)clause of the right shape, so widening is free on instances that lack those cores. - solve_
by_ measure_ synthesis - The whole inversion: discover the Lyapunov function, then let the proof fall out. Search the
covering-layout class; for each candidate whose item-swap is a symmetry, run the steered collapse;
return the first that yields a checking refutation, paired with the measure that drove it.
Noneis a bounded impossibility — no covering-symmetry collapse exists for this formula. - synthesize_
measure - Search the bounded class of covering layouts for one whose item-swap is a genuine symmetry — a
cheap pre-filter (one automorphism check per candidate factorization). Returns the first such
measure in the
items > bins(unsatisfiable) direction, orNone. - verify_
lyapunov - Verify the four Lyapunov axioms over a potential trajectory and return the certificate, or
Noneif any axiom fails. (1) bounded below —u64is≥ 0by type; (2) monotone non-increasing; (3) strict descent across the level set; (4) reaches the minimum at the goal. A trajectory that stalls (a level recurs) or never closes is not a Lyapunov function and certifies nothing.