Offline · exact source
Exact Lean source

MatrixFidelityBlockBound

formalization/Cloning/MatrixFidelityBlockBound.lean

Source hash: ee41538d406e8334e48499cd7738063c7b830d1197b67926bc2dce7e57205e38

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.MatrixTraceOrder
2import Cloning.MatrixFidelitySymmetry
3import Cloning.MatrixFidelityWitness
4import Mathlib.Data.Matrix.ColumnRowPartitioned
5import Mathlib.Tactic.Linarith
6 
7/-!
8# Positive block matrices bound root fidelity
9 
10A positive block matrix with diagonal blocks `A`, `B` and off-diagonal block
11`X` satisfies `Re (trace X) ≤ fidelity A B`. The proof uses a positive-definite
12trace-pairing bound and then removes strict positivity by regularization.
13-/
14 
15noncomputable section
16open scoped Matrix MatrixOrder ComplexOrder Topology
17open Matrix Filter
18 
19namespace Cloning.MatrixFidelity
20 
21set_option autoImplicit false
22set_option backward.isDefEq.respectTransparency false
23 
24variable {n : Type*} [Fintype n] [DecidableEq n]
25 
26/-- Testing a positive block matrix against the column `(H, -I)` gives a
27positive matrix even when the blocks do not commute. -/
28theorem block_quadratic_posSemidef {A B X H : Matrix n n ℂ}
29    (hblock : (Matrix.fromBlocks A X Xᴴ B).PosSemidef)
30    (hH : H.IsHermitian) :
31    (H * A * H - H * X - Xᴴ * H + B).PosSemidef := by
32  have h := hblock.conjTranspose_mul_mul_same (Matrix.fromRows H (-1))
33  rw [Matrix.conjTranspose_fromRows_eq_fromCols_conjTranspose,
34    hH.eq, Matrix.conjTranspose_neg, Matrix.conjTranspose_one,
35    Matrix.fromCols_mul_fromBlocks, Matrix.fromCols_mul_fromRows] at h
36  simpa only [neg_mul, one_mul, mul_neg, mul_one, add_mul,
37    add_neg_cancel_right, sub_eq_add_neg, neg_add_rev, neg_neg,
38    add_assoc, add_left_comm, add_comm] using h
39 
40/-- Every positive-definite weight gives the weighted arithmetic upper bound
41on the real off-diagonal trace of a positive block matrix. -/
42theorem block_trace_weighted_bound {A B X H : Matrix n n ℂ}
43    (hblock : (Matrix.fromBlocks A X Xᴴ B).PosSemidef)
44    (hH : H.PosDef) :
45    2 * (Matrix.trace X).re ≤
46      (Matrix.trace (A * H)).re + (Matrix.trace (B * H⁻¹)).re := by
47  have hQ := block_quadratic_posSemidef hblock hH.isHermitian
48  have hpair := trace_mul_re_nonneg hQ hH.inv.posSemidef
49  have hHi : IsUnit H.det := (Matrix.isUnit_iff_isUnit_det H).mp hH.isUnit
50  have hmul : H * H⁻¹ = 1 := Matrix.mul_nonsing_inv H hHi
51  have hfirst : Matrix.trace (H * A * H * H⁻¹) = Matrix.trace (A * H) := by
52    rw [Matrix.mul_assoc (H * A) H H⁻¹, hmul, Matrix.mul_one,
53      Matrix.trace_mul_comm H A]
54  have hsecond : Matrix.trace (H * X * H⁻¹) = Matrix.trace X := by
55    rw [Matrix.trace_mul_cycle, Matrix.nonsing_inv_mul H hHi, Matrix.one_mul]
56  have hthird : Matrix.trace (Xᴴ * H * H⁻¹) = star (Matrix.trace X) := by
57    rw [Matrix.mul_assoc, hmul, Matrix.mul_one, Matrix.trace_conjTranspose]
58  simp only [Matrix.add_mul, Matrix.sub_mul, Matrix.trace_add, Matrix.trace_sub,
59    Complex.add_re, Complex.sub_re] at hpair
60  rw [hfirst, hsecond, hthird] at hpair
61  have hstar : (star (Matrix.trace X)).re = (Matrix.trace X).re := rfl
62  rw [hstar] at hpair
63  linarith
64 
65/-- At an optimal positive-definite weight the two weighted trace terms
66coincide, so the off-diagonal trace is bounded by root fidelity. -/
67theorem trace_re_le_fidelity_of_block_and_witness {A B X H : Matrix n n ℂ}
68    (hblock : (Matrix.fromBlocks A X Xᴴ B).PosSemidef)
69    (hH : H.PosDef) (hHAH : H * A * H = B)
70    (hoptimal : (Matrix.trace (A * H)).re = fidelity A B) :
71    (Matrix.trace X).re ≤ fidelity A B := by
72  have hbound := block_trace_weighted_bound hblock hH
73  have hHi : IsUnit H.det := (Matrix.isUnit_iff_isUnit_det H).mp hH.isUnit
74  have hterm : Matrix.trace (B * H⁻¹) = Matrix.trace (A * H) := by
75    rw [← hHAH, Matrix.mul_assoc (H * A) H H⁻¹,
76      Matrix.mul_nonsing_inv H hHi, Matrix.mul_one, Matrix.trace_mul_comm H A]
77  rw [hterm, hoptimal] at hbound
78  linarith
79 
80omit [Fintype n] in
81/-- Scalar regularization of both diagonal blocks preserves positivity
82without changing the off-diagonal block. -/
83theorem block_regularize_posSemidef {A B X : Matrix n n ℂ}
84    (hblock : (Matrix.fromBlocks A X Xᴴ B).PosSemidef)
85    {ε : ℝ} (hε : 0 ≤ ε) :
86    (Matrix.fromBlocks (Cloning.MatrixRegularization.regularize A ε) X Xᴴ
87      (Cloning.MatrixRegularization.regularize B ε)).PosSemidef := by
88  have h := Cloning.MatrixRegularization.regularize_posSemidef hblock hε
89  have heq : Cloning.MatrixRegularization.regularize (Matrix.fromBlocks A X Xᴴ B) ε =
90      Matrix.fromBlocks (Cloning.MatrixRegularization.regularize A ε) X Xᴴ
91        (Cloning.MatrixRegularization.regularize B ε) := by
92    unfold Cloning.MatrixRegularization.regularize
93    rw [← Matrix.fromBlocks_one (l := n) (m := n), Matrix.fromBlocks_smul,
94      Matrix.fromBlocks_add]
95    simp only [smul_zero, add_zero]
96  rwa [heq] at h
97 
98omit [Fintype n] [DecidableEq n] in
99/-- The diagonal blocks of a positive block matrix are positive. -/
100theorem block_diagonal_posSemidef {A B X : Matrix n n ℂ}
101    (hblock : (Matrix.fromBlocks A X Xᴴ B).PosSemidef) :
102    A.PosSemidef ∧ B.PosSemidef :=
103  ⟨hblock.submatrix Sum.inl, hblock.submatrix Sum.inr⟩
104 
105/-- The block trace bound for positive-definite diagonal blocks, obtained by
106constructing the optimal geometric-mean weight. -/
107theorem trace_re_le_fidelity_of_block_posSemidef_posDef {A B X : Matrix n n ℂ}
108    (hA : A.PosDef) (hB : B.PosDef)
109    (hblock : (Matrix.fromBlocks A X Xᴴ B).PosSemidef) :
110    (Matrix.trace X).re ≤ fidelity A B := by
111  obtain ⟨H, hH, hHAH, htrace⟩ := exists_fidelity_witness hA hB
112  exact trace_re_le_fidelity_of_block_and_witness hblock hH hHAH htrace
113 
114/-- Every positive block matrix bounds its off-diagonal real trace by the
115root fidelity of its diagonal blocks. No invertibility or normalization is
116assumed; singular diagonal blocks are handled by positive regularization. -/
117theorem trace_re_le_fidelity_of_block_posSemidef {A B X : Matrix n n ℂ}
118    (hblock : (Matrix.fromBlocks A X Xᴴ B).PosSemidef) :
119    (Matrix.trace X).re ≤ fidelity A B := by
120  obtain ⟨hA, hB⟩ := block_diagonal_posSemidef hblock
121  let ε : ℕ → ℝ := fun k => 1 / ((k : ℝ) + 1)
122  have hε (k : ℕ) : 0 < ε k := by
123    dsimp [ε]
124    positivity
125  let Aseq := fun k => Cloning.MatrixRegularization.regularize A (ε k)
126  let Bseq := fun k => Cloning.MatrixRegularization.regularize B (ε k)
127  have hAseq (k : ℕ) : (Aseq k).PosDef :=
128    Cloning.MatrixRegularization.regularize_posDef hA (hε k)
129  have hBseq (k : ℕ) : (Bseq k).PosDef :=
130    Cloning.MatrixRegularization.regularize_posDef hB (hε k)
131  have hAlim : Tendsto Aseq atTop (𝓝 A) :=
132    (Cloning.MatrixRegularization.tendsto_regularize_zero A).comp
133      tendsto_one_div_add_atTop_nhds_zero_nat
134  have hBlim : Tendsto Bseq atTop (𝓝 B) :=
135    (Cloning.MatrixRegularization.tendsto_regularize_zero B).comp
136      tendsto_one_div_add_atTop_nhds_zero_nat
137  have hlim := tendsto_fidelity hA hB (fun k => (hAseq k).posSemidef)
138    (fun k => (hBseq k).posSemidef) hAlim hBlim
139  apply le_of_tendsto_of_tendsto tendsto_const_nhds hlim
140  exact Filter.Eventually.of_forall (fun k =>
141    trace_re_le_fidelity_of_block_posSemidef_posDef (hAseq k) (hBseq k)
142      (block_regularize_posSemidef hblock (hε k).le))
143 
144end Cloning.MatrixFidelity