Offline · exact source
Exact Lean source

TensorGibbsTruncation

formalization/Cloning/TensorGibbsTruncation.lean

Source hash: ccba33d6561f2625df573f0afa886ba60c7c7cfb0482b9098616b30c41388bdd

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.InfiniteFiniteCorner
2import Cloning.TensorLANEmbeddingAction
3 
4/-! Positive spectral truncation in an actual finite orthonormal frame. The
5trace-norm error is exactly the discarded trace, without a square-root loss. -/
6noncomputable section
7open scoped BigOperators InnerProductSpace ComplexOrder
8namespace Cloning.InfiniteTraceClass
9open Cloning.InfiniteFiniteCorner
10set_option maxHeartbeats 1000000
11set_option backward.isDefEq.respectTransparency false
12variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H]
13variable {ι : Type*} [Fintype ι] [DecidableEq ι]
14 
15theorem projection_isStarProjection {v : ι → H} (hv : Orthonormal ℂ v) :
16    IsStarProjection (projection v) := by
17  constructor
18  · change ofMatrix v 1 * ofMatrix v 1 = ofMatrix v 1
19    rw [← ofMatrix_mul hv, one_mul]
20  · change star (ofMatrix v 1) = ofMatrix v 1
21    rw [← ofMatrix_conjTranspose, Matrix.conjTranspose_one]
22 
23theorem mul_projection_eq_eigenmatrix (A : H →L[ℂ] H) (v : ι → H) (lam : ι → ℝ)
24    (hev : ∀ i, A (v i) = (lam i : ℂ) • v i) :
25    A * projection v = ofMatrix v (Matrix.diagonal (fun i => (lam i : ℂ))) := by
26  ext x
27  simp only [ContinuousLinearMap.mul_apply, projection_apply, map_sum, map_smul, hev,
28    ofMatrix_apply, Matrix.diagonal_apply, ite_mul, zero_mul]
29  simp only [Finset.sum_ite_eq, Finset.mem_univ, if_true, smul_smul]
30  apply Finset.sum_congr rfl
31  intro i _
32  rw [mul_comm]
33 
34theorem spectralFrame_residual_nonneg (A : TraceClass H) (hA : 0 ≤ A.1)
35    (v : ι → H) (hv : Orthonormal ℂ v) (lam : ι → ℝ)
36    (hev : ∀ i, A.1 (v i) = (lam i : ℂ) • v i) :
37    0 ≤ (A - frameMatrix v (Matrix.diagonal (fun i => (lam i : ℂ)))).1 := by
38  let P := projection v
39  let B := ofMatrix v (Matrix.diagonal (fun i => (lam i : ℂ)))
40  have hP : IsStarProjection P := projection_isStarProjection hv
41  have hB : IsSelfAdjoint B := by
42    change star (ofMatrix v _) = ofMatrix v _
43    rw [← ofMatrix_conjTranspose]
44    congr 1
45    ext i j
46    by_cases h : i = j
47    · subst j; simp [Matrix.diagonal_apply]
48    · simp [Matrix.diagonal_apply, h, Ne.symm h]
49  have hAP : A.1 * P = B := mul_projection_eq_eigenmatrix A.1 v lam hev
50  have hPA : P * A.1 = B := by
51    have hs := congrArg star hAP
52    simpa only [star_mul, hP.isSelfAdjoint.star_eq, (IsSelfAdjoint.of_nonneg hA).star_eq,
53      hB.star_eq] using hs
54  have hPAP : P * A.1 * P = B := by
55    rw [mul_assoc, hAP]
56    change ofMatrix v 1 * ofMatrix v _ = _
57    rw [← ofMatrix_mul hv, one_mul]
58  have he : A.1 - B = (1-P) * A.1 * (1-P) := by
59    calc
60      _ = A.1 - A.1 * P - P * A.1 + P * A.1 * P := by rw [hPAP,hAP,hPA]; abel
61      _ = _ := by noncomm_ring
62  change 0 ≤ A.1 - B
63  rw [he]
64  exact hP.one_sub.isSelfAdjoint.conjugate_nonneg hA
65 
66theorem spectralFrame_residual_norm (A : TraceClass H) (hA : 0 ≤ A.1)
67    (v : ι → H) (hv : Orthonormal ℂ v) (lam : ι → ℝ)
68    (hev : ∀ i, A.1 (v i) = (lam i : ℂ) • v i) :
69    ‖A - frameMatrix v (Matrix.diagonal (fun i => (lam i : ℂ)))‖ =
70      (traceCLM A).re - ∑ i, lam i := by
71  rw [TraceClass.norm_eq_trace_re_of_nonneg _ (spectralFrame_residual_nonneg A hA v hv lam hev)]
72  change (traceCLM (A - frameMatrix v (Matrix.diagonal (fun i => (lam i : ℂ))))).re = _
73  rw [map_sub, Complex.sub_re]
74  congr 1
75  have hh := trace_ofMatrix hv (Matrix.diagonal (fun i => (lam i : ℂ)))
76  change traceCLM (frameMatrix v (Matrix.diagonal (fun i => (lam i : ℂ)))) = _ at hh
77  rw [hh]
78  simp only [Matrix.trace_diagonal, Complex.re_sum, Complex.ofReal_re]
79 
80 
81theorem frameMatrix_diagonal (v : ι → H) (a : ι → ℝ) :
82    frameMatrix v (Matrix.diagonal (fun i => (a i : ℂ))) =
83      ∑ i, (a i : ℂ) • vectorProjector (v i) := by
84  simp [frameMatrix, Matrix.diagonal_apply, vectorProjector, rankOneOperator]
85 
86theorem frameMatrix_diagonal_nonneg (v : ι → H) (a : ι → ℝ) (ha : ∀ i, 0 ≤ a i) :
87    0 ≤ (frameMatrix v (Matrix.diagonal (fun i => (a i : ℂ)))).1 := by
88  rw [frameMatrix_diagonal]
89  change 0 ≤ inclusionCLM (∑ i, (a i : ℂ) • vectorProjector (v i))
90  simp only [map_sum, map_smul]
91  apply Finset.sum_nonneg
92  intro i _
93  change 0 ≤ (a i : ℂ) • InnerProductSpace.rankOne ℂ (v i) (v i)
94  apply (ContinuousLinearMap.nonneg_iff_isPositive _).mpr
95  apply (InnerProductSpace.isPositive_rankOne_self (v i)).smul_of_nonneg
96  exact_mod_cast ha i
97 
98theorem frameMatrix_diagonal_sub_norm_le (v : ι → H) (hv : ∀ i, ‖v i‖ = 1)
99    (a b : ι → ℝ) :
100    ‖frameMatrix v (Matrix.diagonal (fun i => (a i : ℂ))) -
101      frameMatrix v (Matrix.diagonal (fun i => (b i : ℂ)))‖ ≤ ∑ i, |a i - b i| := by
102  rw [frameMatrix_diagonal, frameMatrix_diagonal, ← Finset.sum_sub_distrib]
103  calc
104    _ ≤ ∑ i, ‖(a i : ℂ) • vectorProjector (v i) - (b i : ℂ) • vectorProjector (v i)‖ :=
105      norm_sum_le _ _
106    _ = _ := by
107      apply Finset.sum_congr rfl
108      intro i _
109      rw [← sub_smul, ← Complex.ofReal_sub, norm_weighted_projector _ (hv i)]
110 
111end Cloning.InfiniteTraceClass