Expand description
The affine group AGL(n,2) — the symmetry a permutation break cannot see.
The clause-level symmetry breakers (symmetry_detect, sym_certify) quotient by the hyperoctahedral
group Bₙ of signed variable permutations. Bₙ is exactly the subgroup of AGL(n,2) (affine
bijections x ↦ A x ⊕ b of the cube GF(2)ⁿ) whose linear part A is a permutation matrix. The
census proved the clause breakers are complete for Bₙ — yet AGL(n,2) ⊋ Bₙ, and the gap is the
shears xᵢ ↦ xᵢ ⊕ xⱼ. A shear maps an axis-aligned subcube (a clause) to a non-subcube, so no
amount of clause permutation can reach it. That gap is precisely why parity / Tseitin formulas — affine
invariant, Bₙ-rigid — defeat clause symmetry breaking and need a linear-algebra engine instead.
This module is that engine, at the symmetry level: the AGL(n,2) group itself, an exhaustive
ground-truth detector of a formula’s affine symmetries (so AGL ⊋ Bₙ is measured, not asserted), and
the affine break — recover the formula’s GF(2)-linear substructure, Gauss-eliminate it, and either
refute an inconsistent linear core or inject the forced units / equivalences (the linear consequences no
single clause states) that collapse the residual search.
Structs§
- Affine
- An affine map of the Boolean cube
GF(2)ⁿ:x ↦ A x ⊕ b.matrix[i]is rowiofAas a coefficient bitmask over the lownbits;translationisb. It is a bijection iffA ∈ GL(n,2). - Affine
Canonical - The result of the canonical affine reduction: an equisatisfiable formula over the free generators (the linearly-determined variables eliminated), plus the map to lift a reduced model back to the full space. This is the affine analogue of breaking a permutation orbit down to one representative — here the RREF canonicalizes the affine structure and the determined coordinates fall away.
Enums§
- Affine
Canon - The outcome of the canonical RREF break.
- Affine
Outcome - The outcome of the affine break.
Functions§
- affine_
canonicalize - The affine SBP — the canonical RREF break. Recover the formula’s GF(2)-linear substructure and
take its reduced row-echelon form (via
gf2::solve_gf2, whose kernel basis is the affine translation symmetry). The RREF partitions variables into free generators and determined coordinates: every variable the kernel never moves is forced to a constant, and every set the kernel moves in lockstep is an equivalence class collapsing to one representative. Substituting those determined coordinates out yields an equisatisfiable formula over the free generators alone — the affine symmetry quotiented to a canonical representative, exactly as a permutation lex-leader collapses an orbit. An inconsistent core insteadAffineCanon::Refuteds (certified). Sound: the eliminated relations are GF(2)-entailed by the formula, soAffineCanonical::liftturns any reduced model into a full one. - affine_
reduce - The affine
GF(2)break. Recover the formula’s linear substructure and Gauss-eliminate it (gf2::solve_gf2): an inconsistent coreAffineOutcome::Refuteds outright; otherwise the elimination’sgf2::SolutionSpaceexposes which variables are forced (the kernel never moves them ⇒ a unit) and which are locked together (the kernel moves them in lockstep ⇒ an equivalence), and we return those consequences as new clauses (AffineOutcome::Forced) — the linear inferences the permutation breaker structurally cannot make. - affine_
refutation_ drat - The clausal DRAT certificate for an affine refutation, or
Noneif the formula’s linear core is not inconsistent (ornum_varsexceeds theu64mask, or the resolution expansion overruns its budget). Recovers the XOR system, finds the GF(2) linear dependency that sums to0 = 1(crate::xorsat::solve), and compiles it to RUP resolvent lemmas through thecrate::xor_dratbridge — the same pathRoute::Parityuses, so it isdrat-trim-checkable against the original CNF. - affine_
subspace_ agl_ order - The affine automorphism group order of a
k-dimensional affine subspace ofGF(2)ⁿ— i.e. the number of affine mapsx ↦ Ax ⊕ bfixing the model set of an XOR-defined family whose solution space has dimensionk. In closed form, computable at everynwithout enumeratingAGL(n,2):|GL(k,2)| · |GL(n−k,2)| · 2^{k(n−k)} · 2^k— the block-upper-triangular invertible linear parts (GL(k)on the subspace,GL(n−k)on the quotient,2^{k(n−k)}shears between them) times the2^kin-subspace translations. The scalable affine-symmetry detector for the whole class of linear families:Bₙsees a vanishing fraction of it (see the tests). - affine_
symmetries - The affine symmetry group of a formula, computed exhaustively: every
φ ∈ AGL(n,2)that maps the model set onto itself (φa bijection, soφ(models) = modelsiffφmaps each model to a model). This is theAGL(n,2)analogue ofsymmetry_detect::find_generators(which finds only theBₙpart), and it is exact forn ≤ 4— the instrument that measuresAGL ⊋ Bₙ. - agl_
order |AGL(n,2)| = 2ⁿ · |GL(n,2)|— the2ⁿtranslations times the invertible linear parts.- all_
affine_ bijections - Every affine bijection of
GF(2)ⁿ(each invertible matrix × each translation). Exhaustive — for ground-truth symmetry computation only — so it is capped atn ≤ 4(|AGL(4,2)| = 322 560). - models_
of - The satisfying assignments of a CNF, each packed into the low
num_varsbits of au64. Brute force over2^{num_vars}— smallnonly (the census / symmetry-measurement regime). - recover_
linear_ system - Recover the
GF(2)-linear substructure of a CNF: the XOR equations its clauses encode (units, binary equivalences, and complete wrong-parity bundles), as(coefficient-mask, rhs)rows over the lownum_varsbits.Nonewhen there is no linear structure ornum_varsexceeds theu64mask.