[STATEMENT]
lemma (in subgroup) mult_in_cancel_left:
  assumes "y \<in> carrier G" "x \<in> H" "group G"
  shows   "x \<otimes> y \<in> H \<longleftrightarrow> y \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes> y \<in> H) = (y \<in> H)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> y \<in> H
 2. y \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
assume "x \<otimes> y \<in> H"
[PROOF STATE]
proof (state)
this:
x \<otimes> y \<in> H

goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> y \<in> H
 2. y \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
hence "inv x \<otimes> (x \<otimes> y) \<in> H"
[PROOF STATE]
proof (prove)
using this:
x \<otimes> y \<in> H

goal (1 subgoal):
 1. inv x \<otimes> (x \<otimes> y) \<in> H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<otimes> y \<in> H
y \<in> carrier G
x \<in> H
Group.group G

goal (1 subgoal):
 1. inv x \<otimes> (x \<otimes> y) \<in> H
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv x \<otimes> (x \<otimes> y) \<in> H

goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> y \<in> H
 2. y \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv x \<otimes> (x \<otimes> y) \<in> H

goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> y \<in> H
 2. y \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
have "inv x \<otimes> (x \<otimes> y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv x \<otimes> (x \<otimes> y) = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y \<in> carrier G
x \<in> H
Group.group G

goal (1 subgoal):
 1. inv x \<otimes> (x \<otimes> y) = y
[PROOF STEP]
by (simp add: \<open>x \<otimes> y \<in> H\<close> group.inv_solve_left')
[PROOF STATE]
proof (state)
this:
inv x \<otimes> (x \<otimes> y) = y

goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> y \<in> H
 2. y \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
y \<in> H
[PROOF STEP]
show "y \<in> H"
[PROOF STATE]
proof (prove)
using this:
y \<in> H

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

goal (1 subgoal):
 1. y \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma sturm_gcd: "r \<in> set (sturm p) \<Longrightarrow> gcd p (pderiv p) dvd r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in> set (sturm p) \<Longrightarrow> gcd p (pderiv p) dvd r
[PROOF STEP]
unfolding sturm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in> set (sturm_aux p (pderiv p)) \<Longrightarrow> gcd p (pderiv p) dvd r
[PROOF STEP]
by (rule sturm_aux_gcd)


[STATEMENT]
lemma bpp_closed1:"\<lbrakk>assoc_bpp A f; x \<in> add_set f A n; y \<in> add_set f A m\<rbrakk> \<Longrightarrow>
                    x \<^sub>f+ y \<in> add_set f A (n + m + Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp A f; x \<in> add_set f A n; y \<in> add_set f A m\<rbrakk> \<Longrightarrow> x \<^sub>f+ y \<in> add_set f A (n + m + Suc 0)
[PROOF STEP]
apply (insert bpp_closedTr[of "A" "f"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp A f; x \<in> add_set f A n; y \<in> add_set f A m; \<And>n m. assoc_bpp A f \<Longrightarrow> \<forall>x y. x \<in> add_set f A n \<and> y \<in> add_set f A m \<longrightarrow> x \<^sub>f+ y \<in> add_set f A (n + m + Suc 0)\<rbrakk> \<Longrightarrow> x \<^sub>f+ y \<in> add_set f A (n + m + Suc 0)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma le_natceiling_iff:
  fixes n :: nat and r :: real
  shows "n \<le> r \<Longrightarrow> n \<le> nat(ceiling r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n \<le> r \<Longrightarrow> n \<le> nat \<lceil>r\<rceil>
[PROOF STEP]
by linarith


[STATEMENT]
lemma mirror_elem_diff: "
  \<lbrakk> finite I; k \<le> n; n \<in> I \<rbrakk> \<Longrightarrow> mirror_elem (n - k) I = mirror_elem n I + k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; k \<le> n; n \<in> I\<rbrakk> \<Longrightarrow> mirror_elem (n - k) I = mirror_elem n I + k
[PROOF STEP]
apply (unfold mirror_elem_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; k \<le> n; n \<in> I\<rbrakk> \<Longrightarrow> nat_mirror (n - k) (iMin I) (Max I) = nat_mirror n (iMin I) (Max I) + k
[PROOF STEP]
apply (rule nat_mirror_diff, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; k \<le> n; n \<in> I\<rbrakk> \<Longrightarrow> n \<le> iMin I + Max I
[PROOF STEP]
apply (simp add: trans_le_add2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma convex_hull_list_eq_set:
  "set Vs \<subseteq> carrier_vec n \<Longrightarrow> set Vs = set Ws \<Longrightarrow> convex_hull_list Vs = convex_hull_list Ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set Vs \<subseteq> carrier_vec n; set Vs = set Ws\<rbrakk> \<Longrightarrow> convex_hull_list Vs = convex_hull_list Ws
[PROOF STEP]
using convex_hull_list_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set ?Ws \<subseteq> carrier_vec n; set ?Vs \<subseteq> set ?Ws\<rbrakk> \<Longrightarrow> convex_hull_list ?Vs \<subseteq> convex_hull_list ?Ws

goal (1 subgoal):
 1. \<lbrakk>set Vs \<subseteq> carrier_vec n; set Vs = set Ws\<rbrakk> \<Longrightarrow> convex_hull_list Vs = convex_hull_list Ws
[PROOF STEP]
by blast


[STATEMENT]
lemma absolutely_integrable_on_combine:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"
  assumes "f absolutely_integrable_on {a..c}"
    and "f absolutely_integrable_on {c..b}"
    and "a \<le> c"
    and "c \<le> b"
  shows "f absolutely_integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f absolutely_integrable_on {a..b}
[PROOF STEP]
by (metis absolutely_integrable_Un assms ivl_disj_un_two_touch(4))


[STATEMENT]
lemma foldl_list_update:
  "n < length xs \<Longrightarrow> foldl f a (xs[n := x]) = foldl f (f (foldl f a (take n xs)) x) (drop (Suc n) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length xs \<Longrightarrow> foldl f a (xs[n := x]) = foldl f (f (foldl f a (take n xs)) x) (drop (Suc n) xs)
[PROOF STEP]
by(simp add: upd_conv_take_nth_drop)


[STATEMENT]
lemma  I_XpZ_carrier:
  shows "I_XpZ \<in> carrier_mat 4 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I_XpZ \<in> carrier_mat 4 4
[PROOF STEP]
using tensor_mat_carrier XpZ_carrier
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
XpZ \<in> carrier_mat 2 2

goal (1 subgoal):
 1. I_XpZ \<in> carrier_mat 4 4
[PROOF STEP]
unfolding I_XpZ_def
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
XpZ \<in> carrier_mat 2 2

goal (1 subgoal):
 1. 1\<^sub>m 2 \<Otimes> XpZ \<in> carrier_mat 4 4
[PROOF STEP]
by auto


[STATEMENT]
lemma of_nat_le_ennreal_iff[simp]: "0 \<le> r \<Longrightarrow> of_nat i \<le> ennreal r \<longleftrightarrow> of_nat i \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> r \<Longrightarrow> (of_nat i \<le> ennreal r) = (real i \<le> r)
[PROOF STEP]
by (simp add: ennreal_of_nat_eq_real_of_nat)


[STATEMENT]
lemma less_rat [simp]:
  "b \<noteq> 0 \<Longrightarrow> d \<noteq> 0 \<Longrightarrow> Fract a b < Fract c d \<longleftrightarrow> (a * d) * (b * d) < (c * b) * (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> 0; d \<noteq> 0\<rbrakk> \<Longrightarrow> (Fract a b < Fract c d) = (a * d * (b * d) < c * b * (b * d))
[PROOF STEP]
by (simp add: less_rat_def positive_rat algebra_simps)


[STATEMENT]
lemma size_not_empty: "size (stack :: 'a stack) > 0 \<longleftrightarrow> \<not> is_empty stack"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < size stack) = (\<not> is_empty stack)
[PROOF STEP]
by(induction stack rule: is_empty_stack.induct) auto


[STATEMENT]
lemma List_product_concat_map: "List.product xs ys = concat (map (\<lambda>x. map (\<lambda>y. (x,y)) ys) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.product xs ys = concat (map (\<lambda>x. map (Pair x) ys) xs)
[PROOF STEP]
by(induction xs) (simp)+


[STATEMENT]
lemma real_of_int_div4: "real_of_int (n div x) \<le> real_of_int n / real_of_int x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (n div x) \<le> real_of_int n / real_of_int x
[PROOF STEP]
using real_of_int_div2 [of n x]
[PROOF STATE]
proof (prove)
using this:
0 \<le> real_of_int n / real_of_int x - real_of_int (n div x)

goal (1 subgoal):
 1. real_of_int (n div x) \<le> real_of_int n / real_of_int x
[PROOF STEP]
by simp


[STATEMENT]
lemma fun_complex_eq: "f = (\<lambda>x. Re (f x) + \<i> * Im (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<lambda>x. complex_of_real (Re (f x)) + \<i> * complex_of_real (Im (f x)))
[PROOF STEP]
by (simp add: fun_eq_iff complex_eq)


[STATEMENT]
lemma is_aligned_no_wrap:
  fixes off :: "'a::len word"
  fixes ptr :: "'a::len word"
  assumes al: "is_aligned ptr sz"
  and    off: "off < 2 ^ sz"
  shows  "unat ptr + unat off < 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
have szv: "sz < LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sz < LENGTH('a)
[PROOF STEP]
using off p2_gt_0 word_neq_0_conv
[PROOF STATE]
proof (prove)
using this:
off < 2 ^ sz
(0 < 2 ^ ?n) = (?n < LENGTH(?'a))
(?w \<noteq> 0) = (0 < ?w)

goal (1 subgoal):
 1. sz < LENGTH('a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
sz < LENGTH('a)

goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
from al
[PROOF STATE]
proof (chain)
picking this:
is_aligned ptr sz
[PROOF STEP]
obtain q where ptrq: "ptr = 2 ^ sz * of_nat q" and
    qv: "q < 2 ^ (LENGTH('a) - sz)"
[PROOF STATE]
proof (prove)
using this:
is_aligned ptr sz

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>ptr = 2 ^ sz * word_of_nat q; q < 2 ^ (LENGTH('a) - sz)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: is_alignedE)
[PROOF STATE]
proof (state)
this:
ptr = 2 ^ sz * word_of_nat q
q < 2 ^ (LENGTH('a) - sz)

goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
proof (cases "sz = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sz = 0 \<Longrightarrow> unat ptr + unat off < 2 ^ LENGTH('a)
 2. sz \<noteq> 0 \<Longrightarrow> unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
sz = 0

goal (2 subgoals):
 1. sz = 0 \<Longrightarrow> unat ptr + unat off < 2 ^ LENGTH('a)
 2. sz \<noteq> 0 \<Longrightarrow> unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sz = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sz = 0

goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
using off ptrq qv
[PROOF STATE]
proof (prove)
using this:
sz = 0
off < 2 ^ sz
ptr = 2 ^ sz * word_of_nat q
q < 2 ^ (LENGTH('a) - sz)

goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unat ptr + unat off < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. sz \<noteq> 0 \<Longrightarrow> unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sz \<noteq> 0 \<Longrightarrow> unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
sz \<noteq> 0

goal (1 subgoal):
 1. sz \<noteq> 0 \<Longrightarrow> unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sz \<noteq> 0
[PROOF STEP]
have sne: "0 < sz"
[PROOF STATE]
proof (prove)
using this:
sz \<noteq> 0

goal (1 subgoal):
 1. 0 < sz
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
0 < sz

goal (1 subgoal):
 1. sz \<noteq> 0 \<Longrightarrow> unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
have uq: "unat (of_nat q ::'a::len word) = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (word_of_nat q) = q
[PROOF STEP]
apply (subst unat_of_nat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q mod 2 ^ LENGTH('a) = q
[PROOF STEP]
apply (rule mod_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q < 2 ^ LENGTH('a)
[PROOF STEP]
apply (rule order_less_trans [OF qv])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (LENGTH('a) - sz) < 2 ^ LENGTH('a)
[PROOF STEP]
apply (rule power_strict_increasing [OF diff_less [OF sne]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < LENGTH('a)
 2. 1 < 2
[PROOF STEP]
apply (simp_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
unat (word_of_nat q) = q

goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
have uptr: "unat ptr = 2 ^ sz * q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat ptr = 2 ^ sz * q
[PROOF STEP]
apply (subst ptrq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (2 ^ sz * word_of_nat q) = 2 ^ sz * q
[PROOF STEP]
apply (subst iffD1 [OF unat_mult_lem])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. unat (2 ^ sz) * unat (word_of_nat q) < 2 ^ LENGTH('a)
 2. unat (2 ^ sz) * unat (word_of_nat q) = 2 ^ sz * q
[PROOF STEP]
apply (subst unat_power_lower [OF szv])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 2 ^ sz * unat (word_of_nat q) < 2 ^ LENGTH('a)
 2. unat (2 ^ sz) * unat (word_of_nat q) = 2 ^ sz * q
[PROOF STEP]
apply (subst uq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 2 ^ sz * q < 2 ^ LENGTH('a)
 2. unat (2 ^ sz) * unat (word_of_nat q) = 2 ^ sz * q
[PROOF STEP]
apply (rule nat_less_power_trans [OF qv order_less_imp_le [OF szv]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (2 ^ sz) * unat (word_of_nat q) = 2 ^ sz * q
[PROOF STEP]
apply (subst uq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (2 ^ sz) * q = 2 ^ sz * q
[PROOF STEP]
apply (subst unat_power_lower [OF szv])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ sz * q = 2 ^ sz * q
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
unat ptr = 2 ^ sz * q

goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
show "unat ptr + unat off < 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
using szv
[PROOF STATE]
proof (prove)
using this:
sz < LENGTH('a)

goal (1 subgoal):
 1. unat ptr + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst uptr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sz < LENGTH('a) \<Longrightarrow> 2 ^ sz * q + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst mult.commute, rule nat_add_offset_less [OF _ qv])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> unat off < 2 ^ sz
 2. sz < LENGTH('a) \<Longrightarrow> LENGTH('a) = LENGTH('a) - sz + sz
[PROOF STEP]
apply (rule order_less_le_trans [OF unat_mono [OF off] order_eq_refl])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz) = 2 ^ sz
 2. sz < LENGTH('a) \<Longrightarrow> LENGTH('a) = LENGTH('a) - sz + sz
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
unat ptr + unat off < 2 ^ LENGTH('a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unat ptr + unat off < 2 ^ LENGTH('a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unat ptr + unat off < 2 ^ LENGTH('a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_rat_floor [simp]:
  "\<lfloor>of_rat r\<rfloor> = \<lfloor>r\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>of_rat r\<rfloor> = \<lfloor>r\<rfloor>
[PROOF STEP]
by (cases r) (simp add: Fract_of_int_quotient of_rat_divide floor_divide_of_int_eq)


[STATEMENT]
lemma find_consistent_signs_at_roots_1:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  shows "(p \<noteq> 0 \<and> length qs > 0 \<and>
    (\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q)))) \<longrightarrow>
    set(find_consistent_signs_at_roots p qs) = set(characterize_consistent_signs_at_roots_copr p qs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
proof (induction "length qs" arbitrary: qs rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qsa) = set (characterize_consistent_signs_at_roots_copr p qsa)) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
length ?qs < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length ?qs \<and> (\<forall>q. List.member ?qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p ?qs) = set (characterize_consistent_signs_at_roots_copr p ?qs)

goal (1 subgoal):
 1. \<And>qs. (\<And>qsa. length qsa < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qsa \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qsa) = set (characterize_consistent_signs_at_roots_copr p qsa)) \<Longrightarrow> p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length ?qs < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length ?qs \<and> (\<forall>q. List.member ?qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p ?qs) = set (characterize_consistent_signs_at_roots_copr p ?qs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length ?qs < length qs \<Longrightarrow> p \<noteq> 0 \<and> 0 < length ?qs \<and> (\<forall>q. List.member ?qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p ?qs) = set (characterize_consistent_signs_at_roots_copr p ?qs)

goal (1 subgoal):
 1. p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
assume ind_hyp: "(\<And>qsa.
        length qsa < length qs \<Longrightarrow> qsa \<noteq> [] \<and> (\<forall>q. List.member qsa q \<longrightarrow> coprime p q) \<longrightarrow>
        set (find_consistent_signs_at_roots p qsa) =
        set (characterize_consistent_signs_at_roots_copr p qsa))"
[PROOF STATE]
proof (state)
this:
length ?qsa < length qs \<Longrightarrow> ?qsa \<noteq> [] \<and> (\<forall>q. List.member ?qsa q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p ?qsa) = set (characterize_consistent_signs_at_roots_copr p ?qsa)

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
assume nonzero: "p \<noteq> 0"
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
assume nontriv: "qs \<noteq> []"
[PROOF STATE]
proof (state)
this:
qs \<noteq> []

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
assume copr:" \<forall>q. List.member qs q \<longrightarrow> coprime p q"
[PROOF STATE]
proof (state)
this:
\<forall>q. List.member qs q \<longrightarrow> coprime p q

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
let ?len = "length qs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
let ?q1 = "take ((?len) div 2) qs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
let ?left = "calculate_data p ?q1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
let ?q2 = "drop ((?len) div 2) qs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
let ?right = "calculate_data p ?q2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have nontriv_q1: "length qs>1 \<longrightarrow> length ?q1 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have qs_more_q1: "length qs>1 \<longrightarrow> length qs > length ?q1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> length (take (length qs div 2) qs) < length qs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> length (take (length qs div 2) qs) < length qs

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have pairwise_rel_prime_q1: "\<forall>q. ((List.member ?q1 q) \<longrightarrow> (coprime p q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>q. List.member (take (length qs div 2) qs) q \<Longrightarrow> coprime p q
[PROOF STEP]
fix q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>q. List.member (take (length qs div 2) qs) q \<Longrightarrow> coprime p q
[PROOF STEP]
assume mem: "List.member (take (length qs div 2) qs) q"
[PROOF STATE]
proof (state)
this:
List.member (take (length qs div 2) qs) q

goal (1 subgoal):
 1. \<And>q. List.member (take (length qs div 2) qs) q \<Longrightarrow> coprime p q
[PROOF STEP]
have "List.member qs q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.member qs q
[PROOF STEP]
using mem set_take_subset[where n = "length qs div 2"]
[PROOF STATE]
proof (prove)
using this:
List.member (take (length qs div 2) qs) q
set (take (length qs div 2) ?xs) \<subseteq> set ?xs

goal (1 subgoal):
 1. List.member qs q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>List.member (take (length qs div 2) qs) q; \<And>xs. set (take (length qs div 2) xs) \<subseteq> set xs\<rbrakk> \<Longrightarrow> List.member qs q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.member qs q
[PROOF STEP]
by (meson \<open>List.member (take (length qs div 2) qs) q\<close> in_set_member in_set_takeD)
[PROOF STATE]
proof (state)
this:
List.member qs q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
List.member qs q

goal (1 subgoal):
 1. \<And>q. List.member (take (length qs div 2) qs) q \<Longrightarrow> coprime p q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
List.member qs q
[PROOF STEP]
show "coprime p q"
[PROOF STATE]
proof (prove)
using this:
List.member qs q

goal (1 subgoal):
 1. coprime p q
[PROOF STEP]
using copr
[PROOF STATE]
proof (prove)
using this:
List.member qs q
\<forall>q. List.member qs q \<longrightarrow> coprime p q

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have nontriv_q2: "length qs>1 \<longrightarrow>length ?q2 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> 0 < length (drop (length qs div 2) qs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> 0 < length (drop (length qs div 2) qs)

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have qs_more_q2: "length qs>1 \<longrightarrow> length qs > length ?q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have pairwise_rel_prime_q2: "\<forall>q. ((List.member ?q2 q) \<longrightarrow> (coprime p q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>q. List.member (drop (length qs div 2) qs) q \<Longrightarrow> coprime p q
[PROOF STEP]
fix q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>q. List.member (drop (length qs div 2) qs) q \<Longrightarrow> coprime p q
[PROOF STEP]
assume mem: "List.member (drop (length qs div 2) qs) q"
[PROOF STATE]
proof (state)
this:
List.member (drop (length qs div 2) qs) q

goal (1 subgoal):
 1. \<And>q. List.member (drop (length qs div 2) qs) q \<Longrightarrow> coprime p q
[PROOF STEP]
have "List.member qs q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.member qs q
[PROOF STEP]
using mem set_take_subset[where n = "length qs div 2"]
[PROOF STATE]
proof (prove)
using this:
List.member (drop (length qs div 2) qs) q
set (take (length qs div 2) ?xs) \<subseteq> set ?xs

goal (1 subgoal):
 1. List.member qs q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>List.member (drop (length qs div 2) qs) q; \<And>xs. set (take (length qs div 2) xs) \<subseteq> set xs\<rbrakk> \<Longrightarrow> List.member qs q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.member qs q
[PROOF STEP]
by (meson \<open>List.member (drop (length qs div 2) qs) q\<close> in_set_dropD in_set_member)
[PROOF STATE]
proof (state)
this:
List.member qs q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
List.member qs q

goal (1 subgoal):
 1. \<And>q. List.member (drop (length qs div 2) qs) q \<Longrightarrow> coprime p q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
List.member qs q
[PROOF STEP]
show "coprime p q"
[PROOF STATE]
proof (prove)
using this:
List.member qs q

goal (1 subgoal):
 1. coprime p q
[PROOF STEP]
using copr
[PROOF STATE]
proof (prove)
using this:
List.member qs q
\<forall>q. List.member qs q \<longrightarrow> coprime p q

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have key_h: "set (snd (snd (if ?len \<le> Suc 0 then reduce_system p (qs, base_case_info)
                        else   Let (combine_systems p (?q1, ?left) (?q2, ?right))
                                  (reduce_system p)))) =
       set (characterize_consistent_signs_at_roots_copr p qs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have h_len1 : "?len = 1 \<longrightarrow> set (snd (snd (if ?len \<le> Suc 0 then reduce_system p (qs, base_case_info)
                        else   Let (combine_systems p (?q1, ?left) (?q2, ?right))
                                  (reduce_system p)))) =
       set (characterize_consistent_signs_at_roots_copr p qs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length qs = 1 \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
using find_consistent_signs_at_roots_len1[of p qs] copr nonzero nontriv
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p \<noteq> 0; length qs = 1; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
\<forall>q. List.member qs q \<longrightarrow> coprime p q
p \<noteq> 0
qs \<noteq> []

goal (1 subgoal):
 1. length qs = 1 \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
by (simp add: find_consistent_signs_at_roots_thm)
[PROOF STATE]
proof (state)
this:
length qs = 1 \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have h_len_gt1 : "?len > 1 \<longrightarrow> set (snd (snd (if ?len \<le> Suc 0 then reduce_system p (qs, base_case_info)
                        else   Let (combine_systems p (?q1, ?left) (?q2, ?right))
                                  (reduce_system p)))) =
       set (characterize_consistent_signs_at_roots_copr p qs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have h_imp_a: "?len > 1 \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (?q1, ?left) (?q2, ?right))))) =
              set (characterize_consistent_signs_at_roots_copr p qs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have h1: "?len > 1 \<longrightarrow> set(snd(snd(?left))) = set (characterize_consistent_signs_at_roots_copr p ?q1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (calculate_data p (take (length qs div 2) qs)))) = set (characterize_consistent_signs_at_roots_copr p (take (length qs div 2) qs))
[PROOF STEP]
using nontriv_q1 pairwise_rel_prime_q1 ind_hyp[of ?q1] qs_more_q1
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)
\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q
length (take (length qs div 2) qs) < length qs \<Longrightarrow> take (length qs div 2) qs \<noteq> [] \<and> (\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p (take (length qs div 2) qs)) = set (characterize_consistent_signs_at_roots_copr p (take (length qs div 2) qs))
1 < length qs \<longrightarrow> length (take (length qs div 2) qs) < length qs

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (calculate_data p (take (length qs div 2) qs)))) = set (characterize_consistent_signs_at_roots_copr p (take (length qs div 2) qs))
[PROOF STEP]
by (metis find_consistent_signs_at_roots_thm less_numeral_extra(3) list.size(3))
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> set (snd (snd (calculate_data p (take (length qs div 2) qs)))) = set (characterize_consistent_signs_at_roots_copr p (take (length qs div 2) qs))

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have h2: "?len > 1 \<longrightarrow> set(snd(snd(?right))) = set (characterize_consistent_signs_at_roots_copr p ?q2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (calculate_data p (drop (length qs div 2) qs)))) = set (characterize_consistent_signs_at_roots_copr p (drop (length qs div 2) qs))
[PROOF STEP]
using nontriv_q2 pairwise_rel_prime_q2 ind_hyp[of ?q2] qs_more_q2
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> 0 < length (drop (length qs div 2) qs)
\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q
length (drop (length qs div 2) qs) < length qs \<Longrightarrow> drop (length qs div 2) qs \<noteq> [] \<and> (\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p (drop (length qs div 2) qs)) = set (characterize_consistent_signs_at_roots_copr p (drop (length qs div 2) qs))
1 < length qs \<longrightarrow> length (drop (length qs div 2) qs) < length qs

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (calculate_data p (drop (length qs div 2) qs)))) = set (characterize_consistent_signs_at_roots_copr p (drop (length qs div 2) qs))
[PROOF STEP]
by (metis (full_types) find_consistent_signs_at_roots_thm list.size(3) not_less_zero)
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> set (snd (snd (calculate_data p (drop (length qs div 2) qs)))) = set (characterize_consistent_signs_at_roots_copr p (drop (length qs div 2) qs))

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
using nonzero nontriv_q1 pairwise_rel_prime_q1 nontriv_q2 pairwise_rel_prime_q2 h1 h2
              smaller_sys_are_good
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
1 < length qs \<longrightarrow> 0 < length (take (length qs div 2) qs)
\<forall>q. List.member (take (length qs div 2) qs) q \<longrightarrow> coprime p q
1 < length qs \<longrightarrow> 0 < length (drop (length qs div 2) qs)
\<forall>q. List.member (drop (length qs div 2) qs) q \<longrightarrow> coprime p q
1 < length qs \<longrightarrow> set (snd (snd (calculate_data p (take (length qs div 2) qs)))) = set (characterize_consistent_signs_at_roots_copr p (take (length qs div 2) qs))
1 < length qs \<longrightarrow> set (snd (snd (calculate_data p (drop (length qs div 2) qs)))) = set (characterize_consistent_signs_at_roots_copr p (drop (length qs div 2) qs))
\<lbrakk>?p \<noteq> 0; 0 < length ?qs1.0; \<forall>q. List.member ?qs1.0 q \<longrightarrow> coprime ?p q; 0 < length ?qs2.0; \<forall>q. List.member ?qs2.0 q \<longrightarrow> coprime ?p q; set (find_consistent_signs_at_roots ?p ?qs1.0) = set (characterize_consistent_signs_at_roots_copr ?p ?qs1.0); set (find_consistent_signs_at_roots ?p ?qs2.0) = set (characterize_consistent_signs_at_roots_copr ?p ?qs2.0)\<rbrakk> \<Longrightarrow> set (snd (snd (reduce_system ?p (combine_systems ?p (?qs1.0, calculate_data ?p ?qs1.0) (?qs2.0, calculate_data ?p ?qs2.0))))) = set (characterize_consistent_signs_at_roots_copr ?p (?qs1.0 @ ?qs2.0))

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
by (metis append_take_drop_id find_consistent_signs_at_roots_thm)
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
have h_imp: "?len > 1 \<longrightarrow> set (snd (snd (Let (combine_systems p (?q1, ?left) (?q2, ?right))
                                  (reduce_system p)))) =
       set (characterize_consistent_signs_at_roots_copr p qs)"
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> set (snd (snd (reduce_system p (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs)))))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> set (snd (snd (Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < length qs \<longrightarrow> set (snd (snd (Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < length qs \<longrightarrow> set (snd (snd (Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. 1 < length qs \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 < length qs \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
using h_len1 h_len_gt1
[PROOF STATE]
proof (prove)
using this:
length qs = 1 \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
1 < length qs \<longrightarrow> set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
by (meson \<open>qs \<noteq> []\<close> length_0_conv less_one nat_neq_iff)
[PROOF STATE]
proof (state)
this:
set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. \<lbrakk>\<And>qs. length qs < length qs \<Longrightarrow> qs \<noteq> [] \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs); p \<noteq> 0; qs \<noteq> []; \<forall>q. List.member qs q \<longrightarrow> coprime p q\<rbrakk> \<Longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
show "set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)"
[PROOF STATE]
proof (prove)
using this:
set (snd (snd (if length qs \<le> Suc 0 then reduce_system p (qs, base_case_info) else Let (combine_systems p (take (length qs div 2) qs, calculate_data p (take (length qs div 2) qs)) (drop (length qs div 2) qs, calculate_data p (drop (length qs div 2) qs))) (reduce_system p)))) = set (characterize_consistent_signs_at_roots_copr p qs)

goal (1 subgoal):
 1. set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)
[PROOF STEP]
by (smt One_nat_def calculate_data.simps find_consistent_signs_at_roots_thm length_0_conv nontriv)
[PROOF STATE]
proof (state)
this:
set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<noteq> 0 \<and> 0 < length qs \<and> (\<forall>q. List.member qs q \<longrightarrow> coprime p q) \<longrightarrow> set (find_consistent_signs_at_roots p qs) = set (characterize_consistent_signs_at_roots_copr p qs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem F'set3_natural: "F'set3 o F'map f1 f2 f3 f4 = image f3 o F'set3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F'set3 \<circ> Fmap f3 f4 = (`) f3 \<circ> F'set3
[PROOF STEP]
by (rule F.set_map0(1))


[STATEMENT]
lemma length_Cons: "length (x # xs) = Suc (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (x # xs) = Suc (length xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma homotopic_circlemaps_imp_homotopic_loops:
  assumes "homotopic_with_canon (\<lambda>h. True) (sphere 0 1) S f g"
   shows "homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * of_real pi * of_real t * \<i>))
                            (g \<circ> exp \<circ> (\<lambda>t. 2 * of_real pi * of_real t * \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
have "homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
homotopic_with_canon (\<lambda>h. True) (sphere 0 1) S f g

goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g
[PROOF STEP]
by (auto simp: sphere_def)
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g

goal (1 subgoal):
 1. homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g

goal (1 subgoal):
 1. homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
have "continuous_on {0..1} (exp \<circ> (\<lambda>t. 2 * of_real pi * of_real t * \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))

goal (1 subgoal):
 1. homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))

goal (1 subgoal):
 1. homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
have "(exp \<circ> (\<lambda>t. 2 * of_real pi * of_real t * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}
[PROOF STEP]
by (auto simp: norm_mult)
[PROOF STATE]
proof (state)
this:
(exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}

goal (1 subgoal):
 1. homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g
continuous_on {0..1} (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
(exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g
continuous_on {0..1} (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
(exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}

goal (1 subgoal):
 1. homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
[PROOF STEP]
apply (simp add: homotopic_loops_def comp_assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g; continuous_on {0..1} (\<lambda>x. exp (2 * complex_of_real pi * complex_of_real x * \<i>)); (\<lambda>x. exp (2 * complex_of_real pi * complex_of_real x * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}\<rbrakk> \<Longrightarrow> homotopic_with_canon (\<lambda>r. pathfinish r = pathstart r) {0..1} S (f \<circ> (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))) (g \<circ> (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)))
[PROOF STEP]
apply (rule homotopic_with_compose_continuous_right)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g; continuous_on {0..1} (\<lambda>x. exp (2 * complex_of_real pi * complex_of_real x * \<i>)); (\<lambda>x. exp (2 * complex_of_real pi * complex_of_real x * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}\<rbrakk> \<Longrightarrow> homotopic_with_canon (\<lambda>f. pathfinish (f \<circ> (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))) = pathstart (f \<circ> (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)))) ?X6 S f g
 2. \<lbrakk>homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g; continuous_on {0..1} (\<lambda>x. exp (2 * complex_of_real pi * complex_of_real x * \<i>)); (\<lambda>x. exp (2 * complex_of_real pi * complex_of_real x * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}\<rbrakk> \<Longrightarrow> continuous_on {0..1} (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))
 3. \<lbrakk>homotopic_with_canon (\<lambda>f. True) {z. cmod z = 1} S f g; continuous_on {0..1} (\<lambda>x. exp (2 * complex_of_real pi * complex_of_real x * \<i>)); (\<lambda>x. exp (2 * complex_of_real pi * complex_of_real x * \<i>)) ` {0..1} \<subseteq> {z. cmod z = 1}\<rbrakk> \<Longrightarrow> (exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) ` {0..1} \<subseteq> ?X6
[PROOF STEP]
apply (auto simp: pathstart_def pathfinish_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
homotopic_loops S (f \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>)) (g \<circ> exp \<circ> (\<lambda>t. 2 * complex_of_real pi * complex_of_real t * \<i>))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_lattice_complete_top_greatest: "(top::'a::finite_lattice_complete) \<ge> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> top
[PROOF STEP]
by (auto simp: top_def Sup_fin.coboundedI)


[STATEMENT]
lemma lm03: "maxpositions l = [n. n\<leftarrow>[0..<size l], l!n \<ge> Max(set l)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maxpositions l = concat (map (\<lambda>n. if Max (set l) \<le> l ! n then [n] else []) [0..<length l])
[PROOF STEP]
unfolding maxpositions_def filterpositions2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat (map (\<lambda>n. if Max (set l) \<le> l ! n then [n] else []) [0..<length l]) = concat (map (\<lambda>n. if Max (set l) \<le> l ! n then [n] else []) [0..<length l])
[PROOF STEP]
by fastforce


[STATEMENT]
lemma cart_product_add_1: "(add_mset a A) \<times># B = ({#a#} \<times># B) + (A \<times># B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_mset a A \<times># B = {#a#} \<times># B + A \<times># B
[PROOF STEP]
by (metis Sigma_mset_plus_distrib1 add_mset_add_single union_commute)


[STATEMENT]
lemma rb_Nil_sp :
  assumes "RedBlack prb"
  shows   "subpath (red prb) rv1 [] rv2 (subs prb) =
           (rv1 \<in> red_vertices prb \<and> (rv1 = rv2 \<or> (rv1,rv2) \<in> (subs prb)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SubRel.subpath (red prb) rv1 [] rv2 (subs prb) = (rv1 \<in> red_vertices prb \<and> (rv1 = rv2 \<or> (rv1, rv2) \<in> subs prb))
[PROOF STEP]
using assms subs_wf_sub_rel subs_sub_rel_of wf_sub_rel.Nil_sp
[PROOF STATE]
proof (prove)
using this:
RedBlack prb
RedBlack ?prb \<Longrightarrow> wf_sub_rel (subs ?prb)
RedBlack ?prb \<Longrightarrow> sub_rel_of (red ?prb) (subs ?prb)
wf_sub_rel ?subs \<Longrightarrow> SubRel.subpath ?g ?v1.0 [] ?v2.0 ?subs = (sub_rel_of ?g ?subs \<and> ?v1.0 \<in> Graph.vertices ?g \<and> (?v1.0 = ?v2.0 \<or> (?v1.0, ?v2.0) \<in> ?subs))

goal (1 subgoal):
 1. SubRel.subpath (red prb) rv1 [] rv2 (subs prb) = (rv1 \<in> red_vertices prb \<and> (rv1 = rv2 \<or> (rv1, rv2) \<in> subs prb))
[PROOF STEP]
by fast


[STATEMENT]
lemma insertion_prod: "insertion f (prod g A) = (\<Prod>x\<in>A. insertion f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (prod g A) = (\<Prod>x\<in>A. insertion f (g x))
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (auto simp: insertion_mult)


[STATEMENT]
lemma finite_set_Cons_union_finite:
  "\<lbrakk>finite xs; finite ys; \<forall>y \<in> ys. finite y\<rbrakk>
    \<Longrightarrow> finite {x # y | x y. x \<in> xs \<and> y \<in> (\<Union>y \<in> ys. y)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite xs; finite ys; \<forall>y\<in>ys. finite y\<rbrakk> \<Longrightarrow> finite {x # y |x y. x \<in> xs \<and> y \<in> (\<Union>y\<in>ys. y)}
[PROOF STEP]
by (simp add: finite_image_set2)


[STATEMENT]
lemma "dist x y \<le> e \<Longrightarrow> z \<in> ball x f \<Longrightarrow> dist z y < e + f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dist x y \<le> e; z \<in> ball x f\<rbrakk> \<Longrightarrow> dist z y < e + f
[PROOF STEP]
by metric


[STATEMENT]
lemma (in PolynRg) const_times_polyn1:"\<lbrakk>Idomain S; p\<in> carrier R; c \<in> carrier S;
            c \<noteq> \<zero>\<^bsub>S\<^esub>\<rbrakk> \<Longrightarrow> deg R S X (c \<cdot>\<^sub>r p) = deg R S X p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; p \<in> carrier R; c \<in> carrier S; c \<noteq> \<zero>\<^bsub>S\<^esub>\<rbrakk> \<Longrightarrow> deg R S X (c \<cdot>\<^sub>r p) = deg R S X p
[PROOF STEP]
apply (frule Idomain.idom_is_ring,
       cut_tac subring,
       frule mem_subring_mem_ring[of S c], assumption,
       simp add:Subring_zero_ring_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; p \<in> carrier R; c \<in> carrier S; c \<noteq> \<zero>; Ring S; Subring R S; c \<in> carrier R\<rbrakk> \<Longrightarrow> deg R S X (c \<cdot>\<^sub>r p) = deg R S X p
[PROOF STEP]
apply (subst deg_mult_pols1[of c p], assumption+,
       simp add: pol_deg_0[THEN sym, of "c"],
       simp add:aadd_0_l)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nth_prime_partition'':
  includes prime_counting_notation
  assumes "x \<ge> (2 :: real)"
  shows "x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
obtain n where n: "x \<in> {nth_prime n..<nth_prime (Suc n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using nth_prime_partition' assms
[PROOF STATE]
proof (prove)
using this:
2 \<le> ?x \<Longrightarrow> \<exists>k. ?x \<in> {real (nth_prime k)..<real (nth_prime (Suc k))}
2 \<le> x

goal (1 subgoal):
 1. (\<And>n. x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))}

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
have "\<pi> (nth_prime n) = \<pi> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (real (nth_prime n)) = \<pi> x
[PROOF STEP]
unfolding \<pi>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_sum_upto (\<lambda>p. 1) (real (nth_prime n)) = prime_sum_upto (\<lambda>p. 1) x
[PROOF STEP]
using between_nth_primes_imp_nonprime n
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>nth_prime ?k < ?n; ?n < nth_prime (Suc ?k)\<rbrakk> \<Longrightarrow> \<not> prime ?n
x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))}

goal (1 subgoal):
 1. prime_sum_upto (\<lambda>p. 1) (real (nth_prime n)) = prime_sum_upto (\<lambda>p. 1) x
[PROOF STEP]
by (intro prime_sum_upto_eqI) (auto simp: le_nat_iff le_floor_iff)
[PROOF STATE]
proof (state)
this:
\<pi> (real (nth_prime n)) = \<pi> x

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
hence "real n = \<pi> x - 1"
[PROOF STATE]
proof (prove)
using this:
\<pi> (real (nth_prime n)) = \<pi> x

goal (1 subgoal):
 1. real n = \<pi> x - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real n = \<pi> x - 1

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
hence n_eq: "n = nat \<lfloor>\<pi> x\<rfloor> - 1" "Suc n = nat \<lfloor>\<pi> x\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
real n = \<pi> x - 1

goal (1 subgoal):
 1. n = nat \<lfloor>\<pi> x\<rfloor> - 1 &&& Suc n = nat \<lfloor>\<pi> x\<rfloor>
[PROOF STEP]
by linarith+
[PROOF STATE]
proof (state)
this:
n = nat \<lfloor>\<pi> x\<rfloor> - 1
Suc n = nat \<lfloor>\<pi> x\<rfloor>

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
with n
[PROOF STATE]
proof (chain)
picking this:
x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))}
n = nat \<lfloor>\<pi> x\<rfloor> - 1
Suc n = nat \<lfloor>\<pi> x\<rfloor>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> {real (nth_prime n)..<real (nth_prime (Suc n))}
n = nat \<lfloor>\<pi> x\<rfloor> - 1
Suc n = nat \<lfloor>\<pi> x\<rfloor>

goal (1 subgoal):
 1. x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> {real (nth_prime (nat \<lfloor>\<pi> x\<rfloor> - 1))..<real (nth_prime (nat \<lfloor>\<pi> x\<rfloor>))}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_factors_power: "n > 0 \<Longrightarrow> prime_factors (x ^ n) = prime_factors x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> prime_factors (x ^ n) = prime_factors x
[PROOF STEP]
by (cases "x = 0"; cases "n = 0")
     (auto simp: prime_factors_multiplicity prime_elem_multiplicity_power_distrib zero_power)


[STATEMENT]
lemma ereal_of_enat_zero[simp]: "ereal_of_enat 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal_of_enat 0 = 0
[PROOF STEP]
by (auto simp flip: enat_0)


[STATEMENT]
lemma invfun_l1:"\<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; a \<in> A\<rbrakk>
                      \<Longrightarrow> (invfun A B f) (f a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; a \<in> A\<rbrakk> \<Longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) (f a) = a
[PROOF STEP]
apply (simp add:bij_to_def, erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; a \<in> A; surj_to f A B; inj_on f A\<rbrakk> \<Longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) (f a) = a
[PROOF STEP]
apply (rule invfun_l, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma chain_homotopic_iterated_singular_subdivision:
  obtains h where
        "\<And>p. h p 0 = (0 :: 'a chain)"
        "\<And>p c1 c2. h p (c1-c2) = h p c1 - h p c2"
        "\<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c)"
        "\<And>p X c. singular_chain p X c
                 \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c)
                   = (singular_subdivision p ^^ n) c - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (induction n arbitrary: thesis)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ 0) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
 2. \<And>n thesis. \<lbrakk>\<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; \<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>p. ?h p 0 = 0; \<And>p c1 c2. ?h p (c1 - c2) = ?h p c1 - ?h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (?h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (?h p c) + ?h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ 0) c - c\<rbrakk> \<Longrightarrow> thesis

goal (2 subgoals):
 1. \<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ 0) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
 2. \<And>n thesis. \<lbrakk>\<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; \<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (rule 0 [of "(\<lambda>p x. 0)"]) auto
[PROOF STATE]
proof (state)
this:
thesis

goal (1 subgoal):
 1. \<And>n thesis. \<lbrakk>\<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; \<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n thesis. \<lbrakk>\<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; \<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
\<lbrakk>\<And>p. ?h p 0 = 0; \<And>p c1 c2. ?h p (c1 - c2) = ?h p c1 - ?h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (?h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (?h p c) + ?h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. \<And>n thesis. \<lbrakk>\<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; \<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
\<lbrakk>\<And>p. ?h p 0 = 0; \<And>p c1 c2. ?h p (c1 - c2) = ?h p c1 - ?h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (?h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (?h p c) + ?h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain k where k:
        "\<And>p. k p 0 = (0 :: 'a chain)"
        "\<And>p c1 c2. k p (c1-c2) = k p c1 - k p c2"
        "\<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (k p c)"
        "\<And>p X c. singular_chain p X c
                 \<Longrightarrow> chain_boundary (Suc p) (k p c) + k (p - Suc 0) (chain_boundary p c)
                     = (singular_subdivision p ^^ n) c - c"
[PROOF STATE]
proof (prove)
using this:
(\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
\<lbrakk>\<And>p. ?h p 0 = 0; \<And>p c1 c2. ?h p (c1 - c2) = ?h p c1 - ?h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (?h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (?h p c) + ?h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesisa__

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>\<And>p. k p 0 = 0; \<And>p c1 c2. k p (c1 - c2) = k p c1 - k p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (k p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (k p c) + k (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
k ?p 0 = 0
k ?p (?c1.0 - ?c2.0) = k ?p ?c1.0 - k ?p ?c2.0
singular_chain ?p ?X ?c \<Longrightarrow> singular_chain (Suc ?p) ?X (k ?p ?c)
singular_chain ?p ?X ?c \<Longrightarrow> chain_boundary (Suc ?p) (k ?p ?c) + k (?p - Suc 0) (chain_boundary ?p ?c) = (singular_subdivision ?p ^^ n) ?c - ?c

goal (1 subgoal):
 1. \<And>n thesis. \<lbrakk>\<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; \<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain h where h:
        "\<And>p. h p 0 = (0 :: 'a chain)"
        "\<And>p c1 c2. h p (c1-c2) = h p c1 - h p c2"
        "\<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c)"
        "\<And>p X c. singular_chain p X c
                 \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = singular_subdivision p c - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = singular_subdivision p c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: chain_homotopic_singular_subdivision)
[PROOF STATE]
proof (state)
this:
h ?p 0 = 0
h ?p (?c1.0 - ?c2.0) = h ?p ?c1.0 - h ?p ?c2.0
singular_chain ?p ?X ?c \<Longrightarrow> singular_chain (Suc ?p) ?X (h ?p ?c)
singular_chain ?p ?X ?c \<Longrightarrow> chain_boundary (Suc ?p) (h ?p ?c) + h (?p - Suc 0) (chain_boundary ?p ?c) = singular_subdivision ?p ?c - ?c

goal (1 subgoal):
 1. \<And>n thesis. \<lbrakk>\<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; \<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
let ?h = "(\<lambda>p c. singular_subdivision (Suc p) (k p c) + h p c)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n thesis. \<lbrakk>\<And>thesis. (\<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ n) c - c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis; \<And>h. \<lbrakk>\<And>p. h p 0 = 0; \<And>p c1 c2. h p (c1 - c2) = h p c1 - h p c2; \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (h p c); \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (h p c) + h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof (rule Suc.prems)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>p. ?h p 0 = 0
 2. \<And>p c1 c2. ?h p (c1 - c2) = ?h p c1 - ?h p c2
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (?h p c)
 4. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (?h p c) + ?h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
fix p X and c :: "'a chain"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>p. ?h p 0 = 0
 2. \<And>p c1 c2. ?h p (c1 - c2) = ?h p c1 - ?h p c2
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (?h p c)
 4. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (?h p c) + ?h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
assume "singular_chain p X c"
[PROOF STATE]
proof (state)
this:
singular_chain p X c

goal (4 subgoals):
 1. \<And>p. ?h p 0 = 0
 2. \<And>p c1 c2. ?h p (c1 - c2) = ?h p c1 - ?h p c2
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> singular_chain (Suc p) X (?h p c)
 4. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (?h p c) + ?h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
singular_chain p X c
[PROOF STEP]
show "singular_chain (Suc p) X (?h p c)"
[PROOF STATE]
proof (prove)
using this:
singular_chain p X c

goal (1 subgoal):
 1. singular_chain (Suc p) X (singular_subdivision (Suc p) (k p c) + h p c)
[PROOF STEP]
by (simp add: h k singular_chain_add singular_chain_singular_subdivision)
[PROOF STATE]
proof (state)
this:
singular_chain (Suc p) X (singular_subdivision (Suc p) (k p c) + h p c)

goal (3 subgoals):
 1. \<And>p. singular_subdivision (Suc p) (k p 0) + h p 0 = 0
 2. \<And>p c1 c2. singular_subdivision (Suc p) (k p (c1 - c2)) + h p (c1 - c2) = singular_subdivision (Suc p) (k p c1) + h p c1 - (singular_subdivision (Suc p) (k p c2) + h p c2)
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>p. singular_subdivision (Suc p) (k p 0) + h p 0 = 0
 2. \<And>p c1 c2. singular_subdivision (Suc p) (k p (c1 - c2)) + h p (c1 - c2) = singular_subdivision (Suc p) (k p c1) + h p c1 - (singular_subdivision (Suc p) (k p c2) + h p c2)
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
fix p :: "nat" and X :: "'a topology" and c :: "'a chain"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>p. singular_subdivision (Suc p) (k p 0) + h p 0 = 0
 2. \<And>p c1 c2. singular_subdivision (Suc p) (k p (c1 - c2)) + h p (c1 - c2) = singular_subdivision (Suc p) (k p c1) + h p c1 - (singular_subdivision (Suc p) (k p c2) + h p c2)
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
assume sc: "singular_chain p X c"
[PROOF STATE]
proof (state)
this:
singular_chain p X c

goal (3 subgoals):
 1. \<And>p. singular_subdivision (Suc p) (k p 0) + h p 0 = 0
 2. \<And>p c1 c2. singular_subdivision (Suc p) (k p (c1 - c2)) + h p (c1 - c2) = singular_subdivision (Suc p) (k p c1) + h p c1 - (singular_subdivision (Suc p) (k p c2) + h p c2)
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
have f5: "chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c)) = singular_subdivision p (chain_boundary (Suc p) (k p c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c)) = singular_subdivision p (chain_boundary (Suc p) (k p c))
[PROOF STEP]
using chain_boundary_singular_subdivision k(3) sc
[PROOF STATE]
proof (prove)
using this:
singular_chain ?p ?X ?c \<Longrightarrow> chain_boundary ?p (singular_subdivision ?p ?c) = singular_subdivision (?p - Suc 0) (chain_boundary ?p ?c)
singular_chain ?p ?X ?c \<Longrightarrow> singular_chain (Suc ?p) ?X (k ?p ?c)
singular_chain p X c

goal (1 subgoal):
 1. chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c)) = singular_subdivision p (chain_boundary (Suc p) (k p c))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c)) = singular_subdivision p (chain_boundary (Suc p) (k p c))

goal (3 subgoals):
 1. \<And>p. singular_subdivision (Suc p) (k p 0) + h p 0 = 0
 2. \<And>p c1 c2. singular_subdivision (Suc p) (k p (c1 - c2)) + h p (c1 - c2) = singular_subdivision (Suc p) (k p c1) + h p c1 - (singular_subdivision (Suc p) (k p c2) + h p c2)
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
have [simp]: "singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) =
                  singular_subdivision p (k (p - Suc 0) (chain_boundary p c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))
[PROOF STEP]
proof (cases p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))
 2. \<And>nat. p = Suc nat \<Longrightarrow> singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))
 2. \<And>nat. p = Suc nat \<Longrightarrow> singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))
[PROOF STEP]
by (simp add: k chain_boundary_def)
[PROOF STATE]
proof (state)
this:
singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))

goal (1 subgoal):
 1. \<And>nat. p = Suc nat \<Longrightarrow> singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) = singular_subdivision p (k (p - Suc 0) (chain_boundary p c))

goal (3 subgoals):
 1. \<And>p. singular_subdivision (Suc p) (k p 0) + h p 0 = 0
 2. \<And>p c1 c2. singular_subdivision (Suc p) (k p (c1 - c2)) + h p (c1 - c2) = singular_subdivision (Suc p) (k p c1) + h p c1 - (singular_subdivision (Suc p) (k p c2) + h p c2)
 3. \<And>p X c. singular_chain p X c \<Longrightarrow> chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
show "chain_boundary (Suc p) (?h p c) + ?h (p - Suc 0) (chain_boundary p c) = (singular_subdivision p ^^ Suc n) c - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
using chain_boundary_singular_subdivision [of "Suc p" X]
[PROOF STATE]
proof (prove)
using this:
singular_chain (Suc p) X ?c \<Longrightarrow> chain_boundary (Suc p) (singular_subdivision (Suc p) ?c) = singular_subdivision (Suc p - Suc 0) (chain_boundary (Suc p) ?c)

goal (1 subgoal):
 1. chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c
[PROOF STEP]
apply (simp add: chain_boundary_add f5 h k algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. singular_chain (Suc p) X c \<Longrightarrow> chain_boundary (Suc p) (singular_subdivision (Suc p) c) = singular_subdivision p (chain_boundary (Suc p) c)) \<Longrightarrow> c + (chain_boundary (Suc p) (h p c) + (singular_subdivision p (chain_boundary (Suc p) (k p c)) + (h (p - Suc 0) (chain_boundary p c) + singular_subdivision p (k (p - Suc 0) (chain_boundary p c))))) = singular_subdivision p ((singular_subdivision p ^^ n) c)
[PROOF STEP]
apply (smt (verit, ccfv_threshold) add.commute add_diff_eq diff_add_cancel diff_diff_eq2 h(4) k(4) sc singular_subdivision_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
chain_boundary (Suc p) (singular_subdivision (Suc p) (k p c) + h p c) + (singular_subdivision (Suc (p - Suc 0)) (k (p - Suc 0) (chain_boundary p c)) + h (p - Suc 0) (chain_boundary p c)) = (singular_subdivision p ^^ Suc n) c - c

goal (2 subgoals):
 1. \<And>p. singular_subdivision (Suc p) (k p 0) + h p 0 = 0
 2. \<And>p c1 c2. singular_subdivision (Suc p) (k p (c1 - c2)) + h p (c1 - c2) = singular_subdivision (Suc p) (k p c1) + h p c1 - (singular_subdivision (Suc p) (k p c2) + h p c2)
[PROOF STEP]
qed (auto simp: k h singular_subdivision_diff)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compact_path_image[intro]: "path g \<Longrightarrow> compact (path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path g \<Longrightarrow> compact (path_image g)
[PROOF STEP]
unfolding path_def path_image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} g \<Longrightarrow> compact (g ` {0..1})
[PROOF STEP]
using compact_continuous_image connected_Icc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on ?s ?f; compact ?s\<rbrakk> \<Longrightarrow> compact (?f ` ?s)
connected {?a..?b}

goal (1 subgoal):
 1. continuous_on {0..1} g \<Longrightarrow> compact (g ` {0..1})
[PROOF STEP]
by blast


[STATEMENT]
lemma pp_star_contr: "pp_prod (pp_star X) Y = (\<Union>n. pp_prod (ppath_dioid.power X n) Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pp_prod (pp_star X) Y = (\<Union>n. pp_prod (ppath_dioid.power X n) Y)
[PROOF STEP]
by (auto simp add: pp_prod_def pp_star_elim)