import Mathlib import OAI.Probability.BinarySweep.MatrixBounds.SchattenTriangle namespace OAI noncomputable section section open scoped BigOperators Classical Matrix.Norms.L2Operator namespace BinaryCoordinateSweeps.TraceHolder variable {ι α β : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] [Fintype β] lemma projection_sandwich_split (X Y P : M ι) (R : α → M ι) (C : β → M ι) (hR : ∀a, R a*R a=R a) (hC : ∀b, C b*C b=C b) (hsR : ∑a, R a=1) (hsC : ∑b, C b=1) : Y*P*X = ∑b, ∑a, (Y*C b)*(C b*P*R a)*(R a*X) := by have he (a : α) (b : β) : (Y*C b)*(C b*P*R a)*(R a*X)=Y*C b*P*R a*X := by simp only [mul_assoc,← mul_assoc (C b) (C b),hC b, ← mul_assoc (R a) (R a),hR a] simp_rw [he] simp only [← Finset.sum_mul,← Finset.mul_sum,hsR,hsC,mul_one] theorem schatten_projection_split {q : ℕ} (hq : 0 schatten_sandwich hq _ _ _ theorem matrixMoment_projection_split_bound {q : ℕ} (hq : 0 Finset.sum_le_sum fun a _ => ht a b _ = _ := by simp [mul_comm,mul_assoc] have hh := pow_le_pow_left₀ (schatten_nonneg _ _) hs (2*q) simpa only [schatten_pow hq,mul_pow] using hh end BinaryCoordinateSweeps.TraceHolder end open scoped BigOperators Classical Matrix.Norms.L2Operator namespace BinaryCoordinateSweeps.TraceHolder lemma overlap_power_le {x c L : ℝ} {q : ℕ} (hx : 0≤x) (hx1 : x≤1) (hc : 0≤c) (hcq : c≤q) (hq : 0