l3lab/ntp-mathlib huggingface dataset:
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> 

Proof state:
case mp.inl.inl.inl
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a✝ b✝ : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a b : α₁
h✝ : r₂ (f a) (f b)
⊢ Sum.Lex r₁ s (Sum.inl a) (Sum.inl b)

Next tactic:
constructor
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> 

Proof state:
case mp.inl.inr.sep
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a✝ b✝ : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a : α₁
b : β
⊢ Sum.Lex r₁ s (Sum.inl a) (Sum.inr b)

Next tactic:
constructor
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> 

Proof state:
case mp.inr.inr.inr
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a✝ b✝ : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a b : β
h✝ : s ((Embedding.refl β) a) ((Embedding.refl β) b)
⊢ Sum.Lex r₁ s (Sum.inr a) (Sum.inr b)

Next tactic:
constructor
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [

Proof state:
case mp.inl.inl.inl.h
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a✝ b✝ : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a b : α₁
h✝ : r₂ (f a) (f b)
⊢ r₁ a b

Next tactic:
rwa [← fo]
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [rwa [← fo]; 

Proof state:
case mp.inr.inr.inr.h
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a✝ b✝ : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a b : β
h✝ : s ((Embedding.refl β) a) ((Embedding.refl β) b)
⊢ s a b

Next tactic:
assumption
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [rwa [← fo]; assumption]
                · 

Proof state:
case mpr
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a✝ b✝ : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a b : α₁ ⊕ β
H : Sum.Lex r₁ s a b
⊢ Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) a) ((Embedding.sumMap f (Embedding.refl β)) b)

Next tactic:
cases H <;> constructor <;> [rwa [fo]; assumption]
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [rwa [← fo]; assumption]
                · 

Proof state:
case mpr
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a✝ b✝ : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a b : α₁ ⊕ β
H : Sum.Lex r₁ s a b
⊢ Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) a) ((Embedding.sumMap f (Embedding.refl β)) b)

Next tactic:
cases H
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [rwa [← fo]; assumption]
                · cases H <;> 

Proof state:
case mpr.inl
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a b : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a₁✝ a₂✝ : α₁
h✝ : r₁ a₁✝ a₂✝
⊢ Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inl a₁✝))
    ((Embedding.sumMap f (Embedding.refl β)) (Sum.inl a₂✝))

Next tactic:
constructor
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [rwa [← fo]; assumption]
                · cases H <;> 

Proof state:
case mpr.inr
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a b : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
b₁✝ b₂✝ : β
h✝ : s b₁✝ b₂✝
⊢ Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inr b₁✝))
    ((Embedding.sumMap f (Embedding.refl β)) (Sum.inr b₂✝))

Next tactic:
constructor
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [rwa [← fo]; assumption]
                · cases H <;> 

Proof state:
case mpr.sep
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a b : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a✝ : α₁
b✝ : β
⊢ Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inl a✝))
    ((Embedding.sumMap f (Embedding.refl β)) (Sum.inr b✝))

Next tactic:
constructor
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [rwa [← fo]; assumption]
                · cases H <;> constructor <;> [

Proof state:
case mpr.inl.h
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a b : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
a₁✝ a₂✝ : α₁
h✝ : r₁ a₁✝ a₂✝
⊢ r₂ (f a₁✝) (f a₂✝)

Next tactic:
rwa [fo]
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
    refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
    rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
    refine inductionOn c (fun β s _ ↦ ?_)
    exact @RelEmbedding.ordinal_type_le _ _ (Sum.Lex r₁ s) (Sum.Lex r₂ s) _ _
              ⟨f.sumMap (Embedding.refl _), by
                intro a b
                constructor <;> intro H
                · cases' a with a a <;> cases' b with b b <;> cases H <;> constructor <;>
                    [rwa [← fo]; assumption]
                · cases H <;> constructor <;> [rwa [fo]; 

Proof state:
case mpr.inr.h
α : Type u
β✝ : Type u_1
γ : Type u_2
r : α → α → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a b : Ordinal.{u}
α₁ : Type u
r₁ : α₁ → α₁ → Prop
x✝² : IsWellOrder α₁ r₁
α₂ : Type u
r₂ : α₂ → α₂ → Prop
x✝¹ : IsWellOrder α₂ r₂
c : Ordinal.{u}
f : α₁ ↪ α₂
fo : ∀ {a b : α₁}, r₂ (f a) (f b) ↔ r₁ a b
fi :
  ∀ (a : α₁) (b : α₂),
    r₂ b ({ toEmbedding := f, map_rel_iff' := fo } a) → ∃ a', { toEmbedding := f, map_rel_iff' := fo } a' = b
β : Type u
s : β → β → Prop
x✝ : IsWellOrder β s
b₁✝ b₂✝ : β
h✝ : s b₁✝ b₂✝
⊢ s ((Embedding.refl β) b₁✝) ((Embedding.refl β) b₂✝)

Next tactic:
assumption
theorem le_add_right (a b : Ordinal) : a ≤ a + b := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_3}
⊢ a ≤ a + b

Next tactic:
simpa only [add_zero] using add_le_add_left (Ordinal.zero_le b) a
theorem le_add_left (a b : Ordinal) : a ≤ b + a := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u_3}
⊢ a ≤ b + a

Next tactic:
simpa only [zero_add] using add_le_add_right (Ordinal.zero_le b) a
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 

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}
h : b = a + b
x✝ : a < a + b ∨ a = a + b
⊢ a ≤ b ∨ b ≤ a

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]; 

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}
h : b = a + b
x✝ : a < a + b ∨ a = a + b
⊢ a ≤ a + b ∨ a + b ≤ a

Next tactic:
exact Or.inl (le_add_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 

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}
x✝ : b < a + b ∨ b = a + b
h : a = a + b
⊢ a ≤ b ∨ b ≤ a

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]; 

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}
x✝ : b < a + b ∨ b = a + b
h : a = a + b
⊢ a + b ≤ b ∨ b ≤ a + b

Next tactic:
exact Or.inr (le_add_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
        

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}
h₁ : b < a + b
h₂ : a < a + b
⊢ a ≤ b ∨ b ≤ a

Next tactic:
revert 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₂
        

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}
⊢ b < a + b → a < a + b → a ≤ b ∨ b ≤ a

Next tactic:
refine inductionOn a ?_
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 ?_
        

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],
    b < type r + b → type r < type r + b → type r ≤ b ∨ b ≤ type r

Next tactic:
intro α₁ r₁ _
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₁ _
        

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₁
⊢ b < type r₁ + b → type r₁ < type r₁ + b → type r₁ ≤ b ∨ b ≤ type r₁

Next tactic:
refine inductionOn b ?_
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 ?_
        

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],
    type r < type r₁ + type r → type r₁ < type r₁ + type r → type r₁ ≤ type r ∨ type r ≤ type r₁

Next tactic:
intro α₂ r₂ _ ⟨f⟩ ⟨g⟩
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⟩
        

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₂
⊢ type r₁ ≤ type r₂ ∨ type r₂ ≤ type r₁

Next tactic:
rw [← typein_top f, ← typein_top g, le_iff_lt_or_eq, le_iff_lt_or_eq,
                 typein_lt_typein, typein_lt_typein]