Repository navigation
refactor(Circuit, NisanWigderson): replace directProductInput with BitString.block; derive restrict_binaryPolynomial - #4538
Merged
Conversation
…tString.block; derive restrict_binaryPolynomial directProductInput was BitString.block under another name; its 25 clients now use block, and the client lemmas named after it are renamed (block_flatten, flatten_block, block_pack, block_eval_batchOrCircuit). Design.restrict_binaryPolynomial now follows from Design.mem_block_binaryPolynomial_iff. Statements are otherwise unchanged.
Collaborator
Author
|
Agent review (reviewer review-4538, Jetski session d898e715) of d38fcff: approve.
Optional nits for a follow-up, not this PR:
|
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.
Infrastructure only, no new mathematics. This PR does the M6.6 cleanup follow-ups from the #4497/#4501/#4509 reviews.
1.
Cslib.Circuits.directProductInputremoved in favour ofCslib.BitString.block. The two were the same function,fun j => x (finProdFinEquiv (i, j)), with the same argument order.Replication.leanand all 25 clients (18 library modules, 7 test files) now useBitString.block. Following the no-alias rule, the old name is gone and no deprecation is left behind. The client lemmas named after it are renamed to match:directProductInput_flatten→block_flatten,flatten_directProductInput→flatten_block(Sorting.lean)directProductInput_pack→block_pack(Iteration/Record.lean)directProductInput_eval_batchOrCircuit→block_eval_batchOrCircuit(MassProduction/Pipeline/Circuit.lean)Apart from those names, every statement is unchanged: the only edit is the swap of two equal-by-definition terms. One proof side effect:
BitString.block_applyis@[simp], butdirectProductInputhad no simp lemma. So simp now unfolds fully applied blocks. That required changing three private proofs:BatchOr.layout_applyis restated in simp normal form,KeyedSort.output_keyends in asimp only, and anrflinblock_blockMapis gone.2.
Design.restrict_binaryPolynomialis derived fromDesign.mem_block_binaryPolynomial_iff. Membership in blockialready does the parity arithmetic, so restricting to the cell(j, v)reduces torestrict_bitPolynomial(proof: 6 lines → 4). The statement is unchanged. The lemma now comes after the membership lemma, and its docstring points to it.3.
max 1 (clog 2 n)stays unshared withCSP.bitWidth.binaryFieldDegree n(the degree of the binary field in the NW design) andCSP.bitWidth n(an encoding width inLogics/Propositional/CSP/ToBoolean.lean) have the same body but different meanings, and each has public clients that state their own bounds. Sharing the definition would mean either importing CSP into NisanWigderson or changing public statements. A shared lemma isn't worth it either: the only common proof is two lines (n ≤ 2 ^ max 1 (clog 2 n)). The lowest suitable home,Foundations/Data/Nat/PowClog.lean, would gain a new public lemma and an import edge for those two lines.Overlap. No file of #4522 (HardnessAmplification), #4524 (DirectProduct) or the upcoming CIKK 4b (UniformLearning/CIKK) is touched. #4529 also edits
MCSP/PartialHardness/Completeness.lean, at other hunks (L12, L243; this PR changes L265–268). No open PR adds a use ofdirectProductInput.Duplicates. After a full build,
python3 scripts/parallel_defs.py --theoremsreports no duplicate statement among the 77 theorems examined, including the renamedblock_*lemmas.python3 scripts/parallel_defs.pyreports no parallel definition among the 8 declarations examined.Manuals. No edit to either manual. Neither the Operator's Manual (
manual/) nor the Agent Operator's Manual (AGENT_OPERATORS.md) mentionsdirectProductInput, the renamed lemmas orrestrict_binaryPolynomial. The same goes forresults/,ROADMAP.mdand the guides.Replication.lean's module docstring now listsblockMap/directProductagainstBitString.block.Validation.
scripts/check.sh --quickpasses (119 affected targets, source hygiene, ratchets, lint of the affected modules,mk_all --check), and so doeslake build --wfail --iofail CslibFrontier. CI supplies the full run.Written by a Jetski agent (meta-os18-thm5, session 63503c38) for Samuel Schlesinger. Not reviewed by a human.