File size: 5,213 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import Mathlib

namespace OAI

noncomputable section

open Filter Finset
open scoped Topology

namespace Problem367

theorem hasSum_of_uniform_energy_tails
    {ΞΉ : Type*} {a : β„• β†’ ΞΉ β†’ ℝ} {b : ΞΉ β†’ ℝ} {energy : β„• β†’ ℝ} {total : ℝ}
    (ha : βˆ€ n i, 0 ≀ a n i)
    (hpartial : βˆ€ n (s : Finset ΞΉ), βˆ‘ i ∈ s, a n i ≀ energy n)
    (hcoordinate : βˆ€ i, Tendsto (fun n => a n i) atTop (𝓝 (b i)))
    (henergy : Tendsto energy atTop (𝓝 total))
    (htail : βˆ€ Ξ΅ > 0, βˆƒ s : Finset ΞΉ,
      βˆ€ n, energy n - βˆ‘ i ∈ s, a n i ≀ Ξ΅) :
    HasSum b total := by
  classical
  have hb : βˆ€ i, 0 ≀ b i := fun i =>
    ge_of_tendsto (hcoordinate i) (Eventually.of_forall fun n => ha n i)
  have hsumlim (s : Finset ΞΉ) :
      Tendsto (fun n => βˆ‘ i ∈ s, a n i) atTop (𝓝 (βˆ‘ i ∈ s, b i)) :=
    tendsto_finsetSum s (fun i _ => hcoordinate i)
  have hbound (s : Finset ΞΉ) : βˆ‘ i ∈ s, b i ≀ total :=
    le_of_tendsto_of_tendsto (hsumlim s) henergy
      (Eventually.of_forall fun n => hpartial n s)
  have hsummable : Summable b := summable_of_sum_le hb hbound
  have hle : βˆ‘' i, b i ≀ total := hsummable.tsum_le_of_sum_le hbound
  have hge : total ≀ βˆ‘' i, b i := by
    apply le_of_forall_pos_le_add
    intro Ξ΅ hΞ΅
    obtain ⟨s, hs⟩ := htail Ρ hΡ
    have hrem : total - βˆ‘ i ∈ s, b i ≀ Ξ΅ :=
      le_of_tendsto (henergy.sub (hsumlim s)) (Eventually.of_forall hs)
    have hfinite : βˆ‘ i ∈ s, b i ≀ βˆ‘' i, b i :=
      hsummable.sum_le_tsum s (fun i _ => hb i)
    linarith
  simpa only [le_antisymm hle hge] using hsummable.hasSum

theorem uniform_energy_tails_of_two_stage_bound
    {ΞΉ : Type*} {a : β„• β†’ ΞΉ β†’ ℝ} {energy : β„• β†’ ℝ}
    {sets : β„• β†’ Finset ΞΉ} {early : β„• β†’ ℝ} {late : β„• β†’ β„• β†’ ℝ}
    (hearly : Tendsto early atTop (𝓝 0))
    (hlate : βˆ€ k, Tendsto (late k) atTop (𝓝 0))
    (hbound : βˆ€ n k L,
      energy n - βˆ‘ i ∈ sets L, a n i ≀ early k + late k L) :
    βˆ€ Ξ΅ > 0, βˆƒ s : Finset ΞΉ, βˆ€ n, energy n - βˆ‘ i ∈ s, a n i ≀ Ξ΅ := by
  intro Ξ΅ hΞ΅
  have hhalf : 0 < Ξ΅ / 2 := half_pos hΞ΅
  obtain ⟨k, hk⟩ := ((tendsto_order.1 hearly).2 (Ρ / 2) hhalf).exists
  obtain ⟨L, hL⟩ := ((tendsto_order.1 (hlate k)).2 (Ρ / 2) hhalf).exists
  refine ⟨sets L, fun n => ?_⟩
  have := hbound n k L
  linarith

section Hilbert

variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H]

theorem norm_sq_residual_of_testing (x y : H)
    (htest : inner ℝ x y = β€–yβ€– ^ 2) :
    β€–x - yβ€– ^ 2 = β€–xβ€– ^ 2 - β€–yβ€– ^ 2 := by
  rw [norm_sub_sq_real, htest]
  ring

theorem tendsto_of_testing_and_energy
    {Ξ± : Type*} {l : Filter Ξ±} {s : Ξ± β†’ H} {x : H}
    (htest : βˆ€ n, inner ℝ x (s n) = β€–s nβ€– ^ 2)
    (henergy : Tendsto (fun n => β€–s nβ€– ^ 2) l (𝓝 (β€–xβ€– ^ 2))) :
    Tendsto s l (𝓝 x) := by
  have hres (n : Ξ±) : β€–s n - xβ€– ^ 2 = β€–xβ€– ^ 2 - β€–s nβ€– ^ 2 := by
    rw [norm_sub_rev]
    exact norm_sq_residual_of_testing x (s n) (htest n)
  have hsq : Tendsto (fun n => β€–s n - xβ€– ^ 2) l (𝓝 0) := by
    simpa only [hres, sub_self] using
      (tendsto_const_nhds : Tendsto (fun _ : Ξ± => β€–xβ€– ^ 2) l (𝓝 (β€–xβ€– ^ 2))).sub henergy
  apply tendsto_iff_norm_sub_tendsto_zero.mpr
  simpa only [Real.sqrt_sq_eq_abs, abs_norm, Real.sqrt_zero] using hsq.sqrt

theorem norm_sq_sum_of_pairwise_orthogonal
    {ΞΉ : Type*} (u : ΞΉ β†’ H)
    (hortho : βˆ€ i j, i β‰  j β†’ inner ℝ (u i) (u j) = 0)
    (s : Finset ΞΉ) : β€–βˆ‘ i ∈ s, u iβ€– ^ 2 = βˆ‘ i ∈ s, β€–u iβ€– ^ 2 := by
  classical
  rw [← real_inner_self_eq_norm_sq, sum_inner]
  apply Finset.sum_congr rfl
  intro i hi
  rw [inner_sum, Finset.sum_eq_single i]
  Β· exact real_inner_self_eq_norm_sq (u i)
  Β· intro j hj hji
    exact hortho i j hji.symm
  Β· intro hnot
    exact (hnot hi).elim

theorem hasSum_of_orthogonal_testing_and_energy
    {ΞΉ : Type*} {u : ΞΉ β†’ H} {x : H}
    (hortho : βˆ€ i j, i β‰  j β†’ inner ℝ (u i) (u j) = 0)
    (htest : βˆ€ i, inner ℝ x (u i) = β€–u iβ€– ^ 2)
    (henergy : HasSum (fun i => β€–u iβ€– ^ 2) (β€–xβ€– ^ 2)) :
    HasSum u x := by
  classical
  apply tendsto_of_testing_and_energy
  Β· intro s
    rw [inner_sum, norm_sq_sum_of_pairwise_orthogonal u hortho s]
    exact Finset.sum_congr rfl fun i _ => htest i
  Β· simpa only [HasSum, norm_sq_sum_of_pairwise_orthogonal u hortho] using henergy

theorem hasSum_of_uniform_energy_tails_and_testing
    {ΞΉ : Type*} {a : β„• β†’ ΞΉ β†’ ℝ} {energy : β„• β†’ ℝ} {u : ΞΉ β†’ H} {x : H}
    (ha : βˆ€ n i, 0 ≀ a n i)
    (hpartial : βˆ€ n (s : Finset ΞΉ), βˆ‘ i ∈ s, a n i ≀ energy n)
    (hcoordinate : βˆ€ i, Tendsto (fun n => a n i) atTop (𝓝 (β€–u iβ€– ^ 2)))
    (henergy : Tendsto energy atTop (𝓝 (β€–xβ€– ^ 2)))
    (htail : βˆ€ Ξ΅ > 0, βˆƒ s : Finset ΞΉ,
      βˆ€ n, energy n - βˆ‘ i ∈ s, a n i ≀ Ξ΅)
    (hortho : βˆ€ i j, i β‰  j β†’ inner ℝ (u i) (u j) = 0)
    (htest : βˆ€ i, inner ℝ x (u i) = β€–u iβ€– ^ 2) :
    HasSum u x :=
  hasSum_of_orthogonal_testing_and_energy hortho htest
    (hasSum_of_uniform_energy_tails ha hpartial hcoordinate henergy htail)

end Hilbert

end Problem367

end

end OAI