l3lab/ntp-mathlib huggingface dataset:
instance linearOrder : LinearOrder Ordinal :=
  {inferInstanceAs (PartialOrder Ordinal) with
    le_total := fun a b =>
      match lt_or_eq_of_le (le_add_left b a), lt_or_eq_of_le (le_add_right a b) with
      | Or.inr h, _ => by rw [h]; exact Or.inl (le_add_right _ _)
      | _, Or.inr h => by rw [h]; exact Or.inr (le_add_left _ _)
      | Or.inl h₁, Or.inl h₂ => by
        revert h₁ h₂
        refine inductionOn a ?_
        intro α₁ r₁ _
        refine inductionOn b ?_
        intro α₂ r₂ _ ⟨f⟩ ⟨g⟩
        rw [← typein_top f, ← typein_top g, le_iff_lt_or_eq, le_iff_lt_or_eq,
                 typein_lt_typein, typein_lt_typein]
        

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
src✝ : PartialOrder Ordinal.{?u.153327} := inferInstanceAs (PartialOrder Ordinal.{?u.153327})
a b : Ordinal.{?u.153327}
α₁ : Type ?u.153327
r₁ : α₁ → α₁ → Prop
inst✝¹ : IsWellOrder α₁ r₁
α₂ : Type ?u.153327
r₂ : α₂ → α₂ → Prop
inst✝ : IsWellOrder α₂ r₂
f : r₂ ≺i Sum.Lex r₁ r₂
g : r₁ ≺i Sum.Lex r₁ r₂
⊢ (Sum.Lex r₁ r₂ g.top f.top ∨ typein (Sum.Lex r₁ r₂) g.top = typein (Sum.Lex r₁ r₂) f.top) ∨
    Sum.Lex r₁ r₂ f.top g.top ∨ typein (Sum.Lex r₁ r₂) f.top = typein (Sum.Lex r₁ r₂) g.top

Next tactic:
rcases trichotomous_of (Sum.Lex r₁ r₂) g.top f.top with (h | h | h) <;>
          [exact Or.inl (Or.inl h); (left; right; rw [h]); exact Or.inr (Or.inl h)]
instance linearOrder : LinearOrder Ordinal :=
  {inferInstanceAs (PartialOrder Ordinal) with
    le_total := fun a b =>
      match lt_or_eq_of_le (le_add_left b a), lt_or_eq_of_le (le_add_right a b) with
      | Or.inr h, _ => by rw [h]; exact Or.inl (le_add_right _ _)
      | _, Or.inr h => by rw [h]; exact Or.inr (le_add_left _ _)
      | Or.inl h₁, Or.inl h₂ => by
        revert h₁ h₂
        refine inductionOn a ?_
        intro α₁ r₁ _
        refine inductionOn b ?_
        intro α₂ r₂ _ ⟨f⟩ ⟨g⟩
        rw [← typein_top f, ← typein_top g, le_iff_lt_or_eq, le_iff_lt_or_eq,
                 typein_lt_typein, typein_lt_typein]
        

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
src✝ : PartialOrder Ordinal.{?u.153327} := inferInstanceAs (PartialOrder Ordinal.{?u.153327})
a b : Ordinal.{?u.153327}
α₁ : Type ?u.153327
r₁ : α₁ → α₁ → Prop
inst✝¹ : IsWellOrder α₁ r₁
α₂ : Type ?u.153327
r₂ : α₂ → α₂ → Prop
inst✝ : IsWellOrder α₂ r₂
f : r₂ ≺i Sum.Lex r₁ r₂
g : r₁ ≺i Sum.Lex r₁ r₂
⊢ (Sum.Lex r₁ r₂ g.top f.top ∨ typein (Sum.Lex r₁ r₂) g.top = typein (Sum.Lex r₁ r₂) f.top) ∨
    Sum.Lex r₁ r₂ f.top g.top ∨ typein (Sum.Lex r₁ r₂) f.top = typein (Sum.Lex r₁ r₂) g.top

Next tactic:
rcases trichotomous_of (Sum.Lex r₁ r₂) g.top f.top with (h | h | h)
instance linearOrder : LinearOrder Ordinal :=
  {inferInstanceAs (PartialOrder Ordinal) with
    le_total := fun a b =>
      match lt_or_eq_of_le (le_add_left b a), lt_or_eq_of_le (le_add_right a b) with
      | Or.inr h, _ => by rw [h]; exact Or.inl (le_add_right _ _)
      | _, Or.inr h => by rw [h]; exact Or.inr (le_add_left _ _)
      | Or.inl h₁, Or.inl h₂ => by
        revert h₁ h₂
        refine inductionOn a ?_
        intro α₁ r₁ _
        refine inductionOn b ?_
        intro α₂ r₂ _ ⟨f⟩ ⟨g⟩
        rw [← typein_top f, ← typein_top g, le_iff_lt_or_eq, le_iff_lt_or_eq,
                 typein_lt_typein, typein_lt_typein]
        rcases trichotomous_of (Sum.Lex r₁ r₂) g.top f.top with (h | h | h) <;>
          [

Proof state:
case inl
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
src✝ : PartialOrder Ordinal.{?u.153327} := inferInstanceAs (PartialOrder Ordinal.{?u.153327})
a b : Ordinal.{?u.153327}
α₁ : Type ?u.153327
r₁ : α₁ → α₁ → Prop
inst✝¹ : IsWellOrder α₁ r₁
α₂ : Type ?u.153327
r₂ : α₂ → α₂ → Prop
inst✝ : IsWellOrder α₂ r₂
f : r₂ ≺i Sum.Lex r₁ r₂
g : r₁ ≺i Sum.Lex r₁ r₂
h : Sum.Lex r₁ r₂ g.top f.top
⊢ (Sum.Lex r₁ r₂ g.top f.top ∨ typein (Sum.Lex r₁ r₂) g.top = typein (Sum.Lex r₁ r₂) f.top) ∨
    Sum.Lex r₁ r₂ f.top g.top ∨ typein (Sum.Lex r₁ r₂) f.top = typein (Sum.Lex r₁ r₂) g.top

Next tactic:
exact Or.inl (Or.inl h)
instance linearOrder : LinearOrder Ordinal :=
  {inferInstanceAs (PartialOrder Ordinal) with
    le_total := fun a b =>
      match lt_or_eq_of_le (le_add_left b a), lt_or_eq_of_le (le_add_right a b) with
      | Or.inr h, _ => by rw [h]; exact Or.inl (le_add_right _ _)
      | _, Or.inr h => by rw [h]; exact Or.inr (le_add_left _ _)
      | Or.inl h₁, Or.inl h₂ => by
        revert h₁ h₂
        refine inductionOn a ?_
        intro α₁ r₁ _
        refine inductionOn b ?_
        intro α₂ r₂ _ ⟨f⟩ ⟨g⟩
        rw [← typein_top f, ← typein_top g, le_iff_lt_or_eq, le_iff_lt_or_eq,
                 typein_lt_typein, typein_lt_typein]
        rcases trichotomous_of (Sum.Lex r₁ r₂) g.top f.top with (h | h | h) <;>
          [exact Or.inl (Or.inl h); (

Proof state:
case inr.inl
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
src✝ : PartialOrder Ordinal.{?u.153327} := inferInstanceAs (PartialOrder Ordinal.{?u.153327})
a b : Ordinal.{?u.153327}
α₁ : Type ?u.153327
r₁ : α₁ → α₁ → Prop
inst✝¹ : IsWellOrder α₁ r₁
α₂ : Type ?u.153327
r₂ : α₂ → α₂ → Prop
inst✝ : IsWellOrder α₂ r₂
f : r₂ ≺i Sum.Lex r₁ r₂
g : r₁ ≺i Sum.Lex r₁ r₂
h : g.top = f.top
⊢ (Sum.Lex r₁ r₂ g.top f.top ∨ typein (Sum.Lex r₁ r₂) g.top = typein (Sum.Lex r₁ r₂) f.top) ∨
    Sum.Lex r₁ r₂ f.top g.top ∨ typein (Sum.Lex r₁ r₂) f.top = typein (Sum.Lex r₁ r₂) g.top

Next tactic:
left
instance linearOrder : LinearOrder Ordinal :=
  {inferInstanceAs (PartialOrder Ordinal) with
    le_total := fun a b =>
      match lt_or_eq_of_le (le_add_left b a), lt_or_eq_of_le (le_add_right a b) with
      | Or.inr h, _ => by rw [h]; exact Or.inl (le_add_right _ _)
      | _, Or.inr h => by rw [h]; exact Or.inr (le_add_left _ _)
      | Or.inl h₁, Or.inl h₂ => by
        revert h₁ h₂
        refine inductionOn a ?_
        intro α₁ r₁ _
        refine inductionOn b ?_
        intro α₂ r₂ _ ⟨f⟩ ⟨g⟩
        rw [← typein_top f, ← typein_top g, le_iff_lt_or_eq, le_iff_lt_or_eq,
                 typein_lt_typein, typein_lt_typein]
        rcases trichotomous_of (Sum.Lex r₁ r₂) g.top f.top with (h | h | h) <;>
          [exact Or.inl (Or.inl h); (left; 

Proof state:
case inr.inl.h
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
src✝ : PartialOrder Ordinal.{?u.153327} := inferInstanceAs (PartialOrder Ordinal.{?u.153327})
a b : Ordinal.{?u.153327}
α₁ : Type ?u.153327
r₁ : α₁ → α₁ → Prop
inst✝¹ : IsWellOrder α₁ r₁
α₂ : Type ?u.153327
r₂ : α₂ → α₂ → Prop
inst✝ : IsWellOrder α₂ r₂
f : r₂ ≺i Sum.Lex r₁ r₂
g : r₁ ≺i Sum.Lex r₁ r₂
h : g.top = f.top
⊢ Sum.Lex r₁ r₂ g.top f.top ∨ typein (Sum.Lex r₁ r₂) g.top = typein (Sum.Lex r₁ r₂) f.top

Next tactic:
right
instance linearOrder : LinearOrder Ordinal :=
  {inferInstanceAs (PartialOrder Ordinal) with
    le_total := fun a b =>
      match lt_or_eq_of_le (le_add_left b a), lt_or_eq_of_le (le_add_right a b) with
      | Or.inr h, _ => by rw [h]; exact Or.inl (le_add_right _ _)
      | _, Or.inr h => by rw [h]; exact Or.inr (le_add_left _ _)
      | Or.inl h₁, Or.inl h₂ => by
        revert h₁ h₂
        refine inductionOn a ?_
        intro α₁ r₁ _
        refine inductionOn b ?_
        intro α₂ r₂ _ ⟨f⟩ ⟨g⟩
        rw [← typein_top f, ← typein_top g, le_iff_lt_or_eq, le_iff_lt_or_eq,
                 typein_lt_typein, typein_lt_typein]
        rcases trichotomous_of (Sum.Lex r₁ r₂) g.top f.top with (h | h | h) <;>
          [exact Or.inl (Or.inl h); (left; right; 

Proof state:
case inr.inl.h.h
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
src✝ : PartialOrder Ordinal.{?u.153327} := inferInstanceAs (PartialOrder Ordinal.{?u.153327})
a b : Ordinal.{?u.153327}
α₁ : Type ?u.153327
r₁ : α₁ → α₁ → Prop
inst✝¹ : IsWellOrder α₁ r₁
α₂ : Type ?u.153327
r₂ : α₂ → α₂ → Prop
inst✝ : IsWellOrder α₂ r₂
f : r₂ ≺i Sum.Lex r₁ r₂
g : r₁ ≺i Sum.Lex r₁ r₂
h : g.top = f.top
⊢ typein (Sum.Lex r₁ r₂) g.top = typein (Sum.Lex r₁ r₂) f.top

Next tactic:
rw [h]
instance linearOrder : LinearOrder Ordinal :=
  {inferInstanceAs (PartialOrder Ordinal) with
    le_total := fun a b =>
      match lt_or_eq_of_le (le_add_left b a), lt_or_eq_of_le (le_add_right a b) with
      | Or.inr h, _ => by rw [h]; exact Or.inl (le_add_right _ _)
      | _, Or.inr h => by rw [h]; exact Or.inr (le_add_left _ _)
      | Or.inl h₁, Or.inl h₂ => by
        revert h₁ h₂
        refine inductionOn a ?_
        intro α₁ r₁ _
        refine inductionOn b ?_
        intro α₂ r₂ _ ⟨f⟩ ⟨g⟩
        rw [← typein_top f, ← typein_top g, le_iff_lt_or_eq, le_iff_lt_or_eq,
                 typein_lt_typein, typein_lt_typein]
        rcases trichotomous_of (Sum.Lex r₁ r₂) g.top f.top with (h | h | h) <;>
          [exact Or.inl (Or.inl h); (left; right; rw [h]); 

Proof state:
case inr.inr
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
src✝ : PartialOrder Ordinal.{?u.153327} := inferInstanceAs (PartialOrder Ordinal.{?u.153327})
a b : Ordinal.{?u.153327}
α₁ : Type ?u.153327
r₁ : α₁ → α₁ → Prop
inst✝¹ : IsWellOrder α₁ r₁
α₂ : Type ?u.153327
r₂ : α₂ → α₂ → Prop
inst✝ : IsWellOrder α₂ r₂
f : r₂ ≺i Sum.Lex r₁ r₂
g : r₁ ≺i Sum.Lex r₁ r₂
h : Sum.Lex r₁ r₂ f.top g.top
⊢ (Sum.Lex r₁ r₂ g.top f.top ∨ typein (Sum.Lex r₁ r₂) g.top = typein (Sum.Lex r₁ r₂) f.top) ∨
    Sum.Lex r₁ r₂ f.top g.top ∨ typein (Sum.Lex r₁ r₂) f.top = typein (Sum.Lex r₁ r₂) g.top

Next tactic:
exact Or.inr (Or.inl h)
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        

Proof state:
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a b : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
⊢ type r + 1 ≤ type s

Next tactic:
haveI := hs
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        

Proof state:
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a b : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
⊢ type r + 1 ≤ type s

Next tactic:
refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · 

Proof state:
case refine'_1
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a✝ b✝ : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
a b : α ⊕ PUnit.{u_3 + 1}
⊢ Sum.Lex r EmptyRelation a b →
    s ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) b)

Next tactic:
rcases a with (a | _)
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · rcases a with (a | _) <;> 

Proof state:
case refine'_1.inl
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a✝ b✝ : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
b : α ⊕ PUnit.{u_3 + 1}
a : α
⊢ Sum.Lex r EmptyRelation (Sum.inl a) b →
    s ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inl a)) ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) b)

Next tactic:
rcases b with (b | _)
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · rcases a with (a | _) <;> 

Proof state:
case refine'_1.inr
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a b✝ : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
b : α ⊕ PUnit.{u_3 + 1}
val✝ : PUnit.{u_3 + 1}
⊢ Sum.Lex r EmptyRelation (Sum.inr val✝) b →
    s ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inr val✝)) ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) b)

Next tactic:
rcases b with (b | _)
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · rcases a with (a | _) <;> rcases b with (b | _)
          · 

Proof state:
case refine'_1.inl.inl
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a✝ b✝ : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
a b : α
⊢ Sum.Lex r EmptyRelation (Sum.inl a) (Sum.inl b) →
    s ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inl a)) ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inl b))

Next tactic:
simpa only [Sum.lex_inl_inl] using f.map_rel_iff.2
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · rcases a with (a | _) <;> rcases b with (b | _)
          · simpa only [Sum.lex_inl_inl] using f.map_rel_iff.2
          · 

Proof state:
case refine'_1.inl.inr
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a✝ b : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
a : α
val✝ : PUnit.{u_3 + 1}
⊢ Sum.Lex r EmptyRelation (Sum.inl a) (Sum.inr val✝) →
    s ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inl a))
      ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inr val✝))

Next tactic:
intro
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · rcases a with (a | _) <;> rcases b with (b | _)
          · simpa only [Sum.lex_inl_inl] using f.map_rel_iff.2
          · intro
            

Proof state:
case refine'_1.inl.inr
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a✝¹ b : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
a : α
val✝ : PUnit.{u_3 + 1}
a✝ : Sum.Lex r EmptyRelation (Sum.inl a) (Sum.inr val✝)
⊢ s ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inl a)) ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inr val✝))

Next tactic:
rw [hf]
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · rcases a with (a | _) <;> rcases b with (b | _)
          · simpa only [Sum.lex_inl_inl] using f.map_rel_iff.2
          · intro
            rw [hf]
            

Proof state:
case refine'_1.inl.inr
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a✝¹ b : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
a : α
val✝ : PUnit.{u_3 + 1}
a✝ : Sum.Lex r EmptyRelation (Sum.inl a) (Sum.inr val✝)
⊢ ∃ a_1, f a_1 = (fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inl a)

Next tactic:
exact ⟨_, rfl⟩
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · rcases a with (a | _) <;> rcases b with (b | _)
          · simpa only [Sum.lex_inl_inl] using f.map_rel_iff.2
          · intro
            rw [hf]
            exact ⟨_, rfl⟩
          · 

Proof state:
case refine'_1.inr.inl
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a b✝ : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
val✝ : PUnit.{u_3 + 1}
b : α
⊢ Sum.Lex r EmptyRelation (Sum.inr val✝) (Sum.inl b) →
    s ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inr val✝))
      ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inl b))

Next tactic:
exact False.elim ∘ Sum.lex_inr_inl
private theorem succ_le_iff' {a b : Ordinal} : a + 1 ≤ b ↔ a < b :=
  ⟨lt_of_lt_of_le
      (inductionOn a fun α r _ =>
        ⟨⟨⟨⟨fun x => Sum.inl x, fun _ _ => Sum.inl.inj⟩, Sum.lex_inl_inl⟩,
            Sum.inr PUnit.unit, fun b =>
            Sum.recOn b (fun x => ⟨fun _ => ⟨x, rfl⟩, fun _ => Sum.Lex.sep _ _⟩) fun x =>
              Sum.lex_inr_inr.trans ⟨False.elim, fun ⟨x, H⟩ => Sum.inl_ne_inr H⟩⟩⟩),
    inductionOn a fun α r hr =>
      inductionOn b fun β s hs ⟨⟨f, t, hf⟩⟩ => by
        haveI := hs
        refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩
        · rcases a with (a | _) <;> rcases b with (b | _)
          · simpa only [Sum.lex_inl_inl] using f.map_rel_iff.2
          · intro
            rw [hf]
            exact ⟨_, rfl⟩
          · exact False.elim ∘ Sum.lex_inr_inl
          · 

Proof state:
case refine'_1.inr.inr
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ → γ → Prop
a b : Ordinal.{u_3}
α : Type u_3
r : α → α → Prop
hr : IsWellOrder α r
β : Type u_3
s : β → β → Prop
hs : IsWellOrder β s
x✝ : type r < type s
f : r ↪r s
t : β
hf : ∀ (b : β), s b t ↔ ∃ a, f a = b
this : IsWellOrder β s
val✝¹ val✝ : PUnit.{u_3 + 1}
⊢ Sum.Lex r EmptyRelation (Sum.inr val✝¹) (Sum.inr val✝) →
    s ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inr val✝¹))
      ((fun t_1 => Sum.rec (⇑f) (fun x => t) t_1) (Sum.inr val✝))

Next tactic:
exact False.elim ∘ Sum.lex_inr_inr.1