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

tactic: obtain ⟨p, hp⟩ := h₁
state_before: R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
⊢ HasUnitMulPowIrreducibleFactorization R
state_after: case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
⊢ HasUnitMulPowIrreducibleFactorization R

tactic: refine ⟨p, hp, ?_⟩
state_before: case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
⊢ HasUnitMulPowIrreducibleFactorization R
state_after: case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
⊢ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x

tactic: intro x hx
state_before: case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
⊢ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
state_after: case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
⊢ ∃ n, Associated (p ^ n) x

tactic: cases' WfDvdMonoid.exists_factors x hx with fx hfx
state_before: case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
⊢ ∃ n, Associated (p ^ n) x
state_after: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
⊢ ∃ n, Associated (p ^ n) x

tactic: refine ⟨Multiset.card fx, ?_⟩
state_before: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
⊢ ∃ n, Associated (p ^ n) x
state_after: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
⊢ Associated (p ^ Multiset.card fx) x

tactic: have H := hfx.2
state_before: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
⊢ Associated (p ^ Multiset.card fx) x
state_after: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associated fx.prod x
⊢ Associated (p ^ Multiset.card fx) x

tactic: rw [← Associates.mk_eq_mk_iff_associated] at H ⊢
state_before: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associated fx.prod x
⊢ Associated (p ^ Multiset.card fx) x
state_after: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ Associates.mk (p ^ Multiset.card fx) = Associates.mk x

tactic: rw [← H, ← Associates.prod_mk, Associates.mk_pow, ← Multiset.prod_replicate]
state_before: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ Associates.mk (p ^ Multiset.card fx) = Associates.mk x
state_after: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ (Multiset.replicate (Multiset.card fx) (Associates.mk p)).prod = (Multiset.map Associates.mk fx).prod

tactic: congr 1
state_before: case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ (Multiset.replicate (Multiset.card fx) (Associates.mk p)).prod = (Multiset.map Associates.mk fx).prod
state_after: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ Multiset.replicate (Multiset.card fx) (Associates.mk p) = Multiset.map Associates.mk fx

tactic: symm
state_before: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ Multiset.replicate (Multiset.card fx) (Associates.mk p) = Multiset.map Associates.mk fx
state_after: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ Multiset.map Associates.mk fx = Multiset.replicate (Multiset.card fx) (Associates.mk p)

tactic: rw [Multiset.eq_replicate]
state_before: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ Multiset.map Associates.mk fx = Multiset.replicate (Multiset.card fx) (Associates.mk p)
state_after: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ Multiset.card (Multiset.map Associates.mk fx) = Multiset.card fx ∧
    ∀ b ∈ Multiset.map Associates.mk fx, b = Associates.mk p

tactic: simp only [true_and_iff, and_imp, Multiset.card_map, eq_self_iff_true, Multiset.mem_map,
  exists_imp]
state_before: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ Multiset.card (Multiset.map Associates.mk fx) = Multiset.card fx ∧
    ∀ b ∈ Multiset.map Associates.mk fx, b = Associates.mk p
state_after: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ ∀ (b : Associates R), ∀ x ∈ fx, Associates.mk x = b → b = Associates.mk p

tactic: rintro _ q hq rfl
state_before: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
⊢ ∀ (b : Associates R), ∀ x ∈ fx, Associates.mk x = b → b = Associates.mk p
state_after: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
q : R
hq : q ∈ fx
⊢ Associates.mk q = Associates.mk p

tactic: rw [Associates.mk_eq_mk_iff_associated]
state_before: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
q : R
hq : q ∈ fx
⊢ Associates.mk q = Associates.mk p
state_after: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
q : R
hq : q ∈ fx
⊢ Associated q p

tactic: apply h₂ (hfx.1 _ hq) hp
state_before: case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ b ∈ fx, Irreducible b) ∧ Associated fx.prod x
H : Associates.mk fx.prod = Associates.mk x
q : R
hq : q ∈ fx
⊢ Associated q p
state_after: no goals