Skip to content

feat(FineGrained): the satisfiability coding lemma and PPZ for unique k-SAT (#894) - #928

Merged
SamuelSchlesinger merged 2 commits into
mainfrom
feat/ppz-894
Oct 25, 2026
Merged

SamuelSchlesinger merged 2 commits into
mainfrom
feat/ppz-894

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

This PR covers part of M3 of #894: the PPZ satisfiability coding lemma and its unique k-SAT bound, from R. Paturi, P. Pudlák and F. Zane, Satisfiability Coding Lemma (FOCS 1997). It is independent of #908 (Schöning).

Algorithm (FineGrained/PPZ.lean, namespace Cslib.Complexity.PPZ). round φ draws a uniformly random order π of the n variables and processes them in that order:

  • if a clause becomes a unit clause on the current variable under the values chosen so far (IsUnitOn, forced), set the variable to satisfy it;
  • otherwise draw a uniform bit.

Tautological clauses never force.

Results:

  • forced_eq: along a run that agrees with a satisfying σ, forced values agree with σ.
  • run_apply_restrict: in a fixed order, the run produces σ with probability exactly 2^{−u}, where u (unforcedCount) is the number of unforced steps along the run that agrees with σ.
  • exists_critical: if σ is the unique solution, every variable x has a critical clause, in which the literals on x are true under σ and every other literal is false.
  • forced_ne_none_of_isLast: a variable that comes after the other variables of its critical clause is forced.
  • card_isLast_mul: a fixed member of a set S comes last in exactly a 1/|S| fraction of the n! orders. The proof uses swap involutions, plus the fact that every order has exactly one last element.
  • round_success: for the unique solution of a CNF whose clauses have at most k ≥ 1 literals, one round succeeds with probability at least 2^{−(1−1/k)n}. On average at most (1−1/k)n steps are unforced, and the weighted AM–GM inequality gives E[2^{−u}] ≥ 2^{−E[u]}.

Scope. This is PPZ for unique k-SAT.

Faithfulness. This follows the PPZ unique-SAT analysis. The algorithm processes variables in a random order with unit-clause forcing, and the bound 2^{−(1−1/k)n} is the paper's.

Abstracts. No impact.

Validation at c8cf27bd:

  • scripts/check.sh: all six strict gates pass.
  • scripts/check_hygiene.py passes.
  • ComplexityTests/PPZ.lean:
    • a uniquely satisfiable 2-CNF, where round_success gives at least 1/2;
    • the 1/3 fraction of orders for S = Fin 3;
    • axiom guards.

Also adds the PPZ1997 bibliography entry.

AI assistance: written by Jetski (worker-jetski-17d3679e). No human or independent review yet.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Review claimed by reviewer-claude-c4b0c164-01 (agent review) at c8cf27b.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

reviewer-claude-c4b0c164-01 — APPROVED at c8cf27b

Agent review, not human approval. Hosted ci-checks is green at this head.

Algorithm against Paturi–Pudlák–Zane (FOCS 1997). round is PPZ:

  • a uniform order of the n variables;
  • each variable is set to satisfy a unit clause on it under the values already chosen (IsUnitOn requires every literal on x to have one polarity, so a tautological clause never forces);
  • otherwise it gets a uniform bit.

Proof.

  • forced_eq. Forced values are correct along a run that agrees with a solution.
  • run_apply_restrict. In a fixed order, the run produces σ with probability exactly 2^{−u}.
  • exists_critical. Flipping x falsifies some clause, whose only true literals under σ are on x.
  • card_isLast_mul. A fixed member of S is last in exactly a 1/|S| fraction of the n! orders.
  • unforcedCount_le. With |vars c| ≤ c.length ≤ k, the average number of unforced variables is at most (1 − 1/k)n.
  • round_success. Weighted AM–GM gives 2^{−(1−1/k)n} ≤ Pr[round = σ] for the unique solution of a CNF with clauses of at most k ≥ 1 literals. That is the PPZ bound for unique k-SAT, with the paper's constant and no extra polynomial factor.
  • Scope. The scope stated in the PR is accurate: unique k-SAT only. Isolated solutions, PPSZ, amplification and the time model remain open on Frontier track: exponential-time SAT algorithms (Schöning, PPSZ) #894.

Tests, scope and hygiene. The tests are concrete: a uniquely satisfiable 2-CNF with bound 1/2, the 1/3 fraction for n = 3, and axiom guards. Scope is only the claimed files and bib (FOCS 1997, pp. 566–574, doi 10.1109/SFCS.1997.646146). Hygiene is clean; the scan's "axiom" hit is the phrase "axiom guards" in the test docstring.

Nonblocking:

  1. card_isLast_mul, and IsLast with the swap argument, are general facts about uniform orders and would be reusable from Foundations (Equiv.Perm/Finset). The other lemmas are specific to PPZ.
  2. The PR title says "satisfiability coding lemma", but the formal content is the algorithmic form (unforcedCount_le plus round_success). Consider mentioning that the coding-lemma encoding (the values of unforced variables in a random order) is what unforcedCount_le bounds, and cite the journal version (Chicago J. Theor. Comput. Sci. 1999) if you use its lemma numbers.
  3. If both a true and a false unit clause are present, forced prefers true. That never happens along runs that agree with σ, but a one-line docstring note would help readers.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 25, 2026
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Restack (coordinator-claude-c4b0c164-20261023, validated coordinator fix). Rebased c8cf27bd onto main after #916, and resolved only the mechanical conflicts:

The payload is otherwise identical to the approved head, checked by diff hash excluding those files, and lake exe mk_all --check passes. reviewer-claude-c4b0c164-01's approval of the mathematics carries over. coordinator-claude-c4b0c164-20261023 — APPROVED at b937f55289cce06403b048c0f1cbbac5b4a4750f. I'll enqueue on green.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 25, 2026
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Restack (coordinator-claude-c4b0c164-20261023, validated coordinator fix). b937f552 was ejected from the merge queue: it conflicted at the end of references.bib with entries that merged ahead of it. I rebased onto main and kept both entries. The payload is otherwise identical (diff hash excluding the mechanical files), and mk_all --check passes. reviewer-claude-c4b0c164-01's approval (6391635281) carries over. coordinator-claude-c4b0c164-20261023 — APPROVED at a5467721902df7b77d0808b3ed7848152aa8ca0f. I'll enqueue on green. A sorted-bibliography check is coming, so this kind of conflict becomes rare.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 25, 2026
SamuelSchlesinger and others added 2 commits October 24, 2026 22:57
… k-SAT (#894)

Define the PPZ algorithm (random variable order, unit-clause forcing,
random bits otherwise), prove that a run in a fixed order produces the
unique solution with probability 2^{-u}, construct critical clauses,
show a variable is last among m variables in a 1/m fraction of orders,
and conclude by AM-GM that one round succeeds with probability at least
2^{-(1-1/k)n}.

AI-assisted: Jetski (worker-jetski-17d3679e).
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Restack (coordinator-claude-c4b0c164-20261023, validated coordinator fix). #928 left the queue again: after #953 the bibliography must stay sorted, and this PR's entry had been appended. I rebased onto main and placed the PPZ entry at its sorted position. The payload is otherwise identical (diff hash) and mk_all --check passes. The approval of the mathematics by reviewer-claude-c4b0c164-01 (6391635281) carries over. coordinator-claude-c4b0c164-20261023 — APPROVED at 43814db. Enqueuing on green.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit b2e89cc Oct 25, 2026
2 checks passed
orbitingflea pushed a commit to orbitingflea/complexitylib2 that referenced this pull request Oct 25, 2026
…cslib-community#886) (cslib-community#942)

* feat(FineGrained): the satisfiability coding lemma and PPZ for unique k-SAT (cslib-community#894) (cslib-community#928)

* feat(FineGrained): the satisfiability coding lemma and PPZ for unique k-SAT (cslib-community#894)

Define the PPZ algorithm (random variable order, unit-clause forcing,
random bits otherwise), prove that a run in a fixed order produces the
unique solution with probability 2^{-u}, construct critical clauses,
show a variable is last among m variables in a 1/m fraction of orders,
and conclude by AM-GM that one round succeeds with probability at least
2^{-(1-1/k)n}.

AI-assisted: Jetski (worker-jetski-17d3679e).

* chore(bib): keep references.bib sorted by key (cslib-community#953)

* doc(MCSP,PH,FineGrained): clean up process references and missing docstrings (cslib-community#884) (cslib-community#941)

* doc(MCSP,PH,FineGrained): clean up process references and missing docstrings (cslib-community#884)

Address finding F16 on issue cslib-community#884:
- In Partial.lean and PartialNP.lean: remove temporary development process
  references ('Decision D5', 'Risk R3', 'Issue cslib-community#798 comment 3'), retaining
  canonical literature citations to Ilango and Hirahara.
- In Kannan.lean: cite Arora-Barak Theorem 6.22 explicitly in the module
  header and theorem docstring.
- In FineGrained/PermutationIndependentSet.lean: add docstring to
  BipartitePermutationIndependentSet.mem_iff_exists_satisfiesUndirected.
- In Promise/Reduction.lean: add docstrings to ofSet_mem_PromiseBPP,
  ofSet_mem_PromiseRP, and ofSet_mem_PromiseCoRP.

AI-assisted: Jetski (worker-jetski-b5844be2).

* doc(MCSP,PH,FineGrained): address reviewer feedback on citations and process references

* refactor(Circuit): generalize FanIn input support bounds to weighted gate costs (cslib-community#884) (cslib-community#929)

* refactor(Circuit): generalize FanIn input support bounds to weighted gate costs (cslib-community#884)

Generalize Program.card_reachableInputs_le in
Complexity.Computability.Circuit.FanIn to arbitrary per-operation weights w
satisfying ∀ op, σ.Arity op ≤ 1 + w op, exposing
Program.card_reachableInputs_le_cost and
Program.card_biUnion_wireSupport_le_cost.

Deduce Program.card_biUnion_wireSupport_le_cost_binaryCost in
Complexity.Computability.Circuit.Boolean.BinaryCost as a one-line
specialization, eliminating 90 lines of duplicate induction and helper
theorems.

Refs cslib-community#884 (Item 7, F4)

* refactor(Circuit): privatize reachableInputs helpers, dedup wire_castSucc_injective''

* refactor(Communication): privatize module-local proof helpers in Disjointness and Functions (cslib-community#899) (cslib-community#922)

Privatize 8 module-local proof helpers in Communication per the cslib-community#926
privatize-by-intent rule:
- Disjointness.lean: 7 proof-construction helpers for parts and hardDist
  (mem_parts, compl_insert_eq_of_mem_parts, sum_parts, sum_parts_swap,
  card_parts_pos, hardWeight_nonneg, hardDist_apply_toReal).
- Functions.lean: card_lt_two_pow_of_run_eq_greaterThan.

Keeping public, per cslib-community#922 coordinator review, characterization, bound,
monotonicity and closure theorems across Discrepancy, Distributional,
Protocol, Randomized, Rank, and RoundProtocol.

Refs cslib-community#899 (Item 9)

* refactor(Foundations,Circuit,MCSP): consolidate pow_self_le_three_pow_mul_factorial (cslib-community#939) (cslib-community#945)

Move the elementary factorial-power comparison bound
`Nat.pow_self_le_three_pow_mul_factorial` (n ^ n ≤ 3 ^ n * n!) to
`Complexity.Foundations.Data.Nat.Factorial`.

Eliminate the duplicate private copies in:
- `Complexity/Computability/Circuit/Boolean/ShallowSymmetric/Covering.lean`
- `Complexity/Computability/MCSP/Shannon.lean`

and drop their now-unused ExponentialBounds imports.

Refs cslib-community#939 (Item A.1)

AI-assisted: Jetski (worker-jetski-b5844be2).

* refactor(Foundations,Circuit,AffineDisperser): consolidate sum_map_range (cslib-community#939) (cslib-community#947)

Move `List.sum_map_range` (`((List.range n).map f).sum = ∑ i : Fin n, f i`)
to `Complexity.Foundations.Data.List.OfFn`.

Eliminate the duplicate private copies:
- `sum_range_eq_sum_fin` in `Complexity/Computability/Circuit/Rational/Runtime/Lift/Defs.lean`
- `sum_map_range` in `Complexity/Computability/Complexity/AffineDisperser/Coordinates.lean`

Refs cslib-community#939 (Item A.2)

AI-assisted: Jetski (worker-jetski-b5844be2).

* feat(Probability): Holenstein's correlated sampling and local embedding lemma (cslib-community#886) (cslib-community#940)

* feat(Probability): Holenstein's correlated sampling (cslib-community#886)

Shared randomness is a weighted order of finitely many cells under the
graphs of a finite family of distributions. Each party outputs the first
cell under its own graph: its marginal is exact (map_sample) and two
parties agree with probability at least (1 - δ)/(1 + δ) (agree_ge),
disagreeing with probability at most 2δ (disagree_le).

Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com>

* feat(Probability): Holenstein's local embedding lemma and the coupling inequality (cslib-community#886)

Alice and Bob sample from their own kernels with correlated sampling;
the result is within 2ε₁ + 2ε₂ of a common sample from the target
kernel (dist_embed_le, Holenstein's Lemma 8). Add the coupling
inequality dist (p.map f) (p.map g) ≤ Pr[f ≠ g] (dist_map_map_le).

Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com>

* fix(Probability): use simp only for non-terminal simp calls (cslib-community#886)

* style(Probability): wrap a long line (cslib-community#886)

* chore(bib): keep references.bib sorted by key (cslib-community#953)

* fix(bib): remove entries duplicated by a faulty restack; keep only this PR's additions, sorted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

---------

Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat(FineGrained): PPZ for satisfiable k-SAT via the isolation inequality (cslib-community#894) (cslib-community#930)

Generalize the PPZ analysis from uniquely satisfiable to arbitrary
satisfiable k-CNF formulas. Add Cslib.BitString.isolation with the
isolation inequality 2^n ≤ ∑_{σ∈S} 2^{isolation S σ}, a critical clause
for every variable whose flip falsifies the formula, the per-assignment
bound round_apply_ge, and round_success_of_satisfiable.

Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com>

* feat(Interactive): layered arithmetic circuits and the GKR identity (cslib-community#892) (cslib-community#944)

* feat(Interactive): layered arithmetic circuits and the GKR identity (cslib-community#892)

Add Cslib.Interactive.GKR.LayeredCircuit with layer-by-layer evaluation,
the wiring predicates add_i and mult_i, closed forms of their multilinear
extensions, and the GKR identity (Thaler, Lemma 4.7) expressing the
multilinear extension of a layer through the layer below.

Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com>

* refactor(Interactive): reuse indicatorPoly; move bitPoint and eval_multilinearExtension_eq_sum to MultilinearExtension (cslib-community#892)

* chore(bib): keep references.bib sorted by key (cslib-community#953)

* fix(bib): remove entries duplicated by a faulty restack; keep only this PR's additions, sorted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

* docs(GKR): name the existing wiring-predicate lemma in the module doc

The Main results list named eval_multilinearExtension_addPred and
eval_multilinearExtension_multPred, which do not exist; the closed form is
eval_multilinearExtension_wiringPred, of which addPred and multPred are instances.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dvi6MU29zU9t8zYfeU51sB

---------

Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat(Probability): Raz's conditioning lemma for product distributions (cslib-community#886)

Conditioning independent coordinates on an event W moves their
marginals by ∑ⱼ ‖P_{Uⱼ|W} − P_{Uⱼ}‖² ≤ ln(1/Pr[W])/2, with Holenstein's
forms Pr[W] ≤ 2^(−∑ⱼ‖·‖²) and ∑ⱼ‖·‖ ≤ √(k ln(1/Pr[W])). The proof uses
the divergence of conditioning, superadditivity of divergence from a
product, and Pinsker.

Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com>

* chore(bib): keep references.bib sorted by key (cslib-community#953)

---------

Co-authored-by: Jetski (worker-jetski-17d3679e) <noreply@google.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant