Lean library · module TopologyByExample.Spaces.ErdosBoundary

The recursive boundary construction for 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 BoundaryState

TopologyByExample.CompleteErdos.BoundaryState

A point inside the neighbourhood with its tail still zero.

def BoundaryState (U : Set CompleteErdos) (n : ℕ)
:= {x : CompleteErdos //
  x ∈ U ∧ x ∈ finiteStage n}

definition boundaryIndex

TopologyByExample.CompleteErdos.boundaryIndex

The reciprocal index selected at a state.

def boundaryIndex {U : Set CompleteErdos} (hU : IsOpen U)
    (hb : ∀ x ∈ U, ‖x.val‖ < 1) (n : ℕ) (s : BoundaryState U n) : ℕ
:=
  Classical.choose (exists_boundary_step hU hb s.val s.property.1 n (s.property.2 n le_rfl))

theorem boundaryIndex_spec

TopologyByExample.CompleteErdos.boundaryIndex_spec

The chosen reciprocal lies inside; its predecessor lies outside.

theorem boundaryIndex_spec {U : Set CompleteErdos} (hU : IsOpen U)
    (hb : ∀ x ∈ U, ‖x.val‖ < 1) (n : ℕ) (s : BoundaryState U n) :
    0 < boundaryIndex hU hb n s ∧
    insertReciprocal s.val n (s.property.2 n le_rfl) (boundaryIndex hU hb n s) ∈ U ∧
    insertReciprocal s.val n (s.property.2 n le_rfl) (boundaryIndex hU hb n s - 1) ∉ U
Proof
:=
  Classical.choose_spec (exists_boundary_step hU hb s.val s.property.1 n
    (s.property.2 n le_rfl))

definition boundaryNext

TopologyByExample.CompleteErdos.boundaryNext

Advance by filling the next zero coordinate.

def boundaryNext {U : Set CompleteErdos} (hU : IsOpen U)
    (hb : ∀ x ∈ U, ‖x.val‖ < 1) (n : ℕ) (s : BoundaryState U n) :
    BoundaryState U (n + 1)
Definition
:=
  ⟨insertReciprocal s.val n (s.property.2 n le_rfl) (boundaryIndex hU hb n s),
    (boundaryIndex_spec hU hb n s).2.1, by
      intro i hi
      rw [insertReciprocal_away _ _ _ _ _ (by omega)]
      exact s.property.2 i (by omega)⟩

definition boundaryStates

TopologyByExample.CompleteErdos.boundaryStates

The increasing sequence obtained by successive coordinate choices.

def boundaryStates {U : Set CompleteErdos} (hU : IsOpen U)
    (hb : ∀ x ∈ U, ‖x.val‖ < 1) (hzero : origin ∈ U) : ∀ n, BoundaryState U n
  | 0 => ⟨origin, hzero, fun _ _ ↦ rfl⟩
  | n + 1 => boundaryNext hU hb n (boundaryStates hU hb hzero n)

theorem coordinate_nonneg

TopologyByExample.CompleteErdos.coordinate_nonneg

Every coordinate in the model is nonnegative.

theorem coordinate_nonneg (x : CompleteErdos) (i : ℕ) : 0 ≤ x.val i
Proof
:= by
  obtain h | ⟨n, hn⟩ := x.property i
  · exact h ▸ le_rfl
  · rw [← hn]; positivity

theorem boundaryStates_monotone

TopologyByExample.CompleteErdos.boundaryStates_monotone

The recursive sequence increases coordinatewise.

theorem boundaryStates_monotone {U : Set CompleteErdos} (hU : IsOpen U)
    (hb : ∀ x ∈ U, ‖x.val‖ < 1) (hzero : origin ∈ U) (i : ℕ) :
    Monotone (fun n ↦ (boundaryStates hU hb hzero n).val.val i)
Proof
:= by
  apply monotone_nat_of_le_succ
  intro n
  change (boundaryStates hU hb hzero n).val.val i ≤
    (insertReciprocal (boundaryStates hU hb hzero n).val n
      ((boundaryStates hU hb hzero n).property.2 n le_rfl)
      (boundaryIndex hU hb n (boundaryStates hU hb hzero n))).val i
  by_cases hi : i = n
  · subst i
    rw [insertReciprocal_at, (boundaryStates hU hb hzero n).property.2 n le_rfl]
    positivity
  · rw [insertReciprocal_away _ _ _ _ _ hi]

theorem boundaryStates_converge

TopologyByExample.CompleteErdos.boundaryStates_converge

The recursive sequence converges in the norm topology.

theorem boundaryStates_converge {U : Set CompleteErdos} (hU : IsOpen U)
    (hb : ∀ x ∈ U, ‖x.val‖ < 1) (hzero : origin ∈ U) :
    ∃ x : CompleteErdos,
      Tendsto (fun n ↦ (boundaryStates hU hb hzero n).val) atTop (𝓝 x) ∧
      (∀ n i, (boundaryStates hU hb hzero n).val.val i ≤ x.val i)
Proof
:= by
  obtain ⟨x, hx, _, _, hle⟩ := exists_limit_of_monotone_bounded
    (fun n ↦ (boundaryStates hU hb hzero n).val.val)
    (fun n i ↦ coordinate_nonneg _ i) (boundaryStates_monotone hU hb hzero)
    1 (fun n ↦ (hb _ (boundaryStates hU hb hzero n).property.1).le)
  have hxc : x ∈ carrier := isClosed_carrier.mem_of_tendsto hx
    (.of_forall fun n ↦ (boundaryStates hU hb hzero n).val.property)
  exact ⟨⟨x, hxc⟩, tendsto_subtype_rng.mpr hx, hle⟩

definition boundaryOutside

TopologyByExample.CompleteErdos.boundaryOutside

The adjacent point excluded by minimality at the next coordinate.

def boundaryOutside {U : Set CompleteErdos} (hU : IsOpen U)
    (hb : ∀ x ∈ U, ‖x.val‖ < 1) (hzero : origin ∈ U) (n : ℕ) : CompleteErdos
Definition
:=
  insertReciprocal (boundaryStates hU hb hzero n).val n
    ((boundaryStates hU hb hzero n).property.2 n le_rfl)
    (boundaryIndex hU hb n (boundaryStates hU hb hzero n) - 1)

theorem reciprocal_gap_bound

TopologyByExample.CompleteErdos.reciprocal_gap_bound

The adjacent reciprocal gap is at most twice the smaller reciprocal.

theorem reciprocal_gap_bound (d : ℕ) (hd : 0 < d) :
Proof
    |1 / (d : ℝ) - 1 / ((d : ℝ) + 1)| ≤ 2 * (1 / ((d : ℝ) + 1)) := by
  have hd' : (0 : ℝ) < d := by exact_mod_cast hd
  have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast hd
  have hle : 1 / ((d : ℝ) + 1) ≤ 1 / (d : ℝ) :=
    one_div_le_one_div_of_le hd' (by linarith)
  rw [abs_of_nonneg (sub_nonneg.mpr hle)]
  have htwo : 1 / (d : ℝ) ≤ 2 / ((d : ℝ) + 1) :=
    (div_le_div_iff₀ hd' (by positivity)).mpr (by nlinarith)
  have hpos : 0 ≤ 1 / ((d : ℝ) + 1) := by positivity
  simp only [div_eq_mul_inv, one_mul] at *
  linarith

theorem boundaryOutside_converges

TopologyByExample.CompleteErdos.boundaryOutside_converges

The exterior sequence is asymptotically close to the interior sequence.

theorem boundaryOutside_converges {U : Set CompleteErdos} (hU : IsOpen U)
    (hb : ∀ x ∈ U, ‖x.val‖ < 1) (hzero : origin ∈ U) (x : CompleteErdos)
    (hx : Tendsto (fun n ↦ (boundaryStates hU hb hzero n).val) atTop (𝓝 x))
    (hle : ∀ n i, (boundaryStates hU hb hzero n).val.val i ≤ x.val i) :
    Tendsto (boundaryOutside hU hb hzero) atTop (𝓝 x)
Proof
:= by
  let d : ℕ → ℕ := fun n ↦ boundaryIndex hU hb n (boundaryStates hU hb hzero n)
  have hd : ∀ n, 0 < d n := fun n ↦
    (boundaryIndex_spec hU hb n (boundaryStates hU hb hzero n)).1
  let a : ℕ → ℝ := fun n ↦ 1 / (d n : ℝ) - 1 / ((d n : ℝ) + 1)
  have ha : Tendsto a atTop (𝓝 0) := by
    apply tendsto_zero_iff_norm_tendsto_zero.mpr
    apply squeeze_zero (fun n ↦ norm_nonneg _) (g := fun n ↦ 2 * x.val n)
    · intro n
      have hc := hle (n + 1) n
      change (insertReciprocal (boundaryStates hU hb hzero n).val n
        ((boundaryStates hU hb hzero n).property.2 n le_rfl) (d n)).val n ≤ x.val n at hc
      rw [insertReciprocal_at] at hc
      exact (reciprocal_gap_bound (d n) (hd n)).trans (by gcongr)
    · simpa using (tendsto_coordinate_zero x.val).const_mul 2
  have he : ∀ n, (boundaryOutside hU hb hzero n).val =
      (boundaryStates hU hb hzero (n + 1)).val.val + lp.single 2 n (a n) := by
    intro n
    have hc : ((d n - 1 : ℕ) : ℝ) + 1 = (d n : ℝ) := by
      rw [Nat.cast_sub (hd n)]
      simp
    apply lp.ext
    funext i
    change ((boundaryStates hU hb hzero n).val.val +
      lp.single 2 n (1 / (((d n - 1 : ℕ) : ℝ) + 1)) : Ambient) i =
      ((boundaryStates hU hb hzero n).val.val +
        lp.single 2 n (1 / ((d n : ℝ) + 1)) + lp.single 2 n (a n) : Ambient) i
    simp only [lp.coeFn_add, Pi.add_apply, lp.single_apply, hc]
    by_cases hi : i = n
    · subst i
      simp [a]
    · simp [Pi.single_eq_of_ne hi]
  apply tendsto_subtype_rng.mpr
  have hu := (continuous_subtypeVal.tendsto x).comp (hx.comp (tendsto_add_atTop_nat 1))
  have hv := hu.add (tendsto_single_zero a ha)
  simpa only [Function.comp_apply, ← he, add_zero] using hv

theorem no_small_clopen

TopologyByExample.CompleteErdos.no_small_clopen

The origin has no clopen neighbourhood contained in the norm unit ball.

theorem no_small_clopen {U : Set CompleteErdos} (hU : IsClopen U)
    (hzero : origin ∈ U) (hb : ∀ x ∈ U, ‖x.val‖ < 1) : False
Proof
:= by
  obtain ⟨x, hx, hle⟩ := boundaryStates_converge hU.isOpen hb hzero
  have hxin := hU.isClosed.mem_of_tendsto hx
    (.of_forall fun n ↦ (boundaryStates hU.isOpen hb hzero n).property.1)
  have hxout := hU.isOpen.isClosed_compl.mem_of_tendsto
    (boundaryOutside_converges hU.isOpen hb hzero x hx hle)
    (.of_forall fun n ↦ (boundaryIndex_spec hU.isOpen hb n
      (boundaryStates hU.isOpen hb hzero n)).2.2)
  exact hxout hxin

On this site: Complete Erdős space: The obstruction to a clopen basis

theorem not_zeroDimensionalSpace

TopologyByExample.CompleteErdos.not_zeroDimensionalSpace

Complete Erdős space is not zero-dimensional.

theorem not_zeroDimensionalSpace : ¬ZeroDimensionalSpace CompleteErdos
Proof
:= by
  intro h
  let := h
  have ho : IsOpen {x : CompleteErdos | ‖x.val‖ < 1} :=
    isOpen_lt continuous_subtypeVal.norm continuous_const
  obtain ⟨U, hU, hzero, hsub⟩ := exists_isClopen_mem_of_isOpen ho
    (show origin ∈ {x : CompleteErdos | ‖x.val‖ < 1} by simp [origin])
  exact no_small_clopen hU hzero (fun x hx ↦ hsub hx)

On this site: Complete Erdős space is not zero-dimensional