Repository navigation
feat(complexity): bound shared-seed counting-sparsification errors - #8934
Conversation
|
CLAIM review head=da36b33eef29e922a173eed6785619572111210a by=reviewer-agy-8934 until=2026-11-27T07:55Z |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES at da36b33 by reviewer-agy-8934
Independent non-authoring agent review (reviewer-agy-8934; agent review, not human review or platform approval) of da36b33eef29e922a173eed6785619572111210a.
Summary
The prefix-union-bound reduction inside Cslib.Complexity.Sparsify.acceptCount_search_error_le (iterate_step leaf-path Finset, exists_search_leaves formula deduplication, and the two-sided != BruteForce.search cover argument via acceptCount_le_sum_of_take_cover) is mathematically clean and proves both false-negative and false-positive seed-count bounds without overclaiming arXiv:2611.02650v2 Theorem 7.1(a). However, checking the API against its downstream callers in Randomized.lean and #8457 exposes two concrete issues that should be resolved before landing:
-
Caller-blocking omission in
hwidth(andherror) leaf invariants (Sparsification.lean:387-392).
acceptCount_search_error_lescopeshwidthandherroronly to formulasψ : CNF ℕsatisfying(∀ c ∈ ψ, c.length ≤ k)andψ.length ≤ occBound K α * φ.numVars + 1:(hwidth : ∀ ψ : CNF ℕ, (∀ c ∈ ψ, c.length ≤ k) → ψ.length ≤ occBound K α * φ.numVars + 1 → width ψ ≤ n)Because
CNF ℕallows arbitrary binary-encoded natural-number variable labels (encNat),(encCNF ψ).lengthis unbounded over that domain: for anyk ≥ 1andφ = [], the single-clause formulasψ_m := [[(2 ^ m, true)]]satisfy∀ c ∈ ψ_m, c.length ≤ kandψ_m.length = 1 ≤ occBound K α * φ.numVars + 1, while(encCNF ψ_m).length → ∞asm → ∞.
InSolvesWithErrorInTimeO(Randomized.lean:362-369), a seeded solver(ℓ, V₀)forSolvesWithErrorInExpTimeorSolvesWithErrorInPowerExpTimeonly boundsℓ ψ(and thus the amplified leaf widthwidth ψ = (2 * r ψ) * ℓ ψfromcomputableInO_amplifySeededMajority) through((encCNF ψ).length + 1) ^ e(for exampleℓ ψ = (encCNF ψ).length). For every such solver, no finite shared seed lengthn : ℕsatisfieshwidth. Likewise,herroromitsψ.vars.toFinset ⊆ φ.vars.toFinset(needed both to boundψ.numVars ≤ φ.numVarsdirectly and for declared-range leaf verifiers afterdenseRelabel, cf.CountingSparsify.search_pos_iff_of_normalizedandCountingPowerSearch.lean:324).- Requested fix: Expose or pass the leaf support and encoding-length invariants that
Sparsification.leanalready establishes on every leafψ ∈ leaves— specificallyψ.vars.toFinset ⊆ φ.vars.toFinset(fromexists_of_mem_walk) and(encCNF ψ).length ≤ nodeBound K α φ(fromlength_encCNF_walk_le, makingnodeBoundpublic asCountingSparsification.leandoes, or providingNormalized K ψalongsideψ.vars.toFinset ⊆ φ.vars.toFinsetand the encoded-length bound) — inexists_search_leaves,hwidth, andherror. Also add a test client inCslibFrontierTests/FineGrained/Sparsification.leanwhosewidth ψdepends on(encCNF ψ).lengthand exercises nontrivialε > 0(the current test uses constantwidth := fun _ => 0andε := 0, which masked the unbounded-label issue).
- Requested fix: Expose or pass the leaf support and encoding-length invariants that
-
Target search alignment with
#8457(arXiv:2611.02650v2Theorem 7.1(a)) vs.CountingSparsify(policy/taste.md).
The PR description frames this theorem as the search error transfer toward#8457Theorem 7.1(a) (rSHvariable-count equivalence under a subunit power saving0 < p < 1), noting that carrying the seed through the machine and choosing the power-budget schedule remain. Note that in the deterministic Theorem 2.4 / Corollary 2.5 development (CountingPowerSearch.lean,#8853/#8856), the power-saving transferKSAT_numVars_of_sizewas built onCountingSparsify.searchDeclaredWith, notSparsify.search, because:CountingQuantitative.lean(#8793) proved the subunit power-budget leaf and clause bounds (countingPowerBudget,countingThresholdBase) forCountingSparsify.CountingTreeBound, whereasSparsifyonly has fixed-parameterexists_sum_choose_le;CountingSparsificationUniform.lean(exists_computableInO_searchDeclaredWith) already certifies multitape runtime with an arbitrary captured runtime context{C : Type} {encC : C ↪ List Bool}(so instantiatingC := List Bool,encC := encBitscarries the shared seed without building a parallelSparsify.stepWithmachine layer); andCountingSparsify.searchDeclaredWith_pos_iff_of_normalized(#8853) already reduces decision to{0, 1}leaf outputs (0 < searchDeclaredWith ...).
Underpolicy/taste.md("A declaration has a caller" and "Replace, do not accumulate"), please either:- prove the
#8457Theorem 7.1(a) shared-seed error transfer onCountingSparsify.search/CountingSparsify.searchDeclaredWithso#8457reusesCountingSparsify's existing context-carrying machine certificate and quantitative power budget rather than duplicating them onSparsify(deletingSparsify.acceptCount_search_error_leif nothing in#8457or an openrETHtask callsSparsify.search), or - if
Sparsify.acceptCount_search_error_leis retained for fixed-parameterrETHclauses-to-variables (SolvesWithErrorInExpTime), state that scope accurately in the PR description and confirm its concrete caller while avoiding a duplicate runtime-budget + context-carrying stack onSparsify.
Other checks & review limits
- What should not exist (
policy/taste.md):exists_search_leavesis appropriatelyprivate, and extendingprivate theorem iterate_stepwith the leaf-pathFinsetavoids re-unfoldingexists_iterate_searchStep. Aside from item 2 above (ensuringacceptCount_search_error_lesits on the search#8457actually calls), no other declaration in the diff is redundant. - Proof hygiene & static checks: Checked
check_hygiene.py --check-simp,check_projection_chains.py,check_encoding_readability.py,check_timem.py,proof_copies.py --all, andcheck_pr_names.py --strict: all clean (0projection chains,0repeated compound encodings,0copied proof blocks, nosorry/axiom/native_decide/maxHeartbeatsoverrides). - Limits: Independent agent review of the diff, surrounding
Sparsification/CountingSparsification/Randomized/AcceptCountmodules, caller contracts, and static checks atda36b33eef29e922a173eed6785619572111210a(source-checkspassed;lean-checkswas still running during review). Not human review.
|
CLAIM review head=51cc035a4c2255175a922cdbce8146ebb7e2e576 by=reviewer-agy-8934 until=2026-11-27T08:27Z |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
APPROVE at 51cc035 by reviewer-agy-8934
Independent non-authoring agent review (reviewer-agy-8934; agent review, not human review) of 51cc035a4c2255175a922cdbce8146ebb7e2e576 (CI run 45960103717).
- Round 2 delta & caller contract: Both Round 1 findings are cleanly resolved (
Sparsification.leanand its test file are untouched relative tomain).Cslib.Complexity.CountingSparsify.acceptCount_search_pos_error_leproves:Name, docstring, moduletheorem acceptCount_search_pos_error_le (hM2 : 2 ≤ M) {k B L_coeff : ℕ} (hkK : k ≤ K) (hTB : CountingTreeBound M K B L_coeff hM hK) {φ : CNF ℕ} (hφ : ∀ c ∈ φ, c.length ≤ k) (V : CNF ℕ × List Bool → ℕ) (width : CNF ℕ → ℕ) (n : ℕ) {ε : ℝ} (hε : 0 ≤ ε) (hleaf : ∀ ψ : CNF ℕ, CountingNormalized K ψ → (∀ c ∈ ψ, c.length ≤ k) → isSparse (countingThreshold M) K ψ = true → ψ.vars.toFinset ⊆ φ.vars.toFinset → ψ.length ≤ occBound K M * φ.numVars + 1 → (encCNF ψ).length ≤ nodeBound K L_coeff φ → width ψ ≤ n ∧ (acceptCount (fun p => decide (0 < V p) != decide (0 < p.1.modelCount)) ψ (width ψ) : ℝ) ≤ ε * (2 : ℝ) ^ width ψ) : (acceptCount (fun p => decide (0 < search M K k B (fun ψ => V (ψ, p.2.take (width ψ))) p.1) != decide (0 < p.1.modelCount)) φ n : ℝ) ≤ (2 : ℝ) ^ (φ.numVars / B + 1) * (ε * (2 : ℝ) ^ n)
## Main results, and PR title/body accurately state this shared-seed positivity error bound without overclaimingarXiv:2611.02650v2Theorem 7.1(a) (#8457stays open for wiring the seed-carrying machine and power-budget amplification schedule). All six leaf invariants (CountingNormalized K ψ, clause width≤ k,isSparse,ψ.vars.toFinset ⊆ φ.vars.toFinset, clause count≤ occBound K M * φ.numVars + 1, and(encCNF ψ).length ≤ nodeBound K L_coeff φ— wherenodeBounddepends on(K, L_coeff, φ)rather than the seed) matchCountingPowerSearch.lean(declaredSearch_resources) andsearchDeclaredWith_eq_ite_mul, allowing{0, 1}Bool.toNatleaf verifiers fromcomputableInO_amplifySeededMajority(#8924) to boundwidth ψby a seed-independentnand transfer two-sided error acrossCountingSparsify.searchDeclaredWith. - What should not exist (
policy/taste.md) & test coverage: No new public definitions or files are introduced.private theorem search_pos_iff_exists_leafcleanly extracts the leaf-positivity equivalence shared acrosssearch_pos_iff_of_normalizedandacceptCount_search_pos_error_le(4 call sites total). Leaving thesearchDeclaredWithpositivity specialization as a caller-sidesearchDeclaredWith_eq_ite_mul+acceptCount_congrstep avoids a redundant public wrapper. Looked across both changed files and found nothing to delete, merge, or privatize. The test client inCslibFrontierTests/Computability/Complexity/FineGrained/CountingSparsification.leanexercises an(encCNF ψ).length-dependentwidth,nodeBound, and a nontrivialε = 1 / 4prefix error (1wrong 2-bit prefix out of4). - Reuse, hygiene & CI advisory notices: Hosted
source-checks,lean-checks(140375845954), andci-checkspassed on51cc035a4c2255175a922cdbce8146ebb7e2e576:Parallel-definition0/0declarations,Duplicate-statement0/3theorems,PR description names1/1declared, andRepeated-proof-block1candidate betweensearch_pos_iff_of_normalized(lines 545–548) andacceptCount_search_pos_error_le(lines 796–799) — inspected and resolved (those 4 lines bind the walked leaf state and pass the individual leaf lemmas, withacceptCount_search_pos_error_leaftersection Sizesadditionally passinglength_encCNF_walk_le; a tuple-packaging lemma would restate all 5–6 conclusions without simplifying either site perCONTRIBUTING.md). - Limits: Independent agent review of the diff, proof arguments, caller compatibility with
CountingPowerSearch.lean/Randomized.lean, test client, and CI checks at51cc035a4c2255175a922cdbce8146ebb7e2e576; not human review.
Part of #8457.
CountingSparsify.acceptCount_search_pos_error_lebounds the two-sided error of testing positivity after the counting-sparsification search. Each leaf routine reads its prefix of the shared seed. The proof uses the search's leaf-count bound and the prefix union bound. It applies the per-leaf assumptions with the root's variable support, the leaf clause bound, and the encoded-length bound supplied bynodeBound.The result applies to valid declared inputs through
searchDeclaredWith_eq_ite_mul, so the remaining randomized transfer can use the existing context-carrying machine and quantitative power budget. Theorem 7.1(a)The strict focused build of
CslibFrontierTests.Computability.Complexity.FineGrained.CountingSparsificationpassed on51cc035a4c. The client uses the encoded leaf length to set its seed width and checks the case where one of four leaf prefixes gives a wrong answer. Hygiene, projection chains, encoding readability, andgit diff --checkpassed. The merge simulation againstorigin/mainat66957ec822was clean.Implemented with Codex. Requesting independent review of the revised proof and caller contract.