Lean library · module TopologyByExample.Spaces.NovakInvolution

The adjacent-integer involution on beta N

Source file

The natural number n represents the book's positive integer n + 1.

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 swap

TopologyByExample.NovakInvolution.swap

Swap adjacent natural numbers, starting with zero and one.

def swap (n : ℕ) : ℕ
:= if n % 2 = 0 then n + 1 else n - 1

theorem swap_involutive

TopologyByExample.NovakInvolution.swap_involutive

Swapping adjacent integers twice gives the original integer.

theorem swap_involutive : Function.Involutive swap
Proof
:= by
  intro n
  simp only [swap]
  split_ifs <;> omega

theorem swap_even

TopologyByExample.NovakInvolution.swap_even

Adjacent-integer swapping changes parity.

theorem swap_even (n : ℕ) : swap n % 2 = 0 ↔ n % 2 ≠ 0
Proof
:= by
  simp only [swap]
  split_ifs <;> omega

definition extension

TopologyByExample.NovakInvolution.extension

The extension of adjacent-integer swapping to ultrafilters.

def extension : Ultrafilter ℕ → Ultrafilter ℕ
:= Ultrafilter.map swap

theorem continuous_map

TopologyByExample.NovakInvolution.continuous_map

Pushforward along any map is continuous on the spaces of ultrafilters.

theorem continuous_map {α β : Type*} (f : α → β) :
    Continuous (Ultrafilter.map f)
Proof
:= by
  apply ultrafilterBasis_is_basis.continuous_iff.mpr
  rintro _ ⟨s, rfl⟩
  exact ultrafilter_isOpen_basic (f ⁻¹' s)

theorem continuous_extension

TopologyByExample.NovakInvolution.continuous_extension

The extended swap is continuous.

theorem continuous_extension : Continuous extension
Proof
:= continuous_map swap

theorem extension_pure

TopologyByExample.NovakInvolution.extension_pure

The extension agrees with adjacent-integer swapping on principal ultrafilters.

theorem extension_pure (n : ℕ) : extension (pure n) = pure (swap n)
Proof
:=
  Ultrafilter.map_pure _ _

theorem extension_involutive

TopologyByExample.NovakInvolution.extension_involutive

The extended swap is an involution.

theorem extension_involutive : Function.Involutive extension
Proof
:= by
  intro u
  simp only [extension, Ultrafilter.map_map]
  have h : swap ∘ swap = id := funext swap_involutive
  rw [h, Ultrafilter.map_id]

theorem extension_ne

TopologyByExample.NovakInvolution.extension_ne

No ultrafilter is fixed by the extended swap.

theorem extension_ne (u : Ultrafilter ℕ) : extension u ≠ u
Proof
:= by
  intro he
  let E : Set ℕ := {n | n % 2 = 0}
  have hp : swap ⁻¹' E = Eᶜ := by
    ext n
    exact swap_even n
  have hm : E ∈ u ↔ Eᶜ ∈ u := by
    conv_lhs => rw [← he]
    change swap ⁻¹' E ∈ u ↔ Eᶜ ∈ u
    rw [hp]
  have hn : E ∈ u ↔ E ∉ u := hm.trans Ultrafilter.compl_mem_iff_notMem
  by_cases h : E ∈ u
  · exact hn.mp h h
  · exact h (hn.mpr h)

definition homeomorph

TopologyByExample.NovakInvolution.homeomorph

The extended swap as a self-homeomorphism of beta N.

def homeomorph : Ultrafilter ℕ ≃ₜ Ultrafilter ℕ
Definition
where
  toFun := extension
  invFun := extension
  left_inv := extension_involutive
  right_inv := extension_involutive
  continuous_toFun := continuous_extension
  continuous_invFun := continuous_extension