[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y✝ x y p : R
h : p ∣ x - y
⊢ p ∣ ∑ i in range n, x ^ i * y ^ (n - 1 - i) ↔ p ∣ ↑n * y ^ (n - 1)
[PROOFSTEP]
rw [← mem_span_singleton, ← Ideal.Quotient.eq] at h 
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y✝ x y p : R
h : ↑(Ideal.Quotient.mk (span {p})) x = ↑(Ideal.Quotient.mk (span {p})) y
⊢ p ∣ ∑ i in range n, x ^ i * y ^ (n - 1 - i) ↔ p ∣ ↑n * y ^ (n - 1)
[PROOFSTEP]
simp only [← mem_span_singleton, ← eq_zero_iff_mem, RingHom.map_geom_sum₂, h, geom_sum₂_self, _root_.map_mul, map_pow,
  map_natCast]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y✝ x y p : R
h : p ∣ x - y
⊢ p ∣ ∑ i in range n, x ^ i * y ^ (n - 1 - i) ↔ p ∣ ↑n * x ^ (n - 1)
[PROOFSTEP]
rw [geom_sum₂_comm, dvd_geom_sum₂_iff_of_dvd_sub]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y✝ x y p : R
h : p ∣ x - y
⊢ p ∣ y - x
[PROOFSTEP]
simpa using h.neg_right
[GOAL]
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
n : ℕ
⊢ p ^ 2 ∣ (x + p) ^ n - x ^ (n - 1) * p * ↑n - x ^ n
[PROOFSTEP]
cases' n with n n
[GOAL]
case zero
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
⊢ p ^ 2 ∣ (x + p) ^ Nat.zero - x ^ (Nat.zero - 1) * p * ↑Nat.zero - x ^ Nat.zero
[PROOFSTEP]
simp only [pow_zero, Nat.cast_zero, sub_zero, sub_self, dvd_zero, Nat.zero_eq, mul_zero]
[GOAL]
case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
n : ℕ
⊢ p ^ 2 ∣ (x + p) ^ Nat.succ n - x ^ (Nat.succ n - 1) * p * ↑(Nat.succ n) - x ^ Nat.succ n
[PROOFSTEP]
simp only [Nat.succ_sub_succ_eq_sub, tsub_zero, Nat.cast_succ, add_pow, Finset.sum_range_succ, Nat.choose_self,
  Nat.succ_sub _, tsub_self, pow_one, Nat.choose_succ_self_right, pow_zero, mul_one, Nat.cast_zero, zero_add,
  Nat.succ_eq_add_one, add_tsub_cancel_left]
[GOAL]
case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
n : ℕ
⊢ p ^ 2 ∣
    ∑ m in range n, x ^ m * p ^ (n + 1 - m) * ↑(Nat.choose (n + 1) m) + x ^ n * p * (↑n + 1) + x ^ (n + 1) -
        x ^ n * p * (↑n + 1) -
      x ^ (n + 1)
[PROOFSTEP]
suffices p ^ 2 ∣ ∑ i : ℕ in range n, x ^ i * p ^ (n + 1 - i) * ↑((n + 1).choose i) by convert this; abel
[GOAL]
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
n : ℕ
this : p ^ 2 ∣ ∑ i in range n, x ^ i * p ^ (n + 1 - i) * ↑(Nat.choose (n + 1) i)
⊢ p ^ 2 ∣
    ∑ m in range n, x ^ m * p ^ (n + 1 - m) * ↑(Nat.choose (n + 1) m) + x ^ n * p * (↑n + 1) + x ^ (n + 1) -
        x ^ n * p * (↑n + 1) -
      x ^ (n + 1)
[PROOFSTEP]
convert this
[GOAL]
case h.e'_4
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
n : ℕ
this : p ^ 2 ∣ ∑ i in range n, x ^ i * p ^ (n + 1 - i) * ↑(Nat.choose (n + 1) i)
⊢ ∑ m in range n, x ^ m * p ^ (n + 1 - m) * ↑(Nat.choose (n + 1) m) + x ^ n * p * (↑n + 1) + x ^ (n + 1) -
        x ^ n * p * (↑n + 1) -
      x ^ (n + 1) =
    ∑ i in range n, x ^ i * p ^ (n + 1 - i) * ↑(Nat.choose (n + 1) i)
[PROOFSTEP]
abel
[GOAL]
case h.e'_4
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
n : ℕ
this : p ^ 2 ∣ ∑ i in range n, x ^ i * p ^ (n + 1 - i) * ↑(Nat.choose (n + 1) i)
⊢ ∑ m in range n, x ^ m * p ^ (n + 1 - m) * ↑(Nat.choose (n + 1) m) + x ^ n * p * (↑n + 1) + x ^ (n + 1) -
        x ^ n * p * (↑n + 1) -
      x ^ (n + 1) =
    ∑ i in range n, x ^ i * p ^ (n + 1 - i) * ↑(Nat.choose (n + 1) i)
[PROOFSTEP]
abel
[GOAL]
case succ
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
n : ℕ
⊢ p ^ 2 ∣ ∑ i in range n, x ^ i * p ^ (n + 1 - i) * ↑(Nat.choose (n + 1) i)
[PROOFSTEP]
apply Finset.dvd_sum
[GOAL]
case succ.h
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y p x : R
n : ℕ
⊢ ∀ (x_1 : ℕ), x_1 ∈ range n → p ^ 2 ∣ x ^ x_1 * p ^ (n + 1 - x_1) * ↑(Nat.choose (n + 1) x_1)
[PROOFSTEP]
intro y hy
[GOAL]
case succ.h
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ p x : R
n y : ℕ
hy : y ∈ range n
⊢ p ^ 2 ∣ x ^ y * p ^ (n + 1 - y) * ↑(Nat.choose (n + 1) y)
[PROOFSTEP]
calc
  p ^ 2 ∣ p ^ (n + 1 - y) := pow_dvd_pow p (le_tsub_of_add_le_left (by linarith [Finset.mem_range.mp hy]))
  _ ∣ x ^ y * p ^ (n + 1 - y) * ↑((n + 1).choose y) := dvd_mul_of_dvd_left (dvd_mul_left _ _) _
[GOAL]
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ p x : R
n y : ℕ
hy : y ∈ range n
⊢ y + 2 ≤ n + 1
[PROOFSTEP]
linarith [Finset.mem_range.mp hy]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
⊢ ↑p ^ 2 ∣ ∑ i in range p, (a + ↑p * b) ^ i * a ^ (p - 1 - i) - ↑p * a ^ (p - 1)
[PROOFSTEP]
have h1 : ∀ (i : ℕ), (p : R) ^ 2 ∣ (a + ↑p * b) ^ i - (a ^ (i - 1) * (↑p * b) * i + a ^ i) :=
  by
  intro i
  calc
    ↑p ^ 2 ∣ (↑p * b) ^ 2 := by simp only [mul_pow, dvd_mul_right]
    _ ∣ (a + ↑p * b) ^ i - (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i) := by
      simp only [sq_dvd_add_pow_sub_sub (↑p * b) a i, ← sub_sub]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
⊢ ∀ (i : ℕ), ↑p ^ 2 ∣ (a + ↑p * b) ^ i - (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
[PROOFSTEP]
intro i
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
i : ℕ
⊢ ↑p ^ 2 ∣ (a + ↑p * b) ^ i - (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
[PROOFSTEP]
calc
  ↑p ^ 2 ∣ (↑p * b) ^ 2 := by simp only [mul_pow, dvd_mul_right]
  _ ∣ (a + ↑p * b) ^ i - (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i) := by
    simp only [sq_dvd_add_pow_sub_sub (↑p * b) a i, ← sub_sub]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
i : ℕ
⊢ ↑p ^ 2 ∣ (↑p * b) ^ 2
[PROOFSTEP]
simp only [mul_pow, dvd_mul_right]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
i : ℕ
⊢ (↑p * b) ^ 2 ∣ (a + ↑p * b) ^ i - (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
[PROOFSTEP]
simp only [sq_dvd_add_pow_sub_sub (↑p * b) a i, ← sub_sub]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 : ∀ (i : ℕ), ↑p ^ 2 ∣ (a + ↑p * b) ^ i - (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
⊢ ↑p ^ 2 ∣ ∑ i in range p, (a + ↑p * b) ^ i * a ^ (p - 1 - i) - ↑p * a ^ (p - 1)
[PROOFSTEP]
simp_rw [← mem_span_singleton, ← Ideal.Quotient.eq] at *
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ i in range p, (a + ↑p * b) ^ i * a ^ (p - 1 - i)) =
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (↑p * a ^ (p - 1))
[PROOFSTEP]
let s : R := (p : R) ^ 2
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ i in range p, (a + ↑p * b) ^ i * a ^ (p - 1 - i)) =
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (↑p * a ^ (p - 1))
[PROOFSTEP]
calc
  (Ideal.Quotient.mk (span { s })) (∑ i in range p, (a + (p : R) * b) ^ i * a ^ (p - 1 - i)) =
      ∑ i : ℕ in Finset.range p, mk (span { s }) ((a ^ (i - 1) * (↑p * b) * ↑i + a ^ i) * a ^ (p - 1 - i)) :=
    by simp_rw [RingHom.map_geom_sum₂, ← map_pow, h1, ← _root_.map_mul]
  _ =
      mk (span { s }) (∑ x : ℕ in Finset.range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
        mk (span { s }) (∑ x : ℕ in Finset.range p, a ^ (x + (p - 1 - x))) :=
    by
    ring_nf
    simp only [← pow_add, map_add, Finset.sum_add_distrib, ← map_sum]
    congr
    simp [pow_add a, mul_assoc]
  _ =
      mk (span { s }) (∑ x : ℕ in Finset.range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
        mk (span { s }) (∑ x : ℕ in Finset.range p, a ^ (p - 1)) :=
    by
    rw [add_right_inj]
    have : ∀ (x : ℕ), (hx : x ∈ range p) → a ^ (x + (p - 1 - x)) = a ^ (p - 1) :=
      by
      intro x hx
      rw [← Nat.add_sub_assoc _ x, Nat.add_sub_cancel_left]
      exact Nat.le_pred_of_lt (Finset.mem_range.mp hx)
    rw [Finset.sum_congr rfl this]
  _ =
      mk (span { s }) (∑ x : ℕ in Finset.range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
        mk (span { s }) (↑p * a ^ (p - 1)) :=
    by simp only [add_right_inj, Finset.sum_const, Finset.card_range, nsmul_eq_mul]
  _ = mk (span { s }) (↑p * b * ∑ x : ℕ in Finset.range p, a ^ (p - 2) * x) + mk (span { s }) (↑p * a ^ (p - 1)) :=
    by
    simp only [Finset.mul_sum, ← mul_assoc, ← pow_add]
    rw [Finset.sum_congr rfl]
    rintro (⟨⟩ | ⟨x⟩) hx
    · rw [Nat.cast_zero, mul_zero, mul_zero]
    · have : x.succ - 1 + (p - 1 - x.succ) = p - 2 :=
        by
        rw [← Nat.add_sub_assoc (Nat.le_pred_of_lt (Finset.mem_range.mp hx))]
        exact congr_arg Nat.pred (Nat.add_sub_cancel_left _ _)
      rw [this]
      ring1
  _ = mk (span { s }) (↑p * a ^ (p - 1)) :=
    by
    have : Finset.sum (range p) (fun (x : ℕ) ↦ (x : R)) = ((Finset.sum (range p) (fun (x : ℕ) ↦ (x : ℕ)))) := by
      simp only [Nat.cast_sum]
    simp only [add_left_eq_self, ← Finset.mul_sum, this]
    norm_cast
    simp only [Finset.sum_range_id]
    norm_cast
    simp only [Nat.cast_mul, _root_.map_mul, Nat.mul_div_assoc p (even_iff_two_dvd.mp (Nat.Odd.sub_odd hp odd_one))]
    ring_nf
    rw [mul_assoc, mul_assoc]
    refine' mul_eq_zero_of_left _ _
    refine' Ideal.Quotient.eq_zero_iff_mem.mpr _
    simp [mem_span_singleton]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {s})) (∑ i in range p, (a + ↑p * b) ^ i * a ^ (p - 1 - i)) =
    ∑ i in range p, ↑(Ideal.Quotient.mk (span {s})) ((a ^ (i - 1) * (↑p * b) * ↑i + a ^ i) * a ^ (p - 1 - i))
[PROOFSTEP]
simp_rw [RingHom.map_geom_sum₂, ← map_pow, h1, ← _root_.map_mul]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ∑ i in range p, ↑(Ideal.Quotient.mk (span {s})) ((a ^ (i - 1) * (↑p * b) * ↑i + a ^ i) * a ^ (p - 1 - i)) =
    ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
      ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x + (p - 1 - x)))
[PROOFSTEP]
ring_nf
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ∑ x in range p,
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (x - 1) * a ^ (p - 1 - x) * ↑p * b * ↑x + a ^ x * a ^ (p - 1 - x)) =
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ x in range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ x in range p, a ^ (x + (p - 1 - x)))
[PROOFSTEP]
simp only [← pow_add, map_add, Finset.sum_add_distrib, ← map_sum]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ x in range p, a ^ (x - 1 + (p - 1 - x)) * ↑p * b * ↑x) +
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ x in range p, a ^ (x + (p - 1 - x))) =
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ x in range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ x in range p, a ^ (x + (p - 1 - x)))
[PROOFSTEP]
congr
[GOAL]
case e_a.h.e_6.h.e_f
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ (fun x => a ^ (x - 1 + (p - 1 - x)) * ↑p * b * ↑x) = fun x => a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))
[PROOFSTEP]
simp [pow_add a, mul_assoc]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
      ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x + (p - 1 - x))) =
    ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
      ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (p - 1))
[PROOFSTEP]
rw [add_right_inj]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x + (p - 1 - x))) =
    ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (p - 1))
[PROOFSTEP]
have : ∀ (x : ℕ), (hx : x ∈ range p) → a ^ (x + (p - 1 - x)) = a ^ (p - 1) :=
  by
  intro x hx
  rw [← Nat.add_sub_assoc _ x, Nat.add_sub_cancel_left]
  exact Nat.le_pred_of_lt (Finset.mem_range.mp hx)
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ∀ (x : ℕ), x ∈ range p → a ^ (x + (p - 1 - x)) = a ^ (p - 1)
[PROOFSTEP]
intro x hx
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
x : ℕ
hx : x ∈ range p
⊢ a ^ (x + (p - 1 - x)) = a ^ (p - 1)
[PROOFSTEP]
rw [← Nat.add_sub_assoc _ x, Nat.add_sub_cancel_left]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
x : ℕ
hx : x ∈ range p
⊢ x ≤ p - 1
[PROOFSTEP]
exact Nat.le_pred_of_lt (Finset.mem_range.mp hx)
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∀ (x : ℕ), x ∈ range p → a ^ (x + (p - 1 - x)) = a ^ (p - 1)
⊢ ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x + (p - 1 - x))) =
    ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (p - 1))
[PROOFSTEP]
rw [Finset.sum_congr rfl this]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
      ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (p - 1)) =
    ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
      ↑(Ideal.Quotient.mk (span {s})) (↑p * a ^ (p - 1))
[PROOFSTEP]
simp only [add_right_inj, Finset.sum_const, Finset.card_range, nsmul_eq_mul]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {s})) (∑ x in range p, a ^ (x - 1) * (a ^ (p - 1 - x) * (↑p * (b * ↑x)))) +
      ↑(Ideal.Quotient.mk (span {s})) (↑p * a ^ (p - 1)) =
    ↑(Ideal.Quotient.mk (span {s})) (↑p * b * ∑ x in range p, a ^ (p - 2) * ↑x) +
      ↑(Ideal.Quotient.mk (span {s})) (↑p * a ^ (p - 1))
[PROOFSTEP]
simp only [Finset.mul_sum, ← mul_assoc, ← pow_add]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ x in range p, a ^ (x - 1 + (p - 1 - x)) * ↑p * b * ↑x) +
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (↑p * a ^ (p - 1)) =
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (∑ x in range p, ↑p * b * a ^ (p - 2) * ↑x) +
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (↑p * a ^ (p - 1))
[PROOFSTEP]
rw [Finset.sum_congr rfl]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ∀ (x : ℕ), x ∈ range p → a ^ (x - 1 + (p - 1 - x)) * ↑p * b * ↑x = ↑p * b * a ^ (p - 2) * ↑x
[PROOFSTEP]
rintro (⟨⟩ | ⟨x⟩) hx
[GOAL]
case zero
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
hx : Nat.zero ∈ range p
⊢ a ^ (Nat.zero - 1 + (p - 1 - Nat.zero)) * ↑p * b * ↑Nat.zero = ↑p * b * a ^ (p - 2) * ↑Nat.zero
[PROOFSTEP]
rw [Nat.cast_zero, mul_zero, mul_zero]
[GOAL]
case succ
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
x : ℕ
hx : Nat.succ x ∈ range p
⊢ a ^ (Nat.succ x - 1 + (p - 1 - Nat.succ x)) * ↑p * b * ↑(Nat.succ x) = ↑p * b * a ^ (p - 2) * ↑(Nat.succ x)
[PROOFSTEP]
have : x.succ - 1 + (p - 1 - x.succ) = p - 2 :=
  by
  rw [← Nat.add_sub_assoc (Nat.le_pred_of_lt (Finset.mem_range.mp hx))]
  exact congr_arg Nat.pred (Nat.add_sub_cancel_left _ _)
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
x : ℕ
hx : Nat.succ x ∈ range p
⊢ Nat.succ x - 1 + (p - 1 - Nat.succ x) = p - 2
[PROOFSTEP]
rw [← Nat.add_sub_assoc (Nat.le_pred_of_lt (Finset.mem_range.mp hx))]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
x : ℕ
hx : Nat.succ x ∈ range p
⊢ Nat.succ x - 1 + (p - 1) - Nat.succ x = p - 2
[PROOFSTEP]
exact congr_arg Nat.pred (Nat.add_sub_cancel_left _ _)
[GOAL]
case succ
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
x : ℕ
hx : Nat.succ x ∈ range p
this : Nat.succ x - 1 + (p - 1 - Nat.succ x) = p - 2
⊢ a ^ (Nat.succ x - 1 + (p - 1 - Nat.succ x)) * ↑p * b * ↑(Nat.succ x) = ↑p * b * a ^ (p - 2) * ↑(Nat.succ x)
[PROOFSTEP]
rw [this]
[GOAL]
case succ
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x✝ y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
x : ℕ
hx : Nat.succ x ∈ range p
this : Nat.succ x - 1 + (p - 1 - Nat.succ x) = p - 2
⊢ a ^ (p - 2) * ↑p * b * ↑(Nat.succ x) = ↑p * b * a ^ (p - 2) * ↑(Nat.succ x)
[PROOFSTEP]
ring1
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ↑(Ideal.Quotient.mk (span {s})) (↑p * b * ∑ x in range p, a ^ (p - 2) * ↑x) +
      ↑(Ideal.Quotient.mk (span {s})) (↑p * a ^ (p - 1)) =
    ↑(Ideal.Quotient.mk (span {s})) (↑p * a ^ (p - 1))
[PROOFSTEP]
have : Finset.sum (range p) (fun (x : ℕ) ↦ (x : R)) = ((Finset.sum (range p) (fun (x : ℕ) ↦ (x : ℕ)))) := by
  simp only [Nat.cast_sum]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
⊢ ∑ x in range p, ↑x = ↑(∑ x in range p, x)
[PROOFSTEP]
simp only [Nat.cast_sum]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {s})) (↑p * b * ∑ x in range p, a ^ (p - 2) * ↑x) +
      ↑(Ideal.Quotient.mk (span {s})) (↑p * a ^ (p - 1)) =
    ↑(Ideal.Quotient.mk (span {s})) (↑p * a ^ (p - 1))
[PROOFSTEP]
simp only [add_left_eq_self, ← Finset.mul_sum, this]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (↑p * b * (a ^ (p - 2) * ↑(∑ x in range p, x))) = 0
[PROOFSTEP]
norm_cast
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (↑p * b * (a ^ (p - 2) * ↑(∑ x in range p, x))) = 0
[PROOFSTEP]
simp only [Finset.sum_range_id]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (↑p * b * (a ^ (p - 2) * ↑(p * (p - 1) / 2))) = 0
[PROOFSTEP]
norm_cast
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (↑p * b * (a ^ (p - 2) * ↑(p * (p - 1) / 2))) = 0
[PROOFSTEP]
simp only [Nat.cast_mul, _root_.map_mul, Nat.mul_div_assoc p (even_iff_two_dvd.mp (Nat.Odd.sub_odd hp odd_one))]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ↑p * ↑(Ideal.Quotient.mk (span {↑p ^ 2})) b *
      (↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (p - 2)) *
        (↑(Ideal.Quotient.mk (span {↑p ^ 2})) ↑p * ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ↑((p - 1) / 2))) =
    0
[PROOFSTEP]
ring_nf
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ↑p ^ 2 * ↑(Ideal.Quotient.mk (span {↑p ^ 2})) b *
        ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (p - 2)) *
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ↑((p - 1) / 2) =
    0
[PROOFSTEP]
rw [mul_assoc, mul_assoc]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ↑p ^ 2 *
      (↑(Ideal.Quotient.mk (span {↑p ^ 2})) b *
        (↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (p - 2)) * ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ↑((p - 1) / 2))) =
    0
[PROOFSTEP]
refine' mul_eq_zero_of_left _ _
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ↑p ^ 2 = 0
[PROOFSTEP]
refine' Ideal.Quotient.eq_zero_iff_mem.mpr _
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
a b x y : R
p : ℕ
hp : Odd p
h1 :
  ∀ (i : ℕ),
    ↑(Ideal.Quotient.mk (span {↑p ^ 2})) ((a + ↑p * b) ^ i) =
      ↑(Ideal.Quotient.mk (span {↑p ^ 2})) (a ^ (i - 1) * (↑p * b) * ↑i + a ^ i)
s : R := ↑p ^ 2
this : ∑ x in range p, ↑x = ↑(∑ x in range p, x)
⊢ (fun x => x ^ 2) ↑p ∈ span {↑p ^ 2}
[PROOFSTEP]
simp [mem_span_singleton]
[GOAL]
R : Type u_1
n✝ : ℕ
inst✝² : CommRing R
a b x✝ y✝ : R
p✝ : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
p : R
hp : Prime p
x y : R
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : ¬p ∣ ↑n
⊢ multiplicity p (x ^ n - y ^ n) = multiplicity p (x - y)
[PROOFSTEP]
rw [← geom_sum₂_mul, multiplicity.mul hp, multiplicity_eq_zero.2 (not_dvd_geom_sum₂ hp hxy hx hn), zero_add]
[GOAL]
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
⊢ multiplicity (↑p) (∑ i in range p, x ^ i * y ^ (p - 1 - i)) = 1
[PROOFSTEP]
rw [← Nat.cast_one]
[GOAL]
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
⊢ multiplicity (↑p) (∑ i in range p, x ^ i * y ^ (p - ↑1 - i)) = 1
[PROOFSTEP]
refine' multiplicity.eq_coe_iff.2 ⟨_, _⟩
[GOAL]
case refine'_1
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
⊢ ↑p ^ 1 ∣ ∑ i in range p, x ^ i * y ^ (p - ↑1 - i)
[PROOFSTEP]
rw [pow_one]
[GOAL]
case refine'_1
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
⊢ ↑p ∣ ∑ i in range p, x ^ i * y ^ (p - ↑1 - i)
[PROOFSTEP]
exact dvd_geom_sum₂_self hxy
[GOAL]
case refine'_2
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
⊢ ¬↑p ^ (1 + 1) ∣ ∑ i in range p, x ^ i * y ^ (p - ↑1 - i)
[PROOFSTEP]
rw [dvd_iff_dvd_of_dvd_sub hxy] at hx 
[GOAL]
case refine'_2
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ y
⊢ ¬↑p ^ (1 + 1) ∣ ∑ i in range p, x ^ i * y ^ (p - ↑1 - i)
[PROOFSTEP]
cases' hxy with k hk
[GOAL]
case refine'_2.intro
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hx : ¬↑p ∣ y
k : R
hk : x - y = ↑p * k
⊢ ¬↑p ^ (1 + 1) ∣ ∑ i in range p, x ^ i * y ^ (p - ↑1 - i)
[PROOFSTEP]
rw [one_add_one_eq_two, eq_add_of_sub_eq' hk]
[GOAL]
case refine'_2.intro
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hx : ¬↑p ∣ y
k : R
hk : x - y = ↑p * k
⊢ ¬↑p ^ 2 ∣ ∑ i in range p, (y + ↑p * k) ^ i * y ^ (p - ↑1 - i)
[PROOFSTEP]
refine' mt (dvd_iff_dvd_of_dvd_sub (@odd_sq_dvd_geom_sum₂_sub _ _ y k _ hp1)).mp _
[GOAL]
case refine'_2.intro
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hx : ¬↑p ∣ y
k : R
hk : x - y = ↑p * k
⊢ ¬↑p ^ 2 ∣ ↑p * y ^ (p - 1)
[PROOFSTEP]
rw [pow_two, mul_dvd_mul_iff_left hp.ne_zero]
[GOAL]
case refine'_2.intro
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hx : ¬↑p ∣ y
k : R
hk : x - y = ↑p * k
⊢ ¬↑p ∣ y ^ (p - 1)
[PROOFSTEP]
exact mt hp.dvd_of_dvd_pow hx
[GOAL]
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
⊢ multiplicity (↑p) (x ^ p - y ^ p) = multiplicity (↑p) (x - y) + 1
[PROOFSTEP]
rw [← geom_sum₂_mul, multiplicity.mul hp, geom_sum₂_eq_one hp hp1 hxy hx, add_comm]
[GOAL]
R : Type u_1
n : ℕ
inst✝² : CommRing R
a✝ b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
a : ℕ
⊢ multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) = multiplicity (↑p) (x - y) + ↑a
[PROOFSTEP]
induction' a with a h_ind
[GOAL]
case zero
R : Type u_1
n : ℕ
inst✝² : CommRing R
a b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
⊢ multiplicity (↑p) (x ^ p ^ Nat.zero - y ^ p ^ Nat.zero) = multiplicity (↑p) (x - y) + ↑Nat.zero
[PROOFSTEP]
rw [Nat.cast_zero, add_zero, pow_zero, pow_one, pow_one]
[GOAL]
case succ
R : Type u_1
n : ℕ
inst✝² : CommRing R
a✝ b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
a : ℕ
h_ind : multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) = multiplicity (↑p) (x - y) + ↑a
⊢ multiplicity (↑p) (x ^ p ^ Nat.succ a - y ^ p ^ Nat.succ a) = multiplicity (↑p) (x - y) + ↑(Nat.succ a)
[PROOFSTEP]
rw [← Nat.add_one, Nat.cast_add, Nat.cast_one, ← add_assoc, ← h_ind, pow_succ', pow_mul, pow_mul]
[GOAL]
case succ
R : Type u_1
n : ℕ
inst✝² : CommRing R
a✝ b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
a : ℕ
h_ind : multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) = multiplicity (↑p) (x - y) + ↑a
⊢ multiplicity (↑p) ((x ^ p ^ a) ^ p - (y ^ p ^ a) ^ p) = multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) + 1
[PROOFSTEP]
apply pow_prime_sub_pow_prime hp hp1
[GOAL]
case succ.hxy
R : Type u_1
n : ℕ
inst✝² : CommRing R
a✝ b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
a : ℕ
h_ind : multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) = multiplicity (↑p) (x - y) + ↑a
⊢ ↑p ∣ x ^ p ^ a - y ^ p ^ a
[PROOFSTEP]
rw [← geom_sum₂_mul]
[GOAL]
case succ.hxy
R : Type u_1
n : ℕ
inst✝² : CommRing R
a✝ b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
a : ℕ
h_ind : multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) = multiplicity (↑p) (x - y) + ↑a
⊢ ↑p ∣ (∑ i in range (p ^ a), x ^ i * y ^ (p ^ a - 1 - i)) * (x - y)
[PROOFSTEP]
exact dvd_mul_of_dvd_right hxy _
[GOAL]
case succ.hx
R : Type u_1
n : ℕ
inst✝² : CommRing R
a✝ b x y : R
p : ℕ
inst✝¹ : IsDomain R
inst✝ : DecidableRel fun x x_1 => x ∣ x_1
hp : Prime ↑p
hp1 : Odd p
hxy : ↑p ∣ x - y
hx : ¬↑p ∣ x
a : ℕ
h_ind : multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) = multiplicity (↑p) (x - y) + ↑a
⊢ ¬↑p ∣ x ^ p ^ a
[PROOFSTEP]
exact fun h => hx (hp.dvd_of_dvd_pow h)
[GOAL]
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
[PROOFSTEP]
cases' n with n
[GOAL]
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 ^ Nat.zero - y ^ Nat.zero) = multiplicity (↑p) (x - y) + multiplicity p Nat.zero
[PROOFSTEP]
simp only [multiplicity.zero, add_top, pow_zero, sub_self, Nat.zero_eq]
[GOAL]
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 ^ Nat.succ n - y ^ Nat.succ n) = multiplicity (↑p) (x - y) + multiplicity p (Nat.succ n)
[PROOFSTEP]
have h : (multiplicity _ _).Dom := finite_nat_iff.mpr ⟨hp.ne_one, n.succ_pos⟩
[GOAL]
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 (Nat.succ n)).Dom
⊢ multiplicity (↑p) (x ^ Nat.succ n - y ^ Nat.succ n) = multiplicity (↑p) (x - y) + multiplicity p (Nat.succ n)
[PROOFSTEP]
rcases eq_coe_iff.mp (PartENat.natCast_get h).symm with ⟨⟨k, hk⟩, hpn⟩
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
⊢ multiplicity (↑p) (x ^ Nat.succ n - y ^ Nat.succ n) = multiplicity (↑p) (x - y) + multiplicity p (Nat.succ n)
[PROOFSTEP]
conv_lhs => rw [hk, pow_mul, pow_mul]
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
| multiplicity (↑p) (x ^ Nat.succ n - y ^ Nat.succ n)
[PROOFSTEP]
rw [hk, pow_mul, pow_mul]
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
| multiplicity (↑p) (x ^ Nat.succ n - y ^ Nat.succ n)
[PROOFSTEP]
rw [hk, pow_mul, pow_mul]
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
| multiplicity (↑p) (x ^ Nat.succ n - y ^ Nat.succ n)
[PROOFSTEP]
rw [hk, pow_mul, pow_mul]
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
⊢ multiplicity (↑p)
      ((x ^ p ^ Part.get (multiplicity p (Nat.succ n)) h) ^ k -
        (y ^ p ^ Part.get (multiplicity p (Nat.succ n)) h) ^ k) =
    multiplicity (↑p) (x - y) + multiplicity p (Nat.succ n)
[PROOFSTEP]
rw [Nat.prime_iff_prime_int] at hp 
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
⊢ multiplicity (↑p)
      ((x ^ p ^ Part.get (multiplicity p (Nat.succ n)) h) ^ k -
        (y ^ p ^ Part.get (multiplicity p (Nat.succ n)) h) ^ k) =
    multiplicity (↑p) (x - y) + multiplicity p (Nat.succ n)
[PROOFSTEP]
rw [pow_sub_pow_of_prime hp, pow_prime_pow_sub_pow_prime_pow hp hp1 hxy hx, PartENat.natCast_get]
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
⊢ ↑p ∣ x ^ p ^ Part.get (multiplicity p (Nat.succ n)) h - y ^ p ^ Part.get (multiplicity p (Nat.succ n)) h
[PROOFSTEP]
rw [← geom_sum₂_mul]
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
⊢ ↑p ∣
    (∑ i in range (p ^ Part.get (multiplicity p (Nat.succ n)) h),
        x ^ i * y ^ (p ^ Part.get (multiplicity p (Nat.succ n)) h - 1 - i)) *
      (x - y)
[PROOFSTEP]
exact dvd_mul_of_dvd_right hxy _
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
⊢ ¬↑p ∣ x ^ p ^ Part.get (multiplicity p (Nat.succ n)) h
[PROOFSTEP]
exact fun h => hx (hp.dvd_of_dvd_pow h)
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
⊢ ¬↑p ∣ ↑k
[PROOFSTEP]
rw [Int.coe_nat_dvd]
[GOAL]
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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * k
⊢ ¬p ∣ k
[PROOFSTEP]
rintro ⟨c, rfl⟩
[GOAL]
case succ.intro.intro.hn.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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
c : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * (p * c)
⊢ False
[PROOFSTEP]
refine' hpn ⟨c, _⟩
[GOAL]
case succ.intro.intro.hn.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 (Nat.succ n)).Dom
hpn : ¬p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) ∣ Nat.succ n
c : ℕ
hk : Nat.succ n = p ^ Part.get (multiplicity p (Nat.succ n)) h * (p * c)
⊢ Nat.succ n = p ^ (Part.get (multiplicity p (Nat.succ n)) h + 1) * c
[PROOFSTEP]
rwa [pow_succ', mul_assoc]
[GOAL]
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 : ℕ
hn : Odd n
⊢ multiplicity (↑p) (x ^ n + y ^ n) = multiplicity (↑p) (x + y) + multiplicity p n
[PROOFSTEP]
rw [← sub_neg_eq_add] at hxy 
[GOAL]
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 : ℕ
hn : Odd n
⊢ multiplicity (↑p) (x ^ n + y ^ n) = multiplicity (↑p) (x + y) + multiplicity p n
[PROOFSTEP]
rw [← sub_neg_eq_add, ← sub_neg_eq_add, ← Odd.neg_pow hn]
[GOAL]
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 : ℕ
hn : Odd n
⊢ multiplicity (↑p) (x ^ n - (-y) ^ n) = multiplicity (↑p) (x - -y) + multiplicity p n
[PROOFSTEP]
exact Int.pow_sub_pow hp hp1 hxy hx n
[GOAL]
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
[PROOFSTEP]
obtain hyx | hyx := le_total y x
[GOAL]
case inl
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 : ℕ
hyx : y ≤ x
⊢ multiplicity p (x ^ n - y ^ n) = multiplicity p (x - y) + multiplicity p n
[PROOFSTEP]
iterate 2 rw [← Int.coe_nat_multiplicity]
[GOAL]
case inl
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 : ℕ
hyx : y ≤ x
⊢ multiplicity p (x ^ n - y ^ n) = multiplicity p (x - y) + multiplicity p n
[PROOFSTEP]
rw [← Int.coe_nat_multiplicity]
[GOAL]
case inl
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 : ℕ
hyx : y ≤ x
⊢ multiplicity ↑p ↑(x ^ n - y ^ n) = multiplicity p (x - y) + multiplicity p n
[PROOFSTEP]
rw [← Int.coe_nat_multiplicity]
[GOAL]
case inl
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 : ℕ
hyx : y ≤ x
⊢ multiplicity ↑p ↑(x ^ n - y ^ n) = multiplicity ↑p ↑(x - y) + multiplicity p n
[PROOFSTEP]
rw [Int.ofNat_sub (Nat.pow_le_pow_of_le_left hyx n)]
[GOAL]
case inl
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 : ℕ
hyx : y ≤ x
⊢ multiplicity (↑p) (↑(x ^ n) - ↑(y ^ n)) = multiplicity ↑p ↑(x - y) + multiplicity p n
[PROOFSTEP]
rw [← Int.coe_nat_dvd] at hxy hx 
[GOAL]
case inl
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 : ℕ
hyx : y ≤ x
⊢ multiplicity (↑p) (↑(x ^ n) - ↑(y ^ n)) = multiplicity ↑p ↑(x - y) + multiplicity p n
[PROOFSTEP]
rw [Int.coe_nat_sub hyx] at *
[GOAL]
case inl
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 : ℕ
hyx : y ≤ x
⊢ multiplicity (↑p) (↑(x ^ n) - ↑(y ^ n)) = multiplicity (↑p) (↑x - ↑y) + multiplicity p n
[PROOFSTEP]
push_cast at *
[GOAL]
case inl
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 : ℕ
hyx : y ≤ x
⊢ multiplicity (↑p) (↑x ^ n - ↑y ^ n) = multiplicity (↑p) (↑x - ↑y) + multiplicity p n
[PROOFSTEP]
exact Int.pow_sub_pow hp hp1 hxy hx n
[GOAL]
case inr
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 : ℕ
hyx : x ≤ y
⊢ multiplicity p (x ^ n - y ^ n) = multiplicity p (x - y) + multiplicity p n
[PROOFSTEP]
simp only [Nat.sub_eq_zero_iff_le.mpr hyx, Nat.sub_eq_zero_iff_le.mpr (Nat.pow_le_pow_of_le_left hyx n),
  multiplicity.zero, PartENat.top_add]
[GOAL]
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 : ℕ
hn : Odd n
⊢ multiplicity p (x ^ n + y ^ n) = multiplicity p (x + y) + multiplicity p n
[PROOFSTEP]
iterate 2 rw [← Int.coe_nat_multiplicity]
[GOAL]
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 : ℕ
hn : Odd n
⊢ multiplicity p (x ^ n + y ^ n) = multiplicity p (x + y) + multiplicity p n
[PROOFSTEP]
rw [← Int.coe_nat_multiplicity]
[GOAL]
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 : ℕ
hn : Odd n
⊢ multiplicity ↑p ↑(x ^ n + y ^ n) = multiplicity p (x + y) + multiplicity p n
[PROOFSTEP]
rw [← Int.coe_nat_multiplicity]
[GOAL]
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 : ℕ
hn : Odd n
⊢ multiplicity ↑p ↑(x ^ n + y ^ n) = multiplicity ↑p ↑(x + y) + multiplicity p n
[PROOFSTEP]
rw [← Int.coe_nat_dvd] at hxy hx 
[GOAL]
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 : ℕ
hn : Odd n
⊢ multiplicity ↑p ↑(x ^ n + y ^ n) = multiplicity ↑p ↑(x + y) + multiplicity p n
[PROOFSTEP]
push_cast at *
[GOAL]
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
a b x✝ y✝ : R
p : ℕ
hp : Nat.Prime p
hp1 : Odd p
x y : ℕ
hx : ¬↑p ∣ ↑x
n : ℕ
hn : Odd n
hxy : ↑p ∣ ↑x + ↑y
⊢ multiplicity (↑p) (↑x ^ n + ↑y ^ n) = multiplicity (↑p) (↑x + ↑y) + multiplicity p n
[PROOFSTEP]
exact Int.pow_add_pow hp hp1 hxy hx hn
[GOAL]
R : Type u_1
n✝ : ℕ
inst✝ : CommRing R
x y : R
n : ℕ
⊢ x ^ 2 ^ n - y ^ 2 ^ n = (∏ i in range n, (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)
[PROOFSTEP]
induction' n with d hd
[GOAL]
case zero
R : Type u_1
n : ℕ
inst✝ : CommRing R
x y : R
⊢ x ^ 2 ^ Nat.zero - y ^ 2 ^ Nat.zero = (∏ i in range Nat.zero, (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)
[PROOFSTEP]
simp only [pow_zero, pow_one, range_zero, prod_empty, one_mul, Nat.zero_eq]
[GOAL]
case succ
R : Type u_1
n : ℕ
inst✝ : CommRing R
x y : R
d : ℕ
hd : x ^ 2 ^ d - y ^ 2 ^ d = (∏ i in range d, (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)
⊢ x ^ 2 ^ Nat.succ d - y ^ 2 ^ Nat.succ d = (∏ i in range (Nat.succ d), (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)
[PROOFSTEP]
suffices x ^ 2 ^ d.succ - y ^ 2 ^ d.succ = (x ^ 2 ^ d + y ^ 2 ^ d) * (x ^ 2 ^ d - y ^ 2 ^ d) by
  rw [this, hd, Finset.prod_range_succ, ← mul_assoc, mul_comm (x ^ 2 ^ d + y ^ 2 ^ d)]
[GOAL]
R : Type u_1
n : ℕ
inst✝ : CommRing R
x y : R
d : ℕ
hd : x ^ 2 ^ d - y ^ 2 ^ d = (∏ i in range d, (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)
this : x ^ 2 ^ Nat.succ d - y ^ 2 ^ Nat.succ d = (x ^ 2 ^ d + y ^ 2 ^ d) * (x ^ 2 ^ d - y ^ 2 ^ d)
⊢ x ^ 2 ^ Nat.succ d - y ^ 2 ^ Nat.succ d = (∏ i in range (Nat.succ d), (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)
[PROOFSTEP]
rw [this, hd, Finset.prod_range_succ, ← mul_assoc, mul_comm (x ^ 2 ^ d + y ^ 2 ^ d)]
[GOAL]
case succ
R : Type u_1
n : ℕ
inst✝ : CommRing R
x y : R
d : ℕ
hd : x ^ 2 ^ d - y ^ 2 ^ d = (∏ i in range d, (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)
⊢ x ^ 2 ^ Nat.succ d - y ^ 2 ^ Nat.succ d = (x ^ 2 ^ d + y ^ 2 ^ d) * (x ^ 2 ^ d - y ^ 2 ^ d)
[PROOFSTEP]
rw [Nat.succ_eq_add_one]
[GOAL]
case succ
R : Type u_1
n : ℕ
inst✝ : CommRing R
x y : R
d : ℕ
hd : x ^ 2 ^ d - y ^ 2 ^ d = (∏ i in range d, (x ^ 2 ^ i + y ^ 2 ^ i)) * (x - y)
⊢ x ^ 2 ^ (d + 1) - y ^ 2 ^ (d + 1) = (x ^ 2 ^ d + y ^ 2 ^ d) * (x ^ 2 ^ d - y ^ 2 ^ d)
[PROOFSTEP]
ring
[GOAL]
R : Type u_1
n : ℕ
x : ℤ
⊢ Odd x → x ^ 2 % 4 = 1
[PROOFSTEP]
intro hx
[GOAL]
R : Type u_1
n : ℕ
x : ℤ
hx : Odd x
⊢ x ^ 2 % 4 = 1
[PROOFSTEP]
unfold Odd at hx 
[GOAL]
R : Type u_1
n : ℕ
x : ℤ
hx : ∃ k, x = 2 * k + 1
⊢ x ^ 2 % 4 = 1
[PROOFSTEP]
rcases hx with ⟨_, rfl⟩
[GOAL]
case intro
R : Type u_1
n : ℕ
w✝ : ℤ
⊢ (2 * w✝ + 1) ^ 2 % 4 = 1
[PROOFSTEP]
ring_nf
[GOAL]
case intro
R : Type u_1
n : ℕ
w✝ : ℤ
⊢ (1 + w✝ * 4 + w✝ ^ 2 * 4) % 4 = 1
[PROOFSTEP]
rw [add_assoc, ← add_mul, Int.add_mul_emod_self]
[GOAL]
case intro
R : Type u_1
n : ℕ
w✝ : ℤ
⊢ 1 % 4 = 1
[PROOFSTEP]
norm_num
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
⊢ multiplicity 2 (x ^ 2 ^ i + y ^ 2 ^ i) = ↑1
[PROOFSTEP]
have hx_odd : Odd x := by rwa [Int.odd_iff_not_even, even_iff_two_dvd]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
⊢ Odd x
[PROOFSTEP]
rwa [Int.odd_iff_not_even, even_iff_two_dvd]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
⊢ multiplicity 2 (x ^ 2 ^ i + y ^ 2 ^ i) = ↑1
[PROOFSTEP]
have hxy_even : Even (x - y) := even_iff_two_dvd.mpr (dvd_trans (by norm_num) hxy)
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
⊢ 2 ∣ 4
[PROOFSTEP]
norm_num
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
hxy_even : Even (x - y)
⊢ multiplicity 2 (x ^ 2 ^ i + y ^ 2 ^ i) = ↑1
[PROOFSTEP]
have hy_odd : Odd y := by simpa using hx_odd.sub_even hxy_even
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
hxy_even : Even (x - y)
⊢ Odd y
[PROOFSTEP]
simpa using hx_odd.sub_even hxy_even
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
⊢ multiplicity 2 (x ^ 2 ^ i + y ^ 2 ^ i) = ↑1
[PROOFSTEP]
refine' multiplicity.eq_coe_iff.mpr ⟨_, _⟩
[GOAL]
case refine'_1
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
⊢ 2 ^ 1 ∣ x ^ 2 ^ i + y ^ 2 ^ i
[PROOFSTEP]
rw [pow_one, ← even_iff_two_dvd]
[GOAL]
case refine'_1
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
⊢ Even (x ^ 2 ^ i + y ^ 2 ^ i)
[PROOFSTEP]
exact hx_odd.pow.add_odd hy_odd.pow
[GOAL]
case refine'_2
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
⊢ ¬2 ^ (1 + 1) ∣ x ^ 2 ^ i + y ^ 2 ^ i
[PROOFSTEP]
cases' i with i
[GOAL]
case refine'_2.zero
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
⊢ ¬2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.zero + y ^ 2 ^ Nat.zero
[PROOFSTEP]
intro hxy'
[GOAL]
case refine'_2.zero
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
hxy' : 2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.zero + y ^ 2 ^ Nat.zero
⊢ False
[PROOFSTEP]
have : 2 * 2 ∣ 2 * x := by
  have := dvd_add hxy hxy'
  norm_num at *
  rw [two_mul]
  exact this
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
hxy' : 2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.zero + y ^ 2 ^ Nat.zero
⊢ 2 * 2 ∣ 2 * x
[PROOFSTEP]
have := dvd_add hxy hxy'
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
hxy' : 2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.zero + y ^ 2 ^ Nat.zero
this : 4 ∣ x - y + (x ^ 2 ^ Nat.zero + y ^ 2 ^ Nat.zero)
⊢ 2 * 2 ∣ 2 * x
[PROOFSTEP]
norm_num at *
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hxy_even : Even (x - y)
hx : x % 2 = 1
hx_odd : ¬Even x
hy_odd : ¬Even y
hxy' : 4 ∣ x + y
this : 4 ∣ x + x
⊢ 4 ∣ 2 * x
[PROOFSTEP]
rw [two_mul]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hxy_even : Even (x - y)
hx : x % 2 = 1
hx_odd : ¬Even x
hy_odd : ¬Even y
hxy' : 4 ∣ x + y
this : 4 ∣ x + x
⊢ 4 ∣ x + x
[PROOFSTEP]
exact this
[GOAL]
case refine'_2.zero
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
hxy' : 2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.zero + y ^ 2 ^ Nat.zero
this : 2 * 2 ∣ 2 * x
⊢ False
[PROOFSTEP]
have : 2 ∣ x := (mul_dvd_mul_iff_left (by norm_num)).mp this
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
hxy' : 2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.zero + y ^ 2 ^ Nat.zero
this : 2 * 2 ∣ 2 * x
⊢ 2 ≠ 0
[PROOFSTEP]
norm_num
[GOAL]
case refine'_2.zero
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
hxy' : 2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.zero + y ^ 2 ^ Nat.zero
this✝ : 2 * 2 ∣ 2 * x
this : 2 ∣ x
⊢ False
[PROOFSTEP]
contradiction
[GOAL]
case refine'_2.succ
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
i : ℕ
⊢ ¬2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.succ i + y ^ 2 ^ Nat.succ i
[PROOFSTEP]
suffices ∀ x : ℤ, Odd x → x ^ 2 ^ (i + 1) % 4 = 1
  by
  rw [show (2 ^ (1 + 1) : ℤ) = 4 by norm_num, Int.dvd_iff_emod_eq_zero, Int.add_emod, this _ hx_odd, this _ hy_odd]
  norm_num
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
i : ℕ
this : ∀ (x : ℤ), Odd x → x ^ 2 ^ (i + 1) % 4 = 1
⊢ ¬2 ^ (1 + 1) ∣ x ^ 2 ^ Nat.succ i + y ^ 2 ^ Nat.succ i
[PROOFSTEP]
rw [show (2 ^ (1 + 1) : ℤ) = 4 by norm_num, Int.dvd_iff_emod_eq_zero, Int.add_emod, this _ hx_odd, this _ hy_odd]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
i : ℕ
this : ∀ (x : ℤ), Odd x → x ^ 2 ^ (i + 1) % 4 = 1
⊢ 2 ^ (1 + 1) = 4
[PROOFSTEP]
norm_num
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
i : ℕ
this : ∀ (x : ℤ), Odd x → x ^ 2 ^ (i + 1) % 4 = 1
⊢ ¬(1 + 1) % 4 = 0
[PROOFSTEP]
norm_num
[GOAL]
case refine'_2.succ
R : Type u_1
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
i : ℕ
⊢ ∀ (x : ℤ), Odd x → x ^ 2 ^ (i + 1) % 4 = 1
[PROOFSTEP]
intro x hx
[GOAL]
case refine'_2.succ
R : Type u_1
n : ℕ
x✝ y : ℤ
hx✝ : ¬2 ∣ x✝
hxy : 4 ∣ x✝ - y
hx_odd : Odd x✝
hxy_even : Even (x✝ - y)
hy_odd : Odd y
i : ℕ
x : ℤ
hx : Odd x
⊢ x ^ 2 ^ (i + 1) % 4 = 1
[PROOFSTEP]
rw [pow_succ, mul_comm, pow_mul, Int.sq_mod_four_eq_one_of_odd hx.pow]
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
⊢ multiplicity 2 (x ^ 2 ^ n - y ^ 2 ^ n) = multiplicity 2 (x - y) + ↑n
[PROOFSTEP]
simp only [pow_two_pow_sub_pow_two_pow n, multiplicity.mul Int.prime_two, multiplicity.Finset.prod Int.prime_two,
  add_comm, Nat.cast_one, Finset.sum_const, Finset.card_range, nsmul_one,
  Int.two_pow_two_pow_add_two_pow_two_pow hx hxy]
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
⊢ multiplicity 2 (x ^ n - y ^ n) = multiplicity 2 (x - y) + multiplicity 2 ↑n
[PROOFSTEP]
have hx_odd : Odd x := by rwa [Int.odd_iff_not_even, even_iff_two_dvd]
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
⊢ Odd x
[PROOFSTEP]
rwa [Int.odd_iff_not_even, even_iff_two_dvd]
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
⊢ multiplicity 2 (x ^ n - y ^ n) = multiplicity 2 (x - y) + multiplicity 2 ↑n
[PROOFSTEP]
have hxy_even : Even (x - y) := even_iff_two_dvd.mpr (dvd_trans (by norm_num) hxy)
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
⊢ 2 ∣ 4
[PROOFSTEP]
norm_num
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
⊢ multiplicity 2 (x ^ n - y ^ n) = multiplicity 2 (x - y) + multiplicity 2 ↑n
[PROOFSTEP]
have hy_odd : Odd y := by simpa using hx_odd.sub_even hxy_even
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
⊢ Odd y
[PROOFSTEP]
simpa using hx_odd.sub_even hxy_even
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
⊢ multiplicity 2 (x ^ n - y ^ n) = multiplicity 2 (x - y) + multiplicity 2 ↑n
[PROOFSTEP]
cases' n with n
[GOAL]
case zero
R : Type u_1
n : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
⊢ multiplicity 2 (x ^ Nat.zero - y ^ Nat.zero) = multiplicity 2 (x - y) + multiplicity 2 ↑Nat.zero
[PROOFSTEP]
simp only [pow_zero, sub_self, multiplicity.zero, Int.ofNat_zero, Nat.zero_eq, add_top]
[GOAL]
case succ
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
⊢ multiplicity 2 (x ^ Nat.succ n - y ^ Nat.succ n) = multiplicity 2 (x - y) + multiplicity 2 ↑(Nat.succ n)
[PROOFSTEP]
have h : (multiplicity 2 n.succ).Dom := multiplicity.finite_nat_iff.mpr ⟨by norm_num, n.succ_pos⟩
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
⊢ 2 ≠ 1
[PROOFSTEP]
norm_num
[GOAL]
case succ
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
⊢ multiplicity 2 (x ^ Nat.succ n - y ^ Nat.succ n) = multiplicity 2 (x - y) + multiplicity 2 ↑(Nat.succ n)
[PROOFSTEP]
rcases multiplicity.eq_coe_iff.mp (PartENat.natCast_get h).symm with ⟨⟨k, hk⟩, hpn⟩
[GOAL]
case succ.intro.intro
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
hpn : ¬2 ^ (Part.get (multiplicity 2 (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
⊢ multiplicity 2 (x ^ Nat.succ n - y ^ Nat.succ n) = multiplicity 2 (x - y) + multiplicity 2 ↑(Nat.succ n)
[PROOFSTEP]
rw [hk, pow_mul, pow_mul, multiplicity.pow_sub_pow_of_prime, Int.two_pow_two_pow_sub_pow_two_pow _ hxy hx, ← hk,
  PartENat.natCast_get]
[GOAL]
case succ.intro.intro
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
hpn : ¬2 ^ (Part.get (multiplicity 2 (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
⊢ multiplicity 2 (x - y) + multiplicity 2 (Nat.succ n) = multiplicity 2 (x - y) + multiplicity 2 ↑(Nat.succ n)
[PROOFSTEP]
norm_cast
[GOAL]
case succ.intro.intro.hp
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
hpn : ¬2 ^ (Part.get (multiplicity 2 (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
⊢ Prime 2
[PROOFSTEP]
exact Int.prime_two
[GOAL]
case succ.intro.intro.hxy
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
hpn : ¬2 ^ (Part.get (multiplicity 2 (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
⊢ 2 ∣ x ^ 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h - y ^ 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h
[PROOFSTEP]
simpa only [even_iff_two_dvd] using hx_odd.pow.sub_odd hy_odd.pow
[GOAL]
case succ.intro.intro.hx
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
hpn : ¬2 ^ (Part.get (multiplicity 2 (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
⊢ ¬2 ∣ x ^ 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h
[PROOFSTEP]
simpa only [even_iff_two_dvd, Int.odd_iff_not_even] using hx_odd.pow
[GOAL]
case succ.intro.intro.hn
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
hpn : ¬2 ^ (Part.get (multiplicity 2 (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
⊢ ¬2 ∣ ↑k
[PROOFSTEP]
erw [Int.coe_nat_dvd]
  -- `erw` to deal with `2 : ℤ` vs `(2 : ℕ) : ℤ`
[GOAL]
case succ.intro.intro.hn
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
hpn : ¬2 ^ (Part.get (multiplicity 2 (Nat.succ n)) h + 1) ∣ Nat.succ n
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
⊢ ¬2 ∣ k
[PROOFSTEP]
contrapose! hpn
[GOAL]
case succ.intro.intro.hn
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
hpn : 2 ∣ k
⊢ 2 ^ (Part.get (multiplicity 2 (Nat.succ n)) h + 1) ∣ Nat.succ n
[PROOFSTEP]
rw [pow_succ']
[GOAL]
case succ.intro.intro.hn
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
hpn : 2 ∣ k
⊢ 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * 2 ∣ Nat.succ n
[PROOFSTEP]
conv_rhs => rw [hk]
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
hpn : 2 ∣ k
| Nat.succ n
[PROOFSTEP]
rw [hk]
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
hpn : 2 ∣ k
| Nat.succ n
[PROOFSTEP]
rw [hk]
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
hpn : 2 ∣ k
| Nat.succ n
[PROOFSTEP]
rw [hk]
[GOAL]
case succ.intro.intro.hn
R : Type u_1
n✝ : ℕ
x y : ℤ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
hxy_even : Even (x - y)
hy_odd : Odd y
n : ℕ
h : (multiplicity 2 (Nat.succ n)).Dom
k : ℕ
hk : Nat.succ n = 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
hpn : 2 ∣ k
⊢ 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * 2 ∣ 2 ^ Part.get (multiplicity 2 (Nat.succ n)) h * k
[PROOFSTEP]
exact mul_dvd_mul_left _ hpn
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hn : Even n
⊢ multiplicity 2 (x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑n
[PROOFSTEP]
have hy : Odd y := by
  rw [← even_iff_two_dvd, ← Int.odd_iff_not_even] at hx 
  replace hxy := (@even_neg _ _ (x - y)).mpr (even_iff_two_dvd.mpr hxy)
  convert Even.add_odd hxy hx
  abel
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hn : Even n
⊢ Odd y
[PROOFSTEP]
rw [← even_iff_two_dvd, ← Int.odd_iff_not_even] at hx 
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 2 ∣ x - y
hx : Odd x
hn : Even n
⊢ Odd y
[PROOFSTEP]
replace hxy := (@even_neg _ _ (x - y)).mpr (even_iff_two_dvd.mpr hxy)
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hx : Odd x
hn : Even n
hxy : Even (-(x - y))
⊢ Odd y
[PROOFSTEP]
convert Even.add_odd hxy hx
[GOAL]
case h.e'_3
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hx : Odd x
hn : Even n
hxy : Even (-(x - y))
⊢ y = -(x - y) + x
[PROOFSTEP]
abel
[GOAL]
case h.e'_3
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hx : Odd x
hn : Even n
hxy : Even (-(x - y))
⊢ y = -(x - y) + x
[PROOFSTEP]
abel
[GOAL]
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hn : Even n
hy : Odd y
⊢ multiplicity 2 (x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑n
[PROOFSTEP]
cases' hn with d hd
[GOAL]
case intro
R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hd : n = d + d
⊢ multiplicity 2 (x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑n
[PROOFSTEP]
subst hd
[GOAL]
case intro
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
⊢ multiplicity 2 (x ^ (d + d) - y ^ (d + d)) + 1 =
    multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑(d + d)
[PROOFSTEP]
simp only [← two_mul, pow_mul]
[GOAL]
case intro
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
⊢ multiplicity 2 ((x ^ 2) ^ d - (y ^ 2) ^ d) + 1 =
    multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑(2 * d)
[PROOFSTEP]
have hxy4 : 4 ∣ x ^ 2 - y ^ 2 :=
  by
  rw [Int.dvd_iff_emod_eq_zero, Int.sub_emod, Int.sq_mod_four_eq_one_of_odd _, Int.sq_mod_four_eq_one_of_odd hy]
  · norm_num
  · simp only [Int.odd_iff_not_even, even_iff_two_dvd, hx, not_false_iff]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
⊢ 4 ∣ x ^ 2 - y ^ 2
[PROOFSTEP]
rw [Int.dvd_iff_emod_eq_zero, Int.sub_emod, Int.sq_mod_four_eq_one_of_odd _, Int.sq_mod_four_eq_one_of_odd hy]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
⊢ (1 - 1) % 4 = 0
[PROOFSTEP]
norm_num
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
⊢ Odd x
[PROOFSTEP]
simp only [Int.odd_iff_not_even, even_iff_two_dvd, hx, not_false_iff]
[GOAL]
case intro
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ multiplicity 2 ((x ^ 2) ^ d - (y ^ 2) ^ d) + 1 =
    multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑(2 * d)
[PROOFSTEP]
rw [Int.two_pow_sub_pow' d hxy4 _, sq_sub_sq, ← Int.ofNat_mul_out, multiplicity.mul Int.prime_two,
  multiplicity.mul Int.prime_two]
[GOAL]
case intro
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑d + 1 =
    multiplicity 2 (x + y) + multiplicity 2 (x - y) + (multiplicity 2 ↑2 + multiplicity 2 ↑d)
R : Type u_1 n : ℕ x y : ℤ hxy : 2 ∣ x - y hx : ¬2 ∣ x hy : Odd y d : ℕ hxy4 : 4 ∣ x ^ 2 - y ^ 2 ⊢ ¬2 ∣ x ^ 2
[PROOFSTEP]
suffices multiplicity (2 : ℤ) ↑(2 : ℕ) = 1 by rw [this, add_comm (1 : PartENat), ← add_assoc]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
this : multiplicity 2 ↑2 = 1
⊢ multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 ↑d + 1 =
    multiplicity 2 (x + y) + multiplicity 2 (x - y) + (multiplicity 2 ↑2 + multiplicity 2 ↑d)
[PROOFSTEP]
rw [this, add_comm (1 : PartENat), ← add_assoc]
[GOAL]
case intro
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ multiplicity 2 ↑2 = 1
[PROOFSTEP]
norm_cast
[GOAL]
case intro
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ multiplicity 2 2 = 1
[PROOFSTEP]
rw [multiplicity.multiplicity_self _ _]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ ¬IsUnit 2
[PROOFSTEP]
apply Prime.not_unit
[GOAL]
case hp
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ Prime 2
[PROOFSTEP]
simp only [← Nat.prime_iff, Nat.prime_two]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ 2 ≠ 0
[PROOFSTEP]
exact two_ne_zero
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ ¬2 ∣ x ^ 2
[PROOFSTEP]
rw [← even_iff_two_dvd, ← Int.odd_iff_not_even]
[GOAL]
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ Odd (x ^ 2)
[PROOFSTEP]
apply Odd.pow
[GOAL]
case hm
R : Type u_1
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ Odd x
[PROOFSTEP]
simp only [Int.odd_iff_not_even, even_iff_two_dvd, hx, not_false_iff]
[GOAL]
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : Even n
⊢ multiplicity 2 (x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 n
[PROOFSTEP]
obtain hyx | hyx := le_total y x
[GOAL]
case inl
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity 2 (x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 n
[PROOFSTEP]
iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
[GOAL]
case inl
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity 2 (x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 n
[PROOFSTEP]
rw [← multiplicity.Int.coe_nat_multiplicity]
[GOAL]
case inl
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity ↑2 ↑(x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 n
[PROOFSTEP]
rw [← multiplicity.Int.coe_nat_multiplicity]
[GOAL]
case inl
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity ↑2 ↑(x ^ n - y ^ n) + 1 = multiplicity ↑2 ↑(x + y) + multiplicity 2 (x - y) + multiplicity 2 n
[PROOFSTEP]
rw [← multiplicity.Int.coe_nat_multiplicity]
[GOAL]
case inl
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity ↑2 ↑(x ^ n - y ^ n) + 1 = multiplicity ↑2 ↑(x + y) + multiplicity ↑2 ↑(x - y) + multiplicity 2 n
[PROOFSTEP]
simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_of_le_left' hyx _), Int.ofNat_add, Int.coe_nat_pow]
[GOAL]
case inl
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity (↑2) (↑x ^ n - ↑y ^ n) + 1 = multiplicity (↑2) (↑x + ↑y) + multiplicity (↑2) (↑x - ↑y) + multiplicity 2 n
[PROOFSTEP]
rw [← Int.coe_nat_dvd] at hx 
[GOAL]
case inl
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬↑2 ∣ ↑x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity (↑2) (↑x ^ n - ↑y ^ n) + 1 = multiplicity (↑2) (↑x + ↑y) + multiplicity (↑2) (↑x - ↑y) + multiplicity 2 n
[PROOFSTEP]
rw [← Int.coe_nat_dvd, Int.ofNat_sub hyx] at hxy 
[GOAL]
case inl
R : Type u_1
n✝ x y : ℕ
hxy : ↑2 ∣ ↑x - ↑y
hx : ¬↑2 ∣ ↑x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity (↑2) (↑x ^ n - ↑y ^ n) + 1 = multiplicity (↑2) (↑x + ↑y) + multiplicity (↑2) (↑x - ↑y) + multiplicity 2 n
[PROOFSTEP]
convert Int.two_pow_sub_pow hxy hx hn using 2
[GOAL]
case h.e'_3.h.e'_6
R : Type u_1
n✝ x y : ℕ
hxy : ↑2 ∣ ↑x - ↑y
hx : ¬↑2 ∣ ↑x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity 2 n = multiplicity 2 ↑n
[PROOFSTEP]
rw [← multiplicity.Int.coe_nat_multiplicity]
[GOAL]
case h.e'_3.h.e'_6
R : Type u_1
n✝ x y : ℕ
hxy : ↑2 ∣ ↑x - ↑y
hx : ¬↑2 ∣ ↑x
n : ℕ
hn : Even n
hyx : y ≤ x
⊢ multiplicity ↑2 ↑n = multiplicity 2 ↑n
[PROOFSTEP]
rfl
[GOAL]
case inr
R : Type u_1
n✝ x y : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : Even n
hyx : x ≤ y
⊢ multiplicity 2 (x ^ n - y ^ n) + 1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 n
[PROOFSTEP]
simp only [Nat.sub_eq_zero_iff_le.mpr hyx, Nat.sub_eq_zero_iff_le.mpr (pow_le_pow_of_le_left' hyx n), multiplicity.zero,
  PartENat.top_add, PartENat.add_top]
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ padicValNat 2 (x ^ n - y ^ n) + 1 = padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n
[PROOFSTEP]
simp only [← PartENat.natCast_inj, Nat.cast_add]
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ ↑(padicValNat 2 (x ^ n - y ^ n)) + ↑1 = ↑(padicValNat 2 (x + y)) + ↑(padicValNat 2 (x - y)) + ↑(padicValNat 2 n)
[PROOFSTEP]
iterate 4 rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ ↑(padicValNat 2 (x ^ n - y ^ n)) + ↑1 = ↑(padicValNat 2 (x + y)) + ↑(padicValNat 2 (x - y)) + ↑(padicValNat 2 n)
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ multiplicity 2 (x ^ n - y ^ n) + ↑1 = ↑(padicValNat 2 (x + y)) + ↑(padicValNat 2 (x - y)) + ↑(padicValNat 2 n)
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x ^ n - y ^ n
R : Type u_1 n✝ x y : ℕ hyx : y < x hxy : 2 ∣ x - y hx : ¬2 ∣ x n : ℕ hn : 0 < n hneven : Even n ⊢ 0 < x ^ n - y ^ n
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ multiplicity 2 (x ^ n - y ^ n) + ↑1 = multiplicity 2 (x + y) + ↑(padicValNat 2 (x - y)) + ↑(padicValNat 2 n)
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x + y
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x + y
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x ^ n - y ^ n
R : Type u_1 n✝ x y : ℕ hyx : y < x hxy : 2 ∣ x - y hx : ¬2 ∣ x n : ℕ hn : 0 < n hneven : Even n ⊢ 0 < x ^ n - y ^ n
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ multiplicity 2 (x ^ n - y ^ n) + ↑1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + ↑(padicValNat 2 n)
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x - y
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x - y
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x + y
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x + y
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x ^ n - y ^ n
R : Type u_1 n✝ x y : ℕ hyx : y < x hxy : 2 ∣ x - y hx : ¬2 ∣ x n : ℕ hn : 0 < n hneven : Even n ⊢ 0 < x ^ n - y ^ n
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ multiplicity 2 (x ^ n - y ^ n) + ↑1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 n
[PROOFSTEP]
convert Nat.two_pow_sub_pow hxy hx hneven using 2
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < n
[PROOFSTEP]
exact hn
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x - y
[PROOFSTEP]
exact Nat.sub_pos_of_lt hyx
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x + y
[PROOFSTEP]
linarith
[GOAL]
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : 0 < n
hneven : Even n
⊢ 0 < x ^ n - y ^ n
[PROOFSTEP]
simp only [tsub_pos_iff_lt, pow_lt_pow_of_lt_left hyx (@zero_le' _ y _) hn]
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n
[PROOFSTEP]
rw [← PartENat.natCast_inj, Nat.cast_add]
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ ↑(padicValNat p (x ^ n - y ^ n)) = ↑(padicValNat p (x - y)) + ↑(padicValNat p n)
[PROOFSTEP]
iterate 3 rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ ↑(padicValNat p (x ^ n - y ^ n)) = ↑(padicValNat p (x - y)) + ↑(padicValNat p n)
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ multiplicity p (x ^ n - y ^ n) = ↑(padicValNat p (x - y)) + ↑(padicValNat p n)
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < x ^ n - y ^ n
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < x ^ n - y ^ n
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ multiplicity p (x ^ n - y ^ n) = multiplicity p (x - y) + ↑(padicValNat p n)
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < x - y
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < x - y
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < x ^ n - y ^ n
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < x ^ n - y ^ n
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ multiplicity p (x ^ n - y ^ n) = multiplicity p (x - y) + multiplicity p n
[PROOFSTEP]
exact multiplicity.Nat.pow_sub_pow hp.out hp1 hxy hx n
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < n
[PROOFSTEP]
exact hn
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < x - y
[PROOFSTEP]
exact Nat.sub_pos_of_lt hyx
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hyx : y < x
hxy : p ∣ x - y
hx : ¬p ∣ x
n : ℕ
hn : 0 < n
⊢ 0 < x ^ n - y ^ n
[PROOFSTEP]
exact Nat.sub_pos_of_lt (Nat.pow_lt_pow_of_lt_left hyx hn)
[GOAL]
R : Type u_1
n✝ x y p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hxy : p ∣ x + y
hx : ¬p ∣ x
n : ℕ
hn : Odd n
⊢ padicValNat p (x ^ n + y ^ n) = padicValNat p (x + y) + padicValNat p n
[PROOFSTEP]
cases' y with y
[GOAL]
case zero
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
hxy : p ∣ x + Nat.zero
⊢ padicValNat p (x ^ n + Nat.zero ^ n) = padicValNat p (x + Nat.zero) + padicValNat p n
[PROOFSTEP]
contradiction
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ padicValNat p (x ^ n + Nat.succ y ^ n) = padicValNat p (x + Nat.succ y) + padicValNat p n
[PROOFSTEP]
rw [← PartENat.natCast_inj, Nat.cast_add]
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ ↑(padicValNat p (x ^ n + Nat.succ y ^ n)) = ↑(padicValNat p (x + Nat.succ y)) + ↑(padicValNat p n)
[PROOFSTEP]
iterate 3 rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ ↑(padicValNat p (x ^ n + Nat.succ y ^ n)) = ↑(padicValNat p (x + Nat.succ y)) + ↑(padicValNat p n)
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ multiplicity p (x ^ n + Nat.succ y ^ n) = ↑(padicValNat p (x + Nat.succ y)) + ↑(padicValNat p n)
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < x ^ n + Nat.succ y ^ n
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < x ^ n + Nat.succ y ^ n
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ multiplicity p (x ^ n + Nat.succ y ^ n) = multiplicity p (x + Nat.succ y) + ↑(padicValNat p n)
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < x + Nat.succ y
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < x + Nat.succ y
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < x ^ n + Nat.succ y ^ n
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < x ^ n + Nat.succ y ^ n
[PROOFSTEP]
rw [padicValNat_def, PartENat.natCast_get]
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ multiplicity p (x ^ n + Nat.succ y ^ n) = multiplicity p (x + Nat.succ y) + multiplicity p n
[PROOFSTEP]
exact multiplicity.Nat.pow_add_pow hp.out hp1 hxy hx hn
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < n
[PROOFSTEP]
exact Odd.pos hn
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < x + Nat.succ y
[PROOFSTEP]
simp only [add_pos_iff, Nat.succ_pos', or_true_iff]
[GOAL]
case succ
R : Type u_1
n✝ x p : ℕ
hp : Fact (Nat.Prime p)
hp1 : Odd p
hx : ¬p ∣ x
n : ℕ
hn : Odd n
y : ℕ
hxy : p ∣ x + Nat.succ y
⊢ 0 < x ^ n + Nat.succ y ^ n
[PROOFSTEP]
exact Nat.lt_add_left _ _ _ (pow_pos y.succ_pos _)
