roseking's picture
Add lean source and binary files (part 122)
b317718 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