Expand description
Satisfiability from sparsity — the Lovász Local Lemma certificate and its constructive Moser–Tardos witness. The lower bookend to the first-moment bound.
The first-moment bound (crate::families::ksat_threshold_first_moment_upper) says: above a clause
density the expected number of solutions vanishes, so the formula is UNSAT with high probability. This
module is the opposite side: a formula that is locally sparse — every clause shares variables with
few others — is satisfiable, and the witness can be constructed.
Symmetric LLL: a uniform random assignment violates a width-w clause with probability 2⁻ʷ. If each
clause shares a variable with at most d others and e · p · (d+1) ≤ 1 (where p = 2^{−w_min} is the
worst-case violation probability), then some assignment satisfies all clauses. This is:
- sound — the LLL theorem (and we fuzz it against brute force: a certificate never lies);
- re-checkable — recompute
w_minandd; - constructive — Moser–Tardos resampling reaches a model in expected
O(m)steps under the condition, so the certificate is also a witness recipe.
Structs§
- LllSat
Cert - A re-checkable SAT certificate from the Lovász Local Lemma: the minimum clause width
w_minand the maximum dependency degreedthat together satisfye · 2^{−w_min} · (d+1) ≤ 1.
Functions§
- lll_
certifies_ sat - Certify satisfiability from sparsity via the symmetric LLL. Returns the witnessing degrees when
e · 2^{−w_min} · (d+1) ≤ 1; otherwiseNone(the condition is sufficient, not necessary —Nonemeans “this certificate does not apply”, never “UNSAT”). An empty clause set is vacuously SAT; a set containing an empty clause can never be certified (it is UNSAT). - lll_
dependency_ degree - The LLL dependency degree: the maximum, over all clauses, of the number of other clauses that share at least one variable with it. Clauses over disjoint variable sets are independent events and do not count toward the degree.
- moser_
tardos_ witness - Constructively find a satisfying assignment by Moser–Tardos resampling: start from a random
assignment and, while some clause is violated, resample the variables of one violated clause. Under
the LLL condition this terminates in expected
O(m)resamples; themax_resamplescap is a safety net (only reachable when the condition does not hold). Returns a model, orNoneif the cap is hit.