l3lab/ntp-mathlib huggingface dataset:
theorem mem_closed_iff_sup (hs : IsClosed s) :
    a ∈ s ↔ ∃ (ι : Type u) (_hι : Nonempty ι) (f : ι → Ordinal),
      (∀ i, f i ∈ s) ∧ sup.{u, u} f = a :=
  by 

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
hs : IsClosed s
⊢ a ∈ s ↔ ∃ ι, ∃ (_ : Nonempty ι), ∃ f, (∀ (i : ι), f i ∈ s) ∧ sup f = a

Next tactic:
rw [← mem_closure_iff_sup, hs.closure_eq]
theorem mem_closure_iff_bsup :
    a ∈ closure s ↔
      ∃ (o : Ordinal) (_ho : o ≠ 0) (f : ∀ a < o, Ordinal),
        (∀ i hi, f i hi ∈ s) ∧ bsup.{u, u} o f = a :=
  ((mem_closure_tfae a s).out 0 4).trans <| by 

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
⊢ (∃ o, o ≠ 0 ∧ ∃ f, (∀ (x : Ordinal.{u}) (hx : x < o), f x hx ∈ s) ∧ bsup o f = a) ↔
    ∃ o, ∃ (_ : o ≠ 0), ∃ f, (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) ∧ bsup o f = a

Next tactic:
simp only [exists_prop]
theorem mem_closed_iff_bsup (hs : IsClosed s) :
    a ∈ s ↔
      ∃ (o : Ordinal) (_ho : o ≠ 0) (f : ∀ a < o, Ordinal),
        (∀ i hi, f i hi ∈ s) ∧ bsup.{u, u} o f = a :=
  by 

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
hs : IsClosed s
⊢ a ∈ s ↔ ∃ o, ∃ (_ : o ≠ 0), ∃ f, (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) ∧ bsup o f = a

Next tactic:
rw [← mem_closure_iff_bsup, hs.closure_eq]
theorem isClosed_iff_sup :
    IsClosed s ↔
      ∀ {ι : Type u}, Nonempty ι → ∀ f : ι → Ordinal, (∀ i, f i ∈ s) → sup.{u, u} f ∈ s := by
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
⊢ IsClosed s ↔ ∀ {ι : Type u}, Nonempty ι → ∀ (f : ι → Ordinal.{u}), (∀ (i : ι), f i ∈ s) → sup f ∈ s

Next tactic:
use fun hs ι hι f hf => (mem_closed_iff_sup hs).2 ⟨ι, hι, f, hf, rfl⟩
theorem isClosed_iff_sup :
    IsClosed s ↔
      ∀ {ι : Type u}, Nonempty ι → ∀ f : ι → Ordinal, (∀ i, f i ∈ s) → sup.{u, u} f ∈ s := by
  use fun hs ι hι f hf => (mem_closed_iff_sup hs).2 ⟨ι, hι, f, hf, rfl⟩
  

Proof state:
case mpr
s : Set Ordinal.{u}
a : Ordinal.{u}
⊢ (∀ {ι : Type u}, Nonempty ι → ∀ (f : ι → Ordinal.{u}), (∀ (i : ι), f i ∈ s) → sup f ∈ s) → IsClosed s

Next tactic:
rw [← closure_subset_iff_isClosed]
theorem isClosed_iff_sup :
    IsClosed s ↔
      ∀ {ι : Type u}, Nonempty ι → ∀ f : ι → Ordinal, (∀ i, f i ∈ s) → sup.{u, u} f ∈ s := by
  use fun hs ι hι f hf => (mem_closed_iff_sup hs).2 ⟨ι, hι, f, hf, rfl⟩
  rw [← closure_subset_iff_isClosed]
  

Proof state:
case mpr
s : Set Ordinal.{u}
a : Ordinal.{u}
⊢ (∀ {ι : Type u}, Nonempty ι → ∀ (f : ι → Ordinal.{u}), (∀ (i : ι), f i ∈ s) → sup f ∈ s) → closure s ⊆ s

Next tactic:
intro h x hx
theorem isClosed_iff_sup :
    IsClosed s ↔
      ∀ {ι : Type u}, Nonempty ι → ∀ f : ι → Ordinal, (∀ i, f i ∈ s) → sup.{u, u} f ∈ s := by
  use fun hs ι hι f hf => (mem_closed_iff_sup hs).2 ⟨ι, hι, f, hf, rfl⟩
  rw [← closure_subset_iff_isClosed]
  intro h x hx
  

Proof state:
case mpr
s : Set Ordinal.{u}
a : Ordinal.{u}
h : ∀ {ι : Type u}, Nonempty ι → ∀ (f : ι → Ordinal.{u}), (∀ (i : ι), f i ∈ s) → sup f ∈ s
x : Ordinal.{u}
hx : x ∈ closure s
⊢ x ∈ s

Next tactic:
rcases mem_closure_iff_sup.1 hx with ⟨ι, hι, f, hf, rfl⟩
theorem isClosed_iff_sup :
    IsClosed s ↔
      ∀ {ι : Type u}, Nonempty ι → ∀ f : ι → Ordinal, (∀ i, f i ∈ s) → sup.{u, u} f ∈ s := by
  use fun hs ι hι f hf => (mem_closed_iff_sup hs).2 ⟨ι, hι, f, hf, rfl⟩
  rw [← closure_subset_iff_isClosed]
  intro h x hx
  rcases mem_closure_iff_sup.1 hx with ⟨ι, hι, f, hf, rfl⟩
  

Proof state:
case mpr.intro.intro.intro.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
h : ∀ {ι : Type u}, Nonempty ι → ∀ (f : ι → Ordinal.{u}), (∀ (i : ι), f i ∈ s) → sup f ∈ s
ι : Type u
hι : Nonempty ι
f : ι → Ordinal.{u}
hf : ∀ (i : ι), f i ∈ s
hx : sup f ∈ closure s
⊢ sup f ∈ s

Next tactic:
exact h hι f hf
theorem isClosed_iff_bsup :
    IsClosed s ↔
      ∀ {o : Ordinal}, o ≠ 0 → ∀ f : ∀ a < o, Ordinal,
        (∀ i hi, f i hi ∈ s) → bsup.{u, u} o f ∈ s := by
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
⊢ IsClosed s ↔
    ∀ {o : Ordinal.{u}},
      o ≠ 0 →
        ∀ (f : (a : Ordinal.{u}) → a < o → Ordinal.{u}), (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) → bsup o f ∈ s

Next tactic:
rw [isClosed_iff_sup]
theorem isClosed_iff_bsup :
    IsClosed s ↔
      ∀ {o : Ordinal}, o ≠ 0 → ∀ f : ∀ a < o, Ordinal,
        (∀ i hi, f i hi ∈ s) → bsup.{u, u} o f ∈ s := by
  rw [isClosed_iff_sup]
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
⊢ (∀ {ι : Type u}, Nonempty ι → ∀ (f : ι → Ordinal.{u}), (∀ (i : ι), f i ∈ s) → sup f ∈ s) ↔
    ∀ {o : Ordinal.{u}},
      o ≠ 0 →
        ∀ (f : (a : Ordinal.{u}) → a < o → Ordinal.{u}), (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) → bsup o f ∈ s

Next tactic:
refine' ⟨fun H o ho f hf => H (out_nonempty_iff_ne_zero.2 ho) _ _, fun H ι hι f hf => _⟩
theorem isClosed_iff_bsup :
    IsClosed s ↔
      ∀ {o : Ordinal}, o ≠ 0 → ∀ f : ∀ a < o, Ordinal,
        (∀ i hi, f i hi ∈ s) → bsup.{u, u} o f ∈ s := by
  rw [isClosed_iff_sup]
  refine' ⟨fun H o ho f hf => H (out_nonempty_iff_ne_zero.2 ho) _ _, fun H ι hι f hf => _⟩
  · 

Proof state:
case refine'_1
s : Set Ordinal.{u}
a : Ordinal.{u}
H : ∀ {ι : Type u}, Nonempty ι → ∀ (f : ι → Ordinal.{u}), (∀ (i : ι), f i ∈ s) → sup f ∈ s
o : Ordinal.{u}
ho : o ≠ 0
f : (a : Ordinal.{u}) → a < o → Ordinal.{u}
hf : ∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s
⊢ ∀ (i : (Quotient.out o).α), familyOfBFamily o f i ∈ s

Next tactic:
exact fun i => hf _ _
theorem isClosed_iff_bsup :
    IsClosed s ↔
      ∀ {o : Ordinal}, o ≠ 0 → ∀ f : ∀ a < o, Ordinal,
        (∀ i hi, f i hi ∈ s) → bsup.{u, u} o f ∈ s := by
  rw [isClosed_iff_sup]
  refine' ⟨fun H o ho f hf => H (out_nonempty_iff_ne_zero.2 ho) _ _, fun H ι hι f hf => _⟩
  · exact fun i => hf _ _
  · 

Proof state:
case refine'_2
s : Set Ordinal.{u}
a : Ordinal.{u}
H :
  ∀ {o : Ordinal.{u}},
    o ≠ 0 →
      ∀ (f : (a : Ordinal.{u}) → a < o → Ordinal.{u}), (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) → bsup o f ∈ s
ι : Type u
hι : Nonempty ι
f : ι → Ordinal.{u}
hf : ∀ (i : ι), f i ∈ s
⊢ sup f ∈ s

Next tactic:
rw [← bsup_eq_sup]
theorem isClosed_iff_bsup :
    IsClosed s ↔
      ∀ {o : Ordinal}, o ≠ 0 → ∀ f : ∀ a < o, Ordinal,
        (∀ i hi, f i hi ∈ s) → bsup.{u, u} o f ∈ s := by
  rw [isClosed_iff_sup]
  refine' ⟨fun H o ho f hf => H (out_nonempty_iff_ne_zero.2 ho) _ _, fun H ι hι f hf => _⟩
  · exact fun i => hf _ _
  · rw [← bsup_eq_sup]
    

Proof state:
case refine'_2
s : Set Ordinal.{u}
a : Ordinal.{u}
H :
  ∀ {o : Ordinal.{u}},
    o ≠ 0 →
      ∀ (f : (a : Ordinal.{u}) → a < o → Ordinal.{u}), (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) → bsup o f ∈ s
ι : Type u
hι : Nonempty ι
f : ι → Ordinal.{u}
hf : ∀ (i : ι), f i ∈ s
⊢ bsup (type WellOrderingRel) (bfamilyOfFamily f) ∈ s

Next tactic:
apply H (type_ne_zero_iff_nonempty.2 hι)
theorem isClosed_iff_bsup :
    IsClosed s ↔
      ∀ {o : Ordinal}, o ≠ 0 → ∀ f : ∀ a < o, Ordinal,
        (∀ i hi, f i hi ∈ s) → bsup.{u, u} o f ∈ s := by
  rw [isClosed_iff_sup]
  refine' ⟨fun H o ho f hf => H (out_nonempty_iff_ne_zero.2 ho) _ _, fun H ι hι f hf => _⟩
  · exact fun i => hf _ _
  · rw [← bsup_eq_sup]
    apply H (type_ne_zero_iff_nonempty.2 hι)
    

Proof state:
case refine'_2.a
s : Set Ordinal.{u}
a : Ordinal.{u}
H :
  ∀ {o : Ordinal.{u}},
    o ≠ 0 →
      ∀ (f : (a : Ordinal.{u}) → a < o → Ordinal.{u}), (∀ (i : Ordinal.{u}) (hi : i < o), f i hi ∈ s) → bsup o f ∈ s
ι : Type u
hι : Nonempty ι
f : ι → Ordinal.{u}
hf : ∀ (i : ι), f i ∈ s
⊢ ∀ (i : Ordinal.{u}) (hi : i < type WellOrderingRel), bfamilyOfFamily f i hi ∈ s

Next tactic:
exact fun i hi => hf _
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
ha : a ∈ frontier s
⊢ IsLimit a

Next tactic:
simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
ha :
  (∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ s)) ∧
    ∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ sᶜ)
⊢ IsLimit a

Next tactic:
by_contra h
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
  by_contra h
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
ha :
  (∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ s)) ∧
    ∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ sᶜ)
h : ¬IsLimit a
⊢ False

Next tactic:
rw [← isOpen_singleton_iff] at h
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
  by_contra h
  rw [← isOpen_singleton_iff] at h
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
ha :
  (∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ s)) ∧
    ∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ sᶜ)
h : IsOpen {a}
⊢ False

Next tactic:
rcases ha.1 _ h rfl with ⟨b, hb, hb'⟩
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
  by_contra h
  rw [← isOpen_singleton_iff] at h
  rcases ha.1 _ h rfl with ⟨b, hb, hb'⟩
  

Proof state:
case intro.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
ha :
  (∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ s)) ∧
    ∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ sᶜ)
h : IsOpen {a}
b : Ordinal.{u}
hb : b ∈ {a}
hb' : b ∈ s
⊢ False

Next tactic:
rcases ha.2 _ h rfl with ⟨c, hc, hc'⟩
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
  by_contra h
  rw [← isOpen_singleton_iff] at h
  rcases ha.1 _ h rfl with ⟨b, hb, hb'⟩
  rcases ha.2 _ h rfl with ⟨c, hc, hc'⟩
  

Proof state:
case intro.intro.intro.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
ha :
  (∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ s)) ∧
    ∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ sᶜ)
h : IsOpen {a}
b : Ordinal.{u}
hb : b ∈ {a}
hb' : b ∈ s
c : Ordinal.{u}
hc : c ∈ {a}
hc' : c ∈ sᶜ
⊢ False

Next tactic:
rw [Set.mem_singleton_iff] at *
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
  by_contra h
  rw [← isOpen_singleton_iff] at h
  rcases ha.1 _ h rfl with ⟨b, hb, hb'⟩
  rcases ha.2 _ h rfl with ⟨c, hc, hc'⟩
  rw [Set.mem_singleton_iff] at *
  

Proof state:
case intro.intro.intro.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
ha :
  (∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ s)) ∧
    ∀ (o : Set Ordinal.{u}), IsOpen o → a ∈ o → Set.Nonempty (o ∩ sᶜ)
h : IsOpen {a}
b : Ordinal.{u}
hb : b = a
hb' : b ∈ s
c : Ordinal.{u}
hc : c = a
hc' : c ∈ sᶜ
⊢ False

Next tactic:
subst hb
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
  by_contra h
  rw [← isOpen_singleton_iff] at h
  rcases ha.1 _ h rfl with ⟨b, hb, hb'⟩
  rcases ha.2 _ h rfl with ⟨c, hc, hc'⟩
  rw [Set.mem_singleton_iff] at *
  subst hb; 

Proof state:
case intro.intro.intro.intro
s : Set Ordinal.{u}
b : Ordinal.{u}
hb' : b ∈ s
c : Ordinal.{u}
hc' : c ∈ sᶜ
ha :
  (∀ (o : Set Ordinal.{u}), IsOpen o → b ∈ o → Set.Nonempty (o ∩ s)) ∧
    ∀ (o : Set Ordinal.{u}), IsOpen o → b ∈ o → Set.Nonempty (o ∩ sᶜ)
h : IsOpen {b}
hc : c = b
⊢ False

Next tactic:
subst hc
theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a := by
  simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
  by_contra h
  rw [← isOpen_singleton_iff] at h
  rcases ha.1 _ h rfl with ⟨b, hb, hb'⟩
  rcases ha.2 _ h rfl with ⟨c, hc, hc'⟩
  rw [Set.mem_singleton_iff] at *
  subst hb; subst hc
  

Proof state:
case intro.intro.intro.intro
s : Set Ordinal.{u}
c : Ordinal.{u}
hc' : c ∈ sᶜ
hb' : c ∈ s
ha :
  (∀ (o : Set Ordinal.{u}), IsOpen o → c ∈ o → Set.Nonempty (o ∩ s)) ∧
    ∀ (o : Set Ordinal.{u}), IsOpen o → c ∈ o → Set.Nonempty (o ∩ sᶜ)
h : IsOpen {c}
⊢ False

Next tactic:
exact hc' hb'
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
⊢ IsNormal f ↔ StrictMono f ∧ Continuous f

Next tactic:
refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · 

Proof state:
case refine'_1
s : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : IsNormal f
⊢ Continuous f

Next tactic:
rw [continuous_def]
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    

Proof state:
case refine'_1
s : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : IsNormal f
⊢ ∀ (s : Set Ordinal.{u}), IsOpen s → IsOpen (f ⁻¹' s)

Next tactic:
intro s hs
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    

Proof state:
case refine'_1
s✝ : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : IsNormal f
s : Set Ordinal.{u}
hs : IsOpen s
⊢ IsOpen (f ⁻¹' s)

Next tactic:
rw [isOpen_iff] at *
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    

Proof state:
case refine'_1
s✝ : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : IsNormal f
s : Set Ordinal.{u}
hs : ∀ o ∈ s, IsLimit o → ∃ a < o, Set.Ioo a o ⊆ s
⊢ ∀ o ∈ f ⁻¹' s, IsLimit o → ∃ a < o, Set.Ioo a o ⊆ f ⁻¹' s

Next tactic:
intro o ho ho'
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    

Proof state:
case refine'_1
s✝ : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : IsNormal f
s : Set Ordinal.{u}
hs : ∀ o ∈ s, IsLimit o → ∃ a < o, Set.Ioo a o ⊆ s
o : Ordinal.{u}
ho : o ∈ f ⁻¹' s
ho' : IsLimit o
⊢ ∃ a < o, Set.Ioo a o ⊆ f ⁻¹' s

Next tactic:
rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    

Proof state:
case refine'_1.intro.intro
s✝ : Set Ordinal.{u}
a✝ : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : IsNormal f
s : Set Ordinal.{u}
hs : ∀ o ∈ s, IsLimit o → ∃ a < o, Set.Ioo a o ⊆ s
o : Ordinal.{u}
ho : o ∈ f ⁻¹' s
ho' : IsLimit o
a : Ordinal.{u}
ha : a < f o
has : Set.Ioo a (f o) ⊆ s
⊢ ∃ a < o, Set.Ioo a o ⊆ f ⁻¹' s

Next tactic:
rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    

Proof state:
case refine'_1.intro.intro
s✝ : Set Ordinal.{u}
a✝ : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : IsNormal f
s : Set Ordinal.{u}
hs : ∀ o ∈ s, IsLimit o → ∃ a < o, Set.Ioo a o ⊆ s
o : Ordinal.{u}
ho : o ∈ f ⁻¹' s
ho' : IsLimit o
a : Ordinal.{u}
ha : ∃ i, ∃ (_ : i < o), a < f i
has : Set.Ioo a (f o) ⊆ s
⊢ ∃ a < o, Set.Ioo a o ⊆ f ⁻¹' s

Next tactic:
rcases ha with ⟨b, hb, hab⟩
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    rcases ha with ⟨b, hb, hab⟩
    

Proof state:
case refine'_1.intro.intro.intro.intro
s✝ : Set Ordinal.{u}
a✝ : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : IsNormal f
s : Set Ordinal.{u}
hs : ∀ o ∈ s, IsLimit o → ∃ a < o, Set.Ioo a o ⊆ s
o : Ordinal.{u}
ho : o ∈ f ⁻¹' s
ho' : IsLimit o
a : Ordinal.{u}
has : Set.Ioo a (f o) ⊆ s
b : Ordinal.{u}
hb : b < o
hab : a < f b
⊢ ∃ a < o, Set.Ioo a o ⊆ f ⁻¹' s

Next tactic:
exact
      ⟨b, hb, fun c hc =>
        Set.mem_preimage.2 (has ⟨hab.trans (h.strictMono hc.1), h.strictMono hc.2⟩)⟩
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    rcases ha with ⟨b, hb, hab⟩
    exact
      ⟨b, hb, fun c hc =>
        Set.mem_preimage.2 (has ⟨hab.trans (h.strictMono hc.1), h.strictMono hc.2⟩)⟩
  · 

Proof state:
case refine'_2
s : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
⊢ StrictMono f ∧ Continuous f → IsNormal f

Next tactic:
rw [isNormal_iff_strictMono_limit]
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    rcases ha with ⟨b, hb, hab⟩
    exact
      ⟨b, hb, fun c hc =>
        Set.mem_preimage.2 (has ⟨hab.trans (h.strictMono hc.1), h.strictMono hc.2⟩)⟩
  · rw [isNormal_iff_strictMono_limit]
    

Proof state:
case refine'_2
s : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
⊢ StrictMono f ∧ Continuous f →
    StrictMono f ∧ ∀ (o : Ordinal.{u}), IsLimit o → ∀ (a : Ordinal.{u}), (∀ b < o, f b ≤ a) → f o ≤ a

Next tactic:
rintro ⟨h, h'⟩
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    rcases ha with ⟨b, hb, hab⟩
    exact
      ⟨b, hb, fun c hc =>
        Set.mem_preimage.2 (has ⟨hab.trans (h.strictMono hc.1), h.strictMono hc.2⟩)⟩
  · rw [isNormal_iff_strictMono_limit]
    rintro ⟨h, h'⟩
    

Proof state:
case refine'_2.intro
s : Set Ordinal.{u}
a : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h : StrictMono f
h' : Continuous f
⊢ StrictMono f ∧ ∀ (o : Ordinal.{u}), IsLimit o → ∀ (a : Ordinal.{u}), (∀ b < o, f b ≤ a) → f o ≤ a

Next tactic:
refine' ⟨h, fun o ho a h => _⟩
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    rcases ha with ⟨b, hb, hab⟩
    exact
      ⟨b, hb, fun c hc =>
        Set.mem_preimage.2 (has ⟨hab.trans (h.strictMono hc.1), h.strictMono hc.2⟩)⟩
  · rw [isNormal_iff_strictMono_limit]
    rintro ⟨h, h'⟩
    refine' ⟨h, fun o ho a h => _⟩
    

Proof state:
case refine'_2.intro
s : Set Ordinal.{u}
a✝ : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h✝ : StrictMono f
h' : Continuous f
o : Ordinal.{u}
ho : IsLimit o
a : Ordinal.{u}
h : ∀ b < o, f b ≤ a
⊢ f o ≤ a

Next tactic:
suffices : o ∈ f ⁻¹' Set.Iic a
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    rcases ha with ⟨b, hb, hab⟩
    exact
      ⟨b, hb, fun c hc =>
        Set.mem_preimage.2 (has ⟨hab.trans (h.strictMono hc.1), h.strictMono hc.2⟩)⟩
  · rw [isNormal_iff_strictMono_limit]
    rintro ⟨h, h'⟩
    refine' ⟨h, fun o ho a h => _⟩
    suffices : o ∈ f ⁻¹' Set.Iic a
    

Proof state:
case refine'_2.intro
s : Set Ordinal.{u}
a✝ : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h✝ : StrictMono f
h' : Continuous f
o : Ordinal.{u}
ho : IsLimit o
a : Ordinal.{u}
h : ∀ b < o, f b ≤ a
this : o ∈ f ⁻¹' Set.Iic a
⊢ f o ≤ a
case this
s : Set Ordinal.{u}
a✝ : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h✝ : StrictMono f
h' : Continuous f
o : Ordinal.{u}
ho : IsLimit o
a : Ordinal.{u}
h : ∀ b < o, f b ≤ a
⊢ o ∈ f ⁻¹' Set.Iic a

Next tactic:
exact Set.mem_preimage.1 this
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    rcases ha with ⟨b, hb, hab⟩
    exact
      ⟨b, hb, fun c hc =>
        Set.mem_preimage.2 (has ⟨hab.trans (h.strictMono hc.1), h.strictMono hc.2⟩)⟩
  · rw [isNormal_iff_strictMono_limit]
    rintro ⟨h, h'⟩
    refine' ⟨h, fun o ho a h => _⟩
    suffices : o ∈ f ⁻¹' Set.Iic a
    exact Set.mem_preimage.1 this
    

Proof state:
case this
s : Set Ordinal.{u}
a✝ : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h✝ : StrictMono f
h' : Continuous f
o : Ordinal.{u}
ho : IsLimit o
a : Ordinal.{u}
h : ∀ b < o, f b ≤ a
⊢ o ∈ f ⁻¹' Set.Iic a

Next tactic:
rw [mem_closed_iff_sup (IsClosed.preimage h' (@isClosed_Iic _ _ _ _ a))]
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f := by
  refine' ⟨fun h => ⟨h.strictMono, _⟩, _⟩
  · rw [continuous_def]
    intro s hs
    rw [isOpen_iff] at *
    intro o ho ho'
    rcases hs _ ho (h.isLimit ho') with ⟨a, ha, has⟩
    rw [← IsNormal.bsup_eq.{u, u} h ho', lt_bsup] at ha
    rcases ha with ⟨b, hb, hab⟩
    exact
      ⟨b, hb, fun c hc =>
        Set.mem_preimage.2 (has ⟨hab.trans (h.strictMono hc.1), h.strictMono hc.2⟩)⟩
  · rw [isNormal_iff_strictMono_limit]
    rintro ⟨h, h'⟩
    refine' ⟨h, fun o ho a h => _⟩
    suffices : o ∈ f ⁻¹' Set.Iic a
    exact Set.mem_preimage.1 this
    rw [mem_closed_iff_sup (IsClosed.preimage h' (@isClosed_Iic _ _ _ _ a))]
    

Proof state:
case this
s : Set Ordinal.{u}
a✝ : Ordinal.{u}
f : Ordinal.{u} → Ordinal.{u}
h✝ : StrictMono f
h' : Continuous f
o : Ordinal.{u}
ho : IsLimit o
a : Ordinal.{u}
h : ∀ b < o, f b ≤ a
⊢ ∃ ι, ∃ (_ : Nonempty ι), ∃ f_1, (∀ (i : ι), f_1 i ∈ f ⁻¹' Set.Iic a) ∧ sup f_1 = o

Next tactic:
exact
      ⟨_, out_nonempty_iff_ne_zero.2 ho.1, typein (· < ·), fun i => h _ (typein_lt_self i),
        sup_typein_limit ho.2⟩
theorem enumOrd_isNormal_iff_isClosed (hs : s.Unbounded (· < ·)) :
    IsNormal (enumOrd s) ↔ IsClosed s := by
  

Proof state:
s : Set Ordinal.{u}
a : Ordinal.{u}
hs : Set.Unbounded (fun x x_1 => x < x_1) s
⊢ IsNormal (enumOrd s) ↔ IsClosed s

Next tactic:
have Hs := enumOrd_strictMono hs