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

tactic: obtain hyx | hyx := le_total y x
state_before: 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
state_after: 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

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

tactic: iterate 3 rw [← multiplicity.Int.natCast_multiplicity]
state_before: 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
state_after: 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

tactic: simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_left' hyx _), Int.ofNat_add,
  Int.natCast_pow]
state_before: 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
state_after: 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

tactic: rw [← Int.natCast_dvd_natCast] at hx
state_before: 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
state_after: 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

tactic: rw [← Int.natCast_dvd_natCast, Int.ofNat_sub hyx] at hxy
state_before: 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
state_after: 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

tactic: convert Int.two_pow_sub_pow hxy hx hn using 2
state_before: 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
state_after: 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

tactic: rw [← multiplicity.Int.natCast_multiplicity]
state_before: 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
state_after: 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

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

tactic: rw [← multiplicity.Int.natCast_multiplicity]
state_before: 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
state_after: 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

tactic: simp only [Nat.sub_eq_zero_iff_le.mpr hyx,
  Nat.sub_eq_zero_iff_le.mpr (pow_le_pow_left' hyx n), multiplicity.zero,
  PartENat.top_add, PartENat.add_top]
state_before: 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
state_after: no goals