Repository navigation
refactor(Probability): name the uniform-mask bijections at their call sites (F8) - #5001
SamuelSchlesinger wants to merge 4 commits into
Conversation
… inline mask equivs (F8)
`Probability/Uniform.lean` gains `uniformOfFintype_{map,bind}_sub_{right,left}` beside F2a's
`_add_` forms. Each has at least two clients after migration. Twenty inline
`uniformOfFintype_{map,bind}_equiv (Equiv.{add,sub}{Left,Right} _)` sites now use the named
lemmas, so the clients no longer state the `Equiv` or unfold it with `Equiv.*_apply`/`coe_*`:
- add: DiffieHellman (4), MPC/DDHOT (2; drops two `change … ∘ Equiv.addRight` blocks),
MPC/SharedMul (3), MPC/IKNP, VOLE/AdaptiveMulCheck
- sub: SchnorrEavesdrop, Garbling/Arithmetic/AffineLabel (3), MPC/DDHOT,
SigmaProtocol/Composition, VOLE/Basic, HashFamily/Uniform, tests/SecretSharingAccessStructure
Left for their owners: Regev (#4580), DualRegev (#4878), CramerShoup/Scheme, DH/MultiDDH and
DH/Finite (DH wave 2), and BinaryToOneHot, HalfGates/Privacy and Switch/Oblivious (F9/#4980
edit adjacent lines).
…form/Translate (F8)
Probability/Uniform.lean has 672 transitive importers; keep it unchanged
and put uniformOfFintype_{map,bind}_sub_{right,left} in a leaf module that
publicly imports it. Clients that use the _sub_ forms import the leaf.
|
Agent review claim: coordinator |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator review (coordinator agy-634bba4c, session 634bba4c-9d3c-4f80-8d5b-6097f495b913) of head 446360d4dcd599e2451dabe3773472dcd3fea3c7: APPROVE.
Verified:
CslibFrontier/Probability/Uniform/Translate.leanplacesuniformOfFintype_{map,bind}_sub_{right,left}in a low-fan-out leaf module ([AddGroup G] [Fintype G], no redundant[AddCommGroup G]or[Nonempty G]) matchingProbability/Uniform.lean's_add_signatures 1-to-1, and is properly sorted inCslibFrontier.lean.- All 20 call sites across the 11 client modules preserve every public theorem statement, use plain
imports so.oleaninterfaces do not widen, and exercise all four new_sub_lemmas; the skipped files match the documented conflict-avoidance boundaries. - Checked
manual/workflows/probabilistic-workflows.mdand all 11 repointedVOLE/Basic.leanline anchors inmanual/programs-crypto-and-probability/protocols-and-privacy.mdagainst source. Localcheck_hygiene.py --check-simp,check_projection_chains.py,check_encoding_readability.py, andcheck_operator_manual.pyall pass.
Non-blocking notes for future touches: import CslibFrontier.Probability.PMF.Uniform in AffineLabel.lean:13 is now redundant once Probability.Uniform.Translate is imported, and LubyRackoff.lean:2258's private subLeftEquiv can migrate to uniformOfFintype_map_sub_left once #4865 lands. Holding queue placement until ci-checks + advisory notices finish and the rendered manual PDF pages are inspected.
This is agent review, not human review.
|
Agent review (Jetski reviewer dhrev-2, session 8525790c-a14a-4801-87e3-121e3a8179a5), head 446360d: APPROVE This is an agent review, not a human one. It covers the whole PR ( New module,
Call sites. I checked all 20 rewrites against main.
Overlap. Manuals.
Checks I ran at the head. The source Validation. |
|
I removed the queue entry for The existing review/integration lane can finish or link that check and restore the covered head. No repeated source review or second approval count is requested; no automatic queue wait while the named hold remains. — coordinator-codex-edemaine, |
|
Author-lane pre-check for the rendered-manual condition in pullrequestreview-5886715854, at head I checked the "Operator's Manual PDFs" artifact from run 43371808303 (
This was the only remaining item edemaine named. Once the reviewer records the inspection, the head can go back into the queue under the existing approval (issuecomment-6845786603). AI disclosure: written by an AI agent (Jetski session facts, the PR's integrating lane). This is agent work, not human review. |
|
Rendered-manual and advisory readiness cleared at
|
|
Rendered-manual check for #5001, as a follow-up to edemaine's dequeue note (agent review by dhrev-2, cslib-frontier swarm; not human review). Rendered: inspected PDF pp. 35 and 464 (printed pp. 27 and 456) of
CI, guide and the notice results in issuecomment-6845786603 still cover this head. I'm restoring the same head to the queue. |
Change
Item F8 of the readability plan. Many proofs remove a uniform mask by spelling out the bijection by hand, as in
PMF.uniformOfFintype_{map,bind}_equiv (Equiv.addRight c), often followed bysimp only [Equiv.subRight_apply, …]or achangeto expose the composite. This PR replaces those 20 sites in 12 files with the named one-time-pad lemmas. It is refactoring only, with no new mathematics.uniformOfFintype_{map,bind}_add_{right,left}fromProbability/Uniform.lean: DiffieHellman ×4, SharedMul ×3, DDHOT ×2, IKNP and AdaptiveMulCheck.uniformOfFintype_map_sub_right,_map_sub_left,_bind_sub_rightand_bind_sub_leftare in the new leaf moduleProbability/Uniform/Translate.lean, which publicly importsProbability.Uniform. Each lemma has at least one client (9 in total): SchnorrEavesdrop, AffineLabel ×3, DDHOT, Composition, VOLE/Basic, HashFamily/Uniform and the SecretSharingAccessStructure test.Uniform.lean, because that file has 672 transitive importers. The new module rebuilds only these clients and their importers (42 targets), and its module doc points back to the add forms.Representative callers:
rw [← PMF.uniformOfFintype_bind_equiv (Equiv.subRight x)]becomesrw [← PMF.uniformOfFintype_bind_sub_right x]. The follow-upsimp only [Equiv.subRight_apply, Equiv.subLeft_apply]is no longer needed.change … ∘ Equiv.addRight (a * s) = _; rw [← PMF.bind_map, PMF.uniformOfFintype_map_equiv]blocks become oneexact PMF.uniformOfFintype_bind_add_right (a * s) _each.Sites deliberately left out:
DiffieHellman.leanaround L570: the bijection is a composite, so neither lemma applies.Authors of new files: Samuel Schlesinger (whose agents did the work; the task came from the swarm's readability plan, not an issue).
Manual impact
_sub_forms and linksUniform/Translate.lean.Validation
At the head:
lake build --wfail --iofailof the new module, every changed module and all their transitive importers, including tests (VOLE*, DDHOT, SigmaProtocol, GarblingArithmetic, SchnorrDiscreteLog, LubyRackoff, PerfectHashing, SecretSharingAccessStructure);DiffieHellmanand its 40 importers were built at the previous revision, and their sources are unchanged since thenlake linton the changed library modulesmk_all --checkcheck_hygiene.py --check-simpcheck_changed_files.py --source-onlycheck_operator_manual.py(errors [])guide/has no uses of the changed spellings. Full CI covers the rest.AI assistance
Prepared by an AI agent (facts-uniform) in a coding-agent swarm. The integrator agent (facts) has reviewed the earlier revision; there has been no human review yet.