Lean library · module TopologyByExample.Theorems.MathiasCones

Finite stems and selective fusion

Source file

Mathias cones consist of infinite subsets with a prescribed finite initial segment and a tail in an ultrafilter member. The fusion lemma gives simultaneous tail containment for all finite subsets of one selective-ultrafilter member.

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 fusion

TopologyByExample.UltrafilterProperties.IsSelective.fusion

Selective fusion for a family indexed by finite stems.

theorem IsSelective.fusion {U : Ultrafilter ℕ} (hU : IsSelective U)
    (A : Finset ℕ → Set ℕ) (hA : ∀ s, A s ∈ U) :
    ∃ H ∈ U, H ⊆ A ∅ ∧ ∀ s : Finset ℕ, (s : Set ℕ) ⊆ H →
      ∀ m ∈ H, s.sup Nat.succ ≤ m → m ∈ A s
Proof
:= by
  classical
  let B (n : ℕ) : Set ℕ := ⋂ s ∈ (Finset.range (n + 1)).powerset, A s
  have hB (n : ℕ) : B n ∈ U := by
    exact (Filter.biInter_finset_mem _).mpr (fun s _ ↦ hA s)
  obtain ⟨H, hH, hHB⟩ := hU.diagonalSelection B hB
  refine ⟨H ∩ A ∅, inter_mem hH (hA ∅), inter_subset_right, fun s hs m hm hsm ↦ ?_⟩
  rcases s.eq_empty_or_nonempty with he | hne
  · simpa only [he] using hm.2
  · let n := s.max' hne
    have hn : n ∈ s := Finset.max'_mem s hne
    have hnm : n < m := lt_of_lt_of_le
      (Nat.lt_succ_of_le (le_refl n)) ((Finset.le_sup hn).trans hsm)
    have hmB := hHB n (hs hn).1 m hm.1 hnm
    have hsB : s ∈ (Finset.range (n + 1)).powerset := by
      apply Finset.mem_powerset.mpr
      intro k hk
      exact Finset.mem_range.mpr (Nat.lt_succ_of_le (Finset.le_max' s k hk))
    exact mem_iInter₂.mp hmB s hsB

definition cut

TopologyByExample.Mathias.cut

The first possible tail coordinate after a finite stem.

def cut (s : Finset ℕ) : ℕ
:= s.sup Nat.succ

definition cone

TopologyByExample.Mathias.cone

An infinite subset with initial segment s and remaining elements in A.

def cone (s : Finset ℕ) (A : Set ℕ) : Set (Set ℕ)
:=
  {X | X.Infinite ∧ (s : Set ℕ) ⊆ X ∧ X ⊆ (s : Set ℕ) ∪ (A ∩ Ici (cut s))}

theorem lt_cut_of_mem

TopologyByExample.Mathias.lt_cut_of_mem

Every element of a finite stem lies below its cut.

theorem lt_cut_of_mem {s : Finset ℕ} {n : ℕ} (hn : n ∈ s) : n < cut s
Proof
:=
  lt_of_lt_of_le (Nat.lt_succ_self _) (Finset.le_sup hn)

theorem cut_insert

TopologyByExample.Mathias.cut_insert

Adjoining a point at or above the cut moves the cut just beyond that point.

theorem cut_insert {s : Finset ℕ} {n : ℕ} (hn : cut s ≤ n) :
    cut (insert n s) = n + 1
Proof
:= by
  classical
  simp only [cut, Finset.sup_insert]
  exact max_eq_left (hn.trans (Nat.le_succ _))

theorem cone_mono

TopologyByExample.Mathias.cone_mono

A smaller tail gives a smaller cone.

theorem cone_mono (s : Finset ℕ) {A B : Set ℕ} (h : A ⊆ B) : cone s A ⊆ cone s B
Proof
:= by
  intro X hX
  exact ⟨hX.1, hX.2.1, hX.2.2.trans (union_subset_union_right _
    (inter_subset_inter_left _ h))⟩

theorem infinite_of_mem

TopologyByExample.Mathias.infinite_of_mem

A free ultrafilter member is infinite.

theorem infinite_of_mem {U : Ultrafilter ℕ} (hfree : (U : Filter ℕ) ≤ cofinite)
    {A : Set ℕ} (hA : A ∈ U) : A.Infinite
Proof
:= by
  intro hfin
  exact (U : Filter ℕ).compl_notMem hA (hfree hfin.compl_mem_cofinite)

theorem tail_mem

TopologyByExample.Mathias.tail_mem

Cutting off finitely many initial coordinates preserves membership in a free ultrafilter.

theorem tail_mem {U : Ultrafilter ℕ} (hfree : (U : Filter ℕ) ≤ cofinite)
    {A : Set ℕ} (hA : A ∈ U) (n : ℕ) : A ∩ Ici n ∈ U
Proof
:= by
  apply inter_mem hA
  apply hfree
  simpa only [compl_Iio] using (finite_Iio n).compl_mem_cofinite

theorem cone_nonempty

TopologyByExample.Mathias.cone_nonempty

Every cone with a free-ultrafilter tail is inhabited.

theorem cone_nonempty {U : Ultrafilter ℕ} (hfree : (U : Filter ℕ) ≤ cofinite)
    (s : Finset ℕ) {A : Set ℕ} (hA : A ∈ U) : (cone s A).Nonempty
Proof
:= by
  refine ⟨(s : Set ℕ) ∪ (A ∩ Ici (cut s)), ?_, subset_union_left, subset_rfl⟩
  exact (infinite_of_mem hfree (tail_mem hfree hA _)).mono subset_union_right

theorem cone_inter_nonempty

TopologyByExample.Mathias.cone_inter_nonempty

Cones with the same stem have a common member when both tails belong to one free ultrafilter.

theorem cone_inter_nonempty {U : Ultrafilter ℕ} (hfree : (U : Filter ℕ) ≤ cofinite)
    (s : Finset ℕ) {A B : Set ℕ} (hA : A ∈ U) (hB : B ∈ U) :
    (cone s A ∩ cone s B).Nonempty
Proof
:= by
  obtain ⟨X, hX⟩ := cone_nonempty hfree s (inter_mem hA hB)
  exact ⟨X, cone_mono s inter_subset_left hX, cone_mono s inter_subset_right hX⟩

theorem cone_insert_subset

TopologyByExample.Mathias.cone_insert_subset

Choosing the next stem point from the tail refines a cone.

theorem cone_insert_subset {s : Finset ℕ} {A : Set ℕ} {n : ℕ}
    (hnA : n ∈ A) (hn : cut s ≤ n) : cone (insert n s) A ⊆ cone s A
Proof
:= by
  intro X hX
  refine ⟨hX.1, (by exact subset_trans (by simp) hX.2.1), ?_⟩
  intro m hm
  rcases hX.2.2 hm with hms | hmA
  · rcases Finset.mem_insert.mp hms with rfl | hms
    · exact Or.inr ⟨hnA, hn⟩
    · exact Or.inl hms
  · exact Or.inr ⟨hmA.1, hn.trans ((Nat.le_succ n).trans (by
      simpa only [cut_insert hn, mem_Ici] using hmA.2))⟩

theorem cone_mono_tail

TopologyByExample.Mathias.cone_mono_tail

Only the part of a tail at or above the stem cut affects its cone.

theorem cone_mono_tail (s : Finset ℕ) {A B : Set ℕ}
    (h : A ∩ Ici (cut s) ⊆ B) : cone s A ⊆ cone s B
Proof
:= by
  intro X hX
  refine ⟨hX.1, hX.2.1, fun n hn ↦ ?_⟩
  rcases hX.2.2 hn with hs | ha
  · exact Or.inl hs
  · exact Or.inr ⟨h ha, ha.2⟩

theorem exists_next_of_mem_cone

TopologyByExample.Mathias.exists_next_of_mem_cone

Every member of a cone has a next point after its finite stem.

theorem exists_next_of_mem_cone {s : Finset ℕ} {A X : Set ℕ} (hX : X ∈ cone s A) :
    ∃ n ∈ A, cut s ≤ n ∧ X ∈ cone (insert n s) A
Proof
:= by
  classical
  have hex : ∃ n, n ∈ X ∧ n ∉ s :=
    (hX.1.sdiff s.finite_toSet).nonempty
  let n := Nat.find hex
  have hnX : n ∈ X := (Nat.find_spec hex).1
  have hns : n ∉ s := (Nat.find_spec hex).2
  have hnA : n ∈ A ∩ Ici (cut s) := (hX.2.2 hnX).resolve_left hns
  refine ⟨n, hnA.1, hnA.2, hX.1, ?_, ?_⟩
  · simpa only [Finset.coe_insert, insert_subset_iff] using And.intro hnX hX.2.1
  · intro m hm
    by_cases hms : m ∈ s
    · exact Or.inl (Finset.mem_insert_of_mem hms)
    by_cases hmn : m = n
    · exact Or.inl (hmn ▸ Finset.mem_insert_self n s)
    · right
      have hnm : n ≤ m := Nat.find_min' hex ⟨hm, hms⟩
      have hmA := (hX.2.2 hm).resolve_left hms
      refine ⟨hmA.1, ?_⟩
      rw [mem_Ici, cut_insert hnA.2]
      omega

theorem exists_long_extension

TopologyByExample.Mathias.exists_long_extension

An infinite member of a cone has arbitrarily long finite extensions of its stem.

theorem exists_long_extension {s : Finset ℕ} {A X : Set ℕ} (hX : X ∈ cone s A)
    (k : ℕ) : ∃ t : Finset ℕ, (t : Set ℕ) ⊆ X \ (s : Set ℕ) ∧
      k < cut t ∧ X ∈ cone (s ∪ t) A
Proof
:= by
  classical
  have hex : ∃ n ∈ X, max k (cut s) ≤ n := by
    by_contra! h
    exact hX.1 ((finite_Iio (max k (cut s))).subset h)
  obtain ⟨n, hnX, hkn⟩ := hex
  have hsn : cut s ≤ n := (le_max_right _ _).trans hkn
  have hnns : n ∉ s := fun hn ↦ (not_lt_of_ge hsn) (lt_cut_of_mem hn)
  let t := (Finset.range (n + 1)).filter (fun m ↦ m ∈ X ∧ m ∉ s)
  have hnt : n ∈ t := Finset.mem_filter.mpr
    ⟨Finset.mem_range.mpr (Nat.lt_succ_self _), hnX, hnns⟩
  have hct : cut t = n + 1 := by
    apply le_antisymm
    · exact Finset.sup_le fun m hm ↦ Nat.succ_le_succ
        (Nat.le_of_lt_succ (Finset.mem_range.mp (Finset.mem_filter.mp hm).1))
    · exact Finset.le_sup hnt
  have hcut : cut (s ∪ t) = n + 1 := by
    simp only [cut, Finset.sup_union]
    change max (cut s) (cut t) = n + 1
    rw [hct, max_eq_right (hsn.trans (Nat.le_succ _))]
  have htX : (t : Set ℕ) ⊆ X \ (s : Set ℕ) := fun m hm ↦
    (Finset.mem_filter.mp hm).2
  refine ⟨t, htX, ?_, hX.1, ?_, ?_⟩
  · rw [hct]
    exact Nat.lt_succ_of_le ((le_max_left _ _).trans hkn)
  · simpa only [Finset.coe_union] using union_subset hX.2.1 (htX.trans sdiff_subset)
  · intro m hmX
    by_cases hms : m ∈ s
    · exact Or.inl (Finset.mem_union_left _ hms)
    by_cases hmn : m < n + 1
    · exact Or.inl (Finset.mem_union_right _ (Finset.mem_filter.mpr
        ⟨Finset.mem_range.mpr hmn, hmX, hms⟩))
    · exact Or.inr ⟨((hX.2.2 hmX).resolve_left hms).1, by
        simpa only [hcut, mem_Ici] using le_of_not_gt hmn⟩

definition CompletelyRamsey

TopologyByExample.Mathias.CompletelyRamsey

A set of infinite subsets is completely Ramsey for an ultrafilter when each cone has a homogeneous refinement with the same finite stem.

def CompletelyRamsey (U : Ultrafilter ℕ) (B : Set (Set ℕ)) : Prop
:=
  ∀ s : Finset ℕ, ∀ A ∈ U, ∃ H ∈ U, H ⊆ A ∧
    (cone s H ⊆ B ∨ cone s H ⊆ Bᶜ)

definition RamseyNull

TopologyByExample.Mathias.RamseyNull

A Ramsey-null set can be avoided by refining the tail of every cone.

def RamseyNull (U : Ultrafilter ℕ) (B : Set (Set ℕ)) : Prop
:=
  ∀ s : Finset ℕ, ∀ A ∈ U, ∃ H ∈ U, H ⊆ A ∧ cone s H ⊆ Bᶜ

theorem compl

TopologyByExample.Mathias.CompletelyRamsey.compl

The completely Ramsey property is invariant under complementation.

theorem CompletelyRamsey.compl {U : Ultrafilter ℕ} {B : Set (Set ℕ)}
    (hB : CompletelyRamsey U B) : CompletelyRamsey U Bᶜ
Proof
:= by
  intro s A hA
  obtain ⟨H, hH, hHA, h⟩ := hB s A hA
  exact ⟨H, hH, hHA, by simpa only [compl_compl] using h.symm⟩

theorem completelyRamsey

TopologyByExample.Mathias.RamseyNull.completelyRamsey

Ramsey-null sets are completely Ramsey.

theorem RamseyNull.completelyRamsey {U : Ultrafilter ℕ} {B : Set (Set ℕ)}
    (hB : RamseyNull U B) : CompletelyRamsey U B
Proof
:= by
  intro s A hA
  obtain ⟨H, hH, hHA, h⟩ := hB s A hA
  exact ⟨H, hH, hHA, Or.inr h⟩