Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Q-ID user security against a storage-bounded server

Open
QAlgorithms.Papers.Independent.Intakenext100.P14.qid_user_security

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

prove2quantum

Fix Q-ID with block length nnn, mmm passwords, code minimum distance at least ddd, and finite nonempty strongly universal-2 hash families with ℓ\ellℓ-bit outputs. Let WWW be any password distribution with Hmin⁡(W)≥1H_{\min}(W)\ge1Hmin​(W)≥1. Consider any server attack initially independent of WWW, with unrestricted classical information and computation, whose retained quantum dimension is at most 2q2^q2q immediately before θ,f\theta,fθ,f are revealed at step 3. For every 0<λ<1/40<\lambda<1/40<λ<1/4, the actual final view ES∗E_{S^*}ES∗​ admits a classical extension W′W'W′ independent of WWW such that

δ ⁣(ρWW′ES∗∣W′≠W,ρW↔W′↔ES∗∣W′≠W)≤2−12((14−λ)d−log⁡2m−q−ℓ−1)+2−(σ(λ)d−log⁡2m−3),\delta\!\left(\rho_{WW'E_{S^*}\mid W'\ne W},\rho_{W\leftrightarrow W'\leftrightarrow E_{S^*}\mid W'\ne W}\right)\le 2^{-\frac12((\frac14-\lambda)d-\log_2m-q-\ell-1)}+2^{-(\sigma(\lambda)d-\log_2m-3)},δ(ρWW′ES∗​∣W′=W​,ρW↔W′↔ES∗​∣W′=W​)≤2−21​((41​−λ)d−log2​m−q−ℓ−1)+2−(σ(λ)d−log2​m−3),

where δ\deltaδ is half the trace norm and

σ(λ)=λ2log⁡2e32(2−log⁡2λ)2.\sigma(\lambda)=\frac{\lambda^2\log_2e}{32(2-\log_2\lambda)^2}.σ(λ)=32(2−log2​λ)2λ2log2​e​.

The extension preserves the actual output marginal exactly, and the comparison uses its own conditioned Markov reconstruction. No positive linear slack is assumed, and the finite error bound may exceed one.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P14
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakenext100.P14

open scoped Matrix ComplexConjugate

open QAlgorithms.Papers.Independent.Dependency50.P47 (Law)

open QAlgorithms.Papers.Independent.Gap48.P11 (blockMatrix cqDistance)

open QAlgorithms.Papers.Independent.Claimed50.P31 (bb84Vector)

open QAlgorithms.Papers.Independent.Advance50.P05 (RectangularInstrument)

attribute [local instance] Classical.propDecidable

attribute [local instance] Classical.decEq

/-- Positive list length and inhabited fibers supply the tagged union's inhabitant.
This derived instance adds no hypothesis to Lemma 2.2. -/
local instance {m : ℕ} [NeZero m] {A : Fin m → Type*}
    [∀ i, Nonempty (A i)] : Nonempty (Sigma A) :=
  ⟨⟨0, Classical.choice (inferInstance : Nonempty (A 0))⟩⟩

/-- PDF p.10, Proposition 3.4, with Definition 3.2 on p.8.
All admissible server attacks are quantified before the independent extension;
there is no assumed entropy estimate or assumed security witness. -/
theorem qid_user_security
    {n ell m d q : ℕ} {F : Type*} {G Y E : Type}
    [Fintype F] [Nonempty F] [Fintype G] [Nonempty G]
    [Fintype Y] [Nonempty Y] [Fintype E] [Nonempty E]
    (P : QIDParameters n ell m d F G) (W : Law (Fin m))
    (hW : ∀ w, W.prob w ≤ 1 / 2) (lambda : ℝ)
    (hlambda : 0 < lambda) (hlambdaUpper : lambda < 1 / 4)
    (A : ServerAttack n ell q F G Y E) :
    HasIndependentGuess (J := Fin m) (serverOutput P W A) some
      (Real.rpow 2 (-((1 / 4 - lambda) * d - Real.logb 2 m - q - ell - 1) / 2) +
        Real.rpow 2 (-(qidUncertaintyExponent lambda * d - Real.logb 2 m - 3))) := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P14

end
Source
Secure Identification and QKD in the Bounded-Quantum-Storage Model, arXiv:0708.2557v3, PDF p. 10, Proposition3.4: Q-ID user security
Read-back

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

Let n,ℓ,m,d,qn,\ell,m,d,qn,ℓ,m,d,q be natural numbers, let F,G,Y,EF,G,Y,EF,G,Y,E be finite nonempty types, and write Qr={0,1}r\mathcal Q_r=\{0,1\}^rQr​={0,1}r. Let PPP consist of an injective code C:{0,…,m−1}→QnC:\{0,\ldots,m-1\}\to\mathcal Q_nC:{0,…,m−1}→Qn​ whose distinct codewords have Hamming distance at least ddd, and hash families hf:Qn→Qℓh_f:\mathcal Q_n\to\mathcal Q_\ellhf​:Qn​→Qℓ​ and kg:{0,…,m−1}→Qℓk_g:\{0,\ldots,m-1\}\to\mathcal Q_\ellkg​:{0,…,m−1}→Qℓ​ such that, for distinct inputs, any prescribed pair of outputs occurs for a fraction 2−2ℓ2^{-2\ell}2−2ℓ of the keys in the respective family. Let Ww≥0W_w\ge0Ww​≥0, ∑wWw=1\sum_wW_w=1∑w​Ww​=1, and Ww≤12W_w\le\frac12Ww​≤21​ for every www, which in particular forces m≥2m\ge2m≥2. Let 0<λ<140<\lambda<\frac140<λ<41​, and let AAA supply a checkpoint instrument By\mathcal B_yBy​ from Qn\mathcal Q_nQn​ to Qq\mathcal Q_qQq​, an instrument Cgθ,f,y\mathcal C^{\theta,f,y}_gCgθ,f,y​ from Qq\mathcal Q_qQq​ to EEE for every θ,f,y\theta,f,yθ,f,y, and channels Fθ,f,y,g,z\mathcal F_{\theta,f,y,g,z}Fθ,f,y,g,z​ on EEE. Each instrument branch has the form ∑jKo,jXKo,j†\sum_jK_{o,j}XK_{o,j}^\dagger∑j​Ko,j​XKo,j†​, with finitely many Kraus operators and ∑o,jKo,j†Ko,j=I\sum_{o,j}K_{o,j}^\dagger K_{o,j}=I∑o,j​Ko,j†​Ko,j​=I; each channel likewise has a finite complete Kraus family. Define vx,θ(u)v_{x,\theta}(u)vx,θ​(u) as the product of (−1)uixi/2(-1)^{u_ix_i}/\sqrt2(−1)ui​xi​/2​ on coordinates with θi=1\theta_i=1θi​=1 and 1ui=xi\mathbf1_{u_i=x_i}1ui​=xi​​ on the others. Define TP(w,x,θ,f,g)=hf(pack⁡θ,C(w)x)⊕kg(w)T_P(w,x,\theta,f,g)=h_f(\operatorname{pack}_{\theta,C(w)}x)\oplus k_g(w)TP​(w,x,θ,f,g)=hf​(packθ,C(w)​x)⊕kg​(w), where packing retains matching-basis bits in increasing coordinate order and pads with zeros to length nnn, and define the output blocks, indexed by www and history h=(θ,f,y,g,z)h=(\theta,f,y,g,z)h=(θ,f,y,g,z), by

Rw,h=Ww22n∣F∣∑x∈Qnz=TP(w,x,θ,f,g)Fθ,f,y,g,z(Cgθ,f,y(By(vx,θvx,θ†))).R_{w,h}=\frac{W_w}{2^{2n}|F|} \sum_{\substack{x\in\mathcal Q_n\\z=T_P(w,x,\theta,f,g)}} \mathcal F_{\theta,f,y,g,z} \left(\mathcal C^{\theta,f,y}_g \left(\mathcal B_y(v_{x,\theta}v_{x,\theta}^\dagger)\right)\right).Rw,h​=22n∣F∣Ww​​x∈Qn​z=TP​(w,x,θ,f,g)​∑​Fθ,f,y,g,z​(Cgθ,f,y​(By​(vx,θ​vx,θ†​))).

The theorem asserts that there is a family ηw,j,h\eta_{w,j,h}ηw,j,h​ with j∈{0,…,m−1}j\in\{0,\ldots,m-1\}j∈{0,…,m−1} whose block-diagonal matrix is positive semidefinite with trace 111, whose marginal ∑jηw,j,h\sum_j\eta_{w,j,h}∑j​ηw,j,h​ equals Rw,hR_{w,h}Rw,h​, and whose masses obey t(∑hηw,j,h)=t(∑hRw,h) t(∑w′,hηw′,j,h)t(\sum_h\eta_{w,j,h})=t(\sum_hR_{w,h})\,t(\sum_{w',h}\eta_{w',j,h})t(∑h​ηw,j,h​)=t(∑h​Rw,h​)t(∑w′,h​ηw′,j,h​), where t=Re⁡Tr⁡t=\operatorname{Re}\operatorname{Tr}t=ReTr. Restrict this extension to w≠jw\ne jw=j and normalize by its mass if that mass is positive, otherwise retain the original extension, calling the result rrr. The trace distance between its block-diagonal matrix and that of Mw,j,h=t(∑h′rw,j,h′) ∑w′rw′,j,h/t(∑w′,h′rw′,j,h′)M_{w,j,h}=t(\sum_{h'}r_{w,j,h'})\,\sum_{w'}r_{w',j,h}/t(\sum_{w',h'}r_{w',j,h'})Mw,j,h​=t(∑h′​rw,j,h′​)∑w′​rw′,j,h​/t(∑w′,h′​rw′,j,h′​) is at most

2−(1/4−λ)d−log⁡2m−q−ℓ−12+2−(λ2log⁡2e32(2−log⁡2λ)2d−log⁡2m−3).2^{-\frac{(1/4-\lambda)d-\log_2m-q-\ell-1}{2}} + 2^{-\left(\frac{\lambda^2\log_2e}{32(2-\log_2\lambda)^2}d-\log_2m-3\right)}.2−2(1/4−λ)d−log2​m−q−ℓ−1​+2−(32(2−log2​λ)2λ2log2​e​d−log2​m−3).

Trace distance here is one half of the real trace of D†D\sqrt{D^\dagger D}D†D​ for the difference DDD of the two block matrices; any zero denominator in MMM gives zero. No additional positive lower bounds on n,ℓ,d,qn,\ell,d,qn,ℓ,d,q are hypotheses.

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