[STATEMENT]
lemma iT_Div_Min: "I \<noteq> {} \<Longrightarrow> iMin (I \<oslash> k) = iMin I div k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> iMin (I \<oslash> k) = iMin I div k
[PROOF STEP]
by (simp add: iT_Div_def iMin_mono2 mono_def div_le_mono)


[STATEMENT]
lemma incseqD2: "incseq r \<Longrightarrow> r m < r n \<Longrightarrow> m < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>incseq r; r m < r n\<rbrakk> \<Longrightarrow> m < n
[PROOF STEP]
by (metis le_less mono_def not_le order.asym)


[STATEMENT]
lemma RBT_set_conv_keys:
  "ID CCOMPARE('a :: ccompare) \<noteq> None
  \<Longrightarrow> RBT_set (t :: 'a set_rbt) = set (RBT_Set2.keys t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ID ccompare \<noteq> None \<Longrightarrow> RBT_set t = set (RBT_Set2.keys t)
[PROOF STEP]
by(clarsimp simp add: RBT_set_def member_conv_keys)


[STATEMENT]
lemma sorted_list_of_set_inj: "inj_on sorted_list_of_set (Collect finite)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on sorted_list_of_set (Collect finite)
[PROOF STEP]
apply (rule inj_onI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> Collect finite; y \<in> Collect finite; sorted_list_of_set x = sorted_list_of_set y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using sorted_list_of_set_inj_aux
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; finite ?B; sorted_list_of_set ?A = sorted_list_of_set ?B\<rbrakk> \<Longrightarrow> ?A = ?B

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> Collect finite; y \<in> Collect finite; sorted_list_of_set x = sorted_list_of_set y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by blast


[STATEMENT]
lemma finprod_singleton_swap:
  assumes i_in_A: "i \<in> A" and fin_A: "finite A" and f_Pi: "f \<in> A \<rightarrow> carrier G"
  shows "(\<Otimes>j\<in>A. if j = i then f j else \<one>) = f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Otimes>j\<in>A. if j = i then f j else \<one>) = f i
[PROOF STEP]
using finprod_singleton [OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<Otimes>j\<in>A. if i = j then f j else \<one>) = f i

goal (1 subgoal):
 1. (\<Otimes>j\<in>A. if j = i then f j else \<one>) = f i
[PROOF STEP]
by (simp add: eq_commute)


[STATEMENT]
lemma word_le_less_eq: "x \<le> y \<longleftrightarrow> x = y \<or> x < y"
  for x y :: "'z::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (x = y \<or> x < y)
[PROOF STEP]
by (auto simp add: order_class.le_less)


[STATEMENT]
lemma indep_set_alt_intro: "\<not>(\<exists>T \<subseteq> S. dep_set T) \<Longrightarrow> indep_set S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>T\<subseteq>S. dep_set T) \<Longrightarrow> indep_set S
[PROOF STEP]
using indep_set_def
[PROOF STATE]
proof (prove)
using this:
indep_set ?S \<equiv> \<not> dep_set ?S

goal (1 subgoal):
 1. \<not> (\<exists>T\<subseteq>S. dep_set T) \<Longrightarrow> indep_set S
[PROOF STEP]
by blast


[STATEMENT]
lemma pfixGe_trans: "[| x pfixGe y; y pfixGe z |] ==> x pfixGe z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x pfixGe y; y pfixGe z\<rbrakk> \<Longrightarrow> x pfixGe z
[PROOF STEP]
by (blast intro: genPrefix_trans)


[STATEMENT]
lemma tensor_P_mult:
  assumes "m1 \<in> carrier_mat (2^n) (2^n)"
    and "m2 \<in> carrier_mat (2^n) (2^n)"
    and "m3 \<in> carrier_mat K K"
    and "m4 \<in> carrier_mat K K"
  shows "(tensor_P m1 m3) * (tensor_P m2 m4) = tensor_P (m1 * m2) (m3 * m4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)
[PROOF STEP]
have eq:"{0..<n} = {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<n} = {..<n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<n} = {..<n}

goal (1 subgoal):
 1. tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)
[PROOF STEP]
have "(nths dims vars1) = replicate n 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths dims vars1 = replicate n 2
[PROOF STEP]
unfolding dims_def vars1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths (replicate n 2 @ [K]) {0..<n} = replicate n 2
[PROOF STEP]
apply (subst eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths (replicate n 2 @ [K]) {..<n} = replicate n 2
[PROOF STEP]
by (simp add: nths_upt_eq_take[of "(replicate n 2 @ [K])" n])
[PROOF STATE]
proof (state)
this:
nths dims vars1 = replicate n 2

goal (1 subgoal):
 1. tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)
[PROOF STEP]
have "ps2_P.d1 = 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps2_P.d1 = 2 ^ n
[PROOF STEP]
unfolding ps2_P.d1_def ps2_P.dims1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (nths dims vars1) = 2 ^ n
[PROOF STEP]
using d_vars1 N_def
[PROOF STATE]
proof (prove)
using this:
prod_list (nths dims vars1) = N
N = 2 ^ n

goal (1 subgoal):
 1. prod_list (nths dims vars1) = 2 ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ps2_P.d1 = 2 ^ n

goal (1 subgoal):
 1. tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ps2_P.d1 = 2 ^ n

goal (1 subgoal):
 1. tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)
[PROOF STEP]
have "ps2_P.d2 = K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps2_P.d2 = K
[PROOF STEP]
unfolding ps2_P.d2_def ps2_P.dims2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (nths dims vars2) = K
[PROOF STEP]
using dims_vars2
[PROOF STATE]
proof (prove)
using this:
nths dims vars2 = [K]

goal (1 subgoal):
 1. prod_list (nths dims vars2) = K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ps2_P.d2 = K

goal (1 subgoal):
 1. tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ps2_P.d1 = 2 ^ n
ps2_P.d2 = K
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ps2_P.d1 = 2 ^ n
ps2_P.d2 = K

goal (1 subgoal):
 1. tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)
[PROOF STEP]
apply (subst ps2_P.ptensor_mat_mult)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> m1 \<in> carrier_mat ps2_P.d1 ps2_P.d1
 2. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> m2 \<in> carrier_mat ps2_P.d1 ps2_P.d1
 3. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> m3 \<in> carrier_mat ps2_P.d2 ps2_P.d2
 4. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> m4 \<in> carrier_mat ps2_P.d2 ps2_P.d2
 5. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> tensor_P m1 m3 * tensor_P m2 m4 = tensor_P m1 m3 * tensor_P m2 m4
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat (2 ^ n) (2 ^ n)
m2 \<in> carrier_mat (2 ^ n) (2 ^ n)
m3 \<in> carrier_mat K K
m4 \<in> carrier_mat K K

goal (5 subgoals):
 1. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> m1 \<in> carrier_mat ps2_P.d1 ps2_P.d1
 2. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> m2 \<in> carrier_mat ps2_P.d1 ps2_P.d1
 3. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> m3 \<in> carrier_mat ps2_P.d2 ps2_P.d2
 4. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> m4 \<in> carrier_mat ps2_P.d2 ps2_P.d2
 5. \<lbrakk>ps2_P.d1 = 2 ^ n; ps2_P.d2 = K\<rbrakk> \<Longrightarrow> tensor_P m1 m3 * tensor_P m2 m4 = tensor_P m1 m3 * tensor_P m2 m4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tensor_P m1 m3 * tensor_P m2 m4 = tensor_P (m1 * m2) (m3 * m4)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma member_mset_pos_iff_zcount: "x \<in># mset_pos M \<longleftrightarrow> 0 < zcount M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in># mset_pos M) = (0 < zcount M x)
[PROOF STEP]
using not_in_iff pos_zcount_in_zmset
[PROOF STATE]
proof (prove)
using this:
(?x \<notin># ?M) = (count ?M ?x = 0)
0 < zcount ?M ?x \<Longrightarrow> ?x \<in>#\<^sub>z ?M

goal (1 subgoal):
 1. (x \<in># mset_pos M) = (0 < zcount M x)
[PROOF STEP]
by force


[STATEMENT]
lemma Sup_V_insert:
  fixes x::V assumes "small A" shows "\<Squnion>(insert x A) = x \<squnion> \<Squnion>A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> insert x A = x \<squnion> \<Squnion> A
[PROOF STEP]
by (simp add: assms cSup_insert_If)


[STATEMENT]
lemma closedin_Hausdorff_sing_eq:
   "Hausdorff_space X \<Longrightarrow> closedin X {x} \<longleftrightarrow> x \<in> topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hausdorff_space X \<Longrightarrow> closedin X {x} = (x \<in> topspace X)
[PROOF STEP]
by (meson closedin_Hausdorff_singleton closedin_subset insert_subset)


[STATEMENT]
lemma Bot_dual_Top: "Bot cl = Top (dual cl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bot cl = Top (dual cl)
[PROOF STEP]
by (simp add: Top_def Bot_def least_def greatest_def)


[STATEMENT]
theorem reds_steps_bisimulation:
  "labels prog l c \<Longrightarrow> (\<langle>c,s\<rangle> \<rightarrow>* \<langle>c',s'\<rangle>) =
     (\<exists>l'. prog \<turnstile> \<langle>c,s,l\<rangle> \<leadsto>* \<langle>c',s',l'\<rangle> \<and> labels prog l' c')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. labels prog l c \<Longrightarrow> \<langle>c,s\<rangle> \<rightarrow>* \<langle>c',s'\<rangle> = (\<exists>l'. prog \<turnstile> \<langle>c,s,l\<rangle> \<leadsto>* \<langle>c',s',l'\<rangle> \<and> labels prog l' c')
[PROOF STEP]
by(fastforce intro:reds_steps elim:steps_reds)


[STATEMENT]
lemma frac_unique_iff: "frac x = a \<longleftrightarrow> x - a \<in> \<int> \<and> 0 \<le> a \<and> a < 1"
  for x :: "'a::floor_ceiling"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (frac x = a) = (x - a \<in> \<int> \<and> (0::'a) \<le> a \<and> a < (1::'a))
[PROOF STEP]
apply (auto simp: Ints_def frac_def algebra_simps floor_unique)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x = a + of_int \<lfloor>x\<rfloor> \<Longrightarrow> (0::'a) \<le> a
 2. x = a + of_int \<lfloor>x\<rfloor> \<Longrightarrow> a < (1::'a)
[PROOF STEP]
apply linarith+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in Corps) Abs_ant_abs[simp]:"Abs (ant z) = ant (abs z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs (ant z) = ant \<bar>z\<bar>
[PROOF STEP]
apply (simp add:Abs_def, simp add:aminus)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ant z < 0 \<longrightarrow> - z = \<bar>z\<bar>) \<and> (\<not> ant z < 0 \<longrightarrow> z = \<bar>z\<bar>)
[PROOF STEP]
apply (simp only:ant_0[THEN sym], simp only:aless_zless)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z < 0 \<longrightarrow> - z = \<bar>z\<bar>) \<and> (\<not> z < 0 \<longrightarrow> z = \<bar>z\<bar>)
[PROOF STEP]
apply (simp add:zabs_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vcomp_rel_vconst: "r \<circ>\<^sub>\<circ> (vconst_on A c) = A \<times>\<^sub>\<circ> (r `\<^sub>\<circ> set {c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<circ>\<^sub>\<circ> vconst_on A c = A \<times>\<^sub>\<circ> r `\<^sub>\<circ> set {c}
[PROOF STEP]
by auto


[STATEMENT]
lemma subset_helper_R:
  fixes p:: "real poly"
  fixes qs1 qs2 :: "real poly list"
  fixes signs1 signs2 :: "rat list list"
  shows "\<forall> x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)).
        \<exists> x1 \<in> set (characterize_consistent_signs_at_roots p qs1).
        \<exists> x2 \<in> set (characterize_consistent_signs_at_roots p qs2).
        x = x1@x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set (characterize_consistent_signs_at_roots p (qs1 @ qs2)). \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
assume  x_in: "x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2))"
[PROOF STATE]
proof (state)
this:
x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2))

goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
have x_in_csv: "x \<in> set(map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p))
[PROOF STEP]
using x_in
[PROOF STATE]
proof (prove)
using this:
x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2))

goal (1 subgoal):
 1. x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p))
[PROOF STEP]
unfolding characterize_consistent_signs_at_roots_def
[PROOF STATE]
proof (prove)
using this:
x \<in> set (remdups (map (signs_at (qs1 @ qs2)) (characterize_root_list_p p)))

goal (1 subgoal):
 1. x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p))
[PROOF STEP]
by (smt (z3) consistent_sign_vec_def map_eq_conv o_apply set_remdups signs_at_def squash_def)
[PROOF STATE]
proof (state)
this:
x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p))

goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
have csv_hyp: "\<forall>r. consistent_sign_vec (qs1 @ qs2) r = (consistent_sign_vec qs1 r)@(consistent_sign_vec qs2 r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r. consistent_sign_vec (qs1 @ qs2) r = consistent_sign_vec qs1 r @ consistent_sign_vec qs2 r
[PROOF STEP]
unfolding consistent_sign_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r. map (\<lambda>q. if 0 < poly q r then 1 else if poly q r = 0 then 0 else - 1) (qs1 @ qs2) = map (\<lambda>q. if 0 < poly q r then 1 else if poly q r = 0 then 0 else - 1) qs1 @ map (\<lambda>q. if 0 < poly q r then 1 else if poly q r = 0 then 0 else - 1) qs2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>r. consistent_sign_vec (qs1 @ qs2) r = consistent_sign_vec qs1 r @ consistent_sign_vec qs2 r

goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
have exr_iff: "(\<exists>r \<in> set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r) \<longleftrightarrow> (\<exists>r \<in> set (characterize_root_list_p p). x = (consistent_sign_vec qs1 r)@(consistent_sign_vec qs2 r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r) = (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec qs1 r @ consistent_sign_vec qs2 r)
[PROOF STEP]
using csv_hyp
[PROOF STATE]
proof (prove)
using this:
\<forall>r. consistent_sign_vec (qs1 @ qs2) r = consistent_sign_vec qs1 r @ consistent_sign_vec qs2 r

goal (1 subgoal):
 1. (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r) = (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec qs1 r @ consistent_sign_vec qs2 r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r) = (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec qs1 r @ consistent_sign_vec qs2 r)

goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
have exr: "x \<in> set(map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p)) \<longrightarrow> (\<exists>r \<in> set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p)) \<longrightarrow> (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p)) \<longrightarrow> (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r)

goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
have mem_list1: "\<forall> r \<in> set (characterize_root_list_p p). (consistent_sign_vec qs1 r) \<in> set(map (consistent_sign_vec qs1) (characterize_root_list_p p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs1 r \<in> set (map (consistent_sign_vec qs1) (characterize_root_list_p p))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs1 r \<in> set (map (consistent_sign_vec qs1) (characterize_root_list_p p))

goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
have mem_list2: "\<forall> r \<in> set (characterize_root_list_p p). (consistent_sign_vec qs2 r) \<in> set(map (consistent_sign_vec qs2) (characterize_root_list_p p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs2 r \<in> set (map (consistent_sign_vec qs2) (characterize_root_list_p p))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs2 r \<in> set (map (consistent_sign_vec qs2) (characterize_root_list_p p))

goal (1 subgoal):
 1. \<And>x. x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<Longrightarrow> \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs2 r \<in> set (map (consistent_sign_vec qs2) (characterize_root_list_p p))
[PROOF STEP]
show "\<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1).
            \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2"
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs2 r \<in> set (map (consistent_sign_vec qs2) (characterize_root_list_p p))

goal (1 subgoal):
 1. \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
using x_in_csv exr mem_list1 mem_list2 characterize_consistent_signs_at_roots_def exr_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs2 r \<in> set (map (consistent_sign_vec qs2) (characterize_root_list_p p))
x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p))
x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p)) \<longrightarrow> (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r)
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs1 r \<in> set (map (consistent_sign_vec qs1) (characterize_root_list_p p))
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs2 r \<in> set (map (consistent_sign_vec qs2) (characterize_root_list_p p))
characterize_consistent_signs_at_roots ?p ?qs = remdups (map (signs_at ?qs) (characterize_root_list_p ?p))
(\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r) = (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec qs1 r @ consistent_sign_vec qs2 r)

goal (1 subgoal):
 1. \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
using imageE image_eqI map_append set_map set_remdups signs_at_def x_in
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs2 r \<in> set (map (consistent_sign_vec qs2) (characterize_root_list_p p))
x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p))
x \<in> set (map (consistent_sign_vec (qs1 @ qs2)) (characterize_root_list_p p)) \<longrightarrow> (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r)
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs1 r \<in> set (map (consistent_sign_vec qs1) (characterize_root_list_p p))
\<forall>r\<in>set (characterize_root_list_p p). consistent_sign_vec qs2 r \<in> set (map (consistent_sign_vec qs2) (characterize_root_list_p p))
characterize_consistent_signs_at_roots ?p ?qs = remdups (map (signs_at ?qs) (characterize_root_list_p ?p))
(\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec (qs1 @ qs2) r) = (\<exists>r\<in>set (characterize_root_list_p p). x = consistent_sign_vec qs1 r @ consistent_sign_vec qs2 r)
\<lbrakk>?b \<in> ?f ` ?A; \<And>x. \<lbrakk>?b = ?f x; x \<in> ?A\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
\<lbrakk>?b = ?f ?x; ?x \<in> ?A\<rbrakk> \<Longrightarrow> ?b \<in> ?f ` ?A
map ?f (?xs @ ?ys) = map ?f ?xs @ map ?f ?ys
set (map ?f ?xs) = ?f ` set ?xs
set (remdups ?xs) = set ?xs
signs_at ?qs ?x \<equiv> map (squash \<circ> (\<lambda>q. poly q ?x)) ?qs
x \<in> set (characterize_consistent_signs_at_roots p (qs1 @ qs2))

goal (1 subgoal):
 1. \<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x1\<in>set (characterize_consistent_signs_at_roots p qs1). \<exists>x2\<in>set (characterize_consistent_signs_at_roots p qs2). x = x1 @ x2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma varnum_zero [simp]: "varnum X 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. varnum X 0 = 0
[PROOF STEP]
by (simp add: varnum_def)


[STATEMENT]
theorem wls_vsubstAbs_substAbs_compose2:
assumes "wlsAbs (us,s) A" and "wls (asSort ys) Y"
and "ys \<noteq> zs \<or> y \<notin> {z,z1}"
shows "((A $[Y / y]_ys) $[z1 // z]_zs) = ((A $[z1 // z]_zs) $[(Y #[z1 // z]_zs) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[Y / y]_ys $[z1 // z]_zs = A $[z1 // z]_zs $[Y #[z1 // z]_zs / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wls (asSort ys) Y
ys \<noteq> zs \<or> y \<notin> {z, z1}

goal (1 subgoal):
 1. A $[Y / y]_ys $[z1 // z]_zs = A $[z1 // z]_zs $[Y #[z1 // z]_zs / y]_ys
[PROOF STEP]
by(simp add: vsubstAbs_substAbs_compose2)


[STATEMENT]
lemma VUnion_vunion[simp]: "\<Union>\<^sub>\<circ>(A \<union>\<^sub>\<circ> B) = \<Union>\<^sub>\<circ>A \<union>\<^sub>\<circ> \<Union>\<^sub>\<circ>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> (A \<union>\<^sub>\<circ> B) = \<Union>\<^sub>\<circ> A \<union>\<^sub>\<circ> \<Union>\<^sub>\<circ> B
[PROOF STEP]
by auto


[STATEMENT]
lemma nontriv_solution_altdef: "nontriv_solution z \<longleftrightarrow> solution z \<and> z \<noteq> (1, 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nontriv_solution z = (solution z \<and> z \<noteq> (1::'a, 0::'a))
[PROOF STEP]
by (auto simp: solution_def nontriv_solution_def)


[STATEMENT]
lemma ltl_to_dra_alphabet_nodes:
  "DRA.nodes (ltl_to_dra_alphabet \<phi> Ap) \<subseteq> DRA.nodes (ltl_to_dra_restricted \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DRA.nodes (ltl_to_dra_alphabet \<phi> Ap) \<subseteq> DRA.nodes (ltl_to_dra_restricted \<phi>)
[PROOF STEP]
unfolding ltl_to_dra_alphabet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DRA.nodes (dra_set_alphabet (ltl_to_dra_restricted \<phi>) (Pow Ap)) \<subseteq> DRA.nodes (ltl_to_dra_restricted \<phi>)
[PROOF STEP]
by (rule dra_set_alphabet_nodes) (simp add: ltl_to_dra_restricted_alphabet)


[STATEMENT]
lemma vreal_vlepoll_VPow_omega: "\<real>\<^sub>\<circ> \<lesssim>\<^sub>\<circ> VPow \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<real>\<^sub>\<circ> \<lesssim>\<^sub>\<circ> VPow \<omega>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<real>\<^sub>\<circ> \<lesssim>\<^sub>\<circ> VPow \<omega>
[PROOF STEP]
have "elts \<real>\<^sub>\<circ> \<lesssim> (UNIV::real set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts \<real>\<^sub>\<circ> \<lesssim> UNIV
[PROOF STEP]
unfolding lepoll_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. inj_on f (elts \<real>\<^sub>\<circ>) \<and> f ` elts \<real>\<^sub>\<circ> \<subseteq> UNIV
[PROOF STEP]
by (auto intro: inj_on_inv_vreal_of_real)
[PROOF STATE]
proof (state)
this:
elts \<real>\<^sub>\<circ> \<lesssim> UNIV

goal (1 subgoal):
 1. \<real>\<^sub>\<circ> \<lesssim>\<^sub>\<circ> VPow \<omega>
[PROOF STEP]
from vlepoll_VPow_omega_if_vreal_lepoll_real[OF this]
[PROOF STATE]
proof (chain)
picking this:
ZFC_in_HOL.set (elts \<real>\<^sub>\<circ>) \<lesssim>\<^sub>\<circ> VPow \<omega>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ZFC_in_HOL.set (elts \<real>\<^sub>\<circ>) \<lesssim>\<^sub>\<circ> VPow \<omega>

goal (1 subgoal):
 1. \<real>\<^sub>\<circ> \<lesssim>\<^sub>\<circ> VPow \<omega>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<real>\<^sub>\<circ> \<lesssim>\<^sub>\<circ> VPow \<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LPDi_Star: "j \<le> i \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j \<le> i. LPDi j r) (MStar r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<le> i \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>i. LPDi j r) (MStar r)
[PROOF STEP]
proof (induct i arbitrary: j r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>j r. j \<le> 0 \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>0. LPDi j r) (MStar r)
 2. \<And>i j r. \<lbrakk>\<And>j r. j \<le> i \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>i. LPDi j r) (MStar r); j \<le> Suc i\<rbrakk> \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>Suc i. LPDi j r) (MStar r)
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
?j \<le> i \<Longrightarrow> LPDi ?j (MStar ?r) \<subseteq> {MStar ?r} \<union> MTimesR (\<Union>j\<le>i. LPDi j ?r) (MStar ?r)
j \<le> Suc i

goal (2 subgoals):
 1. \<And>j r. j \<le> 0 \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>0. LPDi j r) (MStar r)
 2. \<And>i j r. \<lbrakk>\<And>j r. j \<le> i \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>i. LPDi j r) (MStar r); j \<le> Suc i\<rbrakk> \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>Suc i. LPDi j r) (MStar r)
[PROOF STEP]
from Suc(2)
[PROOF STATE]
proof (chain)
picking this:
j \<le> Suc i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
j \<le> Suc i

goal (1 subgoal):
 1. LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>Suc i. LPDi j r) (MStar r)
[PROOF STEP]
by (auto 0 5 simp: MTimesR_def image_iff le_Suc_eq
        dest: bspec[of _ _ "Suc 0"] bspec[of _ _ "Suc _"] set_mp[OF Suc(1)] dest!: set_mp[OF LPDi_Times])
[PROOF STATE]
proof (state)
this:
LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>Suc i. LPDi j r) (MStar r)

goal (1 subgoal):
 1. \<And>j r. j \<le> 0 \<Longrightarrow> LPDi j (MStar r) \<subseteq> {MStar r} \<union> MTimesR (\<Union>j\<le>0. LPDi j r) (MStar r)
[PROOF STEP]
qed simp


[STATEMENT]
lemma cf_array_ObjMap_vdomain[cat_cs_simps]:
  "\<D>\<^sub>\<circ> (cf_array \<BB> \<CC> \<DD> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cf_array \<BB> \<CC> \<DD> \<FF> \<GG>\<lparr>ObjMap\<rparr>) = (\<BB> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cf_array_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>(\<BB> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>. \<GG> (a\<lparr>[]\<^sub>\<circ>\<rparr>)\<lparr>ObjMap\<rparr>\<lparr>a\<lparr>1\<^sub>\<nat>\<rparr>\<rparr>) = (\<BB> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
by simp


[STATEMENT]
lemma cltn2_transpose_abs:
  assumes "invertible M"
  shows "cltn2_transpose (cltn2_abs M) = cltn2_abs (transpose M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cltn2_transpose (cltn2_abs M) = cltn2_abs (Finite_Cartesian_Product.transpose M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cltn2_transpose (cltn2_abs M) = cltn2_abs (Finite_Cartesian_Product.transpose M)
[PROOF STEP]
from \<open>invertible M\<close> and transpose_invertible
[PROOF STATE]
proof (chain)
picking this:
invertible M
invertible ?A \<Longrightarrow> invertible (Finite_Cartesian_Product.transpose ?A)
[PROOF STEP]
have "invertible (transpose M)"
[PROOF STATE]
proof (prove)
using this:
invertible M
invertible ?A \<Longrightarrow> invertible (Finite_Cartesian_Product.transpose ?A)

goal (1 subgoal):
 1. invertible (Finite_Cartesian_Product.transpose M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
invertible (Finite_Cartesian_Product.transpose M)

goal (1 subgoal):
 1. cltn2_transpose (cltn2_abs M) = cltn2_abs (Finite_Cartesian_Product.transpose M)
[PROOF STEP]
from \<open>invertible M\<close> and cltn2_rep_abs2
[PROOF STATE]
proof (chain)
picking this:
invertible M
invertible ?A \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> cltn2_rep (cltn2_abs ?A) = k *\<^sub>R ?A
[PROOF STEP]
obtain k where "k \<noteq> 0" and "cltn2_rep (cltn2_abs M) = k *\<^sub>R M"
[PROOF STATE]
proof (prove)
using this:
invertible M
invertible ?A \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> cltn2_rep (cltn2_abs ?A) = k *\<^sub>R ?A

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<noteq> 0; cltn2_rep (cltn2_abs M) = k *\<^sub>R M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<noteq> 0
cltn2_rep (cltn2_abs M) = k *\<^sub>R M

goal (1 subgoal):
 1. cltn2_transpose (cltn2_abs M) = cltn2_abs (Finite_Cartesian_Product.transpose M)
[PROOF STEP]
from \<open>cltn2_rep (cltn2_abs M) = k *\<^sub>R M\<close>
[PROOF STATE]
proof (chain)
picking this:
cltn2_rep (cltn2_abs M) = k *\<^sub>R M
[PROOF STEP]
have "transpose (cltn2_rep (cltn2_abs M)) = k *\<^sub>R transpose M"
[PROOF STATE]
proof (prove)
using this:
cltn2_rep (cltn2_abs M) = k *\<^sub>R M

goal (1 subgoal):
 1. Finite_Cartesian_Product.transpose (cltn2_rep (cltn2_abs M)) = k *\<^sub>R Finite_Cartesian_Product.transpose M
[PROOF STEP]
by (simp add: transpose_scalar)
[PROOF STATE]
proof (state)
this:
Finite_Cartesian_Product.transpose (cltn2_rep (cltn2_abs M)) = k *\<^sub>R Finite_Cartesian_Product.transpose M

goal (1 subgoal):
 1. cltn2_transpose (cltn2_abs M) = cltn2_abs (Finite_Cartesian_Product.transpose M)
[PROOF STEP]
with \<open>k \<noteq> 0\<close> and \<open>invertible (transpose M)\<close>
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
invertible (Finite_Cartesian_Product.transpose M)
Finite_Cartesian_Product.transpose (cltn2_rep (cltn2_abs M)) = k *\<^sub>R Finite_Cartesian_Product.transpose M
[PROOF STEP]
show "cltn2_transpose (cltn2_abs M) = cltn2_abs (transpose M)"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
invertible (Finite_Cartesian_Product.transpose M)
Finite_Cartesian_Product.transpose (cltn2_rep (cltn2_abs M)) = k *\<^sub>R Finite_Cartesian_Product.transpose M

goal (1 subgoal):
 1. cltn2_transpose (cltn2_abs M) = cltn2_abs (Finite_Cartesian_Product.transpose M)
[PROOF STEP]
unfolding cltn2_transpose_def
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
invertible (Finite_Cartesian_Product.transpose M)
Finite_Cartesian_Product.transpose (cltn2_rep (cltn2_abs M)) = k *\<^sub>R Finite_Cartesian_Product.transpose M

goal (1 subgoal):
 1. cltn2_abs (Finite_Cartesian_Product.transpose (cltn2_rep (cltn2_abs M))) = cltn2_abs (Finite_Cartesian_Product.transpose M)
[PROOF STEP]
by (simp add: cltn2_abs_mult)
[PROOF STATE]
proof (state)
this:
cltn2_transpose (cltn2_abs M) = cltn2_abs (Finite_Cartesian_Product.transpose M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DirProds_one_iso_sym: "(\<lambda>x. (\<lambda>_\<in>{G}. x)) \<in> iso (f G) (DirProds f {G})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<lambda>_\<in>{G}. x) \<in> Group.iso (f G) (DirProds f {G})
[PROOF STEP]
proof (intro isoI homI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> carrier (f G) \<Longrightarrow> (\<lambda>_\<in>{G}. x) \<in> carrier (DirProds f {G})
 2. \<And>x y. \<lbrakk>x \<in> carrier (f G); y \<in> carrier (f G)\<rbrakk> \<Longrightarrow> (\<lambda>_\<in>{G}. x \<otimes>\<^bsub>f G\<^esub> y) = (\<lambda>_\<in>{G}. x) \<otimes>\<^bsub>DirProds f {G}\<^esub> (\<lambda>_\<in>{G}. y)
 3. bij_betw (\<lambda>x. \<lambda>_\<in>{G}. x) (carrier (f G)) (carrier (DirProds f {G}))
[PROOF STEP]
show "bij_betw (\<lambda>x. \<lambda>_\<in>{G}. x) (carrier (f G)) (carrier (DirProds f {G}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>x. \<lambda>_\<in>{G}. x) (carrier (f G)) (carrier (DirProds f {G}))
[PROOF STEP]
proof (unfold bij_betw_def, rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on (\<lambda>x. \<lambda>_\<in>{G}. x) (carrier (f G))
 2. (\<lambda>x. \<lambda>_\<in>{G}. x) ` carrier (f G) = carrier (DirProds f {G})
[PROOF STEP]
show "inj_on (\<lambda>x. (\<lambda>_\<in>{G}. x)) (carrier (f G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. \<lambda>_\<in>{G}. x) (carrier (f G))
[PROOF STEP]
by (intro inj_onI, metis imageI image_constant image_restrict_eq member_remove remove_def)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>x. \<lambda>_\<in>{G}. x) (carrier (f G))

goal (1 subgoal):
 1. (\<lambda>x. \<lambda>_\<in>{G}. x) ` carrier (f G) = carrier (DirProds f {G})
[PROOF STEP]
show "(\<lambda>x. (\<lambda>_\<in>{G}. x)) ` carrier (f G) = carrier (DirProds f {G})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<lambda>_\<in>{G}. x) ` carrier (f G) = carrier (DirProds f {G})
[PROOF STEP]
unfolding DirProds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<lambda>_\<in>{G}. x) ` carrier (f G) = carrier \<lparr>carrier = Pi\<^sub>E {G} (carrier \<circ> f), monoid.mult = \<lambda>x y. \<lambda>i\<in>{G}. x i \<otimes>\<^bsub>f i\<^esub> y i, one = \<lambda>i\<in>{G}. \<one>\<^bsub>f i\<^esub>\<rparr>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<lambda>_\<in>{G}. x) ` carrier (f G) = carrier (DirProds f {G})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>x. \<lambda>_\<in>{G}. x) (carrier (f G)) (carrier (DirProds f {G}))

goal (2 subgoals):
 1. \<And>x. x \<in> carrier (f G) \<Longrightarrow> (\<lambda>_\<in>{G}. x) \<in> carrier (DirProds f {G})
 2. \<And>x y. \<lbrakk>x \<in> carrier (f G); y \<in> carrier (f G)\<rbrakk> \<Longrightarrow> (\<lambda>_\<in>{G}. x \<otimes>\<^bsub>f G\<^esub> y) = (\<lambda>_\<in>{G}. x) \<otimes>\<^bsub>DirProds f {G}\<^esub> (\<lambda>_\<in>{G}. y)
[PROOF STEP]
qed (unfold DirProds_def, auto)


[STATEMENT]
theorem certify_sound:
  assumes "pair_pseudo_graph cert"
  assumes "certify cert"
  shows" \<not>kuratowski_planar G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> kuratowski_planar (with_proj G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pair_pseudo_graph cert
certify cert

goal (1 subgoal):
 1. \<not> kuratowski_planar (with_proj G)
[PROOF STEP]
by (intro kuratowski_contr) (auto simp: certify_def Let_def)


[STATEMENT]
lemma uminus_add_minus_vec:
  assumes "l \<in> carrier_vec n" "r \<in> carrier_vec n"
  shows "- ((l::'a :: ab_group_add vec) + r) = (- l - r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (l + r) = - l - r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l \<in> carrier_vec n
r \<in> carrier_vec n

goal (1 subgoal):
 1. - (l + r) = - l - r
[PROOF STEP]
by auto


[STATEMENT]
lemma "\<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace>
          TRY
            WHILE True
            INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace>
            DO IF \<acute>M = a THEN RAISE \<acute>Abr :== ''Break''
               ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1
               FI
            OD
          CATCH
            IF \<acute>Abr = ''Break'' THEN SKIP ELSE Throw FI
          END
          \<lbrace>\<acute>S = a * b\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>M = 0 \<and> \<acute>S = 0\<rbrace> TRY WHILE True INV \<lbrace>\<acute>S = \<acute>M * b\<rbrace> DO IF \<acute>M = a THEN RAISE \<acute>Abr :== ''Break'' ELSE \<acute>S :== \<acute>S + b;; \<acute>M :== \<acute>M + 1 FI OD CATCH IF \<acute>Abr = ''Break'' THEN SKIP ELSE THROW FI END \<lbrace>\<acute>S = a * b\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>M S. \<lbrakk>M = 0; S = 0\<rbrakk> \<Longrightarrow> S = M * b
 2. \<And>M S. \<lbrakk>S = M * b; True\<rbrakk> \<Longrightarrow> (M = a \<longrightarrow> S = a * b) \<and> (M \<noteq> a \<longrightarrow> S + b = (M + 1) * b)
 3. \<And>M S. \<lbrakk>S = M * b; \<not> True\<rbrakk> \<Longrightarrow> S = a * b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in \<Z>)
  M\<alpha>_Rel_arrow_rl_is_cat_Set_iso_arr'[cat_rel_par_Set_cs_intros]:
  assumes "A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "A' = A \<times>\<^sub>\<circ> (B \<times>\<^sub>\<circ> C)"
    and "B' = (A \<times>\<^sub>\<circ> B) \<times>\<^sub>\<circ> C"
    and "\<CC>' = cat_Set \<alpha>"
  shows "M\<alpha>_Rel_arrow_rl A B C : A' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_rl A B C : A' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
using assms(1-3)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_rl A B C : A' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
unfolding assms(4-6)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. M\<alpha>_Rel_arrow_rl A B C : A \<times>\<^sub>\<circ> B \<times>\<^sub>\<circ> C \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>cat_Set \<alpha>\<^esub> (A \<times>\<^sub>\<circ> B) \<times>\<^sub>\<circ> C
[PROOF STEP]
by (rule M\<alpha>_Rel_arrow_rl_is_cat_Set_iso_arr)


[STATEMENT]
lemma length_takeWhile: "v \<in> set xs \<Longrightarrow> length (takeWhile (\<lambda>z. z \<noteq> v) xs) < length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> set xs \<Longrightarrow> length (takeWhile (\<lambda>z. z \<noteq> v) xs) < length xs
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma is_prefix_cons: "is_prefix (x # a) b = (\<exists> c. b = x # c \<and> is_prefix a c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_prefix (x # a) b = (\<exists>c. b = x # c \<and> is_prefix a c)
[PROOF STEP]
by (metis append_Cons is_prefix_def)


[STATEMENT]
lemma emeasure_distr_I: "emeasure (distr (restrict_space lborel {0<..<1::real}) borel I) UNIV = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (distr (restrict_space lborel {0<..<1}) borel I) UNIV = 1
[PROOF STEP]
by (simp add: emeasure_distr space_restrict_space emeasure_restrict_space )


[STATEMENT]
lemma ivl_integral_cong:
  assumes "\<And>x. x \<in> closed_segment a b \<Longrightarrow> g x = f x"
  assumes "a = c" "b = d"
  shows "ivl_integral a b f = ivl_integral c d g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ivl_integral a b f = ivl_integral c d g
[PROOF STEP]
using assms integral_spike[of "{}" "closed_segment a b" f g]
[PROOF STATE]
proof (prove)
using this:
?x \<in> closed_segment a b \<Longrightarrow> g ?x = f ?x
a = c
b = d
\<lbrakk>negligible {}; \<And>x. x \<in> closed_segment a b - {} \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> integral (closed_segment a b) g = integral (closed_segment a b) f

goal (1 subgoal):
 1. ivl_integral a b f = ivl_integral c d g
[PROOF STEP]
by (auto simp: ivl_integral_def closed_segment_eq_real_ivl split: if_split_asm)


[STATEMENT]
lemma obtain_ideal_points:
  assumes "is_poincare_line H"
  obtains i1 i2 where "i1 \<noteq> i2" "ideal_points H = {i1, i2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i1 i2. \<lbrakk>i1 \<noteq> i2; ideal_points H = {i1, i2}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using two_ideal_points[OF assms] card_eq_2_iff_doubleton[of "ideal_points H"]
[PROOF STATE]
proof (prove)
using this:
card (ideal_points H) = 2
(card (ideal_points H) = 2) = (\<exists>x y. x \<noteq> y \<and> ideal_points H = {x, y})

goal (1 subgoal):
 1. (\<And>i1 i2. \<lbrakk>i1 \<noteq> i2; ideal_points H = {i1, i2}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma isOK_forallM [simp]:
  "isOK (forallM f xs) \<longleftrightarrow> (\<forall>x \<in> set xs. isOK (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isOK (forallM f xs) = (\<forall>x\<in>set xs. isOK (f x))
[PROOF STEP]
by (induct xs) (simp_all)


[STATEMENT]
lemma Union_paths_carrier: "(\<Union>x\<in>paths t. set x) = carrier t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set ` paths t) = carrier t
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma inner_Basis_inf_left: "i \<in> Basis \<Longrightarrow> inf x y \<bullet> i = inf (x \<bullet> i) (y \<bullet> i)"
  and inner_Basis_sup_left: "i \<in> Basis \<Longrightarrow> sup x y \<bullet> i = sup (x \<bullet> i) (y \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> Basis \<Longrightarrow> inf x y \<bullet> i = inf (x \<bullet> i) (y \<bullet> i)) &&& (i \<in> Basis \<Longrightarrow> sup x y \<bullet> i = sup (x \<bullet> i) (y \<bullet> i))
[PROOF STEP]
by (simp_all add: eucl_inf eucl_sup inner_sum_left inner_Basis if_distrib
      cong: if_cong)


[STATEMENT]
lemma map_lcomp_dist:
  "\<lbrakk> pairwise (##\<^sub>S) (set xs); vwb_lens a \<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S (map_lcomp xs a) = \<Squnion>\<^sub>S xs ;\<^sub>S a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pairwise (##\<^sub>S) (set xs); vwb_lens a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S (map_lcomp xs a) = \<Squnion>\<^sub>S xs ;\<^sub>S a
[PROOF STEP]
by (simp add: foldr_compat_dist map_lcomp_def)


[STATEMENT]
lemma gfp_F_lfp_F:
  shows "gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))
[PROOF STEP]
proof %invisible -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))
[PROOF STEP]
let ?F' = "dual \<circ> F2 ds \<circ> F1 \<circ> undual"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))
[PROOF STEP]
have "gfp (F ds) = (F1 (undual (gfp ?F')), gfp ?F')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp (F ds) = (F1 (undual (gfp (dual \<circ> F2 ds \<circ> F1 \<circ> undual))), gfp (dual \<circ> F2 ds \<circ> F1 \<circ> undual))
[PROOF STEP]
by (subst gfp_prod[OF F_mono]) (simp add: F_def o_def gfp_const)
[PROOF STATE]
proof (state)
this:
gfp (F ds) = (F1 (undual (gfp (dual \<circ> F2 ds \<circ> F1 \<circ> undual))), gfp (dual \<circ> F2 ds \<circ> F1 \<circ> undual))

goal (1 subgoal):
 1. gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gfp (F ds) = (F1 (undual (gfp (dual \<circ> F2 ds \<circ> F1 \<circ> undual))), gfp (dual \<circ> F2 ds \<circ> F1 \<circ> undual))

goal (1 subgoal):
 1. gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))
[PROOF STEP]
have "gfp ?F' = dual (lfp (F2 ds \<circ> F1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp (dual \<circ> F2 ds \<circ> F1 \<circ> undual) = dual (lfp (F2 ds \<circ> F1))
[PROOF STEP]
by (simp add: lfp_dual_gfp[OF F2_o_F1_mono, simplified o_assoc])
[PROOF STATE]
proof (state)
this:
gfp (dual \<circ> F2 ds \<circ> F1 \<circ> undual) = dual (lfp (F2 ds \<circ> F1))

goal (1 subgoal):
 1. gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
gfp (F ds) = (F1 (undual (dual (lfp (F2 ds \<circ> F1)))), dual (lfp (F2 ds \<circ> F1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gfp (F ds) = (F1 (undual (dual (lfp (F2 ds \<circ> F1)))), dual (lfp (F2 ds \<circ> F1)))

goal (1 subgoal):
 1. gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))
[PROOF STEP]
unfolding gfp_F_def
[PROOF STATE]
proof (prove)
using this:
gfp (F ds) = (F1 (undual (dual (lfp (F2 ds \<circ> F1)))), dual (lfp (F2 ds \<circ> F1)))

goal (1 subgoal):
 1. map_prod id undual (gfp (F ds)) = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gfp_F ds = (F1 (lfp (F2 ds \<circ> F1)), lfp (F2 ds \<circ> F1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_left_mono: "x \<le> y \<Longrightarrow> y \<le> a \<longrightarrow> x \<le> (a::'a::preorder)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> y \<le> a \<longrightarrow> x \<le> a
[PROOF STEP]
by (auto intro: order_trans)


[STATEMENT]
lemma size_ffilter_card: "size (ffilter f s) = card ({e \<in> (fset s). f e})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (ffilter f s) = card {e \<in> fset s. f e}
[PROOF STEP]
by (simp add: ffilter_def fset_both_sides Abs_fset_inverse Set.filter_def)


[STATEMENT]
lemma one_mult_mat_vec[simp]:
  "(v :: 'a :: semiring_1 vec) \<in> carrier_vec n \<Longrightarrow> 1\<^sub>m n *\<^sub>v v = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> carrier_vec n \<Longrightarrow> 1\<^sub>m n *\<^sub>v v = v
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma integral_add[simp]: "integrable M f \<Longrightarrow> integrable M g \<Longrightarrow>
    integral\<^sup>L M (\<lambda>x. f x + g x) = integral\<^sup>L M f + integral\<^sup>L M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> LINT x|M. f x + g x = integral\<^sup>L M f + integral\<^sup>L M g
[PROOF STEP]
by (intro has_bochner_integral_integral_eq has_bochner_integral_add has_bochner_integral_integrable)


[STATEMENT]
lemma has_fps_expansion_sin' [fps_expansion_intros]:
  "(\<lambda>x::'a :: {banach, real_normed_field}. sin x) has_fps_expansion fps_sin 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin has_fps_expansion fps_sin (1::'a)
[PROOF STEP]
using has_fps_expansion_sin[of 1]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. sin ((1::?'b1) * x)) has_fps_expansion fps_sin (1::?'b1)

goal (1 subgoal):
 1. sin has_fps_expansion fps_sin (1::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma sum_but_one:
  assumes "\<forall>j < (n::nat). j \<noteq>i \<longrightarrow> f j = (0::'a::ring)"
  and "i < n"
  shows "(\<Sum> j \<in> {0 ..< n}. f j * g j) = f i * g i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
have "sum (\<lambda>x. f x * g x) (({0 ..< n} - {i}) \<union> {i}) = sum (\<lambda>x. f x * g x) ({0 ..< n} - {i}) +
    sum (\<lambda>x. f x * g x) {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = (\<Sum>x\<in>{0..<n} - {i}. f x * g x) + (\<Sum>x\<in>{i}. f x * g x)
[PROOF STEP]
by (rule sum.union_disjoint, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = (\<Sum>x\<in>{0..<n} - {i}. f x * g x) + (\<Sum>x\<in>{i}. f x * g x)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = (\<Sum>x\<in>{0..<n} - {i}. f x * g x) + (\<Sum>x\<in>{i}. f x * g x)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
have "... = sum (\<lambda>x. f x * g x) {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{0..<n} - {i}. f x * g x) + (\<Sum>x\<in>{i}. f x * g x) = (\<Sum>x\<in>{i}. f x * g x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>j<n. j \<noteq> i \<longrightarrow> f j = (0::'a)
i < n

goal (1 subgoal):
 1. (\<Sum>x\<in>{0..<n} - {i}. f x * g x) + (\<Sum>x\<in>{i}. f x * g x) = (\<Sum>x\<in>{i}. f x * g x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{0..<n} - {i}. f x * g x) + (\<Sum>x\<in>{i}. f x * g x) = (\<Sum>x\<in>{i}. f x * g x)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{0..<n} - {i}. f x * g x) + (\<Sum>x\<in>{i}. f x * g x) = (\<Sum>x\<in>{i}. f x * g x)

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
have "... = f i * g i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{i}. f x * g x) = f i * g i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{i}. f x * g x) = f i * g i

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = f i * g i
[PROOF STEP]
have "sum (\<lambda>x. f x * g x) (({0 ..< n} - {i}) \<union> {i}) = f i * g i"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = f i * g i

goal (1 subgoal):
 1. (\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = f i * g i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = f i * g i

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = f i * g i

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
have "{0 ..< n} = ({0 ..< n} - {i}) \<union> {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<n} = {0..<n} - {i} \<union> {i}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>j<n. j \<noteq> i \<longrightarrow> f j = (0::'a)
i < n

goal (1 subgoal):
 1. {0..<n} = {0..<n} - {i} \<union> {i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<n} = {0..<n} - {i} \<union> {i}

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = f i * g i
{0..<n} = {0..<n} - {i} \<union> {i}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>{0..<n} - {i} \<union> {i}. f x * g x) = f i * g i
{0..<n} = {0..<n} - {i} \<union> {i}

goal (1 subgoal):
 1. (\<Sum>j = 0..<n. f j * g j) = f i * g i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<n. f j * g j) = f i * g i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vproduct_cong:
  assumes "\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f i = g i"
  shows "(\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i) = (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vproduct I f = vproduct I g
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vproduct I f = vproduct I g
[PROOF STEP]
have "(\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i) \<subseteq>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. g i)" if "\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f i = g i" for f g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vproduct I f \<subseteq>\<^sub>\<circ> vproduct I g
[PROOF STEP]
proof(intro vsubsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> vproduct I f \<Longrightarrow> x \<in>\<^sub>\<circ> vproduct I g
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> vproduct I f \<Longrightarrow> x \<in>\<^sub>\<circ> vproduct I g
[PROOF STEP]
assume "x \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i)"
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> vproduct I f

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> vproduct I f \<Longrightarrow> x \<in>\<^sub>\<circ> vproduct I g
[PROOF STEP]
note xD = vproductD[OF this]
[PROOF STATE]
proof (state)
this:
vsv x
\<D>\<^sub>\<circ> x = I
\<forall>i\<in>elts I. x\<lparr>i\<rparr> \<in>\<^sub>\<circ> f i

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> vproduct I f \<Longrightarrow> x \<in>\<^sub>\<circ> vproduct I g
[PROOF STEP]
interpret vsv x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv x
[PROOF STEP]
by (rule xD(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> vproduct I f \<Longrightarrow> x \<in>\<^sub>\<circ> vproduct I g
[PROOF STEP]
show "x \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in>\<^sub>\<circ> vproduct I g
[PROOF STEP]
by (metis xD(2,3) that VLambda_in_vproduct vsv_is_VLambda)
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> vproduct I g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> ?f i = ?g i) \<Longrightarrow> vproduct I ?f \<subseteq>\<^sub>\<circ> vproduct I ?g

goal (1 subgoal):
 1. vproduct I f = vproduct I g
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
?i \<in>\<^sub>\<circ> I \<Longrightarrow> f ?i = g ?i
(\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> ?f i = ?g i) \<Longrightarrow> vproduct I ?f \<subseteq>\<^sub>\<circ> vproduct I ?g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i \<in>\<^sub>\<circ> I \<Longrightarrow> f ?i = g ?i
(\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> ?f i = ?g i) \<Longrightarrow> vproduct I ?f \<subseteq>\<^sub>\<circ> vproduct I ?g

goal (1 subgoal):
 1. vproduct I f = vproduct I g
[PROOF STEP]
by (intro vsubset_antisym) auto
[PROOF STATE]
proof (state)
this:
vproduct I f = vproduct I g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gcd_diff_dvd_left1: "a dvd b \<Longrightarrow> gcd (b - c) a = gcd c a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd b \<Longrightarrow> gcd (b - c) a = gcd c a
[PROOF STEP]
using gcd_add_dvd_left1[of a b "-c"]
[PROOF STATE]
proof (prove)
using this:
a dvd b \<Longrightarrow> gcd (b + - c) a = gcd (- c) a

goal (1 subgoal):
 1. a dvd b \<Longrightarrow> gcd (b - c) a = gcd c a
[PROOF STEP]
by simp


[STATEMENT]
lemma partGen_ex:
assumes "I \<in> P"
shows "\<exists> J \<in> partGen P. I \<subseteq> J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>J\<in>partGen P. I \<subseteq> J
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
I \<in> P

goal (1 subgoal):
 1. \<exists>J\<in>partGen P. I \<subseteq> J
[PROOF STEP]
unfolding partGen_def
[PROOF STATE]
proof (prove)
using this:
I \<in> P

goal (1 subgoal):
 1. \<exists>J\<in>{gen P I |I. I \<in> P}. I \<subseteq> J
[PROOF STEP]
apply(intro bexI[of _ "gen P I"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. I \<in> P \<Longrightarrow> I \<subseteq> gen P I
 2. I \<in> P \<Longrightarrow> gen P I \<in> {gen P I |I. I \<in> P}
[PROOF STEP]
by auto


[STATEMENT]
lemma index_mat_swaprows[simp]:
  "i < dim_row A \<Longrightarrow> j < dim_col A \<Longrightarrow> swaprows k l A $$ (i,j) = (if k = i then A $$ (l,j) else
    if l = i then A $$ (k,j) else A $$ (i,j))"
  "dim_row (swaprows k l A) = dim_row A" "dim_col (swaprows k l A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> swaprows k l A $$ (i, j) = (if k = i then A $$ (l, j) else if l = i then A $$ (k, j) else A $$ (i, j))) &&& dim_row (swaprows k l A) = dim_row A &&& dim_col (swaprows k l A) = dim_col A
[PROOF STEP]
unfolding mat_swaprows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> mat (dim_row A) (dim_col A) (\<lambda>(i, j). if k = i then A $$ (l, j) else if l = i then A $$ (k, j) else A $$ (i, j)) $$ (i, j) = (if k = i then A $$ (l, j) else if l = i then A $$ (k, j) else A $$ (i, j))) &&& dim_row (mat (dim_row A) (dim_col A) (\<lambda>(i, j). if k = i then A $$ (l, j) else if l = i then A $$ (k, j) else A $$ (i, j))) = dim_row A &&& dim_col (mat (dim_row A) (dim_col A) (\<lambda>(i, j). if k = i then A $$ (l, j) else if l = i then A $$ (k, j) else A $$ (i, j))) = dim_col A
[PROOF STEP]
by auto


[STATEMENT]
lemma inorder_ins:
  "sorted(inorder t) \<Longrightarrow> inorder(tree\<^sub>i(ins x t)) = ins_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (inorder t) \<Longrightarrow> inorder (tree\<^sub>i (ins x t)) = ins_list x (inorder t)
[PROOF STEP]
by(induction t) (auto, auto simp: ins_list_simps split!: if_splits up\<^sub>i.splits)


[STATEMENT]
lemma distinct_seteq_set_length_eq:
  "x \<in> {ys. set ys = xs \<and> distinct ys} \<Longrightarrow> length x = Finite_Set.card xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {ys. set ys = xs \<and> distinct ys} \<Longrightarrow> length x = Finite_Set.card xs
[PROOF STEP]
using distinct_card
[PROOF STATE]
proof (prove)
using this:
distinct ?xs \<Longrightarrow> Finite_Set.card (set ?xs) = length ?xs

goal (1 subgoal):
 1. x \<in> {ys. set ys = xs \<and> distinct ys} \<Longrightarrow> length x = Finite_Set.card xs
[PROOF STEP]
by fastforce


[STATEMENT]
lemma bad_pair_set_finite:
  assumes "finite S"
  shows "finite (bad_pair_set S T c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (bad_pair_set S T c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (bad_pair_set S T c)
[PROOF STEP]
have "finite (S \<times> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (S \<times> S)
[PROOF STEP]
using finite_cartesian_product assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> finite (?A \<times> ?B)
finite S

goal (1 subgoal):
 1. finite (S \<times> S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (S \<times> S)

goal (1 subgoal):
 1. finite (bad_pair_set S T c)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (S \<times> S)

goal (1 subgoal):
 1. finite (bad_pair_set S T c)
[PROOF STEP]
using bad_pair_set_filter_alt finite_filter
[PROOF STATE]
proof (prove)
using this:
finite (S \<times> S)
bad_pair_set ?S ?T ?c = Set.filter (\<lambda>p. bad_pair (fst p) (snd p) ?T ?c) (?S \<times> ?S)
finite ?S \<Longrightarrow> finite (Set.filter ?P ?S)

goal (1 subgoal):
 1. finite (bad_pair_set S T c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (bad_pair_set S T c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_freshEnv_swapEnv_exchange2:
assumes "wlsEnv rho"
shows "freshEnv xs x2 (rho &[x2 \<and> x1]_xs) = freshEnv xs x1 rho"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshEnv xs x2 (rho &[x2 \<and> x1]_xs) = freshEnv xs x1 rho
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho

goal (1 subgoal):
 1. freshEnv xs x2 (rho &[x2 \<and> x1]_xs) = freshEnv xs x1 rho
[PROOF STEP]
by (intro freshEnv_swapEnv_exchange2) auto


[STATEMENT]
lemma HaddP_subst [simp]: "(HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
obtain s::name where "atom s \<sharp> (x,y,z,t,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. atom s \<sharp> (x, y, z, t, i) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom s \<sharp> (x, y, z, t, i)

goal (1 subgoal):
 1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom s \<sharp> (x, y, z, t, i)

goal (1 subgoal):
 1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
by (auto simp: HaddP.simps [of s])
[PROOF STATE]
proof (state)
this:
(HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ldropn_Suc: "ldropn (Suc n) xs = (case xs of LNil \<Rightarrow> LNil | LCons x xs' \<Rightarrow> ldropn n xs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ldropn (Suc n) xs = (case xs of LNil \<Rightarrow> LNil | LCons x xs' \<Rightarrow> ldropn n xs')
[PROOF STEP]
by(simp split: llist.split)(simp add: ldropn_def funpow_swap1)


[STATEMENT]
lemma f_Exec_Stream_Acc_Output_Init_drop': "
  \<lbrakk> 0 < k; n < length xs \<rbrakk> \<Longrightarrow>
  f_Exec_Comp_Stream_Acc_Output_Init k output_fun trans_fun xs c \<up> Suc n =
  f_Exec_Comp_Stream_Acc_Output k output_fun trans_fun xs c \<up> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; n < length xs\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream_Acc_Output_Init k output_fun trans_fun xs c \<up> Suc n = f_Exec_Comp_Stream_Acc_Output k output_fun trans_fun xs c \<up> n
[PROOF STEP]
by (simp add: f_Exec_Comp_Stream_Acc_Output_Init_def)


[STATEMENT]
lemma blockmat_make_vert:
 "blockmat (make_vert_block n) = (make_vert_equiv n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blockmat (make_vert_block n) = make_vert_equiv n
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. blockmat (make_vert_block 0) = make_vert_equiv 0
 2. \<And>n. blockmat (make_vert_block n) = make_vert_equiv n \<Longrightarrow> blockmat (make_vert_block (Suc n)) = make_vert_equiv (Suc n)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. blockmat (make_vert_block n) = make_vert_equiv n \<Longrightarrow> blockmat (make_vert_block (Suc n)) = make_vert_equiv (Suc n)
[PROOF STEP]
unfolding make_vert_block.simps blockmat.simps make_vert_equiv.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. blockmat (make_vert_block n) = make_vert_equiv n \<Longrightarrow> brickmat vert \<otimes> blockmat (make_vert_block n) = mat1 2 \<otimes> make_vert_equiv n
[PROOF STEP]
using mat1_vert_equiv
[PROOF STATE]
proof (prove)
using this:
mat1 2 = brickmat vert

goal (1 subgoal):
 1. \<And>n. blockmat (make_vert_block n) = make_vert_equiv n \<Longrightarrow> brickmat vert \<otimes> blockmat (make_vert_block n) = mat1 2 \<otimes> make_vert_equiv n
[PROOF STEP]
by auto


[STATEMENT]
lemma power_increasing: "n \<le> N \<Longrightarrow> 1 \<le> a \<Longrightarrow> a ^ n \<le> a ^ N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N
[PROOF STEP]
proof (induction N)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>n \<le> 0; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ 0
 2. \<And>N. \<lbrakk>\<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N; n \<le> Suc N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ Suc N
[PROOF STEP]
case (Suc N)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N
n \<le> Suc N
(1::'a) \<le> a

goal (2 subgoals):
 1. \<lbrakk>n \<le> 0; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ 0
 2. \<And>N. \<lbrakk>\<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N; n \<le> Suc N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ Suc N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N
n \<le> Suc N
(1::'a) \<le> a
[PROOF STEP]
have "1 * a^n \<le> a * a^N" if "n \<le> N"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N
n \<le> Suc N
(1::'a) \<le> a

goal (1 subgoal):
 1. (1::'a) * a ^ n \<le> a * a ^ N
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N
n \<le> Suc N
(1::'a) \<le> a
n \<le> N

goal (1 subgoal):
 1. (1::'a) * a ^ n \<le> a * a ^ N
[PROOF STEP]
by (intro mult_mono) (auto simp add: order_trans[OF zero_le_one])
[PROOF STATE]
proof (state)
this:
n \<le> N \<Longrightarrow> (1::'a) * a ^ n \<le> a * a ^ N

goal (2 subgoals):
 1. \<lbrakk>n \<le> 0; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ 0
 2. \<And>N. \<lbrakk>\<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N; n \<le> Suc N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ Suc N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<le> N \<Longrightarrow> (1::'a) * a ^ n \<le> a * a ^ N
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
n \<le> N \<Longrightarrow> (1::'a) * a ^ n \<le> a * a ^ N

goal (1 subgoal):
 1. a ^ n \<le> a ^ Suc N
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
n \<le> N \<Longrightarrow> (1::'a) * a ^ n \<le> a * a ^ N
\<lbrakk>n \<le> N; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ N
n \<le> Suc N
(1::'a) \<le> a

goal (1 subgoal):
 1. a ^ n \<le> a ^ Suc N
[PROOF STEP]
by (auto simp add: le_Suc_eq)
[PROOF STATE]
proof (state)
this:
a ^ n \<le> a ^ Suc N

goal (1 subgoal):
 1. \<lbrakk>n \<le> 0; (1::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> a ^ 0
[PROOF STEP]
qed (auto)


[STATEMENT]
lemma strict_mono_leD: "strict_mono r \<Longrightarrow> m \<le> n \<Longrightarrow> r m \<le> r n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>strict_mono r; m \<le> n\<rbrakk> \<Longrightarrow> r m \<le> r n
[PROOF STEP]
by (erule (1) monoD [OF strict_mono_mono])


[STATEMENT]
lemma real_interval_min_interval[simp]:
  "real_interval (min_interval a b) = min_interval (real_interval a) (real_interval b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_interval (min_interval a b) = min_interval (real_interval a) (real_interval b)
[PROOF STEP]
by (auto simp: interval_eq_set_of_iff set_of_eq real_of_float_min)


[STATEMENT]
lemma sum_path_weights_append_singleton:
  "sum_path_weights (xs @ [(l,x,l')]) = sum_path_weights xs + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_weights (map (\<lambda>(s, l, t). l) (xs @ [(l, x, l')])) = sum_weights (map (\<lambda>(s, l, t). l) xs) + x
[PROOF STEP]
by (induct xs) (simp_all add: add.assoc)


[STATEMENT]
lemma ord_of_frac:
  assumes "a \<in> nonzero Z\<^sub>p"
  assumes "b \<in> nonzero Z\<^sub>p"
  shows "ord (frac a b) = (ord_Zp a) - (ord_Zp b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b
[PROOF STEP]
have "frac a b = frac (numer (frac a b)) (denom (frac a b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fraction Z\<^sub>p a b = fraction Z\<^sub>p (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) (denominator Z\<^sub>p (fraction Z\<^sub>p a b))
[PROOF STEP]
by (simp add: assms(1) assms(2))
[PROOF STATE]
proof (state)
this:
fraction Z\<^sub>p a b = fraction Z\<^sub>p (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) (denominator Z\<^sub>p (fraction Z\<^sub>p a b))

goal (1 subgoal):
 1. ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fraction Z\<^sub>p a b = fraction Z\<^sub>p (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) (denominator Z\<^sub>p (fraction Z\<^sub>p a b))
[PROOF STEP]
have "a \<otimes>\<^bsub>Z\<^sub>p\<^esub> (denom (frac a b)) = b \<otimes>\<^bsub>Z\<^sub>p\<^esub> (numer (frac a b))"
[PROOF STATE]
proof (prove)
using this:
fraction Z\<^sub>p a b = fraction Z\<^sub>p (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) (denominator Z\<^sub>p (fraction Z\<^sub>p a b))

goal (1 subgoal):
 1. a \<otimes>\<^bsub>Z\<^sub>p\<^esub> denominator Z\<^sub>p (fraction Z\<^sub>p a b) = b \<otimes>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p (fraction Z\<^sub>p a b)
[PROOF STEP]
by (simp add: assms(1) assms(2) numer_denom_swap)
[PROOF STATE]
proof (state)
this:
a \<otimes>\<^bsub>Z\<^sub>p\<^esub> denominator Z\<^sub>p (fraction Z\<^sub>p a b) = b \<otimes>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p (fraction Z\<^sub>p a b)

goal (1 subgoal):
 1. ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<otimes>\<^bsub>Z\<^sub>p\<^esub> denominator Z\<^sub>p (fraction Z\<^sub>p a b) = b \<otimes>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p (fraction Z\<^sub>p a b)
[PROOF STEP]
have "(ord_Zp a) - (ord_Zp b) =  (ord_Zp (numer (frac a b))) - (ord_Zp (denom (frac a b)))"
[PROOF STATE]
proof (prove)
using this:
a \<otimes>\<^bsub>Z\<^sub>p\<^esub> denominator Z\<^sub>p (fraction Z\<^sub>p a b) = b \<otimes>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p (fraction Z\<^sub>p a b)

goal (1 subgoal):
 1. ord_Zp a - ord_Zp b = ord_Zp (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) - ord_Zp (denominator Z\<^sub>p (fraction Z\<^sub>p a b))
[PROOF STEP]
using ord_Zp_eq_frac Q\<^sub>p_def Z\<^sub>p_def
[PROOF STATE]
proof (prove)
using this:
a \<otimes>\<^bsub>Z\<^sub>p\<^esub> denominator Z\<^sub>p (fraction Z\<^sub>p a b) = b \<otimes>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p (fraction Z\<^sub>p a b)
\<lbrakk>?a \<in> nonzero Z\<^sub>p; ?b \<in> nonzero Z\<^sub>p; ?c \<in> nonzero Z\<^sub>p; ?d \<in> nonzero Z\<^sub>p; ?a \<otimes>\<^bsub>Z\<^sub>p\<^esub> ?d = ?b \<otimes>\<^bsub>Z\<^sub>p\<^esub> ?c\<rbrakk> \<Longrightarrow> ord_Zp ?a - ord_Zp ?b = ord_Zp ?c - ord_Zp ?d
Q\<^sub>p \<equiv> Frac Z\<^sub>p
Z\<^sub>p \<equiv> padic_int p

goal (1 subgoal):
 1. ord_Zp a - ord_Zp b = ord_Zp (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) - ord_Zp (denominator Z\<^sub>p (fraction Z\<^sub>p a b))
[PROOF STEP]
by (metis Zp.frac_closed Zp.nonzero_closed Zp.numer_denom_facts(4) assms(1) assms(2) local.numer_denom_facts(1) local.numer_denom_facts(2) nonzero_fraction ord_of_nonzero(2) ord_pos)
[PROOF STATE]
proof (state)
this:
ord_Zp a - ord_Zp b = ord_Zp (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) - ord_Zp (denominator Z\<^sub>p (fraction Z\<^sub>p a b))

goal (1 subgoal):
 1. ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord_Zp a - ord_Zp b = ord_Zp (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) - ord_Zp (denominator Z\<^sub>p (fraction Z\<^sub>p a b))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ord_Zp a - ord_Zp b = ord_Zp (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) - ord_Zp (denominator Z\<^sub>p (fraction Z\<^sub>p a b))

goal (1 subgoal):
 1. ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b
[PROOF STEP]
using ord_def
[PROOF STATE]
proof (prove)
using this:
ord_Zp a - ord_Zp b = ord_Zp (numerator Z\<^sub>p (fraction Z\<^sub>p a b)) - ord_Zp (denominator Z\<^sub>p (fraction Z\<^sub>p a b))
ord ?x = ord_Zp (numerator Z\<^sub>p ?x) - ord_Zp (denominator Z\<^sub>p ?x)

goal (1 subgoal):
 1. ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
ord (fraction Z\<^sub>p a b) = ord_Zp a - ord_Zp b

goal:
No subgoals!
[PROOF STEP]
qed