l3lab/ntp-mathlib huggingface dataset:
theorem lift_down' {a : Cardinal.{u}} {b : Ordinal.{max u v}}
    (h : card.{max u v} b ≤ Cardinal.lift.{v,u} a) : ∃ a', lift.{v,u} a' = b :=
  let ⟨c, e⟩ := Cardinal.lift_down h
  Cardinal.inductionOn c
    (fun α =>
      inductionOn b fun β s _ e' => by
        rw [card_type, ← Cardinal.lift_id'.{max u v, u} #β, ← Cardinal.lift_umax.{u, v},
          lift_mk_eq.{u, max u v, max u v}] at e'
        cases' e' with f
        have g := RelIso.preimage f s
        haveI := (g : f ⁻¹'o s ↪r s).isWellOrder
        

Proof state:
case intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a : Cardinal.{u}
b : Ordinal.{max u v}
h : card b ≤ Cardinal.lift.{v, u} a
c : Cardinal.{u}
e : Cardinal.lift.{v, u} c = card b
α : Type u
β : Type (max u v)
s : β → β → Prop
x✝ : IsWellOrder β s
f : α ≃ β
g : ⇑f ⁻¹'o s ≃r s
this : IsWellOrder α (⇑f ⁻¹'o s)
⊢ ∃ a', lift.{v, u} a' = type s

Next tactic:
have := lift_type_eq.{u, max u v, max u v}.2 ⟨g⟩
theorem lift_down' {a : Cardinal.{u}} {b : Ordinal.{max u v}}
    (h : card.{max u v} b ≤ Cardinal.lift.{v,u} a) : ∃ a', lift.{v,u} a' = b :=
  let ⟨c, e⟩ := Cardinal.lift_down h
  Cardinal.inductionOn c
    (fun α =>
      inductionOn b fun β s _ e' => by
        rw [card_type, ← Cardinal.lift_id'.{max u v, u} #β, ← Cardinal.lift_umax.{u, v},
          lift_mk_eq.{u, max u v, max u v}] at e'
        cases' e' with f
        have g := RelIso.preimage f s
        haveI := (g : f ⁻¹'o s ↪r s).isWellOrder
        have := lift_type_eq.{u, max u v, max u v}.2 ⟨g⟩
        

Proof state:
case intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a : Cardinal.{u}
b : Ordinal.{max u v}
h : card b ≤ Cardinal.lift.{v, u} a
c : Cardinal.{u}
e : Cardinal.lift.{v, u} c = card b
α : Type u
β : Type (max u v)
s : β → β → Prop
x✝ : IsWellOrder β s
f : α ≃ β
g : ⇑f ⁻¹'o s ≃r s
this✝ : IsWellOrder α (⇑f ⁻¹'o s)
this : lift.{max u v, u} (type (⇑f ⁻¹'o s)) = lift.{max u v, max u v} (type s)
⊢ ∃ a', lift.{v, u} a' = type s

Next tactic:
rw [lift_id, lift_umax.{u, v}] at this
theorem lift_down' {a : Cardinal.{u}} {b : Ordinal.{max u v}}
    (h : card.{max u v} b ≤ Cardinal.lift.{v,u} a) : ∃ a', lift.{v,u} a' = b :=
  let ⟨c, e⟩ := Cardinal.lift_down h
  Cardinal.inductionOn c
    (fun α =>
      inductionOn b fun β s _ e' => by
        rw [card_type, ← Cardinal.lift_id'.{max u v, u} #β, ← Cardinal.lift_umax.{u, v},
          lift_mk_eq.{u, max u v, max u v}] at e'
        cases' e' with f
        have g := RelIso.preimage f s
        haveI := (g : f ⁻¹'o s ↪r s).isWellOrder
        have := lift_type_eq.{u, max u v, max u v}.2 ⟨g⟩
        rw [lift_id, lift_umax.{u, v}] at this
        

Proof state:
case intro
α✝ : Type u
β✝ : Type u_1
γ : Type u_2
r : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t : γ → γ → Prop
a : Cardinal.{u}
b : Ordinal.{max u v}
h : card b ≤ Cardinal.lift.{v, u} a
c : Cardinal.{u}
e : Cardinal.lift.{v, u} c = card b
α : Type u
β : Type (max u v)
s : β → β → Prop
x✝ : IsWellOrder β s
f : α ≃ β
g : ⇑f ⁻¹'o s ≃r s
this✝ : IsWellOrder α (⇑f ⁻¹'o s)
this : lift.{v, u} (type (⇑f ⁻¹'o s)) = type s
⊢ ∃ a', lift.{v, u} a' = type s

Next tactic:
exact ⟨_, this⟩
theorem lift_down {a : Ordinal.{u}} {b : Ordinal.{max u v}} (h : b ≤ lift.{v,u} a) :
    ∃ a', lift.{v,u} a' = b :=
  @lift_down' (card a) _ (by 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a : Ordinal.{u}
b : Ordinal.{max u v}
h : b ≤ lift.{v, u} a
⊢ card b ≤ Cardinal.lift.{v, u} (card a)

Next tactic:
rw [lift_card]
theorem lift_down {a : Ordinal.{u}} {b : Ordinal.{max u v}} (h : b ≤ lift.{v,u} a) :
    ∃ a', lift.{v,u} a' = b :=
  @lift_down' (card a) _ (by rw [lift_card]; 

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
a : Ordinal.{u}
b : Ordinal.{max u v}
h : b ≤ lift.{v, u} a
⊢ card b ≤ card (lift.{v, u} a)

Next tactic:
exact card_le_card h
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          

Proof state:
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
⊢ ∀ {a b : (α ⊕ β) ⊕ γ}, Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) a) ((sumAssoc α β γ) b) ↔ Sum.Lex (Sum.Lex r s) t a b

Next tactic:
intros a b
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          

Proof state:
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a b : (α ⊕ β) ⊕ γ
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) a) ((sumAssoc α β γ) b) ↔ Sum.Lex (Sum.Lex r s) t a b

Next tactic:
rcases a with (⟨a | a⟩ | a)
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> 

Proof state:
case inl.inl
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
b : (α ⊕ β) ⊕ γ
a : α
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inl (Sum.inl a))) ((sumAssoc α β γ) b) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inl (Sum.inl a)) b

Next tactic:
rcases b with (⟨b | b⟩ | b)
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> 

Proof state:
case inl.inr
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
b : (α ⊕ β) ⊕ γ
a : β
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inl (Sum.inr a))) ((sumAssoc α β γ) b) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inl (Sum.inr a)) b

Next tactic:
rcases b with (⟨b | b⟩ | b)
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> 

Proof state:
case inr
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
b : (α ⊕ β) ⊕ γ
a : γ
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inr a)) ((sumAssoc α β γ) b) ↔ Sum.Lex (Sum.Lex r s) t (Sum.inr a) b

Next tactic:
rcases b with (⟨b | b⟩ | b)
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inl.inl.inl.inl
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a b : α
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inl (Sum.inl a))) ((sumAssoc α β γ) (Sum.inl (Sum.inl b))) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inl (Sum.inl a)) (Sum.inl (Sum.inl b))

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inl.inl.inl.inr
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a : α
b : β
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inl (Sum.inl a))) ((sumAssoc α β γ) (Sum.inl (Sum.inr b))) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inl (Sum.inl a)) (Sum.inl (Sum.inr b))

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inl.inl.inr
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a : α
b : γ
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inl (Sum.inl a))) ((sumAssoc α β γ) (Sum.inr b)) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inl (Sum.inl a)) (Sum.inr b)

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inl.inr.inl.inl
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a : β
b : α
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inl (Sum.inr a))) ((sumAssoc α β γ) (Sum.inl (Sum.inl b))) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inl (Sum.inr a)) (Sum.inl (Sum.inl b))

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inl.inr.inl.inr
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a b : β
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inl (Sum.inr a))) ((sumAssoc α β γ) (Sum.inl (Sum.inr b))) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inl (Sum.inr a)) (Sum.inl (Sum.inr b))

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inl.inr.inr
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a : β
b : γ
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inl (Sum.inr a))) ((sumAssoc α β γ) (Sum.inr b)) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inl (Sum.inr a)) (Sum.inr b)

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inr.inl.inl
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a : γ
b : α
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inr a)) ((sumAssoc α β γ) (Sum.inl (Sum.inl b))) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inr a) (Sum.inl (Sum.inl b))

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inr.inl.inr
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a : γ
b : β
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inr a)) ((sumAssoc α β γ) (Sum.inl (Sum.inr b))) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inr a) (Sum.inl (Sum.inr b))

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
  add := (· + ·)
  zero := 0
  one := 1
  zero_add o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(emptySum PEmpty α).symm, Sum.lex_inr_inr⟩⟩
  add_zero o :=
    inductionOn o fun α r _ =>
      Eq.symm <| Quotient.sound ⟨⟨(sumEmpty α PEmpty).symm, Sum.lex_inl_inl⟩⟩
  add_assoc o₁ o₂ o₃ :=
    Quotient.inductionOn₃ o₁ o₂ o₃ fun ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨γ, t, _⟩ =>
      Quot.sound
        ⟨⟨sumAssoc _ _ _, by
          intros a b
          rcases a with (⟨a | a⟩ | a) <;> rcases b with (⟨b | b⟩ | b) <;>
            

Proof state:
case inr.inr
α✝ : Type u
β✝ : Type u_1
γ✝ : Type u_2
r✝ : α✝ → α✝ → Prop
s✝ : β✝ → β✝ → Prop
t✝ : γ✝ → γ✝ → Prop
o₁ o₂ o₃ : Ordinal.{u}
x✝² x✝¹ x✝ : WellOrder
α : Type u
r : α → α → Prop
wo✝² : IsWellOrder α r
β : Type u
s : β → β → Prop
wo✝¹ : IsWellOrder β s
γ : Type u
t : γ → γ → Prop
wo✝ : IsWellOrder γ t
a b : γ
⊢ Sum.Lex r (Sum.Lex s t) ((sumAssoc α β γ) (Sum.inr a)) ((sumAssoc α β γ) (Sum.inr b)) ↔
    Sum.Lex (Sum.Lex r s) t (Sum.inr a) (Sum.inr b)

Next tactic:
simp only [sumAssoc_apply_inl_inl, sumAssoc_apply_inl_inr, sumAssoc_apply_inr,
              Sum.lex_inl_inl, Sum.lex_inr_inr, Sum.Lex.sep, Sum.lex_inr_inl]
@[simp]
theorem card_nat (n : ℕ) : card.{u} n = n := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
n : ℕ
⊢ card ↑n = ↑n

Next tactic:
induction n <;> [simp; simp only [card_add, card_one, Nat.cast_succ, *]]
@[simp]
theorem card_nat (n : ℕ) : card.{u} n = n := by
  

Proof state:
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
n : ℕ
⊢ card ↑n = ↑n

Next tactic:
induction n
@[simp]
theorem card_nat (n : ℕ) : card.{u} n = n := by
  induction n <;> [

Proof state:
case zero
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
⊢ card ↑Nat.zero = ↑Nat.zero

Next tactic:
simp
@[simp]
theorem card_nat (n : ℕ) : card.{u} n = n := by
  induction n <;> [simp; 

Proof state:
case succ
α : Type u
β : Type u_1
γ : Type u_2
r : α → α → Prop
s : β → β → Prop
t : γ → γ → Prop
n✝ : ℕ
n_ih✝ : card ↑n✝ = ↑n✝
⊢ card ↑(Nat.succ n✝) = ↑(Nat.succ n✝)

Next tactic:
simp only [card_add, card_one, Nat.cast_succ, *]
instance add_covariantClass_le : CovariantClass Ordinal.{u} Ordinal.{u} (· + ·) (· ≤ ·) 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
⊢ c + a ≤ c + b

Next tactic:
revert h c
instance add_covariantClass_le : CovariantClass Ordinal.{u} Ordinal.{u} (· + ·) (· ≤ ·) 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 → c + a ≤ c + b

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

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

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

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₂ → c + type r₁ ≤ c + type r₂

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

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

Next tactic:
refine inductionOn c (fun β s _ ↦ ?_)