[STATEMENT]
theorem fermat_3:
  assumes ass: "(x::int)^3 + y^3 = z^3"
  shows "x*y*z=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y * z = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
let ?g = "gcd x y"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
let ?c = "z div ?g"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume xyz0: "x*y*z\<noteq>0"
  \<comment> \<open>divide out the g.c.d.\<close>
[PROOF STATE]
proof (state)
this:
x * y * z \<noteq> 0

goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "x \<noteq> 0 \<or> y \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x * y * z \<noteq> 0

goal (1 subgoal):
 1. x \<noteq> 0 \<or> y \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<noteq> 0 \<or> y \<noteq> 0

goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0 \<or> y \<noteq> 0
[PROOF STEP]
obtain a b where ab: "x = ?g*a \<and> y = ?g*b \<and> coprime a b"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0 \<or> y \<noteq> 0

goal (1 subgoal):
 1. (\<And>a b. x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using gcd_coprime_exists[of x y]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0 \<or> y \<noteq> 0
gcd x y \<noteq> 0 \<Longrightarrow> \<exists>a' b'. x = a' * gcd x y \<and> y = b' * gcd x y \<and> coprime a' b'

goal (1 subgoal):
 1. (\<And>a b. x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: mult.commute)
[PROOF STATE]
proof (state)
this:
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b

goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b

goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have abc: "?c*?g = z \<and> a^3 + b^3 = ?c^3 \<and> a*b*?c \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
from xyz0
[PROOF STATE]
proof (chain)
picking this:
x * y * z \<noteq> 0
[PROOF STEP]
have g0: "?g\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
x * y * z \<noteq> 0

goal (1 subgoal):
 1. gcd x y \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd x y \<noteq> 0

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
have zgab: "z^3 = ?g^3 * (a^3+b^3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
[PROOF STEP]
from ab and ass
[PROOF STATE]
proof (chain)
picking this:
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b
x ^ 3 + y ^ 3 = z ^ 3
[PROOF STEP]
have "z^3 = (?g*a)^3+(?g*b)^3"
[PROOF STATE]
proof (prove)
using this:
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b
x ^ 3 + y ^ 3 = z ^ 3

goal (1 subgoal):
 1. z ^ 3 = (gcd x y * a) ^ 3 + (gcd x y * b) ^ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z ^ 3 = (gcd x y * a) ^ 3 + (gcd x y * b) ^ 3

goal (1 subgoal):
 1. z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
z ^ 3 = (gcd x y * a) ^ 3 + (gcd x y * b) ^ 3

goal (1 subgoal):
 1. z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
[PROOF STEP]
by (simp only: power_mult_distrib distrib_left)
[PROOF STATE]
proof (state)
this:
z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
have cgz: "?c * ?g = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z div gcd x y * gcd x y = z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z div gcd x y * gcd x y = z
[PROOF STEP]
from zgab
[PROOF STATE]
proof (chain)
picking this:
z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
[PROOF STEP]
have "?g^3 dvd z^3"
[PROOF STATE]
proof (prove)
using this:
z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)

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

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z
[PROOF STEP]
hence "?g dvd z"
[PROOF STATE]
proof (prove)
using this:
gcd x y ^ 3 dvd z ^ 3

goal (1 subgoal):
 1. gcd x y dvd z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd x y dvd z

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
gcd x y dvd z

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z
[PROOF STEP]
by (simp only: ac_simps dvd_mult_div_cancel)
[PROOF STATE]
proof (state)
this:
z div gcd x y * gcd x y = z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z div gcd x y * gcd x y = z

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z div gcd x y * gcd x y = z

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
have "a^3 + b^3 = ?c^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3
[PROOF STEP]
have "?c^3 * ?g^3 = (a^3+b^3)*?g^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
have "?c^3 * ?g^3 = (?c*?g)^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (z div gcd x y * gcd x y) ^ 3
[PROOF STEP]
by (simp only: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(z div gcd x y) ^ 3 * gcd x y ^ 3 = (z div gcd x y * gcd x y) ^ 3

goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(z div gcd x y) ^ 3 * gcd x y ^ 3 = (z div gcd x y * gcd x y) ^ 3

goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
with cgz
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z
(z div gcd x y) ^ 3 * gcd x y ^ 3 = (z div gcd x y * gcd x y) ^ 3
[PROOF STEP]
have "\<dots> = z^3"
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z
(z div gcd x y) ^ 3 * gcd x y ^ 3 = (z div gcd x y * gcd x y) ^ 3

goal (1 subgoal):
 1. (z div gcd x y * gcd x y) ^ 3 = z ^ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(z div gcd x y * gcd x y) ^ 3 = z ^ 3

goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(z div gcd x y * gcd x y) ^ 3 = z ^ 3

goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
with zgab
[PROOF STATE]
proof (chain)
picking this:
z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
(z div gcd x y * gcd x y) ^ 3 = z ^ 3
[PROOF STEP]
have "\<dots> = ?g^3*(a^3+b^3)"
[PROOF STATE]
proof (prove)
using this:
z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
(z div gcd x y * gcd x y) ^ 3 = z ^ 3

goal (1 subgoal):
 1. z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)

goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(z div gcd x y) ^ 3 * gcd x y ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(z div gcd x y) ^ 3 * gcd x y ^ 3 = gcd x y ^ 3 * (a ^ 3 + b ^ 3)

goal (1 subgoal):
 1. (z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3

goal (1 subgoal):
 1. a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3
[PROOF STEP]
with g0
[PROOF STATE]
proof (chain)
picking this:
gcd x y \<noteq> 0
(z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gcd x y \<noteq> 0
(z div gcd x y) ^ 3 * gcd x y ^ 3 = (a ^ 3 + b ^ 3) * gcd x y ^ 3

goal (1 subgoal):
 1. a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
from ab and xyz0 and cgz
[PROOF STATE]
proof (chain)
picking this:
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b
x * y * z \<noteq> 0
z div gcd x y * gcd x y = z
[PROOF STEP]
have "a*b*?c\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b
x * y * z \<noteq> 0
z div gcd x y * gcd x y = z

goal (1 subgoal):
 1. a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * b * (z div gcd x y) \<noteq> 0

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z
a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3
a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z
a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3
a * b * (z div gcd x y) \<noteq> 0

goal (1 subgoal):
 1. z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed
  \<comment> \<open>make both sides even\<close>
[PROOF STATE]
proof (state)
this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0

goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
from ab
[PROOF STATE]
proof (chain)
picking this:
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b
[PROOF STEP]
have "coprime (a ^ 3) (b ^ 3)"
[PROOF STATE]
proof (prove)
using this:
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b

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

goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "\<exists> u v w. u^3 + v^3 = w^3 \<and> u*v*w\<noteq>(0::int) \<and> even w \<and> coprime u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
let "?Q u v w" = "u^3 + v^3 = w^3 \<and> u*v*w\<noteq>(0::int) \<and> even w \<and> coprime u v"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
have "even a \<or> even b \<or> even ?c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even a \<or> even b \<or> even (z div gcd x y)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (even a \<or> even b \<or> even (z div gcd x y)) \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(even a \<or> even b \<or> even ?c)"
[PROOF STATE]
proof (state)
this:
\<not> (even a \<or> even b \<or> even (z div gcd x y))

goal (1 subgoal):
 1. \<not> (even a \<or> even b \<or> even (z div gcd x y)) \<Longrightarrow> False
[PROOF STEP]
hence aodd: "odd a" and "odd b \<and> odd ?c"
[PROOF STATE]
proof (prove)
using this:
\<not> (even a \<or> even b \<or> even (z div gcd x y))

goal (1 subgoal):
 1. odd a &&& odd b \<and> odd (z div gcd x y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd a
odd b \<and> odd (z div gcd x y)

goal (1 subgoal):
 1. \<not> (even a \<or> even b \<or> even (z div gcd x y)) \<Longrightarrow> False
[PROOF STEP]
hence "even (?c^3 - b^3)"
[PROOF STATE]
proof (prove)
using this:
odd a
odd b \<and> odd (z div gcd x y)

goal (1 subgoal):
 1. even ((z div gcd x y) ^ 3 - b ^ 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even ((z div gcd x y) ^ 3 - b ^ 3)

goal (1 subgoal):
 1. \<not> (even a \<or> even b \<or> even (z div gcd x y)) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even ((z div gcd x y) ^ 3 - b ^ 3)

goal (1 subgoal):
 1. \<not> (even a \<or> even b \<or> even (z div gcd x y)) \<Longrightarrow> False
[PROOF STEP]
from abc
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
[PROOF STEP]
have "?c^3-b^3 = a^3"
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0

goal (1 subgoal):
 1. (z div gcd x y) ^ 3 - b ^ 3 = a ^ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(z div gcd x y) ^ 3 - b ^ 3 = a ^ 3

goal (1 subgoal):
 1. \<not> (even a \<or> even b \<or> even (z div gcd x y)) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
even ((z div gcd x y) ^ 3 - b ^ 3)
(z div gcd x y) ^ 3 - b ^ 3 = a ^ 3
[PROOF STEP]
have "even (a^3)"
[PROOF STATE]
proof (prove)
using this:
even ((z div gcd x y) ^ 3 - b ^ 3)
(z div gcd x y) ^ 3 - b ^ 3 = a ^ 3

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

goal (1 subgoal):
 1. \<not> (even a \<or> even b \<or> even (z div gcd x y)) \<Longrightarrow> False
[PROOF STEP]
hence "even (a)"
[PROOF STATE]
proof (prove)
using this:
even (a ^ 3)

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

goal (1 subgoal):
 1. \<not> (even a \<or> even b \<or> even (z div gcd x y)) \<Longrightarrow> False
[PROOF STEP]
with aodd
[PROOF STATE]
proof (chain)
picking this:
odd a
even a
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
odd a
even a

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:
even a \<or> even b \<or> even (z div gcd x y)

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even a \<or> even b \<or> even (z div gcd x y)

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
even a \<or> even b \<or> even (z div gcd x y)

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
assume "even (a)"
[PROOF STATE]
proof (state)
this:
even a

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even a
[PROOF STEP]
obtain u v w where uvwabc: "u = -b \<and> v = ?c \<and> w = a \<and> even w"
[PROOF STATE]
proof (prove)
using this:
even a

goal (1 subgoal):
 1. (\<And>u v w. u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
with abc
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
[PROOF STEP]
have "u*v*w\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w

goal (1 subgoal):
 1. u * v * w \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u * v * w \<noteq> 0

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
have uvw: "u^3+v^3=w^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
from uvwabc
[PROOF STATE]
proof (chain)
picking this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
[PROOF STEP]
have "u^3 + v^3 = (-1*b)^3 + ?c^3"
[PROOF STATE]
proof (prove)
using this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = (- 1 * b) ^ 3 + (z div gcd x y) ^ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u ^ 3 + v ^ 3 = (- 1 * b) ^ 3 + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u ^ 3 + v ^ 3 = (- 1 * b) ^ 3 + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
have "\<dots> = (-1)^3*b^3 + ?c^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1 * b) ^ 3 + (z div gcd x y) ^ 3 = (- 1) ^ 3 * b ^ 3 + (z div gcd x y) ^ 3
[PROOF STEP]
by (simp only: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(- 1 * b) ^ 3 + (z div gcd x y) ^ 3 = (- 1) ^ 3 * b ^ 3 + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- 1 * b) ^ 3 + (z div gcd x y) ^ 3 = (- 1) ^ 3 * b ^ 3 + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
have "\<dots> = - (b^3) + ?c^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ 3 * b ^ 3 + (z div gcd x y) ^ 3 = - (b ^ 3) + (z div gcd x y) ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- 1) ^ 3 * b ^ 3 + (z div gcd x y) ^ 3 = - (b ^ 3) + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- 1) ^ 3 * b ^ 3 + (z div gcd x y) ^ 3 = - (b ^ 3) + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
with abc and uvwabc
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
(- 1) ^ 3 * b ^ 3 + (z div gcd x y) ^ 3 = - (b ^ 3) + (z div gcd x y) ^ 3
[PROOF STEP]
have "\<dots> = w^3"
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
(- 1) ^ 3 * b ^ 3 + (z div gcd x y) ^ 3 = - (b ^ 3) + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. - (b ^ 3) + (z div gcd x y) ^ 3 = w ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (b ^ 3) + (z div gcd x y) ^ 3 = w ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u ^ 3 + v ^ 3 = w ^ 3

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u ^ 3 + v ^ 3 = w ^ 3

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
have "coprime u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime u v
[PROOF STEP]
using \<open>coprime (a ^ 3) (b ^ 3)\<close>
[PROOF STATE]
proof (prove)
using this:
coprime (a ^ 3) (b ^ 3)

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

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd a ^ 3
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd b ^ 3
[PROOF STEP]
with uvwabc
[PROOF STATE]
proof (chain)
picking this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
h dvd u
h dvd v
[PROOF STEP]
have "h dvd ?c*?c^2"
[PROOF STATE]
proof (prove)
using this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
h dvd u
h dvd v

goal (1 subgoal):
 1. h dvd z div gcd x y * (z div gcd x y)\<^sup>2
[PROOF STEP]
by (simp only: dvd_mult2)
[PROOF STATE]
proof (state)
this:
h dvd z div gcd x y * (z div gcd x y)\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd a ^ 3
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd b ^ 3
[PROOF STEP]
with abc
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
h dvd z div gcd x y * (z div gcd x y)\<^sup>2
[PROOF STEP]
have "h dvd a^3+b^3"
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
h dvd z div gcd x y * (z div gcd x y)\<^sup>2

goal (1 subgoal):
 1. h dvd a ^ 3 + b ^ 3
[PROOF STEP]
using power_Suc[of ?c 2]
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
h dvd z div gcd x y * (z div gcd x y)\<^sup>2
(z div gcd x y) ^ Suc 2 = z div gcd x y * (z div gcd x y)\<^sup>2

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

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

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd a ^ 3
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd b ^ 3
[PROOF STEP]
from hu uvwabc
[PROOF STATE]
proof (chain)
picking this:
h dvd u
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
[PROOF STEP]
have hb3: "h dvd b*b^2"
[PROOF STATE]
proof (prove)
using this:
h dvd u
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w

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

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

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

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

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

goal (1 subgoal):
 1. h dvd a ^ 3 &&& h dvd b ^ 3
[PROOF STEP]
using power_Suc[of b 2]
[PROOF STATE]
proof (prove)
using this:
h dvd b * b\<^sup>2
h dvd a ^ 3 + b ^ 3 - b ^ 3
b ^ Suc 2 = b * b\<^sup>2

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

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
u * v * w \<noteq> 0
u ^ 3 + v ^ 3 = w ^ 3
coprime u v
[PROOF STEP]
have "?Q u v w"
[PROOF STATE]
proof (prove)
using this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
u * v * w \<noteq> 0
u ^ 3 + v ^ 3 = w ^ 3
coprime u v

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
using \<open>even a\<close>
[PROOF STATE]
proof (prove)
using this:
u = - b \<and> v = z div gcd x y \<and> w = a \<and> even w
u * v * w \<noteq> 0
u ^ 3 + v ^ 3 = w ^ 3
coprime u v
even a

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
hence ?thesis
[PROOF STATE]
proof (prove)
using this:
u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
even a \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even a \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
even a \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
assume "even b"
[PROOF STATE]
proof (state)
this:
even b

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even b
[PROOF STEP]
obtain u v w where uvwabc: "u = -a \<and> v = ?c \<and> w = b \<and> even w"
[PROOF STATE]
proof (prove)
using this:
even b

goal (1 subgoal):
 1. (\<And>u v w. u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
with abc
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
[PROOF STEP]
have "u*v*w\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w

goal (1 subgoal):
 1. u * v * w \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u * v * w \<noteq> 0

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
have uvw: "u^3+v^3=w^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
from uvwabc
[PROOF STATE]
proof (chain)
picking this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
[PROOF STEP]
have "u^3 + v^3 = (-1*a)^3 + ?c^3"
[PROOF STATE]
proof (prove)
using this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = (- 1 * a) ^ 3 + (z div gcd x y) ^ 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u ^ 3 + v ^ 3 = (- 1 * a) ^ 3 + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u ^ 3 + v ^ 3 = (- 1 * a) ^ 3 + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
have "\<dots> = (-1)^3*a^3 + ?c^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1 * a) ^ 3 + (z div gcd x y) ^ 3 = (- 1) ^ 3 * a ^ 3 + (z div gcd x y) ^ 3
[PROOF STEP]
by (simp only: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(- 1 * a) ^ 3 + (z div gcd x y) ^ 3 = (- 1) ^ 3 * a ^ 3 + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- 1 * a) ^ 3 + (z div gcd x y) ^ 3 = (- 1) ^ 3 * a ^ 3 + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
have "\<dots> = - (a^3) + ?c^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ 3 * a ^ 3 + (z div gcd x y) ^ 3 = - (a ^ 3) + (z div gcd x y) ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- 1) ^ 3 * a ^ 3 + (z div gcd x y) ^ 3 = - (a ^ 3) + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- 1) ^ 3 * a ^ 3 + (z div gcd x y) ^ 3 = - (a ^ 3) + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
with abc and uvwabc
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
(- 1) ^ 3 * a ^ 3 + (z div gcd x y) ^ 3 = - (a ^ 3) + (z div gcd x y) ^ 3
[PROOF STEP]
have "\<dots> = w^3"
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
(- 1) ^ 3 * a ^ 3 + (z div gcd x y) ^ 3 = - (a ^ 3) + (z div gcd x y) ^ 3

goal (1 subgoal):
 1. - (a ^ 3) + (z div gcd x y) ^ 3 = w ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (a ^ 3) + (z div gcd x y) ^ 3 = w ^ 3

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u ^ 3 + v ^ 3 = w ^ 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u ^ 3 + v ^ 3 = w ^ 3

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u ^ 3 + v ^ 3 = w ^ 3

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
have "coprime u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime u v
[PROOF STEP]
using \<open>coprime (a ^ 3) (b ^ 3)\<close>
[PROOF STATE]
proof (prove)
using this:
coprime (a ^ 3) (b ^ 3)

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

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd a ^ 3
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd b ^ 3
[PROOF STEP]
with uvwabc
[PROOF STATE]
proof (chain)
picking this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
h dvd u
h dvd v
[PROOF STEP]
have "h dvd ?c*?c^2"
[PROOF STATE]
proof (prove)
using this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
h dvd u
h dvd v

goal (1 subgoal):
 1. h dvd z div gcd x y * (z div gcd x y)\<^sup>2
[PROOF STEP]
by (simp only: dvd_mult2)
[PROOF STATE]
proof (state)
this:
h dvd z div gcd x y * (z div gcd x y)\<^sup>2

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd a ^ 3
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd b ^ 3
[PROOF STEP]
with abc
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
h dvd z div gcd x y * (z div gcd x y)\<^sup>2
[PROOF STEP]
have "h dvd a^3+b^3"
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
h dvd z div gcd x y * (z div gcd x y)\<^sup>2

goal (1 subgoal):
 1. h dvd a ^ 3 + b ^ 3
[PROOF STEP]
using power_Suc[of ?c 2]
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
h dvd z div gcd x y * (z div gcd x y)\<^sup>2
(z div gcd x y) ^ Suc 2 = z div gcd x y * (z div gcd x y)\<^sup>2

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

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

goal (2 subgoals):
 1. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd a ^ 3
 2. \<And>e. \<lbrakk>\<not> is_unit e; e dvd u; e dvd v\<rbrakk> \<Longrightarrow> e dvd b ^ 3
[PROOF STEP]
from hu uvwabc
[PROOF STATE]
proof (chain)
picking this:
h dvd u
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
[PROOF STEP]
have hb3: "h dvd a*a^2"
[PROOF STATE]
proof (prove)
using this:
h dvd u
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w

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

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

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

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

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

goal (1 subgoal):
 1. h dvd a ^ 3 &&& h dvd b ^ 3
[PROOF STEP]
using power_Suc[of a 2]
[PROOF STATE]
proof (prove)
using this:
h dvd a * a\<^sup>2
h dvd a ^ 3 + b ^ 3 - a ^ 3
a ^ Suc 2 = a * a\<^sup>2

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

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
u * v * w \<noteq> 0
u ^ 3 + v ^ 3 = w ^ 3
coprime u v
[PROOF STEP]
have "?Q u v w"
[PROOF STATE]
proof (prove)
using this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
u * v * w \<noteq> 0
u ^ 3 + v ^ 3 = w ^ 3
coprime u v

goal (1 subgoal):
 1. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
using \<open>even b\<close>
[PROOF STATE]
proof (prove)
using this:
u = - a \<and> v = z div gcd x y \<and> w = b \<and> even w
u * v * w \<noteq> 0
u ^ 3 + v ^ 3 = w ^ 3
coprime u v
even b

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
hence ?thesis
[PROOF STATE]
proof (prove)
using this:
u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
even b \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
even b \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
even b \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
assume "even ?c"
[PROOF STATE]
proof (state)
this:
even (z div gcd x y)

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even (z div gcd x y)
[PROOF STEP]
obtain u v w where uvwabc: "u = a \<and> v = b \<and> w = ?c \<and> even w"
[PROOF STATE]
proof (prove)
using this:
even (z div gcd x y)

goal (1 subgoal):
 1. (\<And>u v w. u = a \<and> v = b \<and> w = z div gcd x y \<and> even w \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = a \<and> v = b \<and> w = z div gcd x y \<and> even w

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
with abc ab
[PROOF STATE]
proof (chain)
picking this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b
u = a \<and> v = b \<and> w = z div gcd x y \<and> even w
[PROOF STEP]
have ?thesis
[PROOF STATE]
proof (prove)
using this:
z div gcd x y * gcd x y = z \<and> a ^ 3 + b ^ 3 = (z div gcd x y) ^ 3 \<and> a * b * (z div gcd x y) \<noteq> 0
x = gcd x y * a \<and> y = gcd x y * b \<and> coprime a b
u = a \<and> v = b \<and> w = z div gcd x y \<and> even w

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

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
even (z div gcd x y) \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
even a \<or> even b \<or> even (z div gcd x y)
even a \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
even b \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
even (z div gcd x y) \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
even a \<or> even b \<or> even (z div gcd x y)
even a \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
even b \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
even (z div gcd x y) \<Longrightarrow> \<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "\<exists> w. \<exists> u v. u^3 + v^3 = w^3 \<and> u*v*w \<noteq> (0::int) \<and> even w \<and> coprime u v"
[PROOF STATE]
proof (prove)
using this:
\<exists>u v w. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. \<exists>w u v. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v
[PROOF STEP]
by auto
  \<comment> \<open>show contradiction using the earlier result\<close>
[PROOF STATE]
proof (state)
this:
\<exists>w u v. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

goal (1 subgoal):
 1. x * y * z \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
\<exists>w u v. u ^ 3 + v ^ 3 = w ^ 3 \<and> u * v * w \<noteq> 0 \<and> even w \<and> coprime u v

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma topspace_prod_topology [simp]:
   "topspace (prod_topology X Y) = topspace X \<times> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace (prod_topology X Y) = topspace X \<times> topspace Y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. topspace (prod_topology X Y) = topspace X \<times> topspace Y
[PROOF STEP]
have "topspace(prod_topology X Y) = \<Union> (Collect (openin (prod_topology X Y)))" (is "_ = ?Z")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace (prod_topology X Y) = \<Union> (Collect (openin (prod_topology X Y)))
[PROOF STEP]
unfolding topspace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (Collect (openin (prod_topology X Y))) = \<Union> (Collect (openin (prod_topology X Y)))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
topspace (prod_topology X Y) = \<Union> (Collect (openin (prod_topology X Y)))

goal (1 subgoal):
 1. topspace (prod_topology X Y) = topspace X \<times> topspace Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
topspace (prod_topology X Y) = \<Union> (Collect (openin (prod_topology X Y)))

goal (1 subgoal):
 1. topspace (prod_topology X Y) = topspace X \<times> topspace Y
[PROOF STEP]
have "\<dots> = topspace X \<times> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (Collect (openin (prod_topology X Y))) = topspace X \<times> topspace Y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<Union> (Collect (openin (prod_topology X Y))) \<subseteq> topspace X \<times> topspace Y
 2. topspace X \<times> topspace Y \<subseteq> \<Union> (Collect (openin (prod_topology X Y)))
[PROOF STEP]
show "?Z \<subseteq> topspace X \<times> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (Collect (openin (prod_topology X Y))) \<subseteq> topspace X \<times> topspace Y
[PROOF STEP]
apply (auto simp: openin_prod_topology union_of_def arbitrary_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b \<U> Xa. \<lbrakk>\<U> \<subseteq> {S \<times> T |S T. openin X S \<and> openin Y T}; (a, b) \<in> Xa; Xa \<in> \<U>\<rbrakk> \<Longrightarrow> a \<in> topspace X
 2. \<And>a b \<U> Xa. \<lbrakk>\<U> \<subseteq> {S \<times> T |S T. openin X S \<and> openin Y T}; (a, b) \<in> Xa; Xa \<in> \<U>\<rbrakk> \<Longrightarrow> b \<in> topspace Y
[PROOF STEP]
using openin_subset
[PROOF STATE]
proof (prove)
using this:
openin ?U ?S \<Longrightarrow> ?S \<subseteq> topspace ?U

goal (2 subgoals):
 1. \<And>a b \<U> Xa. \<lbrakk>\<U> \<subseteq> {S \<times> T |S T. openin X S \<and> openin Y T}; (a, b) \<in> Xa; Xa \<in> \<U>\<rbrakk> \<Longrightarrow> a \<in> topspace X
 2. \<And>a b \<U> Xa. \<lbrakk>\<U> \<subseteq> {S \<times> T |S T. openin X S \<and> openin Y T}; (a, b) \<in> Xa; Xa \<in> \<U>\<rbrakk> \<Longrightarrow> b \<in> topspace Y
[PROOF STEP]
by force+
[PROOF STATE]
proof (state)
this:
\<Union> (Collect (openin (prod_topology X Y))) \<subseteq> topspace X \<times> topspace Y

goal (1 subgoal):
 1. topspace X \<times> topspace Y \<subseteq> \<Union> (Collect (openin (prod_topology X Y)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. topspace X \<times> topspace Y \<subseteq> \<Union> (Collect (openin (prod_topology X Y)))
[PROOF STEP]
have *: "\<exists>A B. topspace X \<times> topspace Y = A \<times> B \<and> openin X A \<and> openin Y B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A B. topspace X \<times> topspace Y = A \<times> B \<and> openin X A \<and> openin Y B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>A B. topspace X \<times> topspace Y = A \<times> B \<and> openin X A \<and> openin Y B

goal (1 subgoal):
 1. topspace X \<times> topspace Y \<subseteq> \<Union> (Collect (openin (prod_topology X Y)))
[PROOF STEP]
show "topspace X \<times> topspace Y \<subseteq> ?Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace X \<times> topspace Y \<subseteq> \<Union> (Collect (openin (prod_topology X Y)))
[PROOF STEP]
apply (rule Union_upper)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace X \<times> topspace Y \<in> Collect (openin (prod_topology X Y))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<exists>A B. topspace X \<times> topspace Y = A \<times> B \<and> openin X A \<and> openin Y B

goal (1 subgoal):
 1. topspace X \<times> topspace Y \<in> Collect (openin (prod_topology X Y))
[PROOF STEP]
by (simp add: openin_prod_topology arbitrary_union_of_inc)
[PROOF STATE]
proof (state)
this:
topspace X \<times> topspace Y \<subseteq> \<Union> (Collect (openin (prod_topology X Y)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Union> (Collect (openin (prod_topology X Y))) = topspace X \<times> topspace Y

goal (1 subgoal):
 1. topspace (prod_topology X Y) = topspace X \<times> topspace Y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
topspace (prod_topology X Y) = topspace X \<times> topspace Y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
topspace (prod_topology X Y) = topspace X \<times> topspace Y

goal (1 subgoal):
 1. topspace (prod_topology X Y) = topspace X \<times> topspace Y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
topspace (prod_topology X Y) = topspace X \<times> topspace Y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem pr_is_total_rec: "f \<in> PrimRec1 \<Longrightarrow> total_recursive f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
assume A: "f \<in> PrimRec1"
[PROOF STATE]
proof (state)
this:
f \<in> PrimRec1

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
define p where "p x = c_pair x (f x)" for x
[PROOF STATE]
proof (state)
this:
p ?x = c_pair ?x (f ?x)

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
f \<in> PrimRec1
[PROOF STEP]
have p_is_pr: "p \<in> PrimRec1"
[PROOF STATE]
proof (prove)
using this:
f \<in> PrimRec1

goal (1 subgoal):
 1. p \<in> PrimRec1
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
f \<in> PrimRec1

goal (1 subgoal):
 1. (\<lambda>x. c_pair x (f x)) \<in> PrimRec1
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
p \<in> PrimRec1

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
let ?U = "{ p x | x. x \<in> UNIV }"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
from ce_univ p_is_pr
[PROOF STATE]
proof (chain)
picking this:
UNIV \<in> ce_sets
p \<in> PrimRec1
[PROOF STEP]
have U_ce: "?U \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
UNIV \<in> ce_sets
p \<in> PrimRec1

goal (1 subgoal):
 1. {p x |x. x \<in> UNIV} \<in> ce_sets
[PROOF STEP]
by (rule ce_set_lm_7)
[PROOF STATE]
proof (state)
this:
{p x |x. x \<in> UNIV} \<in> ce_sets

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
have U_1: "?U = { c_pair x (f x) | x. x \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p x |x. x \<in> UNIV} = {c_pair x (f x) |x. x \<in> UNIV}
[PROOF STEP]
by (simp add: p_def)
[PROOF STATE]
proof (state)
this:
{p x |x. x \<in> UNIV} = {c_pair x (f x) |x. x \<in> UNIV}

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
with U_ce
[PROOF STATE]
proof (chain)
picking this:
{p x |x. x \<in> UNIV} \<in> ce_sets
{p x |x. x \<in> UNIV} = {c_pair x (f x) |x. x \<in> UNIV}
[PROOF STEP]
have S1: "{ c_pair x (f x) | x. x \<in> UNIV} \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
{p x |x. x \<in> UNIV} \<in> ce_sets
{p x |x. x \<in> UNIV} = {c_pair x (f x) |x. x \<in> UNIV}

goal (1 subgoal):
 1. {c_pair x (f x) |x. x \<in> UNIV} \<in> ce_sets
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{c_pair x (f x) |x. x \<in> UNIV} \<in> ce_sets

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
with c_graph_def
[PROOF STATE]
proof (chain)
picking this:
c_graph = (\<lambda>f. {c_pair x (f x) |x. x \<in> UNIV})
{c_pair x (f x) |x. x \<in> UNIV} \<in> ce_sets
[PROOF STEP]
have c_graph_f_is_ce: "c_graph f \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
c_graph = (\<lambda>f. {c_pair x (f x) |x. x \<in> UNIV})
{c_pair x (f x) |x. x \<in> UNIV} \<in> ce_sets

goal (1 subgoal):
 1. c_graph f \<in> ce_sets
[PROOF STEP]
by (unfold c_graph_def, auto)
[PROOF STATE]
proof (state)
this:
c_graph f \<in> ce_sets

goal (1 subgoal):
 1. f \<in> PrimRec1 \<Longrightarrow> total_recursive f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c_graph f \<in> ce_sets
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c_graph f \<in> ce_sets

goal (1 subgoal):
 1. total_recursive f
[PROOF STEP]
by (unfold total_recursive_def1, auto)
[PROOF STATE]
proof (state)
this:
total_recursive f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) group_incl_imp_subgroup: \<^marker>\<open>contributor \<open>Martin Baillon\<close>\<close>
  assumes "H \<subseteq> carrier G"
    and "group (G\<lparr>carrier := H\<rparr>)"
  shows "subgroup H G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
proof (intro submonoid_subgroupI[OF monoid_incl_imp_submonoid[OF assms(1)]])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Group.monoid (G\<lparr>carrier := H\<rparr>)
 2. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
show "monoid (G\<lparr>carrier := H\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.monoid (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
using group_def assms
[PROOF STATE]
proof (prove)
using this:
Group.group ?G \<equiv> Group.monoid ?G \<and> Group.group_axioms ?G
H \<subseteq> carrier G
Group.group (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. Group.monoid (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Group.monoid (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
have ab_eq : "\<And> a b. a \<in> H \<Longrightarrow> b \<in> H \<Longrightarrow> a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> b = a \<otimes> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> b = a \<otimes> b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> carrier G
Group.group (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> b = a \<otimes> b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> H; ?b \<in> H\<rbrakk> \<Longrightarrow> ?a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?b = ?a \<otimes> ?b

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
assume aH : "a \<in> H"
[PROOF STATE]
proof (state)
this:
a \<in> H

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
have " inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> carrier G
[PROOF STEP]
using assms aH group.inv_closed[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> carrier G
Group.group (G\<lparr>carrier := H\<rparr>)
a \<in> H
?x \<in> carrier (G\<lparr>carrier := H\<rparr>) \<Longrightarrow> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?x \<in> carrier (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> carrier G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> carrier G

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> carrier G

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
have "\<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> = \<one>
[PROOF STEP]
using assms monoid.one_closed ab_eq one_def
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> carrier G
Group.group (G\<lparr>carrier := H\<rparr>)
Group.monoid ?G \<Longrightarrow> \<one>\<^bsub>?G\<^esub> \<in> carrier ?G
\<lbrakk>?a \<in> H; ?b \<in> H\<rbrakk> \<Longrightarrow> ?a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?b = ?a \<otimes> ?b
one \<equiv> id \<circ> Record.iso_tuple_snd Record.tuple_iso_tuple \<circ> Record.iso_tuple_fst monoid_ext_Tuple_Iso \<circ> Record.iso_tuple_snd partial_object_ext_Tuple_Iso

goal (1 subgoal):
 1. \<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> = \<one>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> = \<one>

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
hence "a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a= \<one>"
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> = \<one>

goal (1 subgoal):
 1. a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>
[PROOF STEP]
using assms ab_eq aH  group.r_inv[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> = \<one>
H \<subseteq> carrier G
Group.group (G\<lparr>carrier := H\<rparr>)
\<lbrakk>?a \<in> H; ?b \<in> H\<rbrakk> \<Longrightarrow> ?a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?b = ?a \<otimes> ?b
a \<in> H
?x \<in> carrier (G\<lparr>carrier := H\<rparr>) \<Longrightarrow> ?x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?x = \<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>

goal (1 subgoal):
 1. a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
hence "a \<otimes> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a= \<one>"
[PROOF STATE]
proof (prove)
using this:
a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>

goal (1 subgoal):
 1. a \<otimes> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>
[PROOF STEP]
using aH assms group.inv_closed[OF assms(2)] ab_eq
[PROOF STATE]
proof (prove)
using this:
a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>
a \<in> H
H \<subseteq> carrier G
Group.group (G\<lparr>carrier := H\<rparr>)
?x \<in> carrier (G\<lparr>carrier := H\<rparr>) \<Longrightarrow> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?x \<in> carrier (G\<lparr>carrier := H\<rparr>)
\<lbrakk>?a \<in> H; ?b \<in> H\<rbrakk> \<Longrightarrow> ?a \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?b = ?a \<otimes> ?b

goal (1 subgoal):
 1. a \<otimes> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<otimes> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> carrier G
a \<otimes> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>
[PROOF STEP]
have "inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = inv a"
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> carrier G
a \<otimes> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = \<one>

goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = inv a
[PROOF STEP]
by (metis aH assms(1) contra_subsetD group.inv_inv is_group local.inv_equality)
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = inv a

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = inv a

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
have "inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> H
[PROOF STEP]
using aH group.inv_closed[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
a \<in> H
?x \<in> carrier (G\<lparr>carrier := H\<rparr>) \<Longrightarrow> inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> ?x \<in> carrier (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> H

goal (1 subgoal):
 1. \<And>a. a \<in> H \<Longrightarrow> inv a \<in> H
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = inv a
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> H
[PROOF STEP]
show "inv a \<in> H"
[PROOF STATE]
proof (prove)
using this:
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a = inv a
inv\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> a \<in> H

goal (1 subgoal):
 1. inv a \<in> H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv a \<in> H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma delete_edge_is_path:
    assumes "is_path_undir G x p y"
    assumes "(a, b, c) \<notin> set p"
    assumes "(c, b, a) \<notin> set p"
    shows "is_path_undir (delete_edge a b c G) x p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_path_undir (delete_edge a b c G) x p y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_path_undir (delete_edge a b c G) x p y
[PROOF STEP]
from E_valid
[PROOF STATE]
proof (chain)
picking this:
fst ` E \<subseteq> V
snd ` snd ` E \<subseteq> V
[PROOF STEP]
have "valid_graph (delete_edge a b c G)"
[PROOF STATE]
proof (prove)
using this:
fst ` E \<subseteq> V
snd ` snd ` E \<subseteq> V

goal (1 subgoal):
 1. valid_graph (delete_edge a b c G)
[PROOF STEP]
unfolding valid_graph_def delete_edge_def
[PROOF STATE]
proof (prove)
using this:
fst ` E \<subseteq> V
snd ` snd ` E \<subseteq> V

goal (1 subgoal):
 1. fst ` edges \<lparr>nodes = V, edges = E - {(a, b, c)}\<rparr> \<subseteq> nodes \<lparr>nodes = V, edges = E - {(a, b, c)}\<rparr> \<and> snd ` snd ` edges \<lparr>nodes = V, edges = E - {(a, b, c)}\<rparr> \<subseteq> nodes \<lparr>nodes = V, edges = E - {(a, b, c)}\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
valid_graph (delete_edge a b c G)

goal (1 subgoal):
 1. is_path_undir (delete_edge a b c G) x p y
[PROOF STEP]
with assms is_path_undir.simps[of "delete_edge a b c G"]
[PROOF STATE]
proof (chain)
picking this:
is_path_undir G x p y
(a, b, c) \<notin> set p
(c, b, a) \<notin> set p
is_path_undir (delete_edge a b c G) ?v [] ?v' = (?v = ?v' \<and> ?v' \<in> nodes (delete_edge a b c G))
is_path_undir (delete_edge a b c G) ?v ((?v1.0, ?w, ?v2.0) # ?p) ?v' = (?v = ?v1.0 \<and> ((?v1.0, ?w, ?v2.0) \<in> edges (delete_edge a b c G) \<or> (?v2.0, ?w, ?v1.0) \<in> edges (delete_edge a b c G)) \<and> is_path_undir (delete_edge a b c G) ?v2.0 ?p ?v')
valid_graph (delete_edge a b c G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_path_undir G x p y
(a, b, c) \<notin> set p
(c, b, a) \<notin> set p
is_path_undir (delete_edge a b c G) ?v [] ?v' = (?v = ?v' \<and> ?v' \<in> nodes (delete_edge a b c G))
is_path_undir (delete_edge a b c G) ?v ((?v1.0, ?w, ?v2.0) # ?p) ?v' = (?v = ?v1.0 \<and> ((?v1.0, ?w, ?v2.0) \<in> edges (delete_edge a b c G) \<or> (?v2.0, ?w, ?v1.0) \<in> edges (delete_edge a b c G)) \<and> is_path_undir (delete_edge a b c G) ?v2.0 ?p ?v')
valid_graph (delete_edge a b c G)

goal (1 subgoal):
 1. is_path_undir (delete_edge a b c G) x p y
[PROOF STEP]
by (induction p arbitrary: x y) auto
[PROOF STATE]
proof (state)
this:
is_path_undir (delete_edge a b c G) x p y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma preflect_tendsto[tendsto_intros]:
  fixes l::"'a::real_normed_vector"
  shows "(g \<longlongrightarrow> l) F \<Longrightarrow> (h \<longlongrightarrow> m) F \<Longrightarrow> ((\<lambda>x. preflect (g x) (h x)) \<longlongrightarrow> preflect l m) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(g \<longlongrightarrow> l) F; (h \<longlongrightarrow> m) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. preflect (g x) (h x)) \<longlongrightarrow> preflect l m) F
[PROOF STEP]
by (auto intro!: tendsto_eq_intros simp: preflect_def)


[STATEMENT]
lemma c_remove_is_pr: "c_remove \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_remove \<in> PrimRec2
[PROOF STEP]
proof (unfold c_remove_def, rule if_eq_is_pr2)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. c_in \<in> PrimRec2
 2. (\<lambda>x y. 0) \<in> PrimRec2
 3. (\<lambda>x y. y) \<in> PrimRec2
 4. (\<lambda>x y. y - 2 ^ x) \<in> PrimRec2
[PROOF STEP]
show "c_in \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_in \<in> PrimRec2
[PROOF STEP]
by (rule c_in_is_pr)
[PROOF STATE]
proof (state)
this:
c_in \<in> PrimRec2

goal (3 subgoals):
 1. (\<lambda>x y. 0) \<in> PrimRec2
 2. (\<lambda>x y. y) \<in> PrimRec2
 3. (\<lambda>x y. y - 2 ^ x) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x y. 0) \<in> PrimRec2
 2. (\<lambda>x y. y) \<in> PrimRec2
 3. (\<lambda>x y. y - 2 ^ x) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. 0) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. 0) \<in> PrimRec2
[PROOF STEP]
by (rule const_is_pr_2)
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. 0) \<in> PrimRec2

goal (2 subgoals):
 1. (\<lambda>x y. y) \<in> PrimRec2
 2. (\<lambda>x y. y - 2 ^ x) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x y. y) \<in> PrimRec2
 2. (\<lambda>x y. y - 2 ^ x) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. y) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. y) \<in> PrimRec2
[PROOF STEP]
by (rule pr_id2_2)
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. y) \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. y - 2 ^ x) \<in> PrimRec2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x y. y - 2 ^ x) \<in> PrimRec2
[PROOF STEP]
from power_is_pr
[PROOF STATE]
proof (chain)
picking this:
(^) \<in> PrimRec2
[PROOF STEP]
show "(\<lambda>x y. y - 2 ^ x) \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
(^) \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x y. y - 2 ^ x) \<in> PrimRec2
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. y - 2 ^ x) \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_dist_ascending_chain:
  assumes "x \<in> Continuous"
      and "ascending_chain f"
    shows "x * (SUP n::nat . f n) = (SUP n::nat . x * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * \<Squnion> range f = (\<Squnion>n. x * f n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * \<Squnion> range f = (\<Squnion>n. x * f n)
[PROOF STEP]
have "directed (range f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directed (range f)
[PROOF STEP]
by (simp add: assms(2) ascending_chain_directed)
[PROOF STATE]
proof (state)
this:
directed (range f)

goal (1 subgoal):
 1. x * \<Squnion> range f = (\<Squnion>n. x * f n)
[PROOF STEP]
hence "x * (SUP n::nat . f n) = (SUP y\<in>range f . x * y)"
[PROOF STATE]
proof (prove)
using this:
directed (range f)

goal (1 subgoal):
 1. x * \<Squnion> range f = \<Squnion> ((*) x ` range f)
[PROOF STEP]
using assms(1) continuous_Continuous continuous_def
[PROOF STATE]
proof (prove)
using this:
directed (range f)
x \<in> Continuous
continuous ?x = (?x \<in> Continuous)
continuous ?x \<equiv> \<forall>Y. directed Y \<longrightarrow> ?x * (\<Squnion>y\<in>Y. y) = \<Squnion> ((*) ?x ` Y)

goal (1 subgoal):
 1. x * \<Squnion> range f = \<Squnion> ((*) x ` range f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x * \<Squnion> range f = \<Squnion> ((*) x ` range f)

goal (1 subgoal):
 1. x * \<Squnion> range f = (\<Squnion>n. x * f n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x * \<Squnion> range f = \<Squnion> ((*) x ` range f)

goal (1 subgoal):
 1. x * \<Squnion> range f = (\<Squnion>n. x * f n)
[PROOF STEP]
by (simp add: range_composition)
[PROOF STATE]
proof (state)
this:
x * \<Squnion> range f = (\<Squnion>n. x * f n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powser_split_head:
  fixes f :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
  assumes "summable (\<lambda>n. f n * z ^ n)"
  shows "suminf (\<lambda>n. f n * z ^ n) = f 0 + suminf (\<lambda>n. f (Suc n) * z ^ n) * z"
    and "suminf (\<lambda>n. f (Suc n) * z ^ n) * z = suminf (\<lambda>n. f n * z ^ n) - f 0"
    and "summable (\<lambda>n. f (Suc n) * z ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z &&& (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0 &&& summable (\<lambda>n. f (Suc n) * z ^ n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z
 2. (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0
 3. summable (\<lambda>n. f (Suc n) * z ^ n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
show "summable (\<lambda>n. f (Suc n) * z ^ n)"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. f n * z ^ n)

goal (1 subgoal):
 1. summable (\<lambda>n. f (Suc n) * z ^ n)
[PROOF STEP]
by (subst summable_powser_split_head)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f (Suc n) * z ^ n)

goal (2 subgoals):
 1. (\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z
 2. (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0
[PROOF STEP]
from suminf_mult2[OF this, of z]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f (Suc n) * z ^ n * z)
[PROOF STEP]
have "(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f (Suc n) * z ^ Suc n)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f (Suc n) * z ^ n * z)

goal (1 subgoal):
 1. (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f (Suc n) * z ^ Suc n)
[PROOF STEP]
by (simp add: power_commutes algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f (Suc n) * z ^ Suc n)

goal (2 subgoals):
 1. (\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z
 2. (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f (Suc n) * z ^ Suc n)

goal (2 subgoals):
 1. (\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z
 2. (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
have "\<dots> = suminf (\<lambda>n. f n * z ^ n) - f 0"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. f n * z ^ n)

goal (1 subgoal):
 1. (\<Sum>n. f (Suc n) * z ^ Suc n) = (\<Sum>n. f n * z ^ n) - f 0
[PROOF STEP]
by (subst suminf_split_head) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>n. f (Suc n) * z ^ Suc n) = (\<Sum>n. f n * z ^ n) - f 0

goal (2 subgoals):
 1. (\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z
 2. (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0
[PROOF STEP]
show "suminf (\<lambda>n. f n * z ^ n) = f 0 + suminf (\<lambda>n. f (Suc n) * z ^ n) * z"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0

goal (1 subgoal):
 1. (\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z

goal (1 subgoal):
 1. (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z
[PROOF STEP]
show "suminf (\<lambda>n. f (Suc n) * z ^ n) * z = suminf (\<lambda>n. f n * z ^ n) - f 0"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. f n * z ^ n) = f 0 + (\<Sum>n. f (Suc n) * z ^ n) * z

goal (1 subgoal):
 1. (\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. f (Suc n) * z ^ n) * z = (\<Sum>n. f n * z ^ n) - f 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_suffixes [simp]: "n \<le> length xs \<Longrightarrow> suffixes xs ! n = drop (length xs - n) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length xs \<Longrightarrow> suffixes xs ! n = drop (length xs - n) xs
[PROOF STEP]
by (subst suffixes_conv_prefixes) (simp_all add: rev_take)


[STATEMENT]
lemma expands_to_cos_ms_neg_exp:
  assumes "e < 0" "basis_wf basis" "(f expands_to MS (MSLCons (C, e) xs) g) basis"
  shows   "((\<lambda>x. cos (f x)) expands_to MS (cos_ms_aux' (MSLCons (C, e) xs)) (\<lambda>x. cos (g x))) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. cos (f x)) expands_to MS (cos_ms_aux' (MSLCons (C, e) xs)) (\<lambda>x. cos (g x))) basis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
e < 0
basis_wf basis
(f expands_to MS (MSLCons (C, e) xs) g) basis

goal (1 subgoal):
 1. ((\<lambda>x. cos (f x)) expands_to MS (cos_ms_aux' (MSLCons (C, e) xs)) (\<lambda>x. cos (g x))) basis
[PROOF STEP]
by (auto simp: expands_to.simps snd_dominant_term_ms_aux_MSLCons o_def
                       intro!: cos_ms_aux' elim: eventually_mono)


[STATEMENT]
lemma encompasses_segments_of_aform_in_AffineI:
  assumes "length (segments_of_aform X) > 2"
  assumes "list_all (encompasses p) (segments_of_aform X)"
  shows "p \<in> Affine X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
2 < length (segments_of_aform X)
[PROOF STEP]
obtain x y z zs where eq: "segments_of_aform X = x#y#z#zs"
[PROOF STATE]
proof (prove)
using this:
2 < length (segments_of_aform X)

goal (1 subgoal):
 1. (\<And>x y z zs. segments_of_aform X = x # y # z # zs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "segments_of_aform X" rule: list_cases4) auto
[PROOF STATE]
proof (state)
this:
segments_of_aform X = x # y # z # zs

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
hence "fst x = fst (hd (half_segments_of_aform X))"
[PROOF STATE]
proof (prove)
using this:
segments_of_aform X = x # y # z # zs

goal (1 subgoal):
 1. fst x = fst (hd (half_segments_of_aform X))
[PROOF STEP]
by (metis segments_of_aform_def hd_append list.map_disc_iff list.sel(1))
[PROOF STATE]
proof (state)
this:
fst x = fst (hd (half_segments_of_aform X))

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fst x = fst (hd (half_segments_of_aform X))

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
have "\<dots> = lowest_vertex (fst X, nlex_pdevs (snd X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (hd (half_segments_of_aform X)) = lowest_vertex (fst X, nlex_pdevs (snd X))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
2 < length (segments_of_aform X)
list_all (\<lambda>seg. 0 \<le> det3 (fst seg) (snd seg) p) (segments_of_aform X)

goal (1 subgoal):
 1. fst (hd (half_segments_of_aform X)) = lowest_vertex (fst X, nlex_pdevs (snd X))
[PROOF STEP]
by (intro fst_hd_half_segments_of_aform) (auto simp: segments_of_aform_def)
[PROOF STATE]
proof (state)
this:
fst (hd (half_segments_of_aform X)) = lowest_vertex (fst X, nlex_pdevs (snd X))

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fst x = lowest_vertex (fst X, nlex_pdevs (snd X))
[PROOF STEP]
have fstx: "fst x = lowest_vertex (fst X, nlex_pdevs (snd X))"
[PROOF STATE]
proof (prove)
using this:
fst x = lowest_vertex (fst X, nlex_pdevs (snd X))

goal (1 subgoal):
 1. fst x = lowest_vertex (fst X, nlex_pdevs (snd X))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fst x = lowest_vertex (fst X, nlex_pdevs (snd X))

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
have "p \<in> convex hull (set (map fst (segments_of_aform X)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> convex hull set (map fst (segments_of_aform X))
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>seg. 0 \<le> det3 (fst seg) (snd seg) p) (segments_of_aform X)

goal (1 subgoal):
 1. p \<in> convex hull set (map fst (segments_of_aform X))
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>seg. 0 \<le> det3 (fst seg) (snd seg) p) (x # y # z # zs)

goal (1 subgoal):
 1. p \<in> convex hull set (map fst (x # y # z # zs))
[PROOF STEP]
proof (rule encompasses_convex_polygon3)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. convex_polygon (x # y # z # zs)
 2. ccw'.sortedP (fst x) (map snd (butlast (x # y # z # zs)))
[PROOF STEP]
show "convex_polygon (x # y # z # zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_polygon (x # y # z # zs)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
2 < length (segments_of_aform X)

goal (1 subgoal):
 1. convex_polygon (x # y # z # zs)
[PROOF STEP]
unfolding eq[symmetric]
[PROOF STATE]
proof (prove)
using this:
2 < length (segments_of_aform X)

goal (1 subgoal):
 1. convex_polygon (segments_of_aform X)
[PROOF STEP]
by (intro convex_polygon_segments_of_aform) (simp add: segments_of_aform_def Let_def)
[PROOF STATE]
proof (state)
this:
convex_polygon (x # y # z # zs)

goal (1 subgoal):
 1. ccw'.sortedP (fst x) (map snd (butlast (x # y # z # zs)))
[PROOF STEP]
show "ccw'.sortedP (fst x) (map snd (butlast (x # y # z # zs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw'.sortedP (fst x) (map snd (butlast (x # y # z # zs)))
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
2 < length (segments_of_aform X)

goal (1 subgoal):
 1. ccw'.sortedP (fst x) (map snd (butlast (x # y # z # zs)))
[PROOF STEP]
unfolding fstx map_butlast eq[symmetric]
[PROOF STATE]
proof (prove)
using this:
2 < length (segments_of_aform X)

goal (1 subgoal):
 1. ccw'.sortedP (lowest_vertex (fst X, nlex_pdevs (snd X))) (butlast (map snd (segments_of_aform X)))
[PROOF STEP]
by (intro ccw'_sortedP_snd_segments_of_aform)
        (simp add: segments_of_aform_def Let_def half_segments_of_aform_def)
[PROOF STATE]
proof (state)
this:
ccw'.sortedP (fst x) (map snd (butlast (x # y # z # zs)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<in> convex hull set (map fst (segments_of_aform X))

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p \<in> convex hull set (map fst (segments_of_aform X))

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
have "\<dots> \<subseteq> convex hull (Affine X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull set (map fst (segments_of_aform X)) \<subseteq> convex hull Affine X
[PROOF STEP]
proof (rule hull_mono, safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (map fst (segments_of_aform X)) \<Longrightarrow> (a, b) \<in> Affine X
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (map fst (segments_of_aform X)) \<Longrightarrow> (a, b) \<in> Affine X
[PROOF STEP]
assume "(a, b) \<in> set (map fst (segments_of_aform X))"
[PROOF STATE]
proof (state)
this:
(a, b) \<in> set (map fst (segments_of_aform X))

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (map fst (segments_of_aform X)) \<Longrightarrow> (a, b) \<in> Affine X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> set (map fst (segments_of_aform X))
[PROOF STEP]
obtain c d where "((a, b), c, d) \<in> set (segments_of_aform X)"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> set (map fst (segments_of_aform X))

goal (1 subgoal):
 1. (\<And>c d. ((a, b), c, d) \<in> set (segments_of_aform X) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((a, b), c, d) \<in> set (segments_of_aform X)

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (map fst (segments_of_aform X)) \<Longrightarrow> (a, b) \<in> Affine X
[PROOF STEP]
from previous_segments_of_aformE[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. (x, a, b) \<in> set (segments_of_aform X) \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain x where "(x, a, b) \<in> set (segments_of_aform X)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. (x, a, b) \<in> set (segments_of_aform X) \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>x. (x, a, b) \<in> set (segments_of_aform X) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x, a, b) \<in> set (segments_of_aform X)

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (map fst (segments_of_aform X)) \<Longrightarrow> (a, b) \<in> Affine X
[PROOF STEP]
from in_set_segments_of_aform_aform_valE[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>e. \<lbrakk>(a, b) = aform_val e X; e \<in> UNIV \<rightarrow> {- 1..1}\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain e where "(a, b) = aform_val e X" "e \<in> UNIV \<rightarrow> {- 1..1}"
[PROOF STATE]
proof (prove)
using this:
(\<And>e. \<lbrakk>(a, b) = aform_val e X; e \<in> UNIV \<rightarrow> {- 1..1}\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>(a, b) = aform_val e X; e \<in> UNIV \<rightarrow> {- 1..1}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a, b) = aform_val e X
e \<in> UNIV \<rightarrow> {- 1..1}

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (map fst (segments_of_aform X)) \<Longrightarrow> (a, b) \<in> Affine X
[PROOF STEP]
thus "(a, b) \<in> Affine X"
[PROOF STATE]
proof (prove)
using this:
(a, b) = aform_val e X
e \<in> UNIV \<rightarrow> {- 1..1}

goal (1 subgoal):
 1. (a, b) \<in> Affine X
[PROOF STEP]
by (auto simp: Affine_def valuate_def image_iff)
[PROOF STATE]
proof (state)
this:
(a, b) \<in> Affine X

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convex hull set (map fst (segments_of_aform X)) \<subseteq> convex hull Affine X

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
convex hull set (map fst (segments_of_aform X)) \<subseteq> convex hull Affine X

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
have "\<dots> = Affine X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull Affine X = Affine X
[PROOF STEP]
by (simp add: convex_Affine convex_hull_eq)
[PROOF STATE]
proof (state)
this:
convex hull Affine X = Affine X

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p \<in> Affine X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<in> Affine X

goal (1 subgoal):
 1. p \<in> Affine X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
p \<in> Affine X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inpow_subset_nodes:
  assumes "xs \<in> (rev \<circ> sorted_list_of_set) ` (Pow (set nodes))"
    shows "set xs \<subseteq> set nodes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs \<subseteq> set nodes
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set xs \<subseteq> set nodes
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
xs \<in> (rev \<circ> sorted_list_of_set) ` Pow (set nodes)
[PROOF STEP]
obtain x where x: "x \<in> Pow (set nodes)" and "xs = (rev \<circ> sorted_list_of_set) x"
[PROOF STATE]
proof (prove)
using this:
xs \<in> (rev \<circ> sorted_list_of_set) ` Pow (set nodes)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> Pow (set nodes); xs = (rev \<circ> sorted_list_of_set) x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> Pow (set nodes)
xs = (rev \<circ> sorted_list_of_set) x

goal (1 subgoal):
 1. set xs \<subseteq> set nodes
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> Pow (set nodes)
xs = (rev \<circ> sorted_list_of_set) x
[PROOF STEP]
have eq: "set xs = set (sorted_list_of_set x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> Pow (set nodes)
xs = (rev \<circ> sorted_list_of_set) x

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

goal (1 subgoal):
 1. set xs \<subseteq> set nodes
[PROOF STEP]
have "\<forall>x \<in> Pow (set nodes). finite x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>Pow (set nodes). finite x
[PROOF STEP]
by (auto intro: rev_finite_subset)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>Pow (set nodes). finite x

goal (1 subgoal):
 1. set xs \<subseteq> set nodes
[PROOF STEP]
with x eq
[PROOF STATE]
proof (chain)
picking this:
x \<in> Pow (set nodes)
set xs = set (sorted_list_of_set x)
\<forall>x\<in>Pow (set nodes). finite x
[PROOF STEP]
show "set xs \<subseteq> set nodes"
[PROOF STATE]
proof (prove)
using this:
x \<in> Pow (set nodes)
set xs = set (sorted_list_of_set x)
\<forall>x\<in>Pow (set nodes). finite x

goal (1 subgoal):
 1. set xs \<subseteq> set nodes
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> set nodes

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transitive:
  fixes P :: pi
  and   Q :: pi
  and   R :: pi

  assumes "P \<sim>\<^sup>s Q"
  and     "Q \<sim>\<^sup>s R"

  shows "P \<sim>\<^sup>s R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<sim>\<^sup>s R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P \<sim>\<^sup>s Q
Q \<sim>\<^sup>s R

goal (1 subgoal):
 1. P \<sim>\<^sup>s R
[PROOF STEP]
by(force simp add: substClosed_def intro: Strong_Late_Bisim.transitive)


[STATEMENT]
lemma size_list_length_diff1: "xs \<noteq> [] \<Longrightarrow> [] \<notin> set xs \<Longrightarrow>
  size_list (\<lambda>xs. length xs - Suc 0) xs < size_list length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; [] \<notin> set xs\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) xs < size_list length xs
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; [] \<notin> set []\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) [] < size_list length []
 2. \<And>a xs. \<lbrakk>\<lbrakk>xs \<noteq> []; [] \<notin> set xs\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) xs < size_list length xs; a # xs \<noteq> []; [] \<notin> set (a # xs)\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) (a # xs) < size_list length (a # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>xs \<noteq> []; [] \<notin> set xs\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) xs < size_list length xs
x # xs \<noteq> []
[] \<notin> set (x # xs)

goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; [] \<notin> set []\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) [] < size_list length []
 2. \<And>a xs. \<lbrakk>\<lbrakk>xs \<noteq> []; [] \<notin> set xs\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) xs < size_list length xs; a # xs \<noteq> []; [] \<notin> set (a # xs)\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) (a # xs) < size_list length (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>xs \<noteq> []; [] \<notin> set xs\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) xs < size_list length xs
x # xs \<noteq> []
[] \<notin> set (x # xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>xs \<noteq> []; [] \<notin> set xs\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) xs < size_list length xs
x # xs \<noteq> []
[] \<notin> set (x # xs)

goal (1 subgoal):
 1. size_list (\<lambda>xs. length xs - Suc 0) (x # xs) < size_list length (x # xs)
[PROOF STEP]
by (cases xs) auto
[PROOF STATE]
proof (state)
this:
size_list (\<lambda>xs. length xs - Suc 0) (x # xs) < size_list length (x # xs)

goal (1 subgoal):
 1. \<lbrakk>[] \<noteq> []; [] \<notin> set []\<rbrakk> \<Longrightarrow> size_list (\<lambda>xs. length xs - Suc 0) [] < size_list length []
[PROOF STEP]
qed simp


[STATEMENT]
lemma iMODb_minus_divisor_mult: "
  \<lbrakk> x \<in> [r, mod m, c]; r + k * m \<le> x \<rbrakk>  \<Longrightarrow> x - k * m \<in> [r, mod m, c]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> [ r, mod m, c ]; r + k * m \<le> x\<rbrakk> \<Longrightarrow> x - k * m \<in> [ r, mod m, c ]
[PROOF STEP]
by (fastforce simp: iMODb_def mod_diff_mult_self1)


[STATEMENT]
lemma ordertype_inc_le_Ord:
  assumes "small A" "Ord \<alpha>"
    and \<pi>: "\<And>x y. \<lbrakk>x\<in>A; y\<in>A; (x,y) \<in> r\<rbrakk> \<Longrightarrow> \<pi> x < \<pi> y"
    and "wf r" "total_on A r"
    and sub: "\<pi> ` A \<subseteq> elts \<alpha>"
  shows "ordertype A r \<le> \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype A r \<le> \<alpha>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordertype A r \<le> \<alpha>
[PROOF STEP]
have "\<And>x y. \<lbrakk>x\<in>A; y\<in>A; (x,y) \<in> r\<rbrakk> \<Longrightarrow> (\<pi> x, \<pi> y) \<in> VWF"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; (x, y) \<in> r\<rbrakk> \<Longrightarrow> (\<pi> x, \<pi> y) \<in> VWF
[PROOF STEP]
by (meson Ord_in_Ord VWF_iff_Ord_less \<pi> \<open>Ord \<alpha>\<close> sub image_subset_iff)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> A; ?y \<in> A; (?x, ?y) \<in> r\<rbrakk> \<Longrightarrow> (\<pi> ?x, \<pi> ?y) \<in> VWF

goal (1 subgoal):
 1. ordertype A r \<le> \<alpha>
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
small A
Ord \<alpha>
\<lbrakk>?x \<in> A; ?y \<in> A; (?x, ?y) \<in> r\<rbrakk> \<Longrightarrow> \<pi> ?x < \<pi> ?y
wf r
total_on A r
\<pi> ` A \<subseteq> elts \<alpha>
\<lbrakk>?x \<in> A; ?y \<in> A; (?x, ?y) \<in> r\<rbrakk> \<Longrightarrow> (\<pi> ?x, \<pi> ?y) \<in> VWF
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
small A
Ord \<alpha>
\<lbrakk>?x \<in> A; ?y \<in> A; (?x, ?y) \<in> r\<rbrakk> \<Longrightarrow> \<pi> ?x < \<pi> ?y
wf r
total_on A r
\<pi> ` A \<subseteq> elts \<alpha>
\<lbrakk>?x \<in> A; ?y \<in> A; (?x, ?y) \<in> r\<rbrakk> \<Longrightarrow> (\<pi> ?x, \<pi> ?y) \<in> VWF

goal (1 subgoal):
 1. ordertype A r \<le> \<alpha>
[PROOF STEP]
by (metis ordertype_inc_eq ordertype_le_Ord wf_VWF)
[PROOF STATE]
proof (state)
this:
ordertype A r \<le> \<alpha>

goal:
No subgoals!
[PROOF STEP]
qed