import Mathlib import OAI.Probability.BinarySweep.MatrixBounds.SchattenBasic namespace OAI noncomputable section open scoped BigOperators Classical Matrix.Norms.L2Operator namespace BinaryCoordinateSweeps.TraceHolder variable {ι : Type*} [Fintype ι] [DecidableEq ι] lemma matrixMoment_sum_le {α : Type*} [Fintype α] {q : ℕ} (hq : 0 if j.val%2=0 then star (A a) else A a have he : (fun j : Fin (2*q) => if j.val%2=0 then star (∑a, A a) else ∑a, A a)= fun j => ∑a, B j a := by funext j dsimp [B] split_ifs <;> simp only [star_sum] calc _ ≤ ‖Matrix.trace ((star (∑a, A a)*(∑a, A a))^q)‖ := Complex.re_le_norm _ _ = ‖∑x : Fin (2*q) → α, Matrix.trace (List.ofFn (fun j => B j (x j))).prod‖ := by rw [← alternating_gram,he,prod_ofFn_sum,Matrix.trace_sum] _ ≤ ∑x : Fin (2*q) → α, ‖Matrix.trace (List.ofFn (fun j => B j (x j))).prod‖ := norm_sum_le _ _ _ ≤ ∑x : Fin (2*q) → α, ∏j, schatten q (A (x j)) := by apply Finset.sum_le_sum intro x _ convert matrix_trace_holder hq (fun j => B j (x j)) using 1 apply Finset.prod_congr rfl intro coordinate _ dsimp [B,schatten] split_ifs <;> simp only [matrixMoment_star] _ = (∑a, schatten q (A a))^(2*q) := by rw [← Fintype.prod_sum (fun (_ : Fin (2*q)) a => schatten q (A a))] simp lemma schatten_mul_left {q : ℕ} (hq : 0 hd j) (Finset.mem_univ i) have hD : ‖diagPower d ((((2*q:ℕ):ℝ)⁻¹:ℝ):ℂ)‖≤ 1 := diagPower_norm_le_one d hd hd1 (by simp) conv_lhs => rw [he,norm_smul,Real.norm_eq_abs] change |schatten q A| * _ ≤ schatten q A rw [abs_of_nonneg (schatten_nonneg q A)] apply mul_le_of_le_one_right (schatten_nonneg _ _) refine (norm_mul_le _ _).trans ((mul_le_of_le_one_left (norm_nonneg _) ?_).trans hV) exact (norm_mul_le _ _).trans ((mul_le_of_le_one_left (norm_nonneg _) hU).trans hD) lemma schatten_sandwich {q : ℕ} (hq : 0