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⟩
          · 

Proof state:
case H.H.refine'_2
α✝ : 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 : ↑{b | Sum.Lex r s b (Sum.inr x)}
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)} 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)
        a)
      ((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)
        b)

Next tactic:
rcases a with ⟨a | a, 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₁⟩ <;> 

Proof state:
case H.H.refine'_2.mk.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
b : ↑{b | Sum.Lex r s b (Sum.inr x)}
a : α
h₁ : Sum.inl a ∈ {b | Sum.Lex r s b (Sum.inr x)}
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)} { val := Sum.inl a, property := h₁ } 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 := h₁ })
      ((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)
        b)

Next tactic:
rcases b with ⟨b | b, 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₁⟩ <;> 

Proof state:
case H.H.refine'_2.mk.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
b : ↑{b | Sum.Lex r s b (Sum.inr x)}
a : β
h₁ : Sum.inr a ∈ {b | Sum.Lex r s b (Sum.inr x)}
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)} { val := Sum.inr a, property := h₁ } 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 := h₁ })
      ((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)
        b)

Next tactic:
rcases b with ⟨b | b, 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₂⟩ <;> 

Proof state:
case H.H.refine'_2.mk.inl.mk.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 : α
h₁ : Sum.inl a ∈ {b | Sum.Lex r s b (Sum.inr x)}
b : α
h₂ : Sum.inl b ∈ {b | Sum.Lex r s b (Sum.inr x)}
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)} { val := Sum.inl a, property := h₁ }
      { 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.inl a, property := h₁ })
      ((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₂⟩ <;> 

Proof state:
case H.H.refine'_2.mk.inl.mk.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 : α
h₁ : Sum.inl a ∈ {b | Sum.Lex r s b (Sum.inr x)}
b : β
h₂ : Sum.inr b ∈ {b | Sum.Lex r s b (Sum.inr x)}
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)} { val := Sum.inl a, property := h₁ }
      { 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.inl a, property := h₁ })
      ((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₂⟩ <;> 

Proof state:
case H.H.refine'_2.mk.inr.mk.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 : β
h₁ : Sum.inr a ∈ {b | Sum.Lex r s b (Sum.inr x)}
b : α
h₂ : Sum.inl b ∈ {b | Sum.Lex r s b (Sum.inr x)}
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)} { val := Sum.inr a, property := h₁ }
      { 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 := h₁ })
      ((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₂⟩ <;> 

Proof state:
case H.H.refine'_2.mk.inr.mk.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 : β
h₁ : Sum.inr a ∈ {b | Sum.Lex r s b (Sum.inr x)}
b : β
h₂ : Sum.inr b ∈ {b | Sum.Lex r s b (Sum.inr x)}
⊢ Subrel (Sum.Lex r s) {b | Sum.Lex r s b (Sum.inr x)} { val := Sum.inr a, property := h₁ }
      { 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 := h₁ })
      ((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₁ <;> 

Proof state:
case H.H.refine'_2.mk.inl.mk.inl.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₂ : Sum.inl b ∈ {b | Sum.Lex r s b (Sum.inr 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.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.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 := 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.inl.mk.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₂ : Sum.inr b ∈ {b | Sum.Lex r s b (Sum.inr 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 := 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.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 := h₂ })

Next tactic:
cases h₂