[STATEMENT]
lemma cartesian_power_cons:
  assumes " as \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "a \<in> carrier R"
  shows "a#as \<in> carrier (R\<^bsup>n+1\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a # as \<in> carrier (R\<^bsup>n + 1\<^esup>)
[PROOF STEP]
apply(rule cartesian_power_car_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (a # as) = n + 1
 2. set (a # as) \<subseteq> carrier R
[PROOF STEP]
apply (metis One_nat_def assms(1) cartesian_power_car_memE list.size(4))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (a # as) \<subseteq> carrier R
[PROOF STEP]
by (metis assms(1) assms(2) cartesian_power_car_memE cartesian_power_car_memE' in_set_conv_nth set_ConsD subsetI)


[STATEMENT]
lemma offset_poly_pCons:
  "offset_poly (pCons a p) h =
    smult h (offset_poly p h) + pCons a (offset_poly p h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. offset_poly (pCons a p) h = smult h (offset_poly p h) + pCons a (offset_poly p h)
[PROOF STEP]
by (cases "p = 0 \<and> a = 0") (auto simp add: offset_poly_def)


[STATEMENT]
lemma map2_index: "i < length xs \<Longrightarrow> i < length ys \<Longrightarrow> (map2 f xs ys) ! i = f (xs ! i) (ys ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; i < length ys\<rbrakk> \<Longrightarrow> map2 f xs ys ! i = f (xs ! i) (ys ! i)
[PROOF STEP]
by (induction xs arbitrary: ys i) auto


[STATEMENT]
lemma real_is_int_def2: "real_is_int x = (x = real_of_int (int_of_real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_is_int x = (x = real_of_int (int_of_real x))
[PROOF STEP]
by (auto simp add: real_is_int_def int_of_real_def)


[STATEMENT]
lemma \<psi>\<^sub>1_values_even[simp]:
  fixes i j n
  assumes "i < dim_row (\<psi>\<^sub>1 n)" and "j < dim_col (\<psi>\<^sub>1 n)" and "even i"
  shows "(\<psi>\<^sub>1 n) $$ (i,j) = 1/(sqrt 2)^(n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (2 ^ (n + 1)) 1 (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> if even i then 1 / sqrt 2 ^ (n + 1) else - 1 / sqrt 2 ^ (n + 1))) $$ (i, j) = complex_of_real (1 / sqrt 2 ^ (n + 1))
[PROOF STEP]
using assms case_prod_conv
[PROOF STATE]
proof (prove)
using this:
i < dim_row (Matrix.mat (2 ^ (n + 1)) 1 (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> if even i then 1 / sqrt 2 ^ (n + 1) else - 1 / sqrt 2 ^ (n + 1))))
j < dim_col (Matrix.mat (2 ^ (n + 1)) 1 (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> if even i then 1 / sqrt 2 ^ (n + 1) else - 1 / sqrt 2 ^ (n + 1))))
even i
(case (?a, ?b) of (c, d) \<Rightarrow> ?f c d) = ?f ?a ?b

goal (1 subgoal):
 1. Matrix.mat (2 ^ (n + 1)) 1 (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> if even i then 1 / sqrt 2 ^ (n + 1) else - 1 / sqrt 2 ^ (n + 1))) $$ (i, j) = complex_of_real (1 / sqrt 2 ^ (n + 1))
[PROOF STEP]
by simp


[STATEMENT]
lemma swap_o_Fst: "swap o Fst = Snd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swap \<circ> Fst = Snd
[PROOF STEP]
by (auto simp add: Fst_def Snd_def)


[STATEMENT]
lemma infdist_notempty: "A \<noteq> {} \<Longrightarrow> infdist x A = (INF a\<in>A. dist x a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> infdist x A = Inf (dist x ` A)
[PROOF STEP]
by (simp add: infdist_def)


[STATEMENT]
lemma hd_lq_conv_nth: assumes "u <p v" shows "hd(u\<inverse>\<^sup>>v) = v!\<^bold>|u\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (u\<inverse>\<^sup>>v) = v ! \<^bold>|u\<^bold>|
[PROOF STEP]
using prefix_length_less[OF assms, THEN hd_drop_conv_nth]
[PROOF STATE]
proof (prove)
using this:
hd (drop \<^bold>|u\<^bold>| v) = v ! \<^bold>|u\<^bold>|

goal (1 subgoal):
 1. hd (u\<inverse>\<^sup>>v) = v ! \<^bold>|u\<^bold>|
[PROOF STEP]
unfolding lq_drop[OF sprefD1[OF assms]]
[PROOF STATE]
proof (prove)
using this:
hd (drop \<^bold>|u\<^bold>| v) = v ! \<^bold>|u\<^bold>|

goal (1 subgoal):
 1. hd (drop \<^bold>|u\<^bold>| v) = v ! \<^bold>|u\<^bold>|
[PROOF STEP]
.


[STATEMENT]
lemma connectedD[intro?]:
  assumes "connected g" "u\<in>nodes g" "v\<in>nodes g"
  shows "(u,v)\<in>(edges g)\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u, v) \<in> (edges g)\<^sup>*
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Undirected_Graph.connected g
u \<in> nodes g
v \<in> nodes g

goal (1 subgoal):
 1. (u, v) \<in> (edges g)\<^sup>*
[PROOF STEP]
unfolding connected_def
[PROOF STATE]
proof (prove)
using this:
nodes g \<times> nodes g \<subseteq> (edges g)\<^sup>*
u \<in> nodes g
v \<in> nodes g

goal (1 subgoal):
 1. (u, v) \<in> (edges g)\<^sup>*
[PROOF STEP]
by auto


[STATEMENT]
lemma length_Suc_rev_conv: "length xs = Suc n \<longleftrightarrow> (\<exists>ys y. xs=ys@[y] \<and> length ys = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = Suc n) = (\<exists>ys y. xs = ys @ [y] \<and> length ys = n)
[PROOF STEP]
by (cases xs rule: rev_cases) auto


[STATEMENT]
lemma dot_hv [simp]: "Hv u \<bullet> Hv v = u \<bullet> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hv u \<bullet> Hv v = u \<bullet> v
[PROOF STEP]
by (simp add: Hv_def inner_octo_def inner_vec_def sum_7)


[STATEMENT]
lemma dot_hv [simp]: "Hv u \<bullet> Hv v = u \<bullet> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hv u \<bullet> Hv v = u \<bullet> v
[PROOF STEP]
by (simp add: Hv_def inner_quat_def inner_vec_def sum_3)


[STATEMENT]
lemma alt_group_mult: "mult (alt_group n) = (\<circ>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<otimes>\<^bsub>alt_group n\<^esub>) = (\<circ>)
[PROOF STEP]
unfolding alt_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<otimes>\<^bsub>sym_group n\<lparr>carrier := {p. p permutes {1..n} \<and> evenperm p}\<rparr>\<^esub>) = (\<circ>)
[PROOF STEP]
using sym_group_mult
[PROOF STATE]
proof (prove)
using this:
(\<otimes>\<^bsub>sym_group ?n\<^esub>) = (\<circ>)

goal (1 subgoal):
 1. (\<otimes>\<^bsub>sym_group n\<lparr>carrier := {p. p permutes {1..n} \<and> evenperm p}\<rparr>\<^esub>) = (\<circ>)
[PROOF STEP]
by simp


[STATEMENT]
lemma smult_monom [simp]:
  fixes c :: "_ :: mult_zero"
  shows "smult c (monom x c') = monom x (c * c')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult c (monom x c') = monom x (c * c')
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma iT_Plus_Div_distrib_mod_less: "
  \<forall>x\<in>I. x mod m + n mod m < m \<Longrightarrow> I \<oplus> n \<oslash> m = I \<oslash> m \<oplus> n div m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>I. x mod m + n mod m < m \<Longrightarrow> I \<oplus> n \<oslash> m = I \<oslash> m \<oplus> n div m
[PROOF STEP]
by (simp add: set_eq_iff iT_Div_def iT_Plus_def image_image image_iff div_add1_eq1)


[STATEMENT]
lemma eval_map : "(\<exists>l\<in>set(map f L). evalUni l x) = (\<exists>l\<in>set(L). evalUni (f l) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>l\<in>set (map f L). evalUni l x) = (\<exists>l\<in>set L. evalUni (f l) x)
[PROOF STEP]
by auto


[STATEMENT]
lemma contour_integral_diff:
    "f1 contour_integrable_on g \<Longrightarrow> f2 contour_integrable_on g \<Longrightarrow> contour_integral g (\<lambda>x. f1 x - f2 x) =
                contour_integral g f1 - contour_integral g f2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f1 contour_integrable_on g; f2 contour_integrable_on g\<rbrakk> \<Longrightarrow> contour_integral g (\<lambda>x. f1 x - f2 x) = contour_integral g f1 - contour_integral g f2
[PROOF STEP]
by (simp add: contour_integral_unique has_contour_integral_integral has_contour_integral_diff)


[STATEMENT]
lemma sum_mset_mono:
  assumes "\<And>x. x \<in># A \<Longrightarrow> f x \<le> (g x :: 'a :: {ordered_ab_semigroup_add,comm_monoid_add})"
  shows   "(\<Sum>x\<in>#A. f x) \<le> (\<Sum>x\<in>#A. g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f A) \<le> \<Sum>\<^sub># (image_mset g A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in># A \<Longrightarrow> f ?x \<le> g ?x

goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f A) \<le> \<Sum>\<^sub># (image_mset g A)
[PROOF STEP]
by (induction A) (auto intro!: add_mono)


[STATEMENT]
lemma closed_hyperplane: "closed {x. inner a x = b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. a \<bullet> x = b}
[PROOF STEP]
by (simp add: closed_Collect_eq continuous_on_inner)


[STATEMENT]
lemma getParts_disjoint_list: "disjoint_list (map wordinterval_to_set (getParts rs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint_list (map wordinterval_to_set (getParts rs))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. disjoint_list (map wordinterval_to_set (getParts rs))
[PROOF STEP]
have disjoint_list_partitioningIps:
    "{} \<notin> set (map wordinterval_to_set ts) \<Longrightarrow> disjoint_list (map wordinterval_to_set ts) \<Longrightarrow>
     (wordinterval_list_to_set ss) \<subseteq> (wordinterval_list_to_set ts) \<Longrightarrow>
     disjoint_list (map wordinterval_to_set (partitioningIps ss ts))"
     for ts::"'a::len wordinterval list" and ss
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{} \<notin> set (map wordinterval_to_set ts); disjoint_list (map wordinterval_to_set ts); wordinterval_list_to_set ss \<subseteq> wordinterval_list_to_set ts\<rbrakk> \<Longrightarrow> disjoint_list (map wordinterval_to_set (partitioningIps ss ts))
[PROOF STEP]
by (simp add: partitioning1_disjoint_list partitioningIps_equi wordinterval_list_to_set_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>{} \<notin> set (map wordinterval_to_set ?ts); disjoint_list (map wordinterval_to_set ?ts); wordinterval_list_to_set ?ss \<subseteq> wordinterval_list_to_set ?ts\<rbrakk> \<Longrightarrow> disjoint_list (map wordinterval_to_set (partitioningIps ?ss ?ts))

goal (1 subgoal):
 1. disjoint_list (map wordinterval_to_set (getParts rs))
[PROOF STEP]
have "{} \<notin> set (map wordinterval_to_set [wordinterval_UNIV])"
  and "disjoint_list (map wordinterval_to_set [wordinterval_UNIV])"
  and "wordinterval_list_to_set (extract_IPSets rs) \<subseteq> wordinterval_list_to_set [wordinterval_UNIV]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} \<notin> set (map wordinterval_to_set [wordinterval_UNIV]) &&& disjoint_list (map wordinterval_to_set [wordinterval_UNIV]) &&& wordinterval_list_to_set (extract_IPSets rs) \<subseteq> wordinterval_list_to_set [wordinterval_UNIV]
[PROOF STEP]
by(simp add: wordinterval_list_to_set_def disjoint_list_def disjoint_def)+
[PROOF STATE]
proof (state)
this:
{} \<notin> set (map wordinterval_to_set [wordinterval_UNIV])
disjoint_list (map wordinterval_to_set [wordinterval_UNIV])
wordinterval_list_to_set (extract_IPSets rs) \<subseteq> wordinterval_list_to_set [wordinterval_UNIV]

goal (1 subgoal):
 1. disjoint_list (map wordinterval_to_set (getParts rs))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{} \<notin> set (map wordinterval_to_set [wordinterval_UNIV])
disjoint_list (map wordinterval_to_set [wordinterval_UNIV])
wordinterval_list_to_set (extract_IPSets rs) \<subseteq> wordinterval_list_to_set [wordinterval_UNIV]

goal (1 subgoal):
 1. disjoint_list (map wordinterval_to_set (getParts rs))
[PROOF STEP]
unfolding getParts_def
[PROOF STATE]
proof (prove)
using this:
{} \<notin> set (map wordinterval_to_set [wordinterval_UNIV])
disjoint_list (map wordinterval_to_set [wordinterval_UNIV])
wordinterval_list_to_set (extract_IPSets rs) \<subseteq> wordinterval_list_to_set [wordinterval_UNIV]

goal (1 subgoal):
 1. disjoint_list (map wordinterval_to_set (partitioningIps (extract_IPSets rs) [wordinterval_UNIV]))
[PROOF STEP]
by(rule disjoint_list_partitioningIps)
[PROOF STATE]
proof (state)
this:
disjoint_list (map wordinterval_to_set (getParts rs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_wordinterval_to_set_distinct:
  assumes distinct: "distinct xs"
  and disjoint: "(\<forall>x1 \<in> set xs. \<forall>x2 \<in> set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<inter> wordinterval_to_set x2 = {})"
  and notempty: "\<forall>x \<in> set xs. \<not> wordinterval_empty x"
  shows "distinct (map wordinterval_to_set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map wordinterval_to_set xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct (map wordinterval_to_set xs)
[PROOF STEP]
have "\<not> wordinterval_empty x1 \<Longrightarrow>
        wordinterval_to_set x1 \<inter> wordinterval_to_set x2 = {} \<Longrightarrow>
        wordinterval_to_set x1 \<noteq> wordinterval_to_set x2" for x1::"('b::len) wordinterval" and x2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> wordinterval_empty x1; wordinterval_to_set x1 \<inter> wordinterval_to_set x2 = {}\<rbrakk> \<Longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> wordinterval_empty ?x1.1; wordinterval_to_set ?x1.1 \<inter> wordinterval_to_set ?x2.1 = {}\<rbrakk> \<Longrightarrow> wordinterval_to_set ?x1.1 \<noteq> wordinterval_to_set ?x2.1

goal (1 subgoal):
 1. distinct (map wordinterval_to_set xs)
[PROOF STEP]
with disjoint notempty
[PROOF STATE]
proof (chain)
picking this:
\<forall>x1\<in>set xs. \<forall>x2\<in>set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<inter> wordinterval_to_set x2 = {}
\<forall>x\<in>set xs. \<not> wordinterval_empty x
\<lbrakk>\<not> wordinterval_empty ?x1.1; wordinterval_to_set ?x1.1 \<inter> wordinterval_to_set ?x2.1 = {}\<rbrakk> \<Longrightarrow> wordinterval_to_set ?x1.1 \<noteq> wordinterval_to_set ?x2.1
[PROOF STEP]
have "(\<forall>x1 \<in> set xs. \<forall>x2 \<in> set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x1\<in>set xs. \<forall>x2\<in>set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<inter> wordinterval_to_set x2 = {}
\<forall>x\<in>set xs. \<not> wordinterval_empty x
\<lbrakk>\<not> wordinterval_empty ?x1.1; wordinterval_to_set ?x1.1 \<inter> wordinterval_to_set ?x2.1 = {}\<rbrakk> \<Longrightarrow> wordinterval_to_set ?x1.1 \<noteq> wordinterval_to_set ?x2.1

goal (1 subgoal):
 1. \<forall>x1\<in>set xs. \<forall>x2\<in>set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>x1\<in>set xs. \<forall>x2\<in>set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2

goal (1 subgoal):
 1. distinct (map wordinterval_to_set xs)
[PROOF STEP]
with distinct
[PROOF STATE]
proof (chain)
picking this:
distinct xs
\<forall>x1\<in>set xs. \<forall>x2\<in>set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2
[PROOF STEP]
show "distinct (map wordinterval_to_set xs)"
[PROOF STATE]
proof (prove)
using this:
distinct xs
\<forall>x1\<in>set xs. \<forall>x2\<in>set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2

goal (1 subgoal):
 1. distinct (map wordinterval_to_set xs)
[PROOF STEP]
proof(induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>distinct []; \<forall>x1\<in>set []. \<forall>x2\<in>set []. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set [])
 2. \<And>a xs. \<lbrakk>\<lbrakk>distinct xs; \<forall>x1\<in>set xs. \<forall>x2\<in>set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set xs); distinct (a # xs); \<forall>x1\<in>set (a # xs). \<forall>x2\<in>set (a # xs). x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set (a # xs))
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
\<lbrakk>distinct xs_; \<forall>x1\<in>set xs_. \<forall>x2\<in>set xs_. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set xs_)
distinct (a_ # xs_)
\<forall>x1\<in>set (a_ # xs_). \<forall>x2\<in>set (a_ # xs_). x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2

goal (2 subgoals):
 1. \<lbrakk>distinct []; \<forall>x1\<in>set []. \<forall>x2\<in>set []. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set [])
 2. \<And>a xs. \<lbrakk>\<lbrakk>distinct xs; \<forall>x1\<in>set xs. \<forall>x2\<in>set xs. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set xs); distinct (a # xs); \<forall>x1\<in>set (a # xs). \<forall>x2\<in>set (a # xs). x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distinct xs_; \<forall>x1\<in>set xs_. \<forall>x2\<in>set xs_. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set xs_)
distinct (a_ # xs_)
\<forall>x1\<in>set (a_ # xs_). \<forall>x2\<in>set (a_ # xs_). x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2

goal (1 subgoal):
 1. distinct (map wordinterval_to_set (a_ # xs_))
[PROOF STEP]
by simp fast
[PROOF STATE]
proof (state)
this:
distinct (map wordinterval_to_set (a_ # xs_))

goal (1 subgoal):
 1. \<lbrakk>distinct []; \<forall>x1\<in>set []. \<forall>x2\<in>set []. x1 \<noteq> x2 \<longrightarrow> wordinterval_to_set x1 \<noteq> wordinterval_to_set x2\<rbrakk> \<Longrightarrow> distinct (map wordinterval_to_set [])
[PROOF STEP]
qed(simp)
[PROOF STATE]
proof (state)
this:
distinct (map wordinterval_to_set xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ln_eq_zero_iff [simp]: "x \<notin> \<real>\<^sub>\<le>\<^sub>0 \<Longrightarrow> ln x = 0 \<longleftrightarrow> x = 1" for x::complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> \<real>\<^sub>\<le>\<^sub>0 \<Longrightarrow> (ln x = 0) = (x = 1)
[PROOF STEP]
by auto (metis exp_Ln exp_zero nonpos_Reals_zero_I)


[STATEMENT]
lemma amin_mult_pos:"0 < z \<Longrightarrow> amin (z *\<^sub>a x) (z *\<^sub>a y) = z *\<^sub>a amin x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < z \<Longrightarrow> amin (z *\<^sub>a x) (z *\<^sub>a y) = z *\<^sub>a amin x y
[PROOF STEP]
by (simp add:amin_def, simp add:asprod_pos_mono)


[STATEMENT]
lemma qf3_cube_primelist_impl_cube_form: "\<lbrakk> (\<forall>p\<in>set_mset ps. prime p); odd (int (\<Prod>i\<in>#ps. i)) \<rbrakk> \<Longrightarrow>
  (!! a b. coprime a b \<Longrightarrow> a^2 + 3*b^2 = (int(\<Prod>i\<in>#ps. i))^3 \<Longrightarrow> is_cube_form a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>p\<in>#ps. prime p; odd (int (\<Prod>i\<in>#ps. i))\<rbrakk> \<Longrightarrow> (\<And>a b. \<lbrakk>coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b)
[PROOF STEP]
proof (induct ps)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Multiset.Ball {#} prime; odd (int (\<Prod>i\<in>#{#}. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
 2. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>#{#}. prime a
odd (int (\<Prod>i\<in>#{#}. i))
coprime a b
a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Multiset.Ball {#} prime; odd (int (\<Prod>i\<in>#{#}. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
 2. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
hence ab1: "a^2 + 3*b^2 = 1"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>#{#}. prime a
odd (int (\<Prod>i\<in>#{#}. i))
coprime a b
a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3

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

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Multiset.Ball {#} prime; odd (int (\<Prod>i\<in>#{#}. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
 2. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
have b0: "b=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "b\<noteq>0"
[PROOF STATE]
proof (state)
this:
b \<noteq> 0

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

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

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

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

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
with ab1
[PROOF STATE]
proof (chain)
picking this:
a\<^sup>2 + 3 * b\<^sup>2 = 1
1 < 3 * b\<^sup>2
[PROOF STEP]
have "a^2 < 0"
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 + 3 * b\<^sup>2 = 1
1 < 3 * b\<^sup>2

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

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

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

goal (1 subgoal):
 1. b \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a\<^sup>2 < 0
0 \<le> a\<^sup>2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 < 0
0 \<le> a\<^sup>2

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

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

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Multiset.Ball {#} prime; odd (int (\<Prod>i\<in>#{#}. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
 2. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
with ab1
[PROOF STATE]
proof (chain)
picking this:
a\<^sup>2 + 3 * b\<^sup>2 = 1
b = 0
[PROOF STEP]
have a1: "(a=1 \<or> a=-1)"
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 + 3 * b\<^sup>2 = 1
b = 0

goal (1 subgoal):
 1. a = 1 \<or> a = - 1
[PROOF STEP]
by (auto simp add: power2_eq_square zmult_eq_1_iff)
[PROOF STATE]
proof (state)
this:
a = 1 \<or> a = - 1

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Multiset.Ball {#} prime; odd (int (\<Prod>i\<in>#{#}. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
 2. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 1 \<or> a = - 1
[PROOF STEP]
obtain p and q where "p=a" and "q=(0::int)"
[PROOF STATE]
proof (prove)
using this:
a = 1 \<or> a = - 1

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>p = a; q = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = a
q = 0

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Multiset.Ball {#} prime; odd (int (\<Prod>i\<in>#{#}. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
 2. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
with a1 and b0
[PROOF STATE]
proof (chain)
picking this:
a = 1 \<or> a = - 1
b = 0
p = a
q = 0
[PROOF STEP]
have "a = p^3 - 9*p*q^2 \<and> b = 3*p^2*q - 3*q^3"
[PROOF STATE]
proof (prove)
using this:
a = 1 \<or> a = - 1
b = 0
p = a
q = 0

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

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Multiset.Ball {#} prime; odd (int (\<Prod>i\<in>#{#}. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#{#}. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
 2. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
thus "is_cube_form a b"
[PROOF STATE]
proof (prove)
using this:
a = p ^ 3 - 9 * p * q\<^sup>2 \<and> b = 3 * p\<^sup>2 * q - 3 * q ^ 3

goal (1 subgoal):
 1. is_cube_form a b
[PROOF STEP]
by (auto simp only: is_cube_form_def)
[PROOF STATE]
proof (state)
this:
is_cube_form a b

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
case (add p ps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>a\<in>#ps. prime a; odd (int (\<Prod>i\<in>#ps. i)); coprime ?a ?b; ?a\<^sup>2 + 3 * ?b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form ?a ?b
\<forall>a\<in>#add_mset p ps. prime a
odd (int (\<Prod>i\<in>#add_mset p ps. i))
coprime a b
a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset p ps. i) ^ 3

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
hence ass: "coprime a b \<and> odd (int(\<Prod>i\<in>#ps + {#p#}. i))
    \<and> a^2+3*b^2 = int(\<Prod>i\<in>#ps + {#p#}. i)^3 \<and>  (\<forall>a\<in>set_mset ps. prime a) \<and> prime (int p)"
    and IH: "!! u v. coprime u v \<and> u^2+3*v^2 = int(\<Prod>i\<in>#ps. i)^3
    \<and> odd (int(\<Prod>i\<in>#ps. i)) \<Longrightarrow> is_cube_form u v"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>a\<in>#ps. prime a; odd (int (\<Prod>i\<in>#ps. i)); coprime ?a ?b; ?a\<^sup>2 + 3 * ?b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form ?a ?b
\<forall>a\<in>#add_mset p ps. prime a
odd (int (\<Prod>i\<in>#add_mset p ps. i))
coprime a b
a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset p ps. i) ^ 3

goal (1 subgoal):
 1. coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p) &&& (\<And>u v. coprime u v \<and> u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3 \<and> odd (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> is_cube_form u v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
coprime ?u ?v \<and> ?u\<^sup>2 + 3 * ?v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3 \<and> odd (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> is_cube_form ?u ?v

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
coprime ?u ?v \<and> ?u\<^sup>2 + 3 * ?v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3 \<and> odd (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> is_cube_form ?u ?v
[PROOF STEP]
have "coprime a b"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
coprime ?u ?v \<and> ?u\<^sup>2 + 3 * ?v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3 \<and> odd (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> is_cube_form ?u ?v

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

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
let ?w = "int (\<Prod>i\<in>#ps + {#p#}. i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
let ?X = "int (\<Prod>i\<in>#ps. i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
let ?p = "int p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
have ge3_1: "(3::int) \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> 3

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
have pw: "?w = ?p * ?X \<and> odd ?p \<and> odd ?X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
[PROOF STEP]
proof (safe)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i)
 2. even (int p) \<Longrightarrow> False
 3. even (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> False
[PROOF STEP]
have "(\<Prod>i\<in>#ps + {#p#}. i) = p * (\<Prod>i\<in>#ps. i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>#ps + {#p#}. i) = p * (\<Prod>i\<in>#ps. i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>#ps + {#p#}. i) = p * (\<Prod>i\<in>#ps. i)

goal (3 subgoals):
 1. int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i)
 2. even (int p) \<Longrightarrow> False
 3. even (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> False
[PROOF STEP]
thus wpx: "?w = ?p * ?X"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i\<in>#ps + {#p#}. i) = p * (\<Prod>i\<in>#ps. i)

goal (1 subgoal):
 1. int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i)
[PROOF STEP]
by (auto simp only: of_nat_mult [symmetric])
[PROOF STATE]
proof (state)
this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i)

goal (2 subgoals):
 1. even (int p) \<Longrightarrow> False
 2. even (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> False
[PROOF STEP]
with ass
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i)
[PROOF STEP]
show "even ?p \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i)

goal (1 subgoal):
 1. even (int p) \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even (int p) \<Longrightarrow> False

goal (1 subgoal):
 1. even (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> False
[PROOF STEP]
from wpx
[PROOF STATE]
proof (chain)
picking this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i)
[PROOF STEP]
have "?w = ?X*?p"
[PROOF STATE]
proof (prove)
using this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i)

goal (1 subgoal):
 1. int (\<Prod>i\<in>#ps + {#p#}. i) = int (\<Prod>i\<in>#ps. i) * int p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int (\<Prod>i\<in>#ps. i) * int p

goal (1 subgoal):
 1. even (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> False
[PROOF STEP]
with ass
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int (\<Prod>i\<in>#ps + {#p#}. i) = int (\<Prod>i\<in>#ps. i) * int p
[PROOF STEP]
show "even ?X \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int (\<Prod>i\<in>#ps + {#p#}. i) = int (\<Prod>i\<in>#ps. i) * int p

goal (1 subgoal):
 1. even (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
have "is_qfN ?p 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_qfN (int p) 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_qfN (int p) 3
[PROOF STEP]
from ass
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
[PROOF STEP]
have "a^2+3*b^2 = (?p*?X)^3"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)

goal (1 subgoal):
 1. a\<^sup>2 + 3 * b\<^sup>2 = (int p * int (\<Prod>i\<in>#ps. i)) ^ 3
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
a\<^sup>2 + 3 * b\<^sup>2 = (int p * int (\<Prod>i\<in>#ps. i)) ^ 3

goal (1 subgoal):
 1. is_qfN (int p) 3
[PROOF STEP]
hence "?p dvd a^2+3*b^2"
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 + 3 * b\<^sup>2 = (int p * int (\<Prod>i\<in>#ps. i)) ^ 3

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

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

goal (1 subgoal):
 1. is_qfN (int p) 3
[PROOF STEP]
from ass
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
[PROOF STEP]
have "prime ?p" and "coprime a b"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)

goal (1 subgoal):
 1. prime (int p) &&& coprime a b
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
prime (int p)
coprime a b

goal (1 subgoal):
 1. is_qfN (int p) 3
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prime (int p)
coprime a b

goal (1 subgoal):
 1. is_qfN (int p) 3
[PROOF STEP]
from pw
[PROOF STATE]
proof (chain)
picking this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
[PROOF STEP]
have "odd ?p"
[PROOF STATE]
proof (prove)
using this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))

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

goal (1 subgoal):
 1. is_qfN (int p) 3
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
int p dvd a\<^sup>2 + 3 * b\<^sup>2
prime (int p)
coprime a b
odd (int p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int p dvd a\<^sup>2 + 3 * b\<^sup>2
prime (int p)
coprime a b
odd (int p)

goal (1 subgoal):
 1. is_qfN (int p) 3
[PROOF STEP]
by (simp add: qf3_oddprimedivisor)
[PROOF STATE]
proof (state)
this:
is_qfN (int p) 3

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_qfN (int p) 3

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_qfN (int p) 3
[PROOF STEP]
obtain \<alpha> \<beta> where alphabeta: "?p = \<alpha>^2 + 3*\<beta>^2"
[PROOF STATE]
proof (prove)
using this:
is_qfN (int p) 3

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

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
have "\<alpha> \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<noteq> 0
[PROOF STEP]
proof (rule ccontr, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<alpha> = 0"
[PROOF STATE]
proof (state)
this:
\<alpha> = 0

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
with alphabeta
[PROOF STATE]
proof (chain)
picking this:
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
\<alpha> = 0
[PROOF STEP]
have "3 dvd ?p"
[PROOF STATE]
proof (prove)
using this:
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
\<alpha> = 0

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
with pw
[PROOF STATE]
proof (chain)
picking this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
3 dvd int p
[PROOF STEP]
have w3: "3 dvd ?w"
[PROOF STATE]
proof (prove)
using this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
3 dvd int p

goal (1 subgoal):
 1. 3 dvd int (\<Prod>i\<in>#ps + {#p#}. i)
[PROOF STEP]
by (simp only: dvd_mult2)
[PROOF STATE]
proof (state)
this:
3 dvd int (\<Prod>i\<in>#ps + {#p#}. i)

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 dvd int (\<Prod>i\<in>#ps + {#p#}. i)
[PROOF STEP]
obtain v where "?w = 3*v"
[PROOF STATE]
proof (prove)
using this:
3 dvd int (\<Prod>i\<in>#ps + {#p#}. i)

goal (1 subgoal):
 1. (\<And>v. int (\<Prod>i\<in>#ps + {#p#}. i) = 3 * v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: dvd_def)
[PROOF STATE]
proof (state)
this:
int (\<Prod>i\<in>#ps + {#p#}. i) = 3 * v

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
with ass
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int (\<Prod>i\<in>#ps + {#p#}. i) = 3 * v
[PROOF STEP]
have vab: "27*v^3 = a^2 + 3*b^2"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int (\<Prod>i\<in>#ps + {#p#}. i) = 3 * v

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
hence "a^2 = 3*(9*v^3 - b^2)"
[PROOF STATE]
proof (prove)
using this:
27 * v ^ 3 = a\<^sup>2 + 3 * b\<^sup>2

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
hence "3 dvd a^2"
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 = 3 * (9 * v ^ 3 - b\<^sup>2)

goal (1 subgoal):
 1. 3 dvd a\<^sup>2
[PROOF STEP]
by (unfold dvd_def, blast)
[PROOF STATE]
proof (state)
this:
3 dvd a\<^sup>2

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
3 dvd a\<^sup>2

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
3 dvd a\<^sup>2
prime 3
[PROOF STEP]
have a3: "3 dvd a"
[PROOF STATE]
proof (prove)
using this:
3 dvd a\<^sup>2
prime 3

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

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 dvd a
[PROOF STEP]
obtain c where c: "a = 3*c"
[PROOF STATE]
proof (prove)
using this:
3 dvd a

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
with vab
[PROOF STATE]
proof (chain)
picking this:
27 * v ^ 3 = a\<^sup>2 + 3 * b\<^sup>2
a = 3 * c
[PROOF STEP]
have "27*v^3 = 9*c^2 + 3*b^2"
[PROOF STATE]
proof (prove)
using this:
27 * v ^ 3 = a\<^sup>2 + 3 * b\<^sup>2
a = 3 * c

goal (1 subgoal):
 1. 27 * v ^ 3 = 9 * c\<^sup>2 + 3 * b\<^sup>2
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
27 * v ^ 3 = 9 * c\<^sup>2 + 3 * b\<^sup>2

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
hence "b^2 = 3*(3*v^3 - c^2)"
[PROOF STATE]
proof (prove)
using this:
27 * v ^ 3 = 9 * c\<^sup>2 + 3 * b\<^sup>2

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
hence "3 dvd b^2"
[PROOF STATE]
proof (prove)
using this:
b\<^sup>2 = 3 * (3 * v ^ 3 - c\<^sup>2)

goal (1 subgoal):
 1. 3 dvd b\<^sup>2
[PROOF STEP]
by (unfold dvd_def, blast)
[PROOF STATE]
proof (state)
this:
3 dvd b\<^sup>2

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
3 dvd b\<^sup>2

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
3 dvd b\<^sup>2
prime 3
[PROOF STEP]
have "3 dvd b"
[PROOF STATE]
proof (prove)
using this:
3 dvd b\<^sup>2
prime 3

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

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
with a3
[PROOF STATE]
proof (chain)
picking this:
3 dvd a
3 dvd b
[PROOF STEP]
have "3 dvd gcd a b"
[PROOF STATE]
proof (prove)
using this:
3 dvd a
3 dvd b

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

goal (1 subgoal):
 1. \<alpha> = 0 \<Longrightarrow> False
[PROOF STEP]
with ass
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
3 dvd gcd a b
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
3 dvd gcd a b

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:
\<alpha> \<noteq> 0

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<alpha> \<noteq> 0

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
from alphabeta pw ass
[PROOF STATE]
proof (chain)
picking this:
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
[PROOF STEP]
have
    "prime (\<alpha>^2 + 3*\<beta>^2) \<and> odd (\<alpha>^2+3*\<beta>^2) \<and> (3::int) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)

goal (1 subgoal):
 1. prime (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) \<and> odd (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) \<and> 1 \<le> 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) \<and> odd (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) \<and> 1 \<le> 3

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<alpha> \<noteq> 0
prime (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) \<and> odd (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) \<and> 1 \<le> 3
[PROOF STEP]
obtain c d where cdp:
    "(\<alpha>^2+3*\<beta>^2)^3 = c^2+3*d^2 \<and> coprime c (3*d)"
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<noteq> 0
prime (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) \<and> odd (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) \<and> 1 \<le> 3

goal (1 subgoal):
 1. (\<And>c d. (\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) ^ 3 = c\<^sup>2 + 3 * d\<^sup>2 \<and> coprime c (3 * d) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast dest: qfN_oddprime_cube)
[PROOF STATE]
proof (state)
this:
(\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) ^ 3 = c\<^sup>2 + 3 * d\<^sup>2 \<and> coprime c (3 * d)

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
with ass pw alphabeta
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
(\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) ^ 3 = c\<^sup>2 + 3 * d\<^sup>2 \<and> coprime c (3 * d)
[PROOF STEP]
have "\<exists> u v. a^2+3*b^2 = (u^2 + 3*v^2)*(c^2+3*d^2)
    \<and> coprime u v \<and> (\<exists> e. a = c*u+e*3*d*v \<and> b = c*v-e*d*u \<and> \<bar>e\<bar> = 1)"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
(\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) ^ 3 = c\<^sup>2 + 3 * d\<^sup>2 \<and> coprime c (3 * d)

goal (1 subgoal):
 1. \<exists>u v. a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> (\<exists>e. a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1)
[PROOF STEP]
by (rule_tac A="?w" and n="3" in qfN_power_div_prime, auto)
[PROOF STATE]
proof (state)
this:
\<exists>u v. a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> (\<exists>e. a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1)

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>u v. a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> (\<exists>e. a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1)
[PROOF STEP]
obtain u v e where uve: "a^2+3*b^2 = (u^2+3*v^2)*(c^2+3*d^2)
    \<and> coprime u v \<and> a = c*u+e*3*d*v \<and> b = c*v-e*d*u \<and> \<bar>e\<bar> = 1"
[PROOF STATE]
proof (prove)
using this:
\<exists>u v. a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> (\<exists>e. a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1)

goal (1 subgoal):
 1. (\<And>u v e. a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
have "is_cube_form u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_cube_form u v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_cube_form u v
[PROOF STEP]
have uvX: "u^2+3*v^2 = ?X^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
from ass
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
[PROOF STEP]
have p0: "?p \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)

goal (1 subgoal):
 1. int p \<noteq> 0
[PROOF STEP]
by (simp add: prime_int_iff)
[PROOF STATE]
proof (state)
this:
int p \<noteq> 0

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
from pw
[PROOF STATE]
proof (chain)
picking this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
[PROOF STEP]
have "?p^3*?X^3 = ?w^3"
[PROOF STATE]
proof (prove)
using this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))

goal (1 subgoal):
 1. int p ^ 3 * int (\<Prod>i\<in>#ps. i) ^ 3 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
int p ^ 3 * int (\<Prod>i\<in>#ps. i) ^ 3 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int p ^ 3 * int (\<Prod>i\<in>#ps. i) ^ 3 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
with ass
[PROOF STATE]
proof (chain)
picking this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int p ^ 3 * int (\<Prod>i\<in>#ps. i) ^ 3 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3
[PROOF STEP]
have "\<dots> = a^2+3*b^2"
[PROOF STATE]
proof (prove)
using this:
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int p ^ 3 * int (\<Prod>i\<in>#ps. i) ^ 3 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3

goal (1 subgoal):
 1. int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 = a\<^sup>2 + 3 * b\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 = a\<^sup>2 + 3 * b\<^sup>2

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 = a\<^sup>2 + 3 * b\<^sup>2

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
with uve
[PROOF STATE]
proof (chain)
picking this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1
int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 = a\<^sup>2 + 3 * b\<^sup>2
[PROOF STEP]
have "\<dots> = (u^2+3*v^2)*(c^2+3*d^2)"
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1
int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 = a\<^sup>2 + 3 * b\<^sup>2

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

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2)

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
with cdp alphabeta
[PROOF STATE]
proof (chain)
picking this:
(\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) ^ 3 = c\<^sup>2 + 3 * d\<^sup>2 \<and> coprime c (3 * d)
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2)
[PROOF STEP]
have "\<dots> = ?p^3 * (u^2+3*v^2)"
[PROOF STATE]
proof (prove)
using this:
(\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) ^ 3 = c\<^sup>2 + 3 * d\<^sup>2 \<and> coprime c (3 * d)
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2)

goal (1 subgoal):
 1. (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) = int p ^ 3 * (u\<^sup>2 + 3 * v\<^sup>2)
[PROOF STEP]
by (simp only: ac_simps)
[PROOF STATE]
proof (state)
this:
(u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) = int p ^ 3 * (u\<^sup>2 + 3 * v\<^sup>2)

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
int p ^ 3 * int (\<Prod>i\<in>#ps. i) ^ 3 = int p ^ 3 * (u\<^sup>2 + 3 * v\<^sup>2)
[PROOF STEP]
have "?p^3*(u^2+3*v^2-?X^3) = 0"
[PROOF STATE]
proof (prove)
using this:
int p ^ 3 * int (\<Prod>i\<in>#ps. i) ^ 3 = int p ^ 3 * (u\<^sup>2 + 3 * v\<^sup>2)

goal (1 subgoal):
 1. int p ^ 3 * (u\<^sup>2 + 3 * v\<^sup>2 - int (\<Prod>i\<in>#ps. i) ^ 3) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int p ^ 3 * (u\<^sup>2 + 3 * v\<^sup>2 - int (\<Prod>i\<in>#ps. i) ^ 3) = 0

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
with p0
[PROOF STATE]
proof (chain)
picking this:
int p \<noteq> 0
int p ^ 3 * (u\<^sup>2 + 3 * v\<^sup>2 - int (\<Prod>i\<in>#ps. i) ^ 3) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int p \<noteq> 0
int p ^ 3 * (u\<^sup>2 + 3 * v\<^sup>2 - int (\<Prod>i\<in>#ps. i) ^ 3) = 0

goal (1 subgoal):
 1. u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3

goal (1 subgoal):
 1. is_cube_form u v
[PROOF STEP]
with pw IH uve
[PROOF STATE]
proof (chain)
picking this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
coprime ?u ?v \<and> ?u\<^sup>2 + 3 * ?v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3 \<and> odd (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> is_cube_form ?u ?v
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1
u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
coprime ?u ?v \<and> ?u\<^sup>2 + 3 * ?v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3 \<and> odd (int (\<Prod>i\<in>#ps. i)) \<Longrightarrow> is_cube_form ?u ?v
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1
u\<^sup>2 + 3 * v\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3

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

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

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_cube_form u v

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
have "is_cube_form c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_cube_form c d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_cube_form c d
[PROOF STEP]
have "coprime c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime c d
[PROOF STEP]
proof (rule coprimeI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ca. \<lbrakk>ca dvd c; ca dvd d\<rbrakk> \<Longrightarrow> is_unit ca
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ca. \<lbrakk>ca dvd c; ca dvd d\<rbrakk> \<Longrightarrow> is_unit ca
[PROOF STEP]
assume "f dvd c" and "f dvd d"
[PROOF STATE]
proof (state)
this:
f dvd c
f dvd d

goal (1 subgoal):
 1. \<And>ca. \<lbrakk>ca dvd c; ca dvd d\<rbrakk> \<Longrightarrow> is_unit ca
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f dvd c
f dvd d
[PROOF STEP]
have "f dvd c*u + d*(e*3*v) \<and> f dvd c*v-d*(e*u)"
[PROOF STATE]
proof (prove)
using this:
f dvd c
f dvd d

goal (1 subgoal):
 1. f dvd c * u + d * (e * 3 * v) \<and> f dvd c * v - d * (e * u)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f dvd c * u + d * (e * 3 * v) \<and> f dvd c * v - d * (e * u)

goal (1 subgoal):
 1. \<And>ca. \<lbrakk>ca dvd c; ca dvd d\<rbrakk> \<Longrightarrow> is_unit ca
[PROOF STEP]
with uve
[PROOF STATE]
proof (chain)
picking this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1
f dvd c * u + d * (e * 3 * v) \<and> f dvd c * v - d * (e * u)
[PROOF STEP]
have "f dvd a" and "f dvd b"
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1
f dvd c * u + d * (e * 3 * v) \<and> f dvd c * v - d * (e * u)

goal (1 subgoal):
 1. f dvd a &&& f dvd b
[PROOF STEP]
by (auto simp only: ac_simps)
[PROOF STATE]
proof (state)
this:
f dvd a
f dvd b

goal (1 subgoal):
 1. \<And>ca. \<lbrakk>ca dvd c; ca dvd d\<rbrakk> \<Longrightarrow> is_unit ca
[PROOF STEP]
with \<open>coprime a b\<close>
[PROOF STATE]
proof (chain)
picking this:
coprime a b
f dvd a
f dvd b
[PROOF STEP]
show "is_unit f"
[PROOF STATE]
proof (prove)
using this:
coprime a b
f dvd a
f dvd b

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

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

goal (1 subgoal):
 1. is_cube_form c d
[PROOF STEP]
with pw cdp ass alphabeta
[PROOF STATE]
proof (chain)
picking this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
(\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) ^ 3 = c\<^sup>2 + 3 * d\<^sup>2 \<and> coprime c (3 * d)
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
coprime c d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (\<Prod>i\<in>#ps + {#p#}. i) = int p * int (\<Prod>i\<in>#ps. i) \<and> odd (int p) \<and> odd (int (\<Prod>i\<in>#ps. i))
(\<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2) ^ 3 = c\<^sup>2 + 3 * d\<^sup>2 \<and> coprime c (3 * d)
coprime a b \<and> odd (int (\<Prod>i\<in>#ps + {#p#}. i)) \<and> a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps + {#p#}. i) ^ 3 \<and> (\<forall>a\<in>#ps. prime a) \<and> prime (int p)
int p = \<alpha>\<^sup>2 + 3 * \<beta>\<^sup>2
coprime c d

goal (1 subgoal):
 1. is_cube_form c d
[PROOF STEP]
by (rule_tac P="?p" in qf3_cube_prime_impl_cube_form, auto)
[PROOF STATE]
proof (state)
this:
is_cube_form c d

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

goal (1 subgoal):
 1. \<And>x ps a b. \<lbrakk>\<And>a b. \<lbrakk>Multiset.Ball ps prime; odd (int (\<Prod>i\<in>#ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b; Multiset.Ball (add_mset x ps) prime; odd (int (\<Prod>i\<in>#add_mset x ps. i)); coprime a b; a\<^sup>2 + 3 * b\<^sup>2 = int (\<Prod>i\<in>#add_mset x ps. i) ^ 3\<rbrakk> \<Longrightarrow> is_cube_form a b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1
is_cube_form u v
is_cube_form c d
[PROOF STEP]
show "is_cube_form a b"
[PROOF STATE]
proof (prove)
using this:
a\<^sup>2 + 3 * b\<^sup>2 = (u\<^sup>2 + 3 * v\<^sup>2) * (c\<^sup>2 + 3 * d\<^sup>2) \<and> coprime u v \<and> a = c * u + e * 3 * d * v \<and> b = c * v - e * d * u \<and> \<bar>e\<bar> = 1
is_cube_form u v
is_cube_form c d

goal (1 subgoal):
 1. is_cube_form a b
[PROOF STEP]
by (simp only: cube_form_mult)
[PROOF STATE]
proof (state)
this:
is_cube_form a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<turnstile>\<^sub>t
{\<lambda>l s. l ''x'' = nat(s ''x'')}
 WHILE Less (N 0) (V ''x'') DO ''x'' ::= Plus (V ''x'') (N (-1))
{\<lambda>l s. s ''x'' \<le> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile>\<^sub>t {\<lambda>l s. l ''x'' = nat (s ''x'')} WHILE Less (N 0) (V ''x'') DO ''x'' ::= Plus (V ''x'') (N (- 1)) {\<lambda>l s. s ''x'' \<le> 0}
[PROOF STEP]
apply(rule conseq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>l s. l ''x'' = nat (s ''x'') \<longrightarrow> ?P l s
 2. \<turnstile>\<^sub>t {?P} WHILE Less (N 0) (V ''x'') DO ''x'' ::= Plus (V ''x'') (N (- 1)) {?Q}
 3. \<forall>l s. ?Q l s \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<turnstile>\<^sub>t {?P} WHILE Less (N 0) (V ''x'') DO ''x'' ::= Plus (V ''x'') (N (- 1)) {?Q}
 2. \<forall>l s. l ''x'' = nat (s ''x'') \<longrightarrow> ?P l s
 3. \<forall>l s. ?Q l s \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
apply(rule While[where P = "\<lambda>l s. l ''x'' = nat(s ''x'')" and x = "''x''"])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<turnstile>\<^sub>t {\<lambda>l s. (l(''x'' := Suc (l ''x''))) ''x'' = nat (s ''x'')} ''x'' ::= Plus (V ''x'') (N (- 1)) {\<lambda>l s. l ''x'' = nat (s ''x'')}
 2. \<forall>l s. 0 < l ''x'' \<and> l ''x'' = nat (s ''x'') \<longrightarrow> bval (Less (N 0) (V ''x'')) s
 3. \<forall>l s. l ''x'' = 0 \<and> l ''x'' = nat (s ''x'') \<longrightarrow> \<not> bval (Less (N 0) (V ''x'')) s
 4. \<forall>l s. l ''x'' = nat (s ''x'') \<longrightarrow> (\<exists>n. (l(''x'' := n)) ''x'' = nat (s ''x''))
 5. \<forall>l s. (l(''x'' := 0)) ''x'' = nat (s ''x'') \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
apply(rule Assign')
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<forall>l s. (l(''x'' := Suc (l ''x''))) ''x'' = nat (s ''x'') \<longrightarrow> l ''x'' = nat ((s[Plus (V ''x'') (N (- 1))/''x'']) ''x'')
 2. \<forall>l s. 0 < l ''x'' \<and> l ''x'' = nat (s ''x'') \<longrightarrow> bval (Less (N 0) (V ''x'')) s
 3. \<forall>l s. l ''x'' = 0 \<and> l ''x'' = nat (s ''x'') \<longrightarrow> \<not> bval (Less (N 0) (V ''x'')) s
 4. \<forall>l s. l ''x'' = nat (s ''x'') \<longrightarrow> (\<exists>n. (l(''x'' := n)) ''x'' = nat (s ''x''))
 5. \<forall>l s. (l(''x'' := 0)) ''x'' = nat (s ''x'') \<longrightarrow> s ''x'' \<le> 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Increasing_union:
    "[| F \<in> Increasing f;  F \<in> Increasing g |]
     ==> F \<in> Increasing (%s. (f s) + (g s :: ('a::order) multiset))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> Increasing f; F \<in> Increasing g\<rbrakk> \<Longrightarrow> F \<in> Increasing (\<lambda>s. f s + g s)
[PROOF STEP]
apply (auto simp add: Increasing_def Stable_def Constrains_def
                      stable_def constrains_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x act xa xb. \<lbrakk>\<forall>x. \<forall>act\<in>Acts F. act `` (reachable F \<inter> {s. x \<le> f s}) \<subseteq> {s. x \<le> f s}; \<forall>x. \<forall>act\<in>Acts F. act `` (reachable F \<inter> {s. x \<le> g s}) \<subseteq> {s. x \<le> g s}; act \<in> Acts F; (xb, xa) \<in> act; xb \<in> reachable F; x \<le> f xb + g xb\<rbrakk> \<Longrightarrow> x \<le> f xa + g xa
[PROOF STEP]
apply (drule_tac x = "f xb" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x act xa xb. \<lbrakk>\<forall>x. \<forall>act\<in>Acts F. act `` (reachable F \<inter> {s. x \<le> g s}) \<subseteq> {s. x \<le> g s}; act \<in> Acts F; (xb, xa) \<in> act; xb \<in> reachable F; x \<le> f xb + g xb; \<forall>act\<in>Acts F. act `` (reachable F \<inter> {s. f xb \<le> f s}) \<subseteq> {s. f xb \<le> f s}\<rbrakk> \<Longrightarrow> x \<le> f xa + g xa
[PROOF STEP]
apply (drule_tac x = "g xb" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x act xa xb. \<lbrakk>act \<in> Acts F; (xb, xa) \<in> act; xb \<in> reachable F; x \<le> f xb + g xb; \<forall>act\<in>Acts F. act `` (reachable F \<inter> {s. f xb \<le> f s}) \<subseteq> {s. f xb \<le> f s}; \<forall>act\<in>Acts F. act `` (reachable F \<inter> {s. g xb \<le> g s}) \<subseteq> {s. g xb \<le> g s}\<rbrakk> \<Longrightarrow> x \<le> f xa + g xa
[PROOF STEP]
apply (drule bspec, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x act xa xb. \<lbrakk>act \<in> Acts F; (xb, xa) \<in> act; xb \<in> reachable F; x \<le> f xb + g xb; \<forall>act\<in>Acts F. act `` (reachable F \<inter> {s. g xb \<le> g s}) \<subseteq> {s. g xb \<le> g s}; act `` (reachable F \<inter> {s. f xb \<le> f s}) \<subseteq> {s. f xb \<le> f s}\<rbrakk> \<Longrightarrow> x \<le> f xa + g xa
[PROOF STEP]
apply (blast intro: add_mono order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "set (n_sequence_enum xs n) = set (List.n_lists n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (n_sequence_enum xs n) = set (List.n_lists n xs)
[PROOF STEP]
by(induct n) auto


[STATEMENT]
lemma sigma_algebra_iff:
  "sigma_algebra \<Omega> M \<longleftrightarrow>
    algebra \<Omega> M \<and> (\<forall>A. range A \<subseteq> M \<longrightarrow> (\<Union>i::nat. A i) \<in> M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra \<Omega> M = (algebra \<Omega> M \<and> (\<forall>A. range A \<subseteq> M \<longrightarrow> \<Union> (range A) \<in> M))
[PROOF STEP]
by (simp add: sigma_algebra_def sigma_algebra_axioms_def)


[STATEMENT]
lemma field_differentiable_transform_within:
  "0 < d \<Longrightarrow>
        x \<in> S \<Longrightarrow>
        (\<And>x'. x' \<in> S \<Longrightarrow> dist x' x < d \<Longrightarrow> f x' = g x') \<Longrightarrow>
        f field_differentiable (at x within S)
        \<Longrightarrow> g field_differentiable (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < d; x \<in> S; \<And>x'. \<lbrakk>x' \<in> S; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'; f field_differentiable at x within S\<rbrakk> \<Longrightarrow> g field_differentiable at x within S
[PROOF STEP]
unfolding field_differentiable_def has_field_derivative_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < d; x \<in> S; \<And>x'. \<lbrakk>x' \<in> S; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'; \<exists>f'. (f has_derivative (*) f') (at x within S)\<rbrakk> \<Longrightarrow> \<exists>f'. (g has_derivative (*) f') (at x within S)
[PROOF STEP]
by (blast intro: has_derivative_transform_within)


[STATEMENT]
lemma (in cring) of_int_power [simp]: "\<guillemotleft>i ^ n\<guillemotright> = \<guillemotleft>i\<guillemotright> [^] n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>i ^ n\<guillemotright> = \<guillemotleft>i\<guillemotright> [^] n
[PROOF STEP]
by (induct n) (simp_all add: m_ac)


[STATEMENT]
lemma complex_cnj_cancel_iff [simp]: "cnj x = cnj y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cnj x = cnj y) = (x = y)
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma correctCompositionIn_prop1:
assumes "subcomponents PQ = {P,Q}"
       and "correctCompositionIn PQ"
       and "x \<in> (ins PQ)"
shows   "(x \<in> (ins P)) \<or> (x \<in> (ins Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> ins P \<or> x \<in> ins Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subcomponents PQ = {P, Q}
correctCompositionIn PQ
x \<in> ins PQ

goal (1 subgoal):
 1. x \<in> ins P \<or> x \<in> ins Q
[PROOF STEP]
by (simp add: correctCompositionIn_def)


[STATEMENT]
lemma two_pi_canonical [simp]:
  shows "\<downharpoonright>2 * pi\<downharpoonleft> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>2 * pi\<downharpoonleft> = 0
[PROOF STEP]
using canon_ang_plus_pi1[of "pi"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < pi; pi \<le> 2 * pi\<rbrakk> \<Longrightarrow> \<downharpoonright>pi + pi\<downharpoonleft> = pi - pi

goal (1 subgoal):
 1. \<downharpoonright>2 * pi\<downharpoonleft> = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma (in semiring_of_sets) generated_ring_Inter:
  assumes "finite A" "A \<noteq> {}" shows "A \<subseteq> generated_ring \<Longrightarrow> \<Inter>A \<in> generated_ring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> generated_ring \<Longrightarrow> \<Inter> A \<in> generated_ring
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
A \<noteq> {}

goal (1 subgoal):
 1. A \<subseteq> generated_ring \<Longrightarrow> \<Inter> A \<in> generated_ring
[PROOF STEP]
by (induct A rule: finite_ne_induct) (auto intro: generated_ring_Int)


[STATEMENT]
lemma minSetOfComponentsTestL2p2:
"minSetOfComponents level2 {data1, data12} = {sS2, sS4, sS5, sS6}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data12} = {sS2, sS4, sS5, sS6}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data12} = {sS2, sS4, sS5, sS6}
[PROOF STEP]
have outL2:"outSetOfComponents level2 {data1, data12} = {sS6}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outSetOfComponents level2 {data1, data12} = {sS6}
[PROOF STEP]
by (simp add: outSetOfComponents_def  AbstrLevel2, auto)
[PROOF STATE]
proof (state)
this:
outSetOfComponents level2 {data1, data12} = {sS6}

goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data12} = {sS2, sS4, sS5, sS6}
[PROOF STEP]
have "Sources level2 sS6 = {sS2, sS4, sS5}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources level2 sS6 = {sS2, sS4, sS5}
[PROOF STEP]
by  (simp add: SourcesS6_L2)
[PROOF STATE]
proof (state)
this:
Sources level2 sS6 = {sS2, sS4, sS5}

goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data12} = {sS2, sS4, sS5, sS6}
[PROOF STEP]
with outL2
[PROOF STATE]
proof (chain)
picking this:
outSetOfComponents level2 {data1, data12} = {sS6}
Sources level2 sS6 = {sS2, sS4, sS5}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
outSetOfComponents level2 {data1, data12} = {sS6}
Sources level2 sS6 = {sS2, sS4, sS5}

goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data12} = {sS2, sS4, sS5, sS6}
[PROOF STEP]
by (simp add:  minSetOfComponents_def)
[PROOF STATE]
proof (state)
this:
minSetOfComponents level2 {data1, data12} = {sS2, sS4, sS5, sS6}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma order_prop: "x \<le> y \<longleftrightarrow> (\<exists>z. x + z = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (\<exists>z. x + z = y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<le> y \<Longrightarrow> \<exists>z. x + z = y
 2. \<exists>z. x + z = y \<Longrightarrow> x \<le> y
[PROOF STEP]
assume "x \<le> y"
[PROOF STATE]
proof (state)
this:
x \<le> y

goal (2 subgoals):
 1. x \<le> y \<Longrightarrow> \<exists>z. x + z = y
 2. \<exists>z. x + z = y \<Longrightarrow> x \<le> y
[PROOF STEP]
hence "x + y = y"
[PROOF STATE]
proof (prove)
using this:
x \<le> y

goal (1 subgoal):
 1. x + y = y
[PROOF STEP]
by (simp add: less_eq_def)
[PROOF STATE]
proof (state)
this:
x + y = y

goal (2 subgoals):
 1. x \<le> y \<Longrightarrow> \<exists>z. x + z = y
 2. \<exists>z. x + z = y \<Longrightarrow> x \<le> y
[PROOF STEP]
thus "\<exists>z. x + z = y"
[PROOF STATE]
proof (prove)
using this:
x + y = y

goal (1 subgoal):
 1. \<exists>z. x + z = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z. x + z = y

goal (1 subgoal):
 1. \<exists>z. x + z = y \<Longrightarrow> x \<le> y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z. x + z = y \<Longrightarrow> x \<le> y
[PROOF STEP]
assume "\<exists>z. x + z = y"
[PROOF STATE]
proof (state)
this:
\<exists>z. x + z = y

goal (1 subgoal):
 1. \<exists>z. x + z = y \<Longrightarrow> x \<le> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. x + z = y
[PROOF STEP]
obtain c where "x + c = y"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. x + z = y

goal (1 subgoal):
 1. (\<And>c. x + c = y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x + c = y

goal (1 subgoal):
 1. \<exists>z. x + z = y \<Longrightarrow> x \<le> y
[PROOF STEP]
hence "x + c \<le> y"
[PROOF STATE]
proof (prove)
using this:
x + c = y

goal (1 subgoal):
 1. x + c \<le> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x + c \<le> y

goal (1 subgoal):
 1. \<exists>z. x + z = y \<Longrightarrow> x \<le> y
[PROOF STEP]
thus "x \<le> y"
[PROOF STATE]
proof (prove)
using this:
x + c \<le> y

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma boundedIncLevel: "bounded (incLevel` A) = (bounded A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (incLevel ` A) = bounded A
[PROOF STEP]
apply (simp add: bounded_def, rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>N. boundedBy N (incLevel ` A) \<Longrightarrow> \<exists>N. boundedBy N A
 2. \<exists>N. boundedBy N A \<Longrightarrow> \<exists>N. boundedBy N (incLevel ` A)
[PROOF STEP]
apply(erule exE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>N. boundedBy N (incLevel ` A) \<Longrightarrow> \<exists>N. boundedBy N A
 2. \<exists>N. boundedBy N A \<Longrightarrow> \<exists>N. boundedBy N (incLevel ` A)
[PROOF STEP]
apply(rule_tac x=N in exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>N. boundedBy N (incLevel ` A) \<Longrightarrow> boundedBy N A
 2. \<exists>N. boundedBy N A \<Longrightarrow> \<exists>N. boundedBy N (incLevel ` A)
[PROOF STEP]
apply (simp add: boundedBy_def incLevel_def, force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. boundedBy N A \<Longrightarrow> \<exists>N. boundedBy N (incLevel ` A)
[PROOF STEP]
apply(erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. boundedBy N A \<Longrightarrow> \<exists>N. boundedBy N (incLevel ` A)
[PROOF STEP]
apply(rule_tac x="Suc N" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. boundedBy N A \<Longrightarrow> boundedBy (Suc N) (incLevel ` A)
[PROOF STEP]
apply (simp add: boundedBy_def incLevel_def, force)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma P_eq_list_filter: "\<forall>x \<in> set xs. P x = Q x \<Longrightarrow> filter P xs = filter Q xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set xs. P x = Q x \<Longrightarrow> filter P xs = filter Q xs
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<in>set []. P x = Q x \<Longrightarrow> filter P [] = filter Q []
 2. \<And>a xs. \<lbrakk>\<forall>x\<in>set xs. P x = Q x \<Longrightarrow> filter P xs = filter Q xs; \<forall>x\<in>set (a # xs). P x = Q x\<rbrakk> \<Longrightarrow> filter P (a # xs) = filter Q (a # xs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma word_size_neg:
  fixes w :: "32 Word.word"
  shows "size (-w) = size w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (- w) = size w
[PROOF STEP]
using Word.word_size[of w] Word.word_size[of "-w"]
[PROOF STATE]
proof (prove)
using this:
size w = LENGTH(32)
size (- w) = LENGTH(32)

goal (1 subgoal):
 1. size (- w) = size w
[PROOF STEP]
by auto


[STATEMENT]
lemma ssubseqs_Cons: "ssubseqs (x#xs) = (Cons x) ` (ssubseqs xs) \<union> ssubseqs xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ssubseqs (x # xs) = (#) x ` ssubseqs xs \<union> ssubseqs xs
[PROOF STEP]
using subseqs_Cons[of x]
[PROOF STATE]
proof (prove)
using this:
subseqs (x # ?xs) = map ((#) x) (subseqs ?xs) @ subseqs ?xs

goal (1 subgoal):
 1. ssubseqs (x # xs) = (#) x ` ssubseqs xs \<union> ssubseqs xs
[PROOF STEP]
by simp