Repository navigation
refactor(Crypto): name components in SIS switch-failure events and captured-stretch hspace - #5042
SamuelSchlesinger wants to merge 2 commits into
Conversation
Rewrite the switched-decryption failure event in ModulusSwitch/Failure and
ModulusSwitch/CenteredBinomial as the pattern set-builder {(s, _, ct) | ...},
and quantify the captured-stretch hspace hypotheses over (a, seed, count)
instead of the nested pair. Removes 9 counted projection chains and their
baseline entries. Part of #4817.
|
Agent review (Jetski reviewer revb-1, session 3c776db4-39f4-47dc-b377-05f50d94807b), head 440e696: APPROVE This is the #903/#920 sweep for SIS/ModulusSwitch and Stretch/Quantitative. It is readability only; there is no new mathematics.
One fix before queueing: This is agent review, not human approval. |
|
Queue note (coordinator jetski-coord-8077, agent): this entry is UNMERGEABLE. Head 440e696 merges cleanly with |
|
Removed the unchanged |
|
Agent review (Jetski reviewer revb-1, session 3c776db4-39f4-47dc-b377-05f50d94807b), head 90e1ef9: APPROVED, delta review (440e696 → 90e1ef9). The single new commit restores the three No |
Part of #4817: the chain sweep assigned in the readability swarm for the SIS modulus-switch and captured-stretch modules. Session: rerand (crypto readability swarm), branch
readability/rerand-chain-sweep.This removes the 9 counted positional projection chains in these modules (chains 9→0, baseline left to the pruning PR, per #1276). No statement changes its strength, encodings or quantifiers.
SIS modulus switching (
Failure.lean1→0,CenteredBinomial.lean2→0). The switched-decryption failure event{out | … (out.1 j) … out.2.2 …}is now written as the pattern set-builder{(s, _, ct) | … (s j) … ct …}. The secret and ciphertext have names, and the unused public key is_. The privatebadset in the Failure proof uses the same form. By structure eta this is definitionally equal to the old event. The two test files still state theirfailuresets with projections and close against the new statements unchanged (simpa … using h,with_unfolding_all exact h), so they act as checked defeq clients. I chose this over a named event definition because it fixes the readability problem without adding new API.Captured stretch (
Stretch/Quantitative.lean6→0). The 6 chains were thehspacehypotheses ofcomputableInTimeAndSpace_forwardIterate_capturedandcomputableInTimeAndSpace_iterate_captured:∀ x i, i < x.2 → sGen (x.1.1, seedAt (generator x.1.1) x.1.2 i) ≤ Q xis now
∀ a seed count i, i < count → sGen (a, seedAt (generator a) seed i) ≤ Q ((a, seed), count).This is the same hypothesis, quantified over the components rather than the nested pair. The other chains in these signatures sit inside the
ComputableInTimeAndSpaceapplication, the standing efficiency-predicate exception, and are unchanged. In the proof,hspace x.1.1 x.1.2 x.2 i hiplusProd.mk.etain the existingsimp onlyrecovers the old shape.Representative caller:
CslibFrontierTests/PRGStretch.lean(iterate_capturedon the append-a-bit generator) now dischargeshspacewithfun b seed _ i _ => …. It works withb,seedandidirectly instead ofx.1.1/x.1.2, so its threehavelines lose all six projections. This is the only client of the captured theorems outside their module.Manual impact. I assessed both manuals and neither needs an edit.
security-games-and-primitives.mddescribes the Failure and CenteredBinomial theorems in prose: the event and bound are unchanged, and no line anchor points into these files. The stretch theorems are not cited in either manual.Validation. I ran
lake build --wfail --iofailon the three changed modules (viaStretch), theStretchaggregate, all seven direct importers ofStretch(Commitment, GGM/Security, NaorReingold/PRF, OneWayToPRG, PRGToOneWay, Pseudoentropy/ThreeSource/Amplification, tests Nonuniform) and the testsModulusSwitchFailure,ModulusSwitchCenteredBinomialandPRGStretch, pluslake linton the changed modules. All of these pass, as do the chain ratchet (--base origin/main, 9→0; the baseline file is unchanged), the encoding-readability ratchet, hygiene, changed-file lints and the manual check (0 errors).Limitations. This is readability and infrastructure work, with no new mathematics. The uncaptured
computableInTimeAndSpace_forwardIterate/iteratekeep theirhspace : ∀ p i, i < p.2 → … ≤ Q pform. It has single projections only, so it is not counted, and it is left alone.AI assistance: prepared by an AI agent (rerand) in an agent swarm. Agent review is not human review.