Module docstring
{"# Extra lemmas about pseudo-metric spaces "}
{"# Extra lemmas about pseudo-metric spaces "}
instOrderTopologyReal
instance
: OrderTopology ℝ
instance : OrderTopology ℝ :=
orderTopology_of_nhds_abs fun x => by
simp only [nhds_basis_ball.eq_biInf, ball, Real.dist_eq, abs_sub_comm]
Real.singleton_eq_inter_Icc
theorem
(b : ℝ) : { b } = ⋂ (r > 0), Icc (b - r) (b + r)
lemma Real.singleton_eq_inter_Icc (b : ℝ) : {b} = ⋂ (r > 0), Icc (b - r) (b + r) := by
simp [Icc_eq_closedBall, biInter_basis_nhds Metric.nhds_basis_closedBall]
squeeze_zero'
theorem
{α} {f g : α → ℝ} {t₀ : Filter α} (hf : ∀ᶠ t in t₀, 0 ≤ f t) (hft : ∀ᶠ t in t₀, f t ≤ g t) (g0 : Tendsto g t₀ (𝓝 0)) :
Tendsto f t₀ (𝓝 0)
/-- Special case of the sandwich lemma; see `tendsto_of_tendsto_of_tendsto_of_le_of_le'` for the
general case. -/
lemma squeeze_zero' {α} {f g : α → ℝ} {t₀ : Filter α} (hf : ∀ᶠ t in t₀, 0 ≤ f t)
(hft : ∀ᶠ t in t₀, f t ≤ g t) (g0 : Tendsto g t₀ (𝓝 0)) : Tendsto f t₀ (𝓝 0) :=
tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds g0 hf hft
squeeze_zero
theorem
{α} {f g : α → ℝ} {t₀ : Filter α} (hf : ∀ t, 0 ≤ f t) (hft : ∀ t, f t ≤ g t) (g0 : Tendsto g t₀ (𝓝 0)) :
Tendsto f t₀ (𝓝 0)
/-- Special case of the sandwich lemma; see `tendsto_of_tendsto_of_tendsto_of_le_of_le`
and `tendsto_of_tendsto_of_tendsto_of_le_of_le'` for the general case. -/
lemma squeeze_zero {α} {f g : α → ℝ} {t₀ : Filter α} (hf : ∀ t, 0 ≤ f t) (hft : ∀ t, f t ≤ g t)
(g0 : Tendsto g t₀ (𝓝 0)) : Tendsto f t₀ (𝓝 0) :=
squeeze_zero' (Eventually.of_forall hf) (Eventually.of_forall hft) g0
eventually_closedBall_subset
theorem
{x : α} {u : Set α} (hu : u ∈ 𝓝 x) : ∀ᶠ r in 𝓝 (0 : ℝ), closedBall x r ⊆ u
/-- If `u` is a neighborhood of `x`, then for small enough `r`, the closed ball
`Metric.closedBall x r` is contained in `u`. -/
lemma eventually_closedBall_subset {x : α} {u : Set α} (hu : u ∈ 𝓝 x) :
∀ᶠ r in 𝓝 (0 : ℝ), closedBall x r ⊆ u := by
obtain ⟨ε, εpos, hε⟩ : ∃ ε, 0 < ε ∧ closedBall x ε ⊆ u := nhds_basis_closedBall.mem_iff.1 hu
have : IicIic ε ∈ 𝓝 (0 : ℝ) := Iic_mem_nhds εpos
filter_upwards [this] with _ hr using Subset.trans (closedBall_subset_closedBall hr) hε
tendsto_closedBall_smallSets
theorem
(x : α) : Tendsto (closedBall x) (𝓝 0) (𝓝 x).smallSets
lemma tendsto_closedBall_smallSets (x : α) : Tendsto (closedBall x) (𝓝 0) (𝓝 x).smallSets :=
tendsto_smallSets_iff.2 fun _ ↦ eventually_closedBall_subset
Metric.isClosed_closedBall
theorem
: IsClosed (closedBall x ε)
lemma isClosed_closedBall : IsClosed (closedBall x ε) :=
isClosed_le (continuous_id.dist continuous_const) continuous_const
Metric.isClosed_sphere
theorem
: IsClosed (sphere x ε)
lemma isClosed_sphere : IsClosed (sphere x ε) :=
isClosed_eq (continuous_id.dist continuous_const) continuous_const
Metric.closure_closedBall
theorem
: closure (closedBall x ε) = closedBall x ε
@[simp]
lemma closure_closedBall : closure (closedBall x ε) = closedBall x ε :=
isClosed_closedBall.closure_eq
Metric.closure_sphere
theorem
: closure (sphere x ε) = sphere x ε
@[simp]
lemma closure_sphere : closure (sphere x ε) = sphere x ε :=
isClosed_sphere.closure_eq
Metric.closure_ball_subset_closedBall
theorem
: closure (ball x ε) ⊆ closedBall x ε
Metric.frontier_ball_subset_sphere
theorem
: frontier (ball x ε) ⊆ sphere x ε
Metric.frontier_closedBall_subset_sphere
theorem
: frontier (closedBall x ε) ⊆ sphere x ε
Metric.closedBall_zero'
theorem
(x : α) : closedBall x 0 = closure { x }
lemma closedBall_zero' (x : α) : closedBall x 0 = closure {x} :=
Subset.antisymm
(fun _y hy =>
mem_closure_iff.2 fun _ε ε0 => ⟨x, mem_singleton x, (mem_closedBall.1 hy).trans_lt ε0⟩)
(closure_minimal (singleton_subset_iff.2 (dist_self x).le) isClosed_closedBall)
Metric.eventually_isCompact_closedBall
theorem
[WeaklyLocallyCompactSpace α] (x : α) : ∀ᶠ r in 𝓝 (0 : ℝ), IsCompact (closedBall x r)
lemma eventually_isCompact_closedBall [WeaklyLocallyCompactSpace α] (x : α) :
∀ᶠ r in 𝓝 (0 : ℝ), IsCompact (closedBall x r) := by
rcases exists_compact_mem_nhds x with ⟨s, s_compact, hs⟩
filter_upwards [eventually_closedBall_subset hs] with r hr
exact IsCompact.of_isClosed_subset s_compact isClosed_closedBall hr
Metric.exists_isCompact_closedBall
theorem
[WeaklyLocallyCompactSpace α] (x : α) : ∃ r, 0 < r ∧ IsCompact (closedBall x r)
lemma exists_isCompact_closedBall [WeaklyLocallyCompactSpace α] (x : α) :
∃ r, 0 < r ∧ IsCompact (closedBall x r) := by
have : ∀ᶠ r in 𝓝[>] 0, IsCompact (closedBall x r) :=
eventually_nhdsWithin_of_eventually_nhds (eventually_isCompact_closedBall x)
simpa only [and_comm] using (this.and self_mem_nhdsWithin).exists
Metric.biInter_gt_closedBall
theorem
(x : α) (r : ℝ) : ⋂ r' > r, closedBall x r' = closedBall x r
theorem biInter_gt_closedBall (x : α) (r : ℝ) : ⋂ r' > r, closedBall x r' = closedBall x r := by
ext
simp [forall_gt_imp_ge_iff_le_of_dense]
Metric.biInter_gt_ball
theorem
(x : α) (r : ℝ) : ⋂ r' > r, ball x r' = closedBall x r
theorem biInter_gt_ball (x : α) (r : ℝ) : ⋂ r' > r, ball x r' = closedBall x r := by
ext
simp [forall_lt_iff_le']
Metric.biUnion_lt_ball
theorem
(x : α) (r : ℝ) : ⋃ r' < r, ball x r' = ball x r
theorem biUnion_lt_ball (x : α) (r : ℝ) : ⋃ r' < r, ball x r' = ball x r := by
ext
rw [← not_iff_not]
simp [forall_lt_imp_le_iff_le_of_dense]
Metric.biUnion_lt_closedBall
theorem
(x : α) (r : ℝ) : ⋃ r' < r, closedBall x r' = ball x r
theorem biUnion_lt_closedBall (x : α) (r : ℝ) : ⋃ r' < r, closedBall x r' = ball x r := by
ext
rw [← not_iff_not]
simp [forall_lt_iff_le]
lebesgue_number_lemma_of_metric
theorem
{s : Set α} {ι : Sort*} {c : ι → Set α} (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
∃ δ > 0, ∀ x ∈ s, ∃ i, ball x δ ⊆ c i
theorem lebesgue_number_lemma_of_metric {s : Set α} {ι : Sort*} {c : ι → Set α} (hs : IsCompact s)
(hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) : ∃ δ > 0, ∀ x ∈ s, ∃ i, ball x δ ⊆ c i := by
simpa only [ball, UniformSpace.ball, preimage_setOf_eq, dist_comm]
using uniformity_basis_dist.lebesgue_number_lemma hs hc₁ hc₂
lebesgue_number_lemma_of_metric_sUnion
theorem
{s : Set α} {c : Set (Set α)} (hs : IsCompact s) (hc₁ : ∀ t ∈ c, IsOpen t) (hc₂ : s ⊆ ⋃₀ c) :
∃ δ > 0, ∀ x ∈ s, ∃ t ∈ c, ball x δ ⊆ t
theorem lebesgue_number_lemma_of_metric_sUnion {s : Set α} {c : Set (Set α)} (hs : IsCompact s)
(hc₁ : ∀ t ∈ c, IsOpen t) (hc₂ : s ⊆ ⋃₀ c) : ∃ δ > 0, ∀ x ∈ s, ∃ t ∈ c, ball x δ ⊆ t := by
rw [sUnion_eq_iUnion] at hc₂; simpa using lebesgue_number_lemma_of_metric hs (by simpa) hc₂