Repository navigation
refactor(QueryComplexity): shared counting and repair steps in the sensitivity separation and weighted adversary - #4974
Queued
SamuelSchlesinger wants to merge 3 commits into
Queued
SamuelSchlesinger wants to merge 3 commits into
SamuelSchlesinger wants to merge 3 commits into
Conversation
…ow counting step of the true-side bounds recursive_sensitivity_one_at and recursive_joint_one_at repeated the same count: sensitive coordinates lie in a target child of the accepting row or in a per-gate-child set, so their number is at most o * s + r * sideSensitivity F true. A private card_filter_le_of_acceptedRow now makes that argument once; each caller supplies only its gate-child sets, their bound and the flip-change case split. Statements unchanged.
…of ofUnweighted loads ofUnweighted_loadFst_le and ofUnweighted_loadSnd_le ended with the same arithmetic that a constant √L / #S summed over S is at most √L; a private sum_sqrt_div_card_le now proves it once. Statements unchanged.
… for repaired target children recursive_sensitivity_zero_at and recursive_joint_zero_at repeated the argument that a flip repairing a rejected target child of a target candidate lies in the coordinates counted by targetCandidates_biUnion_card_le. The new mem_targetCandidates_biUnion_of_flip, next to that card lemma, makes it once. Statements unchanged.
Collaborator
Author
|
Agent review claim: coordinator |
SamuelSchlesinger
left a comment
Collaborator
Author
There was a problem hiding this comment.
Independent agent review (coordinator agy-634bba4c, session 634bba4c-9d3c-4f80-8d5b-6097f495b913) at c7ec6c92e4049eeb478bcd6990e7b484045ae98f: APPROVE (holding queue until ci-checks completes and advisory notices are checked).
- Correctness & public API. Every existing public declaration name, signature, attribute, and exposed definition body is preserved unchanged.
SensitivitySeparation/Internal/RecursiveOne.lean:card_filter_le_of_acceptedRowcleanly factors the 30-lineacceptedRowwitness/projection cardinality bound shared byrecursive_sensitivity_one_atandrecursive_joint_one_at, matching@[expose]dsensitivityAt/jointSensitivityAtdirectly without intermediateunfold/convertplumbing.Quantum/WeightedAdversary.lean:sum_le_sqrt_of_eq_div_cardfactors the pointwise-constant∑ p ∈ S, f p ≤ √Lbound (including the#S = 0case without case-splitting onS.Nonempty), turningofUnweighted_loadFst_leandofUnweighted_loadSnd_leinto one-liners. (Non-blocking note: the helper only uses0 ≤ crather than√L, andmul_inv_left_lecould shorten its final cancellation line slightly.)SensitivitySeparation/Internal/{RecursiveCandidates,RecursiveZero,RecursiveJointZero}.lean:mem_targetCandidates_biUnion_of_flipsits next totargetCandidates_biUnion_card_lewith matching parameter order (labelgeneralized fromGoodLabeling T r, dropping unusedNestedFamily F) and replaces the duplicate target-candidate membership blocks in both zero-side files.
- Deferred items & manuals. Verified the three items left as-is (
ParallelRepetition/Embedding.lean,SingleTape/CrossingSequence.lean, and theRecursiveZerovsRecursiveJointZerooutercard_le_cardstep): each has genuine structural asymmetry that would require new transport infrastructure rather than a small helper. Checkedmanual/(algebraic-and-quantum.md,sources.md) andmanual/AGENT_OPERATORS.md; no manual edits are needed.
This is agent review, not human review.
SamuelSchlesinger
added this pull request to the merge queue
Nov 13, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3725 (repeated proof machinery). Author: Jetski worker sessions
025a212a(delegating) andec0fc1d6(implementation), branchproofs/query-pcp-twins. This PR is its own task record.Three small query-complexity refactors, one commit each, removing twins flagged by
scripts/proof_copies.py:SensitivitySeparation/Internal/RecursiveOne.lean.recursive_sensitivity_one_atandrecursive_joint_one_atrepeated the same counting step: theU/Vunions, their bounds and the closing calc. The new privatecard_filter_le_of_acceptedRowmakes it once. If every coordinate satisfyingPchanges a target child of the accepting row, or lies in a per-out-neighbour setS jwith|S j| ≤ s, then#P ≤ o * s + r * sideSensitivity F true. Each caller now supplies only its child-change sets, their bound and its case split. The side and joint versions differ only there.Quantum/WeightedAdversary.lean. The privatesum_le_sqrt_of_eq_div_card(a sum overSof terms√L / #Sis at most√L) makesofUnweighted_load{Fst,Snd}_leone line each.SensitivitySeparation/Internal/{RecursiveCandidates,RecursiveZero,RecursiveJointZero}.lean. The new publicmem_targetCandidates_biUnion_of_flipsits next to its cardinality companiontargetCandidates_biUnion_card_lein this internal module. It states that a flip repairing a rejected target child of a target candidate lies in their union.recursive_sensitivity_zero_atandrecursive_joint_zero_atdrop their identical 8-line target branch.No existing statement or public name changes. Net −20 lines (+101/−121), with proof-body lines in the touched files going from 439 to 386.
Left as is, with reasons:
PCP/ParallelRepetition/Embedding.lean's_condX/_condYlemmas rest on different library facts, and deriving one from the other would need a swapped-gamecondLawthat does not exist.SingleTape/CrossingSequence.lean'sSplice.run_haltsmirrors its branches through asymmetric left/right lemmas. Unifying them needs a tape-reflection symmetry for Turing machines, which is a separate project.hsubproofs differs in its nesting.This is refactoring only, with no new mathematics.
Validation:
lake build --wfail --iofailof RecursiveOne, RecursiveZero, RecursiveJointZero and WeightedAdversary;scripts/check.sh --quickpassed. It covered 26 affected targets, including the AmbainisAdversary, SpectralAdversary and NayakWu clients andCslibFrontierResults.Entries, plus lint on 19 modules andmk_all --check. Single-file elaboration is unchanged within noise (RecursiveOne 7.2 → 4.3 s; others ±1 s). CI does the full run.Manuals: neither the Operator's Manual nor the Agent Operator's Manual mentions these internal lemmas, so neither needs an edit.
AI assistance: prepared by AI agents (Jetski). Not reviewed by a human.