math / data /lean /OAI /Probability /FreeIsing /Energy /EnergyLimit.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.21 kB
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