Repository navigation
Conversation
…negligibility and uniform-table lemmas One-time IND-CPA: the fixed-branch experiment `IND_CPA_OneTime_Experiment`, the equation `IND_CPA_OneTime_Advantage_eq_boolDist` (the one-time form of `IND_CPA_Advantage_eq_boolDist_LR`), and admissibility of an adversary for a leakage function. GenericLift's step-adversary bridge is restated per branch through the new equation. Negligibility: `negligible_const_iff`, `not_negligible_one`, `negligible_list_sum`, `negligible_pow_of_lt_one`, `negligible_two_rpow_neg_mul`. Uniform samples: `prEvent_uniformSample_mem_le`, and overwriting one or two table coordinates of a uniform pair (`prEvent_uniformSample_prod_update`, `prEvent_uniformSample_prod_update_update`). Random functions: `prEvent_iterate_collision_le`, collisions among the first `n` iterates of a uniform function, from the fresh-query bound. ToMathlib: `ENNReal.absDiff_add_add_le`, `Nat.pow_clog_le_mul_add_one`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR Summary
Mathematical FormalizationOne-Time IND-CPA
Negligibility (
Uniform Samples (
Random Functions (
Library Additions (ToMathlib)
Refactoring
Documentation
TestingEach new theorem has an associated test file:
Validation
Statistics
Lean Declarations ✏️ Removed: 1 declaration(s)
✏️ Added: 57 declaration(s)
📄 **Per-File Summaries**
Last updated: 2026-11-21 20:24 UTC. |
Generic lemmas about one-time IND-CPA, negligibility, uniform samples and random functions, with
the two
ToMathlibfacts they use.One-time IND-CPA (
AsymmEncAlg/INDCPA/OneTime.lean)IND_CPA_OneTime_Experiment adv bis the game at a fixed hidden bit: generate keys, let theadversary choose two messages, encrypt the first if
b, return the guess. It is defined over anymonad.
IND_CPA_OneTime_Advantage_eq_boolDist: at theProbCompruntime the advantage is𝒟[IND_CPA_OneTime_Experiment adv true].boolDist 𝒟[IND_CPA_OneTime_Experiment adv false],with no factor of two. This is the one-time form of
IND_CPA_Advantage_eq_boolDist_LR.IND_CPA_OneTime_Adversary.IsAdmissible leak adv: on every public key, every pair the adversarymay choose has equal leakage, the pairs
LeftOrRight.oracleaccepts. The game admits any pair,so a scheme that leaks the message length can only be secure against adversaries admissible for
the length.
GenericLift.lean: the private bridge from the step adversary to the LR hybrids is now statedper branch, and
IND_CPA_OneTime_Advantage_stepAdversarygoes through the new equation. Publicstatements are unchanged, and the file is 30 lines shorter.
Negligibility (
Asymptotics/Negligible.lean)negligible_const_iff(a constant is negligible only at0) andnot_negligible_one.negligible_list_sum. A list may repeat an entry, so this is not an instance ofnegligible_sumover a
Finset.negligible_pow_of_lt_one(geometric decay) and its corollarynegligible_two_rpow_neg_mul,2 ^ (-c n)forc > 0.Uniform samples (
Constructions/SampleableType/Measure.lean)prEvent_uniformSample_mem_le: a uniform sample lies in a listlwith probability at mostl.length / |α|, a corollary ofprEvent_uniformSample_exists_eq_le.prEvent_uniformSample_prod_updateandprEvent_uniformSample_prod_update_update: overwritingone or two coordinates of the table in a uniform pair
β × ∀ d, R dwith independent uniformvalues leaves the pair uniform. They are corollaries of
evalDist_bind_bind_update_map_dependentand take its hypotheses. Overwriting a single coordinate of a table on its own is the existing
prEvent_uniformTable_update, so no lemma is added for it.Random functions (
QueryTracking/RandomOracle/IterateCollision.lean, new)prEvent_iterate_collision_le: for a uniformg : α → αand anys, two ofs, g s, …, g^[n] scoincide with probability at mostn · n / Nat.card α. The proof runs theprogram that queries
ntimes, each time at its last answer, through the fresh-query boundprEvent_tableQueryLog_bad_le. Its helpers are private.ToMathlib
ENNReal.absDiff_add_add_le, theℝ≥0∞form of Mathlib'sedist_add_add_le, which needs anormed group.
Nat.pow_clog_le_mul_add_one:b ^ clog b n ≤ b * n + 1, in a newToMathlib/Data/Nat/Log.lean.Mathlib has the lower bound
le_pow_clogbut no upper bound of this form at the pin.Tests
Each new statement has a test, with a boundary or negative case for each bound:
VCVioTest/CryptoFoundations/AsymmEncOneTime.lean: the scheme that sends the message in theclear; the branch at
trueencrypts the first message; the adversary that outputs the ciphertexthas advantage exactly
1; it is not admissible for the identity leakage, and every adversary isadmissible for a constant one; an adversary admissible for the identity leakage has advantage
0against every scheme.VCVioTest/SampleableTypeUpdate.lean: the list bound is attained by[true]and counts arepeated entry twice; the two-coordinate coupling holds when both coordinates are the same;
overwriting with a constant instead of a uniform value changes the distribution.
VCVioTest/RandomOracleIterateCollision.lean: the bound is0atn = 0, and atn = 1onBoolthe probability is exactly the bound1 / 2.VCVioTest/Asymptotics/Negligible.lean: a constant2⁻¹⁰⁰is not negligible; a list sum with arepeated entry is negligible, and one with a constant
1entry is not; ratio1andc = 0arenot negligible.
VCVioTest/ToMathlib/AbsDiff.lean,VCVioTest/ToMathlib/NatLog.lean: subadditivity is strictwhen the differences cancel; the
+ 1is needed atn = 0, and rounding up can exceedn.Validation
./scripts/validate.sh --lint --test --axiomspasses at the head: build with no warnings,umbrellas, boundaries, style and environment linters at the existing baseline, agent docs,
lake test,and the axiom sweep at zero
sorryand zero non-standard axioms. The FFI executables were not run.