Offline · exact source
Exact Lean source

MatrixFidelityMixtures

formalization/Cloning/MatrixFidelityMixtures.lean

Source hash: a01c82519555a42ba39e58b33f551b8f371e9dbc024ea39641fa768b2b828aea

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

Declarations in this module
1import Cloning.MatrixFidelity
2import Cloning.MatrixFidelityProjector
3import Mathlib.Analysis.Convex.Jensen
4import Mathlib.Tactic.Module
5import Mathlib.Tactic.Linarith
6 
7/-!
8# Concavity and finite mixtures for concrete matrix fidelity
9 
10Operator concavity of the positive square root is proved from a matrix variance
11identity and operator monotonicity. No concavity law is assumed.
12-/
13 
14noncomputable section
15open scoped BigOperators MatrixOrder ComplexOrder Matrix.Norms.L2Operator
16open Matrix
17namespace Cloning.MatrixFidelity
18 
19set_option backward.isDefEq.respectTransparency false
20 
21variable {n : Type*} [Fintype n] [DecidableEq n]
22local instance matrixMixturesCStarAlgebra : CStarAlgebra (Matrix n n ℂ) where
23 
24/-- The binary matrix variance identity; the matrices need not commute. -/
25lemma weighted_square_gap (U V : Matrix n n ℂ) (a b : ℝ) (hab : a + b = 1) :
26    a • (U * U) + b • (V * V) - (a • U + b • V) * (a • U + b • V) =
27      (a * b) • ((U - V) * (U - V)) := by
28  have hb : b = 1 - a := by linarith
29  rw [hb]
30  simp only [Matrix.add_mul, Matrix.mul_add, Matrix.sub_mul, Matrix.mul_sub,
31    smul_mul_assoc, mul_smul_comm]
32  module
33 
34/-- Operator concavity of the positive square root, proved by the variance
35identity and monotonicity of the square root. -/
36theorem sqrt_operator_concave {A B : Matrix n n ℂ}
37    (hA : A.PosSemidef) (hB : B.PosSemidef)
38    (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
39    a • CFC.sqrt A + b • CFC.sqrt B ≤ CFC.sqrt (a • A + b • B) := by
40  let H := a • CFC.sqrt A + b • CFC.sqrt B
41  let D := CFC.sqrt A - CFC.sqrt B
42  have hH : H.PosSemidef :=
43    ((sqrt_posSemidef A).smul ha).add ((sqrt_posSemidef B).smul hb)
44  have hD : D.conjTranspose = D := by
45    simp only [D, Matrix.conjTranspose_sub, sqrt_conjTranspose]
46  have hDD : (D * D).PosSemidef := by
47    simpa only [hD] using Matrix.posSemidef_conjTranspose_mul_self D
48  have hgap : a • A + b • B - H * H = (a * b) • (D * D) := by
49    simpa only [H, D, sqrt_mul_self hA, sqrt_mul_self hB] using
50      weighted_square_gap (CFC.sqrt A) (CFC.sqrt B) a b hab
51  have hle : H * H ≤ a • A + b • B := by
52    change (a • A + b • B - H * H).PosSemidef
53    rw [hgap]
54    exact hDD.smul (mul_nonneg ha hb)
55  have h := CFC.sqrt_le_sqrt (H * H) (a • A + b • B) hle
56  rw [CFC.sqrt_mul_self H hH.nonneg] at h
57  exact h
58 
59/-- Root fidelity is concave in its first positive matrix argument, with a
60fixed target matrix. -/
61theorem fidelity_concave_left {A B : Matrix n n ℂ}
62    (hA : A.PosSemidef) (hB : B.PosSemidef) (T : Matrix n n ℂ)
63    (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
64    a * fidelity A T + b * fidelity B T ≤ fidelity (a • A + b • B) T := by
65  have h := trace_re_mono (sqrt_operator_concave
66    (sandwich_posSemidef hA T) (sandwich_posSemidef hB T) a b ha hb hab)
67  have hs : CFC.sqrt T * (a • A + b • B) * CFC.sqrt T =
68      a • (CFC.sqrt T * A * CFC.sqrt T) + b • (CFC.sqrt T * B * CFC.sqrt T) := by
69    simp only [Matrix.mul_add, Matrix.add_mul, mul_smul_comm, smul_mul_assoc]
70  unfold fidelity
71  rw [hs]
72  simpa only [Matrix.trace_add, Matrix.trace_smul, Complex.add_re,
73    Complex.smul_re, smul_eq_mul] using h
74 
75omit [Fintype n] [DecidableEq n] in
76/-- The cone of positive semidefinite matrices is convex over the reals. -/
77lemma convex_posSemidef_matrices :
78    Convex ℝ {A : Matrix n n ℂ | A.PosSemidef} := by
79  intro A hA B hB a b ha hb _
80  exact (hA.smul ha).add (hB.smul hb)
81 
82/-- Concavity on the full positive cone in the standard Mathlib sense. -/
83theorem concaveOn_fidelity_left (T : Matrix n n ℂ) :
84    ConcaveOn ℝ {A : Matrix n n ℂ | A.PosSemidef} (fun A => fidelity A T) := by
85  refine ⟨convex_posSemidef_matrices, ?_⟩
86  intro A hA B hB a b ha hb hab
87  exact fidelity_concave_left hA hB T a b ha hb hab
88 
89/-- Mixing positive sector states does not decrease fidelity below the
90corresponding mixture of their individual fidelities. -/
91theorem fidelity_finite_mixture {ι : Type*} [Fintype ι]
92    (A : ι → Matrix n n ℂ) (T : Matrix n n ℂ) (w : ι → ℝ)
93    (hA : ∀ i, (A i).PosSemidef) (hw : ∀ i, 0 ≤ w i) (hsum : ∑ i, w i = 1) :
94    ∑ i, w i * fidelity (A i) T ≤ fidelity (∑ i, w i • A i) T := by
95  exact (concaveOn_fidelity_left T).le_map_sum
96    (fun i _ => hw i) hsum (fun i _ => hA i)
97 
98/-- A uniform lower sector-fidelity bound survives arbitrary finite probability
99mixtures; no choice of a particular input sector is needed. -/
100theorem fidelity_finite_mixture_lower {ι : Type*} [Fintype ι]
101    (A : ι → Matrix n n ℂ) (T : Matrix n n ℂ) (w : ι → ℝ) (c : ℝ)
102    (hA : ∀ i, (A i).PosSemidef) (hw : ∀ i, 0 ≤ w i) (hsum : ∑ i, w i = 1)
103    (hc : ∀ i, 0 < w i → c ≤ fidelity (A i) T) :
104    c ≤ fidelity (∑ i, w i • A i) T := by
105  calc
106    c = ∑ i, w i * c := by rw [← Finset.sum_mul, hsum, one_mul]
107    _ ≤ ∑ i, w i * fidelity (A i) T := by
108      apply Finset.sum_le_sum
109      intro i _
110      by_cases hpos : 0 < w i
111      · exact mul_le_mul_of_nonneg_left (hc i hpos) (hw i)
112      · have hz : w i = 0 := le_antisymm (le_of_not_gt hpos) (hw i)
113        simp only [hz, zero_mul, le_refl]
114    _ ≤ _ := fidelity_finite_mixture A T w hA hw hsum
115 
116end Cloning.MatrixFidelity