Buckets:
| import Mathlib | |
| import OAI.Probability.GaussianInformation.Dyadic.BallVolume | |
| namespace OAI | |
| open MeasureTheory ProbabilityTheory Set | |
| open scoped BigOperators ENNReal | |
| open MeasureTheory Metric Set | |
| open scoped ENNReal NNReal | |
| namespace RepeatedLocalization | |
| section Cover | |
| variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] | |
| lemma card_separated_le (s : Finset E) {R δ : ℝ} (hR : 0 ≤ R) (hδ : 0 < δ) | |
| (hs : ∀ c ∈ s, ‖c‖ ≤ R) | |
| (hsep : ∀ c ∈ s, ∀ d ∈ s, c ≠ d → δ ≤ ‖c - d‖) : | |
| (s.card : ℝ) ≤ ((2 * R + δ) / δ) ^ Module.finrank ℝ E := by | |
| borelize E | |
| let μ : Measure E := Measure.addHaar | |
| have hsmall : 0 < δ / 2 := by positivity | |
| have hlarge : 0 < R + δ / 2 := by positivity | |
| let A := ⋃ c ∈ s, ball c (δ / 2) | |
| have hdisj : (s : Set E).PairwiseDisjoint (fun c => ball c (δ / 2)) := by | |
| intro c hc d hd hcd | |
| apply ball_disjoint_ball | |
| rw [dist_eq_norm] | |
| convert hsep c hc d hd hcd using 1 | |
| ring | |
| have hsub : A ⊆ ball (0 : E) (R + δ / 2) := by | |
| refine iUnion₂_subset fun x hx => ball_subset_ball' ?_ | |
| rw [dist_zero_right] | |
| linarith [hs x hx] | |
| have hb : (s.card : ℝ≥0∞) * ENNReal.ofReal ((δ / 2)^Module.finrank ℝ E) * | |
| μ (ball 0 1) ≤ ENNReal.ofReal ((R + δ / 2)^Module.finrank ℝ E) * μ (ball 0 1) := by | |
| calc | |
| _ = μ A := by | |
| rw [measure_biUnion_finset hdisj (fun _ _ => measurableSet_ball)] | |
| simp only [μ.addHaar_ball_of_pos _ hsmall, Finset.sum_const, nsmul_eq_mul, mul_assoc] | |
| _ ≤ μ (ball 0 (R + δ / 2)) := measure_mono hsub | |
| _ = _ := μ.addHaar_ball_of_pos _ hlarge | |
| have hb' := (ENNReal.mul_le_mul_iff_left (measure_ball_pos μ (0 : E) zero_lt_one).ne' | |
| measure_ball_lt_top.ne).mp hb | |
| have hbR : (s.card : ℝ) * (δ / 2)^Module.finrank ℝ E ≤ | |
| (R + δ / 2)^Module.finrank ℝ E := by | |
| simpa [ENNReal.toReal_ofReal (pow_nonneg hsmall.le _)] using | |
| ENNReal.toReal_le_of_le_ofReal (pow_nonneg hlarge.le _) hb' | |
| calc | |
| (s.card : ℝ) ≤ (R + δ / 2)^Module.finrank ℝ E / (δ / 2)^Module.finrank ℝ E := | |
| (le_div_iff₀ (pow_pos hsmall _)).mpr hbR | |
| _ = ((2 * R + δ) / δ)^Module.finrank ℝ E := by | |
| rw [← div_pow] | |
| congr 1 | |
| field_simp | |
| lemma exists_ball_cover_card_le {R δ : ℝ} (hR : 0 ≤ R) (hδ : 0 < δ) : | |
| ∃ s : Finset E, (∀ c ∈ s, ‖c‖ ≤ R) ∧ | |
| (∀ x : E, ‖x‖ ≤ R → ∃ c ∈ s, dist x c ≤ δ) ∧ | |
| (s.card : ℝ) ≤ ((2 * R + δ) / δ)^Module.finrank ℝ E := by | |
| classical | |
| let ε : ℝ≥0 := ⟨δ, hδ.le⟩ | |
| let A := closedBall (0 : E) R | |
| have hεpos : 0 < ε := hδ | |
| have hε : ε ≠ 0 := ne_of_gt hεpos | |
| obtain ⟨N, _, hNfin, hNcov⟩ := Metric.exists_finite_isCover_of_isCompact | |
| (s := A) (ε := ε / 2) (by positivity) (isCompact_closedBall _ _) | |
| have hp : Metric.packingNumber ε A < ⊤ := by | |
| calc | |
| _ = Metric.packingNumber (2 * (ε / 2)) A := by congr 1; ring | |
| _ ≤ Metric.externalCoveringNumber (ε / 2) A := | |
| Metric.packingNumber_two_mul_le_externalCoveringNumber _ _ | |
| _ ≤ N.encard := hNcov.externalCoveringNumber_le_encard | |
| _ < ⊤ := hNfin.encard_lt_top | |
| let S := Metric.maximalSeparatedSet ε A | |
| have hSfin : S.Finite := Set.encard_lt_top_iff.mp (by | |
| change (Metric.maximalSeparatedSet ε A).encard < ⊤ | |
| rw [Metric.encard_maximalSeparatedSet hp.ne] | |
| exact hp) | |
| have hSsub : ∀ c ∈ hSfin.toFinset, ‖c‖ ≤ R := by | |
| intro c hc | |
| have : c ∈ S := by simpa using hc | |
| simpa [A] using (Metric.maximalSeparatedSet_subset this) | |
| refine ⟨hSfin.toFinset, hSsub, ?_, card_separated_le _ hR hδ hSsub ?_⟩ | |
| · intro x hx | |
| have hcov := Metric.isCover_iff_subset_iUnion_closedBall.mp | |
| (Metric.isCover_maximalSeparatedSet hp.ne) | |
| have hm : x ∈ A := by simpa [A] using hx | |
| obtain ⟨c, hc, hxc⟩ := mem_iUnion₂.mp (hcov hm) | |
| exact ⟨c, by simpa using hc, hxc⟩ | |
| · intro c hc d hd hcd | |
| have hs := Metric.isSeparated_maximalSeparatedSet (ε := ε) (A := A) | |
| (by simpa using hc) (by simpa using hd) hcd | |
| have ht := ENNReal.toReal_mono (edist_ne_top c d) hs.le | |
| change δ ≤ (edist c d).toReal at ht | |
| simpa [ε, edist_dist, dist_eq_norm] using ht | |
| end Cover | |
| end RepeatedLocalization | |
| end OAI | |
Xet Storage Details
- Size:
- 4.3 kB
- Xet hash:
- 2baafc5806456b05b627ee561cba7f8702b717db7c8c251d10e6e3b9a57806f6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.