Lean library · module TopologyByExample.Spaces.ErdosClosure

The original closure definition of complete Erdős space

Source file

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 positiveCarrier

TopologyByExample.CompleteErdos.positiveCarrier

The positive reciprocal-coordinate subspace in the original construction.

def positiveCarrier : Set Ambient
:=
  {x | ∀ i, ∃ n : ℕ, x i = 1 / ((n : ℝ) + 1)}

theorem positiveCarrier_subset

TopologyByExample.CompleteErdos.positiveCarrier_subset

Positive reciprocal sequences satisfy the closed coordinate restriction.

theorem positiveCarrier_subset : positiveCarrier ⊆ carrier
Proof
:= by
  intro x hx i
  obtain ⟨n, hn⟩ := hx i
  exact Or.inr ⟨n, hn.symm⟩

definition geometric

TopologyByExample.CompleteErdos.geometric

A fixed square-summable sequence of positive reciprocals.

def geometric : Ambient
Definition
:= ⟨fun i ↦ (1 / 2 : ℝ) ^ i, by
  have h : Memℓp (fun i : ℕ ↦ (1 / 2 : ℝ) ^ i) 1 := by
    apply memℓp_gen
    simpa using summable_geometric_of_norm_lt_one (by norm_num : ‖(1 / 2 : ℝ)‖ < 1)
  exact h.of_exponent_ge (by norm_num)⟩

theorem scaled_geometric_mem

TopologyByExample.CompleteErdos.scaled_geometric_mem

Dividing the geometric sequence by a positive integer preserves positive reciprocals.

theorem scaled_geometric_mem (k : ℕ) :
    (1 / ((k : ℝ) + 1)) • geometric ∈ positiveCarrier
Proof
:= by
  intro i
  let m : ℕ := (k + 1) * 2 ^ i
  have hm : 0 < m := by dsimp [m]; positivity
  refine ⟨m - 1, ?_⟩
  have he : ((m - 1 : ℕ) : ℝ) + 1 = (k + 1 : ℝ) * 2 ^ i := by
    simp [Nat.cast_sub hm, m]
  simp [geometric, lp.coeFn_smul, he, one_div, inv_pow, mul_comm]

definition positiveApproximation

TopologyByExample.CompleteErdos.positiveApproximation

Fill only the zero coordinates with a small positive geometric sequence.

def positiveApproximation (x : CompleteErdos) (k : ℕ) : Ambient
Definition
:=
  x.val + ⟨fun i ↦ if x.val i = 0 then ((1 / ((k : ℝ) + 1)) • geometric) i else 0,
    (lp.memℓp ((1 / ((k : ℝ) + 1)) • geometric)).mono' fun i ↦ by
      split_ifs
      · exact le_rfl
      · exact by simpa only [norm_zero] using norm_nonneg _⟩

theorem positiveApproximation_mem

TopologyByExample.CompleteErdos.positiveApproximation_mem

Every approximation has strictly positive reciprocal coordinates.

theorem positiveApproximation_mem (x : CompleteErdos) (k : ℕ) :
    positiveApproximation x k ∈ positiveCarrier
Proof
:= by
  intro i
  change ∃ n : ℕ, x.val i + (if x.val i = 0 then
    ((1 / ((k : ℝ) + 1)) • geometric) i else 0) = 1 / ((n : ℝ) + 1)
  by_cases hi : x.val i = 0
  · simpa only [hi, ite_true, zero_add] using scaled_geometric_mem k i
  · obtain h | ⟨n, hn⟩ := x.property i
    · exact (hi h).elim
    · exact ⟨n, by simpa only [ite_eq_right hi, add_zero] using hn.symm⟩

theorem norm_positiveApproximation_sub_le

TopologyByExample.CompleteErdos.norm_positiveApproximation_sub_le

The modification has norm bounded by that of the scaled geometric sequence.

theorem norm_positiveApproximation_sub_le (x : CompleteErdos) (k : ℕ) :
    ‖positiveApproximation x k - x.val‖ ≤ ‖(1 / ((k : ℝ) + 1)) • geometric‖
Proof
:= by
  apply lp.norm_mono (by norm_num)
  intro i
  by_cases hi : x.val i = 0
  · simp [positiveApproximation, hi]
  · simp only [positiveApproximation, lp.coeFn_add, lp.coeFn_sub, Pi.add_apply,
      Pi.sub_apply, ite_eq_right hi, add_zero, sub_self, norm_zero]
    exact norm_nonneg _

theorem tendsto_positiveApproximation

TopologyByExample.CompleteErdos.tendsto_positiveApproximation

The strictly positive approximations converge to the original point in norm.

theorem tendsto_positiveApproximation (x : CompleteErdos) :
    Tendsto (positiveApproximation x) atTop (𝓝 x.val)
Proof
:= by
  apply tendsto_iff_norm_sub_tendsto_zero.mpr
  apply squeeze_zero (fun k ↦ norm_nonneg _) (norm_positiveApproximation_sub_le x)
  have h := (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).smul_const geometric
  simpa using h.norm

theorem closure_positiveCarrier

TopologyByExample.CompleteErdos.closure_positiveCarrier

The coordinate-restricted model is exactly the closure in Erdős's definition.

theorem closure_positiveCarrier : closure positiveCarrier = carrier
Proof
:= by
  apply Subset.antisymm
  · exact closure_minimal positiveCarrier_subset isClosed_carrier
  · intro x hx
    exact mem_closure_of_tendsto (tendsto_positiveApproximation ⟨x, hx⟩)
      (.of_forall fun k ↦ positiveApproximation_mem ⟨x, hx⟩ k)

On this site: Complete Erdős space: The positive reciprocal-coordinate closure

theorem dense_positiveCarrier

TopologyByExample.CompleteErdos.dense_positiveCarrier

Positive reciprocal sequences are dense also in the relative topology.

theorem dense_positiveCarrier : Dense {x : CompleteErdos | x.val ∈ positiveCarrier}
Proof
:= by
  intro x
  let u : ℕ → CompleteErdos := fun k ↦
    ⟨positiveApproximation x k, positiveCarrier_subset (positiveApproximation_mem x k)⟩
  have hu : Tendsto u atTop (𝓝 x) := tendsto_subtype_rng.mpr (tendsto_positiveApproximation x)
  exact mem_closure_of_tendsto hu (.of_forall fun k ↦ positiveApproximation_mem x k)

theorem not_isOpen_singleton

TopologyByExample.CompleteErdos.not_isOpen_singleton

No singleton is open: an isolated point would be both finitely supported and positive.

theorem not_isOpen_singleton (x : CompleteErdos) : ¬IsOpen ({x} : Set CompleteErdos)
Proof
:= by
  intro hx
  have hp := dense_positiveCarrier.mem_of_isOpen_singleton hx
  obtain ⟨n, hn⟩ := mem_iUnion.mp (dense_finiteStages.mem_of_isOpen_singleton hx)
  obtain ⟨m, hm⟩ := hp n
  have hz := hn n le_rfl
  have hpos : 0 < 1 / ((m : ℝ) + 1) := by positivity
  rw [hz] at hm
  exact (ne_of_gt hpos) hm.symm

On this site: Complete Erdős space: Absence of isolated points

instance

instance : PerfectSpace CompleteErdos
Proof
:= by
  rw [perfectSpace_iff_forall_not_isolated]
  intro x
  exact ⟨fun h ↦ not_isOpen_singleton x ((isOpen_singleton_iff_punctured_nhds x).mpr h)⟩