Lean library · module TopologyByExample.Theorems.SelectiveDiagonal

Diagonal selection from selectivity

Source file

The constant-or-injective definition gives pseudointersections and sufficiently spaced members. Together they give diagonal selection and the full finite partition characterization.

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 pseudointersection

TopologyByExample.UltrafilterProperties.IsSelective.pseudointersection

A selective ultrafilter has a member almost contained in every member of a specified countable family.

theorem IsSelective.pseudointersection {U : Ultrafilter ℕ} (hU : IsSelective U)
    (A : ℕ → Set ℕ) (hA : ∀ n, A n ∈ U) :
    ∃ H ∈ U, ∀ n, (H \ A n).Finite
Proof
:= by
  classical
  by_cases hC : (⋂ n, A n) ∈ U
  · refine ⟨⋂ n, A n, hC, fun n ↦ ?_⟩
    have he : (⋂ n, A n) \ A n = ∅ := by
      apply sdiff_eq_empty.mpr
      exact iInter_subset A n
    rw [he]
    exact finite_empty
  let f : ℕ → ℕ := fun a ↦ if h : ∃ n, a ∉ A n then Nat.find h else 0
  obtain ⟨H, hH, hconst | hinj⟩ := hU f
  · obtain ⟨k, hk⟩ := hconst
    obtain ⟨a, ⟨haH, haC⟩, haA⟩ := Ultrafilter.nonempty_of_mem
      (inter_mem (inter_mem hH (Ultrafilter.compl_mem_iff_notMem.mpr hC)) (hA k))
    have hex : ∃ n, a ∉ A n := by
      simpa only [mem_compl_iff, mem_iInter, not_forall] using haC
    have hfk : Nat.find hex = k := by simpa only [f, dite_eq_left hex] using hk a haH
    exact False.elim (Nat.find_spec hex (hfk ▸ haA))
  · refine ⟨H, hH, fun n ↦ (finite_Iic n).of_injOn (f := f) ?_ ?_⟩
    · intro a ha
      have hex : ∃ k, a ∉ A k := ⟨n, ha.2⟩
      simpa only [f, dite_eq_left hex, mem_Iic] using Nat.find_min' hex ha.2
    · exact hinj.mono sdiff_subset

theorem injOn_of_finite_fibres

TopologyByExample.UltrafilterProperties.IsSelective.injOn_of_finite_fibres

A selective free ultrafilter contains a set on which any finite-to-one map is injective.

theorem IsSelective.injOn_of_finite_fibres {U : Ultrafilter ℕ} (hU : IsSelective U)
    (hfree : (U : Filter ℕ) ≤ cofinite) (f : ℕ → ℕ)
    (hf : ∀ k, (f ⁻¹' {k}).Finite) : ∃ H ∈ U, InjOn f H
Proof
:= by
  obtain ⟨H, hH, hconst | hinj⟩ := hU f
  · obtain ⟨k, hk⟩ := hconst
    have hfin : H.Finite := (hf k).subset hk
    exact False.elim ((U : Filter ℕ).compl_notMem hH (hfree hfin.compl_mem_cofinite))
  · exact ⟨H, hH, hinj⟩

theorem spaced

TopologyByExample.UltrafilterProperties.IsSelective.spaced

A selective free ultrafilter has a member whose successive points exceed any prescribed natural-valued bound at the earlier point.

theorem IsSelective.spaced {U : Ultrafilter ℕ} (hU : IsSelective U)
    (hfree : (U : Filter ℕ) ≤ cofinite) (t : ℕ → ℕ) :
    ∃ H ∈ U, ∀ n ∈ H, ∀ m ∈ H, n < m → t n < m
Proof
:= by
  classical
  let g : ℕ → ℕ := Nat.rec 0 fun _ b ↦
    max (b + 1) ((Finset.range (b + 1)).sup t + 1)
  have hgs (k : ℕ) : g k < g (k + 1) := by
    exact lt_of_lt_of_le (Nat.lt_succ_self _) (le_max_left _ _)
  have hgm : StrictMono g := strictMono_nat_of_lt_succ hgs
  have hgge (k : ℕ) : k ≤ g k := hgm.id_le k
  have hgt (k n : ℕ) (hn : n ≤ g k) : t n < g (k + 1) :=
    lt_of_lt_of_le (Nat.lt_succ_of_le (Finset.le_sup (Finset.mem_range.mpr
      (Nat.lt_succ_of_le hn)))) (le_max_right _ _)
  have hex (n : ℕ) : ∃ k, n < g (k + 1) := ⟨n, lt_of_lt_of_le
    (Nat.lt_succ_self n) (hgge (n + 1))⟩
  let b (n : ℕ) : ℕ := Nat.find (hex n)
  have hbhi (n : ℕ) : n < g (b n + 1) := Nat.find_spec (hex n)
  have hblo (n : ℕ) : g (b n) ≤ n := by
    by_cases hb : b n = 0
    · simp [hb, g]
    · have hmin := Nat.find_min (hex n) (show b n - 1 < b n by omega)
      have he : b n - 1 + 1 = b n := by omega
      rw [he] at hmin
      exact le_of_not_gt hmin
  have hbfin (k : ℕ) : (b ⁻¹' {k}).Finite :=
    (finite_Iio (g (k + 1))).subset (fun n hn ↦ by
      simpa only [mem_preimage, mem_singleton_iff] using hn ▸ hbhi n)
  obtain ⟨H, hH, hbinj⟩ := hU.injOn_of_finite_fibres hfree b hbfin
  obtain ⟨i, hi⟩ := exists_constant_member (fun n ↦ (⟨b n % 2, Nat.mod_lt _ (by decide)⟩ : Fin 2))
  refine ⟨H ∩ {n | (⟨b n % 2, Nat.mod_lt _ (by decide)⟩ : Fin 2) = i},
    inter_mem hH hi, fun n hn m hm hnm ↦ ?_⟩
  have hbnm : b n < b m := by
    have hne : b n ≠ b m := fun he ↦ (ne_of_lt hnm) (hbinj hn.1 hm.1 he)
    by_contra hnot
    have hbmn : b m + 1 ≤ b n := by omega
    have := (hbhi m).trans_le ((hgm.monotone hbmn).trans (hblo n))
    omega
  have hmod : b n % 2 = b m % 2 := congrArg Fin.val (hn.2.trans hm.2.symm)
  have hgap : b n + 2 ≤ b m := by omega
  exact (hgt (b n + 1) n (hbhi n).le).trans_le
    ((hgm.monotone hgap).trans (hblo m))

theorem diagonalSelection

TopologyByExample.UltrafilterProperties.IsSelective.diagonalSelection

Selectivity implies diagonal selection.

theorem IsSelective.diagonalSelection {U : Ultrafilter ℕ} (hU : IsSelective U) :
    HasDiagonalSelection U
Proof
:= by
  classical
  rcases U.le_cofinite_or_eq_pure with hfree | ⟨p, rfl⟩
  · intro A hA
    obtain ⟨H, hH, hHA⟩ := hU.pseudointersection A hA
    have hbound (n : ℕ) : ∃ t : ℕ, ∀ m ∈ H \ A n, m ≤ t :=
      (hHA n).bddAbove
    choose t ht using hbound
    obtain ⟨K, hK, hKt⟩ := hU.spaced hfree t
    refine ⟨H ∩ K, inter_mem hH hK, fun n hn m hm hnm ↦ ?_⟩
    by_contra hma
    exact (not_lt_of_ge (ht n m ⟨hm.1, hma⟩)) (hKt n hn.2 m hm.2 hnm)
  · intro A _
    refine ⟨{p}, by simp, ?_⟩
    intro n hn m hm hnm
    simp only [mem_singleton_iff] at hn hm
    omega

theorem isSelective_iff_finiteRamsey

TopologyByExample.UltrafilterProperties.isSelective_iff_finiteRamsey

The function and finite partition definitions of selectivity agree.

theorem isSelective_iff_finiteRamsey (U : Ultrafilter ℕ) :
    IsSelective U ↔ HasFiniteRamseyProperty U
Proof
:=
  ⟨fun h ↦ h.diagonalSelection.finiteRamsey, fun h ↦ h.isSelective⟩

On this site: Theorem: Selectivity and finite partition properties