[STATEMENT]
lemma rel_interior_eq_closure:
  fixes S :: "'n::euclidean_space set"
  shows "rel_interior S = closure S \<longleftrightarrow> affine S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_interior S = closure S) = affine S
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> (rel_interior S = closure S) = affine S
 2. S \<noteq> {} \<Longrightarrow> (rel_interior S = closure S) = affine S
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> (rel_interior S = closure S) = affine S
 2. S \<noteq> {} \<Longrightarrow> (rel_interior S = closure S) = affine S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {}

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

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> (rel_interior S = closure S) = affine S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> (rel_interior S = closure S) = affine S
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> (rel_interior S = closure S) = affine S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_interior S = closure S) = affine S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rel_interior S = closure S \<Longrightarrow> affine S
 2. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
assume eq: "rel_interior S = closure S"
[PROOF STATE]
proof (state)
this:
rel_interior S = closure S

goal (2 subgoals):
 1. rel_interior S = closure S \<Longrightarrow> affine S
 2. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
have "openin (top_of_set (affine hull S)) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (affine hull S)) S
[PROOF STEP]
by (metis eq closure_subset openin_rel_interior rel_interior_subset subset_antisym)
[PROOF STATE]
proof (state)
this:
openin (top_of_set (affine hull S)) S

goal (2 subgoals):
 1. rel_interior S = closure S \<Longrightarrow> affine S
 2. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
openin (top_of_set (affine hull S)) S

goal (2 subgoals):
 1. rel_interior S = closure S \<Longrightarrow> affine S
 2. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
have "closedin (top_of_set (affine hull S)) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set (affine hull S)) S
[PROOF STEP]
by (metis closed_subset closure_subset_eq eq hull_subset rel_interior_subset)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set (affine hull S)) S

goal (2 subgoals):
 1. rel_interior S = closure S \<Longrightarrow> affine S
 2. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set (affine hull S)) S
closedin (top_of_set (affine hull S)) S
[PROOF STEP]
have "S = {} \<or> S = affine hull S"
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set (affine hull S)) S
closedin (top_of_set (affine hull S)) S

goal (1 subgoal):
 1. S = {} \<or> S = affine hull S
[PROOF STEP]
using convex_connected connected_clopen convex_affine_hull
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set (affine hull S)) S
closedin (top_of_set (affine hull S)) S
convex ?S \<Longrightarrow> connected ?S
connected ?S = (\<forall>T. openin (top_of_set ?S) T \<and> closedin (top_of_set ?S) T \<longrightarrow> T = {} \<or> T = ?S)
convex (affine hull ?S)

goal (1 subgoal):
 1. S = {} \<or> S = affine hull S
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
S = {} \<or> S = affine hull S

goal (2 subgoals):
 1. rel_interior S = closure S \<Longrightarrow> affine S
 2. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
S = {} \<or> S = affine hull S
[PROOF STEP]
have "affine hull S = S"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
S = {} \<or> S = affine hull S

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

goal (2 subgoals):
 1. rel_interior S = closure S \<Longrightarrow> affine S
 2. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine hull S = S
[PROOF STEP]
show "affine S"
[PROOF STATE]
proof (prove)
using this:
affine hull S = S

goal (1 subgoal):
 1. affine S
[PROOF STEP]
by (metis affine_hull_eq)
[PROOF STATE]
proof (state)
this:
affine S

goal (1 subgoal):
 1. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
assume "affine S"
[PROOF STATE]
proof (state)
this:
affine S

goal (1 subgoal):
 1. affine S \<Longrightarrow> rel_interior S = closure S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine S
[PROOF STEP]
show "rel_interior S = closure S"
[PROOF STATE]
proof (prove)
using this:
affine S

goal (1 subgoal):
 1. rel_interior S = closure S
[PROOF STEP]
by (simp add: rel_interior_affine affine_closed)
[PROOF STATE]
proof (state)
this:
rel_interior S = closure S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(rel_interior S = closure S) = affine S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_eq_SUP_real:
  assumes X: "summable X" "\<And>i. 0 \<le> X i" shows "suminf X = (SUP i. \<Sum>n<i. X n::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suminf X = (SUP i. sum X {..<i})
[PROOF STEP]
by (intro LIMSEQ_unique[OF summable_LIMSEQ] X LIMSEQ_incseq_SUP)
     (auto intro!: bdd_aboveI2[where M="\<Sum>i. X i"] sum_le_suminf X monoI sum_mono2)


[STATEMENT]
lemma arith_prog_disjoint:
  assumes "[a \<noteq> a'] (mod int b)" and "b > 0"
  shows   "arith_prog a b \<inter> arith_prog a' b = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arith_prog a b \<inter> arith_prog a' b = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
[a \<noteq> a'] (mod int b)
0 < b

goal (1 subgoal):
 1. arith_prog a b \<inter> arith_prog a' b = {}
[PROOF STEP]
by (auto simp: arith_prog_def cong_def)


[STATEMENT]
lemma hyperUn_assoc: "(A \<squnion> B) \<squnion> C = A \<squnion> (B \<squnion> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<squnion> B \<squnion> C = A \<squnion> (B \<squnion> C)
[PROOF STEP]
by(simp add:hyperset_defs Un_assoc)


[STATEMENT]
lemma eval_fmla_Iff [simp]: "eval_fmla e (Iff A B) \<longleftrightarrow> (eval_fmla e A  \<longleftrightarrow>  eval_fmla e B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fmla e (A IFF B) = (eval_fmla e A = eval_fmla e B)
[PROOF STEP]
by (auto simp: Iff_def)


[STATEMENT]
lemma (in Group) smallest_sg_gen:"\<lbrakk>A \<subseteq> carrier G; G \<guillemotright> H; A \<subseteq> H\<rbrakk> \<Longrightarrow>
                                   sg_gen G A \<subseteq> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> carrier G; G \<guillemotright> H ; A \<subseteq> H\<rbrakk> \<Longrightarrow> sg_gen G A \<subseteq> H
[PROOF STEP]
apply (simp add:sg_gen_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> carrier G; G \<guillemotright> H ; A \<subseteq> H\<rbrakk> \<Longrightarrow> \<Inter> {H. G \<guillemotright> H  \<and> A \<subseteq> H} \<subseteq> H
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma p_div_gcd_p_pderiv: "p div (gcd p (pderiv p)) = (\<Prod>(a, i)\<in>as. a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p div gcd p (pderiv p) = (\<Prod>(a, i)\<in>as. a)
[PROOF STEP]
unfolding pderiv_exp_gcd
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p div (\<Prod>(x, y)\<in>as. x ^ y) = (\<Prod>(a, i)\<in>as. a)
[PROOF STEP]
unfolding poly_exp_expand
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(x, y)\<in>as. x ^ y) * (\<Prod>(a, i)\<in>as. a) div (\<Prod>(x, y)\<in>as. x ^ y) = (\<Prod>(a, i)\<in>as. a)
[PROOF STEP]
by (rule nonzero_mult_div_cancel_left, insert monic_Prod, auto)


[STATEMENT]
lemma nn_integral_return:
  assumes "x \<in> space M" "g \<in> borel_measurable M"
  shows "(\<integral>\<^sup>+ a. g a \<partial>return M x) = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = g x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = g x
[PROOF STEP]
interpret prob_space "return M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (return M x)
[PROOF STEP]
by (rule prob_space_return[OF \<open>x \<in> space M\<close>])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = g x
[PROOF STEP]
have "(\<integral>\<^sup>+ a. g a \<partial>return M x) = (\<integral>\<^sup>+ a. g x \<partial>return M x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = \<integral>\<^sup>+ a. g x \<partial>return M x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> space M
g \<in> borel_measurable M

goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = \<integral>\<^sup>+ a. g x \<partial>return M x
[PROOF STEP]
by (intro nn_integral_cong_AE) (auto simp: AE_return)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (return M x) g = \<integral>\<^sup>+ a. g x \<partial>return M x

goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (return M x) g = \<integral>\<^sup>+ a. g x \<partial>return M x

goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = g x
[PROOF STEP]
have "... = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ a. g x \<partial>return M x = g x
[PROOF STEP]
using nn_integral_const[of "return M x"] emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ?c \<partial>return M x = ?c * emeasure (return M x) (space (return M x))
emeasure (return M x) (space (return M x)) = 1

goal (1 subgoal):
 1. \<integral>\<^sup>+ a. g x \<partial>return M x = g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ a. g x \<partial>return M x = g x

goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = g x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N (return M x) g = g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (return M x) g = g x

goal (1 subgoal):
 1. integral\<^sup>N (return M x) g = g x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (return M x) g = g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Suc_rtos_i_mod_r_3:"\<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0;
      i div s < r - Suc 0\<rbrakk> \<Longrightarrow> Suc (rtos r s i) mod r = Suc (i div s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; i div s < r - Suc 0\<rbrakk> \<Longrightarrow> Suc (rtos r s i) mod r = Suc (i div s)
[PROOF STEP]
apply (frule le_less_trans [of "i" "r * s - Suc 0" "r * s"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; i \<le> r * s - Suc 0; i div s < r - Suc 0; i < r * s\<rbrakk> \<Longrightarrow> Suc (rtos r s i) mod r = Suc (i div s)
[PROOF STEP]
apply (simp add:rtos_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma iT_Plus_neg_not_empty_iff: "(I \<oplus>- k \<noteq> {}) = (\<exists>x\<in>I. k \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (I \<oplus>- k \<noteq> {}) = (\<exists>x\<in>I. k \<le> x)
[PROOF STEP]
by (simp add: iT_Plus_neg_image_conv cut_ge_not_empty_iff)


[STATEMENT]
lemma sorted_msort:
  "sorted (msort xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (msort xs)
[PROOF STEP]
by (induct xs rule: msort.induct) simp_all


[STATEMENT]
lemma meld_correct:
    shows "to_mset (meld q q') = to_mset q + to_mset q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_mset (meld q q') = to_mset q + to_mset q'
[PROOF STEP]
apply (unfold to_mset_def meld_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. BinomialHeapStruc.queue_to_multiset (Rep_BinomialHeap (Abs_BinomialHeap (BinomialHeapStruc.meld (Rep_BinomialHeap q) (Rep_BinomialHeap q')))) = BinomialHeapStruc.queue_to_multiset (Rep_BinomialHeap q) + BinomialHeapStruc.queue_to_multiset (Rep_BinomialHeap q')
[PROOF STEP]
apply (simp_all add: BinomialHeapStruc.meld_correct)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fps_to_fls_sum [simp]: "fps_to_fls (sum f A) = (\<Sum>x\<in>A. fps_to_fls (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_to_fls (sum f A) = (\<Sum>x\<in>A. fps_to_fls (f x))
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma fds_shift_ln [simp]: "fds_shift a (fds_ln l f) = fds_ln l (fds_shift a f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_shift a (fds_ln l f) = fds_ln l (fds_shift a f)
[PROOF STEP]
by (simp add: fds_ln_def fds_shift_integral)


[STATEMENT]
lemma supp_nprod:
  fixes x :: "'a"
  and   y :: "'b"
  shows "(supp (nPair x y)) = (supp x)\<union>(supp y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (nPair x y) = supp x \<union> supp y
[PROOF STEP]
by  (force simp add: supp_def Collect_imp_eq Collect_neg_eq)


[STATEMENT]
lemma (in deutsch) transpose_of_deutsch_transform:
  shows "(U\<^sub>f)\<^sup>t = U\<^sub>f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U\<^sub>f\<^sup>t = U\<^sub>f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row U\<^sub>f; j < dim_col U\<^sub>f\<rbrakk> \<Longrightarrow> U\<^sub>f\<^sup>t $$ (i, j) = U\<^sub>f $$ (i, j)
 2. dim_row U\<^sub>f\<^sup>t = dim_row U\<^sub>f
 3. dim_col U\<^sub>f\<^sup>t = dim_col U\<^sub>f
[PROOF STEP]
show "dim_row (U\<^sub>f\<^sup>t) = dim_row U\<^sub>f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row U\<^sub>f\<^sup>t = dim_row U\<^sub>f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row U\<^sub>f\<^sup>t = dim_row U\<^sub>f

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row U\<^sub>f; j < dim_col U\<^sub>f\<rbrakk> \<Longrightarrow> U\<^sub>f\<^sup>t $$ (i, j) = U\<^sub>f $$ (i, j)
 2. dim_col U\<^sub>f\<^sup>t = dim_col U\<^sub>f
[PROOF STEP]
show "dim_col (U\<^sub>f\<^sup>t) = dim_col U\<^sub>f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col U\<^sub>f\<^sup>t = dim_col U\<^sub>f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col U\<^sub>f\<^sup>t = dim_col U\<^sub>f

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row U\<^sub>f; j < dim_col U\<^sub>f\<rbrakk> \<Longrightarrow> U\<^sub>f\<^sup>t $$ (i, j) = U\<^sub>f $$ (i, j)
[PROOF STEP]
fix i j:: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row U\<^sub>f; j < dim_col U\<^sub>f\<rbrakk> \<Longrightarrow> U\<^sub>f\<^sup>t $$ (i, j) = U\<^sub>f $$ (i, j)
[PROOF STEP]
assume "i < dim_row U\<^sub>f" and "j < dim_col U\<^sub>f"
[PROOF STATE]
proof (state)
this:
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row U\<^sub>f; j < dim_col U\<^sub>f\<rbrakk> \<Longrightarrow> U\<^sub>f\<^sup>t $$ (i, j) = U\<^sub>f $$ (i, j)
[PROOF STEP]
thus "U\<^sub>f\<^sup>t $$ (i, j) = U\<^sub>f $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
i < dim_row U\<^sub>f
j < dim_col U\<^sub>f

goal (1 subgoal):
 1. U\<^sub>f\<^sup>t $$ (i, j) = U\<^sub>f $$ (i, j)
[PROOF STEP]
by (auto simp add: transpose_mat_def)
      (metis deutsch_transform_coeff(1-4) deutsch_transform_coeff_is_zero set_4_disj)
[PROOF STATE]
proof (state)
this:
U\<^sub>f\<^sup>t $$ (i, j) = U\<^sub>f $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PLS_def_ITP2015:
  fixes s as
  shows "PLS s as = {length as' | as'. (exec_plan s as' = exec_plan s as) \<and> (subseq as' as)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PLS s as = {length as' |as'. exec_plan s as' = exec_plan s as \<and> subseq as' as}
[PROOF STEP]
using PLS_def
[PROOF STATE]
proof (prove)
using this:
PLS ?s ?as \<equiv> length ` {as'. exec_plan ?s as' = exec_plan ?s ?as \<and> subseq as' ?as}

goal (1 subgoal):
 1. PLS s as = {length as' |as'. exec_plan s as' = exec_plan s as \<and> subseq as' as}
[PROOF STEP]
by blast

\<comment> \<open>NOTE Set comprehension had to be rewritten to image (there is no pattern matching in the part
left of the pipe symbol).\<close>


[STATEMENT]
lemma smcf_cn_cov_comp_ArrMap_vdomain[smc_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>S\<^sub>M\<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
interpret L: is_semifunctor \<alpha> \<open>op_smc \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_smc \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
interpret R: is_semifunctor \<alpha> \<AA> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
by
      (
        rule dghm_cn_cov_comp_ArrMap_vdomain
          [
            OF
              L.smcf_is_dghm[unfolded slicing_commute[symmetric]]
              R.smcf_is_dghm,
            unfolded slicing_commute slicing_simps
          ]
      )
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma weak_universalD[dest]:
  assumes "weak_universal (t:: 'x itself) R (G\<^sub>1::('a, 'b) labeled_graph) G\<^sub>2 f\<^sub>1 f\<^sub>2"
  shows "\<And>  h\<^sub>1 h\<^sub>2 G::('a, 'x) labeled_graph.
         graph_homomorphism (snd R) G h\<^sub>1 \<Longrightarrow> graph_homomorphism G\<^sub>1 G h\<^sub>2 \<Longrightarrow> f\<^sub>1 O h\<^sub>2 \<subseteq> h\<^sub>1
         \<Longrightarrow> (\<exists> h. graph_homomorphism G\<^sub>2 G h \<and> h\<^sub>2 \<subseteq> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h\<^sub>1 h\<^sub>2 G. \<lbrakk>graph_homomorphism (snd R) G h\<^sub>1; graph_homomorphism G\<^sub>1 G h\<^sub>2; f\<^sub>1 O h\<^sub>2 \<subseteq> h\<^sub>1\<rbrakk> \<Longrightarrow> \<exists>h. graph_homomorphism G\<^sub>2 G h \<and> h\<^sub>2 \<subseteq> h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
weak_universal t R G\<^sub>1 G\<^sub>2 f\<^sub>1 f\<^sub>2

goal (1 subgoal):
 1. \<And>h\<^sub>1 h\<^sub>2 G. \<lbrakk>graph_homomorphism (snd R) G h\<^sub>1; graph_homomorphism G\<^sub>1 G h\<^sub>2; f\<^sub>1 O h\<^sub>2 \<subseteq> h\<^sub>1\<rbrakk> \<Longrightarrow> \<exists>h. graph_homomorphism G\<^sub>2 G h \<and> h\<^sub>2 \<subseteq> h
[PROOF STEP]
unfolding weak_universal_def
[PROOF STATE]
proof (prove)
using this:
\<forall>h\<^sub>1 h\<^sub>2 G. graph_homomorphism (snd R) G h\<^sub>1 \<and> graph_homomorphism G\<^sub>1 G h\<^sub>2 \<and> f\<^sub>1 O h\<^sub>2 \<subseteq> h\<^sub>1 \<longrightarrow> (\<exists>h. graph_homomorphism G\<^sub>2 G h \<and> h\<^sub>2 \<subseteq> h)

goal (1 subgoal):
 1. \<And>h\<^sub>1 h\<^sub>2 G. \<lbrakk>graph_homomorphism (snd R) G h\<^sub>1; graph_homomorphism G\<^sub>1 G h\<^sub>2; f\<^sub>1 O h\<^sub>2 \<subseteq> h\<^sub>1\<rbrakk> \<Longrightarrow> \<exists>h. graph_homomorphism G\<^sub>2 G h \<and> h\<^sub>2 \<subseteq> h
[PROOF STEP]
by metis


[STATEMENT]
lemma face_of_convex_hull_aux:
  assumes eq: "x *\<^sub>R p = u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c"
    and x: "u + v + w = x" "x \<noteq> 0" and S: "affine S" "a \<in> S" "b \<in> S" "c \<in> S"
  shows "p \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<in> S
[PROOF STEP]
have "p = (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x
[PROOF STEP]
by (metis \<open>x \<noteq> 0\<close> eq mult.commute right_inverse scaleR_one scaleR_scaleR)
[PROOF STATE]
proof (state)
this:
p = (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x

goal (1 subgoal):
 1. p \<in> S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p = (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x

goal (1 subgoal):
 1. p \<in> S
[PROOF STEP]
have "affine hull {a,b,c} \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull {a, b, c} \<subseteq> S
[PROOF STEP]
by (simp add: S hull_minimal)
[PROOF STATE]
proof (state)
this:
affine hull {a, b, c} \<subseteq> S

goal (1 subgoal):
 1. p \<in> S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
affine hull {a, b, c} \<subseteq> S

goal (1 subgoal):
 1. p \<in> S
[PROOF STEP]
have "(u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x \<in> affine hull {a,b,c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x \<in> affine hull {a, b, c}
[PROOF STEP]
apply (simp add: affine_hull_3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ua va wa. (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x = ua *\<^sub>R a + va *\<^sub>R b + wa *\<^sub>R c \<and> ua + va + wa = 1
[PROOF STEP]
apply (rule_tac x="u/x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>va wa. (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x = (u / x) *\<^sub>R a + va *\<^sub>R b + wa *\<^sub>R c \<and> u / x + va + wa = 1
[PROOF STEP]
apply (rule_tac x="v/x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>wa. (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x = (u / x) *\<^sub>R a + (v / x) *\<^sub>R b + wa *\<^sub>R c \<and> u / x + v / x + wa = 1
[PROOF STEP]
apply (rule_tac x="w/x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x = (u / x) *\<^sub>R a + (v / x) *\<^sub>R b + (w / x) *\<^sub>R c \<and> u / x + v / x + w / x = 1
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
u + v + w = x
x \<noteq> 0

goal (1 subgoal):
 1. (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x = (u / x) *\<^sub>R a + (v / x) *\<^sub>R b + (w / x) *\<^sub>R c \<and> u / x + v / x + w / x = 1
[PROOF STEP]
apply (auto simp: field_split_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x \<in> affine hull {a, b, c}

goal (1 subgoal):
 1. p \<in> S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p = (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x
affine hull {a, b, c} \<subseteq> S
(u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x \<in> affine hull {a, b, c}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = (u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x
affine hull {a, b, c} \<subseteq> S
(u *\<^sub>R a + v *\<^sub>R b + w *\<^sub>R c) /\<^sub>R x \<in> affine hull {a, b, c}

goal (1 subgoal):
 1. p \<in> S
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
p \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power: "VARS (p::int) i
  { True }
  p := 1;
  i := 0;
  WHILE i < n
    INV { p = x^i \<and> i \<le> n }
     DO p := p * x;
        i := i + 1
     OD
  { p = x^n }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {True}
p := 1; i := 0; WHILE i < n INV {p = x ^ i \<and> i \<le> n}  VAR {0}
DO p := p * x; i := i + 1 OD
{p = x ^ n}
[PROOF STEP]
apply vcg_simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<le> n \<and> \<not> i < n \<Longrightarrow> x ^ i = x ^ n
[PROOF STEP]
by auto


[STATEMENT]
lemma two_realpow_ge_one: "(1::real) \<le> 2 ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 2 ^ n
[PROOF STEP]
by simp


[STATEMENT]
lemma testN_mult_testN:
  "testN k * testN k = testN k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. testN k * testN k = testN k
[PROOF STEP]
unfolding testN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat N N (\<lambda>(i, j). if i = k \<and> j = k then 1 else 0) * mat N N (\<lambda>(i, j). if i = k \<and> j = k then 1 else 0) = mat N N (\<lambda>(i, j). if i = k \<and> j = k then 1 else 0)
[PROOF STEP]
by (auto simp add: scalar_prod_def sum_only_one_neq_0)


[STATEMENT]
lemma monomial_0D:
  assumes "monomial c t = 0"
  shows "c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c = (0::'b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
monomial c t = 0

goal (1 subgoal):
 1. c = (0::'b)
[PROOF STEP]
by transfer (auto simp: fun_eq_iff when_def; meson)


[STATEMENT]
lemma in_multisets_iff:
  "M \<in> multisets A \<longleftrightarrow> set_mset M \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M \<in> multisets A) = (set_mset M \<subseteq> A)
[PROOF STEP]
by (simp add: multisets_def)


[STATEMENT]
lemma poly_add:
  fixes p q :: "'a ::comm_ring_1 poly"
  assumes q0: "q \<noteq> 0" and x: "poly p x = 0" and y: "poly q y = 0"
  shows "poly (poly_add p q) (x+y) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly_add p q) (x + y) = (0::'a)
[PROOF STEP]
proof (unfold poly_add_def, rule poly_resultant_zero[OF disjI2])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 < degree (poly_lift q)
 2. poly2 (poly_x_minus_y p) (x + y) ?y = (0::'a)
 3. poly2 (poly_lift q) (x + y) ?y = (0::'a)
[PROOF STEP]
have "degree q > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < degree q
[PROOF STEP]
using poly_zero q0 y
[PROOF STATE]
proof (prove)
using this:
poly ?p ?x = (0::?'a) \<Longrightarrow> (?p = 0) = (degree ?p = 0)
q \<noteq> 0
poly q y = (0::'a)

goal (1 subgoal):
 1. 0 < degree q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < degree q

goal (3 subgoals):
 1. 0 < degree (poly_lift q)
 2. poly2 (poly_x_minus_y p) (x + y) ?y = (0::'a)
 3. poly2 (poly_lift q) (x + y) ?y = (0::'a)
[PROOF STEP]
thus degq: "degree (poly_lift q) > 0"
[PROOF STATE]
proof (prove)
using this:
0 < degree q

goal (1 subgoal):
 1. 0 < degree (poly_lift q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < degree (poly_lift q)

goal (2 subgoals):
 1. poly2 (poly_x_minus_y p) (x + y) ?y = (0::'a)
 2. poly2 (poly_lift q) (x + y) ?y = (0::'a)
[PROOF STEP]
qed (insert x y, simp_all)


[STATEMENT]
lemma dtree_from_list_eq_dverts: "dverts (dtree_from_list r xs) = insert r (fst ` set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dverts (dtree_from_list r xs) = insert r (fst ` set xs)
[PROOF STEP]
by(induction xs arbitrary: r) force+


[STATEMENT]
lemma sub_add:
  assumes "g \<in> carrier P"
  assumes "f \<in> carrier P"
  assumes "h \<in>carrier P"
  shows "((f \<oplus>\<^bsub>P\<^esub> h) of g) = ((f of g) \<oplus>\<^bsub>P\<^esub> (h of g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cring_Poly.compose R (f \<oplus>\<^bsub>P\<^esub> h) g = Cring_Poly.compose R f g \<oplus>\<^bsub>P\<^esub> Cring_Poly.compose R h g
[PROOF STEP]
by (simp add: assms(1) assms(2) assms(3) rev_sub_add sub_rev_sub)


[STATEMENT]
lemma suminf_eq_SUP_real:
  assumes X: "summable X" "\<And>i. 0 \<le> X i" shows "suminf X = (SUP i. \<Sum>n<i. X n::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suminf X = (SUP i. sum X {..<i})
[PROOF STEP]
by (intro LIMSEQ_unique[OF summable_LIMSEQ] X LIMSEQ_incseq_SUP)
     (auto intro!: bdd_aboveI2[where M="\<Sum>i. X i"] sum_le_suminf X monoI sum_mono2)


[STATEMENT]
lemma True_in_eps_star[iff]:
 "\<And>A. (True#p,q) \<in> eps(star A) =
     ( (\<exists>r. q = True#r \<and> (p,r) \<in> eps A) \<or> (fin A p \<and> q = True#start A) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. ((True # p, q) \<in> eps (RegExp2NAe.star A)) = ((\<exists>r. q = True # r \<and> (p, r) \<in> eps A) \<or> fin A p \<and> q = True # start A)
[PROOF STEP]
by (simp add:star_def step_def) (blast)


[STATEMENT]
lemma pmf_prob_pmf_set_integral:
  "pmf_prob p A = pmf_set_integral p (\<lambda>_. 1) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf_prob p A = pmf_set_integral p (\<lambda>_. 1) A
[PROOF STEP]
by (simp add: pmf_prob_def pmf_set_integral_def)


[STATEMENT]
lemma "\<lbrakk> (x::int) \<le> y; y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> x = y \<and> y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> x = y \<and> y = z
[PROOF STEP]
apply (rule int.circular)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>x \<le> y; y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> x \<le> y
 2. \<lbrakk>x \<le> y; y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> y \<le> z
 3. \<lbrakk>x \<le> y; y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> z \<le> x
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<le> y; y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> y \<le> z
 2. \<lbrakk>x \<le> y; y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> z \<le> x
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; y \<le> z; z \<le> x\<rbrakk> \<Longrightarrow> z \<le> x
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tNDComm:
  assumes abcd: "twoNetsDistinct a b c d" shows "twoNetsDistinct c d a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. twoNetsDistinct c d a b
[PROOF STEP]
apply (insert abcd)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. twoNetsDistinct a b c d \<Longrightarrow> twoNetsDistinct c d a b
[PROOF STEP]
by (metis twoNetsDistinct_def nDComm)


[STATEMENT]
lemma meet_cont1:
  fixes y :: "'a :: cont_binary_meet"
  shows "cont (\<lambda>x. (x \<sqinter> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cont (\<lambda>x. x \<sqinter> y)
[PROOF STEP]
by (rule contI2[OF meet_monofun1]) (simp add: meet_cont')


[STATEMENT]
lemma finite_resultant_mpoly_polys_non_empty: fixes p :: "complex mpoly"
  assumes nz: "0 \<notin> qs ` N"
  and i: "i \<in> N"
  and fin: "finite {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}"
shows "finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
let ?solN = "mpoly_polys_zero_solution p qs N"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
let ?solN1 = "mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i})"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
let ?x = "Suc i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
note defs = mpoly_polys_zero_solution_def
[PROOF STATE]
proof (state)
this:
mpoly_polys_zero_solution ?p ?qs ?N ?\<alpha> = (mpoly_polys_solution ?p ?qs ?N ?\<alpha> \<and> (\<forall>i. i \<notin> insert 0 (Suc ` ?N) \<longrightarrow> ?\<alpha> i = (0::?'a)))

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
define zero where "zero \<alpha> = \<alpha>(?x := 0)" for \<alpha> :: "nat \<Rightarrow> complex"
[PROOF STATE]
proof (state)
this:
zero ?\<alpha> = ?\<alpha>(Suc i := 0)

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
zero ?\<alpha> = ?\<alpha>(Suc i := 0)

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
fix \<alpha>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
assume sol: "?solN1 \<alpha>"
[PROOF STATE]
proof (state)
this:
mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
from sol[unfolded defs]
[PROOF STATE]
proof (chain)
picking this:
mpoly_polys_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha> \<and> (\<forall>ia. ia \<notin> insert 0 (Suc ` (N - {i})) \<longrightarrow> \<alpha> ia = 0)
[PROOF STEP]
have 0: "\<alpha> ?x = 0"
[PROOF STATE]
proof (prove)
using this:
mpoly_polys_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha> \<and> (\<forall>ia. ia \<notin> insert 0 (Suc ` (N - {i})) \<longrightarrow> \<alpha> ia = 0)

goal (1 subgoal):
 1. \<alpha> (Suc i) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha> (Suc i) = 0

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
from resultant_mpoly_polys_zero_solution(1)[of qs N i p, OF nz i sol]
[PROOF STATE]
proof (chain)
picking this:
\<exists>v. mpoly_polys_zero_solution p qs N (\<alpha>(Suc i := v))
[PROOF STEP]
obtain v
      where "?solN (\<alpha>(?x := v))"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. mpoly_polys_zero_solution p qs N (\<alpha>(Suc i := v))

goal (1 subgoal):
 1. (\<And>v. mpoly_polys_zero_solution p qs N (\<alpha>(Suc i := v)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mpoly_polys_zero_solution p qs N (\<alpha>(Suc i := v))

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
hence sol: "\<alpha>(?x := v) \<in> {\<alpha>. ?solN \<alpha>}"
[PROOF STATE]
proof (prove)
using this:
mpoly_polys_zero_solution p qs N (\<alpha>(Suc i := v))

goal (1 subgoal):
 1. \<alpha>(Suc i := v) \<in> {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<alpha>(Suc i := v) \<in> {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
hence "zero (\<alpha>(?x := v)) \<in> zero ` {\<alpha>. ?solN \<alpha>}"
[PROOF STATE]
proof (prove)
using this:
\<alpha>(Suc i := v) \<in> {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. zero (\<alpha>(Suc i := v)) \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zero (\<alpha>(Suc i := v)) \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
zero (\<alpha>(Suc i := v)) \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
have "zero (\<alpha>(?x := v)) = \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zero (\<alpha>(Suc i := v)) = \<alpha>
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
\<alpha> (Suc i) = 0

goal (1 subgoal):
 1. zero (\<alpha>(Suc i := v)) = \<alpha>
[PROOF STEP]
by (auto simp: zero_def)
[PROOF STATE]
proof (state)
this:
zero (\<alpha>(Suc i := v)) = \<alpha>

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<alpha> \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}
[PROOF STEP]
have "\<alpha> \<in> zero ` {\<alpha>. ?solN \<alpha>}"
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. \<alpha> \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<alpha> \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) ?\<alpha>2 \<Longrightarrow> ?\<alpha>2 \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
hence "{\<alpha>. ?solN1 \<alpha>} \<subseteq> zero ` {\<alpha>. ?solN \<alpha>}"
[PROOF STATE]
proof (prove)
using this:
mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) ?\<alpha>2 \<Longrightarrow> ?\<alpha>2 \<in> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>} \<subseteq> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>} \<subseteq> zero ` {\<alpha>. mpoly_polys_zero_solution p qs N \<alpha>}

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
from finite_subset[OF this finite_imageI[OF fin]]
[PROOF STATE]
proof (chain)
picking this:
finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}

goal (1 subgoal):
 1. finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite {\<alpha>. mpoly_polys_zero_solution (resultant_mpoly_poly (Suc i) p (qs i)) qs (N - {i}) \<alpha>}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compute_lapprox_posrat[code]:
  "lapprox_posrat prec x y =
   (let
      l = rat_precision prec x y;
      d = if 0 \<le> l then x * 2^nat l div y else x div 2^nat (- l) div y
    in normfloat (Float d (- l)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lapprox_posrat prec x y = (let l = rat_precision prec (int x) (int y); x = if 0 \<le> l then x * 2 ^ nat l div y else x div 2 ^ nat (- l) div y in normfloat (Float (int x) (- l)))
[PROOF STEP]
unfolding div_mult_twopow_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lapprox_posrat prec x y = (let l = rat_precision prec (int x) (int y); x = if 0 \<le> l then x * 2 ^ nat l div y else x div (y * 2 ^ nat (- l)) in normfloat (Float (int x) (- l)))
[PROOF STEP]
by transfer
      (simp add: round_down_def powr_int real_div_nat_eq_floor_of_divide field_simps Let_def
        truncate_down_rat_precision del: two_powr_minus_int_float)


[STATEMENT]
lemma iFROM_induct: "
  \<lbrakk> P n; \<And>k. \<lbrakk> k \<in> [n\<dots>]; P k \<rbrakk> \<Longrightarrow> P (Suc k); a \<in> [n\<dots>] \<rbrakk> \<Longrightarrow> P a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P n; \<And>k. \<lbrakk>k \<in> [n\<dots>]; P k\<rbrakk> \<Longrightarrow> P (Suc k); a \<in> [n\<dots>]\<rbrakk> \<Longrightarrow> P a
[PROOF STEP]
apply (rule inext_induct[of _ "[n\<dots>]"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>P n; \<And>k. \<lbrakk>k \<in> [n\<dots>]; P k\<rbrakk> \<Longrightarrow> P (Suc k); a \<in> [n\<dots>]\<rbrakk> \<Longrightarrow> P (iMin [n\<dots>])
 2. \<And>na. \<lbrakk>P n; \<And>k. \<lbrakk>k \<in> [n\<dots>]; P k\<rbrakk> \<Longrightarrow> P (Suc k); a \<in> [n\<dots>]; na \<in> [n\<dots>]; P na\<rbrakk> \<Longrightarrow> P (inext na [n\<dots>])
 3. \<lbrakk>P n; \<And>k. \<lbrakk>k \<in> [n\<dots>]; P k\<rbrakk> \<Longrightarrow> P (Suc k); a \<in> [n\<dots>]\<rbrakk> \<Longrightarrow> a \<in> [n\<dots>]
[PROOF STEP]
apply (simp add: iT_Min iT_inext_if)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma permutesI_finite_dom:
  assumes "finite A"
  assumes "f \<in> A \<rightarrow> A"
  assumes "\<And>a. a \<notin> A \<Longrightarrow> f a = a"
  assumes "\<And>a. a \<in> A \<Longrightarrow> g (f a) = a"
  shows "f permutes A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f permutes A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
f \<in> A \<rightarrow> A
?a \<notin> A \<Longrightarrow> f ?a = ?a
?a \<in> A \<Longrightarrow> g (f ?a) = ?a

goal (1 subgoal):
 1. f permutes A
[PROOF STEP]
by (intro bij_imp_permutes bij_betwI_finite_dom)


[STATEMENT]
lemma complex_rotations_inverses:
  "r \<in> complex_rotations \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> r = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in> complex_rotations \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> r = id
[PROOF STEP]
proof (induction r rule: complex_rotations.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. r \<in> simple_rotations \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> r = id
 2. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
case (simp r)
[PROOF STATE]
proof (state)
this:
r \<in> simple_rotations

goal (2 subgoals):
 1. \<And>r. r \<in> simple_rotations \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> r = id
 2. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<in> simple_rotations
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
r \<in> simple_rotations

goal (1 subgoal):
 1. \<exists>y\<in>complex_rotations. y \<circ> r = id
[PROOF STEP]
using simple_rotations_inverses
[PROOF STATE]
proof (prove)
using this:
r \<in> simple_rotations
?r \<in> simple_rotations \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> ?r = id

goal (1 subgoal):
 1. \<exists>y\<in>complex_rotations. y \<circ> r = id
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>complex_rotations. y \<circ> r = id

goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
case (comp r s)
[PROOF STATE]
proof (state)
this:
r \<in> simple_rotations
s \<in> complex_rotations
\<exists>y\<in>complex_rotations. y \<circ> s = id

goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
obtain r' where r'_comp:"r'\<in>complex_rotations" and r'_inv:"r' \<circ> r = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r'. \<lbrakk>r' \<in> complex_rotations; r' \<circ> r = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using simple_rotations_inverses comp.hyps
[PROOF STATE]
proof (prove)
using this:
?r \<in> simple_rotations \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> ?r = id
r \<in> simple_rotations
s \<in> complex_rotations

goal (1 subgoal):
 1. (\<And>r'. \<lbrakk>r' \<in> complex_rotations; r' \<circ> r = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r' \<in> complex_rotations
r' \<circ> r = id

goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
obtain y where y_comp:"y\<in>complex_rotations" and y_inv:"y \<circ> s = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> complex_rotations; y \<circ> s = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using comp.IH
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>complex_rotations. y \<circ> s = id

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> complex_rotations; y \<circ> s = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> complex_rotations
y \<circ> s = id

goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
from complex_rotations_comp
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?r \<in> complex_rotations; ?s \<in> complex_rotations\<rbrakk> \<Longrightarrow> ?r \<circ> ?s \<in> complex_rotations
[PROOF STEP]
have yr':"y \<circ> r' \<in> complex_rotations"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?r \<in> complex_rotations; ?s \<in> complex_rotations\<rbrakk> \<Longrightarrow> ?r \<circ> ?s \<in> complex_rotations

goal (1 subgoal):
 1. y \<circ> r' \<in> complex_rotations
[PROOF STEP]
using r'_comp y_comp
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?r \<in> complex_rotations; ?s \<in> complex_rotations\<rbrakk> \<Longrightarrow> ?r \<circ> ?s \<in> complex_rotations
r' \<in> complex_rotations
y \<in> complex_rotations

goal (1 subgoal):
 1. y \<circ> r' \<in> complex_rotations
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<circ> r' \<in> complex_rotations

goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
have "r' \<circ> (r \<circ> s) = r' \<circ> r \<circ> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r' \<circ> (r \<circ> s) = r' \<circ> r \<circ> s
[PROOF STEP]
using comp_assoc
[PROOF STATE]
proof (prove)
using this:
?f \<circ> ?g \<circ> ?h = ?f \<circ> (?g \<circ> ?h)

goal (1 subgoal):
 1. r' \<circ> (r \<circ> s) = r' \<circ> r \<circ> s
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
r' \<circ> (r \<circ> s) = r' \<circ> r \<circ> s

goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r' \<circ> (r \<circ> s) = r' \<circ> r \<circ> s
[PROOF STEP]
have "r' \<circ> (r \<circ> s) = s"
[PROOF STATE]
proof (prove)
using this:
r' \<circ> (r \<circ> s) = r' \<circ> r \<circ> s

goal (1 subgoal):
 1. r' \<circ> (r \<circ> s) = s
[PROOF STEP]
using r'_inv
[PROOF STATE]
proof (prove)
using this:
r' \<circ> (r \<circ> s) = r' \<circ> r \<circ> s
r' \<circ> r = id

goal (1 subgoal):
 1. r' \<circ> (r \<circ> s) = s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r' \<circ> (r \<circ> s) = s

goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r' \<circ> (r \<circ> s) = s
[PROOF STEP]
have "y \<circ> r' \<circ> (r \<circ> s) = id"
[PROOF STATE]
proof (prove)
using this:
r' \<circ> (r \<circ> s) = s

goal (1 subgoal):
 1. y \<circ> r' \<circ> (r \<circ> s) = id
[PROOF STEP]
using y_inv comp_assoc
[PROOF STATE]
proof (prove)
using this:
r' \<circ> (r \<circ> s) = s
y \<circ> s = id
?f \<circ> ?g \<circ> ?h = ?f \<circ> (?g \<circ> ?h)

goal (1 subgoal):
 1. y \<circ> r' \<circ> (r \<circ> s) = id
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
y \<circ> r' \<circ> (r \<circ> s) = id

goal (1 subgoal):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<exists>y\<in>complex_rotations. y \<circ> s = id\<rbrakk> \<Longrightarrow> \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<circ> r' \<circ> (r \<circ> s) = id
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
y \<circ> r' \<circ> (r \<circ> s) = id

goal (1 subgoal):
 1. \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
using yr'
[PROOF STATE]
proof (prove)
using this:
y \<circ> r' \<circ> (r \<circ> s) = id
y \<circ> r' \<in> complex_rotations

goal (1 subgoal):
 1. \<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>complex_rotations. y \<circ> (r \<circ> s) = id

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma m_s_widen_rep: assumes "finite X" "S1 = S2 on -X" "\<not> S2 x \<le> S1 x"
  shows "(\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
have 1: "\<forall>x\<in>X. m(S1 x) \<ge> m(S1 x \<nabla> S2 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>X. m (S1 x \<nabla> S2 x) \<le> m (S1 x)
[PROOF STEP]
by (metis m_anti_mono wn_class.widen1)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>X. m (S1 x \<nabla> S2 x) \<le> m (S1 x)

goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
have "x \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
using assms(2,3)
[PROOF STATE]
proof (prove)
using this:
S1 = S2 on - X
\<not> S2 x \<le> S1 x

goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
by(auto simp add: Ball_def)
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
hence 2: "\<exists>x\<in>X. m(S1 x) > m(S1 x \<nabla> S2 x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> X

goal (1 subgoal):
 1. \<exists>x\<in>X. m (S1 x \<nabla> S2 x) < m (S1 x)
[PROOF STEP]
using assms(3) m_widen
[PROOF STATE]
proof (prove)
using this:
x \<in> X
\<not> S2 x \<le> S1 x
\<not> ?y \<le> ?x \<Longrightarrow> m (?x \<nabla> ?y) < m ?x

goal (1 subgoal):
 1. \<exists>x\<in>X. m (S1 x \<nabla> S2 x) < m (S1 x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. m (S1 x \<nabla> S2 x) < m (S1 x)

goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
from sum_strict_mono_ex1[OF \<open>finite X\<close> 1 2]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))

goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>X. m (S1 x \<nabla> S2 x)) < (\<Sum>x\<in>X. m (S1 x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Euclid_induct [case_names swap zero add]:
  fixes P :: "nat \<Rightarrow> nat \<Rightarrow> bool"
  assumes c: "\<And>a b. P a b \<longleftrightarrow> P b a"
    and z: "\<And>a. P a 0"
    and add: "\<And>a b. P a b \<longrightarrow> P a (a + b)"
  shows "P a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P a b
[PROOF STEP]
proof (induct "a + b" arbitrary: a b rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (\<And>aa ba. aa + ba < a + b \<Longrightarrow> P aa ba) \<Longrightarrow> P a b
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
?a + ?b < a + b \<Longrightarrow> P ?a ?b

goal (1 subgoal):
 1. \<And>a b. (\<And>aa ba. aa + ba < a + b \<Longrightarrow> P aa ba) \<Longrightarrow> P a b
[PROOF STEP]
consider (eq) "a = b" | (lt) "a < b" "a + b - a < a + b" | "b = 0" | "b + a - b < a + b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a = b \<Longrightarrow> thesis; \<lbrakk>a < b; a + b - a < a + b\<rbrakk> \<Longrightarrow> thesis; b = 0 \<Longrightarrow> thesis; b + a - b < a + b \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
\<lbrakk>a = b \<Longrightarrow> ?thesis; \<lbrakk>a < b; a + b - a < a + b\<rbrakk> \<Longrightarrow> ?thesis; b = 0 \<Longrightarrow> ?thesis; b + a - b < a + b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>a b. (\<And>aa ba. aa + ba < a + b \<Longrightarrow> P aa ba) \<Longrightarrow> P a b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P a b
[PROOF STEP]
proof (cases a b rule: linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. a < b \<Longrightarrow> P a b
 2. a = b \<Longrightarrow> P a b
 3. b < a \<Longrightarrow> P a b
[PROOF STEP]
case equal
[PROOF STATE]
proof (state)
this:
a = b

goal (3 subgoals):
 1. a < b \<Longrightarrow> P a b
 2. a = b \<Longrightarrow> P a b
 3. b < a \<Longrightarrow> P a b
[PROOF STEP]
with add [rule_format, OF z [rule_format, of a]]
[PROOF STATE]
proof (chain)
picking this:
P a (a + 0)
a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P a (a + 0)
a = b

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

goal (2 subgoals):
 1. a < b \<Longrightarrow> P a b
 2. b < a \<Longrightarrow> P a b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a < b \<Longrightarrow> P a b
 2. b < a \<Longrightarrow> P a b
[PROOF STEP]
case lt: less
[PROOF STATE]
proof (state)
this:
a < b

goal (2 subgoals):
 1. a < b \<Longrightarrow> P a b
 2. b < a \<Longrightarrow> P a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < b
[PROOF STEP]
consider "a = 0" | "a + b - a < a + b"
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. \<lbrakk>a = 0 \<Longrightarrow> thesis; a + b - a < a + b \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
\<lbrakk>a = 0 \<Longrightarrow> ?thesis; a + b - a < a + b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (2 subgoals):
 1. a < b \<Longrightarrow> P a b
 2. b < a \<Longrightarrow> P a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a = 0 \<Longrightarrow> ?thesis; a + b - a < a + b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a = 0 \<Longrightarrow> ?thesis; a + b - a < a + b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. P a b
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> P a b
 2. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> P a b
 2. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
with z c
[PROOF STATE]
proof (chain)
picking this:
P ?a 0
P ?a ?b = P ?b ?a
a = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P ?a 0
P ?a ?b = P ?b ?a
a = 0

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

goal (1 subgoal):
 1. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
a + b - a < a + b

goal (1 subgoal):
 1. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a + b - a < a + b

goal (1 subgoal):
 1. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
have *: "a + b - a = a + (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + b - a = a + (b - a)
[PROOF STEP]
using lt
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. a + b - a = a + (b - a)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
a + b - a = a + (b - a)

goal (1 subgoal):
 1. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a + (b - a) < a + b
[PROOF STEP]
have "a + (b - a) < a + b"
[PROOF STATE]
proof (prove)
using this:
a + (b - a) < a + b

goal (1 subgoal):
 1. a + (b - a) < a + b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a + (b - a) < a + b

goal (1 subgoal):
 1. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a + (b - a) < a + b
[PROOF STEP]
have "P a (a + (b - a))"
[PROOF STATE]
proof (prove)
using this:
a + (b - a) < a + b

goal (1 subgoal):
 1. P a (a + (b - a))
[PROOF STEP]
by (rule add [rule_format, OF less])
[PROOF STATE]
proof (state)
this:
P a (a + (b - a))

goal (1 subgoal):
 1. a + b - a < a + b \<Longrightarrow> P a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P a (a + (b - a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P a (a + (b - a))

goal (1 subgoal):
 1. P a b
[PROOF STEP]
by (simp add: *[symmetric])
[PROOF STATE]
proof (state)
this:
P a b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P a b

goal (1 subgoal):
 1. b < a \<Longrightarrow> P a b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b < a \<Longrightarrow> P a b
[PROOF STEP]
case gt: greater
[PROOF STATE]
proof (state)
this:
b < a

goal (1 subgoal):
 1. b < a \<Longrightarrow> P a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b < a
[PROOF STEP]
consider "b = 0" | "b + a - b < a + b"
[PROOF STATE]
proof (prove)
using this:
b < a

goal (1 subgoal):
 1. \<lbrakk>b = 0 \<Longrightarrow> thesis; b + a - b < a + b \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
\<lbrakk>b = 0 \<Longrightarrow> ?thesis; b + a - b < a + b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. b < a \<Longrightarrow> P a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>b = 0 \<Longrightarrow> ?thesis; b + a - b < a + b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>b = 0 \<Longrightarrow> ?thesis; b + a - b < a + b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. P a b
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b = 0 \<Longrightarrow> P a b
 2. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
b = 0

goal (2 subgoals):
 1. b = 0 \<Longrightarrow> P a b
 2. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
with z c
[PROOF STATE]
proof (chain)
picking this:
P ?a 0
P ?a ?b = P ?b ?a
b = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P ?a 0
P ?a ?b = P ?b ?a
b = 0

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

goal (1 subgoal):
 1. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
b + a - b < a + b

goal (1 subgoal):
 1. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b + a - b < a + b

goal (1 subgoal):
 1. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
have *: "b + a - b = b + (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b + a - b = b + (a - b)
[PROOF STEP]
using gt
[PROOF STATE]
proof (prove)
using this:
b < a

goal (1 subgoal):
 1. b + a - b = b + (a - b)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
b + a - b = b + (a - b)

goal (1 subgoal):
 1. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
b + (a - b) < a + b
[PROOF STEP]
have "b + (a - b) < a + b"
[PROOF STATE]
proof (prove)
using this:
b + (a - b) < a + b

goal (1 subgoal):
 1. b + (a - b) < a + b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
b + (a - b) < a + b

goal (1 subgoal):
 1. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b + (a - b) < a + b
[PROOF STEP]
have "P b (b + (a - b))"
[PROOF STATE]
proof (prove)
using this:
b + (a - b) < a + b

goal (1 subgoal):
 1. P b (b + (a - b))
[PROOF STEP]
by (rule add [rule_format, OF less])
[PROOF STATE]
proof (state)
this:
P b (b + (a - b))

goal (1 subgoal):
 1. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P b (b + (a - b))
[PROOF STEP]
have "P b a"
[PROOF STATE]
proof (prove)
using this:
P b (b + (a - b))

goal (1 subgoal):
 1. P b a
[PROOF STEP]
by (simp add: *[symmetric])
[PROOF STATE]
proof (state)
this:
P b a

goal (1 subgoal):
 1. b + a - b < a + b \<Longrightarrow> P a b
[PROOF STEP]
with c
[PROOF STATE]
proof (chain)
picking this:
P ?a ?b = P ?b ?a
P b a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P ?a ?b = P ?b ?a
P b a

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P a b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma part_partGen:
"part (Union P) (partGen P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. part (\<Union> P) (partGen P)
[PROOF STEP]
unfolding part_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (partGen P) = \<Union> P \<and> (\<forall>J1 J2. J1 \<in> partGen P \<and> J2 \<in> partGen P \<and> J1 \<noteq> J2 \<longrightarrow> J1 \<inter> J2 = {})
[PROOF STEP]
apply(intro conjI allI impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (partGen P) = \<Union> P
 2. \<And>J1 J2. J1 \<in> partGen P \<and> J2 \<in> partGen P \<and> J1 \<noteq> J2 \<Longrightarrow> J1 \<inter> J2 = {}
[PROOF STEP]
apply (metis Union_partGen)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>J1 J2. J1 \<in> partGen P \<and> J2 \<in> partGen P \<and> J1 \<noteq> J2 \<Longrightarrow> J1 \<inter> J2 = {}
[PROOF STEP]
using Int_partGen
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{?I, ?J} \<subseteq> partGen ?P; ?I \<inter> ?J \<noteq> {}\<rbrakk> \<Longrightarrow> ?I = ?J

goal (1 subgoal):
 1. \<And>J1 J2. J1 \<in> partGen P \<and> J2 \<in> partGen P \<and> J1 \<noteq> J2 \<Longrightarrow> J1 \<inter> J2 = {}
[PROOF STEP]
by blast


[STATEMENT]
lemma valid_prefixes_alt_def: "valid_prefixes r = (\<forall>e \<in> set r. valid_prefix (routing_match e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_prefixes r = (\<forall>e\<in>set r. valid_prefix (routing_match e))
[PROOF STEP]
unfolding valid_prefixes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<and>) (map (\<lambda>rr. valid_prefix (routing_match rr)) r) True = (\<forall>e\<in>set r. valid_prefix (routing_match e))
[PROOF STEP]
unfolding foldr_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr ((\<and>) \<circ> (\<lambda>rr. valid_prefix (routing_match rr))) r True = (\<forall>e\<in>set r. valid_prefix (routing_match e))
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<lambda>x. (\<and>) (valid_prefix (routing_match x))) r True = (\<forall>e\<in>set r. valid_prefix (routing_match e))
[PROOF STEP]
unfolding foldr_True_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set r. valid_prefix (routing_match x)) = (\<forall>e\<in>set r. valid_prefix (routing_match e))
[PROOF STEP]
..


[STATEMENT]
theorem Gamma_Weierstrass_complex: "Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma (z :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
proof (cases "z \<in> \<int>\<^sub>\<le>\<^sub>0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
 2. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z \<in> \<int>\<^sub>\<le>\<^sub>0

goal (2 subgoals):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
 2. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
obtain n where "z = - of_nat n"
[PROOF STATE]
proof (prove)
using this:
z \<in> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. (\<And>n. z = - of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim nonpos_Ints_cases')
[PROOF STATE]
proof (state)
this:
z = - of_nat n

goal (2 subgoals):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
 2. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z = - of_nat n

goal (2 subgoals):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
 2. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
z \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
have "Gamma_series_Weierstrass \<dots> \<longlonglongrightarrow> Gamma z"
[PROOF STATE]
proof (prove)
using this:
z \<in> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. Gamma_series_Weierstrass (- of_nat n) \<longlonglongrightarrow> Gamma z
[PROOF STEP]
by (simp add: tendsto_cong[OF Gamma_series_Weierstrass_nonpos_Ints] Gamma_nonpos_Int)
[PROOF STATE]
proof (state)
this:
Gamma_series_Weierstrass (- of_nat n) \<longlonglongrightarrow> Gamma z

goal (2 subgoals):
 1. z \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
 2. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z

goal (1 subgoal):
 1. Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<notin> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
hence z: "z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
z \<notin> \<int>\<^sub>\<le>\<^sub>0

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

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
let ?f = "(\<lambda>x. \<Prod>x = Suc 0..x. exp (z / of_nat x) / (1 + z / of_nat x))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
have A: "exp (ln (1 + z / of_nat n)) = (1 + z / of_nat n)" if "n \<ge> 1" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (Ln (1 + z / of_nat n)) = 1 + z / of_nat n
[PROOF STEP]
using False that
[PROOF STATE]
proof (prove)
using this:
z \<notin> \<int>\<^sub>\<le>\<^sub>0
1 \<le> n

goal (1 subgoal):
 1. exp (Ln (1 + z / of_nat n)) = 1 + z / of_nat n
[PROOF STEP]
by (subst exp_Ln) (auto simp: field_simps dest!: plus_of_nat_eq_0_imp)
[PROOF STATE]
proof (state)
this:
1 \<le> ?n \<Longrightarrow> exp (Ln (1 + z / of_nat ?n)) = 1 + z / of_nat ?n

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
have "(\<lambda>n. \<Sum>k=1..n. z / of_nat k - ln (1 + z / of_nat k)) \<longlonglongrightarrow> ln_Gamma z + euler_mascheroni * z + ln z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k = 1..n. z / of_nat k - Ln (1 + z / of_nat k)) \<longlonglongrightarrow> ln_Gamma z + euler_mascheroni * z + Ln z
[PROOF STEP]
using ln_Gamma_series'_aux[OF False]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. z / of_nat (Suc k) - Ln (1 + z / of_nat (Suc k))) sums (ln_Gamma z + euler_mascheroni * z + Ln z)

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k = 1..n. z / of_nat k - Ln (1 + z / of_nat k)) \<longlonglongrightarrow> ln_Gamma z + euler_mascheroni * z + Ln z
[PROOF STEP]
by (simp only: atLeastLessThanSuc_atLeastAtMost [symmetric] One_nat_def
                   sum.shift_bounds_Suc_ivl sums_def atLeast0LessThan)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>k = 1..n. z / of_nat k - Ln (1 + z / of_nat k)) \<longlonglongrightarrow> ln_Gamma z + euler_mascheroni * z + Ln z

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
from tendsto_exp[OF this] False z
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. exp (\<Sum>k = 1..x. z / of_nat k - Ln (1 + z / of_nat k))) \<longlonglongrightarrow> exp (ln_Gamma z + euler_mascheroni * z + Ln z)
z \<notin> \<int>\<^sub>\<le>\<^sub>0
z \<noteq> 0
[PROOF STEP]
have "?f \<longlonglongrightarrow> z * exp (euler_mascheroni * z) * Gamma z"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. exp (\<Sum>k = 1..x. z / of_nat k - Ln (1 + z / of_nat k))) \<longlonglongrightarrow> exp (ln_Gamma z + euler_mascheroni * z + Ln z)
z \<notin> \<int>\<^sub>\<le>\<^sub>0
z \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. \<Prod>x = Suc 0..x. exp (z / of_nat x) / (1 + z / of_nat x)) \<longlonglongrightarrow> z * exp (euler_mascheroni * z) * Gamma z
[PROOF STEP]
by (simp add: exp_add exp_sum exp_diff mult_ac Gamma_complex_altdef A)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Prod>x = Suc 0..x. exp (z / of_nat x) / (1 + z / of_nat x)) \<longlonglongrightarrow> z * exp (euler_mascheroni * z) * Gamma z

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
from tendsto_mult[OF tendsto_const[of "exp (-euler_mascheroni * z) / z"] this] z
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. exp (- euler_mascheroni * z) / z * (\<Prod>x = Suc 0..x. exp (z / of_nat x) / (1 + z / of_nat x))) \<longlonglongrightarrow> exp (- euler_mascheroni * z) / z * (z * exp (euler_mascheroni * z) * Gamma z)
z \<noteq> 0
[PROOF STEP]
show "Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. exp (- euler_mascheroni * z) / z * (\<Prod>x = Suc 0..x. exp (z / of_nat x) / (1 + z / of_nat x))) \<longlonglongrightarrow> exp (- euler_mascheroni * z) / z * (z * exp (euler_mascheroni * z) * Gamma z)
z \<noteq> 0

goal (1 subgoal):
 1. Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z
[PROOF STEP]
by (simp add: exp_minus field_split_simps Gamma_series_Weierstrass_def [abs_def])
[PROOF STATE]
proof (state)
this:
Gamma_series_Weierstrass z \<longlonglongrightarrow> Gamma z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma per_union_commute[simp]: "per_union R i j = per_union R j i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. per_union R i j = per_union R j i
[PROOF STEP]
unfolding per_union_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<union> {(x, y). (x, i) \<in> R \<and> (y, j) \<in> R} \<union> {(y, x). (x, i) \<in> R \<and> (y, j) \<in> R} = R \<union> {(x, y). (x, j) \<in> R \<and> (y, i) \<in> R} \<union> {(y, x). (x, j) \<in> R \<and> (y, i) \<in> R}
[PROOF STEP]
by auto


[STATEMENT]
lemma bit_eq_iff:
  \<open>a = b \<longleftrightarrow> (\<forall>n. 2 ^ n \<noteq> 0 \<longrightarrow> bit a n \<longleftrightarrow> bit b n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a = b) = (\<forall>n. (2::'a) ^ n \<noteq> (0::'a) \<longrightarrow> a !! n = b !! n)
[PROOF STEP]
using bit_eq_iff [of a b]
[PROOF STATE]
proof (prove)
using this:
(a = b) = (\<forall>n. possible_bit TYPE('a) n \<longrightarrow> a !! n = b !! n)

goal (1 subgoal):
 1. (a = b) = (\<forall>n. (2::'a) ^ n \<noteq> (0::'a) \<longrightarrow> a !! n = b !! n)
[PROOF STEP]
by (simp add: possible_bit_def)


[STATEMENT]
lemma sets_Collect_single:
  "i \<in> I \<Longrightarrow> A \<in> sets (M i) \<Longrightarrow> { x \<in> space (Pi\<^sub>M I M). x i \<in> A } \<in> sets (Pi\<^sub>M I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<in> I; A \<in> sets (M i)\<rbrakk> \<Longrightarrow> {x \<in> space (Pi\<^sub>M I M). x i \<in> A} \<in> sets (Pi\<^sub>M I M)
[PROOF STEP]
by simp


[STATEMENT]
lemma rbt_lookup_in_tree: "rbt_sorted t \<Longrightarrow> rbt_lookup t k = Some v \<longleftrightarrow> (k, v) \<in> set (entries t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt_sorted t \<Longrightarrow> (rbt_lookup t k = Some v) = ((k, v) \<in> set (entries t))
[PROOF STEP]
by (simp add: map_of_entries [symmetric] distinct_entries)


[STATEMENT]
lemma (in LCD) foldSetD_determ:
  "\<lbrakk>(A, x) \<in> foldSetD D f e; (A, y) \<in> foldSetD D f e; e \<in> D; A \<subseteq> B\<rbrakk>
  \<Longrightarrow> y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(A, x) \<in> foldSetD D (\<cdot>) e; (A, y) \<in> foldSetD D (\<cdot>) e; e \<in> D; A \<subseteq> B\<rbrakk> \<Longrightarrow> y = x
[PROOF STEP]
by (blast intro: foldSetD_determ_aux [rule_format])


[STATEMENT]
lemma trcl_rev_cons: "\<lbrakk> (c,w,ch)\<in>trcl T; (ch,e,c')\<in>T \<rbrakk> \<Longrightarrow> (c,w@[e],c')\<in>trcl T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(c, w, ch) \<in> trcl T; (ch, e, c') \<in> T\<rbrakk> \<Longrightarrow> (c, w @ [e], c') \<in> trcl T
[PROOF STEP]
by (auto dest: trcl_concat iff add: trcl_single)


[STATEMENT]
lemma h_extensions_set :
  assumes "q \<in> states M"
shows "List.set (h_extensions M q k) = {io@[(x,y)] | io x y . io \<in> LS M q \<and> length io \<le> k \<and> x \<in> inputs M \<and> y \<in> outputs M}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
define ex where ex: "ex = map (\<lambda>xy . [xy]) (List.product (inputs_as_list M) (outputs_as_list M))"
[PROOF STATE]
proof (state)
this:
ex = map (\<lambda>xy. [xy]) (List.product (inputs_as_list M) (outputs_as_list M))

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ex = map (\<lambda>xy. [xy]) (List.product (inputs_as_list M) (outputs_as_list M))
[PROOF STEP]
have "List.set ex = {[xy] | xy . xy \<in> list.set (List.product (inputs_as_list M) (outputs_as_list M))}"
[PROOF STATE]
proof (prove)
using this:
ex = map (\<lambda>xy. [xy]) (List.product (inputs_as_list M) (outputs_as_list M))

goal (1 subgoal):
 1. list.set ex = {[xy] |xy. xy \<in> list.set (List.product (inputs_as_list M) (outputs_as_list M))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list.set ex = {[xy] |xy. xy \<in> list.set (List.product (inputs_as_list M) (outputs_as_list M))}

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list.set ex = {[xy] |xy. xy \<in> list.set (List.product (inputs_as_list M) (outputs_as_list M))}
[PROOF STEP]
have *: "List.set ex = {[(x,y)] | x y . x \<in> inputs M \<and> y \<in> outputs M}"
[PROOF STATE]
proof (prove)
using this:
list.set ex = {[xy] |xy. xy \<in> list.set (List.product (inputs_as_list M) (outputs_as_list M))}

goal (1 subgoal):
 1. list.set ex = {[(x, y)] |x y. x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
using inputs_as_list_set[of M] outputs_as_list_set[of M]
[PROOF STATE]
proof (prove)
using this:
list.set ex = {[xy] |xy. xy \<in> list.set (List.product (inputs_as_list M) (outputs_as_list M))}
list.set (inputs_as_list M) = FSM.inputs M
list.set (outputs_as_list M) = FSM.outputs M

goal (1 subgoal):
 1. list.set ex = {[(x, y)] |x y. x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list.set ex = {[(x, y)] |x y. x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
have "h_extensions M q k = language_up_to_length_with_extensions q (\<lambda> q x . sorted_list_of_set (h M (q,x))) (inputs_as_list M) ex k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h_extensions M q k = language_up_to_length_with_extensions q (\<lambda>q x. sorted_list_of_set (FSM.h M (q, x))) (inputs_as_list M) ex k
[PROOF STEP]
unfolding ex h_extensions.simps Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. language_up_to_length_with_extensions q (\<lambda>q x. sorted_list_of_set (FSM.h M (q, x))) (inputs_as_list M) (map (\<lambda>xy. [xy]) (List.product (inputs_as_list M) (outputs_as_list M))) k = language_up_to_length_with_extensions q (\<lambda>q x. sorted_list_of_set (FSM.h M (q, x))) (inputs_as_list M) (map (\<lambda>xy. [xy]) (List.product (inputs_as_list M) (outputs_as_list M))) k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h_extensions M q k = language_up_to_length_with_extensions q (\<lambda>q x. sorted_list_of_set (FSM.h M (q, x))) (inputs_as_list M) ex k

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h_extensions M q k = language_up_to_length_with_extensions q (\<lambda>q x. sorted_list_of_set (FSM.h M (q, x))) (inputs_as_list M) ex k
[PROOF STEP]
have "List.set (h_extensions M q k) = {io @ xy |io xy. io \<in> LS M q \<and> length io \<le> k \<and> xy \<in> list.set ex}"
[PROOF STATE]
proof (prove)
using this:
h_extensions M q k = language_up_to_length_with_extensions q (\<lambda>q x. sorted_list_of_set (FSM.h M (q, x))) (inputs_as_list M) ex k

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ xy |io xy. io \<in> LS M q \<and> length io \<le> k \<and> xy \<in> list.set ex}
[PROOF STEP]
using language_up_to_length_with_extensions_set[OF assms]
[PROOF STATE]
proof (prove)
using this:
h_extensions M q k = language_up_to_length_with_extensions q (\<lambda>q x. sorted_list_of_set (FSM.h M (q, x))) (inputs_as_list M) ex k
list.set (language_up_to_length_with_extensions q (\<lambda>q x. sorted_list_of_set (FSM.h M (q, x))) (inputs_as_list M) ?ex ?k) = {io @ xy |io xy. io \<in> LS M q \<and> length io \<le> ?k \<and> xy \<in> list.set ?ex}

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ xy |io xy. io \<in> LS M q \<and> length io \<le> k \<and> xy \<in> list.set ex}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list.set (h_extensions M q k) = {io @ xy |io xy. io \<in> LS M q \<and> length io \<le> k \<and> xy \<in> list.set ex}

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list.set (h_extensions M q k) = {io @ xy |io xy. io \<in> LS M q \<and> length io \<le> k \<and> xy \<in> list.set ex}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
list.set (h_extensions M q k) = {io @ xy |io xy. io \<in> LS M q \<and> length io \<le> k \<and> xy \<in> list.set ex}

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
list.set (h_extensions M q k) = {io @ xy |io xy. io \<in> LS M q \<and> length io \<le> k \<and> xy \<in> {[(x, y)] |x y. x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}}

goal (1 subgoal):
 1. list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
list.set (h_extensions M q k) = {io @ [(x, y)] |io x y. io \<in> LS M q \<and> length io \<le> k \<and> x \<in> FSM.inputs M \<and> y \<in> FSM.outputs M}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_refl: "s homeomorphic s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s homeomorphic s
[PROOF STEP]
unfolding homeomorphic_def homeomorphism_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>s. g (f x) = x) \<and> f ` s = s \<and> continuous_on s f \<and> (\<forall>y\<in>s. f (g y) = y) \<and> g ` s = s \<and> continuous_on s g
[PROOF STEP]
using continuous_on_id
[PROOF STATE]
proof (prove)
using this:
continuous_on ?s (\<lambda>x. x)

goal (1 subgoal):
 1. \<exists>f g. (\<forall>x\<in>s. g (f x) = x) \<and> f ` s = s \<and> continuous_on s f \<and> (\<forall>y\<in>s. f (g y) = y) \<and> g ` s = s \<and> continuous_on s g
[PROOF STEP]
apply (rule_tac x = "(\<lambda>x. x)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. continuous_on s (\<lambda>x. x)) \<Longrightarrow> \<exists>g. (\<forall>x\<in>s. g x = x) \<and> (\<lambda>x. x) ` s = s \<and> continuous_on s (\<lambda>x. x) \<and> (\<forall>y\<in>s. g y = y) \<and> g ` s = s \<and> continuous_on s g
[PROOF STEP]
apply (rule_tac x = "(\<lambda>x. x)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. continuous_on s (\<lambda>x. x)) \<Longrightarrow> (\<forall>x\<in>s. x = x) \<and> (\<lambda>x. x) ` s = s \<and> continuous_on s (\<lambda>x. x) \<and> (\<forall>y\<in>s. y = y) \<and> (\<lambda>x. x) ` s = s \<and> continuous_on s (\<lambda>x. x)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vec_nth_cbox_1_eq [simp]:
  fixes u v :: "'a::euclidean_space^1"
  shows "(\<lambda>x. x $ 1) ` cbox u v = cbox (u$1) (v$1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x $ 1) ` cbox u v = cbox (u $ 1) (v $ 1)
[PROOF STEP]
by (auto simp: Basis_vec_def cart_eq_inner_axis [symmetric] mem_box image_iff Bex_def inner_axis) (metis vec_component)


[STATEMENT]
lemma unifiable_insert_swap:
  "unifiable (insert (s, t) E) = unifiable (insert (t, s) E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unifiable (insert (s, t) E) = unifiable (insert (t, s) E)
[PROOF STEP]
by (auto simp: unifiable_def unifiers_insert_swap)


[STATEMENT]
lemma ufa_\<alpha>_refl[simp]: "(i,i)\<in>ufa_\<alpha> l \<longleftrightarrow> i<length l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((i, i) \<in> ufa_\<alpha> l) = (i < length l)
[PROOF STEP]
unfolding ufa_\<alpha>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((i, i) \<in> {(x, y). x < length l \<and> y < length l \<and> rep_of l x = rep_of l y}) = (i < length l)
[PROOF STEP]
by simp


[STATEMENT]
lemma abs_half_enclosure:
  fixes r::real
  assumes "bl \<le> r" "r \<le> bu"
  shows "\<bar>r - (bl + bu) / 2\<bar> \<le> (bu - bl) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>r - (bl + bu) / 2\<bar> \<le> (bu - bl) / 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bl \<le> r
r \<le> bu

goal (1 subgoal):
 1. \<bar>r - (bl + bu) / 2\<bar> \<le> (bu - bl) / 2
[PROOF STEP]
by (auto simp: abs_real_def divide_simps)


[STATEMENT]
lemma set_spmf_lists_sample [simp]: "set_spmf (spmf_of_set (carrier L)) = (carrier L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_spmf (spmf_of_set (carrier L)) = carrier L
[PROOF STEP]
using finite_L
[PROOF STATE]
proof (prove)
using this:
finite (carrier L)

goal (1 subgoal):
 1. set_spmf (spmf_of_set (carrier L)) = carrier L
[PROOF STEP]
by simp


[STATEMENT]
lemma lmerge_simps:
  "lmerge (LCons x xs) (LCons y ys) =
  (if x < y then LCons x (lmerge xs (LCons y ys))
   else if y < x then LCons y (lmerge (LCons x xs) ys)
   else LCons y (lmerge xs ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lmerge (LCons x xs) (LCons y ys) = (if x < y then LCons x (lmerge xs (LCons y ys)) else if y < x then LCons y (lmerge (LCons x xs) ys) else LCons y (lmerge xs ys))
[PROOF STEP]
by(rule llist.expand)(simp_all add: lhd_lmerge ltl_lmerge)


[STATEMENT]
lemma poly_deg_monom_mult:
  assumes "c \<noteq> 0" and "p \<noteq> (0::(_ \<Rightarrow>\<^sub>0 'a::add_linorder_min) \<Rightarrow>\<^sub>0 'b::semiring_no_zero_divisors)"
  shows "poly_deg (punit.monom_mult c t p) = deg_pm t + poly_deg p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (punit.monom_mult c t p) = deg_pm t + poly_deg p
[PROOF STEP]
proof (rule order.antisym, fact poly_deg_monom_mult_le)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
obtain s where "s \<in> keys p" and "poly_deg p = deg_pm s"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>s \<in> keys p; poly_deg p = deg_pm s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule poly_degE)
[PROOF STATE]
proof (state)
this:
s \<in> keys p
poly_deg p = deg_pm s

goal (1 subgoal):
 1. deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)
[PROOF STEP]
have "deg_pm t + poly_deg p = deg_pm (t + s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_pm t + poly_deg p = deg_pm (t + s)
[PROOF STEP]
by (simp add: \<open>poly_deg p = deg_pm s\<close> deg_pm_plus)
[PROOF STATE]
proof (state)
this:
deg_pm t + poly_deg p = deg_pm (t + s)

goal (1 subgoal):
 1. deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deg_pm t + poly_deg p = deg_pm (t + s)

goal (1 subgoal):
 1. deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)
[PROOF STEP]
have "... \<le> poly_deg (punit.monom_mult c t p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_pm (t + s) \<le> poly_deg (punit.monom_mult c t p)
[PROOF STEP]
proof (rule poly_deg_max_keys)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t + s \<in> keys (punit.monom_mult c t p)
[PROOF STEP]
from \<open>s \<in> keys p\<close>
[PROOF STATE]
proof (chain)
picking this:
s \<in> keys p
[PROOF STEP]
show "t + s \<in> keys (punit.monom_mult c t p)"
[PROOF STATE]
proof (prove)
using this:
s \<in> keys p

goal (1 subgoal):
 1. t + s \<in> keys (punit.monom_mult c t p)
[PROOF STEP]
unfolding punit.keys_monom_mult[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
s \<in> keys p

goal (1 subgoal):
 1. t + s \<in> punit.splus t ` keys p
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
t + s \<in> keys (punit.monom_mult c t p)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
deg_pm (t + s) \<le> poly_deg (punit.monom_mult c t p)

goal (1 subgoal):
 1. deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)
[PROOF STEP]
show "deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)"
[PROOF STATE]
proof (prove)
using this:
deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)

goal (1 subgoal):
 1. deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
deg_pm t + poly_deg p \<le> poly_deg (punit.monom_mult c t p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ent_conjE1: "\<lbrakk>A\<Longrightarrow>\<^sub>AC\<rbrakk> \<Longrightarrow> A\<and>\<^sub>AB\<Longrightarrow>\<^sub>AC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<Longrightarrow>\<^sub>A C \<Longrightarrow> A \<and>\<^sub>A B \<Longrightarrow>\<^sub>A C
[PROOF STEP]
unfolding entails_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>h. h \<Turnstile> A \<longrightarrow> h \<Turnstile> C \<Longrightarrow> \<forall>h. h \<Turnstile> A \<and>\<^sub>A B \<longrightarrow> h \<Turnstile> C
[PROOF STEP]
by (auto simp: mod_and_dist)


[STATEMENT]
lemma powr_sum_distrib_real_right:
  assumes "a \<noteq> 0"
  shows   "(\<Prod>x\<in>X. a powr e x :: real) = a powr (\<Sum>x\<in>X. e x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>X. a powr e x) = a powr sum e X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (\<Prod>x\<in>X. a powr e x) = a powr sum e X
[PROOF STEP]
by (induction X rule: infinite_finite_induct) (auto simp: powr_add)


[STATEMENT]
lemma DropToIndex:
fixes
  a::"'a" and l liste
assumes
  AssumpDropToIndex: "a \<in> set (drop l liste)"
shows
  "\<exists> i \<ge> l . i < length liste \<and> a = liste ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i\<ge>l. i < length liste \<and> a = liste ! i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i\<ge>l. i < length liste \<and> a = liste ! i
[PROOF STEP]
have "\<exists> index < length (drop l liste) . a = (drop l liste) ! index"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>index<length (drop l liste). a = drop l liste ! index
[PROOF STEP]
using AssumpDropToIndex SetToIndex[of "a" "drop l liste"]
[PROOF STATE]
proof (prove)
using this:
a \<in> set (drop l liste)
a \<in> set (drop l liste) \<Longrightarrow> \<exists>index<length (drop l liste). a = drop l liste ! index

goal (1 subgoal):
 1. \<exists>index<length (drop l liste). a = drop l liste ! index
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>index<length (drop l liste). a = drop l liste ! index

goal (1 subgoal):
 1. \<exists>i\<ge>l. i < length liste \<and> a = liste ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>index<length (drop l liste). a = drop l liste ! index
[PROOF STEP]
obtain index where Index: "index < length (drop l liste)"
    "a = (drop l liste) ! index"
[PROOF STATE]
proof (prove)
using this:
\<exists>index<length (drop l liste). a = drop l liste ! index

goal (1 subgoal):
 1. (\<And>index. \<lbrakk>index < length (drop l liste); a = drop l liste ! index\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
index < length (drop l liste)
a = drop l liste ! index

goal (1 subgoal):
 1. \<exists>i\<ge>l. i < length liste \<and> a = liste ! i
[PROOF STEP]
have "l + index < length liste"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l + index < length liste
[PROOF STEP]
using Index(1)
[PROOF STATE]
proof (prove)
using this:
index < length (drop l liste)

goal (1 subgoal):
 1. l + index < length liste
[PROOF STEP]
by (metis length_drop less_diff_conv add.commute)
[PROOF STATE]
proof (state)
this:
l + index < length liste

goal (1 subgoal):
 1. \<exists>i\<ge>l. i < length liste \<and> a = liste ! i
[PROOF STEP]
hence "a = liste ! (l + index)"
[PROOF STATE]
proof (prove)
using this:
l + index < length liste

goal (1 subgoal):
 1. a = liste ! (l + index)
[PROOF STEP]
using DropToShift[of "l" "index"] Index(2)
[PROOF STATE]
proof (prove)
using this:
l + index < length liste
l + index < length ?list \<Longrightarrow> drop l ?list ! index = ?list ! (l + index)
a = drop l liste ! index

goal (1 subgoal):
 1. a = liste ! (l + index)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a = liste ! (l + index)

goal (1 subgoal):
 1. \<exists>i\<ge>l. i < length liste \<and> a = liste ! i
[PROOF STEP]
thus "\<exists>i\<ge>l. i < length liste \<and> a = liste ! i"
[PROOF STATE]
proof (prove)
using this:
a = liste ! (l + index)

goal (1 subgoal):
 1. \<exists>i\<ge>l. i < length liste \<and> a = liste ! i
[PROOF STEP]
by (metis \<open>l + index < length liste\<close> le_add1)
[PROOF STATE]
proof (state)
this:
\<exists>i\<ge>l. i < length liste \<and> a = liste ! i

goal:
No subgoals!
[PROOF STEP]
qed