l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
⊢ toNat (x * y) = toNat x * toNat y

Next tactic:
rcases eq_or_ne x 0 with (rfl | hx1)
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · 

Proof state:
case inl
α β : Type u
c : Cardinal.{?u.510469}
y : Cardinal.{u_1}
⊢ toNat (0 * y) = toNat 0 * toNat y

Next tactic:
rw [zero_mul, zero_toNat, zero_mul]
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  

Proof state:
case inr
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
hx1 : x ≠ 0
⊢ toNat (x * y) = toNat x * toNat y

Next tactic:
rcases eq_or_ne y 0 with (rfl | hy1)
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · 

Proof state:
case inr.inl
α β : Type u
c : Cardinal.{?u.510469}
x : Cardinal.{u_1}
hx1 : x ≠ 0
⊢ toNat (x * 0) = toNat x * toNat 0

Next tactic:
rw [mul_zero, zero_toNat, mul_zero]
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  

Proof state:
case inr.inr
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
hx1 : x ≠ 0
hy1 : y ≠ 0
⊢ toNat (x * y) = toNat x * toNat y

Next tactic:
cases' lt_or_le x ℵ₀ with hx2 hx2
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  cases' lt_or_le x ℵ₀ with hx2 hx2
  · 

Proof state:
case inr.inr.inl
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
hx1 : x ≠ 0
hy1 : y ≠ 0
hx2 : x < ℵ₀
⊢ toNat (x * y) = toNat x * toNat y

Next tactic:
cases' lt_or_le y ℵ₀ with hy2 hy2
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  cases' lt_or_le x ℵ₀ with hx2 hx2
  · cases' lt_or_le y ℵ₀ with hy2 hy2
    · 

Proof state:
case inr.inr.inl.inl
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
hx1 : x ≠ 0
hy1 : y ≠ 0
hx2 : x < ℵ₀
hy2 : y < ℵ₀
⊢ toNat (x * y) = toNat x * toNat y

Next tactic:
lift x to ℕ using hx2
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  cases' lt_or_le x ℵ₀ with hx2 hx2
  · cases' lt_or_le y ℵ₀ with hy2 hy2
    · lift x to ℕ using hx2
      

Proof state:
case inr.inr.inl.inl.intro
α β : Type u
c : Cardinal.{?u.510469}
y : Cardinal.{u_1}
hy1 : y ≠ 0
hy2 : y < ℵ₀
x : ℕ
hx1 : ↑x ≠ 0
⊢ toNat (↑x * y) = toNat ↑x * toNat y

Next tactic:
lift y to ℕ using hy2
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  cases' lt_or_le x ℵ₀ with hx2 hx2
  · cases' lt_or_le y ℵ₀ with hy2 hy2
    · lift x to ℕ using hx2
      lift y to ℕ using hy2
      

Proof state:
case inr.inr.inl.inl.intro.intro
α β : Type u
c : Cardinal.{?u.510469}
x : ℕ
hx1 : ↑x ≠ 0
y : ℕ
hy1 : ↑y ≠ 0
⊢ toNat (↑x * ↑y) = toNat ↑x * toNat ↑y

Next tactic:
rw [← Nat.cast_mul, toNat_cast, toNat_cast, toNat_cast]
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  cases' lt_or_le x ℵ₀ with hx2 hx2
  · cases' lt_or_le y ℵ₀ with hy2 hy2
    · lift x to ℕ using hx2
      lift y to ℕ using hy2
      rw [← Nat.cast_mul, toNat_cast, toNat_cast, toNat_cast]
    · 

Proof state:
case inr.inr.inl.inr
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
hx1 : x ≠ 0
hy1 : y ≠ 0
hx2 : x < ℵ₀
hy2 : ℵ₀ ≤ y
⊢ toNat (x * y) = toNat x * toNat y

Next tactic:
rw [toNat_apply_of_aleph0_le hy2, mul_zero, toNat_apply_of_aleph0_le]
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  cases' lt_or_le x ℵ₀ with hx2 hx2
  · cases' lt_or_le y ℵ₀ with hy2 hy2
    · lift x to ℕ using hx2
      lift y to ℕ using hy2
      rw [← Nat.cast_mul, toNat_cast, toNat_cast, toNat_cast]
    · rw [toNat_apply_of_aleph0_le hy2, mul_zero, toNat_apply_of_aleph0_le]
      

Proof state:
case inr.inr.inl.inr
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
hx1 : x ≠ 0
hy1 : y ≠ 0
hx2 : x < ℵ₀
hy2 : ℵ₀ ≤ y
⊢ ℵ₀ ≤ x * y

Next tactic:
exact aleph0_le_mul_iff'.2 (Or.inl ⟨hx1, hy2⟩)
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  cases' lt_or_le x ℵ₀ with hx2 hx2
  · cases' lt_or_le y ℵ₀ with hy2 hy2
    · lift x to ℕ using hx2
      lift y to ℕ using hy2
      rw [← Nat.cast_mul, toNat_cast, toNat_cast, toNat_cast]
    · rw [toNat_apply_of_aleph0_le hy2, mul_zero, toNat_apply_of_aleph0_le]
      exact aleph0_le_mul_iff'.2 (Or.inl ⟨hx1, hy2⟩)
  · 

Proof state:
case inr.inr.inr
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
hx1 : x ≠ 0
hy1 : y ≠ 0
hx2 : ℵ₀ ≤ x
⊢ toNat (x * y) = toNat x * toNat y

Next tactic:
rw [toNat_apply_of_aleph0_le hx2, zero_mul, toNat_apply_of_aleph0_le]
@[simp]
theorem toNat_mul (x y : Cardinal) : toNat (x * y) = toNat x * toNat y := by
  rcases eq_or_ne x 0 with (rfl | hx1)
  · rw [zero_mul, zero_toNat, zero_mul]
  rcases eq_or_ne y 0 with (rfl | hy1)
  · rw [mul_zero, zero_toNat, mul_zero]
  cases' lt_or_le x ℵ₀ with hx2 hx2
  · cases' lt_or_le y ℵ₀ with hy2 hy2
    · lift x to ℕ using hx2
      lift y to ℕ using hy2
      rw [← Nat.cast_mul, toNat_cast, toNat_cast, toNat_cast]
    · rw [toNat_apply_of_aleph0_le hy2, mul_zero, toNat_apply_of_aleph0_le]
      exact aleph0_le_mul_iff'.2 (Or.inl ⟨hx1, hy2⟩)
  · rw [toNat_apply_of_aleph0_le hx2, zero_mul, toNat_apply_of_aleph0_le]
    

Proof state:
case inr.inr.inr
α β : Type u
c : Cardinal.{?u.510469}
x y : Cardinal.{u_1}
hx1 : x ≠ 0
hy1 : y ≠ 0
hx2 : ℵ₀ ≤ x
⊢ ℵ₀ ≤ x * y

Next tactic:
exact aleph0_le_mul_iff'.2 (Or.inr ⟨hx2, hy1⟩)
@[simp]
theorem toNat_add_of_lt_aleph0 {a : Cardinal.{u}} {b : Cardinal.{v}} (ha : a < ℵ₀) (hb : b < ℵ₀) :
    toNat (lift.{v, u} a + lift.{u, v} b) = toNat a + toNat b := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.565358}
a : Cardinal.{u}
b : Cardinal.{v}
ha : a < ℵ₀
hb : b < ℵ₀
⊢ toNat (lift.{v, u} a + lift.{u, v} b) = toNat a + toNat b

Next tactic:
apply Cardinal.natCast_injective
@[simp]
theorem toNat_add_of_lt_aleph0 {a : Cardinal.{u}} {b : Cardinal.{v}} (ha : a < ℵ₀) (hb : b < ℵ₀) :
    toNat (lift.{v, u} a + lift.{u, v} b) = toNat a + toNat b := by
  apply Cardinal.natCast_injective
  

Proof state:
case a
α β : Type u
c : Cardinal.{?u.565358}
a : Cardinal.{u}
b : Cardinal.{v}
ha : a < ℵ₀
hb : b < ℵ₀
⊢ ↑(toNat (lift.{v, u} a + lift.{u, v} b)) = ↑(toNat a + toNat b)

Next tactic:
replace ha : lift.{v, u} a < ℵ₀ := by rwa [lift_lt_aleph0]
@[simp]
theorem toNat_add_of_lt_aleph0 {a : Cardinal.{u}} {b : Cardinal.{v}} (ha : a < ℵ₀) (hb : b < ℵ₀) :
    toNat (lift.{v, u} a + lift.{u, v} b) = toNat a + toNat b := by
  apply Cardinal.natCast_injective
  replace ha : lift.{v, u} a < ℵ₀ := by 

Proof state:
α β : Type u
c : Cardinal.{?u.565358}
a : Cardinal.{u}
b : Cardinal.{v}
ha : a < ℵ₀
hb : b < ℵ₀
⊢ lift.{v, u} a < ℵ₀

Next tactic:
rwa [lift_lt_aleph0]
@[simp]
theorem toNat_add_of_lt_aleph0 {a : Cardinal.{u}} {b : Cardinal.{v}} (ha : a < ℵ₀) (hb : b < ℵ₀) :
    toNat (lift.{v, u} a + lift.{u, v} b) = toNat a + toNat b := by
  apply Cardinal.natCast_injective
  replace ha : lift.{v, u} a < ℵ₀ := by rwa [lift_lt_aleph0]
  

Proof state:
case a
α β : Type u
c : Cardinal.{?u.565358}
a : Cardinal.{u}
b : Cardinal.{v}
hb : b < ℵ₀
ha : lift.{v, u} a < ℵ₀
⊢ ↑(toNat (lift.{v, u} a + lift.{u, v} b)) = ↑(toNat a + toNat b)

Next tactic:
replace hb : lift.{u, v} b < ℵ₀ := by rwa [lift_lt_aleph0]
@[simp]
theorem toNat_add_of_lt_aleph0 {a : Cardinal.{u}} {b : Cardinal.{v}} (ha : a < ℵ₀) (hb : b < ℵ₀) :
    toNat (lift.{v, u} a + lift.{u, v} b) = toNat a + toNat b := by
  apply Cardinal.natCast_injective
  replace ha : lift.{v, u} a < ℵ₀ := by rwa [lift_lt_aleph0]
  replace hb : lift.{u, v} b < ℵ₀ := by 

Proof state:
α β : Type u
c : Cardinal.{?u.565358}
a : Cardinal.{u}
b : Cardinal.{v}
hb : b < ℵ₀
ha : lift.{v, u} a < ℵ₀
⊢ lift.{u, v} b < ℵ₀

Next tactic:
rwa [lift_lt_aleph0]
@[simp]
theorem toNat_add_of_lt_aleph0 {a : Cardinal.{u}} {b : Cardinal.{v}} (ha : a < ℵ₀) (hb : b < ℵ₀) :
    toNat (lift.{v, u} a + lift.{u, v} b) = toNat a + toNat b := by
  apply Cardinal.natCast_injective
  replace ha : lift.{v, u} a < ℵ₀ := by rwa [lift_lt_aleph0]
  replace hb : lift.{u, v} b < ℵ₀ := by rwa [lift_lt_aleph0]
  

Proof state:
case a
α β : Type u
c : Cardinal.{?u.565358}
a : Cardinal.{u}
b : Cardinal.{v}
ha : lift.{v, u} a < ℵ₀
hb : lift.{u, v} b < ℵ₀
⊢ ↑(toNat (lift.{v, u} a + lift.{u, v} b)) = ↑(toNat a + toNat b)

Next tactic:
rw [Nat.cast_add, ← toNat_lift.{v, u} a, ← toNat_lift.{u, v} b, cast_toNat_of_lt_aleph0 ha,
    cast_toNat_of_lt_aleph0 hb, cast_toNat_of_lt_aleph0 (add_lt_aleph0 ha hb)]
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by 

Proof state:
α β : Type u
c : Cardinal.{?u.592107}
⊢ (fun c => if c < ℵ₀ then ↑(toNat c) else ⊤) 0 = 0

Next tactic:
simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    

Proof state:
α β : Type u
c : Cardinal.{?u.592107}
x y : Cardinal.{?u.592489}
⊢ ZeroHom.toFun
      { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤, map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
      (x + y) =
    ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        x +
      ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        y

Next tactic:
by_cases hx : x < ℵ₀
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · 

Proof state:
case pos
α β : Type u
c : Cardinal.{?u.592107}
x y : Cardinal.{?u.603162}
hx : x < ℵ₀
⊢ ZeroHom.toFun
      { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤, map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
      (x + y) =
    ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        x +
      ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        y

Next tactic:
obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      

Proof state:
case pos.intro
α β : Type u
c : Cardinal.{?u.592107}
y : Cardinal.{?u.603162}
x0 : ℕ
hx : ↑x0 < ℵ₀
⊢ ZeroHom.toFun
      { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤, map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
      (↑x0 + y) =
    ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        ↑x0 +
      ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        y

Next tactic:
by_cases hy : y < ℵ₀
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · 

Proof state:
case pos
α β : Type u
c : Cardinal.{?u.592107}
y : Cardinal.{?u.603421}
x0 : ℕ
hx : ↑x0 < ℵ₀
hy : y < ℵ₀
⊢ ZeroHom.toFun
      { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤, map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
      (↑x0 + y) =
    ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        ↑x0 +
      ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        y

Next tactic:
obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        

Proof state:
case pos.intro
α β : Type u
c : Cardinal.{?u.592107}
x0 : ℕ
hx : ↑x0 < ℵ₀
y0 : ℕ
hy : ↑y0 < ℵ₀
⊢ ZeroHom.toFun
      { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤, map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
      (↑x0 + ↑y0) =
    ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        ↑x0 +
      ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        ↑y0

Next tactic:
simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
        

Proof state:
case pos.intro
α β : Type u
c : Cardinal.{?u.592107}
x0 : ℕ
hx : ↑x0 < ℵ₀
y0 : ℕ
hy : ↑y0 < ℵ₀
⊢ ↑(toNat (↑x0 + ↑y0)) = ↑x0 + ↑y0

Next tactic:
rw [← Nat.cast_add, toNat_cast, Nat.cast_add]
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
        rw [← Nat.cast_add, toNat_cast, Nat.cast_add]
      · 

Proof state:
case neg
α β : Type u
c : Cardinal.{?u.592107}
y : Cardinal.{?u.604361}
x0 : ℕ
hx : ↑x0 < ℵ₀
hy : ¬y < ℵ₀
⊢ ZeroHom.toFun
      { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤, map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
      (↑x0 + y) =
    ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        ↑x0 +
      ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        y

Next tactic:
simp_rw [if_neg hy, PartENat.add_top]
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
        rw [← Nat.cast_add, toNat_cast, Nat.cast_add]
      · simp_rw [if_neg hy, PartENat.add_top]
        

Proof state:
case neg
α β : Type u
c : Cardinal.{?u.592107}
y : Cardinal.{?u.604361}
x0 : ℕ
hx : ↑x0 < ℵ₀
hy : ¬y < ℵ₀
⊢ (if ↑x0 + y < ℵ₀ then ↑(toNat (↑x0 + y)) else ⊤) = ⊤

Next tactic:
contrapose! hy
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
        rw [← Nat.cast_add, toNat_cast, Nat.cast_add]
      · simp_rw [if_neg hy, PartENat.add_top]
        contrapose! hy
        

Proof state:
case neg
α β : Type u
c : Cardinal.{?u.592107}
y : Cardinal.{?u.604361}
x0 : ℕ
hx : ↑x0 < ℵ₀
hy : (if ↑x0 + y < ℵ₀ then ↑(toNat (↑x0 + y)) else ⊤) ≠ ⊤
⊢ y < ℵ₀

Next tactic:
simp only [ne_eq, ite_eq_right_iff, PartENat.natCast_ne_top, not_forall, exists_prop,
          and_true, not_false_eq_true] at hy
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
        rw [← Nat.cast_add, toNat_cast, Nat.cast_add]
      · simp_rw [if_neg hy, PartENat.add_top]
        contrapose! hy
        simp only [ne_eq, ite_eq_right_iff, PartENat.natCast_ne_top, not_forall, exists_prop,
          and_true, not_false_eq_true] at hy
        

Proof state:
case neg
α β : Type u
c : Cardinal.{?u.592107}
y : Cardinal.{?u.604361}
x0 : ℕ
hx : ↑x0 < ℵ₀
hy : ↑x0 + y < ℵ₀
⊢ y < ℵ₀

Next tactic:
exact le_add_self.trans_lt hy
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
        rw [← Nat.cast_add, toNat_cast, Nat.cast_add]
      · simp_rw [if_neg hy, PartENat.add_top]
        contrapose! hy
        simp only [ne_eq, ite_eq_right_iff, PartENat.natCast_ne_top, not_forall, exists_prop,
          and_true, not_false_eq_true] at hy
        exact le_add_self.trans_lt hy
    · 

Proof state:
case neg
α β : Type u
c : Cardinal.{?u.592107}
x y : Cardinal.{?u.604361}
hx : ¬x < ℵ₀
⊢ ZeroHom.toFun
      { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤, map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
      (x + y) =
    ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        x +
      ZeroHom.toFun
        { toFun := fun c => if c < ℵ₀ then ↑(toNat c) else ⊤,
          map_zero' := (_ : (if 0 < ℵ₀ then ↑(toNat 0) else ⊤) = 0) }
        y

Next tactic:
simp_rw [if_neg hx, PartENat.top_add]
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
        rw [← Nat.cast_add, toNat_cast, Nat.cast_add]
      · simp_rw [if_neg hy, PartENat.add_top]
        contrapose! hy
        simp only [ne_eq, ite_eq_right_iff, PartENat.natCast_ne_top, not_forall, exists_prop,
          and_true, not_false_eq_true] at hy
        exact le_add_self.trans_lt hy
    · simp_rw [if_neg hx, PartENat.top_add]
      

Proof state:
case neg
α β : Type u
c : Cardinal.{?u.592107}
x y : Cardinal.{?u.604361}
hx : ¬x < ℵ₀
⊢ (if x + y < ℵ₀ then ↑(toNat (x + y)) else ⊤) = ⊤

Next tactic:
contrapose! hx
/-- This function sends finite cardinals to the corresponding natural, and infinite cardinals
  to `⊤`. -/
def toPartENat : Cardinal →+ PartENat where
  toFun c := if c < ℵ₀ then toNat c else ⊤
  map_zero' := by simp [if_pos (zero_lt_one.trans one_lt_aleph0)]
  map_add' x y := by
    by_cases hx : x < ℵ₀
    · obtain ⟨x0, rfl⟩ := lt_aleph0.1 hx
      by_cases hy : y < ℵ₀
      · obtain ⟨y0, rfl⟩ := lt_aleph0.1 hy
        simp only [add_lt_aleph0 hx hy, hx, hy, toNat_cast, if_true]
        rw [← Nat.cast_add, toNat_cast, Nat.cast_add]
      · simp_rw [if_neg hy, PartENat.add_top]
        contrapose! hy
        simp only [ne_eq, ite_eq_right_iff, PartENat.natCast_ne_top, not_forall, exists_prop,
          and_true, not_false_eq_true] at hy
        exact le_add_self.trans_lt hy
    · simp_rw [if_neg hx, PartENat.top_add]
      contrapose! hx
      

Proof state:
case neg
α β : Type u
c : Cardinal.{?u.592107}
x y : Cardinal.{?u.604361}
hx : (if x + y < ℵ₀ then ↑(toNat (x + y)) else ⊤) ≠ ⊤
⊢ x < ℵ₀

Next tactic:
simp only [ne_eq, ite_eq_right_iff, PartENat.natCast_ne_top, not_forall, exists_prop,
        and_true, not_false_eq_true] at hx