l3lab/ntp-mathlib huggingface dataset:
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    

Proof state:
case refine'_1.intro.intro.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
⊢ (lsub fun i => sInf {b | f' i ≤ f b}) = a

Next tactic:
refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · 

Proof state:
case refine'_1.intro.intro.intro.refine'_1
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
i : ι
⊢ sInf {b | f' i ≤ f b} < a

Next tactic:
rcases H i with ⟨b, hb, hb'⟩
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · rcases H i with ⟨b, hb, hb'⟩
      

Proof state:
case refine'_1.intro.intro.intro.refine'_1.intro.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
i : ι
b : Ordinal.{u}
hb : b < a
hb' : f' i ≤ f b
⊢ sInf {b | f' i ≤ f b} < a

Next tactic:
exact lt_of_le_of_lt (csInf_le' hb') hb
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · rcases H i with ⟨b, hb, hb'⟩
      exact lt_of_le_of_lt (csInf_le' hb') hb
    · 

Proof state:
case refine'_1.intro.intro.intro.refine'_2
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b : Ordinal.{u}
hb : b < a
⊢ b < lsub fun i => sInf {b | f' i ≤ f b}

Next tactic:
have := hf.strictMono hb
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · rcases H i with ⟨b, hb, hb'⟩
      exact lt_of_le_of_lt (csInf_le' hb') hb
    · have := hf.strictMono hb
      

Proof state:
case refine'_1.intro.intro.intro.refine'_2
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b : Ordinal.{u}
hb : b < a
this : f b < f a
⊢ b < lsub fun i => sInf {b | f' i ≤ f b}

Next tactic:
rw [← hf', lt_lsub_iff] at this
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · rcases H i with ⟨b, hb, hb'⟩
      exact lt_of_le_of_lt (csInf_le' hb') hb
    · have := hf.strictMono hb
      rw [← hf', lt_lsub_iff] at this
      

Proof state:
case refine'_1.intro.intro.intro.refine'_2
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b : Ordinal.{u}
hb : b < a
this : ∃ i, f b ≤ f' i
⊢ b < lsub fun i => sInf {b | f' i ≤ f b}

Next tactic:
cases' this with i hi
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · rcases H i with ⟨b, hb, hb'⟩
      exact lt_of_le_of_lt (csInf_le' hb') hb
    · have := hf.strictMono hb
      rw [← hf', lt_lsub_iff] at this
      cases' this with i hi
      

Proof state:
case refine'_1.intro.intro.intro.refine'_2.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b : Ordinal.{u}
hb : b < a
i : ι
hi : f b ≤ f' i
⊢ b < lsub fun i => sInf {b | f' i ≤ f b}

Next tactic:
rcases H i with ⟨b, _, hb⟩
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · rcases H i with ⟨b, hb, hb'⟩
      exact lt_of_le_of_lt (csInf_le' hb') hb
    · have := hf.strictMono hb
      rw [← hf', lt_lsub_iff] at this
      cases' this with i hi
      rcases H i with ⟨b, _, hb⟩
      

Proof state:
case refine'_1.intro.intro.intro.refine'_2.intro.intro.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
ι : Type u
f' : ι → Ordinal.{u}
hf' : lsub f' = f a
hι : #ι = cof (f a)
H : ∀ (i : ι), ∃ b < a, f' i ≤ f b
b✝ : Ordinal.{u}
hb✝ : b✝ < a
i : ι
hi : f b✝ ≤ f' i
b : Ordinal.{u}
left✝ : b < a
hb : f' i ≤ f b
⊢ b✝ < lsub fun i => sInf {b | f' i ≤ f b}

Next tactic:
exact
        ((le_csInf_iff'' ⟨b, by exact hb⟩).2 fun c hc =>
          hf.strictMono.le_iff_le.1 (hi.trans hc)).trans_lt (lt_lsub _ i)
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · rcases H i with ⟨b, hb, hb'⟩
      exact lt_of_le_of_lt (csInf_le' hb') hb
    · have := hf.strictMono hb
      rw [← hf', lt_lsub_iff] at this
      cases' this with i hi
      rcases H i with ⟨b, _, hb⟩
      exact
        ((le_csInf_iff'' ⟨b, by exact hb⟩).2 fun c hc =>
          hf.strictMono.le_iff_le.1 (hi.trans hc)).trans_lt (lt_lsub _ i)
  · 

Proof state:
case refine'_2
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
⊢ (blsub o fun b hb => f (g b hb)) = f a

Next tactic:
rw [@blsub_comp.{u, u, u} a _ (fun b _ => f b) (@fun i j _ _ h => hf.strictMono.monotone h) g
        hg.2.2]
protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb) := by
  refine' ⟨_, @fun i j _ _ h => hf.strictMono (hg.2.1 _ _ h), _⟩
  · rcases exists_lsub_cof (f a) with ⟨ι, f', hf', hι⟩
    rw [← hg.cof_eq, ord_le_ord, ← hι]
    suffices (lsub.{u, u} fun i => sInf { b : Ordinal | f' i ≤ f b }) = a by
      rw [← this]
      apply cof_lsub_le
    have H : ∀ i, ∃ b < a, f' i ≤ f b := fun i => by
      have := lt_lsub.{u, u} f' i
      rw [hf', ← IsNormal.blsub_eq.{u, u} hf ha, lt_blsub_iff] at this
      simpa using this
    refine' (lsub_le fun i => _).antisymm (le_of_forall_lt fun b hb => _)
    · rcases H i with ⟨b, hb, hb'⟩
      exact lt_of_le_of_lt (csInf_le' hb') hb
    · have := hf.strictMono hb
      rw [← hf', lt_lsub_iff] at this
      cases' this with i hi
      rcases H i with ⟨b, _, hb⟩
      exact
        ((le_csInf_iff'' ⟨b, by exact hb⟩).2 fun c hc =>
          hf.strictMono.le_iff_le.1 (hi.trans hc)).trans_lt (lt_lsub _ i)
  · rw [@blsub_comp.{u, u, u} a _ (fun b _ => f b) (@fun i j _ _ h => hf.strictMono.monotone h) g
        hg.2.2]
    

Proof state:
case refine'_2
α : Type u_1
r : α → α → Prop
f : Ordinal.{u} → Ordinal.{u}
hf : IsNormal f
a o : Ordinal.{u}
ha : IsLimit a
g : (b : Ordinal.{u}) → b < o → Ordinal.{u}
hg : IsFundamentalSequence a o g
⊢ (blsub a fun b x => f b) = f a

Next tactic:
exact IsNormal.blsub_eq.{u, u} hf ha
theorem IsNormal.cof_le {f} (hf : IsNormal f) (a) : cof a ≤ cof (f a) := by
  

Proof state:
α : Type u_1
r : α → α → Prop
f : Ordinal.{u_2} → Ordinal.{u_2}
hf : IsNormal f
a : Ordinal.{u_2}
⊢ cof a ≤ cof (f a)

Next tactic:
rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha)
theorem IsNormal.cof_le {f} (hf : IsNormal f) (a) : cof a ≤ cof (f a) := by
  rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha)
  · 

Proof state:
case inl
α : Type u_1
r : α → α → Prop
f : Ordinal.{u_2} → Ordinal.{u_2}
hf : IsNormal f
⊢ cof 0 ≤ cof (f 0)

Next tactic:
rw [cof_zero]
theorem IsNormal.cof_le {f} (hf : IsNormal f) (a) : cof a ≤ cof (f a) := by
  rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha)
  · rw [cof_zero]
    

Proof state:
case inl
α : Type u_1
r : α → α → Prop
f : Ordinal.{u_2} → Ordinal.{u_2}
hf : IsNormal f
⊢ 0 ≤ cof (f 0)

Next tactic:
exact zero_le _
theorem IsNormal.cof_le {f} (hf : IsNormal f) (a) : cof a ≤ cof (f a) := by
  rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha)
  · rw [cof_zero]
    exact zero_le _
  · 

Proof state:
case inr.inl.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u_2} → Ordinal.{u_2}
hf : IsNormal f
b : Ordinal.{u_2}
⊢ cof (succ b) ≤ cof (f (succ b))

Next tactic:
rw [cof_succ, Cardinal.one_le_iff_ne_zero, cof_ne_zero, ← Ordinal.pos_iff_ne_zero]
theorem IsNormal.cof_le {f} (hf : IsNormal f) (a) : cof a ≤ cof (f a) := by
  rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha)
  · rw [cof_zero]
    exact zero_le _
  · rw [cof_succ, Cardinal.one_le_iff_ne_zero, cof_ne_zero, ← Ordinal.pos_iff_ne_zero]
    

Proof state:
case inr.inl.intro
α : Type u_1
r : α → α → Prop
f : Ordinal.{u_2} → Ordinal.{u_2}
hf : IsNormal f
b : Ordinal.{u_2}
⊢ 0 < f (succ b)

Next tactic:
exact (Ordinal.zero_le (f b)).trans_lt (hf.1 b)
theorem IsNormal.cof_le {f} (hf : IsNormal f) (a) : cof a ≤ cof (f a) := by
  rcases zero_or_succ_or_limit a with (rfl | ⟨b, rfl⟩ | ha)
  · rw [cof_zero]
    exact zero_le _
  · rw [cof_succ, Cardinal.one_le_iff_ne_zero, cof_ne_zero, ← Ordinal.pos_iff_ne_zero]
    exact (Ordinal.zero_le (f b)).trans_lt (hf.1 b)
  · 

Proof state:
case inr.inr
α : Type u_1
r : α → α → Prop
f : Ordinal.{u_2} → Ordinal.{u_2}
hf : IsNormal f
a : Ordinal.{u_2}
ha : IsLimit a
⊢ cof a ≤ cof (f a)

Next tactic:
rw [hf.cof_eq ha]
@[simp]
theorem cof_add (a b : Ordinal) : b ≠ 0 → cof (a + b) = cof b := fun h => by
  

Proof state:
α : Type u_1
r : α → α → Prop
a b : Ordinal.{u_2}
h : b ≠ 0
⊢ cof (a + b) = cof b

Next tactic:
rcases zero_or_succ_or_limit b with (rfl | ⟨c, rfl⟩ | hb)
@[simp]
theorem cof_add (a b : Ordinal) : b ≠ 0 → cof (a + b) = cof b := fun h => by
  rcases zero_or_succ_or_limit b with (rfl | ⟨c, rfl⟩ | hb)
  · 

Proof state:
case inl
α : Type u_1
r : α → α → Prop
a : Ordinal.{u_2}
h : 0 ≠ 0
⊢ cof (a + 0) = cof 0

Next tactic:
contradiction
@[simp]
theorem cof_add (a b : Ordinal) : b ≠ 0 → cof (a + b) = cof b := fun h => by
  rcases zero_or_succ_or_limit b with (rfl | ⟨c, rfl⟩ | hb)
  · contradiction
  · 

Proof state:
case inr.inl.intro
α : Type u_1
r : α → α → Prop
a c : Ordinal.{u_2}
h : succ c ≠ 0
⊢ cof (a + succ c) = cof (succ c)

Next tactic:
rw [add_succ, cof_succ, cof_succ]
@[simp]
theorem cof_add (a b : Ordinal) : b ≠ 0 → cof (a + b) = cof b := fun h => by
  rcases zero_or_succ_or_limit b with (rfl | ⟨c, rfl⟩ | hb)
  · contradiction
  · rw [add_succ, cof_succ, cof_succ]
  · 

Proof state:
case inr.inr
α : Type u_1
r : α → α → Prop
a b : Ordinal.{u_2}
h : b ≠ 0
hb : IsLimit b
⊢ cof (a + b) = cof b

Next tactic:
exact (add_isNormal a).cof_eq hb
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  

Proof state:
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
⊢ ℵ₀ ≤ cof o ↔ IsLimit o

Next tactic:
rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · 

Proof state:
case inl
α : Type u_1
r : α → α → Prop
⊢ ℵ₀ ≤ cof 0 ↔ IsLimit 0

Next tactic:
simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · 

Proof state:
case inr.inl.intro
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
⊢ ℵ₀ ≤ cof (succ o) ↔ IsLimit (succ o)

Next tactic:
simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · 

Proof state:
case inr.inr
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
⊢ ℵ₀ ≤ cof o ↔ IsLimit o

Next tactic:
simp [l]
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    

Proof state:
case inr.inr
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
⊢ ℵ₀ ≤ cof o

Next tactic:
refine' le_of_not_lt fun h => _
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    

Proof state:
case inr.inr
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
⊢ False

Next tactic:
cases' Cardinal.lt_aleph0.1 h with n e
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    

Proof state:
case inr.inr.intro
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
n : ℕ
e : cof o = ↑n
⊢ False

Next tactic:
have := cof_cof o
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    have := cof_cof o
    

Proof state:
case inr.inr.intro
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
n : ℕ
e : cof o = ↑n
this : cof (ord (cof o)) = cof o
⊢ False

Next tactic:
rw [e, ord_nat] at this
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    have := cof_cof o
    rw [e, ord_nat] at this
    

Proof state:
case inr.inr.intro
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
n : ℕ
e : cof o = ↑n
this : cof ↑n = ↑n
⊢ False

Next tactic:
cases n
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    have := cof_cof o
    rw [e, ord_nat] at this
    cases n
    · 

Proof state:
case inr.inr.intro.zero
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
e : cof o = ↑Nat.zero
this : cof ↑Nat.zero = ↑Nat.zero
⊢ False

Next tactic:
simp at e
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    have := cof_cof o
    rw [e, ord_nat] at this
    cases n
    · simp at e
      

Proof state:
case inr.inr.intro.zero
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
this : cof ↑Nat.zero = ↑Nat.zero
e : o = 0
⊢ False

Next tactic:
simp [e, not_zero_isLimit] at l
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    have := cof_cof o
    rw [e, ord_nat] at this
    cases n
    · simp at e
      simp [e, not_zero_isLimit] at l
    · 

Proof state:
case inr.inr.intro.succ
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
n✝ : ℕ
e : cof o = ↑(Nat.succ n✝)
this : cof ↑(Nat.succ n✝) = ↑(Nat.succ n✝)
⊢ False

Next tactic:
rw [nat_cast_succ, cof_succ] at this
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    have := cof_cof o
    rw [e, ord_nat] at this
    cases n
    · simp at e
      simp [e, not_zero_isLimit] at l
    · rw [nat_cast_succ, cof_succ] at this
      

Proof state:
case inr.inr.intro.succ
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
n✝ : ℕ
e : cof o = ↑(Nat.succ n✝)
this : 1 = ↑(Nat.succ n✝)
⊢ False

Next tactic:
rw [← this, cof_eq_one_iff_is_succ] at e
theorem aleph0_le_cof {o} : ℵ₀ ≤ cof o ↔ IsLimit o := by
  rcases zero_or_succ_or_limit o with (rfl | ⟨o, rfl⟩ | l)
  · simp [not_zero_isLimit, Cardinal.aleph0_ne_zero]
  · simp [not_succ_isLimit, Cardinal.one_lt_aleph0]
  · simp [l]
    refine' le_of_not_lt fun h => _
    cases' Cardinal.lt_aleph0.1 h with n e
    have := cof_cof o
    rw [e, ord_nat] at this
    cases n
    · simp at e
      simp [e, not_zero_isLimit] at l
    · rw [nat_cast_succ, cof_succ] at this
      rw [← this, cof_eq_one_iff_is_succ] at e
      

Proof state:
case inr.inr.intro.succ
α : Type u_1
r : α → α → Prop
o : Ordinal.{u_2}
l : IsLimit o
h : cof o < ℵ₀
n✝ : ℕ
e : ∃ a, o = succ a
this : 1 = ↑(Nat.succ n✝)
⊢ False

Next tactic:
rcases e with ⟨a, rfl⟩