Theorem: multiplicity.Int.pow_sub_pow
File: Mathlib/NumberTheory/Multiplicity.lean

Proof steps:
state_before: R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
⊢ multiplicity (↑p) (x ^ n - y ^ n) = multiplicity (↑p) (x - y) + multiplicity p n
state_after: case zero
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
⊢ multiplicity (↑p) (x ^ 0 - y ^ 0) = multiplicity (↑p) (x - y) + multiplicity p 0

case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
⊢ multiplicity (↑p) (x ^ (n + 1) - y ^ (n + 1)) = multiplicity (↑p) (x - y) + multiplicity p (n + 1)
tactic: cases' n with n
state_before: case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
⊢ multiplicity (↑p) (x ^ (n + 1) - y ^ (n + 1)) = multiplicity (↑p) (x - y) + multiplicity p (n + 1)
state_after: case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p n.succ).Dom
⊢ multiplicity (↑p) (x ^ (n + 1) - y ^ (n + 1)) = multiplicity (↑p) (x - y) + multiplicity p (n + 1)
tactic: have h : (multiplicity _ _).Dom := finite_nat_iff.mpr ⟨hp.ne_one, n.succ_pos⟩
state_before: case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p n.succ).Dom
⊢ multiplicity (↑p) (x ^ (n + 1) - y ^ (n + 1)) = multiplicity (↑p) (x - y) + multiplicity p (n + 1)
state_after: case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
⊢ multiplicity (↑p) (x ^ (n + 1) - y ^ (n + 1)) = multiplicity (↑p) (x - y) + multiplicity p (n + 1)
tactic: simp only [Nat.succ_eq_add_one] at h
state_before: case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
⊢ multiplicity (↑p) (x ^ (n + 1) - y ^ (n + 1)) = multiplicity (↑p) (x - y) + multiplicity p (n + 1)
state_after: case succ.intro.intro
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ multiplicity (↑p) (x ^ (n + 1) - y ^ (n + 1)) = multiplicity (↑p) (x - y) + multiplicity p (n + 1)
tactic: rcases eq_coe_iff.mp (PartENat.natCast_get h).symm with ⟨⟨k, hk⟩, hpn⟩
state_before: case succ.intro.intro
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ multiplicity (↑p) (x ^ (n + 1) - y ^ (n + 1)) = multiplicity (↑p) (x - y) + multiplicity p (n + 1)
state_after: case succ.intro.intro
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ multiplicity (↑p) ((x ^ p ^ (multiplicity p (n + 1)).get h) ^ k - (y ^ p ^ (multiplicity p (n + 1)).get h) ^ k) =
    multiplicity (↑p) (x - y) + multiplicity p (n + 1)
tactic: conv_lhs => rw [hk, pow_mul, pow_mul]
state_before: case succ.intro.intro
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ multiplicity (↑p) ((x ^ p ^ (multiplicity p (n + 1)).get h) ^ k - (y ^ p ^ (multiplicity p (n + 1)).get h) ^ k) =
    multiplicity (↑p) (x - y) + multiplicity p (n + 1)
state_after: case succ.intro.intro
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Prime ↑p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ multiplicity (↑p) ((x ^ p ^ (multiplicity p (n + 1)).get h) ^ k - (y ^ p ^ (multiplicity p (n + 1)).get h) ^ k) =
    multiplicity (↑p) (x - y) + multiplicity p (n + 1)
tactic: rw [Nat.prime_iff_prime_int] at hp
state_before: case succ.intro.intro
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Prime ↑p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ multiplicity (↑p) ((x ^ p ^ (multiplicity p (n + 1)).get h) ^ k - (y ^ p ^ (multiplicity p (n + 1)).get h) ^ k) =
    multiplicity (↑p) (x - y) + multiplicity p (n + 1)
state_after: case succ.intro.intro.hxy
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Prime ↑p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ ↑p ∣ x ^ p ^ (multiplicity p (n + 1)).get h - y ^ p ^ (multiplicity p (n + 1)).get h

case succ.intro.intro.hx
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Prime ↑p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ ¬↑p ∣ x ^ p ^ (multiplicity p (n + 1)).get h

case succ.intro.intro.hn
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Prime ↑p
hp1 : Odd p
x y : ℤ
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
n : ℕ
h : (multiplicity p (n + 1)).Dom
hpn : ¬p ^ ((multiplicity p (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = p ^ (multiplicity p (n + 1)).get h * k
⊢ ¬↑p ∣ ↑k
tactic: rw [pow_sub_pow_of_prime hp, pow_prime_pow_sub_pow_prime_pow hp hp1 hxy hx, PartENat.natCast_get]