Lean library ยท module TopologyByExample.Theorems.AlmostDisjointFamily

Infinite maximal almost-disjoint families on the naturals

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

structure IsAlmostDisjointFamily

TopologyByExample.IsAlmostDisjointFamily

An almost-disjoint family consists of infinite sets with finite pairwise intersections.

structure IsAlmostDisjointFamily (๐’œ : Set (Set โ„•)) : Prop where
  /-- Each member is infinite. -/
  infinite_members : โˆ€ A โˆˆ ๐’œ, A.Infinite
  /-- Distinct members meet in a finite set. -/
  finite_inter : ๐’œ.Pairwise fun A B => (A โˆฉ B).Finite

structure IsMaximalAlmostDisjointFamily

TopologyByExample.IsMaximalAlmostDisjointFamily

A maximal almost-disjoint family meets every infinite set infinitely in some member.

structure IsMaximalAlmostDisjointFamily (๐’œ : Set (Set โ„•)) : Prop
    extends IsAlmostDisjointFamily ๐’œ where
  /-- Every infinite set has infinite intersection with a member. -/
  meets_infinite : โˆ€ B : Set โ„•, B.Infinite โ†’ โˆƒ A โˆˆ ๐’œ, (A โˆฉ B).Infinite

theorem exists_maximal_extension

TopologyByExample.IsAlmostDisjointFamily.exists_maximal_extension

Every almost-disjoint family extends to a maximal almost-disjoint family.

theorem IsAlmostDisjointFamily.exists_maximal_extension {๐’ฎ : Set (Set โ„•)}
    (h๐’ฎ : IsAlmostDisjointFamily ๐’ฎ) :
    โˆƒ ๐’œ, ๐’ฎ โІ ๐’œ โˆง IsMaximalAlmostDisjointFamily ๐’œ
Proof
:= by
  classical
  have hbound : โˆ€ c โІ {๐’œ | IsAlmostDisjointFamily ๐’œ},
      IsChain (ยท โІ ยท) c โ†’ c.Nonempty โ†’
      โˆƒ ub โˆˆ {๐’œ | IsAlmostDisjointFamily ๐’œ}, โˆ€ s โˆˆ c, s โІ ub := by
    intro c hc hchain _
    refine โŸจโ‹ƒโ‚€ c, ?_, fun s hs => subset_sUnion_of_mem hsโŸฉ
    constructor
    ยท intro A hA
      obtain โŸจs, hs, hAsโŸฉ := hA
      exact (hc hs).infinite_members A hAs
    ยท intro A hA B hB hAB
      obtain โŸจs, hs, hAsโŸฉ := hA
      obtain โŸจt, ht, hBtโŸฉ := hB
      rcases hchain.total hs ht with hst | hts
      ยท exact (hc ht).finite_inter (hst hAs) hBt hAB
      ยท exact (hc hs).finite_inter hAs (hts hBt) hAB
  obtain โŸจ๐’œ, hsub, hmaxโŸฉ := zorn_subset_nonempty
    {๐’œ | IsAlmostDisjointFamily ๐’œ} hbound ๐’ฎ h๐’ฎ
  refine โŸจ๐’œ, hsub, hmax.1, ?_โŸฉ
  intro B hB
  by_contra hn
  have hfin : โˆ€ A โˆˆ ๐’œ, (A โˆฉ B).Finite := by
    intro A hA
    exact not_infinite.mp (fun hi => hn โŸจA, hA, hiโŸฉ)
  have hins : IsAlmostDisjointFamily (insert B ๐’œ) := by
    constructor
    ยท intro A hA
      rcases hA with rfl | hA
      ยท exact hB
      ยท exact hmax.1.infinite_members A hA
    ยท intro C hC D hD hCD
      rcases hC with rfl | hC <;> rcases hD with rfl | hD
      ยท exact (hCD rfl).elim
      ยท simpa only [inter_comm] using hfin D hD
      ยท exact hfin C hC
      ยท exact hmax.1.finite_inter hC hD hCD
  have hBA : B โˆˆ ๐’œ := hmax.2 hins (subset_insert B ๐’œ) (mem_insert B ๐’œ)
  exact hB (by simpa using hfin B hBA)

On this site: Theorem: Every almost-disjoint family extends to a maximal one

definition natPairColumn

TopologyByExample.natPairColumn

One column of the standard pairing of pairs of naturals with naturals.

def natPairColumn (n : โ„•) : Set โ„•
:= range (Nat.pair n)

theorem infinite_natPairColumn

TopologyByExample.infinite_natPairColumn

Every pairing column is infinite.

theorem infinite_natPairColumn (n : โ„•) : (natPairColumn n).Infinite
Proof
:= by
  apply infinite_range_of_injective
  intro a b hab
  exact (Nat.pair_eq_pair.mp hab).2

theorem disjoint_natPairColumn

TopologyByExample.disjoint_natPairColumn

Distinct pairing columns are disjoint.

theorem disjoint_natPairColumn {m n : โ„•} (hmn : m โ‰  n) :
    Disjoint (natPairColumn m) (natPairColumn n)
Proof
:= by
  apply disjoint_left.mpr
  rintro x โŸจa, rflโŸฉ โŸจb, hbโŸฉ
  exact hmn (Nat.pair_eq_pair.mp hb).1.symm

theorem infinite_range_natPairColumn

TopologyByExample.infinite_range_natPairColumn

The pairing columns form an infinite family.

theorem infinite_range_natPairColumn : (range natPairColumn).Infinite
Proof
:= by
  apply infinite_range_of_injective
  intro m n hmn
  by_contra hne
  have hd := disjoint_natPairColumn hne
  have hm : Nat.pair m 0 โˆˆ natPairColumn m := mem_range_self 0
  exact disjoint_left.mp hd hm (hmn โ–ธ hm)

theorem almostDisjoint_natPairColumns

TopologyByExample.almostDisjoint_natPairColumns

The pairing columns form an almost-disjoint family.

theorem almostDisjoint_natPairColumns : IsAlmostDisjointFamily (range natPairColumn)
Proof
:= by
  constructor
  ยท rintro A โŸจn, rflโŸฉ
    exact infinite_natPairColumn n
  ยท rintro A โŸจm, rflโŸฉ B โŸจn, rflโŸฉ hmn
    have hd := disjoint_natPairColumn (fun h => hmn (congrArg natPairColumn h))
    rw [hd.inter_eq]
    exact finite_empty

theorem exists_infinite_maximalAlmostDisjointFamily

TopologyByExample.exists_infinite_maximalAlmostDisjointFamily

There exists an infinite maximal almost-disjoint family on the naturals.

theorem exists_infinite_maximalAlmostDisjointFamily :
    โˆƒ ๐’œ : Set (Set โ„•), ๐’œ.Infinite โˆง IsMaximalAlmostDisjointFamily ๐’œ
Proof
:= by
  obtain โŸจ๐’œ, hsub, h๐’œโŸฉ := almostDisjoint_natPairColumns.exists_maximal_extension
  exact โŸจ๐’œ, infinite_range_natPairColumn.mono hsub, h๐’œโŸฉ

On this site: Theorem: There exists an infinite maximal almost-disjoint family