[STATEMENT]
theorem set_build:
  "0 < length ps \<Longrightarrow> \<forall>k. distinct (map (\<lambda>p. p$k) ps) \<Longrightarrow> set ps = set_kdt (build ks ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < length ps; \<forall>k. distinct (map (\<lambda>p. p $ k) ps)\<rbrakk> \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
proof (induction ps rule: length_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<forall>ys. length ys < length xs \<longrightarrow> 0 < length ys \<longrightarrow> (\<forall>k. distinct (map (\<lambda>p. p $ k) ys)) \<longrightarrow> set ys = set_kdt (build ks ys); 0 < length xs; \<forall>k. distinct (map (\<lambda>p. p $ k) xs)\<rbrakk> \<Longrightarrow> set xs = set_kdt (build ks xs)
[PROOF STEP]
case (1 ps)
[PROOF STATE]
proof (state)
this:
\<forall>ys. length ys < length ps \<longrightarrow> 0 < length ys \<longrightarrow> (\<forall>k. distinct (map (\<lambda>p. p $ k) ys)) \<longrightarrow> set ys = set_kdt (build ks ys)
0 < length ps
\<forall>k. distinct (map (\<lambda>p. p $ k) ps)

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<forall>ys. length ys < length xs \<longrightarrow> 0 < length ys \<longrightarrow> (\<forall>k. distinct (map (\<lambda>p. p $ k) ys)) \<longrightarrow> set ys = set_kdt (build ks ys); 0 < length xs; \<forall>k. distinct (map (\<lambda>p. p $ k) xs)\<rbrakk> \<Longrightarrow> set xs = set_kdt (build ks xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ps = set_kdt (build ks ps)
[PROOF STEP]
proof (cases "1 < length ps")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
1 < length ps

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
obtain k s where ks_def: "(k, s) = widest_spread ks ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k s. (k, s) = widest_spread ks ps \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis surj_pair)
[PROOF STATE]
proof (state)
this:
(k, s) = widest_spread ks ps

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
obtain l m r where lmr_def: "(l, m, r) = partition_by_median k ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l m r. (l, m, r) = partition_by_median k ps \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis prod_cases3)
[PROOF STATE]
proof (state)
this:
(l, m, r) = partition_by_median k ps

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
have D: "\<forall>k. distinct (map (\<lambda>p. p$k) l)" "\<forall>k. distinct (map (\<lambda>p. p$k) r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k. distinct (map (\<lambda>p. p $ k) l) &&& \<forall>k. distinct (map (\<lambda>p. p $ k) r)
[PROOF STEP]
using lmr_def
[PROOF STATE]
proof (prove)
using this:
(l, m, r) = partition_by_median k ps

goal (1 subgoal):
 1. \<forall>k. distinct (map (\<lambda>p. p $ k) l) &&& \<forall>k. distinct (map (\<lambda>p. p $ k) r)
[PROOF STEP]
unfolding partition_by_median_def
[PROOF STATE]
proof (prove)
using this:
(l, m, r) = (let m = axis_median k ps; (l, r) = partition (\<lambda>p. p $ k \<le> m) ps in (l, m, r))

goal (1 subgoal):
 1. \<forall>k. distinct (map (\<lambda>p. p $ k) l) &&& \<forall>k. distinct (map (\<lambda>p. p $ k) r)
[PROOF STEP]
by (auto simp: "1.prems"(2) Let_def distinct_map_filter)
[PROOF STATE]
proof (state)
this:
\<forall>k. distinct (map (\<lambda>p. p $ k) l)
\<forall>k. distinct (map (\<lambda>p. p $ k) r)

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>k. distinct (map (\<lambda>p. p $ k) l)
\<forall>k. distinct (map (\<lambda>p. p $ k) r)

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
have "length l < length ps" "0 < length l"
                  "length r < length ps" "0 < length r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length l < length ps &&& 0 < length l) &&& length r < length ps &&& 0 < length r
[PROOF STEP]
using length_partition_by_median(8)[OF True "1.prems"(2)]
            length_partition_by_median(5)[OF "1.prems"(1) "1.prems"(2)]
            length_partition_by_median(6)[OF "1.prems"(1) "1.prems"(2)]
            length_partition_by_median(7)[OF True "1.prems"(2)]
            lmr_def
[PROOF STATE]
proof (prove)
using this:
(?l, ?m, ?r) = partition_by_median ?k ps \<Longrightarrow> length ?l < length ps
(?l, ?m, ?r) = partition_by_median ?k ps \<Longrightarrow> 0 < length ?l
(?l, ?m, ?r) = partition_by_median ?k ps \<Longrightarrow> length ?r < length ps
(?l, ?m, ?r) = partition_by_median ?k ps \<Longrightarrow> 0 < length ?r
(l, m, r) = partition_by_median k ps

goal (1 subgoal):
 1. (length l < length ps &&& 0 < length l) &&& length r < length ps &&& 0 < length r
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
length l < length ps
0 < length l
length r < length ps
0 < length r

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>k. distinct (map (\<lambda>p. p $ k) l)
\<forall>k. distinct (map (\<lambda>p. p $ k) r)
length l < length ps
0 < length l
length r < length ps
0 < length r
[PROOF STEP]
have "set l = set_kdt (build ks l)" "set r = set_kdt (build ks r)"
[PROOF STATE]
proof (prove)
using this:
\<forall>k. distinct (map (\<lambda>p. p $ k) l)
\<forall>k. distinct (map (\<lambda>p. p $ k) r)
length l < length ps
0 < length l
length r < length ps
0 < length r

goal (1 subgoal):
 1. set l = set_kdt (build ks l) &&& set r = set_kdt (build ks r)
[PROOF STEP]
using "1.IH"
[PROOF STATE]
proof (prove)
using this:
\<forall>k. distinct (map (\<lambda>p. p $ k) l)
\<forall>k. distinct (map (\<lambda>p. p $ k) r)
length l < length ps
0 < length l
length r < length ps
0 < length r
\<forall>ys. length ys < length ps \<longrightarrow> 0 < length ys \<longrightarrow> (\<forall>k. distinct (map (\<lambda>p. p $ k) ys)) \<longrightarrow> set ys = set_kdt (build ks ys)

goal (1 subgoal):
 1. set l = set_kdt (build ks l) &&& set r = set_kdt (build ks r)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
set l = set_kdt (build ks l)
set r = set_kdt (build ks r)

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set l = set_kdt (build ks l)
set r = set_kdt (build ks r)

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
have "set ps = set l \<union> set r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ps = set l \<union> set r
[PROOF STEP]
using lmr_def
[PROOF STATE]
proof (prove)
using this:
(l, m, r) = partition_by_median k ps

goal (1 subgoal):
 1. set ps = set l \<union> set r
[PROOF STEP]
unfolding partition_by_median_def
[PROOF STATE]
proof (prove)
using this:
(l, m, r) = (let m = axis_median k ps; (l, r) = partition (\<lambda>p. p $ k \<le> m) ps in (l, m, r))

goal (1 subgoal):
 1. set ps = set l \<union> set r
[PROOF STEP]
by (auto simp: Let_def)
[PROOF STATE]
proof (state)
this:
set ps = set l \<union> set r

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set ps = set l \<union> set r

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
have "build ks ps = Node k m (build ks l) (build ks r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. build ks ps = Node k m (build ks l) (build ks r)
[PROOF STEP]
using build_psimp_3[OF True ks_def lmr_def] build_termination D
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>build_dom (ks, l); build_dom (ks, r)\<rbrakk> \<Longrightarrow> build ks ps = Node k m (build ks l) (build ks r)
\<forall>k. distinct (map (\<lambda>p. p $ k) ?ps) \<Longrightarrow> build_dom (?ks, ?ps)
\<forall>k. distinct (map (\<lambda>p. p $ k) l)
\<forall>k. distinct (map (\<lambda>p. p $ k) r)

goal (1 subgoal):
 1. build ks ps = Node k m (build ks l) (build ks r)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
build ks ps = Node k m (build ks l) (build ks r)

goal (2 subgoals):
 1. 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
 2. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set l = set_kdt (build ks l)
set r = set_kdt (build ks r)
set ps = set l \<union> set r
build ks ps = Node k m (build ks l) (build ks r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set l = set_kdt (build ks l)
set r = set_kdt (build ks r)
set ps = set l \<union> set r
build ks ps = Node k m (build ks l) (build ks r)

goal (1 subgoal):
 1. set ps = set_kdt (build ks ps)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set ps = set_kdt (build ks ps)

goal (1 subgoal):
 1. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 1 < length ps

goal (1 subgoal):
 1. \<not> 1 < length ps \<Longrightarrow> set ps = set_kdt (build ks ps)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> 1 < length ps

goal (1 subgoal):
 1. set ps = set_kdt (build ks ps)
[PROOF STEP]
using "1.prems"
[PROOF STATE]
proof (prove)
using this:
\<not> 1 < length ps
0 < length ps
\<forall>k. distinct (map (\<lambda>p. p $ k) ps)

goal (1 subgoal):
 1. set ps = set_kdt (build ks ps)
[PROOF STEP]
by (cases ps) auto
[PROOF STATE]
proof (state)
this:
set ps = set_kdt (build ks ps)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set ps = set_kdt (build ks ps)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proper_Un:
  assumes "proper A" "proper B"
  shows "proper (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper (A \<union> B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
proper A
proper B

goal (1 subgoal):
 1. proper (A \<union> B)
[PROOF STEP]
unfolding proper_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x r. compact (cball x r \<inter> A)
\<forall>x r. compact (cball x r \<inter> B)

goal (1 subgoal):
 1. \<forall>x r. compact (cball x r \<inter> (A \<union> B))
[PROOF STEP]
by (auto simp add: compact_Un inf_sup_distrib1)


[STATEMENT]
lemma not_negative_int_iff [simp]:
  \<open>NOT k < 0 \<longleftrightarrow> k \<ge> 0\<close> for k :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (NOT k < 0) = (0 \<le> k)
[PROOF STEP]
by (subst Not_eq_iff [symmetric]) (simp add: not_less not_le)


[STATEMENT]
lemma drop_closed:
  assumes "k < n"
  assumes "x \<in> carrier (R\<^bsup>n\<^esup>)"
  shows "drop k x \<in> carrier (R\<^bsup>n - k\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop k x \<in> carrier (R\<^bsup>n - k\<^esup>)
[PROOF STEP]
apply(rule   cartesian_power_car_memI[of "drop k x" "n - k"] )
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (drop k x) = n - k
 2. set (drop k x) \<subseteq> carrier R
[PROOF STEP]
using assms(2) cartesian_power_car_memE length_drop
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (R\<^bsup>n\<^esup>)
?as \<in> carrier (?R\<^bsup>?n\<^esup>) \<Longrightarrow> length ?as = ?n
length (drop ?n ?xs) = length ?xs - ?n

goal (2 subgoals):
 1. length (drop k x) = n - k
 2. set (drop k x) \<subseteq> carrier R
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (drop k x) \<subseteq> carrier R
[PROOF STEP]
by (metis add_diff_inverse_nat assms(1) assms(2) cartesian_power_car_memE
      cartesian_power_car_memE' in_set_conv_nth length_drop less_imp_le_nat
      nat_add_left_cancel_less nth_drop order.asym subsetI)


[STATEMENT]
lemma lm131:
  assumes "Y \<subseteq> f-`{0}"
  shows "sum f Y  =  0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f Y = (0::'b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Y \<subseteq> f -` {0::'b}

goal (1 subgoal):
 1. sum f Y = (0::'b)
[PROOF STEP]
by (metis rev_subsetD sum.neutral vimage_singleton_eq)


[STATEMENT]
lemma fps_cutoff_numeral: "fps_cutoff n (numeral c) = (if n = 0 then 0 else numeral c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_cutoff n (numeral c) = (if n = 0 then 0 else numeral c)
[PROOF STEP]
by (simp add: numeral_fps_const fps_cutoff_fps_const)


[STATEMENT]
theorem mset_x_eq_poly_roots_Q: "{#x i. i \<in># mset_set {..<n}#} = poly_roots Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset x (mset_set {..<n}) = poly_roots Q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. image_mset x (mset_set {..<n}) = poly_roots Q
[PROOF STEP]
have "poly_roots Q = (\<Sum>i<n. {#x i#})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_roots Q = (\<Sum>i<n. {#x i#})
[PROOF STEP]
by (simp add: Q_def poly_roots_prod)
[PROOF STATE]
proof (state)
this:
poly_roots Q = (\<Sum>i<n. {#x i#})

goal (1 subgoal):
 1. image_mset x (mset_set {..<n}) = poly_roots Q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly_roots Q = (\<Sum>i<n. {#x i#})

goal (1 subgoal):
 1. image_mset x (mset_set {..<n}) = poly_roots Q
[PROOF STEP]
have "\<dots> = {#x i. i \<in># mset_set {..<n}#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. {#x i#}) = image_mset x (mset_set {..<n})
[PROOF STEP]
by (induction n) (auto simp: lessThan_Suc)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. {#x i#}) = image_mset x (mset_set {..<n})

goal (1 subgoal):
 1. image_mset x (mset_set {..<n}) = poly_roots Q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly_roots Q = image_mset x (mset_set {..<n})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly_roots Q = image_mset x (mset_set {..<n})

goal (1 subgoal):
 1. image_mset x (mset_set {..<n}) = poly_roots Q
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
image_mset x (mset_set {..<n}) = poly_roots Q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PiE_iff: "f \<in> Pi\<^sub>E I X \<longleftrightarrow> (\<forall>i\<in>I. f i \<in> X i) \<and> f \<in> extensional I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> Pi\<^sub>E I X) = ((\<forall>i\<in>I. f i \<in> X i) \<and> f \<in> extensional I)
[PROOF STEP]
by (simp add: PiE_def Pi_iff)


[STATEMENT]
lemma erf_real_gt_neg1 [intro]: "erf (x::real) > -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 < erf x
[PROOF STEP]
using erfc_real_less_2[of x]
[PROOF STATE]
proof (prove)
using this:
erfc x < 2

goal (1 subgoal):
 1. - 1 < erf x
[PROOF STEP]
unfolding erfc_def
[PROOF STATE]
proof (prove)
using this:
1 - erf x < 2

goal (1 subgoal):
 1. - 1 < erf x
[PROOF STEP]
by simp


[STATEMENT]
lemma comp_by_index_main: "nat_to_pr (comp_by_index n1 n2) = (\<lambda> x. (nat_to_pr n1) ((nat_to_pr n2) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr (comp_by_index n1 n2) = (\<lambda>x. nat_to_pr n1 (nat_to_pr n2 x))
[PROOF STEP]
by (unfold comp_by_index_def, unfold nat_to_pr_def, simp add: loc_srj_3_1)


[STATEMENT]
lemma p: "p > 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 < p
[PROOF STEP]
using pl l2 kp
[PROOF STATE]
proof (prove)
using this:
l < p
2 < l
p < k

goal (1 subgoal):
 1. 2 < p
[PROOF STEP]
by auto


[STATEMENT]
lemma SA_div_eval:
  assumes "f \<in> Units (SA n)"
  assumes "h \<in> carrier (SA n)"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "(h \<otimes>\<^bsub>SA n\<^esub> (inv\<^bsub>SA n\<^esub> f)) x = h x \<otimes> inv (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h \<otimes>\<^bsub>SA n\<^esub> inv\<^bsub>SA n\<^esub> f) x = (h x \<div> f x)
[PROOF STEP]
using assms SA_inv_eval  SA_mult
[PROOF STATE]
proof (prove)
using this:
f \<in> Units (SA n)
h \<in> carrier (SA n)
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
\<lbrakk>?f \<in> Units (SA ?n); ?x \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>)\<rbrakk> \<Longrightarrow> (inv\<^bsub>SA ?n\<^esub> ?f) ?x = inv ?f ?x
?x \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> (?f \<otimes>\<^bsub>SA ?n\<^esub> ?g) ?x = ?f ?x \<otimes> ?g ?x

goal (1 subgoal):
 1. (h \<otimes>\<^bsub>SA n\<^esub> inv\<^bsub>SA n\<^esub> f) x = (h x \<div> f x)
[PROOF STEP]
by presburger


[STATEMENT]
lemma invertible_left_inverse:
  fixes A :: "'a::{field}^'n^'n"
  shows "invertible A \<longleftrightarrow> (\<exists>(B::'a^'n^'n). B ** A = mat 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible A = (\<exists>B. B ** A = mat (1::'a))
[PROOF STEP]
by (metis invertible_def matrix_left_right_inverse)


[STATEMENT]
lemma compose_Bij: "\<lbrakk>x \<in> Bij S; y \<in> Bij S\<rbrakk> \<Longrightarrow> compose S x y \<in> Bij S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> Bij S; y \<in> Bij S\<rbrakk> \<Longrightarrow> compose S x y \<in> Bij S
[PROOF STEP]
by (auto simp add: Bij_def bij_betw_compose)


[STATEMENT]
lemma octo_of_real_minus [simp]: "octo_of_real (- x) = - octo_of_real x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. octo_of_real (- x) = - octo_of_real x
[PROOF STEP]
by (simp add: octo_of_real_def)


[STATEMENT]
lemma normal_form_minus_normal_form:
  "normal_form F (normal_form F p - normal_form F q) = normal_form F p - normal_form F q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_form F (normal_form F p - normal_form F q) = normal_form F p - normal_form F q
[PROOF STEP]
by (intro normal_form_unique rtranclp.rtrancl_refl punit.is_irred_minus normal_form)


[STATEMENT]
lemma square_free_int_imp_separable_mod_ring: assumes sf: "square_free f"
  and large: "int CARD('a) > separable_bound f"
  shows "separable (map_poly of_int f :: 'a :: prime_card mod_ring poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. separable (of_int_poly f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. separable (of_int_poly f)
[PROOF STEP]
define g where "g = map_poly (of_int :: int \<Rightarrow> 'a mod_ring) f"
[PROOF STATE]
proof (state)
this:
g = of_int_poly f

goal (1 subgoal):
 1. separable (of_int_poly f)
[PROOF STEP]
from square_free_int_imp_resultant_non_zero_mod_ring[OF sf large]
[PROOF STATE]
proof (chain)
picking this:
resultant (of_int_poly f) (pderiv (of_int_poly f)) \<noteq> 0 \<and> of_int_poly f \<noteq> 0
[PROOF STEP]
have res: "resultant g (pderiv g) \<noteq> 0" and g: "g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
resultant (of_int_poly f) (pderiv (of_int_poly f)) \<noteq> 0 \<and> of_int_poly f \<noteq> 0

goal (1 subgoal):
 1. resultant g (pderiv g) \<noteq> 0 &&& g \<noteq> 0
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
resultant (of_int_poly f) (pderiv (of_int_poly f)) \<noteq> 0 \<and> of_int_poly f \<noteq> 0

goal (1 subgoal):
 1. resultant (of_int_poly f) (pderiv (of_int_poly f)) \<noteq> 0 &&& of_int_poly f \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
resultant g (pderiv g) \<noteq> 0
g \<noteq> 0

goal (1 subgoal):
 1. separable (of_int_poly f)
[PROOF STEP]
from res[unfolded resultant_0_gcd]
[PROOF STATE]
proof (chain)
picking this:
\<not> degree (gcd g (pderiv g)) \<noteq> 0
[PROOF STEP]
have "degree (gcd g (pderiv g)) = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> degree (gcd g (pderiv g)) \<noteq> 0

goal (1 subgoal):
 1. degree (gcd g (pderiv g)) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (gcd g (pderiv g)) = 0

goal (1 subgoal):
 1. separable (of_int_poly f)
[PROOF STEP]
from degree0_coeffs[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. gcd g (pderiv g) = [:a:]
[PROOF STEP]
have "separable g"
[PROOF STATE]
proof (prove)
using this:
\<exists>a. gcd g (pderiv g) = [:a:]

goal (1 subgoal):
 1. separable g
[PROOF STEP]
unfolding separable_def
[PROOF STATE]
proof (prove)
using this:
\<exists>a. gcd g (pderiv g) = [:a:]

goal (1 subgoal):
 1. coprime g (pderiv g)
[PROOF STEP]
by (metis degree_pCons_0 g gcd_eq_0_iff is_unit_gcd is_unit_iff_degree)
[PROOF STATE]
proof (state)
this:
separable g

goal (1 subgoal):
 1. separable (of_int_poly f)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
separable g

goal (1 subgoal):
 1. separable (of_int_poly f)
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
separable (of_int_poly f)

goal (1 subgoal):
 1. separable (of_int_poly f)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
separable (of_int_poly f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma framed_uncross_implies_uncross: "(framed_uncross x y)\<Longrightarrow>(uncross x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. framed_uncross x y \<Longrightarrow> uncross x y
[PROOF STEP]
by (auto simp add: framed_uncross_def uncross_def)


[STATEMENT]
lemma complex_poly_eq:
  "r = map_poly of_real (map_poly Re r) + smult \<i> (map_poly of_real (map_poly Im r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r) + smult \<i> (map_poly complex_of_real (map_poly Im r))
[PROOF STEP]
by (auto simp: poly_eq_iff coeff_map_poly complex_eq)


[STATEMENT]
lemma n_less_Suc:"(n::nat) < Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < Suc n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lower_bound_cong:
  "eventually (\<lambda>x. f x = g x) at_top \<Longrightarrow> eventually (\<lambda>x. l x \<le> g x) at_top \<Longrightarrow>
     eventually (\<lambda>x. l x \<le> f x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<^sub>F x in at_top. f x = g x; \<forall>\<^sub>F x in at_top. l x \<le> g x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. l x \<le> f x
[PROOF STEP]
by (erule (1) eventually_elim2) simp


[STATEMENT]
lemma ordinal_plus_mono:
"\<lbrakk>x \<le> x'; y \<le> y'\<rbrakk> \<Longrightarrow> x + y \<le> x' + (y'::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> x'; y \<le> y'\<rbrakk> \<Longrightarrow> x + y \<le> x' + y'
[PROOF STEP]
by (rule order_trans[OF ordinal_plus_monoL ordinal_plus_monoR])


[STATEMENT]
lemma derives_implies_leftderives_gen: "derives a (u@v) \<Longrightarrow> is_word u \<Longrightarrow> (\<exists> w.
          leftderives a (u@w) \<and>
          (v = [] \<longrightarrow> w = []) \<and>
          (\<forall> X. is_first X v \<longrightarrow> is_first X w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>derives a (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
using Derivation_implies_leftderives_gen derives_implies_Derivation
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Derivation ?a ?D (?u @ ?v); is_word ?u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives ?a (?u @ w) \<and> (?v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X ?v \<longrightarrow> is_first X w)
derives ?a ?b \<Longrightarrow> \<exists>D. Derivation ?a D ?b

goal (1 subgoal):
 1. \<lbrakk>derives a (u @ v); is_word u\<rbrakk> \<Longrightarrow> \<exists>w. leftderives a (u @ w) \<and> (v = [] \<longrightarrow> w = []) \<and> (\<forall>X. is_first X v \<longrightarrow> is_first X w)
[PROOF STEP]
by blast


[STATEMENT]
lemma multiset_sum_monotone_f':
  assumes "CC \<subset># DD"
  shows "(\<Sum>(C, i) \<in># CC. Suc (f C)) < (\<Sum>(C, i) \<in># DD. Suc (f C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(C, i)\<in>#CC. Suc (f C)) < (\<Sum>(C, i)\<in>#DD. Suc (f C))
[PROOF STEP]
using multiset_sum_of_Suc_f_monotone[OF assms, of "f \<circ> fst"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>#CC. Suc ((f \<circ> fst) x)) < (\<Sum>x\<in>#DD. Suc ((f \<circ> fst) x))

goal (1 subgoal):
 1. (\<Sum>(C, i)\<in>#CC. Suc (f C)) < (\<Sum>(C, i)\<in>#DD. Suc (f C))
[PROOF STEP]
by (metis (mono_tags) comp_apply image_mset_cong2 split_beta)


[STATEMENT]
lemma sin_2pi_minus [simp]: "sin (2 * pi - x) = - (sin x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (2 * pi - x) = - sin x
[PROOF STEP]
by (metis sin_periodic_pi2 add_diff_eq mult_2 sin_pi_minus)


[STATEMENT]
lemma powhr_less_mono: "\<And>a b x. a < b \<Longrightarrow> 1 < x \<Longrightarrow> x powhr a < x powhr b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>a < b; 1 < x\<rbrakk> \<Longrightarrow> x powhr a < x powhr b
[PROOF STEP]
by transfer simp


[STATEMENT]
theorem join_prod: "p \<squnion> q = (fst p \<squnion> fst q, snd p \<squnion> snd q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<squnion> q = (fst p \<squnion> fst q, snd p \<squnion> snd q)
[PROOF STEP]
by (rule join_equality) (rule is_sup_prod)


[STATEMENT]
lemma mult_less_multiset\<^sub>D\<^sub>M: "(M, N) \<in> mult {(x, y). x < y} \<longleftrightarrow> less_multiset\<^sub>D\<^sub>M M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M, N) \<in> mult {(x, y). x < y}) = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
unfolding multp_def[of "(<)", symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
using multp_eq_multp\<^sub>D\<^sub>M[of "(<)", simplified]
[PROOF STATE]
proof (prove)
using this:
multp (<) = multp\<^sub>D\<^sub>M (<)

goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
by (simp add: multp\<^sub>D\<^sub>M_def less_multiset\<^sub>D\<^sub>M_def)


[STATEMENT]
lemma measure_translation:
  "measure lebesgue ((+) a ` S) = measure lebesgue S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure lebesgue ((+) a ` S) = Sigma_Algebra.measure lebesgue S
[PROOF STEP]
using measure_lebesgue_affine [of 1 a S]
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure lebesgue ((\<lambda>x. 1 *\<^sub>R x + a) ` S) = \<bar>1\<bar> ^ DIM('a) * Sigma_Algebra.measure lebesgue S

goal (1 subgoal):
 1. Sigma_Algebra.measure lebesgue ((+) a ` S) = Sigma_Algebra.measure lebesgue S
[PROOF STEP]
by (simp add: ac_simps cong: image_cong_simp)


[STATEMENT]
lemma raw_ports_invert: "ports_to_set (raw_ports_invert ps) = - ports_to_set ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ports_to_set (raw_ports_invert ps) = - ports_to_set ps
[PROOF STEP]
by(auto simp add: raw_ports_invert_def l2wi_wi2l ports_to_set_wordinterval)


[STATEMENT]
lemma separating_hyperplane_closed_0_inset:
  fixes S :: "'a::euclidean_space set"
  assumes "convex S" "closed S" "S \<noteq> {}" "0 \<notin> S"
  obtains a b where "a \<in> S" "a \<noteq> 0" "0 < b" "\<And>x. x \<in> S \<Longrightarrow> a \<bullet> x > b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> S; a \<noteq> (0::'a); 0 < b; \<And>x. x \<in> S \<Longrightarrow> b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using separating_hyperplane_closed_point_inset [OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>a b. \<lbrakk>a \<in> S; (a - (0::'a)) \<bullet> (0::'a) < b; \<And>x. x \<in> S \<Longrightarrow> b < (a - (0::'a)) \<bullet> x\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> S; a \<noteq> (0::'a); 0 < b; \<And>x. x \<in> S \<Longrightarrow> b < a \<bullet> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp (metis \<open>0 \<notin> S\<close>)


[STATEMENT]
lemma is_solution_solve_system:
  fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
  shows "is_solution x A b = is_solution x (fst (solve_system A b)) (snd (solve_system A b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_solution x A b = is_solution x (fst (solve_system A b)) (snd (solve_system A b))
[PROOF STEP]
using solve_system_imp_is_solution is_solution_imp_solve_system
[PROOF STATE]
proof (prove)
using this:
is_solution ?x (fst (solve_system ?A ?b)) (snd (solve_system ?A ?b)) \<Longrightarrow> is_solution ?x ?A ?b
is_solution ?x ?A ?b \<Longrightarrow> is_solution ?x (fst (solve_system ?A ?b)) (snd (solve_system ?A ?b))

goal (1 subgoal):
 1. is_solution x A b = is_solution x (fst (solve_system A b)) (snd (solve_system A b))
[PROOF STEP]
by blast


[STATEMENT]
lemma param_apsnd[param]:
  "(apsnd,apsnd)\<in>(Rb\<rightarrow>Rc)\<rightarrow>\<langle>Ra,Rb\<rangle>prod_rel\<rightarrow>\<langle>Ra,Rc\<rangle>prod_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (apsnd, apsnd) \<in> (Rb \<rightarrow> Rc) \<rightarrow> Ra \<times>\<^sub>r Rb \<rightarrow> Ra \<times>\<^sub>r Rc
[PROOF STEP]
unfolding apsnd_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_prod id, map_prod id) \<in> (Rb \<rightarrow> Rc) \<rightarrow> Ra \<times>\<^sub>r Rb \<rightarrow> Ra \<times>\<^sub>r Rc
[PROOF STEP]
by parametricity


[STATEMENT]
lemma enumerator_completeness_help: "\<And> ls. increasing ls \<Longrightarrow> ls \<noteq> [] \<Longrightarrow> length ls = Suc ks \<Longrightarrow> list_all (\<lambda>x. x < Suc nmax) ls \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax))
[PROOF STEP]
proof (induct ks)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc 0; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ 0) (enumBase nmax))
 2. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
increasing ls
ls \<noteq> []
|ls| = Suc 0
list_all (\<lambda>x. x < Suc nmax) ls

goal (2 subgoals):
 1. \<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc 0; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ 0) (enumBase nmax))
 2. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
assume "increasing ls" "ls \<noteq> []" "length ls = Suc 0" "list_all (\<lambda>x. x < Suc nmax) ls"
[PROOF STATE]
proof (state)
this:
increasing ls
ls \<noteq> []
|ls| = Suc 0
list_all (\<lambda>x. x < Suc nmax) ls

goal (2 subgoals):
 1. \<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc 0; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ 0) (enumBase nmax))
 2. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
increasing ls
ls \<noteq> []
|ls| = Suc 0
list_all (\<lambda>x. x < Suc nmax) ls
[PROOF STEP]
have "\<exists> x. ls = [x]"
[PROOF STATE]
proof (prove)
using this:
increasing ls
ls \<noteq> []
|ls| = Suc 0
list_all (\<lambda>x. x < Suc nmax) ls

goal (1 subgoal):
 1. \<exists>x. ls = [x]
[PROOF STEP]
apply (case_tac "ls::nat list")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc 0; list_all (\<lambda>x. x < Suc nmax) ls; ls = []\<rbrakk> \<Longrightarrow> \<exists>x. ls = [x]
 2. \<And>a list. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc 0; list_all (\<lambda>x. x < Suc nmax) ls; ls = a # list\<rbrakk> \<Longrightarrow> \<exists>x. ls = [x]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x. ls = [x]

goal (2 subgoals):
 1. \<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc 0; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ 0) (enumBase nmax))
 2. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. ls = [x]
[PROOF STEP]
obtain x where ls1: "ls = [x]"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. ls = [x]

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

goal (2 subgoals):
 1. \<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc 0; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ 0) (enumBase nmax))
 2. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with 0
[PROOF STATE]
proof (chain)
picking this:
increasing ls
ls \<noteq> []
|ls| = Suc 0
list_all (\<lambda>x. x < Suc nmax) ls
ls = [x]
[PROOF STEP]
have "x < Suc nmax"
[PROOF STATE]
proof (prove)
using this:
increasing ls
ls \<noteq> []
|ls| = Suc 0
list_all (\<lambda>x. x < Suc nmax) ls
ls = [x]

goal (1 subgoal):
 1. x < Suc nmax
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x < Suc nmax

goal (2 subgoals):
 1. \<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc 0; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ 0) (enumBase nmax))
 2. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with ls1
[PROOF STATE]
proof (chain)
picking this:
ls = [x]
x < Suc nmax
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ls = [x]
x < Suc nmax

goal (1 subgoal):
 1. ls \<in> set ((enumAppend nmax ^^ 0) (enumBase nmax))
[PROOF STEP]
apply (simp add: enumBase_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ls = [x]; x < Suc nmax\<rbrakk> \<Longrightarrow> x = nmax \<or> [x] \<in> (\<lambda>x. [x]) ` {0..<nmax}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls \<in> set ((enumAppend nmax ^^ 0) (enumBase nmax))

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
define ls' where "ls' = butlast ls"
[PROOF STATE]
proof (state)
this:
ls' = butlast ls

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
define l where "l = last ls"
[PROOF STATE]
proof (state)
this:
l = last ls

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
define ll where "ll = last ls'"
[PROOF STATE]
proof (state)
this:
ll = last ls'

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
define bl where "bl = butlast ls'"
[PROOF STATE]
proof (state)
this:
bl = butlast ls'

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
define ls'list where "ls'list = (enumAppend nmax ^^ n) (enumBase nmax)"
[PROOF STATE]
proof (state)
this:
ls'list = (enumAppend nmax ^^ n) (enumBase nmax)

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ls'list = (enumAppend nmax ^^ n) (enumBase nmax)
[PROOF STEP]
have short: "(enumAppend nmax ^^ n) (enumBase nmax) = ls'list"
[PROOF STATE]
proof (prove)
using this:
ls'list = (enumAppend nmax ^^ n) (enumBase nmax)

goal (1 subgoal):
 1. (enumAppend nmax ^^ n) (enumBase nmax) = ls'list
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(enumAppend nmax ^^ n) (enumBase nmax) = ls'list

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
[PROOF STEP]
have "ls \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls

goal (1 subgoal):
 1. ls \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls \<noteq> []

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ls \<noteq> []
[PROOF STEP]
have "ls = butlast ls @ [last ls]"
[PROOF STATE]
proof (prove)
using this:
ls \<noteq> []

goal (1 subgoal):
 1. ls = butlast ls @ [last ls]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls = butlast ls @ [last ls]

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with ls'_def l_def
[PROOF STATE]
proof (chain)
picking this:
ls' = butlast ls
l = last ls
ls = butlast ls @ [last ls]
[PROOF STEP]
have ls1: "ls = ls' @ [l]"
[PROOF STATE]
proof (prove)
using this:
ls' = butlast ls
l = last ls
ls = butlast ls @ [last ls]

goal (1 subgoal):
 1. ls = ls' @ [l]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls = ls' @ [l]

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
ls = ls' @ [l]
[PROOF STEP]
have "length ls' = Suc n"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
ls = ls' @ [l]

goal (1 subgoal):
 1. |ls'| = Suc n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
|ls'| = Suc n

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
|ls'| = Suc n
[PROOF STEP]
have ls'ne: "ls' \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
|ls'| = Suc n

goal (1 subgoal):
 1. ls' \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls' \<noteq> []

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with ll_def bl_def
[PROOF STATE]
proof (chain)
picking this:
ll = last ls'
bl = butlast ls'
ls' \<noteq> []
[PROOF STEP]
have ls'1: "ls' = bl @ [ll]"
[PROOF STATE]
proof (prove)
using this:
ll = last ls'
bl = butlast ls'
ls' \<noteq> []

goal (1 subgoal):
 1. ls' = bl @ [ll]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls' = bl @ [ll]

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ls' = bl @ [ll]
[PROOF STEP]
have ll_in_ls': "ll \<in> set ls'"
[PROOF STATE]
proof (prove)
using this:
ls' = bl @ [ll]

goal (1 subgoal):
 1. ll \<in> set ls'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ll \<in> set ls'

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
from Suc ls1
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
ls = ls' @ [l]
[PROOF STEP]
have "list_all (\<lambda>x. x < Suc nmax) ls'"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
ls = ls' @ [l]

goal (1 subgoal):
 1. list_all (\<lambda>x. x < Suc nmax) ls'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_all (\<lambda>x. x < Suc nmax) ls'

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with ll_in_ls'
[PROOF STATE]
proof (chain)
picking this:
ll \<in> set ls'
list_all (\<lambda>x. x < Suc nmax) ls'
[PROOF STEP]
have "ll < Suc nmax"
[PROOF STATE]
proof (prove)
using this:
ll \<in> set ls'
list_all (\<lambda>x. x < Suc nmax) ls'

goal (1 subgoal):
 1. ll < Suc nmax
[PROOF STEP]
by (induct ls') auto
[PROOF STATE]
proof (state)
this:
ll < Suc nmax

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with ll_def
[PROOF STATE]
proof (chain)
picking this:
ll = last ls'
ll < Suc nmax
[PROOF STEP]
have llsmall: "last ls' \<le> nmax"
[PROOF STATE]
proof (prove)
using this:
ll = last ls'
ll < Suc nmax

goal (1 subgoal):
 1. last ls' \<le> nmax
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
last ls' \<le> nmax

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
from ls1
[PROOF STATE]
proof (chain)
picking this:
ls = ls' @ [l]
[PROOF STEP]
have l_in_ls: "l \<in> set ls"
[PROOF STATE]
proof (prove)
using this:
ls = ls' @ [l]

goal (1 subgoal):
 1. l \<in> set ls
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l \<in> set ls

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
[PROOF STEP]
have "list_all (\<lambda>x. x < Suc nmax) ls"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls

goal (1 subgoal):
 1. list_all (\<lambda>x. x < Suc nmax) ls
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_all (\<lambda>x. x < Suc nmax) ls

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with l_in_ls
[PROOF STATE]
proof (chain)
picking this:
l \<in> set ls
list_all (\<lambda>x. x < Suc nmax) ls
[PROOF STEP]
have "l < Suc nmax"
[PROOF STATE]
proof (prove)
using this:
l \<in> set ls
list_all (\<lambda>x. x < Suc nmax) ls

goal (1 subgoal):
 1. l < Suc nmax
[PROOF STEP]
by (induct ls) auto
[PROOF STATE]
proof (state)
this:
l < Suc nmax

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l < Suc nmax
[PROOF STEP]
have lo: "l \<le> nmax"
[PROOF STATE]
proof (prove)
using this:
l < Suc nmax

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

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
from Suc ls1 ls'1
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
ls = ls' @ [l]
ls' = bl @ [ll]
[PROOF STEP]
have "increasing ((bl @ [ll]) @ [l])"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
ls = ls' @ [l]
ls' = bl @ [ll]

goal (1 subgoal):
 1. increasing ((bl @ [ll]) @ [l])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
increasing ((bl @ [ll]) @ [l])

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
increasing ((bl @ [ll]) @ [l])
[PROOF STEP]
have "ll \<le>  l"
[PROOF STATE]
proof (prove)
using this:
increasing ((bl @ [ll]) @ [l])

goal (1 subgoal):
 1. ll \<le> l
[PROOF STEP]
by (rule increasing2) auto
[PROOF STATE]
proof (state)
this:
ll \<le> l

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with ll_def
[PROOF STATE]
proof (chain)
picking this:
ll = last ls'
ll \<le> l
[PROOF STEP]
have lu: "last ls' \<le> l"
[PROOF STATE]
proof (prove)
using this:
ll = last ls'
ll \<le> l

goal (1 subgoal):
 1. last ls' \<le> l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
last ls' \<le> l

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
from Suc ls1
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
ls = ls' @ [l]
[PROOF STEP]
have vors: "ls' \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>increasing ?ls; ?ls \<noteq> []; |?ls| = Suc n; list_all (\<lambda>x. x < Suc nmax) ?ls\<rbrakk> \<Longrightarrow> ?ls \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
increasing ls
ls \<noteq> []
|ls| = Suc (Suc n)
list_all (\<lambda>x. x < Suc nmax) ls
ls = ls' @ [l]

goal (1 subgoal):
 1. ls' \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
[PROOF STEP]
by (rule_tac Suc) (auto intro: increasing4)
[PROOF STATE]
proof (state)
this:
ls' \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with short
[PROOF STATE]
proof (chain)
picking this:
(enumAppend nmax ^^ n) (enumBase nmax) = ls'list
ls' \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))
[PROOF STEP]
have "ls' \<in> set ls'list"
[PROOF STATE]
proof (prove)
using this:
(enumAppend nmax ^^ n) (enumBase nmax) = ls'list
ls' \<in> set ((enumAppend nmax ^^ n) (enumBase nmax))

goal (1 subgoal):
 1. ls' \<in> set ls'list
[PROOF STEP]
by  auto
[PROOF STATE]
proof (state)
this:
ls' \<in> set ls'list

goal (1 subgoal):
 1. \<And>ks ls. \<lbrakk>\<And>ls. \<lbrakk>increasing ls; ls \<noteq> []; |ls| = Suc ks; list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ ks) (enumBase nmax)); increasing ls; ls \<noteq> []; |ls| = Suc (Suc ks); list_all (\<lambda>x. x < Suc nmax) ls\<rbrakk> \<Longrightarrow> ls \<in> set ((enumAppend nmax ^^ Suc ks) (enumBase nmax))
[PROOF STEP]
with short llsmall ls1 lo lu
[PROOF STATE]
proof (chain)
picking this:
(enumAppend nmax ^^ n) (enumBase nmax) = ls'list
last ls' \<le> nmax
ls = ls' @ [l]
l \<le> nmax
last ls' \<le> l
ls' \<in> set ls'list
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(enumAppend nmax ^^ n) (enumBase nmax) = ls'list
last ls' \<le> nmax
ls = ls' @ [l]
l \<le> nmax
last ls' \<le> l
ls' \<in> set ls'list

goal (1 subgoal):
 1. ls \<in> set ((enumAppend nmax ^^ Suc n) (enumBase nmax))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(enumAppend nmax ^^ n) (enumBase nmax) = ls'list; ls = ls' @ [l]; l \<le> nmax; last ls' \<le> l; ls' \<in> set ls'list\<rbrakk> \<Longrightarrow> ls' @ [l] \<in> set (enumAppend nmax ls'list)
[PROOF STEP]
apply (simp add: enumAppend_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(enumAppend nmax ^^ n) (enumBase nmax) = ls'list; ls = ls' @ [l]; l \<le> nmax; last ls' \<le> l; ls' \<in> set ls'list\<rbrakk> \<Longrightarrow> \<exists>x\<in>set ls'list. ls' @ [l] \<in> (\<lambda>xa. x @ [xa]) ` {xa. last x \<le> nmax \<and> (xa = nmax \<or> last x \<le> xa \<and> xa < nmax)}
[PROOF STEP]
apply (intro bexI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(enumAppend nmax ^^ n) (enumBase nmax) = ls'list; ls = ls' @ [l]; l \<le> nmax; last ls' \<le> l; ls' \<in> set ls'list\<rbrakk> \<Longrightarrow> ls' @ [l] \<in> (\<lambda>x. ?x14 @ [x]) ` {x. last ?x14 \<le> nmax \<and> (x = nmax \<or> last ?x14 \<le> x \<and> x < nmax)}
 2. \<lbrakk>(enumAppend nmax ^^ n) (enumBase nmax) = ls'list; ls = ls' @ [l]; l \<le> nmax; last ls' \<le> l; ls' \<in> set ls'list\<rbrakk> \<Longrightarrow> ?x14 \<in> set ls'list
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls \<in> set ((enumAppend nmax ^^ Suc n) (enumBase nmax))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma xor_list_left_commute:
  fixes xs ys zs :: "'a :: boolean_algebra list"
  shows "xs [\<oplus>] (ys [\<oplus>] zs) = ys [\<oplus>] (xs [\<oplus>] zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs [\<oplus>] ys [\<oplus>] zs = ys [\<oplus>] xs [\<oplus>] zs
[PROOF STEP]
by(metis xor_list_assoc xor_list_commute)


[STATEMENT]
lemma mod_ring_normalize64: "(mod_ring_rel64 ===> mod_ring_rel64) (\<lambda>x. if x = 0 then 0 else 1) normalize"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel64 ===> mod_ring_rel64) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
using urel64_normalize[OF *] mod_ring_normalize
[PROOF STATE]
proof (prove)
using this:
urel64 ?x ?y \<Longrightarrow> urel64 (if ?x = 0 then 0 else 1) (if ?y = 0 then 0 else 1)
(mod_ring_rel ===> mod_ring_rel) (\<lambda>x. if x = 0 then 0 else 1) normalize

goal (1 subgoal):
 1. (mod_ring_rel64 ===> mod_ring_rel64) (\<lambda>x. if x = 0 then 0 else 1) normalize
[PROOF STEP]
unfolding mod_ring_rel64_def[OF *] rel_fun_def
[PROOF STATE]
proof (prove)
using this:
urel64 ?x ?y \<Longrightarrow> urel64 (if ?x = 0 then 0 else 1) (if ?y = 0 then 0 else 1)
\<forall>x y. mod_ring_rel x y \<longrightarrow> mod_ring_rel (if x = 0 then 0 else 1) (normalize y)

goal (1 subgoal):
 1. \<forall>x y. (\<exists>z. urel64 x z \<and> mod_ring_rel z y) \<longrightarrow> (\<exists>z. urel64 (if x = 0 then 0 else 1) z \<and> mod_ring_rel z (normalize y))
[PROOF STEP]
by blast


[STATEMENT]
lemma interior_convex_hull_explicit:
  fixes S :: "'a::euclidean_space set"
  assumes "\<not> affine_dependent S"
  shows
   "interior(convex hull S) =
             (if card(S) \<le> DIM('a) then {}
              else {y. \<exists>u. (\<forall>x \<in> S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
fix u :: "'a \<Rightarrow> real" and a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
assume "card Basis < card S" and u: "\<And>x. x\<in>S \<Longrightarrow> 0 < u x" "sum u S = 1" and a: "a \<in> S"
[PROOF STATE]
proof (state)
this:
DIM('b) < card S
?x \<in> S \<Longrightarrow> 0 < u ?x
sum u S = 1
a \<in> S

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
DIM('b) < card S
?x \<in> S \<Longrightarrow> 0 < u ?x
sum u S = 1
a \<in> S
[PROOF STEP]
have cs: "Suc 0 < card S"
[PROOF STATE]
proof (prove)
using this:
DIM('b) < card S
?x \<in> S \<Longrightarrow> 0 < u ?x
sum u S = 1
a \<in> S

goal (1 subgoal):
 1. Suc 0 < card S
[PROOF STEP]
by (metis DIM_positive less_trans_Suc)
[PROOF STATE]
proof (state)
this:
Suc 0 < card S

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
obtain b where b: "b \<in> S" "a \<noteq> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> S; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "S \<le> {a}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>b. \<lbrakk>b \<in> S; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis; S \<subseteq> {a}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>b. \<lbrakk>b \<in> S; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis; \<not> S \<subseteq> {a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S \<subseteq> {a}

goal (2 subgoals):
 1. \<lbrakk>\<And>b. \<lbrakk>b \<in> S; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis; S \<subseteq> {a}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>b. \<lbrakk>b \<in> S; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis; \<not> S \<subseteq> {a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> {a}
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> {a}

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using cs subset_singletonD
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> {a}
Suc 0 < card S
?A \<subseteq> {?x} \<Longrightarrow> ?A = {} \<or> ?A = {?x}

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

goal (1 subgoal):
 1. \<lbrakk>\<And>b. \<lbrakk>b \<in> S; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis; \<not> S \<subseteq> {a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
qed blast
[PROOF STATE]
proof (state)
this:
b \<in> S
a \<noteq> b

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
have "u a + u b \<le> sum u {a,b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u a + u b \<le> sum u {a, b}
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
a \<in> S
b \<in> S
a \<noteq> b

goal (1 subgoal):
 1. u a + u b \<le> sum u {a, b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u a + u b \<le> sum u {a, b}

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u a + u b \<le> sum u {a, b}

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
have "... \<le> sum u S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum u {a, b} \<le> sum u S
[PROOF STEP]
using a b u
[PROOF STATE]
proof (prove)
using this:
a \<in> S
b \<in> S
a \<noteq> b
?x \<in> S \<Longrightarrow> 0 < u ?x
sum u S = 1

goal (1 subgoal):
 1. sum u {a, b} \<le> sum u S
[PROOF STEP]
by (intro Groups_Big.sum_mono2) (auto simp: less_imp_le aff_independent_finite assms)
[PROOF STATE]
proof (state)
this:
sum u {a, b} \<le> sum u S

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u a + u b \<le> sum u S
[PROOF STEP]
have "u a < 1"
[PROOF STATE]
proof (prove)
using this:
u a + u b \<le> sum u S

goal (1 subgoal):
 1. u a < 1
[PROOF STEP]
using \<open>b \<in> S\<close> u
[PROOF STATE]
proof (prove)
using this:
u a + u b \<le> sum u S
b \<in> S
?x \<in> S \<Longrightarrow> 0 < u ?x
sum u S = 1

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

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>DIM(?'b) < card S; \<And>x. x \<in> S \<Longrightarrow> 0 < ?u2 x; sum ?u2 S = 1; ?a2 \<in> S\<rbrakk> \<Longrightarrow> ?u2 ?a2 < 1

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
note [simp] = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>DIM(?'b) < card S; \<And>x. x \<in> S \<Longrightarrow> 0 < ?u2 x; sum ?u2 S = 1; ?a2 \<in> S\<rbrakk> \<Longrightarrow> ?u2 ?a2 < 1

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent S

goal (1 subgoal):
 1. interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})
[PROOF STEP]
by (force simp add: not_le interior_convex_hull_explicit_minimal)
[PROOF STATE]
proof (state)
this:
interior (convex hull S) = (if card S \<le> DIM('a) then {} else {y. \<exists>u. (\<forall>x\<in>S. 0 < u x \<and> u x < 1) \<and> sum u S = 1 \<and> (\<Sum>x\<in>S. u x *\<^sub>R x) = y})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zeta_1: "zeta 1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zeta 1 = 0
[PROOF STEP]
by (simp add: zeta_def hurwitz_zeta_1)


[STATEMENT]
lemma real_add_minus_iff [simp]: "x + - a = 0 \<longleftrightarrow> x = a"
  for x a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + - a = 0) = (x = a)
[PROOF STEP]
by arith


[STATEMENT]
lemma rename_rename_guarantees_eq:
     "bij h ==> (rename h F \<in> (rename h ` X) guarantees
                              (rename h ` Y)) =
                (F \<in> X guarantees Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (rename h F \<in> rename h ` X guarantees rename h ` Y) = (F \<in> X guarantees Y)
[PROOF STEP]
apply (unfold rename_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (extend (\<lambda>(x, u). h x) F \<in> extend (\<lambda>(x, u). h x) ` X guarantees extend (\<lambda>(x, u). h x) ` Y) = (F \<in> X guarantees Y)
[PROOF STEP]
apply (subst good_map_bij [THEN Extend.intro, THEN Extend.extend_guarantees_eq [symmetric]], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (extend (\<lambda>(x, u). h x) F \<in> extend (\<lambda>(x, u). h x) ` X guarantees extend (\<lambda>(x, u). h x) ` Y) = (extend (\<lambda>(x, u). h x) F \<in> extend (\<lambda>(x, u). h x) ` X guarantees extend (\<lambda>(x, u). h x) ` Y)
[PROOF STEP]
apply (simp (no_asm_simp) add: fst_o_inv_eq_inv o_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma coeff_minus: "coeff p m - coeff q m = coeff (p-q) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff p m - MPoly_Type.coeff q m = MPoly_Type.coeff (p - q) m
[PROOF STEP]
by (simp add: coeff_def lookup_minus minus_mpoly.rep_eq)


[STATEMENT]
lemma fls_integral_linear_comm:
  fixes f g :: "'a::{comm_ring_1,inverse} fls"
  shows
    "fls_integral (fls_const a * f + fls_const b * g) =
      fls_const a * fls_integral f + fls_const b * fls_integral g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (fls_const a * f + fls_const b * g) = fls_const a * fls_integral f + fls_const b * fls_integral g
[PROOF STEP]
by    (simp add: fls_integral_mult_const_left_comm)


[STATEMENT]
lemma r_universal:
  assumes "recfn n f" and "length xs = n"
  shows "eval (r_universal n) (encode f # xs) = eval f xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (r_universal n) (encode f # xs) = eval f xs
[PROOF STEP]
unfolding r_universal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (Cn (Suc n) r_univ [recf.Id (Suc n) 0, r_shift (r_list_encode (n - 1))]) (encode f # xs) = eval f xs
[PROOF STEP]
using wellf_arity_nonzero assms r_list_encode r_univ'
[PROOF STATE]
proof (prove)
using this:
wellf ?f \<Longrightarrow> 0 < arity ?f
recfn n f
length xs = n
length ?xs = Suc ?n \<Longrightarrow> eval (r_list_encode ?n) ?xs \<down>= Partial_Recursive.list_encode ?xs
recfn (e_length ?x) ?f \<Longrightarrow> eval r_univ [encode ?f, ?x] = eval ?f (Partial_Recursive.list_decode ?x)

goal (1 subgoal):
 1. eval (Cn (Suc n) r_univ [recf.Id (Suc n) 0, r_shift (r_list_encode (n - 1))]) (encode f # xs) = eval f xs
[PROOF STEP]
by fastforce


[STATEMENT]
lemma closure_Times: "closure (A \<times> B) = closure A \<times> closure B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (A \<times> B) = closure A \<times> closure B
[PROOF STEP]
proof (rule closure_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. A \<times> B \<subseteq> closure A \<times> closure B
 2. closed (closure A \<times> closure B)
 3. \<And>T'. \<lbrakk>A \<times> B \<subseteq> T'; closed T'\<rbrakk> \<Longrightarrow> closure A \<times> closure B \<subseteq> T'
[PROOF STEP]
show "A \<times> B \<subseteq> closure A \<times> closure B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> B \<subseteq> closure A \<times> closure B
[PROOF STEP]
by (intro Sigma_mono closure_subset)
[PROOF STATE]
proof (state)
this:
A \<times> B \<subseteq> closure A \<times> closure B

goal (2 subgoals):
 1. closed (closure A \<times> closure B)
 2. \<And>T'. \<lbrakk>A \<times> B \<subseteq> T'; closed T'\<rbrakk> \<Longrightarrow> closure A \<times> closure B \<subseteq> T'
[PROOF STEP]
show "closed (closure A \<times> closure B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (closure A \<times> closure B)
[PROOF STEP]
by (intro closed_Times closed_closure)
[PROOF STATE]
proof (state)
this:
closed (closure A \<times> closure B)

goal (1 subgoal):
 1. \<And>T'. \<lbrakk>A \<times> B \<subseteq> T'; closed T'\<rbrakk> \<Longrightarrow> closure A \<times> closure B \<subseteq> T'
[PROOF STEP]
fix T
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T'. \<lbrakk>A \<times> B \<subseteq> T'; closed T'\<rbrakk> \<Longrightarrow> closure A \<times> closure B \<subseteq> T'
[PROOF STEP]
assume "A \<times> B \<subseteq> T" and "closed T"
[PROOF STATE]
proof (state)
this:
A \<times> B \<subseteq> T
closed T

goal (1 subgoal):
 1. \<And>T'. \<lbrakk>A \<times> B \<subseteq> T'; closed T'\<rbrakk> \<Longrightarrow> closure A \<times> closure B \<subseteq> T'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<times> B \<subseteq> T
closed T
[PROOF STEP]
show "closure A \<times> closure B \<subseteq> T"
[PROOF STATE]
proof (prove)
using this:
A \<times> B \<subseteq> T
closed T

goal (1 subgoal):
 1. closure A \<times> closure B \<subseteq> T
[PROOF STEP]
apply (simp add: closed_def open_prod_def, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>A \<times> B \<subseteq> T; \<forall>x\<in>- T. \<exists>A. open A \<and> (\<exists>B. open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> - T); A \<times> B \<subseteq> T; closed T; a \<in> closure A; b \<in> closure B\<rbrakk> \<Longrightarrow> (a, b) \<in> T
[PROOF STEP]
apply (rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>A \<times> B \<subseteq> T; \<forall>x\<in>- T. \<exists>A. open A \<and> (\<exists>B. open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> - T); A \<times> B \<subseteq> T; closed T; a \<in> closure A; b \<in> closure B; (a, b) \<notin> T\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule_tac x="(a, b)" in bspec, simp, clarify, rename_tac C D)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b C D. \<lbrakk>A \<times> B \<subseteq> T; A \<times> B \<subseteq> T; closed T; a \<in> closure A; b \<in> closure B; (a, b) \<notin> T; open C; open D; C \<times> D \<subseteq> - T; a \<in> C; b \<in> D\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add: closure_interior interior_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b C D. \<lbrakk>A \<times> B \<subseteq> T; closed T; \<forall>x\<subseteq>- A. open x \<longrightarrow> a \<notin> x; \<forall>x\<subseteq>- B. open x \<longrightarrow> b \<notin> x; (a, b) \<notin> T; open C; open D; C \<times> D \<subseteq> - T; a \<in> C; b \<in> D\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule_tac x=C in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b C D. \<lbrakk>A \<times> B \<subseteq> T; closed T; \<forall>x\<subseteq>- B. open x \<longrightarrow> b \<notin> x; (a, b) \<notin> T; open C; open D; C \<times> D \<subseteq> - T; a \<in> C; b \<in> D; C \<subseteq> - A \<longrightarrow> open C \<longrightarrow> a \<notin> C\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule_tac x=D in spec, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
closure A \<times> closure B \<subseteq> T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma param_list_ball[param]:
  "\<lbrakk>(P,P')\<in>(Ra\<rightarrow>Id); (l,l')\<in>\<langle>Ra\<rangle> list_rel\<rbrakk>
    \<Longrightarrow> (\<forall>x\<in>set l. P x, \<forall>x\<in>set l'. P' x) \<in> Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(P, P') \<in> Ra \<rightarrow> bool_rel; (l, l') \<in> \<langle>Ra\<rangle>list_rel\<rbrakk> \<Longrightarrow> (\<forall>x\<in>set l. P x, \<forall>x\<in>set l'. P' x) \<in> bool_rel
[PROOF STEP]
unfolding list_all_rec_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(P, P') \<in> Ra \<rightarrow> bool_rel; (l, l') \<in> \<langle>Ra\<rangle>list_rel\<rbrakk> \<Longrightarrow> (list_all_rec P l, list_all_rec P' l') \<in> bool_rel
[PROOF STEP]
unfolding list_all_rec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(P, P') \<in> Ra \<rightarrow> bool_rel; (l, l') \<in> \<langle>Ra\<rangle>list_rel\<rbrakk> \<Longrightarrow> (rec_list (\<lambda>P. True) (\<lambda>a l la P. P a \<and> la P) l P, rec_list (\<lambda>P. True) (\<lambda>a l la P. P a \<and> la P) l' P') \<in> bool_rel
[PROOF STEP]
by (parametricity)


[STATEMENT]
lemma integral_component_eq[simp]:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  assumes "f integrable_on S"
  shows "integral S (\<lambda>x. f x \<bullet> k) = integral S f \<bullet> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral S (\<lambda>x. f x \<bullet> k) = integral S f \<bullet> k
[PROOF STEP]
unfolding integral_linear[OF assms(1) bounded_linear_inner_left,unfolded o_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral S f \<bullet> k = integral S f \<bullet> k
[PROOF STEP]
..