Theorem: Ordinal.isOpen_singleton_iff
File: Mathlib/SetTheory/Ordinal/Topology.lean

tactic: refine ⟨fun h ⟨h₀, hsucc⟩ => ?_, fun ha => ?_⟩
state_before: s : Set Ordinal.{u}
a : Ordinal.{u}
⊢ IsOpen {a} ↔ ¬a.IsLimit
state_after: case refine_1
s : Set Ordinal.{u}
a : Ordinal.{u}
h : IsOpen {a}
x✝ : a.IsLimit
h₀ : a ≠ 0
hsucc : ∀ a_1 < a, succ a_1 < a
⊢ False

case refine_2
s : Set Ordinal.{u}
a : Ordinal.{u}
ha : ¬a.IsLimit
⊢ IsOpen {a}

tactic: obtain ⟨b, c, hbc, hbc'⟩ :=
  (mem_nhds_iff_exists_Ioo_subset' ⟨0, Ordinal.pos_iff_ne_zero.2 h₀⟩ ⟨_, lt_succ a⟩).1
    (h.mem_nhds rfl)
state_before: case refine_1
s : Set Ordinal.{u}
a : Ordinal.{u}
h : IsOpen {a}
x✝ : a.IsLimit
h₀ : a ≠ 0
hsucc : ∀ a_1 < a, succ a_1 < a
⊢ False
state_after: case refine_1.intro.intro.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
h : IsOpen {a}
x✝ : a.IsLimit
h₀ : a ≠ 0
hsucc : ∀ a_1 < a, succ a_1 < a
b c : Ordinal.{u}
hbc : a ∈ Set.Ioo b c
hbc' : Set.Ioo b c ⊆ {a}
⊢ False

tactic: have hba := hsucc b hbc.1
state_before: case refine_1.intro.intro.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
h : IsOpen {a}
x✝ : a.IsLimit
h₀ : a ≠ 0
hsucc : ∀ a_1 < a, succ a_1 < a
b c : Ordinal.{u}
hbc : a ∈ Set.Ioo b c
hbc' : Set.Ioo b c ⊆ {a}
⊢ False
state_after: case refine_1.intro.intro.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
h : IsOpen {a}
x✝ : a.IsLimit
h₀ : a ≠ 0
hsucc : ∀ a_1 < a, succ a_1 < a
b c : Ordinal.{u}
hbc : a ∈ Set.Ioo b c
hbc' : Set.Ioo b c ⊆ {a}
hba : succ b < a
⊢ False

tactic: exact hba.ne (hbc' ⟨lt_succ b, hba.trans hbc.2⟩)
state_before: case refine_1.intro.intro.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
h : IsOpen {a}
x✝ : a.IsLimit
h₀ : a ≠ 0
hsucc : ∀ a_1 < a, succ a_1 < a
b c : Ordinal.{u}
hbc : a ∈ Set.Ioo b c
hbc' : Set.Ioo b c ⊆ {a}
hba : succ b < a
⊢ False
state_after: no goals

tactic: rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha')
state_before: case refine_2
s : Set Ordinal.{u}
a : Ordinal.{u}
ha : ¬a.IsLimit
⊢ IsOpen {a}
state_after: case refine_2.inl
s : Set Ordinal.{u}
ha : ¬IsLimit 0
⊢ IsOpen {0}

case refine_2.inr.inl.intro
s : Set Ordinal.{u}
b : Ordinal.{u}
ha : ¬(succ b).IsLimit
⊢ IsOpen {succ b}

case refine_2.inr.inr
s : Set Ordinal.{u}
a : Ordinal.{u}
ha : ¬a.IsLimit
ha' : a.IsLimit
⊢ IsOpen {a}

tactic: rw [← bot_eq_zero, ← Set.Iic_bot, ← Iio_succ]
state_before: case refine_2.inl
s : Set Ordinal.{u}
ha : ¬IsLimit 0
⊢ IsOpen {0}
state_after: case refine_2.inl
s : Set Ordinal.{u}
ha : ¬IsLimit 0
⊢ IsOpen (Set.Iio (succ ⊥))

tactic: exact isOpen_Iio
state_before: case refine_2.inl
s : Set Ordinal.{u}
ha : ¬IsLimit 0
⊢ IsOpen (Set.Iio (succ ⊥))
state_after: no goals

tactic: rw [← Set.Icc_self, Icc_succ_left, ← Ioo_succ_right]
state_before: case refine_2.inr.inl.intro
s : Set Ordinal.{u}
b : Ordinal.{u}
ha : ¬(succ b).IsLimit
⊢ IsOpen {succ b}
state_after: case refine_2.inr.inl.intro
s : Set Ordinal.{u}
b : Ordinal.{u}
ha : ¬(succ b).IsLimit
⊢ IsOpen (Set.Ioo b (succ (succ b)))

tactic: exact isOpen_Ioo
state_before: case refine_2.inr.inl.intro
s : Set Ordinal.{u}
b : Ordinal.{u}
ha : ¬(succ b).IsLimit
⊢ IsOpen (Set.Ioo b (succ (succ b)))
state_after: no goals

tactic: exact (ha ha').elim
state_before: case refine_2.inr.inr
s : Set Ordinal.{u}
a : Ordinal.{u}
ha : ¬a.IsLimit
ha' : a.IsLimit
⊢ IsOpen {a}
state_after: no goals