Theorem: Cardinal.add_eq_left_iff
File: Mathlib/SetTheory/Cardinal/Ordinal.lean

tactic: rw [max_le_iff]
state_before: a b : Cardinal.{u_1}
⊢ a + b = a ↔ max ℵ₀ b ≤ a ∨ b = 0
state_after: a b : Cardinal.{u_1}
⊢ a + b = a ↔ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0

tactic: refine ⟨fun h => ?_, ?_⟩
state_before: a b : Cardinal.{u_1}
⊢ a + b = a ↔ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0
state_after: case refine_1
a b : Cardinal.{u_1}
h : a + b = a
⊢ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0

case refine_2
a b : Cardinal.{u_1}
⊢ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0 → a + b = a

tactic: rcases le_or_lt ℵ₀ a with ha | ha
state_before: case refine_1
a b : Cardinal.{u_1}
h : a + b = a
⊢ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0
state_after: case refine_1.inl
a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0

case refine_1.inr
a b : Cardinal.{u_1}
h : a + b = a
ha : a < ℵ₀
⊢ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0

tactic: right
state_before: case refine_1.inr
a b : Cardinal.{u_1}
h : a + b = a
ha : a < ℵ₀
⊢ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0
state_after: case refine_1.inr.h
a b : Cardinal.{u_1}
h : a + b = a
ha : a < ℵ₀
⊢ b = 0

tactic: rw [← h, add_lt_aleph0_iff, lt_aleph0, lt_aleph0] at ha
state_before: case refine_1.inr.h
a b : Cardinal.{u_1}
h : a + b = a
ha : a < ℵ₀
⊢ b = 0
state_after: case refine_1.inr.h
a b : Cardinal.{u_1}
h : a + b = a
ha : (∃ n, a = ↑n) ∧ ∃ n, b = ↑n
⊢ b = 0

tactic: rcases ha with ⟨⟨n, rfl⟩, ⟨m, rfl⟩⟩
state_before: case refine_1.inr.h
a b : Cardinal.{u_1}
h : a + b = a
ha : (∃ n, a = ↑n) ∧ ∃ n, b = ↑n
⊢ b = 0
state_after: case refine_1.inr.h.intro.intro.intro
n m : ℕ
h : ↑n + ↑m = ↑n
⊢ ↑m = 0

tactic: norm_cast at h ⊢
state_before: case refine_1.inr.h.intro.intro.intro
n m : ℕ
h : ↑n + ↑m = ↑n
⊢ ↑m = 0
state_after: case refine_1.inr.h.intro.intro.intro
n m : ℕ
h : n + m = n
⊢ m = 0

tactic: rw [← add_right_inj, h, add_zero]
state_before: case refine_1.inr.h.intro.intro.intro
n m : ℕ
h : n + m = n
⊢ m = 0
state_after: no goals

tactic: left
state_before: case refine_1.inl
a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0
state_after: case refine_1.inl.h
a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ ℵ₀ ≤ a ∧ b ≤ a

tactic: use ha
state_before: case refine_1.inl.h
a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ ℵ₀ ≤ a ∧ b ≤ a
state_after: case right
a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ b ≤ a

tactic: rw [← not_lt]
state_before: case right
a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ b ≤ a
state_after: case right
a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ ¬a < b

tactic: apply fun hb => ne_of_gt _ h
state_before: case right
a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ ¬a < b
state_after: a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ a < b → a < a + b

tactic: intro hb
state_before: a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
⊢ a < b → a < a + b
state_after: a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
hb : a < b
⊢ a < a + b

tactic: exact hb.trans_le (self_le_add_left b a)
state_before: a b : Cardinal.{u_1}
h : a + b = a
ha : ℵ₀ ≤ a
hb : a < b
⊢ a < a + b
state_after: no goals

tactic: rintro (⟨h1, h2⟩ | h3)
state_before: case refine_2
a b : Cardinal.{u_1}
⊢ ℵ₀ ≤ a ∧ b ≤ a ∨ b = 0 → a + b = a
state_after: case refine_2.inl.intro
a b : Cardinal.{u_1}
h1 : ℵ₀ ≤ a
h2 : b ≤ a
⊢ a + b = a

case refine_2.inr
a b : Cardinal.{u_1}
h3 : b = 0
⊢ a + b = a

tactic: rw [add_eq_max h1, max_eq_left h2]
state_before: case refine_2.inl.intro
a b : Cardinal.{u_1}
h1 : ℵ₀ ≤ a
h2 : b ≤ a
⊢ a + b = a
state_after: no goals

tactic: rw [h3, add_zero]
state_before: case refine_2.inr
a b : Cardinal.{u_1}
h3 : b = 0
⊢ a + b = a
state_after: no goals