Lean library · module TopologyByExample.Spaces.DuncanInsertions

Inserting finite dense blocks into Duncan sequences

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 insertBlockSeq

TopologyByExample.DuncanSpace.insertBlockSeq

Keep a prefix, insert K consecutive integers, then resume a sufficiently late tail.

def insertBlockSeq (x : ℕ → ℕ) (N K i : ℕ) : ℕ
Definition
:=
  if i < N then x i
  else if i < N + K then x N + (i - N) + 1
  else x (i - (N + K) + (x N + K + 1))

theorem strictMono_insertBlockSeq

TopologyByExample.DuncanSpace.strictMono_insertBlockSeq

The block insertion sequence remains strictly increasing.

theorem strictMono_insertBlockSeq {x : ℕ → ℕ} (hx : StrictMono x) (N K : ℕ) :
    StrictMono (insertBlockSeq x N K)
Proof
:= by
  apply strictMono_nat_of_lt_succ
  intro i
  dsimp [insertBlockSeq]
  split_ifs with hi hj hik hjk
  · exact hx (Nat.lt_succ_self i)
  · have hle := hx.monotone (show i ≤ N by omega)
    omega
  · apply hx
    have hbase := hx.id_le N
    dsimp at hbase
    omega
  · omega
  · omega
  · have hlarge := hx.id_le ((i + 1) - (N + K) + (x N + K + 1))
    dsimp at hlarge
    omega
  · omega
  · omega
  · apply hx
    omega

theorem range_insertBlockSeq_agree_above

TopologyByExample.DuncanSpace.range_insertBlockSeq_agree_above

Inserting a finite block preserves all sufficiently large values.

theorem range_insertBlockSeq_agree_above {x : ℕ → ℕ} (hx : StrictMono x) (N K k : ℕ)
    (hk : x (x N + K + 1) ≤ k) : k ∈ range x ↔ k ∈ range (insertBlockSeq x N K)
Proof
:= by
  constructor
  · rintro ⟨i, rfl⟩
    have hi := hx.le_iff_le.mp hk
    refine ⟨N + K + (i - (x N + K + 1)), ?_⟩
    simp only [insertBlockSeq]
    split_ifs <;> try omega
    congr 1
    omega
  · rintro ⟨i, rfl⟩
    dsimp [insertBlockSeq] at hk ⊢
    split_ifs at hk ⊢ with hi hik
    · exact mem_range_self _
    · have hlarge := hx.id_le (x N + K + 1)
      dsimp at hlarge
      omega
    · exact mem_range_self _

definition insertBlock

TopologyByExample.DuncanSpace.insertBlock

Finite insertion as a point of Duncan's space with unchanged density.

def insertBlock (x : DuncanSpace) (N K : ℕ) : DuncanSpace
Definition
:= by
  refine ⟨(insertBlockSeq x.val.1 N K, x.val.2), strictMono_insertBlockSeq x.property.1 N K,
    ?_, ?_⟩
  · intro i
    dsimp [insertBlockSeq]
    split_ifs
    · exact x.property.2.1 _
    · omega
    · exact x.property.2.1 _
  · exact density_of_agree_above _ _ (x.val.1 (x.val.1 N + K + 1))
      (range_insertBlockSeq_agree_above x.property.1 N K) _ x.property.2.2

theorem tendsto_insertBlock

TopologyByExample.DuncanSpace.tendsto_insertBlock

Insertions beginning farther out converge back, whatever the block lengths.

theorem tendsto_insertBlock (x : DuncanSpace) (K : ℕ → ℕ) :
    Tendsto (fun N ↦ insertBlock x N (K N)) atTop (𝓝 x)
Proof
:= by
  apply tendsto_subtype_rng.mpr
  apply Filter.Tendsto.prodMk_nhds
  · apply tendsto_pi_nhds.mpr
    intro i
    apply tendsto_const_nhds.congr'
    filter_upwards [eventually_gt_atTop i] with N hN
    simp [insertBlockSeq, hN]
  · exact tendsto_const_nhds