Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3: one code meets five reliability and secrecy bounds

Open
QAlgorithms.Papers.Independent.Intake100.P73.wiretap_one_shot

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

prove2quantum

Let B:X→P(Y)B:X\to\mathcal P(Y)B:X→P(Y) and E:X→P(Z)E:X\to\mathcal P(Z)E:X→P(Z) be classical discrete channels with a common input, and let p∈P(X)p\in\mathcal P(X)p∈P(X). No degradedness assumption is imposed. Fix positive integers L,ML,ML,M and independent threshold parameters C,C′>0C,C'>0C,C′>0. For a channel VVV define Vp=∑xp(x)VxV_p=\sum_xp(x)V_xVp​=∑x​p(x)Vx​, ϕ(t∣V,p)=log⁡∑y(∑xp(x)Vx(y)1/(1+t))1+t\phi(t\mid V,p)=\log\sum_y(\sum_xp(x)V_x(y)^{1/(1+t)})^{1+t}ϕ(t∣V,p)=log∑y​(∑x​p(x)Vx​(y)1/(1+t))1+t, δV=PpV{Vx/Vp>C}\delta_V=\mathbb P_{pV}\{V_x/V_p>C\}δV​=PpV​{Vx​/Vp​>C}, δV′=∑xp(x)∑Vx/Vp≤CVx2/Vp\delta'_V=\sum_xp(x)\sum_{V_x/V_p\le C}V_x^2/V_pδV′​=∑x​p(x)∑Vx​/Vp​≤C​Vx2​/Vp​, and η(a)=−alog⁡a\eta(a)=-a\log aη(a)=−aloga, with null-support and zero-entropy terms treated by their usual conventions.

There is ONE stochastic wiretap code Φ\PhiΦ of exactly MMM equiprobable messages with pairwise disjoint Bob regions, for which

ϵB(Φ)≤3inf⁡0≤s≤1(ML)seϕ(s∣B,p),ϵB(Φ)≤3(PpB{Bx/Bp≤C′}+ML/C′),\epsilon_B(\Phi)\le3\inf_{0\le s\le1}(ML)^s e^{\phi(s\mid B,p)},\qquad \epsilon_B(\Phi)\le3\left(\mathbb P_{pB}\{B_x/B_p\le C'\}+ML/C'\right),ϵB​(Φ)≤30≤s≤1inf​(ML)seϕ(s∣B,p),ϵB​(Φ)≤3(PpB​{Bx​/Bp​≤C′}+ML/C′), IE(Φ)≤3inf⁡−1/2≤t<0log⁡(1+Lteϕ(t∣E,p))−t,dE(Φ)≤6(2δE+δE′/L).I_E(\Phi)\le3\inf_{-1/2\le t<0}\frac{\log(1+L^te^{\phi(t\mid E,p)})}{-t},\qquad d_E(\Phi)\le6\left(2\delta_E+\sqrt{\delta'_E/L}\right).IE​(Φ)≤3−1/2≤t<0inf​−tlog(1+Lteϕ(t∣E,p))​,dE​(Φ)≤6(2δE​+δE′​/L​).

If ZZZ is finite, this same code additionally satisfies

IE(Φ)≤3(η(δE)+δElog⁡∣Z∣+δE′/L).I_E(\Phi)\le3\left(\eta(\delta_E)+\delta_E\log|Z|+\delta'_E/L\right).IE​(Φ)≤3(η(δE​)+δE​log∣Z∣+δE′​/L).

Here ϵB\epsilon_BϵB​ is average Bob error, IE=M−1∑iD(EQi∥M−1∑jEQj)I_E=M^{-1}\sum_i D(E_{Q_i}\|M^{-1}\sum_jE_{Q_j})IE​=M−1∑i​D(EQi​​∥M−1∑j​EQj​​), and dEd_EdE​ is average full L1 over ordered distinct message pairs, defined as zero for M=1M=1M=1. All logarithms are natural. The simultaneous guarantee controls the reliability and both secrecy criteria of one actual code.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intake100_P73
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intake100.P73

open Filter

open scoped BigOperators ENNReal Topology

attribute [local instance] Classical.propDecidable Classical.decEq

universe u

/-- Hayashi, PDF pp.6–7, Theorem 3, (19)–(23): ONE code meets ALL five bounds.
Only (21) is conditional on finite Z. M=1 has empty pair-average leakage zero. -/
theorem wiretap_one_shot {X Y Z : Type*}
    (B : X → Y → ℝ≥0∞) (E : X → Z → ℝ≥0∞)
    (hB : IsDiscreteStochastic B) (hE : IsDiscreteStochastic E) (p : PMF X)
    (L M : ℕ) (hL : 0 < L) (hM : 0 < M) (C Cp : ℝ) (hC : 0 < C) (hCp : 0 < Cp) :
    ∃ c : DiscreteStochasticWiretapCode X Y, c.messages = M ∧
      (averageBobError B c : EReal) ≤ 3 * sInf
        ((fun s : ℝ => ((((M * L : ℕ) : ℝ≥0∞) ^ s * phiMoment B p s : ℝ≥0∞) : EReal)) '' Set.Icc 0 1) ∧
      averageBobError B c ≤ ENNReal.ofReal (3 * (lowTail B p Cp + ((M * L : ℕ) : ℝ) / Cp)) ∧
      (Finite Z → averageEveDivergence E c ≤ ENNReal.ofReal (3 * entropyBound E p L C)) ∧
      (averageEveDivergence E c : EReal) ≤ 3 * sInf
        ((fun t : ℝ => klBound E p L t) '' Set.Ico (-(1 / 2)) 0) ∧
      eveDistance E c ≤ ENNReal.ofReal (6 * l1Bound E p C L) := by sorry

end QAlgorithms.Papers.Independent.Intake100.P73

end
Source
General non-asymptotic and asymptotic formulas in channel resolvability and identification capacity and their application to wire-tap channel, arXiv:cs/0503088v2, PDF p. 6, Theorem 3, (19)–(23): one wiretap code with reliability and secrecy bounds
Read-back

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

For any types X,Y,ZX,Y,ZX,Y,Z, functions B:X×Y→[0,∞]B:X\times Y\to[0,\infty]B:X×Y→[0,∞] and E:X×Z→[0,∞]E:X\times Z\to[0,\infty]E:X×Z→[0,∞] satisfying ∑y′B(x,y)=1\sum'_yB(x,y)=1∑y′​B(x,y)=1 and ∑z′E(x,z)=1\sum'_zE(x,z)=1∑z′​E(x,z)=1 for every xxx, a probability mass function ppp on XXX, positive integers L,ML,ML,M, and positive reals C,C′C,C'C,C′, the theorem asserts that there exist probability mass functions r1,…,rMr_1,\ldots,r_Mr1​,…,rM​ on XXX and pairwise disjoint sets D1,…,DM⊆YD_1,\ldots,D_M\subseteq YD1​,…,DM​⊆Y satisfying all the bounds below simultaneously. Write bi(y)=∑x′ri(x)B(x,y)b_i(y)=\sum'_x r_i(x)B(x,y)bi​(y)=∑x′​ri​(x)B(x,y), ei(z)=∑x′ri(x)E(x,z)e_i(z)=\sum'_x r_i(x)E(x,z)ei​(z)=∑x′​ri​(x)E(x,z), eˉ(z)=M−1∑i=1Mei(z)\bar e(z)=M^{-1}\sum_{i=1}^M e_i(z)eˉ(z)=M−1∑i=1M​ei​(z), and

β=1M∑i=1M∑y′{0,y∈Di,bi(y),y∉Di,η=1M∑i=1MDK(ei,eˉ).\beta=\frac1M\sum_{i=1}^M\sum'_y \begin{cases}0,&y\in D_i,\\b_i(y),&y\notin D_i,\end{cases} \qquad \eta=\frac1M\sum_{i=1}^M D_K(e_i,\bar e).β=M1​i=1∑M​y∑′​{0,bi​(y),​y∈Di​,y∈/Di​,​η=M1​i=1∑M​DK​(ei​,eˉ).

Here D1(P,Q)=∑v′((P(v)\dotminusQ(v))+(Q(v)\dotminusP(v)))D_1(P,Q)=\sum'_v((P(v)\mathbin{\dotminus}Q(v))+(Q(v)\mathbin{\dotminus}P(v)))D1​(P,Q)=∑v′​((P(v)\dotminusQ(v))+(Q(v)\dotminusP(v))), with truncated subtraction, and DK(P,Q)=∑v′A(P(v),Q(v))D_K(P,Q)=\sum'_v A(P(v),Q(v))DK​(P,Q)=∑v′​A(P(v),Q(v)), where A(a,b)=bA(a,b)=bA(a,b)=b if a=0a=0a=0, A(a,b)=+∞A(a,b)=+\inftyA(a,b)=+∞ if a≠0,b=0a\ne0,b=0a=0,b=0, and otherwise

A(a,b)=b[ρ(a)ρ(b)log⁡ ⁣(ρ(a)ρ(b))−ρ(a)ρ(b)+1]+.A(a,b)=b\left[ \frac{\rho(a)}{\rho(b)}\log\!\left(\frac{\rho(a)}{\rho(b)}\right) -\frac{\rho(a)}{\rho(b)}+1\right]_+.A(a,b)=b[ρ(b)ρ(a)​log(ρ(b)ρ(a)​)−ρ(b)ρ(a)​+1]+​.

The map ρ\rhoρ converts extended nonnegative numbers to reals, sending +∞+\infty+∞ to 000, and [r]+=max⁡(r,0)[r]_+=\max(r,0)[r]+​=max(r,0) is embedded in [0,∞][0,\infty][0,∞]. For F=BF=BF=B or F=EF=EF=E, with its corresponding output type, define

qF(v)=∑x′p(x)F(x,v),ΦF(t)=∑v′(∑x′p(x)F(x,v)1/(1+t))1+t,q_F(v)=\sum'_x p(x)F(x,v), \qquad \Phi_F(t)=\sum'_v \left(\sum'_x p(x)F(x,v)^{1/(1+t)}\right)^{1+t},qF​(v)=x∑′​p(x)F(x,v),ΦF​(t)=v∑′​(x∑′​p(x)F(x,v)1/(1+t))1+t, uF=ρ ⁣(∑x′∑v′1{p(x)>0, qF(v)>0, C<F(x,v)/qF(v)}p(x)F(x,v)),δF=∑x′∑v′1{p(x)>0, qF(v)>0, F(x,v)/qF(v)≤C}p(x)F(x,v)2qF(v),u_F=\rho\!\left(\sum'_x\sum'_v \mathbf1_{\{p(x)>0,\ q_F(v)>0,\ C<F(x,v)/q_F(v)\}} p(x)F(x,v)\right), \quad \delta_F=\sum'_x\sum'_v \mathbf1_{\{p(x)>0,\ q_F(v)>0,\ F(x,v)/q_F(v)\le C\}} \frac{p(x)F(x,v)^2}{q_F(v)},uF​=ρ(x∑′​v∑′​1{p(x)>0, qF​(v)>0, C<F(x,v)/qF​(v)}​p(x)F(x,v)),δF​=x∑′​v∑′​1{p(x)>0, qF​(v)>0, F(x,v)/qF​(v)≤C}​qF​(v)p(x)F(x,v)2​,

and define

ℓB=ρ ⁣(∑x′∑y′1{B(x,y)/qB(y)≤C′}p(x)B(x,y)).\ell_B=\rho\!\left(\sum'_x\sum'_y \mathbf1_{\{B(x,y)/q_B(y)\le C'\}}p(x)B(x,y)\right).ℓB​=ρ(x∑′​y∑′​1{B(x,y)/qB​(y)≤C′}​p(x)B(x,y)).

Each indicated summand is zero outside its condition; in particular, the definition of ℓB\ell_BℓB​ has no additional positivity conditions, and its ratio uses total extended nonnegative division. With h(a)=0h(a)=0h(a)=0 if a=0a=0a=0, and h(a)=−alog⁡ah(a)=-a\log ah(a)=−aloga otherwise, the simultaneous bounds are

β≤3inf⁡0≤s≤1(ML)sΦB(s),β≤[3(ℓB+MLC′)]+,\beta\le3\inf_{0\le s\le1}(ML)^s\Phi_B(s), \qquad \beta\le\left[3\left(\ell_B+\frac{ML}{C'}\right)\right]_+,β≤30≤s≤1inf​(ML)sΦB​(s),β≤[3(ℓB​+C′ML​)]+​, if Z is finite,η≤[3(h(uE)+uElog⁡∣Z∣+ρ(δE)L)]+,η≤3inf⁡−1/2≤t<0log⁡(1+LtΦE(t))−t,\text{if $Z$ is finite,}\qquad \eta\le\left[3\left(h(u_E)+u_E\log|Z|+\frac{\rho(\delta_E)}L\right)\right]_+, \qquad \eta\le3\inf_{-1/2\le t<0} \frac{\log(1+L^t\Phi_E(t))}{-t},if Z is finite,η≤[3(h(uE​)+uE​log∣Z∣+Lρ(δE​)​)]+​,η≤3−1/2≤t<0inf​−tlog(1+LtΦE​(t))​, d≤[6(2uE+ρ(δE)L)]+,d={0,M=1,1M(M−1)∑i=1M∑j=1M{0,i=j,D1(ei,ej),i≠j,M≠1.d\le\left[6\left(2u_E+\sqrt{\frac{\rho(\delta_E)}L}\right)\right]_+, \qquad d= \begin{cases} 0,&M=1,\\[2pt] \displaystyle\frac1{M(M-1)} \sum_{i=1}^M\sum_{j=1}^M \begin{cases}0,&i=j,\\D_1(e_i,e_j),&i\ne j,\end{cases} &M\ne1. \end{cases}d≤[6(2uE​+Lρ(δE​)​​)]+​,d=⎩⎨⎧​0,M(M−1)1​i=1∑M​j=1∑M​{0,D1​(ei​,ej​),​i=j,i=j,​​M=1,M=1.​

The first bound on β\betaβ and the infimum bound on η\etaη are inequalities in the extended reals; their infima are taken there, and the latter uses the extended logarithm, which sends 000 to −∞-\infty−∞ and +∞+\infty+∞ to +∞+\infty+∞. The interval for sss includes both endpoints, while the interval for ttt includes −12-\tfrac12−21​ and excludes 000. The regions need not cover YYY and may be empty. The hypotheses exclude L=0L=0L=0, M=0M=0M=0, and nonpositive thresholds, and force X,Y,ZX,Y,ZX,Y,Z to be nonempty; M=1M=1M=1 is allowed, in which case the disjointness condition is vacuous and d=0d=0d=0.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 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