[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 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 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 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 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 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 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 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 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 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 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 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 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


[STATEMENT]
lemma tiling_domino_finite:
  assumes t: "t \<in> tiling domino"  (is "t \<in> ?T")
  shows "finite t"  (is "?F t")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite t
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
t \<in> tiling domino

goal (1 subgoal):
 1. finite t
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {}
 2. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
show "?F {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {}
[PROOF STEP]
by (rule finite.emptyI)
[PROOF STATE]
proof (state)
this:
finite {}

goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
fix a t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
assume "?F t"
[PROOF STATE]
proof (state)
this:
finite t

goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
assume "a \<in> domino"
[PROOF STATE]
proof (state)
this:
a \<in> domino

goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> domino
[PROOF STEP]
have "?F a"
[PROOF STATE]
proof (prove)
using this:
a \<in> domino

goal (1 subgoal):
 1. finite a
[PROOF STEP]
by (rule domino_finite)
[PROOF STATE]
proof (state)
this:
finite a

goal (1 subgoal):
 1. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; finite t; a \<subseteq> - t\<rbrakk> \<Longrightarrow> finite (a \<union> t)
[PROOF STEP]
from this and \<open>?F t\<close>
[PROOF STATE]
proof (chain)
picking this:
finite a
finite t
[PROOF STEP]
show "?F (a \<union> t)"
[PROOF STATE]
proof (prove)
using this:
finite a
finite t

goal (1 subgoal):
 1. finite (a \<union> t)
[PROOF STEP]
by (rule finite_UnI)
[PROOF STATE]
proof (state)
this:
finite (a \<union> t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enat_mult_cancel1 [simp]:
  "k * m = k * n \<longleftrightarrow> m = n \<or> k = 0 \<or> k = (\<infinity> :: enat) \<and> n \<noteq> 0 \<and> m \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k * m = k * n) = (m = n \<or> k = 0 \<or> k = \<infinity> \<and> n \<noteq> 0 \<and> m \<noteq> 0)
[PROOF STEP]
by(cases k m n rule: enat.exhaust[case_product enat.exhaust[case_product enat.exhaust]])(simp_all add: zero_enat_def)


[STATEMENT]
lemma mset_tree_merge:
  "braun (Node l x r) \<Longrightarrow> mset_tree(merge l r) = mset_tree l + mset_tree r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. braun \<langle>l, x, r\<rangle> \<Longrightarrow> mset_tree (merge l r) = mset_tree l + mset_tree r
[PROOF STEP]
by(induction l r rule: merge.induct)
  (auto simp: Let_def tree.set_sel(2) mset_sift_down replace_min_sift_down
        simp del: replace_min.simps dest!: del_left_mset split!: prod.split)


[STATEMENT]
lemma listsum_Cons: "listsum ds (A # As) = A + listsum ds As"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listsum ds (A # As) = A + listsum ds As
[PROOF STEP]
unfolding listsum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (+) (A # As) (tensor0 ds) = A + foldr (+) As (tensor0 ds)
[PROOF STEP]
by auto


[STATEMENT]
lemma convex_simplex: "n simplex S \<Longrightarrow> convex S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n simplex S \<Longrightarrow> convex S
[PROOF STEP]
by (metis convex_convex_hull simplex_def)


[STATEMENT]
lemma poly_zero_add: "poly_add zero_poly p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_add zero_poly p = p
[PROOF STEP]
unfolding zero_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_add [] p = p
[PROOF STEP]
using poly_add.simps
[PROOF STATE]
proof (prove)
using this:
poly_add [] ?q = ?q
poly_add ((?m, ?c) # ?p) ?q = (case List.extract (\<lambda>mc. fst mc = ?m) ?q of None \<Rightarrow> (?m, ?c) # poly_add ?p ?q | Some (q1, (x, d), q2) \<Rightarrow> if ?c + d = (0::?'a) then poly_add ?p (q1 @ q2) else (?m, ?c + d) # poly_add ?p (q1 @ q2))

goal (1 subgoal):
 1. poly_add [] p = p
[PROOF STEP]
by auto


[STATEMENT]
lemma one_matrix_mult_left[simp]: "nrows A <= n \<Longrightarrow> (one_matrix n) * A = (A::('a::semiring_1) matrix)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows A \<le> n \<Longrightarrow> one_matrix n * A = A
[PROOF STEP]
apply (subst Rep_matrix_inject[THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows A \<le> n \<Longrightarrow> Rep_matrix (one_matrix n * A) = Rep_matrix A
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. nrows A \<le> n \<Longrightarrow> Rep_matrix (one_matrix n * A) x xa = Rep_matrix A x xa
[PROOF STEP]
apply (simp add: times_matrix_def Rep_mult_matrix)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. nrows A \<le> n \<Longrightarrow> foldseq (+) (\<lambda>k. (if x = k \<and> x < n then 1::'a else (0::'a)) * Rep_matrix A k xa) n = Rep_matrix A x xa
[PROOF STEP]
apply (rule_tac j1="x" in ssubst[OF foldseq_almostzero])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x xa. nrows A \<le> n \<Longrightarrow> \<forall>x. (0::'a) + x = x
 2. \<And>x xa. nrows A \<le> n \<Longrightarrow> \<forall>x. x + (0::'a) = x
 3. \<And>x xa. nrows A \<le> n \<Longrightarrow> \<forall>i. i \<noteq> x \<longrightarrow> (if x = i \<and> x < n then 1::'a else (0::'a)) * Rep_matrix A i xa = (0::'a)
 4. \<And>x xa. nrows A \<le> n \<Longrightarrow> (if x \<le> n then (if x = x \<and> x < n then 1::'a else (0::'a)) * Rep_matrix A x xa else (0::'a)) = Rep_matrix A x xa
[PROOF STEP]
apply (simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. nrows A \<le> n \<Longrightarrow> \<not> x < n \<longrightarrow> (x = n \<longrightarrow> Rep_matrix A n xa = (0::'a)) \<and> (x \<noteq> n \<longrightarrow> Rep_matrix A x xa = (0::'a))
[PROOF STEP]
by (simp add: nrows)


[STATEMENT]
lemma d_delta_ln_upper_5: "x > 0 \<Longrightarrow>
    ((\<lambda>x. ln_upper_5 x - ln x) has_field_derivative diff_delta_ln_upper_5 x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ((\<lambda>x. ln_upper_5 x - ln x) has_real_derivative diff_delta_ln_upper_5 x) (at x)
[PROOF STEP]
unfolding ln_upper_5_def diff_delta_ln_upper_5_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ((\<lambda>x. (x\<^sup>2 + 19 * x + 10) * (x - 1) / (3 * (3 * x\<^sup>2 + 6 * x + 1)) - ln x) has_real_derivative (x - 1) ^ 5 / ((3 * x\<^sup>2 + 6 * x + 1)\<^sup>2 * x)) (at x)
[PROOF STEP]
apply (intro derivative_eq_intros | simp add: add_nonneg_eq_0_iff)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (((2 * x + 19) * (x - 1) + (x\<^sup>2 + 19 * x + 10)) * (9 * x\<^sup>2 + 18 * x + 3) - (x\<^sup>2 + 19 * x + 10) * (x - 1) * (18 * x + 18)) / ((9 * x\<^sup>2 + 18 * x + 3) * (9 * x\<^sup>2 + 18 * x + 3)) - 1 / x = (x - 1) ^ 5 / ((3 * x\<^sup>2 + 6 * x + 1)\<^sup>2 * x)
[PROOF STEP]
apply (simp add: divide_simps add_nonneg_eq_0_iff, algebra)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum2:
  assumes fin: "finite X"
  assumes ne: "X\<noteq>{}"
  assumes ncoll: "(\<And>x. x \<in> X \<Longrightarrow> ccw 0 (f x) a)"
  shows "ccw 0 (sum f X) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw (0::'a) (sum f X) a
[PROOF STEP]
using sum[OF assms(1,2), of "-a" f] ncoll
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> X \<Longrightarrow> ccw (0::'a) (- a) (f x)) \<Longrightarrow> ccw (0::'a) (- a) (sum f X)
?x \<in> X \<Longrightarrow> ccw (0::'a) (f ?x) a

goal (1 subgoal):
 1. ccw (0::'a) (sum f X) a
[PROOF STEP]
by simp


[STATEMENT]
lemma insert_subset_equality: "\<lbrakk> a\<notin>A; a\<notin>B; insert a A = insert a B \<rbrakk> \<Longrightarrow> A=B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<notin> A; a \<notin> B; insert a A = insert a B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
by auto


[STATEMENT]
lemma ic_not_closed:
  assumes "a < (b::real)"
  shows "\<not> closed {a<..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> closed {a<..b}
[PROOF STEP]
using assms frontier_subset_eq frontier_ic greaterThanAtMost_iff
[PROOF STATE]
proof (prove)
using this:
a < b
(frontier ?S \<subseteq> ?S) = closed ?S
?a < ?b \<Longrightarrow> frontier {?a<..?b} = {?a, ?b}
(?i \<in> {?l<..?u}) = (?l < ?i \<and> ?i \<le> ?u)

goal (1 subgoal):
 1. \<not> closed {a<..b}
[PROOF STEP]
by blast


[STATEMENT]
lemma qiterl_inductl: "x \<squnion> y \<cdot> z \<le> z \<Longrightarrow> qiterl (x::'a::unital_near_quantale) y \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<cdot> z \<le> z \<Longrightarrow> qiterl x y \<le> z
[PROOF STEP]
by (simp add: lfp_lowerbound qiterl_def qiter_fun_def)


[STATEMENT]
lemma equiv_order_trans[trans]:
  assumes xy: "x \<simeq> y" and yz: "y \<sqsubseteq> z" and x: "x \<in> A" and y: "y \<in> A" and z: "z \<in> A"
  shows "x \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> z
[PROOF STEP]
using attract[OF _ _ _ x y z] xy yz
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<sqsubseteq> y; y \<sqsubseteq> x; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> x \<sqsubseteq> z
x \<simeq> y
y \<sqsubseteq> z

goal (1 subgoal):
 1. x \<sqsubseteq> z
[PROOF STEP]
by (auto elim: equivpartpE)


[STATEMENT]
lemma push_bit_double:
  "push_bit n (a * 2) = push_bit n a * 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit n (a * (2::'a)) = push_bit n a * (2::'a)
[PROOF STEP]
by (simp add: push_bit_eq_mult ac_simps)


[STATEMENT]
lemma cinner_sum_left: "cinner (\<Sum>x\<in>A. f x) y = (\<Sum>x\<in>A. cinner (f x) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner (sum f A) y = (\<Sum>x\<in>A. cinner (f x) y)
[PROOF STEP]
by (cases "finite A", induct set: finite, simp_all add: cinner_add_left)


[STATEMENT]
lemma path_append[simp]:
  "path g u (p1@p2) w \<longleftrightarrow> (\<exists>v. path g u p1 v \<and> path g v p2 w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path g u (p1 @ p2) w = (\<exists>v. path g u p1 v \<and> path g v p2 w)
[PROOF STEP]
by (induction p1 arbitrary: u) auto


[STATEMENT]
lemma smod_word_minus_one [simp]:
  \<open>w smod - 1 = 0\<close> for w :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w smod - 1 = 0
[PROOF STEP]
by (simp add: smod_word_def signed_modulo_int_def)


[STATEMENT]
lemma le_list_trans:
  assumes ord: "order r A"
      and xs:  "xs \<in> nlists n A" and ys: "ys \<in> nlists n A" and zs: "zs \<in> nlists n A"
      and      "xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys" and "ys [\<sqsubseteq>\<^bsub>r\<^esub>] zs"
    shows      "xs [\<sqsubseteq>\<^bsub>r\<^esub>] zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs [\<sqsubseteq>\<^bsub>r\<^esub>] zs
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs [\<sqsubseteq>\<^bsub>r\<^esub>] zs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
order r A
xs \<in> nlists n A
ys \<in> nlists n A
zs \<in> nlists n A
xs [\<sqsubseteq>\<^bsub>r\<^esub>] ys
ys [\<sqsubseteq>\<^bsub>r\<^esub>] zs

goal (1 subgoal):
 1. xs [\<sqsubseteq>\<^bsub>r\<^esub>] zs
[PROOF STEP]
proof (unfold le_def lesssub_def lesub_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
assume "list_all2 r xs ys" and "list_all2 r ys zs"
[PROOF STATE]
proof (state)
this:
list_all2 r xs ys
list_all2 r ys zs

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
hence xs_ys_zs:  "\<forall>i < length xs. r (xs!i) (ys!i) \<and> r (ys!i) (zs!i)"
        and len_xs_zs: "length xs = length zs"
[PROOF STATE]
proof (prove)
using this:
list_all2 r xs ys
list_all2 r ys zs

goal (1 subgoal):
 1. \<forall>i<length xs. r (xs ! i) (ys ! i) \<and> r (ys ! i) (zs ! i) &&& length xs = length zs
[PROOF STEP]
by (auto simp add: list_all2_conv_all_nth)
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. r (xs ! i) (ys ! i) \<and> r (ys ! i) (zs ! i)
length xs = length zs

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
from xs ys zs
[PROOF STATE]
proof (chain)
picking this:
xs \<in> nlists n A
ys \<in> nlists n A
zs \<in> nlists n A
[PROOF STEP]
have inA: "\<forall>i<length xs. xs!i \<in> A \<and> ys!i \<in> A \<and> zs!i \<in> A"
[PROOF STATE]
proof (prove)
using this:
xs \<in> nlists n A
ys \<in> nlists n A
zs \<in> nlists n A

goal (1 subgoal):
 1. \<forall>i<length xs. xs ! i \<in> A \<and> ys ! i \<in> A \<and> zs ! i \<in> A
[PROOF STEP]
by (unfold nlists_def) auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. xs ! i \<in> A \<and> ys ! i \<in> A \<and> zs ! i \<in> A

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
from ord
[PROOF STATE]
proof (chain)
picking this:
order r A
[PROOF STEP]
have "\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^sub>r y \<and> y \<sqsubseteq>\<^sub>r z \<longrightarrow> x \<sqsubseteq>\<^sub>r z"
[PROOF STATE]
proof (prove)
using this:
order r A

goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z
[PROOF STEP]
by (unfold order_def) blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
hence "\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^bsub>r\<^esub> y \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z \<longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> z

goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z
[PROOF STEP]
by (unfold lesssub_def lesub_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
with xs_ys_zs inA
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length xs. r (xs ! i) (ys ! i) \<and> r (ys ! i) (zs ! i)
\<forall>i<length xs. xs ! i \<in> A \<and> ys ! i \<in> A \<and> zs ! i \<in> A
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z
[PROOF STEP]
have "\<forall>i<length xs. r (xs!i) (zs!i)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length xs. r (xs ! i) (ys ! i) \<and> r (ys ! i) (zs ! i)
\<forall>i<length xs. xs ! i \<in> A \<and> ys ! i \<in> A \<and> zs ! i \<in> A
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. r x y \<and> r y z \<longrightarrow> r x z

goal (1 subgoal):
 1. \<forall>i<length xs. r (xs ! i) (zs ! i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. r (xs ! i) (zs ! i)

goal (1 subgoal):
 1. \<lbrakk>order r A; xs \<in> nlists n A; ys \<in> nlists n A; zs \<in> nlists n A; list_all2 r xs ys; list_all2 r ys zs\<rbrakk> \<Longrightarrow> list_all2 r xs zs
[PROOF STEP]
with len_xs_zs
[PROOF STATE]
proof (chain)
picking this:
length xs = length zs
\<forall>i<length xs. r (xs ! i) (zs ! i)
[PROOF STEP]
show "list_all2 r xs zs"
[PROOF STATE]
proof (prove)
using this:
length xs = length zs
\<forall>i<length xs. r (xs ! i) (zs ! i)

goal (1 subgoal):
 1. list_all2 r xs zs
[PROOF STEP]
by (simp add:list_all2_conv_all_nth)
[PROOF STATE]
proof (state)
this:
list_all2 r xs zs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_image_mirror: "path_image (-g) = uminus ` path_image g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (- g) = uminus ` path_image g
[PROOF STEP]
by (auto simp: path_image_def)


[STATEMENT]
lemma times_iff [simp]: "\<langle>a,b\<rangle> \<^bold>\<in> A * B \<longleftrightarrow> a \<^bold>\<in> A \<and> b \<^bold>\<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>a, b\<rangle> \<^bold>\<in> A * B) = (a \<^bold>\<in> A \<and> b \<^bold>\<in> B)
[PROOF STEP]
by (simp add: times_hf_def)


[STATEMENT]
lemma combine_append_replicate:
  "set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ (replicate n \<zero>)) Us = combine Ks Us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Us \<subseteq> carrier R \<Longrightarrow> combine (Ks @ replicate n \<zero>) Us = combine Ks Us
[PROOF STEP]
by (induct n) (auto, metis append.assoc combine_append_zero replicate_append_same)


[STATEMENT]
lemma index_ordered_less:
  assumes "i < j" shows "index i < index j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
i < j
[PROOF STEP]
have "Suc i \<le> j"
[PROOF STATE]
proof (prove)
using this:
i < j

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

goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
from index_ordered_le[OF this]
[PROOF STATE]
proof (chain)
picking this:
index (Suc i) \<le> index j
[PROOF STEP]
have "index (Suc i) \<le> index j"
[PROOF STATE]
proof (prove)
using this:
index (Suc i) \<le> index j

goal (1 subgoal):
 1. index (Suc i) \<le> index j
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
index (Suc i) \<le> index j

goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
with index_ordered[of i]
[PROOF STATE]
proof (chain)
picking this:
index i < index (Suc i)
index (Suc i) \<le> index j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
index i < index (Suc i)
index (Suc i) \<le> index j

goal (1 subgoal):
 1. index i < index j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
index i < index j

goal:
No subgoals!
[PROOF STEP]
qed