Definitions for Composable security proof for continuous-variable quantum key distribution with coherent states
DefinitionQAlgorithms_Papers_Independent_Intake100_P61The objects the formalized statements of Composable security proof for continuous-variable quantum key distribution with coherent states (arXiv:1408.5689) are stated in. Each was checked against the paper by a blind read-back and a moderator.
vectorSquare: PDF pp.20–22: Euclidean squared norm of unbundled coordinates.realDot: PDF pp.21–22: real Euclidean inner product.firstCoordinates: PDF pp.20–22: first k coordinates, padded with zeros in the original space.halfProjection: PDF pp.20–21: actual projection U* P_k U v. A normalized invariant Borel probability on U(m) or O(m) is Haar; the range U* span(e_0,...,e_(k-1)) is uniform.pairDensityLaw: PDF p.22: actual density Q(X,Y) against 8n-dimensional Lebesgue measure.transposeRotation: PDF p.22: literal symmetry (X,Y) -> (O X,O^T Y). No identification with the passive optical U(2n) action is made.nonnegativeVolume: PDF pp.22–23: nonnegative half-line Lebesgue reference measure.quadrantLaw: PDF pp.22–23: one joint law constructed from p on the nonnegative quadrant.firstMarginalDensity: PDF pp.22–23: marginal density from that same p.densityConditionalMean: PDF pp.22–23, E21/E28: extended conditional mean from p(y|x)=p(x,y)/p_X(x). This differs from Advance50.P02.conditionalMean, which is a finite cq entropy. Zero or infinite marginal-density fibers are null for a probability law and are assigned zero. Infinite means on positive finite fibers remain infinity.empiricalEntropy: PDF pp.17–18, D26: plug-in one-symbol entropy in bits.iidWordProbability: PDF pp.17–18: iid event probability with actual product weights from p.
import Mathlib
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P30
/-! Leverrier, arXiv:1408.5689v3. Classical components with explicit laws.
Source corrections and deferred quantum interfaces are recorded in the unit.
Compilation is pending the separate mechanical handoff. -/
noncomputable section
open MeasureTheory Filter
open scoped BigOperators ENNReal Topology
namespace QAlgorithms.Papers.Independent.Intake100.P61
attribute [local instance] Classical.propDecidable Classical.decEq
-- The frozen frequency formula specializes exactly to the source alphabet Fin (2 ^ d).
open QAlgorithms.Papers.Independent.Advance50.P30 (empiricalFrequency)
/-- PDF pp.20–21: Borel outcomes on U(m) over C or O(m) over R. -/
instance rotationMeasurable (K : Type) [RCLike K] (m : ℕ) :
MeasurableSpace (Matrix.unitaryGroup (Fin m) K) := borel _
/-- PDF pp.20–21: the preceding sigma algebra is precisely Borel. -/
instance rotationBorel (K : Type) [RCLike K] (m : ℕ) :
BorelSpace (Matrix.unitaryGroup (Fin m) K) := ⟨rfl⟩
/-- PDF pp.20–22: Euclidean squared norm of unbundled coordinates. -/
def vectorSquare {K : Type} [RCLike K] {m : ℕ} (v : Fin m → K) : ℝ :=
∑ i, ‖v i‖ ^ 2
/-- PDF pp.21–22: real Euclidean inner product. -/
def realDot {m : ℕ} (v w : Fin m → ℝ) : ℝ := ∑ i, v i * w i
/-- PDF pp.20–22: first k coordinates, padded with zeros in the original space. -/
def firstCoordinates {K : Type} [Zero K] {m : ℕ} (k : ℕ) (v : Fin m → K) : Fin m → K :=
fun i => if i.val < k then v i else 0
/-- PDF pp.20–21: actual projection U* P_k U v. A normalized invariant Borel
probability on U(m) or O(m) is Haar; the range U* span(e_0,...,e_(k-1)) is uniform. -/
def halfProjection {K : Type} [RCLike K] {m : ℕ}
(U : Matrix.unitaryGroup (Fin m) K) (k : ℕ) (v : Fin m → K) : Fin m → K :=
(star (U : Matrix (Fin m) (Fin m) K)).mulVec
(firstCoordinates k ((U : Matrix (Fin m) (Fin m) K).mulVec v))
example {K : Type} [RCLike K] {m : ℕ} : vectorSquare (0 : Fin m → K) = 0 := by
simp [vectorSquare]
example {m : ℕ} (v : Fin m → ℝ) : realDot v 0 = 0 := by
simp [realDot]
example {K : Type} [Zero K] {m : ℕ} (v : Fin m → K) : firstCoordinates 0 v = 0 := by
funext i
simp [firstCoordinates]
example {K : Type} [RCLike K] {m : ℕ}
(U : Matrix.unitaryGroup (Fin m) K) (k : ℕ) : halfProjection U k 0 = 0 := by
have hzero : firstCoordinates k (0 : Fin m → K) = 0 := by
funext i
simp [firstCoordinates]
simp only [halfProjection, Matrix.mulVec_zero, hzero]
/-- PDF p.22: actual density Q(X,Y) against 8n-dimensional Lebesgue measure. -/
def pairDensityLaw (n : ℕ)
(q : ((Fin (4 * n) → ℝ) × (Fin (4 * n) → ℝ)) → ℝ≥0∞) :
Measure ((Fin (4 * n) → ℝ) × (Fin (4 * n) → ℝ)) := volume.withDensity q
/-- PDF p.22: literal symmetry (X,Y) -> (O X,O^T Y).
No identification with the passive optical U(2n) action is made. -/
def transposeRotation {m : ℕ} (O : Matrix.unitaryGroup (Fin m) ℝ)
(v : (Fin m → ℝ) × (Fin m → ℝ)) : (Fin m → ℝ) × (Fin m → ℝ) :=
((O : Matrix (Fin m) (Fin m) ℝ).mulVec v.1,
(O : Matrix (Fin m) (Fin m) ℝ).transpose.mulVec v.2)
example (n : ℕ) : pairDensityLaw n (fun _ => 0) = 0 := by
simp [pairDensityLaw]
example {m : ℕ} (O : Matrix.unitaryGroup (Fin m) ℝ) :
transposeRotation O (0, 0) = (0, 0) := by
simp [transposeRotation, Matrix.mulVec]
/-- PDF pp.22–23: nonnegative half-line Lebesgue reference measure. -/
def nonnegativeVolume : Measure ℝ := volume.restrict (Set.Ici 0)
/-- PDF pp.22–23: one joint law constructed from p on the nonnegative quadrant. -/
def quadrantLaw (p : ℝ × ℝ → ℝ≥0∞) : Measure (ℝ × ℝ) :=
(nonnegativeVolume.prod nonnegativeVolume).withDensity p
/-- PDF pp.22–23: marginal density from that same p. -/
def firstMarginalDensity (p : ℝ × ℝ → ℝ≥0∞) (x : ℝ) : ℝ≥0∞ :=
∫⁻ y, p (x, y) ∂nonnegativeVolume
/-- PDF pp.22–23, E21/E28: extended conditional mean from p(y|x)=p(x,y)/p_X(x).
This differs from Advance50.P02.conditionalMean, which is a finite cq entropy.
Zero or infinite marginal-density fibers are null for a probability law and
are assigned zero. Infinite means on positive finite fibers remain infinity. -/
def densityConditionalMean (p : ℝ × ℝ → ℝ≥0∞) (x : ℝ) : ℝ≥0∞ :=
let px := firstMarginalDensity p x
if px = 0 ∨ px = ⊤ then 0
else ∫⁻ y, ENNReal.ofReal y * (p (x, y) / px) ∂nonnegativeVolume
example : quadrantLaw (fun _ => 0) = 0 := by
simp [quadrantLaw]
example (x : ℝ) : firstMarginalDensity (fun _ => 0) x = 0 := by
simp [firstMarginalDensity]
example (x : ℝ) : densityConditionalMean (fun _ => 0) x = 0 := by
simp [densityConditionalMean, firstMarginalDensity]
/-- PDF pp.17–18, D26: plug-in one-symbol entropy in bits. -/
def empiricalEntropy {d n : ℕ} (word : Fin n → Fin (2 ^ d)) : ℝ :=
-∑ a, empiricalFrequency word a * Real.logb 2 (empiricalFrequency word a)
/-- PDF pp.17–18: iid event probability with actual product weights from p. -/
def iidWordProbability {d : ℕ} (p : Fin (2 ^ d) → ℝ) (n : ℕ)
(event : (Fin n → Fin (2 ^ d)) → Prop) : ℝ :=
∑ word : Fin n → Fin (2 ^ d), if event word then ∏ i, p (word i) else 0
example {d n : ℕ} (a : Fin (2 ^ d)) :
empiricalFrequency (fun _ : Fin n => a) a = (n : ℝ) / n := by
simp [empiricalFrequency]
example {d : ℕ} (p : Fin (2 ^ d) → ℝ) (n : ℕ) :
iidWordProbability p n (fun _ => False) = 0 := by
simp [iidWordProbability]
example {d : ℕ} (word : Fin 0 → Fin (2 ^ d)) : empiricalEntropy word = 0 := by
simp [empiricalEntropy, empiricalFrequency]
end QAlgorithms.Papers.Independent.Intake100.P61
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intake100.P61.densityConditionalMean
For any function and any , put . This defines the extended-real quantity
Here is regarded as a nonnegative extended real and equals on the integration domain. The second branch can itself be infinite. No measurability or probability assumption is required, and the definition also applies when .
QAlgorithms.Papers.Independent.Intake100.P61.empiricalEntropy
For arbitrary natural numbers , including zero, and a word , define its empirical frequency at symbol by
This declaration defines the real number
Real division and logarithms are totalized: division by zero and both give zero. Thus unobserved symbols contribute zero, and when , every empirical frequency and the resulting entropy are zero. When , the alphabet has one symbol.
QAlgorithms.Papers.Independent.Intake100.P61.firstCoordinates
For every type with a specified zero element, every natural number , every natural number , and every vector , define a vector of the same length by
No condition is imposed: , and whenever . For , the result is the unique vector on the empty index set.
QAlgorithms.Papers.Independent.Intake100.P61.firstMarginalDensity
For any function and any real number , this defines
as a nonnegative extended-real integral. The result may be zero or infinite. The definition applies to negative as well, and imposes no measurability or normalization assumption on .
QAlgorithms.Papers.Independent.Intake100.P61.halfProjection
For every field equipped with a real-or-complex scalar structure, every natural number , every unitary matrix over , every natural number , and every vector , define
where is the conjugate transpose and for and otherwise. The parameter is unrestricted: the result is for and for . This also includes .
QAlgorithms.Papers.Independent.Intake100.P61.iidWordProbability
For any natural number , any real-valued function on the alphabet , any natural number , and any predicate on words of length over that alphabet, this defines
There is no requirement that the values of be nonnegative or sum to one, so this real number need not be a probability. For , there is one empty word and its product is , giving if that word satisfies and otherwise; gives a one-symbol alphabet.
QAlgorithms.Papers.Independent.Intake100.P61.nonnegativeVolume
Define a measure on by restricting Lebesgue measure to the closed nonnegative half-line ; thus a measurable set has measure equal to the Lebesgue measure of .
QAlgorithms.Papers.Independent.Intake100.P61.pairDensityLaw
For every natural number and every function , define the measure obtained by weighting Lebesgue measure by :
for measurable sets . No measurability, finiteness, or normalization assumption on is included in this definition, and is allowed.
QAlgorithms.Papers.Independent.Intake100.P61.quadrantLaw
For any function , this defines the measure obtained by weighting the product of two copies of Lebesgue measure restricted to by the density . No measurability, normalization, or finiteness assumption is imposed on ; in particular, the resulting measure is not required to be a probability measure.
QAlgorithms.Papers.Independent.Intake100.P61.realDot
For every natural number and every pair of real vectors , define
When , this empty sum is .
QAlgorithms.Papers.Independent.Intake100.P61.rotationBorel
For every field equipped with a real-or-complex scalar structure and every natural number , the measurable structure on the group of unitary matrices over is its Borel measurable structure. This includes .
QAlgorithms.Papers.Independent.Intake100.P61.rotationMeasurable
For every field equipped with a real-or-complex scalar structure, including its norm and conjugation, and every natural number , the group of unitary matrices over is equipped with the Borel measurable structure generated by its topology. This includes .
QAlgorithms.Papers.Independent.Intake100.P61.transposeRotation
For every natural number , every real orthogonal matrix , and every pair , define
Thus the first component is multiplied by and the second by its transpose. This includes .
QAlgorithms.Papers.Independent.Intake100.P61.vectorSquare
For every field equipped with a real-or-complex scalar structure, every natural number , and every vector , define the real number
When , this empty sum is .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.