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

tactic: have key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod := by
  rw [Multiset.prod_replicate, Multiset.prod_replicate, Associated]
  refine ⟨u * v⁻¹, ?_⟩
  simp only [Units.val_mul]
  rw [mul_left_comm, ← mul_assoc, h, mul_right_comm, Units.mul_inv, one_mul]
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ m = n
state_after: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
⊢ m = n

tactic: have := by
  refine Multiset.card_eq_card_of_rel (UniqueFactorizationMonoid.factors_unique ?_ ?_ key)
  all_goals
    intro x hx
    obtain rfl := Multiset.eq_of_mem_replicate hx
    assumption
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
⊢ m = n
state_after: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
this : Multiset.card (Multiset.replicate m p) = Multiset.card (Multiset.replicate n q)
⊢ m = n

tactic: simpa only [Multiset.card_replicate]
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
this : Multiset.card (Multiset.replicate m p) = Multiset.card (Multiset.replicate n q)
⊢ m = n
state_after: no goals

tactic: rw [Multiset.prod_replicate, Multiset.prod_replicate, Associated]
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
state_after: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ ∃ u, p ^ m * ↑u = q ^ n

tactic: refine ⟨u * v⁻¹, ?_⟩
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ ∃ u, p ^ m * ↑u = q ^ n
state_after: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ p ^ m * ↑(u * v⁻¹) = q ^ n

tactic: simp only [Units.val_mul]
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ p ^ m * ↑(u * v⁻¹) = q ^ n
state_after: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ p ^ m * (↑u * ↑v⁻¹) = q ^ n

tactic: rw [mul_left_comm, ← mul_assoc, h, mul_right_comm, Units.mul_inv, one_mul]
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ p ^ m * (↑u * ↑v⁻¹) = q ^ n
state_after: no goals

tactic: refine Multiset.card_eq_card_of_rel (UniqueFactorizationMonoid.factors_unique ?_ ?_ key)
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
⊢ ?m.49829
state_after: case refine_1
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
⊢ ∀ x ∈ Multiset.replicate m p, Irreducible x

case refine_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
⊢ ∀ x ∈ Multiset.replicate n q, Irreducible x

tactic: all_goals
  intro x hx
  obtain rfl := Multiset.eq_of_mem_replicate hx
  assumption
state_before: case refine_1
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
⊢ ∀ x ∈ Multiset.replicate m p, Irreducible x

case refine_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
⊢ ∀ x ∈ Multiset.replicate n q, Irreducible x
state_after: no goals

tactic: intro x hx
state_before: case refine_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
⊢ ∀ x ∈ Multiset.replicate n q, Irreducible x
state_after: case refine_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
x : R
hx : x ∈ Multiset.replicate n q
⊢ Irreducible x

tactic: obtain rfl := Multiset.eq_of_mem_replicate hx
state_before: case refine_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod
x : R
hx : x ∈ Multiset.replicate n q
⊢ Irreducible x
state_after: case refine_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p : R
hp : Irreducible p
u v : Rˣ
m n : ℕ
x : R
hq : Irreducible x
h : ↑u * p ^ m = ↑v * x ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n x).prod
hx : x ∈ Multiset.replicate n x
⊢ Irreducible x

tactic: assumption
state_before: case refine_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p : R
hp : Irreducible p
u v : Rˣ
m n : ℕ
x : R
hq : Irreducible x
h : ↑u * p ^ m = ↑v * x ^ n
key : Associated (Multiset.replicate m p).prod (Multiset.replicate n x).prod
hx : x ∈ Multiset.replicate n x
⊢ Irreducible x
state_after: no goals