Expand description
Linear algebra over ℤ/m for composite m, by the Chinese Remainder Theorem — the
multiplicative symmetry break. A system Σ aᵢ·xᵢ ≡ c (mod m) over a squarefree modulus
m = p₁·…·p_t factors, through the ring isomorphism ℤ/m ≅ GF(p₁) × … × GF(p_t), into one
independent system over each prime field — each decided by crate::modp::solve — and the
per-field solutions are recombined by CRT. The factorization of the modulus is the symmetry that
splits the problem; the prime fields are the irreducible pieces:
- consistent mod
m⟺ consistent over every prime factorpᵢ, and the recombined residues give an assignment overℤ/mthat re-checks (satisfies); - inconsistent mod
m⟺ some prime factor’s system is inconsistent, and that prime together with its GF(p) refutation combination is the re-checkable witness (crate::modp::is_refutation).
This is crate::modp (the prime-field cut, itself the prime generalization of the GF(2) parity
cut) carried up onto the composites by multiplication. Prime-power moduli p^k need the residue
ring ℤ/p^k (a different object — p is a zero divisor), a separate rung; this module is exact
and complete for squarefree m.
Structs§
- Solution
SpaceM - The complete solution space of a
ℤ/pᵏlinear system, in symmetry-broken form: a particular solution plus a generating set of the kernel submodule (each generator is a column of the Smith transformVscaled by its pivot’s freedomq/gcd(dₜ,q)). The prime-power analogue ofcrate::modp::SolutionSpacePover a local ring — and the substrate of the scalable forced/linked break: a variable the kernel never moves is forced.
Enums§
- Allowed
Outcome - The per-variable allowed-value congruence of a
ℤ/msystem, for any compositem. By CRT over the prime-power components, each variable’s solution-projection is a cosetx_g ≡ residue (mod modulus)— the tightest congruence the system forces on it. Generalizes forcing:modulus = mis a single value (fully forced),1 < modulus < mis partial (confined to a value-subset),modulus = 1is free. Within each prime-power component the coset modulus isgcd(p^k, kernel column at g)fromsolve_space_prime_power; the components recombine by CRT.Inconsistentif any component is. - ForcedM
- The forced-value structure of a
ℤ/msystem over a squarefreem. - Modm
Outcome - The outcome of deciding a linear system over
ℤ/m. - Prime
Power Space - The outcome of
solve_space_prime_power.
Functions§
- allowed_
residues - See
AllowedOutcome.Noneonly on Smith overflow. - cycle_
system - The scalable composite obstruction: the
n-cycle of differencesxᵢ − x_{i+1} ≡ 1 (mod m), inconsistent exactly whenm ∤ n(summing telescopes the left to0, the right ton). The coefficient−1is writtenm − 1. Reusescrate::modp::cycle_system’s shape across the field. - forced_
values_ prime_ power - Which variables a
ℤ/msystem forces, for any compositem— by CRT over its prime-power components (ℤ/m ≅ ∏ ℤ/pᵢ^{kᵢ}), each solved scalably by Smith normal form (solve_space_prime_power): a variable is forced modmiff its kernel never moves it in every component, and the value is the CRT of the residues. This is the Smith-form generalization that replaces the old bounded brute force — no size cap;Noneonly on Smith overflow.Inconsistentwhen any component is. - forced_
values_ squarefree - Which variables a squarefree
ℤ/msystem forces to a single value, by CRT of theGF(pᵢ)solution spaces (ℤ/m ≅ ∏ GF(pᵢ)): a variable is forced modmiff it is forced mod every prime factor (crate::modp::solve_space— its kernel never moves it), and the value is the CRT of those residues.Noneifmis not squarefree (the prime-power case needs Smith normal form, not handled here). This is the substrate of the composite affine SAT-side break. - is_
refutation - Re-check a refutation over
ℤ/modulus: the chosen combination of equations has every variable coefficient≡ 0and a nonzero right-hand side modmodulus— a solver-free certificate that the system is inconsistent over that quotient ring (and hence over anyℤ/mwithmodulus | m). - prime_
power_ factorize - The prime-power factorization of
m(m = ∏ pᵢ^{kᵢ}), orNoneifm < 2. - satisfies
- Re-check a satisfying assignment over
ℤ/m: every congruence holds modm. - solve
- Decide a linear system over
ℤ/mfor anym ≥ 2, closing every composite modulus. By CRT,ℤ/m ≅ ∏ ℤ/pᵢ^{kᵢ}: solve each prime-power component (solve_prime_power) and recombine the residues. Consistent modm⟺ consistent over every prime-power factor; the first inconsistent factor is the witness (and certifies UNSAT modm, since that factor dividesm). ReturnsNoneonly ifm < 2, or a component is too large / overflows the integer Smith reduction. - solve_
prime_ power - Decide a linear system over the residue ring
ℤ/pᵏ. Fork = 1this is the prime field, handed to the provencrate::modp::solve. Fork ≥ 2the ring has zero divisors, so we diagonalize over the integers —U·A·V = DwithU, Vunimodular (Smith-style: gcd row/column reduction) — after which eachdₜ·yₜ ≡ (U·b)ₜ (mod pᵏ)is an independent 1-D congruence, solvable iffgcd(dₜ, pᵏ) ∣ (U·b)ₜ.Uyields both the satisfying assignment (x = V·y) and, on failure, the re-checkable refutation (a row ofU, scaled to annihilate the coefficients modpᵏ). ReturnsNoneonly if the integer entries would exceed [GROWTH_CAP]. - solve_
space_ prime_ power - Solve a
ℤ/pᵏsystem for its full solution space via Smith normal formU·A·V = D— the scalable analogue ofcrate::modp::solve_spaceover a prime-power ring (wherepis a zero-divisor, so field Gaussian fails). Returns the particular solution plus the kernel generators (so a variable the kernel never moves is forced), orInconsistent.Noneonly when the integer Smith reduction overflows [GROWTH_CAP].k = 1delegates to the prime-field solver. - solve_
squarefree - Decide a linear system over
ℤ/mfor squarefreem, via CRT over the prime fields. ReturnsNoneonly whenmis not squarefree (the prime-power ring is a separate rung). The first prime factor whose system is inconsistent is reported as the witness — by CRT, the whole composite system is then inconsistent. - squarefree_
primes - The distinct prime factors of
m, in increasing order — orNoneifm < 2ormis not squarefree (somep² | m). Squarefreeness is exactly the condition under whichℤ/mis a product of fields, so the CRT-over-prime-fields decision procedure below is complete.