[STATEMENT]
lemma is_join_and_compatible:
  assumes "x \<sqsubseteq> z"
  assumes "y \<sqsubseteq> z"
  assumes "\<And> a. \<lbrakk> x \<sqsubseteq> a ; y \<sqsubseteq> a \<rbrakk> \<Longrightarrow> z \<sqsubseteq> a"
  shows "compatible x y \<and> x \<squnion> y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compatible x y \<and> x \<squnion> y = z
[PROOF STEP]
by (metis compatibleI is_joinI assms)


[STATEMENT]
lemma interior_UNIV [simp]: "interior UNIV = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior UNIV = UNIV
[PROOF STEP]
using open_UNIV
[PROOF STATE]
proof (prove)
using this:
open UNIV

goal (1 subgoal):
 1. interior UNIV = UNIV
[PROOF STEP]
by (rule interior_open)


[STATEMENT]
lemma edges_of_walk_in_E: "walk xs \<Longrightarrow> edges_of_walk xs \<subseteq> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. walk xs \<Longrightarrow> edges_of_walk xs \<subseteq> E
[PROOF STEP]
unfolding edges_of_walk_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. walk xs \<Longrightarrow> {uu_. \<exists>v w xs_pre xs_post. uu_ = (v, w) \<and> xs = xs_pre @ v # w # xs_post} \<subseteq> E
[PROOF STEP]
using walk_middle_edge
[PROOF STATE]
proof (prove)
using this:
walk (?xs @ ?v # ?w # ?ys) \<Longrightarrow> ?v \<rightarrow> ?w

goal (1 subgoal):
 1. walk xs \<Longrightarrow> {uu_. \<exists>v w xs_pre xs_post. uu_ = (v, w) \<and> xs = xs_pre @ v # w # xs_post} \<subseteq> E
[PROOF STEP]
by auto


[STATEMENT]
lemma nonzero_product:
  fixes p:: "real poly"
  assumes nonzero: "p\<noteq>0"
  fixes qs:: "real poly list"
  assumes pairwise_rel_prime_1: "\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))"
  fixes I:: "nat list"
  fixes x:: "real"
  assumes root_p: "x \<in> {x. poly p x = 0}"
  assumes welldefined: "list_constr I (length qs)"
  shows "(poly (prod_list (retrieve_polys qs I)) x > 0) \<or> (poly (prod_list (retrieve_polys qs I)) x < 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < poly (prod_list (retrieve_polys qs I)) x \<or> poly (prod_list (retrieve_polys qs I)) x < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < poly (prod_list (retrieve_polys qs I)) x \<or> poly (prod_list (retrieve_polys qs I)) x < 0
[PROOF STEP]
have "\<And>x. x \<in> set (retrieve_polys qs I) \<Longrightarrow> coprime p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set (retrieve_polys qs I) \<Longrightarrow> coprime p x
[PROOF STEP]
unfolding retrieve_polys_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set (map ((!) qs) I) \<Longrightarrow> coprime p x
[PROOF STEP]
by (smt in_set_conv_nth in_set_member length_map list_all_length list_constr_def nth_map pairwise_rel_prime_1 welldefined)
[PROOF STATE]
proof (state)
this:
?x \<in> set (retrieve_polys qs I) \<Longrightarrow> coprime p ?x

goal (1 subgoal):
 1. 0 < poly (prod_list (retrieve_polys qs I)) x \<or> poly (prod_list (retrieve_polys qs I)) x < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set (retrieve_polys qs I) \<Longrightarrow> coprime p ?x
[PROOF STEP]
have coprimeh: "coprime p (prod_list (retrieve_polys qs I))"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set (retrieve_polys qs I) \<Longrightarrow> coprime p ?x

goal (1 subgoal):
 1. coprime p (prod_list (retrieve_polys qs I))
[PROOF STEP]
using prod_list_coprime_right
[PROOF STATE]
proof (prove)
using this:
?x \<in> set (retrieve_polys qs I) \<Longrightarrow> coprime p ?x
(\<And>x. x \<in> set ?xs \<Longrightarrow> coprime ?a x) \<Longrightarrow> coprime ?a (prod_list ?xs)

goal (1 subgoal):
 1. coprime p (prod_list (retrieve_polys qs I))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime p (prod_list (retrieve_polys qs I))

goal (1 subgoal):
 1. 0 < poly (prod_list (retrieve_polys qs I)) x \<or> poly (prod_list (retrieve_polys qs I)) x < 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
coprime p (prod_list (retrieve_polys qs I))

goal (1 subgoal):
 1. 0 < poly (prod_list (retrieve_polys qs I)) x \<or> poly (prod_list (retrieve_polys qs I)) x < 0
[PROOF STEP]
using root_p
[PROOF STATE]
proof (prove)
using this:
coprime p (prod_list (retrieve_polys qs I))
x \<in> {x. poly p x = 0}

goal (1 subgoal):
 1. 0 < poly (prod_list (retrieve_polys qs I)) x \<or> poly (prod_list (retrieve_polys qs I)) x < 0
[PROOF STEP]
using coprime_poly_0 linorder_neqE_linordered_idom
[PROOF STATE]
proof (prove)
using this:
coprime p (prod_list (retrieve_polys qs I))
x \<in> {x. poly p x = 0}
coprime ?p ?q \<Longrightarrow> poly ?p ?x \<noteq> (0::?'a) \<or> poly ?q ?x \<noteq> (0::?'a)
\<lbrakk>?x \<noteq> ?y; ?x < ?y \<Longrightarrow> ?thesis; ?y < ?x \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. 0 < poly (prod_list (retrieve_polys qs I)) x \<or> poly (prod_list (retrieve_polys qs I)) x < 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < poly (prod_list (retrieve_polys qs I)) x \<or> poly (prod_list (retrieve_polys qs I)) x < 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_sum_power_slide:
  assumes "m \<le> n"
  shows "x\<^bsub>0\<^esub>\<^bsup>m  \<^esup>\<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>0\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>0\<^esup>
 2. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 \<le> n

goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>0\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>0\<^esup>
 2. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 \<le> n

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>0\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>0\<^esup>
[PROOF STEP]
by (metis mult_onel mult_oner powsum_00)
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>0\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>0\<^esup>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>
Suc m \<le> n

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
note hyp = this
[PROOF STATE]
proof (state)
this:
m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>
Suc m \<le> n

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
have "x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>) \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>) \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>
[PROOF STEP]
by (simp add:powsum2)
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>) \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>) \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
have "... = x\<^bsub>0\<^esub>\<^bsup>m \<^esup>\<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> + x\<^bsup>Suc m \<^esup>\<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>) \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>
[PROOF STEP]
by (metis distrib_right')
[PROOF STATE]
proof (state)
this:
(x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>) \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>) \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
have "... = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m \<^esup>\<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>
[PROOF STEP]
by (metis Suc.hyps Suc.prems Suc_leD)
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
have "... = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsup>Suc m\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsup>Suc m\<^esup>
[PROOF STEP]
by (metis Suc.prems star_power_slide)
[PROOF STATE]
proof (state)
this:
(x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsup>Suc m\<^esup>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsup>Suc m\<^esup>

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
have "... = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsup>Suc m\<^esup> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>)
[PROOF STEP]
by (metis distrib_left)
[PROOF STATE]
proof (state)
this:
(x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsup>Suc m\<^esup> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>m \<le> n \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>m\<^esup>; Suc m \<le> n\<rbrakk> \<Longrightarrow> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> (x\<^bsub>0\<^esub>\<^bsup>m\<^esup> + x\<^bsup>Suc m\<^esup>)

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>
[PROOF STEP]
by (simp add:powsum2)
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup> \<cdot> (x\<^bsup>n\<^esup>)\<^sup>\<star> = (x\<^bsup>n\<^esup>)\<^sup>\<star> \<cdot> x\<^bsub>0\<^esub>\<^bsup>Suc m\<^esup>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sgn_rat [simp, code]: "sgn (Fract a b) = of_int (sgn a * sgn b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (Fract a b) = of_int (sgn a * sgn b)
[PROOF STEP]
unfolding Fract_of_int_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (Fract a b) = of_int (sgn a * sgn b)
[PROOF STEP]
by (auto simp: zsgn_def sgn_rat_def Zero_rat_def eq_rat)
    (auto simp: rat_number_collapse not_less le_less zero_less_mult_iff)


[STATEMENT]
lemma preimg_img_on_Union :
  assumes "\<phi> ` A \<subseteq> A"
  shows "A = \<Union>(preimg_img_on A \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = \<Union> (preimg_img_on A \<phi>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<phi> ` A \<subseteq> A

goal (1 subgoal):
 1. A = \<Union> (preimg_img_on A \<phi>)
[PROOF STEP]
by(fastforce simp: preimg_img_on_def)


[STATEMENT]
lemma set_to_list_Suc_map:
  assumes "finite S"
  shows "set_to_list (Suc ` S) = map Suc (set_to_list S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
obtain n where n_def: "n = card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. n = card S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n = card S

goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
have "\<And>S. card S = n \<Longrightarrow> set_to_list (Suc ` S) = map Suc (set_to_list S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
proof(induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. card S = 0 \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
 2. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
card S = 0

goal (2 subgoals):
 1. \<And>S. card S = 0 \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
 2. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card S = 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card S = 0

goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
by (metis card_eq_0_iff finite_imageD image_is_empty inj_Suc list.simps(8) set_to_list_empty)
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
card ?S = n \<Longrightarrow> sorted_list_of_set (Suc ` ?S) = map Suc (sorted_list_of_set ?S)
card S = Suc n

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
have 0: "S = insert (Min S) (S - {Min S})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = insert (Min S) (S - {Min S})
[PROOF STEP]
by (metis Min_in Suc.prems card_gt_0_iff insert_Diff zero_less_Suc)
[PROOF STATE]
proof (state)
this:
S = insert (Min S) (S - {Min S})

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
have 1: "sorted_list_of_set (Suc ` (S - {Min S})) = map Suc (sorted_list_of_set (S - {Min S}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (Suc ` (S - {Min S})) = map Suc (sorted_list_of_set (S - {Min S}))
[PROOF STEP]
by (metis "0" Suc.IH Suc.prems card_Diff_singleton card.infinite diff_Suc_1 insertI1 nat.simps(3))
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (Suc ` (S - {Min S})) = map Suc (sorted_list_of_set (S - {Min S}))

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
have 2: "set_to_list S = (Min S)#(set_to_list (S - {Min S}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set S = Min S # sorted_list_of_set (S - {Min S})
[PROOF STEP]
by (metis "0" DiffD1 Min_le Suc.prems card_Diff_singleton card.infinite card_insert_if
          diff_Suc_1 finite_Diff n_not_Suc_n nat.simps(3) nat_less_le set_to_list_insert_Min)
[PROOF STATE]
proof (state)
this:
sorted_list_of_set S = Min S # sorted_list_of_set (S - {Min S})

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
have 3: "sorted_list_of_set (Suc ` S) = (Min (Suc ` S))#(set_to_list ((Suc ` S) - {Min (Suc ` S)}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = Min (Suc ` S) # sorted_list_of_set (Suc ` S - {Min (Suc ` S)})
[PROOF STEP]
by (metis DiffD1 Diff_idemp Min_in Min_le Suc.prems card_Diff1_less card_eq_0_iff finite_Diff
          finite_imageI image_is_empty insert_Diff nat.simps(3) nat_less_le set_to_list_insert_Min)
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (Suc ` S) = Min (Suc ` S) # sorted_list_of_set (Suc ` S - {Min (Suc ` S)})

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
have 4: "(Min (Suc ` S)) = Suc (Min S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (Suc ` S) = Suc (Min S)
[PROOF STEP]
by (metis Min.hom_commute Suc.prems Suc_le_mono card_eq_0_iff min_def nat.simps(3))
[PROOF STATE]
proof (state)
this:
Min (Suc ` S) = Suc (Min S)

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
have 5: "sorted_list_of_set (Suc ` S) = Suc (Min S)#(set_to_list ((Suc ` S) - {Suc (Min S)}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = Suc (Min S) # sorted_list_of_set (Suc ` S - {Suc (Min S)})
[PROOF STEP]
using 3 4
[PROOF STATE]
proof (prove)
using this:
sorted_list_of_set (Suc ` S) = Min (Suc ` S) # sorted_list_of_set (Suc ` S - {Min (Suc ` S)})
Min (Suc ` S) = Suc (Min S)

goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = Suc (Min S) # sorted_list_of_set (Suc ` S - {Suc (Min S)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (Suc ` S) = Suc (Min S) # sorted_list_of_set (Suc ` S - {Suc (Min S)})

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
have 6: "sorted_list_of_set (Suc ` S) = Suc (Min S)#(set_to_list (Suc ` (S - {Min S})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = Suc (Min S) # sorted_list_of_set (Suc ` (S - {Min S}))
[PROOF STEP]
by (metis (no_types, lifting) "0" "5" Diff_insert_absorb image_insert inj_Suc inj_on_insert)
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (Suc ` S) = Suc (Min S) # sorted_list_of_set (Suc ` (S - {Min S}))

goal (1 subgoal):
 1. \<And>n S. \<lbrakk>\<And>S. card S = n \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S); card S = Suc n\<rbrakk> \<Longrightarrow> sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
using 6
[PROOF STATE]
proof (prove)
using this:
sorted_list_of_set (Suc ` S) = Suc (Min S) # sorted_list_of_set (Suc ` (S - {Min S}))

goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
by (simp add: "1" "2")
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card ?S = n \<Longrightarrow> sorted_list_of_set (Suc ` ?S) = map Suc (sorted_list_of_set ?S)

goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card ?S = n \<Longrightarrow> sorted_list_of_set (Suc ` ?S) = map Suc (sorted_list_of_set ?S)

goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
using n_def
[PROOF STATE]
proof (prove)
using this:
card ?S = n \<Longrightarrow> sorted_list_of_set (Suc ` ?S) = map Suc (sorted_list_of_set ?S)
n = card S

goal (1 subgoal):
 1. sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (Suc ` S) = map Suc (sorted_list_of_set S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma neg_le_minus_divide_eq [field_simps]: "c < 0 \<Longrightarrow> a \<le> - (b / c) \<longleftrightarrow> - b \<le> a * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> (a \<le> - (b / c)) = (- b \<le> a * c)
[PROOF STEP]
unfolding minus_divide_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> (a \<le> - b / c) = (- b \<le> a * c)
[PROOF STEP]
by (rule neg_le_divide_eq)


[STATEMENT]
lemma x0_hb_bound5:
  assumes "x \<ge> x\<^sub>1" "i < k"
  shows   "(bs ! i + (hs ! i) x / x) \<le> bs ! i * 3/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
have "(hs ! i) x \<le> \<bar>(hs ! i) x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (hs ! i) x \<le> \<bar>(hs ! i) x\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(hs ! i) x \<le> \<bar>(hs ! i) x\<bar>

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(hs ! i) x \<le> \<bar>(hs ! i) x\<bar>

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x\<^sub>1 \<le> x
i < k
[PROOF STEP]
have "... \<le> hb * x / ln x powr (1 + e)"
[PROOF STATE]
proof (prove)
using this:
x\<^sub>1 \<le> x
i < k

goal (1 subgoal):
 1. \<bar>(hs ! i) x\<bar> \<le> hb * x / ln x powr (1 + e)
[PROOF STEP]
by (simp add: h_bounds)
[PROOF STATE]
proof (state)
this:
\<bar>(hs ! i) x\<bar> \<le> hb * x / ln x powr (1 + e)

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>(hs ! i) x\<bar> \<le> hb * x / ln x powr (1 + e)

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
have "... = x * (hb / ln x powr (1 + e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hb * x / ln x powr (1 + e) = x * (hb / ln x powr (1 + e))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hb * x / ln x powr (1 + e) = x * (hb / ln x powr (1 + e))

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
hb * x / ln x powr (1 + e) = x * (hb / ln x powr (1 + e))

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
from assms x0_pos x0_le_x1
[PROOF STATE]
proof (chain)
picking this:
x\<^sub>1 \<le> x
i < k
0 < x\<^sub>0
x\<^sub>0 \<le> x\<^sub>1
[PROOF STEP]
have "... < x * (bs ! i / 2)"
[PROOF STATE]
proof (prove)
using this:
x\<^sub>1 \<le> x
i < k
0 < x\<^sub>0
x\<^sub>0 \<le> x\<^sub>1

goal (1 subgoal):
 1. x * (hb / ln x powr (1 + e)) < x * (bs ! i / 2)
[PROOF STEP]
by (intro mult_strict_left_mono x0_hb_bound0) simp_all
[PROOF STATE]
proof (state)
this:
x * (hb / ln x powr (1 + e)) < x * (bs ! i / 2)

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(hs ! i) x < x * (bs ! i / 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(hs ! i) x < x * (bs ! i / 2)

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
using assms x1_pos
[PROOF STATE]
proof (prove)
using this:
(hs ! i) x < x * (bs ! i / 2)
x\<^sub>1 \<le> x
i < k
0 < x\<^sub>1

goal (1 subgoal):
 1. bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
bs ! i + (hs ! i) x / x \<le> bs ! i * 3 / 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_depressed_cubic: fixes a :: "'a :: field_char_0"
  assumes a: "a \<noteq> 0"
  and xy: "x = y - b / (3 * a)"
  and e: "e = (c - b^2 / (3 * a)) / a"
  and f: "f = (d + 2 * b^3 / (27 * a^2) - b * c / (3 * a)) / a"
shows "(a * x ^ 3 + b * x\<^sup>2 + c * x + d = 0) \<longleftrightarrow> y^3 + e * y + f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))
[PROOF STEP]
let ?yexp = "y^3 + e * y + f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))
[PROOF STEP]
have "a * x^3 + b * x^2 + c * x + d = 0 \<longleftrightarrow> (a * x^3 + b * x^2 + c * x + d) / a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = ((a * x ^ 3 + b * x\<^sup>2 + c * x + d) / a = (0::'a))
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

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

goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = ((a * x ^ 3 + b * x\<^sup>2 + c * x + d) / a = (0::'a))

goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))
[PROOF STEP]
have "(a * x^3 + b * x^2 + c * x + d) / a = ?yexp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d) / a = y ^ 3 + e * y + f
[PROOF STEP]
unfolding xy e f power3_eq_cube power2_eq_square
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * ((y - b / ((3::'a) * a)) * (y - b / ((3::'a) * a)) * (y - b / ((3::'a) * a))) + b * ((y - b / ((3::'a) * a)) * (y - b / ((3::'a) * a))) + c * (y - b / ((3::'a) * a)) + d) / a = y * y * y + (c - b * b / ((3::'a) * a)) / a * y + (d + (2::'a) * (b * b * b) / ((27::'a) * (a * a)) - b * c / ((3::'a) * a)) / a
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. (a * ((y - b / ((3::'a) * a)) * (y - b / ((3::'a) * a)) * (y - b / ((3::'a) * a))) + b * ((y - b / ((3::'a) * a)) * (y - b / ((3::'a) * a))) + c * (y - b / ((3::'a) * a)) + d) / a = y * y * y + (c - b * b / ((3::'a) * a)) / a * y + (d + (2::'a) * (b * b * b) / ((27::'a) * (a * a)) - b * c / ((3::'a) * a)) / a
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(a * x ^ 3 + b * x\<^sup>2 + c * x + d) / a = y ^ 3 + e * y + f

goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))

goal (1 subgoal):
 1. (a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(a * x ^ 3 + b * x\<^sup>2 + c * x + d = (0::'a)) = (y ^ 3 + e * y + f = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_plus_assoc: assumes wf: "mat nr nc m1" "mat nr nc m2" "mat nr nc m3"
  shows "mat_plus m1 (mat_plus m2 m3) = mat_plus (mat_plus m1 m2) m3" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_plus m1 (mat_plus m2 m3) = mat_plus (mat_plus m1 m2) m3
[PROOF STEP]
proof (rule mat_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus m1 (mat_plus m2 m3))
 2. mat ?nr ?nc (mat_plus (mat_plus m1 m2) m3)
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus m1 (mat_plus m2 m3) ! i ! j = mat_plus (mat_plus m1 m2) m3 ! i ! j
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus m1 (mat_plus m2 m3))
 2. mat ?nr ?nc (mat_plus (mat_plus m1 m2) m3)
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus m1 (mat_plus m2 m3) ! i ! j = mat_plus (mat_plus m1 m2) m3 ! i ! j
[PROOF STEP]
assume "i < nc" "j < nr"
[PROOF STATE]
proof (state)
this:
i < nc
j < nr

goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus m1 (mat_plus m2 m3))
 2. mat ?nr ?nc (mat_plus (mat_plus m1 m2) m3)
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus m1 (mat_plus m2 m3) ! i ! j = mat_plus (mat_plus m1 m2) m3 ! i ! j
[PROOF STEP]
note [simp] = mat_plus_index[OF _ _ this]
[PROOF STATE]
proof (state)
this:
\<lbrakk>mat nr nc ?m1.0; mat nr nc ?m2.0\<rbrakk> \<Longrightarrow> mat_plusI ?pl ?m1.0 ?m2.0 ! i ! j = ?pl (?m1.0 ! i ! j) (?m2.0 ! i ! j)

goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus m1 (mat_plus m2 m3))
 2. mat ?nr ?nc (mat_plus (mat_plus m1 m2) m3)
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus m1 (mat_plus m2 m3) ! i ! j = mat_plus (mat_plus m1 m2) m3 ! i ! j
[PROOF STEP]
show "?l ! i ! j = ?r ! i ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_plus m1 (mat_plus m2 m3) ! i ! j = mat_plus (mat_plus m1 m2) m3 ! i ! j
[PROOF STEP]
using wf
[PROOF STATE]
proof (prove)
using this:
mat nr nc m1
mat nr nc m2
mat nr nc m3

goal (1 subgoal):
 1. mat_plus m1 (mat_plus m2 m3) ! i ! j = mat_plus (mat_plus m1 m2) m3 ! i ! j
[PROOF STEP]
by (simp add: add.assoc)
[PROOF STATE]
proof (state)
this:
mat_plus m1 (mat_plus m2 m3) ! i ! j = mat_plus (mat_plus m1 m2) m3 ! i ! j

goal (2 subgoals):
 1. mat nr nc (mat_plus m1 (mat_plus m2 m3))
 2. mat nr nc (mat_plus (mat_plus m1 m2) m3)
[PROOF STEP]
qed (auto simp: wf)


[STATEMENT]
lemma fold_mset_add_carrier: "a \<in> carrier G \<Longrightarrow> set_mset M \<subseteq> carrier G \<Longrightarrow> fold_mset (\<oplus>) a M \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; set_mset M \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) a M \<in> carrier G
[PROOF STEP]
proof (induct M arbitrary: a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. \<lbrakk>a \<in> carrier G; set_mset {#} \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) a {#} \<in> carrier G
 2. \<And>x M a. \<lbrakk>\<And>a. \<lbrakk>a \<in> carrier G; set_mset M \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) a M \<in> carrier G; a \<in> carrier G; set_mset (add_mset x M) \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) a (add_mset x M) \<in> carrier G
[PROOF STEP]
case (add x M)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> carrier G; set_mset M \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) ?a M \<in> carrier G
a \<in> carrier G
set_mset (add_mset x M) \<subseteq> carrier G

goal (2 subgoals):
 1. \<And>a. \<lbrakk>a \<in> carrier G; set_mset {#} \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) a {#} \<in> carrier G
 2. \<And>x M a. \<lbrakk>\<And>a. \<lbrakk>a \<in> carrier G; set_mset M \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) a M \<in> carrier G; a \<in> carrier G; set_mset (add_mset x M) \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) a (add_mset x M) \<in> carrier G
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> carrier G; set_mset M \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) ?a M \<in> carrier G
a \<in> carrier G
set_mset (add_mset x M) \<subseteq> carrier G

goal (1 subgoal):
 1. fold_mset (\<oplus>) a (add_mset x M) \<in> carrier G
[PROOF STEP]
by
    (subst comp_fun_commute_on.fold_mset_add_mset[of _ "carrier G"], unfold_locales, auto simp: a_lcomm)
[PROOF STATE]
proof (state)
this:
fold_mset (\<oplus>) a (add_mset x M) \<in> carrier G

goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<in> carrier G; set_mset {#} \<subseteq> carrier G\<rbrakk> \<Longrightarrow> fold_mset (\<oplus>) a {#} \<in> carrier G
[PROOF STEP]
qed simp


[STATEMENT]
lemma least_eq_iff:
  assumes "finite B"
  assumes "A \<subseteq> B"
  assumes "\<And>x. x \<in> B \<Longrightarrow> rank_of x B < k \<Longrightarrow> x \<in> A"
  shows "least k A = least k B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K_Smallest.least k A = K_Smallest.least k B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. K_Smallest.least k A = K_Smallest.least k B
[PROOF STEP]
have "least k B \<subseteq> least k A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K_Smallest.least k B \<subseteq> K_Smallest.least k A
[PROOF STEP]
using assms rank_mono_2[OF assms(1,2)] order_le_less_trans
[PROOF STATE]
proof (prove)
using this:
finite B
A \<subseteq> B
\<lbrakk>?x \<in> B; rank_of ?x B < k\<rbrakk> \<Longrightarrow> ?x \<in> A
rank_of ?x A \<le> rank_of ?x B
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. K_Smallest.least k B \<subseteq> K_Smallest.least k A
[PROOF STEP]
by (simp add:least_def, blast)
[PROOF STATE]
proof (state)
this:
K_Smallest.least k B \<subseteq> K_Smallest.least k A

goal (1 subgoal):
 1. K_Smallest.least k A = K_Smallest.least k B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
K_Smallest.least k B \<subseteq> K_Smallest.least k A

goal (1 subgoal):
 1. K_Smallest.least k A = K_Smallest.least k B
[PROOF STEP]
have "card (least k B) \<ge> card (least k A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (K_Smallest.least k A) \<le> card (K_Smallest.least k B)
[PROOF STEP]
using assms finite_subset[OF assms(2,1)] card_mono[OF assms(1,2)]
[PROOF STATE]
proof (prove)
using this:
finite B
A \<subseteq> B
\<lbrakk>?x \<in> B; rank_of ?x B < k\<rbrakk> \<Longrightarrow> ?x \<in> A
finite A
card A \<le> card B

goal (1 subgoal):
 1. card (K_Smallest.least k A) \<le> card (K_Smallest.least k B)
[PROOF STEP]
by (simp add: card_least min_le_iff_disj)
[PROOF STATE]
proof (state)
this:
card (K_Smallest.least k A) \<le> card (K_Smallest.least k B)

goal (1 subgoal):
 1. K_Smallest.least k A = K_Smallest.least k B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (K_Smallest.least k A) \<le> card (K_Smallest.least k B)

goal (1 subgoal):
 1. K_Smallest.least k A = K_Smallest.least k B
[PROOF STEP]
have "finite (least k A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (K_Smallest.least k A)
[PROOF STEP]
using finite_subset least_subset assms(1,2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
K_Smallest.least ?k ?S \<subseteq> ?S
finite B
A \<subseteq> B

goal (1 subgoal):
 1. finite (K_Smallest.least k A)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
finite (K_Smallest.least k A)

goal (1 subgoal):
 1. K_Smallest.least k A = K_Smallest.least k B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
K_Smallest.least k B \<subseteq> K_Smallest.least k A
card (K_Smallest.least k A) \<le> card (K_Smallest.least k B)
finite (K_Smallest.least k A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
K_Smallest.least k B \<subseteq> K_Smallest.least k A
card (K_Smallest.least k A) \<le> card (K_Smallest.least k B)
finite (K_Smallest.least k A)

goal (1 subgoal):
 1. K_Smallest.least k A = K_Smallest.least k B
[PROOF STEP]
by (intro card_seteq[symmetric], simp_all)
[PROOF STATE]
proof (state)
this:
K_Smallest.least k A = K_Smallest.least k B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj2_Col_distinct_coeff_non_zero:
  assumes "proj2_Col p q r" and "p \<noteq> q" and "r \<noteq> p" and "r \<noteq> q"
  shows "proj2_Col_coeff p q r \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_Col_coeff p q r \<noteq> 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proj2_Col_coeff p q r = 0 \<Longrightarrow> False
[PROOF STEP]
assume "proj2_Col_coeff p q r = 0"
[PROOF STATE]
proof (state)
this:
proj2_Col_coeff p q r = 0

goal (1 subgoal):
 1. proj2_Col_coeff p q r = 0 \<Longrightarrow> False
[PROOF STEP]
from \<open>proj2_Col p q r\<close> and \<open>p \<noteq> q\<close> and \<open>r \<noteq> p\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_Col p q r
p \<noteq> q
r \<noteq> p
[PROOF STEP]
have "r = proj2_abs ((proj2_Col_coeff p q r) *\<^sub>R proj2_rep p + proj2_rep q)"
[PROOF STATE]
proof (prove)
using this:
proj2_Col p q r
p \<noteq> q
r \<noteq> p

goal (1 subgoal):
 1. r = proj2_abs (proj2_Col_coeff p q r *\<^sub>R proj2_rep p + proj2_rep q)
[PROOF STEP]
by (rule proj2_Col_coeff)
[PROOF STATE]
proof (state)
this:
r = proj2_abs (proj2_Col_coeff p q r *\<^sub>R proj2_rep p + proj2_rep q)

goal (1 subgoal):
 1. proj2_Col_coeff p q r = 0 \<Longrightarrow> False
[PROOF STEP]
with \<open>proj2_Col_coeff p q r = 0\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_Col_coeff p q r = 0
r = proj2_abs (proj2_Col_coeff p q r *\<^sub>R proj2_rep p + proj2_rep q)
[PROOF STEP]
have "r = q"
[PROOF STATE]
proof (prove)
using this:
proj2_Col_coeff p q r = 0
r = proj2_abs (proj2_Col_coeff p q r *\<^sub>R proj2_rep p + proj2_rep q)

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

goal (1 subgoal):
 1. proj2_Col_coeff p q r = 0 \<Longrightarrow> False
[PROOF STEP]
with \<open>r \<noteq> q\<close>
[PROOF STATE]
proof (chain)
picking this:
r \<noteq> q
r = q
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
r \<noteq> q
r = q

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_bool_lists_correct: "set (all_bool_lists x) = {xs. length xs = x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (all_bool_lists x) = {xs. length xs = x}
[PROOF STEP]
proof(standard)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (all_bool_lists x) \<subseteq> {xs. length xs = x}
 2. {xs. length xs = x} \<subseteq> set (all_bool_lists x)
[PROOF STEP]
show "set (all_bool_lists x) \<subseteq> {xs. length xs = x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (all_bool_lists x) \<subseteq> {xs. length xs = x}
[PROOF STEP]
by (induct x) auto
[PROOF STATE]
proof (state)
this:
set (all_bool_lists x) \<subseteq> {xs. length xs = x}

goal (1 subgoal):
 1. {xs. length xs = x} \<subseteq> set (all_bool_lists x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {xs. length xs = x} \<subseteq> set (all_bool_lists x)
[PROOF STEP]
show "{xs. length xs = x} \<subseteq> set (all_bool_lists x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. length xs = x} \<subseteq> set (all_bool_lists x)
[PROOF STEP]
proof(induct x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {xs. length xs = 0} \<subseteq> set (all_bool_lists 0)
 2. \<And>x. {xs. length xs = x} \<subseteq> set (all_bool_lists x) \<Longrightarrow> {xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. {xs. length xs = 0} \<subseteq> set (all_bool_lists 0)
 2. \<And>x. {xs. length xs = x} \<subseteq> set (all_bool_lists x) \<Longrightarrow> {xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. length xs = 0} \<subseteq> set (all_bool_lists 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{xs. length xs = 0} \<subseteq> set (all_bool_lists 0)

goal (1 subgoal):
 1. \<And>x. {xs. length xs = x} \<subseteq> set (all_bool_lists x) \<Longrightarrow> {xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. {xs. length xs = x} \<subseteq> set (all_bool_lists x) \<Longrightarrow> {xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))
[PROOF STEP]
case (Suc x)
[PROOF STATE]
proof (state)
this:
{xs. length xs = x} \<subseteq> set (all_bool_lists x)

goal (1 subgoal):
 1. \<And>x. {xs. length xs = x} \<subseteq> set (all_bool_lists x) \<Longrightarrow> {xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))
[PROOF STEP]
have "length ys = Suc x \<Longrightarrow> \<exists>xs. ys = False # xs \<or> ys = True # xs" for ys
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ys = Suc x \<Longrightarrow> \<exists>xs. ys = False # xs \<or> ys = True # xs
[PROOF STEP]
by (metis (full_types) Suc_length_conv)
[PROOF STATE]
proof (state)
this:
length ?ys = Suc x \<Longrightarrow> \<exists>xs. ?ys = False # xs \<or> ?ys = True # xs

goal (1 subgoal):
 1. \<And>x. {xs. length xs = x} \<subseteq> set (all_bool_lists x) \<Longrightarrow> {xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length ?ys = Suc x \<Longrightarrow> \<exists>xs. ?ys = False # xs \<or> ?ys = True # xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length ?ys = Suc x \<Longrightarrow> \<exists>xs. ?ys = False # xs \<or> ?ys = True # xs

goal (1 subgoal):
 1. {xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
length ?ys = Suc x \<Longrightarrow> \<exists>xs. ?ys = False # xs \<or> ?ys = True # xs
{xs. length xs = x} \<subseteq> set (all_bool_lists x)

goal (1 subgoal):
 1. {xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{xs. length xs = Suc x} \<subseteq> set (all_bool_lists (Suc x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{xs. length xs = x} \<subseteq> set (all_bool_lists x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lambert_W_strict_mono:
  assumes "x \<ge> -exp(-1)" "x < y"
  shows   "Lambert_W x < Lambert_W y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lambert_W x < Lambert_W y
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Lambert_W x < Lambert_W y \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(Lambert_W x < Lambert_W y)"
[PROOF STATE]
proof (state)
this:
\<not> Lambert_W x < Lambert_W y

goal (1 subgoal):
 1. \<not> Lambert_W x < Lambert_W y \<Longrightarrow> False
[PROOF STEP]
hence "Lambert_W x * exp (Lambert_W x) \<ge> Lambert_W y * exp (Lambert_W y)"
[PROOF STATE]
proof (prove)
using this:
\<not> Lambert_W x < Lambert_W y

goal (1 subgoal):
 1. Lambert_W y * exp (Lambert_W y) \<le> Lambert_W x * exp (Lambert_W x)
[PROOF STEP]
by (intro exp_times_self_mono) (auto simp: Lambert_W_ge)
[PROOF STATE]
proof (state)
this:
Lambert_W y * exp (Lambert_W y) \<le> Lambert_W x * exp (Lambert_W x)

goal (1 subgoal):
 1. \<not> Lambert_W x < Lambert_W y \<Longrightarrow> False
[PROOF STEP]
hence "x \<ge> y"
[PROOF STATE]
proof (prove)
using this:
Lambert_W y * exp (Lambert_W y) \<le> Lambert_W x * exp (Lambert_W x)

goal (1 subgoal):
 1. y \<le> x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Lambert_W y * exp (Lambert_W y) \<le> Lambert_W x * exp (Lambert_W x)
- exp (- 1) \<le> x
x < y

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

goal (1 subgoal):
 1. \<not> Lambert_W x < Lambert_W y \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
- exp (- 1) \<le> x
x < y
y \<le> x
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
- exp (- 1) \<le> x
x < y
y \<le> x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in comm_semiring_0) poly_cmult: "poly (c %* p) x = c * poly p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (c %* p) x = c * poly p x
[PROOF STEP]
proof (induct p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly (c %* []) x = c * poly [] x
 2. \<And>a p. poly (c %* p) x = c * poly p x \<Longrightarrow> poly (c %* (a # p)) x = c * poly (a # p) x
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. poly (c %* []) x = c * poly [] x
 2. \<And>a p. poly (c %* p) x = c * poly p x \<Longrightarrow> poly (c %* (a # p)) x = c * poly (a # p) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (c %* []) x = c * poly [] x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly (c %* []) x = c * poly [] x

goal (1 subgoal):
 1. \<And>a p. poly (c %* p) x = c * poly p x \<Longrightarrow> poly (c %* (a # p)) x = c * poly (a # p) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. poly (c %* p) x = c * poly p x \<Longrightarrow> poly (c %* (a # p)) x = c * poly (a # p) x
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
poly (c %* p_) x = c * poly p_ x

goal (1 subgoal):
 1. \<And>a p. poly (c %* p) x = c * poly p x \<Longrightarrow> poly (c %* (a # p)) x = c * poly (a # p) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly (c %* p_) x = c * poly p_ x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
poly (c %* p_) x = c * poly p_ x

goal (1 subgoal):
 1. poly (c %* (a_ # p_)) x = c * poly (a_ # p_) x
[PROOF STEP]
by (cases "x = zero") (auto simp add: distrib_left ac_simps)
[PROOF STATE]
proof (state)
this:
poly (c %* (a_ # p_)) x = c * poly (a_ # p_) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma positive_one:
  "positive (1\<^sub>m n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positive (1\<^sub>m n)
[PROOF STEP]
proof (rule positive_if_decomp)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1\<^sub>m n \<in> carrier_mat ?n ?n
 2. \<exists>M. M * adjoint M = 1\<^sub>m n
[PROOF STEP]
show "1\<^sub>m n \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m n \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1\<^sub>m n \<in> carrier_mat n n

goal (1 subgoal):
 1. \<exists>M. M * adjoint M = 1\<^sub>m n
[PROOF STEP]
have "adjoint (1\<^sub>m n) = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint (1\<^sub>m n) = 1\<^sub>m n
[PROOF STEP]
using hermitian_one hermitian_def
[PROOF STATE]
proof (prove)
using this:
hermitian (1\<^sub>m ?n)
hermitian ?A = (adjoint ?A = ?A)

goal (1 subgoal):
 1. adjoint (1\<^sub>m n) = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjoint (1\<^sub>m n) = 1\<^sub>m n

goal (1 subgoal):
 1. \<exists>M. M * adjoint M = 1\<^sub>m n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
adjoint (1\<^sub>m n) = 1\<^sub>m n
[PROOF STEP]
have "1\<^sub>m n * adjoint (1\<^sub>m n) = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
adjoint (1\<^sub>m n) = 1\<^sub>m n

goal (1 subgoal):
 1. 1\<^sub>m n * adjoint (1\<^sub>m n) = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1\<^sub>m n * adjoint (1\<^sub>m n) = 1\<^sub>m n

goal (1 subgoal):
 1. \<exists>M. M * adjoint M = 1\<^sub>m n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1\<^sub>m n * adjoint (1\<^sub>m n) = 1\<^sub>m n
[PROOF STEP]
show "\<exists>M. M * adjoint M = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
1\<^sub>m n * adjoint (1\<^sub>m n) = 1\<^sub>m n

goal (1 subgoal):
 1. \<exists>M. M * adjoint M = 1\<^sub>m n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>M. M * adjoint M = 1\<^sub>m n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uminus_axis_eq[simp]: "- axis i k = axis i (-k)" for k :: "'a::ring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - axis i k = axis i (- k)
[PROOF STEP]
unfolding axis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<chi>ia. if ia = i then k else (0::'a)) = (\<chi>ia. if ia = i then - k else (0::'a))
[PROOF STEP]
by(simp add: vec_eq_iff)


[STATEMENT]
lemma ln_x_over_x_tendsto_0: "((\<lambda>x::real. ln x / x) \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ln x / x) \<longlongrightarrow> 0) at_top
[PROOF STEP]
proof (rule lhospital_at_top_at_top[where f' = inverse and g' = "\<lambda>_. 1"])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. LIM x at_top. x :> at_top
 2. \<forall>\<^sub>F x in at_top. 1 \<noteq> 0
 3. \<forall>\<^sub>F x in at_top. (ln has_real_derivative inverse x) (at x)
 4. \<forall>\<^sub>F x in at_top. ((\<lambda>x. x) has_real_derivative 1) (at x)
 5. ((\<lambda>x. inverse x / 1) \<longlongrightarrow> 0) at_top
[PROOF STEP]
from eventually_gt_at_top[of "0::real"]
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) 0) at_top
[PROOF STEP]
show "\<forall>\<^sub>F x in at_top. (ln has_real_derivative inverse x) (at x)"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. (ln has_real_derivative inverse x) (at x)
[PROOF STEP]
by eventually_elim (auto intro!: derivative_eq_intros simp: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. (ln has_real_derivative inverse x) (at x)

goal (4 subgoals):
 1. LIM x at_top. x :> at_top
 2. \<forall>\<^sub>F x in at_top. 1 \<noteq> 0
 3. \<forall>\<^sub>F x in at_top. ((\<lambda>x. x) has_real_derivative 1) (at x)
 4. ((\<lambda>x. inverse x / 1) \<longlongrightarrow> 0) at_top
[PROOF STEP]
qed (use tendsto_inverse_0 in
      \<open>auto simp: filterlim_ident dest!: tendsto_mono[OF at_top_le_at_infinity]\<close>)


[STATEMENT]
lemma sets_Collect_restrict_space_iff:
  assumes "S \<in> sets M"
  shows "{x\<in>space (restrict_space M S). P x} \<in> sets (restrict_space M S) \<longleftrightarrow> {x\<in>space M. x \<in> S \<and> P x} \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x \<in> space (restrict_space M S). P x} \<in> sets (restrict_space M S)) = ({x \<in> space M. x \<in> S \<and> P x} \<in> sets M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ({x \<in> space (restrict_space M S). P x} \<in> sets (restrict_space M S)) = ({x \<in> space M. x \<in> S \<and> P x} \<in> sets M)
[PROOF STEP]
have "{x\<in>S. P x} = {x\<in>space M. x \<in> S \<and> P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> S. P x} = {x \<in> space M. x \<in> S \<and> P x}
[PROOF STEP]
using sets.sets_into_space[OF assms]
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> space M

goal (1 subgoal):
 1. {x \<in> S. P x} = {x \<in> space M. x \<in> S \<and> P x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> S. P x} = {x \<in> space M. x \<in> S \<and> P x}

goal (1 subgoal):
 1. ({x \<in> space (restrict_space M S). P x} \<in> sets (restrict_space M S)) = ({x \<in> space M. x \<in> S \<and> P x} \<in> sets M)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x \<in> S. P x} = {x \<in> space M. x \<in> S \<and> P x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{x \<in> S. P x} = {x \<in> space M. x \<in> S \<and> P x}

goal (1 subgoal):
 1. ({x \<in> space (restrict_space M S). P x} \<in> sets (restrict_space M S)) = ({x \<in> space M. x \<in> S \<and> P x} \<in> sets M)
[PROOF STEP]
by (subst sets_restrict_space_iff) (auto simp add: space_restrict_space assms)
[PROOF STATE]
proof (state)
this:
({x \<in> space (restrict_space M S). P x} \<in> sets (restrict_space M S)) = ({x \<in> space M. x \<in> S \<and> P x} \<in> sets M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in field) degree_one_imp_splitted:
  assumes "p \<in> carrier (poly_ring R)" and "degree p = 1" shows "splitted p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. splitted p
[PROOF STEP]
using degree_one_imp_singleton_roots[OF assms] assms(2)
[PROOF STATE]
proof (prove)
using this:
roots p = {#\<ominus> (inv lead_coeff p \<otimes> const_term p)#}
degree p = 1

goal (1 subgoal):
 1. splitted p
[PROOF STEP]
unfolding splitted_def
[PROOF STATE]
proof (prove)
using this:
roots p = {#\<ominus> (inv lead_coeff p \<otimes> const_term p)#}
degree p = 1

goal (1 subgoal):
 1. size (roots p) = degree p
[PROOF STEP]
by simp


[STATEMENT]
lemma scaleR_eq_self_cancel:
  fixes x::"'a::real_vector"
  shows "a *\<^sub>R x = x \<longleftrightarrow> a = 1 \<or> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>R x = x) = (a = 1 \<or> x = (0::'a))
[PROOF STEP]
using scaleR_cancel_right[of a x 1]
[PROOF STATE]
proof (prove)
using this:
(a *\<^sub>R x = 1 *\<^sub>R x) = (a = 1 \<or> x = (0::'a))

goal (1 subgoal):
 1. (a *\<^sub>R x = x) = (a = 1 \<or> x = (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma inj_on_xor_list_nlists [simp]:
  fixes xs :: "'a :: boolean_algebra list"
  shows "n \<le> length xs \<Longrightarrow> inj_on (xor_list xs) (nlists UNIV n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length xs \<Longrightarrow> inj_on (([\<oplus>]) xs) (nlists UNIV n)
[PROOF STEP]
apply(clarsimp simp add: inj_on_def in_nlists_UNIV)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>length x \<le> length xs; length y = length x; xs [\<oplus>] x = xs [\<oplus>] y; n = length x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using xor_list_left_inverse
[PROOF STATE]
proof (prove)
using this:
length ?ys \<le> length ?xs \<Longrightarrow> ?xs [\<oplus>] ?xs [\<oplus>] ?ys = ?ys

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>length x \<le> length xs; length y = length x; xs [\<oplus>] x = xs [\<oplus>] y; n = length x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma card2_sunflower: assumes "finite S" and "card S \<le> 2"
  shows "sunflower S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sunflower S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sunflower S
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite S
card S \<le> 2
[PROOF STEP]
have "card S = 0 \<or> card S = Suc 0 \<or> card S = 2"
[PROOF STATE]
proof (prove)
using this:
finite S
card S \<le> 2

goal (1 subgoal):
 1. card S = 0 \<or> card S = Suc 0 \<or> card S = 2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
card S = 0 \<or> card S = Suc 0 \<or> card S = 2

goal (1 subgoal):
 1. sunflower S
[PROOF STEP]
with \<open>finite S\<close>
[PROOF STATE]
proof (chain)
picking this:
finite S
card S = 0 \<or> card S = Suc 0 \<or> card S = 2
[PROOF STEP]
obtain A B where "S = {} \<or> S = {A} \<or> S = {A,B}"
[PROOF STATE]
proof (prove)
using this:
finite S
card S = 0 \<or> card S = Suc 0 \<or> card S = 2

goal (1 subgoal):
 1. (\<And>A B. S = {} \<or> S = {A} \<or> S = {A, B} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using card_2_iff[of S] card_1_singleton_iff[of S]
[PROOF STATE]
proof (prove)
using this:
finite S
card S = 0 \<or> card S = Suc 0 \<or> card S = 2
(card S = 2) = (\<exists>x y. S = {x, y} \<and> x \<noteq> y)
(card S = Suc 0) = (\<exists>x. S = {x})

goal (1 subgoal):
 1. (\<And>A B. S = {} \<or> S = {A} \<or> S = {A, B} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S = {} \<or> S = {A} \<or> S = {A, B}

goal (1 subgoal):
 1. sunflower S
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {} \<or> S = {A} \<or> S = {A, B}

goal (1 subgoal):
 1. sunflower S
[PROOF STEP]
unfolding sunflower_def
[PROOF STATE]
proof (prove)
using this:
S = {} \<or> S = {A} \<or> S = {A, B}

goal (1 subgoal):
 1. \<forall>x. (\<exists>A B. A \<in> S \<and> B \<in> S \<and> A \<noteq> B \<and> x \<in> A \<and> x \<in> B) \<longrightarrow> (\<forall>A. A \<in> S \<longrightarrow> x \<in> A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sunflower S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_integer_ge:
  \<open>b \<le> x mod (a + 1)\<close> if \<open>b \<le> 0\<close> \<open>0 < a\<close> for a b x :: integer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<le> x mod (a + 1)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
b \<le> 0
0 < a

goal (1 subgoal):
 1. b \<le> x mod (a + 1)
[PROOF STEP]
including integer.lifting
[PROOF STATE]
proof (prove)
using this:
b \<le> 0
0 < a

goal (1 subgoal):
 1. b \<le> x mod (a + 1)
[PROOF STEP]
proof transfer
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b a x. \<lbrakk>b \<le> 0; 0 < a\<rbrakk> \<Longrightarrow> b \<le> x mod (a + 1)
[PROOF STEP]
fix a b x :: int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b a x. \<lbrakk>b \<le> 0; 0 < a\<rbrakk> \<Longrightarrow> b \<le> x mod (a + 1)
[PROOF STEP]
assume \<open>b \<le> 0\<close> \<open>0 < a\<close>
[PROOF STATE]
proof (state)
this:
b \<le> 0
0 < a

goal (1 subgoal):
 1. \<And>b a x. \<lbrakk>b \<le> 0; 0 < a\<rbrakk> \<Longrightarrow> b \<le> x mod (a + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<le> 0
0 < a
[PROOF STEP]
have \<open>0 \<le> x mod (a + 1)\<close>
[PROOF STATE]
proof (prove)
using this:
b \<le> 0
0 < a

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

goal (1 subgoal):
 1. \<And>b a x. \<lbrakk>b \<le> 0; 0 < a\<rbrakk> \<Longrightarrow> b \<le> x mod (a + 1)
[PROOF STEP]
with \<open>b \<le> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<le> 0
0 \<le> x mod (a + 1)
[PROOF STEP]
show \<open>b \<le> x mod (a + 1)\<close>
[PROOF STATE]
proof (prove)
using this:
b \<le> 0
0 \<le> x mod (a + 1)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_neg:
  assumes "F\<noteq>bot"  and eve:"eventually (\<lambda>x. P x) F"
  shows "\<not> eventually (\<lambda>x. \<not> P x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F x in F. \<not> P x)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> \<not> (\<forall>\<^sub>F x in F. \<not> P x) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> \<not> eventually (\<lambda>x. \<not> P x) F"
[PROOF STATE]
proof (state)
this:
\<not> \<not> (\<forall>\<^sub>F x in F. \<not> P x)

goal (1 subgoal):
 1. \<not> \<not> (\<forall>\<^sub>F x in F. \<not> P x) \<Longrightarrow> False
[PROOF STEP]
hence "eventually (\<lambda>x. \<not> P x) F"
[PROOF STATE]
proof (prove)
using this:
\<not> \<not> (\<forall>\<^sub>F x in F. \<not> P x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. \<not> P x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. \<not> P x

goal (1 subgoal):
 1. \<not> \<not> (\<forall>\<^sub>F x in F. \<not> P x) \<Longrightarrow> False
[PROOF STEP]
hence "eventually (\<lambda>x. False) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. \<not> P x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. False
[PROOF STEP]
using eventually_conj[OF eve,of "(\<lambda>x. \<not> P x)"]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. \<not> P x
\<forall>\<^sub>F x in F. \<not> P x \<Longrightarrow> \<forall>\<^sub>F x in F. P x \<and> \<not> P x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. False

goal (1 subgoal):
 1. \<not> \<not> (\<forall>\<^sub>F x in F. \<not> P x) \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. False

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>F\<noteq>bot\<close> eventually_False
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. False
F \<noteq> bot
(\<forall>\<^sub>F x in ?F. False) = (?F = bot)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inversion_number_between_code:
  "inversion_number_between xs ys = inversion_number_between_sorted (sort xs) (sort ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inversion_number_between xs ys = inversion_number_between_sorted (sort xs) (sort ys)
[PROOF STEP]
by (subst inversion_number_between_sorted_correct)
     (simp_all add: cong: inversion_number_between_cong_mset)


[STATEMENT]
lemma bounded_translation:
  fixes S :: "'a::real_normed_vector set"
  assumes "bounded S"
  shows "bounded ((\<lambda>x. a + x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
bounded S
[PROOF STEP]
obtain b where b: "b > 0" "\<forall>x\<in>S. norm x \<le> b"
[PROOF STATE]
proof (prove)
using this:
bounded S

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 < b; \<forall>x\<in>S. norm x \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding bounded_pos
[PROOF STATE]
proof (prove)
using this:
\<exists>b>0. \<forall>x\<in>S. norm x \<le> b

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>0 < b; \<forall>x\<in>S. norm x \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < b
\<forall>x\<in>S. norm x \<le> b

goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
0 < b
\<forall>x\<in>S. norm x \<le> b

goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
assume "x \<in> S"
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
[PROOF STEP]
have "norm (a + x) \<le> b + norm a"
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. norm (a + x) \<le> b + norm a
[PROOF STEP]
using norm_triangle_ineq[of a x] b
[PROOF STATE]
proof (prove)
using this:
x \<in> S
norm (a + x) \<le> norm a + norm x
0 < b
\<forall>x\<in>S. norm x \<le> b

goal (1 subgoal):
 1. norm (a + x) \<le> b + norm a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm (a + x) \<le> b + norm a

goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> S \<Longrightarrow> norm (a + ?x2) \<le> b + norm a

goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2 \<in> S \<Longrightarrow> norm (a + ?x2) \<le> b + norm a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> S \<Longrightarrow> norm (a + ?x2) \<le> b + norm a

goal (1 subgoal):
 1. bounded ((+) a ` S)
[PROOF STEP]
unfolding bounded_pos
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> S \<Longrightarrow> norm (a + ?x2) \<le> b + norm a

goal (1 subgoal):
 1. \<exists>b>0. \<forall>x\<in>(+) a ` S. norm x \<le> b
[PROOF STEP]
using norm_ge_zero[of a] b(1) and add_strict_increasing[of b 0 "norm a"]
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> S \<Longrightarrow> norm (a + ?x2) \<le> b + norm a
0 \<le> norm a
0 < b
\<lbrakk>0 < b; 0 \<le> norm a\<rbrakk> \<Longrightarrow> 0 < b + norm a

goal (1 subgoal):
 1. \<exists>b>0. \<forall>x\<in>(+) a ` S. norm x \<le> b
[PROOF STEP]
by (auto intro!: exI[of _ "b + norm a"])
[PROOF STATE]
proof (state)
this:
bounded ((+) a ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_zero_row_upt_k_le:
  assumes "is_zero_row_upt_k i (Suc k) A"
  shows "is_zero_row_upt_k i k A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zero_row_upt_k i k A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_zero_row_upt_k i (Suc k) A

goal (1 subgoal):
 1. is_zero_row_upt_k i k A
[PROOF STEP]
unfolding is_zero_row_upt_k_def
[PROOF STATE]
proof (prove)
using this:
\<forall>j. mod_type_class.to_nat j < Suc k \<longrightarrow> A $ i $ j = (0::'b)

goal (1 subgoal):
 1. \<forall>j. mod_type_class.to_nat j < k \<longrightarrow> A $ i $ j = (0::'b)
[PROOF STEP]
by simp


[STATEMENT]
lemma content_division_of:
  assumes "K \<in> \<D>" "\<D> division_of S"
  shows "content K = (\<Prod>i \<in> Basis. interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content K = (\<Prod>i\<in>Basis. interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. content K = (\<Prod>i\<in>Basis. interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)
[PROOF STEP]
obtain a b where "K = cbox a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. K = cbox a b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using cbox_division_memE assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?K \<in> ?\<D>; ?\<D> division_of ?S; \<And>a b. \<lbrakk>?K = cbox a b; ?K \<noteq> {}; ?K \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
K \<in> \<D>
\<D> division_of S

goal (1 subgoal):
 1. (\<And>a b. K = cbox a b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
K = cbox a b

goal (1 subgoal):
 1. content K = (\<Prod>i\<in>Basis. interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K = cbox a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
K = cbox a b

goal (1 subgoal):
 1. content K = (\<Prod>i\<in>Basis. interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
K = cbox a b
K \<in> \<D>
\<D> division_of S

goal (1 subgoal):
 1. content K = (\<Prod>i\<in>Basis. interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)
[PROOF STEP]
by (force simp: division_of_def content_cbox')
[PROOF STATE]
proof (state)
this:
content K = (\<Prod>i\<in>Basis. interval_upperbound K \<bullet> i - interval_lowerbound K \<bullet> i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma padic_int_is_domain:
  assumes "prime p"
  shows "domain (padic_int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain (padic_int p)
[PROOF STEP]
proof(rule domainI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. cring (padic_int p)
 2. \<one>\<^bsub>padic_int p\<^esub> \<noteq> \<zero>\<^bsub>padic_int p\<^esub>
 3. \<And>a b. \<lbrakk>a \<otimes>\<^bsub>padic_int p\<^esub> b = \<zero>\<^bsub>padic_int p\<^esub>; a \<in> carrier (padic_int p); b \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> a = \<zero>\<^bsub>padic_int p\<^esub> \<or> b = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show "cring (padic_int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring (padic_int p)
[PROOF STEP]
using padic_int_is_cring assms(1)
[PROOF STATE]
proof (prove)
using this:
prime ?p \<Longrightarrow> cring (padic_int ?p)
prime p

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

goal (2 subgoals):
 1. \<one>\<^bsub>padic_int p\<^esub> \<noteq> \<zero>\<^bsub>padic_int p\<^esub>
 2. \<And>a b. \<lbrakk>a \<otimes>\<^bsub>padic_int p\<^esub> b = \<zero>\<^bsub>padic_int p\<^esub>; a \<in> carrier (padic_int p); b \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> a = \<zero>\<^bsub>padic_int p\<^esub> \<or> b = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show "\<one>\<^bsub>padic_int p\<^esub> \<noteq> \<zero>\<^bsub>padic_int p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>padic_int p\<^esub> \<noteq> \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<one>\<^bsub>padic_int p\<^esub> = \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> False
[PROOF STEP]
assume "\<one>\<^bsub>padic_int p\<^esub> = \<zero>\<^bsub>padic_int p\<^esub> "
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>padic_int p\<^esub> = \<zero>\<^bsub>padic_int p\<^esub>

goal (1 subgoal):
 1. \<one>\<^bsub>padic_int p\<^esub> = \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<one>\<^bsub>padic_int p\<^esub> = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
have "(\<one>\<^bsub>padic_int p\<^esub>) 1 = \<zero>\<^bsub>padic_int p\<^esub> 1"
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>padic_int p\<^esub> = \<zero>\<^bsub>padic_int p\<^esub>

goal (1 subgoal):
 1. \<one>\<^bsub>padic_int p\<^esub> 1 = \<zero>\<^bsub>padic_int p\<^esub> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>padic_int p\<^esub> 1 = \<zero>\<^bsub>padic_int p\<^esub> 1

goal (1 subgoal):
 1. \<one>\<^bsub>padic_int p\<^esub> = \<zero>\<^bsub>padic_int p\<^esub> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<one>\<^bsub>padic_int p\<^esub> 1 = \<zero>\<^bsub>padic_int p\<^esub> 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>padic_int p\<^esub> 1 = \<zero>\<^bsub>padic_int p\<^esub> 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using padic_int_simps(1,2)
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>padic_int p\<^esub> 1 = \<zero>\<^bsub>padic_int p\<^esub> 1
\<one>\<^bsub>padic_int ?p\<^esub> = padic_one ?p
\<zero>\<^bsub>padic_int ?p\<^esub> = padic_zero ?p

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding padic_one_def padic_zero_def
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>padic_int p\<^esub> 1 = \<zero>\<^bsub>padic_int p\<^esub> 1
\<one>\<^bsub>padic_int ?p\<^esub> = (\<lambda>n. if n = 0 then 0 else 1)
\<zero>\<^bsub>padic_int ?p\<^esub> = (\<lambda>n. 0)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>padic_int p\<^esub> \<noteq> \<zero>\<^bsub>padic_int p\<^esub>

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<otimes>\<^bsub>padic_int p\<^esub> b = \<zero>\<^bsub>padic_int p\<^esub>; a \<in> carrier (padic_int p); b \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> a = \<zero>\<^bsub>padic_int p\<^esub> \<or> b = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
show "\<And>a b. a \<otimes>\<^bsub>padic_int p\<^esub> b = \<zero>\<^bsub>padic_int p\<^esub>   \<Longrightarrow>
              a \<in> carrier (padic_int p) \<Longrightarrow>
              b \<in> carrier (padic_int p) \<Longrightarrow>
              a = \<zero>\<^bsub>padic_int p\<^esub> \<or> b = \<zero>\<^bsub>padic_int p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<otimes>\<^bsub>padic_int p\<^esub> b = \<zero>\<^bsub>padic_int p\<^esub>; a \<in> carrier (padic_int p); b \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> a = \<zero>\<^bsub>padic_int p\<^esub> \<or> b = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
using assms padic_no_zero_divisors
[PROOF STATE]
proof (prove)
using this:
prime p
\<lbrakk>prime ?p; ?a \<in> carrier (padic_int ?p); ?b \<in> carrier (padic_int ?p); ?a \<noteq> \<zero>\<^bsub>padic_int ?p\<^esub>; ?b \<noteq> \<zero>\<^bsub>padic_int ?p\<^esub>\<rbrakk> \<Longrightarrow> ?a \<otimes>\<^bsub>padic_int ?p\<^esub> ?b \<noteq> \<zero>\<^bsub>padic_int ?p\<^esub>

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<otimes>\<^bsub>padic_int p\<^esub> b = \<zero>\<^bsub>padic_int p\<^esub>; a \<in> carrier (padic_int p); b \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> a = \<zero>\<^bsub>padic_int p\<^esub> \<or> b = \<zero>\<^bsub>padic_int p\<^esub>
[PROOF STEP]
by (meson prime_nat_int_transfer)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<otimes>\<^bsub>padic_int p\<^esub> ?b = \<zero>\<^bsub>padic_int p\<^esub>; ?a \<in> carrier (padic_int p); ?b \<in> carrier (padic_int p)\<rbrakk> \<Longrightarrow> ?a = \<zero>\<^bsub>padic_int p\<^esub> \<or> ?b = \<zero>\<^bsub>padic_int p\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_set_singleton_contra:
  assumes finiteS: "finite S"
      and Sne: "S \<noteq> {}"
      and cardS: "card S > 1 \<Longrightarrow> False"
  shows "\<exists>j. S = {j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. S = {j}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>j. S = {j}
[PROOF STEP]
from cardS Sne card_0_eq[OF finiteS]
[PROOF STATE]
proof (chain)
picking this:
1 < card S \<Longrightarrow> False
S \<noteq> {}
(card S = 0) = (S = {})
[PROOF STEP]
have Scard: "card S = 1"
[PROOF STATE]
proof (prove)
using this:
1 < card S \<Longrightarrow> False
S \<noteq> {}
(card S = 0) = (S = {})

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

goal (1 subgoal):
 1. \<exists>j. S = {j}
[PROOF STEP]
from has_extend_witness[where xs="[]", OF card_has[OF this]]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set [] \<subseteq> S; length [] < 1\<rbrakk> \<Longrightarrow> set [] \<subset> S
[PROOF STEP]
obtain j where "{j} \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set [] \<subseteq> S; length [] < 1\<rbrakk> \<Longrightarrow> set [] \<subset> S

goal (1 subgoal):
 1. (\<And>j. {j} \<subseteq> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{j} \<subseteq> S

goal (1 subgoal):
 1. \<exists>j. S = {j}
[PROOF STEP]
from card_seteq[OF finiteS this] Scard
[PROOF STATE]
proof (chain)
picking this:
card S \<le> card {j} \<Longrightarrow> {j} = S
card S = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card S \<le> card {j} \<Longrightarrow> {j} = S
card S = 1

goal (1 subgoal):
 1. \<exists>j. S = {j}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>j. S = {j}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordered_incidence_sysII:
  assumes "finite_incidence_system \<V> \<B>" and "set \<V>s = \<V>" and "distinct \<V>s" and "mset \<B>s = \<B>"
  shows "ordered_incidence_system \<V>s \<B>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
interpret fisys: finite_incidence_system "set \<V>s" "mset \<B>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_incidence_system (set \<V>s) (mset \<B>s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_incidence_system \<V> \<B>
set \<V>s = \<V>
distinct \<V>s
mset \<B>s = \<B>

goal (1 subgoal):
 1. finite_incidence_system (set \<V>s) (mset \<B>s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
using fisys.wellformed assms
[PROOF STATE]
proof (prove)
using this:
?b \<in># mset \<B>s \<Longrightarrow> ?b \<subseteq> set \<V>s
finite_incidence_system \<V> \<B>
set \<V>s = \<V>
distinct \<V>s
mset \<B>s = \<B>

goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
by (unfold_locales) (simp_all)
[PROOF STATE]
proof (state)
this:
ordered_incidence_system \<V>s \<B>s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rbt_lookup_rbt_bulkload:
  "rbt_lookup (rbt_bulkload xs) = map_of xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt_lookup (rbt_bulkload xs) = map_of xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rbt_lookup (rbt_bulkload xs) = map_of xs
[PROOF STEP]
obtain ys where "ys = rev xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ys. ys = rev xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ys = rev xs

goal (1 subgoal):
 1. rbt_lookup (rbt_bulkload xs) = map_of xs
[PROOF STEP]
have "\<And>t. is_rbt t \<Longrightarrow>
    rbt_lookup (List.fold (case_prod rbt_insert) ys t) = rbt_lookup t ++ map_of (rev ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. is_rbt t \<Longrightarrow> rbt_lookup (List.fold (\<lambda>(x, y). rbt_insert x y) ys t) = rbt_lookup t ++ map_of (rev ys)
[PROOF STEP]
by (induct ys) (simp_all add: rbt_bulkload_def rbt_lookup_rbt_insert case_prod_beta)
[PROOF STATE]
proof (state)
this:
is_rbt ?t \<Longrightarrow> rbt_lookup (List.fold (\<lambda>(x, y). rbt_insert x y) ys ?t) = rbt_lookup ?t ++ map_of (rev ys)

goal (1 subgoal):
 1. rbt_lookup (rbt_bulkload xs) = map_of xs
[PROOF STEP]
from this Empty_is_rbt
[PROOF STATE]
proof (chain)
picking this:
is_rbt ?t \<Longrightarrow> rbt_lookup (List.fold (\<lambda>(x, y). rbt_insert x y) ys ?t) = rbt_lookup ?t ++ map_of (rev ys)
is_rbt Empty
[PROOF STEP]
have
    "rbt_lookup (List.fold (case_prod rbt_insert) (rev xs) Empty) = rbt_lookup Empty ++ map_of xs"
[PROOF STATE]
proof (prove)
using this:
is_rbt ?t \<Longrightarrow> rbt_lookup (List.fold (\<lambda>(x, y). rbt_insert x y) ys ?t) = rbt_lookup ?t ++ map_of (rev ys)
is_rbt Empty

goal (1 subgoal):
 1. rbt_lookup (List.fold (\<lambda>(x, y). rbt_insert x y) (rev xs) Empty) = rbt_lookup Empty ++ map_of xs
[PROOF STEP]
by (simp add: \<open>ys = rev xs\<close>)
[PROOF STATE]
proof (state)
this:
rbt_lookup (List.fold (\<lambda>(x, y). rbt_insert x y) (rev xs) Empty) = rbt_lookup Empty ++ map_of xs

goal (1 subgoal):
 1. rbt_lookup (rbt_bulkload xs) = map_of xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rbt_lookup (List.fold (\<lambda>(x, y). rbt_insert x y) (rev xs) Empty) = rbt_lookup Empty ++ map_of xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rbt_lookup (List.fold (\<lambda>(x, y). rbt_insert x y) (rev xs) Empty) = rbt_lookup Empty ++ map_of xs

goal (1 subgoal):
 1. rbt_lookup (rbt_bulkload xs) = map_of xs
[PROOF STEP]
by (simp add: rbt_bulkload_def rbt_lookup_Empty foldr_conv_fold)
[PROOF STATE]
proof (state)
this:
rbt_lookup (rbt_bulkload xs) = map_of xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma relInvImage_mono:
  "R1 \<subseteq> R2 \<Longrightarrow> relInvImage A R1 f \<subseteq> relInvImage A R2 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 \<subseteq> R2 \<Longrightarrow> relInvImage A R1 f \<subseteq> relInvImage A R2 f
[PROOF STEP]
unfolding relInvImage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R1 \<subseteq> R2 \<Longrightarrow> {(a1, a2) |a1 a2. a1 \<in> A \<and> a2 \<in> A \<and> (f a1, f a2) \<in> R1} \<subseteq> {(a1, a2) |a1 a2. a1 \<in> A \<and> a2 \<in> A \<and> (f a1, f a2) \<in> R2}
[PROOF STEP]
by auto


[STATEMENT]
lemma powsum_split_var1: "x\<^bsub>0\<^esub>\<^bsup>n+1\<^esup> = 1 + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
have "x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = x\<^bsub>0\<^esub>\<^bsup>0 + Suc n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = x\<^bsub>0\<^esub>\<^bsup>0 + Suc n\<^esup>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = x\<^bsub>0\<^esub>\<^bsup>0 + Suc n\<^esup>

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = x\<^bsub>0\<^esub>\<^bsup>0 + Suc n\<^esup>

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
have "... = x\<^bsub>0\<^esub>\<^bsup>0\<^esup> + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>0 + Suc n\<^esup> = x\<^bsub>0\<^esub>\<^bsup>0\<^esup> + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
by (subst powsum_split, rule refl)
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>0 + Suc n\<^esup> = x\<^bsub>0\<^esub>\<^bsup>0\<^esup> + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>0 + Suc n\<^esup> = x\<^bsub>0\<^esub>\<^bsup>0\<^esup> + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
have "... = 1 + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>0\<^esup> + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup> = (1::'a) + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>0\<^esup> + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup> = (1::'a) + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>0 + Suc 0\<^esub>\<^bsup>n\<^esup>

goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x\<^bsub>0\<^esub>\<^bsup>n + 1\<^esup> = (1::'a) + x\<^bsub>1\<^esub>\<^bsup>n\<^esup>

goal:
No subgoals!
[PROOF STEP]
qed