math / data /lean /OAI /Probability /GaussianRegression /AffineTubes.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
6.95 kB
import OAI.Probability.GaussianRegression.Nets
import OAI.Probability.GaussianRegression.InverseMoments
namespace OAI
/-!
Affine tube covers and inverse-distance bounds.
-/
open MeasureTheory ProbabilityTheory Set Filter
open scoped ENNReal NNReal RealInnerProductSpace Topology
noncomputable section
universe u
namespace NoiselessRegression
section AffineTubes
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
[FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]
open EuclideanGeometry
theorem exists_affine_tube_cover (L : AffineSubspace ℝ E) [Nonempty L]
{r : ℝ} (hr : 0 < r) (hr1 : r ≀ 1) :
βˆƒ s : Finset L.direction,
(s.card : ℝ) ≀ (3 / r) ^ Module.finrank ℝ L.direction ∧
βˆ€ t : E, β€–tβ€– ≀ 1 β†’ Metric.infDist t L ≀ r β†’
βˆƒ y ∈ s, dist t ((y : E) + (orthogonalProjection L 0 : E)) ≀ 2 * r := by
classical
obtain ⟨s, _, hcard, hnet⟩ := exists_unit_ball_net (E := L.direction) hr hr1
refine ⟨s, hcard, ?_⟩
intro t ht hdist
obtain ⟨y, hy, hty⟩ := hnet (L.direction.orthogonalProjectionOnto t)
((L.direction.norm_orthogonalProjectionOnto_apply_le t).trans ht)
refine ⟨y, hy, ?_⟩
have hproj : (orthogonalProjection L t : E) =
(L.direction.orthogonalProjectionOnto t : E) + (orthogonalProjection L 0 : E) := by
have h := (orthogonalProjection L).map_vadd (0 : E) t
simpa only [vadd_eq_add, add_zero, orthogonalProjection_contLinear,
AffineSubspace.coe_vadd] using congrArg (fun x : L => (x : E)) h
have hpdist : dist (orthogonalProjection L t : E)
((y : E) + (orthogonalProjection L 0 : E)) ≀ r := by
rw [hproj, dist_add_right]
exact hty
have hd : dist t (orthogonalProjection L t : E) ≀ r := by
rwa [dist_orthogonalProjection_eq_infDist]
calc
dist t ((y : E) + (orthogonalProjection L 0 : E)) ≀
dist t (orthogonalProjection L t : E) +
dist (orthogonalProjection L t : E) ((y : E) + (orthogonalProjection L 0 : E)) :=
dist_triangle _ _ _
_ ≀ r + r := add_le_add hd hpdist
_ = 2 * r := by ring
theorem HasLocalMassBound.affine_tube {Ξ½ : Measure E} {a : ℝ}
(hΞ½ : HasLocalMassBound Ξ½ a) (hsupport : Ξ½.support βŠ† Metric.closedBall 0 1)
(L : AffineSubspace ℝ E) [Nonempty L] {r : ℝ} (hr : 0 < r) (hr1 : r ≀ 1) :
Ξ½ {t | Metric.infDist t L ≀ r} ≀
ENNReal.ofReal ((3 / r) ^ Module.finrank ℝ L.direction * (4 * r) ^ a) := by
classical
obtain ⟨s, hcard, hcover⟩ := exists_affine_tube_cover L hr hr1
let c : L.direction β†’ E := fun y => (y : E) + (orthogonalProjection L 0 : E)
have hsub : {t | Metric.infDist t L ≀ r} ≀ᡐ[Ξ½]
⋃ y ∈ s, Metric.closedBall (c y) (2 * r) := by
filter_upwards [Ξ½.support_mem_ae] with t ht
intro hdist
have htunit : β€–tβ€– ≀ 1 := by simpa using hsupport ht
obtain ⟨y, hy, hty⟩ := hcover t htunit hdist
exact mem_iUnionβ‚‚.mpr ⟨y, hy, hty⟩
calc
Ξ½ {t | Metric.infDist t L ≀ r} ≀ Ξ½ (⋃ y ∈ s, Metric.closedBall (c y) (2 * r)) :=
measure_mono_ae hsub
_ ≀ βˆ‘ y ∈ s, Ξ½ (Metric.closedBall (c y) (2 * r)) := measure_biUnion_finset_le _ _
_ ≀ βˆ‘ _y ∈ s, ENNReal.ofReal ((4 * r) ^ a) := by
refine Finset.sum_le_sum fun y _ => ?_
simpa only [show (2 : ℝ) * (2 * r) = 4 * r by ring] using
hΞ½.any_center (c y) (r := 2 * r) (by positivity)
_ = (s.card : ℝβ‰₯0∞) * ENNReal.ofReal ((4 * r) ^ a) := by simp
_ ≀ ENNReal.ofReal ((3 / r) ^ Module.finrank ℝ L.direction) *
ENNReal.ofReal ((4 * r) ^ a) := by
gcongr
exact_mod_cast ENNReal.ofReal_le_ofReal hcard
_ = _ := (ENNReal.ofReal_mul (by positivity)).symm
lemma tube_radius_factors (β„“ : β„•) (a : ℝ) {r : ℝ} (hr : 0 < r) :
(3 / r) ^ β„“ * (4 * r) ^ a =
(3 : ℝ) ^ β„“ * (4 : ℝ) ^ a * r ^ (a - β„“) := by
rw [div_pow, Real.mul_rpow (by norm_num) hr.le,
Real.rpow_sub_natCast hr.ne']
ring
theorem HasLocalMassBound.affine_tube_pow {Ξ½ : Measure E} {a : ℝ}
(hΞ½ : HasLocalMassBound Ξ½ a) (hsupport : Ξ½.support βŠ† Metric.closedBall 0 1)
(L : AffineSubspace ℝ E) [Nonempty L] (k : β„•)
(hmargin : (Module.finrank ℝ L.direction : ℝ) + k ≀ a)
{r : ℝ} (hr : 0 < r) (hr1 : r ≀ 1) :
Ξ½ {t | Metric.infDist t L ≀ r} ≀
ENNReal.ofReal ((3 : ℝ) ^ Module.finrank ℝ L.direction * (4 : ℝ) ^ a) *
ENNReal.ofReal (r ^ k) := by
refine (hΞ½.affine_tube hsupport L hr hr1).trans ?_
rw [tube_radius_factors _ _ hr, ← ENNReal.ofReal_mul (by positivity)]
apply ENNReal.ofReal_le_ofReal
apply mul_le_mul_of_nonneg_left _ (by positivity)
rw [← Real.rpow_natCast]
exact Real.rpow_le_rpow_of_exponent_ge hr hr1 (by linarith)
theorem HasLocalMassBound.affine_inverse_moment {Ξ½ : Measure E} {a : ℝ}
(hΞ½ : HasLocalMassBound Ξ½ a) (hsupport : Ξ½.support βŠ† Metric.closedBall 0 1)
(L : AffineSubspace ℝ E) [Nonempty L] (m : β„•)
(hmargin : (Module.finrank ℝ L.direction : ℝ) + (m + 1 : β„•) ≀ a) :
∫⁻ t, ENNReal.ofReal ((Metric.infDist t L)⁻¹ ^ m) βˆ‚Ξ½ ≀
Ξ½ Set.univ +
ENNReal.ofReal ((3 : ℝ) ^ Module.finrank ℝ L.direction * (4 : ℝ) ^ a) *
(2 : ℝβ‰₯0∞) ^ (m + 1) := by
apply inverse_moment_of_tube_bound Ξ½ _ m (Metric.continuous_infDist_pt _).measurable
(fun _ => Metric.infDist_nonneg)
intro r hr hr1
exact hΞ½.affine_tube_pow hsupport L (m + 1) hmargin hr hr1
theorem HasLocalMassBound.affine_null {Ξ½ : Measure E} {a : ℝ}
(hΞ½ : HasLocalMassBound Ξ½ a) (hsupport : Ξ½.support βŠ† Metric.closedBall 0 1)
(L : AffineSubspace ℝ E) [Nonempty L]
(hmargin : (Module.finrank ℝ L.direction : ℝ) + 1 ≀ a) : Ξ½ L = 0 := by
let C : ℝ := (3 : ℝ) ^ Module.finrank ℝ L.direction * (4 : ℝ) ^ a
have hC : 0 ≀ C := by dsimp [C]; positivity
have hb (n : β„•) : Ξ½ L ≀ ENNReal.ofReal (C * (1 / 2 : ℝ) ^ n) := by
have hn : 0 < (1 / 2 : ℝ) ^ n := by positivity
have hn1 : (1 / 2 : ℝ) ^ n ≀ 1 := pow_le_oneβ‚€ (by norm_num) (by norm_num)
calc
Ξ½ L ≀ Ξ½ {t | Metric.infDist t L ≀ (1 / 2 : ℝ) ^ n} := by
apply measure_mono
intro t ht
simp only [mem_ofPred_eq, Metric.infDist_zero_of_mem ht]
exact hn.le
_ ≀ ENNReal.ofReal C * ENNReal.ofReal (((1 / 2 : ℝ) ^ n) ^ 1) :=
hΞ½.affine_tube_pow hsupport L 1 (by simpa using hmargin) hn hn1
_ = _ := by rw [pow_one, ENNReal.ofReal_mul hC]
have hlim : Tendsto (fun n : β„• => ENNReal.ofReal (C * (1 / 2 : ℝ) ^ n))
atTop (𝓝 0) := by
convert ENNReal.tendsto_ofReal ((tendsto_const_nhds (x := C)).mul
(tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0 : ℝ) ≀ 1 / 2)
(by norm_num : (1 / 2 : ℝ) < 1))) using 1
simp
exact le_antisymm (ge_of_tendsto' hlim hb) (by positivity)
end AffineTubes
end NoiselessRegression
end
end OAI