Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Balancing local setting bias and exact accepted yield

Open
QAlgorithms.Papers.Independent.Intakethird100.P47.balanced_input_bias_and_yield

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let p(a,b∣A,B)p(a,b\mid A,B)p(a,b∣A,B) be a nonnegative binary conditional distribution normalized for each pair of settings, and let w(A,B)w(A,B)w(A,B) be a nonnegative normalized input law. The joint law is w(A,B)p(a,b∣A,B)w(A,B)p(a,b\mid A,B)w(A,B)p(a,b∣A,B). Set S={a=b=0}S=\{a=b=0\}S={a=b=0}, s=∑A,Bw(A,B)p(00∣A,B)s=\sum_{A,B}w(A,B)p(00\mid A,B)s=∑A,B​w(A,B)p(00∣A,B), and, when s>0s>0s>0, let J(A,B)=w(A,B)p(00∣A,B)/sJ(A,B)=w(A,B)p(00\mid A,B)/sJ(A,B)=w(A,B)p(00∣A,B)/s be the accepted setting law.

Let x=p(00∣00)>0x=p(00\mid00)>0x=p(00∣00)>0, y=p(00∣11)>0y=p(00\mid11)>0y=p(00∣11)>0, and assume both cross-setting acceptance probabilities vanish. Choose independent settings with Pr⁡[A=0]=Pr⁡[B=0]=r∈[0,1]\Pr[A=0]=\Pr[B=0]=r\in[0,1]Pr[A=0]=Pr[B=0]=r∈[0,1]. Acceptance has positive probability even at the endpoints. With rb=y/(x+y)∈(0,1)r_b=\sqrt y/(\sqrt x+\sqrt y)\in(0,1)rb​=y​/(x​+y​)∈(0,1),

(∀k, Pr⁡[A=k∣S]=12)  ⟺  xr2=y(1−r)2  ⟺  r=rb.\bigl(\forall k,\ \Pr[A=k\mid S]=\tfrac12\bigr) \iff xr^2=y(1-r)^2\iff r=r_b.(∀k, Pr[A=k∣S]=21​)⟺xr2=y(1−r)2⟺r=rb​.

At this balancing bias,

s=2xr2=2xy(x+y)2.s=2xr^2=\frac{2xy}{(\sqrt x+\sqrt y)^2}.s=2xr2=(x​+y​)22xy​.

For x=(55−11)/2x=(5\sqrt5-11)/2x=(55​−11)/2 and y=5−2y=\sqrt5-2y=5​−2, rb=(5−1)/2r_b=(\sqrt5-1)/2rb​=(5​−1)/2. This balances the raw key values and evaluates acceptance; it does not maximize a specified cryptographic rate.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P47
Formal statement
namespace QAlgorithms.Papers.Independent.Intakethird100.P47

open scoped ComplexConjugate

open scoped BigOperators

/-- VII B.2, PDF p.9, (19a,b): the unique equal local input bias balancing the ideal
accepted settings, with exact yield. The denominator is (sqrt(x)+sqrt(y)) squared.
The yield is a raw accepted-run probability, not an operational secrecy capacity. -/
theorem balanced_input_bias_and_yield (p : Behavior) (hp : IsBehavior p)
    (x y r : ℝ) (hx : 0 < x) (hy : 0 < y) (hr : 0 ≤ r ∧ r ≤ 1)
    (h00 : p false false false false = x) (h11 : p true true false false = y)
    (h10 : p true false false false = 0) (h01 : p false true false false = 0) :
    let w := binarySettingLaw r r
    let rb := Real.sqrt y / (Real.sqrt x + Real.sqrt y)
    0 < siftingProbability p w ∧ 0 < rb ∧ rb < 1 ∧
    ((∀ A, aliceMarginal (acceptedLaw p w) A = 1 / 2) ↔ x * r ^ 2 = y * (1 - r) ^ 2) ∧
    (x * r ^ 2 = y * (1 - r) ^ 2 ↔ r = rb) ∧
    (r = rb → siftingProbability p w = 2 * x * r ^ 2 ∧
      siftingProbability p w = 2 * x * y / (Real.sqrt x + Real.sqrt y) ^ 2) ∧
    (x = (5 * Real.sqrt 5 - 11) / 2 → y = Real.sqrt 5 - 2 →
      rb = (Real.sqrt 5 - 1) / 2) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P47
Source
Device-independent quantum key distribution based on measurement inputs, arXiv:1308.6447v3, PDF p. 9, VII B.2: balancing input distribution and exact ideal yield
Read-back

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

Identify false and true with 000 and 111. Let pABab∈Rp_{AB}^{ab}\in\mathbb RpABab​∈R be nonnegative for all A,B,a,b∈{0,1}A,B,a,b\in\{0,1\}A,B,a,b∈{0,1}, with ∑a,bpABab=1\sum_{a,b}p_{AB}^{ab}=1∑a,b​pABab​=1 for every A,BA,BA,B. Let x,y,r∈Rx,y,r\in\mathbb Rx,y,r∈R satisfy x>0x>0x>0, y>0y>0y>0, and 0≤r≤10\le r\le10≤r≤1, including the endpoints. Assume p0000=xp_{00}^{00}=xp0000​=x, p1100=yp_{11}^{00}=yp1100​=y, and p1000=p0100=0p_{10}^{00}=p_{01}^{00}=0p1000​=p0100​=0. Put q0=rq_0=rq0​=r, q1=1−rq_1=1-rq1​=1−r, wAB=qAqBw_{AB}=q_Aq_BwAB​=qA​qB​, S=∑A,BwABpAB00=xr2+y(1−r)2S=\sum_{A,B}w_{AB}p_{AB}^{00}=xr^2+y(1-r)^2S=∑A,B​wAB​pAB00​=xr2+y(1−r)2, JAB=wABpAB00/SJ_{AB}=w_{AB}p_{AB}^{00}/SJAB​=wAB​pAB00​/S, and rb=y/(x+y)r_b=\sqrt y/(\sqrt x+\sqrt y)rb​=y​/(x​+y​). Then S>0S>0S>0, 0<rb<10<r_b<10<rb​<1, and

(∀A, ∑BJAB=12)⟺xr2=y(1−r)2,xr2=y(1−r)2⟺r=rb.\left(\forall A,\ \sum_B J_{AB}=\frac12\right) \Longleftrightarrow xr^2=y(1-r)^2, \qquad xr^2=y(1-r)^2\Longleftrightarrow r=r_b.(∀A, B∑​JAB​=21​)⟺xr2=y(1−r)2,xr2=y(1−r)2⟺r=rb​.

If r=rbr=r_br=rb​, then S=2xr2S=2xr^2S=2xr2 and S=2xy/(x+y)2S=2xy/(\sqrt x+\sqrt y)^2S=2xy/(x​+y​)2. If additionally x=(55−11)/2x=(5\sqrt5-11)/2x=(55​−11)/2 and y=5−2y=\sqrt5-2y=5​−2, then rb=(5−1)/2r_b=(\sqrt5-1)/2rb​=(5​−1)/2.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me