Skip to content

Commit 5d1d19d

Browse files
committed
feat(Topology/UrysohnsLemma): add a variation of Urysohn's lemma for T2Space (#12459)
prove a version of Urysohn's lemma and separation lemmas needed for them. - In a `T2Space X`, for a closed set `t` and a relatively compact open set `s` such that `t ⊆ s`, there is a continuous function `f` supported in `s`, `f x = 1` on `t` and `0 ≤ f x ≤ 1`. Motivation: this will be used in #12290.
1 parent f276328 commit 5d1d19d

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

Mathlib/Topology/Separation.lean

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,22 @@ theorem IsCompact.nhdsSet_inter_eq [T2Space X] {s t : Set X} (hs : IsCompact s)
14101410
· exact le_iSup₂_of_le x ⟨hxs, hyt⟩ (inf_idem _).le
14111411
· exact (disjoint_nhds_nhds.mpr hne).eq_bot ▸ bot_le
14121412

1413+
/-- In a `T2Space X`, for a compact set `t` and a point `x` outside `t`, there are open sets `U`,
1414+
`V` that separate `t` and `x`.-/
1415+
lemma IsCompact.separation_of_not_mem {X : Type u_1} [TopologicalSpace X] [T2Space X] {x : X}
1416+
{t : Set X} (H1 : IsCompact t) (H2 : x ∉ t) :
1417+
∃ (U : Set X), ∃ (V : Set X), IsOpen U ∧ IsOpen V ∧ t ⊆ U ∧ x ∈ V ∧ Disjoint U V := by
1418+
simpa [SeparatedNhds] using SeparatedNhds.of_isCompact_isCompact_isClosed H1 isCompact_singleton
1419+
isClosed_singleton <| disjoint_singleton_right.mpr H2
1420+
1421+
/-- In a `T2Space X`, for a compact set `t` and a point `x` outside `t`, `𝓝ˢ t` and `𝓝 x` are
1422+
disjoint. -/
1423+
lemma IsCompact.disjoint_nhdsSet_nhds {X : Type u_1} [TopologicalSpace X] [T2Space X] {x : X}
1424+
{t : Set X} (H1 : IsCompact t) (H2 : x ∉ t) :
1425+
Disjoint (𝓝ˢ t) (𝓝 x) := by
1426+
simpa using SeparatedNhds.disjoint_nhdsSet <| .of_isCompact_isCompact_isClosed H1
1427+
isCompact_singleton isClosed_singleton <| disjoint_singleton_right.mpr H2
1428+
14131429
/-- If a function `f` is
14141430
14151431
- injective on a compact set `s`;
@@ -1738,6 +1754,25 @@ theorem SeparatedNhds.of_isCompact_isCompact [T2Space X] {s t : Set X} (hs : IsC
17381754
@[deprecated (since := "2024-01-28")]
17391755
alias separatedNhds_of_isCompact_isCompact := SeparatedNhds.of_isCompact_isCompact
17401756

1757+
/-- In a `T2Space X`, for disjoint closed sets `s t` such that `closure sᶜ` is compact,
1758+
there are neighbourhoods that separate `s` and `t`.-/
1759+
lemma SeparatedNhds.of_isClosed_isCompact_closure_compl_isClosed [T2Space X] {s : Set X}
1760+
{t : Set X} (H1 : IsClosed s) (H2 : IsCompact (closure sᶜ)) (H3 : IsClosed t)
1761+
(H4 : Disjoint s t) : SeparatedNhds s t := by
1762+
-- Since `t` is a closed subset of the compact set `closure sᶜ`, it is compact.
1763+
have ht : IsCompact t := .of_isClosed_subset H2 H3 <| H4.subset_compl_left.trans subset_closure
1764+
-- we split `s` into its frontier and its interior.
1765+
rw [← diff_union_of_subset (interior_subset (s := s))]
1766+
-- since `t ⊆ sᶜ`, which is open, and `interior s` is open, we have
1767+
-- `SeparatedNhds (interior s) t`, which leaves us only with the frontier.
1768+
refine .union_left ?_ ⟨interior s, sᶜ, isOpen_interior, H1.isOpen_compl, le_rfl,
1769+
H4.subset_compl_left, disjoint_compl_right.mono_left interior_subset⟩
1770+
-- Since the frontier of `s` is compact (as it is a subset of `closure sᶜ`), we simply apply
1771+
-- `SeparatedNhds_of_isCompact_isCompact`.
1772+
rw [← H1.frontier_eq, frontier_eq_closure_inter_closure, H1.closure_eq]
1773+
refine .of_isCompact_isCompact ?_ ht (disjoint_of_subset_left inter_subset_left H4)
1774+
exact H2.of_isClosed_subset (H1.inter isClosed_closure) inter_subset_right
1775+
17411776
section SeparatedFinset
17421777

17431778
theorem SeparatedNhds.of_finset_finset [T2Space X] (s t : Finset X) (h : Disjoint s t) :

Mathlib/Topology/UrysohnsLemma.lean

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ theorem tendsto_approx_atTop (c : CU P) (x : X) :
230230
theorem lim_of_mem_C (c : CU P) (x : X) (h : x ∈ c.C) : c.lim x = 0 := by
231231
simp only [CU.lim, approx_of_mem_C, h, ciSup_const]
232232

233+
theorem disjoint_C_support_lim (c : CU P) : Disjoint c.C (Function.support c.lim) :=
234+
Function.disjoint_support_iff.mpr (fun x hx => lim_of_mem_C c x hx)
235+
233236
theorem lim_of_nmem_U (c : CU P) (x : X) (h : x ∉ c.U) : c.lim x = 1 := by
234237
simp only [CU.lim, approx_of_nmem_U c _ h, ciSup_const]
235238

@@ -431,6 +434,54 @@ theorem exists_continuous_one_zero_of_isCompact_of_isGδ [RegularSpace X] [Local
431434
· apply le_trans _ hu.le
432435
exact tsum_le_tsum (fun n ↦ I n x) (S x) u_sum
433436

437+
/-- A variation of Urysohn's lemma. In a `T2Space X`, for a closed set `t` and a relatively
438+
compact open set `s` such that `t ⊆ s`, there is a continuous function `f` supported in `s`,
439+
`f x = 1` on `t` and `0 ≤ f x ≤ 1`. -/
440+
lemma exists_tsupport_one_of_isOpen_isClosed [T2Space X] {s t : Set X}
441+
(hs : IsOpen s) (hscp : IsCompact (closure s)) (ht : IsClosed t) (hst : t ⊆ s) : ∃ f : C(X, ℝ),
442+
tsupport f ⊆ s ∧ EqOn f 1 t ∧ ∀ x, f x ∈ Icc (0 : ℝ) 1 := by
443+
-- separate `sᶜ` and `t` by `u` and `v`.
444+
rw [← compl_compl s] at hscp
445+
obtain ⟨u, v, huIsOpen, hvIsOpen, hscompl_subset_u, ht_subset_v, hDjsjointuv⟩ :=
446+
SeparatedNhds.of_isClosed_isCompact_closure_compl_isClosed (isClosed_compl_iff.mpr hs)
447+
hscp ht (HasSubset.Subset.disjoint_compl_left hst)
448+
rw [← subset_compl_iff_disjoint_right] at hDjsjointuv
449+
have huvc : closure u ⊆ vᶜ := closure_minimal hDjsjointuv hvIsOpen.isClosed_compl
450+
-- although `sᶜ` is not compact, `closure s` is compact and we can apply
451+
-- `SeparatedNhds.of_isClosed_isCompact_closure_compl_isClosed`. To apply the condition
452+
-- recursively, we need to make sure that `sᶜ ⊆ C`.
453+
let P : Set X → Prop := fun C => sᶜ ⊆ C
454+
set c : Urysohns.CU P :=
455+
{ C := closure u
456+
U := tᶜ
457+
P_C := hscompl_subset_u.trans subset_closure
458+
closed_C := isClosed_closure
459+
open_U := ht.isOpen_compl
460+
subset := subset_compl_comm.mp
461+
(Subset.trans ht_subset_v (subset_compl_comm.mp huvc))
462+
hP := by
463+
intro c u0 cIsClosed Pc u0IsOpen csubu0
464+
obtain ⟨u1, hu1⟩ := SeparatedNhds.of_isClosed_isCompact_closure_compl_isClosed cIsClosed
465+
(IsCompact.of_isClosed_subset hscp isClosed_closure
466+
(closure_mono (compl_subset_compl.mpr Pc)))
467+
(isClosed_compl_iff.mpr u0IsOpen) (HasSubset.Subset.disjoint_compl_right csubu0)
468+
simp_rw [← subset_compl_iff_disjoint_right, compl_subset_comm (s := u0)] at hu1
469+
obtain ⟨v1, hu1, hv1, hcu1, hv1u, hu1v1⟩ := hu1
470+
refine ⟨u1, hu1, hcu1, ?_, (Pc.trans hcu1).trans subset_closure⟩
471+
exact closure_minimal hu1v1 hv1.isClosed_compl |>.trans hv1u }
472+
-- `c.lim = 0` on `closure u` and `c.lim = 1` on `t`, so that `tsupport c.lim ⊆ s`.
473+
use ⟨c.lim, c.continuous_lim⟩
474+
simp only [ContinuousMap.coe_mk]
475+
refine ⟨?_, ?_, Urysohns.CU.lim_mem_Icc c⟩
476+
· apply Subset.trans _ (compl_subset_comm.mp hscompl_subset_u)
477+
rw [← IsClosed.closure_eq (isClosed_compl_iff.mpr huIsOpen)]
478+
apply closure_mono
479+
exact Disjoint.subset_compl_right (disjoint_of_subset_right subset_closure
480+
(Disjoint.symm (Urysohns.CU.disjoint_C_support_lim c)))
481+
· intro x hx
482+
apply Urysohns.CU.lim_of_nmem_U
483+
exact not_mem_compl_iff.mpr hx
484+
434485
theorem exists_continuous_nonneg_pos [RegularSpace X] [LocallyCompactSpace X] (x : X) :
435486
∃ f : C(X, ℝ), HasCompactSupport f ∧ 0 ≤ (f : X → ℝ) ∧ f x ≠ 0 := by
436487
rcases exists_compact_mem_nhds x with ⟨k, hk, k_mem⟩

0 commit comments

Comments
 (0)