theoremenergy_average_le {IN : Type*} [FintypeI] [NonemptyI] [FintypeN]
(f : I→N→ℝ) : energy (fun n => 𝔼 i, f i n) ≤ 𝔼 i, energy (f i) :=by
proof · 4
lines
calc
energy (fun n => 𝔼 i, f i n) ≤ 𝔼 n, 𝔼 i, f i n ^ 2:=Finset.expect_le_expect fun n _ => sq_average_le_average_sq (fun i => f i n)
_ = 𝔼 i, energy (f i) :=Finset.expect_comm _ _ _
theoremenergy_average_le_of_bound {IN : Type*} [FintypeI] [NonemptyI]
[FintypeN] (f : I→N→ℝ) (η : ℝ) (h : ∀ i, energy (f i) ≤ η) :
energy (fun n => 𝔼 i, f i n) ≤ η :=
proof · 1
line
(energy_average_le f).trans (Finset.expect_le Finset.univ_nonempty (fun i _ => h i))
theoremenergy_weighted_sum_le {IN : Type*} [FintypeI] [FintypeN]
(w : I→ℝ) (f : I→N→ℝ) (η : ℝ)
(hw : ∀ i, 0≤ w i) (hf : ∀ i, energy (f i) ≤ η) :
energy (fun n =>∑ i, w i * f i n) ≤ (∑ i, w i) ^ 2 * η :=by
proof · 19
lines
havehsum : 0≤∑ i, w i :=Finset.sum_nonneg (fun i _ => hw i)
calc
energy (fun n =>∑ i, w i * f i n) ≤
𝔼 n, (∑ i, w i) * ∑ i, w i * f i n ^ 2:=by
apply Finset.expect_le_expect
intro n _
apply Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul Finset.univ
· exact fun i _ => hw i
· exact fun i _ => mul_nonneg (hw i) (sq_nonneg _)
· intro i _
exact le_of_eq (by ring)
_ = (∑ i, w i) * ∑ i, w i * energy (f i) :=by
rw [←Finset.mul_expect, Finset.expect_sum_comm]
simp_rw [←Finset.mul_expect]
rfl
_ ≤ (∑ i, w i) * ∑ i, w i * η :=by
apply mul_le_mul_of_nonneg_left _ hsum
exact Finset.sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left (hf i) (hw i))
_ = (∑ i, w i) ^ 2 * η :=by rw [←Finset.sum_mul]; ring
theoremrestrictionEnergy_average_translate_le {IMN : Type*}
[FintypeI] [NonemptyI] [AddCommGroupM] [FintypeN]
(f : M→ℝ) (ι : N→M) (shifts : I→M) (η : ℝ)
(h : ∀T, restrictionEnergy f ι T≤ η) (T : M) :
restrictionEnergy (fun x => 𝔼 i, f (x + shifts i)) ι T≤ η :=by
proof · 3
lines
apply energy_average_le_of_bound (fun i n => f ((T + ι n) + shifts i)) η
intro i
simpa only [restrictionEnergy, add_right_comm T] using h (T + shifts i)
theoremrestrictionGlobal_weighted_sum {I : Type*} [FintypeI]
(w : I→ℝ) (f : I→ (E→ₗ[F2] F) →ℝ) (d : Nat) (η : ℝ)
(hw : ∀ i, 0≤ w i) (hf : ∀ i, RestrictionGlobal d η (f i)) :
RestrictionGlobal d ((∑ i, w i) ^ 2 * η) (funX=>∑ i, w i * f i X) :=by
proof · 3
lines
intro AB hord T
exact energy_weighted_sum_le w (fun i n => f i (T + embed AB n)) η hw
(fun i => hf i AB hord T)
theoremrestrictionGlobal_three_terms (d : Nat) (η a b : ℝ)
(f g h : (E→ₗ[F2] F) →ℝ) (ha : 0≤ a) (hb : 0≤ b)
(hf : RestrictionGlobal d η f) (hg : RestrictionGlobal d η g)
(hh : RestrictionGlobal d η h) :
RestrictionGlobal d ((1 + a + b) ^ 2 * η)
(funX=> f X - a * g X + b * h X) :=by
proof · 17
lines
letw : Fin3→ℝ:=fun i =>if i = 0then1elseif i = 1then a else b
letfs : Fin3→ (E→ₗ[F2] F) →ℝ:=fun i =>if i = 0then f elseif i = 1then (funX=> -g X) else h
havehw : ∀ i, 0≤ w i :=by
intro i
rcases (show i = 0∨ i = 1∨ i = 2by omega) with rfl | rfl | rfl
· simp [w]
· simpa [w] using ha
· simpa [w] using hb
havehfs : ∀ i, RestrictionGlobal d η (fs i) :=by
intro i
rcases (show i = 0∨ i = 1∨ i = 2by omega) with rfl | rfl | rfl
· simpa [fs] using hf
· simpa [fs] using restrictionGlobal_neg d η g hg
· simpa [fs] using hh
have hs := restrictionGlobal_weighted_sum w fs d η hw hfs
simpa [w, fs, Fin.sum_univ_succ, sub_eq_add_neg, add_assoc] using hs
have hg := restrictionGlobal_averageTranslates shifts d η f hf
have hh := restrictionGlobal_averageTranslates shifts d η (averageTranslates shifts f) hg
exact restrictionGlobal_three_terms d η _ _ f _ _
(add_nonneg (pow_nonneg (by norm_num) _) (pow_nonneg (by norm_num) _))
(pow_nonneg (by norm_num) _) hf hg hh
theoremrestrictionGlobal_lineAverage (v : E) (hv : v ≠0)
(d : Nat) (η : ℝ) (f : (E→ₗ[F2] F) →ℝ) (hf : RestrictionGlobal d η f) :
RestrictionGlobal d η (lineAverage v f) :=by
proof · 2
lines
let:= lineIndex_nonempty (F:=F) v hv
exact restrictionGlobal_averageTranslates (lineShift v) d η f hf
theoremglobal_average_family {I : Type*} [FintypeI] [NonemptyI]
(f : I→ (E→ₗ[F2] F) →ℝ) (d : ℕ) (η : ℝ)
(hf : ∀ i, RestrictionGlobal d η (f i)) :
RestrictionGlobal d η (funX=> 𝔼 i, f i X) :=by
proof · 3
lines
intro AB hord T
exact energy_average_le_of_bound (fun i N=> f i (T + embed ABN)) η
(fun i => hf i AB hord T)
theoremrankNoise_global (d : ℕ) (η : ℝ) (f : (E→ₗ[F2] F) →ℝ)
(hf : RestrictionGlobal d η f) : RestrictionGlobal d η (rankNoise f) :=by
proof · 12
lines
classical
let : FintypeF:=Fintype.ofFinite Flet : Fintype (E→ₗ[F2] F2) := linearMapFintype
havehe : rankNoise f =
funX=> 𝔼 v : F, 𝔼 φ : E→ₗ[F2] F2, f (X + φ.smulRight v) :=by
funext X
exact rankNoise_eq_average f X
rw [he]
apply global_average_family _ d η
intro v
exact restrictionGlobal_averageTranslates (funφ : E→ₗ[F2] F2=> φ.smulRight v)
d η f hf
let a := node j / (node j - node d)
let b := (node j - node d)⁻¹haveha : 0≤ a := div_nonneg (node_pos j).le (node_gap hj).1.le
havehb : 0≤ b := inv_nonneg.mpr (node_gap hj).1.le
letw : Fin2→ℝ:=fun i =>if i = 0then a else b
letfs : Fin2→ (E→ₗ[F2] F) →ℝ:=fun i =>if i = 0then f elsefunX=> -rankNoise f Xhavehw : ∀ i, 0≤ w i :=by
intro i
rcases (show i = 0∨ i = 1by omega) with rfl | rfl
· simpa [w] using ha
· simpa [w] using hb
havehfs : ∀ i, RestrictionGlobal d η (fs i) :=by
intro i
rcases (show i = 0∨ i = 1by omega) with rfl | rfl
· simpa [fs] using hf
· simpa [fs] using restrictionGlobal_neg d η (rankNoise f) (rankNoise_global d η f hf)
have hs := restrictionGlobal_weighted_sum w fs d η hw hfs
havehe : (funX=>∑i : Fin2, w i * fs i X) = step d j f :=by
funext X
simp [w, fs, Fin.sum_univ_succ, step, a, b, div_eq_mul_inv]
ring
havehwSum : (∑i : Fin2, w i) = a + b :=by simp [w, Fin.sum_univ_succ]
rw [he, hwSum] at hs
apply global_mono_bound _ hs
havehc : a + b ≤ (2 : ℝ) ^ (d + 1) := step_coefficient_bound hj
havehsq : (a + b) ^ 2≤ ((2 : ℝ) ^ (d + 1)) ^ 2:=by
nlinarith [mul_nonneg (sub_nonneg.mpr hc)
(show0≤ (2 : ℝ) ^ (d + 1) + (a + b) by positivity)]
havehp : ((2 : ℝ) ^ (d + 1)) ^ 2 = (2 : ℝ) ^ (2 * (d + 1)) :=by
rw [← pow_mul]
congr 1
omega
rw [hp] at hsq
exact mul_le_mul_of_nonneg_right hsq (global_nonneg d η f hf)
theoremiterateFilter_global (d k : ℕ) (hk : k ≤ d) (η : ℝ)
(f : (E→ₗ[F2] F) →ℝ) (hf : RestrictionGlobal d η f) :
RestrictionGlobal d ((2 : ℝ) ^ (2 * k * (d + 1)) * η) (iterateFilter d k f) :=by
proof · 7
lines
induction k with
| zero => simpa [iterateFilter] using hf
| succ k ih =>havehk' : k ≤ d :=by omega
have hs := step_global d k (by omega) _ _ (ih hk')
havehex : 2 * (d + 1) + 2 * k * (d + 1) = 2 * (k + 1) * (d + 1) :=by ring
simpa only [iterateFilter, ← mul_assoc, ← pow_add, hex] using hs
theoremcoefficient_linearCombination (a b : ℝ) (f g : (E→ₗ[F2] F) →ℝ)
(S : F→ₗ[F2] E) :
linearCoeff (funX=> a * f X + b * g X) S =
a * linearCoeff f S + b * linearCoeff g S:=by
theoremstep_coeff (d j : ℕ) (f : (E→ₗ[F2] F) →ℝ) (S : F→ₗ[F2] E) :
linearCoeff (step d j f) S =
((node j - node (frequencyRank S)) / (node j - node d)) * linearCoeff f S:=by
proof · 9
lines
havehe : step d j f = funX=>
(node j / (node j - node d)) * f X +
(-1 / (node j - node d)) * rankNoise f X:=by
funext X
dsimp [step]
ring
rw [he, coefficient_linearCombination, rankNoise_coeff]
simp only [div_eq_mul_inv]
ring
theoremiterateFilter_coeff (d k : ℕ) (f : (E→ₗ[F2] F) →ℝ) (S : F→ₗ[F2] E) :
linearCoeff (iterateFilter d k f) S =
multiplier d k (frequencyRank S) * linearCoeff f S:=by
proof · 3
lines
induction k with
| zero => simp [iterateFilter, multiplier]
| succ k ih => rw [iterateFilter, step_coeff, ih, multiplier_succ]; ring
theoremiterateFilter_coeff_low (d : ℕ) (f : (E→ₗ[F2] F) →ℝ)
(S : F→ₗ[F2] E) (hS : frequencyRank S≤ d) :
linearCoeff (iterateFilter d d f) S =
if frequencyRank S = d then linearCoeff f Selse0:=by
proof · 7
lines
rw [iterateFilter_coeff]
by_cases he : frequencyRank S = d
· rw [he, multiplier_target d d le_rfl]
simp
· havehl : frequencyRank S < d :=by omega
rw [multiplier_below d d _ hl]
simp [he]
theoremrankLevel_eq_projector (d : ℕ) (f : (E→ₗ[F2] F) →ℝ) :
rankLevel d f = Derivatives.spectralProjector (funY=> frequencyRank Y = d) f :=by
proof · 4
lines
apply Derivatives.function_eq_of_linearCoeff_eq
intro Y
rw [linearCoeff_rankLevel, Derivatives.linearCoeff_spectralProjector]
by_cases h : frequencyRank Y = d <;> simp [h]
theoremhybridDerivative_rankLevel_eq_local_projection (d : ℕ)
(f : (E→ₗ[F2] F) →ℝ) (A : SubmoduleF2E) (B : SubmoduleF2F)
[Fintype (B→ₗ[F2] (E ⧸ A))] (T : E→ₗ[F2] F) (hord : order AB≤ d) :
Derivatives.hybridDerivative ABT (rankLevel d f) =
rankLevel (d - order AB) (restrict (iterateFilter d d f) ABT) :=by
proof · 4
lines
rw [rankLevel_eq_projector (d - order AB) (restrict (iterateFilter d d f) ABT),
Derivatives.spectralProjector_restriction,
filtered_compression_projector d f AB hord]
rfl
theoremhybridDerivative_rankLevel_energy_le_strong (d : ℕ) (η : ℝ)
(f : (E→ₗ[F2] F) →ℝ) (hf : IsRestrictionGlobal f d η)
(A : SubmoduleF2E) (B : SubmoduleF2F) (T : E→ₗ[F2] F)
(hord : order AB≤ d) :
(𝔼 N, Derivatives.hybridDerivative ABT (rankLevel d f) N ^ 2) ≤
(2 : ℝ) ^ (2 * d * (d + 1)) * η :=by
proof · 9
lines
classical
let : Finite (E ⧸ A) :=Finite.of_surjective A.mkQ A.mkQ_surjective
let : Fintype (B→ₗ[F2] (E ⧸ A)) := linearMapFintype
havehglobal : RestrictionGlobal d η f :=by
intro A'B' horder T'
exact hf A'B'T' horder
have hg := iterateFilter_global d d le_rfl η f hglobal
rw [hybridDerivative_rankLevel_eq_local_projection d f ABT hord]
exact (rankLevel_energy_le _ _).trans (hg AB hord T)
theoremhybridDerivative_rankLevel_energy_le (d : ℕ) (η : ℝ)
(f : (E→ₗ[F2] F) →ℝ) (hf : IsRestrictionGlobal f d η)
(A : SubmoduleF2E) (B : SubmoduleF2F) (T : E→ₗ[F2] F)
(hord : order AB≤ d) :
(𝔼 N, Derivatives.hybridDerivative ABT (rankLevel d f) N ^ 2) ≤
(2 : ℝ) ^ (10 * d * d) * η :=by
proof · 8
lines
havehglobal : RestrictionGlobal d η f :=by
intro A'B' horder T'
exact hf A'B'T' horder
havehe : 2 * d * (d + 1) ≤10 * d * d :=by
nlinarith [Nat.le_mul_self d]
exact (hybridDerivative_rankLevel_energy_le_strong d η f hf ABT hord).trans
(mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (bynorm_num : (1 : ℝ) ≤2) he)
(global_nonneg d η f hglobal))
theoremhybridSelectorEnergy_le (d : ℕ) (f : (E→ₗ[F2] F) →ℝ)
(hdegree : ∀Y, d < Module.finrank F2Y.range → linearCoeff f Y = 0) :
Derivatives.hybridSelectorEnergy d f ≤
(2 : ℝ) ^ (3 * d * d) * (𝔼 X, f X ^ 2) :=by
proof · 17
lines
classical
unfold Derivatives.hybridSelectorEnergy Derivatives.hybridProjector
apply Derivatives.selector_energy_sum_le
intro Y hY
havehrank : Module.finrank F2Y.range ≤ d :=by
by_contra hn
exact hY (hdegree Y (Nat.lt_of_not_ge hn))
have hc :=HybridCounting.card_hybridIndex_le Y d hrank
havehcount : Derivatives.selectorMultiplicity
(funs : Derivatives.HybridIndex (E:=E) (F:=F) d =>funY=>LinearIdentities.HybridY s.val.1 s.val.2) Y =
Nat.card {s : Derivatives.HybridIndex (E:=E) (F:=F) d //
LinearIdentities.HybridY s.val.1 s.val.2} :=by
simp only [Derivatives.selectorMultiplicity, Nat.card_eq_fintype_card,
Fintype.card_subtype]
rw [hcount]
exact_mod_cast hc
theoremhybridMomentSum_rankLevel_le (d : ℕ) (η : ℝ)
(f : (E→ₗ[F2] F) →ℝ) (hf : LevelInequality.IsRestrictionGlobal f d η) :
Derivatives.hybridMomentSum d (LevelInequality.rankLevel d f) ≤
(2 : ℝ) ^ (13 * d * d) * η * (𝔼 X, f X ^ 2) :=by
proof · 27
lines
havehglobal : Globality.RestrictionGlobal d η f :=by
intro AB hord T
exact hf ABT hord
havehη : 0≤ η :=RankLevelFilter.global_nonneg d η f hglobal
have hu :=Derivatives.hybridMomentSum_le_of_uniform_energy d
(LevelInequality.rankLevel d f) ((2 : ℝ) ^ (10 * d * d) * η)
(funABT h =>RankLevelFilter.hybridDerivative_rankLevel_energy_le d η f hf ABT h)
have hs := hybridSelectorEnergy_le d (LevelInequality.rankLevel d f)
(funY hY =>LevelInequality.rankLevel_degree_le d f Y hY)
have hc :=LevelInequality.rankLevel_energy_le d f
havehζ : 0≤ (2 : ℝ) ^ (10 * d * d) * η := mul_nonneg (by positivity) hη
havehp : (2 : ℝ) ^ (10 * d * d) * (2 : ℝ) ^ (3 * d * d) =
(2 : ℝ) ^ (13 * d * d) :=by
rw [← pow_add]
congr 1
ring
calc
_ ≤ ((2 : ℝ) ^ (10 * d * d) * η) * Derivatives.hybridSelectorEnergy d
(LevelInequality.rankLevel d f) := hu
_ ≤ ((2 : ℝ) ^ (10 * d * d) * η) * ((2 : ℝ) ^ (3 * d * d) *
(𝔼 X, LevelInequality.rankLevel d f X ^ 2)) :=
mul_le_mul_of_nonneg_left hs hζ
_ ≤ ((2 : ℝ) ^ (10 * d * d) * η) * ((2 : ℝ) ^ (3 * d * d) * (𝔼 X, f X ^ 2)) :=
mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hc (by positivity)) hζ
_ = ((2 : ℝ) ^ (10 * d * d) * (2 : ℝ) ^ (3 * d * d)) * η * (𝔼 X, f X ^ 2) :=by
ring
_ = _ :=by rw [hp]
theoremrankLevel_fourth_moment_le (d : ℕ) (η : ℝ)
(f : (E→ₗ[F2] F) →ℝ) (hf : IsRestrictionGlobal f d η) :
(𝔼 M, rankLevel d f M^4) ≤
(2:ℝ)^(113*d*d) * η * (𝔼 M, f M^2) :=by
proof · 13
lines
have ha :=A5Induction.derivative_inequality d (rankLevel d f)
(DerivativeDegree.degree_rankLevel d f)
have hs :=SelectorEnergy.hybridMomentSum_rankLevel_le d η f hf
havehp : (2:ℝ)^(100*d^2) * (2:ℝ)^(13*d*d) = (2:ℝ)^(113*d*d) :=by
rw [← pow_add]
congr 1
ring
calc
_ ≤ (2:ℝ)^(100*d^2) * Derivatives.hybridMomentSum d (rankLevel d f) := ha
_ ≤ (2:ℝ)^(100*d^2) * ((2:ℝ)^(13*d*d) * η * (𝔼 M, f M^2)) :=
mul_le_mul_of_nonneg_left hs (by positivity)
_ = ((2:ℝ)^(100*d^2) * (2:ℝ)^(13*d*d)) * η * (𝔼 M, f M^2) :=by ring
_ = _ :=by rw [hp]
let : FiniteDimensionalF2E:=Module.Finite.of_finite
let : FiniteDimensionalF2F:=Module.Finite.of_finite
intro d _ ρ hρ _ f hf hrestricted
havehglobal : IsRestrictionGlobal f d ρ :=
(boolean_global_iff_density f hf d ρ).mpr hrestricted
have hfourth := rankLevel_fourth_moment_le d ρ f hglobal
rw [boolean_squared_norm_eq_density hf] at hfourth
exact rankLevel_bound_of_fourth_moment d f hf ρ hρ.le hfourth
theoremsum_rank_le {ι : Type*} [Fintype ι] (rk : ι →Nat) (w : ι →ℝ) (r : Nat) :
(∑ i, if rk i ≤ r then w i else0) =
∑ d ∈Finset.range (r + 1), ∑ i, if rk i = d then w i else0:=by
proof · 6
lines
calc
_ = ∑ i, ∑ d ∈Finset.range (r + 1), if rk i = d then w i else0:=by
apply Finset.sum_congr rfl
intro i _
simp [Finset.mem_range]
_ = _ :=Finset.sum_comm
theoremrankCutoffEnergy_eq_sum_exactRankMass (r : Nat) (f : (E→ₗ[F2] F) →ℝ) :
rankCutoffEnergy r f =
∑ d ∈Finset.range (r + 1), ∑Swith frequencyRank S = d, linearCoeff f S ^ 2:=by
proof · 2
lines
simpa only [rankCutoffEnergy, Finset.sum_filter] using
sum_rank_le frequencyRank (funS=> linearCoeff f S ^ 2) r
theoremrankCutoffEnergy_eq_sum_rankLevel (r : Nat) (f : (E→ₗ[F2] F) →ℝ) :
rankCutoffEnergy r f =
∑ d ∈Finset.range (r + 1), (𝔼 X, rankLevel d f X ^ 2) :=by
proof · 1
line
simp only [rankLevel_energy, rankCutoffEnergy_eq_sum_exactRankMass]