l3lab/ntp-mathlib huggingface dataset:
/-- **Lifting the exponent lemma** for `p = 2` -/
theorem Int.two_pow_sub_pow {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 := by
  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
  cases' hn with d hd
  subst hd
  simp only [← two_mul, pow_mul]
  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]
  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]
  suffices multiplicity (2 : ℤ) ↑(2 : ℕ) = 1 by rw [this, add_comm (1 : PartENat), ← add_assoc]
  · norm_cast
    rw [multiplicity.multiplicity_self _ _]
    · apply Prime.not_unit
      simp only [← Nat.prime_iff, Nat.prime_two]
    · exact two_ne_zero
  · rw [← even_iff_two_dvd, ← Int.odd_iff_not_even]
    apply Odd.pow
    

Proof state:
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

Next tactic:
simp only [Int.odd_iff_not_even, even_iff_two_dvd, hx, not_false_iff]
theorem Nat.two_pow_sub_pow {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 := by
  

Proof state:
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

Next tactic:
obtain hyx | hyx := le_total y x
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · 

Proof state:
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

Next tactic:
iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 

Proof state:
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

Next tactic:
rw [← multiplicity.Int.coe_nat_multiplicity]
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 

Proof state:
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

Next tactic:
rw [← multiplicity.Int.coe_nat_multiplicity]
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 

Proof state:
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

Next tactic:
rw [← multiplicity.Int.coe_nat_multiplicity]
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
    

Proof state:
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

Next tactic:
simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_left' hyx _), Int.ofNat_add,
      Int.coe_nat_pow]
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
    simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_left' hyx _), Int.ofNat_add,
      Int.coe_nat_pow]
    

Proof state:
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

Next tactic:
rw [← Int.coe_nat_dvd] at hx
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
    simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_left' hyx _), Int.ofNat_add,
      Int.coe_nat_pow]
    rw [← Int.coe_nat_dvd] at hx
    

Proof state:
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

Next tactic:
rw [← Int.coe_nat_dvd, Int.ofNat_sub hyx] at hxy
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
    simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_left' hyx _), Int.ofNat_add,
      Int.coe_nat_pow]
    rw [← Int.coe_nat_dvd] at hx
    rw [← Int.coe_nat_dvd, Int.ofNat_sub hyx] at hxy
    

Proof state:
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

Next tactic:
convert Int.two_pow_sub_pow hxy hx hn using 2
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
    simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_left' hyx _), Int.ofNat_add,
      Int.coe_nat_pow]
    rw [← Int.coe_nat_dvd] at hx
    rw [← Int.coe_nat_dvd, Int.ofNat_sub hyx] at hxy
    convert Int.two_pow_sub_pow hxy hx hn using 2
    

Proof state:
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

Next tactic:
rw [← multiplicity.Int.coe_nat_multiplicity]
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
    simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_left' hyx _), Int.ofNat_add,
      Int.coe_nat_pow]
    rw [← Int.coe_nat_dvd] at hx
    rw [← Int.coe_nat_dvd, Int.ofNat_sub hyx] at hxy
    convert Int.two_pow_sub_pow hxy hx hn using 2
    rw [← multiplicity.Int.coe_nat_multiplicity]
    

Proof state:
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

Next tactic:
rfl
theorem Nat.two_pow_sub_pow {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 := by
  obtain hyx | hyx := le_total y x
  · iterate 3 rw [← multiplicity.Int.coe_nat_multiplicity]
    simp only [Int.ofNat_sub hyx, Int.ofNat_sub (pow_le_pow_left' hyx _), Int.ofNat_add,
      Int.coe_nat_pow]
    rw [← Int.coe_nat_dvd] at hx
    rw [← Int.coe_nat_dvd, Int.ofNat_sub hyx] at hxy
    convert Int.two_pow_sub_pow hxy hx hn using 2
    rw [← multiplicity.Int.coe_nat_multiplicity]
    rfl
  · 

Proof state:
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

Next 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]
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
hneven : Even n
⊢ padicValNat 2 (x ^ n - y ^ n) + 1 = padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n

Next tactic:
simp only [← PartENat.natCast_inj, Nat.cast_add]
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
hneven : Even n
⊢ ↑(padicValNat 2 (x ^ n - y ^ n)) + ↑1 = ↑(padicValNat 2 (x + y)) + ↑(padicValNat 2 (x - y)) + ↑(padicValNat 2 n)

Next tactic:
iterate 4 rw [padicValNat_def, PartENat.natCast_get]
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
hneven : Even n
⊢ ↑(padicValNat 2 (x ^ n - y ^ n)) + ↑1 = ↑(padicValNat 2 (x + y)) + ↑(padicValNat 2 (x - y)) + ↑(padicValNat 2 n)

Next tactic:
rw [padicValNat_def, PartENat.natCast_get]
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0 hneven : Even n ⊢ 0 < x ^ n - y ^ n

Next tactic:
rw [padicValNat_def, PartENat.natCast_get]
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0 hneven : Even n ⊢ 0 < x ^ n - y ^ n

Next tactic:
rw [padicValNat_def, PartENat.natCast_get]
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0
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 : n ≠ 0 hneven : Even n ⊢ 0 < x ^ n - y ^ n

Next tactic:
rw [padicValNat_def, PartENat.natCast_get]
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 rw [padicValNat_def, PartENat.natCast_get]
  · 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
hneven : Even n
⊢ multiplicity 2 (x ^ n - y ^ n) + ↑1 = multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 n

Next tactic:
convert Nat.two_pow_sub_pow hxy hx hneven using 2
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 rw [padicValNat_def, PartENat.natCast_get]
  · convert Nat.two_pow_sub_pow hxy hx hneven using 2
  · 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
hneven : Even n
⊢ 0 < n

Next tactic:
exact hn.bot_lt
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 rw [padicValNat_def, PartENat.natCast_get]
  · convert Nat.two_pow_sub_pow hxy hx hneven using 2
  · exact hn.bot_lt
  · 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
hneven : Even n
⊢ 0 < x - y

Next tactic:
exact Nat.sub_pos_of_lt hyx
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 rw [padicValNat_def, PartENat.natCast_get]
  · convert Nat.two_pow_sub_pow hxy hx hneven using 2
  · exact hn.bot_lt
  · exact Nat.sub_pos_of_lt hyx
  · 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
hneven : Even n
⊢ 0 < x + y

Next tactic:
linarith
theorem pow_two_sub_pow (hyx : y < x) (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : n ≠ 0)
    (hneven : Even n) :
    padicValNat 2 (x ^ n - y ^ n) + 1 =
      padicValNat 2 (x + y) + padicValNat 2 (x - y) + padicValNat 2 n := by
  simp only [← PartENat.natCast_inj, Nat.cast_add]
  iterate 4 rw [padicValNat_def, PartENat.natCast_get]
  · convert Nat.two_pow_sub_pow hxy hx hneven using 2
  · exact hn.bot_lt
  · exact Nat.sub_pos_of_lt hyx
  · linarith
  · 

Proof state:
R : Type u_1
n✝ x y : ℕ
hyx : y < x
hxy : 2 ∣ x - y
hx : ¬2 ∣ x
n : ℕ
hn : n ≠ 0
hneven : Even n
⊢ 0 < x ^ n - y ^ n

Next tactic:
simp only [tsub_pos_iff_lt, pow_lt_pow_left hyx zero_le' hn]
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  

Proof state:
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 : n ≠ 0
⊢ padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n

Next tactic:
rw [← PartENat.natCast_inj, Nat.cast_add]
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  rw [← PartENat.natCast_inj, Nat.cast_add]
  

Proof state:
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 : n ≠ 0
⊢ ↑(padicValNat p (x ^ n - y ^ n)) = ↑(padicValNat p (x - y)) + ↑(padicValNat p n)

Next tactic:
iterate 3 rw [padicValNat_def, PartENat.natCast_get]
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  rw [← PartENat.natCast_inj, Nat.cast_add]
  iterate 3 

Proof state:
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 : n ≠ 0
⊢ ↑(padicValNat p (x ^ n - y ^ n)) = ↑(padicValNat p (x - y)) + ↑(padicValNat p n)

Next tactic:
rw [padicValNat_def, PartENat.natCast_get]
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  rw [← PartENat.natCast_inj, Nat.cast_add]
  iterate 3 

Proof state:
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 : n ≠ 0
⊢ 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 : n ≠ 0
⊢ 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 : n ≠ 0
⊢ 0 < x ^ n - y ^ n

Next tactic:
rw [padicValNat_def, PartENat.natCast_get]
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  rw [← PartENat.natCast_inj, Nat.cast_add]
  iterate 3 

Proof state:
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 : n ≠ 0
⊢ 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 : n ≠ 0
⊢ 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 : n ≠ 0
⊢ 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 : n ≠ 0
⊢ 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 : n ≠ 0
⊢ 0 < x ^ n - y ^ n

Next tactic:
rw [padicValNat_def, PartENat.natCast_get]
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  rw [← PartENat.natCast_inj, Nat.cast_add]
  iterate 3 rw [padicValNat_def, PartENat.natCast_get]
  · 

Proof state:
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 : n ≠ 0
⊢ multiplicity p (x ^ n - y ^ n) = multiplicity p (x - y) + multiplicity p n

Next tactic:
exact multiplicity.Nat.pow_sub_pow hp.out hp1 hxy hx n
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  rw [← PartENat.natCast_inj, Nat.cast_add]
  iterate 3 rw [padicValNat_def, PartENat.natCast_get]
  · exact multiplicity.Nat.pow_sub_pow hp.out hp1 hxy hx n
  · 

Proof state:
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 : n ≠ 0
⊢ 0 < n

Next tactic:
exact hn.bot_lt
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  rw [← PartENat.natCast_inj, Nat.cast_add]
  iterate 3 rw [padicValNat_def, PartENat.natCast_get]
  · exact multiplicity.Nat.pow_sub_pow hp.out hp1 hxy hx n
  · exact hn.bot_lt
  · 

Proof state:
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 : n ≠ 0
⊢ 0 < x - y

Next tactic:
exact Nat.sub_pos_of_lt hyx
theorem pow_sub_pow (hyx : y < x) (hxy : p ∣ x - y) (hx : ¬p ∣ x) {n : ℕ} (hn : n ≠ 0) :
    padicValNat p (x ^ n - y ^ n) = padicValNat p (x - y) + padicValNat p n := by
  rw [← PartENat.natCast_inj, Nat.cast_add]
  iterate 3 rw [padicValNat_def, PartENat.natCast_get]
  · exact multiplicity.Nat.pow_sub_pow hp.out hp1 hxy hx n
  · exact hn.bot_lt
  · exact Nat.sub_pos_of_lt hyx
  · 

Proof state:
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 : n ≠ 0
⊢ 0 < x ^ n - y ^ n

Next tactic:
exact Nat.sub_pos_of_lt (Nat.pow_lt_pow_left hyx hn)
theorem pow_add_pow (hxy : p ∣ x + y) (hx : ¬p ∣ x) {n : ℕ} (hn : Odd n) :
    padicValNat p (x ^ n + y ^ n) = padicValNat p (x + y) + padicValNat p n := by
  

Proof state:
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

Next tactic:
cases' y with y
theorem pow_add_pow (hxy : p ∣ x + y) (hx : ¬p ∣ x) {n : ℕ} (hn : Odd n) :
    padicValNat p (x ^ n + y ^ n) = padicValNat p (x + y) + padicValNat p n := by
  cases' y with y
  · 

Proof state:
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

Next tactic:
contradiction
theorem pow_add_pow (hxy : p ∣ x + y) (hx : ¬p ∣ x) {n : ℕ} (hn : Odd n) :
    padicValNat p (x ^ n + y ^ n) = padicValNat p (x + y) + padicValNat p n := by
  cases' y with y
  · contradiction
  

Proof state:
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

Next tactic:
rw [← PartENat.natCast_inj, Nat.cast_add]