[STATEMENT]
lemma no_rewritten_fermat3:
  "\<not> (\<exists> v w. v^3+w^3 = x^3 \<and> v*w*x \<noteq> 0 \<and> even (x::int) \<and> coprime v w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
[PROOF STEP]
proof (induct x rule: infinite_descent0_measure[where V="\<lambda>x. nat\<bar>x^3\<bar>"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. nat \<bar>x ^ 3\<bar> = 0 \<Longrightarrow> \<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
 2. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
case (0 x)
[PROOF STATE]
proof (state)
this:
nat \<bar>x ^ 3\<bar> = 0

goal (2 subgoals):
 1. \<And>x. nat \<bar>x ^ 3\<bar> = 0 \<Longrightarrow> \<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
 2. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
hence "x^3 = 0"
[PROOF STATE]
proof (prove)
using this:
nat \<bar>x ^ 3\<bar> = 0

goal (1 subgoal):
 1. x ^ 3 = 0
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
x ^ 3 = 0

goal (2 subgoals):
 1. \<And>x. nat \<bar>x ^ 3\<bar> = 0 \<Longrightarrow> \<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
 2. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
hence "x=0"
[PROOF STATE]
proof (prove)
using this:
x ^ 3 = 0

goal (1 subgoal):
 1. x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = 0

goal (2 subgoals):
 1. \<And>x. nat \<bar>x ^ 3\<bar> = 0 \<Longrightarrow> \<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
 2. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
x = 0

goal (1 subgoal):
 1. \<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
case (smaller x)
[PROOF STATE]
proof (state)
this:
0 < nat \<bar>x ^ 3\<bar>
\<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < nat \<bar>x ^ 3\<bar>
\<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)
[PROOF STEP]
obtain v w where vwx:
    "v^3+w^3=x^3 \<and> v*w*x \<noteq> 0 \<and> even x \<and> coprime v w" (is "?P v w x")
[PROOF STATE]
proof (prove)
using this:
0 < nat \<bar>x ^ 3\<bar>
\<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)

goal (1 subgoal):
 1. (\<And>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
[PROOF STEP]
have "coprime v w"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w

goal (1 subgoal):
 1. coprime v w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coprime v w

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
have "\<exists> \<alpha> \<beta> \<gamma>. ?P \<alpha> \<beta> \<gamma> \<and> nat\<bar>\<gamma>^3\<bar> < nat\<bar>x^3\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
proof -
    \<comment> \<open>obtain coprime $p$ and $q$ such that $v = p+q$ and $w = p-q$\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have vwOdd: "odd v \<and> odd w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd v \<and> odd w
[PROOF STEP]
proof (rule ccontr, case_tac "odd v", simp_all)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
assume ve: "even v"
[PROOF STATE]
proof (state)
this:
even v

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
hence "even (v^3)"
[PROOF STATE]
proof (prove)
using this:
even v

goal (1 subgoal):
 1. even (v ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (v ^ 3)

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even (v ^ 3)

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
from vwx
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
[PROOF STEP]
have "even (x^3)"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w

goal (1 subgoal):
 1. even (x ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (x ^ 3)

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
even (v ^ 3)
even (x ^ 3)
[PROOF STEP]
have "even (x^3-v^3)"
[PROOF STATE]
proof (prove)
using this:
even (v ^ 3)
even (x ^ 3)

goal (1 subgoal):
 1. even (x ^ 3 - v ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (x ^ 3 - v ^ 3)

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even (x ^ 3 - v ^ 3)

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
from vwx
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
[PROOF STEP]
have "x^3-v^3 = w^3"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w

goal (1 subgoal):
 1. x ^ 3 - v ^ 3 = w ^ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x ^ 3 - v ^ 3 = w ^ 3

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
even (x ^ 3 - v ^ 3)
x ^ 3 - v ^ 3 = w ^ 3
[PROOF STEP]
have "even (w^3)"
[PROOF STATE]
proof (prove)
using this:
even (x ^ 3 - v ^ 3)
x ^ 3 - v ^ 3 = w ^ 3

goal (1 subgoal):
 1. even (w ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (w ^ 3)

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
hence "even w"
[PROOF STATE]
proof (prove)
using this:
even (w ^ 3)

goal (1 subgoal):
 1. even w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even w

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
with ve
[PROOF STATE]
proof (chain)
picking this:
even v
even w
[PROOF STEP]
have "2 dvd v \<and> 2 dvd w"
[PROOF STATE]
proof (prove)
using this:
even v
even w

goal (1 subgoal):
 1. even v \<and> even w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even v \<and> even w

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
hence "2 dvd gcd v w"
[PROOF STATE]
proof (prove)
using this:
even v \<and> even w

goal (1 subgoal):
 1. even (gcd v w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (gcd v w)

goal (2 subgoals):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
 2. even v \<Longrightarrow> False
[PROOF STEP]
with vwx
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
even (gcd v w)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
even (gcd v w)

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "odd v" and "even w"
[PROOF STATE]
proof (state)
this:
odd v
even w

goal (1 subgoal):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "odd (v^3)" and "even (w^3)"
[PROOF STATE]
proof (prove)
using this:
odd v
even w

goal (1 subgoal):
 1. odd (v ^ 3) &&& even (w ^ 3)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd (v ^ 3)
even (w ^ 3)

goal (1 subgoal):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "odd (w^3 + v^3)"
[PROOF STATE]
proof (prove)
using this:
odd (v ^ 3)
even (w ^ 3)

goal (1 subgoal):
 1. odd (w ^ 3 + v ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
odd (w ^ 3 + v ^ 3)

goal (1 subgoal):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with vwx
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
odd (w ^ 3 + v ^ 3)
[PROOF STEP]
have "odd (x^3)"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
odd (w ^ 3 + v ^ 3)

goal (1 subgoal):
 1. odd (x ^ 3)
[PROOF STEP]
by (simp add: add.commute)
[PROOF STATE]
proof (state)
this:
odd (x ^ 3)

goal (1 subgoal):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "odd x"
[PROOF STATE]
proof (prove)
using this:
odd (x ^ 3)

goal (1 subgoal):
 1. odd x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
odd x

goal (1 subgoal):
 1. \<lbrakk>even w; odd v\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with vwx
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
odd x
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
odd x

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd v \<and> odd w

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "even (v+w) \<and> even (v-w)"
[PROOF STATE]
proof (prove)
using this:
odd v \<and> odd w

goal (1 subgoal):
 1. even (v + w) \<and> even (v - w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (v + w) \<and> even (v - w)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even (v + w) \<and> even (v - w)
[PROOF STEP]
obtain p q where pq: "v+w = 2*p \<and> v-w = 2*q"
[PROOF STATE]
proof (prove)
using this:
even (v + w) \<and> even (v - w)

goal (1 subgoal):
 1. (\<And>p q. v + w = 2 * p \<and> v - w = 2 * q \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using evenE[of "v+w"] evenE[of "v-w"]
[PROOF STATE]
proof (prove)
using this:
even (v + w) \<and> even (v - w)
\<lbrakk>even (v + w); \<And>b. v + w = 2 * b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
\<lbrakk>even (v - w); \<And>b. v - w = 2 * b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>p q. v + w = 2 * p \<and> v - w = 2 * q \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
v + w = 2 * p \<and> v - w = 2 * q

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence vw: "v = p+q \<and> w = p-q"
[PROOF STATE]
proof (prove)
using this:
v + w = 2 * p \<and> v - w = 2 * q

goal (1 subgoal):
 1. v = p + q \<and> w = p - q
[PROOF STEP]
by auto
    \<comment> \<open>show that $x^3 = (2p)(p^2 + 3q^2)$ and that these factors are\<close>
    \<comment> \<open>either coprime (first case), or have $3$ as g.c.d. (second case)\<close>
[PROOF STATE]
proof (state)
this:
v = p + q \<and> w = p - q

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have vwpq: "v^3 + w^3 = (2*p)*(p^2 + 3*q^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "2*(v^3 + w^3) = 2*(v+w)*(v^2 - v*w + w^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (v ^ 3 + w ^ 3) = 2 * (v + w) * (v\<^sup>2 - v * w + w\<^sup>2)
[PROOF STEP]
by (simp only: factor_sum_cubes)
[PROOF STATE]
proof (state)
this:
2 * (v ^ 3 + w ^ 3) = 2 * (v + w) * (v\<^sup>2 - v * w + w\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (v ^ 3 + w ^ 3) = 2 * (v + w) * (v\<^sup>2 - v * w + w\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
from pq
[PROOF STATE]
proof (chain)
picking this:
v + w = 2 * p \<and> v - w = 2 * q
[PROOF STEP]
have "\<dots> = 4*p*(v^2 - v*w + w^2)"
[PROOF STATE]
proof (prove)
using this:
v + w = 2 * p \<and> v - w = 2 * q

goal (1 subgoal):
 1. 2 * (v + w) * (v\<^sup>2 - v * w + w\<^sup>2) = 4 * p * (v\<^sup>2 - v * w + w\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * (v + w) * (v\<^sup>2 - v * w + w\<^sup>2) = 4 * p * (v\<^sup>2 - v * w + w\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (v + w) * (v\<^sup>2 - v * w + w\<^sup>2) = 4 * p * (v\<^sup>2 - v * w + w\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "\<dots> = p*((v+w)^2 + 3*(v-w)^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * p * (v\<^sup>2 - v * w + w\<^sup>2) = p * ((v + w)\<^sup>2 + 3 * (v - w)\<^sup>2)
[PROOF STEP]
by (simp add: eval_nat_numeral field_simps)
[PROOF STATE]
proof (state)
this:
4 * p * (v\<^sup>2 - v * w + w\<^sup>2) = p * ((v + w)\<^sup>2 + 3 * (v - w)\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
4 * p * (v\<^sup>2 - v * w + w\<^sup>2) = p * ((v + w)\<^sup>2 + 3 * (v - w)\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
with pq
[PROOF STATE]
proof (chain)
picking this:
v + w = 2 * p \<and> v - w = 2 * q
4 * p * (v\<^sup>2 - v * w + w\<^sup>2) = p * ((v + w)\<^sup>2 + 3 * (v - w)\<^sup>2)
[PROOF STEP]
have "\<dots> = p*((2*p)^2 + 3*(2*q)^2)"
[PROOF STATE]
proof (prove)
using this:
v + w = 2 * p \<and> v - w = 2 * q
4 * p * (v\<^sup>2 - v * w + w\<^sup>2) = p * ((v + w)\<^sup>2 + 3 * (v - w)\<^sup>2)

goal (1 subgoal):
 1. p * ((v + w)\<^sup>2 + 3 * (v - w)\<^sup>2) = p * ((2 * p)\<^sup>2 + 3 * (2 * q)\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p * ((v + w)\<^sup>2 + 3 * (v - w)\<^sup>2) = p * ((2 * p)\<^sup>2 + 3 * (2 * q)\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p * ((v + w)\<^sup>2 + 3 * (v - w)\<^sup>2) = p * ((2 * p)\<^sup>2 + 3 * (2 * q)\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "\<dots> = 2*(2*p)*(p^2+3*q^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * ((2 * p)\<^sup>2 + 3 * (2 * q)\<^sup>2) = 2 * (2 * p) * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
p * ((2 * p)\<^sup>2 + 3 * (2 * q)\<^sup>2) = 2 * (2 * p) * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * (v ^ 3 + w ^ 3) = 2 * (2 * p) * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * (v ^ 3 + w ^ 3) = 2 * (2 * p) * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
let ?g = "gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have g1: "?g \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?g \<ge> 1"
[PROOF STATE]
proof (state)
this:
\<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "?g < 0 \<or> ?g = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) < 0 \<or> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0
[PROOF STEP]
unfolding not_le
[PROOF STATE]
proof (prove)
using this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) < 1

goal (1 subgoal):
 1. gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) < 0 \<or> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) < 0 \<or> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0

goal (1 subgoal):
 1. \<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) < 0 \<or> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0

goal (1 subgoal):
 1. \<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have "?g \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) < 0 \<or> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0
0 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "?g = 0"
[PROOF STATE]
proof (prove)
using this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) < 0 \<or> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0
0 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0

goal (1 subgoal):
 1. \<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
hence "p = 0"
[PROOF STATE]
proof (prove)
using this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 0

goal (1 subgoal):
 1. p = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = 0

goal (1 subgoal):
 1. \<not> 1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
with vwpq vwx \<open>0 < nat\<bar>x^3\<bar>\<close>
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
0 < nat \<bar>x ^ 3\<bar>
p = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
0 < nat \<bar>x ^ 3\<bar>
p = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have gOdd: "odd ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> odd ?g"
[PROOF STATE]
proof (state)
this:
\<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
hence"2 dvd p^2+3*q^2"
[PROOF STATE]
proof (prove)
using this:
\<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. even (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
obtain k where k: "p^2 + 3*q^2 = 2*k"
[PROOF STATE]
proof (prove)
using this:
even (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. (\<And>k. p\<^sup>2 + 3 * q\<^sup>2 = 2 * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: dvd_def)
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = 2 * k

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
hence "2*(k - 2*q^2) = p^2-q^2"
[PROOF STATE]
proof (prove)
using this:
p\<^sup>2 + 3 * q\<^sup>2 = 2 * k

goal (1 subgoal):
 1. 2 * (k - 2 * q\<^sup>2) = p\<^sup>2 - q\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * (k - 2 * q\<^sup>2) = p\<^sup>2 - q\<^sup>2

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (k - 2 * q\<^sup>2) = p\<^sup>2 - q\<^sup>2

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = (p+q)*(p-q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p\<^sup>2 - q\<^sup>2 = (p + q) * (p - q)
[PROOF STEP]
by (simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
p\<^sup>2 - q\<^sup>2 = (p + q) * (p - q)

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * (k - 2 * q\<^sup>2) = (p + q) * (p - q)
[PROOF STEP]
have "v*w = 2*(k - 2*q^2)"
[PROOF STATE]
proof (prove)
using this:
2 * (k - 2 * q\<^sup>2) = (p + q) * (p - q)

goal (1 subgoal):
 1. v * w = 2 * (k - 2 * q\<^sup>2)
[PROOF STEP]
using vw
[PROOF STATE]
proof (prove)
using this:
2 * (k - 2 * q\<^sup>2) = (p + q) * (p - q)
v = p + q \<and> w = p - q

goal (1 subgoal):
 1. v * w = 2 * (k - 2 * q\<^sup>2)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
v * w = 2 * (k - 2 * q\<^sup>2)

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
hence "even (v*w)"
[PROOF STATE]
proof (prove)
using this:
v * w = 2 * (k - 2 * q\<^sup>2)

goal (1 subgoal):
 1. even (v * w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even (v * w)

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
hence "even (v) \<or> even (w)"
[PROOF STATE]
proof (prove)
using this:
even (v * w)

goal (1 subgoal):
 1. even v \<or> even w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even v \<or> even w

goal (1 subgoal):
 1. \<not> odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)) \<Longrightarrow> False
[PROOF STEP]
with vwOdd
[PROOF STATE]
proof (chain)
picking this:
odd v \<and> odd w
even v \<or> even w
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
odd v \<and> odd w
even v \<or> even w

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
have even_odd_p_q: "even p \<and> odd q \<or> odd p \<and> even q"
[PROOF STATE]
proof (prove)
using this:
odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. even p \<and> odd q \<or> odd p \<and> even q
[PROOF STEP]
by auto
    \<comment> \<open>first case: $p$ is not a multiple of $3$; hence $2p$ and $p^2+3q^2$\<close>
    \<comment> \<open>are coprime; hence both are cubes\<close>
[PROOF STATE]
proof (state)
this:
even p \<and> odd q \<or> odd p \<and> even q

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
even p \<and> odd q \<or> odd p \<and> even q

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
assume p3: "\<not> 3 dvd p"
[PROOF STATE]
proof (state)
this:
\<not> 3 dvd p

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have g3: "\<not> 3 dvd ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> \<not> 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> \<not> 3 dvd ?g"
[PROOF STATE]
proof (state)
this:
\<not> \<not> 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<not> \<not> 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
hence "3 dvd 2*p"
[PROOF STATE]
proof (prove)
using this:
\<not> \<not> 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 3 dvd 2 * p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 dvd 2 * p

goal (1 subgoal):
 1. \<not> \<not> 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
hence "(3::int) dvd 2 \<or> 3 dvd p"
[PROOF STATE]
proof (prove)
using this:
3 dvd 2 * p

goal (1 subgoal):
 1. 3 dvd 2 \<or> 3 dvd p
[PROOF STEP]
using prime_dvd_multD[of 3]
[PROOF STATE]
proof (prove)
using this:
3 dvd 2 * p
\<lbrakk>prime (3::?'a1); (3::?'a1) dvd ?a * ?b\<rbrakk> \<Longrightarrow> (3::?'a1) dvd ?a \<or> (3::?'a1) dvd ?b

goal (1 subgoal):
 1. 3 dvd 2 \<or> 3 dvd p
[PROOF STEP]
by (fastforce simp add: prime_dvd_mult_iff)
[PROOF STATE]
proof (state)
this:
3 dvd 2 \<or> 3 dvd p

goal (1 subgoal):
 1. \<not> \<not> 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
with p3
[PROOF STATE]
proof (chain)
picking this:
\<not> 3 dvd p
3 dvd 2 \<or> 3 dvd p
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> 3 dvd p
3 dvd 2 \<or> 3 dvd p

goal (1 subgoal):
 1. False
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from \<open>coprime v w\<close>
[PROOF STATE]
proof (chain)
picking this:
coprime v w
[PROOF STEP]
have pq_relprime: "coprime p q"
[PROOF STATE]
proof (prove)
using this:
coprime v w

goal (1 subgoal):
 1. coprime p q
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd p; e dvd q\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd p; e dvd q\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd p; e dvd q\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd p; e dvd q\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
assume "c dvd p" and "c dvd q"
[PROOF STATE]
proof (state)
this:
c dvd p
c dvd q

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd p; e dvd q\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd p; e dvd q\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c dvd p
c dvd q
[PROOF STEP]
have "c dvd p + q" and "c dvd p - q"
[PROOF STATE]
proof (prove)
using this:
c dvd p
c dvd q

goal (1 subgoal):
 1. c dvd p + q &&& c dvd p - q
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
c dvd p + q
c dvd p - q

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd p; e dvd q\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd p; e dvd q\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with vw
[PROOF STATE]
proof (chain)
picking this:
v = p + q \<and> w = p - q
c dvd p + q
c dvd p - q
[PROOF STEP]
show "c dvd v" and "c dvd w"
[PROOF STATE]
proof (prove)
using this:
v = p + q \<and> w = p - q
c dvd p + q
c dvd p - q

goal (1 subgoal):
 1. c dvd v &&& c dvd w
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
c dvd v
c dvd w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime p q

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from \<open>coprime p q\<close>
[PROOF STATE]
proof (chain)
picking this:
coprime p q
[PROOF STEP]
have "coprime p (q\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
coprime p q

goal (1 subgoal):
 1. coprime p (q\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coprime p (q\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime p (q\<^sup>2)
[PROOF STEP]
have factors_relprime: "coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
coprime p (q\<^sup>2)

goal (1 subgoal):
 1. coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd p
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd p
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
assume g2p: "c dvd 2 * p" and gpq: "c dvd p\<^sup>2 + 3 * q\<^sup>2"
[PROOF STATE]
proof (state)
this:
c dvd 2 * p
c dvd p\<^sup>2 + 3 * q\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd p
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
have "coprime 2 c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime 2 c
[PROOF STEP]
using g2p gpq even_odd_p_q dvd_trans [of 2 c "p\<^sup>2 + 3 * q\<^sup>2"]
[PROOF STATE]
proof (prove)
using this:
c dvd 2 * p
c dvd p\<^sup>2 + 3 * q\<^sup>2
even p \<and> odd q \<or> odd p \<and> even q
\<lbrakk>even c; c dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> even (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. coprime 2 c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime 2 c

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd p
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
with g2p
[PROOF STATE]
proof (chain)
picking this:
c dvd 2 * p
coprime 2 c
[PROOF STEP]
show "c dvd p"
[PROOF STATE]
proof (prove)
using this:
c dvd 2 * p
coprime 2 c

goal (1 subgoal):
 1. c dvd p
[PROOF STEP]
by (simp add: coprime_dvd_mult_left_iff ac_simps)
[PROOF STATE]
proof (state)
this:
c dvd p

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c dvd p
[PROOF STEP]
have "c dvd p\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
c dvd p

goal (1 subgoal):
 1. c dvd p\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
c dvd p\<^sup>2

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
with gpq
[PROOF STATE]
proof (chain)
picking this:
c dvd p\<^sup>2 + 3 * q\<^sup>2
c dvd p\<^sup>2
[PROOF STEP]
have "c dvd 3 * q\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
c dvd p\<^sup>2 + 3 * q\<^sup>2
c dvd p\<^sup>2

goal (1 subgoal):
 1. c dvd 3 * q\<^sup>2
[PROOF STEP]
by (simp add: dvd_add_right_iff)
[PROOF STATE]
proof (state)
this:
c dvd 3 * q\<^sup>2

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c dvd 3 * q\<^sup>2

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
have "coprime 3 c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime 3 c
[PROOF STEP]
using \<open>c dvd p\<close> p3 dvd_trans [of 3 c p]
[PROOF STATE]
proof (prove)
using this:
c dvd p
\<not> 3 dvd p
\<lbrakk>3 dvd c; c dvd p\<rbrakk> \<Longrightarrow> 3 dvd p

goal (1 subgoal):
 1. coprime 3 c
[PROOF STEP]
by (auto intro: prime_imp_coprime)
[PROOF STATE]
proof (state)
this:
coprime 3 c

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * p; e dvd p\<^sup>2 + 3 * q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd q\<^sup>2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c dvd 3 * q\<^sup>2
coprime 3 c
[PROOF STEP]
show "c dvd q\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
c dvd 3 * q\<^sup>2
coprime 3 c

goal (1 subgoal):
 1. c dvd q\<^sup>2
[PROOF STEP]
by (simp add: coprime_dvd_mult_right_iff ac_simps)
[PROOF STATE]
proof (state)
this:
c dvd q\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from vwx vwpq
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have pqx: "(2*p)*(p^2 + 3*q^2) = x^3"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = x ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = x ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = x ^ 3
[PROOF STEP]
have "\<exists> c. 2*p = c^3"
[PROOF STATE]
proof (prove)
using this:
coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = x ^ 3

goal (1 subgoal):
 1. \<exists>c. 2 * p = c ^ 3
[PROOF STEP]
by (simp add: int_relprime_odd_power_divisors)
[PROOF STATE]
proof (state)
this:
\<exists>c. 2 * p = c ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>c. 2 * p = c ^ 3
[PROOF STEP]
obtain c where c: "c^3 = 2*p"
[PROOF STATE]
proof (prove)
using this:
\<exists>c. 2 * p = c ^ 3

goal (1 subgoal):
 1. (\<And>c. c ^ 3 = 2 * p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c ^ 3 = 2 * p

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from pqx factors_relprime
[PROOF STATE]
proof (chain)
picking this:
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = x ^ 3
coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "coprime (p^2 + 3*q^2) (2*p)"
        and "(p^2 + 3*q^2)*(2*p) = x^3"
[PROOF STATE]
proof (prove)
using this:
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = x ^ 3
coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. coprime (p\<^sup>2 + 3 * q\<^sup>2) (2 * p) &&& (p\<^sup>2 + 3 * q\<^sup>2) * (2 * p) = x ^ 3
[PROOF STEP]
by (auto simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
coprime (p\<^sup>2 + 3 * q\<^sup>2) (2 * p)
(p\<^sup>2 + 3 * q\<^sup>2) * (2 * p) = x ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "\<exists> d. p^2 + 3*q^2 = d^3"
[PROOF STATE]
proof (prove)
using this:
coprime (p\<^sup>2 + 3 * q\<^sup>2) (2 * p)
(p\<^sup>2 + 3 * q\<^sup>2) * (2 * p) = x ^ 3

goal (1 subgoal):
 1. \<exists>d. p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3
[PROOF STEP]
by (simp add: int_relprime_odd_power_divisors)
[PROOF STATE]
proof (state)
this:
\<exists>d. p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>d. p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3
[PROOF STEP]
obtain d where d: "p^2 + 3*q^2 = d^3"
[PROOF STATE]
proof (prove)
using this:
\<exists>d. p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3

goal (1 subgoal):
 1. (\<And>d. p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "odd d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd d
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
assume "\<not> odd d"
[PROOF STATE]
proof (state)
this:
\<not> odd d

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
hence "even (d^3)"
[PROOF STATE]
proof (prove)
using this:
\<not> odd d

goal (1 subgoal):
 1. even (d ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (d ^ 3)

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
hence "2 dvd d^3"
[PROOF STATE]
proof (prove)
using this:
even (d ^ 3)

goal (1 subgoal):
 1. even (d ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (d ^ 3)

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even (d ^ 3)

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
have "2 dvd 2*p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (2 * p)
[PROOF STEP]
by (rule dvd_triv_left)
[PROOF STATE]
proof (state)
this:
even (2 * p)

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
even (d ^ 3)
even (2 * p)
[PROOF STEP]
have "2 dvd gcd (2*p) (d^3)"
[PROOF STATE]
proof (prove)
using this:
even (d ^ 3)
even (2 * p)

goal (1 subgoal):
 1. even (gcd (2 * p) (d ^ 3))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (gcd (2 * p) (d ^ 3))

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
with d factors_relprime
[PROOF STATE]
proof (chain)
picking this:
p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3
coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
even (gcd (2 * p) (d ^ 3))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3
coprime (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
even (gcd (2 * p) (d ^ 3))

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd d

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with d pq_relprime
[PROOF STATE]
proof (chain)
picking this:
p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3
coprime p q
odd d
[PROOF STEP]
have "coprime p q \<and> p^2 + 3*q^2 = d^3 \<and> odd d"
[PROOF STATE]
proof (prove)
using this:
p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3
coprime p q
odd d

goal (1 subgoal):
 1. coprime p q \<and> p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3 \<and> odd d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coprime p q \<and> p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3 \<and> odd d

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "is_cube_form p q"
[PROOF STATE]
proof (prove)
using this:
coprime p q \<and> p\<^sup>2 + 3 * q\<^sup>2 = d ^ 3 \<and> odd d

goal (1 subgoal):
 1. is_cube_form p q
[PROOF STEP]
by (rule qf3_cube_impl_cube_form)
[PROOF STATE]
proof (state)
this:
is_cube_form p q

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_cube_form p q
[PROOF STEP]
obtain a b where "p = a^3 - 9*a*b^2 \<and> q = 3*a^2*b - 3*b^3"
[PROOF STATE]
proof (prove)
using this:
is_cube_form p q

goal (1 subgoal):
 1. (\<And>a b. p = a ^ 3 - 9 * a * b\<^sup>2 \<and> q = 3 * a\<^sup>2 * b - 3 * b ^ 3 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (unfold is_cube_form_def, auto)
[PROOF STATE]
proof (state)
this:
p = a ^ 3 - 9 * a * b\<^sup>2 \<and> q = 3 * a\<^sup>2 * b - 3 * b ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence ab: "p = a*(a+3*b)*(a- 3*b) \<and> q = b*(a+b)*(a-b)*3"
[PROOF STATE]
proof (prove)
using this:
p = a ^ 3 - 9 * a * b\<^sup>2 \<and> q = 3 * a\<^sup>2 * b - 3 * b ^ 3

goal (1 subgoal):
 1. p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
[PROOF STEP]
by (simp add: eval_nat_numeral field_simps)
[PROOF STATE]
proof (state)
this:
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with c
[PROOF STATE]
proof (chain)
picking this:
c ^ 3 = 2 * p
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
[PROOF STEP]
have abc: "(2*a)*(a+3*b)*(a- 3*b) = c^3"
[PROOF STATE]
proof (prove)
using this:
c ^ 3 = 2 * p
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3

goal (1 subgoal):
 1. 2 * a * (a + 3 * b) * (a - 3 * b) = c ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * a * (a + 3 * b) * (a - 3 * b) = c ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from pq_relprime ab
[PROOF STATE]
proof (chain)
picking this:
coprime p q
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
[PROOF STEP]
have ab_relprime: "coprime a b"
[PROOF STATE]
proof (prove)
using this:
coprime p q
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3

goal (1 subgoal):
 1. coprime a b
[PROOF STEP]
by (auto intro: coprime_imp_coprime)
[PROOF STATE]
proof (state)
this:
coprime a b

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime a b
[PROOF STEP]
have ab1: "coprime (2 * a) (a + 3 * b)"
[PROOF STATE]
proof (prove)
using this:
coprime a b

goal (1 subgoal):
 1. coprime (2 * a) (a + 3 * b)
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
assume h2a: "h dvd 2 * a" and hab: "h dvd a + 3 * b"
[PROOF STATE]
proof (state)
this:
h dvd 2 * a
h dvd a + 3 * b

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
have "coprime 2 h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime 2 h
[PROOF STEP]
using ab even_odd_p_q hab dvd_trans [of 2 h "a + 3 * b"]
[PROOF STATE]
proof (prove)
using this:
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
even p \<and> odd q \<or> odd p \<and> even q
h dvd a + 3 * b
\<lbrakk>even h; h dvd a + 3 * b\<rbrakk> \<Longrightarrow> even (a + 3 * b)

goal (1 subgoal):
 1. coprime 2 h
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime 2 h

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
with h2a
[PROOF STATE]
proof (chain)
picking this:
h dvd 2 * a
coprime 2 h
[PROOF STEP]
show "h dvd a"
[PROOF STATE]
proof (prove)
using this:
h dvd 2 * a
coprime 2 h

goal (1 subgoal):
 1. h dvd a
[PROOF STEP]
by (simp add: coprime_dvd_mult_left_iff ac_simps)
[PROOF STATE]
proof (state)
this:
h dvd a

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
with hab
[PROOF STATE]
proof (chain)
picking this:
h dvd a + 3 * b
h dvd a
[PROOF STEP]
have "h dvd 3 * b" and "\<not> 3 dvd h"
[PROOF STATE]
proof (prove)
using this:
h dvd a + 3 * b
h dvd a

goal (1 subgoal):
 1. h dvd 3 * b &&& \<not> 3 dvd h
[PROOF STEP]
using dvd_trans [of 3 h a] ab \<open>\<not> 3 dvd p\<close>
[PROOF STATE]
proof (prove)
using this:
h dvd a + 3 * b
h dvd a
\<lbrakk>3 dvd h; h dvd a\<rbrakk> \<Longrightarrow> 3 dvd a
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
\<not> 3 dvd p

goal (1 subgoal):
 1. h dvd 3 * b &&& \<not> 3 dvd h
[PROOF STEP]
by (auto simp add: dvd_add_right_iff)
[PROOF STATE]
proof (state)
this:
h dvd 3 * b
\<not> 3 dvd h

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h dvd 3 * b
\<not> 3 dvd h

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
have "coprime 3 h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime 3 h
[PROOF STEP]
using \<open>\<not> 3 dvd h\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> 3 dvd h

goal (1 subgoal):
 1. coprime 3 h
[PROOF STEP]
by (auto intro: prime_imp_coprime)
[PROOF STATE]
proof (state)
this:
coprime 3 h

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * a; e dvd a + 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
h dvd 3 * b
\<not> 3 dvd h
coprime 3 h
[PROOF STEP]
show "h dvd b"
[PROOF STATE]
proof (prove)
using this:
h dvd 3 * b
\<not> 3 dvd h
coprime 3 h

goal (1 subgoal):
 1. h dvd b
[PROOF STEP]
by (simp add: coprime_dvd_mult_left_iff ac_simps)
[PROOF STATE]
proof (state)
this:
h dvd b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime (2 * a) (a + 3 * b)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime (2 * a) (a + 3 * b)
[PROOF STEP]
have [simp]: "even b \<longleftrightarrow> odd a"
        and ab3: "coprime a (a + 3 * b)"
[PROOF STATE]
proof (prove)
using this:
coprime (2 * a) (a + 3 * b)

goal (1 subgoal):
 1. even b = odd a &&& coprime a (a + 3 * b)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
even b = odd a
coprime a (a + 3 * b)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from \<open>coprime a b\<close>
[PROOF STATE]
proof (chain)
picking this:
coprime a b
[PROOF STEP]
have ab4: "coprime a (a - 3 * b)"
[PROOF STATE]
proof (prove)
using this:
coprime a b

goal (1 subgoal):
 1. coprime a (a - 3 * b)
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
assume h2a: "h dvd a" and hab: "h dvd a - 3 * b"
[PROOF STATE]
proof (state)
this:
h dvd a
h dvd a - 3 * b

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h dvd a
h dvd a - 3 * b
[PROOF STEP]
show "h dvd a"
[PROOF STATE]
proof (prove)
using this:
h dvd a
h dvd a - 3 * b

goal (1 subgoal):
 1. h dvd a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd a

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
with hab
[PROOF STATE]
proof (chain)
picking this:
h dvd a - 3 * b
h dvd a
[PROOF STEP]
have "h dvd 3 * b" and "\<not> 3 dvd h"
[PROOF STATE]
proof (prove)
using this:
h dvd a - 3 * b
h dvd a

goal (1 subgoal):
 1. h dvd 3 * b &&& \<not> 3 dvd h
[PROOF STEP]
using dvd_trans [of 3 h a] ab \<open>\<not> 3 dvd p\<close> dvd_add_right_iff [of h a "- 3 * b"]
[PROOF STATE]
proof (prove)
using this:
h dvd a - 3 * b
h dvd a
\<lbrakk>3 dvd h; h dvd a\<rbrakk> \<Longrightarrow> 3 dvd a
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
\<not> 3 dvd p
h dvd a \<Longrightarrow> (h dvd a + - 3 * b) = (h dvd - 3 * b)

goal (1 subgoal):
 1. h dvd 3 * b &&& \<not> 3 dvd h
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h dvd 3 * b
\<not> 3 dvd h

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h dvd 3 * b
\<not> 3 dvd h

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
have "coprime 3 h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime 3 h
[PROOF STEP]
using \<open>\<not> 3 dvd h\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> 3 dvd h

goal (1 subgoal):
 1. coprime 3 h
[PROOF STEP]
by (auto intro: prime_imp_coprime)
[PROOF STATE]
proof (state)
this:
coprime 3 h

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a; e dvd a - 3 * b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
h dvd 3 * b
\<not> 3 dvd h
coprime 3 h
[PROOF STEP]
show "h dvd b"
[PROOF STATE]
proof (prove)
using this:
h dvd 3 * b
\<not> 3 dvd h
coprime 3 h

goal (1 subgoal):
 1. h dvd b
[PROOF STEP]
by (simp add: coprime_dvd_mult_left_iff ac_simps)
[PROOF STATE]
proof (state)
this:
h dvd b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime a (a - 3 * b)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from ab1
[PROOF STATE]
proof (chain)
picking this:
coprime (2 * a) (a + 3 * b)
[PROOF STEP]
have ab2: "coprime (a + 3 * b) (a - 3 * b)"
[PROOF STATE]
proof (prove)
using this:
coprime (2 * a) (a + 3 * b)

goal (1 subgoal):
 1. coprime (a + 3 * b) (a - 3 * b)
[PROOF STEP]
by (rule coprime_imp_coprime)
          (use dvd_add [of _ "a + 3 * b" "a - 3 * b"] in simp_all)
[PROOF STATE]
proof (state)
this:
coprime (a + 3 * b) (a - 3 * b)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "\<exists>k l m. 2 * a = k ^ 3 \<and> a + 3 * b = l ^ 3 \<and> a - 3 * b = m ^ 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k l m. 2 * a = k ^ 3 \<and> a + 3 * b = l ^ 3 \<and> a - 3 * b = m ^ 3
[PROOF STEP]
using ab2 ab3 ab4 abc
          int_relprime_odd_power_divisors [of 3 "2 * a" "(a + 3 * b) * (a - 3 * b)" c]
          int_relprime_odd_power_divisors [of 3 "(a + 3 * b)" "2 * a * (a - 3 * b)" c]
          int_relprime_odd_power_divisors [of 3 "(a - 3 * b)" "2 * a * (a + 3 * b)" c]
[PROOF STATE]
proof (prove)
using this:
coprime (a + 3 * b) (a - 3 * b)
coprime a (a + 3 * b)
coprime a (a - 3 * b)
2 * a * (a + 3 * b) * (a - 3 * b) = c ^ 3
\<lbrakk>odd 3; 2 * a * ((a + 3 * b) * (a - 3 * b)) = c ^ 3; coprime (2 * a) ((a + 3 * b) * (a - 3 * b))\<rbrakk> \<Longrightarrow> \<exists>k. 2 * a = k ^ 3
\<lbrakk>odd 3; (a + 3 * b) * (2 * a * (a - 3 * b)) = c ^ 3; coprime (a + 3 * b) (2 * a * (a - 3 * b))\<rbrakk> \<Longrightarrow> \<exists>k. a + 3 * b = k ^ 3
\<lbrakk>odd 3; (a - 3 * b) * (2 * a * (a + 3 * b)) = c ^ 3; coprime (a - 3 * b) (2 * a * (a + 3 * b))\<rbrakk> \<Longrightarrow> \<exists>k. a - 3 * b = k ^ 3

goal (1 subgoal):
 1. \<exists>k l m. 2 * a = k ^ 3 \<and> a + 3 * b = l ^ 3 \<and> a - 3 * b = m ^ 3
[PROOF STEP]
by auto (auto simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
\<exists>k l m. 2 * a = k ^ 3 \<and> a + 3 * b = l ^ 3 \<and> a - 3 * b = m ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>k l m. 2 * a = k ^ 3 \<and> a + 3 * b = l ^ 3 \<and> a - 3 * b = m ^ 3
[PROOF STEP]
obtain \<alpha> \<beta> \<gamma> where albega:
        "2*a = \<gamma>^3 \<and> a - 3*b = \<alpha>^3 \<and> a+3*b = \<beta>^3"
[PROOF STATE]
proof (prove)
using this:
\<exists>k l m. 2 * a = k ^ 3 \<and> a + 3 * b = l ^ 3 \<and> a - 3 * b = m ^ 3

goal (1 subgoal):
 1. (\<And>\<gamma> \<alpha> \<beta>. 2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
      \<comment> \<open>show this is a (smaller) solution\<close>
[PROOF STATE]
proof (state)
this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "\<alpha>^3 + \<beta>^3 = \<gamma>^3"
[PROOF STATE]
proof (prove)
using this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3

goal (1 subgoal):
 1. \<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "\<alpha>*\<beta>*\<gamma> \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> * \<beta> * \<gamma> \<noteq> 0
[PROOF STEP]
proof (rule ccontr, safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> False; \<alpha> * \<beta> * \<gamma> = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "\<alpha> * \<beta> * \<gamma> = 0"
[PROOF STATE]
proof (state)
this:
\<alpha> * \<beta> * \<gamma> = 0

goal (1 subgoal):
 1. \<lbrakk>\<not> False; \<alpha> * \<beta> * \<gamma> = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with albega ab
[PROOF STATE]
proof (chain)
picking this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
\<alpha> * \<beta> * \<gamma> = 0
[PROOF STEP]
have "p=0"
[PROOF STATE]
proof (prove)
using this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
\<alpha> * \<beta> * \<gamma> = 0

goal (1 subgoal):
 1. p = 0
[PROOF STEP]
by (auto simp add: power_0_left)
[PROOF STATE]
proof (state)
this:
p = 0

goal (1 subgoal):
 1. \<lbrakk>\<not> False; \<alpha> * \<beta> * \<gamma> = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with vwpq vwx
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
p = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
p = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<alpha> * \<beta> * \<gamma> \<noteq> 0

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<alpha> * \<beta> * \<gamma> \<noteq> 0

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "even \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
have "even (2*a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (2 * a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (2 * a)

goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
with albega
[PROOF STATE]
proof (chain)
picking this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3
even (2 * a)
[PROOF STEP]
have "even (\<gamma>^3)"
[PROOF STATE]
proof (prove)
using this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3
even (2 * a)

goal (1 subgoal):
 1. even (\<gamma> ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (\<gamma> ^ 3)

goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
even (\<gamma> ^ 3)

goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
even \<gamma>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even \<gamma>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "coprime \<alpha> \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime \<alpha> \<beta>
[PROOF STEP]
using ab2
[PROOF STATE]
proof (prove)
using this:
coprime (a + 3 * b) (a - 3 * b)

goal (1 subgoal):
 1. coprime \<alpha> \<beta>
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + 3 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - 3 * b
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + 3 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - 3 * b
[PROOF STEP]
assume ha: "h dvd \<alpha>" and hb: "h dvd \<beta>"
[PROOF STATE]
proof (state)
this:
h dvd \<alpha>
h dvd \<beta>

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + 3 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - 3 * b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h dvd \<alpha>
h dvd \<beta>
[PROOF STEP]
have "h dvd \<alpha> * \<alpha>^2 \<and> h dvd \<beta> * \<beta>^2"
[PROOF STATE]
proof (prove)
using this:
h dvd \<alpha>
h dvd \<beta>

goal (1 subgoal):
 1. h dvd \<alpha> * \<alpha>\<^sup>2 \<and> h dvd \<beta> * \<beta>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd \<alpha> * \<alpha>\<^sup>2 \<and> h dvd \<beta> * \<beta>\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + 3 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - 3 * b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h dvd \<alpha> * \<alpha>\<^sup>2 \<and> h dvd \<beta> * \<beta>\<^sup>2
[PROOF STEP]
have "h dvd \<alpha>^Suc 2 \<and> h dvd \<beta>^Suc 2"
[PROOF STATE]
proof (prove)
using this:
h dvd \<alpha> * \<alpha>\<^sup>2 \<and> h dvd \<beta> * \<beta>\<^sup>2

goal (1 subgoal):
 1. h dvd \<alpha> ^ Suc 2 \<and> h dvd \<beta> ^ Suc 2
[PROOF STEP]
by (auto simp only: power_Suc)
[PROOF STATE]
proof (state)
this:
h dvd \<alpha> ^ Suc 2 \<and> h dvd \<beta> ^ Suc 2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + 3 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - 3 * b
[PROOF STEP]
with albega
[PROOF STATE]
proof (chain)
picking this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3
h dvd \<alpha> ^ Suc 2 \<and> h dvd \<beta> ^ Suc 2
[PROOF STEP]
show "h dvd a - 3 * b" "h dvd a + 3 * b"
[PROOF STATE]
proof (prove)
using this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3
h dvd \<alpha> ^ Suc 2 \<and> h dvd \<beta> ^ Suc 2

goal (1 subgoal):
 1. h dvd a - 3 * b &&& h dvd a + 3 * b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h dvd a - 3 * b
h dvd a + 3 * b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime \<alpha> \<beta>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coprime \<alpha> \<beta>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "nat\<bar>\<gamma>^3\<bar> < nat\<bar>x^3\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
let ?A = "p^2 + 3*q^2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from vwx vwpq
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "x^3 = 2*p*?A"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with ab
[PROOF STATE]
proof (chain)
picking this:
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "\<dots> = 2*a*((a+3*b)*(a- 3*b)*?A)"
[PROOF STATE]
proof (prove)
using this:
p = a * (a + 3 * b) * (a - 3 * b) \<and> q = b * (a + b) * (a - b) * 3
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * a * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * a * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * a * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with albega
[PROOF STATE]
proof (chain)
picking this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * a * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
have "\<dots> = \<gamma>^3 *((a+3*b)*(a- 3*b)*?A)"
[PROOF STATE]
proof (prove)
using this:
2 * a = \<gamma> ^ 3 \<and> a - 3 * b = \<alpha> ^ 3 \<and> a + 3 * b = \<beta> ^ 3
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * a * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. 2 * a * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)) = \<gamma> ^ 3 * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * a * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)) = \<gamma> ^ 3 * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x ^ 3 = \<gamma> ^ 3 * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
have eq: "\<bar>x^3\<bar> = \<bar>\<gamma>^3\<bar> * \<bar>(a+3*b)*(a- 3*b)*?A\<bar>"
[PROOF STATE]
proof (prove)
using this:
x ^ 3 = \<gamma> ^ 3 * ((a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. \<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by (auto simp add: abs_mult)
[PROOF STATE]
proof (state)
this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with \<open>0 < nat\<bar>x^3\<bar>\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < nat \<bar>x ^ 3\<bar>
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
have "\<bar>(a+3*b)*(a- 3*b)*?A\<bar> > 0"
[PROOF STATE]
proof (prove)
using this:
0 < nat \<bar>x ^ 3\<bar>
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. 0 < \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence eqpos: "\<bar>(a+3*b)*(a- 3*b)\<bar> > 0"
[PROOF STATE]
proof (prove)
using this:
0 < \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. 0 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have Ag1: "\<bar>?A\<bar> > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
have Aqf3: "is_qfN ?A 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_qfN (p\<^sup>2 + 3 * q\<^sup>2) 3
[PROOF STEP]
by (auto simp add: is_qfN_def)
[PROOF STATE]
proof (state)
this:
is_qfN (p\<^sup>2 + 3 * q\<^sup>2) 3

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_qfN (p\<^sup>2 + 3 * q\<^sup>2) 3

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
have triv3b: "(3::int) \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> 3

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
is_qfN (p\<^sup>2 + 3 * q\<^sup>2) 3
1 \<le> 3
[PROOF STEP]
have "?A \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
is_qfN (p\<^sup>2 + 3 * q\<^sup>2) 3
1 \<le> 3

goal (1 subgoal):
 1. 0 \<le> p\<^sup>2 + 3 * q\<^sup>2
[PROOF STEP]
by (simp only: qfN_pos)
[PROOF STATE]
proof (state)
this:
0 \<le> p\<^sup>2 + 3 * q\<^sup>2

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
hence "?A > 1 \<or> ?A = 0 \<or> ?A =1"
[PROOF STATE]
proof (prove)
using this:
0 \<le> p\<^sup>2 + 3 * q\<^sup>2

goal (1 subgoal):
 1. 1 < p\<^sup>2 + 3 * q\<^sup>2 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 0 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 1
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
1 < p\<^sup>2 + 3 * q\<^sup>2 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 0 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 1

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 < p\<^sup>2 + 3 * q\<^sup>2 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 0 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 1

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
1 < p\<^sup>2 + 3 * q\<^sup>2 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 0 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 1

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
assume "?A = 0"
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = 0

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
with triv3b
[PROOF STATE]
proof (chain)
picking this:
1 \<le> 3
p\<^sup>2 + 3 * q\<^sup>2 = 0
[PROOF STEP]
have "p = 0 \<and> q = 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> 3
p\<^sup>2 + 3 * q\<^sup>2 = 0

goal (1 subgoal):
 1. p = 0 \<and> q = 0
[PROOF STEP]
by (rule qfN_zero)
[PROOF STATE]
proof (state)
this:
p = 0 \<and> q = 0

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
with vwpq vwx
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
p = 0 \<and> q = 0
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
p = 0 \<and> q = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
assume A1: "?A = 1"
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = 1

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
have "q=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "q \<noteq> 0"
[PROOF STATE]
proof (state)
this:
q \<noteq> 0

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "q^2 > 0"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0

goal (1 subgoal):
 1. 0 < q\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < q\<^sup>2

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "3*q^2 > 1"
[PROOF STATE]
proof (prove)
using this:
0 < q\<^sup>2

goal (1 subgoal):
 1. 1 < 3 * q\<^sup>2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
1 < 3 * q\<^sup>2

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 < 3 * q\<^sup>2

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "p^2 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> p\<^sup>2
[PROOF STEP]
by (rule zero_le_power2)
[PROOF STATE]
proof (state)
this:
0 \<le> p\<^sup>2

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 < 3 * q\<^sup>2
0 \<le> p\<^sup>2
[PROOF STEP]
have "?A > 1"
[PROOF STATE]
proof (prove)
using this:
1 < 3 * q\<^sup>2
0 \<le> p\<^sup>2

goal (1 subgoal):
 1. 1 < p\<^sup>2 + 3 * q\<^sup>2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
1 < p\<^sup>2 + 3 * q\<^sup>2

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
p\<^sup>2 + 3 * q\<^sup>2 = 1
1 < p\<^sup>2 + 3 * q\<^sup>2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p\<^sup>2 + 3 * q\<^sup>2 = 1
1 < p\<^sup>2 + 3 * q\<^sup>2

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
q = 0

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
with pq_relprime
[PROOF STATE]
proof (chain)
picking this:
coprime p q
q = 0
[PROOF STEP]
have "\<bar>p\<bar> = 1"
[PROOF STATE]
proof (prove)
using this:
coprime p q
q = 0

goal (1 subgoal):
 1. \<bar>p\<bar> = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>p\<bar> = 1

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
with vwpq vwx A1
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
p\<^sup>2 + 3 * q\<^sup>2 = 1
\<bar>p\<bar> = 1
[PROOF STEP]
have "\<bar>x^3\<bar> = 2"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
p\<^sup>2 + 3 * q\<^sup>2 = 1
\<bar>p\<bar> = 1

goal (1 subgoal):
 1. \<bar>x ^ 3\<bar> = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>x ^ 3\<bar> = 2

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
\<bar>x ^ 3\<bar> = 2

goal (1 subgoal):
 1. False
[PROOF STEP]
by (rule two_not_abs_cube)
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = 1 \<Longrightarrow> False

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 < p\<^sup>2 + 3 * q\<^sup>2 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 0 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 1
p\<^sup>2 + 3 * q\<^sup>2 = 0 \<Longrightarrow> False
p\<^sup>2 + 3 * q\<^sup>2 = 1 \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < p\<^sup>2 + 3 * q\<^sup>2 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 0 \<or> p\<^sup>2 + 3 * q\<^sup>2 = 1
p\<^sup>2 + 3 * q\<^sup>2 = 0 \<Longrightarrow> False
p\<^sup>2 + 3 * q\<^sup>2 = 1 \<Longrightarrow> False

goal (1 subgoal):
 1. 1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar>
1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
have
          "\<bar>(a+3*b)*(a- 3*b)\<bar>*1 < \<bar>(a+3*b)*(a- 3*b)\<bar>*\<bar>?A\<bar>"
[PROOF STATE]
proof (prove)
using this:
0 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar>
1 < \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>

goal (1 subgoal):
 1. \<bar>(a + 3 * b) * (a - 3 * b)\<bar> * 1 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar> * \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
by (simp only: zmult_zless_mono2)
[PROOF STATE]
proof (state)
this:
\<bar>(a + 3 * b) * (a - 3 * b)\<bar> * 1 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar> * \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with eqpos
[PROOF STATE]
proof (chain)
picking this:
0 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar>
\<bar>(a + 3 * b) * (a - 3 * b)\<bar> * 1 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar> * \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
have "\<bar>(a+3*b)*(a- 3*b)\<bar>*\<bar>?A\<bar> > 1"
[PROOF STATE]
proof (prove)
using this:
0 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar>
\<bar>(a + 3 * b) * (a - 3 * b)\<bar> * 1 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar> * \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>

goal (1 subgoal):
 1. 1 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar> * \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
1 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar> * \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "\<bar>(a+3*b)*(a- 3*b)*?A\<bar> > 1"
[PROOF STATE]
proof (prove)
using this:
1 < \<bar>(a + 3 * b) * (a - 3 * b)\<bar> * \<bar>p\<^sup>2 + 3 * q\<^sup>2\<bar>

goal (1 subgoal):
 1. 1 < \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by (auto simp add: abs_mult)
[PROOF STATE]
proof (state)
this:
1 < \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 < \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "\<bar>\<gamma>^3\<bar> > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
from eq
[PROOF STATE]
proof (chain)
picking this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
have "\<bar>\<gamma>^3\<bar> = 0 \<Longrightarrow> \<bar>x^3\<bar>=0"
[PROOF STATE]
proof (prove)
using this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. \<bar>\<gamma> ^ 3\<bar> = 0 \<Longrightarrow> \<bar>x ^ 3\<bar> = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>\<gamma> ^ 3\<bar> = 0 \<Longrightarrow> \<bar>x ^ 3\<bar> = 0

goal (1 subgoal):
 1. 0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
with \<open>0 < nat\<bar>x^3\<bar>\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < nat \<bar>x ^ 3\<bar>
\<bar>\<gamma> ^ 3\<bar> = 0 \<Longrightarrow> \<bar>x ^ 3\<bar> = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < nat \<bar>x ^ 3\<bar>
\<bar>\<gamma> ^ 3\<bar> = 0 \<Longrightarrow> \<bar>x ^ 3\<bar> = 0

goal (1 subgoal):
 1. 0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < \<bar>\<gamma> ^ 3\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < \<bar>\<gamma> ^ 3\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 < \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
have "\<bar>\<gamma>^3\<bar> * 1 < \<bar>\<gamma>^3\<bar> * \<bar>(a+3*b)*(a- 3*b)*?A\<bar>"
[PROOF STATE]
proof (prove)
using this:
1 < \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
0 < \<bar>\<gamma> ^ 3\<bar>

goal (1 subgoal):
 1. \<bar>\<gamma> ^ 3\<bar> * 1 < \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by (rule zmult_zless_mono2)
[PROOF STATE]
proof (state)
this:
\<bar>\<gamma> ^ 3\<bar> * 1 < \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
\<bar>\<gamma> ^ 3\<bar> * 1 < \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
have "\<bar>x^3\<bar> > \<bar>\<gamma>^3\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
\<bar>\<gamma> ^ 3\<bar> * 1 < \<bar>\<gamma> ^ 3\<bar> * \<bar>(a + 3 * b) * (a - 3 * b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. \<bar>\<gamma> ^ 3\<bar> < \<bar>x ^ 3\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>\<gamma> ^ 3\<bar> < \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>\<gamma> ^ 3\<bar> < \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3
\<alpha> * \<beta> * \<gamma> \<noteq> 0
even \<gamma>
coprime \<alpha> \<beta>
nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3
\<alpha> * \<beta> * \<gamma> \<noteq> 0
even \<gamma>
coprime \<alpha> \<beta>
nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<not> 3 dvd p \<Longrightarrow> \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
    \<comment> \<open>second case: $p = 3r$ and hence $x^3 = (18r)(q^2+3r^2)$ and these\<close>
    \<comment> \<open>factors are coprime; hence both are cubes\<close>
[PROOF STATE]
proof (state)
this:
\<not> 3 dvd p \<Longrightarrow> \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<not> 3 dvd p \<Longrightarrow> \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
assume p3: "3 dvd p"
[PROOF STATE]
proof (state)
this:
3 dvd p

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 dvd p
[PROOF STEP]
obtain r where r: "p = 3*r"
[PROOF STATE]
proof (prove)
using this:
3 dvd p

goal (1 subgoal):
 1. (\<And>r. p = 3 * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: dvd_def)
[PROOF STATE]
proof (state)
this:
p = 3 * r

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p = 3 * r

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "3 dvd 3*(3*r^2 + q^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 dvd 3 * (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
by (rule dvd_triv_left)
[PROOF STATE]
proof (state)
this:
3 dvd 3 * (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p = 3 * r
3 dvd 3 * (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
have pq3: "3 dvd p^2+3*q^2"
[PROOF STATE]
proof (prove)
using this:
p = 3 * r
3 dvd 3 * (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. 3 dvd p\<^sup>2 + 3 * q\<^sup>2
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
3 dvd p\<^sup>2 + 3 * q\<^sup>2

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
3 dvd p\<^sup>2 + 3 * q\<^sup>2

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from p3
[PROOF STATE]
proof (chain)
picking this:
3 dvd p
[PROOF STEP]
have "3 dvd 2*p"
[PROOF STATE]
proof (prove)
using this:
3 dvd p

goal (1 subgoal):
 1. 3 dvd 2 * p
[PROOF STEP]
by (rule dvd_mult)
[PROOF STATE]
proof (state)
this:
3 dvd 2 * p

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
3 dvd p\<^sup>2 + 3 * q\<^sup>2
3 dvd 2 * p
[PROOF STEP]
have g3: "3 dvd ?g"
[PROOF STATE]
proof (prove)
using this:
3 dvd p\<^sup>2 + 3 * q\<^sup>2
3 dvd 2 * p

goal (1 subgoal):
 1. 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from \<open>coprime v w\<close>
[PROOF STATE]
proof (chain)
picking this:
coprime v w
[PROOF STEP]
have qr_relprime: "coprime q r"
[PROOF STATE]
proof (prove)
using this:
coprime v w

goal (1 subgoal):
 1. coprime q r
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
assume hq: "h dvd q" "h dvd r"
[PROOF STATE]
proof (state)
this:
h dvd q
h dvd r

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with r
[PROOF STATE]
proof (chain)
picking this:
p = 3 * r
h dvd q
h dvd r
[PROOF STEP]
have "h dvd p"
[PROOF STATE]
proof (prove)
using this:
p = 3 * r
h dvd q
h dvd r

goal (1 subgoal):
 1. h dvd p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd p

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with hq
[PROOF STATE]
proof (chain)
picking this:
h dvd q
h dvd r
h dvd p
[PROOF STEP]
have "h dvd p + q" "h dvd p - q"
[PROOF STATE]
proof (prove)
using this:
h dvd q
h dvd r
h dvd p

goal (1 subgoal):
 1. h dvd p + q &&& h dvd p - q
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
h dvd p + q
h dvd p - q

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd q; e dvd r\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with vw
[PROOF STATE]
proof (chain)
picking this:
v = p + q \<and> w = p - q
h dvd p + q
h dvd p - q
[PROOF STEP]
show "h dvd v" "h dvd w"
[PROOF STATE]
proof (prove)
using this:
v = p + q \<and> w = p - q
h dvd p + q
h dvd p - q

goal (1 subgoal):
 1. h dvd v &&& h dvd w
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
h dvd v
h dvd w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime q r

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have factors_relprime: "coprime (18*r) (q^2 + 3*r^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
from g3
[PROOF STATE]
proof (chain)
picking this:
3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
obtain k where k: "?g = 3*k"
[PROOF STATE]
proof (prove)
using this:
3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. (\<And>k. gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 3 * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: dvd_def)
[PROOF STATE]
proof (state)
this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 3 * k

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
have "k = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k = 1
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
assume "k \<noteq> 1"
[PROOF STATE]
proof (state)
this:
k \<noteq> 1

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
with g1 k
[PROOF STATE]
proof (chain)
picking this:
1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 3 * k
k \<noteq> 1
[PROOF STEP]
have "k > 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 3 * k
k \<noteq> 1

goal (1 subgoal):
 1. 1 < k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < k

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < k
[PROOF STEP]
obtain h where h: "prime h \<and> h dvd k"
[PROOF STATE]
proof (prove)
using this:
1 < k

goal (1 subgoal):
 1. (\<And>h. prime h \<and> h dvd k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using prime_divisor_exists[of k]
[PROOF STATE]
proof (prove)
using this:
1 < k
\<lbrakk>k \<noteq> 0; \<not> is_unit k\<rbrakk> \<Longrightarrow> \<exists>b. b dvd k \<and> prime b

goal (1 subgoal):
 1. (\<And>h. prime h \<and> h dvd k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime h \<and> h dvd k

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
with k
[PROOF STATE]
proof (chain)
picking this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 3 * k
prime h \<and> h dvd k
[PROOF STEP]
have hg: "3*h dvd ?g"
[PROOF STATE]
proof (prove)
using this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 3 * k
prime h \<and> h dvd k

goal (1 subgoal):
 1. 3 * h dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by (auto simp add: mult_dvd_mono)
[PROOF STATE]
proof (state)
this:
3 * h dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
hence "3*h dvd p^2 + 3*q^2" and hp: "3*h dvd 2*p"
[PROOF STATE]
proof (prove)
using this:
3 * h dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 3 * h dvd p\<^sup>2 + 3 * q\<^sup>2 &&& 3 * h dvd 2 * p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 * h dvd p\<^sup>2 + 3 * q\<^sup>2
3 * h dvd 2 * p

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 * h dvd p\<^sup>2 + 3 * q\<^sup>2
3 * h dvd 2 * p
[PROOF STEP]
obtain s where s: "p^2 + 3*q^2 = (3*h)*s"
[PROOF STATE]
proof (prove)
using this:
3 * h dvd p\<^sup>2 + 3 * q\<^sup>2
3 * h dvd 2 * p

goal (1 subgoal):
 1. (\<And>s. p\<^sup>2 + 3 * q\<^sup>2 = 3 * h * s \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: dvd_def)
[PROOF STATE]
proof (state)
this:
p\<^sup>2 + 3 * q\<^sup>2 = 3 * h * s

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
with r
[PROOF STATE]
proof (chain)
picking this:
p = 3 * r
p\<^sup>2 + 3 * q\<^sup>2 = 3 * h * s
[PROOF STEP]
have rqh: "3*r^2+q^2 = h*s"
[PROOF STATE]
proof (prove)
using this:
p = 3 * r
p\<^sup>2 + 3 * q\<^sup>2 = 3 * h * s

goal (1 subgoal):
 1. 3 * r\<^sup>2 + q\<^sup>2 = h * s
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
3 * r\<^sup>2 + q\<^sup>2 = h * s

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
from hp r
[PROOF STATE]
proof (chain)
picking this:
3 * h dvd 2 * p
p = 3 * r
[PROOF STEP]
have "3*h dvd 3*(2*r)"
[PROOF STATE]
proof (prove)
using this:
3 * h dvd 2 * p
p = 3 * r

goal (1 subgoal):
 1. 3 * h dvd 3 * (2 * r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 * h dvd 3 * (2 * r)

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
3 * h dvd 3 * (2 * r)

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
have "(3::int) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
3 * h dvd 3 * (2 * r)
3 \<noteq> 0
[PROOF STEP]
have "h dvd 2*r"
[PROOF STATE]
proof (prove)
using this:
3 * h dvd 3 * (2 * r)
3 \<noteq> 0

goal (1 subgoal):
 1. h dvd 2 * r
[PROOF STEP]
by (rule zdvd_mult_cancel)
[PROOF STATE]
proof (state)
this:
h dvd 2 * r

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
with h
[PROOF STATE]
proof (chain)
picking this:
prime h \<and> h dvd k
h dvd 2 * r
[PROOF STEP]
have "h dvd 2 \<or> h dvd r"
[PROOF STATE]
proof (prove)
using this:
prime h \<and> h dvd k
h dvd 2 * r

goal (1 subgoal):
 1. h dvd 2 \<or> h dvd r
[PROOF STEP]
by (auto dest: prime_dvd_multD)
[PROOF STATE]
proof (state)
this:
h dvd 2 \<or> h dvd r

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h dvd 2 \<or> h dvd r

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
have "\<not> h dvd 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> h dvd 2
[PROOF STEP]
proof (rule ccontr, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h dvd 2 \<Longrightarrow> False
[PROOF STEP]
assume "h dvd 2"
[PROOF STATE]
proof (state)
this:
h dvd 2

goal (1 subgoal):
 1. h dvd 2 \<Longrightarrow> False
[PROOF STEP]
with h
[PROOF STATE]
proof (chain)
picking this:
prime h \<and> h dvd k
h dvd 2
[PROOF STEP]
have "h=2"
[PROOF STATE]
proof (prove)
using this:
prime h \<and> h dvd k
h dvd 2

goal (1 subgoal):
 1. h = 2
[PROOF STEP]
using zdvd_not_zless[of 2 h]
[PROOF STATE]
proof (prove)
using this:
prime h \<and> h dvd k
h dvd 2
\<lbrakk>0 < 2; 2 < h\<rbrakk> \<Longrightarrow> \<not> h dvd 2

goal (1 subgoal):
 1. h = 2
[PROOF STEP]
by (auto simp: prime_int_iff)
[PROOF STATE]
proof (state)
this:
h = 2

goal (1 subgoal):
 1. h dvd 2 \<Longrightarrow> False
[PROOF STEP]
with hg
[PROOF STATE]
proof (chain)
picking this:
3 * h dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
h = 2
[PROOF STEP]
have "2*3 dvd ?g"
[PROOF STATE]
proof (prove)
using this:
3 * h dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
h = 2

goal (1 subgoal):
 1. 2 * 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. h dvd 2 \<Longrightarrow> False
[PROOF STEP]
hence "2 dvd ?g"
[PROOF STATE]
proof (prove)
using this:
2 * 3 dvd gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. even (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
by (rule dvd_mult_left)
[PROOF STATE]
proof (state)
this:
even (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. h dvd 2 \<Longrightarrow> False
[PROOF STEP]
with gOdd
[PROOF STATE]
proof (chain)
picking this:
odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))
even (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
odd (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))
even (gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> h dvd 2

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
h dvd 2 \<or> h dvd r
\<not> h dvd 2
[PROOF STEP]
have hr: "h dvd r"
[PROOF STATE]
proof (prove)
using this:
h dvd 2 \<or> h dvd r
\<not> h dvd 2

goal (1 subgoal):
 1. h dvd r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd r

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h dvd r
[PROOF STEP]
obtain t where "r = h*t"
[PROOF STATE]
proof (prove)
using this:
h dvd r

goal (1 subgoal):
 1. (\<And>t. r = h * t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: dvd_def)
[PROOF STATE]
proof (state)
this:
r = h * t

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
hence t: "r^2 = h*(h*t^2)"
[PROOF STATE]
proof (prove)
using this:
r = h * t

goal (1 subgoal):
 1. r\<^sup>2 = h * (h * t\<^sup>2)
[PROOF STEP]
by (auto simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
r\<^sup>2 = h * (h * t\<^sup>2)

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
with rqh
[PROOF STATE]
proof (chain)
picking this:
3 * r\<^sup>2 + q\<^sup>2 = h * s
r\<^sup>2 = h * (h * t\<^sup>2)
[PROOF STEP]
have "h*s = h*(3*h*t^2) + q^2"
[PROOF STATE]
proof (prove)
using this:
3 * r\<^sup>2 + q\<^sup>2 = h * s
r\<^sup>2 = h * (h * t\<^sup>2)

goal (1 subgoal):
 1. h * s = h * (3 * h * t\<^sup>2) + q\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h * s = h * (3 * h * t\<^sup>2) + q\<^sup>2

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
hence "q^2 = h*(s - 3*h*t^2)"
[PROOF STATE]
proof (prove)
using this:
h * s = h * (3 * h * t\<^sup>2) + q\<^sup>2

goal (1 subgoal):
 1. q\<^sup>2 = h * (s - 3 * h * t\<^sup>2)
[PROOF STEP]
by (simp add: right_diff_distrib)
[PROOF STATE]
proof (state)
this:
q\<^sup>2 = h * (s - 3 * h * t\<^sup>2)

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
hence "h dvd q^2"
[PROOF STATE]
proof (prove)
using this:
q\<^sup>2 = h * (s - 3 * h * t\<^sup>2)

goal (1 subgoal):
 1. h dvd q\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd q\<^sup>2

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
with h
[PROOF STATE]
proof (chain)
picking this:
prime h \<and> h dvd k
h dvd q\<^sup>2
[PROOF STEP]
have "h dvd q"
[PROOF STATE]
proof (prove)
using this:
prime h \<and> h dvd k
h dvd q\<^sup>2

goal (1 subgoal):
 1. h dvd q
[PROOF STEP]
using prime_dvd_multD[of h q q]
[PROOF STATE]
proof (prove)
using this:
prime h \<and> h dvd k
h dvd q\<^sup>2
\<lbrakk>prime h; h dvd q * q\<rbrakk> \<Longrightarrow> h dvd q \<or> h dvd q

goal (1 subgoal):
 1. h dvd q
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
h dvd q

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
with hr
[PROOF STATE]
proof (chain)
picking this:
h dvd r
h dvd q
[PROOF STEP]
have "h dvd gcd q r"
[PROOF STATE]
proof (prove)
using this:
h dvd r
h dvd q

goal (1 subgoal):
 1. h dvd gcd q r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd gcd q r

goal (1 subgoal):
 1. k \<noteq> 1 \<Longrightarrow> False
[PROOF STEP]
with h qr_relprime
[PROOF STATE]
proof (chain)
picking this:
prime h \<and> h dvd k
coprime q r
h dvd gcd q r
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
prime h \<and> h dvd k
coprime q r
h dvd gcd q r

goal (1 subgoal):
 1. False
[PROOF STEP]
by (unfold prime_def, auto)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
k = 1

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
with k r
[PROOF STATE]
proof (chain)
picking this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 3 * k
p = 3 * r
k = 1
[PROOF STEP]
have "3 = gcd (2*(3*r)) ((3*r)^2 + 3*q^2)"
[PROOF STATE]
proof (prove)
using this:
gcd (2 * p) (p\<^sup>2 + 3 * q\<^sup>2) = 3 * k
p = 3 * r
k = 1

goal (1 subgoal):
 1. 3 = gcd (2 * (3 * r)) ((3 * r)\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 = gcd (2 * (3 * r)) ((3 * r)\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
3 = gcd (2 * (3 * r)) ((3 * r)\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
have "\<dots> = gcd (3*(2*r)) (3*(3*r^2 + q^2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (2 * (3 * r)) ((3 * r)\<^sup>2 + 3 * q\<^sup>2) = gcd (3 * (2 * r)) (3 * (3 * r\<^sup>2 + q\<^sup>2))
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
gcd (2 * (3 * r)) ((3 * r)\<^sup>2 + 3 * q\<^sup>2) = gcd (3 * (2 * r)) (3 * (3 * r\<^sup>2 + q\<^sup>2))

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gcd (2 * (3 * r)) ((3 * r)\<^sup>2 + 3 * q\<^sup>2) = gcd (3 * (2 * r)) (3 * (3 * r\<^sup>2 + q\<^sup>2))

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
have "\<dots> = 3 * gcd (2*r) (3*r^2 + q^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (3 * (2 * r)) (3 * (3 * r\<^sup>2 + q\<^sup>2)) = 3 * gcd (2 * r) (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
using gcd_mult_distrib_int[of 3]
[PROOF STATE]
proof (prove)
using this:
\<bar>3\<bar> * gcd ?m ?n = gcd (3 * ?m) (3 * ?n)

goal (1 subgoal):
 1. gcd (3 * (2 * r)) (3 * (3 * r\<^sup>2 + q\<^sup>2)) = 3 * gcd (2 * r) (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gcd (3 * (2 * r)) (3 * (3 * r\<^sup>2 + q\<^sup>2)) = 3 * gcd (2 * r) (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
3 = 3 * gcd (2 * r) (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
have "coprime (2*r) (3*r^2 + q^2)"
[PROOF STATE]
proof (prove)
using this:
3 = 3 * gcd (2 * r) (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. coprime (2 * r) (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
by (auto dest: gcd_eq_1_imp_coprime)
[PROOF STATE]
proof (state)
this:
coprime (2 * r) (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coprime (2 * r) (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
have "coprime 9 (3*r^2 + q^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime 9 (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
using \<open>coprime v w\<close>
[PROOF STATE]
proof (prove)
using this:
coprime v w

goal (1 subgoal):
 1. coprime 9 (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
fix h :: int
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
assume "\<not> is_unit h"
[PROOF STATE]
proof (state)
this:
\<not> is_unit h

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
assume h9: "h dvd 9" and hrq: "h dvd 3 * r\<^sup>2 + q\<^sup>2"
[PROOF STATE]
proof (state)
this:
h dvd 9
h dvd 3 * r\<^sup>2 + q\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
have "prime (3::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prime 3

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prime 3

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
from \<open>h dvd 9\<close>
[PROOF STATE]
proof (chain)
picking this:
h dvd 9
[PROOF STEP]
have "h dvd 3\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
h dvd 9

goal (1 subgoal):
 1. h dvd 3\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd 3\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
prime 3
h dvd 3\<^sup>2
[PROOF STEP]
obtain k where "normalize h = 3 ^ k"
[PROOF STATE]
proof (prove)
using this:
prime 3
h dvd 3\<^sup>2

goal (1 subgoal):
 1. (\<And>k. normalize h = 3 ^ k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule divides_primepow)
[PROOF STATE]
proof (state)
this:
normalize h = 3 ^ k

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with \<open>\<not> is_unit h\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> is_unit h
normalize h = 3 ^ k
[PROOF STEP]
have "0 < k"
[PROOF STATE]
proof (prove)
using this:
\<not> is_unit h
normalize h = 3 ^ k

goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < k

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with \<open>normalize h = 3 ^ k\<close>
[PROOF STATE]
proof (chain)
picking this:
normalize h = 3 ^ k
0 < k
[PROOF STEP]
have "\<bar>h\<bar> = 3 * 3 ^ (k - 1)"
[PROOF STATE]
proof (prove)
using this:
normalize h = 3 ^ k
0 < k

goal (1 subgoal):
 1. \<bar>h\<bar> = 3 * 3 ^ (k - 1)
[PROOF STEP]
by (cases k) simp_all
[PROOF STATE]
proof (state)
this:
\<bar>h\<bar> = 3 * 3 ^ (k - 1)

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>h\<bar> = 3 * 3 ^ (k - 1)
[PROOF STEP]
have "3 dvd \<bar>h\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>h\<bar> = 3 * 3 ^ (k - 1)

goal (1 subgoal):
 1. 3 dvd \<bar>h\<bar>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
3 dvd \<bar>h\<bar>

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 dvd \<bar>h\<bar>
[PROOF STEP]
have "3 dvd h"
[PROOF STATE]
proof (prove)
using this:
3 dvd \<bar>h\<bar>

goal (1 subgoal):
 1. 3 dvd h
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 dvd h

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 dvd h
[PROOF STEP]
have "3 dvd 3 * r\<^sup>2 + q\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
3 dvd h

goal (1 subgoal):
 1. 3 dvd 3 * r\<^sup>2 + q\<^sup>2
[PROOF STEP]
using hrq
[PROOF STATE]
proof (prove)
using this:
3 dvd h
h dvd 3 * r\<^sup>2 + q\<^sup>2

goal (1 subgoal):
 1. 3 dvd 3 * r\<^sup>2 + q\<^sup>2
[PROOF STEP]
by (rule dvd_trans)
[PROOF STATE]
proof (state)
this:
3 dvd 3 * r\<^sup>2 + q\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 dvd 3 * r\<^sup>2 + q\<^sup>2
[PROOF STEP]
have "3 dvd q\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
3 dvd 3 * r\<^sup>2 + q\<^sup>2

goal (1 subgoal):
 1. 3 dvd q\<^sup>2
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
3 dvd q\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 dvd q\<^sup>2
[PROOF STEP]
have "3 dvd q"
[PROOF STATE]
proof (prove)
using this:
3 dvd q\<^sup>2

goal (1 subgoal):
 1. 3 dvd q
[PROOF STEP]
using prime_dvd_power_int [of 3 q 2]
[PROOF STATE]
proof (prove)
using this:
3 dvd q\<^sup>2
\<lbrakk>prime 3; 3 dvd q\<^sup>2\<rbrakk> \<Longrightarrow> 3 dvd q

goal (1 subgoal):
 1. 3 dvd q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 dvd q

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with p3
[PROOF STATE]
proof (chain)
picking this:
3 dvd p
3 dvd q
[PROOF STEP]
have "3 dvd p + q" and "3 dvd p - q"
[PROOF STATE]
proof (prove)
using this:
3 dvd p
3 dvd q

goal (1 subgoal):
 1. 3 dvd p + q &&& 3 dvd p - q
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
3 dvd p + q
3 dvd p - q

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with vw
[PROOF STATE]
proof (chain)
picking this:
v = p + q \<and> w = p - q
3 dvd p + q
3 dvd p - q
[PROOF STEP]
have "3 dvd v" and "3 dvd w"
[PROOF STATE]
proof (prove)
using this:
v = p + q \<and> w = p - q
3 dvd p + q
3 dvd p - q

goal (1 subgoal):
 1. 3 dvd v &&& 3 dvd w
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
3 dvd v
3 dvd w

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
with \<open>coprime v w\<close>
[PROOF STATE]
proof (chain)
picking this:
coprime v w
3 dvd v
3 dvd w
[PROOF STEP]
have "is_unit (3::int)"
[PROOF STATE]
proof (prove)
using this:
coprime v w
3 dvd v
3 dvd w

goal (1 subgoal):
 1. is_unit 3
[PROOF STEP]
by (rule coprime_common_divisor)
[PROOF STATE]
proof (state)
this:
is_unit 3

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd v
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 9; e dvd 3 * r\<^sup>2 + q\<^sup>2\<rbrakk> \<Longrightarrow> e dvd w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_unit 3
[PROOF STEP]
show "h dvd v" and "h dvd w"
[PROOF STATE]
proof (prove)
using this:
is_unit 3

goal (1 subgoal):
 1. h dvd v &&& h dvd w
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
h dvd v
h dvd w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime 9 (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
coprime (2 * r) (3 * r\<^sup>2 + q\<^sup>2)
coprime 9 (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
have "coprime (2 * r * 9) (3 * r\<^sup>2 + q\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
coprime (2 * r) (3 * r\<^sup>2 + q\<^sup>2)
coprime 9 (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. coprime (2 * r * 9) (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
by (simp only: coprime_mult_left_iff)
[PROOF STATE]
proof (state)
this:
coprime (2 * r * 9) (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime (2 * r * 9) (3 * r\<^sup>2 + q\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coprime (2 * r * 9) (3 * r\<^sup>2 + q\<^sup>2)

goal (1 subgoal):
 1. coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have rqx: "(18*r)*(q^2 + 3*r^2) = x^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
[PROOF STEP]
from vwx vwpq
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "x^3 = 2*p*(p^2 + 3*q^2)"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
[PROOF STEP]
with r
[PROOF STATE]
proof (chain)
picking this:
p = 3 * r
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "\<dots> = 2*(3*r)*(9*r^2 + 3*q^2)"
[PROOF STATE]
proof (prove)
using this:
p = 3 * r
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * (3 * r) * (9 * r\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by (auto simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * (3 * r) * (9 * r\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x ^ 3 = 2 * (3 * r) * (9 * r\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x ^ 3 = 2 * (3 * r) * (9 * r\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
[PROOF STEP]
have "\<exists> c. 18*r = c^3"
[PROOF STATE]
proof (prove)
using this:
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3

goal (1 subgoal):
 1. \<exists>c. 18 * r = c ^ 3
[PROOF STEP]
by (simp add: int_relprime_odd_power_divisors)
[PROOF STATE]
proof (state)
this:
\<exists>c. 18 * r = c ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>c. 18 * r = c ^ 3
[PROOF STEP]
obtain c1 where c1: "c1^3 = 3*(6*r)"
[PROOF STATE]
proof (prove)
using this:
\<exists>c. 18 * r = c ^ 3

goal (1 subgoal):
 1. (\<And>c1. c1 ^ 3 = 3 * (6 * r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c1 ^ 3 = 3 * (6 * r)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "3 dvd c1^3" and "prime (3::int)"
[PROOF STATE]
proof (prove)
using this:
c1 ^ 3 = 3 * (6 * r)

goal (1 subgoal):
 1. 3 dvd c1 ^ 3 &&& prime 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 dvd c1 ^ 3
prime 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "3 dvd c1"
[PROOF STATE]
proof (prove)
using this:
3 dvd c1 ^ 3
prime 3

goal (1 subgoal):
 1. 3 dvd c1
[PROOF STEP]
using prime_dvd_power[of 3]
[PROOF STATE]
proof (prove)
using this:
3 dvd c1 ^ 3
prime 3
\<lbrakk>prime (3::?'a1); (3::?'a1) dvd ?x ^ ?n\<rbrakk> \<Longrightarrow> (3::?'a1) dvd ?x

goal (1 subgoal):
 1. 3 dvd c1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
3 dvd c1

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with c1
[PROOF STATE]
proof (chain)
picking this:
c1 ^ 3 = 3 * (6 * r)
3 dvd c1
[PROOF STEP]
obtain c where c: "3*c^3 = 2*r"
[PROOF STATE]
proof (prove)
using this:
c1 ^ 3 = 3 * (6 * r)
3 dvd c1

goal (1 subgoal):
 1. (\<And>c. 3 * c ^ 3 = 2 * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: power_mult_distrib dvd_def)
[PROOF STATE]
proof (state)
this:
3 * c ^ 3 = 2 * r

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from rqx factors_relprime
[PROOF STATE]
proof (chain)
picking this:
18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
[PROOF STEP]
have "coprime (q^2 + 3*r^2) (18*r)"
        and "(q^2 + 3*r^2)*(18*r) = x^3"
[PROOF STATE]
proof (prove)
using this:
18 * r * (q\<^sup>2 + 3 * r\<^sup>2) = x ^ 3
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)

goal (1 subgoal):
 1. coprime (q\<^sup>2 + 3 * r\<^sup>2) (18 * r) &&& (q\<^sup>2 + 3 * r\<^sup>2) * (18 * r) = x ^ 3
[PROOF STEP]
by (auto simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
coprime (q\<^sup>2 + 3 * r\<^sup>2) (18 * r)
(q\<^sup>2 + 3 * r\<^sup>2) * (18 * r) = x ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "\<exists> d. q^2 + 3*r^2 = d^3"
[PROOF STATE]
proof (prove)
using this:
coprime (q\<^sup>2 + 3 * r\<^sup>2) (18 * r)
(q\<^sup>2 + 3 * r\<^sup>2) * (18 * r) = x ^ 3

goal (1 subgoal):
 1. \<exists>d. q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3
[PROOF STEP]
by (simp add: int_relprime_odd_power_divisors)
[PROOF STATE]
proof (state)
this:
\<exists>d. q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>d. q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3
[PROOF STEP]
obtain d where d: "q^2 + 3*r^2 = d^3"
[PROOF STATE]
proof (prove)
using this:
\<exists>d. q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3

goal (1 subgoal):
 1. (\<And>d. q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "odd d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd d
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
assume "\<not> odd d"
[PROOF STATE]
proof (state)
this:
\<not> odd d

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
hence "2 dvd d^3"
[PROOF STATE]
proof (prove)
using this:
\<not> odd d

goal (1 subgoal):
 1. even (d ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (d ^ 3)

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even (d ^ 3)

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
have "2 dvd 2*(9*r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (2 * (9 * r))
[PROOF STEP]
by (rule dvd_triv_left)
[PROOF STATE]
proof (state)
this:
even (2 * (9 * r))

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
even (d ^ 3)
even (2 * (9 * r))
[PROOF STEP]
have "2 dvd gcd (2*(9*r)) (d^3)"
[PROOF STATE]
proof (prove)
using this:
even (d ^ 3)
even (2 * (9 * r))

goal (1 subgoal):
 1. even (gcd (2 * (9 * r)) (d ^ 3))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (gcd (2 * (9 * r)) (d ^ 3))

goal (1 subgoal):
 1. \<not> odd d \<Longrightarrow> False
[PROOF STEP]
with d factors_relprime
[PROOF STATE]
proof (chain)
picking this:
q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
even (gcd (2 * (9 * r)) (d ^ 3))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3
coprime (18 * r) (q\<^sup>2 + 3 * r\<^sup>2)
even (gcd (2 * (9 * r)) (d ^ 3))

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd d

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with d qr_relprime
[PROOF STATE]
proof (chain)
picking this:
q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3
coprime q r
odd d
[PROOF STEP]
have "coprime q r \<and> q^2 + 3*r^2 = d^3 \<and> odd d"
[PROOF STATE]
proof (prove)
using this:
q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3
coprime q r
odd d

goal (1 subgoal):
 1. coprime q r \<and> q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3 \<and> odd d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coprime q r \<and> q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3 \<and> odd d

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "is_cube_form q r"
[PROOF STATE]
proof (prove)
using this:
coprime q r \<and> q\<^sup>2 + 3 * r\<^sup>2 = d ^ 3 \<and> odd d

goal (1 subgoal):
 1. is_cube_form q r
[PROOF STEP]
by (rule qf3_cube_impl_cube_form)
[PROOF STATE]
proof (state)
this:
is_cube_form q r

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_cube_form q r
[PROOF STEP]
obtain a b where "q = a^3 - 9*a*b^2 \<and> r = 3*a^2*b - 3*b^3"
[PROOF STATE]
proof (prove)
using this:
is_cube_form q r

goal (1 subgoal):
 1. (\<And>a b. q = a ^ 3 - 9 * a * b\<^sup>2 \<and> r = 3 * a\<^sup>2 * b - 3 * b ^ 3 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (unfold is_cube_form_def, auto)
[PROOF STATE]
proof (state)
this:
q = a ^ 3 - 9 * a * b\<^sup>2 \<and> r = 3 * a\<^sup>2 * b - 3 * b ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence ab: "q = a*(a+3*b)*(a- 3*b) \<and> r = b*(a+b)*(a-b)*3"
[PROOF STATE]
proof (prove)
using this:
q = a ^ 3 - 9 * a * b\<^sup>2 \<and> r = 3 * a\<^sup>2 * b - 3 * b ^ 3

goal (1 subgoal):
 1. q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
[PROOF STEP]
by (simp add: eval_nat_numeral field_simps)
[PROOF STATE]
proof (state)
this:
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with c
[PROOF STATE]
proof (chain)
picking this:
3 * c ^ 3 = 2 * r
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
[PROOF STEP]
have abc: "(2*b)*(a+b)*(a-b) = c^3"
[PROOF STATE]
proof (prove)
using this:
3 * c ^ 3 = 2 * r
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3

goal (1 subgoal):
 1. 2 * b * (a + b) * (a - b) = c ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * b * (a + b) * (a - b) = c ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from qr_relprime ab
[PROOF STATE]
proof (chain)
picking this:
coprime q r
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
[PROOF STEP]
have ab_relprime: "coprime a b"
[PROOF STATE]
proof (prove)
using this:
coprime q r
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3

goal (1 subgoal):
 1. coprime a b
[PROOF STEP]
by (auto intro: coprime_imp_coprime)
[PROOF STATE]
proof (state)
this:
coprime a b

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime a b
[PROOF STEP]
have ab1: "coprime (2*b) (a+b)"
[PROOF STATE]
proof (prove)
using this:
coprime a b

goal (1 subgoal):
 1. coprime (2 * b) (a + b)
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
assume h2b: "h dvd 2*b" and hab: "h dvd a+b"
[PROOF STATE]
proof (state)
this:
h dvd 2 * b
h dvd a + b

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
have "odd h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd h
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even h \<Longrightarrow> False
[PROOF STEP]
assume "even h"
[PROOF STATE]
proof (state)
this:
even h

goal (1 subgoal):
 1. even h \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even h
[PROOF STEP]
have "even (a + b)"
[PROOF STATE]
proof (prove)
using this:
even h

goal (1 subgoal):
 1. even (a + b)
[PROOF STEP]
using hab
[PROOF STATE]
proof (prove)
using this:
even h
h dvd a + b

goal (1 subgoal):
 1. even (a + b)
[PROOF STEP]
by (rule dvd_trans)
[PROOF STATE]
proof (state)
this:
even (a + b)

goal (1 subgoal):
 1. even h \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even (a + b)
[PROOF STEP]
have "even (a+3*b)"
[PROOF STATE]
proof (prove)
using this:
even (a + b)

goal (1 subgoal):
 1. even (a + 3 * b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (a + 3 * b)

goal (1 subgoal):
 1. even h \<Longrightarrow> False
[PROOF STEP]
with ab
[PROOF STATE]
proof (chain)
picking this:
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
even (a + 3 * b)
[PROOF STEP]
have "even q" "even r"
[PROOF STATE]
proof (prove)
using this:
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
even (a + 3 * b)

goal (1 subgoal):
 1. even q &&& even r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even q
even r

goal (1 subgoal):
 1. even h \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even q
even r
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
even q
even r

goal (1 subgoal):
 1. False
[PROOF STEP]
using coprime_common_divisor_int qr_relprime
[PROOF STATE]
proof (prove)
using this:
even q
even r
\<lbrakk>coprime ?a ?b; ?x dvd ?a; ?x dvd ?b\<rbrakk> \<Longrightarrow> \<bar>?x\<bar> = 1
coprime q r

goal (1 subgoal):
 1. False
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd h

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd a
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd b
[PROOF STEP]
with h2b
[PROOF STATE]
proof (chain)
picking this:
h dvd 2 * b
odd h
[PROOF STEP]
show "h dvd b"
[PROOF STATE]
proof (prove)
using this:
h dvd 2 * b
odd h

goal (1 subgoal):
 1. h dvd b
[PROOF STEP]
using coprime_dvd_mult_right_iff [of h 2 b]
[PROOF STATE]
proof (prove)
using this:
h dvd 2 * b
odd h
coprime h 2 \<Longrightarrow> (h dvd 2 * b) = (h dvd b)

goal (1 subgoal):
 1. h dvd b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd b

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd 2 * b; e dvd a + b\<rbrakk> \<Longrightarrow> e dvd a
[PROOF STEP]
with hab
[PROOF STATE]
proof (chain)
picking this:
h dvd a + b
h dvd b
[PROOF STEP]
show "h dvd a"
[PROOF STATE]
proof (prove)
using this:
h dvd a + b
h dvd b

goal (1 subgoal):
 1. h dvd a
[PROOF STEP]
using dvd_diff [of h "a + b" b]
[PROOF STATE]
proof (prove)
using this:
h dvd a + b
h dvd b
\<lbrakk>h dvd a + b; h dvd b\<rbrakk> \<Longrightarrow> h dvd a + b - b

goal (1 subgoal):
 1. h dvd a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h dvd a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime (2 * b) (a + b)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from ab1
[PROOF STATE]
proof (chain)
picking this:
coprime (2 * b) (a + b)
[PROOF STEP]
have ab2: "coprime (a+b) (a-b)"
[PROOF STATE]
proof (prove)
using this:
coprime (2 * b) (a + b)

goal (1 subgoal):
 1. coprime (a + b) (a - b)
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a + b; e dvd a - b\<rbrakk> \<Longrightarrow> e dvd 2 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a + b; e dvd a - b\<rbrakk> \<Longrightarrow> e dvd a + b
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a + b; e dvd a - b\<rbrakk> \<Longrightarrow> e dvd 2 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a + b; e dvd a - b\<rbrakk> \<Longrightarrow> e dvd a + b
[PROOF STEP]
assume hab1: "h dvd a+b" and hab2: "h dvd a-b"
[PROOF STATE]
proof (state)
this:
h dvd a + b
h dvd a - b

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a + b; e dvd a - b\<rbrakk> \<Longrightarrow> e dvd 2 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a + b; e dvd a - b\<rbrakk> \<Longrightarrow> e dvd a + b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h dvd a + b
h dvd a - b
[PROOF STEP]
show "h dvd 2*b"
[PROOF STATE]
proof (prove)
using this:
h dvd a + b
h dvd a - b

goal (1 subgoal):
 1. h dvd 2 * b
[PROOF STEP]
using dvd_diff[of h "a+b" "a-b"]
[PROOF STATE]
proof (prove)
using this:
h dvd a + b
h dvd a - b
\<lbrakk>h dvd a + b; h dvd a - b\<rbrakk> \<Longrightarrow> h dvd a + b - (a - b)

goal (1 subgoal):
 1. h dvd 2 * b
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
h dvd 2 * b

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a + b; e dvd a - b\<rbrakk> \<Longrightarrow> e dvd a + b
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime (a + b) (a - b)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from ab1
[PROOF STATE]
proof (chain)
picking this:
coprime (2 * b) (a + b)
[PROOF STEP]
have ab3: "coprime (a-b) (2*b)"
[PROOF STATE]
proof (prove)
using this:
coprime (2 * b) (a + b)

goal (1 subgoal):
 1. coprime (a - b) (2 * b)
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd 2 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd a + b
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd 2 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd a + b
[PROOF STEP]
assume hab: "h dvd a-b" and h2b: "h dvd 2*b"
[PROOF STATE]
proof (state)
this:
h dvd a - b
h dvd 2 * b

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd 2 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd a + b
[PROOF STEP]
have "a-b+2*b = a+b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b + 2 * b = a + b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a - b + 2 * b = a + b

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd 2 * b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd a + b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a - b + 2 * b = a + b
[PROOF STEP]
show "h dvd a+b"
[PROOF STATE]
proof (prove)
using this:
a - b + 2 * b = a + b

goal (1 subgoal):
 1. h dvd a + b
[PROOF STEP]
using hab h2b dvd_add [of h "a-b" "2*b"]
[PROOF STATE]
proof (prove)
using this:
a - b + 2 * b = a + b
h dvd a - b
h dvd 2 * b
\<lbrakk>h dvd a - b; h dvd 2 * b\<rbrakk> \<Longrightarrow> h dvd a - b + 2 * b

goal (1 subgoal):
 1. h dvd a + b
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
h dvd a + b

goal (1 subgoal):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd a - b; e dvd 2 * b\<rbrakk> \<Longrightarrow> e dvd 2 * b
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime (a - b) (2 * b)

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime (a - b) (2 * b)
[PROOF STEP]
have [simp]: "even b \<longleftrightarrow> odd a"
[PROOF STATE]
proof (prove)
using this:
coprime (a - b) (2 * b)

goal (1 subgoal):
 1. even b = odd a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even b = odd a

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "\<exists> k l m. 2*b = k^3 \<and> a+b = l^3 \<and> a-b = m^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k l m. 2 * b = k ^ 3 \<and> a + b = l ^ 3 \<and> a - b = m ^ 3
[PROOF STEP]
using abc ab1 ab2 ab3
          int_relprime_odd_power_divisors [of 3 "2 * b" "(a + b) * (a - b)" c]
          int_relprime_odd_power_divisors [of 3 "a + b" "(2 * b) * (a - b)" c]
          int_relprime_odd_power_divisors [of 3 "a - b" "(2 * b) * (a + b)" c]
[PROOF STATE]
proof (prove)
using this:
2 * b * (a + b) * (a - b) = c ^ 3
coprime (2 * b) (a + b)
coprime (a + b) (a - b)
coprime (a - b) (2 * b)
\<lbrakk>odd 3; 2 * b * ((a + b) * (a - b)) = c ^ 3; coprime (2 * b) ((a + b) * (a - b))\<rbrakk> \<Longrightarrow> \<exists>k. 2 * b = k ^ 3
\<lbrakk>odd 3; (a + b) * (2 * b * (a - b)) = c ^ 3; coprime (a + b) (2 * b * (a - b))\<rbrakk> \<Longrightarrow> \<exists>k. a + b = k ^ 3
\<lbrakk>odd 3; (a - b) * (2 * b * (a + b)) = c ^ 3; coprime (a - b) (2 * b * (a + b))\<rbrakk> \<Longrightarrow> \<exists>k. a - b = k ^ 3

goal (1 subgoal):
 1. \<exists>k l m. 2 * b = k ^ 3 \<and> a + b = l ^ 3 \<and> a - b = m ^ 3
[PROOF STEP]
by simp (simp add: ac_simps, simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<exists>k l m. 2 * b = k ^ 3 \<and> a + b = l ^ 3 \<and> a - b = m ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>k l m. 2 * b = k ^ 3 \<and> a + b = l ^ 3 \<and> a - b = m ^ 3
[PROOF STEP]
obtain \<alpha>1 \<beta> \<gamma> where a1: "2*b = \<gamma>^3 \<and> a-b = \<alpha>1^3 \<and> a+b = \<beta>^3"
[PROOF STATE]
proof (prove)
using this:
\<exists>k l m. 2 * b = k ^ 3 \<and> a + b = l ^ 3 \<and> a - b = m ^ 3

goal (1 subgoal):
 1. (\<And>\<gamma> \<alpha>1 \<beta>. 2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
[PROOF STEP]
obtain \<alpha> where "\<alpha> = -\<alpha>1"
[PROOF STATE]
proof (prove)
using this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3

goal (1 subgoal):
 1. (\<And>\<alpha>. \<alpha> = - \<alpha>1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
      \<comment> \<open>show this is a (smaller) solution\<close>
[PROOF STATE]
proof (state)
this:
\<alpha> = - \<alpha>1

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with a1
[PROOF STATE]
proof (chain)
picking this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
\<alpha> = - \<alpha>1
[PROOF STEP]
have a2: "\<alpha>^3 = b-a"
[PROOF STATE]
proof (prove)
using this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
\<alpha> = - \<alpha>1

goal (1 subgoal):
 1. \<alpha> ^ 3 = b - a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> ^ 3 = b - a

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with a1
[PROOF STATE]
proof (chain)
picking this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
\<alpha> ^ 3 = b - a
[PROOF STEP]
have "\<alpha>^3 + \<beta>^3 = \<gamma>^3"
[PROOF STATE]
proof (prove)
using this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
\<alpha> ^ 3 = b - a

goal (1 subgoal):
 1. \<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "\<alpha>*\<beta>*\<gamma> \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> * \<beta> * \<gamma> \<noteq> 0
[PROOF STEP]
proof (rule ccontr, safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> False; \<alpha> * \<beta> * \<gamma> = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "\<alpha> * \<beta> * \<gamma> = 0"
[PROOF STATE]
proof (state)
this:
\<alpha> * \<beta> * \<gamma> = 0

goal (1 subgoal):
 1. \<lbrakk>\<not> False; \<alpha> * \<beta> * \<gamma> = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with a1 a2 ab
[PROOF STATE]
proof (chain)
picking this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
\<alpha> ^ 3 = b - a
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
\<alpha> * \<beta> * \<gamma> = 0
[PROOF STEP]
have "r=0"
[PROOF STATE]
proof (prove)
using this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
\<alpha> ^ 3 = b - a
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
\<alpha> * \<beta> * \<gamma> = 0

goal (1 subgoal):
 1. r = 0
[PROOF STEP]
by (auto simp add: power_0_left)
[PROOF STATE]
proof (state)
this:
r = 0

goal (1 subgoal):
 1. \<lbrakk>\<not> False; \<alpha> * \<beta> * \<gamma> = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with r vwpq vwx
[PROOF STATE]
proof (chain)
picking this:
p = 3 * r
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
r = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
p = 3 * r
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
r = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<alpha> * \<beta> * \<gamma> \<noteq> 0

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<alpha> * \<beta> * \<gamma> \<noteq> 0

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "even \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
have "even (2*b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (2 * b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (2 * b)

goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
with a1
[PROOF STATE]
proof (chain)
picking this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
even (2 * b)
[PROOF STEP]
have "even (\<gamma>^3)"
[PROOF STATE]
proof (prove)
using this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
even (2 * b)

goal (1 subgoal):
 1. even (\<gamma> ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (\<gamma> ^ 3)

goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
even (\<gamma> ^ 3)

goal (1 subgoal):
 1. even \<gamma>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
even \<gamma>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even \<gamma>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "coprime \<alpha> \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime \<alpha> \<beta>
[PROOF STEP]
using ab2
[PROOF STATE]
proof (prove)
using this:
coprime (a + b) (a - b)

goal (1 subgoal):
 1. coprime \<alpha> \<beta>
[PROOF STEP]
proof (rule coprime_imp_coprime)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - b
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - b
[PROOF STEP]
assume ha: "h dvd \<alpha>" and hb: "h dvd \<beta>"
[PROOF STATE]
proof (state)
this:
h dvd \<alpha>
h dvd \<beta>

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h dvd \<alpha>
h dvd \<beta>
[PROOF STEP]
have "h dvd \<alpha> * \<alpha>^2" and "h dvd \<beta> * \<beta>^2"
[PROOF STATE]
proof (prove)
using this:
h dvd \<alpha>
h dvd \<beta>

goal (1 subgoal):
 1. h dvd \<alpha> * \<alpha>\<^sup>2 &&& h dvd \<beta> * \<beta>\<^sup>2
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
h dvd \<alpha> * \<alpha>\<^sup>2
h dvd \<beta> * \<beta>\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h dvd \<alpha> * \<alpha>\<^sup>2
h dvd \<beta> * \<beta>\<^sup>2
[PROOF STEP]
have "h dvd \<alpha>^Suc 2" and "h dvd \<beta>^Suc 2"
[PROOF STATE]
proof (prove)
using this:
h dvd \<alpha> * \<alpha>\<^sup>2
h dvd \<beta> * \<beta>\<^sup>2

goal (1 subgoal):
 1. h dvd \<alpha> ^ Suc 2 &&& h dvd \<beta> ^ Suc 2
[PROOF STEP]
by (auto simp only: power_Suc)
[PROOF STATE]
proof (state)
this:
h dvd \<alpha> ^ Suc 2
h dvd \<beta> ^ Suc 2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - b
[PROOF STEP]
with a1 a2
[PROOF STATE]
proof (chain)
picking this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
\<alpha> ^ 3 = b - a
h dvd \<alpha> ^ Suc 2
h dvd \<beta> ^ Suc 2
[PROOF STEP]
have "h dvd b - a" and "h dvd a + b"
[PROOF STATE]
proof (prove)
using this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
\<alpha> ^ 3 = b - a
h dvd \<alpha> ^ Suc 2
h dvd \<beta> ^ Suc 2

goal (1 subgoal):
 1. h dvd b - a &&& h dvd a + b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h dvd b - a
h dvd a + b

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a + b
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd \<alpha>; e dvd \<beta>\<rbrakk> \<Longrightarrow> e dvd a - b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h dvd b - a
h dvd a + b
[PROOF STEP]
show "h dvd a + b" and "h dvd a - b"
[PROOF STATE]
proof (prove)
using this:
h dvd b - a
h dvd a + b

goal (1 subgoal):
 1. h dvd a + b &&& h dvd a - b
[PROOF STEP]
by (simp_all add: dvd_diff_commute)
[PROOF STATE]
proof (state)
this:
h dvd a + b
h dvd a - b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime \<alpha> \<beta>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
coprime \<alpha> \<beta>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "nat\<bar>\<gamma>^3\<bar> < nat\<bar>x^3\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
let ?A = "p^2 + 3*q^2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
from vwx vwpq
[PROOF STATE]
proof (chain)
picking this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "x^3 = 2*p*?A"
[PROOF STATE]
proof (prove)
using this:
v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w
v ^ 3 + w ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with r
[PROOF STATE]
proof (chain)
picking this:
p = 3 * r
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "\<dots> = 6*r*?A"
[PROOF STATE]
proof (prove)
using this:
p = 3 * r
x ^ 3 = 2 * p * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 6 * r * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 6 * r * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 6 * r * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with ab
[PROOF STATE]
proof (chain)
picking this:
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 6 * r * (p\<^sup>2 + 3 * q\<^sup>2)
[PROOF STEP]
have "\<dots> = 2*b*(9*(a+b)*(a-b)*?A)"
[PROOF STATE]
proof (prove)
using this:
q = a * (a + 3 * b) * (a - 3 * b) \<and> r = b * (a + b) * (a - b) * 3
2 * p * (p\<^sup>2 + 3 * q\<^sup>2) = 6 * r * (p\<^sup>2 + 3 * q\<^sup>2)

goal (1 subgoal):
 1. 6 * r * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * b * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
6 * r * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * b * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
6 * r * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * b * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with a1
[PROOF STATE]
proof (chain)
picking this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
6 * r * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * b * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
have "\<dots> = \<gamma>^3 *(9*(a+b)*(a-b)*?A)"
[PROOF STATE]
proof (prove)
using this:
2 * b = \<gamma> ^ 3 \<and> a - b = \<alpha>1 ^ 3 \<and> a + b = \<beta> ^ 3
6 * r * (p\<^sup>2 + 3 * q\<^sup>2) = 2 * b * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. 2 * b * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)) = \<gamma> ^ 3 * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * b * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)) = \<gamma> ^ 3 * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x ^ 3 = \<gamma> ^ 3 * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))
[PROOF STEP]
have eq: "\<bar>x^3\<bar> = \<bar>\<gamma>^3\<bar> * \<bar>9*(a+b)*(a-b)*?A\<bar>"
[PROOF STATE]
proof (prove)
using this:
x ^ 3 = \<gamma> ^ 3 * (9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2))

goal (1 subgoal):
 1. \<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by (auto simp add: abs_mult)
[PROOF STATE]
proof (state)
this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with \<open>0 < nat\<bar>x^3\<bar>\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < nat \<bar>x ^ 3\<bar>
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
have "\<bar>9*(a+b)*(a-b)*?A\<bar> > 0"
[PROOF STATE]
proof (prove)
using this:
0 < nat \<bar>x ^ 3\<bar>
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. 0 < \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "\<bar>(a+b)*(a-b)*?A\<bar> \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
0 < \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. 1 \<le> \<bar>(a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
1 \<le> \<bar>(a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
hence "\<bar>9*(a+b)*(a-b)*?A\<bar> > 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> \<bar>(a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. 1 < \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
1 < \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 < \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have "\<bar>\<gamma>^3\<bar> > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
from eq
[PROOF STATE]
proof (chain)
picking this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
have "\<bar>\<gamma>^3\<bar> = 0 \<Longrightarrow> \<bar>x^3\<bar>=0"
[PROOF STATE]
proof (prove)
using this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. \<bar>\<gamma> ^ 3\<bar> = 0 \<Longrightarrow> \<bar>x ^ 3\<bar> = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>\<gamma> ^ 3\<bar> = 0 \<Longrightarrow> \<bar>x ^ 3\<bar> = 0

goal (1 subgoal):
 1. 0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
with \<open>0 < nat\<bar>x^3\<bar>\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < nat \<bar>x ^ 3\<bar>
\<bar>\<gamma> ^ 3\<bar> = 0 \<Longrightarrow> \<bar>x ^ 3\<bar> = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < nat \<bar>x ^ 3\<bar>
\<bar>\<gamma> ^ 3\<bar> = 0 \<Longrightarrow> \<bar>x ^ 3\<bar> = 0

goal (1 subgoal):
 1. 0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < \<bar>\<gamma> ^ 3\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < \<bar>\<gamma> ^ 3\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 < \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
0 < \<bar>\<gamma> ^ 3\<bar>
[PROOF STEP]
have "\<bar>\<gamma>^3\<bar> * 1 < \<bar>\<gamma>^3\<bar> * \<bar>9*(a+b)*(a-b)*?A\<bar>"
[PROOF STATE]
proof (prove)
using this:
1 < \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
0 < \<bar>\<gamma> ^ 3\<bar>

goal (1 subgoal):
 1. \<bar>\<gamma> ^ 3\<bar> * 1 < \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
by (rule zmult_zless_mono2)
[PROOF STATE]
proof (state)
this:
\<bar>\<gamma> ^ 3\<bar> * 1 < \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
\<bar>\<gamma> ^ 3\<bar> * 1 < \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
[PROOF STEP]
have "\<bar>x^3\<bar> > \<bar>\<gamma>^3\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>x ^ 3\<bar> = \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>
\<bar>\<gamma> ^ 3\<bar> * 1 < \<bar>\<gamma> ^ 3\<bar> * \<bar>9 * (a + b) * (a - b) * (p\<^sup>2 + 3 * q\<^sup>2)\<bar>

goal (1 subgoal):
 1. \<bar>\<gamma> ^ 3\<bar> < \<bar>x ^ 3\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>\<gamma> ^ 3\<bar> < \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>\<gamma> ^ 3\<bar> < \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3
\<alpha> * \<beta> * \<gamma> \<noteq> 0
even \<gamma>
coprime \<alpha> \<beta>
nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
have ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3
\<alpha> * \<beta> * \<gamma> \<noteq> 0
even \<gamma>
coprime \<alpha> \<beta>
nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
3 dvd p \<Longrightarrow> \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> 3 dvd p \<Longrightarrow> \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
3 dvd p \<Longrightarrow> \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> 3 dvd p \<Longrightarrow> \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
3 dvd p \<Longrightarrow> \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < nat \<bar>x ^ 3\<bar>; \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = x ^ 3 \<and> v * w * x \<noteq> 0 \<and> even x \<and> coprime v w)\<rbrakk> \<Longrightarrow> \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<exists>\<alpha> \<beta> \<gamma>. (\<alpha> ^ 3 + \<beta> ^ 3 = \<gamma> ^ 3 \<and> \<alpha> * \<beta> * \<gamma> \<noteq> 0 \<and> even \<gamma> \<and> coprime \<alpha> \<beta>) \<and> nat \<bar>\<gamma> ^ 3\<bar> < nat \<bar>x ^ 3\<bar>

goal (1 subgoal):
 1. \<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y. nat \<bar>y ^ 3\<bar> < nat \<bar>x ^ 3\<bar> \<and> \<not> (\<nexists>v w. v ^ 3 + w ^ 3 = y ^ 3 \<and> v * w * y \<noteq> 0 \<and> even y \<and> coprime v w)

goal:
No subgoals!
[PROOF STEP]
qed