Lean library · module TopologyByExample.Spaces.ErdosSpace

Erdős space

Source file

The rational-coordinate subspace of real square-summable sequences, equipped with the norm subspace topology.

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 rationalHilbertSubgroup

TopologyByExample.rationalHilbertSubgroup

The rational-coordinate additive subgroup of real Hilbert sequence space.

def rationalHilbertSubgroup : AddSubgroup ℓ²(ℕ, ℝ)
Definition
where
  carrier := {x | ∀ n, ∃ q : ℚ, x n = q}
  zero_mem' n := ⟨0, by simp⟩
  add_mem' {x y} hx hy n := by
    obtain ⟨q, hq⟩ := hx n
    obtain ⟨r, hr⟩ := hy n
    exact ⟨q + r, by simp [← hq, ← hr]⟩
  neg_mem' {x} hx n := by
    obtain ⟨q, hq⟩ := hx n
    exact ⟨-q, by simp [← hq]⟩

definition ErdosSpace

TopologyByExample.ErdosSpace

Erdős space: rational-coordinate square-summable real sequences.

def ErdosSpace
:= rationalHilbertSubgroup

On this site: Space: Erdős space

instance

instance : NormedAddCommGroup ErdosSpace
Proof
:=
  inferInstanceAs (NormedAddCommGroup rationalHilbertSubgroup)

definition inclusion

TopologyByExample.ErdosSpace.inclusion

Inclusion into real Hilbert sequence space.

def inclusion : ErdosSpace → ℓ²(ℕ, ℝ)
:= Subtype.val

theorem inclusion_add

TopologyByExample.ErdosSpace.inclusion_add

@[simp] theorem inclusion_add (x y : ErdosSpace) :
    inclusion (x + y) = inclusion x + inclusion y
Proof
:= rfl

theorem inclusion_zero

TopologyByExample.ErdosSpace.inclusion_zero

@[simp] theorem inclusion_zero : inclusion 0 = 0
Proof
:= rfl

theorem isometry_inclusion

TopologyByExample.ErdosSpace.isometry_inclusion

The exact norm metric agrees with the ambient Hilbert-space metric.

theorem isometry_inclusion : Isometry inclusion
Proof
:= isometry_subtypeVal

On this site: Erdős space: Inclusion in real Hilbert sequence space

theorem continuous_coordinate

TopologyByExample.ErdosSpace.continuous_coordinate

Each coordinate is a continuous real-valued function.

theorem continuous_coordinate (n : ℕ) : Continuous (fun x ↦ inclusion x n)
Proof
:=
  (lp.evalCLM ℝ (fun _ : ℕ ↦ ℝ) 2 n).continuous.comp isometry_inclusion.continuous

definition single

TopologyByExample.ErdosSpace.single

A one-coordinate rational vector.

def single (n : ℕ) (q : ℚ) : ErdosSpace
Definition
:=
  ⟨lp.single 2 n (q : ℝ), fun j ↦ by
    by_cases h : j = n
    · subst j; exact ⟨q, by simp⟩
    · exact ⟨0, by simp [lp.single_apply, h]⟩⟩

theorem inclusion_single

TopologyByExample.ErdosSpace.inclusion_single

@[simp] theorem inclusion_single (n : ℕ) (q : ℚ) :
    inclusion (single n q) = lp.single 2 n (q : ℝ)
Proof
:= rfl

theorem norm_single

TopologyByExample.ErdosSpace.norm_single

Norm of a one-coordinate rational vector.

theorem norm_single (n : ℕ) (q : ℚ) : ‖single n q‖ = ‖q‖
Proof
:= by
  change ‖lp.single (E := fun _ : ℕ ↦ ℝ) 2 n (q : ℝ)‖ = ‖q‖
  rw [lp.norm_single (by norm_num)]
  exact Rat.norm_cast_real q

definition coordinate

TopologyByExample.ErdosSpace.coordinate

The rational coordinate of a point.

def coordinate (x : ErdosSpace) (n : ℕ) : ℚ
:= (x.property n).choose

theorem coordinate_cast

TopologyByExample.ErdosSpace.coordinate_cast

@[simp] theorem coordinate_cast (x : ErdosSpace) (n : ℕ) :
    (coordinate x n : ℝ) = inclusion x n
Proof
:= (x.property n).choose_spec.symm

theorem inclusion_sum

TopologyByExample.ErdosSpace.inclusion_sum

@[simp] theorem inclusion_sum {ι : Type*} (s : Finset ι) (f : ι → ErdosSpace) :
    inclusion (∑ i ∈ s, f i) = ∑ i ∈ s, inclusion (f i)
Proof
:= by
  classical
  induction s using Finset.induction_on with
  | empty => simp
  | @insert a s ha ih => simp [ha, ih]

theorem dense_finite_sums

TopologyByExample.ErdosSpace.dense_finite_sums

Finite rational sequences are dense for the norm topology.

theorem dense_finite_sums :
    DenseRange (fun z : Σ s : Finset ℕ, s → ℚ ↦ ∑ i : z.1, single i (z.2 i))
Proof
:= by
  intro x
  have hsum : Tendsto (fun s : Finset ℕ ↦ ∑ i ∈ s, single i (coordinate x i))
      atTop (𝓝 x) := by
    apply isometry_inclusion.isEmbedding.tendsto_nhds_iff.mpr
    have h := (lp.hasSum_single (p := 2) (by norm_num) (inclusion x))
    simpa only [HasSum, SummationFilter.unconditional_filter, Function.comp_def,
      inclusion_sum, inclusion_single, coordinate_cast] using h
  apply isClosed_closure.mem_of_tendsto hsum
  filter_upwards [] with s
  apply subset_closure
  refine ⟨⟨s, fun i ↦ coordinate x i⟩, ?_⟩
  exact Finset.sum_coe_sort s (fun i ↦ single i (coordinate x i))

instance

instance : SeparableSpace ErdosSpace
Proof
:= dense_finite_sums.separableSpace'

instance

instance : SecondCountableTopology ErdosSpace
Proof
:= inferInstance

instance

Distinct points can be separated by clopen coordinate cuts.

instance : TotallySeparatedSpace ErdosSpace
Proof
:= by
  apply totallySeparatedSpace_iff_exists_isClopen.mpr
  intro x y hxy
  have hne : ∃ n, inclusion x n ≠ inclusion y n := by
    by_contra! h
    exact hxy (Subtype.ext (lp.ext (funext h)))
  obtain ⟨n, hn⟩ := hne
  have hc : Continuous (fun x : ErdosSpace ↦ coordinate x n) :=
    Rat.isEmbedding_coe_real.isInducing.continuous_iff.mpr (by
      simpa only [Function.comp_def, coordinate_cast] using continuous_coordinate n)
  have hq : coordinate x n ≠ coordinate y n := by
    intro h
    apply hn
    simpa using congrArg (fun q : ℚ ↦ (q : ℝ)) h
  obtain ⟨U, hU, hx, hy⟩ := exists_isClopen_of_totally_separated hq
  exact ⟨(fun x ↦ coordinate x n) ⁻¹' U, hU.preimage hc, hx, hy⟩

theorem isometry_single

TopologyByExample.ErdosSpace.isometry_single

A rational coordinate line is isometric.

theorem isometry_single (n : ℕ) : Isometry (single n)
Proof
:= by
  apply isometry_iff_dist_eq.mpr
  intro q r
  change dist (lp.single (E := fun _ : ℕ ↦ ℝ) 2 n (q : ℝ))
    (lp.single 2 n (r : ℝ)) = dist q r
  rw [(lp.isometry_single n).dist_eq, Rat.dist_cast]

instance

instance : Nontrivial ErdosSpace
Proof
:= (isometry_single 0).injective.nontrivial

theorem continuous_line

TopologyByExample.ErdosSpace.continuous_line

Translating a rational coordinate line gives a continuous map.

theorem continuous_line (x : ErdosSpace) (n : ℕ) :
    Continuous (fun q : ℚ ↦ x + single n q)
Proof
:=
  continuous_const.add (isometry_single n).continuous

theorem single_zero

TopologyByExample.ErdosSpace.single_zero

@[simp] theorem single_zero (n : ℕ) : single n 0 = 0
Proof
:= by
  apply isometry_inclusion.injective
  simp only [inclusion_single, inclusion_zero, Rat.cast_zero, lp.single_zero]

theorem not_isOpen_singleton

TopologyByExample.ErdosSpace.not_isOpen_singleton

No point is isolated.

theorem not_isOpen_singleton (x : ErdosSpace) : ¬IsOpen ({x} : Set ErdosSpace)
Proof
:= by
  intro h
  have he : (fun q : ℚ ↦ x + single 0 q) ⁻¹' {x} = {0} := by
    ext q
    simp only [mem_preimage, mem_singleton_iff, add_eq_left]
    exact (isometry_single 0).injective.eq_iff' (single_zero 0)
  exact _root_.not_isOpen_singleton (0 : ℚ) (he ▸ h.preimage (continuous_line x 0))

theorem isNowhereDense_fibre

TopologyByExample.ErdosSpace.isNowhereDense_fibre

Each rational coordinate fibre is closed and nowhere dense.

theorem isNowhereDense_fibre (q : ℚ) :
    IsNowhereDense {x : ErdosSpace | inclusion x 0 = q}
Proof
:= by
  have hc : IsClosed {x : ErdosSpace | inclusion x 0 = q} :=
    isClosed_eq (continuous_coordinate 0) continuous_const
  apply hc.isNowhereDense_iff.mpr
  apply eq_empty_iff_forall_notMem.mpr
  intro x hx
  have hxf := interior_subset hx
  have hpre := (isOpen_interior (s := {x : ErdosSpace | inclusion x 0 = q})).preimage
    (continuous_line x 0)
  have hz : (0 : ℚ) ∈ (fun r : ℚ ↦ x + single 0 r) ⁻¹'
      interior {x : ErdosSpace | inclusion x 0 = q} := by simpa
  have he : (fun r : ℚ ↦ x + single 0 r) ⁻¹'
      interior {x : ErdosSpace | inclusion x 0 = q} = {0} := by
    apply Subset.antisymm
    · intro r hr
      have hf := interior_subset hr
      change inclusion x 0 + (r : ℝ) = (q : ℝ) at hf
      change inclusion x 0 = (q : ℝ) at hxf
      have : (r : ℝ) = 0 := by linarith
      exact_mod_cast this
    · exact singleton_subset_iff.mpr hz
  exact _root_.not_isOpen_singleton (0 : ℚ) (he ▸ hpre)

theorem isMeagre_univ

TopologyByExample.ErdosSpace.isMeagre_univ

Erdős space is meagre in itself.

theorem isMeagre_univ : IsMeagre (univ : Set ErdosSpace)
Proof
:= by
  have he : (univ : Set ErdosSpace) = ⋃ q : ℚ, {x | inclusion x 0 = q} := by
    ext x
    simp only [mem_univ, mem_iUnion, mem_ofPred_eq, true_iff]
    exact x.property 0
  rw [he]
  exact isMeagre_iUnion fun q ↦ (isNowhereDense_fibre q).isMeagre