Expand description
Nullstellensatz over any prime field GF(p) and over GF(4) — the characteristic axis of the
algebraic proof system that crate::polycalc fixes at GF(2).
Each characteristic is a genuinely different proof system: the mod-p counting principles fall to
degree 1 over GF(p) yet carry growing degree over GF(q) for every other prime q — the pairwise
incomparability that makes “which field?” a real dial, not a convention. Extension fields, by
contrast, add nothing: a certificate over GF(pᵏ) projects coefficient-wise through any GF(p)-linear
functional fixing 1, so NS degree depends only on the characteristic (the GF(4) engine here exists
to prove that collapse, constructively). The GF(2) engine stays as the specialized fast path — its
coefficient-free bitset representation packs 64 basis columns per word — and this general engine is
pinned to it by a p = 2 differential test.
Everything crate::polycalc certifies has its analogue here, now with explicit coefficients:
signed clause false-indicators (1 − x, which characteristic 2 silently conflates with 1 + x),
the field-generic partition of unity ((1 − x) + x = 1 holds in every field, so constructive
completeness is not a GF(2) artifact), degree-d refutation decisions, and dual-witness degree
lower bounds with zero-trust re-checking.
Re-exports§
pub use crate::polycalc::Mono;
Structs§
- NsCertificate
Gfp - A constructive Nullstellensatz certificate over
f: one coefficient polynomialg_Cper input clause withΣ_C p_C · g_C = 1in the multilinear ring overf— the coefficient-explicit generalization ofcrate::polycalc::NsCertificate.
Enums§
- NsField
- The coefficient field of the general engine. Elements are
u64-encoded:Prime(p)uses the residues0..p;Gf4uses 2-bit pairsa + b·ωin the basis{1, ω}withω² = ω + 1(valuea | b<<1).
Functions§
- build_
ns_ certificate_ gfp - The uniform completeness construction over
f— the partition-of-unity charging ofcrate::polycalc::build_ns_certificate, field-generic because its every ingredient is: the signed point indicators sum to1in any field (partition_of_unity_gfp), andp_C · δ_a = δ_awheneverp_C(a) = 1(multilinear representations on the cube are unique over any field). Returns a constructiveNsCertificateGfpproving UNSAT or a satisfying assignment proving SAT. Bounded tonum_vars ≤ 20(the explicit-corner construction). - check_
ns_ lower_ bound_ gfp check_ns_lower_bound_polys_gfpfor a CNF. An empty clause admits no lower bound at any degree.- check_
ns_ lower_ bound_ polys_ gfp - Re-check a
ns_lower_bound_witness_polys_gfpcertificate (zero trust in the producer):L(1) = 1and⟨L, m·g⟩ = 0overffor every admitted generator product.true⟹ the system genuinely has no degree-dNullstellensatz refutation overf. Degree-bounded enumeration —num_vars ≤ 63. - clause_
polynomial_ gfp - The clause polynomial over
f— the signed false-indicator: a positive literalxcontributes1 − x(overGF(3):1 + 2x, not1 + x— overGF(2)the two coincide, which is exactly the sign the general engine must make explicit), a negative literal¬xcontributesx. The product is1exactly on the clause’s falsifying corners and0elsewhere, over every field. - exactly_
one_ linear_ generators_ gfp - The linear encoding of exactly-one constraints over
f: for each groupGthe degree-1 generator(Σ_{v∈G} x_v) − 1plus the pairwise productsx_u·x_v, deduplicated — the signed generalization ofcrate::polycalc::exactly_one_linear_generators(overGF(2)the two coincide, since−1 = 1). This is the encoding the modular-counting degree bounds are stated against; overGF(p)the point generators telescope —Σ_i P_i = −nwhen every edge meets exactlyppoints — so a counting family withp ∤ ncollapses at degree 1 over its own characteristic. - gfp_
poly_ degree - The degree of a multilinear polynomial: its largest monomial’s popcount (0 for the zero polynomial).
- gfp_
solve - Solve a linear system
Σ aᵢ·x_{vᵢ} = rhsoverfby incremental-echelon Gaussian elimination with modular-inverse pivot normalization. Each equation is a sparse coefficient vector overnvarsunknowns plus its right-hand side. Returns a solution (free variables 0) orNoneon inconsistency. The field-general sibling of theGF(2)engine’s bit-packedgf2_solve: rows join an echelon basis one at a time (memory staysO(rank · nvars)however many equations stream through), each stored row is pivot-normalized with every entry strictly below its pivot column, so back-substitution in increasing pivot order reads a solution off directly. - ns_
certificate_ at_ degree_ gfp - A degree-
dcertificate EXTRACTION overf: wherens_refutes_polys_gfponly decides span membership, this runs the same incremental echelon with provenance — each basis row remembers the combination of original generator products it is — and reads the certificateg_C = Σ λ_{C,m}·moff the target’s reduction, exactly the technique ofcrate::modp::solve’s refutation combinations. ReturnsNonewhen no degree-drefutation exists. The extracted certificate is what theGF(4) → GF(2)projection (project_gf4_certificate_to_gf2) operates on. Provenance rows costO(rank · products)memory — meant for the small-census scale, not the witness frontier. - ns_
lower_ bound_ witness_ gfp ns_lower_bound_witness_polys_gfpfor a CNF (signed clause false-indicators as generators). An empty clause is an immediate refutation — no lower bound at any degree.- ns_
lower_ bound_ witness_ on_ basis_ gfp ns_lower_bound_witness_polys_gfprestricted to a sub-basis: the functionalLis sought only on monomials passingin_basis(L = 0elsewhere), while the constraints⟨L, m·g⟩ = 0still range over all admitted generator products — so anySomeis a fully valid,check_ns_lower_bound_polys_gfp-verifiable witness, andNonemeans only “no witness on this sub-basis”. The structure probe of theGF(2)engine, carried to every characteristic: which candidate supports hold a family’s lower bound, field by field. Degree-bounded enumeration —num_vars ≤ 63.- ns_
lower_ bound_ witness_ polys_ gfp - A degree-
dpseudo-expectation overffor an arbitrary generator system: a functionalLon the degree-≤ dmonomials withL(1) = 1andL(m·g) = 0for every admitted generator product, returned as its nonzero values(monomial, value).Some(L)certifiesNS-degree > doverf(re-checkable bycheck_ns_lower_bound_polys_gfp, zero trust in the solver);Nonemeans a degree-drefutation exists — the exact witness↔refutation duality of theGF(2)engine, at every characteristic. Degree-bounded enumeration —num_vars ≤ 63. - ns_
refutes_ gfp ns_refutes_polys_gfpfor a CNF: the generators are the signed clause false-indicators. An empty clause is1 = 0outright.- ns_
refutes_ polys_ gfp - Does a degree-
dNullstellensatz refutation overfexist for an arbitrary polynomial generator system — is1in thef-span of{ m·g : deg(m·g) ≤ d }? The general-field sibling ofcrate::polycalc::ns_refutes_polys, answered by incremental-echelon span membership (memoryO(rank · basis)however many generator products stream through). Degree-bounded enumeration —num_vars ≤ 63. - partition_
of_ unity_ gfp - The partition of unity
Σ_{a ∈ {0,1}ⁿ} δ_aoverf, by direct summation — the constant1at everynover every field (pou_atom_gfpis the closed-form reason). - pou_
atom_ gfp - The partition-of-unity atom on variable
v:(1 − x_v) + x_v, the constant1in every field — the identity is characteristic-free, so the completeness construction it powers is not aGF(2)artifact. - project_
gf4_ certificate_ to_ gf2 - The
GF(4) → GF(2)coefficient projection — the constructive half of the extension-field collapse.λ : a + b·ω ↦ ais theGF(2)-linear functional fixing1; because every clause polynomial has prime-subfield (0/1) coefficients, applyingλcoefficient-wise to aGF(4)certificate identityΣ_C p_C · g_C = 1commutes with the clause factors and lands on aGF(2)certificate of no larger degree. So nothing proved overGF(4)needed the extension: NS degree depends only on the characteristic. ReturnsNoneunless the certificate is overGf4. - reynolds_
gfp - The Reynolds operator
L ↦ |G|⁻¹ · Σ_{g∈G} g·Loverf— the characteristic-0 averaging trick, available exactly when|G|is invertible, i.e.gcd(|G|, char) = 1. ReturnsNonewhenchar | |G|(the annihilation branch: the group-sum killsL(1)and no normalization can restore it), and the averaged functional otherwise. Averaging a valid pseudo-expectation of aG-invariant generator system yields a valid,G-invariant one — the branch theGF(2)engine can never take on an even group. Pass the full closed group. - symmetrize_
gfp - The unnormalized group-sum symmetrization
Σ_{g∈G} g·Lof a functional overf— coefficients genuinely ADD, where theGF(2)engine could only toggle. On the constant monomial it evaluates to|G| · L(1), which is the whole dichotomy: zero (annihilation) iffchar | |G|. Pass the full closed group, not a generating set.
Type Aliases§
- GfpPoly
- A multilinear polynomial over an
NsField: monomial → nonzero coefficient (absent = 0). The coefficient-explicit generalization ofcrate::polycalc::Poly, whoseGF(2)monomial-set form is the special case “every present coefficient is 1”.