Lean library · module TopologyByExample.Spaces.DuncanSparse

Sparse points of Duncan'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

theorem countBelow_le_sqrt

TopologyByExample.DuncanSpace.countBelow_le_sqrt

Quadratic growth bounds the counting function by the square root.

theorem countBelow_le_sqrt (x : ℕ → ℕ) (hx : ∀ i, (i + 1) ^ 2 ≤ x i) (n : ℕ) :
    sequenceCountBelow x n ≤ Nat.sqrt n
Proof
:= by
  classical
  have hs : (Finset.range n).filter (fun k ↦ k ∈ range x) ⊆
      (Finset.range (Nat.sqrt n)).image x := by
    intro k hk
    obtain ⟨hkn, i, rfl⟩ := Finset.mem_filter.mp hk
    apply Finset.mem_image.mpr
    refine ⟨i, Finset.mem_range.mpr ?_, rfl⟩
    have hi : i + 1 ≤ Nat.sqrt n := Nat.le_sqrt'.mpr ((hx i).trans (by
      exact Nat.le_of_lt (Finset.mem_range.mp hkn)))
    omega
  exact (Finset.card_le_card hs).trans ((Finset.card_image_le).trans (by simp))

theorem density_zero_of_quadratic

TopologyByExample.DuncanSpace.density_zero_of_quadratic

A sequence growing at least quadratically has asymptotic density zero.

theorem density_zero_of_quadratic (x : ℕ → ℕ) (hx : ∀ i, (i + 1) ^ 2 ≤ x i) :
    Tendsto (fun n : ℕ ↦ (sequenceCountBelow x n : ℝ) / n) atTop (𝓝 0)
Proof
:= by
  have hlim : Tendsto (fun n : ℕ ↦ (Real.sqrt (n : ℝ))⁻¹) atTop (𝓝 0) :=
    tendsto_inv_atTop_zero.comp (Real.tendsto_sqrt_atTop.comp tendsto_natCast_atTop_atTop)
  apply squeeze_zero (fun _ ↦ by positivity) (fun n ↦ ?_) hlim
  have hsq : (Nat.sqrt n : ℝ) ≤ Real.sqrt (n : ℝ) := by
    apply (Real.le_sqrt (by positivity) (by positivity)).mpr
    exact_mod_cast Nat.sqrt_le' n
  have hc0 : (sequenceCountBelow x n : ℝ) ≤ (Nat.sqrt n : ℝ) := by
    exact_mod_cast countBelow_le_sqrt x hx n
  have hc := hc0.trans hsq
  calc
    (sequenceCountBelow x n : ℝ) / n ≤ Real.sqrt (n : ℝ) / n :=
      div_le_div_of_nonneg_right hc (Nat.cast_nonneg n)
    _ = _ := Real.sqrt_div_self

On this site: Duncan's space: Quadratic growth gives density zero

definition sparseAbove

TopologyByExample.DuncanSpace.sparseAbove

An increasing sparse sequence above any prescribed coordinate bounds.

def sparseAbove (b : ℕ → ℕ) : ℕ → ℕ
  | 0 => max 1 (b 0 + 1)
  | n + 1 => max (sparseAbove b n + 1) (max ((n + 2) ^ 2) (b (n + 1) + 1))

theorem strictMono_sparseAbove

TopologyByExample.DuncanSpace.strictMono_sparseAbove

The sparse diagonal sequence is strictly increasing.

theorem strictMono_sparseAbove (b : ℕ → ℕ) : StrictMono (sparseAbove b)
Proof
:= by
  apply strictMono_nat_of_lt_succ
  intro n
  exact (Nat.lt_succ_self _).trans_le (le_max_left _ _)

theorem quadratic_sparseAbove

TopologyByExample.DuncanSpace.quadratic_sparseAbove

The sparse diagonal sequence grows quadratically.

theorem quadratic_sparseAbove (b : ℕ → ℕ) (n : ℕ) : (n + 1) ^ 2 ≤ sparseAbove b n
Proof
:= by
  cases n with
  | zero => simp [sparseAbove]
  | succ n => exact (le_max_left _ _).trans (le_max_right _ _)

theorem bound_sparseAbove

TopologyByExample.DuncanSpace.bound_sparseAbove

The sparse diagonal sequence exceeds each prescribed bound.

theorem bound_sparseAbove (b : ℕ → ℕ) (n : ℕ) : b n < sparseAbove b n
Proof
:= by
  cases n with
  | zero => exact (Nat.lt_succ_self _).trans_le (le_max_right _ _)
  | succ n =>
    exact (Nat.lt_succ_self _).trans_le ((le_max_right _ _).trans (le_max_right _ _))

definition sparsePoint

TopologyByExample.DuncanSpace.sparsePoint

A point of density zero exceeding arbitrary coordinate bounds.

def sparsePoint (b : ℕ → ℕ) : DuncanSpace
Definition
:=
  ⟨(sparseAbove b, 0), strictMono_sparseAbove b, fun n ↦ by
    have h := quadratic_sparseAbove b n
    dsimp
    exact (pow_pos (by omega : 0 < n + 1) 2).trans_le h,
    density_zero_of_quadratic _ (quadratic_sparseAbove b)⟩

theorem not_sigmaCompactSpace

TopologyByExample.DuncanSpace.not_sigmaCompactSpace

Duncan's space is not sigma compact.

theorem not_sigmaCompactSpace : ¬SigmaCompactSpace DuncanSpace
Proof
:= by
  classical
  intro h
  let := h
  have hb (n : ℕ) : ∃ b : ℕ, ∀ z ∈ compactCovering DuncanSpace n, z.val.1 n ≤ b := by
    obtain ⟨b, hb⟩ := ((isCompact_compactCovering DuncanSpace n).image
      ((continuous_apply n).comp continuous_sequence)).finite_of_discrete.bddAbove
    exact ⟨b, fun z hz ↦ hb (mem_image_of_mem _ hz)⟩
  choose b hb using hb
  obtain ⟨n, hn⟩ := exists_mem_compactCovering (sparsePoint b)
  have hle := hb n _ hn
  exact (not_lt_of_ge hle) (bound_sparseAbove b n)

On this site: Duncan's space is not σ-compact

definition binaryCode

TopologyByExample.DuncanSpace.binaryCode

A binary sequence coded by small changes to a quadratic sequence.

def binaryCode (b : ℕ → Bool) (n : ℕ) : ℕ
:= (n + 1) ^ 2 + (b n).toNat

theorem strictMono_binaryCode

TopologyByExample.DuncanSpace.strictMono_binaryCode

Binary coding gives a strictly increasing sequence.

theorem strictMono_binaryCode (b : ℕ → Bool) : StrictMono (binaryCode b)
Proof
:= by
  apply strictMono_nat_of_lt_succ
  intro n
  dsimp [binaryCode]
  cases b n <;> cases b (n + 1) <;>
    simp only [Bool.toNat_false, Bool.toNat_true, pow_two, Nat.mul_add, Nat.add_mul,
      Nat.mul_one, Nat.one_mul] <;> omega

definition binaryPoint

TopologyByExample.DuncanSpace.binaryPoint

The binary code has density zero and determines a point of Duncan's space.

def binaryPoint (b : ℕ → Bool) : DuncanSpace
Definition
:=
  ⟨(binaryCode b, 0), strictMono_binaryCode b, fun n ↦ by
    dsimp [binaryCode]
    have hp : 0 < (n + 1) ^ 2 := pow_pos (by omega) _
    omega, density_zero_of_quadratic _ (fun _ ↦ Nat.le_add_right _ _)⟩

theorem binaryPoint_injective

TopologyByExample.DuncanSpace.binaryPoint_injective

Different binary sequences give different points.

theorem binaryPoint_injective : Function.Injective binaryPoint
Proof
:= by
  intro b c h
  funext n
  have he := congrArg (fun z : DuncanSpace ↦ z.val.1 n) h
  change (n + 1) ^ 2 + (b n).toNat = (n + 1) ^ 2 + (c n).toNat at he
  cases hbn : b n <;> cases hcn : c n <;> simp_all

theorem cardinalityContinuum

TopologyByExample.DuncanSpace.cardinalityContinuum

Duncan's space has cardinality continuum.

theorem cardinalityContinuum : CardinalityContinuum DuncanSpace
Proof
:= by
  apply le_antisymm cardinal_mk_le_continuum_of_secondCountable_t0
  have h := Cardinal.mk_le_of_injective binaryPoint_injective
  rw [Cardinal.mk_arrow, Cardinal.mk_bool, Cardinal.mk_nat, Cardinal.lift_aleph0,
    Cardinal.lift_ofNat, Cardinal.two_power_aleph0] at h
  exact h

On this site: Duncan's space has cardinality equal to \(\mathfrak{c}\)