Download data/lean/OAI/Probability/GaussianRegression/Nets.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.47 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/GaussianRegression/Nets.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/GaussianRegression/Nets.lean
-
curl -L -o Nets.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/GaussianRegression/Nets.lean
6.47 kB
| import OAI.Probability.GaussianRegression.Model | |
| namespace OAI | |
| /-! | |
| Local mass bounds and quantitative finite Euclidean nets. | |
| -/ | |
| open MeasureTheory ProbabilityTheory Set Filter | |
| open scoped ENNReal NNReal RealInnerProductSpace Topology | |
| noncomputable section | |
| universe u | |
| namespace NoiselessRegression | |
| section FrostmanGeometry | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| def HasLocalMassBound (Ξ½ : Measure E) (a : β) : Prop := | |
| β t β Ξ½.support, β r : β, 0 < r β | |
| Ξ½ (Metric.closedBall t r) β€ ENNReal.ofReal (r ^ a) | |
| omit [BorelSpace E] in | |
| theorem HasLocalMassBound.any_center {Ξ½ : Measure E} {a : β} | |
| (hΞ½ : HasLocalMassBound Ξ½ a) (z : E) {r : β} (hr : 0 < r) : | |
| Ξ½ (Metric.closedBall z r) β€ ENNReal.ofReal ((2 * r) ^ a) := by | |
| by_cases hmass : Ξ½ (Metric.closedBall z r) = 0 | |
| Β· simp [hmass] | |
| obtain β¨t, htball, htsuppβ© := Ξ½.nonempty_inter_support_of_pos (pos_iff_ne_zero.mpr hmass) | |
| refine (measure_mono ?_).trans (hΞ½ t htsupp (2 * r) (by positivity)) | |
| intro x hx | |
| apply Metric.mem_closedBall.mpr | |
| calc | |
| dist x t β€ dist x z + dist z t := dist_triangle _ _ _ | |
| _ β€ r + r := add_le_add (Metric.mem_closedBall.mp hx) | |
| (by simpa [dist_comm] using Metric.mem_closedBall.mp htball) | |
| _ = 2 * r := by ring | |
| theorem card_le_volume_ratio (s : Finset E) {r R : β} (hr : 0 < r) (hR : 0 β€ R) | |
| (hs : β x β s, βxβ β€ R) | |
| (hsep : β x β s, β y β s, x β y β r β€ dist x y) : | |
| (s.card : β) β€ ((R + r / 2) / (r / 2)) ^ Module.finrank β E := by | |
| classical | |
| let Ξ½ : Measure E := Measure.addHaar | |
| let Ξ΄ : β := r / 2 | |
| let Ο : β := R + r / 2 | |
| have hΞ΄ : 0 < Ξ΄ := by dsimp [Ξ΄]; positivity | |
| have hΟ : 0 < Ο := by dsimp [Ο]; positivity | |
| let A : Set E := β c β s, Metric.ball c Ξ΄ | |
| have hd : Set.Pairwise (s : Set E) (fun c d => Disjoint (Metric.ball c Ξ΄) (Metric.ball d Ξ΄)) := by | |
| intro c hc d hd hcd | |
| apply Metric.ball_disjoint_ball | |
| simpa [Ξ΄] using hsep c hc d hd hcd | |
| have hsub : A β Metric.ball (0 : E) Ο := by | |
| refine iUnionβ_subset fun x hx => ?_ | |
| apply Metric.ball_subset_ball' | |
| dsimp [Ξ΄, Ο] | |
| rw [dist_zero_right] | |
| linarith [hs x hx] | |
| have I : | |
| (s.card : ββ₯0β) * ENNReal.ofReal (Ξ΄ ^ Module.finrank β E) * Ξ½ (Metric.ball 0 1) β€ | |
| ENNReal.ofReal (Ο ^ Module.finrank β E) * Ξ½ (Metric.ball 0 1) := by | |
| calc | |
| (s.card : ββ₯0β) * ENNReal.ofReal (Ξ΄ ^ Module.finrank β E) * Ξ½ (Metric.ball 0 1) = Ξ½ A := by | |
| dsimp only [A] | |
| rw [measure_biUnion_finset hd (fun _ _ => Metric.isOpen_ball.measurableSet)] | |
| simp only [Ξ½.addHaar_ball_of_pos _ hΞ΄, Finset.sum_const, nsmul_eq_mul, mul_assoc] | |
| _ β€ Ξ½ (Metric.ball (0 : E) Ο) := measure_mono hsub | |
| _ = _ := Ξ½.addHaar_ball_of_pos 0 hΟ | |
| have J : (s.card : ββ₯0β) * ENNReal.ofReal (Ξ΄ ^ Module.finrank β E) β€ | |
| ENNReal.ofReal (Ο ^ Module.finrank β E) := | |
| (ENNReal.mul_le_mul_iff_left (Metric.measure_ball_pos Ξ½ 0 zero_lt_one).ne' | |
| measure_ball_lt_top.ne).mp I | |
| have K : (s.card : β) * Ξ΄ ^ Module.finrank β E β€ Ο ^ Module.finrank β E := by | |
| simpa only [ENNReal.toReal_mul, ENNReal.toReal_natCast, | |
| ENNReal.toReal_ofReal (pow_nonneg hΞ΄.le _)] using | |
| ENNReal.toReal_le_of_le_ofReal (pow_nonneg hΟ.le _) J | |
| rw [div_pow] | |
| exact (le_div_iffβ (pow_pos hΞ΄ _)).mpr K | |
| end FrostmanGeometry | |
| section FiniteNets | |
| variable {E : Type*} [PseudoMetricSpace E] | |
| theorem exists_net_of_finite_packing_bound (A : Set E) {r : β} (hr : 0 β€ r) (N : β) | |
| (hcard : β s : Finset E, (β x β s, x β A) β | |
| (β x β s, β y β s, x β y β r < dist x y) β s.card β€ N) : | |
| β s : Finset E, (β x β s, x β A) β§ | |
| (β x β s, β y β s, x β y β r < dist x y) β§ | |
| β x β A, β y β s, dist x y β€ r := by | |
| classical | |
| let S : Set β := {n | β s : Finset E, (β x β s, x β A) β§ | |
| (β x β s, β y β s, x β y β r < dist x y) β§ s.card = n} | |
| have hS : S.Finite := (Set.finite_Iic N).subset (by | |
| rintro n β¨s, hs, hsep, rflβ© | |
| exact hcard s hs hsep) | |
| have hS0 : S.Nonempty := β¨0, β , by simpβ© | |
| obtain β¨n, hn, hmaxβ© := Set.exists_max_image S id hS hS0 | |
| obtain β¨s, hs, hsep, rflβ© := hn | |
| refine β¨s, hs, hsep, ?_β© | |
| intro x hx | |
| by_contra! hnot | |
| have hxs : x β s := by | |
| intro h | |
| have := hnot x h | |
| simpa using lt_of_le_of_lt hr this | |
| have hins : β y β insert x s, y β A := by | |
| intro y hy | |
| rcases Finset.mem_insert.mp hy with rfl | hy | |
| Β· exact hx | |
| Β· exact hs y hy | |
| have hsep' : β y β insert x s, β z β insert x s, y β z β r < dist y z := by | |
| intro y hy z hz hne | |
| rcases Finset.mem_insert.mp hy with hxy | hys | |
| Β· subst y | |
| rcases Finset.mem_insert.mp hz with hxz | hzs | |
| Β· exact (hne hxz.symm).elim | |
| Β· exact hnot z hzs | |
| Β· rcases Finset.mem_insert.mp hz with hxz | hzs | |
| Β· subst z | |
| simpa [dist_comm] using hnot y hys | |
| Β· exact hsep y hys z hzs hne | |
| have hinS : (insert x s).card β S := β¨insert x s, hins, hsep', rflβ© | |
| have hh := hmax _ hinS | |
| simp only [id_eq, Finset.card_insert_of_notMem hxs] at hh | |
| omega | |
| end FiniteNets | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| [FiniteDimensional β E] [MeasurableSpace E] [BorelSpace E] | |
| theorem exists_unit_ball_net {r : β} (hr : 0 < r) (hr1 : r β€ 1) : | |
| β s : Finset E, (β x β s, βxβ β€ 1) β§ | |
| (s.card : β) β€ (3 / r) ^ Module.finrank β E β§ | |
| β x : E, βxβ β€ 1 β β y β s, dist x y β€ r := by | |
| classical | |
| have hbound : β s : Finset E, (β x β s, βxβ β€ 1) β | |
| (β x β s, β y β s, x β y β r < dist x y) β | |
| (s.card : β) β€ (3 / r) ^ Module.finrank β E := by | |
| intro s hs hsep | |
| refine (card_le_volume_ratio s hr zero_le_one hs | |
| (fun x hx y hy hne => (hsep x hx y hy hne).le)).trans ?_ | |
| apply pow_le_pow_leftβ (by positivity) | |
| apply (div_le_div_iffβ (by positivity : 0 < r / 2) hr).mpr | |
| nlinarith | |
| obtain β¨s, hs, hsep, hnetβ© := exists_net_of_finite_packing_bound | |
| {x : E | βxβ β€ 1} hr.le β(3 / r) ^ Module.finrank β Eββ | |
| (by | |
| intro s hs hsep | |
| exact_mod_cast (hbound s hs hsep).trans (Nat.le_ceil _)) | |
| exact β¨s, hs, hbound s hs hsep, hnetβ© | |
| end NoiselessRegression | |
| end | |
| end OAI | |