File size: 6,466 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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