internlm/Lean-Github huggingface dataset:
Theorem: descent_gcd3_coprime
Proof state before:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
H : 3 ∣ q ^ 2 + 3 * s ^ 2
⊢ 3 ∣ q
Tactic:
rw [dvd_add_left (dvd_mul_right _ _)] at H
Proof state after:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
H : 3 ∣ q ^ 2
⊢ 3 ∣ q
Theorem: descent_gcd3_coprime
Proof state before:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
H : 3 ∣ q ^ 2
⊢ 3 ∣ q
Tactic:
exact Prime.dvd_of_dvd_pow Int.prime_three H
Proof state after:
no goals
Theorem: descent_gcd3_coprime
Proof state before:
case nonzero
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
⊢ ¬(3 ^ 2 * 2 * s = 0 ∧ q ^ 2 + 3 * s ^ 2 = 0)
Tactic:
rintro ⟨h1, -⟩
Proof state after:
case nonzero.intro
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
h1 : 3 ^ 2 * 2 * s = 0
⊢ False
Theorem: descent_gcd3_coprime
Proof state before:
case nonzero.intro
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
h1 : 3 ^ 2 * 2 * s = 0
⊢ False
Tactic:
rw [mul_eq_zero] at h1
Proof state after:
case nonzero.intro
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
h1 : 3 ^ 2 * 2 = 0 ∨ s = 0
⊢ False
Theorem: descent_gcd3_coprime
Proof state before:
case nonzero.intro
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
h1 : 3 ^ 2 * 2 = 0 ∨ s = 0
⊢ False
Tactic:
exact hspos (h1.resolve_left (by norm_num))
Proof state after:
no goals
Theorem: descent_gcd3_coprime
Proof state before:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
h1 : 3 ^ 2 * 2 = 0 ∨ s = 0
⊢ ¬3 ^ 2 * 2 = 0
Tactic:
norm_num
Proof state after:
no goals
Theorem: descent_gcd3_coprime
Proof state before:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ k ∣ s
Tactic:
apply Int.dvd_mul_cancel_prime' h2ndvd hkdvdright Int.prime_two
Proof state after:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ k ∣ 2 * s
Theorem: descent_gcd3_coprime
Proof state before:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ k ∣ 2 * s
Tactic:
apply Int.dvd_mul_cancel_prime' h3ndvd hkdvdright Int.prime_three
Proof state after:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ k ∣ 3 * (2 * s)
Theorem: descent_gcd3_coprime
Proof state before:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ k ∣ 3 * (2 * s)
Tactic:
apply Int.dvd_mul_cancel_prime' h3ndvd hkdvdright Int.prime_three
Proof state after:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ k ∣ 3 * (3 * (2 * s))
Theorem: descent_gcd3_coprime
Proof state before:
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ k ∣ 3 * (3 * (2 * s))
Tactic:
convert hkdvdleft using 1
Proof state after:
case h.e'_4
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ 3 * (3 * (2 * s)) = 3 ^ 2 * 2 * s
Theorem: descent_gcd3_coprime
Proof state before:
case h.e'_4
q s : ℤ
h3_ndvd_q : ¬3 ∣ q
hspos : s ≠ 0
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
h2ndvd : ¬2 ∣ q ^ 2 + 3 * s ^ 2
h3ndvd : ¬3 ∣ q ^ 2 + 3 * s ^ 2
k : ℤ
hkprime : Prime k
hkdvdleft : k ∣ 3 ^ 2 * 2 * s
hkdvdright : k ∣ q ^ 2 + 3 * s ^ 2
⊢ 3 * (3 * (2 * s)) = 3 ^ 2 * 2 * s
Tactic:
ring
Proof state after:
no goals
Theorem: descent_gcd3
Proof state before:
a b c p q : ℤ
hp : p ≠ 0
hq : q ≠ 0
hcoprime : IsCoprime p q
hodd : Even p ↔ ¬Even q
hcube : 2 * p * (p ^ 2 + 3 * q ^ 2) = a ^ 3 ∨ 2 * p * (p ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * p * (p ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * p).gcd (p ^ 2 + 3 * q ^ 2) = 3
h3_dvd_p : 3 ∣ p
⊢ ∃ a' b' c', a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * p).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
have h3_ndvd_q : ¬3 ∣ q := by
  intro H
  have := hcoprime.isUnit_of_dvd' h3_dvd_p H
  rw [Int.isUnit_iff_natAbs_eq] at this
  norm_num at this
Proof state after:
a b c p q : ℤ
hp : p ≠ 0
hq : q ≠ 0
hcoprime : IsCoprime p q
hodd : Even p ↔ ¬Even q
hcube : 2 * p * (p ^ 2 + 3 * q ^ 2) = a ^ 3 ∨ 2 * p * (p ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * p * (p ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * p).gcd (p ^ 2 + 3 * q ^ 2) = 3
h3_dvd_p : 3 ∣ p
h3_ndvd_q : ¬3 ∣ q
⊢ ∃ a' b' c', a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * p).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
a b c p q : ℤ
hp : p ≠ 0
hq : q ≠ 0
hcoprime : IsCoprime p q
hodd : Even p ↔ ¬Even q
hcube : 2 * p * (p ^ 2 + 3 * q ^ 2) = a ^ 3 ∨ 2 * p * (p ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * p * (p ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * p).gcd (p ^ 2 + 3 * q ^ 2) = 3
h3_dvd_p : 3 ∣ p
h3_ndvd_q : ¬3 ∣ q
⊢ ∃ a' b' c', a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * p).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
obtain ⟨s, rfl⟩ := h3_dvd_p
Proof state after:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
have hspos : s ≠ 0 := right_ne_zero_of_mul hp
Proof state after:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
have hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) := by
  ring
Proof state after:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
have hodd' : Even q ↔ ¬Even s :=
  by
  rw [Iff.comm, not_iff_comm, Iff.comm]
  have : ¬ Even (3 : ℤ) := by decide
  simpa [this, parity_simps] using hodd
Proof state after:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
have hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2) :=
  descent_gcd3_coprime h3_ndvd_q hspos hcoprime' hodd'
Proof state after:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
obtain ⟨r, hr⟩ : ∃ r, 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = r ^ 3 := by
  rcases hcube with (hcube | hcube | hcube) <;> [(use a); (use b); (use c)]
Proof state after:
case intro.intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = r ^ 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro.intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = r ^ 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
rw [hps] at hr
Proof state after:
case intro.intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro.intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
have : Odd 3 := by norm_num; decide
Proof state after:
case intro.intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
this : Odd 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro.intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
this : Odd 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
obtain ⟨hcubeleft, hcuberight⟩ := Int.eq_pow_of_mul_eq_pow_odd hcoprime'' this hr
Proof state after:
case intro.intro.intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
this : Odd 3
hcubeleft : ∃ d, 3 ^ 2 * 2 * s = d ^ 3
hcuberight : ∃ e, q ^ 2 + 3 * s ^ 2 = e ^ 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro.intro.intro
a b c q : ℤ
hq : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
this : Odd 3
hcubeleft : ∃ d, 3 ^ 2 * 2 * s = d ^ 3
hcuberight : ∃ e, q ^ 2 + 3 * s ^ 2 = e ^ 3
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
obtain ⟨u, v, hq, hs, huvcoprime, huvodd⟩ := obscure' q s hq hcoprime'.symm hodd' hcuberight
Proof state after:
case intro.intro.intro.intro.intro.intro.intro.intro
a b c q : ℤ
hq✝ : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
this : Odd 3
hcubeleft : ∃ d, 3 ^ 2 * 2 * s = d ^ 3
hcuberight : ∃ e, q ^ 2 + 3 * s ^ 2 = e ^ 3
u v : ℤ
hq : q = u * (u - 3 * v) * (u + 3 * v)
hs : s = 3 * v * (u - v) * (u + v)
huvcoprime : IsCoprime u v
huvodd : Even u ↔ ¬Even v
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Theorem: descent_gcd3
Proof state before:
case intro.intro.intro.intro.intro.intro.intro.intro
a b c q : ℤ
hq✝ : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
this : Odd 3
hcubeleft : ∃ d, 3 ^ 2 * 2 * s = d ^ 3
hcuberight : ∃ e, q ^ 2 + 3 * s ^ 2 = e ^ 3
u v : ℤ
hq : q = u * (u - 3 * v) * (u + 3 * v)
hs : s = 3 * v * (u - v) * (u + v)
huvcoprime : IsCoprime u v
huvodd : Even u ↔ ¬Even v
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3
Tactic:
have hv : v ≠ 0 := by
  rintro rfl
  norm_num at hs
  contradiction
Proof state after:
case intro.intro.intro.intro.intro.intro.intro.intro
a b c q : ℤ
hq✝ : q ≠ 0
h3_ndvd_q : ¬3 ∣ q
s : ℤ
hp : 3 * s ≠ 0
hcoprime : IsCoprime (3 * s) q
hodd : Even (3 * s) ↔ ¬Even q
hcube :
  2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = a ^ 3 ∨
    2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = b ^ 3 ∨ 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = c ^ 3
hgcd : (2 * (3 * s)).gcd ((3 * s) ^ 2 + 3 * q ^ 2) = 3
hspos : s ≠ 0
hps : 2 * (3 * s) * ((3 * s) ^ 2 + 3 * q ^ 2) = 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2)
hcoprime' : IsCoprime s q
hodd' : Even q ↔ ¬Even s
hcoprime'' : IsCoprime (3 ^ 2 * 2 * s) (q ^ 2 + 3 * s ^ 2)
r : ℤ
hr : 3 ^ 2 * 2 * s * (q ^ 2 + 3 * s ^ 2) = r ^ 3
this : Odd 3
hcubeleft : ∃ d, 3 ^ 2 * 2 * s = d ^ 3
hcuberight : ∃ e, q ^ 2 + 3 * s ^ 2 = e ^ 3
u v : ℤ
hq : q = u * (u - 3 * v) * (u + 3 * v)
hs : s = 3 * v * (u - v) * (u + v)
huvcoprime : IsCoprime u v
huvodd : Even u ↔ ¬Even v
hv : v ≠ 0
⊢ ∃ a' b' c',
    a' ≠ 0 ∧ b' ≠ 0 ∧ c' ≠ 0 ∧ (a' ^ 3 * b' ^ 3 * c' ^ 3).natAbs ≤ (2 * (3 * s)).natAbs ∧ a' ^ 3 + b' ^ 3 = c' ^ 3