[STATEMENT]
lemma map_poly_homo_polysub:
  "map_poly f (p1 -\<^sub>p p2) = map_poly f p1 -\<^sub>p map_poly f p2"
  if [simp]: "\<And>x y. f (x + y) = f x + f y" "\<And>x. f x = 0 \<longleftrightarrow> x = 0" "\<And>x y. f (- x) = - f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly f (p1 -\<^sub>p p2) = map_poly f p1 -\<^sub>p map_poly f p2
[PROOF STEP]
by (auto simp: polysub_def map_poly_homo_polyadd map_poly_homo_polyneg)


[STATEMENT]
lemma a_meet_e: "a \<sqinter> (e_aux a b c) = a \<sqinter> (b \<squnion> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sqinter> e_aux a b c = a \<sqinter> (b \<squnion> c)
[PROOF STEP]
by (rule order.antisym) (simp_all add: e_aux_def le_infI2)


[STATEMENT]
lemma nuc_Inf_closed: "nucleus f \<Longrightarrow> Inf_closed_set (Fix f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nucleus f \<Longrightarrow> Inf_closed_set (Fix f)
[PROOF STEP]
by (simp add: clop_Inf_closed nucleus_def)


[STATEMENT]
lemma classes_cover: "\<Union>(classes Qeq) = Field Qeq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (classes Qeq) = Field Qeq
[PROOF STEP]
by (simp add: Union_quotient classes_def equiv_transymcl)


[STATEMENT]
lemma measurable_case_nat'[measurable (raw)]:
  assumes fg[measurable]: "f \<in> measurable N M" "g \<in> measurable N (\<Pi>\<^sub>M i\<in>UNIV. M)"
  shows "(\<lambda>x. case_nat (f x) (g x)) \<in> measurable N (\<Pi>\<^sub>M i\<in>UNIV. M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. case_nat (f x) (g x)) \<in> N \<rightarrow>\<^sub>M Pi\<^sub>M UNIV (\<lambda>i. M)
[PROOF STEP]
using fg[THEN measurable_space]
[PROOF STATE]
proof (prove)
using this:
?x \<in> space N \<Longrightarrow> f ?x \<in> space M
?x \<in> space N \<Longrightarrow> g ?x \<in> space (Pi\<^sub>M UNIV (\<lambda>i. M))

goal (1 subgoal):
 1. (\<lambda>x. case_nat (f x) (g x)) \<in> N \<rightarrow>\<^sub>M Pi\<^sub>M UNIV (\<lambda>i. M)
[PROOF STEP]
by (auto intro!: measurable_PiM_single' simp add: space_PiM PiE_iff split: nat.split)


[STATEMENT]
lemma mkId2: "Pbij_Dom (mkId h) = Dom h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pbij_Dom (mkId h) = Dom h
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pbij_Dom (mkId h) = Dom h
[PROOF STEP]
by (simp add: Dom_def Pbij_Dom_def mkId_def)


[STATEMENT]
lemma eqpoll_free_Abelian_group_infinite:
  assumes "infinite A" shows "carrier(free_Abelian_group A) \<approx> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (free_Abelian_group A) \<approx> A
[PROOF STEP]
proof (rule lepoll_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. carrier (free_Abelian_group A) \<lesssim> A
 2. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
have "carrier (free_Abelian_group A) \<lesssim> {f::'a\<Rightarrow>int. f ` A \<subseteq> UNIV \<and> {x. f x \<noteq> 0} \<subseteq> A \<and> finite {x. f x \<noteq> 0}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (free_Abelian_group A) \<lesssim> {f. f ` A \<subseteq> UNIV \<and> {x. f x \<noteq> 0} \<subseteq> A \<and> finite {x. f x \<noteq> 0}}
[PROOF STEP]
unfolding lepoll_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. inj_on f (carrier (free_Abelian_group A)) \<and> f ` carrier (free_Abelian_group A) \<subseteq> {f. f ` A \<subseteq> UNIV \<and> {x. f x \<noteq> 0} \<subseteq> A \<and> finite {x. f x \<noteq> 0}}
[PROOF STEP]
by (rule_tac x="Poly_Mapping.lookup" in exI) (auto simp: poly_mapping_eqI lookup_not_eq_zero_eq_in_keys inj_onI)
[PROOF STATE]
proof (state)
this:
carrier (free_Abelian_group A) \<lesssim> {f. f ` A \<subseteq> UNIV \<and> {x. f x \<noteq> 0} \<subseteq> A \<and> finite {x. f x \<noteq> 0}}

goal (2 subgoals):
 1. carrier (free_Abelian_group A) \<lesssim> A
 2. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
carrier (free_Abelian_group A) \<lesssim> {f. f ` A \<subseteq> UNIV \<and> {x. f x \<noteq> 0} \<subseteq> A \<and> finite {x. f x \<noteq> 0}}

goal (2 subgoals):
 1. carrier (free_Abelian_group A) \<lesssim> A
 2. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
have "\<dots> \<lesssim> Fpow (A \<times> (UNIV::int set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. f ` A \<subseteq> UNIV \<and> {x. f x \<noteq> 0} \<subseteq> A \<and> finite {x. f x \<noteq> 0}} \<lesssim> Fpow (A \<times> UNIV)
[PROOF STEP]
by (rule lepoll_restricted_funspace)
[PROOF STATE]
proof (state)
this:
{f. f ` A \<subseteq> UNIV \<and> {x. f x \<noteq> 0} \<subseteq> A \<and> finite {x. f x \<noteq> 0}} \<lesssim> Fpow (A \<times> UNIV)

goal (2 subgoals):
 1. carrier (free_Abelian_group A) \<lesssim> A
 2. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{f. f ` A \<subseteq> UNIV \<and> {x. f x \<noteq> 0} \<subseteq> A \<and> finite {x. f x \<noteq> 0}} \<lesssim> Fpow (A \<times> UNIV)

goal (2 subgoals):
 1. carrier (free_Abelian_group A) \<lesssim> A
 2. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
have "\<dots> \<approx> A \<times> (UNIV::int set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fpow (A \<times> UNIV) \<approx> A \<times> UNIV
[PROOF STEP]
proof (rule eqpoll_Fpow)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite (A \<times> UNIV)
[PROOF STEP]
show "infinite (A \<times> (UNIV::int set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (A \<times> UNIV)
[PROOF STEP]
using assms finite_cartesian_productD1
[PROOF STATE]
proof (prove)
using this:
infinite A
\<lbrakk>finite (?A \<times> ?B); ?B \<noteq> {}\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. infinite (A \<times> UNIV)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
infinite (A \<times> UNIV)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Fpow (A \<times> UNIV) \<approx> A \<times> UNIV

goal (2 subgoals):
 1. carrier (free_Abelian_group A) \<lesssim> A
 2. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Fpow (A \<times> UNIV) \<approx> A \<times> UNIV

goal (2 subgoals):
 1. carrier (free_Abelian_group A) \<lesssim> A
 2. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
have "\<dots> \<approx> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> UNIV \<approx> A
[PROOF STEP]
unfolding eqpoll_iff_card_of_ordIso
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A \<times> UNIV| =o |A|
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |A \<times> UNIV| =o |A|
[PROOF STEP]
have "|A \<times> (UNIV::int set)| <=o |A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A \<times> UNIV| \<le>o |A|
[PROOF STEP]
by (simp add: assms card_of_Times_ordLeq_infinite flip: infinite_iff_card_of_countable)
[PROOF STATE]
proof (state)
this:
|A \<times> UNIV| \<le>o |A|

goal (1 subgoal):
 1. |A \<times> UNIV| =o |A|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|A \<times> UNIV| \<le>o |A|

goal (1 subgoal):
 1. |A \<times> UNIV| =o |A|
[PROOF STEP]
have "|A| \<le>o |A \<times> (UNIV::int set)|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A| \<le>o |A \<times> UNIV|
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|A| \<le>o |A \<times> UNIV|

goal (1 subgoal):
 1. |A \<times> UNIV| =o |A|
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
|A \<times> UNIV| \<le>o |A|
|A| \<le>o |A \<times> UNIV|
[PROOF STEP]
have "|A| *c |(UNIV::int set)| =o |A|"
[PROOF STATE]
proof (prove)
using this:
|A \<times> UNIV| \<le>o |A|
|A| \<le>o |A \<times> UNIV|

goal (1 subgoal):
 1. |A| *c |UNIV| =o |A|
[PROOF STEP]
by (simp add: cprod_def ordIso_iff_ordLeq)
[PROOF STATE]
proof (state)
this:
|A| *c |UNIV| =o |A|

goal (1 subgoal):
 1. |A \<times> UNIV| =o |A|
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
|A| *c |UNIV| =o |A|
[PROOF STEP]
show "|A \<times> (UNIV::int set)| =o |A|"
[PROOF STATE]
proof (prove)
using this:
|A| *c |UNIV| =o |A|

goal (1 subgoal):
 1. |A \<times> UNIV| =o |A|
[PROOF STEP]
by (metis Times_cprod ordIso_transitive)
[PROOF STATE]
proof (state)
this:
|A \<times> UNIV| =o |A|

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<times> UNIV \<approx> A

goal (2 subgoals):
 1. carrier (free_Abelian_group A) \<lesssim> A
 2. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
carrier (free_Abelian_group A) \<lesssim> A
[PROOF STEP]
show "carrier (free_Abelian_group A) \<lesssim> A"
[PROOF STATE]
proof (prove)
using this:
carrier (free_Abelian_group A) \<lesssim> A

goal (1 subgoal):
 1. carrier (free_Abelian_group A) \<lesssim> A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
carrier (free_Abelian_group A) \<lesssim> A

goal (1 subgoal):
 1. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
have "inj_on frag_of A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on frag_of A
[PROOF STEP]
by (simp add: frag_of_eq inj_on_def)
[PROOF STATE]
proof (state)
this:
inj_on frag_of A

goal (1 subgoal):
 1. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on frag_of A

goal (1 subgoal):
 1. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
have "frag_of ` A \<subseteq> carrier (free_Abelian_group A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frag_of ` A \<subseteq> carrier (free_Abelian_group A)
[PROOF STEP]
by (simp add: image_subsetI)
[PROOF STATE]
proof (state)
this:
frag_of ` A \<subseteq> carrier (free_Abelian_group A)

goal (1 subgoal):
 1. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on frag_of A
frag_of ` A \<subseteq> carrier (free_Abelian_group A)
[PROOF STEP]
show "A \<lesssim> carrier (free_Abelian_group A)"
[PROOF STATE]
proof (prove)
using this:
inj_on frag_of A
frag_of ` A \<subseteq> carrier (free_Abelian_group A)

goal (1 subgoal):
 1. A \<lesssim> carrier (free_Abelian_group A)
[PROOF STEP]
by (force simp: lepoll_def)
[PROOF STATE]
proof (state)
this:
A \<lesssim> carrier (free_Abelian_group A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pair_o_assoc'[simp]:
  assumes [simp]: \<open>compatible F G\<close> \<open>compatible G H\<close> \<open>compatible F H\<close>
  shows \<open>((F; G); H) \<circ> assoc' = (F; (G; H))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((F;G);H) \<circ> assoc' = (F;(G;H))
[PROOF STEP]
proof (rule tensor_extensionality3)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. register (((F;G);H) \<circ> assoc')
 2. register (F;(G;H))
 3. \<And>f g h. (((F;G);H) \<circ> assoc') (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h) = (F;(G;H)) (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>register (((F; G); H) \<circ> assoc')\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. register (((F;G);H) \<circ> assoc')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
register (((F;G);H) \<circ> assoc')

goal (2 subgoals):
 1. register (F;(G;H))
 2. \<And>f g h. (((F;G);H) \<circ> assoc') (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h) = (F;(G;H)) (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>register (F; (G; H))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. register (F;(G;H))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
register (F;(G;H))

goal (1 subgoal):
 1. \<And>f g h. (((F;G);H) \<circ> assoc') (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h) = (F;(G;H)) (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>(((F; G); H) \<circ> assoc') (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h) = (F; (G; H)) (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h)\<close> for f g h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((F;G);H) \<circ> assoc') (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h) = (F;(G;H)) (f \<otimes>\<^sub>u g \<otimes>\<^sub>u h)
[PROOF STEP]
by (simp add: register_pair_apply assoc'_apply comp_update_assoc)
[PROOF STATE]
proof (state)
this:
(((F;G);H) \<circ> assoc') (?f \<otimes>\<^sub>u ?g \<otimes>\<^sub>u ?h) = (F;(G;H)) (?f \<otimes>\<^sub>u ?g \<otimes>\<^sub>u ?h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma_2_5_15: "(a r\<rightarrow> b) * (b r\<rightarrow> c) \<le> a r\<rightarrow> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a r\<rightarrow> b) * (b r\<rightarrow> c) \<le> a r\<rightarrow> c
[PROOF STEP]
by (rule pseudo_hoop_dual.lemma_2_5_14)


[STATEMENT]
lemma ord_of_nat_times[nat_omega_simps]: "a\<^sub>\<nat> * b\<^sub>\<nat> = (a * b)\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a\<^sub>\<nat> * b\<^sub>\<nat> = (a * b)\<^sub>\<nat>
[PROOF STEP]
by (induct b) (simp_all add: mult_succ nat_omega_simps)


[STATEMENT]
lemma similar_into_equiv: "x \<cong> y \<Longrightarrow> x \<simeq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cong> y \<Longrightarrow> x \<simeq> y
[PROOF STEP]
by (induction pred: itrm_cong) (auto intro: ap_cong itrm_sym itrm_trans)


[STATEMENT]
lemma find_csas_lemma_nozeros:
  fixes qs:: "rat poly list"
  assumes fs: "factorize_polys qs = (fs,data)"
  assumes "fs \<noteq> []"
  shows "(csa \<in> (consistent_sign_vectors fs UNIV) \<and> has_no_zeros csa) \<longleftrightarrow>
    csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs))  (cast_rat_list fs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
let ?new_l = "cast_rat_list fs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
let ?copr = "coprime_r ?new_l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
have copr_nonz: "?copr \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime_r (cast_rat_list fs) \<noteq> 0
[PROOF STEP]
using coprime_r_nonzero[OF assms(1-2)]
[PROOF STATE]
proof (prove)
using this:
?fss = map real_of_rat_poly fs \<Longrightarrow> coprime_r ?fss \<noteq> 0

goal (1 subgoal):
 1. coprime_r (cast_rat_list fs) \<noteq> 0
[PROOF STEP]
unfolding cast_rat_list_def
[PROOF STATE]
proof (prove)
using this:
?fss = map real_of_rat_poly fs \<Longrightarrow> coprime_r ?fss \<noteq> 0

goal (1 subgoal):
 1. coprime_r (map real_of_rat_poly fs) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime_r (cast_rat_list fs) \<noteq> 0

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
have nontriv_list: "0 < length ?new_l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length (cast_rat_list fs)
[PROOF STEP]
using assms cast_rat_list_def
[PROOF STATE]
proof (prove)
using this:
factorize_polys qs = (fs, data)
fs \<noteq> []
cast_rat_list ?qs = map real_of_rat_poly ?qs

goal (1 subgoal):
 1. 0 < length (cast_rat_list fs)
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
0 < length (cast_rat_list fs)

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
have pairwise_cp: "(\<And>q. q \<in> set ?new_l \<Longrightarrow>
       algebraic_semidom_class.coprime ?copr q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q. q \<in> set (cast_rat_list fs) \<Longrightarrow> algebraic_semidom_class.coprime (coprime_r (cast_rat_list fs)) q
[PROOF STEP]
using coprime_r_coprime_prop[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?fss = map real_of_rat_poly fs; ?f \<in> set ?fss\<rbrakk> \<Longrightarrow> comm_monoid_mult_class.coprime ?f (coprime_r ?fss)

goal (1 subgoal):
 1. \<And>q. q \<in> set (cast_rat_list fs) \<Longrightarrow> algebraic_semidom_class.coprime (coprime_r (cast_rat_list fs)) q
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q. \<lbrakk>q \<in> set (cast_rat_list fs); \<And>fss f. \<lbrakk>fss = map real_of_rat_poly fs; f \<in> real_of_rat_poly ` set fs\<rbrakk> \<Longrightarrow> algebraic_semidom_class.coprime f (coprime_r (map real_of_rat_poly fs))\<rbrakk> \<Longrightarrow> algebraic_semidom_class.coprime (coprime_r (cast_rat_list fs)) q
[PROOF STEP]
by (metis cast_rat_list_def comm_monoid_mult_class.coprime_commute coprime_iff_coprime list.set_map)
[PROOF STATE]
proof (state)
this:
?q \<in> set (cast_rat_list fs) \<Longrightarrow> algebraic_semidom_class.coprime (coprime_r (cast_rat_list fs)) ?q

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
have set_fsga: "set(find_consistent_signs_at_roots ?copr ?new_l) = set(characterize_consistent_signs_at_roots ?copr ?new_l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) = set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
using find_consistent_signs_at_roots[OF copr_nonz pairwise_cp]
[PROOF STATE]
proof (prove)
using this:
(\<And>q. q \<in> set ?qs \<Longrightarrow> q \<in> set (cast_rat_list fs)) \<Longrightarrow> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) ?qs) = set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) ?qs)

goal (1 subgoal):
 1. set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) = set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) = set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) = set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
have csa_in_hyp: "csa \<in> set (find_consistent_signs_at_roots ?copr ?new_l)
      \<longleftrightarrow> csa \<in> set(characterize_consistent_signs_at_roots ?copr ?new_l)"
[PROOF STATE]
proof (prove)
using this:
set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) = set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal (1 subgoal):
 1. (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
have forward: "(csa \<in> (consistent_sign_vectors fs UNIV) \<and> has_no_zeros csa)
     \<Longrightarrow> csa \<in> set(characterize_consistent_signs_at_roots ?copr ?new_l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
assume csa_in: "(csa \<in> (consistent_sign_vectors fs UNIV) \<and> has_no_zeros csa)"
[PROOF STATE]
proof (state)
this:
csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
have fin: "finite {x. poly (coprime_r (cast_rat_list fs)) x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. poly (coprime_r (cast_rat_list fs)) x = 0}
[PROOF STEP]
using copr_nonz poly_roots_finite
[PROOF STATE]
proof (prove)
using this:
coprime_r (cast_rat_list fs) \<noteq> 0
?p \<noteq> 0 \<Longrightarrow> finite {x. poly ?p x = (0::?'a)}

goal (1 subgoal):
 1. finite {x. poly (coprime_r (cast_rat_list fs)) x = 0}
[PROOF STEP]
by (simp add: poly_roots_finite fs)
[PROOF STATE]
proof (state)
this:
finite {x. poly (coprime_r (cast_rat_list fs)) x = 0}

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
have pcl: "pairwise_coprime_list fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise_coprime_list fs
[PROOF STEP]
using coprime_factorize fs
[PROOF STATE]
proof (prove)
using this:
pairwise_coprime_list (fst (factorize_polys ?qs))
factorize_polys qs = (fs, data)

goal (1 subgoal):
 1. pairwise_coprime_list fs
[PROOF STEP]
by (metis fst_conv)
[PROOF STATE]
proof (state)
this:
pairwise_coprime_list fs

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
have sqf: "\<And>q. q \<in> set fs \<Longrightarrow> rsquarefree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q. q \<in> set fs \<Longrightarrow> rsquarefree q
[PROOF STEP]
using factorize_polys_square_free[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
?f \<in> set fs \<Longrightarrow> square_free ?f

goal (1 subgoal):
 1. \<And>q. q \<in> set fs \<Longrightarrow> rsquarefree q
[PROOF STEP]
by (metis square_free_rsquarefree)
[PROOF STATE]
proof (state)
this:
?q \<in> set fs \<Longrightarrow> rsquarefree ?q

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
obtain x1 where x1:"csa = sign_vec fs x1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x1. csa = sign_vec fs x1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using consistent_sign_vectors_def csa_in
[PROOF STATE]
proof (prove)
using this:
consistent_sign_vectors ?qs ?S = sign_vec ?qs ` ?S
csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa

goal (1 subgoal):
 1. (\<And>x1. csa = sign_vec fs x1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
csa = sign_vec fs x1

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
have hnz: "has_no_zeros csa"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_no_zeros csa
[PROOF STEP]
using csa_in
[PROOF STATE]
proof (prove)
using this:
csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa

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

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
obtain w where w_prop: "w\<in>roots_of_coprime_r (cast_rat_list fs)" "csa = sign_vec fs w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>w. \<lbrakk>w \<in> roots_of_coprime_r (cast_rat_list fs); csa = sign_vec fs w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using roots_of_coprime_r_capture_sgas_without_zeros[OF pcl sqf x1 hnz]
[PROOF STATE]
proof (prove)
using this:
(\<And>q. q \<in> set fs \<Longrightarrow> q \<in> set fs) \<Longrightarrow> \<exists>w\<in>roots_of_coprime_r (cast_rat_list fs). csa = sign_vec fs w

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>w \<in> roots_of_coprime_r (cast_rat_list fs); csa = sign_vec fs w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> roots_of_coprime_r (cast_rat_list fs)
csa = sign_vec fs w

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
have w_root: "poly (coprime_r (cast_rat_list fs)) w = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (coprime_r (cast_rat_list fs)) w = 0
[PROOF STEP]
using w_prop
[PROOF STATE]
proof (prove)
using this:
w \<in> roots_of_coprime_r (cast_rat_list fs)
csa = sign_vec fs w

goal (1 subgoal):
 1. poly (coprime_r (cast_rat_list fs)) w = 0
[PROOF STEP]
by (simp add: roots_of_coprime_r_def)
[PROOF STATE]
proof (state)
this:
poly (coprime_r (cast_rat_list fs)) w = 0

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly (coprime_r (cast_rat_list fs)) w = 0
[PROOF STEP]
have "w \<in> {x. poly (coprime_r (cast_rat_list fs)) x = 0}"
[PROOF STATE]
proof (prove)
using this:
poly (coprime_r (cast_rat_list fs)) w = 0

goal (1 subgoal):
 1. w \<in> {x. poly (coprime_r (cast_rat_list fs)) x = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> {x. poly (coprime_r (cast_rat_list fs)) x = 0}

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> {x. poly (coprime_r (cast_rat_list fs)) x = 0}
[PROOF STEP]
have w_ins: "w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs)))"
[PROOF STATE]
proof (prove)
using this:
w \<in> {x. poly (coprime_r (cast_rat_list fs)) x = 0}

goal (1 subgoal):
 1. w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs)))
[PROOF STEP]
using fin set_sorted_list_of_set[where A="{x. poly (coprime_r (cast_rat_list fs)) x = 0}"]
[PROOF STATE]
proof (prove)
using this:
w \<in> {x. poly (coprime_r (cast_rat_list fs)) x = 0}
finite {x. poly (coprime_r (cast_rat_list fs)) x = 0}
finite {x. poly (coprime_r (cast_rat_list fs)) x = 0} \<Longrightarrow> set (sorted_list_of_set {x. poly (coprime_r (cast_rat_list fs)) x = 0}) = {x. poly (coprime_r (cast_rat_list fs)) x = 0}

goal (1 subgoal):
 1. w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs)))
[PROOF STEP]
unfolding characterize_root_list_p_def
[PROOF STATE]
proof (prove)
using this:
w \<in> {x. poly (coprime_r (cast_rat_list fs)) x = 0}
finite {x. poly (coprime_r (cast_rat_list fs)) x = 0}
finite {x. poly (coprime_r (cast_rat_list fs)) x = 0} \<Longrightarrow> set (sorted_list_of_set {x. poly (coprime_r (cast_rat_list fs)) x = 0}) = {x. poly (coprime_r (cast_rat_list fs)) x = 0}

goal (1 subgoal):
 1. w \<in> set (sorted_list_of_set {x. poly (coprime_r (cast_rat_list fs)) x = 0})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs)))

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
have "map ((\<lambda>x. if 0 < x then 1 else if x < 0 then - 1 else 0) \<circ> (\<lambda>p. rpoly p w)) fs =
          map ((\<lambda>x. if 0 < x then 1 else - 1) \<circ> (\<lambda>p. rpoly p w)) fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::'a else - (1::'a)) \<circ> (\<lambda>p. rpoly p w)) fs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::'a else - (1::'a)) \<circ> (\<lambda>p. rpoly p w)) fs
[PROOF STEP]
have "\<not>(\<exists>x \<in> set fs. rpoly x w = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>x\<in>set fs. rpoly x w = 0)
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set fs; rpoly x w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set fs; rpoly x w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume x_in: "x \<in> set fs"
[PROOF STATE]
proof (state)
this:
x \<in> set fs

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set fs; rpoly x w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume x_zer: "rpoly x w = 0"
[PROOF STATE]
proof (state)
this:
rpoly x w = 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set fs; rpoly x w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rpoly x w = 0
[PROOF STEP]
have "\<exists>k < length fs. nth fs k = x"
[PROOF STATE]
proof (prove)
using this:
rpoly x w = 0

goal (1 subgoal):
 1. \<exists>k<length fs. fs ! k = x
[PROOF STEP]
using x_in
[PROOF STATE]
proof (prove)
using this:
rpoly x w = 0
x \<in> set fs

goal (1 subgoal):
 1. \<exists>k<length fs. fs ! k = x
[PROOF STEP]
by (simp add: in_set_conv_nth)
[PROOF STATE]
proof (state)
this:
\<exists>k<length fs. fs ! k = x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set fs; rpoly x w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>k<length fs. fs ! k = x
[PROOF STEP]
obtain k where k_prop: "k < length fs \<and> fs ! k = x"
[PROOF STATE]
proof (prove)
using this:
\<exists>k<length fs. fs ! k = x

goal (1 subgoal):
 1. (\<And>k. k < length fs \<and> fs ! k = x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k < length fs \<and> fs ! k = x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set fs; rpoly x w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k < length fs \<and> fs ! k = x
[PROOF STEP]
have "(sign_vec fs w) ! k = 0"
[PROOF STATE]
proof (prove)
using this:
k < length fs \<and> fs ! k = x

goal (1 subgoal):
 1. sign_vec fs w ! k = 0
[PROOF STEP]
using x_zer
[PROOF STATE]
proof (prove)
using this:
k < length fs \<and> fs ! k = x
rpoly x w = 0

goal (1 subgoal):
 1. sign_vec fs w ! k = 0
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rpoly (fs ! k) w = 0; k < length fs; x = fs ! k\<rbrakk> \<Longrightarrow> sign_vec fs w ! k = 0
[PROOF STEP]
unfolding sign_vec_def squash_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rpoly (fs ! k) w = 0; k < length fs; x = fs ! k\<rbrakk> \<Longrightarrow> map ((\<lambda>x. if 0 < x then 1 else if x < 0 then - 1 else 0) \<circ> (\<lambda>p. rpoly p w)) fs ! k = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sign_vec fs w ! k = 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set fs; rpoly x w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sign_vec fs w ! k = 0
[PROOF STEP]
have "\<not> (has_no_zeros (sign_vec fs w))"
[PROOF STATE]
proof (prove)
using this:
sign_vec fs w ! k = 0

goal (1 subgoal):
 1. \<not> has_no_zeros (sign_vec fs w)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sign_vec fs w ! k = 0; has_no_zeros (sign_vec fs w)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (simp add: hnz_prop k_prop)
[PROOF STATE]
proof (state)
this:
\<not> has_no_zeros (sign_vec fs w)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set fs; rpoly x w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> has_no_zeros (sign_vec fs w)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> has_no_zeros (sign_vec fs w)

goal (1 subgoal):
 1. False
[PROOF STEP]
using hnz
[PROOF STATE]
proof (prove)
using this:
\<not> has_no_zeros (sign_vec fs w)
has_no_zeros csa

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding sign_vec_def squash_def
[PROOF STATE]
proof (prove)
using this:
\<not> has_no_zeros (map ((\<lambda>x. if 0 < x then 1 else if x < 0 then - 1 else 0) \<circ> (\<lambda>p. rpoly p w)) fs)
has_no_zeros csa

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>\<not> has_no_zeros (sign_vec fs w)\<close> w_prop(2)
[PROOF STATE]
proof (prove)
using this:
\<not> has_no_zeros (map ((\<lambda>x. if 0 < x then 1 else if x < 0 then - 1 else 0) \<circ> (\<lambda>p. rpoly p w)) fs)
has_no_zeros csa
\<not> has_no_zeros (sign_vec fs w)
csa = sign_vec fs w

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>x\<in>set fs. rpoly x w = 0)

goal (1 subgoal):
 1. map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::'a else - (1::'a)) \<circ> (\<lambda>p. rpoly p w)) fs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>x\<in>set fs. rpoly x w = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x\<in>set fs. rpoly x w = 0)

goal (1 subgoal):
 1. map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::'a else - (1::'a)) \<circ> (\<lambda>p. rpoly p w)) fs
[PROOF STEP]
using hnz
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x\<in>set fs. rpoly x w = 0)
has_no_zeros csa

goal (1 subgoal):
 1. map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::'a else - (1::'a)) \<circ> (\<lambda>p. rpoly p w)) fs
[PROOF STEP]
unfolding sign_vec_def squash_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x\<in>set fs. rpoly x w = 0)
has_no_zeros csa

goal (1 subgoal):
 1. map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::'a else - (1::'a)) \<circ> (\<lambda>p. rpoly p w)) fs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::'a else - (1::'a)) \<circ> (\<lambda>p. rpoly p w)) fs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map ((\<lambda>x. if 0 < x then 1::?'a1 else if x < 0 then - (1::?'a1) else (0::?'a1)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::?'a1 else - (1::?'a1)) \<circ> (\<lambda>p. rpoly p w)) fs

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map ((\<lambda>x. if 0 < x then 1::?'a1 else if x < 0 then - (1::?'a1) else (0::?'a1)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::?'a1 else - (1::?'a1)) \<circ> (\<lambda>p. rpoly p w)) fs
[PROOF STEP]
have "map ((\<lambda>x. if 0 < x then 1 else if x < 0 then - 1 else 0) \<circ> (\<lambda>p. rpoly p w)) fs =
    map (\<lambda>q. if 0 < poly q w then 1 else - 1)
     (cast_rat_list fs)"
[PROOF STATE]
proof (prove)
using this:
map ((\<lambda>x. if 0 < x then 1::?'a1 else if x < 0 then - (1::?'a1) else (0::?'a1)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::?'a1 else - (1::?'a1)) \<circ> (\<lambda>p. rpoly p w)) fs

goal (1 subgoal):
 1. map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map (\<lambda>q. if 0 < poly q w then 1::'a else - (1::'a)) (cast_rat_list fs)
[PROOF STEP]
unfolding cast_rat_list_def
[PROOF STATE]
proof (prove)
using this:
map ((\<lambda>x. if 0 < x then 1::?'a1 else if x < 0 then - (1::?'a1) else (0::?'a1)) \<circ> (\<lambda>p. rpoly p w)) fs = map ((\<lambda>x. if 0 < x then 1::?'a1 else - (1::?'a1)) \<circ> (\<lambda>p. rpoly p w)) fs

goal (1 subgoal):
 1. map ((\<lambda>x. if 0 < x then 1::'a else if x < 0 then - (1::'a) else (0::'a)) \<circ> (\<lambda>p. rpoly p w)) fs = map (\<lambda>q. if 0 < poly q w then 1::'a else - (1::'a)) (map real_of_rat_poly fs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map ((\<lambda>x. if 0 < x then 1::?'a2 else if x < 0 then - (1::?'a2) else (0::?'a2)) \<circ> (\<lambda>p. rpoly p w)) fs = map (\<lambda>q. if 0 < poly q w then 1::?'a2 else - (1::?'a2)) (cast_rat_list fs)

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map ((\<lambda>x. if 0 < x then 1::?'a2 else if x < 0 then - (1::?'a2) else (0::?'a2)) \<circ> (\<lambda>p. rpoly p w)) fs = map (\<lambda>q. if 0 < poly q w then 1::?'a2 else - (1::?'a2)) (cast_rat_list fs)
[PROOF STEP]
have "csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1)
             (cast_rat_list fs)"
[PROOF STATE]
proof (prove)
using this:
map ((\<lambda>x. if 0 < x then 1::?'a2 else if x < 0 then - (1::?'a2) else (0::?'a2)) \<circ> (\<lambda>p. rpoly p w)) fs = map (\<lambda>q. if 0 < poly q w then 1::?'a2 else - (1::?'a2)) (cast_rat_list fs)

goal (1 subgoal):
 1. csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs)
[PROOF STEP]
by (simp add: comp_def sign_vec_def squash_def w_prop(2))
[PROOF STATE]
proof (state)
this:
csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs)

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs)

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
unfolding characterize_consistent_signs_at_roots_def
[PROOF STATE]
proof (prove)
using this:
csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs)

goal (1 subgoal):
 1. csa \<in> set (remdups (map (signs_at (cast_rat_list fs)) (characterize_root_list_p (coprime_r (cast_rat_list fs)))))
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs) \<Longrightarrow> map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs) \<in> signs_at (cast_rat_list fs) ` set (characterize_root_list_p (coprime_r (cast_rat_list fs)))
[PROOF STEP]
unfolding signs_at_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs) \<Longrightarrow> map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs) \<in> (\<lambda>x. map (squash \<circ> (\<lambda>q. poly q x)) (cast_rat_list fs)) ` set (characterize_root_list_p (coprime_r (cast_rat_list fs)))
[PROOF STEP]
using w_ins w_prop
[PROOF STATE]
proof (prove)
using this:
w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs)))
w \<in> roots_of_coprime_r (cast_rat_list fs)
csa = sign_vec fs w

goal (1 subgoal):
 1. csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs) \<Longrightarrow> map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs) \<in> (\<lambda>x. map (squash \<circ> (\<lambda>q. poly q x)) (cast_rat_list fs)) ` set (characterize_root_list_p (coprime_r (cast_rat_list fs)))
[PROOF STEP]
using consistent_sign_vectors_consistent_sign_vectors_r consistent_sign_vectors_def consistent_sign_vectors_r_def signs_at_def
[PROOF STATE]
proof (prove)
using this:
w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs)))
w \<in> roots_of_coprime_r (cast_rat_list fs)
csa = sign_vec fs w
consistent_sign_vectors_r (cast_rat_list ?qs) ?S = consistent_sign_vectors ?qs ?S
consistent_sign_vectors ?qs ?S = sign_vec ?qs ` ?S
consistent_sign_vectors_r ?qs ?S = signs_at ?qs ` ?S
signs_at ?qs ?x \<equiv> map (squash \<circ> (\<lambda>q. poly q ?x)) ?qs

goal (1 subgoal):
 1. csa = map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs) \<Longrightarrow> map (\<lambda>q. if 0 < poly q w then 1 else - 1) (cast_rat_list fs) \<in> (\<lambda>x. map (squash \<circ> (\<lambda>q. poly q x)) (cast_rat_list fs)) ` set (characterize_root_list_p (coprime_r (cast_rat_list fs)))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
have backward: "csa \<in> set(characterize_consistent_signs_at_roots ?copr ?new_l) \<Longrightarrow>
    (csa \<in> (consistent_sign_vectors fs UNIV) \<and> has_no_zeros csa)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
assume csa_in: "csa \<in> set(characterize_consistent_signs_at_roots ?copr ?new_l)"
[PROOF STATE]
proof (state)
this:
csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
have csa_in_old_set: "csa \<in> set (characterize_consistent_signs_at_roots_copr ?copr ?new_l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots_copr (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
using csa_list_copr_rel copr_nonz csa_in find_consistent_signs_at_roots_copr pairwise_cp set_fsga
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<noteq> 0; \<forall>q. List.member ?qs q \<longrightarrow> algebraic_semidom_class.coprime ?p q\<rbrakk> \<Longrightarrow> characterize_consistent_signs_at_roots ?p ?qs = characterize_consistent_signs_at_roots_copr ?p ?qs
coprime_r (cast_rat_list fs) \<noteq> 0
csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
\<lbrakk>?p \<noteq> 0; \<And>q. q \<in> set ?qs \<Longrightarrow> algebraic_semidom_class.coprime ?p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots ?p ?qs) = set (characterize_consistent_signs_at_roots_copr ?p ?qs)
?q \<in> set (cast_rat_list fs) \<Longrightarrow> algebraic_semidom_class.coprime (coprime_r (cast_rat_list fs)) ?q
set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) = set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots_copr (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
csa \<in> set (characterize_consistent_signs_at_roots_copr (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
have "\<forall>(x::real). \<forall> (l::real poly list). rec_list True (\<lambda>h T. If (h = 0) False)
          (map (\<lambda>q. if 0 < poly q x then (1::rat) else (-1::rat))
            l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)
[PROOF STEP]
fix x::"real"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)
[PROOF STEP]
fix l::"real poly list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)
[PROOF STEP]
show " rec_list True (\<lambda>h T. If (h = 0) False)
            (map (\<lambda>q. if 0 < poly q x then (1::rat) else (-1::rat)) l) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)
[PROOF STEP]
proof (induct l)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) [])
 2. \<And>a l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l) \<Longrightarrow> rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (a # l))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) [])
 2. \<And>a l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l) \<Longrightarrow> rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (a # l))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) [])

goal (1 subgoal):
 1. \<And>a l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l) \<Longrightarrow> rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (a # l))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l) \<Longrightarrow> rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (a # l))
[PROOF STEP]
case (Cons a l)
[PROOF STATE]
proof (state)
this:
rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)

goal (1 subgoal):
 1. \<And>a l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l) \<Longrightarrow> rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (a # l))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)

goal (1 subgoal):
 1. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (a # l))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (a # l))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)
[PROOF STEP]
have "\<forall>x. rec_list True (\<lambda>h T. If (h = 0) False)
          (map (\<lambda>q. if 0 < poly q x then (1::rat) else - 1)
            (cast_rat_list fs))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x l. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) l)

goal (1 subgoal):
 1. \<forall>x. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs))

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs))
[PROOF STEP]
have hnz: "has_no_zeros csa"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs))

goal (1 subgoal):
 1. has_no_zeros csa
[PROOF STEP]
using csa_in_old_set
[PROOF STATE]
proof (prove)
using this:
\<forall>x. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs))
csa \<in> set (characterize_consistent_signs_at_roots_copr (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal (1 subgoal):
 1. has_no_zeros csa
[PROOF STEP]
unfolding characterize_consistent_signs_at_roots_copr_def consistent_sign_vec_copr_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs))
csa \<in> set (remdups (map (\<lambda>x. map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs)) (characterize_root_list_p (coprime_r (cast_rat_list fs)))))

goal (1 subgoal):
 1. has_no_zeros csa
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs)); x \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))); csa = map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs)\<rbrakk> \<Longrightarrow> has_no_zeros (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs))
[PROOF STEP]
unfolding has_no_zeros_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. rec_list True (\<lambda>h T. If (h = 0) False) (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs)); x \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))); csa = map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs)\<rbrakk> \<Longrightarrow> 0 \<notin> set (map (\<lambda>q. if 0 < poly q x then 1 else - 1) (cast_rat_list fs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
has_no_zeros csa

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
have "\<exists>w \<in> set(characterize_root_list_p ?copr). csa = consistent_sign_vec_copr ?new_l w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w\<in>set (characterize_root_list_p (coprime_r (cast_rat_list fs))). csa = consistent_sign_vec_copr (cast_rat_list fs) w
[PROOF STEP]
using csa_in_old_set
[PROOF STATE]
proof (prove)
using this:
csa \<in> set (characterize_consistent_signs_at_roots_copr (coprime_r (cast_rat_list fs)) (cast_rat_list fs))

goal (1 subgoal):
 1. \<exists>w\<in>set (characterize_root_list_p (coprime_r (cast_rat_list fs))). csa = consistent_sign_vec_copr (cast_rat_list fs) w
[PROOF STEP]
using characterize_consistent_signs_at_roots_copr_def
[PROOF STATE]
proof (prove)
using this:
csa \<in> set (characterize_consistent_signs_at_roots_copr (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
characterize_consistent_signs_at_roots_copr ?p ?qss = remdups (map (consistent_sign_vec_copr ?qss) (characterize_root_list_p ?p))

goal (1 subgoal):
 1. \<exists>w\<in>set (characterize_root_list_p (coprime_r (cast_rat_list fs))). csa = consistent_sign_vec_copr (cast_rat_list fs) w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>w\<in>set (characterize_root_list_p (coprime_r (cast_rat_list fs))). csa = consistent_sign_vec_copr (cast_rat_list fs) w

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>w\<in>set (characterize_root_list_p (coprime_r (cast_rat_list fs))). csa = consistent_sign_vec_copr (cast_rat_list fs) w
[PROOF STEP]
obtain w where w_prop: "w \<in> set (characterize_root_list_p ?copr) \<and> csa = consistent_sign_vec_copr ?new_l w"
[PROOF STATE]
proof (prove)
using this:
\<exists>w\<in>set (characterize_root_list_p (coprime_r (cast_rat_list fs))). csa = consistent_sign_vec_copr (cast_rat_list fs) w

goal (1 subgoal):
 1. (\<And>w. w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))) \<and> csa = consistent_sign_vec_copr (cast_rat_list fs) w \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))) \<and> csa = consistent_sign_vec_copr (cast_rat_list fs) w

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))) \<and> csa = consistent_sign_vec_copr (cast_rat_list fs) w
[PROOF STEP]
have "poly ?copr w = 0"
[PROOF STATE]
proof (prove)
using this:
w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))) \<and> csa = consistent_sign_vec_copr (cast_rat_list fs) w

goal (1 subgoal):
 1. poly (coprime_r (cast_rat_list fs)) w = 0
[PROOF STEP]
unfolding characterize_root_list_p_def
[PROOF STATE]
proof (prove)
using this:
w \<in> set (sorted_list_of_set {x. poly (coprime_r (cast_rat_list fs)) x = 0}) \<and> csa = consistent_sign_vec_copr (cast_rat_list fs) w

goal (1 subgoal):
 1. poly (coprime_r (cast_rat_list fs)) w = 0
[PROOF STEP]
by (simp add: copr_nonz poly_roots_finite)
[PROOF STATE]
proof (state)
this:
poly (coprime_r (cast_rat_list fs)) w = 0

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly (coprime_r (cast_rat_list fs)) w = 0
[PROOF STEP]
have copr_prop: "\<forall>p \<in> set(?new_l). poly p w \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
poly (coprime_r (cast_rat_list fs)) w = 0

goal (1 subgoal):
 1. \<forall>p\<in>set (cast_rat_list fs). poly p w \<noteq> 0
[PROOF STEP]
using w_prop coprime_r_coprime_prop
[PROOF STATE]
proof (prove)
using this:
poly (coprime_r (cast_rat_list fs)) w = 0
w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))) \<and> csa = consistent_sign_vec_copr (cast_rat_list fs) w
\<lbrakk>factorize_polys ?ps = (?fs, ?data); ?fss = map real_of_rat_poly ?fs; ?f \<in> set ?fss\<rbrakk> \<Longrightarrow> comm_monoid_mult_class.coprime ?f (coprime_r ?fss)

goal (1 subgoal):
 1. \<forall>p\<in>set (cast_rat_list fs). poly p w \<noteq> 0
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>poly (coprime_r (cast_rat_list fs)) w = 0; \<And>ps fs data fss f. \<lbrakk>factorize_polys ps = (fs, data); fss = map real_of_rat_poly fs; f \<in> real_of_rat_poly ` set fs\<rbrakk> \<Longrightarrow> algebraic_semidom_class.coprime f (coprime_r (map real_of_rat_poly fs)); p \<in> set (cast_rat_list fs); w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))); csa = consistent_sign_vec_copr (cast_rat_list fs) w; poly p w = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (meson coprime_poly_0 in_set_member pairwise_cp)
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>set (cast_rat_list fs). poly p w \<noteq> 0

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>p\<in>set (cast_rat_list fs). poly p w \<noteq> 0
[PROOF STEP]
have "consistent_sign_vec_copr ?new_l w = sign_vec fs w"
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set (cast_rat_list fs). poly p w \<noteq> 0

goal (1 subgoal):
 1. consistent_sign_vec_copr (cast_rat_list fs) w = sign_vec fs w
[PROOF STEP]
unfolding sign_vec_def squash_def consistent_sign_vec_copr_def
        cast_rat_list_def
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>set (map real_of_rat_poly fs). poly p w \<noteq> 0

goal (1 subgoal):
 1. map (\<lambda>q. if 0 < poly q w then 1 else - 1) (map real_of_rat_poly fs) = map ((\<lambda>x. if 0 < x then 1 else if x < 0 then - 1 else 0) \<circ> (\<lambda>p. rpoly p w)) fs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
consistent_sign_vec_copr (cast_rat_list fs) w = sign_vec fs w

goal (1 subgoal):
 1. csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
consistent_sign_vec_copr (cast_rat_list fs) w = sign_vec fs w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
consistent_sign_vec_copr (cast_rat_list fs) w = sign_vec fs w

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
using hnz w_prop
[PROOF STATE]
proof (prove)
using this:
consistent_sign_vec_copr (cast_rat_list fs) w = sign_vec fs w
has_no_zeros csa
w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))) \<and> csa = consistent_sign_vec_copr (cast_rat_list fs) w

goal (1 subgoal):
 1. csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>consistent_sign_vec_copr (cast_rat_list fs) w = sign_vec fs w; has_no_zeros (sign_vec fs w); w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))); csa = sign_vec fs w\<rbrakk> \<Longrightarrow> sign_vec fs w \<in> consistent_sign_vectors fs UNIV
[PROOF STEP]
using consistent_sign_vectors_def
[PROOF STATE]
proof (prove)
using this:
consistent_sign_vectors ?qs ?S = sign_vec ?qs ` ?S

goal (1 subgoal):
 1. \<lbrakk>consistent_sign_vec_copr (cast_rat_list fs) w = sign_vec fs w; has_no_zeros (sign_vec fs w); w \<in> set (characterize_root_list_p (coprime_r (cast_rat_list fs))); csa = sign_vec fs w\<rbrakk> \<Longrightarrow> sign_vec fs w \<in> consistent_sign_vectors fs UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
have "(csa \<in> (consistent_sign_vectors fs UNIV) \<and> has_no_zeros csa)
     \<longleftrightarrow> csa \<in> set(characterize_consistent_signs_at_roots ?copr ?new_l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
using forward backward
[PROOF STATE]
proof (prove)
using this:
csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa \<Longrightarrow> csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))
csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)) \<Longrightarrow> csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
using  csa_in_hyp
[PROOF STATE]
proof (prove)
using this:
(csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
(csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs))) = (csa \<in> set (characterize_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))

goal (1 subgoal):
 1. (csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(csa \<in> consistent_sign_vectors fs UNIV \<and> has_no_zeros csa) = (csa \<in> set (find_consistent_signs_at_roots (coprime_r (cast_rat_list fs)) (cast_rat_list fs)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(P = Q) = ((Q \<or> \<not>P) \<and> (\<not>Q\<or>P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P = Q) = ((Q \<or> \<not> P) \<and> (\<not> Q \<or> P))
[PROOF STEP]
by blast


[STATEMENT]
lemma "(1 + 2*\<i>) * (1 + 3*\<i>) = -5 + 5*\<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + 2 * \<i>) * (1 + 3 * \<i>) = - 5 + 5 * \<i>
[PROOF STEP]
by (simp add: ring_distribs)


[STATEMENT]
lemma nsets_disjoint_2:
  "X \<inter> Y = {} \<Longrightarrow> [X \<union> Y]\<^bsup>2\<^esup> = [X]\<^bsup>2\<^esup> \<union> [Y]\<^bsup>2\<^esup> \<union> (\<Union>x\<in>X. \<Union>y\<in>Y. {{x,y}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<inter> Y = {} \<Longrightarrow> [X \<union> Y]\<^bsup>2\<^esup> = [X]\<^bsup>2\<^esup> \<union> [Y]\<^bsup>2\<^esup> \<union> (\<Union>x\<in>X. \<Union>y\<in>Y. {{x, y}})
[PROOF STEP]
by (fastforce simp: nsets_2_eq Set.doubleton_eq_iff)


[STATEMENT]
lemma is_subseq_closed:
  assumes "s \<in> closed_seqs Zp"
  assumes "is_subseq_of s s'"
  shows "s' \<in> closed_seqs Zp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s' \<in> carrier Zp\<^bsup>\<omega>\<^esup>
[PROOF STEP]
apply(rule closed_seqs_memI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. s' k \<in> carrier Zp
[PROOF STEP]
using is_subseq_ind assms closed_seqs_memE
[PROOF STATE]
proof (prove)
using this:
is_subseq_of ?s ?s' \<Longrightarrow> \<exists>l. ?s' ?k = ?s l
s \<in> carrier Zp\<^bsup>\<omega>\<^esup>
is_subseq_of s s'
?s \<in> carrier ?R\<^bsup>\<omega>\<^esup> \<Longrightarrow> ?s ?k \<in> carrier ?R

goal (1 subgoal):
 1. \<And>k. s' k \<in> carrier Zp
[PROOF STEP]
by metis


[STATEMENT]
lemma connectedin_eq_not_separated_subset:
  "connectedin X S \<longleftrightarrow>
      S \<subseteq> topspace X \<and> (\<nexists>C1 C2. S \<subseteq> C1 \<union> C2 \<and> S \<inter> C1 \<noteq> {} \<and> S \<inter> C2 \<noteq> {} \<and> separatedin X C1 C2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>C1 C2. S \<subseteq> C1 \<union> C2 \<and> S \<inter> C1 \<noteq> {} \<and> S \<inter> C2 \<noteq> {} \<and> separatedin X C1 C2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>C1 C2. S \<subseteq> C1 \<union> C2 \<and> S \<inter> C1 \<noteq> {} \<and> S \<inter> C2 \<noteq> {} \<and> separatedin X C1 C2))
[PROOF STEP]
have "\<forall>C1 C2. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2"
    if "\<And>C1 C2. C1 \<union> C2 = S \<longrightarrow> C1 = {} \<or> C2 = {} \<or> \<not> separatedin X C1 C2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C1 C2. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2
[PROOF STEP]
proof (intro allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C1 C2. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2
[PROOF STEP]
fix C1 C2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C1 C2. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2
[PROOF STEP]
show "S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2
[PROOF STEP]
using that [of "S \<inter> C1" "S \<inter> C2"]
[PROOF STATE]
proof (prove)
using this:
S \<inter> C1 \<union> S \<inter> C2 = S \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X (S \<inter> C1) (S \<inter> C2)

goal (1 subgoal):
 1. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2
[PROOF STEP]
by (auto simp: separatedin_mono)
[PROOF STATE]
proof (state)
this:
S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<And>C1 C2. C1 \<union> C2 = S \<longrightarrow> C1 = {} \<or> C2 = {} \<or> \<not> separatedin X C1 C2) \<Longrightarrow> \<forall>C1 C2. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2

goal (1 subgoal):
 1. connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>C1 C2. S \<subseteq> C1 \<union> C2 \<and> S \<inter> C1 \<noteq> {} \<and> S \<inter> C2 \<noteq> {} \<and> separatedin X C1 C2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>C1 C2. C1 \<union> C2 = S \<longrightarrow> C1 = {} \<or> C2 = {} \<or> \<not> separatedin X C1 C2) \<Longrightarrow> \<forall>C1 C2. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>C1 C2. C1 \<union> C2 = S \<longrightarrow> C1 = {} \<or> C2 = {} \<or> \<not> separatedin X C1 C2) \<Longrightarrow> \<forall>C1 C2. S \<subseteq> C1 \<union> C2 \<longrightarrow> S \<inter> C1 = {} \<or> S \<inter> C2 = {} \<or> \<not> separatedin X C1 C2

goal (1 subgoal):
 1. connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>C1 C2. S \<subseteq> C1 \<union> C2 \<and> S \<inter> C1 \<noteq> {} \<and> S \<inter> C2 \<noteq> {} \<and> separatedin X C1 C2))
[PROOF STEP]
by (metis Un_Int_eq(1) Un_Int_eq(2) connectedin_eq_not_separated order_refl)
[PROOF STATE]
proof (state)
this:
connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>C1 C2. S \<subseteq> C1 \<union> C2 \<and> S \<inter> C1 \<noteq> {} \<and> S \<inter> C2 \<noteq> {} \<and> separatedin X C1 C2))

goal:
No subgoals!
[PROOF STEP]
qed