Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Classical random-parity verification

Open
QAlgorithms.Papers.Independent.Intakenext100.P87.classical_hashing

by Gohan · Oct 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let N>0N>0N>0, let 0≤m<N0\le m<N0≤m<N, and fix distinct strings x,y∈{0,1}Nx,y\in\{0,1\}^Nx,y∈{0,1}N before the questions are selected. Choose mmm masks independently and uniformly from the nonzero NNN-bit masks. The parity of mask sss on xxx is s⋅xs\cdot xs⋅x modulo two. Then

Pr⁡[∀j, sj⋅x=sj⋅y]≤2−m.\Pr[\forall j,\ s_j\cdot x=s_j\cdot y]\le2^{-m}.Pr[∀j, sj​⋅x=sj​⋅y]≤2−m.

Nonzero masks encode the source's fair questions. The empty sequence of questions has collision probability one. No equality with 2−m2^{-m}2−m is claimed for this mask distribution.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P87
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakenext100.P87

open scoped Matrix ComplexConjugate

open QAlgorithms.Measurements

/-- PDF pp.7--8: collision probability is at most 2^(-m), including m=0.
No equality to 2^(-m) is asserted for nonzero masks. -/
theorem classical_hashing (N m : ℕ) (hN : 0 < N) (hm : m < N)
    (x y : Qubits N) (hxy : x ≠ y) :
    hashingCollisionProbability m x y ≤ (2 : ℝ)⁻¹ ^ m := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P87

end
Source
Unconditional Security Of Quantum Key Distribution Over Arbitrarily Long Distances, arXiv:quant-ph/9803006v5, PDF p. 7, Classical random-parity verification
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For every positive integer NNN, every natural number m<Nm<Nm<N, and every pair of distinct Boolean strings x,yx,yx,y of length NNN, let SN\mathcal S_NSN​ be the set of all Boolean strings of length NNN except the all-false string. The fraction of ordered tuples (s0,…,sm−1)∈SNm(s_0,\ldots,s_{m-1})\in\mathcal S_N^m(s0​,…,sm−1​)∈SNm​ satisfying

∑j=0N−1xjsi,j≡∑j=0N−1yjsi,j(mod2)for every i\sum_{j=0}^{N-1}x_js_{i,j} \equiv \sum_{j=0}^{N-1}y_js_{i,j}\pmod2 \quad\text{for every }ij=0∑N−1​xj​si,j​≡j=0∑N−1​yj​si,j​(mod2)for every i

is at most 2−m2^{-m}2−m. Tuple entries may repeat, and the fraction is the number of satisfying tuples divided by the total number of tuples. The hypotheses make that denominator positive. The case m=0m=0m=0 is included, with fraction 111 and bound 111.

Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me