Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Definitions for One-sided Device-Independent Quantum Key Distribution: Security, feasibility, and the connection with steering

Definition
QAlgorithms_Papers_Independent_Intakethird100_P94

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

prove2quantum

The objects the formalized statements of One-sided Device-Independent Quantum Key Distribution: Security, feasibility, and the connection with steering (arXiv:1109.1435) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • BobBases: PDF pp.2,6: Bob's two binary rank-one projective bases, as columns of unitaries.
  • basisEffect: PDF p.6, (S2): the rank-one projector for outcome b in basis j.
  • squaredOverlap: PDF pp.3,6, q of (S4): squared overlap of two specified basis vectors. The first vector is conjugated, consistently with the accepted inner-product convention.
  • maximumOverlap: PDF pp.3,6: the maximum over the FOUR pairs of binary basis vectors.
  • projectiveOverlapIncompatibility: PDF pp.3,6: q=-log2(max squared overlap), the projective specialization of [20]. Unitarity makes the maximum positive; q is computed, never supplied as a free bound. This overlap uncertainty parameter is distinct from Dependency50.P32.incompatibility, which is generalized POVM robustness (an ENNReal infimum of 1+r).
  • MutuallyUnbiased: PDF p.6, (S10): mutually unbiased qubit bases, including Pauli Z/X.
  • HiddenModel: PDF p.6, (S2): a single setting-independent normalized hidden ensemble. Alice's response may depend on her setting and the hidden state. Bob's response is Born's rule on that SAME state for every pair of settings. Integrability prevents Bochner's default value on non-integrable input; coordinate measurability expresses the usual standing convention for a continuous classical hidden variable. The no-click output is fixed in advance, and the detection flag is part of Alice's output.
  • observed: PDF p.6, (S2): actual observed P(a,s,b|i,j), including the flag. The integral permits arbitrary discrete or continuous ensembles, not just finite mixtures.
  • conditionalEntropyBits: PDF p.6, definitions following (S3): binary conditional Shannon entropy in bits. P is the joint law of the conditioning symbol x and binary B. Zero-mass rows contribute zero, so no conditional law is assigned to an impossible event.
  • binaryError: PDF p.6, (S7): disagreement probability for a joint binary law, without postselection.
  • detectionProbability: PDF p.6, (S6): Alice's detection probability at setting i, after Bob selection.
  • fullError: PDF p.6, (S7)--(S9): Q_i from all Alice outputs, including assigned no-click bits.
  • detectedErrorMass: PDF p.6, (S8),(S10): unnormalized probability of a detected disagreement.
  • weightedDetectedEntropy: PDF p.6, (S8),(S10): eta_i*h(Q_i^ps), with the zero-efficiency continuation explicitly defined to be zero. Conditional Q_i^ps is used only on a positive-mass branch.
  • flaggedConditionalEntropy: PDF p.6, (S5): entropy of the actual same-setting marginal B_i conditioned on (A_i,s_i). This definition never posits joint outcomes for Bob's two incompatible measurements.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Information

/-!
Statements from Branciard et al., arXiv:1109.1435v3, PDF p.6.
The operational security statements are explicitly deferred in the unit artifacts.
Bool false/true labels settings 1/2, binary outcomes, and no-click/click flags.
A single arbitrary probability space supplies the hidden ensemble for all settings.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Intakethird100.P94

open MeasureTheory
open scoped ComplexConjugate

/-- PDF pp.2,6: Bob's two binary rank-one projective bases, as columns of unitaries. -/
abbrev BobBases := Bool → Matrix.unitaryGroup Bool ℂ

/-- PDF p.6, (S2): the rank-one projector for outcome b in basis j. -/
def basisEffect (U : BobBases) (j b : Bool) : Matrix Bool Bool ℂ :=
  fun x y => (U j : Matrix Bool Bool ℂ) x b * conj ((U j : Matrix Bool Bool ℂ) y b)

/-- PDF pp.3,6, q of (S4): squared overlap of two specified basis vectors.
The first vector is conjugated, consistently with the accepted inner-product convention. -/
def squaredOverlap (U : BobBases) (a b : Bool) : ℝ :=
  Complex.normSq (∑ x : Bool,
    conj ((U false : Matrix Bool Bool ℂ) x a) * (U true : Matrix Bool Bool ℂ) x b)

/-- PDF pp.3,6: the maximum over the FOUR pairs of binary basis vectors. -/
def maximumOverlap (U : BobBases) : ℝ :=
  max (max (squaredOverlap U false false) (squaredOverlap U false true))
    (max (squaredOverlap U true false) (squaredOverlap U true true))

/-- PDF pp.3,6: q=-log2(max squared overlap), the projective specialization of [20].
Unitarity makes the maximum positive; q is computed, never supplied as a free bound.
This overlap uncertainty parameter is distinct from Dependency50.P32.incompatibility,
which is generalized POVM robustness (an ENNReal infimum of 1+r). -/
def projectiveOverlapIncompatibility (U : BobBases) : ℝ :=
  -Real.logb 2 (maximumOverlap U)

/-- PDF p.6, (S10): mutually unbiased qubit bases, including Pauli Z/X. -/
def MutuallyUnbiased (U : BobBases) : Prop :=
  ∀ a b, squaredOverlap U a b = 1 / 2

/-- PDF p.6, (S2): a single setting-independent normalized hidden ensemble.
Alice's response may depend on her setting and the hidden state. Bob's response is
Born's rule on that SAME state for every pair of settings. Integrability prevents
Bochner's default value on non-integrable input; coordinate measurability expresses
the usual standing convention for a continuous classical hidden variable.
The no-click output is fixed in advance, and the detection flag is part of Alice's output. -/
structure HiddenModel (Lambda : Type*) [MeasurableSpace Lambda] (U : BobBases) where
  law : Measure Lambda
  probability : IsProbabilityMeasure law
  rho : Lambda → Matrix Bool Bool ℂ
  normalized : ∀ l, QAlgorithms.IsDensityMatrix (rho l)
  rhoMeasurable : ∀ x y, Measurable (fun l => rho l x y)
  response : Bool → Lambda → Bool → Bool → ℝ
  responseNonneg : ∀ i l a s, 0 ≤ response i l a s
  responseSum : ∀ i l, ∑ a : Bool, ∑ s : Bool, response i l a s = 1
  responseMeasurable : ∀ i a s, Measurable (fun l => response i l a s)
  noClickBit : Bool → Bool
  assignedNoClick : ∀ i l a, a ≠ noClickBit i → response i l a false = 0
  bornIntegrable : ∀ i j a s b,
    Integrable (fun l => response i l a s *
      QAlgorithms.effectProb (basisEffect U j b) (rho l)) law

/-- PDF p.6, (S2): actual observed P(a,s,b|i,j), including the flag.
The integral permits arbitrary discrete or continuous ensembles, not just finite mixtures. -/
def observed {Lambda : Type*} [MeasurableSpace Lambda] {U : BobBases}
    (L : HiddenModel Lambda U) (i j a s b : Bool) : ℝ :=
  ∫ l, L.response i l a s * QAlgorithms.effectProb (basisEffect U j b) (L.rho l) ∂L.law

/-- PDF p.6, definitions following (S3): binary conditional Shannon entropy in bits.
P is the joint law of the conditioning symbol x and binary B. Zero-mass rows
contribute zero, so no conditional law is assigned to an impossible event. -/
def conditionalEntropyBits {X : Type*} [Fintype X] (P : X → Bool → ℝ) : ℝ :=
  ∑ x, if (∑ b : Bool, P x b) = 0 then 0 else
    (∑ b : Bool, P x b) * QAlgorithms.binEntropy2 (P x true / (∑ b : Bool, P x b))

/-- PDF p.6, (S7): disagreement probability for a joint binary law, without postselection. -/
def binaryError (P : Bool → Bool → ℝ) : ℝ :=
  ∑ a : Bool, ∑ b : Bool, if a ≠ b then P a b else 0

/-- PDF p.6, (S6): Alice's detection probability at setting i, after Bob selection. -/
def detectionProbability {Lambda : Type*} [MeasurableSpace Lambda] {U : BobBases}
    (L : HiddenModel Lambda U) (i : Bool) : ℝ :=
  ∑ a : Bool, ∑ b : Bool, observed L i i a true b

/-- PDF p.6, (S7)--(S9): Q_i from all Alice outputs, including assigned no-click bits. -/
def fullError {Lambda : Type*} [MeasurableSpace Lambda] {U : BobBases}
    (L : HiddenModel Lambda U) (i : Bool) : ℝ :=
  binaryError (fun a b => ∑ s : Bool, observed L i i a s b)

/-- PDF p.6, (S8),(S10): unnormalized probability of a detected disagreement. -/
def detectedErrorMass {Lambda : Type*} [MeasurableSpace Lambda] {U : BobBases}
    (L : HiddenModel Lambda U) (i : Bool) : ℝ :=
  binaryError (fun a b => observed L i i a true b)

/-- PDF p.6, (S8),(S10): eta_i*h(Q_i^ps), with the zero-efficiency continuation
explicitly defined to be zero. Conditional Q_i^ps is used only on a positive-mass branch. -/
def weightedDetectedEntropy {Lambda : Type*} [MeasurableSpace Lambda] {U : BobBases}
    (L : HiddenModel Lambda U) (i : Bool) : ℝ :=
  if detectionProbability L i = 0 then 0 else
    detectionProbability L i * QAlgorithms.binEntropy2
      (detectedErrorMass L i / detectionProbability L i)

/-- PDF p.6, (S5): entropy of the actual same-setting marginal B_i conditioned on (A_i,s_i).
This definition never posits joint outcomes for Bob's two incompatible measurements. -/
def flaggedConditionalEntropy {Lambda : Type*} [MeasurableSpace Lambda] {U : BobBases}
    (L : HiddenModel Lambda U) (i : Bool) : ℝ :=
  conditionalEntropyBits (fun t : Bool × Bool => fun b => observed L i i t.1 t.2 b)

/-- A zero-mass conditioning row contributes exactly zero. -/
example : conditionalEntropyBits (fun (_ : Unit) (_ : Bool) => (0 : ℝ)) = 0 := by
  simp [conditionalEntropyBits]

/-- Identity columns give the computational-basis rank-one projector. -/
example : basisEffect (fun _ => 1) false false false false = 1 := by
  simp [basisEffect]

/-- No detections give a zero entropy penalty; no conditional error is evaluated. -/
example {Lambda : Type*} [MeasurableSpace Lambda] {U : BobBases}
    (L : HiddenModel Lambda U) (i : Bool) (h : detectionProbability L i = 0) :
    weightedDetectedEntropy L i = 0 := by
  simp [weightedDetectedEntropy, h]

end QAlgorithms.Papers.Independent.Intakethird100.P94
Source
One-sided Device-Independent Quantum Key Distribution: Security, feasibility, and the connection with steering, arXiv:1109.1435v3, https://arxiv.org/abs/1109.1435v3
Read-back

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

QAlgorithms.Papers.Independent.Intakethird100.P94.BobBases

A value of this type is a family U=(Uj)j∈BU=(U_j)_{j\in B}U=(Uj​)j∈B​, where B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true} and each UjU_jUj​ is a complex unitary matrix whose rows and columns are indexed by BBB. Thus it specifies two 2×22\times22×2 matrices satisfying Uj∗Uj=UjUj∗=IU_j^\ast U_j=U_jU_j^\ast=IUj∗​Uj​=Uj​Uj∗​=I.

QAlgorithms.Papers.Independent.Intakethird100.P94.HiddenModel

Given any type Λ\LambdaΛ equipped with a measurable-space structure and any family U=(Uj)j∈BU=(U_j)_{j\in B}U=(Uj​)j∈B​ of complex 2×22\times22×2 unitary matrices, where B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, a value of this structure consists of a measure μ\muμ on Λ\LambdaΛ with μ(Λ)=1\mu(\Lambda)=1μ(Λ)=1; a function ρ:Λ→CB×B\rho:\Lambda\to\mathbb C^{B\times B}ρ:Λ→CB×B such that, for every ℓ∈Λ\ell\in\Lambdaℓ∈Λ, ρ(ℓ)\rho(\ell)ρ(ℓ) is positive semidefinite and has trace 111, and every entry function ℓ↦ρ(ℓ)x,y\ell\mapsto\rho(\ell)_{x,y}ℓ↦ρ(ℓ)x,y​ is measurable for all x,y∈Bx,y\in Bx,y∈B; a function r:B×Λ×B×B→Rr:B\times\Lambda\times B\times B\to\mathbb Rr:B×Λ×B×B→R such that r(i,ℓ,a,s)≥0r(i,\ell,a,s)\ge0r(i,ℓ,a,s)≥0 for every i,a,s∈Bi,a,s\in Bi,a,s∈B and ℓ∈Λ\ell\in\Lambdaℓ∈Λ, ∑a∈B∑s∈Br(i,ℓ,a,s)=1\sum_{a\in B}\sum_{s\in B}r(i,\ell,a,s)=1∑a∈B​∑s∈B​r(i,ℓ,a,s)=1 for every i,ℓi,\elli,ℓ, and ℓ↦r(i,ℓ,a,s)\ell\mapsto r(i,\ell,a,s)ℓ↦r(i,ℓ,a,s) is measurable for every i,a,si,a,si,a,s; and a function c:B→Bc:B\to Bc:B→B such that a≠c(i)a\ne c(i)a=c(i) implies r(i,ℓ,a,false)=0r(i,\ell,a,\mathrm{false})=0r(i,ℓ,a,false)=0 for every i,ℓ,ai,\ell,ai,ℓ,a. Finally, for every i,j,a,s,b∈Bi,j,a,s,b\in Bi,j,a,s,b∈B, the real function

ℓ⟼r(i,ℓ,a,s) Re⁡tr⁡ ⁣(Ej,bρ(ℓ)),(Ej,b)x,y=(Uj)x,b(Uj)y,b‾,\ell\longmapsto r(i,\ell,a,s)\, \operatorname{Re}\operatorname{tr}\!\bigl(E_{j,b}\rho(\ell)\bigr), \qquad (E_{j,b})_{x,y}=(U_j)_{x,b}\overline{(U_j)_{y,b}},ℓ⟼r(i,ℓ,a,s)Retr(Ej,b​ρ(ℓ)),(Ej,b​)x,y​=(Uj​)x,b​(Uj​)y,b​​,

must be integrable with respect to μ\muμ. The requirements on ρ\rhoρ and rrr hold at every ℓ\ellℓ, including points of measure zero; such data cannot exist if Λ\LambdaΛ is empty.

QAlgorithms.Papers.Independent.Intakethird100.P94.MutuallyUnbiased

For a family U=(Uj)j∈BU=(U_j)_{j\in B}U=(Uj​)j∈B​ of complex 2×22\times22×2 unitary matrices, where B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, this is the proposition that every pair of column indices a,b∈Ba,b\in Ba,b∈B satisfies

∣∑x∈B(Ufalse)x,a‾ (Utrue)x,b∣2=12.\left| \sum_{x\in B} \overline{(U_{\mathrm{false}})_{x,a}}\, (U_{\mathrm{true}})_{x,b} \right|^2 =\frac12.​x∈B∑​(Ufalse​)x,a​​(Utrue​)x,b​​2=21​.

QAlgorithms.Papers.Independent.Intakethird100.P94.basisEffect

For a family U=(Uj)j∈BU=(U_j)_{j\in B}U=(Uj​)j∈B​ of complex 2×22\times22×2 unitary matrices, with B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, and indices j,b∈Bj,b\in Bj,b∈B, this defines the complex matrix Ej,bE_{j,b}Ej,b​ with entries

(Ej,b)x,y=(Uj)x,b (Uj)y,b‾(x,y∈B).(E_{j,b})_{x,y}=(U_j)_{x,b}\,\overline{(U_j)_{y,b}} \qquad(x,y\in B).(Ej,b​)x,y​=(Uj​)x,b​(Uj​)y,b​​(x,y∈B).

It is the outer product of column bbb of UjU_jUj​ with its conjugate transpose.

QAlgorithms.Papers.Independent.Intakethird100.P94.binaryError

For any function P:B×B→RP:B\times B\to\mathbb RP:B×B→R, where B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, this defines

∑a∈B∑b∈B{P(a,b),a≠b,0,a=b,=P(false,true)+P(true,false).\sum_{a\in B}\sum_{b\in B} \begin{cases} P(a,b),&a\ne b,\\ 0,&a=b, \end{cases} = P(\mathrm{false},\mathrm{true}) + P(\mathrm{true},\mathrm{false}).a∈B∑​b∈B∑​{P(a,b),0,​a=b,a=b,​=P(false,true)+P(true,false).

No nonnegativity or normalization assumption is imposed on PPP.

QAlgorithms.Papers.Independent.Intakethird100.P94.conditionalEntropyBits

For any finite type XXX, with its supplied finite enumeration, and any function P:X×B→RP:X\times B\to\mathbb RP:X×B→R, where B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, set mx=P(x,false)+P(x,true)m_x=P(x,\mathrm{false})+P(x,\mathrm{true})mx​=P(x,false)+P(x,true). This defines

∑x∈X{0,mx=0,mx h2 ⁣(P(x,true)mx),mx≠0,h2(p)=−plog⁡p−(1−p)log⁡(1−p)log⁡2.\sum_{x\in X} \begin{cases} 0,&m_x=0,\\[2pt] m_x\,h_2\!\left(\dfrac{P(x,\mathrm{true})}{m_x}\right),&m_x\ne0, \end{cases} \qquad h_2(p)=\frac{-p\log p-(1-p)\log(1-p)}{\log2}.x∈X∑​⎩⎨⎧​0,mx​h2​(mx​P(x,true)​),​mx​=0,mx​=0,​h2​(p)=log2−plogp−(1−p)log(1−p)​.

Here the logarithms use the total real-logarithm convention: log⁡0=0\log0=0log0=0 and log⁡t=log⁡∣t∣\log t=\log|t|logt=log∣t∣ for negative ttt. There is no assumption that PPP is nonnegative or normalized, so the entropy argument need not belong to [0,1][0,1][0,1]; a zero row sum contributes zero even when it results from cancellation of nonzero entries. If XXX is empty, the sum is zero.

QAlgorithms.Papers.Independent.Intakethird100.P94.detectedErrorMass

Let B={0,1}\mathbb B=\{0,1\}B={0,1}, with 000 denoting false and 111 true. For any measurable space Λ\LambdaΛ, two unitary complex matrices U0,U1U_0,U_1U0​,U1​ indexed by B\mathbb BB, and a model LLL, the model consists of a probability measure μ\muμ on Λ\LambdaΛ; matrices ρλ\rho_\lambdaρλ​ that are positive semidefinite with trace 111 and have measurable entries; nonnegative responses ri(λ,a,s)r_i(\lambda,a,s)ri​(λ,a,s), measurable in λ\lambdaλ, satisfying ∑a,s∈Bri(λ,a,s)=1\sum_{a,s\in\mathbb B}r_i(\lambda,a,s)=1∑a,s∈B​ri​(λ,a,s)=1 for every i,λi,\lambdai,λ; and designated bits cic_ici​ such that ri(λ,a,0)=0r_i(\lambda,a,0)=0ri​(λ,a,0)=0 whenever a≠cia\ne c_ia=ci​. Set Ej,b(x,y)=Uj(x,b)Uj(y,b)‾E_{j,b}(x,y)=U_j(x,b)\overline{U_j(y,b)}Ej,b​(x,y)=Uj​(x,b)Uj​(y,b)​ and qj,b(λ)=Re⁡tr⁡(Ej,bρλ)q_{j,b}(\lambda)=\operatorname{Re}\operatorname{tr}(E_{j,b}\rho_\lambda)qj,b​(λ)=Retr(Ej,b​ρλ​); the model also requires every function ri(λ,a,s)qj,b(λ)r_i(\lambda,a,s)q_{j,b}(\lambda)ri​(λ,a,s)qj,b​(λ) to be integrable with respect to μ\muμ. For every i∈Bi\in\mathbb Bi∈B, the definition is the real number

detectedErrorMass⁡(L,i)=∑a,b∈Ba≠b∫Λri(λ,a,1)qi,b(λ) dμ(λ).\operatorname{detectedErrorMass}(L,i) =\sum_{\substack{a,b\in\mathbb B\\a\ne b}} \int_\Lambda r_i(\lambda,a,1)q_{i,b}(\lambda)\,d\mu(\lambda).detectedErrorMass(L,i)=a,b∈Ba=b​∑​∫Λ​ri​(λ,a,1)qi,b​(λ)dμ(λ).

This is an error mass without division by the detection probability, including when that probability is zero.

QAlgorithms.Papers.Independent.Intakethird100.P94.detectionProbability

Let Λ\LambdaΛ be any measurable space, let B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, and let UjU_jUj​ be a complex 2×22\times22×2 unitary matrix for each j∈Bj\in Bj∈B. The supplied model contains a probability measure μ\muμ; a matrix-valued function ρ\rhoρ with measurable entries, positive semidefinite values, and trace 111 at every ℓ∈Λ\ell\in\Lambdaℓ∈Λ; nonnegative responses r(i,ℓ,a,s)r(i,\ell,a,s)r(i,ℓ,a,s) measurable in ℓ\ellℓ and satisfying ∑a,s∈Br(i,ℓ,a,s)=1\sum_{a,s\in B}r(i,\ell,a,s)=1∑a,s∈B​r(i,ℓ,a,s)=1 for every i,ℓi,\elli,ℓ; and a function c:B→Bc:B\to Bc:B→B such that a≠c(i)a\ne c(i)a=c(i) implies r(i,ℓ,a,false)=0r(i,\ell,a,\mathrm{false})=0r(i,ℓ,a,false)=0. Define (Ej,b)x,y=(Uj)x,b(Uj)y,b‾(E_{j,b})_{x,y}=(U_j)_{x,b}\overline{(U_j)_{y,b}}(Ej,b​)x,y​=(Uj​)x,b​(Uj​)y,b​​; the model also requires integrability of ℓ↦r(i,ℓ,a,s)Re⁡tr⁡(Ej,bρ(ℓ))\ell\mapsto r(i,\ell,a,s)\operatorname{Re}\operatorname{tr}(E_{j,b}\rho(\ell))ℓ↦r(i,ℓ,a,s)Retr(Ej,b​ρ(ℓ)) for every i,j,a,s,b∈Bi,j,a,s,b\in Bi,j,a,s,b∈B. For each i∈Bi\in Bi∈B, this defines

∑a∈B∑b∈B∫Λr(i,ℓ,a,true) Re⁡tr⁡ ⁣(Ei,bρ(ℓ)) dμ(ℓ).\sum_{a\in B}\sum_{b\in B} \int_\Lambda r(i,\ell,a,\mathrm{true})\, \operatorname{Re}\operatorname{tr}\!\bigl(E_{i,b}\rho(\ell)\bigr) \,d\mu(\ell).a∈B∑​b∈B∑​∫Λ​r(i,ℓ,a,true)Retr(Ei,b​ρ(ℓ))dμ(ℓ).

Both setting indices are fixed to iii, the flag is fixed to true\mathrm{true}true, and both outcome indices are summed.

QAlgorithms.Papers.Independent.Intakethird100.P94.flaggedConditionalEntropy

Let B={0,1}\mathbb B=\{0,1\}B={0,1}, representing false and true respectively. For any measurable space Λ\LambdaΛ, two unitary complex matrices U0,U1U_0,U_1U0​,U1​ indexed by B\mathbb BB, and a model LLL, the supplied data are a probability measure μ\muμ; positive semidefinite matrices ρλ\rho_\lambdaρλ​ of trace 111, with measurable entries; nonnegative responses ri(λ,a,s)r_i(\lambda,a,s)ri​(λ,a,s), measurable in λ\lambdaλ, whose sum over a,sa,sa,s is 111 for every i,λi,\lambdai,λ; and bits cic_ici​ such that ri(λ,a,0)=0r_i(\lambda,a,0)=0ri​(λ,a,0)=0 whenever a≠cia\ne c_ia=ci​. Write Ej,b(x,y)=Uj(x,b)Uj(y,b)‾E_{j,b}(x,y)=U_j(x,b)\overline{U_j(y,b)}Ej,b​(x,y)=Uj​(x,b)Uj​(y,b)​ and qj,b(λ)=Re⁡tr⁡(Ej,bρλ)q_{j,b}(\lambda)=\operatorname{Re}\operatorname{tr}(E_{j,b}\rho_\lambda)qj,b​(λ)=Retr(Ej,b​ρλ​); every product ri(λ,a,s)qj,b(λ)r_i(\lambda,a,s)q_{j,b}(\lambda)ri​(λ,a,s)qj,b​(λ) is assumed integrable. For every i∈Bi\in\mathbb Bi∈B, define pi(a,s,b)=∫Λri(λ,a,s)qi,b(λ) dμ(λ)p_i(a,s,b)=\int_\Lambda r_i(\lambda,a,s)q_{i,b}(\lambda)\,d\mu(\lambda)pi​(a,s,b)=∫Λ​ri​(λ,a,s)qi,b​(λ)dμ(λ) and mi(a,s)=∑bpi(a,s,b)m_i(a,s)=\sum_b p_i(a,s,b)mi​(a,s)=∑b​pi​(a,s,b). Then

flaggedConditionalEntropy⁡(L,i)=∑a,s∈B{0,mi(a,s)=0,mi(a,s) h2 ⁣(pi(a,s,1)mi(a,s)),mi(a,s)≠0,\operatorname{flaggedConditionalEntropy}(L,i) =\sum_{a,s\in\mathbb B} \begin{cases} 0,&m_i(a,s)=0,\\ m_i(a,s)\,h_2\!\left(\dfrac{p_i(a,s,1)}{m_i(a,s)}\right),&m_i(a,s)\ne0, \end{cases}flaggedConditionalEntropy(L,i)=a,s∈B∑​⎩⎨⎧​0,mi​(a,s)h2​(mi​(a,s)pi​(a,s,1)​),​mi​(a,s)=0,mi​(a,s)=0,​

where h2(p)=−[pln⁡p+(1−p)ln⁡(1−p)]/ln⁡2h_2(p)=-[p\ln p+(1-p)\ln(1-p)]/\ln2h2​(p)=−[plnp+(1−p)ln(1−p)]/ln2, with 0ln⁡0=00\ln0=00ln0=0. Both values of the flag sss are included, and each zero-mass pair (a,s)(a,s)(a,s) contributes zero.

QAlgorithms.Papers.Independent.Intakethird100.P94.fullError

Let Λ\LambdaΛ be any measurable space, let B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, and let UjU_jUj​ be a complex 2×22\times22×2 unitary matrix for each j∈Bj\in Bj∈B. The supplied model contains a probability measure μ\muμ; a matrix-valued function ρ\rhoρ with measurable entries, positive semidefinite values, and trace 111 at every ℓ∈Λ\ell\in\Lambdaℓ∈Λ; nonnegative responses r(i,ℓ,a,s)r(i,\ell,a,s)r(i,ℓ,a,s) measurable in ℓ\ellℓ and satisfying ∑a,s∈Br(i,ℓ,a,s)=1\sum_{a,s\in B}r(i,\ell,a,s)=1∑a,s∈B​r(i,ℓ,a,s)=1 for every i,ℓi,\elli,ℓ; and a function c:B→Bc:B\to Bc:B→B such that a≠c(i)a\ne c(i)a=c(i) implies r(i,ℓ,a,false)=0r(i,\ell,a,\mathrm{false})=0r(i,ℓ,a,false)=0. Define (Ej,b)x,y=(Uj)x,b(Uj)y,b‾(E_{j,b})_{x,y}=(U_j)_{x,b}\overline{(U_j)_{y,b}}(Ej,b​)x,y​=(Uj​)x,b​(Uj​)y,b​​; the model also requires integrability of ℓ↦r(i,ℓ,a,s)Re⁡tr⁡(Ej,bρ(ℓ))\ell\mapsto r(i,\ell,a,s)\operatorname{Re}\operatorname{tr}(E_{j,b}\rho(\ell))ℓ↦r(i,ℓ,a,s)Retr(Ej,b​ρ(ℓ)) for every i,j,a,s,b∈Bi,j,a,s,b\in Bi,j,a,s,b∈B. For each i∈Bi\in Bi∈B, this defines

∑a,b∈Ba≠b ∑s∈B∫Λr(i,ℓ,a,s) Re⁡tr⁡ ⁣(Ei,bρ(ℓ)) dμ(ℓ).\sum_{\substack{a,b\in B\\a\ne b}} \ \sum_{s\in B} \int_\Lambda r(i,\ell,a,s)\, \operatorname{Re}\operatorname{tr}\!\bigl(E_{i,b}\rho(\ell)\bigr) \,d\mu(\ell).a,b∈Ba=b​∑​ s∈B∑​∫Λ​r(i,ℓ,a,s)Retr(Ei,b​ρ(ℓ))dμ(ℓ).

Thus both setting indices are fixed to iii, only unequal outcome indices contribute, and both values of the flag sss are included.

QAlgorithms.Papers.Independent.Intakethird100.P94.maximumOverlap

For a family U=(Uj)j∈BU=(U_j)_{j\in B}U=(Uj​)j∈B​ of complex 2×22\times22×2 unitary matrices, where B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, this defines

max⁡ ⁣{∣∑x∈B(Ufalse)x,a‾ (Utrue)x,b∣2: a,b∈B}.\max\!\left\{ \left| \sum_{x\in B} \overline{(U_{\mathrm{false}})_{x,a}}\, (U_{\mathrm{true}})_{x,b} \right|^2 :\ a,b\in B \right\}.max⎩⎨⎧​​x∈B∑​(Ufalse​)x,a​​(Utrue​)x,b​​2: a,b∈B⎭⎬⎫​.

Thus the maximum is taken over all four choices of the two column indices.

QAlgorithms.Papers.Independent.Intakethird100.P94.observed

Let Λ\LambdaΛ be any measurable space, let B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, and let UjU_jUj​ be a complex 2×22\times22×2 unitary matrix for each j∈Bj\in Bj∈B. Suppose the supplied model consists of a probability measure μ\muμ on Λ\LambdaΛ, matrices ρ(ℓ)\rho(\ell)ρ(ℓ) that are positive semidefinite with trace 111 for every ℓ\ellℓ and have measurable entry functions, nonnegative responses r(i,ℓ,a,s)r(i,\ell,a,s)r(i,ℓ,a,s) measurable in ℓ\ellℓ and satisfying ∑a,s∈Br(i,ℓ,a,s)=1\sum_{a,s\in B}r(i,\ell,a,s)=1∑a,s∈B​r(i,ℓ,a,s)=1 for every i,ℓi,\elli,ℓ, and a function c:B→Bc:B\to Bc:B→B satisfying r(i,ℓ,a,false)=0r(i,\ell,a,\mathrm{false})=0r(i,ℓ,a,false)=0 whenever a≠c(i)a\ne c(i)a=c(i). Write (Ej,b)x,y=(Uj)x,b(Uj)y,b‾(E_{j,b})_{x,y}=(U_j)_{x,b}\overline{(U_j)_{y,b}}(Ej,b​)x,y​=(Uj​)x,b​(Uj​)y,b​​, and assume, as part of the model, that every function ℓ↦r(i,ℓ,a,s)Re⁡tr⁡(Ej,bρ(ℓ))\ell\mapsto r(i,\ell,a,s)\operatorname{Re}\operatorname{tr}(E_{j,b}\rho(\ell))ℓ↦r(i,ℓ,a,s)Retr(Ej,b​ρ(ℓ)) is μ\muμ-integrable for all Boolean indices i,j,a,s,bi,j,a,s,bi,j,a,s,b. For any such indices, this defines the real number

∫Λr(i,ℓ,a,s) Re⁡tr⁡ ⁣(Ej,bρ(ℓ)) dμ(ℓ).\int_\Lambda r(i,\ell,a,s)\, \operatorname{Re}\operatorname{tr}\!\bigl(E_{j,b}\rho(\ell)\bigr) \,d\mu(\ell).∫Λ​r(i,ℓ,a,s)Retr(Ej,b​ρ(ℓ))dμ(ℓ).

QAlgorithms.Papers.Independent.Intakethird100.P94.projectiveOverlapIncompatibility

For a family U=(Uj)j∈BU=(U_j)_{j\in B}U=(Uj​)j∈B​ of complex 2×22\times22×2 unitary matrices, where B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, this defines the real number

−log⁡2 ⁣(max⁡a,b∈B∣∑x∈B(Ufalse)x,a‾ (Utrue)x,b∣2).-\log_2\!\left( \max_{a,b\in B} \left| \sum_{x\in B} \overline{(U_{\mathrm{false}})_{x,a}}\, (U_{\mathrm{true}})_{x,b} \right|^2 \right).−log2​​a,b∈Bmax​​x∈B∑​(Ufalse​)x,a​​(Utrue​)x,b​​2​.

The logarithm here is the real base-222 logarithm.

QAlgorithms.Papers.Independent.Intakethird100.P94.squaredOverlap

For a family U=(Uj)j∈BU=(U_j)_{j\in B}U=(Uj​)j∈B​ of complex 2×22\times22×2 unitary matrices, where B={false,true}B=\{\mathrm{false},\mathrm{true}\}B={false,true}, and column indices a,b∈Ba,b\in Ba,b∈B, this defines the real number

ca,b=∣∑x∈B(Ufalse)x,a‾ (Utrue)x,b∣2.c_{a,b} = \left| \sum_{x\in B} \overline{(U_{\mathrm{false}})_{x,a}}\, (U_{\mathrm{true}})_{x,b} \right|^2.ca,b​=​x∈B∑​(Ufalse​)x,a​​(Utrue​)x,b​​2.

Here the squared complex modulus of a number zzz means (Re⁡z)2+(Im⁡z)2(\operatorname{Re}z)^2+(\operatorname{Im}z)^2(Rez)2+(Imz)2.

QAlgorithms.Papers.Independent.Intakethird100.P94.weightedDetectedEntropy

Let B={0,1}\mathbb B=\{0,1\}B={0,1}, with false represented by 000 and true by 111. For any measurable space Λ\LambdaΛ, two unitary complex matrices U0,U1U_0,U_1U0​,U1​ indexed by B\mathbb BB, and a model LLL, assume that LLL supplies a probability measure μ\muμ; positive semidefinite trace-one matrices ρλ\rho_\lambdaρλ​ with measurable entries; and responses ri(λ,a,s)r_i(\lambda,a,s)ri​(λ,a,s) that are nonnegative, measurable in λ\lambdaλ, and satisfy ∑a,sri(λ,a,s)=1\sum_{a,s}r_i(\lambda,a,s)=1∑a,s​ri​(λ,a,s)=1 for every i,λi,\lambdai,λ. It also supplies bits cic_ici​ with ri(λ,a,0)=0r_i(\lambda,a,0)=0ri​(λ,a,0)=0 for a≠cia\ne c_ia=ci​. Define Ej,b(x,y)=Uj(x,b)Uj(y,b)‾E_{j,b}(x,y)=U_j(x,b)\overline{U_j(y,b)}Ej,b​(x,y)=Uj​(x,b)Uj​(y,b)​, qj,b(λ)=Re⁡tr⁡(Ej,bρλ)q_{j,b}(\lambda)=\operatorname{Re}\operatorname{tr}(E_{j,b}\rho_\lambda)qj,b​(λ)=Retr(Ej,b​ρλ​), and pi(a,s,b)=∫Λri(λ,a,s)qi,b(λ) dμ(λ)p_i(a,s,b)=\int_\Lambda r_i(\lambda,a,s)q_{i,b}(\lambda)\,d\mu(\lambda)pi​(a,s,b)=∫Λ​ri​(λ,a,s)qi,b​(λ)dμ(λ); all products ri(λ,a,s)qj,b(λ)r_i(\lambda,a,s)q_{j,b}(\lambda)ri​(λ,a,s)qj,b​(λ), for every choice of indices, are required to be integrable. For every i∈Bi\in\mathbb Bi∈B, put ηi=∑a,bpi(a,1,b)\eta_i=\sum_{a,b}p_i(a,1,b)ηi​=∑a,b​pi​(a,1,b) and ei=∑a≠bpi(a,1,b)e_i=\sum_{a\ne b}p_i(a,1,b)ei​=∑a=b​pi​(a,1,b). With h2(p)=−[pln⁡p+(1−p)ln⁡(1−p)]/ln⁡2h_2(p)=-[p\ln p+(1-p)\ln(1-p)]/\ln2h2​(p)=−[plnp+(1−p)ln(1−p)]/ln2, using 0ln⁡0=00\ln0=00ln0=0, the definition is

weightedDetectedEntropy⁡(L,i)={0,ηi=0,ηih2(ei/ηi),ηi≠0.\operatorname{weightedDetectedEntropy}(L,i)= \begin{cases} 0,&\eta_i=0,\\ \eta_i h_2(e_i/\eta_i),&\eta_i\ne0. \end{cases}weightedDetectedEntropy(L,i)={0,ηi​h2​(ei​/ηi​),​ηi​=0,ηi​=0.​

In particular, the zero-efficiency branch returns zero without using a conditional error ratio.

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