import Mathlib import OAI.Analysis.FreeWords.ConcreteCornerFactor import OAI.Analysis.FreeWords.ConcreteCornerTrace import OAI.Analysis.FreeWords.LocalCompression namespace OAI noncomputable section namespace KKMatrixQuantization open KKTraceTransfer KKFreeLiftFrontier KKProjectionSupport KKConcreteCorner noncomputable section theorem corner_small_compression {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] {ι : Type*} [Fintype ι] (M : VonNeumannAlgebra H) (τ : FaithfulNormalTrace M) (hF : IsFactor M) (hD : IsDiffuse M) (p : ConcreteAlgebra M) (hp : IsStarProjection p) (hp0 : p ≠ 0) (x : ι → ConcreteAlgebra M) (hs : ∀ i, p*x i*p=x i) (hx : ∀ i, τ.map (x i)=0) (ε : ℝ) (hε : 0 < ε) : ∃ q : ConcreteAlgebra M, IsStarProjection q ∧ q ≠ 0 ∧ q*p=q ∧ (τ.map q).re < ε ∧ ∑ i, (traceNorm τ (q*x i*q))^2 < ε*(τ.map q).re := by have hpCLM : IsStarProjection (p : H →L[ℂ] H) := hp.map M.toStarSubalgebra.subtype let S : Submodule ℂ H := (p.val : H →ₗ[ℂ] H).range let : IsClosed (S : Set H) := ContinuousLinearMap.IsIdempotentElem.isClosed_range hpCLM.isIdempotentElem let : CompleteSpace S := IsClosed.completeSpace_coe have heq : S.starProjection=p.val := by obtain ⟨h,heq⟩ := isStarProjection_iff_eq_starProjection_range.mp hpCLM exact heq.symm have hmem : S.starProjection ∈ M := heq ▸ p.property have hproj : projection S M hmem=p := Subtype.ext heq have hproj0 : projection S M hmem≠0 := hproj ▸ hp0 let C := cornerAlgebra S M let σ := cornerTrace S M hmem τ hproj0 let y : ι → ConcreteAlgebra C := fun i => restrict S M hmem (x i) have hy (i : ι) : liftLinear S M hmem (y i)=x i := by change liftLinear S M hmem (restrict S M hmem (x i))=x i rw [lift_restrict,hproj,hs] have hyτ (i : ι) : σ.map (y i)=0 := by change (cornerTrace S M hmem τ hproj0).map (y i)=0 rw [cornerTrace_apply,hy,hx,mul_zero] let t : ℝ := (τ.map p).re have ht : 0