Expand description
The cofactor-DAG lens: symmetry above the instance.
§4 of work/PAPER.md measures symmetry in the instance — automorphisms of the cover (Bₙ, AGL,
shears). The residue (census::residue_map) is rigid to all of them; that rigidity is the wall.
This module lifts the lens one level up, onto the formula’s Shannon cofactor DAG: the DAG
whose nodes are the distinct residual sub-formulas F|ρ under partial assignments ρ, with
edges the Shannon expansion F = x·F|_{x=1} + x̄·F|_{x=0}.
A hard core has exponentially many distinct cofactors — that is exactly what “no small
variable-order decision DAG / exponential resolution width” means, and it is the finite, per-n
incompressibility pole (crate::ait::incompressible_string_exists) one level up. The
hypothesis this module makes executable: those exponentially-many cofactors may fall into
polynomially many equivalence classes under a congruence ~ that is not induced by any
automorphism of the instance. Quotient the DAG by ~ and the exponential object becomes a
polynomial one; when the certificate is ~-invariant the quotient DAG is the refutation,
with class-sharing playing the role of extension variables (the Resolution → ER/SR jump).
The collapse measure, and the certificate — kept deliberately separate:
distinct_width/cofactor_set— the strict distinct-cofactor set under the fixed order0..n(the OBDD width): the honest exponential floor for the residue.quotient_class_count— the number of~-classes among that same fixed set. Because it only quotients a fixed set,quotient_class_count(Raw) = distinct_widthand coarser congruences give monotonically fewer classes:iso ≤ rename ≤ raw = distinctare theorems (not artifacts of a branching order), so they hold on every formula, the residue included. This is the clean measure of “do exponentially-many cofactors fall into polynomially-many classes?”quotient_dag— the certificate realization: the cofactor DAG quotiented by~, every edge carrying the explicitTwist(literal renaming) verified locally bycheck_quotient_dag(zero trust). It is a sound, poly-time-checkable refutation; its node count is a certificate size, reported but never conflated with the collapse measure (the two constructions are size-incomparable — renaming can re-order the branch variable).
The congruence ladder, finest → coarsest: Raw (strict equality) ⊂ Rename (first-appearance
renaming) ⊂ GroupInduced (an instance symmetry group’s orbits — Bₙ, AGL) ⊂ CofactorIso
(full CNF-isomorphism: any variable relabeling and polarity flip, not tied to an instance
automorphism — the strongest decidable rung, the one that sees symmetry above the instance).
Whether a poly-index congruence exists for the residue past this rung — an SR-definable one — is
3-SAT ∈ coNP.
Structs§
- Cofactor
Iso - Merge cofactors that are CNF-isomorphic (any relabeling + polarity flip) — the strongest
decidable rung, the symmetry that need not live in the instance.
capbounds the brute force. - Group
Induced - Merge cofactors lying in the same orbit under an instance-symmetry group (
Bₙ,AGL, …). - Quotient
Dag - The cofactor DAG quotiented by a
Congruence:rootnode index,nodes(one per class), andvisits(the memoized recursion’s work — output-sensitive: linear in the collapse found). - Raw
- Strict equality — no canonicalization at all (the identity twist). The finest rung: it merges
nothing, so
quotient_class_count(Raw) == distinct_widthexactly. - Reduce
Iso - Apply the full sound reduction (
reduce: unit-prop + pure-literal + subsumption to fixpoint), then canonicalize up to CNF-isomorphism — one rung coarser thanUnitPropIso. A collapse-measure congruence (the reduction is structural, RUP/reduction-certified, not a relabeling), forquotient_class_count. The ladder:reduce-iso ≤ unitprop-iso ≤ iso ≤ rename ≤ raw = distinct. - Rename
- First-appearance renaming (trivial group). One rung coarser than
Raw: it merges cofactors that coincide after relabeling variables by order of first appearance. - Structured
Dag - The cofactor DAG cut off at structured leaves: the whole dispatcher, organized as a decision DAG.
Its size is the number of cofactors that must be branched before a specialist (or
⊥) fires —1exactly when the root itself is crushed, growing only where no specialist ever fires (the wall). Reportedstructured/trivialleaf counts show which crushers carried the refutation. - Structured
Reduce Iso - The reduction rung fused with the non-resolution crushers as terminals:
reduceto fixpoint, then if a non-resolution specialist (parity/GF(2), mod-p, exact-cover, algebraic collapse) refutes the reduced cofactor, collapse it to one “crushed” class; otherwise canonicalize up to iso. Coarser thanReduceIso(all non-resolution-crushable reduced cofactors merge into one), sostruct-reduce-iso ≤ reduce-iso. This is the rung that can beat the Chvátal–Szemerédi resolution cap — GF(2)/mod-pare polynomial exactly where resolution is exponential — measured viaquotient_class_count(specialist verdicts certified by their routes; reduce by RUP). - Unit
Prop Iso - Unit-propagate to fixpoint, then canonicalize up to CNF-isomorphism — strictly coarser than
CofactorIso(cofactors that reduce to isomorphic residuals after propagation merge, and all unit-refutable cofactors collapse into one). A collapse-measure congruence only: unit propagation is a structural reduction, not a relabeling, so the returned twist is the iso-twist of the reduced form — valid forquotient_class_count(which uses only the canonical key), not for the twist-certificatequotient_dag(a propagation merge is certified by RUP instead).
Enums§
- Node
- A node of the strict distinct-cofactor DAG.
- QNode
- A node of the quotient DAG. Edges carry the
Twistthat maps the recomputed cofactor onto the stored child representative. - SNode
- A node of the structured-leaf cofactor DAG.
Traits§
- Congruence
- An equivalence relation on cofactors, given by a canonical representative of each class plus the
Twistrealizing the merge. To be a sound certificate substrate it must be a congruence: its twists are literal renamings (bijection + polarity flips), which preserve (un)satisfiability, so isomorphism-invariance of UNSAT makes the local check sound. Two cofactors are~-equivalent iffcanonicalizereturns the same representative.
Functions§
- apply_
twist - Apply a
Twistto a clause set;Noneif a live variable is unmapped. - canon
- Canonicalize a CNF given as packed
Lits. - canon_
raw - Canonicalize a CNF given in raw
(var, polarity)form. - check_
distinct_ dag - Zero-trust local checker for the strict DAG: leaves carry
⊥; every internal node’s two children are exactly its recomputed cofactors. A pass certifies the root UNSAT by structural induction, in time linear in the DAG. - check_
quotient_ dag - Zero-trust checker with twist verification: leaves carry
⊥; each internal node’s recomputed cofactor, pushed through the stored twist, must equal the child EXACTLY. A pass certifies the root UNSAT by structural induction (unsatisfiability is isomorphism-invariant and each twist is a literal renaming), in time linear in the quotient DAG. - check_
structured_ dag - The checker:
⊥leaves carry the empty clause; structured leaves re-fire their specialist (the dispatcher’s route re-checks internally — an idempotent re-verification); internal nodes’ children are exactly their recomputed Shannon cofactors. The internal skeleton is fully zero-trust; the structured leaves are dispatcher-certified (extracting each route’s own witness for end-to-end zero trust is the next hardening). - cofactor
- The Shannon cofactor
F|_{x=b}: drop clauses satisfied byx=b, delete thexliteral from the rest, recanonicalize. An empty clause survives as⊥(the branch is UNSAT on the spot). - cofactor_
set - The strict distinct-cofactor set: every
(depth, cofactor)pair reachable by prefix-restricting the fixed order0..n. Its cardinality isdistinct_width; quotienting it by a congruence can only merge pairs, so everyquotient_class_countis≤ distinct_widthand coarser congruences give monotonically fewer classes — both are theorems about quotients of this one fixed set, and therefore hold on every formula. - distinct_
cofactor_ dag - Build the memoized strict distinct-cofactor DAG over the fixed order
0..n. Identical cofactors at the same depth SHARE a node. ReturnsNoneiff the formula is satisfiable (some fully unfolded branch carries no⊥). The node count is the number of distinct cofactors — the OBDD width — and is the honest exponential floor on the residue (no order keeps it small). - distinct_
width - The distinct-cofactor count — the OBDD width under the fixed order
0..n. Equal toΣ (level widths)and to|cofactor_set|. - group_
canon - The group-canonical form of a clause set: the minimum, over every group element
g, of the name-normalized image — plus the twist realizing it. Two cofactors in the sameG-orbit canonicalize identically, whatever corner of the orbit they sit in. - is_leaf
- A leaf: the clause set contains the empty clause
⊥. - iso_
canon - The full CNF-isomorphism canonical form: the lex-least image over all relabelings of the live
variables and all polarity flips — not tied to any instance automorphism. Above
caplive variables it degrades gracefully to first-appearance normalization (the boundary is reported by callers, never silently exceeded). - level_
widths - The per-level widths of the strict decision DAG:
w[i]= number of distinct residual clause-sets reachable after branching on variables0..i. The distinct-cofactor count isΣ w[i]. - normalize
- Deterministic name-normalization: rename variables by first appearance over the sorted clause list, iterated to a fixpoint of (rename, sort). Returns the normalized set and the renaming.
- quotient_
class_ count - The collapse measure. The number of
~-classes among the strict distinct-cofactor set: canonicalize every(depth, cofactor)under~and count distinct. Because it is a quotient of the fixed setcofactor_set, it satisfies — as theorems, for every formula —quotient_class_count(Raw) = distinct_widthand monotonicity under congruence coarsening (iso ≤ rename ≤ raw). This is the clean instrument for “do exponentially-many cofactors fall into polynomially-many classes?”, with no dependence on any branching order. - quotient_
dag - Build the cofactor DAG quotiented by
cong: memoize on the canonical form, branch on the first live variable of the (canonicalized) subproblem, and merge~-equivalent cofactors, recording the realizing twist on each edge. ReturnsNoneiff the formula is satisfiable. - quotient_
width - The quotient width
W(F, ~)—Noneiff satisfiable. - reduce
- A sound poly reduction to fixpoint: unit propagation, then pure-literal elimination, then
subsumption, iterated. Each step preserves (un)satisfiability and commutes with relabeling, so
reduce(π(F)) = π(reduce(F))— which makesReduceIsoa legitimate coarsening ofUnitPropIso. - structured_
leaf - A cofactor is a structured leaf if a decidable specialist refutes it — the full dispatcher
(
crate::solve::solve_structured) returns UNSAT via a route that is not raw CDCL or the certified-no-shortcutIncompressibleverdict. So GF(2)/parity (Tseitin), mod-p(mod-pTseitin), counting (pigeonhole/exact-cover), 2-SAT, Horn — every nut the paper already cracks — is a leaf here, certified internally by the route it fired. Returns that route, orNoneif no specialist crushes the cofactor (it must be branched, or it is⊥/satisfiable). - structured_
leaf_ dag - Build the structured-leaf cofactor DAG over the fixed order
0..n: a node is a leaf when it is⊥or when a specialist crushes it (structured_leaf); otherwise it branches. Identical cofactors at the same depth share a node.Noneiff the formula is satisfiable. - unit_
propagate - Unit-propagate a clause set to fixpoint: repeatedly assign a unit clause’s literal (drop satisfied
clauses, delete the falsified literal), stopping at a derived
⊥or when no unit remains. A sound structural reduction (RUP-certified), monotone under relabeling.
Type Aliases§
- Canon
Clauses - A canonicalized CNF: clauses of
(var, polarity)literals, each clause sorted+deduped, the clause list sorted+deduped. The node currency of every cofactor DAG here. - Twist
- An explicit literal renaming
var → (var′, flip), stored on a quotient-DAG edge and verified by the checker: it witnesses that a recomputed cofactor is~-equivalent to its stored child.