Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit ef62d1c

Browse files
chore(*): last preparations for Heine (#3179)
This is hopefully the last preparatory PR before we study compact uniform spaces. It has almost no mathematical content, except that I define `uniform_continuous_on`, and check it is equivalent to uniform continuity for the induced uniformity. Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
1 parent 6624509 commit ef62d1c

File tree

9 files changed

+185
-11
lines changed

9 files changed

+185
-11
lines changed

src/data/set/basic.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ instance univ_decidable : decidable_pred (@set.univ α) :=
346346
/-- `diagonal α` is the subset of `α × α` consisting of all pairs of the form `(a, a)`. -/
347347
def diagonal (α : Type*) : set (α × α) := {p | p.1 = p.2}
348348

349+
@[simp]
350+
lemma mem_diagonal {α : Type*} (x : α) : (x, x) ∈ diagonal α :=
351+
by simp [diagonal]
352+
349353
/-! ### Lemmas about union -/
350354

351355
theorem union_def {s₁ s₂ : set α} : s₁ ∪ s₂ = {a | a ∈ s₁ ∨ a ∈ s₂} := rfl
@@ -1449,6 +1453,9 @@ range_subset_iff.2 $ λ x, rfl
14491453
| ⟨x⟩ c := subset.antisymm range_const_subset $
14501454
assume y hy, (mem_singleton_iff.1 hy).symm ▸ mem_range_self x
14511455

1456+
lemma diagonal_eq_range {α : Type*} : diagonal α = range (λ x, (x, x)) :=
1457+
by { ext ⟨x, y⟩, simp [diagonal, eq_comm] }
1458+
14521459
theorem preimage_singleton_nonempty {f : α → β} {y : β} :
14531460
(f ⁻¹' {y}).nonempty ↔ y ∈ range f :=
14541461
iff.rfl

src/order/complete_lattice.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,14 @@ theorem infi_union {f : β → α} {s t : set β} : (⨅ x ∈ s ∪ t, f x) = (
641641
calc (⨅ x ∈ s ∪ t, f x) = (⨅ x, (⨅h : x∈s, f x) ⊓ (⨅h : x∈t, f x)) : congr_arg infi $ funext $ assume x, infi_or
642642
... = (⨅x∈s, f x) ⊓ (⨅x∈t, f x) : infi_inf_eq
643643

644+
lemma infi_split (f : β → α) (p : β → Prop) :
645+
(⨅ i, f i) = (⨅ i (h : p i), f i) ⊓ (⨅ i (h : ¬ p i), f i) :=
646+
by simpa [classical.em] using @infi_union _ _ _ f {i | p i} {i | ¬ p i}
647+
648+
lemma infi_split_single (f : β → α) (i₀ : β) :
649+
(⨅ i, f i) = f i₀ ⊓ (⨅ i (h : i ≠ i₀), f i) :=
650+
by convert infi_split _ _; simp
651+
644652
theorem infi_le_infi_of_subset {f : β → α} {s t : set β} (h : s ⊆ t) :
645653
(⨅ x ∈ t, f x) ≤ (⨅ x ∈ s, f x) :=
646654
by rw [(union_eq_self_of_subset_left h).symm, infi_union]; exact inf_le_left
@@ -649,6 +657,14 @@ theorem supr_union {f : β → α} {s t : set β} : (⨆ x ∈ s ∪ t, f x) = (
649657
calc (⨆ x ∈ s ∪ t, f x) = (⨆ x, (⨆h : x∈s, f x) ⊔ (⨆h : x∈t, f x)) : congr_arg supr $ funext $ assume x, supr_or
650658
... = (⨆x∈s, f x) ⊔ (⨆x∈t, f x) : supr_sup_eq
651659

660+
lemma supr_split (f : β → α) (p : β → Prop) :
661+
(⨆ i, f i) = (⨆ i (h : p i), f i) ⊔ (⨆ i (h : ¬ p i), f i) :=
662+
by simpa [classical.em] using @supr_union _ _ _ f {i | p i} {i | ¬ p i}
663+
664+
lemma supr_split_single (f : β → α) (i₀ : β) :
665+
(⨆ i, f i) = f i₀ ⊔ (⨆ i (h : i ≠ i₀), f i) :=
666+
by convert supr_split _ _; simp
667+
652668
theorem supr_le_supr_of_subset {f : β → α} {s t : set β} (h : s ⊆ t) :
653669
(⨆ x ∈ s, f x) ≤ (⨆ x ∈ t, f x) :=
654670
by rw [(union_eq_self_of_subset_left h).symm, supr_union]; exact le_sup_left

src/order/filter/basic.lean

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,38 @@ begin
751751
refl
752752
end
753753

754+
lemma mem_iff_inf_principal_compl {f : filter α} {V : set α} :
755+
V ∈ f ↔ f ⊓ 𝓟 (-V) = ⊥ :=
756+
begin
757+
rw inf_eq_bot_iff,
758+
split,
759+
{ intro h,
760+
use [V, -V],
761+
simp [h, subset.refl] },
762+
{ rintros ⟨U, W, U_in, W_in, UW⟩,
763+
rw [mem_principal_sets, compl_subset_comm] at W_in,
764+
apply mem_sets_of_superset U_in,
765+
intros x x_in,
766+
apply W_in,
767+
intro H,
768+
have : x ∈ U ∩ W := ⟨x_in, H⟩,
769+
rwa UW at this },
770+
end
771+
772+
lemma le_iff_forall_inf_principal_compl {f g : filter α} :
773+
f ≤ g ↔ ∀ V ∈ g, f ⊓ 𝓟 (-V) = ⊥ :=
774+
begin
775+
change (∀ V ∈ g, V ∈ f) ↔ _,
776+
simp_rw [mem_iff_inf_principal_compl],
777+
end
778+
779+
lemma principal_le_iff {s : set α} {f : filter α} :
780+
𝓟 s ≤ f ↔ ∀ V ∈ f, s ⊆ V :=
781+
begin
782+
change (∀ V, V ∈ f → V ∈ _) ↔ _,
783+
simp_rw mem_principal_sets,
784+
end
785+
754786
@[simp] lemma infi_principal_finset {ι : Type w} (s : finset ι) (f : ι → set α) :
755787
(⨅i∈s, 𝓟 (f i)) = 𝓟 (⋂i∈s, f i) :=
756788
begin
@@ -1259,6 +1291,28 @@ theorem preimage_mem_comap (ht : t ∈ g) : m ⁻¹' t ∈ comap m g :=
12591291
lemma comap_id : comap id f = f :=
12601292
le_antisymm (assume s, preimage_mem_comap) (assume s ⟨t, ht, hst⟩, mem_sets_of_superset ht hst)
12611293

1294+
lemma comap_const_of_not_mem {x : α} {f : filter α} {V : set α} (hV : V ∈ f) (hx : x ∉ V) :
1295+
comap (λ y : α, x) f = ⊥ :=
1296+
begin
1297+
ext W,
1298+
suffices : ∃ t ∈ f, (λ (y : α), x) ⁻¹' t ⊆ W, by simpa,
1299+
use [V, hV],
1300+
simp [preimage_const_of_not_mem hx],
1301+
end
1302+
1303+
lemma comap_const_of_mem {x : α} {f : filter α} (h : ∀ V ∈ f, x ∈ V) : comap (λ y : α, x) f = ⊤ :=
1304+
begin
1305+
ext W,
1306+
suffices : (∃ (t : set α), t ∈ f.sets ∧ (λ (y : α), x) ⁻¹' t ⊆ W) ↔ W = univ,
1307+
by simpa,
1308+
split,
1309+
{ rintros ⟨V, V_in, hW⟩,
1310+
simpa [preimage_const_of_mem (h V V_in), univ_subset_iff] using hW },
1311+
{ rintro rfl,
1312+
use univ,
1313+
simp [univ_mem_sets] },
1314+
end
1315+
12621316
lemma comap_comap_comp {m : γ → β} {n : β → α} : comap m (comap n f) = comap (n ∘ m) f :=
12631317
le_antisymm
12641318
(assume c ⟨b, hb, (h : preimage (n ∘ m) b ⊆ c)⟩, ⟨preimage n b, preimage_mem_comap hb, h⟩)
@@ -1403,6 +1457,17 @@ begin
14031457
exact H }
14041458
end
14051459

1460+
lemma subtype_coe_map_comap_prod (s : set α) (f : filter (α × α)) :
1461+
map (coe : s × s → α × α) (comap (coe : s × s → α × α) f) = f ⊓ 𝓟 (s.prod s) :=
1462+
let φ (x : s × s) : s.prod s := ⟨⟨x.1.1, x.2.1⟩, ⟨x.1.2, x.2.2⟩⟩ in
1463+
begin
1464+
rw show (coe : s × s → α × α) = coe ∘ φ, by ext x; cases x; refl,
1465+
rw [← filter.map_map, ← filter.comap_comap_comp],
1466+
rw map_comap_of_surjective,
1467+
exact subtype_coe_map_comap _ _,
1468+
exact λ ⟨⟨a, b⟩, ⟨ha, hb⟩⟩, ⟨⟨⟨a, ha⟩, ⟨b, hb⟩⟩, rfl⟩
1469+
end
1470+
14061471
lemma comap_ne_bot {f : filter β} {m : α → β} (hm : ∀t∈ f, ∃a, m a ∈ t) :
14071472
comap m f ≠ ⊥ :=
14081473
forall_sets_nonempty_iff_ne_bot.mp $ assume s ⟨t, ht, t_s⟩,
@@ -1923,6 +1988,10 @@ begin
19231988
⟨prod.fst ⁻¹' t₁, ⟨t₁, ht₁, subset.refl _⟩, prod.snd ⁻¹' t₂, ⟨t₂, ht₂, subset.refl _⟩, h⟩
19241989
end
19251990

1991+
lemma comap_prod (f : α → β × γ) (b : filter β) (c : filter γ) :
1992+
comap f (b ×ᶠ c) = (comap (prod.fst ∘ f) b) ⊓ (comap (prod.snd ∘ f) c) :=
1993+
by erw [comap_inf, filter.comap_comap_comp, filter.comap_comap_comp]
1994+
19261995
lemma eventually_prod_iff {p : α × β → Prop} {f : filter α} {g : filter β} :
19271996
(∀ᶠ x in f ×ᶠ g, p x) ↔ ∃ (pa : α → Prop) (ha : ∀ᶠ x in f, pa x)
19281997
(pb : β → Prop) (hb : ∀ᶠ y in g, pb y), ∀ {x}, pa x → ∀ {y}, pb y → p (x, y) :=

src/topology/basic.lean

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,10 @@ In this section we define [cluster points](https://en.wikipedia.org/wiki/Limit_p
525525
an accumulation point or a limit point. -/
526526
def cluster_pt (x : α) (F : filter α) : Prop := 𝓝 x ⊓ F ≠ ⊥
527527

528+
lemma cluster_pt_iff {x : α} {F : filter α} :
529+
cluster_pt x F ↔ ∀ {U V : set α}, U ∈ 𝓝 x → V ∈ F → (U ∩ V).nonempty :=
530+
by rw [cluster_pt, inf_ne_bot_iff]
531+
528532
lemma cluster_pt.of_le_nhds {x : α} {f : filter α} (H : f ≤ 𝓝 x) (h : f ≠ ⊥) : cluster_pt x f :=
529533
by rwa [cluster_pt, inf_comm, inf_eq_left.mpr H]
530534

@@ -535,11 +539,11 @@ lemma cluster_pt.mono {x : α} {f g : filter α} (H : cluster_pt x f) (h : f ≤
535539
cluster_pt x g :=
536540
ne_bot_of_le_ne_bot H $ inf_le_inf_left _ h
537541

538-
lemma cluster_pt_of_inf_left {x : α} {f g : filter α} (H : cluster_pt x $ f ⊓ g) :
542+
lemma cluster_pt.of_inf_left {x : α} {f g : filter α} (H : cluster_pt x $ f ⊓ g) :
539543
cluster_pt x f :=
540544
H.mono inf_le_left
541545

542-
lemma cluster_pt_of_inf_right {x : α} {f g : filter α} (H : cluster_pt x $ f ⊓ g) :
546+
lemma cluster_pt.of_inf_right {x : α} {f g : filter α} (H : cluster_pt x $ f ⊓ g) :
543547
cluster_pt x g :=
544548
H.mono inf_le_right
545549

@@ -574,6 +578,9 @@ lemma mem_interior_iff_mem_nhds {s : set α} {a : α} :
574578
a ∈ interior s ↔ s ∈ 𝓝 a :=
575579
by simp only [interior_eq_nhds, le_principal_iff]; refl
576580

581+
lemma subset_interior_iff_nhds {s V : set α} : s ⊆ interior V ↔ ∀ x ∈ s, V ∈ 𝓝 x :=
582+
show (∀ x, x ∈ s → x ∈ _) ↔ _, by simp_rw mem_interior_iff_mem_nhds
583+
577584
lemma is_open_iff_nhds {s : set α} : is_open s ↔ ∀a∈s, 𝓝 a ≤ 𝓟 s :=
578585
calc is_open s ↔ s ⊆ interior s : subset_interior_iff_open.symm
579586
... ↔ (∀a∈s, 𝓝 a ≤ 𝓟 s) : by rw [interior_eq_nhds]; refl
@@ -589,6 +596,9 @@ calc closure s = - interior (- s) : closure_eq_compl_interior_compl
589596
(show 𝓟 s ⊔ 𝓟 (-s) = ⊤, by simp only [sup_principal, union_compl_self, principal_univ])
590597
(by simp only [inf_principal, inter_compl_self, principal_empty])).symm
591598

599+
theorem mem_closure_iff_cluster_pt {s : set α} {a : α} : a ∈ closure s ↔ cluster_pt a (𝓟 s) :=
600+
by simpa only [closure_eq_cluster_pts]
601+
592602
theorem mem_closure_iff_nhds {s : set α} {a : α} :
593603
a ∈ closure s ↔ ∀ t ∈ 𝓝 a, (t ∩ s).nonempty :=
594604
mem_closure_iff.trans

src/topology/metric_space/basic.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,16 @@ theorem uniform_continuous_iff [metric_space β] {f : α → β} :
418418
∀{a b:α}, dist a b < δ → dist (f a) (f b) < ε :=
419419
uniformity_basis_dist.uniform_continuous_iff uniformity_basis_dist
420420

421+
@[nolint ge_or_gt] -- see Note [nolint_ge]
422+
lemma uniform_continuous_on_iff [metric_space β] {f : α → β} {s : set α} :
423+
uniform_continuous_on f s ↔ ∀ ε > 0, ∃ δ > 0, ∀ x y ∈ s, dist x y < δ → dist (f x) (f y) < ε :=
424+
begin
425+
dsimp [uniform_continuous_on],
426+
rw (metric.uniformity_basis_dist.inf_principal (s.prod s)).tendsto_iff metric.uniformity_basis_dist,
427+
simp only [and_imp, exists_prop, prod.forall, mem_inter_eq, gt_iff_lt, mem_set_of_eq, mem_prod],
428+
finish,
429+
end
430+
421431
@[nolint ge_or_gt] -- see Note [nolint_ge]
422432
theorem uniform_embedding_iff [metric_space β] {f : α → β} :
423433
uniform_embedding f ↔ function.injective f ∧ uniform_continuous f ∧
@@ -531,13 +541,15 @@ lemma tendsto_uniformly_iff {ι : Type*}
531541
tendsto_uniformly F f p ↔ ∀ ε > 0, ∀ᶠ n in p, ∀ x, dist (f x) (F n x) < ε :=
532542
by { rw [← tendsto_uniformly_on_univ, tendsto_uniformly_on_iff], simp }
533543

544+
@[nolint ge_or_gt] -- see Note [nolint_ge]
534545
protected lemma cauchy_iff {f : filter α} :
535546
cauchy f ↔ f ≠ ⊥ ∧ ∀ ε > 0, ∃ t ∈ f, ∀ x y ∈ t, dist x y < ε :=
536547
uniformity_basis_dist.cauchy_iff
537548

538549
theorem nhds_basis_ball : (𝓝 x).has_basis (λ ε:ℝ, 0 < ε) (ball x) :=
539550
nhds_basis_uniformity uniformity_basis_dist
540551

552+
@[nolint ge_or_gt] -- see Note [nolint_ge]
541553
theorem mem_nhds_iff : s ∈ 𝓝 x ↔ ∃ε>0, ball x ε ⊆ s :=
542554
nhds_basis_ball.mem_iff
543555

@@ -552,6 +564,7 @@ theorem nhds_basis_ball_inv_nat_pos :
552564
(𝓝 x).has_basis (λ n, 0<n) (λ n:ℕ, ball x (1 / ↑n)) :=
553565
nhds_basis_uniformity uniformity_basis_dist_inv_nat_pos
554566

567+
@[nolint ge_or_gt] -- see Note [nolint_ge]
555568
theorem is_open_iff : is_open s ↔ ∀x∈s, ∃ε>0, ball x ε ⊆ s :=
556569
by simp only [is_open_iff_mem_nhds, mem_nhds_iff]
557570

@@ -613,6 +626,7 @@ theorem continuous_iff [metric_space β] {f : α → β} :
613626
∀b (ε > 0), ∃ δ > 0, ∀a, dist a b < δ → dist (f a) (f b) < ε :=
614627
continuous_iff_continuous_at.trans $ forall_congr $ λ b, tendsto_nhds_nhds
615628

629+
@[nolint ge_or_gt] -- see Note [nolint_ge]
616630
theorem tendsto_nhds {f : filter β} {u : β → α} {a : α} :
617631
tendsto u f (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ x in f, dist (u x) a < ε :=
618632
nhds_basis_ball.tendsto_right_iff
@@ -717,6 +731,10 @@ lemma metric.emetric_closed_ball_nnreal {x : α} {ε : nnreal} :
717731
emetric.closed_ball x ε = closed_ball x ε :=
718732
by { convert metric.emetric_closed_ball ε.2, simp }
719733

734+
/-- Build a new metric space from an old one where the bundled uniform structure is provably
735+
(but typically non-definitionaly) equal to some given uniform structure.
736+
See Note [forgetful inheritance].
737+
-/
720738
def metric_space.replace_uniformity {α} [U : uniform_space α] (m : metric_space α)
721739
(H : @uniformity _ U = @uniformity _ emetric_space.to_uniform_space') :
722740
metric_space α :=
@@ -934,6 +952,8 @@ lemma cauchy_seq_iff_le_tendsto_0 {s : ℕ → α} : cauchy_seq s ↔ ∃ b :
934952

935953
end cauchy_seq
936954

955+
/-- Metric space structure pulled back by an injective function. Injectivity is necessary to
956+
ensure that `dist x y = 0` only if `x = y`. -/
937957
def metric_space.induced {α β} (f : α → β) (hf : function.injective f)
938958
(m : metric_space β) : metric_space α :=
939959
{ dist := λ x y, dist (f x) (f y),

src/topology/separation.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,20 @@ let ⟨s, hs, hys, hxs⟩ := regular_space.regular is_closed_singleton
335335
⟨v, s, hv, hs, hxv, singleton_subset_iff.1 hys,
336336
eq_empty_of_subset_empty $ λ z ⟨hzv, hzs⟩, htu ⟨hvt hzv, hsu hzs⟩⟩⟩
337337

338+
variable {α}
339+
340+
lemma disjoint_nested_nhds [regular_space α] {x y : α} (h : x ≠ y) :
341+
∃ (U₁ V₁ ∈ 𝓝 x) (U₂ V₂ ∈ 𝓝 y), is_closed V₁ ∧ is_closed V₂ ∧ is_open U₁ ∧ is_open U₂ ∧
342+
V₁ ⊆ U₁ ∧ V₂ ⊆ U₂ ∧ U₁ ∩ U₂ = ∅ :=
343+
begin
344+
rcases t2_separation h with ⟨U₁, U₂, U₁_op, U₂_op, x_in, y_in, H⟩,
345+
rcases nhds_is_closed (mem_nhds_sets U₁_op x_in) with ⟨V₁, V₁_in, h₁, V₁_closed⟩,
346+
rcases nhds_is_closed (mem_nhds_sets U₂_op y_in) with ⟨V₂, V₂_in, h₂, V₂_closed⟩,
347+
use [U₁, V₁, mem_sets_of_superset V₁_in h₁, V₁_in,
348+
U₂, V₂, mem_sets_of_superset V₂_in h₂, V₂_in],
349+
tauto
350+
end
351+
338352
end regularity
339353

340354
section normality

src/topology/subset_properties.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ classical.by_cases mem_sets_of_eq_bot $
6666
assume : f ⊓ 𝓟 (- t) ≠ ⊥,
6767
let ⟨a, ha, (hfa : cluster_pt a $ f ⊓ 𝓟 (-t))⟩ := hs _ this $ inf_le_left_of_le hf₂ in
6868
have a ∈ t,
69-
from ht₂ a ha (cluster_pt_of_inf_left hfa),
69+
from ht₂ a ha (hfa.of_inf_left),
7070
have (-t) ∩ t ∈ nhds_within a (-t),
7171
from inter_mem_nhds_within _ (mem_nhds_sets ht₁ this),
7272
have A : nhds_within a (-t) = ⊥,
7373
from empty_in_sets_eq_bot.1 $ compl_inter_self t ▸ this,
7474
have nhds_within a (-t) ≠ ⊥,
75-
from cluster_pt_of_inf_right hfa,
75+
from hfa.of_inf_right,
7676
absurd A this
7777

7878
lemma compact_iff_ultrafilter_le_nhds {s : set α} :

src/topology/uniform_space/basic.lean

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,17 @@ lemma mem_nhds_uniformity_iff_left {x : α} {s : set α} :
550550
s ∈ 𝓝 x ↔ {p : α × α | p.2 = x → p.1 ∈ s} ∈ 𝓤 α :=
551551
by { rw [uniformity_eq_symm, mem_nhds_uniformity_iff_right], refl }
552552

553-
lemma nhds_eq_comap_uniformity {x : α} : 𝓝 x = (𝓤 α).comap (prod.mk x) :=
554-
by ext s; rw [mem_nhds_uniformity_iff_right, mem_comap_sets]; from iff.intro
553+
lemma nhds_eq_comap_uniformity_aux {α : Type u} {x : α} {s : set α} {F : filter (α × α)} :
554+
{p : α × α | p.fst = x → p.snd ∈ s} ∈ F ↔ s ∈ comap (prod.mk x) F :=
555+
by rw mem_comap_sets ; from iff.intro
555556
(assume hs, ⟨_, hs, assume x hx, hx rfl⟩)
556-
(assume ⟨t, h, ht⟩, (𝓤 α).sets_of_superset h $
557+
(assume ⟨t, h, ht⟩, F.sets_of_superset h $
557558
assume ⟨p₁, p₂⟩ hp (h : p₁ = x), ht $ by simp [h.symm, hp])
558559

560+
561+
lemma nhds_eq_comap_uniformity {x : α} : 𝓝 x = (𝓤 α).comap (prod.mk x) :=
562+
by { ext s, rw [mem_nhds_uniformity_iff_right], exact nhds_eq_comap_uniformity_aux }
563+
559564
lemma is_open_iff_ball_subset {s : set α} : is_open s ↔ ∀ x ∈ s, ∃ V ∈ 𝓤 α, ball x V ⊆ s :=
560565
begin
561566
simp_rw [is_open_iff_mem_nhds, nhds_eq_comap_uniformity],
@@ -695,6 +700,20 @@ match this with
695700
Union_subset $ assume p, Union_subset $ assume hp, (ht p hp).left⟩
696701
end
697702

703+
/-- Entourages are neighborhoods of the diagonal. -/
704+
lemma nhds_le_uniformity : (⨆ x : α, 𝓝 (x, x)) ≤ 𝓤 α :=
705+
begin
706+
apply supr_le _,
707+
intros x V V_in,
708+
rcases comp_symm_mem_uniformity_sets V_in with ⟨w, w_in, w_symm, w_sub⟩,
709+
have : (ball x w).prod (ball x w) ∈ 𝓝 (x, x),
710+
{ rw nhds_prod_eq,
711+
exact prod_mem_prod (ball_mem_nhds x w_in) (ball_mem_nhds x w_in) },
712+
apply mem_sets_of_superset this,
713+
rintros ⟨u, v⟩ ⟨u_in, v_in⟩,
714+
exact w_sub (mem_comp_of_mem_ball w_symm u_in v_in)
715+
end
716+
698717
/-!
699718
### Closure and interior in uniform spaces
700719
-/
@@ -851,6 +870,13 @@ as `(x, y)` tends to the diagonal. In other words, if `x` is sufficiently close
851870
def uniform_continuous [uniform_space β] (f : α → β) :=
852871
tendsto (λx:α×α, (f x.1, f x.2)) (𝓤 α) (𝓤 β)
853872

873+
/-- A function `f : α → β` is *uniformly continuous* on `s : set α` if `(f x, f y)` tends to
874+
the diagonal as `(x, y)` tends to the diagonal while remaining in `s.prod s`.
875+
In other words, if `x` is sufficiently close to `y`, then `f x` is close to
876+
`f y` no matter where `x` and `y` are located in `s`.-/
877+
def uniform_continuous_on [uniform_space β] (f : α → β) (s : set α) : Prop :=
878+
tendsto (λ x : α × α, (f x.1, f x.2)) (𝓤 α ⊓ principal (s.prod s)) (𝓤 β)
879+
854880
theorem uniform_continuous_def [uniform_space β] {f : α → β} :
855881
uniform_continuous f ↔ ∀ r ∈ 𝓤 β, { x : α × α | (f x.1, f x.2) ∈ r} ∈ 𝓤 α :=
856882
iff.rfl
@@ -1096,6 +1122,17 @@ lemma uniform_continuous_subtype_mk {p : α → Prop} [uniform_space α] [unifor
10961122
uniform_continuous (λx, ⟨f x, h x⟩ : β → subtype p) :=
10971123
uniform_continuous_comap' hf
10981124

1125+
lemma uniform_continuous_on_iff_restrict [uniform_space α] [uniform_space β] (f : α → β) (s : set α) :
1126+
uniform_continuous_on f s ↔ uniform_continuous (s.restrict f) :=
1127+
begin
1128+
unfold uniform_continuous_on set.restrict uniform_continuous tendsto,
1129+
rw [show (λ x : s × s, (f x.1, f x.2)) = prod.map f f ∘ coe, by ext x; cases x; refl,
1130+
uniformity_comap rfl,
1131+
show prod.map subtype.val subtype.val = (coe : s × s → α × α), by ext x; cases x; refl],
1132+
conv in (map _ (comap _ _)) { rw ← filter.map_map },
1133+
rw subtype_coe_map_comap_prod, refl,
1134+
end
1135+
10991136
lemma tendsto_of_uniform_continuous_subtype
11001137
[uniform_space α] [uniform_space β] {f : α → β} {s : set α} {a : α}
11011138
(hf : uniform_continuous (λx:s, f x.val)) (ha : s ∈ 𝓝 a) :

0 commit comments

Comments
 (0)