Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.
Python
module
import TauCeti.Analysis.InnerProductSpace.HilbertSchmidt.NearIsometry
public import Aesop.BuiltinRules
public import Mathlib.Analysis.CStarAlgebra.Module.Constructions
public import Mathlib.Order.CompletePartialOrder
import Mathlib.Algebra.Order.Star.Int
import Mathlib.Algebra.Order.Star.Real
import Mathlib.Analysis.InnerProductSpace.Trace
import Mathlib.RingTheory.Coalgebra.CoassocSimps
public import TauCeti.LinearAlgebra.Spreading
public import Lib.Speed
import New.Spanning.SecondMoment.PositiveType
/-!
# Few translates fill
Let a finite group act unitarily on `T`, let `pr₀` be the projection onto a stable subspace `T₀`,
and let `B : S → T` be linear. Suppose that `pr₀ B` is almost an isometry from below in mean square
and that the second moment of the operators `B* s B` is nearly as small as Cauchy–Schwarz allows.
Then a few translates `s pr₀ B` span almost all of `T₀`. In this file `‖A‖`, written of a linear map
`A`, is its Hilbert–Schmidt norm.
* `New.hilbertSchmidtNorm`, `New.IsNearIsometry`: the Hilbert–Schmidt norm, and the first
hypothesis.
* `New.isSpread_of_second_moment`: for any subspace `W` of `T₀`, the preimage of `W` under some
translate `s pr₀ B` is small, in terms of the share of `W` in `T₀` (`TauCeti.IsSpread`).
* `TauCeti.IsSpread.exists_card_mul_finrank_le_and_le_finrank_biSup_range`: a logarithm times
`dim T₀ / dim S` translates span almost all of `T₀`.
## Relation to the literature
Rank bounds from second moments: Welch 1974. Greedy covering with a logarithmic loss: Wolsey, Greedy
algorithm for the submodular set covering problem, 1982.
-/
@[expose] public section
open Module LinearMap Finset
open scoped InnerProductSpace
namespace New
section HilbertSchmidt
open Complex
variable {S T T' : Type}
[NormedAddCommGroup S] [InnerProductSpace ℂ S] [FiniteDimensional ℂ S]
[NormedAddCommGroup T] [InnerProductSpace ℂ T] [FiniteDimensional ℂ T]
[NormedAddCommGroup T'] [InnerProductSpace ℂ T'] [FiniteDimensional ℂ T']
/-- The values of a linear map on an orthonormal basis of the source, as one vector of a Hilbert
space. Its inner product is the Hilbert–Schmidt inner product of maps. -/
noncomputable def hilbertSchmidtVector : (S →ₗ[ℂ] T) →ₗ[ℂ] PiLp 2 fun _ : Fin (finrank ℂ S) ↦
T where
toFun A := WithLp.toLp 2 fun i ↦ A (stdOrthonormalBasis ℂ S i)
map_add' _ _ := rfl
map_smul' _ _ := rfl
/-- The Hilbert–Schmidt norm of a linear map. -/
noncomputable def hilbertSchmidtNorm (A : S →ₗ[ℂ] T) : ℝ := ‖hilbertSchmidtVector A‖
omit [FiniteDimensional ℂ T] in
lemma hilbertSchmidtNorm_nonneg (A : S →ₗ[ℂ] T) : 0 ≤ hilbertSchmidtNorm A := norm_nonneg _
/-- The inner product of `hilbertSchmidtVector A` and `hilbertSchmidtVector B`, the vectors of the
values of `A` and `B` on an orthonormal basis, is the trace of `A* B`: the Hilbert–Schmidt inner
product. -/
lemma inner_hilbertSchmidtVector (A B : S →ₗ[ℂ] T) :
⟪hilbertSchmidtVector A, hilbertSchmidtVector B⟫_ℂ = trace ℂ S (A.adjoint ∘ₗ B) := by
rw [trace_eq_sum_inner _ (stdOrthonormalBasis ℂ S), PiLp.inner_apply]
exact sum_congr rfl fun i _ ↦ (adjoint_inner_right A _ _).symm
lemma hilbertSchmidtNorm_sq_eq_trace (A : S →ₗ[ℂ] T) :
((hilbertSchmidtNorm A ^ 2 : ℝ) : ℂ) = trace ℂ S (A.adjoint ∘ₗ A) := by
simp [← inner_hilbertSchmidtVector, hilbertSchmidtNorm, inner_self_eq_norm_sq_to_K]
/-- The squared Hilbert–Schmidt norm of `A` is the sum of `‖A (b i)‖ ^ 2` over the vectors `b i` of
any orthonormal basis `b` of `S`. -/
lemma hilbertSchmidtNorm_sq_eq_sum {ι : Type} [Fintype ι] (b : OrthonormalBasis ι ℂ S)
(A : S →ₗ[ℂ] T) :
hilbertSchmidtNorm A ^ 2 = ∑ i : ι, ‖A (b i)‖ ^ 2 := by
apply ofReal_injective
rw [hilbertSchmidtNorm_sq_eq_trace, trace_eq_sum_inner _ b, ofReal_sum]
simp [inner_self_eq_norm_sq_to_K, adjoint_inner_right]
private lemma hilbertSchmidtNorm_toLinearMap (A : S →L[ℂ] T) :
hilbertSchmidtNorm A.toLinearMap = A.hilbertSchmidtNorm := by
rw [← sq_eq_sq₀ (hilbertSchmidtNorm_nonneg _)
(ContinuousLinearMap.hilbertSchmidtNorm_nonneg _),
hilbertSchmidtNorm_sq_eq_sum (stdOrthonormalBasis ℂ S),
ContinuousLinearMap.sq_hilbertSchmidtNorm_eq_sum _ (stdOrthonormalBasis ℂ S)]
rfl
/-- The squared Hilbert–Schmidt norm is the sum of the squared moduli of the matrix entries. -/
lemma hilbertSchmidtNorm_sq_eq_sum_entries {ι κ : Type} [Fintype ι] [Fintype κ]
(b : OrthonormalBasis ι ℂ S) (c : OrthonormalBasis κ ℂ T) (A : S →ₗ[ℂ] T) :
hilbertSchmidtNorm A ^ 2 = ∑ j : κ, ∑ i : ι, ‖⟪A (b i), c j⟫_ℂ‖ ^ 2 := by
rw [hilbertSchmidtNorm_sq_eq_sum b, sum_comm]
exact sum_congr rfl fun i _ ↦ (c.sum_sq_norm_inner_left _).symm
lemma hilbertSchmidtNorm_adjoint (A : S →ₗ[ℂ] T) :
hilbertSchmidtNorm A.adjoint = hilbertSchmidtNorm A := by
rw [← sq_eq_sq₀ (hilbertSchmidtNorm_nonneg _) (hilbertSchmidtNorm_nonneg _), ← ofReal_inj,
hilbertSchmidtNorm_sq_eq_trace,
hilbertSchmidtNorm_sq_eq_trace, adjoint_adjoint, trace_comp_comm']
/-- If `‖A x‖ ≤ ‖B x‖` for all `x`, then the Hilbert–Schmidt norm of `A` is at most that of `B`. -/
lemma hilbertSchmidtNorm_le_of_norm_le {A : S →ₗ[ℂ] T} {B : S →ₗ[ℂ] T'}
(h_le : ∀ x : S, ‖A x‖ ≤ ‖B x‖) :
hilbertSchmidtNorm A ≤ hilbertSchmidtNorm B := by
rw [← sq_le_sq₀ (hilbertSchmidtNorm_nonneg _) (hilbertSchmidtNorm_nonneg _),
hilbertSchmidtNorm_sq_eq_sum (stdOrthonormalBasis ℂ S),
hilbertSchmidtNorm_sq_eq_sum (stdOrthonormalBasis ℂ S)]
exact sum_le_sum fun i _ ↦ pow_le_pow_left₀ (norm_nonneg _) (h_le _) 2
/-- The orthogonal projection onto a subspace, as the linear map under `starProjection`. -/
noncomputable def orthoProj (U : Submodule ℂ S) : S →ₗ[ℂ] S := U.starProjection
lemma adjoint_orthoProj (U : Submodule ℂ S) : (orthoProj U).adjoint = orthoProj U :=
U.starProjection_isSymmetric.adjoint_eq
lemma orthoProj_comp_self (U : Submodule ℂ S) : orthoProj U ∘ₗ orthoProj U = orthoProj U :=
LinearMap.ext fun x ↦ Submodule.starProjection_eq_self_iff.2 (U.starProjection_apply_mem x)
/-- The squared Hilbert–Schmidt norm of the orthogonal projection onto `U` is `dim U`. -/
lemma hilbertSchmidtNorm_orthoProj_sq (U : Submodule ℂ S) :
hilbertSchmidtNorm (orthoProj U) ^ 2 = finrank ℂ U := by
have h_proj : IsProj U (orthoProj U) :=
⟨U.starProjection_apply_mem, fun _ ↦ Submodule.starProjection_eq_self_iff.2⟩
apply ofReal_injective
rw [hilbertSchmidtNorm_sq_eq_trace, adjoint_orthoProj, orthoProj_comp_self, h_proj.trace,
ofReal_natCast]
lemma hilbertSchmidtNorm_comp_orthoProj_le (A : S →ₗ[ℂ] T) (U : Submodule ℂ S) :
hilbertSchmidtNorm (A ∘ₗ orthoProj U) ≤ hilbertSchmidtNorm A := by
rw [← hilbertSchmidtNorm_adjoint (A ∘ₗ orthoProj U), ← hilbertSchmidtNorm_adjoint A, adjoint_comp,
adjoint_orthoProj]
exact hilbertSchmidtNorm_le_of_norm_le fun x ↦ U.norm_starProjection_apply_le (A.adjoint x)
/-- The squared Hilbert–Schmidt norm of `pr_W A` is the real part of the inner product of
`pr_W` with `A A*`, where `hilbertSchmidtVector` carries the Hilbert–Schmidt inner product of
maps. -/
lemma hilbertSchmidtNorm_orthoProj_comp_sq (W : Submodule ℂ T) (A : S →ₗ[ℂ] T) :
hilbertSchmidtNorm (orthoProj W ∘ₗ A) ^ 2 = re ⟪hilbertSchmidtVector (orthoProj W),
hilbertSchmidtVector (A ∘ₗ A.adjoint)⟫_ℂ := by
set p : T →ₗ[ℂ] T := orthoProj W
have h_adjoint : (p ∘ₗ A).adjoint ∘ₗ (p ∘ₗ A) = A.adjoint ∘ₗ p ∘ₗ A := by
rw [adjoint_comp, adjoint_orthoProj, comp_assoc, ← comp_assoc A p, orthoProj_comp_self]
rw [inner_hilbertSchmidtVector, adjoint_orthoProj, ← comp_assoc, trace_comp_comm', ← h_adjoint,
← hilbertSchmidtNorm_sq_eq_trace, ofReal_re]
/-- `A` is almost an isometry from below in mean square, with the error `ε`: on every subspace `U`
its squared Hilbert–Schmidt norm `‖A pr_U‖²` is at least `dim U - ε dim S`. -/
def IsNearIsometry (A : S →ₗ[ℂ] T) (ε : ℝ) : Prop :=
∀ U : Submodule ℂ S, finrank ℂ U - ε * finrank ℂ S ≤ hilbertSchmidtNorm (A ∘ₗ orthoProj U) ^ 2
private lemma isNearIsometry_toLinearMap (A : S →L[ℂ] T) (ε : ℝ) :
IsNearIsometry A.toLinearMap ε ↔ A.IsNearIsometry ε := by
simp only [IsNearIsometry, ContinuousLinearMap.isNearIsometry_iff,
← hilbertSchmidtNorm_toLinearMap, ContinuousLinearMap.toLinearMap_comp, orthoProj]
/-- If the squared Hilbert–Schmidt norm of `A* A - 1` is at most `ε² dim S`, then
`IsNearIsometry A ε`: on every subspace `U` the squared Hilbert–Schmidt norm of `A` is at least
`dim U - ε dim S`. -/
lemma isNearIsometry_of_hilbertSchmidtNorm_le {A : S →ₗ[ℂ] T} {ε : ℝ} (hε : 0 ≤ ε)
(h_defect : hilbertSchmidtNorm (A.adjoint ∘ₗ A - 1) ^ 2 ≤ ε ^ 2 * finrank ℂ S) :
IsNearIsometry A ε := by
apply (isNearIsometry_toLinearMap A.toContinuousLinearMap ε).mpr
apply ContinuousLinearMap.isNearIsometry_of_sq_hilbertSchmidtNorm_le hε
simpa [← hilbertSchmidtNorm_toLinearMap, ← ContinuousLinearMap.adjoint_toLinearMap]
using h_defect
omit [FiniteDimensional ℂ T] in
/-- A near isometry with the error `ε` is one with any larger error. -/
lemma IsNearIsometry.mono {A : S →ₗ[ℂ] T} {ε ε' : ℝ} (hA : IsNearIsometry A ε) (h_le : ε ≤ ε') :
IsNearIsometry A ε' :=
fun U ↦ le_trans (by gcongr) (hA U)
/-- Let `pr₀` be any endomorphism. If `pr₀ B` is almost an isometry from below in mean square, with
an error `ε` below `1`, and the source `S` is not zero, then the range of `pr₀` is not zero. -/
lemma IsNearIsometry.finrank_range_pos [Nontrivial S] {pr₀ : T →ₗ[ℂ] T} {B : S →ₗ[ℂ] T} {ε : ℝ}
(h_isom : IsNearIsometry (pr₀ ∘ₗ B) ε) (hε : ε < 1) : 0 < finrank ℂ (range pr₀) := by
-- Otherwise `pr₀ = 0`, and the hypothesis for the whole of `S` reads `(1 - ε) dim S ≤ 0`.
refine Nat.pos_of_ne_zero fun h_zero ↦ ?_
obtain rfl : pr₀ = 0 := range_eq_bot.1 (Submodule.finrank_eq_zero.1 h_zero)
have h_top : finrank ℂ S - ε * finrank ℂ S ≤ 0 := by simpa [hilbertSchmidtNorm] using h_isom ⊤
have h_pos : (0 : ℝ) < finrank ℂ S := by exact_mod_cast finrank_pos
nlinarith
/-- For an orthogonal projection `p` and any `q`: in squared Hilbert–Schmidt norm, the part
`(1 - p q) A` that `p q` misses is at most the sum of the parts that `p` and `q` miss. -/
lemma hilbertSchmidtNorm_one_sub_mul_comp_sq_le {p : T →ₗ[ℂ] T} (hp : p.IsSymmetricProjection)
(q : T →ₗ[ℂ] T) (A : S →ₗ[ℂ] T) : hilbertSchmidtNorm ((1 - p * q) ∘ₗ A) ^ 2 ≤
hilbertSchmidtNorm ((1 - p) ∘ₗ A) ^ 2 + hilbertSchmidtNorm ((1 - q) ∘ₗ A) ^ 2 := by
simpa [← hilbertSchmidtNorm_toLinearMap, LinearMap.sub_comp] using
ContinuousLinearMap.sq_hilbertSchmidtNorm_one_sub_mul_comp_le
(p := p.toContinuousLinearMap)
(ContinuousLinearMap.isStarProjection_iff_isSymmetricProjection.mpr hp)
q.toContinuousLinearMap A.toContinuousLinearMap (stdOrthonormalBasis ℂ S).toHilbertBasis
(ContinuousLinearMap.hilbertSchmidtEnergy_ne_top _ _)
/-- Let `IsNearIsometry A ε`: `dim U - ε dim S ≤ ‖A pr_U‖²` in Hilbert–Schmidt norm for all
subspaces `U`. If an orthogonal projection `pr` misses at most `δ dim S` of the squared norm of
`A`, then `IsNearIsometry (pr A) (ε + δ)`. -/
lemma IsNearIsometry.proj_comp {A : S →ₗ[ℂ] T} {ε δ : ℝ} (hA : IsNearIsometry A ε)
{pr : T →ₗ[ℂ] T} (hpr : pr.IsSymmetricProjection)
(h_rest : hilbertSchmidtNorm ((1 - pr) ∘ₗ A) ^ 2 ≤ δ * finrank ℂ S) :
IsNearIsometry (pr ∘ₗ A) (ε + δ) := by
apply (isNearIsometry_toLinearMap (pr.toContinuousLinearMap ∘L A.toContinuousLinearMap) _).mpr
apply ContinuousLinearMap.IsNearIsometry.isStarProjection_comp
((isNearIsometry_toLinearMap A.toContinuousLinearMap ε).mp hA)
(ContinuousLinearMap.isStarProjection_iff_isSymmetricProjection.mpr hpr)
simpa [← hilbertSchmidtNorm_toLinearMap, LinearMap.sub_comp] using h_rest
variable {Γ : Type} [Group Γ] {ρ : Representation ℂ Γ T}
lemma adjoint_rep_of_unitary (hρ : ∀ (s : Γ) (x y : T), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ) (s : Γ) :
(ρ s).adjoint = ρ s⁻¹ := by
refine ((eq_adjoint_iff _ _).2 fun x y ↦ ?_).symm
rw [← hρ s, ρ.self_inv_apply]
/-- Let `ρ` be a unitary representation of `Γ` on `T`. The vector `hilbertSchmidtVector X` lists the
values of a map `X` on an orthonormal basis, so `⟪hilbertSchmidtVector X, hilbertSchmidtVector Y⟫`
is the Hilbert–Schmidt inner product `tr (X* Y)`. This product of `s B B* s⁻¹` and `t B B* t⁻¹` is
the squared Hilbert–Schmidt norm of `B* s⁻¹ t B`. So `s ↦ ‖B* s B‖²` has positive type in this
norm. -/
lemma inner_hilbertSchmidtVector_translate (hρ : ∀ (s : Γ) (x y : T), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ)
(B : S →ₗ[ℂ] T) (s t : Γ) :
⟪hilbertSchmidtVector ((ρ s ∘ₗ B) ∘ₗ (ρ s ∘ₗ B).adjoint),
hilbertSchmidtVector ((ρ t ∘ₗ B) ∘ₗ (ρ t ∘ₗ B).adjoint)⟫_ℂ =
(hilbertSchmidtNorm (B.adjoint ∘ₗ ρ (s⁻¹ * t) ∘ₗ B) ^ 2 : ℝ) := by
set X : S →ₗ[ℂ] T := ρ s ∘ₗ B with hX
set Y : S →ₗ[ℂ] T := ρ t ∘ₗ B with hY
have h_factor : B.adjoint ∘ₗ ρ (s⁻¹ * t) ∘ₗ B = X.adjoint ∘ₗ Y := by
simp [hX, hY, adjoint_comp, adjoint_rep_of_unitary hρ, End.mul_eq_comp, comp_assoc]
rw [h_factor, hilbertSchmidtNorm_sq_eq_trace, inner_hilbertSchmidtVector]
calc trace ℂ T ((X ∘ₗ X.adjoint).adjoint ∘ₗ Y ∘ₗ Y.adjoint)
= trace ℂ T (((X ∘ₗ X.adjoint) ∘ₗ Y) ∘ₗ Y.adjoint) := by
rw [adjoint_comp, adjoint_adjoint, comp_assoc _ Y]
_ = trace ℂ S (Y.adjoint ∘ₗ (X ∘ₗ X.adjoint) ∘ₗ Y) := trace_comp_comm' _ _
_ = trace ℂ S ((X.adjoint ∘ₗ Y).adjoint ∘ₗ X.adjoint ∘ₗ Y) := by
simp only [adjoint_comp, adjoint_adjoint, comp_assoc]
/-- Cauchy–Schwarz for the projection onto `W` and the sum of the operators `s B B* s⁻¹`, where
`s` runs through a finite group that acts unitarily: the sum of the squared Hilbert–Schmidt norms
`‖pr_W s B‖²` has square at most `dim W` times the order of the group times the sum of
`‖B* s B‖²`. -/
lemma sq_sum_hilbertSchmidtNorm_orthoProj_comp_le [Fintype Γ]
(hρ : ∀ (s : Γ) (x y : T), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ) (B : S →ₗ[ℂ] T) (W : Submodule ℂ T) :
(∑ s : Γ, hilbertSchmidtNorm (orthoProj W ∘ₗ ρ s ∘ₗ B) ^ 2) ^ 2 ≤
finrank ℂ W * (Fintype.card Γ * ∑ s : Γ, hilbertSchmidtNorm (B.adjoint ∘ₗ ρ s ∘ₗ B) ^ 2) := by
set sumBB : PiLp 2 fun _ : Fin (finrank ℂ T) ↦ T :=
∑ s : Γ, hilbertSchmidtVector ((ρ s ∘ₗ B) ∘ₗ (ρ s ∘ₗ B).adjoint)
have h_norm : ‖sumBB‖ ^ 2 = Fintype.card Γ * ∑ s,
hilbertSchmidtNorm (B.adjoint ∘ₗ ρ s ∘ₗ B) ^ 2 := by
rw [norm_sq_eq_re_inner (𝕜 := ℂ), inner_sum_sum_eq_card_mul
(fun s ↦ ((hilbertSchmidtNorm (B.adjoint ∘ₗ ρ s ∘ₗ B) ^ 2 : ℝ) : ℂ))
(inner_hilbertSchmidtVector_translate hρ B),
← ofReal_sum, ← ofReal_natCast, ← ofReal_mul]
exact ofReal_re _
have h_inner : ∑ s, hilbertSchmidtNorm (orthoProj W ∘ₗ ρ s ∘ₗ B) ^ 2 =
re ⟪hilbertSchmidtVector (orthoProj W), sumBB⟫_ℂ := by
simp only [sumBB, hilbertSchmidtNorm_orthoProj_comp_sq, inner_sum, re_sum]
have h_cs : re ⟪hilbertSchmidtVector (orthoProj W),
sumBB⟫_ℂ ≤ hilbertSchmidtNorm (orthoProj W) * ‖sumBB‖ :=
(re_le_norm _).trans (norm_inner_le_norm _ _)
calc (∑ s : Γ, hilbertSchmidtNorm (orthoProj W ∘ₗ ρ s ∘ₗ B) ^ 2) ^ 2
≤ (hilbertSchmidtNorm (orthoProj W) * ‖sumBB‖) ^ 2 :=
pow_le_pow_left₀ (sum_nonneg fun _ _ ↦ sq_nonneg _) (h_inner.trans_le h_cs) 2
_ = finrank ℂ W * (Fintype.card Γ * ∑ s : Γ,
hilbertSchmidtNorm (B.adjoint ∘ₗ ρ s ∘ₗ B) ^ 2) := by
rw [mul_pow, hilbertSchmidtNorm_orthoProj_sq, h_norm]
/-- **One translate.** Let a finite group `Γ` act unitarily on `T` by `ρ`, and let `pr₀` be the
orthogonal projection onto a stable subspace `T₀`, so that `pr₀ s = s pr₀`. Suppose that `pr₀ B` is
almost an isometry in mean square with the error `ε`, and that `dim T₀` times the mean of
`‖B* s B‖²` is at most `(1 + ε) (dim S)²`. Then the maps `pr₀ s B` spread (`TauCeti.IsSpread`):
for every subspace `W` of `T₀`, of dimension `α dim T₀`, the preimage of `W` under some `pr₀ s B`
has dimension at most `(1 + α + 3 ε) / 2 · dim S`. -/
theorem isSpread_of_second_moment [Fintype Γ]
(hρ : ∀ (s : Γ) (x y : T), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ) {pr₀ : T →ₗ[ℂ] T}
(hpr₀ : pr₀.IsSymmetricProjection) (h_comm : ∀ s : Γ, Commute pr₀ (ρ s)) {B : S →ₗ[ℂ] T}
{ε : ℝ} (hε : 0 ≤ ε) (h_isom : IsNearIsometry (pr₀ ∘ₗ B) ε)
(h_moment : finrank ℂ (range pr₀) * ∑ s : Γ, hilbertSchmidtNorm (B.adjoint ∘ₗ ρ s ∘ₗ B) ^ 2 ≤
Fintype.card Γ * ((1 + ε) * finrank ℂ S ^ 2)) :
TauCeti.IsSpread (fun s : Γ ↦ pr₀.rangeRestrict ∘ₗ ρ s ∘ₗ B) (3 / 2 * ε) := by
-- Cauchy–Schwarz bounds the mean of `‖pr_W s B‖²`, so for some `s` this squared norm is within
-- that bound. For this `s` the near isometry, applied to the preimage of `W`, bounds the
-- dimension of that preimage. Here `W₀` is `W` inside `T₀`, and `α = dim W / dim T₀`.
refine TauCeti.isSpread_iff.2 fun W₀ ↦ ?_
let α : ℝ := finrank ℂ W₀ / finrank ℂ (range pr₀)
set W : Submodule ℂ T := W₀.map (range pr₀).subtype
have h_dim : (finrank ℂ W : ℝ) = α * finrank ℂ (range pr₀) := by
rw [Submodule.finrank_map_subtype_eq]
have h_zero (h : (finrank ℂ (range pr₀) : ℝ) = 0) : (finrank ℂ W₀ : ℝ) = 0 :=
mod_cast Nat.eq_zero_of_le_zero (W₀.finrank_le.trans_eq (mod_cast h))
exact (div_mul_cancel_of_imp h_zero).symm
set moment : ℝ := ∑ s : Γ, hilbertSchmidtNorm (B.adjoint ∘ₗ ρ s ∘ₗ B) ^ 2
have h_mean : ∑ s, hilbertSchmidtNorm (orthoProj W ∘ₗ ρ s ∘ₗ B) ^ 2 ≤
Fintype.card Γ * ((α + 1 + ε) / 2 * finrank ℂ S) := by
refine (abs_le_of_sq_le_sq' ?_ (by positivity)).2
calc (∑ s, hilbertSchmidtNorm (orthoProj W ∘ₗ ρ s ∘ₗ B) ^ 2) ^ 2
≤ finrank ℂ W * (Fintype.card Γ * moment) :=
sq_sum_hilbertSchmidtNorm_orthoProj_comp_le hρ B W
_ = α * Fintype.card Γ * (finrank ℂ (range pr₀) * moment) := by
rw [h_dim]
ring
_ ≤ α * Fintype.card Γ * (Fintype.card Γ * ((1 + ε) * finrank ℂ S ^ 2)) := by gcongr
_ = α * (1 + ε) * (Fintype.card Γ * finrank ℂ S) ^ 2 := by ring
_ ≤ ((α + 1 + ε) / 2) ^ 2 * (Fintype.card Γ * finrank ℂ S) ^ 2 := by
gcongr
nlinarith [sq_nonneg (α - (1 + ε))]
_ = (Fintype.card Γ * ((α + 1 + ε) / 2 * finrank ℂ S)) ^ 2 := by ring
obtain ⟨s, -, hs⟩ : ∃ s ∈ (Finset.univ : Finset Γ),
hilbertSchmidtNorm (orthoProj W ∘ₗ ρ s ∘ₗ B) ^ 2 ≤ (α + 1 + ε) / 2 * finrank ℂ S :=
exists_le_of_sum_le univ_nonempty (by rwa [sum_const, card_univ, nsmul_eq_mul])
refine ⟨s, ?_⟩
set W' : Submodule ℂ S := W₀.comap (pr₀.rangeRestrict ∘ₗ ρ s ∘ₗ B)
-- On the preimage `W'` of `W` the maps `s pr₀ B` and `pr_W s B` agree.
have h_agree (x : S) (hx : x ∈ W') : ρ s (pr₀ (B x)) = orthoProj W (ρ s (B x)) := by
have h_mem : pr₀ (ρ s (B x)) ∈ W :=
Submodule.mem_map_of_mem (f := (range pr₀).subtype) hx
have h_orth (w : T) (hw : w ∈ W) : ⟪ρ s (B x) - pr₀ (ρ s (B x)), w⟫_ℂ = 0 := by
obtain ⟨y, rfl⟩ : w ∈ range pr₀ := Submodule.map_subtype_le _ W₀ hw
simp [← hpr₀.isSymmetric _ y, ← mul_apply_eq_comp pr₀ pr₀, hpr₀.isIdempotentElem.eq]
rw [← mul_apply_eq_comp, ← (h_comm s).eq, mul_apply_eq_comp]
exact (Submodule.eq_starProjection_of_mem_of_inner_eq_zero h_mem h_orth).symm
have h_preimage : hilbertSchmidtNorm ((pr₀ ∘ₗ B) ∘ₗ orthoProj W') ≤ hilbertSchmidtNorm
(orthoProj W ∘ₗ ρ s ∘ₗ B) := by
refine (hilbertSchmidtNorm_le_of_norm_le fun x ↦ ?_).trans
(hilbertSchmidtNorm_comp_orthoProj_le _ W')
have h_isometry (y : T) : ‖ρ s y‖ = ‖y‖ := by
rw [norm_eq_sqrt_re_inner (𝕜 := ℂ), hρ, ← norm_eq_sqrt_re_inner]
calc ‖pr₀ (B (orthoProj W' x))‖
= ‖ρ s (pr₀ (B (orthoProj W' x)))‖ := (h_isometry _).symm
_ ≤ ‖orthoProj W (ρ s (B (orthoProj W' x)))‖ := by
rw [h_agree (orthoProj W' x) (W'.starProjection_apply_mem x)]
have h_near : finrank ℂ W' - ε * finrank ℂ S ≤ hilbertSchmidtNorm ((pr₀ ∘ₗ B) ∘ₗ orthoProj W') ^
2 :=
h_isom W'
linarith [pow_le_pow_left₀ (hilbertSchmidtNorm_nonneg _) h_preimage 2]
end HilbertSchmidt
end New