case pos
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : x = 0
⊢ count p (normalizedFactors x) = n

case neg
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : ¬x = 0
⊢ count p (normalizedFactors x) = n
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
⊢ count p (normalizedFactors x) = n
by_cases hx0 : x = 0
case neg
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : ¬x = 0
⊢ ↑(count p (normalizedFactors x)) = ↑n
case neg
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : ¬x = 0
⊢ count p (normalizedFactors x) = n
rw [← PartENat.natCast_inj]
case h.e'_2.h.e'_3.h.e'_3
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : ¬x = 0
⊢ p = ↑normalize p

case h.e'_3
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : ¬x = 0
⊢ ↑n = multiplicity p x
case neg
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : ¬x = 0
⊢ ↑(count p (normalizedFactors x)) = ↑n
convert (multiplicity_eq_count_normalizedFactors hp hx0).symm
no goals
case h.e'_3
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : ¬x = 0
⊢ ↑n = multiplicity p x
exact (multiplicity.eq_coe_iff.mpr ⟨hle, hlt⟩).symm
no goals
case pos
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : x = 0
⊢ count p (normalizedFactors x) = n
simp [hx0] at hlt
no goals
case h.e'_2.h.e'_3.h.e'_3
α : Type ?u.1059112
R : Type u_1
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : Nontrivial R
inst✝¹ : NormalizationMonoid R
dec_dvd : DecidableRel Dvd.dvd
inst✝ : DecidableEq R
p x : R
hp : Irreducible p
hnorm : ↑normalize p = p
n : ℕ
hle : p ^ n ∣ x
hlt : ¬p ^ (n + 1) ∣ x
this : DecidableRel fun x x_1 => x ∣ x_1 := fun x x_1 => Classical.propDecidable ((fun x x_2 => x ∣ x_2) x x_1)
hx0 : ¬x = 0
⊢ p = ↑normalize p
exact hnorm.symm