Skip to content

Commit

Permalink
feat(Topology/MetricSpace/Pseudo/Defs): add dense_iff_iUnion_ball a…
Browse files Browse the repository at this point in the history
…nd `dist_eq_of_dist_zero` (#19294)

Upstreamed from the [Carleson](https://github.com/fpvandoorn/carleson) project. 

Co-authored-by: Floris van Doorn
  • Loading branch information
pitmonticone authored and TobiasLeichtfried committed Nov 21, 2024
1 parent 834682a commit 721bc41
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Mathlib/Topology/MetricSpace/Pseudo/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,10 @@ theorem tendsto_iff_of_dist {f₁ f₂ : ι → α} {p : Filter ι} {a : α}

end Real

theorem PseudoMetricSpace.dist_eq_of_dist_zero (x : α) {y z : α} (h : dist y z = 0) :
dist x y = dist x z :=
dist_comm y x ▸ dist_comm z x ▸ sub_eq_zero.1 (abs_nonpos_iff.1 (h ▸ abs_dist_sub_le y z x))

-- Porting note: 3 new lemmas
theorem dist_dist_dist_le_left (x y z : α) : dist (dist x z) (dist y z) ≤ dist x y :=
abs_dist_sub_le ..
Expand Down Expand Up @@ -1127,6 +1131,10 @@ theorem dense_iff {s : Set α} : Dense s ↔ ∀ x, ∀ r > 0, (ball x r ∩ s).
forall_congr' fun x => by
simp only [mem_closure_iff, Set.Nonempty, exists_prop, mem_inter_iff, mem_ball', and_comm]

theorem dense_iff_iUnion_ball (s : Set α) : Dense s ↔ ∀ r > 0, ⋃ c ∈ s, ball c r = univ := by
simp_rw [eq_univ_iff_forall, mem_iUnion, exists_prop, mem_ball, Dense, mem_closure_iff,
forall_comm (α := α)]

theorem denseRange_iff {f : β → α} : DenseRange f ↔ ∀ x, ∀ r > 0, ∃ y, dist x (f y) < r :=
forall_congr' fun x => by simp only [mem_closure_iff, exists_range_iff]

Expand Down

0 comments on commit 721bc41

Please sign in to comment.