Lean library · module TopologyByExample.Spaces.OddEven

The odd–even topology and the deleted integer topology

Source file

The odd–even topology on ℕ is the partition topology of the pairs {2k, 2k + 1}: a set is open if and only if, with any number, it contains the other member of its pair. It is the topology induced from the discrete topology by n ↦ n / 2.

The space appears in the grid as the product of the countably infinite discrete space ℕ with the two-point indiscrete space; this file proves that the two are homeomorphic, by (k, b) ↦ 2k + b.

The deleted integer topology on ℝ \ ℤ is likewise a partition topology, that of the intervals (n, n + 1): it is induced from the discrete ℤ by x ↦ ⌊x⌋, and it is homeomorphic to the product of the discrete ℤ with the indiscrete topology on (0, 1), by x ↦ (⌊x⌋, x - ⌊x⌋).

Main definitions

Main statements

Tags

odd–even topology, deleted integer topology, partition topology

This file was written by Claude (Anthropic's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.

Imports

definition oddEvenTopology

TopologyByExample.oddEvenTopology

The odd–even topology on ℕ, induced from the discrete topology by n ↦ n / 2: its open sets are the unions of pairs {2k, 2k + 1}.

@[instance_reducible]
def oddEvenTopology : TopologicalSpace ℕ
:=
  .induced (· / 2) inferInstance

theorem isOpen_oddEvenTopology_iff

TopologyByExample.isOpen_oddEvenTopology_iff

A set is open in the odd–even topology if and only if, whenever it contains a number, it contains the other member of its pair {2k, 2k + 1}.

theorem isOpen_oddEvenTopology_iff {s : Set ℕ} :
    IsOpen[oddEvenTopology] s ↔ ∀ m n, m / 2 = n / 2 → m ∈ s → n ∈ s
Proof
:= by
  constructor
  · rintro ⟨t, -, rfl⟩ m n hmn hm
    simpa [mem_preimage, ← hmn] using hm
  · intro h
    refine ⟨(· / 2) '' s, isOpen_discrete _, ?_⟩
    ext n
    exact ⟨fun ⟨m, hm, hmn⟩ ↦ h m n hmn hm, fun hn ↦ ⟨n, hn, rfl⟩⟩

definition oddEvenHomeomorph

TopologyByExample.oddEvenHomeomorph

The product of the discrete space ℕ with the two-point indiscrete space is homeomorphic to ℕ with the odd–even topology, by (k, b) ↦ 2k + b.

def oddEvenHomeomorph : ℕ × WithTopology Bool ⊤ ≃ₜ WithTopology ℕ oddEvenTopology
Definition
where
  toEquiv := ((Equiv.prodCongr (Equiv.refl ℕ) (WithTopology.equiv Bool ⊤)).trans
    (Equiv.prodComm _ _)).trans (Equiv.boolProdNatEquivNat.trans (WithTopology.equiv _ _).symm)
  continuous_toFun := by
    have hg : Continuous[_, oddEvenTopology]
        fun p : ℕ × WithTopology Bool ⊤ ↦ Nat.bit (WithTopology.ofTopology p.2) p.1 := by
      refine continuous_induced_rng.2 ?_
      have : (fun p : ℕ × WithTopology Bool ⊤ ↦
          Nat.bit (WithTopology.ofTopology p.2) p.1 / 2) = Prod.fst := by
        ext p; exact Nat.bit_div_two _ _
      simpa [Function.comp_def, this] using continuous_fst
    exact @Continuous.comp _ _ _ _ oddEvenTopology _ _ _
      (WithTopology.continuous_toTopology oddEvenTopology) hg
  continuous_invFun := by
    refine Continuous.prodMk ?_ ?_
    · exact (@Continuous.comp _ _ _ _ oddEvenTopology _ _ _ continuous_induced_dom
        (WithTopology.continuous_ofTopology oddEvenTopology)).congr
          fun n ↦ (Nat.div2_val _).symm
    · exact @Continuous.comp _ _ _ _ ⊤ _ _ _ (WithTopology.continuous_toTopology ⊤) continuous_top

theorem nonempty_homeomorph_oddEvenTopology

TopologyByExample.nonempty_homeomorph_oddEvenTopology

The product of the discrete space ℕ with the two-point indiscrete space is homeomorphic to ℕ with the odd–even topology.

theorem nonempty_homeomorph_oddEvenTopology :
    Nonempty (ℕ × WithTopology Bool ⊤ ≃ₜ WithTopology ℕ oddEvenTopology)
Proof
:=
  ⟨oddEvenHomeomorph⟩

On this site: Odd–even topology: The partition topology of the pairs \(\{2k, 2k + 1\}\)

The deleted integer topology

definition Carrier

TopologyByExample.DeletedInteger.Carrier

The real numbers that are not integers.

abbrev Carrier : Type
:= {x : ℝ // x ∉ range ((↑) : ℤ → ℝ)}

theorem fract_pos

TopologyByExample.DeletedInteger.fract_pos

A real number that is not an integer has positive fractional part.

theorem fract_pos (x : Carrier) : 0 < Int.fract (x : ℝ)
Proof
:=
  Int.fract_pos.2 fun h ↦ x.property ⟨_, h.symm⟩

definition equiv

TopologyByExample.DeletedInteger.equiv

x ↦ (⌊x⌋, x - ⌊x⌋), a bijection from ℝ \ ℤ onto ℤ × (0, 1).

noncomputable def equiv : Carrier ≃ ℤ × Ioo (0 : ℝ) 1
Definition
where
  toFun x := (⌊(x : ℝ)⌋, ⟨Int.fract (x : ℝ), fract_pos x, Int.fract_lt_one _⟩)
  invFun p := ⟨p.1 + p.2, by
    rintro ⟨m, hm⟩
    have h := Int.fract_intCast (R := ℝ) m
    rw [hm, Int.fract_intCast_add, Int.fract_eq_self.2 ⟨p.2.property.1.le, p.2.property.2⟩] at h
    exact p.2.property.1.ne' h⟩
  left_inv x := Subtype.ext (Int.floor_add_fract _)
  right_inv := by
    rintro ⟨n, t, ht₀, ht₁⟩
    have hf : Int.fract t = t := Int.fract_eq_self.2 ⟨ht₀.le, ht₁⟩
    have hfl : ⌊t⌋ = 0 := Int.floor_eq_zero_iff.2 ⟨ht₀.le, ht₁⟩
    ext
    · simp [Int.floor_intCast_add, hfl]
    · simp [Int.fract_intCast_add, hf]

definition deletedIntegerTopology

TopologyByExample.deletedIntegerTopology

The deleted integer topology on ℝ \ ℤ: the partition topology of the intervals (n, n + 1), induced from the discrete ℤ by x ↦ ⌊x⌋.

@[instance_reducible]
noncomputable def deletedIntegerTopology : TopologicalSpace DeletedInteger.Carrier
:=
  .induced (fun x ↦ ⌊(x : ℝ)⌋) inferInstance

theorem isOpen_deletedIntegerTopology_iff

TopologyByExample.isOpen_deletedIntegerTopology_iff

A set is open in the deleted integer topology if and only if, with any point, it contains every point of the same interval (n, n + 1).

theorem isOpen_deletedIntegerTopology_iff {s : Set DeletedInteger.Carrier} :
    IsOpen[deletedIntegerTopology] s ↔
      ∀ x y : DeletedInteger.Carrier, ⌊(x : ℝ)⌋ = ⌊(y : ℝ)⌋ → x ∈ s → y ∈ s
Proof
:= by
  constructor
  · rintro ⟨t, -, rfl⟩ x y hxy hx
    simpa [mem_preimage, ← hxy] using hx
  · intro h
    refine ⟨(fun x : DeletedInteger.Carrier ↦ ⌊(x : ℝ)⌋) '' s, isOpen_discrete _, ?_⟩
    ext y
    exact ⟨fun ⟨x, hx, hxy⟩ ↦ h x y hxy hx, fun hy ↦ ⟨y, hy, rfl⟩⟩

theorem nonempty_homeomorph_deletedIntegerTopology

TopologyByExample.nonempty_homeomorph_deletedIntegerTopology

The deleted integer topology on ℝ \ ℤ is homeomorphic to the product of the discrete space ℤ with the indiscrete topology on (0, 1).

theorem nonempty_homeomorph_deletedIntegerTopology :
    Nonempty (WithTopology DeletedInteger.Carrier deletedIntegerTopology ≃ₜ
      ℤ × WithTopology (Ioo (0 : ℝ) 1) ⊤)
Proof
:=
  ⟨homeomorphProdOfIndiscrete (fun x : DeletedInteger.Carrier ↦ ⌊(x : ℝ)⌋)
    (DeletedInteger.equiv.trans <| Equiv.prodCongr (Equiv.refl ℤ) (WithTopology.equiv _ ⊤).symm)
    fun _ ↦ rfl⟩

On this site: Odd–even topology: The deleted integer topology

On this site: Space: Odd–even topology