Download data/lean/OAI/Analysis/HardSphere/Paths/TimeGaps.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 19.9 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HardSphere/Paths/TimeGaps.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/HardSphere/Paths/TimeGaps.lean
-
curl -L -o TimeGaps.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HardSphere/Paths/TimeGaps.lean
19.9 kB
| import Mathlib | |
| import OAI.Analysis.HardSphere.Paths.Index | |
| namespace OAI | |
| section | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal BigOperators Topology | |
| namespace HardSphere.DyadicSkeleton | |
| lemma weighted_gap_concentration (t k : β) (hk : 0 < k) | |
| (y : Fin 2 β β) (R : β) (hR : 0 β€ R) (H : Noise β ββ₯0β) | |
| (hH : Measurable H) (hinv : PastInvariant t H) : | |
| (β«β» Ο, H Ο * nearTest (t+k) y R Ο βlaw) β€ | |
| ENNReal.ofReal ((16*R^2/cvel^2) * (k:β)^(-(3:β)/2)) * | |
| β«β» Ο, H Ο βlaw := by | |
| obtain β¨β,b,ht,hf,hkββ© := exists_fresh_block t k hk | |
| refine (fresh_weighted_pair β b (t+k) hf y R H hH | |
| (fun j β¦ hinv j β b ht)).trans ?_ | |
| apply mul_le_mul_left | |
| rw [β ENNReal.ofReal_pow (div_nonneg hR (freshScale_pos β).le)] | |
| exact ENNReal.ofReal_le_ofReal (freshScale_gap_bound k β hk hkβ R) | |
| def timeGaps : {n : β} β (Fin n β β) β Fin n β β | |
| | 0, _ => Fin.elim0 | |
| | _+1, t => Fin.cases (t 0) (fun i β¦ t i.succ - t i.castSucc) | |
| @[simp] lemma timeGaps_zero {n : β} (t : Fin (n+1) β β) : timeGaps t 0 = t 0 := rfl | |
| @[simp] lemma timeGaps_succ {n : β} (t : Fin (n+1) β β) (i : Fin n) : | |
| timeGaps t i.succ = t i.succ - t i.castSucc := rfl | |
| lemma timeGaps_castSucc {n : β} (t : Fin (n+1) β β) (i : Fin n) : | |
| timeGaps t i.castSucc = timeGaps (Fin.init t) i := by | |
| cases n with | |
| | zero => exact Fin.elim0 i | |
| | succ n => exact Fin.cases rfl (fun _ β¦ rfl) i | |
| lemma timeGaps_injective {n : β} : | |
| Function.Injective (fun t : {t : Fin n β β // Monotone t} β¦ timeGaps t.val) := by | |
| intro t s h | |
| apply Subtype.ext | |
| funext i | |
| cases n with | |
| | zero => exact Fin.elim0 i | |
| | succ n => | |
| refine Fin.induction ?_ (fun j ih β¦ ?_) i | |
| Β· exact congrFun h 0 | |
| Β· have he := congrFun h j.succ | |
| simp only [timeGaps_succ] at he | |
| have ht := t.property (Fin.castSucc_le_succ j) | |
| have hs := s.property (Fin.castSucc_le_succ j) | |
| omega | |
| def splitVectorEquiv (n : β) (A : Type*) : (Fin (n+1) β A) β A Γ (Fin n β A) where | |
| toFun f := (f 0, fun i β¦ f i.succ) | |
| invFun v := Fin.cases v.1 v.2 | |
| left_inv f := by funext i; exact Fin.cases rfl (fun _ β¦ rfl) i | |
| right_inv v := rfl | |
| lemma tsum_vector_prod {n : β} (f : Fin n β β β ββ₯0β) : | |
| (β' g : Fin n β β, β i, f i (g i)) = β i, β' k, f i k := by | |
| induction n with | |
| | zero => simp | |
| | succ n ih => | |
| rw [β (splitVectorEquiv n β).symm.tsum_eq] | |
| change (β' v : β Γ (Fin n β β), β i, f i (Fin.cases v.1 v.2 i)) = _ | |
| rw [ENNReal.tsum_prod'] | |
| simp only [Fin.prod_univ_succ, Fin.cases_zero, Fin.cases_succ] | |
| simp_rw [ENNReal.tsum_mul_left, ih] | |
| rw [ENNReal.tsum_mul_right] | |
| lemma ordered_gap_sum_bound (T n : β) (b : β β ββ₯0β) : | |
| (β' t : {t : Fin n β β // StrictMono t β§ β i, t i β€ T}, β i, b (timeGaps t.val i)) β€ | |
| (β' k, b k)^n := by | |
| let g : {t : Fin n β β // StrictMono t β§ β i, t i β€ T} β (Fin n β β) := | |
| fun t β¦ timeGaps t.val | |
| have hg : Function.Injective g := by | |
| intro t s he | |
| have hv := timeGaps_injective (aβ := β¨t.val,t.property.1.monotoneβ©) | |
| (aβ := β¨s.val,s.property.1.monotoneβ©) he | |
| exact Subtype.ext (congrArg (fun q : {f : Fin n β β // Monotone f} β¦ q.val) hv) | |
| have h := ENNReal.tsum_comp_le_tsum_of_injective hg (fun v : Fin n β β β¦ β i, b (v i)) | |
| simpa only [g, tsum_vector_prod, Finset.prod_const, Finset.card_univ, Fintype.card_fin] using h | |
| abbrev BoundedTimes (T n : β) := {t : Fin n β β // StrictMono t β§ β i, t i β€ T} | |
| abbrev TimeSubset (T : β) := {s : Finset β // s β (Finset.range (T+1)).powerset} | |
| def encodeTimeSubset (T : β) (s : TimeSubset T) : Ξ£ n, BoundedTimes T n := | |
| β¨s.val.card, β¨s.val.orderEmbOfFin rfl, (s.val.orderEmbOfFin rfl).strictMono, | |
| fun i β¦ by | |
| have h := (Finset.mem_powerset.mp s.property) (s.val.orderEmbOfFin_mem rfl i) | |
| exact Nat.le_of_lt_succ (Finset.mem_range.mp h)β©β© | |
| def decodeTimes {T : β} (v : Ξ£ n, BoundedTimes T n) : Finset β := | |
| Finset.univ.image v.2.val | |
| lemma decode_encode (T : β) (s : TimeSubset T) : decodeTimes (encodeTimeSubset T s) = s.val := by | |
| exact s.val.image_orderEmbOfFin_univ rfl | |
| lemma encodeTimeSubset_injective (T : β) : Function.Injective (encodeTimeSubset T) := by | |
| intro s t h | |
| apply Subtype.ext | |
| simpa only [decode_encode] using congrArg decodeTimes h | |
| lemma prod_encode (T : β) (s : TimeSubset T) (f : β β ββ₯0β) : | |
| (β i, f ((encodeTimeSubset T s).2.val i)) = β u β s.val, f u := by | |
| change (β i, f (s.val.orderEmbOfFin rfl i)) = _ | |
| conv_rhs => rw [β s.val.map_orderEmbOfFin_univ rfl, Finset.prod_map] | |
| rfl | |
| lemma prod_one_add_le_ordered_series (T : β) (f : β β ββ₯0β) : | |
| (β u β Finset.range (T+1), (1+f u)) β€ | |
| β' n, β' t : BoundedTimes T n, β i, f (t.val i) := by | |
| rw [Finset.prod_one_add] | |
| calc | |
| _ = β' s : TimeSubset T, β u β s.val, f u := by | |
| rw [tsum_fintype] | |
| exact (Finset.sum_attach _ _).symm | |
| _ = β' s : TimeSubset T, β i, f ((encodeTimeSubset T s).2.val i) := by | |
| apply tsum_congr | |
| intro s | |
| exact (prod_encode T s f).symm | |
| _ β€ β' v : Ξ£ n, BoundedTimes T n, β i, f (v.2.val i) := | |
| ENNReal.tsum_comp_le_tsum_of_injective (encodeTimeSubset_injective T) | |
| (fun v : Ξ£ n, BoundedTimes T n β¦ β i, f (v.2.val i)) | |
| _ = _ := ENNReal.tsum_sigma' _ | |
| def gapKernel (k : β) : ββ₯0β := | |
| if k=0 then 1 else ENNReal.ofReal ((16/cvel^2) * (k:β)^(-(3:β)/2)) | |
| def radiusFactor (R : β) : ββ₯0β := ENNReal.ofReal ((1+R)^2) | |
| lemma radiusFactor_one_le (R : β) (hR : 0 β€ R) : 1 β€ radiusFactor R := by | |
| rw [β ENNReal.ofReal_one] | |
| apply ENNReal.ofReal_le_ofReal | |
| nlinarith | |
| lemma weighted_gap_radius (t k : β) (hk : 0 < k) | |
| (y : Fin 2 β β) (R : β) (hR : 0 β€ R) (H : Noise β ββ₯0β) | |
| (hH : Measurable H) (hinv : PastInvariant t H) : | |
| (β«β» Ο, H Ο * nearTest (t+k) y R Ο βlaw) β€ | |
| radiusFactor R * gapKernel k * β«β» Ο, H Ο βlaw := by | |
| refine (weighted_gap_concentration t k hk y R hR H hH hinv).trans ?_ | |
| apply mul_le_mul_left | |
| rw [gapKernel,ite_eq_right (ne_of_gt hk),radiusFactor, | |
| β ENNReal.ofReal_mul (sq_nonneg (1+R))] | |
| apply ENNReal.ofReal_le_ofReal | |
| have hp : 0 β€ (16/cvel^2) * (k:β)^(-(3:β)/2) := by positivity | |
| calc | |
| _ = R^2 * ((16/cvel^2) * (k:β)^(-(3:β)/2)) := by ring | |
| _ β€ _ := mul_le_mul_of_nonneg_right (by nlinarith) hp | |
| def encounterMass {n : β} (t : Fin n β β) (r : Fin n β β) | |
| (y : β β Fin 2 β β) : ββ₯0β := | |
| β«β» Ο, β i, nearTest (t i) (y (t i)) (r i) Ο βlaw | |
| lemma encounter_append_bound (u s : β) (hus : u < s) | |
| {n : β} (t : Fin n β β) (r : Fin n β β) (y : β β Fin 2 β β) | |
| (ht : β i, t i β€ u) (R : β) (hR : 0 β€ R) : | |
| encounterMass (Fin.snoc t s) (Fin.snoc r R) y β€ | |
| radiusFactor R * gapKernel (s-u) * encounterMass t r y := by | |
| have h := weighted_gap_radius u (s-u) (by omega) (y s) R hR | |
| (fun Ο β¦ β i, nearTest (t i) (y (t i)) (r i) Ο) (by fun_prop) (by | |
| intro j β b hb Ο x | |
| apply Finset.prod_congr rfl | |
| intro i _ | |
| exact nearTest_pastInvariant (t i) u (ht i) (y (t i)) (r i) j β b hb Ο x) | |
| rw [Nat.add_sub_of_le hus.le] at h | |
| simpa only [encounterMass,Fin.prod_univ_castSucc,Fin.snoc_castSucc,Fin.snoc_last] using h | |
| lemma encounter_singleton_bound (s : β) (R : β) (hR : 0 β€ R) (y : β β Fin 2 β β) : | |
| encounterMass (fun _ : Fin 1 β¦ s) (fun _ β¦ R) y β€ radiusFactor R * gapKernel s := by | |
| by_cases h0 : s=0 | |
| Β· subst s | |
| refine le_trans ?_ (by simpa [gapKernel] using radiusFactor_one_le R hR) | |
| calc | |
| _ β€ β«β» _ : Noise, 1 βlaw := by | |
| apply lintegral_mono | |
| intro Ο | |
| simpa only [Fin.prod_univ_one] using nearTest_le_one 0 (y 0) R Ο | |
| _ = 1 := by simp | |
| Β· have h := weighted_gap_radius 0 s (by omega) (y s) R hR | |
| (fun _ β¦ 1) measurable_const (by intro j β b hb Ο x; rfl) | |
| simpa [encounterMass,Fin.prod_univ_one] using h | |
| lemma encounterMass_le_gap_prod (n : β) (t : Fin n β β) (r : Fin n β β) | |
| (y : β β Fin 2 β β) (ht : StrictMono t) (hr : β i, 0 β€ r i) : | |
| encounterMass t r y β€ β i, radiusFactor (r i) * gapKernel (timeGaps t i) := by | |
| induction n with | |
| | zero => simp [encounterMass] | |
| | succ n ih => | |
| cases n with | |
| | zero => | |
| have h := encounter_singleton_bound (t 0) (r 0) (hr 0) y | |
| have he : (fun _ : Fin 1 β¦ t 0) = t := by | |
| funext i; exact congrArg t (Fin.ext (by omega)) | |
| have hl : (fun _ : Fin 1 β¦ r 0) = r := by | |
| funext i; exact congrArg r (Fin.ext (by omega)) | |
| rw [he, hl] at h | |
| rw [Fin.prod_univ_one, timeGaps_zero] | |
| exact h | |
| | succ n => | |
| have hin : StrictMono (Fin.init t) := ht.comp (Fin.strictMono_castSucc) | |
| have hb := ih (Fin.init t) (Fin.init r) hin (fun i β¦ hr i.castSucc) | |
| have hlt : t (Fin.last n).castSucc < t (Fin.last (n+1)) := ht (by simp) | |
| have ha := encounter_append_bound (t (Fin.last n).castSucc) (t (Fin.last (n+1))) | |
| hlt (Fin.init t) (Fin.init r) y | |
| (fun i β¦ ht.monotone (by exact_mod_cast Fin.le_last i)) | |
| (r (Fin.last (n+1))) (hr _) | |
| rw [Fin.snoc_init_self, Fin.snoc_init_self] at ha | |
| refine ha.trans ?_ | |
| rw [Fin.prod_univ_castSucc] | |
| calc | |
| _ β€ radiusFactor (r (Fin.last (n+1))) * | |
| gapKernel (t (Fin.last (n+1))-t (Fin.last n).castSucc) * | |
| β i, radiusFactor (Fin.init r i) * gapKernel (timeGaps (Fin.init t) i) := | |
| mul_le_mul' le_rfl hb | |
| _ = _ := by | |
| simp_rw [timeGaps_castSucc] | |
| change _ = _ * (radiusFactor (r (Fin.last (n+1))) * | |
| gapKernel (t (Fin.last (n+1))-t (Fin.last n).castSucc)) | |
| exact mul_comm _ _ | |
| lemma gapKernel_sum_ne_top : (β' k, gapKernel k) β β := by | |
| have hs : Summable (fun k : β β¦ (16/cvel^2) * (k:β)^(-(3:β)/2)) := | |
| (Real.summable_nat_rpow.mpr (by norm_num)).mul_left _ | |
| have he : (β' k : β, ENNReal.ofReal ((16/cvel^2) * (k:β)^(-(3:β)/2))) = | |
| ENNReal.ofReal (β' k : β, (16/cvel^2) * (k:β)^(-(3:β)/2)) := | |
| (ENNReal.ofReal_tsum_of_nonneg (fun _ β¦ by positivity) hs).symm | |
| have hb : (β' k, gapKernel k) β€ | |
| 1 + β' k : β, ENNReal.ofReal ((16/cvel^2) * (k:β)^(-(3:β)/2)) := by | |
| calc | |
| _ β€ (β' k : β, ((if k=0 then 1 else 0) + | |
| ENNReal.ofReal ((16/cvel^2) * (k:β)^(-(3:β)/2)))) := by | |
| apply ENNReal.tsum_le_tsum | |
| intro k | |
| by_cases h : k=0 <;> simp [gapKernel,h] | |
| _ = _ := by rw [ENNReal.tsum_add]; simp | |
| rw [he] at hb | |
| exact ne_top_of_le_ne_top (by finiteness) hb | |
| lemma gapKernel_sum_one_le : (1 : ββ₯0β) β€ β' k, gapKernel k := by | |
| simpa only [gapKernel,βreduceIte] using ENNReal.le_tsum (f := gapKernel) 0 | |
| def orderedEncounterConstant : β := (β' k, gapKernel k).toReal | |
| lemma orderedEncounterConstant_pos : 0 < orderedEncounterConstant := by | |
| exact ENNReal.toReal_pos (ne_of_gt (lt_of_lt_of_le (by norm_num) gapKernel_sum_one_le)) | |
| gapKernel_sum_ne_top | |
| lemma orderedEncounterConstant_cast : ENNReal.ofReal orderedEncounterConstant = β' k, gapKernel k := | |
| ENNReal.ofReal_toReal gapKernel_sum_ne_top | |
| lemma ordered_encounter_sum (T n : β) (r : Fin n β β) (hr : β i, 0 β€ r i) | |
| (y : β β Fin 2 β β) : | |
| (β' t : BoundedTimes T n, encounterMass t.val r y) β€ | |
| β i, ENNReal.ofReal orderedEncounterConstant * radiusFactor (r i) := by | |
| calc | |
| _ β€ β' t : BoundedTimes T n, β i, radiusFactor (r i) * gapKernel (timeGaps t.val i) := | |
| ENNReal.tsum_le_tsum fun t β¦ encounterMass_le_gap_prod n t.val r y t.property.1 hr | |
| _ = (β i, radiusFactor (r i)) * | |
| β' t : BoundedTimes T n, β i, gapKernel (timeGaps t.val i) := by | |
| simp_rw [Finset.prod_mul_distrib,ENNReal.tsum_mul_left] | |
| _ β€ (β i, radiusFactor (r i)) * (β' k, gapKernel k)^n := | |
| mul_le_mul' le_rfl (ordered_gap_sum_bound T n gapKernel) | |
| _ = _ := by | |
| rw [Finset.prod_mul_distrib,orderedEncounterConstant_cast] | |
| simp [mul_comm] | |
| def radiusEnvelope (a : β β ββ₯0β) (n : β) (y : Fin 2 β β) (Ο : Noise) : ββ₯0β := | |
| β' l : β, a l * nearTest n y (l:β) Ο | |
| @[fun_prop] lemma measurable_radiusEnvelope (a : β β ββ₯0β) (n : β) (y : Fin 2 β β) : | |
| Measurable (radiusEnvelope a n y) := by | |
| unfold radiusEnvelope | |
| exact Measurable.tsum (fun l β¦ (measurable_nearTest n y (l:β)).const_mul _) | |
| lemma radiusEnvelope_prod {n : β} (t : Fin n β β) (a : β β ββ₯0β) | |
| (y : β β Fin 2 β β) (Ο : Noise) : | |
| (β i, radiusEnvelope a (t i) (y (t i)) Ο) = | |
| β' l : Fin n β β, (β i, a (l i)) * β i, nearTest (t i) (y (t i)) (l i : β) Ο := by | |
| unfold radiusEnvelope | |
| rw [β tsum_vector_prod] | |
| apply tsum_congr | |
| intro l | |
| exact Finset.prod_mul_distrib | |
| def weightedEncounterMass {n : β} (t : Fin n β β) (a : β β ββ₯0β) | |
| (y : β β Fin 2 β β) : ββ₯0β := | |
| β«β» Ο, β i, radiusEnvelope a (t i) (y (t i)) Ο βlaw | |
| lemma weightedEncounterMass_eq {n : β} (t : Fin n β β) (a : β β ββ₯0β) | |
| (y : β β Fin 2 β β) : | |
| weightedEncounterMass t a y = | |
| β' l : Fin n β β, (β i, a (l i)) * encounterMass t (fun i β¦ (l i : β)) y := by | |
| unfold weightedEncounterMass | |
| simp_rw [radiusEnvelope_prod] | |
| rw [lintegral_tsum (fun l β¦ by fun_prop)] | |
| apply tsum_congr | |
| intro l | |
| exact lintegral_const_mul _ (by fun_prop) | |
| def radiusActivity (a : β β ββ₯0β) : ββ₯0β := | |
| ENNReal.ofReal orderedEncounterConstant * β' l : β, a l * radiusFactor (l:β) | |
| lemma weighted_ordered_sum_bound (T n : β) (a : β β ββ₯0β) | |
| (y : β β Fin 2 β β) : | |
| (β' t : BoundedTimes T n, weightedEncounterMass t.val a y) β€ (radiusActivity a)^n := by | |
| simp_rw [weightedEncounterMass_eq] | |
| rw [ENNReal.tsum_comm] | |
| calc | |
| _ = β' l : Fin n β β, (β i, a (l i)) * | |
| β' t : BoundedTimes T n, encounterMass t.val (fun i β¦ (l i : β)) y := by | |
| apply tsum_congr | |
| intro l | |
| rw [ENNReal.tsum_mul_left] | |
| _ β€ β' l : Fin n β β, (β i, a (l i)) * | |
| β i, ENNReal.ofReal orderedEncounterConstant * radiusFactor (l i : β) := | |
| ENNReal.tsum_le_tsum fun l β¦ mul_le_mul' le_rfl | |
| (ordered_encounter_sum T n (fun i β¦ (l i : β)) (fun i β¦ Nat.cast_nonneg _) y) | |
| _ = β' l : Fin n β β, β i, | |
| ENNReal.ofReal orderedEncounterConstant * (a (l i) * radiusFactor (l i : β)) := by | |
| apply tsum_congr | |
| intro l | |
| rw [β Finset.prod_mul_distrib] | |
| apply Finset.prod_congr rfl | |
| intro i _ | |
| ring | |
| _ = _ := by | |
| rw [tsum_vector_prod (fun (_ : Fin n) k β¦ | |
| ENNReal.ofReal orderedEncounterConstant * (a k * radiusFactor (k:β)))] | |
| simp only [ENNReal.tsum_mul_left,radiusActivity,Finset.prod_const, | |
| Finset.card_univ,Fintype.card_fin] | |
| lemma ordered_product_bound_envelope (T : β) (a : β β ββ₯0β) | |
| (y : β β Fin 2 β β) : | |
| (β«β» Ο, β u β Finset.range (T+1), (1+radiusEnvelope a u (y u) Ο) βlaw) β€ | |
| (1-radiusActivity a)β»ΒΉ := by | |
| calc | |
| _ β€ β«β» Ο, β' n, β' t : BoundedTimes T n, | |
| β i, radiusEnvelope a (t.val i) (y (t.val i)) Ο βlaw := | |
| lintegral_mono fun Ο β¦ prod_one_add_le_ordered_series T | |
| (fun u β¦ radiusEnvelope a u (y u) Ο) | |
| _ = β' n, β' t : BoundedTimes T n, weightedEncounterMass t.val a y := by | |
| rw [lintegral_tsum (fun n β¦ (Measurable.tsum (fun t β¦ by fun_prop)).aemeasurable)] | |
| apply tsum_congr | |
| intro n | |
| rw [lintegral_tsum (fun t β¦ by fun_prop)] | |
| rfl | |
| _ β€ β' n, (radiusActivity a)^n := | |
| ENNReal.tsum_le_tsum (fun n β¦ weighted_ordered_sum_bound T n a y) | |
| _ = _ := ENNReal.tsum_geometric _ | |
| lemma ordered_product_bound (T : β) (a : β β ββ₯0β) (y : β β Fin 2 β β) | |
| (f : β β Noise β ββ₯0β) (hf : β n Ο, f n Ο β€ radiusEnvelope a n (y n) Ο) : | |
| (β«β» Ο, β u β Finset.range (T+1), (1+f u Ο) βlaw) β€ (1-radiusActivity a)β»ΒΉ := by | |
| refine le_trans (lintegral_mono (fun Ο β¦ ?_)) (ordered_product_bound_envelope T a y) | |
| exact Finset.prod_le_prod (fun u _ β¦ add_le_add_right (hf u Ο) 1) | |
| lemma exp_sub_one_le_slope {x B : β} (hx : 0 β€ x) (hB : x β€ B) : | |
| Real.exp x - 1 β€ Real.exp B * x := by | |
| have h := mul_le_mul_of_nonneg_left (Real.add_one_le_exp (-x)) (Real.exp_pos x).le | |
| rw [β Real.exp_add, add_neg_cancel, Real.exp_zero] at h | |
| have he : Real.exp x β€ Real.exp B := Real.exp_le_exp.mpr hB | |
| nlinarith [mul_le_mul_of_nonneg_right he hx] | |
| lemma radiusEnvelope_smul (c : ββ₯0β) (a : β β ββ₯0β) (n : β) | |
| (y : Fin 2 β β) (Ο : Noise) : | |
| radiusEnvelope (fun l β¦ c*a l) n y Ο = c*radiusEnvelope a n y Ο := by | |
| unfold radiusEnvelope | |
| rw [β ENNReal.tsum_mul_left] | |
| apply tsum_congr | |
| intro l | |
| ring | |
| lemma radiusActivity_smul (c : ββ₯0β) (a : β β ββ₯0β) : | |
| radiusActivity (fun l β¦ c*a l) = c*radiusActivity a := by | |
| unfold radiusActivity | |
| simp only [mul_assoc] | |
| rw [ENNReal.tsum_mul_left] | |
| ac_rfl | |
| lemma ofReal_exp_finset_sum {ΞΉ : Type*} (s : Finset ΞΉ) (f : ΞΉ β β) : | |
| ENNReal.ofReal (Real.exp (β i β s, f i)) = β i β s, ENNReal.ofReal (Real.exp (f i)) := by | |
| rw [Real.exp_sum, ENNReal.ofReal_prod_of_nonneg] | |
| intro i _ | |
| exact (Real.exp_pos _).le | |
| lemma radius_exponential_bound (T : β) (a : β β ββ₯0β) (y : β β Fin 2 β β) | |
| (U : β β Noise β β) (hU0 : β n Ο, 0 β€ U n Ο) (hU1 : β n Ο, U n Ο β€ 1) | |
| (hUa : β n Ο, ENNReal.ofReal (U n Ο) β€ radiusEnvelope a n (y n) Ο) | |
| (ha : ENNReal.ofReal (2*Real.exp 2) * radiusActivity a β€ (1/2:ββ₯0β)) : | |
| (β«β» Ο, ENNReal.ofReal (Real.exp (2 * β u β Finset.range (T+1), U u Ο)) βlaw) β€ 2 := by | |
| let c := ENNReal.ofReal (2*Real.exp 2) | |
| let b := fun l β¦ c*a l | |
| let f := fun n Ο β¦ ENNReal.ofReal (Real.exp (2*U n Ο)-1) | |
| have hba : radiusActivity b β€ (1/2:ββ₯0β) := by | |
| simpa only [b,radiusActivity_smul,c] using ha | |
| have hbf : β n Ο, f n Ο β€ radiusEnvelope b n (y n) Ο := by | |
| intro n Ο | |
| calc | |
| f n Ο β€ ENNReal.ofReal (2*Real.exp 2 * U n Ο) := by | |
| apply ENNReal.ofReal_le_ofReal | |
| simpa only [mul_assoc,mul_left_comm,mul_comm] using | |
| exp_sub_one_le_slope (by linarith [hU0 n Ο] : 0 β€ 2*U n Ο) | |
| (by linarith [hU1 n Ο] : 2*U n Ο β€ 2) | |
| _ = c * ENNReal.ofReal (U n Ο) := by rw [ENNReal.ofReal_mul (by positivity)] | |
| _ β€ c * radiusEnvelope a n (y n) Ο := mul_le_mul' le_rfl (hUa n Ο) | |
| _ = radiusEnvelope b n (y n) Ο := (radiusEnvelope_smul c a n (y n) Ο).symm | |
| have he (n : β) (Ο : Noise) : 1+f n Ο = ENNReal.ofReal (Real.exp (2*U n Ο)) := by | |
| have hx : 0 β€ Real.exp (2*U n Ο)-1 := by | |
| have := Real.one_le_exp_iff.mpr (by linarith [hU0 n Ο] : 0 β€ 2*U n Ο) | |
| linarith | |
| change 1+ENNReal.ofReal (Real.exp (2*U n Ο)-1) = _ | |
| rw [β ENNReal.ofReal_one,β ENNReal.ofReal_add (by norm_num) hx] | |
| congr 1 | |
| ring | |
| have h := ordered_product_bound T b y f hbf | |
| have hh : (β«β» Ο, ENNReal.ofReal | |
| (Real.exp (2 * β u β Finset.range (T+1), U u Ο)) βlaw) = | |
| β«β» Ο, β u β Finset.range (T+1), (1+f u Ο) βlaw := by | |
| apply lintegral_congr | |
| intro Ο | |
| rw [Finset.mul_sum,ofReal_exp_finset_sum] | |
| exact Finset.prod_congr rfl (fun u _ β¦ (he _ _).symm) | |
| rw [hh] | |
| refine h.trans ?_ | |
| have hd : (1/2:ββ₯0β) β€ 1-radiusActivity b := by | |
| simpa using tsub_le_tsub_left hba (1:ββ₯0β) | |
| exact (ENNReal.inv_le_inv.mpr hd).trans_eq (by norm_num) | |
| end HardSphere.DyadicSkeleton | |
| end | |
| end | |
| end OAI | |