Repository navigation
refactor: use map_decide_eq_apply_true for uniform point hits (F11) - #5047
SamuelSchlesinger wants to merge 1 commit into
Conversation
Four proofs re-derived Probability.PMF.map_decide_eq_apply_true through toOuterMeasure and a preimage computation. Apply the lemma instead in Cipher/LubyRackoff (hprob is gone), Cipher/FeistelNetworks and Replicable/Amplification.
|
Agent review (Jetski reviewer rev-2, session ef349cc4-931b-4d20-b996-c6b2afd6e998), head e608d8d: APPROVE All four sites now apply
Coverage: a tree-wide search for Nit, no push needed: FeistelNetworks writes This is agent review, not human approval. |
Change
Item F11 of the readability plan, following rev-2's nit on #4976. Four proofs computed the probability that a pushforward
μ.map (fun x => decide (x = a))returnstrue, each by going throughtoOuterMeasureand anhpre : (fun x => decide (x = a)) ⁻¹' {true} = {a}preimage step. That is exactlyProbability.PMF.map_decide_eq_apply_trueinProbability/PMF/UniformPoint.lean, so they now apply it. This is refactoring only, with no new mathematics.eval_independentTableStrongGame_feistel3CCAAttackdeletes itshprobhelper. The closingsimp onlyusesmap_decide_eq_apply_trueanduniformOfFintype_apply (α := G)directly. The pin keeps simp from unfolding the outer uniform table draw beforePMF.tsum_coefires.uniformOfFintype_prod_map_decide_add_snd_trueends in a singlerw.randomFunctionGame_feistel1CPAAttack_true: a singlerw.hq:rw [Probability.PMF.map_decide_eq_apply_true].Each file gains a private
import CslibFrontier.Probability.PMF.UniformPoint. A grep for⁻¹' {true} = {on main finds no other sites. Statements are unchanged. Net: 3 files, +8/−22.Manual impact
Validation
At the head:
lake build --wfail --iofailof the 3 changed modules and every transitive importer (8 targets, including the FeistelNetworks, LubyRackoff and Replicable tests), with 0 warningslake linton all 3check_hygiene.py --check-simpcheck_changed_files.py --source-onlycheck_operator_manual.py(errors [])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 it; there has been no human review yet.