Theorem: Cardinal.isUnit_iff
File: Mathlib/SetTheory/Cardinal/Divisibility.lean

tactic: refine
  ⟨fun h => ?_, by
    rintro rfl
    exact isUnit_one⟩
state_before: a b : Cardinal.{u}
n m : ℕ
⊢ IsUnit a ↔ a = 1
state_after: a b : Cardinal.{u}
n m : ℕ
h : IsUnit a
⊢ a = 1

tactic: rcases eq_or_ne a 0 with (rfl | ha)
state_before: a b : Cardinal.{u}
n m : ℕ
h : IsUnit a
⊢ a = 1
state_after: case inl
b : Cardinal.{u}
n m : ℕ
h : IsUnit 0
⊢ 0 = 1

case inr
a b : Cardinal.{u}
n m : ℕ
h : IsUnit a
ha : a ≠ 0
⊢ a = 1

tactic: rw [isUnit_iff_forall_dvd] at h
state_before: case inr
a b : Cardinal.{u}
n m : ℕ
h : IsUnit a
ha : a ≠ 0
⊢ a = 1
state_after: case inr
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
⊢ a = 1

tactic: cases' h 1 with t ht
state_before: case inr
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
⊢ a = 1
state_after: case inr.intro
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : 1 = a * t
⊢ a = 1

tactic: rw [eq_comm, mul_eq_one_iff'] at ht
state_before: case inr.intro
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : 1 = a * t
⊢ a = 1
state_after: case inr.intro
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a = 1 ∧ t = 1
⊢ a = 1

case inr.intro.ha
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a * t = 1
⊢ 1 ≤ a

case inr.intro.hb
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a * t = 1
⊢ 1 ≤ t

tactic: rintro rfl
state_before: a b : Cardinal.{u}
n m : ℕ
⊢ a = 1 → IsUnit a
state_after: b : Cardinal.{u}
n m : ℕ
⊢ IsUnit 1

tactic: exact isUnit_one
state_before: b : Cardinal.{u}
n m : ℕ
⊢ IsUnit 1
state_after: no goals

tactic: exact (not_isUnit_zero h).elim
state_before: case inl
b : Cardinal.{u}
n m : ℕ
h : IsUnit 0
⊢ 0 = 1
state_after: no goals

tactic: exact ht.1
state_before: case inr.intro
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a = 1 ∧ t = 1
⊢ a = 1
state_after: no goals

tactic: exact one_le_iff_ne_zero.mpr ha
state_before: case inr.intro.ha
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a * t = 1
⊢ 1 ≤ a
state_after: no goals

tactic: apply one_le_iff_ne_zero.mpr
state_before: case inr.intro.hb
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a * t = 1
⊢ 1 ≤ t
state_after: case inr.intro.hb
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a * t = 1
⊢ t ≠ 0

tactic: intro h
state_before: case inr.intro.hb
a b : Cardinal.{u}
n m : ℕ
h : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a * t = 1
⊢ t ≠ 0
state_after: case inr.intro.hb
a b : Cardinal.{u}
n m : ℕ
h✝ : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a * t = 1
h : t = 0
⊢ False

tactic: rw [h, mul_zero] at ht
state_before: case inr.intro.hb
a b : Cardinal.{u}
n m : ℕ
h✝ : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : a * t = 1
h : t = 0
⊢ False
state_after: case inr.intro.hb
a b : Cardinal.{u}
n m : ℕ
h✝ : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : 0 = 1
h : t = 0
⊢ False

tactic: exact zero_ne_one ht
state_before: case inr.intro.hb
a b : Cardinal.{u}
n m : ℕ
h✝ : ∀ (y : Cardinal.{u}), a ∣ y
ha : a ≠ 0
t : Cardinal.{u}
ht : 0 = 1
h : t = 0
⊢ False
state_after: no goals