Definitions for One-sided Device-Independent Quantum Key Distribution: Security, feasibility, and the connection with steering
DefinitionQAlgorithms_Papers_Independent_Intakethird100_P94The 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.
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
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 , where and each is a complex unitary matrix whose rows and columns are indexed by . Thus it specifies two matrices satisfying .
QAlgorithms.Papers.Independent.Intakethird100.P94.HiddenModel
Given any type equipped with a measurable-space structure and any family of complex unitary matrices, where , a value of this structure consists of a measure on with ; a function such that, for every , is positive semidefinite and has trace , and every entry function is measurable for all ; a function such that for every and , for every , and is measurable for every ; and a function such that implies for every . Finally, for every , the real function
must be integrable with respect to . The requirements on and hold at every , including points of measure zero; such data cannot exist if is empty.
QAlgorithms.Papers.Independent.Intakethird100.P94.MutuallyUnbiased
For a family of complex unitary matrices, where , this is the proposition that every pair of column indices satisfies
QAlgorithms.Papers.Independent.Intakethird100.P94.basisEffect
For a family of complex unitary matrices, with , and indices , this defines the complex matrix with entries
It is the outer product of column of with its conjugate transpose.
QAlgorithms.Papers.Independent.Intakethird100.P94.binaryError
For any function , where , this defines
No nonnegativity or normalization assumption is imposed on .
QAlgorithms.Papers.Independent.Intakethird100.P94.conditionalEntropyBits
For any finite type , with its supplied finite enumeration, and any function , where , set . This defines
Here the logarithms use the total real-logarithm convention: and for negative . There is no assumption that is nonnegative or normalized, so the entropy argument need not belong to ; a zero row sum contributes zero even when it results from cancellation of nonzero entries. If is empty, the sum is zero.
QAlgorithms.Papers.Independent.Intakethird100.P94.detectedErrorMass
Let , with denoting false and true. For any measurable space , two unitary complex matrices indexed by , and a model , the model consists of a probability measure on ; matrices that are positive semidefinite with trace and have measurable entries; nonnegative responses , measurable in , satisfying for every ; and designated bits such that whenever . Set and ; the model also requires every function to be integrable with respect to . For every , the definition is the real number
This is an error mass without division by the detection probability, including when that probability is zero.
QAlgorithms.Papers.Independent.Intakethird100.P94.detectionProbability
Let be any measurable space, let , and let be a complex unitary matrix for each . The supplied model contains a probability measure ; a matrix-valued function with measurable entries, positive semidefinite values, and trace at every ; nonnegative responses measurable in and satisfying for every ; and a function such that implies . Define ; the model also requires integrability of for every . For each , this defines
Both setting indices are fixed to , the flag is fixed to , and both outcome indices are summed.
QAlgorithms.Papers.Independent.Intakethird100.P94.flaggedConditionalEntropy
Let , representing false and true respectively. For any measurable space , two unitary complex matrices indexed by , and a model , the supplied data are a probability measure ; positive semidefinite matrices of trace , with measurable entries; nonnegative responses , measurable in , whose sum over is for every ; and bits such that whenever . Write and ; every product is assumed integrable. For every , define and . Then
where , with . Both values of the flag are included, and each zero-mass pair contributes zero.
QAlgorithms.Papers.Independent.Intakethird100.P94.fullError
Let be any measurable space, let , and let be a complex unitary matrix for each . The supplied model contains a probability measure ; a matrix-valued function with measurable entries, positive semidefinite values, and trace at every ; nonnegative responses measurable in and satisfying for every ; and a function such that implies . Define ; the model also requires integrability of for every . For each , this defines
Thus both setting indices are fixed to , only unequal outcome indices contribute, and both values of the flag are included.
QAlgorithms.Papers.Independent.Intakethird100.P94.maximumOverlap
For a family of complex unitary matrices, where , this defines
Thus the maximum is taken over all four choices of the two column indices.
QAlgorithms.Papers.Independent.Intakethird100.P94.observed
Let be any measurable space, let , and let be a complex unitary matrix for each . Suppose the supplied model consists of a probability measure on , matrices that are positive semidefinite with trace for every and have measurable entry functions, nonnegative responses measurable in and satisfying for every , and a function satisfying whenever . Write , and assume, as part of the model, that every function is -integrable for all Boolean indices . For any such indices, this defines the real number
QAlgorithms.Papers.Independent.Intakethird100.P94.projectiveOverlapIncompatibility
For a family of complex unitary matrices, where , this defines the real number
The logarithm here is the real base- logarithm.
QAlgorithms.Papers.Independent.Intakethird100.P94.squaredOverlap
For a family of complex unitary matrices, where , and column indices , this defines the real number
Here the squared complex modulus of a number means .
QAlgorithms.Papers.Independent.Intakethird100.P94.weightedDetectedEntropy
Let , with false represented by and true by . For any measurable space , two unitary complex matrices indexed by , and a model , assume that supplies a probability measure ; positive semidefinite trace-one matrices with measurable entries; and responses that are nonnegative, measurable in , and satisfy for every . It also supplies bits with for . Define , , and ; all products , for every choice of indices, are required to be integrable. For every , put and . With , using , the definition is
In particular, the zero-efficiency branch returns zero without using a conditional error ratio.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.