Theorem: DiscreteValuationRing.associated_pow_irreducible
File: Mathlib/RingTheory/DiscreteValuationRing/Basic.lean

tactic: have : WfDvdMonoid R := IsNoetherianRing.wfDvdMonoid
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
⊢ ∃ n, Associated x (ϖ ^ n)

tactic: cases' WfDvdMonoid.exists_factors x hx with fx hfx
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
⊢ ∃ n, Associated x (ϖ ^ n)

tactic: use Multiset.card fx
state_before: case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
⊢ ∃ n, Associated x (ϖ ^ n)

tactic: have H := hfx.2
state_before: case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
⊢ Associated x (ϖ ^ ↑Multiset.card fx)

tactic: rw [← Associates.mk_eq_mk_iff_associated] at H⊢
state_before: case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associated (Multiset.prod fx) x
⊢ Associated x (ϖ ^ ↑Multiset.card fx)

tactic: rw [← H, ← Associates.prod_mk, Associates.mk_pow, ← Multiset.prod_replicate]
state_before: case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Associates.mk x = Associates.mk (ϖ ^ ↑Multiset.card fx)

tactic: congr 1
state_before: case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Multiset.prod (Multiset.map Associates.mk fx) =
    Multiset.prod (Multiset.replicate (↑Multiset.card fx) (Associates.mk ϖ))

tactic: rw [Multiset.eq_replicate]
state_before: case intro.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Multiset.map Associates.mk fx = Multiset.replicate (↑Multiset.card fx) (Associates.mk ϖ)

tactic: simp only [true_and_iff, and_imp, Multiset.card_map, eq_self_iff_true, Multiset.mem_map,
  exists_imp]
state_before: case intro.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ ↑Multiset.card (Multiset.map Associates.mk fx) = ↑Multiset.card fx ∧
    ∀ (b : Associates R), b ∈ Multiset.map Associates.mk fx → b = Associates.mk ϖ

tactic: rintro _ _ _ rfl
state_before: case intro.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ ∀ (b : Associates R) (x : R), x ∈ fx → Associates.mk x = b → b = Associates.mk ϖ

tactic: rw [Associates.mk_eq_mk_iff_associated]
state_before: case intro.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
x✝ : R
a✝ : x✝ ∈ fx
⊢ Associates.mk x✝ = Associates.mk ϖ

tactic: refine' associated_of_irreducible _ _ hirr
state_before: case intro.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
x✝ : R
a✝ : x✝ ∈ fx
⊢ Associated x✝ ϖ

tactic: apply hfx.1
state_before: case intro.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
x✝ : R
a✝ : x✝ ∈ fx
⊢ Irreducible x✝

tactic: assumption
state_before: case intro.e_a.a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
x✝ : R
a✝ : x✝ ∈ fx
⊢ x✝ ∈ fx