math / data /lean /OAI /Probability /ProjectionMoments /FrameMoments.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
16.7 kB
import OAI.Probability.ProjectionMoments.SphereDensity
namespace OAI
noncomputable section
open MeasureTheory
open scoped ENNReal NNReal
open MeasureTheory ProbabilityTheory Set Filter InnerProductSpace
open scoped ENNReal NNReal RealInnerProductSpace Topology
namespace ProjectionMoments
section
attribute [fun_prop] measurable_ballAverage
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
[FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]
omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in
lemma replicaConstant_real_le [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {Ξ½ : Measure E} (hΞ½ : Ξ½ Set.univ ≀ 1) {a : ℝ} {m : β„•}
(hd : 1 ≀ Module.finrank ℝ E) (ha : a ≀ Module.finrank ℝ E)
(hm : m ≀ Module.finrank ℝ E) :
NoiselessRegression.replicaConstant Ξ½ a m ≀ (128 : ℝβ‰₯0∞)^Module.finrank ℝ E := by
apply le_trans _ (NoiselessRegression.replicaConstant_le hΞ½ hd le_rfl hm)
have hr : (4 : ℝ)^a ≀ (4 : ℝ)^(Module.finrank ℝ E : ℝ) :=
Real.rpow_le_rpow_of_exponent_le (by norm_num) ha
have hc : ENNReal.ofReal ((3 : ℝ)^Module.finrank ℝ E * 4^a) ≀
ENNReal.ofReal ((3 : ℝ)^Module.finrank ℝ E * 4^(Module.finrank ℝ E : ℝ)) :=
ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_left hr (by positivity))
exact add_le_add le_rfl (mul_le_mul' hc le_rfl)
theorem frame_moment_unit {Ξ½ : Measure E} [IsFiniteMeasure Ξ½] {a : ℝ}
(hΞ½ : NoiselessRegression.HasLocalMassBound Ξ½ a)
(hs : Ξ½.support βŠ† Metric.closedBall 0 1) (hmass : Ξ½ Set.univ ≀ 1)
{m n : β„•} (hd : 1 ≀ Module.finrank ℝ E) (ha : a ≀ Module.finrank ℝ E)
(hm : m ≀ Module.finrank ℝ E) (hmargin : (n : ℝ)+m ≀ a)
(u : Fin m β†’ E) (hu : Orthonormal ℝ u)
(hac : βˆ€α΅ A βˆ‚frameLaw u, Ξ½.map (coordinateMap A) β‰ͺ (volume : Measure (Fin m β†’ ℝ))) :
∫⁻ A, labelMoment Ξ½ m n A βˆ‚frameLaw u ≀
(2 : ℝβ‰₯0∞)^m * ENNReal.ofReal (Real.sqrt (2 * Module.finrank ℝ E))^(m*n) *
(128 : ℝβ‰₯0∞)^(Module.finrank ℝ E*n) := by
rw [← orbitMoment_eq_frame]
apply (frame_gaussian_comparison Ξ½ hm hd u hu hac).trans
apply mul_le_mul' le_rfl
apply (gaussian_labelMoment_bound hΞ½ hs m n hmargin).trans
simpa only [one_mul, pow_mul] using
mul_le_mul' hmass (pow_le_pow_left' (replicaConstant_real_le hmass hd ha hm) n)
lemma lintegral_inv_smul_label {m : β„•} (f : Label m β†’ ℝβ‰₯0∞)
(hf : Measurable f) {R : ℝ} (hR : 0 < R) :
∫⁻ y, f (R⁻¹ β€’ y) = ENNReal.ofReal (R^m) * ∫⁻ y, f y := by
rw [← lintegral_map hf (by fun_prop), Measure.map_addHaar_smul volume (inv_ne_zero hR.ne'),
finrank_euclideanSpace_fin, inv_pow, inv_inv, abs_of_nonneg (pow_nonneg hR.le m),
lintegral_smul_measure, smul_eq_mul]
lemma ballAverage_label_scaled {Ξ½ : Measure E} [IsFiniteMeasure Ξ½]
{K a : ℝ} (hK : 0 < K) (z : E) {R Ξ· : ℝ} (hR : 0 < R) (hΞ· : 0 < Ξ·)
(m n : β„•) (A : Fin m β†’ E) :
(∫⁻ y : Label m, ballAverage ν m η (A,y)^(n+1)) =
(ENNReal.ofReal (K*R^(a-m)))^(n+1) * ENNReal.ofReal (R^m) *
∫⁻ y : Label m, ballAverage (normalizedRescale ν K a z R) m (η/R) (A,y)^(n+1) := by
let ΞΌ := normalizedRescale Ξ½ K a z R
have : IsFiniteMeasure ΞΌ := normalizedRescale_finite Ξ½ K a z R (by positivity)
rw [← lintegral_add_left_eq_self (fun y : Label m => ballAverage Ξ½ m Ξ· (A,y)^(n+1)) (rowMap A z)]
simp_rw [ballAverage_normalizedRescale K a hK z hR hΞ·, mul_pow]
rw [lintegral_const_mul _ (by fun_prop), lintegral_inv_smul_label (fun y : Label m => ballAverage (normalizedRescale Ξ½ K a z R) m (Ξ·/R) (A,y)^(n+1)) (by fun_prop) hR,
mul_assoc]
theorem ballAverage_integrated_scaled {Ξ½ : Measure E} [IsFiniteMeasure Ξ½]
{K a : ℝ} (hΞ½ : AllBallMass Ξ½ K a) (hK : 0 < K)
(z : E) {R Ξ· : ℝ} (hR : 0 < R) (hΞ· : 0 < Ξ·)
(hs : Ξ½.support βŠ† Metric.closedBall z R)
(m n : β„•) (hmargin : (n : ℝ)+m ≀ a)
(hd : 1 ≀ Module.finrank ℝ E) (ha : a ≀ Module.finrank ℝ E)
(hm : m ≀ Module.finrank ℝ E) :
∫⁻ x : (Fin m β†’ E) Γ— Label m, ballAverage Ξ½ m Ξ· x^(n+1)
βˆ‚(Measure.pi (fun _ => stdGaussian E)).prod volume ≀
ENNReal.ofReal (K*R^(a-m))^(n+1) * ENNReal.ofReal (R^m) *
(128 : ℝβ‰₯0∞)^(Module.finrank ℝ E*n) := by
let ΞΌ := normalizedRescale Ξ½ K a z R
have : IsFiniteMeasure ΞΌ := normalizedRescale_finite Ξ½ K a z R (by positivity)
rw [lintegral_prod _ (by fun_prop)]
simp_rw [ballAverage_label_scaled (Ξ½ := Ξ½) (a := a) hK z hR hΞ· m n]
rw [lintegral_const_mul _ (by fun_prop)]
apply mul_le_mul' le_rfl
rw [← lintegral_prod _ (show AEMeasurable (fun x : (Fin m β†’ E) Γ— Label m =>
ballAverage ΞΌ m (Ξ·/R) x^(n+1)) _ by fun_prop)]
apply (ballAverage_integrated_moment (normalizedRescale_local hΞ½ hK z hR)
(normalizedRescale_support K a z hR hs) m n hmargin (div_pos hΞ· hR)).trans
have hmass := normalizedRescale_mass hΞ½ hK z hR hs
simpa only [one_mul, pow_mul] using mul_le_mul' hmass
(pow_le_pow_left' (replicaConstant_real_le hmass hd ha hm) n)
theorem lowerDensity_integrated_scaled {Ξ½ : Measure E} [IsFiniteMeasure Ξ½]
{K a : ℝ} (hΞ½ : AllBallMass Ξ½ K a) (hK : 0 < K)
(z : E) {R : ℝ} (hR : 0 < R) (hs : Ξ½.support βŠ† Metric.closedBall z R)
(m n : β„•) (hmargin : (n : ℝ)+m ≀ a)
(hd : 1 ≀ Module.finrank ℝ E) (ha : a ≀ Module.finrank ℝ E)
(hm : m ≀ Module.finrank ℝ E) :
∫⁻ x : (Fin m β†’ E) Γ— Label m, lowerDensity Ξ½ m x^(n+1)
βˆ‚(Measure.pi (fun _ => stdGaussian E)).prod volume ≀
ENNReal.ofReal (K*R^(a-m))^(n+1) * ENNReal.ofReal (R^m) *
(128 : ℝβ‰₯0∞)^(Module.finrank ℝ E*n) := by
have hp (v : β„• β†’ ℝβ‰₯0∞) : (liminf v atTop)^(n+1) =
liminf (fun j => v j^(n+1)) atTop :=
(show Monotone (fun x : ℝβ‰₯0∞ => x^(n+1)) from
(fun _ _ h => pow_le_pow_left' h (n+1))).map_liminf_of_continuousAt
v (ENNReal.continuous_pow (n+1)).continuousAt
simp only [lowerDensity, hp]
apply (lintegral_liminf_le (fun j => (measurable_ballAverage Ξ½ m _).pow_const _)).trans
apply liminf_le_of_frequently_le'
exact Filter.Frequently.of_forall (fun j => ballAverage_integrated_scaled hΞ½ hK z hR
(inv_pos.mpr (by positivity)) hs m n hmargin hd ha hm)
theorem gaussian_labelMoment_scaled {Ξ½ : Measure E} [IsFiniteMeasure Ξ½]
{K a : ℝ} (hΞ½ : AllBallMass Ξ½ K a) (hK : 0 < K)
(z : E) {R : ℝ} (hR : 0 < R) (hs : Ξ½.support βŠ† Metric.closedBall z R)
(m n : β„•) (hmargin : (n : ℝ)+m ≀ a)
(hd : 1 ≀ Module.finrank ℝ E) (ha : a ≀ Module.finrank ℝ E)
(hm : m ≀ Module.finrank ℝ E) :
∫⁻ A, labelMoment Ξ½ m n A βˆ‚Measure.pi (fun _ => stdGaussian E) ≀
ENNReal.ofReal (K*R^(a-m))^(n+1) * ENNReal.ofReal (R^m) *
(128 : ℝβ‰₯0∞)^(Module.finrank ℝ E*n) := by
have he (A : Fin m β†’ E) : labelMoment Ξ½ m n A =
∫⁻ y : Label m, lowerDensity ν m (A,y)^(n+1) :=
(PiLp.volume_preserving_toLp (Fin m)).lintegral_comp
(show Measurable (fun y : Label m => lowerDensity Ξ½ m (A,y)^(n+1)) by fun_prop)
simp_rw [he]
rw [← lintegral_prod _ (show AEMeasurable (fun x : (Fin m β†’ E) Γ— Label m =>
lowerDensity Ξ½ m x^(n+1)) _ by fun_prop)]
exact lowerDensity_integrated_scaled hΞ½ hK z hR hs m n hmargin hd ha hm
theorem frame_moment_scaled {Ξ½ : Measure E} [IsFiniteMeasure Ξ½]
{K a : ℝ} (hΞ½ : AllBallMass Ξ½ K a) (hK : 0 < K)
(z : E) {R : ℝ} (hR : 0 < R) (hs : Ξ½.support βŠ† Metric.closedBall z R)
(m n : β„•) (hmargin : (n : ℝ)+m ≀ a)
(hd : 1 ≀ Module.finrank ℝ E) (ha : a ≀ Module.finrank ℝ E)
(hm : m ≀ Module.finrank ℝ E) (u : Fin m β†’ E) (hu : Orthonormal ℝ u)
(hac : βˆ€α΅ A βˆ‚frameLaw u, Ξ½.map (coordinateMap A) β‰ͺ (volume : Measure (Fin m β†’ ℝ))) :
∫⁻ A, labelMoment Ξ½ m n A βˆ‚frameLaw u ≀
(2 : ℝβ‰₯0∞)^m * ENNReal.ofReal (Real.sqrt (2*Module.finrank ℝ E))^(m*n) *
(ENNReal.ofReal (K*R^(a-m))^(n+1) * ENNReal.ofReal (R^m) *
(128 : ℝβ‰₯0∞)^(Module.finrank ℝ E*n)) := by
rw [← orbitMoment_eq_frame]
exact (frame_gaussian_comparison Ξ½ hm hd u hu hac).trans
(mul_le_mul' le_rfl (gaussian_labelMoment_scaled hΞ½ hK z hR hs m n hmargin hd ha hm))
end
lemma frame_cost_power {d m n : β„•} (hd : 1 ≀ d) (hm : m ≀ d)
(a K R : ℝ) (hK : 0 ≀ K) (hR : 0 < R) :
(2 : ℝ)^m * (Real.sqrt (2*d))^(m*n) *
((K*R^(a-m))^(n+1) * R^m * (128 : ℝ)^(d*n)) ≀
((256 : ℝ)^d * (256*Real.sqrt d)^((m:ℝ)*(1-1/((n:ℝ)+1))) * K *
R^(a-(m:ℝ)*(1-1/((n:ℝ)+1))))^(n+1) := by
have hq : (n : ℝ)+1 β‰  0 := by positivity
have hexp : ((m:ℝ)*(1-1/((n:ℝ)+1)))*((n:ℝ)+1) = (m*n:β„•) := by
push_cast
field_simp
ring
have hRexp : (a-(m:ℝ)*(1-1/((n:ℝ)+1)))*((n:ℝ)+1) =
(a-m)*((n:ℝ)+1)+m := by
field_simp
ring
have hscale : (K*R^(a-m))^(n+1)*R^m =
K^(n+1)*R^((a-(m:ℝ)*(1-1/((n:ℝ)+1)))*((n:ℝ)+1)) := by
rw [mul_pow, mul_assoc, ← Real.rpow_mul_natCast hR.le,
← Real.rpow_natCast R m, ← Real.rpow_add hR]
congr 2
rw [Nat.cast_add, Nat.cast_one, hRexp]
have h2 : (2 : ℝ)^m ≀ 256^d := by
apply (pow_le_pow_leftβ‚€ (by norm_num) (by norm_num : (2 : ℝ) ≀ 256) m).trans
exact pow_le_pow_rightβ‚€ (by norm_num) hm
have h128 : (128 : ℝ)^(d*n) ≀ 256^(d*n) :=
pow_le_pow_leftβ‚€ (by norm_num) (by norm_num) (d*n)
have hcoef : (2 : ℝ)^m * 128^(d*n) ≀ 256^(d*(n+1)) := by
apply (mul_le_mul h2 h128 (by positivity) (by positivity)).trans_eq
rw [← pow_add]
congr 1
ring
have hsqrt : Real.sqrt (2*d) ≀ 256*Real.sqrt d := by
rw [Real.sqrt_mul (by norm_num)]
apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _)
exact (Real.sqrt_le_iff.mpr ⟨by norm_num, by norm_num⟩)
have hS : ((256 : ℝ)^d * (256*Real.sqrt d)^((m:ℝ)*(1-1/((n:ℝ)+1))) * K *
R^(a-(m:ℝ)*(1-1/((n:ℝ)+1))))^(n+1) =
256^(d*(n+1)) * (256*Real.sqrt d)^(m*n) *
(K^(n+1)*R^((a-(m:ℝ)*(1-1/((n:ℝ)+1)))*((n:ℝ)+1))) := by
simp only [mul_pow]
rw [← pow_mul, ← Real.rpow_mul_natCast (by positivity),
← Real.rpow_mul_natCast hR.le]
simp only [Nat.cast_add, Nat.cast_one]
rw [hexp, Real.rpow_natCast]
ring
rw [hS]
calc
_ = (2^m*128^(d*n))*(Real.sqrt (2*d))^(m*n) *
(K^(n+1)*R^((a-(m:ℝ)*(1-1/((n:ℝ)+1)))*((n:ℝ)+1))) := by
rw [← hscale]
ring
_ ≀ _ := mul_le_mul_of_nonneg_right
(mul_le_mul hcoef (pow_le_pow_leftβ‚€ (Real.sqrt_nonneg _) hsqrt (m*n))
(by positivity) (by positivity)) (by positivity)
lemma ennreal_root_bound {q : β„•} (hq : q β‰  0) {v : ℝβ‰₯0∞} {B : ℝ}
(hB : 0 ≀ B) (h : v ≀ ENNReal.ofReal B ^ q) :
v ^ (1/(q:ℝ)) ≀ ENNReal.ofReal B := by
have hq' : (q : ℝ) β‰  0 := Nat.cast_ne_zero.mpr hq
have hh := ENNReal.rpow_le_rpow h (by positivity : 0 ≀ 1/(q:ℝ))
rwa [← ENNReal.ofReal_pow hB,
ENNReal.ofReal_rpow_of_nonneg (pow_nonneg hB q) (by positivity),
← Real.rpow_natCast_mul hB, mul_one_div_cancel hq', Real.rpow_one] at hh
lemma frame_cost_root {d m n : β„•} (hd : 1 ≀ d) (hm : m ≀ d)
(a K R : ℝ) (hK : 0 ≀ K) (hR : 0 < R) {v : ℝβ‰₯0∞}
(h : v ≀ (2 : ℝβ‰₯0∞)^m * ENNReal.ofReal (Real.sqrt (2*d))^(m*n) *
(ENNReal.ofReal (K*R^(a-m))^(n+1) * ENNReal.ofReal (R^m) *
(128 : ℝβ‰₯0∞)^(d*n))) :
v ^ (1/((n:ℝ)+1)) ≀
ENNReal.ofReal ((256 : ℝ)^d * (256*Real.sqrt d)^((m:ℝ)*(1-1/((n:ℝ)+1))) * K *
R^(a-(m:ℝ)*(1-1/((n:ℝ)+1)))) := by
have hb := ENNReal.ofReal_le_ofReal (frame_cost_power (n := n) hd hm a K R hK hR)
simp (discharger := positivity) only [ENNReal.ofReal_mul, ENNReal.ofReal_pow,
ENNReal.ofReal_ofNat] at hb
simp (discharger := positivity) only [ENNReal.ofReal_mul, ENNReal.ofReal_pow] at h
have hB : 0 ≀ (256 : ℝ)^d * (256*Real.sqrt d)^((m:ℝ)*(1-1/((n:ℝ)+1))) * K *
R^(a-(m:ℝ)*(1-1/((n:ℝ)+1))) := by positivity
have hb' : v ≀ (ENNReal.ofReal ((256 : ℝ)^d *
(256*Real.sqrt d)^((m:ℝ)*(1-1/((n:ℝ)+1))) * K *
R^(a-(m:ℝ)*(1-1/((n:ℝ)+1)))))^(n+1) := by
simp (discharger := positivity) only [ENNReal.ofReal_mul, ENNReal.ofReal_pow,
ENNReal.ofReal_ofNat]
exact h.trans hb
have hh := ennreal_root_bound (show n+1 β‰  0 by omega) hB hb'
simpa only [Nat.cast_add, Nat.cast_one] using hh
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
[FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]
omit [BorelSpace E] in
lemma measure_eq_zero_of_allBall_zero [BorelSpace E] {Ξ½ : Measure E} {a : ℝ}
(hΞ½ : AllBallMass Ξ½ 0 a) (z : E) {R : ℝ} (hR : 0 < R)
(hs : Ξ½.support βŠ† Metric.closedBall z R) : Ξ½ = 0 := by
apply Measure.measure_univ_eq_zero.mp
have he : Ξ½ Set.univ = Ξ½ (Metric.closedBall z R) := by
apply measure_congr
filter_upwards [Ξ½.support_mem_ae] with x hx
exact propext (iff_of_true (Set.mem_univ x) (hs hx))
rw [he]
apply le_antisymm _ bot_le
simpa using hΞ½ z R hR
omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in
@[simp] lemma lowerDensity_zero [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] (m : β„•) (x : (Fin m β†’ E) Γ— Label m) :
lowerDensity (0 : Measure E) m x = 0 := by
simp [lowerDensity, ballAverage, vectorSmoothing]
@[simp] lemma coordinateDensity_zero (m : β„•) (x : (Fin m β†’ E) Γ— (Fin m β†’ ℝ)) :
coordinateDensity (0 : Measure E) m x = 0 := lowerDensity_zero m _
lemma coordinateDensity_frame_support (Ξ½ : Measure E) [IsFiniteMeasure Ξ½] {m : β„•}
(z : E) {R : ℝ} (hR : 0 ≀ R) (hs : Ξ½.support βŠ† Metric.closedBall z R)
(A : Fin m β†’ E) (hA : Orthonormal ℝ A) (y : Fin m β†’ ℝ)
(hy : R < β€–WithLp.toLp 2 (y-coordinateMap A z)β€–) :
coordinateDensity Ξ½ m (A,y) = 0 := by
apply lowerDensity_eq_zero_of_far Ξ½ m A z R (WithLp.toLp 2 y) hs
have he : WithLp.toLp 2 (y-coordinateMap A z) = WithLp.toLp 2 y - rowMap A z := rfl
rw [he] at hy
exact (show β€–rowMap Aβ€– * R ≀ R from by nlinarith [norm_rowMap_le hA]).trans_lt hy
theorem integrated_frame_moment :
βˆƒ C : ℝ, 1 ≀ C ∧ βˆ€ (d k q : β„•) (Ξ² K R : ℝ)
(Ξ½ : Measure (EuclideanSpace ℝ (Fin d))) [IsFiniteMeasure Ξ½]
(z : EuclideanSpace ℝ (Fin d)) (u : Fin k β†’ EuclideanSpace ℝ (Fin d)),
1 ≀ k β†’ 2 ≀ q β†’ k+q ≀ d β†’ 0 < Ξ² β†’ Ξ² ≀ d β†’
1 ≀ Ξ²-k-((q:ℝ)-2) β†’ 0 ≀ K β†’ 0 < R β†’
Ξ½.support βŠ† Metric.closedBall z R β†’ AllBallMass Ξ½ K Ξ² β†’
Orthonormal ℝ u β†’
(βˆ€α΅ A βˆ‚frameLaw u, Ξ½.map (coordinateMap A) β‰ͺ (volume : Measure (Fin k β†’ ℝ))) β†’
Measurable (coordinateDensity ν k) ∧
(βˆ€α΅ A βˆ‚frameLaw u,
(volume : Measure (Fin k β†’ ℝ)).withDensity (fun y => coordinateDensity Ξ½ k (A,y)) =
ν.map (coordinateMap A)) ∧
(βˆ€ (A : Fin k β†’ EuclideanSpace ℝ (Fin d)), Orthonormal ℝ A β†’
βˆ€ y : Fin k β†’ ℝ,
R < β€–WithLp.toLp 2 (y-coordinateMap A z)β€– β†’ coordinateDensity Ξ½ k (A,y) = 0) ∧
(∫⁻ A, ∫⁻ y : Fin k β†’ ℝ, coordinateDensity Ξ½ k (A,y)^q βˆ‚volume βˆ‚frameLaw u) ^ (1/(q:ℝ)) ≀
ENNReal.ofReal (C^d * (C*Real.sqrt d)^((k:ℝ)*(1-1/(q:ℝ))) *
K * R^(Ξ²-(k:ℝ)*(1-1/(q:ℝ)))) := by
refine ⟨256, by norm_num, ?_⟩
intro d k q Ξ² K R Ξ½ _ z u hk hq hdim hΞ² hΞ²d hmargin hK hR hs hΞ½ hu hac
refine ⟨measurable_coordinateDensity ν k, ?_, ?_, ?_⟩
Β· filter_upwards [hac] with A hA
exact coordinateDensity_is_density Ξ½ k A hA
Β· intro A hA y hy
exact coordinateDensity_frame_support Ξ½ z hR.le hs A hA y hy
Β· rcases eq_or_lt_of_le hK with hK0 | hK0
Β· have hzero : Ξ½ = 0 := measure_eq_zero_of_allBall_zero (hK0 β–Έ hΞ½) z hR hs
subst Ξ½
simp only [coordinateDensity_zero, zero_pow (by omega : q β‰  0), lintegral_zero]
rw [ENNReal.zero_rpow_of_pos (by positivity : 0 < 1/(q:ℝ))]
exact bot_le
Β· have hn : q-1+1 = q := by omega
have hnR : ((q-1:β„•):ℝ)+1 = q := by exact_mod_cast hn
have hmm : ((q-1:β„•):ℝ)+k ≀ Ξ² := by linarith
have h := frame_moment_scaled hΞ½ hK0 z hR hs k (q-1) hmm
(by simpa using (show 1 ≀ d by omega)) (by simpa using hΞ²d)
(by simpa using (show k ≀ d by omega)) u hu hac
have ht := frame_cost_root (d := d) (m := k) (n := q-1) (by omega) (by omega)
Ξ² K R hK hR (by simpa only [finrank_euclideanSpace_fin] using h)
simpa only [labelMoment, hn, hnR] using ht
end ProjectionMoments
end
end OAI