MatrixStrongConcavity.lean
1module2public import SubentropyCertificates.ClassicalStrongConcavity3public import SubentropyCertificates.SpectralJensen4import all SubentropyCertificates.HelstromSpectral56/-! Lemma 11. A finite mixture of arbitrary density matrices, including7singular ones. Diagonal matrices give the posterior form. -/8@[expose] public section9noncomputable section10set_option autoImplicit false11set_option backward.isDefEq.respectTransparency false12open Matrix13open scoped BigOperators ComplexOrder MatrixOrder14namespace SubentropyCertificates.StrongConcavity15open SubentropyCertificates.Helstrom SubentropyCertificates.Subadditivity16open SubentropyCertificates.ClassicalCurve17open D5.S3.Quantum.Subentropy.Basic18variable {D J : Type*} [Fintype D] [DecidableEq D] [Fintype J]1920/-- Squared Hilbert–Schmidt norm, with the real part of the complex trace. -/21def hsSquared (A : Matrix D D ℂ) : ℝ := (A.conjTranspose*A).trace.re2223private theorem hs_spectrum {A : Matrix D D ℂ} (H : A.IsHermitian) :24 hsSquared A = energy H.eigenvalues := by25 let U := H.eigenvectorUnitary26 let p := H.eigenvalues27 have hd : A = spectralMatrix U p := H.spectral_theorem28 change (A.conjTranspose*A).trace.re = ∑ i, p i^229 rw [H.eq,hd,spectral_mul,spectral_trace]30 simp only [sq]3132omit [DecidableEq D] in33private theorem hs_variance (w : J → ℝ) (hw : ∑ j, w j=1)34 (A : J → Matrix D D ℂ) (hA : ∀ j, (A j).IsHermitian)35 {M : Matrix D D ℂ} (hM : M.IsHermitian) (hm : M=∑ j,w j • A j) :36 ∑ j,w j*hsSquared (A j-M) = (∑ j,w j*hsSquared (A j))-hsSquared M := by37 have he : M*M=∑ j,w j • (A j*M) := by38 calc M*M = (∑ j,w j • A j)*M := congrArg (fun X : Matrix D D ℂ => X*M) hm39 _ = _ := by rw [Matrix.sum_mul]; simp only [Matrix.smul_mul]40 have hc : ∑ j,w j*(A j*M).trace.re=(M*M).trace.re := by41 simpa only [Matrix.trace_sum,Matrix.trace_smul,Complex.re_sum,Complex.smul_re,smul_eq_mul] using42 (congrArg (fun X : Matrix D D ℂ => X.trace.re) he.symm)43 have one j : w j*hsSquared (A j-M) = w j*hsSquared (A j)-2*(w j*(A j*M).trace.re)+w j*hsSquared M := by44 unfold hsSquared45 rw [((hA j).sub hM).eq,(hA j).eq,hM.eq,Matrix.sub_mul,Matrix.mul_sub,Matrix.mul_sub,46 Matrix.trace_sub,Matrix.trace_sub,Matrix.trace_sub,Matrix.trace_mul_comm M (A j)]47 simp only [Complex.sub_re]; ring48 simp_rw [one]49 rw [Finset.sum_add_distrib,Finset.sum_sub_distrib,← Finset.mul_sum,← Finset.sum_mul,hw,one_mul,hc]50 simp only [hsSquared,hM.eq]; ring5152/-- Lemma 11 in the Hilbert–Schmidt norm. Neither the states nor their mean53need be invertible. Zero weights are permitted. -/54theorem matrix_strong_concavity (hd : 2 ≤ Fintype.card D)55 (w : J → ℝ) (hw : ∀ j, 0 ≤ w j) (hs : ∑ j,w j=1)56 (A : J → Matrix D D ℂ) (hA : ∀ j,(A j).PosSemidef) (ht : ∀ j,(A j).trace=1) :57 let M := ∑ j,w j • A j58 mu (Fintype.card D)/2*(∑ j,w j*hsSquared (A j-M)) ≤59 matrixSubentropy M - ∑ j,w j*matrixSubentropy (A j) := by60 let M := ∑ j,w j • A j61 have hM : M.PosSemidef := Matrix.posSemidef_sum _ (fun j _ => (hA j).smul (hw j))62 have he {B : Matrix D D ℂ} (H : B.IsHermitian) :63 corrected H.eigenvalues = matrixSubentropy B+mu (Fintype.card D)/2*hsSquared B := by64 rw [corrected,← hs_spectrum H,subentropy_of_spectrum H]65 have h := spectral_jensen (corrected_concave hd) corrected_perm w hw hs A hA ht hM.isHermitian rfl66 simp_rw [he] at h67 have expand j : w j*(matrixSubentropy (A j)+mu (Fintype.card D)/2*hsSquared (A j)) =68 w j*matrixSubentropy (A j)+mu (Fintype.card D)/2*(w j*hsSquared (A j)) := by ring69 simp_rw [expand] at h70 rw [Finset.sum_add_distrib,← Finset.mul_sum] at h71 change _ * (∑ j,w j*hsSquared (A j-M)) ≤ matrixSubentropy M - _72 rw [hs_variance w hs A (fun j => (hA j).isHermitian) hM.isHermitian rfl]73 linarith only [h]7475/-- Diagonal specialization, in ordinary Euclidean coordinates. -/76theorem posterior_strong_concavity (hd : 2 ≤ Fintype.card D)77 (w : J → ℝ) (hw : ∀ j,0 ≤ w j) (hs : ∑ j,w j=1)78 (p : J → D → ℝ) (hp : ∀ j,p j ∈ probabilitySimplex D) :79 let m := ∑ j,w j • p j80 mu (Fintype.card D)/2*(∑ j,w j*energy (p j-m)) ≤81 classicalSubentropy m - ∑ j,w j*classicalSubentropy (p j) := by82 let m := ∑ j,w j • p j83 let diag (v : D → ℝ) := diagonal (fun i => (v i:ℂ))84 have hm : ∑ j,w j • diag (p j) = diag m := by85 ext i k86 by_cases he : i=k87 · subst k88 simp [diag,m,Matrix.sum_apply,Matrix.smul_apply,Complex.real_smul,Finset.sum_apply]89 · simp [diag,he,Matrix.sum_apply,Matrix.smul_apply]90 have hv (v : D → ℝ) : hsSquared (diag v - diag m) = energy (v-m) := by91 unfold hsSquared diag92 rw [Matrix.diagonal_sub,Matrix.diagonal_conjTranspose,Matrix.diagonal_mul_diagonal,Matrix.trace_diagonal,Complex.re_sum]93 unfold energy94 apply Finset.sum_congr rfl95 intro i _96 simp [sq]97 have h := matrix_strong_concavity hd w hw hs (fun j => diag (p j))98 (fun j => (diagonal_density (hp j)).1) (fun j => (diagonal_density (hp j)).2)99 dsimp only at h100 rw [hm] at h101 simpa only [hv,diag,m,classicalSubentropy] using h102103/-- In dimension one every trace-one matrix is the identity. -/104theorem variance_one_dim (hd : Fintype.card D=1) (w : J → ℝ) (hs : ∑ j,w j=1)105 (A : J → Matrix D D ℂ) (ht : ∀ j,(A j).trace=1) :106 ∑ j,w j*hsSquared (A j-∑ k,w k • A k)=0 := by107 obtain ⟨x,hx⟩ := Fintype.card_eq_one_iff.mp hd108 let _ : Unique D := ⟨⟨x⟩,hx⟩109 have one (j : J) : A j = 1 := by110 ext i k111 rw [Subsingleton.elim i default, Subsingleton.elim k default]112 simpa [Matrix.trace] using ht j113 simp only [one,← Finset.sum_smul,hs,one_smul,sub_self]114 simp [hsSquared]115116end SubentropyCertificates.StrongConcavity
Axioms used
Choose a statement to see which axioms its proof uses.