Theorem: Int.two_pow_two_pow_add_two_pow_two_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.851761
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
⊢ multiplicity 2 (x ^ 2 ^ i + y ^ 2 ^ i) = ↑1

tactic: have hxy_even : Even (x - y) := even_iff_two_dvd.mpr (dvd_trans (by norm_num) hxy)
state_before: R : Type ?u.851761
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
⊢ multiplicity 2 (x ^ 2 ^ i + y ^ 2 ^ i) = ↑1

tactic: have hy_odd : Odd y := by simpa using hx_odd.sub_even hxy_even
state_before: R : Type ?u.851761
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

tactic: refine' multiplicity.eq_coe_iff.mpr ⟨_, _⟩
state_before: R : Type ?u.851761
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

tactic: cases' i with i
state_before: case refine'_2
R : Type ?u.851761
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

tactic: 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
state_before: case refine'_2.succ
R : Type ?u.851761
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

tactic: intro x hx
state_before: case refine'_2.succ
R : Type ?u.851761
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

tactic: rw [pow_succ, mul_comm, pow_mul, Int.sq_mod_four_eq_one_of_odd hx.pow]
state_before: case refine'_2.succ
R : Type ?u.851761
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

tactic: rwa [Int.odd_iff_not_even, even_iff_two_dvd]
state_before: R : Type ?u.851761
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
⊢ Odd x

tactic: norm_num
state_before: R : Type ?u.851761
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
⊢ 2 ∣ 4

tactic: simpa using hx_odd.sub_even hxy_even
state_before: R : Type ?u.851761
n : ℕ
x y : ℤ
hx : ¬2 ∣ x
hxy : 4 ∣ x - y
i : ℕ
hx_odd : Odd x
hxy_even : Even (x - y)
⊢ Odd y

tactic: rw [pow_one, ← even_iff_two_dvd]
state_before: case refine'_1
R : Type ?u.851761
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

tactic: exact hx_odd.pow.add_odd hy_odd.pow
state_before: case refine'_1
R : Type ?u.851761
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)

tactic: intro hxy'
state_before: case refine'_2.zero
R : Type ?u.851761
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

tactic: have : 2 * 2 ∣ 2 * x := by
  have := dvd_add hxy hxy'
  norm_num at *
  rw [two_mul]
  exact this
state_before: case refine'_2.zero
R : Type ?u.851761
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

tactic: have : 2 ∣ x := (mul_dvd_mul_iff_left (by norm_num)).mp this
state_before: case refine'_2.zero
R : Type ?u.851761
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

tactic: contradiction
state_before: case refine'_2.zero
R : Type ?u.851761
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

tactic: have := dvd_add hxy hxy'
state_before: R : Type ?u.851761
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

tactic: norm_num at *
state_before: R : Type ?u.851761
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

tactic: rw [two_mul]
state_before: R : Type ?u.851761
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

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

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

tactic: rw [show (2 ^ (1 + 1) : ℤ) = 4 by norm_num, Int.dvd_iff_emod_eq_zero, Int.add_emod,
  this _ hx_odd, this _ hy_odd]
state_before: R : Type ?u.851761
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

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

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