Theorem: Int.two_pow_sub_pow
File: Mathlib/NumberTheory/Multiplicity.lean

tactic: 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
state_before: R : Type ?u.865616
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

tactic: cases' hn with d hd
state_before: R : Type ?u.865616
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

tactic: subst hd
state_before: case intro
R : Type ?u.865616
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

tactic: simp only [← two_mul, pow_mul]
state_before: case intro
R : Type ?u.865616
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)

tactic: 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]
state_before: case intro
R : Type ?u.865616
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)

tactic: suffices multiplicity (2 : ℤ) ↑(2 : ℕ) = 1 by rw [this, add_comm (1 : PartENat), ← add_assoc]
state_before: case intro
R : Type ?u.865616
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.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ ¬2 ∣ x ^ 2

tactic: rw [← even_iff_two_dvd, ← Int.odd_iff_not_even] at hx
state_before: R : Type ?u.865616
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hn : Even n
⊢ Odd y

tactic: replace hxy := (@even_neg _ _ (x - y)).mpr (even_iff_two_dvd.mpr hxy)
state_before: R : Type ?u.865616
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 2 ∣ x - y
hx : Odd x
hn : Even n
⊢ Odd y

tactic: convert Even.add_odd hxy hx
state_before: R : Type ?u.865616
n✝ : ℕ
x y : ℤ
n : ℕ
hx : Odd x
hn : Even n
hxy : Even (-(x - y))
⊢ Odd y

tactic: abel
state_before: case h.e'_3
R : Type ?u.865616
n✝ : ℕ
x y : ℤ
n : ℕ
hx : Odd x
hn : Even n
hxy : Even (-(x - y))
⊢ y = -(x - y) + x

tactic: 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]
state_before: R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
⊢ 4 ∣ x ^ 2 - y ^ 2

tactic: norm_num
state_before: R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
⊢ (1 - 1) % 4 = 0

tactic: simp only [Int.odd_iff_not_even, even_iff_two_dvd, hx, not_false_iff]
state_before: R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
⊢ Odd x

tactic: rw [this, add_comm (1 : PartENat), ← add_assoc]
state_before: R : Type ?u.865616
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)

tactic: norm_cast
state_before: case intro
R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ multiplicity 2 ↑2 = 1

tactic: rw [multiplicity.multiplicity_self _ _]
state_before: case intro
R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ multiplicity 2 2 = 1

tactic: apply Prime.not_unit
state_before: R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ ¬IsUnit 2

tactic: simp only [← Nat.prime_iff, Nat.prime_two]
state_before: case hp
R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ Prime 2

tactic: exact two_ne_zero
state_before: R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ 2 ≠ 0

tactic: rw [← even_iff_two_dvd, ← Int.odd_iff_not_even]
state_before: R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ ¬2 ∣ x ^ 2

tactic: apply Odd.pow
state_before: R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ Odd (x ^ 2)

tactic: simp only [Int.odd_iff_not_even, even_iff_two_dvd, hx, not_false_iff]
state_before: case hm
R : Type ?u.865616
n : ℕ
x y : ℤ
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
hy : Odd y
d : ℕ
hxy4 : 4 ∣ x ^ 2 - y ^ 2
⊢ Odd x