Skip to content

Commit b5690db

Browse files
committed
chore: Namespace UniformSpace.ball API (#16113)
All these lemmas have pretty generic names
1 parent ef88579 commit b5690db

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Mathlib/Topology/UniformSpace/Basic.lean

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -564,16 +564,16 @@ theorem comp_comp_symm_mem_uniformity_sets {s : Set (α × α)} (hs : s ∈ 𝓤
564564
### Balls in uniform spaces
565565
-/
566566

567+
namespace UniformSpace
568+
567569
/-- The ball around `(x : β)` with respect to `(V : Set (β × β))`. Intended to be
568570
used for `V ∈ 𝓤 β`, but this is not needed for the definition. Recovers the
569571
notions of metric space ball when `V = {p | dist p.1 p.2 < r }`. -/
570-
def UniformSpace.ball (x : β) (V : Set (β × β)) : Set β :=
571-
Prod.mk x ⁻¹' V
572+
def ball (x : β) (V : Set (β × β)) : Set β := Prod.mk x ⁻¹' V
572573

573574
open UniformSpace (ball)
574575

575-
theorem UniformSpace.mem_ball_self (x : α) {V : Set (α × α)} (hV : V ∈ 𝓤 α) : x ∈ ball x V :=
576-
refl_mem_uniformity hV
576+
lemma mem_ball_self (x : α) {V : Set (α × α)} : V ∈ 𝓤 α → x ∈ ball x V := refl_mem_uniformity
577577

578578
/-- The triangle inequality for `UniformSpace.ball` -/
579579
theorem mem_ball_comp {V W : Set (β × β)} {x y z} (h : y ∈ ball x V) (h' : z ∈ ball y W) :
@@ -612,11 +612,10 @@ theorem mem_comp_of_mem_ball {V W : Set (β × β)} {x y z : β} (hV : Symmetric
612612
rw [mem_ball_symmetry hV] at hx
613613
exact ⟨z, hx, hy⟩
614614

615-
theorem UniformSpace.isOpen_ball (x : α) {V : Set (α × α)} (hV : IsOpen V) : IsOpen (ball x V) :=
615+
lemma isOpen_ball (x : α) {V : Set (α × α)} (hV : IsOpen V) : IsOpen (ball x V) :=
616616
hV.preimage <| continuous_const.prod_mk continuous_id
617617

618-
theorem UniformSpace.isClosed_ball (x : α) {V : Set (α × α)} (hV : IsClosed V) :
619-
IsClosed (ball x V) :=
618+
lemma isClosed_ball (x : α) {V : Set (α × α)} (hV : IsClosed V) : IsClosed (ball x V) :=
620619
hV.preimage <| continuous_const.prod_mk continuous_id
621620

622621
theorem mem_comp_comp {V W M : Set (β × β)} (hW' : SymmetricRel W) {p : β × β} :
@@ -629,10 +628,14 @@ theorem mem_comp_comp {V W M : Set (β × β)} (hW' : SymmetricRel W) {p : β ×
629628
rw [mem_ball_symmetry hW'] at z_in
630629
exact ⟨z, ⟨w, w_in, hwz⟩, z_in⟩
631630

631+
end UniformSpace
632+
632633
/-!
633634
### Neighborhoods in uniform spaces
634635
-/
635636

637+
open UniformSpace
638+
636639
theorem mem_nhds_uniformity_iff_right {x : α} {s : Set α} :
637640
s ∈ 𝓝 x ↔ { p : α × α | p.1 = x → p.2 ∈ s } ∈ 𝓤 α := by
638641
simp only [nhds_eq_comap_uniformity, mem_comap_prod_mk]

Mathlib/Topology/UniformSpace/UniformEmbedding.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ theorem UniformInducing.inducing {f : α → β} (h : UniformInducing f) : Induc
109109
theorem UniformInducing.prod {α' : Type*} {β' : Type*} [UniformSpace α'] [UniformSpace β']
110110
{e₁ : α → α'} {e₂ : β → β'} (h₁ : UniformInducing e₁) (h₂ : UniformInducing e₂) :
111111
UniformInducing fun p : α × β => (e₁ p.1, e₂ p.2) :=
112-
by simp [(· ∘ ·), uniformity_prod, ← h₁.1, ← h₂.1, comap_inf, comap_comap]⟩
112+
by simp [(· ∘ ·), uniformity_prod, ← h₁.1, ← h₂.1, Filter.comap_inf, comap_comap]⟩
113113

114114
theorem UniformInducing.denseInducing {f : α → β} (h : UniformInducing f) (hd : DenseRange f) :
115115
DenseInducing f :=
@@ -238,9 +238,9 @@ theorem closure_image_mem_nhds_of_uniformInducing {s : Set (α × α)} {e : α
238238
∃ U, (U ∈ 𝓤 β ∧ IsOpen U ∧ SymmetricRel U) ∧ Prod.map e e ⁻¹' U ⊆ s := by
239239
rwa [← he₁.comap_uniformity, (uniformity_hasBasis_open_symmetric.comap _).mem_iff] at hs
240240
rcases he₂.dense.mem_nhds (UniformSpace.ball_mem_nhds b hU) with ⟨a, ha⟩
241-
refine ⟨a, mem_of_superset ?_ (closure_mono <| image_subset _ <| ball_mono hs a)⟩
241+
refine ⟨a, mem_of_superset ?_ (closure_mono <| image_subset _ <| UniformSpace.ball_mono hs a)⟩
242242
have ho : IsOpen (UniformSpace.ball (e a) U) := UniformSpace.isOpen_ball (e a) hUo
243-
refine mem_of_superset (ho.mem_nhds <| (mem_ball_symmetry hsymm).2 ha) fun y hy => ?_
243+
refine mem_of_superset (ho.mem_nhds <| (UniformSpace.mem_ball_symmetry hsymm).2 ha) fun y hy => ?_
244244
refine mem_closure_iff_nhds.2 fun V hV => ?_
245245
rcases he₂.dense.mem_nhds (inter_mem hV (ho.mem_nhds hy)) with ⟨x, hxV, hxU⟩
246246
exact ⟨e x, hxV, mem_image_of_mem e hxU⟩

0 commit comments

Comments
 (0)