Lean library · module TopologyByExample.Theorems.BernsteinMeagreReservoir
Meagre sets with continuum many points in every interval
This file was written by Codex (OpenAI's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.
Imports
definition PlaneContinuum
TopologyByExample.BernsteinMeagreReservoir.PlaneContinuum
Nondegenerate closed connected plane sets.
abbrev PlaneContinuum
:=
{C : Set (ℝ × ℝ) // IsClosed C ∧ IsPreconnected C ∧ C.Nontrivial}
theorem nowhereDense_of_closed_totallyDisconnected
TopologyByExample.BernsteinMeagreReservoir.nowhereDense_of_closed_totallyDisconnected
A closed totally disconnected real set is nowhere dense.
theorem nowhereDense_of_closed_totallyDisconnected {S : Set ℝ}
(hS : IsClosed S) (ht : IsTotallyDisconnected S) : IsNowhereDense S
Proof
:= by
rw [IsNowhereDense, hS.closure_eq]
apply Set.eq_empty_iff_forall_notMem.mpr
intro x hx
obtain ⟨r, hr, hball⟩ := Metric.isOpen_iff.mp isOpen_interior x hx
have hsub : Metric.ball x r ⊆ S := hball.trans interior_subset
have he := ht _ hsub Metric.isPreconnected_ball
(Metric.mem_ball_self hr)
(show x + r / 2 ∈ Metric.ball x r from by
rw [Metric.mem_ball, Real.dist_eq]
have : |x + r / 2 - x| = r / 2 := by rw [add_sub_cancel_left, abs_of_pos (half_pos hr)]
rw [this]
exact half_lt_self hr)
linarith
theorem totallyDisconnected_cantorSet
TopologyByExample.BernsteinMeagreReservoir.totallyDisconnected_cantorSet
The middle-thirds Cantor set is totally disconnected.
theorem totallyDisconnected_cantorSet : IsTotallyDisconnected cantorSet
Proof
:= by
have : TotallyDisconnectedSpace cantorSet :=
cantorSetHomeomorphNatToBool.isEmbedding.isTotallyDisconnected_range.mp
(isTotallyDisconnected_of_totallyDisconnectedSpace _)
exact totallyDisconnectedSpace_subtype_iff.mp this
definition IntervalIndex
TopologyByExample.BernsteinMeagreReservoir.IntervalIndex
Rational intervals index the scaled copies.
abbrev IntervalIndex
:= {p : ℚ × ℚ // p.1 < p.2}
definition affine
TopologyByExample.BernsteinMeagreReservoir.affine
The affine map placing the Cantor set inside a rational interval.
def affine (p : IntervalIndex) : ℝ ≃ₜ ℝ
Definition
:=
(Homeomorph.mulLeft₀ ((p.val.2 : ℝ) - p.val.1)
(sub_ne_zero.mpr (by exact_mod_cast ne_of_gt p.property))).trans
(Homeomorph.addLeft (p.val.1 : ℝ))
definition copy
TopologyByExample.BernsteinMeagreReservoir.copy
One scaled compact copy of the Cantor set.
def copy (p : IntervalIndex) : Set ℝ
:= affine p '' cantorSet
definition realReservoir
TopologyByExample.BernsteinMeagreReservoir.realReservoir
The countable union of all rationally scaled Cantor copies.
def realReservoir : Set ℝ
:= ⋃ p : IntervalIndex, copy p
theorem nowhereDense_copy
TopologyByExample.BernsteinMeagreReservoir.nowhereDense_copy
Each scaled copy is nowhere dense.
theorem nowhereDense_copy (p : IntervalIndex) : IsNowhereDense (copy p)
Proof
:= by
apply nowhereDense_of_closed_totallyDisconnected
· exact (isCompact_cantorSet.image (affine p).continuous).isClosed
· exact (affine p).isEmbedding.isTotallyDisconnected_image.mpr totallyDisconnected_cantorSet
theorem isMeagre_realReservoir
TopologyByExample.BernsteinMeagreReservoir.isMeagre_realReservoir
The real reservoir is meagre.
theorem isMeagre_realReservoir : IsMeagre realReservoir
Proof
:=
isMeagre_iUnion fun p ↦ (nowhereDense_copy p).isMeagre
theorem cardinal_copy
TopologyByExample.BernsteinMeagreReservoir.cardinal_copy
Every scaled copy has cardinality continuum.
theorem cardinal_copy (p : IntervalIndex) : #(copy p) = continuum
theorem copy_subset_interval
TopologyByExample.BernsteinMeagreReservoir.copy_subset_interval
A scaled copy lies in its indexing closed interval.
theorem copy_subset_interval (p : IntervalIndex) :
copy p ⊆ Icc (p.val.1 : ℝ) (p.val.2 : ℝ)
Proof
:= by
rintro z ⟨x, hx, rfl⟩
have hx' := cantorSet_subset_unitInterval hx
have hp : (p.val.1 : ℝ) < p.val.2 := by exact_mod_cast p.property
change (p.val.1 : ℝ) ≤ p.val.1 + (p.val.2 - p.val.1) * x ∧
p.val.1 + (p.val.2 - p.val.1) * x ≤ p.val.2
constructor <;> nlinarith [hx'.1, hx'.2]
theorem cardinal_inter_interval
TopologyByExample.BernsteinMeagreReservoir.cardinal_inter_interval
Every nonempty real open interval contains continuum many reservoir points.
theorem cardinal_inter_interval {a b : ℝ} (hab : a < b) :
#↥(realReservoir ∩ Ioo a b) = continuum
Proof
:= by
apply le_antisymm cardinal_mk_le_continuum_of_secondCountable_t0
obtain ⟨q, haq, hqb⟩ := exists_rat_btwn hab
obtain ⟨r, hqr, hrb⟩ := exists_rat_btwn hqb
let p : IntervalIndex := ⟨(q, r), by exact_mod_cast hqr⟩
have hsub : copy p ⊆ realReservoir ∩ Ioo a b := by
intro z hz
have hi := copy_subset_interval p hz
refine ⟨mem_iUnion.mpr ⟨p, hz⟩, ?_, ?_⟩
· exact haq.trans_le hi.1
· exact hi.2.trans_lt hrb
rw [← cardinal_copy p]
exact mk_le_mk_of_subset hsub
definition planeReservoir
TopologyByExample.BernsteinMeagreReservoir.planeReservoir
The plane reservoir consists of the horizontal and vertical lines with reservoir coordinates.
def planeReservoir : Set (ℝ × ℝ)
:=
Prod.fst ⁻¹' realReservoir ∪ Prod.snd ⁻¹' realReservoir
theorem isMeagre_planeReservoir
TopologyByExample.BernsteinMeagreReservoir.isMeagre_planeReservoir
The plane reservoir is meagre.
theorem isMeagre_planeReservoir : IsMeagre planeReservoir
Proof
:= by
exact (isMeagre_realReservoir.preimage_of_isOpenMap continuous_fst isOpenMap_fst).union
(isMeagre_realReservoir.preimage_of_isOpenMap continuous_snd isOpenMap_snd)
theorem cardinal_inter_of_projection
TopologyByExample.BernsteinMeagreReservoir.cardinal_inter_of_projection
A nonconstant real projection of a continuum supplies continuum many points in the plane reservoir.
theorem cardinal_inter_of_projection (C : PlaneContinuum)
(f : (ℝ × ℝ) → ℝ) (hf : Continuous f)
(hres : f ⁻¹' realReservoir ⊆ planeReservoir)
{x y : ℝ × ℝ} (hx : x ∈ C.val) (hy : y ∈ C.val) (hxy : f x < f y) :
#↥(C.val ∩ planeReservoir) = continuum
Proof
:= by
apply le_antisymm cardinal_mk_le_continuum_of_secondCountable_t0
have hi : Icc (f x) (f y) ⊆ f '' C.val :=
(C.property.2.1.image f hf.continuousOn).Icc_subset
(mem_image_of_mem f hx) (mem_image_of_mem f hy)
have hsub : realReservoir ∩ Ioo (f x) (f y) ⊆ f '' (C.val ∩ planeReservoir) := by
intro z hz
obtain ⟨w, hw, rfl⟩ := hi (Ioo_subset_Icc_self hz.2)
exact ⟨w, ⟨hw, hres hz.1⟩, rfl⟩
have hle := mk_le_mk_of_subset hsub
rw [cardinal_inter_interval hxy] at hle
exact hle.trans mk_image_le
theorem cardinal_inter_continuum
TopologyByExample.BernsteinMeagreReservoir.cardinal_inter_continuum
Every nondegenerate closed connected plane set has continuum many reservoir points.
theorem cardinal_inter_continuum (C : PlaneContinuum) :
#↥(C.val ∩ planeReservoir) = continuum
Proof
:= by
obtain ⟨x, hx, y, hy, hxy⟩ := C.property.2.2
by_cases hfst : x.1 = y.1
· have hsnd : x.2 ≠ y.2 := fun h ↦ hxy (Prod.ext hfst h)
rcases lt_or_gt_of_ne hsnd with h | h
· exact cardinal_inter_of_projection C Prod.snd continuous_snd
(fun _ hz ↦ Or.inr hz) hx hy h
· exact cardinal_inter_of_projection C Prod.snd continuous_snd
(fun _ hz ↦ Or.inr hz) hy hx h
· rcases lt_or_gt_of_ne hfst with h | h
· exact cardinal_inter_of_projection C Prod.fst continuous_fst
(fun _ hz ↦ Or.inl hz) hx hy h
· exact cardinal_inter_of_projection C Prod.fst continuous_fst
(fun _ hz ↦ Or.inl hz) hy hx h
theorem reservoir_properties
TopologyByExample.BernsteinMeagreReservoir.reservoir_properties
The meagre plane set meets each nondegenerate closed connected set in continuum many points.
theorem reservoir_properties : IsMeagre planeReservoir ∧
∀ C : PlaneContinuum, #↥(C.val ∩ planeReservoir) = continuum
Proof
:=
⟨isMeagre_planeReservoir, cardinal_inter_continuum⟩
On this site: Theorem: A meagre plane set meeting every continuum
theorem nowhereDense_preimage_dense
TopologyByExample.BernsteinMeagreReservoir.nowhereDense_preimage_dense
A closed nowhere dense set stays nowhere dense in a dense subspace.
theorem nowhereDense_preimage_dense {X : Type*} [TopologicalSpace X]
{S F : Set X} (hS : Dense S) (hF : IsClosed F) (hn : IsNowhereDense F) :
IsNowhereDense (((↑) : S → X) ⁻¹' F)
Proof
:= by
rw [IsNowhereDense, (hF.preimage continuous_subtypeVal).closure_eq]
apply Set.eq_empty_iff_forall_notMem.mpr
intro x hx
obtain ⟨U, hU, he⟩ := Topology.IsInducing.subtypeVal.isOpen_iff.mp
(isOpen_interior : IsOpen (interior (((↑) : S → X) ⁻¹' F)))
have hxU : x.val ∈ U := by
change x ∈ ((↑) : S → X) ⁻¹' U
rwa [he]
have hd : Dense Fᶜ := by
rw [← interior_eq_empty_iff_dense_compl]
simpa [IsNowhereDense, hF.closure_eq] using hn
obtain ⟨z, hzU, hzF⟩ := hd.inter_open_nonempty U hU ⟨x.val, hxU⟩
obtain ⟨w, hw, hwS⟩ := hS.inter_open_nonempty (U ∩ Fᶜ)
(hU.inter hF.isOpen_compl) ⟨z, hzU, hzF⟩
have hwI : (⟨w, hwS⟩ : S) ∈ interior (((↑) : S → X) ⁻¹' F) := by
rw [← he]
exact hw.1
have hwF : (⟨w, hwS⟩ : S) ∈ ((↑) : S → X) ⁻¹' F := interior_subset hwI
exact hw.2 hwF
theorem meagre_univ_of_dense_subset
TopologyByExample.BernsteinMeagreReservoir.meagre_univ_of_dense_subset
A dense subspace contained in a meagre ambient set is meagre in itself.
theorem meagre_univ_of_dense_subset {X : Type*} [TopologicalSpace X]
{S M : Set X} (hS : Dense S) (hM : IsMeagre M) (hSM : S ⊆ M) :
IsMeagre (univ : Set S)
Proof
:= by
obtain ⟨T, hT, hTc, hcover⟩ := isMeagre_iff_countable_union_isNowhereDense.mp hM
apply isMeagre_iff_countable_union_isNowhereDense.mpr
refine ⟨(fun F : Set X ↦ ((↑) : S → X) ⁻¹' closure F) '' T, ?_, hTc.image _, ?_⟩
· rintro _ ⟨F, hF, rfl⟩
exact nowhereDense_preimage_dense hS isClosed_closure (hT F hF).closure
· intro x _
obtain ⟨F, hF, hxF⟩ := hcover (hSM x.property)
exact mem_sUnion.mpr ⟨_, ⟨F, hF, rfl⟩, subset_closure hxF⟩
On this site: Theorem: Dense subspaces contained in meagre sets