l3lab/ntp-mathlib huggingface dataset:
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> 

Proof state:
case H.H.refine'_2.mk.inr.mk.inl.inr
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a : β
b : α
h₂ : Sum.inl b ∈ {b | Sum.Lex r s b (Sum.inr x)}
h✝ : s a x
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)}
      { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) } { val := Sum.inl b, property := h₂ } →
    Sum.Lex r (Subrel s {b | s b x})
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) })
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inl b, property := h₂ })

Next tactic:
cases h₂
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> 

Proof state:
case H.H.refine'_2.mk.inr.mk.inr.inr
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a b : β
h₂ : Sum.inr b ∈ {b | Sum.Lex r s b (Sum.inr x)}
h✝ : s a x
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)}
      { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) } { val := Sum.inr b, property := h₂ } →
    Sum.Lex r (Subrel s {b | s b x})
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) })
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inr b, property := h₂ })

Next tactic:
cases h₂
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              

Proof state:
case H.H.refine'_2.mk.inl.mk.inl.sep.sep
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a b : α
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)}
      { val := Sum.inl a, property := (_ : Sum.Lex r s (Sum.inl a) (Sum.inr x)) }
      { val := Sum.inl b, property := (_ : Sum.Lex r s (Sum.inl b) (Sum.inr x)) } →
    Sum.Lex r (Subrel s {b | s b x})
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inl a, property := (_ : Sum.Lex r s (Sum.inl a) (Sum.inr x)) })
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inl b, property := (_ : Sum.Lex r s (Sum.inl b) (Sum.inr x)) })

Next tactic:
rintro ⟨⟩
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              

Proof state:
case H.H.refine'_2.mk.inl.mk.inr.sep.inr
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a : α
b : β
h✝ : s b x
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)}
      { val := Sum.inl a, property := (_ : Sum.Lex r s (Sum.inl a) (Sum.inr x)) }
      { val := Sum.inr b, property := (_ : Sum.Lex r s (Sum.inr b) (Sum.inr x)) } →
    Sum.Lex r (Subrel s {b | s b x})
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inl a, property := (_ : Sum.Lex r s (Sum.inl a) (Sum.inr x)) })
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inr b, property := (_ : Sum.Lex r s (Sum.inr b) (Sum.inr x)) })

Next tactic:
rintro ⟨⟩
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              

Proof state:
case H.H.refine'_2.mk.inr.mk.inl.inr.sep
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a : β
b : α
h✝ : s a x
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)}
      { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) }
      { val := Sum.inl b, property := (_ : Sum.Lex r s (Sum.inl b) (Sum.inr x)) } →
    Sum.Lex r (Subrel s {b | s b x})
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) })
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inl b, property := (_ : Sum.Lex r s (Sum.inl b) (Sum.inr x)) })

Next tactic:
rintro ⟨⟩
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              

Proof state:
case H.H.refine'_2.mk.inr.mk.inr.inr.inr
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a b : β
h✝¹ : s a x
h✝ : s b x
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)}
      { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) }
      { val := Sum.inr b, property := (_ : Sum.Lex r s (Sum.inr b) (Sum.inr x)) } →
    Sum.Lex r (Subrel s {b | s b x})
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) })
      ((fun a =>
          Subtype.casesOn a fun val h =>
            Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
              (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
        { val := Sum.inr b, property := (_ : Sum.Lex r s (Sum.inr b) (Sum.inr x)) })

Next tactic:
rintro ⟨⟩
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              rintro ⟨⟩ <;> 

Proof state:
case H.H.refine'_2.mk.inl.mk.inl.sep.sep.inl
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a b : α
h✝ : r a b
⊢ Sum.Lex r (Subrel s {b | s b x})
    ((fun a =>
        Subtype.casesOn a fun val h =>
          Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
            (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
      { val := Sum.inl a, property := (_ : Sum.Lex r s (Sum.inl a) (Sum.inr x)) })
    ((fun a =>
        Subtype.casesOn a fun val h =>
          Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
            (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
      { val := Sum.inl b, property := (_ : Sum.Lex r s (Sum.inl b) (Sum.inr x)) })

Next tactic:
constructor
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              rintro ⟨⟩ <;> 

Proof state:
case H.H.refine'_2.mk.inl.mk.inr.sep.inr.sep
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a : α
b : β
h✝ : s b x
⊢ Sum.Lex r (Subrel s {b | s b x})
    ((fun a =>
        Subtype.casesOn a fun val h =>
          Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
            (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
      { val := Sum.inl a, property := (_ : Sum.Lex r s (Sum.inl a) (Sum.inr x)) })
    ((fun a =>
        Subtype.casesOn a fun val h =>
          Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
            (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
      { val := Sum.inr b, property := (_ : Sum.Lex r s (Sum.inr b) (Sum.inr x)) })

Next tactic:
constructor
theorem add_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a + b ≤ c ↔ ∀ b' < b, a + b' ≤ c :=
  ⟨fun h b' l => (add_le_add_left l.le _).trans h, fun H =>
    le_of_not_lt <| by
      -- Porting note: `induction` tactics are required because of the parser bug.
      induction a using inductionOn with
      | H α r =>
        induction b using inductionOn with
        | H β s =>
          intro l
          suffices ∀ x : β, Sum.Lex r s (Sum.inr x) (enum _ _ l) by
            -- Porting note: `revert` & `intro` is required because `cases'` doesn't replace
            --               `enum _ _ l` in `this`.
            revert this; cases' enum _ _ l with x x <;> intro this
            · cases this (enum s 0 h.pos)
            · exact irrefl _ (this _)
          intro x
          rw [← typein_lt_typein (Sum.Lex r s), typein_enum]
          have := H _ (h.2 _ (typein_lt_type s x))
          rw [add_succ, succ_le_iff] at this
          refine'
            (RelEmbedding.ofMonotone (fun a => _) fun a b => _).ordinal_type_le.trans_lt this
          · rcases a with ⟨a | b, h⟩
            · exact Sum.inl a
            · exact Sum.inr ⟨b, by cases h; assumption⟩
          · rcases a with ⟨a | a, h₁⟩ <;> rcases b with ⟨b | b, h₂⟩ <;> cases h₁ <;> cases h₂ <;>
              rintro ⟨⟩ <;> 

Proof state:
case H.H.refine'_2.mk.inr.mk.inr.inr.inr.inr
α✝ : Type u_1
β✝ : Type u_2
γ : Type u_3
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
c : Ordinal.{u_4}
α : Type u_4
r : α → α → Prop
inst✝¹ : IsWellOrder α r
β : Type u_4
s : β → β → Prop
inst✝ : IsWellOrder β s
h : IsLimit (type s)
H : ∀ b' < type s, type r + b' ≤ c
l : c < type r + type s
x : β
this : type r + typein s x < c
a b : β
h✝² : s a x
h✝¹ : s b x
h✝ : s a b
⊢ Sum.Lex r (Subrel s {b | s b x})
    ((fun a =>
        Subtype.casesOn a fun val h =>
          Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
            (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
      { val := Sum.inr a, property := (_ : Sum.Lex r s (Sum.inr a) (Sum.inr x)) })
    ((fun a =>
        Subtype.casesOn a fun val h =>
          Sum.casesOn (motive := fun x_1 => x_1 ∈ {b | Sum.Lex r s b (Sum.inr x)} → α ⊕ ↑{b | s b x}) val
            (fun a h => Sum.inl a) (fun b h => Sum.inr { val := b, property := (_ : b ∈ {b | s b x}) }) h)
      { val := Sum.inr b, property := (_ : Sum.Lex r s (Sum.inr b) (Sum.inr x)) })

Next tactic:
constructor