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

tactic: have hx_odd : Odd x := by rwa [Int.odd_iff_not_even, even_iff_two_dvd]
state_before: 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
state_after: 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

tactic: have hxy_even : Even (x - y) := even_iff_two_dvd.mpr (dvd_trans (by decide) hxy)
state_before: 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
state_after: 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

tactic: have hy_odd : Odd y := by simpa using hx_odd.sub_even hxy_even
state_before: 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
state_after: 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

tactic: cases' n with n
state_before: 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
state_after: 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 ^ 0 - y ^ 0) = multiplicity 2 (x - y) + multiplicity 2 ↑0

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 ^ (n + 1) - y ^ (n + 1)) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)

tactic: have h : (multiplicity 2 n.succ).Dom := multiplicity.finite_nat_iff.mpr ⟨by norm_num, n.succ_pos⟩
state_before: 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 ^ (n + 1) - y ^ (n + 1)) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)
state_after: 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 n.succ).Dom
⊢ multiplicity 2 (x ^ (n + 1) - y ^ (n + 1)) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)

tactic: simp only [Nat.succ_eq_add_one] at h
state_before: 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 n.succ).Dom
⊢ multiplicity 2 (x ^ (n + 1) - y ^ (n + 1)) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)
state_after: 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 (n + 1)).Dom
⊢ multiplicity 2 (x ^ (n + 1) - y ^ (n + 1)) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)

tactic: rcases multiplicity.eq_coe_iff.mp (PartENat.natCast_get h).symm with ⟨⟨k, hk⟩, hpn⟩
state_before: 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 (n + 1)).Dom
⊢ multiplicity 2 (x ^ (n + 1) - y ^ (n + 1)) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)
state_after: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ multiplicity 2 (x ^ (n + 1) - y ^ (n + 1)) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)

tactic: 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]
state_before: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ multiplicity 2 (x ^ (n + 1) - y ^ (n + 1)) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)
state_after: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ multiplicity 2 (x - y) + multiplicity 2 (n + 1) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)

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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ Prime 2

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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ 2 ∣ x ^ 2 ^ (multiplicity 2 (n + 1)).get h - y ^ 2 ^ (multiplicity 2 (n + 1)).get h

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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ ¬2 ∣ x ^ 2 ^ (multiplicity 2 (n + 1)).get h

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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ ¬2 ∣ ↑k

tactic: erw [Int.natCast_dvd_natCast]
state_before: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ ¬2 ∣ ↑k
state_after: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ ¬2 ∣ k

tactic: contrapose! hpn
state_before: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ ¬2 ∣ k
state_after: 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 (n + 1)).Dom
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
hpn : 2 ∣ k
⊢ 2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1

tactic: rw [pow_succ]
state_before: 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 (n + 1)).Dom
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
hpn : 2 ∣ k
⊢ 2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
state_after: 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 (n + 1)).Dom
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
hpn : 2 ∣ k
⊢ 2 ^ (multiplicity 2 (n + 1)).get h * 2 ∣ n + 1

tactic: conv_rhs => rw [hk]
state_before: 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 (n + 1)).Dom
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
hpn : 2 ∣ k
⊢ 2 ^ (multiplicity 2 (n + 1)).get h * 2 ∣ n + 1
state_after: 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 (n + 1)).Dom
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
hpn : 2 ∣ k
⊢ 2 ^ (multiplicity 2 (n + 1)).get h * 2 ∣ 2 ^ (multiplicity 2 (n + 1)).get h * k

tactic: exact mul_dvd_mul_left _ hpn
state_before: 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 (n + 1)).Dom
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
hpn : 2 ∣ k
⊢ 2 ^ (multiplicity 2 (n + 1)).get h * 2 ∣ 2 ^ (multiplicity 2 (n + 1)).get h * k
state_after: no goals

tactic: rwa [Int.odd_iff_not_even, even_iff_two_dvd]
state_before: R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
⊢ Odd x
state_after: no goals

tactic: decide
state_before: R : Type u_1
n✝ : ℕ
x y : ℤ
n : ℕ
hxy : 4 ∣ x - y
hx : ¬2 ∣ x
hx_odd : Odd x
⊢ 2 ∣ 4
state_after: no goals

tactic: simpa using hx_odd.sub_even hxy_even
state_before: 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
state_after: no goals

tactic: simp only [pow_zero, sub_self, multiplicity.zero, Int.ofNat_zero, Nat.zero_eq, add_top]
state_before: 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 ^ 0 - y ^ 0) = multiplicity 2 (x - y) + multiplicity 2 ↑0
state_after: no goals

tactic: norm_num
state_before: 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
state_after: no goals

tactic: norm_cast
state_before: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ multiplicity 2 (x - y) + multiplicity 2 (n + 1) = multiplicity 2 (x - y) + multiplicity 2 ↑(n + 1)
state_after: no goals

tactic: exact Int.prime_two
state_before: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ Prime 2
state_after: no goals

tactic: simpa only [even_iff_two_dvd] using hx_odd.pow.sub_odd hy_odd.pow
state_before: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ 2 ∣ x ^ 2 ^ (multiplicity 2 (n + 1)).get h - y ^ 2 ^ (multiplicity 2 (n + 1)).get h
state_after: no goals

tactic: simpa only [even_iff_two_dvd, Int.odd_iff_not_even] using hx_odd.pow
state_before: 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 (n + 1)).Dom
hpn : ¬2 ^ ((multiplicity 2 (n + 1)).get h + 1) ∣ n + 1
k : ℕ
hk : n + 1 = 2 ^ (multiplicity 2 (n + 1)).get h * k
⊢ ¬2 ∣ x ^ 2 ^ (multiplicity 2 (n + 1)).get h
state_after: no goals