Theorem: DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization.toUniqueFactorizationMonoid
File: Mathlib/RingTheory/DiscreteValuationRing/Basic.lean

tactic: use Multiset.replicate (Classical.choose (spec.2 hx)) p
state_before: R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ ∃ f, (∀ b ∈ f, Prime b) ∧ Associated f.prod x
state_after: case h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ (∀ b ∈ Multiset.replicate (Classical.choose ⋯) p, Prime b) ∧
    Associated (Multiset.replicate (Classical.choose ⋯) p).prod x

tactic: constructor
state_before: case h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ (∀ b ∈ Multiset.replicate (Classical.choose ⋯) p, Prime b) ∧
    Associated (Multiset.replicate (Classical.choose ⋯) p).prod x
state_after: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ ∀ b ∈ Multiset.replicate (Classical.choose ⋯) p, Prime b

case h.right
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ Associated (Multiset.replicate (Classical.choose ⋯) p).prod x

tactic: intro q hq
state_before: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ ∀ b ∈ Multiset.replicate (Classical.choose ⋯) p, Prime b
state_after: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
⊢ Prime q

tactic: have hpq := Multiset.eq_of_mem_replicate hq
state_before: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
⊢ Prime q
state_after: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
⊢ Prime q

tactic: rw [hpq]
state_before: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
⊢ Prime q
state_after: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
⊢ Prime p

tactic: refine ⟨spec.1.ne_zero, spec.1.not_unit, ?_⟩
state_before: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
⊢ Prime p
state_after: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
⊢ ∀ (a b : R), p ∣ a * b → p ∣ a ∨ p ∣ b

tactic: intro a b h
state_before: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
⊢ ∀ (a b : R), p ∣ a * b → p ∣ a ∨ p ∣ b
state_after: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
a b : R
h : p ∣ a * b
⊢ p ∣ a ∨ p ∣ b

tactic: by_cases ha : a = 0
state_before: case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
a b : R
h : p ∣ a * b
⊢ p ∣ a ∨ p ∣ b
state_after: case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : a = 0
⊢ p ∣ a ∨ p ∣ b

case neg
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : ¬a = 0
⊢ p ∣ a ∨ p ∣ b

tactic: obtain ⟨m, u, rfl⟩ := spec.2 ha
state_before: case neg
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : ¬a = 0
⊢ p ∣ a ∨ p ∣ b
state_after: case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * ↑u * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
⊢ p ∣ Classical.choose hR ^ m * ↑u ∨ p ∣ b

tactic: rw [mul_assoc, mul_left_comm, Units.dvd_mul_left] at h
state_before: case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * ↑u * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
⊢ p ∣ Classical.choose hR ^ m * ↑u ∨ p ∣ b
state_after: case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
⊢ p ∣ Classical.choose hR ^ m * ↑u ∨ p ∣ b

tactic: rw [Units.dvd_mul_right]
state_before: case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
⊢ p ∣ Classical.choose hR ^ m * ↑u ∨ p ∣ b
state_after: case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
⊢ p ∣ Classical.choose hR ^ m ∨ p ∣ b

tactic: by_cases hm : m = 0
state_before: case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
⊢ p ∣ Classical.choose hR ^ m ∨ p ∣ b
state_after: case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : m = 0
⊢ p ∣ Classical.choose hR ^ m ∨ p ∣ b

case neg
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : ¬m = 0
⊢ p ∣ Classical.choose hR ^ m ∨ p ∣ b

tactic: left
state_before: case neg
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : ¬m = 0
⊢ p ∣ Classical.choose hR ^ m ∨ p ∣ b
state_after: case neg.h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : ¬m = 0
⊢ p ∣ Classical.choose hR ^ m

tactic: obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hm
state_before: case neg.h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : ¬m = 0
⊢ p ∣ Classical.choose hR ^ m
state_after: case neg.h.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
u : Rˣ
m : ℕ
h : p ∣ Classical.choose hR ^ m.succ * b
ha : ¬Classical.choose hR ^ m.succ * ↑u = 0
hm : ¬m.succ = 0
⊢ p ∣ Classical.choose hR ^ m.succ

tactic: rw [pow_succ']
state_before: case neg.h.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
u : Rˣ
m : ℕ
h : p ∣ Classical.choose hR ^ m.succ * b
ha : ¬Classical.choose hR ^ m.succ * ↑u = 0
hm : ¬m.succ = 0
⊢ p ∣ Classical.choose hR ^ m.succ
state_after: case neg.h.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
u : Rˣ
m : ℕ
h : p ∣ Classical.choose hR ^ m.succ * b
ha : ¬Classical.choose hR ^ m.succ * ↑u = 0
hm : ¬m.succ = 0
⊢ p ∣ Classical.choose hR * Classical.choose hR ^ m

tactic: apply dvd_mul_of_dvd_left dvd_rfl _
state_before: case neg.h.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
u : Rˣ
m : ℕ
h : p ∣ Classical.choose hR ^ m.succ * b
ha : ¬Classical.choose hR ^ m.succ * ↑u = 0
hm : ¬m.succ = 0
⊢ p ∣ Classical.choose hR * Classical.choose hR ^ m
state_after: no goals

tactic: rw [ha]
state_before: case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : a = 0
⊢ p ∣ a ∨ p ∣ b
state_after: case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : a = 0
⊢ p ∣ 0 ∨ p ∣ b

tactic: simp only [true_or_iff, dvd_zero]
state_before: case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : a = 0
⊢ p ∣ 0 ∨ p ∣ b
state_after: no goals

tactic: simp only [hm, one_mul, pow_zero] at h ⊢
state_before: case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ Classical.choose hR ^ m * b
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : m = 0
⊢ p ∣ Classical.choose hR ^ m ∨ p ∣ b
state_after: case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : m = 0
h : p ∣ b
⊢ p ∣ 1 ∨ p ∣ b

tactic: right
state_before: case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : m = 0
h : p ∣ b
⊢ p ∣ 1 ∨ p ∣ b
state_after: case pos.h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : m = 0
h : p ∣ b
⊢ p ∣ b

tactic: exact h
state_before: case pos.h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (Classical.choose ⋯) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
ha : ¬Classical.choose hR ^ m * ↑u = 0
hm : m = 0
h : p ∣ b
⊢ p ∣ b
state_after: no goals

tactic: rw [Multiset.prod_replicate]
state_before: case h.right
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ Associated (Multiset.replicate (Classical.choose ⋯) p).prod x
state_after: case h.right
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ Associated (p ^ Classical.choose ⋯) x

tactic: exact Classical.choose_spec (spec.2 hx)
state_before: case h.right
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := Classical.choose hR
spec : Irreducible (Classical.choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (Classical.choose hR ^ n) x :=
  Classical.choose_spec hR
x : R
hx : x ≠ 0
⊢ Associated (p ^ Classical.choose ⋯) x
state_after: no goals