[STATEMENT]
lemma open_segment_eq [simp]:
  fixes a :: "'a::euclidean_space"
  shows "open_segment a b = open_segment c d \<longleftrightarrow> a = b \<and> c = d \<or> {a,b} = {c,d}"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (open_segment a b = open_segment c d) = (a = b \<and> c = d \<or> {a, b} = {c, d})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. open_segment a b = open_segment c d \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
 2. a = b \<and> c = d \<or> {a, b} = {c, d} \<Longrightarrow> open_segment a b = open_segment c d
[PROOF STEP]
assume abcd: ?lhs
[PROOF STATE]
proof (state)
this:
open_segment a b = open_segment c d

goal (2 subgoals):
 1. open_segment a b = open_segment c d \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
 2. a = b \<and> c = d \<or> {a, b} = {c, d} \<Longrightarrow> open_segment a b = open_segment c d
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
proof (cases "a=b \<or> c=d")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = b \<or> c = d \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
 2. \<not> (a = b \<or> c = d) \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = b \<or> c = d

goal (2 subgoals):
 1. a = b \<or> c = d \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
 2. \<not> (a = b \<or> c = d) \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
with abcd
[PROOF STATE]
proof (chain)
picking this:
open_segment a b = open_segment c d
a = b \<or> c = d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
open_segment a b = open_segment c d
a = b \<or> c = d

goal (1 subgoal):
 1. a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
using finite_open_segment
[PROOF STATE]
proof (prove)
using this:
open_segment a b = open_segment c d
a = b \<or> c = d
finite (open_segment ?a ?b) = (?a = ?b)

goal (1 subgoal):
 1. a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
a = b \<and> c = d \<or> {a, b} = {c, d}

goal (1 subgoal):
 1. \<not> (a = b \<or> c = d) \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (a = b \<or> c = d) \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (a = b \<or> c = d)

goal (1 subgoal):
 1. \<not> (a = b \<or> c = d) \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (a = b \<or> c = d)
[PROOF STEP]
have a2: "a \<noteq> b \<and> c \<noteq> d"
[PROOF STATE]
proof (prove)
using this:
\<not> (a = b \<or> c = d)

goal (1 subgoal):
 1. a \<noteq> b \<and> c \<noteq> d
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a \<noteq> b \<and> c \<noteq> d

goal (1 subgoal):
 1. \<not> (a = b \<or> c = d) \<Longrightarrow> a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
with abcd
[PROOF STATE]
proof (chain)
picking this:
open_segment a b = open_segment c d
a \<noteq> b \<and> c \<noteq> d
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
open_segment a b = open_segment c d
a \<noteq> b \<and> c \<noteq> d

goal (1 subgoal):
 1. a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
unfolding open_segment_def
[PROOF STATE]
proof (prove)
using this:
closed_segment a b - {a, b} = closed_segment c d - {c, d}
a \<noteq> b \<and> c \<noteq> d

goal (1 subgoal):
 1. a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
by (metis (no_types) abcd closed_segment_eq closure_open_segment)
[PROOF STATE]
proof (state)
this:
a = b \<and> c = d \<or> {a, b} = {c, d}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a = b \<and> c = d \<or> {a, b} = {c, d}

goal (1 subgoal):
 1. a = b \<and> c = d \<or> {a, b} = {c, d} \<Longrightarrow> open_segment a b = open_segment c d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = b \<and> c = d \<or> {a, b} = {c, d} \<Longrightarrow> open_segment a b = open_segment c d
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
a = b \<and> c = d \<or> {a, b} = {c, d}

goal (1 subgoal):
 1. a = b \<and> c = d \<or> {a, b} = {c, d} \<Longrightarrow> open_segment a b = open_segment c d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b \<and> c = d \<or> {a, b} = {c, d}
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
a = b \<and> c = d \<or> {a, b} = {c, d}

goal (1 subgoal):
 1. open_segment a b = open_segment c d
[PROOF STEP]
by (metis Diff_cancel convex_hull_singleton insert_absorb2 open_segment_def segment_convex_hull)
[PROOF STATE]
proof (state)
this:
open_segment a b = open_segment c d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linear_comp_closed:
  assumes "linear x"
      and "linear y"
    shows "linear (x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (x * y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. linear (x * y)
[PROOF STEP]
have "reflexive y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflexive y
[PROOF STEP]
by (simp add: assms(2) linear_reflexive)
[PROOF STATE]
proof (state)
this:
reflexive y

goal (1 subgoal):
 1. linear (x * y)
[PROOF STEP]
hence "x \<squnion> x\<^sup>T \<le> x * y \<squnion> y\<^sup>T * x\<^sup>T"
[PROOF STATE]
proof (prove)
using this:
reflexive y

goal (1 subgoal):
 1. x \<squnion> x\<^sup>T \<le> x * y \<squnion> y\<^sup>T * x\<^sup>T
[PROOF STEP]
by (metis case_split_left case_split_right le_supI sup.cobounded1 sup.cobounded2 sup.idem reflexive_conv_closed)
[PROOF STATE]
proof (state)
this:
x \<squnion> x\<^sup>T \<le> x * y \<squnion> y\<^sup>T * x\<^sup>T

goal (1 subgoal):
 1. linear (x * y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<squnion> x\<^sup>T \<le> x * y \<squnion> y\<^sup>T * x\<^sup>T

goal (1 subgoal):
 1. linear (x * y)
[PROOF STEP]
by (simp add: assms(1) conv_dist_comp top_le)
[PROOF STATE]
proof (state)
this:
linear (x * y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma combine_after_finite_tree :
  assumes "finite_tree t1"
  and     "finite_tree t2"
shows "finite_tree (combine_after t1 \<alpha> t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_tree (combine_after t1 \<alpha> t2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite_tree (combine_after t1 \<alpha> t2)
[PROOF STEP]
have "finite (Prefix_Tree.set t2)" and "finite (Prefix_Tree.set t1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Prefix_Tree.set t2) &&& finite (Prefix_Tree.set t1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_tree t1
finite_tree t2

goal (1 subgoal):
 1. finite (Prefix_Tree.set t2) &&& finite (Prefix_Tree.set t1)
[PROOF STEP]
unfolding finite_tree_iff
[PROOF STATE]
proof (prove)
using this:
finite (Prefix_Tree.set t1)
finite (Prefix_Tree.set t2)

goal (1 subgoal):
 1. finite (Prefix_Tree.set t2) &&& finite (Prefix_Tree.set t1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (Prefix_Tree.set t2)
finite (Prefix_Tree.set t1)

goal (1 subgoal):
 1. finite_tree (combine_after t1 \<alpha> t2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (Prefix_Tree.set t2)
finite (Prefix_Tree.set t1)
[PROOF STEP]
have "finite (Prefix_Tree.set (Prefix_Tree.insert t1 \<alpha>) \<union> {\<alpha> @ as |as. as \<in> Prefix_Tree.set t2})"
[PROOF STATE]
proof (prove)
using this:
finite (Prefix_Tree.set t2)
finite (Prefix_Tree.set t1)

goal (1 subgoal):
 1. finite (Prefix_Tree.set (Prefix_Tree.insert t1 \<alpha>) \<union> {\<alpha> @ as |as. as \<in> Prefix_Tree.set t2})
[PROOF STEP]
using finite_tree_iff insert_finite_tree
[PROOF STATE]
proof (prove)
using this:
finite (Prefix_Tree.set t2)
finite (Prefix_Tree.set t1)
finite_tree ?t = finite (Prefix_Tree.set ?t)
finite_tree ?t \<Longrightarrow> finite_tree (Prefix_Tree.insert ?t ?xs)

goal (1 subgoal):
 1. finite (Prefix_Tree.set (Prefix_Tree.insert t1 \<alpha>) \<union> {\<alpha> @ as |as. as \<in> Prefix_Tree.set t2})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
finite (Prefix_Tree.set (Prefix_Tree.insert t1 \<alpha>) \<union> {\<alpha> @ as |as. as \<in> Prefix_Tree.set t2})

goal (1 subgoal):
 1. finite_tree (combine_after t1 \<alpha> t2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (Prefix_Tree.set (Prefix_Tree.insert t1 \<alpha>) \<union> {\<alpha> @ as |as. as \<in> Prefix_Tree.set t2})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (Prefix_Tree.set (Prefix_Tree.insert t1 \<alpha>) \<union> {\<alpha> @ as |as. as \<in> Prefix_Tree.set t2})

goal (1 subgoal):
 1. finite_tree (combine_after t1 \<alpha> t2)
[PROOF STEP]
unfolding finite_tree_iff combine_after_set
[PROOF STATE]
proof (prove)
using this:
finite (Prefix_Tree.set (Prefix_Tree.insert t1 \<alpha>) \<union> {\<alpha> @ as |as. as \<in> Prefix_Tree.set t2})

goal (1 subgoal):
 1. finite (Prefix_Tree.set t1 \<union> {xs'. \<exists>xs''. \<alpha> = xs' @ xs''} \<union> {\<alpha> @ xs' |xs'. xs' \<in> Prefix_Tree.set t2})
[PROOF STEP]
by (metis insert_set)
[PROOF STATE]
proof (state)
this:
finite_tree (combine_after t1 \<alpha> t2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zip_map_option2: "zip_option x (map_option g y) = map_option (apsnd g) (zip_option x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip_option x (map_option g y) = map_option (apsnd g) (zip_option x y)
[PROOF STEP]
by(cases "(x, y)" rule: zip_option.cases) simp_all


[STATEMENT]
lemma joinE:
  assumes "(a, b) \<in> A\<^sup>\<down>"
  obtains c where "(a, c) \<in> A\<^sup>*" and "(b, c) \<in> A\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. \<lbrakk>(a, c) \<in> A\<^sup>*; (b, c) \<in> A\<^sup>*\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> A\<^sup>\<down>

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>(a, c) \<in> A\<^sup>*; (b, c) \<in> A\<^sup>*\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: join_def rtrancl_converse)


[STATEMENT]
lemma subset_imp_ds_subset: assumes "trans r" and "S \<subseteq> ds r T" shows "ds r S \<subseteq> ds r T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<down>s S \<subseteq> r \<down>s T
[PROOF STEP]
using assms ds_monotone ds_ds_subseteq_ds
[PROOF STATE]
proof (prove)
using this:
trans r
S \<subseteq> r \<down>s T
?S \<subseteq> ?T \<Longrightarrow> ?r \<down>s ?S \<subseteq> ?r \<down>s ?T
trans ?r \<Longrightarrow> ?r \<down>s (?r \<down>s ?S) \<subseteq> ?r \<down>s ?S

goal (1 subgoal):
 1. r \<down>s S \<subseteq> r \<down>s T
[PROOF STEP]
by blast


[STATEMENT]
lemma unat_of_int_32:
  "\<lbrakk>i \<ge> 0; i \<le>2 ^ 31\<rbrakk> \<Longrightarrow> (unat ((of_int i)::sword32)) = nat i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> i; i \<le> 2 ^ 31\<rbrakk> \<Longrightarrow> unat (word_of_int i) = nat i
[PROOF STEP]
by (simp add: unsigned_of_int nat_take_bit_eq take_bit_nat_eq_self)


[STATEMENT]
lemma symp_llist_all2: "symp R \<Longrightarrow> symp (llist_all2 R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. symp R \<Longrightarrow> symp (llist_all2 R)
[PROOF STEP]
by (rule sympI) (auto simp add: llist_all2_conv_all_lnth elim: sympE)


[STATEMENT]
lemma path_connected_Ici[simp]: "path_connected {a..}" for a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected {a..}
[PROOF STEP]
by (simp add: convex_imp_path_connected)


[STATEMENT]
lemma rotate2 [simp]:
  "(rotate2 x)$1 = -x$2"
  "(rotate2 x)$2 = x$1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate2 x $ 1 = - x $ 2 &&& rotate2 x $ 2 = x $ 1
[PROOF STEP]
by (simp add: rotate2_def)+


[STATEMENT]
lemma (in normalization_semidom_multiplicative) normalized_prod_msetI:
  assumes "\<And>a. a \<in># A \<Longrightarrow> normalize a = a"
  shows "normalize (prod_mset A) = prod_mset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (\<Prod>\<^sub># A) = \<Prod>\<^sub># A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. normalize (\<Prod>\<^sub># A) = \<Prod>\<^sub># A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
?a1 \<in># A \<Longrightarrow> normalize ?a1 = ?a1
[PROOF STEP]
have "image_mset normalize A = A"
[PROOF STATE]
proof (prove)
using this:
?a1 \<in># A \<Longrightarrow> normalize ?a1 = ?a1

goal (1 subgoal):
 1. image_mset normalize A = A
[PROOF STEP]
by (induct A) simp_all
[PROOF STATE]
proof (state)
this:
image_mset normalize A = A

goal (1 subgoal):
 1. normalize (\<Prod>\<^sub># A) = \<Prod>\<^sub># A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
image_mset normalize A = A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
image_mset normalize A = A

goal (1 subgoal):
 1. normalize (\<Prod>\<^sub># A) = \<Prod>\<^sub># A
[PROOF STEP]
by (simp add: normalize_prod_mset)
[PROOF STATE]
proof (state)
this:
normalize (\<Prod>\<^sub># A) = \<Prod>\<^sub># A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_wrt_less_sum_mono_lowerbound:
  fixes f :: "nat \<Rightarrow> ('b::ordered_comm_monoid_add)"
  assumes mono: "\<And>x y. x\<le>y \<Longrightarrow> f x \<le> f y"
  shows "sorted_wrt (<) ns \<Longrightarrow>
    (\<Sum>i\<in>{0..<length ns}. f i) \<le> (\<Sum>i\<leftarrow>ns. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (<) ns \<Longrightarrow> sum f {0..<length ns} \<le> sum_list (map f ns)
[PROOF STEP]
proof (induction ns rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sorted_wrt (<) [] \<Longrightarrow> sum f {0..<length []} \<le> sum_list (map f [])
 2. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
sorted_wrt (<) []

goal (2 subgoals):
 1. sorted_wrt (<) [] \<Longrightarrow> sum f {0..<length []} \<le> sum_list (map f [])
 2. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sorted_wrt (<) []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sorted_wrt (<) []

goal (1 subgoal):
 1. sum f {0..<length []} \<le> sum_list (map f [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {0..<length []} \<le> sum_list (map f [])

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
case (snoc n ns)
[PROOF STATE]
proof (state)
this:
sorted_wrt (<) ns \<Longrightarrow> sum f {0..<length ns} \<le> sum_list (map f ns)
sorted_wrt (<) (ns @ [n])

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
have "sum f {0..<length (ns @ [n])}
      = sum f {0..<length ns} + f (length ns)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {0..<length (ns @ [n])} = sum f {0..<length ns} + f (length ns)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {0..<length (ns @ [n])} = sum f {0..<length ns} + f (length ns)

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {0..<length (ns @ [n])} = sum f {0..<length ns} + f (length ns)

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
have "sum f {0..<length ns} \<le> sum_list (map f ns)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {0..<length ns} \<le> sum_list (map f ns)
[PROOF STEP]
using snoc
[PROOF STATE]
proof (prove)
using this:
sorted_wrt (<) ns \<Longrightarrow> sum f {0..<length ns} \<le> sum_list (map f ns)
sorted_wrt (<) (ns @ [n])

goal (1 subgoal):
 1. sum f {0..<length ns} \<le> sum_list (map f ns)
[PROOF STEP]
by (auto simp: sorted_wrt_append)
[PROOF STATE]
proof (state)
this:
sum f {0..<length ns} \<le> sum_list (map f ns)

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {0..<length ns} \<le> sum_list (map f ns)

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
have "length ns \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ns \<le> n
[PROOF STEP]
using sorted_wrt_less_idx[OF snoc.prems(1), of "length ns"]
[PROOF STATE]
proof (prove)
using this:
length ns < length (ns @ [n]) \<Longrightarrow> length ns \<le> (ns @ [n]) ! length ns

goal (1 subgoal):
 1. length ns \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length ns \<le> n

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + f (length ns) \<le> y + f (length ns); \<And>x y. x \<le> y \<Longrightarrow> sum_list (map f ns) + f x \<le> sum_list (map f ns) + f y\<rbrakk> \<Longrightarrow> sum f {0..<length (ns @ [n])} \<le> sum_list (map f ns) + f n
[PROOF STEP]
have "sum f {0..<length (ns @ [n])} \<le> sum_list (map f ns) + f n"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + f (length ns) \<le> y + f (length ns); \<And>x y. x \<le> y \<Longrightarrow> sum_list (map f ns) + f x \<le> sum_list (map f ns) + f y\<rbrakk> \<Longrightarrow> sum f {0..<length (ns @ [n])} \<le> sum_list (map f ns) + f n

goal (1 subgoal):
 1. sum f {0..<length (ns @ [n])} \<le> sum_list (map f ns) + f n
[PROOF STEP]
using mono add_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + f (length ns) \<le> y + f (length ns); \<And>x y. x \<le> y \<Longrightarrow> sum_list (map f ns) + f x \<le> sum_list (map f ns) + f y\<rbrakk> \<Longrightarrow> sum f {0..<length (ns @ [n])} \<le> sum_list (map f ns) + f n
?x \<le> ?y \<Longrightarrow> f ?x \<le> f ?y
\<lbrakk>?a \<le> ?b; ?c \<le> ?d\<rbrakk> \<Longrightarrow> ?a + ?c \<le> ?b + ?d

goal (1 subgoal):
 1. sum f {0..<length (ns @ [n])} \<le> sum_list (map f ns) + f n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sum f {0..<length (ns @ [n])} \<le> sum_list (map f ns) + f n

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>sorted_wrt (<) xs \<Longrightarrow> sum f {0..<length xs} \<le> sum_list (map f xs); sorted_wrt (<) (xs @ [x])\<rbrakk> \<Longrightarrow> sum f {0..<length (xs @ [x])} \<le> sum_list (map f (xs @ [x]))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
sum f {0..<length (ns @ [n])} \<le> sum_list (map f ns) + f n

goal (1 subgoal):
 1. sum f {0..<length (ns @ [n])} \<le> sum_list (map f (ns @ [n]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {0..<length (ns @ [n])} \<le> sum_list (map f (ns @ [n]))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_const_over_n [tendsto_intros]:
  fixes a :: "'a::real_normed_field"
  shows "(\<lambda>n. a / of_nat n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a / of_nat n) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
using tendsto_mult [OF tendsto_const [of a] lim_1_over_n]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a * ((1::'a) / of_nat x)) \<longlonglongrightarrow> a * (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. a / of_nat n) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma ODNmap_mem:"\<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; ODord y x\<rbrakk> \<Longrightarrow>
      ODNmap D y \<in> carrier D \<and>
             (\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D (ODNmap D y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; y \<sqsubset> x\<rbrakk> \<Longrightarrow> ODNmap D y \<in> carrier D \<and> (\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D (ODNmap D y))))
[PROOF STEP]
apply (frule ODnum_segmentTr [of "D" "x" "y"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; y \<sqsubset> x; \<exists>c. c \<in> carrier D \<and> (\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D c)))\<rbrakk> \<Longrightarrow> ODNmap D y \<in> carrier D \<and> (\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D (ODNmap D y))))
[PROOF STEP]
apply (simp add:ODNmap_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; x = ordinal_number D; y \<in> ODnums; y \<sqsubset> ordinal_number D; \<exists>c. c \<in> carrier D \<and> (\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D c)))\<rbrakk> \<Longrightarrow> (SOME z. z \<in> carrier D \<and> (\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D z)))) \<in> carrier D \<and> (\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D (SOME z. z \<in> carrier D \<and> (\<forall>Y\<in>y. ord_equiv Y (Iod D (segment D z)))))))
[PROOF STEP]
apply (rule someI2_ex, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma UNIV_finite_5:
  "UNIV = set [finite_5.a\<^sub>1, finite_5.a\<^sub>2, finite_5.a\<^sub>3, finite_5.a\<^sub>4, finite_5.a\<^sub>5]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = set [a\<^sub>1, a\<^sub>2, a\<^sub>3, a\<^sub>4, a\<^sub>5]
[PROOF STEP]
by(auto intro: finite_5.exhaust)


[STATEMENT]
lemma (in PolynRg) Subring_pow_ring_pow:"x \<in> carrier S \<Longrightarrow>
                   x^\<^bsup>S n\<^esup> = x^\<^bsup>R n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier S \<Longrightarrow> x^\<^bsup>S n\<^esup> = x^\<^bsup>R n\<^esup>
[PROOF STEP]
apply (cut_tac subring, frule subring_Ring)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier S; Subring R S; Ring S\<rbrakk> \<Longrightarrow> x^\<^bsup>S n\<^esup> = x^\<^bsup>R n\<^esup>
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> carrier S; Subring R S; Ring S\<rbrakk> \<Longrightarrow> x^\<^bsup>S 0\<^esup> = x^\<^bsup>R 0\<^esup>
 2. \<And>n. \<lbrakk>x \<in> carrier S; Subring R S; Ring S; x^\<^bsup>S n\<^esup> = x^\<^bsup>R n\<^esup>\<rbrakk> \<Longrightarrow> x^\<^bsup>S Suc n\<^esup> = x^\<^bsup>R Suc n\<^esup>
[PROOF STEP]
apply (simp, simp add:Subring_one_ring_one)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier S; Subring R S; Ring S; x^\<^bsup>S n\<^esup> = x^\<^bsup>R n\<^esup>\<rbrakk> \<Longrightarrow> x^\<^bsup>S Suc n\<^esup> = x^\<^bsup>R Suc n\<^esup>
[PROOF STEP]
apply (frule_tac n = n in Ring.npClose[of S x], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier S; Subring R S; Ring S; x^\<^bsup>S n\<^esup> = x^\<^bsup>R n\<^esup>; x^\<^bsup>S n\<^esup> \<in> carrier S\<rbrakk> \<Longrightarrow> x^\<^bsup>S Suc n\<^esup> = x^\<^bsup>R Suc n\<^esup>
[PROOF STEP]
apply (simp add:Subring_tOp_ring_tOp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bij_Rep: "bij_betw (Rep) (UNIV::'a set) {0..<int CARD('a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw Rep UNIV {0..<int CARD('a)}
[PROOF STEP]
proof (unfold bij_betw_def, rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj Rep
 2. range Rep = {0..<int CARD('a)}
[PROOF STEP]
show "inj Rep"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj Rep
[PROOF STEP]
by (metis strict_mono_imp_inj_on strict_mono_Rep)
[PROOF STATE]
proof (state)
this:
inj Rep

goal (1 subgoal):
 1. range Rep = {0..<int CARD('a)}
[PROOF STEP]
show "range Rep = {0..<int CARD('a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range Rep = {0..<int CARD('a)}
[PROOF STEP]
using Typedef.type_definition.Rep_range[OF type]
[PROOF STATE]
proof (prove)
using this:
range Rep = {0..<int CARD('a)}

goal (1 subgoal):
 1. range Rep = {0..<int CARD('a)}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
range Rep = {0..<int CARD('a)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_imp_surj_on: "bij_betw f A B \<Longrightarrow> surj_on f A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f A B \<Longrightarrow> surj_on f A B
[PROOF STEP]
unfolding bij_betw_def surj_on_image_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f A \<and> f ` A = B \<Longrightarrow> B \<subseteq> f ` A
[PROOF STEP]
by simp


[STATEMENT]
lemma diagonal_step_code_nth [code abstract]: "vec_nth (diagonal_step A i j c v)
  = diagonal_step_row A i j c v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (diagonal_step A i j c v) = diagonal_step_row A i j c v
[PROOF STEP]
unfolding diagonal_step_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (\<chi>a b. if a = from_nat i \<and> b = from_nat i then c else if a = from_nat j \<and> b = from_nat j then v * A $ from_nat j $ from_nat j else A $ a $ b) = diagonal_step_row A i j c v
[PROOF STEP]
unfolding diagonal_step_row_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (\<chi>a b. if a = from_nat i \<and> b = from_nat i then c else if a = from_nat j \<and> b = from_nat j then v * A $ from_nat j $ from_nat j else A $ a $ b) = (\<lambda>a. \<chi>b. if a = from_nat i \<and> b = from_nat i then c else if a = from_nat j \<and> b = from_nat j then v * A $ from_nat j $ from_nat j else A $ a $ b)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in equivalence) classes_consistent:
  assumes "A \<subseteq> carrier S"
  shows "is_closed (closure_of A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_closed (closure_of A)
[PROOF STEP]
using closure_idem_strong
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> carrier S \<Longrightarrow> closure_of (closure_of ?A) = closure_of ?A

goal (1 subgoal):
 1. is_closed (closure_of A)
[PROOF STEP]
by (simp add: assms eq_is_closed_def)


[STATEMENT]
lemma (in valid_unMultigraph) rem_UnPath_parity_others:
  assumes "finite E"  "is_trail v ps v'" "n\<notin>{v,v'}"
  shows " even (degree n (rem_unPath ps G)) = even(degree n G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (degree n (rem_unPath ps G)) = even (degree n G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite E
is_trail v ps v'
n \<notin> {v, v'}

goal (1 subgoal):
 1. even (degree n (rem_unPath ps G)) = even (degree n G)
[PROOF STEP]
proof (induct ps arbitrary: v)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>v. \<lbrakk>finite E; is_trail v [] v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath [] G)) = even (degree n G)
 2. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
finite E
is_trail v [] v'
n \<notin> {v, v'}

goal (2 subgoals):
 1. \<And>v. \<lbrakk>finite E; is_trail v [] v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath [] G)) = even (degree n G)
 2. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite E
is_trail v [] v'
n \<notin> {v, v'}

goal (1 subgoal):
 1. even (degree n (rem_unPath [] G)) = even (degree n G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath [] G)) = even (degree n G)

goal (1 subgoal):
 1. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite E; is_trail ?v xs v'; n \<notin> {?v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath xs G)) = even (degree n G)
finite E
is_trail v (x # xs) v'
n \<notin> {v, v'}

goal (1 subgoal):
 1. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
obtain x1 x2 x3 where x:"x=(x1,x2,x3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x1 x2 x3. x = (x1, x2, x3) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis prod_cases3)
[PROOF STATE]
proof (state)
this:
x = (x1, x2, x3)

goal (1 subgoal):
 1. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
hence "even (degree n (rem_unPath (x#xs) G))= even (degree n (
          del_unEdge x1 x2 x3 (rem_unPath xs G)))"
[PROOF STATE]
proof (prove)
using this:
x = (x1, x2, x3)

goal (1 subgoal):
 1. even (degree n (rem_unPath (x # xs) G)) = even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)))
[PROOF STEP]
by (metis rem_unPath.simps(2) rem_unPath_com)
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)))

goal (1 subgoal):
 1. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
have "n=x3 \<Longrightarrow>?case"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
assume "n=x3"
[PROOF STATE]
proof (state)
this:
n = x3

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "even (degree n (rem_unPath (x#xs) G))= even (degree n (
          del_unEdge x1 x2 x3 (rem_unPath xs G)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (degree n (rem_unPath (x # xs) G)) = even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)))
[PROOF STEP]
by (metis rem_unPath.simps(2) rem_unPath_com x)
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)))

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)))

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "...=even(degree n (rem_unPath xs G) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
have "finite (edges (rem_unPath xs G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (edges (rem_unPath xs G))
[PROOF STEP]
by (metis (full_types) assms(1) finite_Diff rem_unPath_edges)
[PROOF STATE]
proof (state)
this:
finite (edges (rem_unPath xs G))

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (edges (rem_unPath xs G))

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
have "(x1,x2,x3) \<in>edges( rem_unPath xs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x1, x2, x3) \<in> edges (rem_unPath xs G)
[PROOF STEP]
by (metis Cons.prems(2) distinct_elim is_trail.simps(2) x)
[PROOF STATE]
proof (state)
this:
(x1, x2, x3) \<in> edges (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(x1, x2, x3) \<in> edges (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
have "(x3,x2,x1) \<in>edges( rem_unPath xs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x3, x2, x1) \<in> edges (rem_unPath xs G)
[PROOF STEP]
by (metis Cons.prems(2) corres distinct_elim_rev is_trail.simps(2) x)
[PROOF STATE]
proof (state)
this:
(x3, x2, x1) \<in> edges (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (edges (rem_unPath xs G))
(x1, x2, x3) \<in> edges (rem_unPath xs G)
(x3, x2, x1) \<in> edges (rem_unPath xs G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (edges (rem_unPath xs G))
(x1, x2, x3) \<in> edges (rem_unPath xs G)
(x3, x2, x1) \<in> edges (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
using \<open>n = x3\<close> del_edge_undirected_degree_minus'
[PROOF STATE]
proof (prove)
using this:
finite (edges (rem_unPath xs G))
(x1, x2, x3) \<in> edges (rem_unPath xs G)
(x3, x2, x1) \<in> edges (rem_unPath xs G)
n = x3
\<lbrakk>finite (edges ?g); (?v, ?e, ?v') \<in> edges ?g; (?v', ?e, ?v) \<in> edges ?g\<rbrakk> \<Longrightarrow> degree ?v' (del_unEdge ?v ?e ?v' ?g) = degree ?v' ?g - 1

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G) - 1)

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "...=odd(degree n (rem_unPath xs G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
have "(x1,x2,x3)\<in>E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x1, x2, x3) \<in> E
[PROOF STEP]
by (metis Cons.prems(2) is_trail.simps(2) x)
[PROOF STATE]
proof (state)
this:
(x1, x2, x3) \<in> E

goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
hence "(x3,x2,x1)\<in>edges (rem_unPath xs G)"
[PROOF STATE]
proof (prove)
using this:
(x1, x2, x3) \<in> E

goal (1 subgoal):
 1. (x3, x2, x1) \<in> edges (rem_unPath xs G)
[PROOF STEP]
by (metis Cons.prems(2) corres distinct_elim_rev x)
[PROOF STATE]
proof (state)
this:
(x3, x2, x1) \<in> edges (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
hence "(x3,x2,x1)\<in>{e \<in> edges (rem_unPath xs G). fst e = n}"
[PROOF STATE]
proof (prove)
using this:
(x3, x2, x1) \<in> edges (rem_unPath xs G)

goal (1 subgoal):
 1. (x3, x2, x1) \<in> {e \<in> edges (rem_unPath xs G). fst e = n}
[PROOF STEP]
using \<open>n=x3\<close>
[PROOF STATE]
proof (prove)
using this:
(x3, x2, x1) \<in> edges (rem_unPath xs G)
n = x3

goal (1 subgoal):
 1. (x3, x2, x1) \<in> {e \<in> edges (rem_unPath xs G). fst e = n}
[PROOF STEP]
by (metis (mono_tags) fst_conv mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
(x3, x2, x1) \<in> {e \<in> edges (rem_unPath xs G). fst e = n}

goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(x3, x2, x1) \<in> {e \<in> edges (rem_unPath xs G). fst e = n}

goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
have "finite {e \<in> edges (rem_unPath xs G). fst e = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {e \<in> edges (rem_unPath xs G). fst e = n}
[PROOF STEP]
using \<open>finite E\<close>
[PROOF STATE]
proof (prove)
using this:
finite E

goal (1 subgoal):
 1. finite {e \<in> edges (rem_unPath xs G). fst e = n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {e \<in> edges (rem_unPath xs G). fst e = n}

goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(x3, x2, x1) \<in> {e \<in> edges (rem_unPath xs G). fst e = n}
finite {e \<in> edges (rem_unPath xs G). fst e = n}
[PROOF STEP]
have "degree n (rem_unPath xs G)\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
(x3, x2, x1) \<in> {e \<in> edges (rem_unPath xs G). fst e = n}
finite {e \<in> edges (rem_unPath xs G). fst e = n}

goal (1 subgoal):
 1. degree n (rem_unPath xs G) \<noteq> 0
[PROOF STEP]
unfolding degree_def
[PROOF STATE]
proof (prove)
using this:
(x3, x2, x1) \<in> {e \<in> edges (rem_unPath xs G). fst e = n}
finite {e \<in> edges (rem_unPath xs G). fst e = n}

goal (1 subgoal):
 1. card {e \<in> edges (rem_unPath xs G). fst e = n} \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree n (rem_unPath xs G) \<noteq> 0

goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
degree n (rem_unPath xs G) \<noteq> 0

goal (1 subgoal):
 1. even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath xs G) - 1) = odd (degree n (rem_unPath xs G))

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "...=even(degree n G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd (degree n (rem_unPath xs G)) = even (degree n G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd (degree n (rem_unPath xs G)) = even (degree n G)
[PROOF STEP]
have "x3\<noteq>v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x3 \<noteq> v'
[PROOF STEP]
by (metis \<open>n = x3\<close> assms(3) insert_iff)
[PROOF STATE]
proof (state)
this:
x3 \<noteq> v'

goal (1 subgoal):
 1. odd (degree n (rem_unPath xs G)) = even (degree n G)
[PROOF STEP]
hence "odd (degree x3 (rem_unPath xs G)) = even(degree x3 G)"
[PROOF STATE]
proof (prove)
using this:
x3 \<noteq> v'

goal (1 subgoal):
 1. odd (degree x3 (rem_unPath xs G)) = even (degree x3 G)
[PROOF STEP]
using Cons assms
[PROOF STATE]
proof (prove)
using this:
x3 \<noteq> v'
\<lbrakk>finite E; is_trail ?v xs v'; n \<notin> {?v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath xs G)) = even (degree n G)
finite E
is_trail v (x # xs) v'
n \<notin> {v, v'}
finite E
is_trail v ps v'
n \<notin> {v, v'}

goal (1 subgoal):
 1. odd (degree x3 (rem_unPath xs G)) = even (degree x3 G)
[PROOF STEP]
by (metis is_trail.simps(2) rem_UnPath_parity_v x)
[PROOF STATE]
proof (state)
this:
odd (degree x3 (rem_unPath xs G)) = even (degree x3 G)

goal (1 subgoal):
 1. odd (degree n (rem_unPath xs G)) = even (degree n G)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
odd (degree x3 (rem_unPath xs G)) = even (degree x3 G)

goal (1 subgoal):
 1. odd (degree n (rem_unPath xs G)) = even (degree n G)
[PROOF STEP]
using \<open>n=x3\<close>
[PROOF STATE]
proof (prove)
using this:
odd (degree x3 (rem_unPath xs G)) = even (degree x3 G)
n = x3

goal (1 subgoal):
 1. odd (degree n (rem_unPath xs G)) = even (degree n G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd (degree n (rem_unPath xs G)) = even (degree n G)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd (degree n (rem_unPath xs G)) = even (degree n G)

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "even (degree n (rem_unPath (x#xs) G))=even(degree n G)"
[PROOF STATE]
proof (prove)
using this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
have "n\<noteq>x3 \<Longrightarrow>?case"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
assume "n\<noteq>x3"
[PROOF STATE]
proof (state)
this:
n \<noteq> x3

goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "even (degree n (rem_unPath (x#xs) G))= even (degree n (
          del_unEdge x1 x2 x3 (rem_unPath xs G)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (degree n (rem_unPath (x # xs) G)) = even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)))
[PROOF STEP]
by (metis rem_unPath.simps(2) rem_unPath_com x)
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)))

goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)))

goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "...=even(degree n (rem_unPath xs G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
have "v=x1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = x1
[PROOF STEP]
by (metis Cons.prems(2) is_trail.simps(2) x)
[PROOF STATE]
proof (state)
this:
v = x1

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
hence "n\<notin>{x1,x3}"
[PROOF STATE]
proof (prove)
using this:
v = x1

goal (1 subgoal):
 1. n \<notin> {x1, x3}
[PROOF STEP]
by (metis Cons.prems(3) \<open>n \<noteq> x3\<close> insertE insertI1 singletonE)
[PROOF STATE]
proof (state)
this:
n \<notin> {x1, x3}

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n \<notin> {x1, x3}

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
have "valid_unMultigraph (rem_unPath xs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_unMultigraph (rem_unPath xs G)
[PROOF STEP]
using valid_unMultigraph_axioms
[PROOF STATE]
proof (prove)
using this:
valid_unMultigraph G

goal (1 subgoal):
 1. valid_unMultigraph (rem_unPath xs G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
valid_unMultigraph (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
valid_unMultigraph (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
have "finite (edges (rem_unPath xs G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (edges (rem_unPath xs G))
[PROOF STEP]
by (metis (full_types) assms(1) finite_Diff rem_unPath_edges)
[PROOF STATE]
proof (state)
this:
finite (edges (rem_unPath xs G))

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n \<notin> {x1, x3}
valid_unMultigraph (rem_unPath xs G)
finite (edges (rem_unPath xs G))
[PROOF STEP]
have "degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))
                            =degree n (rem_unPath xs G)"
[PROOF STATE]
proof (prove)
using this:
n \<notin> {x1, x3}
valid_unMultigraph (rem_unPath xs G)
finite (edges (rem_unPath xs G))

goal (1 subgoal):
 1. degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)) = degree n (rem_unPath xs G)
[PROOF STEP]
using degree_frame
[PROOF STATE]
proof (prove)
using this:
n \<notin> {x1, x3}
valid_unMultigraph (rem_unPath xs G)
finite (edges (rem_unPath xs G))
\<lbrakk>finite E; ?x \<notin> {?v, ?v'}\<rbrakk> \<Longrightarrow> degree ?x (del_unEdge ?v ?w ?v' G) = degree ?x G

goal (1 subgoal):
 1. degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)) = degree n (rem_unPath xs G)
[PROOF STEP]
by (metis valid_unMultigraph.degree_frame)
[PROOF STATE]
proof (state)
this:
degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)) = degree n (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
degree n (del_unEdge x1 x2 x3 (rem_unPath xs G)) = degree n (rem_unPath xs G)

goal (1 subgoal):
 1. even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))

goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
even (degree n (del_unEdge x1 x2 x3 (rem_unPath xs G))) = even (degree n (rem_unPath xs G))

goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "...=even(degree n G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (degree n (rem_unPath xs G)) = even (degree n G)
[PROOF STEP]
using Cons assms \<open>n \<noteq> x3\<close> x
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite E; is_trail ?v xs v'; n \<notin> {?v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath xs G)) = even (degree n G)
finite E
is_trail v (x # xs) v'
n \<notin> {v, v'}
finite E
is_trail v ps v'
n \<notin> {v, v'}
n \<noteq> x3
x = (x1, x2, x3)

goal (1 subgoal):
 1. even (degree n (rem_unPath xs G)) = even (degree n G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath xs G)) = even (degree n G)

goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
have "even (degree n (rem_unPath (x#xs) G))=even(degree n G)"
[PROOF STATE]
proof (prove)
using this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. \<And>a ps v. \<lbrakk>\<And>v. \<lbrakk>finite E; is_trail v ps v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath ps G)) = even (degree n G); finite E; is_trail v (a # ps) v'; n \<notin> {v, v'}\<rbrakk> \<Longrightarrow> even (degree n (rem_unPath (a # ps) G)) = even (degree n G)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
n = x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
n \<noteq> x3 \<Longrightarrow> even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal (1 subgoal):
 1. even (degree n (rem_unPath (x # xs) G)) = even (degree n G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even (degree n (rem_unPath (x # xs) G)) = even (degree n G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma euclidean_isCont:
  assumes "\<And>b. b \<in> Basis \<Longrightarrow> isCont (\<lambda>x. (inner (f x) b) *\<^sub>R b) x"
    shows "isCont f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x
[PROOF STEP]
apply (subst euclidean_representation_sum_fun [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. \<Sum>b\<in>Basis. inner (f x) b *\<^sub>R b) x
[PROOF STEP]
apply (rule isCont_sum)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>b\<in>Basis. isCont (\<lambda>x. inner (f x) b *\<^sub>R b) x
[PROOF STEP]
apply (blast intro: assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fps_integral_nth_0_Suc [simp]:
  fixes a :: "'a::{semiring_1,inverse} fps"
  shows "fps_integral a a0 $ 0 = a0"
  and   "fps_integral a a0 $ Suc n = inverse (of_nat (Suc n)) * a $ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_integral a a0 $ 0 = a0 &&& fps_integral a a0 $ Suc n = inverse (of_nat (Suc n)) * a $ n
[PROOF STEP]
by    (auto simp: fps_integral_def)


[STATEMENT]
lemma prj0_in_hom':
    assumes "cospan f g"
    shows "\<guillemotleft>\<p>\<^sub>0[f, g] : dom \<p>\<^sub>0[f, g] \<rightarrow> dom g\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>\<p>\<^sub>0[f, g] : local.dom \<p>\<^sub>0[f, g] \<rightarrow> local.dom g\<guillemotright>
[PROOF STEP]
using assms pullback_commutes
[PROOF STATE]
proof (prove)
using this:
cospan f g
cospan ?f ?g \<Longrightarrow> commutative_square ?f ?g \<p>\<^sub>1[?f, ?g] \<p>\<^sub>0[?f, ?g]

goal (1 subgoal):
 1. \<guillemotleft>\<p>\<^sub>0[f, g] : local.dom \<p>\<^sub>0[f, g] \<rightarrow> local.dom g\<guillemotright>
[PROOF STEP]
by (metis category.commutative_squareE category_axioms in_homI)


[STATEMENT]
lemma aall_mono:
  assumes 1: "sigma \<Turnstile> \<forall>\<forall>x. F(x)"
    and 2: "\<And>x. sigma \<Turnstile> F(x) \<longrightarrow> G(x)"
  shows "sigma \<Turnstile> \<forall>\<forall>x. G(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<forall> x. G x) sigma
[PROOF STEP]
apply (rule unit_base [THEN aallI])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. basevars (x, ?vs) \<Longrightarrow> G x sigma
[PROOF STEP]
apply (rule 2 [unfolded intensional_rews, THEN mp])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. basevars (x, ?vs) \<Longrightarrow> F x sigma
[PROOF STEP]
apply (rule 1 [THEN aallE [temp_use]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma integrable_imp_measurable:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "f integrable_on S"
  shows "f \<in> borel_measurable (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
have "(UNIV::'a set) \<in> sets lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<in> sets lborel
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
UNIV \<in> sets lborel

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
UNIV \<in> sets lborel
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
UNIV \<in> sets lborel

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
by (metis (mono_tags, lifting) assms borel_measurable_if_D integrable_imp_measurable_weak integrable_restrict_UNIV lebesgue_on_UNIV_eq sets_lebesgue_on_refl)
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable (lebesgue_on S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma root_list_lb:
  fixes ps:: "(real poly) list" and b::real
  assumes "0\<notin>set ps"
  obtains lb where "\<forall>p\<in>set ps. \<forall>x. poly p x=0 \<longrightarrow> x>lb"
    and "\<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p" and "lb<b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<notin> set ps

goal (1 subgoal):
 1. (\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (induct ps arbitrary:thesis)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set []. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set []. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set []\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>p\<in>set []. \<forall>x. poly p x = 0 \<longrightarrow> ?lb < x; \<forall>x\<le>?lb. \<forall>p\<in>set []. sgn (poly p x) = sgn_neg_inf p; ?lb < b\<rbrakk> \<Longrightarrow> thesis
0 \<notin> set []

goal (2 subgoals):
 1. \<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set []. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set []. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set []\<rbrakk> \<Longrightarrow> thesis
 2. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using Nil(1)[of "b - 1"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>p\<in>set []. \<forall>x. poly p x = 0 \<longrightarrow> b - 1 < x; \<forall>x\<le>b - 1. \<forall>p\<in>set []. sgn (poly p x) = sgn_neg_inf p; b - 1 < b\<rbrakk> \<Longrightarrow> thesis

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

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (Cons p ps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> ?thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> ?thesis
\<lbrakk>\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> ?lb < x; \<forall>x\<le>?lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p; ?lb < b\<rbrakk> \<Longrightarrow> thesis
0 \<notin> set (p # ps)

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "p\<noteq>0" and "0\<notin>set ps"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> ?thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> ?thesis
\<lbrakk>\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> ?lb < x; \<forall>x\<le>?lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p; ?lb < b\<rbrakk> \<Longrightarrow> thesis
0 \<notin> set (p # ps)

goal (1 subgoal):
 1. p \<noteq> 0 &&& 0 \<notin> set ps
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<noteq> 0
0 \<notin> set ps

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
0 \<notin> set ps
[PROOF STEP]
obtain lb1 where lb1:"\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> x > lb1" and
      lb1_sgn:"\<forall>x\<le>lb1. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p" and "lb1<b"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
0 \<notin> set ps

goal (1 subgoal):
 1. (\<And>lb1. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb1 < x; \<forall>x\<le>lb1. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb1 < b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Cons.hyps
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
0 \<notin> set ps
\<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> ?thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>lb1. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb1 < x; \<forall>x\<le>lb1. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb1 < b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb1 < x
\<forall>x\<le>lb1. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p
lb1 < b

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain lb2 where lb2:"\<forall>x. poly p x = 0 \<longrightarrow> x > lb2"
      and lb2_sgn: "\<forall>x\<le>lb2. sgn (poly p x) = sgn_neg_inf p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>lb2. \<lbrakk>\<forall>x. poly p x = 0 \<longrightarrow> lb2 < x; \<forall>x\<le>lb2. sgn (poly p x) = sgn_neg_inf p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using root_lb[OF \<open>p\<noteq>0\<close>]
[PROOF STATE]
proof (prove)
using this:
(\<And>lb. \<lbrakk>\<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. sgn (poly p x) = sgn_neg_inf p\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>lb2. \<lbrakk>\<forall>x. poly p x = 0 \<longrightarrow> lb2 < x; \<forall>x\<le>lb2. sgn (poly p x) = sgn_neg_inf p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. poly p x = 0 \<longrightarrow> lb2 < x
\<forall>x\<le>lb2. sgn (poly p x) = sgn_neg_inf p

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
define lb where "lb\<equiv>min lb1 lb2"
[PROOF STATE]
proof (state)
this:
lb \<equiv> min lb1 lb2

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> x > lb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x
[PROOF STEP]
using lb1 lb2 lb_def
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb1 < x
\<forall>x. poly p x = 0 \<longrightarrow> lb2 < x
lb \<equiv> min lb1 lb2

goal (1 subgoal):
 1. \<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "\<forall>x\<le>lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<le>lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p
[PROOF STEP]
using lb1_sgn lb2_sgn lb_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<le>lb1. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p
\<forall>x\<le>lb2. sgn (poly p x) = sgn_neg_inf p
lb \<equiv> min lb1 lb2

goal (1 subgoal):
 1. \<forall>x\<le>lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<le>lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p

goal (1 subgoal):
 1. \<And>a ps thesis. \<lbrakk>\<And>thesis. \<lbrakk>\<And>lb. \<lbrakk>\<forall>p\<in>set ps. \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set ps. sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set ps\<rbrakk> \<Longrightarrow> thesis; \<And>lb. \<lbrakk>\<forall>p\<in>set (a # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (a # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis; 0 \<notin> set (a # ps)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x
\<forall>x\<le>lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x
\<forall>x\<le>lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using Cons(2)[of lb] \<open>lb1<b\<close> lb_def
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x
\<forall>x\<le>lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p
\<lbrakk>\<forall>p\<in>set (p # ps). \<forall>x. poly p x = 0 \<longrightarrow> lb < x; \<forall>x\<le>lb. \<forall>p\<in>set (p # ps). sgn (poly p x) = sgn_neg_inf p; lb < b\<rbrakk> \<Longrightarrow> thesis
lb1 < b
lb \<equiv> min lb1 lb2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma density_density_eq:
   "f \<in> borel_measurable M \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow>
   density (density M f) g = density M (\<lambda>x. f x * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> borel_measurable M\<rbrakk> \<Longrightarrow> density (density M f) g = density M (\<lambda>x. f x * g x)
[PROOF STEP]
by (auto intro!: measure_eqI simp: emeasure_density nn_integral_density ac_simps)


[STATEMENT]
lemma lnorm_minus_commute: "lnorm M p (g - f) = lnorm M p (f - g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lnorm M p (g - f) = lnorm M p (f - g)
[PROOF STEP]
by (simp add: lnorm_def abs_minus_commute)


[STATEMENT]
lemma Norm_nonneg [simp]:
  "Norm N x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> Norm N x
[PROOF STEP]
unfolding Norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> enn2real (eNorm N x)
[PROOF STEP]
by auto


[STATEMENT]
lemma FNTT_length: "length numbers = 2^l \<Longrightarrow> length (FNTT numbers) = length numbers"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
proof(induction l arbitrary: numbers)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
case (Suc l)
[PROOF STATE]
proof (state)
this:
length ?numbers = 2 ^ l \<Longrightarrow> length (FNTT ?numbers) = length ?numbers
length numbers = 2 ^ Suc l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
define numbers1 where "numbers1 = [numbers!i .  i <- (filter even [0..<length numbers])]"
[PROOF STATE]
proof (state)
this:
numbers1 = map ((!) numbers) (filter even [0..<length numbers])

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
define numbers2 where "numbers2 = [numbers!i .  i <- (filter odd [0..<length numbers])]"
[PROOF STATE]
proof (state)
this:
numbers2 = map ((!) numbers) (filter odd [0..<length numbers])

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
define fntt1 where "fntt1 = FNTT numbers1"
[PROOF STATE]
proof (state)
this:
fntt1 = FNTT numbers1

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
define fntt2 where "fntt2 = FNTT numbers2"
[PROOF STATE]
proof (state)
this:
fntt2 = FNTT numbers2

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
define presum where
    "presum = (map2 ( \<lambda> x k.  x*(\<omega>^( (n div (length numbers)) * k)))
                   fntt2 [0..<((length numbers) div 2)])"
[PROOF STATE]
proof (state)
this:
presum = map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) fntt2 [0..<length numbers div 2]

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
define sum1 where
    "sum1 = map2 (+) fntt1 presum"
[PROOF STATE]
proof (state)
this:
sum1 = map2 (+) fntt1 presum

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
define sum2 where
    "sum2 = map2 (-) fntt1 presum"
[PROOF STATE]
proof (state)
this:
sum2 = map2 (-) fntt1 presum

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
have "length numbers1  = 2^l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length numbers1 = 2 ^ l
[PROOF STEP]
by (metis Suc.prems numbers1_def diff_add_inverse2 length_even_filter mult_2 nonzero_mult_div_cancel_left power_Suc zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
length numbers1 = 2 ^ l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
hence "length fntt1 = 2^l"
[PROOF STATE]
proof (prove)
using this:
length numbers1 = 2 ^ l

goal (1 subgoal):
 1. length fntt1 = 2 ^ l
[PROOF STEP]
by (simp add: Suc.IH fntt1_def)
[PROOF STATE]
proof (state)
this:
length fntt1 = 2 ^ l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
hence "length presum = 2^l"
[PROOF STATE]
proof (prove)
using this:
length fntt1 = 2 ^ l

goal (1 subgoal):
 1. length presum = 2 ^ l
[PROOF STEP]
unfolding presum_def
[PROOF STATE]
proof (prove)
using this:
length fntt1 = 2 ^ l

goal (1 subgoal):
 1. length (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) fntt2 [0..<length numbers div 2]) = 2 ^ l
[PROOF STEP]
using map2_length Suc.IH Suc.prems fntt2_def length_odd_filter numbers2_def
[PROOF STATE]
proof (prove)
using this:
length fntt1 = 2 ^ l
length (map2 ?f ?xs ?ys) = min (length ?xs) (length ?ys)
length ?numbers = 2 ^ l \<Longrightarrow> length (FNTT ?numbers) = length ?numbers
length numbers = 2 ^ Suc l
fntt2 = FNTT numbers2
length (map ?f (filter odd [0..<?l])) = ?l div 2
numbers2 = map ((!) numbers) (filter odd [0..<length numbers])

goal (1 subgoal):
 1. length (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) fntt2 [0..<length numbers div 2]) = 2 ^ l
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
length presum = 2 ^ l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
hence "length sum1 = 2^l"
[PROOF STATE]
proof (prove)
using this:
length presum = 2 ^ l

goal (1 subgoal):
 1. length sum1 = 2 ^ l
[PROOF STEP]
by (simp add: \<open>length fntt1 = 2 ^ l\<close> sum1_def)
[PROOF STATE]
proof (state)
this:
length sum1 = 2 ^ l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
have "length numbers2 = 2^l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length numbers2 = 2 ^ l
[PROOF STEP]
by (metis Suc.prems numbers2_def length_odd_filter nonzero_mult_div_cancel_left power_Suc zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
length numbers2 = 2 ^ l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
hence "length fntt2 = 2^l"
[PROOF STATE]
proof (prove)
using this:
length numbers2 = 2 ^ l

goal (1 subgoal):
 1. length fntt2 = 2 ^ l
[PROOF STEP]
by (simp add: Suc.IH fntt2_def)
[PROOF STATE]
proof (state)
this:
length fntt2 = 2 ^ l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
hence "length sum2 = 2^l"
[PROOF STATE]
proof (prove)
using this:
length fntt2 = 2 ^ l

goal (1 subgoal):
 1. length sum2 = 2 ^ l
[PROOF STEP]
unfolding sum2_def
[PROOF STATE]
proof (prove)
using this:
length fntt2 = 2 ^ l

goal (1 subgoal):
 1. length (map2 (-) fntt1 presum) = 2 ^ l
[PROOF STEP]
using \<open>length sum1 = 2 ^ l\<close> sum1_def
[PROOF STATE]
proof (prove)
using this:
length fntt2 = 2 ^ l
length sum1 = 2 ^ l
sum1 = map2 (+) fntt1 presum

goal (1 subgoal):
 1. length (map2 (-) fntt1 presum) = 2 ^ l
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
length sum2 = 2 ^ l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
hence final:"length (sum1@sum2) = 2^(Suc l)"
[PROOF STATE]
proof (prove)
using this:
length sum2 = 2 ^ l

goal (1 subgoal):
 1. length (sum1 @ sum2) = 2 ^ Suc l
[PROOF STEP]
by (simp add: \<open>length sum1 = 2 ^ l\<close>)
[PROOF STATE]
proof (state)
this:
length (sum1 @ sum2) = 2 ^ Suc l

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
obtain x y xs where xyxs_Def: "numbers = x#y#xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y xs. numbers = x # y # xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>length numbers2 = 2 ^ l\<close> evens_odds.elims filter_compehension_evens_odds length_0_conv neq_Nil_conv numbers2_def power_eq_0_iff zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
numbers = x # y # xs

goal (2 subgoals):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
 2. \<And>l numbers. \<lbrakk>\<And>numbers. length numbers = 2 ^ l \<Longrightarrow> length (FNTT numbers) = length numbers; length numbers = 2 ^ Suc l\<rbrakk> \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (FNTT numbers) = length numbers
[PROOF STEP]
apply(subst xyxs_Def, subst FNTT.simps(3), subst xyxs_Def[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (let nn = length numbers; nums1 = map ((!) (x # y # xs)) (filter even [0..<nn]); nums2 = map ((!) (x # y # xs)) (filter odd [0..<nn]); fntt1 = FNTT nums1; fntt2 = FNTT nums2; sum1 = map2 (+) fntt1 (map2 (\<lambda>x y. x * \<omega> ^ (n div nn * y)) fntt2 [0..<nn div 2]) in Let (map2 (-) fntt1 (map2 (\<lambda>x y. x * \<omega> ^ (n div nn * y)) fntt2 [0..<nn div 2])) ((@) sum1)) = length numbers
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map2 (+) (FNTT (map ((!) (x # y # xs)) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) (x # y # xs)) (filter odd [0..<length numbers]))) [0..<length numbers div 2]) @ map2 (-) (FNTT (map ((!) (x # y # xs)) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) (x # y # xs)) (filter odd [0..<length numbers]))) [0..<length numbers div 2])) = length numbers
[PROOF STEP]
using final
[PROOF STATE]
proof (prove)
using this:
length (sum1 @ sum2) = 2 ^ Suc l

goal (1 subgoal):
 1. length (map2 (+) (FNTT (map ((!) (x # y # xs)) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) (x # y # xs)) (filter odd [0..<length numbers]))) [0..<length numbers div 2]) @ map2 (-) (FNTT (map ((!) (x # y # xs)) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) (x # y # xs)) (filter odd [0..<length numbers]))) [0..<length numbers div 2])) = length numbers
[PROOF STEP]
unfolding sum1_def sum2_def presum_def fntt1_def fntt2_def numbers1_def numbers2_def
[PROOF STATE]
proof (prove)
using this:
length (map2 (+) (FNTT (map ((!) numbers) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) numbers) (filter odd [0..<length numbers]))) [0..<length numbers div 2]) @ map2 (-) (FNTT (map ((!) numbers) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) numbers) (filter odd [0..<length numbers]))) [0..<length numbers div 2])) = 2 ^ Suc l

goal (1 subgoal):
 1. length (map2 (+) (FNTT (map ((!) (x # y # xs)) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) (x # y # xs)) (filter odd [0..<length numbers]))) [0..<length numbers div 2]) @ map2 (-) (FNTT (map ((!) (x # y # xs)) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) (x # y # xs)) (filter odd [0..<length numbers]))) [0..<length numbers div 2])) = length numbers
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
length (map2 (+) (FNTT (map ((!) numbers) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) numbers) (filter odd [0..<length numbers]))) [0..<length numbers div 2]) @ map2 (-) (FNTT (map ((!) numbers) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) numbers) (filter odd [0..<length numbers]))) [0..<length numbers div 2])) = 2 ^ Suc l
length ?numbers = 2 ^ l \<Longrightarrow> length (FNTT ?numbers) = length ?numbers
length numbers = 2 ^ Suc l

goal (1 subgoal):
 1. length (map2 (+) (FNTT (map ((!) (x # y # xs)) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) (x # y # xs)) (filter odd [0..<length numbers]))) [0..<length numbers div 2]) @ map2 (-) (FNTT (map ((!) (x # y # xs)) (filter even [0..<length numbers]))) (map2 (\<lambda>x y. x * \<omega> ^ (n div length numbers * y)) (FNTT (map ((!) (x # y # xs)) (filter odd [0..<length numbers]))) [0..<length numbers div 2])) = length numbers
[PROOF STEP]
by (metis xyxs_Def)
[PROOF STATE]
proof (state)
this:
length (FNTT numbers) = length numbers

goal (1 subgoal):
 1. \<And>numbers. length numbers = 2 ^ 0 \<Longrightarrow> length (FNTT numbers) = length numbers
[PROOF STEP]
qed (metis FNTT.simps(2) Suc_length_conv length_0_conv nat_power_eq_Suc_0_iff)


[STATEMENT]
lemma Un_in_lattice: "[|x\<in>L; y\<in>L; lattice L|] ==> x\<union>y \<in> L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> L; y \<in> L; lattice L\<rbrakk> \<Longrightarrow> x \<union> y \<in> L
[PROOF STEP]
using Union_in_lattice [of "{x, y}" L]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{x, y} \<subseteq> L; lattice L\<rbrakk> \<Longrightarrow> \<Union> {x, y} \<in> L

goal (1 subgoal):
 1. \<lbrakk>x \<in> L; y \<in> L; lattice L\<rbrakk> \<Longrightarrow> x \<union> y \<in> L
[PROOF STEP]
by simp


[STATEMENT]
lemma mono_f: "strict_mono (f off)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono (f off)
[PROOF STEP]
unfolding strict_mono_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> D * x + (m - 1) + off < D * y + (m - 1) + off
[PROOF STEP]
using D0
[PROOF STATE]
proof (prove)
using this:
D \<noteq> 0

goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> D * x + (m - 1) + off < D * y + (m - 1) + off
[PROOF STEP]
by auto


[STATEMENT]
lemma pmf_mix_deeper: "a \<in> {0..1} \<Longrightarrow> pmf (mix_pmf a p q) x = a * pmf p x + pmf q x - a * pmf q x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> {0..1} \<Longrightarrow> pmf (mix_pmf a p q) x = a * pmf p x + pmf q x - a * pmf q x
[PROOF STEP]
by (simp add: left_diff_distrib' pmf_mix)


[STATEMENT]
lemma disjoint_witness_None: "\<lbrakk>invar1 s1; invar2 s2\<rbrakk>
    \<Longrightarrow> disjoint_witness s1 s2 = None \<longleftrightarrow> \<alpha>1 s1 \<inter> \<alpha>2 s2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar1 s1; invar2 s2\<rbrakk> \<Longrightarrow> (disjoint_witness s1 s2 = None) = (\<alpha>1 s1 \<inter> \<alpha>2 s2 = {})
[PROOF STEP]
by (case_tac "disjoint_witness s1 s2")
       (auto dest: disjoint_witness_correct)


[STATEMENT]
lemma sams_comm:
  assumes "SAMS A B C D E F"
  shows "SAMS C B A F E D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SAMS C B A F E D
[PROOF STEP]
using assms sams_left_comm sams_right_comm
[PROOF STATE]
proof (prove)
using this:
SAMS A B C D E F
SAMS ?A ?B ?C ?D ?E ?F \<Longrightarrow> SAMS ?C ?B ?A ?D ?E ?F
SAMS ?A ?B ?C ?D ?E ?F \<Longrightarrow> SAMS ?A ?B ?C ?F ?E ?D

goal (1 subgoal):
 1. SAMS C B A F E D
[PROOF STEP]
by blast


[STATEMENT]
lemma enclen_length [simp]:
  "enclen (lenc xs) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enclen (lenc xs) = length xs
[PROOF STEP]
unfolding enclen_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. BMax_rec (\<lambda>x. inside (lenc xs) (x - 1)) (lenc xs) = length xs
[PROOF STEP]
apply(simp add: BMax_rec_eq1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (GREATEST z. z - 1 < length xs \<and> z \<le> lenc xs \<or> z = 0) = length xs
[PROOF STEP]
apply(rule Greatest_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length xs - 1 < length xs \<and> length xs \<le> lenc xs \<or> length xs = 0
 2. \<And>y. y - 1 < length xs \<and> y \<le> lenc xs \<or> y = 0 \<Longrightarrow> y \<le> length xs
[PROOF STEP]
apply(auto simp add: lenc_length_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in module) in_sum:
  fixes N1 N2
  assumes h1: "submodule R N1 M" and h2: "submodule R N2 M"
  shows "N1 \<subseteq> submodule_sum N1 N2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N1 \<subseteq> submodule_sum N1 N2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. N1 \<subseteq> submodule_sum N1 N2
[PROOF STEP]
from h1 h2
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule R N1 M
LinearCombinations.submodule R N2 M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule R N1 M
LinearCombinations.submodule R N2 M

goal (1 subgoal):
 1. N1 \<subseteq> submodule_sum N1 N2
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>LinearCombinations.submodule R N1 M; LinearCombinations.submodule R N2 M; x \<in> N1\<rbrakk> \<Longrightarrow> x \<in> submodule_sum N1 N2
[PROOF STEP]
apply (unfold submodule_sum_def image_def, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>LinearCombinations.submodule R N1 M; LinearCombinations.submodule R N2 M; x \<in> N1\<rbrakk> \<Longrightarrow> \<exists>xa\<in>N1. \<exists>y\<in>N2. x = xa \<oplus>\<^bsub>M\<^esub> y
[PROOF STEP]
apply (rename_tac v)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<lbrakk>LinearCombinations.submodule R N1 M; LinearCombinations.submodule R N2 M; v \<in> N1\<rbrakk> \<Longrightarrow> \<exists>x\<in>N1. \<exists>y\<in>N2. v = x \<oplus>\<^bsub>M\<^esub> y
[PROOF STEP]
apply (rule_tac x="v" in bexI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>v. \<lbrakk>LinearCombinations.submodule R N1 M; LinearCombinations.submodule R N2 M; v \<in> N1\<rbrakk> \<Longrightarrow> \<exists>y\<in>N2. v = v \<oplus>\<^bsub>M\<^esub> y
 2. \<And>v. \<lbrakk>LinearCombinations.submodule R N1 M; LinearCombinations.submodule R N2 M; v \<in> N1\<rbrakk> \<Longrightarrow> v \<in> N1
[PROOF STEP]
apply (rule_tac x="\<zero>\<^bsub>M\<^esub>" in bexI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>v. \<lbrakk>LinearCombinations.submodule R N1 M; LinearCombinations.submodule R N2 M; v \<in> N1\<rbrakk> \<Longrightarrow> v = v \<oplus>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub>
 2. \<And>v. \<lbrakk>LinearCombinations.submodule R N1 M; LinearCombinations.submodule R N2 M; v \<in> N1\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>M\<^esub> \<in> N2
 3. \<And>v. \<lbrakk>LinearCombinations.submodule R N1 M; LinearCombinations.submodule R N2 M; v \<in> N1\<rbrakk> \<Longrightarrow> v \<in> N1
[PROOF STEP]
by (unfold submodule_def, auto)
[PROOF STATE]
proof (state)
this:
N1 \<subseteq> submodule_sum N1 N2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalize_lcm_left: "lcm (normalize a) b = lcm a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm (normalize a) b = lcm a b
[PROOF STEP]
by (fact lcm.normalize_left_idem)