[STATEMENT]
lemma hsi_method_via_h_framework_completeness_and_finiteness :
  fixes M1 :: "('a::linorder,'b::linorder,'c::linorder) fsm"
  fixes M2 :: "('e,'b,'c) fsm"
  assumes "observable M1"
  and     "observable M2"
  and     "minimal M1"
  and     "minimal M2"
  and     "size_r M1 \<le> m"
  and     "size M2 \<le> m"
  and     "inputs M2 = inputs M1"
  and     "outputs M2 = outputs M1"
shows "(L M1 = L M2) \<longleftrightarrow> ((L M1 \<inter> set (hsi_method_via_h_framework M1 m)) = (L M2 \<inter> set (hsi_method_via_h_framework M1 m)))"
and "finite_tree (hsi_method_via_h_framework M1 m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (hsi_method_via_h_framework M1 m) = L M2 \<inter> Prefix_Tree.set (hsi_method_via_h_framework M1 m)) &&& finite_tree (hsi_method_via_h_framework M1 m)
[PROOF STEP]
using h_framework_static_with_empty_graph_completeness_and_finiteness[OF assms, where dist_fun="(\<lambda> k q . get_HSI M1 q)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m))
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> finite_tree (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m)

goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (hsi_method_via_h_framework M1 m) = L M2 \<inter> Prefix_Tree.set (hsi_method_via_h_framework M1 m)) &&& finite_tree (hsi_method_via_h_framework M1 m)
[PROOF STEP]
using get_HSI_distinguishes[OF assms(1,3)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m))
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> finite_tree (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (hsi_method_via_h_framework M1 m) = L M2 \<inter> Prefix_Tree.set (hsi_method_via_h_framework M1 m)) &&& finite_tree (hsi_method_via_h_framework M1 m)
[PROOF STEP]
using get_HSI_finite
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m))
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> finite_tree (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io
finite_tree (get_HSI ?M ?q)

goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (hsi_method_via_h_framework M1 m) = L M2 \<inter> Prefix_Tree.set (hsi_method_via_h_framework M1 m)) &&& finite_tree (hsi_method_via_h_framework M1 m)
[PROOF STEP]
unfolding hsi_method_via_h_framework_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m))
\<lbrakk>\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (get_HSI M1 q1) \<inter> Prefix_Tree.set (get_HSI M1 q2) \<and> distinguishes M1 q1 q2 io; \<And>q k. q \<in> FSM.states M1 \<Longrightarrow> finite_tree (get_HSI M1 q)\<rbrakk> \<Longrightarrow> finite_tree (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (get_HSI M1 ?q1.0) \<inter> Prefix_Tree.set (get_HSI M1 ?q2.0). distinguishes M1 ?q1.0 ?q2.0 io
finite_tree (get_HSI ?M ?q)

goal (1 subgoal):
 1. (L M1 = L M2) = (L M1 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m) = L M2 \<inter> Prefix_Tree.set (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m)) &&& finite_tree (h_framework_static_with_empty_graph M1 (\<lambda>k. get_HSI M1) m)
[PROOF STEP]
by blast+


[STATEMENT]
lemma cblinfun_power_uminus: \<open>cblinfun_power (-a) n = (-1)^n *\<^sub>R cblinfun_power a n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cblinfun_power (- a) n = (- 1) ^ n *\<^sub>R cblinfun_power a n
[PROOF STEP]
apply (subst asm_rl[of \<open>-a = (-1) *\<^sub>R a\<close>])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. - a = - 1 *\<^sub>R a
 2. cblinfun_power (- 1 *\<^sub>R a) n = (- 1) ^ n *\<^sub>R cblinfun_power a n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cblinfun_power (- 1 *\<^sub>R a) n = (- 1) ^ n *\<^sub>R cblinfun_power a n
[PROOF STEP]
by (rule cblinfun_power_scaleR)


[STATEMENT]
lemma snd_Gauss_Jordan_upt_k_iarrays_PA:
shows "snd (Gauss_Jordan_upt_k_iarrays_PA A k) = (Gauss_Jordan_upt_k_iarrays A k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Gauss_Jordan_upt_k_iarrays_PA A k) = Gauss_Jordan_upt_k_iarrays A k
[PROOF STEP]
unfolding Gauss_Jordan_upt_k_iarrays_PA_def Gauss_Jordan_upt_k_iarrays_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (fst (foldl Gauss_Jordan_column_k_iarrays_PA (mat_iarray (1::'a) (nrows_iarray A), 0, A) [0..<Suc k]), snd (snd (foldl Gauss_Jordan_column_k_iarrays_PA (mat_iarray (1::'a) (nrows_iarray A), 0, A) [0..<Suc k]))) = snd (foldl Gauss_Jordan_column_k_iarrays (0, A) [0..<Suc k])
[PROOF STEP]
using foldl_Gauss_Jordan_column_k_iarrays_eq[of "mat_iarray 1 (nrows_iarray A)" A "Suc k"]
[PROOF STATE]
proof (prove)
using this:
snd (foldl Gauss_Jordan_column_k_iarrays_PA (mat_iarray (1::'a) (nrows_iarray A), 0, A) [0..<Suc k]) = foldl Gauss_Jordan_column_k_iarrays (0, A) [0..<Suc k]

goal (1 subgoal):
 1. snd (fst (foldl Gauss_Jordan_column_k_iarrays_PA (mat_iarray (1::'a) (nrows_iarray A), 0, A) [0..<Suc k]), snd (snd (foldl Gauss_Jordan_column_k_iarrays_PA (mat_iarray (1::'a) (nrows_iarray A), 0, A) [0..<Suc k]))) = snd (foldl Gauss_Jordan_column_k_iarrays (0, A) [0..<Suc k])
[PROOF STEP]
by simp


[STATEMENT]
lemma fls_X_power_base_factor: "fls_base_factor (fls_X ^ n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor (fls_X ^ n) = 1
[PROOF STEP]
by (simp add: fls_X_power_conv_shift_1)


[STATEMENT]
lemma forball_contra1:"\<lbrakk>\<forall>y\<in>A. P x y \<longrightarrow> Q y; \<forall>y\<in>A. \<not> Q y\<rbrakk> \<Longrightarrow> \<forall>y\<in>A. \<not> P x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y\<in>A. P x y \<longrightarrow> Q y; \<forall>y\<in>A. \<not> Q y\<rbrakk> \<Longrightarrow> \<forall>y\<in>A. \<not> P x y
[PROOF STEP]
by blast


[STATEMENT]
lemma continuity_lem_lt0_expanded:
  fixes r:: "real"
  fixes a b c:: "real"
  shows "a*r^2 + b*r + c < 0 \<Longrightarrow>
    \<exists>y'> r. \<forall>x\<in>{r<..y'}. a*x^2 + b*x + c < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * r\<^sup>2 + b * r + c < 0 \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c < 0
[PROOF STEP]
using quadratic_poly_eval continuity_lem_lt0
[PROOF STATE]
proof (prove)
using this:
poly [:?c, ?b, ?a:] ?x = ?a * ?x\<^sup>2 + ?b * ?x + ?c
poly [:?c, ?b, ?a:] ?r < 0 \<Longrightarrow> \<exists>y'>?r. \<forall>x\<in>{?r<..y'}. poly [:?c, ?b, ?a:] x < 0

goal (1 subgoal):
 1. a * r\<^sup>2 + b * r + c < 0 \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c < 0
[PROOF STEP]
by (simp add: add.commute)


[STATEMENT]
lemma incomp_lcp_len: "\<not> u \<bowtie> v \<Longrightarrow> \<^bold>|u \<and>\<^sub>p v\<^bold>| < min \<^bold>|u\<^bold>| \<^bold>|v\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> u \<bowtie> v \<Longrightarrow> \<^bold>|u \<and>\<^sub>p v\<^bold>| < min \<^bold>|u\<^bold>| \<^bold>|v\<^bold>|
[PROOF STEP]
using lcp_len'[of u v] lcp_len'[of v u]
[PROOF STATE]
proof (prove)
using this:
\<not> u \<le>p v \<Longrightarrow> \<^bold>|u \<and>\<^sub>p v\<^bold>| < \<^bold>|u\<^bold>|
\<not> v \<le>p u \<Longrightarrow> \<^bold>|v \<and>\<^sub>p u\<^bold>| < \<^bold>|v\<^bold>|

goal (1 subgoal):
 1. \<not> u \<bowtie> v \<Longrightarrow> \<^bold>|u \<and>\<^sub>p v\<^bold>| < min \<^bold>|u\<^bold>| \<^bold>|v\<^bold>|
[PROOF STEP]
unfolding lcp_sym[of v] min_less_iff_conj
[PROOF STATE]
proof (prove)
using this:
\<not> u \<le>p v \<Longrightarrow> \<^bold>|u \<and>\<^sub>p v\<^bold>| < \<^bold>|u\<^bold>|
\<not> v \<le>p u \<Longrightarrow> \<^bold>|u \<and>\<^sub>p v\<^bold>| < \<^bold>|v\<^bold>|

goal (1 subgoal):
 1. \<not> u \<bowtie> v \<Longrightarrow> \<^bold>|u \<and>\<^sub>p v\<^bold>| < \<^bold>|u\<^bold>| \<and> \<^bold>|u \<and>\<^sub>p v\<^bold>| < \<^bold>|v\<^bold>|
[PROOF STEP]
by blast


[STATEMENT]
theorem Par_ZObisT[simp]:
assumes "c1 \<approx>01T d1" and "c2 \<approx>01T d2"
shows "Par c1 c2 \<approx>01T Par d1 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 | c2 \<approx>01T d1 | d2
[PROOF STEP]
using assms thetaParZOT_ZObisT
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>01T d1
c2 \<approx>01T d2
thetaParZOT \<subseteq> ZObisT

goal (1 subgoal):
 1. c1 | c2 \<approx>01T d1 | d2
[PROOF STEP]
unfolding thetaParZOT_def
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>01T d1
c2 \<approx>01T d2
{(c1 | c2, d1 | d2) |c1 c2 d1 d2. c1 \<approx>01T d1 \<and> c2 \<approx>01T d2} \<subseteq> ZObisT

goal (1 subgoal):
 1. c1 | c2 \<approx>01T d1 | d2
[PROOF STEP]
by blast


[STATEMENT]
lemma in_below: "a\<noteq>b \<Longrightarrow> L:Lin \<Longrightarrow>
  (x,y) : below L a b \<longleftrightarrow> x\<noteq>y \<and>
  (if y=a then (x,b) : L else
   if x=a then y=b | (b,y) : L else (x,y) : L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> b; L \<in> Lin\<rbrakk> \<Longrightarrow> ((x, y) \<in> below L a b) = (x \<noteq> y \<and> (if y = a then (x, b) \<in> L else if x = a then y = b \<or> (b, y) \<in> L else (x, y) \<in> L))
[PROOF STEP]
by(auto simp:below_def slo_defs)


[STATEMENT]
lemma poincare_section2_rep[poincare_tac_theorems]:
  "{(120, -1000, -1000, -1000, -1000)..(120, 1000, 1000, 1000, 1000)::real*real*real*real*real} =
  {eucl_of_list [120, -1000, -1000, -1000, -1000]..eucl_of_list [120, 1000, 1000, 1000, 1000]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(120, - 1000, - 1000, - 1000, - 1000)..(120, 1000, 1000, 1000, 1000)} = {eucl_of_list [120, - 1000, - 1000, - 1000, - 1000]..eucl_of_list [120, 1000, 1000, 1000, 1000]}
[PROOF STEP]
by (auto simp: eucl_of_list_prod)


[STATEMENT]
lemma strong_consensus_cluster_imp_cons_cluster:
\<comment> \<open>Every intact set is a consensus cluster\<close>
  shows "strong_consensus_cluster I \<Longrightarrow> is_cons_cluster I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strong_consensus_cluster I \<Longrightarrow> is_cons_cluster I
[PROOF STEP]
unfolding strong_consensus_cluster_def is_cons_cluster_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<subseteq> W \<and> (\<forall>p\<in>I. \<exists>Q\<subseteq>I. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set I Q \<and> quorum_of_set I Q' \<longrightarrow> I \<inter> Q \<inter> Q' \<noteq> {}) \<Longrightarrow> I \<subseteq> W \<and> (\<forall>p\<in>I. \<exists>Q\<subseteq>I. quorum_of p Q) \<and> (\<forall>Q Q'. quorum_of_set I Q \<and> quorum_of_set I Q' \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
[PROOF STEP]
by blast


[STATEMENT]
lemma merge1_img_eq: "\<forall>(t2,e2) \<in> fset xs. merge1 t2 = t2 \<Longrightarrow> ((\<lambda>(t,e). (merge1 t,e)) |`| xs) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>(t2, e2)\<in>fset xs. merge1 t2 = t2 \<Longrightarrow> (\<lambda>(t, e). (merge1 t, e)) |`| xs = xs
[PROOF STEP]
using fset_img_eq[of xs "\<lambda>(t,e). (merge1 t,e)"]
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>fset xs. (case x of (t, e) \<Rightarrow> (merge1 t, e)) = x \<Longrightarrow> (\<lambda>(t, e). (merge1 t, e)) |`| xs = xs

goal (1 subgoal):
 1. \<forall>(t2, e2)\<in>fset xs. merge1 t2 = t2 \<Longrightarrow> (\<lambda>(t, e). (merge1 t, e)) |`| xs = xs
[PROOF STEP]
by force


[STATEMENT]
theorem free_in_quad_fm :
  assumes freeA : "var\<notin> vars a"
  assumes freeB : "var\<notin> vars b"
  assumes freeC : "var\<notin> vars c"
  assumes freeD : "var\<notin> vars d"
  shows "freeIn var (quadratic_sub_fm var a b c d A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freeIn var (quadratic_sub_fm var a b c d A)
[PROOF STEP]
using free_in_quad_fm_helper[OF assms, of 0]
[PROOF STATE]
proof (prove)
using this:
freeIn (var + 0) (quadratic_sub_fm_helper var a b c d ?F 0)

goal (1 subgoal):
 1. freeIn var (quadratic_sub_fm var a b c d A)
[PROOF STEP]
by auto


[STATEMENT]
lemma add_lessD2: "i + j < (k::nat) \<Longrightarrow> j < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + j < k \<Longrightarrow> j < k
[PROOF STEP]
by simp


[STATEMENT]
theorem certificate_characterization:
  defines "kuratowski \<equiv> \<lambda>G :: 'a pair_pre_digraph. K\<^bsub>3,3\<^esub> G \<or> K\<^bsub>5\<^esub> G"
  shows "kuratowski (contr_graph G)
    \<longleftrightarrow> (\<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 G = verts3 slim)" (is "?L \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G))) = (\<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G))) \<Longrightarrow> \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
 2. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
assume ?L
[PROOF STATE]
proof (state)
this:
kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))

goal (2 subgoals):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G))) \<Longrightarrow> \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
 2. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
interpret S: pair_graph slim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pair_graph slim
[PROOF STEP]
by (rule pair_graph_slim)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G))) \<Longrightarrow> \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
 2. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
have "subdivision_pair (contr_graph G) slim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim
[PROOF STEP]
have *: "S.is_slim (verts3 G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S.is_slim (verts3 (with_proj G))
[PROOF STEP]
by (rule slim_is_slim)
[PROOF STATE]
proof (state)
this:
S.is_slim (verts3 (with_proj G))

goal (1 subgoal):
 1. subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim
[PROOF STEP]
using contr_graph_slim_eq S.subdivision_gen_contr[OF *]
[PROOF STATE]
proof (prove)
using this:
gen_contr_graph (with_proj slim) (verts3 (with_proj G)) = gen_contr_graph (with_proj G) (verts3 (with_proj G))
subdivision_pair (gen_contr_graph (with_proj slim) (verts3 (with_proj G))) slim

goal (1 subgoal):
 1. subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim

goal (2 subgoals):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G))) \<Longrightarrow> \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
 2. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim

goal (2 subgoals):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G))) \<Longrightarrow> \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
 2. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
have "verts3 slim = verts3 G" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. verts3 (with_proj slim) = verts3 (with_proj G)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> verts3 (with_proj slim) \<Longrightarrow> x \<in> verts3 (with_proj G)
 2. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> verts3 (with_proj slim) \<Longrightarrow> x \<in> verts3 (with_proj G)
 2. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
assume "v \<in> ?l"
[PROOF STATE]
proof (state)
this:
v \<in> verts3 (with_proj slim)

goal (2 subgoals):
 1. \<And>x. x \<in> verts3 (with_proj slim) \<Longrightarrow> x \<in> verts3 (with_proj G)
 2. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> verts3 (with_proj slim)
[PROOF STEP]
show "v \<in> ?r"
[PROOF STATE]
proof (prove)
using this:
v \<in> verts3 (with_proj slim)

goal (1 subgoal):
 1. v \<in> verts3 (with_proj G)
[PROOF STEP]
using verts_slim_in_G verts3_slim_in_verts3
[PROOF STATE]
proof (prove)
using this:
v \<in> verts3 (with_proj slim)
pverts slim \<subseteq> pverts G
?v \<in> verts3 (with_proj slim) \<Longrightarrow> ?v \<in> verts3 (with_proj G)

goal (1 subgoal):
 1. v \<in> verts3 (with_proj G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> verts3 (with_proj G)

goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
assume "v \<in> ?r"
[PROOF STATE]
proof (state)
this:
v \<in> verts3 (with_proj G)

goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
have "v \<in> verts3 (contr_graph G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
have "v \<in> verts (contr_graph G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> verts (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
using \<open>v \<in> ?r\<close>
[PROOF STATE]
proof (prove)
using this:
v \<in> verts3 (with_proj G)

goal (1 subgoal):
 1. v \<in> verts (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
by (auto simp: verts3_def gen_contr_graph_def)
[PROOF STATE]
proof (state)
this:
v \<in> verts (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))

goal (1 subgoal):
 1. v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> verts (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<in> verts (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))

goal (1 subgoal):
 1. v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
using \<open>?L\<close>
[PROOF STATE]
proof (prove)
using this:
v \<in> verts (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))

goal (1 subgoal):
 1. v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
unfolding kuratowski_def
[PROOF STATE]
proof (prove)
using this:
v \<in> verts (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
K\<^bsub>3,3\<^esub> (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G)))) \<or> K\<^bsub>5\<^esub> (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))

goal (1 subgoal):
 1. v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
by (auto simp: verts3_K33 verts3_K5)
[PROOF STATE]
proof (state)
this:
v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))

goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
have "v \<in> verts3 (gen_contr_graph slim (verts3 G))"
[PROOF STATE]
proof (prove)
using this:
v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))

goal (1 subgoal):
 1. v \<in> verts3 (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G))))
[PROOF STEP]
unfolding contr_graph_slim_eq
[PROOF STATE]
proof (prove)
using this:
v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))

goal (1 subgoal):
 1. v \<in> verts3 (with_proj (gen_contr_graph (with_proj G) (verts3 (with_proj G))))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
v \<in> verts3 (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G))))

goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> verts3 (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G))))
[PROOF STEP]
have "2 < in_degree (gen_contr_graph slim (verts3 G)) v"
[PROOF STATE]
proof (prove)
using this:
v \<in> verts3 (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G))))

goal (1 subgoal):
 1. 2 < in_degree (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))) v
[PROOF STEP]
unfolding verts3_def
[PROOF STATE]
proof (prove)
using this:
v \<in> {v \<in> verts (with_proj (gen_contr_graph (with_proj slim) {v \<in> verts (with_proj G). 2 < in_degree (with_proj G) v})). 2 < in_degree (with_proj (gen_contr_graph (with_proj slim) {v \<in> verts (with_proj G). 2 < in_degree (with_proj G) v})) v}

goal (1 subgoal):
 1. 2 < in_degree (with_proj (gen_contr_graph (with_proj slim) {v \<in> verts (with_proj G). 2 < in_degree (with_proj G) v})) v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 < in_degree (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))) v

goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 < in_degree (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))) v

goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
have "\<dots> \<le> in_degree slim v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. in_degree (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))) v \<le> in_degree (with_proj slim) v
[PROOF STEP]
using \<open>v \<in> ?r\<close> verts3_slim_in_verts3
[PROOF STATE]
proof (prove)
using this:
v \<in> verts3 (with_proj G)
?v \<in> verts3 (with_proj slim) \<Longrightarrow> ?v \<in> verts3 (with_proj G)

goal (1 subgoal):
 1. in_degree (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))) v \<le> in_degree (with_proj slim) v
[PROOF STEP]
by (auto intro: S.in_degree_contr)
[PROOF STATE]
proof (state)
this:
in_degree (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))) v \<le> in_degree (with_proj slim) v

goal (1 subgoal):
 1. \<And>x. x \<in> verts3 (with_proj G) \<Longrightarrow> x \<in> verts3 (with_proj slim)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 < in_degree (with_proj slim) v
[PROOF STEP]
show "v \<in> verts3 slim"
[PROOF STATE]
proof (prove)
using this:
2 < in_degree (with_proj slim) v

goal (1 subgoal):
 1. v \<in> verts3 (with_proj slim)
[PROOF STEP]
using verts3_in_slim_G \<open>v \<in> ?r\<close>
[PROOF STATE]
proof (prove)
using this:
2 < in_degree (with_proj slim) v
?x \<in> verts3 (with_proj G) \<Longrightarrow> ?x \<in> pverts slim
v \<in> verts3 (with_proj G)

goal (1 subgoal):
 1. v \<in> verts3 (with_proj slim)
[PROOF STEP]
unfolding verts3_def
[PROOF STATE]
proof (prove)
using this:
2 < in_degree (with_proj slim) v
?x \<in> {v \<in> verts (with_proj G). 2 < in_degree (with_proj G) v} \<Longrightarrow> ?x \<in> pverts slim
v \<in> {v \<in> verts (with_proj G). 2 < in_degree (with_proj G) v}

goal (1 subgoal):
 1. v \<in> {v \<in> verts (with_proj slim). 2 < in_degree (with_proj slim) v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> verts3 (with_proj slim)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
verts3 (with_proj slim) = verts3 (with_proj G)

goal (2 subgoals):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G))) \<Longrightarrow> \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
 2. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim
verts3 (with_proj slim) = verts3 (with_proj G)
[PROOF STEP]
show ?R
[PROOF STATE]
proof (prove)
using this:
subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim
verts3 (with_proj slim) = verts3 (with_proj G)

goal (1 subgoal):
 1. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
[PROOF STEP]
using \<open>?L\<close>
[PROOF STATE]
proof (prove)
using this:
subdivision_pair (gen_contr_graph (with_proj G) (verts3 (with_proj G))) slim
verts3 (with_proj slim) = verts3 (with_proj G)
kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))

goal (1 subgoal):
 1. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)

goal (1 subgoal):
 1. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
assume ?R
[PROOF STATE]
proof (state)
this:
\<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)

goal (1 subgoal):
 1. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)
[PROOF STEP]
have "kuratowski (gen_contr_graph slim (verts3 G))"
[PROOF STATE]
proof (prove)
using this:
\<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)

goal (1 subgoal):
 1. kuratowski (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))
[PROOF STEP]
unfolding kuratowski_def
[PROOF STATE]
proof (prove)
using this:
\<exists>H. (K\<^bsub>3,3\<^esub> (with_proj H) \<or> K\<^bsub>5\<^esub> (with_proj H)) \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim)

goal (1 subgoal):
 1. K\<^bsub>3,3\<^esub> (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))) \<or> K\<^bsub>5\<^esub> (with_proj (gen_contr_graph (with_proj slim) (verts3 (with_proj G))))
[PROOF STEP]
by (auto intro: K33_contractedI K5_contractedI)
[PROOF STATE]
proof (state)
this:
kuratowski (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))

goal (1 subgoal):
 1. \<exists>H. kuratowski H \<and> subdivision_pair H slim \<and> verts3 (with_proj G) = verts3 (with_proj slim) \<Longrightarrow> kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kuratowski (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))
[PROOF STEP]
show ?L
[PROOF STATE]
proof (prove)
using this:
kuratowski (gen_contr_graph (with_proj slim) (verts3 (with_proj G)))

goal (1 subgoal):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
unfolding contr_graph_slim_eq
[PROOF STATE]
proof (prove)
using this:
kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))

goal (1 subgoal):
 1. kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
kuratowski (gen_contr_graph (with_proj G) (verts3 (with_proj G)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma adjacent_Cons: "adjacent w (t # ts) =
  (t \<noteq> Leaf \<and> r t = snd w \<and> (case ts of [] \<Rightarrow> l t = fst w
     | u # us \<Rightarrow> adjacent (fst w, r u) ts \<and> l t = Suc (r u)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent w (t # ts) = (t \<noteq> Leaf \<and> r t = snd w \<and> (case ts of [] \<Rightarrow> l t = fst w | u # us \<Rightarrow> adjacent (fst w, r u) ts \<and> l t = Suc (r u)))
[PROOF STEP]
unfolding adjacent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Leaf \<notin> set (t # ts) \<and> list_all2 (\<lambda>t u. l t = Suc (r u)) (butlast (t # ts)) (tl (t # ts)) \<and> (t # ts = [] \<or> l (last (t # ts)) = fst w \<and> r (hd (t # ts)) = snd w)) = (t \<noteq> Leaf \<and> r t = snd w \<and> (case ts of [] \<Rightarrow> l t = fst w | u # us \<Rightarrow> (Leaf \<notin> set ts \<and> list_all2 (\<lambda>t u. l t = Suc (r u)) (butlast ts) (tl ts) \<and> (ts = [] \<or> l (last ts) = fst (fst w, r u) \<and> r (hd ts) = snd (fst w, r u))) \<and> l t = Suc (r u)))
[PROOF STEP]
by (auto split: list.splits)


[STATEMENT]
lemma pvar_mult:
  assumes "i \<in> I"
  assumes "j \<in>  I"
  shows "(pvar R i) \<otimes>\<^bsub>Pring R I\<^esub> (pvar R j) = mset_to_IP R {#i, j#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pvar R i \<otimes>\<^bsub>Pring R I\<^esub> pvar R j = mset_to_IP R {#i, j#}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pvar R i \<otimes>\<^bsub>Pring R I\<^esub> pvar R j = mset_to_IP R {#i, j#}
[PROOF STEP]
have "{#i#} + {#j#}  = {# i, j#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#i#} + {#j#} = {#i, j#}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{#i#} + {#j#} = {#i, j#}

goal (1 subgoal):
 1. pvar R i \<otimes>\<^bsub>Pring R I\<^esub> pvar R j = mset_to_IP R {#i, j#}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{#i#} + {#j#} = {#i, j#}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{#i#} + {#j#} = {#i, j#}

goal (1 subgoal):
 1. pvar R i \<otimes>\<^bsub>Pring R I\<^esub> pvar R j = mset_to_IP R {#i, j#}
[PROOF STEP]
unfolding var_to_IP_def
[PROOF STATE]
proof (prove)
using this:
{#i#} + {#j#} = {#i, j#}

goal (1 subgoal):
 1. mset_to_IP R {#i#} \<otimes>\<^bsub>Pring R I\<^esub> mset_to_IP R {#j#} = mset_to_IP R {#i, j#}
[PROOF STEP]
by (metis R.Pring_mult R.monom_mult)
[PROOF STATE]
proof (state)
this:
pvar R i \<otimes>\<^bsub>Pring R I\<^esub> pvar R j = mset_to_IP R {#i, j#}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_model: "0 < n \<Longrightarrow> n < n_vars \<Longrightarrow> int n \<in> set (model_to_dimacs_model M [1..<n_vars]) \<or> - (int n) \<in> set (model_to_dimacs_model M [1..<n_vars])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; n < n_vars\<rbrakk> \<Longrightarrow> int n \<in> set (model_to_dimacs_model M [1..<n_vars]) \<or> - int n \<in> set (model_to_dimacs_model M [1..<n_vars])
[PROOF STEP]
using pos_in_model neg_in_model
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?M ?n; 0 < ?n; ?n < ?n_vars\<rbrakk> \<Longrightarrow> int ?n \<in> set (model_to_dimacs_model ?M [1..<?n_vars])
\<lbrakk>\<not> ?M ?n; 0 < ?n; ?n < ?n_vars\<rbrakk> \<Longrightarrow> - int ?n \<in> set (model_to_dimacs_model ?M [1..<?n_vars])

goal (1 subgoal):
 1. \<lbrakk>0 < n; n < n_vars\<rbrakk> \<Longrightarrow> int n \<in> set (model_to_dimacs_model M [1..<n_vars]) \<or> - int n \<in> set (model_to_dimacs_model M [1..<n_vars])
[PROOF STEP]
by metis


[STATEMENT]
lemma valid_abstractionD[dest]:
  assumes "valid_abstraction A X k"
  shows "(\<forall>(x,m) \<in> clkp_set A. m \<le> k x \<and> x \<in> X \<and> m \<in> \<nat>)" "collect_clkvt A \<subseteq> X" "finite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>(x, m)\<in>PTA.clkp_set A. m \<le> k x \<and> x \<in> X \<and> m \<in> \<nat> &&& PTA.collect_clkvt A \<subseteq> X &&& finite X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
PTA.valid_abstraction A X k

goal (1 subgoal):
 1. \<forall>(x, m)\<in>PTA.clkp_set A. m \<le> k x \<and> x \<in> X \<and> m \<in> \<nat> &&& PTA.collect_clkvt A \<subseteq> X &&& finite X
[PROOF STEP]
unfolding valid_abstraction_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>(x, m)\<in>PTA.clkp_set A. m \<le> k x \<and> x \<in> X \<and> m \<in> \<nat>) \<and> PTA.collect_clkvt A \<subseteq> X \<and> finite X

goal (1 subgoal):
 1. \<forall>(x, m)\<in>PTA.clkp_set A. m \<le> k x \<and> x \<in> X \<and> m \<in> \<nat> &&& PTA.collect_clkvt A \<subseteq> X &&& finite X
[PROOF STEP]
by auto


[STATEMENT]
lemma Ugps_isomorphic:"\<lbrakk>Ugp G; Ugp E\<rbrakk> \<Longrightarrow> G \<cong> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ugp G; Ugp E\<rbrakk> \<Longrightarrow> G \<cong> E
[PROOF STEP]
apply (simp add:isomorphic_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ugp G; Ugp E\<rbrakk> \<Longrightarrow> \<exists>f. gbij\<^bsub>G,E\<^esub> f
[PROOF STEP]
apply (frule_tac Ugp_const_gbij[of "G" "E"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ugp G; Ugp E; gbij\<^bsub>G,E\<^esub> (\<lambda>x\<in>carrier G. \<one>\<^bsub>E\<^esub>)\<rbrakk> \<Longrightarrow> \<exists>f. gbij\<^bsub>G,E\<^esub> f
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma state_separator_from_s_states_code[code] :
  "state_separator_from_s_states M q1 q2 =
    (let C = canonical_separator M q1 q2;
         cs = select_inputs (h C) (initial C) (inputs_as_list C) (remove1 (Inl (q1,q2)) (remove1 (Inr q1) (remove1 (Inr q2) (states_as_list C)))) {Inr q1, Inr q2} []
      in (case length cs of
            0 \<Rightarrow> None |
            _ \<Rightarrow> if fst (last cs) = Inl (q1,q2)
                  then Some (state_separator_from_input_choices M C q1 q2 cs)
                  else None))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. state_separator_from_s_states M q1 q2 = (let C = canonical_separator M q1 q2; cs = select_inputs (FSM.h C) (FSM.initial C) (inputs_as_list C) (remove1 (Inl (q1, q2)) (remove1 (Inr q1) (remove1 (Inr q2) (states_as_list C)))) {Inr q1, Inr q2} [] in case length cs of 0 \<Rightarrow> None | Suc nat \<Rightarrow> if fst (last cs) = Inl (q1, q2) then Some (state_separator_from_input_choices M C q1 q2 cs) else None)
[PROOF STEP]
unfolding s_states_def state_separator_from_s_states_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case length (select_inputs (FSM.h (canonical_separator M q1 q2)) (FSM.initial (canonical_separator M q1 q2)) (inputs_as_list (canonical_separator M q1 q2)) (remove1 (Inl (q1, q2)) (remove1 (Inr q1) (remove1 (Inr q2) (states_as_list (canonical_separator M q1 q2))))) {Inr q1, Inr q2} []) of 0 \<Rightarrow> None | Suc nat \<Rightarrow> if fst (last (select_inputs (FSM.h (canonical_separator M q1 q2)) (FSM.initial (canonical_separator M q1 q2)) (inputs_as_list (canonical_separator M q1 q2)) (remove1 (Inl (q1, q2)) (remove1 (Inr q1) (remove1 (Inr q2) (states_as_list (canonical_separator M q1 q2))))) {Inr q1, Inr q2} [])) = Inl (q1, q2) then Some (state_separator_from_input_choices M (canonical_separator M q1 q2) q1 q2 (select_inputs (FSM.h (canonical_separator M q1 q2)) (FSM.initial (canonical_separator M q1 q2)) (inputs_as_list (canonical_separator M q1 q2)) (remove1 (Inl (q1, q2)) (remove1 (Inr q1) (remove1 (Inr q2) (states_as_list (canonical_separator M q1 q2))))) {Inr q1, Inr q2} [])) else None) = (case length (select_inputs (FSM.h (canonical_separator M q1 q2)) (FSM.initial (canonical_separator M q1 q2)) (inputs_as_list (canonical_separator M q1 q2)) (remove1 (Inl (q1, q2)) (remove1 (Inr q1) (remove1 (Inr q2) (states_as_list (canonical_separator M q1 q2))))) {Inr q1, Inr q2} []) of 0 \<Rightarrow> None | Suc nat \<Rightarrow> if fst (last (select_inputs (FSM.h (canonical_separator M q1 q2)) (FSM.initial (canonical_separator M q1 q2)) (inputs_as_list (canonical_separator M q1 q2)) (remove1 (Inl (q1, q2)) (remove1 (Inr q1) (remove1 (Inr q2) (states_as_list (canonical_separator M q1 q2))))) {Inr q1, Inr q2} [])) = Inl (q1, q2) then Some (state_separator_from_input_choices M (canonical_separator M q1 q2) q1 q2 (select_inputs (FSM.h (canonical_separator M q1 q2)) (FSM.initial (canonical_separator M q1 q2)) (inputs_as_list (canonical_separator M q1 q2)) (remove1 (Inl (q1, q2)) (remove1 (Inr q1) (remove1 (Inr q2) (states_as_list (canonical_separator M q1 q2))))) {Inr q1, Inr q2} [])) else None)
[PROOF STEP]
by simp


[STATEMENT]
lemma [z3_rule]:
  "0 + x = x"
  "x + 0 = x"
  "0 * x = 0"
  "1 * x = x"
  "-x = -1 * x"
  "x + y = y + x"
  for x y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 + x = x &&& x + 0 = x &&& 0 * x = 0) &&& 1 * x = x &&& - x = - 1 * x &&& x + y = y + x
[PROOF STEP]
by auto


[STATEMENT]
lemma norm_blinfun_transfer[transfer_rule]: "(rel_blinfun A A ===> (=)) norm norm"
  if [transfer_rule]: "(A ===> (=)) norm norm" "(rel_set A) UNIV UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_blinfun A A ===> (=)) norm norm
[PROOF STEP]
unfolding norm_blinfun.rep_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_blinfun A A ===> (=)) (\<lambda>x. onorm (blinfun_apply x)) (\<lambda>x. onorm (blinfun_apply x))
[PROOF STEP]
unfolding onorm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_blinfun A A ===> (=)) (\<lambda>x. SUP xa. norm (blinfun_apply x xa) / norm xa) (\<lambda>x. SUP xa. norm (blinfun_apply x xa) / norm xa)
[PROOF STEP]
by transfer_prover


[STATEMENT]
lemma index_zero_implies_same_group_unique: "ps \<subseteq> \<V> \<Longrightarrow> card ps = 2 \<Longrightarrow> \<B> index ps = 0 \<Longrightarrow>
    \<exists>! G \<in> \<G> . ps \<subseteq> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ps \<subseteq> \<V>; card ps = 2; \<B> index ps = 0\<rbrakk> \<Longrightarrow> \<exists>!G. G \<in> \<G> \<and> ps \<subseteq> G
[PROOF STEP]
by (meson GDD.index_zero_implies_same_group GDD_axioms card_2_iff' group_design.point_in_one_group
      group_design_axioms in_mono)


[STATEMENT]
lemma pop_list_tl: "\<lbrakk>0 < size big; invar big; Big.pop big = (x, big')\<rbrakk>
   \<Longrightarrow> Big.list big' = tl (Big.list big)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < size big; invar big; Big.pop big = (x, big')\<rbrakk> \<Longrightarrow> Big.list big' = tl (Big.list big)
[PROOF STEP]
using pop_list cons_tl[of x "list big'" "list big"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < size ?big; invar ?big; Big.pop ?big = (?x, ?big')\<rbrakk> \<Longrightarrow> ?x # Big.list ?big' = Big.list ?big
x # Big.list big' = Big.list big \<Longrightarrow> Big.list big' = tl (Big.list big)

goal (1 subgoal):
 1. \<lbrakk>0 < size big; invar big; Big.pop big = (x, big')\<rbrakk> \<Longrightarrow> Big.list big' = tl (Big.list big)
[PROOF STEP]
by force


[STATEMENT]
lemma int_word_sint:
  \<open>sint (word_of_int x :: 'a::len word) = (x + 2 ^ (LENGTH('a) - 1)) mod 2 ^ LENGTH('a) - 2 ^ (LENGTH('a) - 1)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sint (word_of_int x) = (x + 2 ^ (LENGTH('a) - 1)) mod 2 ^ LENGTH('a) - 2 ^ (LENGTH('a) - 1)
[PROOF STEP]
by transfer (simp flip: take_bit_eq_mod add: signed_take_bit_eq_take_bit_shift)


[STATEMENT]
lemma Top_le_conv:  "\<lbrakk> order r A; top r T; x \<in> A; T \<in> A \<rbrakk> \<Longrightarrow> (T \<sqsubseteq>\<^sub>r x) = (x = T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; Semilat.top r T; x \<in> A; T \<in> A\<rbrakk> \<Longrightarrow> (T \<sqsubseteq>\<^bsub>r\<^esub> x) = (x = T)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; Semilat.top r T; x \<in> A; T \<in> A\<rbrakk> \<Longrightarrow> (T \<sqsubseteq>\<^bsub>r\<^esub> x) = (x = T)
[PROOF STEP]
apply (unfold top_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r A; \<forall>x. x \<sqsubseteq>\<^bsub>r\<^esub> T; x \<in> A; T \<in> A\<rbrakk> \<Longrightarrow> (T \<sqsubseteq>\<^bsub>r\<^esub> x) = (x = T)
[PROOF STEP]
apply (blast intro: order_antisym)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma SIGMA_image_vimage:
  "snd ` (SIGMA x:f`X. f -` {x} \<inter> X) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd ` (SIGMA x:f ` X. f -` {x} \<inter> X) = X
[PROOF STEP]
by (auto simp: image_iff)


[STATEMENT]
lemma frac_neg: "frac (- x) = (if x \<in> \<int> then 0 else 1 - frac x)"
  for x :: "'a::floor_ceiling"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frac (- x) = (if x \<in> \<int> then 0::'a else (1::'a) - frac x)
[PROOF STEP]
apply (auto simp add: frac_unique_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<notin> \<int> \<Longrightarrow> - x - ((1::'a) - frac x) \<in> \<int>
 2. x \<notin> \<int> \<Longrightarrow> frac x \<le> (1::'a)
[PROOF STEP]
apply (simp add: frac_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> \<int> \<Longrightarrow> frac x \<le> (1::'a)
[PROOF STEP]
apply (meson frac_lt_1 less_iff_diff_less_0 not_le not_less_iff_gr_or_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inf_not_le_Le[simp]: "\<infinity> \<le> Le x = False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<infinity> \<le> Le x) = False
[PROOF STEP]
unfolding less_eq dbm_le_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<infinity> \<prec> Le x \<or> \<infinity> = Le x) = False
[PROOF STEP]
by auto


[STATEMENT]
lemma closedin_Euclidean_imp_closed: "closedin (Euclidean_space m) S \<Longrightarrow> closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (Euclidean_space m) S \<Longrightarrow> closed S
[PROOF STEP]
by (metis Euclidean_space_def closed_closedin closedin_Euclidean_space closedin_closed_subtopology euclidean_product_topology topspace_Euclidean_space)


[STATEMENT]
lemma "f \<in> (\<lambda>u v. b \<times> u \<times> v) ` A \<Longrightarrow> \<forall>u v. P (b \<times> u \<times> v) \<Longrightarrow> P(f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> (\<lambda>u v. b \<times> u \<times> v) ` A; \<forall>u v. P (b \<times> u \<times> v)\<rbrakk> \<Longrightarrow> P (f y)
[PROOF STEP]
by (metis (lifting) imageE)


[STATEMENT]
lemma diff_inv_eq_inv_set:
  "diff_invariant I (\<lambda>t. f) (\<lambda>s. T) S 0 (\<lambda>s. True) = (\<forall>s. I s \<longrightarrow> \<gamma>\<^sup>\<phi> s \<subseteq> {s. I s})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diff_invariant I (\<lambda>t. f) (\<lambda>s. T) S 0 (\<lambda>s. True) = (\<forall>s. I s \<longrightarrow> \<gamma>\<^sup>\<phi> s \<subseteq> {s. I s})
[PROOF STEP]
unfolding diff_inv_eq_inv_set orbit_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s. I s \<longrightarrow> x\<acute>=\<lambda>t. f & \<lambda>s. True on \<lambda>s. T S @ 0 s \<subseteq> Collect I) = (\<forall>s. I s \<longrightarrow> x\<acute>=\<lambda>t. f & \<lambda>s. True on \<lambda>s. T S @ 0 s \<subseteq> {s. I s})
[PROOF STEP]
by simp


[STATEMENT]
lemma TC: "TC a = a \<squnion> \<Squnion> (TC ` elts a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. TC a = a \<squnion> \<Squnion> (TC ` elts a)
[PROOF STEP]
by (metis (no_types, lifting) SUP_cong TC_def restrict_apply' transrec)


[STATEMENT]
lemma of_qr_scale:
  "of_qr (to_module s * b) =
  Polynomial.smult (of_int_mod_ring s) (of_qr b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_qr (to_module s * b) = Polynomial.smult (of_int_mod_ring s) (of_qr b)
[PROOF STEP]
unfolding to_module_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_qr (to_qr (Poly [of_int_mod_ring s]) * b) = Polynomial.smult (of_int_mod_ring s) (of_qr b)
[PROOF STEP]
by (auto simp add: of_qr_mult[of "to_qr [:of_int_mod_ring s:]" "b"]
  of_qr_to_qr) (simp add: mod_mult_left_eq mod_smult_left of_qr.rep_eq)


[STATEMENT]
lemma sum_wt_ParT_notWtFT_notFinished[simp]:
assumes cl: "properL cl" and nf: "WtFT cl \<noteq> 1"
and n: "n < length cl" and cln: "\<not> finished (cl!n)"
shows
"sum (wt (ParT cl) s) {brnL cl n ..<+ brn (cl!n)} =
 (1 / (length cl)) / (1 - WtFT cl) *
 sum (wt (cl ! n) s) {..< brn (cl ! n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (wt (ParT cl) s) {brnL cl n..<brnL cl n + brn (cl ! n)} = 1 / real (length cl) / (1 - WtFT cl) * sum (wt (cl ! n) s) {..<brn (cl ! n)}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum (wt (ParT cl) s) {brnL cl n..<brnL cl n + brn (cl ! n)} = 1 / real (length cl) / (1 - WtFT cl) * sum (wt (cl ! n) s) {..<brn (cl ! n)}
[PROOF STEP]
have 1: "{brnL cl n ..<+ brn (cl!n)} = (+) (brnL cl n) ` {..< brn (cl!n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {brnL cl n..<brnL cl n + brn (cl ! n)} = (+) (brnL cl n) ` {..<brn (cl ! n)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{brnL cl n..<brnL cl n + brn (cl ! n)} = (+) (brnL cl n) ` {..<brn (cl ! n)}

goal (1 subgoal):
 1. sum (wt (ParT cl) s) {brnL cl n..<brnL cl n + brn (cl ! n)} = 1 / real (length cl) / (1 - WtFT cl) * sum (wt (cl ! n) s) {..<brn (cl ! n)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (wt (ParT cl) s) {brnL cl n..<brnL cl n + brn (cl ! n)} = 1 / real (length cl) / (1 - WtFT cl) * sum (wt (cl ! n) s) {..<brn (cl ! n)}
[PROOF STEP]
unfolding 1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (wt (ParT cl) s) ((+) (brnL cl n) ` {..<brn (cl ! n)}) = 1 / real (length cl) / (1 - WtFT cl) * sum (wt (cl ! n) s) {..<brn (cl ! n)}
[PROOF STEP]
apply(rule sum_wt_ParT_sub_notWtFT_notFinished)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. properL cl
 2. WtFT cl \<noteq> 1
 3. n < length cl
 4. \<not> finished (cl ! n)
 5. {..<brn (cl ! n)} \<subseteq> {..<brn (cl ! n)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
properL cl
WtFT cl \<noteq> 1
n < length cl
\<not> finished (cl ! n)

goal (5 subgoals):
 1. properL cl
 2. WtFT cl \<noteq> 1
 3. n < length cl
 4. \<not> finished (cl ! n)
 5. {..<brn (cl ! n)} \<subseteq> {..<brn (cl ! n)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum (wt (ParT cl) s) {brnL cl n..<brnL cl n + brn (cl ! n)} = 1 / real (length cl) / (1 - WtFT cl) * sum (wt (cl ! n) s) {..<brn (cl ! n)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "filterlim (\<lambda>x::real. (1 + 3 / x) powr x) (at_left (exp 3)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. (1 + 3 / x) powr x :> at_left (exp 3)
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma vangle_scaleR_self:
  "vangle (k *\<^sub>R v) v = (if k = 0 \<or> v = 0 then pi / 2 else if k > 0 then 0 else pi)"
  "vangle v (k *\<^sub>R v) = (if k = 0 \<or> v = 0 then pi / 2 else if k > 0 then 0 else pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle (k *\<^sub>R v) v = (if k = 0 \<or> v = (0::'a) then pi / 2 else if 0 < k then 0 else pi) &&& vangle v (k *\<^sub>R v) = (if k = 0 \<or> v = (0::'a) then pi / 2 else if 0 < k then 0 else pi)
[PROOF STEP]
by (auto simp: vangle_def dot_square_norm power2_eq_square)


[STATEMENT]
lemma remaining_steps_step [simp]: "\<lbrakk>invar (big :: 'a state); remaining_steps big > 0\<rbrakk>
   \<Longrightarrow> Suc (remaining_steps (step big)) = remaining_steps big"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar big; 0 < remaining_steps big\<rbrakk> \<Longrightarrow> Suc (remaining_steps (step big)) = remaining_steps big
[PROOF STEP]
by(induction big rule: step_state.induct)(auto split: current.splits)


[STATEMENT]
lemma partition_factors_main: "partition_factors_main s xs = (a,b) \<Longrightarrow> mset xs = mset a + mset b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_factors_main s xs = (a, b) \<Longrightarrow> mset xs = mset a + mset b
[PROOF STEP]
by (induct s xs arbitrary: a b rule: partition_factors_main.induct, auto split: if_splits prod.splits)


[STATEMENT]
lemma (in comm_monoid) divides_unit:
  assumes udvd: "a divides u"
    and  carr: "a \<in> carrier G"  "u \<in> Units G"
  shows "a \<in> Units G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> Units G
[PROOF STEP]
using udvd carr
[PROOF STATE]
proof (prove)
using this:
a divides u
a \<in> carrier G
u \<in> Units G

goal (1 subgoal):
 1. a \<in> Units G
[PROOF STEP]
by (blast intro: unit_factor)


[STATEMENT]
lemma UINF_mem_UNIV [simp]: "(\<Sqinter> x\<in>UNIV \<bullet> P(x)) = (\<Sqinter> x \<bullet> P(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> x \<in> UNIV \<bullet> P x) = (\<Sqinter> x \<bullet> P x)
[PROOF STEP]
by (pred_auto)


[STATEMENT]
lemma ereal_minus_minus_image[simp]:
  fixes S :: "ereal set"
  shows "uminus ` uminus ` S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uminus ` uminus ` S = S
[PROOF STEP]
by (auto simp: image_iff)


[STATEMENT]
lemma supp_append:
  shows "supp (xs @ ys) = supp xs \<union> supp ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (xs @ ys) = supp xs \<union> supp ys
[PROOF STEP]
by (induct xs) (auto simp: supp_Nil supp_Cons)


[STATEMENT]
lemma length_stake[simp]: "length (stake n s) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (stake n s) = n
[PROOF STEP]
by (induct n arbitrary: s) auto


[STATEMENT]
lemma lq_trans: "u \<le>p v \<Longrightarrow> v \<le>p w \<Longrightarrow> (u\<inverse>\<^sup>>v) \<cdot> (v\<inverse>\<^sup>>w) = u\<inverse>\<^sup>>w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<le>p v; v \<le>p w\<rbrakk> \<Longrightarrow> u\<inverse>\<^sup>>v \<cdot> v\<inverse>\<^sup>>w = u\<inverse>\<^sup>>w
[PROOF STEP]
by (auto simp add: prefix_def)


[STATEMENT]
lemma Arg2pi_of_real: "Arg2pi (of_real r) = (if r<0 then pi else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg2pi (complex_of_real r) = (if r < 0 then pi else 0)
[PROOF STEP]
using Arg2pi_eq_0_pi Arg2pi_eq_pi
[PROOF STATE]
proof (prove)
using this:
(Arg2pi ?z = 0 \<or> Arg2pi ?z = pi) = (?z \<in> \<real>)
(Arg2pi ?z = pi) = (?z \<in> \<real> \<and> Re ?z < 0)

goal (1 subgoal):
 1. Arg2pi (complex_of_real r) = (if r < 0 then pi else 0)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sqsubset_is_subset: "A \<sqsubseteq> B \<longleftrightarrow> A \<subseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<sqsubseteq> B) = (A \<subseteq> B)
[PROOF STEP]
by (fact below_set_def)


[STATEMENT]
lemma FindPreHNF_echelon_form:
  assumes A_def: "A = A'' @\<^sub>r D \<cdot>\<^sub>m 1\<^sub>m n"
    and A'': "A'' \<in> carrier_mat m n" and mn: "m\<ge>n" and D: "D>0"
  shows "echelon_form_JNF (FindPreHNF abs_flag D A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
have A: "A \<in> carrier_mat (m+n) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat (m + n) n
[PROOF STEP]
using A_def A''
[PROOF STATE]
proof (prove)
using this:
A = A'' @\<^sub>r D \<cdot>\<^sub>m 1\<^sub>m n
A'' \<in> carrier_mat m n

goal (1 subgoal):
 1. A \<in> carrier_mat (m + n) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat (m + n) n

goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
have FindPreHNF: "(FindPreHNF abs_flag D A) \<in> carrier_mat (m+n) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FindPreHNF abs_flag D A \<in> carrier_mat (m + n) n
[PROOF STEP]
by (rule FindPreHNF[OF A])
[PROOF STATE]
proof (state)
this:
FindPreHNF abs_flag D A \<in> carrier_mat (m + n) n

goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
proof (cases "m+n<2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m + n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
 2. \<not> m + n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m + n < 2

goal (2 subgoals):
 1. m + n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
 2. \<not> m + n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
by (rule echelon_form_JNF_1xn[OF FindPreHNF True])
[PROOF STATE]
proof (state)
this:
echelon_form_JNF (FindPreHNF abs_flag D A)

goal (1 subgoal):
 1. \<not> m + n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> m + n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> m + n < 2

goal (1 subgoal):
 1. \<not> m + n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
note m_ge2 = False
[PROOF STATE]
proof (state)
this:
\<not> m + n < 2

goal (1 subgoal):
 1. \<not> m + n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
proof (cases "n<2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
 2. \<not> n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n < 2

goal (2 subgoals):
 1. n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
 2. \<not> n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
by (rule FindPreHNF_echelon_form_mx1[OF A_def A'' True D mn])
[PROOF STATE]
proof (state)
this:
echelon_form_JNF (FindPreHNF abs_flag D A)

goal (1 subgoal):
 1. \<not> n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> n < 2

goal (1 subgoal):
 1. \<not> n < 2 \<Longrightarrow> echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_JNF (FindPreHNF abs_flag D A)
[PROOF STEP]
by (rule FindPreHNF_echelon_form_n_ge2[OF A_def A'' _ mn D], insert False, auto)
[PROOF STATE]
proof (state)
this:
echelon_form_JNF (FindPreHNF abs_flag D A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
echelon_form_JNF (FindPreHNF abs_flag D A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
echelon_form_JNF (FindPreHNF abs_flag D A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_on_ctble_discont_open:
  fixes f :: "real \<Rightarrow> real"
  fixes A :: "real set"
  assumes "open A" "mono_on A f"
  shows "countable {a\<in>A. \<not>isCont f a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable {a \<in> A. \<not> isCont f a}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable {a \<in> A. \<not> isCont f a}
[PROOF STEP]
have "{a\<in>A. \<not>isCont f a} = {a\<in>A. \<not>(continuous (at a within A) f)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> A. \<not> isCont f a} = {a \<in> A. \<not> continuous (at a within A) f}
[PROOF STEP]
by (auto simp add: continuous_within_open [OF _ \<open>open A\<close>])
[PROOF STATE]
proof (state)
this:
{a \<in> A. \<not> isCont f a} = {a \<in> A. \<not> continuous (at a within A) f}

goal (1 subgoal):
 1. countable {a \<in> A. \<not> isCont f a}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{a \<in> A. \<not> isCont f a} = {a \<in> A. \<not> continuous (at a within A) f}

goal (1 subgoal):
 1. countable {a \<in> A. \<not> isCont f a}
[PROOF STEP]
apply (elim ssubst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable {a \<in> A. \<not> continuous (at a within A) f}
[PROOF STEP]
by (rule mono_on_ctble_discont, rule assms)
[PROOF STATE]
proof (state)
this:
countable {a \<in> A. \<not> isCont f a}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simplicial_subdivision_diff:
   "simplicial_subdivision p (c1-c2) = simplicial_subdivision p c1 - simplicial_subdivision p c2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_subdivision p (c1 - c2) = simplicial_subdivision p c1 - simplicial_subdivision p c2
[PROOF STEP]
by (induction p) (auto simp: frag_extend_diff)


[STATEMENT]
lemma lmirror_aux_LCons:
  "lmirror_aux acc (LCons x xs) = LCons x (lappend (lmirror_aux LNil xs) (LCons x acc))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lmirror_aux acc (LCons x xs) = LCons x (lappend (lmirror_aux LNil xs) (LCons x acc))
[PROOF STEP]
by (metis lappend_code(1) lmirror_aux_acc lmirror_aux_simps(2))


[STATEMENT]
lemma borel_measurable_has_bochner_integral'[measurable_dest]:
  "has_bochner_integral M f x \<Longrightarrow> g \<in> measurable N M \<Longrightarrow> (\<lambda>x. f (g x)) \<in> borel_measurable N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>has_bochner_integral M f x; g \<in> N \<rightarrow>\<^sub>M M\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x)) \<in> borel_measurable N
[PROOF STEP]
using borel_measurable_has_bochner_integral[measurable]
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral ?M ?f ?x \<Longrightarrow> ?f \<in> borel_measurable ?M

goal (1 subgoal):
 1. \<lbrakk>has_bochner_integral M f x; g \<in> N \<rightarrow>\<^sub>M M\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x)) \<in> borel_measurable N
[PROOF STEP]
by measurable


[STATEMENT]
lemma eval\<^sub>G_Or_map:
  "eval\<^sub>G S (Or xs) = Or (map (eval\<^sub>G S) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval\<^sub>G S (Or xs) = Or (map (eval\<^sub>G S) xs)
[PROOF STEP]
proof (induction xs rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. eval\<^sub>G S (Or []) = Or (map (eval\<^sub>G S) [])
 2. \<And>x xs. eval\<^sub>G S (Or xs) = Or (map (eval\<^sub>G S) xs) \<Longrightarrow> eval\<^sub>G S (Or (xs @ [x])) = Or (map (eval\<^sub>G S) (xs @ [x]))
[PROOF STEP]
case (snoc x xs)
[PROOF STATE]
proof (state)
this:
eval\<^sub>G S (Or xs) = Or (map (eval\<^sub>G S) xs)

goal (2 subgoals):
 1. eval\<^sub>G S (Or []) = Or (map (eval\<^sub>G S) [])
 2. \<And>x xs. eval\<^sub>G S (Or xs) = Or (map (eval\<^sub>G S) xs) \<Longrightarrow> eval\<^sub>G S (Or (xs @ [x])) = Or (map (eval\<^sub>G S) (xs @ [x]))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
eval\<^sub>G S (Or xs) = Or (map (eval\<^sub>G S) xs)

goal (1 subgoal):
 1. eval\<^sub>G S (Or (xs @ [x])) = Or (map (eval\<^sub>G S) (xs @ [x]))
[PROOF STEP]
by (cases xs) simp+
[PROOF STATE]
proof (state)
this:
eval\<^sub>G S (Or (xs @ [x])) = Or (map (eval\<^sub>G S) (xs @ [x]))

goal (1 subgoal):
 1. eval\<^sub>G S (Or []) = Or (map (eval\<^sub>G S) [])
[PROOF STEP]
qed simp


[STATEMENT]
lemma mod_cut_greater_aux_le_x: "
  \<lbrakk> (r::nat) \<le> t; t < x; x mod m = r mod m\<rbrakk> \<Longrightarrow>
  t + m - (t - r) mod m \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> t; t < x; x mod m = r mod m\<rbrakk> \<Longrightarrow> t + m - (t - r) mod m \<le> x
[PROOF STEP]
apply (insert diff_mod_le[of t r m])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> t; t < x; x mod m = r mod m; (t - r) mod m \<le> t\<rbrakk> \<Longrightarrow> t + m - (t - r) mod m \<le> x
[PROOF STEP]
apply (subst diff_add_assoc2, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> t; t < x; x mod m = r mod m; (t - r) mod m \<le> t\<rbrakk> \<Longrightarrow> t - (t - r) mod m + m \<le> x
[PROOF STEP]
apply (rule less_mod_eq_imp_add_divisor_le, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> t; t < x; x mod m = r mod m; (t - r) mod m \<le> t\<rbrakk> \<Longrightarrow> (t - (t - r) mod m) mod m = x mod m
[PROOF STEP]
apply (simp add: sub_diff_mod_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma from_FSM_product_inputs :
  assumes "q1 \<in> states M" and "q2 \<in> states M"
shows "(inputs (product (from_FSM M q1) (from_FSM M q2))) = (inputs M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FSM.inputs (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) = FSM.inputs M
[PROOF STEP]
by (simp add: assms(1) assms(2))


[STATEMENT]
lemma permutationNotEmpty:
  assumes "l \<noteq> []"
  shows "perm2 l n \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perm2 l n \<noteq> []
[PROOF STEP]
using assms perm2.simps(2) rotate_is_Nil_conv
[PROOF STATE]
proof (prove)
using this:
l \<noteq> []
perm2 (?x # ?l) = (\<lambda>n. rotateLeft (length (?x # rotateLeft (n mod (1 + length ?l)) (perm2 ?l (n div (1 + length ?l)))) - n mod (1 + length ?l) mod length (?x # rotateLeft (n mod (1 + length ?l)) (perm2 ?l (n div (1 + length ?l))))) (?x # rotateLeft (n mod (1 + length ?l)) (perm2 ?l (n div (1 + length ?l)))))
(rotateLeft ?n ?xs = []) = (?xs = [])

goal (1 subgoal):
 1. perm2 l n \<noteq> []
[PROOF STEP]
by (metis neq_Nil_conv)


[STATEMENT]
lemma prod_coprime_left:
  "coprime (\<Prod>i\<in>A. f i) a" if "\<And>i. i \<in> A \<Longrightarrow> coprime (f i) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (prod f A) a
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
?i1 \<in> A \<Longrightarrow> coprime (f ?i1) a

goal (1 subgoal):
 1. coprime (prod f A) a
[PROOF STEP]
by (induct A rule: infinite_finite_induct) simp_all


[STATEMENT]
lemma prefixeq_butlast: "prefix (butlast xs) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix (butlast xs) xs
[PROOF STEP]
by (simp add: butlast_conv_take take_is_prefix)


[STATEMENT]
lemma acyclic_insert_cyclic: "\<lbrakk>acyclic g; \<not>acyclic (insert (x,y) g)\<rbrakk> \<Longrightarrow> (y,x)\<in>g\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>acyclic g; \<not> acyclic (insert (x, y) g)\<rbrakk> \<Longrightarrow> (y, x) \<in> g\<^sup>*
[PROOF STEP]
by (unfold acyclic_def) (auto simp add: trancl_insert)


[STATEMENT]
lemma ideal_generated_singleton_dvd:
  assumes i: "ideal_generated S = ideal_generated {d}" and x: "x \<in> S"
  shows "d dvd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd x
[PROOF STEP]
by (metis i x finite.intros dvd_ideal_generated_singleton
      ideal_generated_in ideal_generated_singleton_subset)


[STATEMENT]
lemma finished_not_finished_imp_back_edge:
    "\<lbrakk>w \<in> succ v; v \<in> dom (finished s); w \<in> dom (discovered s);
      w \<notin> dom (finished s);
      \<delta> s w \<le> \<delta> s v\<rbrakk>
     \<Longrightarrow> (v, w) \<in> back_edges s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<in> E `` {v}; v \<in> dom (finished s); w \<in> dom (discovered s); w \<notin> dom (finished s); \<delta> s w \<le> \<delta> s v\<rbrakk> \<Longrightarrow> (v, w) \<in> back_edges s
[PROOF STEP]
using disc_imp_back_edge_or_pending finished_discovered finished_no_pending
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> E `` {?v}; ?v \<in> dom (discovered s); ?w \<in> dom (discovered s); \<delta> s ?w \<le> \<delta> s ?v; ?w \<in> dom (finished s) \<Longrightarrow> ?v \<in> dom (finished s) \<and> \<phi> s ?v \<le> \<phi> s ?w\<rbrakk> \<Longrightarrow> (?v, ?w) \<in> back_edges s \<or> (?v, ?w) \<in> pending s
dom (finished s) \<subseteq> dom (discovered s)
?v \<in> dom (finished s) \<Longrightarrow> pending s `` {?v} = {}

goal (1 subgoal):
 1. \<lbrakk>w \<in> E `` {v}; v \<in> dom (finished s); w \<in> dom (discovered s); w \<notin> dom (finished s); \<delta> s w \<le> \<delta> s v\<rbrakk> \<Longrightarrow> (v, w) \<in> back_edges s
[PROOF STEP]
by fast


[STATEMENT]
lemma inj_vint_of_int: "inj vint_of_int"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj vint_of_int
[PROOF STEP]
using inj_vreal_of_real
[PROOF STATE]
proof (prove)
using this:
inj vreal_of_real

goal (1 subgoal):
 1. inj vint_of_int
[PROOF STEP]
unfolding vint_of_int_def inj_def of_int_eq_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x\<^sub>\<real> = y\<^sub>\<real> \<longrightarrow> x = y

goal (1 subgoal):
 1. \<forall>x y. (real_of_int x)\<^sub>\<real> = (real_of_int y)\<^sub>\<real> \<longrightarrow> x = y
[PROOF STEP]
by force


[STATEMENT]
lemma pos_length: "pos a xs = Some i \<Longrightarrow> i < length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos a xs = Some i \<Longrightarrow> i < length xs
[PROOF STEP]
by (induction a xs arbitrary: i rule: pos.induct) (auto split: if_splits option.splits)


[STATEMENT]
lemma isCont_Si: "isCont Si x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont Si x
[PROOF STEP]
using DERIV_Si
[PROOF STATE]
proof (prove)
using this:
(Si has_real_derivative sinc ?x) (at ?x)

goal (1 subgoal):
 1. isCont Si x
[PROOF STEP]
by (rule DERIV_isCont)


[STATEMENT]
lemma image_Pair_const: "(\<lambda>x. (x, c)) ` A = A \<times> {c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (x, c)) ` A = A \<times> {c}
[PROOF STEP]
by auto


[STATEMENT]
lemma arc_ends_blocks_subset: "E \<subseteq> arcs G \<Longrightarrow> (x, y) \<in> ((arc_to_ends G) ` E) \<Longrightarrow>
  {x, y} \<in> (arc_to_block ` E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>E \<subseteq> arcs G; (x, y) \<in> arc_to_ends G ` E\<rbrakk> \<Longrightarrow> {x, y} \<in> arc_to_block ` E
[PROOF STEP]
by (auto simp add: arc_to_ends_def arc_to_block_def )


[STATEMENT]
lemma closure_of_Times:
   "(prod_topology X Y) closure_of (S \<times> T) = (X closure_of S) \<times> (Y closure_of T)"  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_topology X Y closure_of S \<times> T = (X closure_of S) \<times> Y closure_of T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. prod_topology X Y closure_of S \<times> T \<subseteq> (X closure_of S) \<times> Y closure_of T
 2. (X closure_of S) \<times> Y closure_of T \<subseteq> prod_topology X Y closure_of S \<times> T
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_topology X Y closure_of S \<times> T \<subseteq> (X closure_of S) \<times> Y closure_of T
[PROOF STEP]
by (clarsimp simp: closure_of_def openin_prod_topology_alt) blast
[PROOF STATE]
proof (state)
this:
prod_topology X Y closure_of S \<times> T \<subseteq> (X closure_of S) \<times> Y closure_of T

goal (1 subgoal):
 1. (X closure_of S) \<times> Y closure_of T \<subseteq> prod_topology X Y closure_of S \<times> T
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X closure_of S) \<times> Y closure_of T \<subseteq> prod_topology X Y closure_of S \<times> T
[PROOF STEP]
by (clarsimp simp: closure_of_def openin_prod_topology_alt) (meson SigmaI subsetD)
[PROOF STATE]
proof (state)
this:
(X closure_of S) \<times> Y closure_of T \<subseteq> prod_topology X Y closure_of S \<times> T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cons_less_Conss [simp]:
  "x#xs [\<sqsubset>\<^sub>r] y#ys = (x \<sqsubset>\<^sub>r y \<and> xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys \<or> x = y \<and> xs [\<sqsubset>\<^sub>r] ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs [\<sqsubset>\<^bsub>r\<^esub>] y # ys) = (x \<sqsubset>\<^bsub>r\<^esub> y \<and> xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys \<or> x = y \<and> xs [\<sqsubset>\<^bsub>r\<^esub>] ys)
[PROOF STEP]
apply (unfold lesssub_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs [\<sqsubseteq>\<^bsub>r\<^esub>] y # ys \<and> x # xs \<noteq> y # ys) = ((x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> x \<noteq> y) \<and> xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys \<or> x = y \<and> xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys \<and> xs \<noteq> ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = y; xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys; xs \<noteq> ys\<rbrakk> \<Longrightarrow> y \<sqsubseteq>\<^bsub>r\<^esub> y
[PROOF STEP]
apply (unfold lesssub_def lesub_def r_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = y; Listn.le nodes_le xs ys; xs \<noteq> ys\<rbrakk> \<Longrightarrow> nodes_le y y
[PROOF STEP]
apply (simp only: nodes_le_refl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sset_smerge: "sset (smerge ss) = \<Union>(sset ` (sset ss))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sset (smerge ss) = \<Union> (sset ` sset ss)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> sset (smerge ss) \<Longrightarrow> x \<in> \<Union> (sset ` sset ss)
 2. \<And>x xa. \<lbrakk>xa \<in> sset ss; x \<in> sset xa\<rbrakk> \<Longrightarrow> x \<in> sset (smerge ss)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> sset (smerge ss) \<Longrightarrow> x \<in> \<Union> (sset ` sset ss)
 2. \<And>x xa. \<lbrakk>xa \<in> sset ss; x \<in> sset xa\<rbrakk> \<Longrightarrow> x \<in> sset (smerge ss)
[PROOF STEP]
assume "x \<in> sset (smerge ss)"
[PROOF STATE]
proof (state)
this:
x \<in> sset (smerge ss)

goal (2 subgoals):
 1. \<And>x. x \<in> sset (smerge ss) \<Longrightarrow> x \<in> \<Union> (sset ` sset ss)
 2. \<And>x xa. \<lbrakk>xa \<in> sset ss; x \<in> sset xa\<rbrakk> \<Longrightarrow> x \<in> sset (smerge ss)
[PROOF STEP]
thus "x \<in> \<Union>(sset ` (sset ss))"
[PROOF STATE]
proof (prove)
using this:
x \<in> sset (smerge ss)

goal (1 subgoal):
 1. x \<in> \<Union> (sset ` sset ss)
[PROOF STEP]
unfolding smerge_def
[PROOF STATE]
proof (prove)
using this:
x \<in> sset (flat (smap (\<lambda>n. map (\<lambda>s. s !! n) (stake (Suc n) ss) @ stake n (ss !! n)) nats))

goal (1 subgoal):
 1. x \<in> \<Union> (sset ` sset ss)
[PROOF STEP]
by (subst (asm) sset_flat)
      (auto simp: stream.set_map in_set_conv_nth sset_range simp del: stake.simps, fast+)
[PROOF STATE]
proof (state)
this:
x \<in> \<Union> (sset ` sset ss)

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>xa \<in> sset ss; x \<in> sset xa\<rbrakk> \<Longrightarrow> x \<in> sset (smerge ss)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>xa \<in> sset ss; x \<in> sset xa\<rbrakk> \<Longrightarrow> x \<in> sset (smerge ss)
[PROOF STEP]
fix s x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>xa \<in> sset ss; x \<in> sset xa\<rbrakk> \<Longrightarrow> x \<in> sset (smerge ss)
[PROOF STEP]
assume "s \<in> sset ss" "x \<in> sset s"
[PROOF STATE]
proof (state)
this:
s \<in> sset ss
x \<in> sset s

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>xa \<in> sset ss; x \<in> sset xa\<rbrakk> \<Longrightarrow> x \<in> sset (smerge ss)
[PROOF STEP]
thus "x \<in> sset (smerge ss)"
[PROOF STATE]
proof (prove)
using this:
s \<in> sset ss
x \<in> sset s

goal (1 subgoal):
 1. x \<in> sset (smerge ss)
[PROOF STEP]
using snth_sset_smerge
[PROOF STATE]
proof (prove)
using this:
s \<in> sset ss
x \<in> sset s
?ss !! ?n !! ?m \<in> sset (smerge ?ss)

goal (1 subgoal):
 1. x \<in> sset (smerge ss)
[PROOF STEP]
by (auto simp: sset_range)
[PROOF STATE]
proof (state)
this:
x \<in> sset (smerge ss)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nact_exists:
  fixes t::"nat \<Rightarrow> cnf"
  assumes "\<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub>"
  shows "\<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> (\<nexists>k. n\<le>k \<and> k<i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> \<not> (\<exists>k\<ge>n. k < i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> \<not> (\<exists>k\<ge>n. k < i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
let ?L = "LEAST i. (i\<ge>n \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> \<not> (\<exists>k\<ge>n. k < i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub>
[PROOF STEP]
have "?L\<ge>n \<and> \<parallel>c\<parallel>\<^bsub>t ?L\<^esub>"
[PROOF STATE]
proof (prove)
using this:
\<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub>

goal (1 subgoal):
 1. n \<le> (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>)\<^esub>
[PROOF STEP]
using LeastI[of "\<lambda>x::nat. (x\<ge>n \<and> \<parallel>c\<parallel>\<^bsub>t x\<^esub>)"]
[PROOF STATE]
proof (prove)
using this:
\<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub>
n \<le> ?k \<and> \<parallel>c\<parallel>\<^bsub>t ?k\<^esub> \<Longrightarrow> n \<le> (LEAST x. n \<le> x \<and> \<parallel>c\<parallel>\<^bsub>t x\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t (LEAST x. n \<le> x \<and> \<parallel>c\<parallel>\<^bsub>t x\<^esub>)\<^esub>

goal (1 subgoal):
 1. n \<le> (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>)\<^esub>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n \<le> (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>)\<^esub>

goal (1 subgoal):
 1. \<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> \<not> (\<exists>k\<ge>n. k < i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n \<le> (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>)\<^esub>

goal (1 subgoal):
 1. \<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> \<not> (\<exists>k\<ge>n. k < i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
have "\<nexists>k. n\<le>k \<and> k<?L \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>k\<ge>n. k < (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
using not_less_Least
[PROOF STATE]
proof (prove)
using this:
?k < (LEAST x. ?P x) \<Longrightarrow> \<not> ?P ?k

goal (1 subgoal):
 1. \<not> (\<exists>k\<ge>n. k < (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>k\<ge>n. k < (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)

goal (1 subgoal):
 1. \<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> \<not> (\<exists>k\<ge>n. k < i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n \<le> (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>)\<^esub>
\<not> (\<exists>k\<ge>n. k < (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>)\<^esub>
\<not> (\<exists>k\<ge>n. k < (LEAST i. n \<le> i \<and> \<parallel>c\<parallel>\<^bsub>t i\<^esub>) \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)

goal (1 subgoal):
 1. \<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> \<not> (\<exists>k\<ge>n. k < i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>i\<ge>n. \<parallel>c\<parallel>\<^bsub>t i\<^esub> \<and> \<not> (\<exists>k\<ge>n. k < i \<and> \<parallel>c\<parallel>\<^bsub>t k\<^esub>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Some_one_point2 [simp]:
 "\<lbrakk> Q a; P a \<rbrakk> \<Longrightarrow> (SOME x. P x \<and> Q x \<and> x = a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Q a; P a\<rbrakk> \<Longrightarrow> (SOME x. P x \<and> Q x \<and> x = a) = a
[PROOF STEP]
by auto


[STATEMENT]
lemma sorted_transpose[simp]: "sorted (rev (map length (transpose xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (rev (map length (transpose xs)))
[PROOF STEP]
by (auto simp: sorted_iff_nth_mono rev_nth nth_transpose
    length_filter_conv_card intro: card_mono)


[STATEMENT]
lemma subarray_upd2: " i < n  \<Longrightarrow> subarray n m a (Array.update a i v h) = subarray n m a h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> subarray n m a (Array.update a i v h) = subarray n m a h
[PROOF STEP]
apply (simp add: subarray_def Array.update_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> nths' n m ((Array.get h a)[i := v]) = nths' n m (Array.get h a)
[PROOF STEP]
apply (subst nths'_update2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i < n \<Longrightarrow> i < n
 2. i < n \<Longrightarrow> nths' n m (Array.get h a) = nths' n m (Array.get h a)
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> nths' n m (Array.get h a) = nths' n m (Array.get h a)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cBex_simps [simp, no_atp]:
  "\<And>A P Q. cBex A (\<lambda>x. P x \<and> Q) = (cBex A P \<and> Q)"
  "\<And>A P Q. cBex A (\<lambda>x. P \<and> Q x) = (P \<and> cBex A Q)"
  "\<And>P. cBex cempty P = False"
  "\<And>a B P. cBex (cinsert a B) P = (P a \<or> cBex B P)"
  "\<And>A P f. cBex (cimage f A) P = cBex A (\<lambda>x. P (f x))"
  "\<And>A P. (\<not> cBex A P) = cBall A (\<lambda>x. \<not> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<And>A P Q. cBex A (\<lambda>x. P x \<and> Q) = (cBex A P \<and> Q)) &&& (\<And>A P Q. cBex A (\<lambda>x. P \<and> Q x) = (P \<and> cBex A Q)) &&& (\<And>P. cBex cempty P = False)) &&& (\<And>a B P. cBex (cinsert a B) P = (P a \<or> cBex B P)) &&& (\<And>A P f. cBex (cimage f A) P = cBex A (\<lambda>x. P (f x))) &&& (\<And>A P. (\<not> cBex A P) = cBall A (\<lambda>x. \<not> P x))
[PROOF STEP]
by auto


[STATEMENT]
lemma ikkbz_in_ikkbz_sub_set: "ikkbz \<in> {ikkbz_sub r|r. r \<in> verts G}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ikkbz \<in> {ikkbz_sub r |r. r \<in> verts G}
[PROOF STEP]
unfolding ikkbz_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arg_min_on cost_l {ikkbz_sub r |r. r \<in> verts G} \<in> {ikkbz_sub r |r. r \<in> verts G}
[PROOF STEP]
using ikkbz_sub_set_fin ikkbz_sub_set_nempty arg_min_if_finite
[PROOF STATE]
proof (prove)
using this:
finite {ikkbz_sub r |r. r \<in> verts G}
{ikkbz_sub r |r. r \<in> verts G} \<noteq> {}
\<lbrakk>finite ?S; ?S \<noteq> {}\<rbrakk> \<Longrightarrow> arg_min_on ?f ?S \<in> ?S
\<lbrakk>finite ?S; ?S \<noteq> {}\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>?S. ?f x < ?f (arg_min_on ?f ?S))

goal (1 subgoal):
 1. arg_min_on cost_l {ikkbz_sub r |r. r \<in> verts G} \<in> {ikkbz_sub r |r. r \<in> verts G}
[PROOF STEP]
by blast


[STATEMENT]
lemma bernoulli_stream_element_prob_rec:
  fixes x
  assumes "M = bernoulli_stream p"
and "0 \<le> p" and "p \<le> 1"
  shows "\<And> n. emeasure M {w\<in> space M. (stake (Suc n) w = stake (Suc n) x)} =
    (emeasure M {w\<in> space M. (stake n w = stake n x)} * prob_component p x n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = emeasure M {w \<in> space M. stake n w = stake n x} * ennreal (prob_component p x n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = emeasure M {w \<in> space M. stake n w = stake n x} * ennreal (prob_component p x n)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = emeasure M {w \<in> space M. stake n w = stake n x} * ennreal (prob_component p x n)
[PROOF STEP]
define S where "S = {w\<in> space M. (stake (Suc n) w = stake (Suc n) x)}"
[PROOF STATE]
proof (state)
this:
S = {w \<in> space M. stake (Suc n) w = stake (Suc n) x}

goal (1 subgoal):
 1. \<And>n. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = emeasure M {w \<in> space M. stake n w = stake n x} * ennreal (prob_component p x n)
[PROOF STEP]
define precS where "precS = {w\<in> space M. (stake n w = stake n x)}"
[PROOF STATE]
proof (state)
this:
precS = {w \<in> space M. stake n w = stake n x}

goal (1 subgoal):
 1. \<And>n. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = emeasure M {w \<in> space M. stake n w = stake n x} * ennreal (prob_component p x n)
[PROOF STEP]
show "emeasure M S = emeasure M precS * prob_component p x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
proof (cases " n\<le> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
 2. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n \<le> 0

goal (2 subgoals):
 1. n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
 2. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
hence "n=0"
[PROOF STATE]
proof (prove)
using this:
n \<le> 0

goal (1 subgoal):
 1. n = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
 2. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
hence "emeasure M S = (\<Prod>i\<in>{0..n}. prob_component p x i)"
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. emeasure M S = ennreal (prod (prob_component p x) {0..n})
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = ennreal (prod (prob_component p x) {0..n})
[PROOF STEP]
using bernoulli_stream_pref_prob assms diff_Suc_1 le_refl
[PROOF STATE]
proof (prove)
using this:
n = 0
\<lbrakk>?M = bernoulli_stream ?p; 0 \<le> ?p; ?p \<le> 1; Suc 0 \<le> ?n\<rbrakk> \<Longrightarrow> emeasure ?M {w \<in> space ?M. stake ?n w = stake ?n ?x} = ennreal (prod (prob_component ?p ?x) {0..?n - 1})
M = bernoulli_stream p
0 \<le> p
p \<le> 1
Suc ?n - 1 = ?n
?n \<le> ?n

goal (1 subgoal):
 1. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = ennreal (prod (prob_component p x) {0..n})
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
emeasure M S = ennreal (prod (prob_component p x) {0..n})

goal (2 subgoals):
 1. n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
 2. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M S = ennreal (prod (prob_component p x) {0..n})

goal (2 subgoals):
 1. n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
 2. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
have "... = prob_component p x 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (prod (prob_component p x) {0..n}) = ennreal (prob_component p x 0)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
n \<le> 0

goal (1 subgoal):
 1. ennreal (prod (prob_component p x) {0..n}) = ennreal (prob_component p x 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ennreal (prod (prob_component p x) {0..n}) = ennreal (prob_component p x 0)

goal (2 subgoals):
 1. n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
 2. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (prod (prob_component p x) {0..n}) = ennreal (prob_component p x 0)

goal (2 subgoals):
 1. n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
 2. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
have "... = emeasure M precS * prob_component p x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (prob_component p x 0) = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
using bernoulli_stream_npref_prob assms
[PROOF STATE]
proof (prove)
using this:
?M = bernoulli_stream ?p \<Longrightarrow> emeasure ?M {w \<in> space ?M. stake 0 w = stake 0 ?x} = 1
M = bernoulli_stream p
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. ennreal (prob_component p x 0) = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
by (simp add: \<open>n=0\<close> precS_def)
[PROOF STATE]
proof (state)
this:
ennreal (prob_component p x 0) = emeasure M precS * ennreal (prob_component p x n)

goal (2 subgoals):
 1. n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
 2. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
show "emeasure M S = emeasure M precS * prob_component p x n"
[PROOF STATE]
proof (prove)
using this:
emeasure M S = emeasure M precS * ennreal (prob_component p x n)

goal (1 subgoal):
 1. emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure M S = emeasure M precS * ennreal (prob_component p x n)

goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> n \<le> 0

goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
hence "n \<ge> Suc 0"
[PROOF STATE]
proof (prove)
using this:
\<not> n \<le> 0

goal (1 subgoal):
 1. Suc 0 \<le> n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc 0 \<le> n

goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
hence "emeasure M S = (\<Prod>i\<in>{0..n}. prob_component p x i)"
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> n

goal (1 subgoal):
 1. emeasure M S = ennreal (prod (prob_component p x) {0..n})
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> n

goal (1 subgoal):
 1. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = ennreal (prod (prob_component p x) {0..n})
[PROOF STEP]
using bernoulli_stream_pref_prob diff_Suc_1 le_refl assms
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> n
\<lbrakk>?M = bernoulli_stream ?p; 0 \<le> ?p; ?p \<le> 1; Suc 0 \<le> ?n\<rbrakk> \<Longrightarrow> emeasure ?M {w \<in> space ?M. stake ?n w = stake ?n ?x} = ennreal (prod (prob_component ?p ?x) {0..?n - 1})
Suc ?n - 1 = ?n
?n \<le> ?n
M = bernoulli_stream p
0 \<le> p
p \<le> 1

goal (1 subgoal):
 1. emeasure M {w \<in> space M. stake (Suc n) w = stake (Suc n) x} = ennreal (prod (prob_component p x) {0..n})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
emeasure M S = ennreal (prod (prob_component p x) {0..n})

goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M S = ennreal (prod (prob_component p x) {0..n})

goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
have "... = (\<Prod>i\<in>{0..n-1}. prob_component p x i) * prob_component p x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (prod (prob_component p x) {0..n}) = ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n)
[PROOF STEP]
using \<open>n \<ge> Suc 0\<close>
[PROOF STATE]
proof (prove)
using this:
Suc 0 \<le> n

goal (1 subgoal):
 1. ennreal (prod (prob_component p x) {0..n}) = ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n)
[PROOF STEP]
by (metis One_nat_def Suc_le_lessD Suc_pred prod.atLeast0_atMost_Suc)
[PROOF STATE]
proof (state)
this:
ennreal (prod (prob_component p x) {0..n}) = ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n)

goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (prod (prob_component p x) {0..n}) = ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n)

goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
have "... = emeasure M precS * prob_component p x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n) = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
using bernoulli_stream_pref_prob
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?M = bernoulli_stream ?p; 0 \<le> ?p; ?p \<le> 1; Suc 0 \<le> ?n\<rbrakk> \<Longrightarrow> emeasure ?M {w \<in> space ?M. stake ?n w = stake ?n ?x} = ennreal (prod (prob_component ?p ?x) {0..?n - 1})

goal (1 subgoal):
 1. ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n) = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
unfolding precS_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?M = bernoulli_stream ?p; 0 \<le> ?p; ?p \<le> 1; Suc 0 \<le> ?n\<rbrakk> \<Longrightarrow> emeasure ?M {w \<in> space ?M. stake ?n w = stake ?n ?x} = ennreal (prod (prob_component ?p ?x) {0..?n - 1})

goal (1 subgoal):
 1. ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n) = emeasure M {w \<in> space M. stake n w = stake n x} * ennreal (prob_component p x n)
[PROOF STEP]
using \<open>Suc 0 \<le> n\<close> ennreal_mult'' assms prob_component_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?M = bernoulli_stream ?p; 0 \<le> ?p; ?p \<le> 1; Suc 0 \<le> ?n\<rbrakk> \<Longrightarrow> emeasure ?M {w \<in> space ?M. stake ?n w = stake ?n ?x} = ennreal (prod (prob_component ?p ?x) {0..?n - 1})
Suc 0 \<le> n
0 \<le> ?b \<Longrightarrow> ennreal (?a * ?b) = ennreal ?a * ennreal ?b
M = bernoulli_stream p
0 \<le> p
p \<le> 1
prob_component ?p ?w ?n = (if ?w !! ?n then ?p else 1 - ?p)

goal (1 subgoal):
 1. ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n) = emeasure M {w \<in> space M. stake n w = stake n x} * ennreal (prob_component p x n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ennreal (prod (prob_component p x) {0..n - 1} * prob_component p x n) = emeasure M precS * ennreal (prob_component p x n)

goal (1 subgoal):
 1. \<not> n \<le> 0 \<Longrightarrow> emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
show "emeasure M S = emeasure M precS * prob_component p x n"
[PROOF STATE]
proof (prove)
using this:
emeasure M S = emeasure M precS * ennreal (prob_component p x n)

goal (1 subgoal):
 1. emeasure M S = emeasure M precS * ennreal (prob_component p x n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure M S = emeasure M precS * ennreal (prob_component p x n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
emeasure M S = emeasure M precS * ennreal (prob_component p x n)

goal:
No subgoals!
[PROOF STEP]
qed