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

Commit e0c0d84

Browse files
committed
feat(topology/separation): removing a finite set from a dense set preserves density (#10405)
Also add the fact that one can find a dense set containing neither top nor bottom in a nontrivial dense linear order.
1 parent 55b81f8 commit e0c0d84

File tree

6 files changed

+86
-17
lines changed

6 files changed

+86
-17
lines changed

src/measure_theory/function/ae_measurable_order.lean

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,12 @@ theorem ennreal.ae_measurable_of_exist_almost_disjoint_supersets
110110
{x | f x < p} ⊆ u ∧ {x | (q : ℝ≥0∞) < f x} ⊆ v ∧ μ (u ∩ v) = 0) :
111111
ae_measurable f μ :=
112112
begin
113-
let s : set ℝ≥0∞ := {x | ∃ a : ℚ, x = ennreal.of_real a},
114-
have s_count : countable s,
115-
{ have : s = range (λ (a : ℚ), ennreal.of_real a),
116-
by { ext x, simp only [eq_comm, mem_range, mem_set_of_eq] },
117-
rw this,
118-
exact countable_range _ },
119-
have s_dense : dense s,
120-
{ refine dense_iff_forall_lt_exists_mem.2 (λ c d hcd, _),
121-
rcases ennreal.lt_iff_exists_rat_btwn.1 hcd with ⟨q, hq⟩,
122-
exact ⟨ennreal.of_real q, ⟨q, rfl⟩, hq.2⟩ },
113+
obtain ⟨s, s_count, s_dense, s_zero, s_top⟩ : ∃ s : set ℝ≥0∞, countable s ∧ dense s ∧
114+
0 ∉ s ∧ ∞ ∉ s := ennreal.exists_countable_dense_no_zero_top,
115+
have I : ∀ x ∈ s, x ≠ ∞ := λ x xs hx, s_top (hx ▸ xs),
123116
apply measure_theory.ae_measurable_of_exist_almost_disjoint_supersets μ s s_count s_dense _,
124-
rintros _ ⟨p, rfl⟩ _ ⟨q, rfl⟩ hpq,
125-
apply h,
126-
simpa [ennreal.of_real] using hpq,
117+
rintros p hp q hq hpq,
118+
lift p to ℝ≥0 using I p hp,
119+
lift q to ℝ≥0 using I q hq,
120+
exact h p q (ennreal.coe_lt_coe.1 hpq),
127121
end

src/topology/algebra/ordered/basic.lean

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,6 +2435,44 @@ begin
24352435
exact ⟨x, ⟨H hx, xs⟩⟩ }
24362436
end
24372437

2438+
instance (x : α) [nontrivial α] : ne_bot (𝓝[{x}ᶜ] x) :=
2439+
begin
2440+
apply forall_mem_nonempty_iff_ne_bot.1 (λ s hs, _),
2441+
obtain ⟨u, u_open, xu, us⟩ : ∃ (u : set α), is_open u ∧ x ∈ u ∧ u ∩ {x}ᶜ ⊆ s :=
2442+
mem_nhds_within.1 hs,
2443+
obtain ⟨a, b, a_lt_b, hab⟩ : ∃ (a b : α), a < b ∧ Ioo a b ⊆ u := u_open.exists_Ioo_subset ⟨x, xu⟩,
2444+
obtain ⟨y, hy⟩ : ∃ y, a < y ∧ y < b := exists_between a_lt_b,
2445+
rcases ne_or_eq x y with xy|rfl,
2446+
{ exact ⟨y, us ⟨hab hy, xy.symm⟩⟩ },
2447+
obtain ⟨z, hz⟩ : ∃ z, a < z ∧ z < x := exists_between hy.1,
2448+
exact ⟨z, us ⟨hab ⟨hz.1, hz.2.trans hy.2⟩, hz.2.ne⟩⟩,
2449+
end
2450+
2451+
/-- Let `s` be a dense set in a nontrivial dense linear order `α`. If `s` is a
2452+
separable space (e.g., if `α` has a second countable topology), then there exists a countable
2453+
dense subset `t ⊆ s` such that `t` does not contain bottom/top elements of `α`. -/
2454+
lemma dense.exists_countable_dense_subset_no_bot_top [nontrivial α]
2455+
{s : set α} [separable_space s] (hs : dense s) :
2456+
∃ t ⊆ s, countable t ∧ dense t ∧ (∀ x, is_bot x → x ∉ t) ∧ (∀ x, is_top x → x ∉ t) :=
2457+
begin
2458+
rcases hs.exists_countable_dense_subset with ⟨t, hts, htc, htd⟩,
2459+
refine ⟨t \ ({x | is_bot x} ∪ {x | is_top x}), _, _, _, _, _⟩,
2460+
{ exact (diff_subset _ _).trans hts },
2461+
{ exact htc.mono (diff_subset _ _) },
2462+
{ exact htd.diff_finite ((subsingleton_is_bot α).finite.union (subsingleton_is_top α).finite) },
2463+
{ assume x hx, simp [hx] },
2464+
{ assume x hx, simp [hx] }
2465+
end
2466+
2467+
variable (α)
2468+
/-- If `α` is a nontrivial separable dense linear order, then there exists a
2469+
countable dense set `s : set α` that contains neither top nor bottom elements of `α`.
2470+
For a dense set containing both bot and top elements, see
2471+
`exists_countable_dense_bot_top`. -/
2472+
lemma exists_countable_dense_no_bot_top [separable_space α] [nontrivial α] :
2473+
∃ s : set α, countable s ∧ dense s ∧ (∀ x, is_bot x → x ∉ s) ∧ (∀ x, is_top x → x ∉ s) :=
2474+
by simpa using dense_univ.exists_countable_dense_subset_no_bot_top
2475+
24382476
end densely_ordered
24392477

24402478
section complete_linear_order

src/topology/bases.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ in ⟨coe '' t, image_subset_iff.2 $ λ x _, mem_preimage.2 $ subtype.coe_prop _
414414
/-- Let `s` be a dense set in a topological space `α` with partial order structure. If `s` is a
415415
separable space (e.g., if `α` has a second countable topology), then there exists a countable
416416
dense subset `t ⊆ s` such that `t` contains bottom/top element of `α` when they exist and belong
417-
to `s`. -/
417+
to `s`. For a dense subset containing neither bot nor top elements, see
418+
`dense.exists_countable_dense_subset_no_bot_top`. -/
418419
lemma dense.exists_countable_dense_subset_bot_top {α : Type*} [topological_space α]
419420
[partial_order α] {s : set α} [separable_space s] (hs : dense s) :
420421
∃ t ⊆ s, countable t ∧ dense t ∧ (∀ x, is_bot x → x ∈ s → x ∈ t) ∧
@@ -435,7 +436,8 @@ instance separable_space_univ {α : Type*} [topological_space α] [separable_spa
435436

436437
/-- If `α` is a separable topological space with a partial order, then there exists a countable
437438
dense set `s : set α` that contains those of both bottom and top elements of `α` that actually
438-
exist. -/
439+
exist. For a dense set containing neither bot nor top elements, see
440+
`exists_countable_dense_no_bot_top`. -/
439441
lemma exists_countable_dense_bot_top (α : Type*) [topological_space α] [separable_space α]
440442
[partial_order α] :
441443
∃ s : set α, countable s ∧ dense s ∧ (∀ x, is_bot x → x ∈ s) ∧ (∀ x, is_top x → x ∈ s) :=

src/topology/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ space. -/
936936
closure {x}ᶜ = (univ : set α) :=
937937
(dense_compl_singleton x).closure_eq
938938

939-
/-- If `x` is not an isolated point of a topological space, then the interior of `{x}` is empty. -/
939+
/-- If `x` is not an isolated point of a topological space, then the interior of `{x}` is empty. -/
940940
@[simp] lemma interior_singleton (x : α) [ne_bot (𝓝[{x}ᶜ] x)] :
941941
interior {x} = (∅ : set α) :=
942942
interior_eq_empty_iff_dense_compl.2 (dense_compl_singleton x)

src/topology/instances/ennreal.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,14 @@ have Inf ((λb, ↑r - b) '' range b) = ↑r - (⨆i, b i),
521521
(ennreal.tendsto_coe_sub.comp (tendsto_id' inf_le_left)),
522522
by rw [eq, ←this]; simp [Inf_image, infi_range, -mem_range]; exact le_rfl
523523

524+
lemma exists_countable_dense_no_zero_top :
525+
∃ (s : set ℝ≥0∞), countable s ∧ dense s ∧ 0 ∉ s ∧ ∞ ∉ s :=
526+
begin
527+
obtain ⟨s, s_count, s_dense, hs⟩ : ∃ s : set ℝ≥0∞, countable s ∧ dense s ∧
528+
(∀ x, is_bot x → x ∉ s) ∧ (∀ x, is_top x → x ∉ s) := exists_countable_dense_no_bot_top ℝ≥0∞,
529+
exact ⟨s, s_count, s_dense, λ h, hs.1 0 (by simp) h, λ h, hs.2 ∞ (by simp) h⟩,
530+
end
531+
524532
end topological_space
525533

526534
section tsum

src/topology/separation.lean

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ begin
304304
apply is_closed_map.of_nonempty, intros s hs h2s, simp_rw [h2s.image_const, is_closed_singleton]
305305
end
306306

307-
lemma finite.is_closed {α} [topological_space α] [t1_space α] {s : set α} (hs : set.finite s) :
307+
lemma finite.is_closed [t1_space α] {s : set α} (hs : set.finite s) :
308308
is_closed s :=
309309
begin
310310
rw ← bUnion_of_singleton s,
@@ -321,6 +321,33 @@ begin
321321
exact ⟨i, hi, λ h, hsub h rfl⟩
322322
end
323323

324+
/-- Removing a non-isolated point from a dense set, one still obtains a dense set. -/
325+
lemma dense.diff_singleton [t1_space α] {s : set α} (hs : dense s) (x : α) [ne_bot (𝓝[{x}ᶜ] x)] :
326+
dense (s \ {x}) :=
327+
hs.inter_of_open_right (dense_compl_singleton x) is_open_compl_singleton
328+
329+
/-- Removing a finset from a dense set in a space without isolated points, one still
330+
obtains a dense set. -/
331+
lemma dense.diff_finset [t1_space α] [∀ (x : α), ne_bot (𝓝[{x}ᶜ] x)]
332+
{s : set α} (hs : dense s) (t : finset α) :
333+
dense (s \ t) :=
334+
begin
335+
induction t using finset.induction_on with x s hxs ih hd,
336+
{ simpa using hs },
337+
{ rw [finset.coe_insert, ← union_singleton, ← diff_diff],
338+
exact ih.diff_singleton _, }
339+
end
340+
341+
/-- Removing a finite set from a dense set in a space without isolated points, one still
342+
obtains a dense set. -/
343+
lemma dense.diff_finite [t1_space α] [∀ (x : α), ne_bot (𝓝[{x}ᶜ] x)]
344+
{s : set α} (hs : dense s) {t : set α} (ht : finite t) :
345+
dense (s \ t) :=
346+
begin
347+
convert hs.diff_finset ht.to_finset,
348+
exact (finite.coe_to_finset _).symm,
349+
end
350+
324351
/-- If a function to a `t1_space` tends to some limit `b` at some point `a`, then necessarily
325352
`b = f a`. -/
326353
lemma eq_of_tendsto_nhds [topological_space β] [t1_space β] {f : α → β} {a : α} {b : β}

0 commit comments

Comments
 (0)