l3lab/ntp-mathlib huggingface dataset:
instance add_covariantClass_le : CovariantClass Ordinal.{u} Ordinal.{u} (· + ·) (· ≤ ·) 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 _ ↦ ?_)
    refine ⟨⟨⟨(Embedding.refl.{u+1} _).sumMap f, ?_⟩, ?_⟩⟩
    · intros a b
      match a, b with
      | Sum.inl a, Sum.inl b => exact Sum.lex_inl_inl.trans Sum.lex_inl_inl.symm
      | Sum.inl a, Sum.inr b => apply iff_of_true <;> apply Sum.Lex.sep
      | Sum.inr a, Sum.inl b => apply iff_of_false <;> exact Sum.lex_inr_inl
      | Sum.inr a, Sum.inr b => exact Sum.lex_inr_inr.trans <| fo.trans Sum.lex_inr_inr.symm
    · intros a b H
      match a, b, H with
      | _, Sum.inl b, _ => exact ⟨Sum.inl b, rfl⟩
      | Sum.inl a, Sum.inr b, H => exact (Sum.lex_inr_inl H).elim
      | Sum.inr a, Sum.inr b, H =>
        

Proof state:
α : 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 s r₂ b✝
    ({ toEmbedding := Embedding.sumMap (Embedding.refl β) f,
        map_rel_iff' :=
          (_ :
            ∀ {a b : β ⊕ α₁},
              Sum.Lex s r₂ ((Embedding.sumMap (Embedding.refl β) f) a) ((Embedding.sumMap (Embedding.refl β) f) b) ↔
                Sum.Lex s r₁ a b) }
      a✝)
a : α₁
b : α₂
H :
  Sum.Lex s r₂ (Sum.inr b)
    ({ toEmbedding := Embedding.sumMap (Embedding.refl β) f,
        map_rel_iff' :=
          (_ :
            ∀ {a b : β ⊕ α₁},
              Sum.Lex s r₂ ((Embedding.sumMap (Embedding.refl β) f) a) ((Embedding.sumMap (Embedding.refl β) f) b) ↔
                Sum.Lex s r₁ a b) }
      (Sum.inr a))
⊢ ∃ a',
    { toEmbedding := Embedding.sumMap (Embedding.refl β) f,
          map_rel_iff' :=
            (_ :
              ∀ {a b : β ⊕ α₁},
                Sum.Lex s r₂ ((Embedding.sumMap (Embedding.refl β) f) a) ((Embedding.sumMap (Embedding.refl β) f) b) ↔
                  Sum.Lex s r₁ a b) }
        a' =
      Sum.inr b

Next tactic:
let ⟨w, h⟩ := fi _ _ (Sum.lex_inr_inr.1 H)
instance add_covariantClass_le : CovariantClass Ordinal.{u} Ordinal.{u} (· + ·) (· ≤ ·) 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 _ ↦ ?_)
    refine ⟨⟨⟨(Embedding.refl.{u+1} _).sumMap f, ?_⟩, ?_⟩⟩
    · intros a b
      match a, b with
      | Sum.inl a, Sum.inl b => exact Sum.lex_inl_inl.trans Sum.lex_inl_inl.symm
      | Sum.inl a, Sum.inr b => apply iff_of_true <;> apply Sum.Lex.sep
      | Sum.inr a, Sum.inl b => apply iff_of_false <;> exact Sum.lex_inr_inl
      | Sum.inr a, Sum.inr b => exact Sum.lex_inr_inr.trans <| fo.trans Sum.lex_inr_inr.symm
    · intros a b H
      match a, b, H with
      | _, Sum.inl b, _ => exact ⟨Sum.inl b, rfl⟩
      | Sum.inl a, Sum.inr b, H => exact (Sum.lex_inr_inl H).elim
      | Sum.inr a, Sum.inr b, H =>
        let ⟨w, h⟩ := fi _ _ (Sum.lex_inr_inr.1 H)
        

Proof state:
α : 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 s r₂ b✝
    ({ toEmbedding := Embedding.sumMap (Embedding.refl β) f,
        map_rel_iff' :=
          (_ :
            ∀ {a b : β ⊕ α₁},
              Sum.Lex s r₂ ((Embedding.sumMap (Embedding.refl β) f) a) ((Embedding.sumMap (Embedding.refl β) f) b) ↔
                Sum.Lex s r₁ a b) }
      a✝)
a : α₁
b : α₂
H :
  Sum.Lex s r₂ (Sum.inr b)
    ({ toEmbedding := Embedding.sumMap (Embedding.refl β) f,
        map_rel_iff' :=
          (_ :
            ∀ {a b : β ⊕ α₁},
              Sum.Lex s r₂ ((Embedding.sumMap (Embedding.refl β) f) a) ((Embedding.sumMap (Embedding.refl β) f) b) ↔
                Sum.Lex s r₁ a b) }
      (Sum.inr a))
w : α₁
h : { toEmbedding := f, map_rel_iff' := fo } w = b
⊢ ∃ a',
    { toEmbedding := Embedding.sumMap (Embedding.refl β) f,
          map_rel_iff' :=
            (_ :
              ∀ {a b : β ⊕ α₁},
                Sum.Lex s r₂ ((Embedding.sumMap (Embedding.refl β) f) a) ((Embedding.sumMap (Embedding.refl β) f) b) ↔
                  Sum.Lex s r₁ a b) }
        a' =
      Sum.inr b

Next tactic:
exact ⟨Sum.inr w, congr_arg Sum.inr h⟩
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
c a b : Ordinal.{u}
h : a ≤ b
⊢ Function.swap (fun x x_1 => x + x_1) c a ≤ Function.swap (fun x x_1 => x + x_1) c b

Next tactic:
revert h c
instance add_swap_covariantClass_le :
    CovariantClass Ordinal.{u} Ordinal.{u} (swap (· + ·)) (· ≤ ·) where
  elim := fun c a b h => by
    revert h c
    

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a b : Ordinal.{u}
⊢ ∀ (c : Ordinal.{u}), a ≤ b → Function.swap (fun x x_1 => x + x_1) c a ≤ Function.swap (fun x x_1 => x + x_1) c b

Next tactic:
refine inductionOn a (fun α₁ r₁ _ ↦ ?_)
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₁ _ ↦ ?_)
    

Proof state:
α : 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₁
⊢ ∀ (c : Ordinal.{u}),
    type r₁ ≤ b → Function.swap (fun x x_1 => x + x_1) c (type r₁) ≤ Function.swap (fun x x_1 => x + x_1) c b

Next tactic:
refine inductionOn b (fun α₂ r₂ _ ↦ ?_)
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₂ _ ↦ ?_)
    

Proof state:
α : 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}),
    type r₁ ≤ type r₂ →
      Function.swap (fun x x_1 => x + x_1) c (type r₁) ≤ Function.swap (fun x x_1 => x + x_1) c (type r₂)

Next tactic:
rintro c ⟨⟨⟨f, fo⟩, fi⟩⟩
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⟩⟩
    

Proof state:
case intro.mk.mk
α : 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
⊢ Function.swap (fun x x_1 => x + x_1) c (type r₁) ≤ Function.swap (fun x x_1 => x + x_1) c (type r₂)

Next tactic:
refine inductionOn c (fun β s _ ↦ ?_)
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 _ ↦ ?_)
    

Proof state:
case intro.mk.mk
α : 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
⊢ Function.swap (fun x x_1 => x + x_1) (type s) (type r₁) ≤ Function.swap (fun x x_1 => x + x_1) (type s) (type r₂)

Next tactic:
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]; 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
                

Proof state:
α : 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 β)) a) ((Embedding.sumMap f (Embedding.refl β)) b) ↔
      Sum.Lex r₁ s a b

Next tactic:
intro a b
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
                

Proof state:
α : 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 β)) a) ((Embedding.sumMap f (Embedding.refl β)) b) ↔
    Sum.Lex r₁ s a 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 <;> 

Proof state:
case mp
α : 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 β)) a) ((Embedding.sumMap f (Embedding.refl β)) b) →
    Sum.Lex r₁ s a b

Next tactic:
intro 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 <;> 

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 : α₁ ⊕ β
⊢ Sum.Lex r₁ s a b →
    Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) a) ((Embedding.sumMap f (Embedding.refl β)) b)

Next tactic:
intro 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
                · 

Proof state:
case mp
α : 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 ((Embedding.sumMap f (Embedding.refl β)) a) ((Embedding.sumMap f (Embedding.refl β)) b)
⊢ Sum.Lex r₁ s a b

Next tactic:
cases' a with a a <;> cases' b with b b <;> 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
                · 

Proof state:
case mp
α : 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 ((Embedding.sumMap f (Embedding.refl β)) a) ((Embedding.sumMap f (Embedding.refl β)) b)
⊢ Sum.Lex r₁ s a b

Next tactic:
cases' a with a a
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 <;> 

Proof state:
case mp.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
b : α₁ ⊕ β
a : α₁
H : Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inl a)) ((Embedding.sumMap f (Embedding.refl β)) b)
⊢ Sum.Lex r₁ s (Sum.inl a) b

Next tactic:
cases' b with b b
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 <;> 

Proof state:
case mp.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 : α₁ ⊕ β
a : β
H : Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inr a)) ((Embedding.sumMap f (Embedding.refl β)) b)
⊢ Sum.Lex r₁ s (Sum.inr a) b

Next tactic:
cases' b with b b
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 <;> 

Proof state:
case mp.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 :
  Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inl a))
    ((Embedding.sumMap f (Embedding.refl β)) (Sum.inl b))
⊢ Sum.Lex r₁ s (Sum.inl a) (Sum.inl 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 <;> 

Proof state:
case mp.inl.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 :
  Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inl a))
    ((Embedding.sumMap f (Embedding.refl β)) (Sum.inr b))
⊢ Sum.Lex r₁ s (Sum.inl a) (Sum.inr 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 <;> 

Proof state:
case mp.inr.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 :
  Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inr a))
    ((Embedding.sumMap f (Embedding.refl β)) (Sum.inl b))
⊢ Sum.Lex r₁ s (Sum.inr a) (Sum.inl 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 <;> 

Proof state:
case mp.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 :
  Sum.Lex r₂ s ((Embedding.sumMap f (Embedding.refl β)) (Sum.inr a))
    ((Embedding.sumMap f (Embedding.refl β)) (Sum.inr b))
⊢ Sum.Lex r₁ s (Sum.inr a) (Sum.inr b)

Next tactic:
cases H