[STATEMENT]
lemma Max_by_dest:
  assumes "finite A" and "A \<noteq> {}"
  shows "Max_by f A \<in> A \<and> f (Max_by f A) = Max (f ` A)" (is "?P (Max_by f A)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max_by f A \<in> A \<and> f (Max_by f A) = Max (f ` A)
[PROOF STEP]
proof(simp only: Max_by_def some_eq_ex[where P="?P"])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. x \<in> A \<and> f x = Max (f ` A)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<noteq> {}
[PROOF STEP]
have "finite (f ` A)" "f ` A \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<noteq> {}

goal (1 subgoal):
 1. finite (f ` A) &&& f ` A \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (f ` A)
f ` A \<noteq> {}

goal (1 subgoal):
 1. \<exists>x. x \<in> A \<and> f x = Max (f ` A)
[PROOF STEP]
from Max_in[OF this]
[PROOF STATE]
proof (chain)
picking this:
Max (f ` A) \<in> f ` A
[PROOF STEP]
show "\<exists>x. x \<in> A \<and> f x = Max (f ` A)"
[PROOF STATE]
proof (prove)
using this:
Max (f ` A) \<in> f ` A

goal (1 subgoal):
 1. \<exists>x. x \<in> A \<and> f x = Max (f ` A)
[PROOF STEP]
by (metis image_iff)
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> A \<and> f x = Max (f ` A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invertible_right_cancel [simp]:
  "\<lbrakk> invertible x; x \<in> M; y \<in> M; z \<in> M \<rbrakk> \<Longrightarrow> y \<cdot> x = z \<cdot> x \<longleftrightarrow> y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invertible x; x \<in> M; y \<in> M; z \<in> M\<rbrakk> \<Longrightarrow> (y \<cdot> x = z \<cdot> x) = (y = z)
[PROOF STEP]
by (metis associative invertible_def right_unit)


[STATEMENT]
lemma (in wf_digraph) subgraph_apath_imp_apath:
  assumes path: "pre_digraph.apath H u p v"
  assumes sub: "subgraph H G"
  shows "apath u p v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. apath u p v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pre_digraph.apath H u p v
subgraph H G

goal (1 subgoal):
 1. apath u p v
[PROOF STEP]
unfolding pre_digraph.apath_def
[PROOF STATE]
proof (prove)
using this:
pre_digraph.awalk H u p v \<and> distinct (pre_digraph.awalk_verts H u p)
subgraph H G

goal (1 subgoal):
 1. awalk u p v \<and> distinct (awalk_verts u p)
[PROOF STEP]
by (auto intro: subgraph_awalk_imp_awalk simp: compatible_awalk_verts)


[STATEMENT]
lemma matrix_inv:
  assumes "invertible M"
  shows matrix_inv_left: "matrix_inv M ** M = mat 1"
    and matrix_inv_right: "M ** matrix_inv M = mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_inv M ** M = mat (1::'a) &&& M ** matrix_inv M = mat (1::'a)
[PROOF STEP]
using \<open>invertible M\<close> and someI_ex [of "\<lambda> N. M ** N = mat 1 \<and> N ** M = mat 1"]
[PROOF STATE]
proof (prove)
using this:
invertible M
\<exists>x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a) \<Longrightarrow> M ** (SOME x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a)) = mat (1::'a) \<and> (SOME x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a)) ** M = mat (1::'a)

goal (1 subgoal):
 1. matrix_inv M ** M = mat (1::'a) &&& M ** matrix_inv M = mat (1::'a)
[PROOF STEP]
unfolding invertible_def and matrix_inv_def
[PROOF STATE]
proof (prove)
using this:
\<exists>A'. M ** A' = mat (1::'a) \<and> A' ** M = mat (1::'a)
\<exists>x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a) \<Longrightarrow> M ** (SOME x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a)) = mat (1::'a) \<and> (SOME x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a)) ** M = mat (1::'a)

goal (1 subgoal):
 1. (SOME A'. M ** A' = mat (1::'a) \<and> A' ** M = mat (1::'a)) ** M = mat (1::'a) &&& M ** (SOME A'. M ** A' = mat (1::'a) \<and> A' ** M = mat (1::'a)) = mat (1::'a)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma part_circlepath_half_finite_inter:
  assumes "st\<noteq>tt" "r\<noteq>0" "c\<noteq>0"
  shows "finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0\<le> t \<and> t\<le>1}" (is "finite ?T")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
let ?S = "{\<theta>. (z0+r*exp (\<i> * \<theta> )) \<bullet> c = d \<and> \<theta> \<in> closed_segment st tt}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
define S where "S \<equiv> {\<theta>. (z0+r*exp (\<i> * \<theta> )) \<bullet> c = d \<and> \<theta> \<in> closed_segment st tt}"
[PROOF STATE]
proof (state)
this:
S \<equiv> {\<theta>. (z0 + complex_of_real r * exp (\<i> * complex_of_real \<theta>)) \<bullet> c = d \<and> \<theta> \<in> closed_segment st tt}

goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
have "S = linepath st tt ` ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S \<subseteq> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
 2. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
define g where "g\<equiv>(\<lambda>t. (t-st)/(tt -st))"
[PROOF STATE]
proof (state)
this:
g \<equiv> \<lambda>t. (t - st) / (tt - st)

goal (2 subgoals):
 1. S \<subseteq> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
 2. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
have "0\<le>g t" "g t\<le>1" when "t \<in> closed_segment st tt " for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> g t &&& g t \<le> 1
[PROOF STEP]
using that \<open>st\<noteq>tt\<close> closed_segment_eq_real_ivl
[PROOF STATE]
proof (prove)
using this:
t \<in> closed_segment st tt
st \<noteq> tt
closed_segment ?a ?b = (if ?a \<le> ?b then {?a..?b} else {?b..?a})

goal (1 subgoal):
 1. 0 \<le> g t &&& g t \<le> 1
[PROOF STEP]
unfolding  g_def real_scaleR_def
[PROOF STATE]
proof (prove)
using this:
t \<in> closed_segment st tt
st \<noteq> tt
closed_segment ?a ?b = (if ?a \<le> ?b then {?a..?b} else {?b..?a})

goal (1 subgoal):
 1. 0 \<le> (t - st) / (tt - st) &&& (t - st) / (tt - st) \<le> 1
[PROOF STEP]
by (auto simp add:divide_simps)
[PROOF STATE]
proof (state)
this:
?t \<in> closed_segment st tt \<Longrightarrow> 0 \<le> g ?t
?t \<in> closed_segment st tt \<Longrightarrow> g ?t \<le> 1

goal (2 subgoals):
 1. S \<subseteq> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
 2. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?t \<in> closed_segment st tt \<Longrightarrow> 0 \<le> g ?t
?t \<in> closed_segment st tt \<Longrightarrow> g ?t \<le> 1

goal (2 subgoals):
 1. S \<subseteq> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
 2. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
have "linepath st tt (g t) =t" "g (linepath st tt t) = t" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linepath st tt (g t) = t &&& g (linepath st tt t) = t
[PROOF STEP]
unfolding linepath_def g_def real_scaleR_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - (t - st) / (tt - st)) * st + (t - st) / (tt - st) * tt = t &&& ((1 - t) * st + t * tt - st) / (tt - st) = t
[PROOF STEP]
using \<open>st\<noteq>tt\<close>
[PROOF STATE]
proof (prove)
using this:
st \<noteq> tt

goal (1 subgoal):
 1. (1 - (t - st) / (tt - st)) * st + (t - st) / (tt - st) * tt = t &&& ((1 - t) * st + t * tt - st) / (tt - st) = t
[PROOF STEP]
apply (simp_all add:divide_simps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. st \<noteq> tt \<Longrightarrow> (tt - t) * st + (t - st) * tt = t * (tt - st)
 2. st \<noteq> tt \<Longrightarrow> (1 - t) * st + t * tt - st = t * (tt - st)
[PROOF STEP]
by (auto simp add:algebra_simps )
[PROOF STATE]
proof (state)
this:
linepath st tt (g ?t) = ?t
g (linepath st tt ?t) = ?t

goal (2 subgoals):
 1. S \<subseteq> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
 2. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?t \<in> closed_segment st tt \<Longrightarrow> 0 \<le> g ?t
?t \<in> closed_segment st tt \<Longrightarrow> g ?t \<le> 1
linepath st tt (g ?t) = ?t
g (linepath st tt ?t) = ?t
[PROOF STEP]
have "x\<in>linepath st tt ` ?T" when "x\<in>S" for x
[PROOF STATE]
proof (prove)
using this:
?t \<in> closed_segment st tt \<Longrightarrow> 0 \<le> g ?t
?t \<in> closed_segment st tt \<Longrightarrow> g ?t \<le> 1
linepath st tt (g ?t) = ?t
g (linepath st tt ?t) = ?t

goal (1 subgoal):
 1. x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
?t \<in> closed_segment st tt \<Longrightarrow> 0 \<le> g ?t
?t \<in> closed_segment st tt \<Longrightarrow> g ?t \<le> 1
linepath st tt (g ?t) = ?t
g (linepath st tt ?t) = ?t
x \<in> S

goal (1 subgoal):
 1. x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
?t \<in> closed_segment st tt \<Longrightarrow> 0 \<le> g ?t
?t \<in> closed_segment st tt \<Longrightarrow> g ?t \<le> 1
linepath st tt (g ?t) = ?t
g (linepath st tt ?t) = ?t
x \<in> {\<theta>. (z0 + complex_of_real r * exp (\<i> * complex_of_real \<theta>)) \<bullet> c = d \<and> \<theta> \<in> closed_segment st tt}

goal (1 subgoal):
 1. x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto intro!:image_eqI[where x="g x"] simp add:part_circlepath_def)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> ?x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (2 subgoals):
 1. S \<subseteq> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
 2. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> S \<Longrightarrow> ?x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
show "S \<subseteq> linepath st tt ` ?T"
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> ?x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. S \<subseteq> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<subseteq> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
have "x\<in>S" when "x\<in>linepath st tt ` ?T" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
unfolding part_circlepath_def S_def
[PROOF STATE]
proof (prove)
using this:
x \<in> linepath st tt ` {t. (z0 + complex_of_real r * exp (\<i> * complex_of_real (linepath st tt t))) \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. x \<in> {\<theta>. (z0 + complex_of_real r * exp (\<i> * complex_of_real \<theta>)) \<bullet> c = d \<and> \<theta> \<in> closed_segment st tt}
[PROOF STEP]
by (auto simp add: linepath_in_path)
[PROOF STATE]
proof (state)
this:
?x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<Longrightarrow> ?x \<in> S

goal (1 subgoal):
 1. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<Longrightarrow> ?x \<in> S
[PROOF STEP]
show "linepath st tt ` ?T \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
?x \<in> linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<Longrightarrow> ?x \<in> S

goal (1 subgoal):
 1. linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1} \<subseteq> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
S = linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S = linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
have "finite S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite S
[PROOF STEP]
define a' b' c' where "a'=r * Re c" and "b' = r* Im c" and "c'=Im c * Im z0 + Re z0 * Re c - d"
[PROOF STATE]
proof (state)
this:
a' = r * Re c
b' = r * Im c
c' = Im c * Im z0 + Re z0 * Re c - d

goal (1 subgoal):
 1. finite S
[PROOF STEP]
define f where "f \<theta>= a' * cos \<theta> + b' * sin \<theta> + c'" for \<theta>
[PROOF STATE]
proof (state)
this:
f ?\<theta> = a' * cos ?\<theta> + b' * sin ?\<theta> + c'

goal (1 subgoal):
 1. finite S
[PROOF STEP]
have "(z0+r*exp (\<i> * \<theta> )) \<bullet> c = d \<longleftrightarrow> f \<theta> = 0" for \<theta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((z0 + complex_of_real r * exp (\<i> * complex_of_real \<theta>)) \<bullet> c = d) = (f \<theta> = 0)
[PROOF STEP]
unfolding exp_Euler inner_complex_def f_def a'_def b'_def c'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re (z0 + complex_of_real r * (cos (complex_of_real \<theta>) + \<i> * sin (complex_of_real \<theta>))) * Re c + Im (z0 + complex_of_real r * (cos (complex_of_real \<theta>) + \<i> * sin (complex_of_real \<theta>))) * Im c = d) = (r * Re c * cos \<theta> + r * Im c * sin \<theta> + (Im c * Im z0 + Re z0 * Re c - d) = 0)
[PROOF STEP]
by (auto simp add:algebra_simps cos_of_real sin_of_real)
[PROOF STATE]
proof (state)
this:
((z0 + complex_of_real r * exp (\<i> * complex_of_real ?\<theta>)) \<bullet> c = d) = (f ?\<theta> = 0)

goal (1 subgoal):
 1. finite S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((z0 + complex_of_real r * exp (\<i> * complex_of_real ?\<theta>)) \<bullet> c = d) = (f ?\<theta> = 0)
[PROOF STEP]
have *:"S = roots f \<inter> closed_segment st tt"
[PROOF STATE]
proof (prove)
using this:
((z0 + complex_of_real r * exp (\<i> * complex_of_real ?\<theta>)) \<bullet> c = d) = (f ?\<theta> = 0)

goal (1 subgoal):
 1. S = roots f \<inter> closed_segment st tt
[PROOF STEP]
unfolding S_def roots_within_def
[PROOF STATE]
proof (prove)
using this:
((z0 + complex_of_real r * exp (\<i> * complex_of_real ?\<theta>)) \<bullet> c = d) = (f ?\<theta> = 0)

goal (1 subgoal):
 1. {\<theta>. (z0 + complex_of_real r * exp (\<i> * complex_of_real \<theta>)) \<bullet> c = d \<and> \<theta> \<in> closed_segment st tt} = {x \<in> UNIV. f x = 0} \<inter> closed_segment st tt
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S = roots f \<inter> closed_segment st tt

goal (1 subgoal):
 1. finite S
[PROOF STEP]
have "uniform_discrete S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_discrete S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. uniform_discrete S
[PROOF STEP]
have "a' \<noteq> 0 \<or> b' \<noteq> 0 \<or> c' \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a' \<noteq> 0 \<or> b' \<noteq> 0 \<or> c' \<noteq> 0
[PROOF STEP]
using assms complex_eq_iff
[PROOF STATE]
proof (prove)
using this:
st \<noteq> tt
r \<noteq> 0
c \<noteq> 0
(?x = ?y) = (Re ?x = Re ?y \<and> Im ?x = Im ?y)

goal (1 subgoal):
 1. a' \<noteq> 0 \<or> b' \<noteq> 0 \<or> c' \<noteq> 0
[PROOF STEP]
unfolding a'_def b'_def c'_def
[PROOF STATE]
proof (prove)
using this:
st \<noteq> tt
r \<noteq> 0
c \<noteq> 0
(?x = ?y) = (Re ?x = Re ?y \<and> Im ?x = Im ?y)

goal (1 subgoal):
 1. r * Re c \<noteq> 0 \<or> r * Im c \<noteq> 0 \<or> Im c * Im z0 + Re z0 * Re c - d \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a' \<noteq> 0 \<or> b' \<noteq> 0 \<or> c' \<noteq> 0

goal (1 subgoal):
 1. uniform_discrete S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a' \<noteq> 0 \<or> b' \<noteq> 0 \<or> c' \<noteq> 0
[PROOF STEP]
have "periodic_set (roots f) (4 * pi)"
[PROOF STATE]
proof (prove)
using this:
a' \<noteq> 0 \<or> b' \<noteq> 0 \<or> c' \<noteq> 0

goal (1 subgoal):
 1. periodic_set (roots f) (4 * pi)
[PROOF STEP]
using periodic_set_sin_cos_linear[of a' b' c',folded f_def]
[PROOF STATE]
proof (prove)
using this:
a' \<noteq> 0 \<or> b' \<noteq> 0 \<or> c' \<noteq> 0
a' \<noteq> 0 \<or> b' \<noteq> 0 \<or> c' \<noteq> 0 \<Longrightarrow> periodic_set (roots f) (4 * pi)

goal (1 subgoal):
 1. periodic_set (roots f) (4 * pi)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
periodic_set (roots f) (4 * pi)

goal (1 subgoal):
 1. uniform_discrete S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
periodic_set (roots f) (4 * pi)
[PROOF STEP]
have "uniform_discrete (roots f)"
[PROOF STATE]
proof (prove)
using this:
periodic_set (roots f) (4 * pi)

goal (1 subgoal):
 1. uniform_discrete (roots f)
[PROOF STEP]
using periodic_imp_uniform_discrete
[PROOF STATE]
proof (prove)
using this:
periodic_set (roots f) (4 * pi)
periodic_set ?S ?\<delta> \<Longrightarrow> uniform_discrete ?S

goal (1 subgoal):
 1. uniform_discrete (roots f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
uniform_discrete (roots f)

goal (1 subgoal):
 1. uniform_discrete S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
uniform_discrete (roots f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
uniform_discrete (roots f)

goal (1 subgoal):
 1. uniform_discrete S
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
uniform_discrete (roots f)

goal (1 subgoal):
 1. uniform_discrete (roots f \<inter> closed_segment st tt)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
uniform_discrete S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
uniform_discrete S

goal (1 subgoal):
 1. finite S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
uniform_discrete S

goal (1 subgoal):
 1. finite S
[PROOF STEP]
have "bounded S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (roots f \<inter> closed_segment st tt)
[PROOF STEP]
by (simp add: bounded_Int bounded_closed_segment)
[PROOF STATE]
proof (state)
this:
bounded S

goal (1 subgoal):
 1. finite S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
uniform_discrete S
bounded S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
uniform_discrete S
bounded S

goal (1 subgoal):
 1. finite S
[PROOF STEP]
using uniform_discrete_finite_iff
[PROOF STATE]
proof (prove)
using this:
uniform_discrete S
bounded S
(uniform_discrete ?S \<and> bounded ?S) = finite ?S

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite S

goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite S

goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
have "inj_on (linepath st tt) ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (linepath st tt) {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on (linepath st tt) {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
have "inj (linepath st tt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (linepath st tt)
[PROOF STEP]
unfolding linepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>x. (1 - x) *\<^sub>R st + x *\<^sub>R tt)
[PROOF STEP]
using assms inj_segment
[PROOF STATE]
proof (prove)
using this:
st \<noteq> tt
r \<noteq> 0
c \<noteq> 0
?a \<noteq> ?b \<Longrightarrow> inj_on (\<lambda>u. (1 - u) *\<^sub>R ?a + u *\<^sub>R ?b) ?I

goal (1 subgoal):
 1. inj (\<lambda>x. (1 - x) *\<^sub>R st + x *\<^sub>R tt)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj (linepath st tt)

goal (1 subgoal):
 1. inj_on (linepath st tt) {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj (linepath st tt)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj (linepath st tt)

goal (1 subgoal):
 1. inj_on (linepath st tt) {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto elim:subset_inj_on)
[PROOF STATE]
proof (state)
this:
inj_on (linepath st tt) {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on (linepath st tt) {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S = linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
finite S
inj_on (linepath st tt) {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = linepath st tt ` {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
finite S
inj_on (linepath st tt) {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto elim!: finite_imageD)
[PROOF STATE]
proof (state)
this:
finite {t. part_circlepath z0 r st tt t \<bullet> c = d \<and> 0 \<le> t \<and> t \<le> 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Union_set_lists: "\<Union>(set ` (lists A)) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set ` lists A) = A
[PROOF STEP]
unfolding lists_def2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set ` {l. set l \<subseteq> A}) = A
[PROOF STEP]
proof(auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> \<exists>xa. set xa \<subseteq> A \<and> x \<in> set xa
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> \<exists>xa. set xa \<subseteq> A \<and> x \<in> set xa
[PROOF STEP]
assume "a \<in> A"
[PROOF STATE]
proof (state)
this:
a \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> \<exists>xa. set xa \<subseteq> A \<and> x \<in> set xa
[PROOF STEP]
hence "set [a] \<le> A \<and> a \<in> set [a]"
[PROOF STATE]
proof (prove)
using this:
a \<in> A

goal (1 subgoal):
 1. set [a] \<subseteq> A \<and> a \<in> set [a]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set [a] \<subseteq> A \<and> a \<in> set [a]

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> \<exists>xa. set xa \<subseteq> A \<and> x \<in> set xa
[PROOF STEP]
thus "\<exists>l. set l \<le> A \<and> a \<in> set l"
[PROOF STATE]
proof (prove)
using this:
set [a] \<subseteq> A \<and> a \<in> set [a]

goal (1 subgoal):
 1. \<exists>l. set l \<subseteq> A \<and> a \<in> set l
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>l. set l \<subseteq> A \<and> a \<in> set l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma holds_smap[iff]: "holds P (smap f w) \<longleftrightarrow> holds (P \<circ> f) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. holds P (smap f w) = holds (P \<circ> f) w
[PROOF STEP]
unfolding holds.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (shd (smap f w)) = (P \<circ> f) (shd w)
[PROOF STEP]
by simp


[STATEMENT]
lemma set_mset_fold: "set_mset A = fold_mset insert {} A" (is "_ = fold_mset ?f _ _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset A = fold_mset insert {} A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_mset A = fold_mset insert {} A
[PROOF STEP]
interpret comp_fun_commute ?f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute insert
[PROOF STEP]
by standard auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_mset A = fold_mset insert {} A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset A = fold_mset insert {} A
[PROOF STEP]
by (induct A) auto
[PROOF STATE]
proof (state)
this:
set_mset A = fold_mset insert {} A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma individually_rational_onI:
  assumes "CD_on ds X = X"
  assumes "CH X = X"
  shows "individually_rational_on ds X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. individually_rational_on ds X
[PROOF STEP]
unfolding individually_rational_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CD_on ds X = X \<and> CH X = X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
CD_on ds X = X
CH X = X

goal (1 subgoal):
 1. CD_on ds X = X \<and> CH X = X
[PROOF STEP]
by blast


[STATEMENT]
lemma index_states_observable :
  assumes "observable M"
  shows "observable (index_states M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. observable (index_states M)
[PROOF STEP]
using rename_states_observable[of "assign_indices (states M)", OF assign_indices_bij_betw assms]
[PROOF STATE]
proof (prove)
using this:
observable (FSM.rename_states M (assign_indices (FSM.states M)))

goal (1 subgoal):
 1. observable (index_states M)
[PROOF STEP]
unfolding index_states.simps
[PROOF STATE]
proof (prove)
using this:
observable (FSM.rename_states M (assign_indices (FSM.states M)))

goal (1 subgoal):
 1. observable (FSM.rename_states M (assign_indices (FSM.states M)))
[PROOF STEP]
.


[STATEMENT]
lemma polynomial_function:
  shows "set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (Fun R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
proof(induction as)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> carrier R \<Longrightarrow> polynomial [] \<in> carrier (function_ring (carrier R) R)
 2. \<And>a as. \<lbrakk>set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R); set (a # as) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> polynomial (a # as) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> carrier R

goal (2 subgoals):
 1. set [] \<subseteq> carrier R \<Longrightarrow> polynomial [] \<in> carrier (function_ring (carrier R) R)
 2. \<And>a as. \<lbrakk>set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R); set (a # as) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> polynomial (a # as) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set [] \<subseteq> carrier R
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
set [] \<subseteq> carrier R

goal (1 subgoal):
 1. polynomial [] \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
by (simp add: function_zero_closed)
[PROOF STATE]
proof (state)
this:
polynomial [] \<in> carrier (function_ring (carrier R) R)

goal (1 subgoal):
 1. \<And>a as. \<lbrakk>set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R); set (a # as) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> polynomial (a # as) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a as. \<lbrakk>set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R); set (a # as) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> polynomial (a # as) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
case (Cons a as)
[PROOF STATE]
proof (state)
this:
set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R)
set (a # as) \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>a as. \<lbrakk>set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R); set (a # as) \<subseteq> carrier R\<rbrakk> \<Longrightarrow> polynomial (a # as) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R)
set (a # as) \<subseteq> carrier R
[PROOF STEP]
show "polynomial (a # as) \<in> carrier (function_ring (carrier R) R)"
[PROOF STATE]
proof (prove)
using this:
set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R)
set (a # as) \<subseteq> carrier R

goal (1 subgoal):
 1. polynomial (a # as) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
using polynomial.simps(2)[of a as] polynomial_induct_lemma[of "polynomial as" a]
[PROOF STATE]
proof (prove)
using this:
set as \<subseteq> carrier R \<Longrightarrow> polynomial as \<in> carrier (function_ring (carrier R) R)
set (a # as) \<subseteq> carrier R
polynomial (a # as) = (\<lambda>x\<in>carrier R. a \<oplus> x \<otimes> polynomial as x)
\<lbrakk>polynomial as \<in> carrier (function_ring (carrier R) R); a \<in> carrier R\<rbrakk> \<Longrightarrow> (\<lambda>x\<in>carrier R. a \<oplus> x \<otimes> polynomial as x) \<in> carrier (function_ring (carrier R) R)

goal (1 subgoal):
 1. polynomial (a # as) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
polynomial (a # as) \<in> carrier (function_ring (carrier R) R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_less_real_le: "n < m \<longleftrightarrow> real n + 1 \<le> real m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n < m) = (real n + 1 \<le> real m)
[PROOF STEP]
by (metis discrete of_nat_1 of_nat_add of_nat_le_iff)


[STATEMENT]
lemma cexpr_sem_dist_dens_cexpr_nonneg:
  assumes "\<Gamma> \<turnstile>\<^sub>c e1 : dist_param_type dst" "\<Gamma> \<turnstile>\<^sub>c e2 : dist_result_type dst"
  assumes "free_vars e1 \<subseteq> V" "free_vars e2 \<subseteq> V"
  assumes "\<sigma> \<in> space (state_measure V \<Gamma>)"
  shows "ennreal (extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))) =
           dist_dens dst (cexpr_sem \<sigma> e1) (cexpr_sem \<sigma> e2) \<and>
           0 \<le> extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))) = dist_dens dst (cexpr_sem \<sigma> e1) (cexpr_sem \<sigma> e2) \<and> 0 \<le> extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ennreal (extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))) = dist_dens dst (cexpr_sem \<sigma> e1) (cexpr_sem \<sigma> e2) \<and> 0 \<le> extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))
[PROOF STEP]
from val_type_cexpr_sem[OF assms(1,3,5)] and val_type_cexpr_sem[OF assms(2,4,5)]
[PROOF STATE]
proof (chain)
picking this:
val_type (cexpr_sem \<sigma> e1) = dist_param_type dst
val_type (cexpr_sem \<sigma> e2) = dist_result_type dst
[PROOF STEP]
have "cexpr_sem \<sigma> e1 \<in> space (stock_measure (dist_param_type dst))" and
         "cexpr_sem \<sigma> e2 \<in> space (stock_measure (dist_result_type dst))"
[PROOF STATE]
proof (prove)
using this:
val_type (cexpr_sem \<sigma> e1) = dist_param_type dst
val_type (cexpr_sem \<sigma> e2) = dist_result_type dst

goal (1 subgoal):
 1. cexpr_sem \<sigma> e1 \<in> space (stock_measure (dist_param_type dst)) &&& cexpr_sem \<sigma> e2 \<in> space (stock_measure (dist_result_type dst))
[PROOF STEP]
by (auto simp: type_universe_def simp del: type_universe_type)
[PROOF STATE]
proof (state)
this:
cexpr_sem \<sigma> e1 \<in> space (stock_measure (dist_param_type dst))
cexpr_sem \<sigma> e2 \<in> space (stock_measure (dist_result_type dst))

goal (1 subgoal):
 1. ennreal (extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))) = dist_dens dst (cexpr_sem \<sigma> e1) (cexpr_sem \<sigma> e2) \<and> 0 \<le> extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cexpr_sem \<sigma> e1 \<in> space (stock_measure (dist_param_type dst))
cexpr_sem \<sigma> e2 \<in> space (stock_measure (dist_result_type dst))

goal (1 subgoal):
 1. ennreal (extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))) = dist_dens dst (cexpr_sem \<sigma> e1) (cexpr_sem \<sigma> e2) \<and> 0 \<le> extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))
[PROOF STEP]
by (subst dist_dens_cexpr_def, cases dst)
       (auto simp:
            lift_Comp_def lift_RealVal_def lift_RealIntVal_def lift_RealIntVal2_def
            bernoulli_density_def val_type_eq_REAL val_type_eq_BOOL val_type_eq_PRODUCT val_type_eq_INTEG
            uniform_int_density_def uniform_real_density_def
            lift_IntVal_def poisson_density'_def one_ennreal_def
            field_simps gaussian_density_def)
[PROOF STATE]
proof (state)
this:
ennreal (extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))) = dist_dens dst (cexpr_sem \<sigma> e1) (cexpr_sem \<sigma> e2) \<and> 0 \<le> extract_real (cexpr_sem \<sigma> (dist_dens_cexpr dst e1 e2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(get_all_matching_src_ips_executable (Iface ''eth0'')
      (MatchAnd (MatchNot (Match (Src (IpAddrNetmask (ipv4addr_of_dotdecimal (192,168,0,0)) 24)))) (Match (IIface (Iface ''eth0''))))) =
      RangeUnion (WordInterval 0 0xC0A7FFFF) (WordInterval 0xC0A80100 0xFFFFFFFF)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_all_matching_src_ips_executable (Iface ''eth0'') (MatchAnd (MatchNot (Match (Src (IpAddrNetmask (ipv4addr_of_dotdecimal (192, 168, 0, 0)) 24)))) (Match (IIface (Iface ''eth0'')))) = RangeUnion (WordInterval 0 3232235519) (WordInterval 3232235776 4294967295)
[PROOF STEP]
by eval


[STATEMENT]
lemma (in Module) fg_qmodule:"\<lbrakk> M fgover R; submodule R M N\<rbrakk> \<Longrightarrow>
                          (M /\<^sub>m N) fgover R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M fgover R; submodule R M N\<rbrakk> \<Longrightarrow> M /\<^sub>m N fgover R
[PROOF STEP]
apply (frule mpj_mHom[of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N)\<rbrakk> \<Longrightarrow> M /\<^sub>m N fgover R
[PROOF STEP]
apply (frule mpj_surjec [of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N); surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N\<rbrakk> \<Longrightarrow> M /\<^sub>m N fgover R
[PROOF STEP]
apply (rule surjec_finitely_gen [of "M /\<^sub>m N" "mpj M N"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N); surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N\<rbrakk> \<Longrightarrow> R module M /\<^sub>m N
 2. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N); surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N\<rbrakk> \<Longrightarrow> mpj M N \<in> mHom R M (M /\<^sub>m N)
 3. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N); surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N\<rbrakk> \<Longrightarrow> surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N
 4. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N); surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N\<rbrakk> \<Longrightarrow> M fgover R
[PROOF STEP]
apply (simp add:qmodule_module)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N); surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N\<rbrakk> \<Longrightarrow> mpj M N \<in> mHom R M (M /\<^sub>m N)
 2. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N); surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N\<rbrakk> \<Longrightarrow> surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N
 3. \<lbrakk>M fgover R; submodule R M N; mpj M N \<in> mHom R M (M /\<^sub>m N); surjec\<^bsub>M,M /\<^sub>m N\<^esub> mpj M N\<rbrakk> \<Longrightarrow> M fgover R
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(get_exists_matching_src_ips_executable (Iface ''eth0'')
      (MatchAnd (MatchNot (Match (Src (IpAddrNetmask (ipv4addr_of_dotdecimal (192,168,0,0)) 24)))) (Match (IIface (Iface ''eth0''))))) =
      RangeUnion (WordInterval 0 0xC0A7FFFF) (WordInterval 0xC0A80100 0xFFFFFFFF)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_exists_matching_src_ips_executable (Iface ''eth0'') (MatchAnd (MatchNot (Match (Src (IpAddrNetmask (ipv4addr_of_dotdecimal (192, 168, 0, 0)) 24)))) (Match (IIface (Iface ''eth0'')))) = RangeUnion (WordInterval 0 3232235519) (WordInterval 3232235776 4294967295)
[PROOF STEP]
by eval


[STATEMENT]
lemma comp_pows_pref: assumes  "v \<noteq> \<epsilon>" and "(u \<cdot> v)\<^sup>@k \<cdot> u \<le>p (u \<cdot> v)\<^sup>@m" shows "k \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> m
[PROOF STEP]
using pref_exp_le[OF _  pref_extD[OF assms(2)]] assms(1)
[PROOF STATE]
proof (prove)
using this:
u \<cdot> v \<noteq> \<epsilon> \<Longrightarrow> k \<le> m
v \<noteq> \<epsilon>

goal (1 subgoal):
 1. k \<le> m
[PROOF STEP]
by blast


[STATEMENT]
lemma preserve_mat_rep_num:
  assumes "inj_on_01_hom f"
  assumes "i < dim_row M"
  shows "mat_rep_num M i = mat_rep_num (map_mat f M) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_rep_num M i = mat_rep_num (map_mat f M) i
[PROOF STEP]
unfolding mat_rep_num_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_vec (row M i) (1::'b) = count_vec (row (map_mat f M) i) (1::'a)
[PROOF STEP]
using injective_lim.lim_inj_hom_count_vec inj_on_01_hom_def row_map_mat
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>injective_lim ?A ?f; set\<^sub>v ?v \<subseteq> ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> count_vec ?v ?x = count_vec (map_vec ?f ?v) (?f ?x)
inj_on_01_hom ?hom \<equiv> zero_hom ?hom \<and> one_hom ?hom \<and> injective_lim {0::?'a, 1::?'a} ?hom
?i < dim_row ?A \<Longrightarrow> row (map_mat ?f ?A) ?i = map_vec ?f (row ?A ?i)

goal (1 subgoal):
 1. count_vec (row M i) (1::'b) = count_vec (row (map_mat f M) i) (1::'a)
[PROOF STEP]
by (metis assms(1) assms(2) inj_on_01_hom.inj_1_iff insert_iff row_elems_ss01)


[STATEMENT]
lemma fls_base_factor_mult_fls_X_power:
  shows "fls_base_factor (fls_X ^ n * f) = fls_base_factor f"
  and   "fls_base_factor (f * fls_X ^ n) = fls_base_factor f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor (fls_X ^ n * f) = fls_base_factor f &&& fls_base_factor (f * fls_X ^ n) = fls_base_factor f
[PROOF STEP]
using fls_base_factor_shift[of "-int n" f]
[PROOF STATE]
proof (prove)
using this:
fls_base_factor (fls_shift (- int n) f) = fls_base_factor f

goal (1 subgoal):
 1. fls_base_factor (fls_X ^ n * f) = fls_base_factor f &&& fls_base_factor (f * fls_X ^ n) = fls_base_factor f
[PROOF STEP]
by    (auto simp: fls_X_power_times_conv_shift)


[STATEMENT]
lemma projecting_Un:
     "[| projecting C h F XA' XA;  projecting C h F XB' XB |]
      ==> projecting C h F (XA' \<union> XB') (XA \<union> XB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>projecting C h F XA' XA; projecting C h F XB' XB\<rbrakk> \<Longrightarrow> projecting C h F (XA' \<union> XB') (XA \<union> XB)
[PROOF STEP]
by (unfold projecting_def, blast)


[STATEMENT]
lemma lfp_eqvt [eqvt]:
  fixes F::"('a \<Rightarrow> 'b) \<Rightarrow> ('a::pt \<Rightarrow> 'b::{inf_eqvt, le_eqvt})"
  shows "p \<bullet> (lfp F) = lfp (p \<bullet> F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<bullet> lfp F = lfp (p \<bullet> F)
[PROOF STEP]
unfolding lfp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<bullet> Inf {u. F u \<le> u} = Inf {u. (p \<bullet> F) u \<le> u}
[PROOF STEP]
by simp


[STATEMENT]
lemma ennreal_Ex_less_of_nat: "(x::ennreal) < top \<Longrightarrow> \<exists>n. x < of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < top \<Longrightarrow> \<exists>n. x < of_nat n
[PROOF STEP]
by (cases x rule: ennreal_cases)
     (auto simp: ennreal_of_nat_eq_real_of_nat ennreal_less_iff reals_Archimedean2)


[STATEMENT]
lemma gauss_sum_conv_gauss_sum_int:
  "gauss_sum k = gauss_sum_int (int k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_sum k = gauss_sum_int (int k)
[PROOF STEP]
unfolding gauss_sum_def gauss_sum_int_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> m * unity_root n (int m * int k))
[PROOF STEP]
by auto


[STATEMENT]
lemma viterbi_sequence:
  "snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os"
  if "snd (viterbi s t_end os) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < snd (viterbi s t_end os)

goal (1 subgoal):
 1. snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os
[PROOF STEP]
proof (induction os arbitrary: s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s. 0 < snd (viterbi s t_end []) \<Longrightarrow> snd (viterbi s t_end []) = val_of s (fst (viterbi s t_end [])) []
 2. \<And>a os s. \<lbrakk>\<And>s. 0 < snd (viterbi s t_end os) \<Longrightarrow> snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os; 0 < snd (viterbi s t_end (a # os))\<rbrakk> \<Longrightarrow> snd (viterbi s t_end (a # os)) = val_of s (fst (viterbi s t_end (a # os))) (a # os)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
0 < snd (viterbi s t_end [])

goal (2 subgoals):
 1. \<And>s. 0 < snd (viterbi s t_end []) \<Longrightarrow> snd (viterbi s t_end []) = val_of s (fst (viterbi s t_end [])) []
 2. \<And>a os s. \<lbrakk>\<And>s. 0 < snd (viterbi s t_end os) \<Longrightarrow> snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os; 0 < snd (viterbi s t_end (a # os))\<rbrakk> \<Longrightarrow> snd (viterbi s t_end (a # os)) = val_of s (fst (viterbi s t_end (a # os))) (a # os)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < snd (viterbi s t_end [])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < snd (viterbi s t_end [])

goal (1 subgoal):
 1. snd (viterbi s t_end []) = val_of s (fst (viterbi s t_end [])) []
[PROOF STEP]
by (simp add: indicator_def split: if_split_asm split_of_bool_asm)
[PROOF STATE]
proof (state)
this:
snd (viterbi s t_end []) = val_of s (fst (viterbi s t_end [])) []

goal (1 subgoal):
 1. \<And>a os s. \<lbrakk>\<And>s. 0 < snd (viterbi s t_end os) \<Longrightarrow> snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os; 0 < snd (viterbi s t_end (a # os))\<rbrakk> \<Longrightarrow> snd (viterbi s t_end (a # os)) = val_of s (fst (viterbi s t_end (a # os))) (a # os)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a os s. \<lbrakk>\<And>s. 0 < snd (viterbi s t_end os) \<Longrightarrow> snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os; 0 < snd (viterbi s t_end (a # os))\<rbrakk> \<Longrightarrow> snd (viterbi s t_end (a # os)) = val_of s (fst (viterbi s t_end (a # os))) (a # os)
[PROOF STEP]
case (Cons o os s)
[PROOF STATE]
proof (state)
this:
0 < snd (viterbi ?s1 t_end os) \<Longrightarrow> snd (viterbi ?s1 t_end os) = val_of ?s1 (fst (viterbi ?s1 t_end os)) os
0 < snd (viterbi s t_end (o # os))

goal (1 subgoal):
 1. \<And>a os s. \<lbrakk>\<And>s. 0 < snd (viterbi s t_end os) \<Longrightarrow> snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os; 0 < snd (viterbi s t_end (a # os))\<rbrakk> \<Longrightarrow> snd (viterbi s t_end (a # os)) = val_of s (fst (viterbi s t_end (a # os))) (a # os)
[PROOF STEP]
let ?xs = "map
    (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v))
    state_list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a os s. \<lbrakk>\<And>s. 0 < snd (viterbi s t_end os) \<Longrightarrow> snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os; 0 < snd (viterbi s t_end (a # os))\<rbrakk> \<Longrightarrow> snd (viterbi s t_end (a # os)) = val_of s (fst (viterbi s t_end (a # os))) (a # os)
[PROOF STEP]
from state_list_nonempty
[PROOF STATE]
proof (chain)
picking this:
state_list \<noteq> []
[PROOF STEP]
have "?xs \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
state_list \<noteq> []

goal (1 subgoal):
 1. map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list \<noteq> []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list \<noteq> []

goal (1 subgoal):
 1. \<And>a os s. \<lbrakk>\<And>s. 0 < snd (viterbi s t_end os) \<Longrightarrow> snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os; 0 < snd (viterbi s t_end (a # os))\<rbrakk> \<Longrightarrow> snd (viterbi s t_end (a # os)) = val_of s (fst (viterbi s t_end (a # os))) (a # os)
[PROOF STEP]
from argmax(1)[OF this, of snd]
[PROOF STATE]
proof (chain)
picking this:
fst (argmax snd (map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list)) \<in> set (map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list)
[PROOF STEP]
obtain t where
    "t \<in> set state_list"
    "fst (argmax snd ?xs) =
    (t # fst (viterbi t t_end os), ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * snd (viterbi t t_end os))"
[PROOF STATE]
proof (prove)
using this:
fst (argmax snd (map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list)) \<in> set (map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> set state_list; fst (argmax snd (map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list)) = (t # fst (viterbi t t_end os), ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * snd (viterbi t t_end os))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto split: prod.splits)
[PROOF STATE]
proof (state)
this:
t \<in> set state_list
fst (argmax snd (map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list)) = (t # fst (viterbi t t_end os), ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * snd (viterbi t t_end os))

goal (1 subgoal):
 1. \<And>a os s. \<lbrakk>\<And>s. 0 < snd (viterbi s t_end os) \<Longrightarrow> snd (viterbi s t_end os) = val_of s (fst (viterbi s t_end os)) os; 0 < snd (viterbi s t_end (a # os))\<rbrakk> \<Longrightarrow> snd (viterbi s t_end (a # os)) = val_of s (fst (viterbi s t_end (a # os))) (a # os)
[PROOF STEP]
with Cons
[PROOF STATE]
proof (chain)
picking this:
0 < snd (viterbi ?s1 t_end os) \<Longrightarrow> snd (viterbi ?s1 t_end os) = val_of ?s1 (fst (viterbi ?s1 t_end os)) os
0 < snd (viterbi s t_end (o # os))
t \<in> set state_list
fst (argmax snd (map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list)) = (t # fst (viterbi t t_end os), ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * snd (viterbi t t_end os))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < snd (viterbi ?s1 t_end os) \<Longrightarrow> snd (viterbi ?s1 t_end os) = val_of ?s1 (fst (viterbi ?s1 t_end os)) os
0 < snd (viterbi s t_end (o # os))
t \<in> set state_list
fst (argmax snd (map (\<lambda>t. let (xs, v) = viterbi t t_end os in (t # xs, ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * v)) state_list)) = (t # fst (viterbi t t_end os), ennreal (pmf (\<O> t) o * pmf (\<K> s) t) * snd (viterbi t t_end os))

goal (1 subgoal):
 1. snd (viterbi s t_end (o # os)) = val_of s (fst (viterbi s t_end (o # os))) (o # os)
[PROOF STEP]
by (auto simp: ennreal_zero_less_mult_iff)
[PROOF STATE]
proof (state)
this:
snd (viterbi s t_end (o # os)) = val_of s (fst (viterbi s t_end (o # os))) (o # os)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_of_Times_cong1[simp]:
assumes "|A| =o |B|"
shows "|A \<times> C| =o |B \<times> C|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A \<times> C| =o |B \<times> C|
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
|A| =o |B|

goal (1 subgoal):
 1. |A \<times> C| =o |B \<times> C|
[PROOF STEP]
by (simp add: ordIso_iff_ordLeq)


[STATEMENT]
lemma union_nodes_finite:
    assumes "finite (DCA.nodes A)" "finite (DCA.nodes B)"
    shows "finite (DCA.nodes (union A B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (DCA.nodes (DCA_Combine.union A B))
[PROOF STEP]
using union'_nodes_finite assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (DCA.nodes ?A); finite (DCA.nodes ?B)\<rbrakk> \<Longrightarrow> finite (DGCA.nodes (union' ?A ?B))
finite (DCA.nodes A)
finite (DCA.nodes B)

goal (1 subgoal):
 1. finite (DCA.nodes (DCA_Combine.union A B))
[PROOF STEP]
by simp


[STATEMENT]
lemma (in is_cf_adjunction) cf_adjunction_counit_NTMap_op:
  "\<epsilon>\<^sub>C (op_cf_adj \<Phi>)\<lparr>NTMap\<rparr> = \<eta>\<^sub>C \<Phi>\<lparr>NTMap\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<epsilon>\<^sub>C (op_cf_adj \<Phi>)\<lparr>NTMap\<rparr> = \<eta>\<^sub>C \<Phi>\<lparr>NTMap\<rparr>
[PROOF STEP]
by
    (
      rule is_cf_adjunction.cf_adjunction_unit_NTMap_op[
        OF is_cf_adjunction_op,
        unfolded is_cf_adjunction.cf_adjunction_op_cf_adj_op_cf_adj[
          OF is_cf_adjunction_axioms
          ],
        unfolded cat_op_simps,
        symmetric
      ]
   )


[STATEMENT]
lemma closure_minimal: "S \<subseteq> T \<Longrightarrow> closed T \<Longrightarrow> closure S \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; closed T\<rbrakk> \<Longrightarrow> closure S \<subseteq> T
[PROOF STEP]
unfolding closure_hull
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; closed T\<rbrakk> \<Longrightarrow> closed hull S \<subseteq> T
[PROOF STEP]
by (rule hull_minimal)


[STATEMENT]
lemma prod_alg_dvd_prod:
  fixes f :: "'a \<Rightarrow> 'b :: field_char_0"
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x alg_dvd g x"
  shows   "prod f A alg_dvd prod g A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f A alg_dvd prod g A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> f ?x alg_dvd g ?x

goal (1 subgoal):
 1. prod f A alg_dvd prod g A
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma le_add_iff1: "a *\<^sub>R e + c \<le> b *\<^sub>R e + d \<longleftrightarrow> (a - b) *\<^sub>R e + c \<le> d"
  for c d e :: "'a::ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>R e + c \<le> b *\<^sub>R e + d) = ((a - b) *\<^sub>R e + c \<le> d)
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma CD_on_card:
  shows "card (CD_on ds X) = (\<Sum>d\<in>ds. card (Cd d X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (CD_on ds X) = (\<Sum>d\<in>ds. card (Cd d X))
[PROOF STEP]
unfolding CD_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union>d\<in>ds. Cd d X) = (\<Sum>d\<in>ds. card (Cd d X))
[PROOF STEP]
by (simp add: card_UN_disjoint Cd_range_disjoint)


[STATEMENT]
lemma extract_var_single: "extract_var (monom (Poly_Mapping.single v n) a) v = monom 0 (monom (Poly_Mapping.single v n) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_var (monom (Poly_Mapping.single v n) a) v = monom 0 (monom (Poly_Mapping.single v n) a)
[PROOF STEP]
unfolding extract_var_monom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (remove_key v (Poly_Mapping.single v n)) (monom (Poly_Mapping.single v (lookup (Poly_Mapping.single v n) v)) a) = monom 0 (monom (Poly_Mapping.single v n) a)
[PROOF STEP]
by simp


[STATEMENT]
lemma getter_functions: "calculate_data p qs = (get_matrix (calculate_data p qs), (get_subsets (calculate_data p qs), get_signs (calculate_data p qs))) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. calculate_data p qs = (get_matrix (calculate_data p qs), get_subsets (calculate_data p qs), get_signs (calculate_data p qs))
[PROOF STEP]
unfolding get_matrix_def get_subsets_def get_signs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. calculate_data p qs = (fst (calculate_data p qs), fst (snd (calculate_data p qs)), snd (snd (calculate_data p qs)))
[PROOF STEP]
by auto


[STATEMENT]
lemma hyps_free_limited:
  assumes "terminal_path v v' pth"
  shows "length pth \<le> fcard vertices"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
have "length pth = length (map fst (map fst pth))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length pth = length (map fst (map fst pth))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length pth = length (map fst (map fst pth))

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length pth = length (map fst (map fst pth))

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
from hyps_free_vertices_distinct[OF assms]
[PROOF STATE]
proof (chain)
picking this:
distinct (map fst (map fst pth) @ [v'])
[PROOF STEP]
have "distinct (map fst (map fst pth))"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (map fst pth) @ [v'])

goal (1 subgoal):
 1. distinct (map fst (map fst pth))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distinct (map fst (map fst pth))

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
hence "length (map fst (map fst pth)) = card (set (map fst (map fst pth)))"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst (map fst pth))

goal (1 subgoal):
 1. length (map fst (map fst pth)) = card (set (map fst (map fst pth)))
[PROOF STEP]
by (rule distinct_card[symmetric])
[PROOF STATE]
proof (state)
this:
length (map fst (map fst pth)) = card (set (map fst (map fst pth)))

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (map fst (map fst pth)) = card (set (map fst (map fst pth)))

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
have "\<dots> \<le> card (fset vertices)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (map fst (map fst pth))) \<le> card (fset vertices)
[PROOF STEP]
proof (rule card_mono[OF finite_fset])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (map fst (map fst pth)) \<subseteq> fset vertices
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
terminal_path v v' pth
[PROOF STEP]
show "set (map fst (map fst pth)) \<subseteq> fset vertices"
[PROOF STATE]
proof (prove)
using this:
terminal_path v v' pth

goal (1 subgoal):
 1. set (map fst (map fst pth)) \<subseteq> fset vertices
[PROOF STEP]
by (induction v v' pth) (auto, metis valid_edges notin_fset case_prodD valid_out_port.simps)
[PROOF STATE]
proof (state)
this:
set (map fst (map fst pth)) \<subseteq> fset vertices

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (set (map fst (map fst pth))) \<le> card (fset vertices)

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set (map fst (map fst pth))) \<le> card (fset vertices)

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
have "\<dots> = fcard vertices"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (fset vertices) = fcard vertices
[PROOF STEP]
by (simp add: fcard.rep_eq)
[PROOF STATE]
proof (state)
this:
card (fset vertices) = fcard vertices

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length pth \<le> fcard vertices
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length pth \<le> fcard vertices

goal (1 subgoal):
 1. length pth \<le> fcard vertices
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
length pth \<le> fcard vertices

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Suffixes_star [simp]:
  assumes "A \<noteq> {}"
  shows   "Suffixes (star A) = Suffixes A @@ star A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
have "star A = (\<Union>n. A ^^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. star A = \<Union> (range ((^^) A))
[PROOF STEP]
unfolding star_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range ((^^) A)) = \<Union> (range ((^^) A))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
star A = \<Union> (range ((^^) A))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
star A = \<Union> (range ((^^) A))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
have "Suffixes \<dots> = (\<Union>x. Suffixes (A ^^ x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suffixes (\<Union> (range ((^^) A))) = (\<Union>x. Suffixes (A ^^ x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suffixes (\<Union> (range ((^^) A))) = (\<Union>x. Suffixes (A ^^ x))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suffixes (\<Union> (range ((^^) A))) = (\<Union>x. Suffixes (A ^^ x))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
have "\<dots> = (\<Union>n. insert [] (Suffixes A @@ (\<Union>k<n. A ^^ k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x. Suffixes (A ^^ x)) = (\<Union>n. insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}

goal (1 subgoal):
 1. (\<Union>x. Suffixes (A ^^ x)) = (\<Union>n. insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})))
[PROOF STEP]
by (subst Suffixes_compower) auto
[PROOF STATE]
proof (state)
this:
(\<Union>x. Suffixes (A ^^ x)) = (\<Union>n. insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>x. Suffixes (A ^^ x)) = (\<Union>n. insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n})))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
have "\<dots> = insert [] (Suffixes A @@ (\<Union>n. (\<Union>k<n. A ^^ k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n}))) = insert [] (Suffixes A @@ (\<Union>n. \<Union> ((^^) A ` {..<n})))
[PROOF STEP]
by (simp_all add: conc_UNION_distrib)
[PROOF STATE]
proof (state)
this:
(\<Union>n. insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n}))) = insert [] (Suffixes A @@ (\<Union>n. \<Union> ((^^) A ` {..<n})))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>n. insert [] (Suffixes A @@ \<Union> ((^^) A ` {..<n}))) = insert [] (Suffixes A @@ (\<Union>n. \<Union> ((^^) A ` {..<n})))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
have "(\<Union>n. (\<Union>k<n. A ^^ k)) = (\<Union>n. A ^^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. \<Union> ((^^) A ` {..<n})) = \<Union> (range ((^^) A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>n. \<Union> ((^^) A ` {..<n})) = \<Union> (range ((^^) A))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Union>n. \<Union> ((^^) A ` {..<n})) = \<Union> (range ((^^) A))

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
have "\<dots> = star A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range ((^^) A)) = star A
[PROOF STEP]
unfolding star_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range ((^^) A)) = \<Union> (range ((^^) A))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<Union> (range ((^^) A)) = star A

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (range ((^^) A)) = star A

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
have "insert [] (Suffixes A @@ star A) = Suffixes A @@ star A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert [] (Suffixes A @@ star A) = Suffixes A @@ star A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}

goal (1 subgoal):
 1. insert [] (Suffixes A @@ star A) = Suffixes A @@ star A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert [] (Suffixes A @@ star A) = Suffixes A @@ star A

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Suffixes (star A) = Suffixes A @@ star A

goal (1 subgoal):
 1. Suffixes (star A) = Suffixes A @@ star A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Suffixes (star A) = Suffixes A @@ star A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "a \<in> conjunctive \<Longrightarrow> x * a \<le> a * y \<Longrightarrow> (x ^ \<omega>) * a \<le> a * (y ^ \<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> x ^ \<omega> * a \<le> a * y ^ \<omega>
[PROOF STEP]
apply (rule omega_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> x * (a * y ^ \<omega>) \<sqinter> a \<le> a * y ^ \<omega>
[PROOF STEP]
apply (simp add: mult.assoc [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> x * a * y ^ \<omega> \<sqinter> a \<le> a * y ^ \<omega>
[PROOF STEP]
apply (rule_tac y = "a * y * y ^ \<omega> \<sqinter> a" in order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> x * a * y ^ \<omega> \<sqinter> a \<le> a * y * y ^ \<omega> \<sqinter> a
 2. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> a * y * y ^ \<omega> \<sqinter> a \<le> a * y ^ \<omega>
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> x * a * y ^ \<omega> \<sqinter> a \<le> a * y * y ^ \<omega>
 2. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> a * y * y ^ \<omega> \<sqinter> a \<le> a * y ^ \<omega>
[PROOF STEP]
apply (rule_tac y = "x * a * y ^ \<omega>" in order_trans, simp_all)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> x * a * y ^ \<omega> \<le> a * y * y ^ \<omega>
 2. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> a * y * y ^ \<omega> \<sqinter> a \<le> a * y ^ \<omega>
[PROOF STEP]
apply (rule le_comp_right, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> a * y * y ^ \<omega> \<sqinter> a \<le> a * y ^ \<omega>
[PROOF STEP]
apply (simp add: mult.assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> a * (y * y ^ \<omega>) \<sqinter> a \<le> a * y ^ \<omega>
[PROOF STEP]
apply (subst (2) omega_fix)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*); x * a \<le> a * y\<rbrakk> \<Longrightarrow> a * (y * y ^ \<omega>) \<sqinter> a \<le> a * (y * y ^ \<omega> \<sqinter> (1::'a))
[PROOF STEP]
by (simp add: conjunctiveD)


[STATEMENT]
lemma ordsetmap_smap: "\<lbrakk> a\<in>P; b\<in>P; a\<^bold>\<le>b \<rbrakk> \<Longrightarrow> smap a \<subseteq> smap b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> P; b \<in> P; a \<^bold>\<le> b\<rbrakk> \<Longrightarrow> smap a \<subseteq> smap b
[PROOF STEP]
using OrderingSetMap.ordsetmap[
          OF poset_to_PosetComplex_OrderingSetMap, OF below_in_P_simplex_like
        ]
        poset_simplex_map_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> P \<Longrightarrow> x \<in> P; ?a \<in> P; ?b \<in> P; ?a \<^bold>\<le> ?b\<rbrakk> \<Longrightarrow> smap ?a \<subseteq> smap ?b
poset_simplex_map ?P ?x = {y. pseudominimal_in (?P .\<^bold>\<le> ?x) y}

goal (1 subgoal):
 1. \<lbrakk>a \<in> P; b \<in> P; a \<^bold>\<le> b\<rbrakk> \<Longrightarrow> smap a \<subseteq> smap b
[PROOF STEP]
by    simp


[STATEMENT]
lemma synth_analz_mono: "G\<subseteq>H \<Longrightarrow> synth (analz(G)) \<subseteq> synth (analz(H))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<subseteq> H \<Longrightarrow> synth (analz G) \<subseteq> synth (analz H)
[PROOF STEP]
by (iprover intro: synth_mono analz_mono)


[STATEMENT]
lemma alternate_list_of: (* Note that this only holds for finite lists,
                    as the other direction is left undefined with arguments (not just undefined) *)
  assumes "lfinite xs"
  shows "alternate (list_of xs) = list_of (lalternate xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alternate (list_of xs) = list_of (lalternate xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lfinite xs

goal (1 subgoal):
 1. alternate (list_of xs) = list_of (lalternate xs)
[PROOF STEP]
by (metis lalternate_llist_of list_of_llist_of llist_of_list_of)


[STATEMENT]
lemma ltake_lappend1:  "n \<le> llength xs \<Longrightarrow> ltake n (lappend xs ys) = ltake n xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> llength xs \<Longrightarrow> ltake n (lappend xs ys) = ltake n xs
[PROOF STEP]
by(coinduction arbitrary: n xs)(auto intro!: exI simp add: llength_ltl epred_le_epredI ltl_ltake)


[STATEMENT]
lemma merge_pure_star[simp]:
  "\<up>a * \<up>b = \<up>(a\<and>b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<up> a * \<up> b = \<up> (a \<and> b)
[PROOF STEP]
unfolding times_assn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_assn (times_assn_raw (Rep_assn (\<up> a)) (Rep_assn (\<up> b))) = \<up> (a \<and> b)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. times_assn_raw (Rep_assn (\<up> a)) (Rep_assn (\<up> b)) h = (h \<Turnstile> \<up> (a \<and> b))
[PROOF STEP]
unfolding pure_assn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. times_assn_raw (Rep_assn (Abs_assn (pure_assn_raw a))) (Rep_assn (Abs_assn (pure_assn_raw b))) h = (h \<Turnstile> Abs_assn (pure_assn_raw (a \<and> b)))
[PROOF STEP]
apply (simp add: Abs_assn_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. times_assn_raw (pure_assn_raw a) (pure_assn_raw b) h = pure_assn_raw (a \<and> b) h
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in digraph_map) face_cycle_sets_iso:
  assumes hom: "digraph_isomorphism hom"
  shows "pre_digraph_map.face_cycle_sets (app_iso hom G) (map_iso hom) = (\<lambda>x. iso_arcs hom ` x) ` face_cycle_sets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_digraph_map.face_cycle_sets (app_iso hom G) (map_iso hom) = (`) (iso_arcs hom) ` face_cycle_sets
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. pre_digraph_map.face_cycle_sets (app_iso hom G) (map_iso hom) = (`) (iso_arcs hom) ` face_cycle_sets
[PROOF STEP]
by (auto simp: pre_digraph_map.face_cycle_sets_def face_cycle_set_iso) (auto simp: face_cycle_set_iso intro: rev_image_eqI)


[STATEMENT]
lemma minSetOfComponentsTestL2p3:
"minSetOfComponents level2 {data1, data10, data11} = {sS1, sS2, sS3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data10, data11} = {sS1, sS2, sS3}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data10, data11} = {sS1, sS2, sS3}
[PROOF STEP]
have sg1:"outSetOfComponents level2 {data1, data10, data11} = {sS1, sS3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outSetOfComponents level2 {data1, data10, data11} = {sS1, sS3}
[PROOF STEP]
by (simp add: outSetOfComponents_def  AbstrLevel2, auto)
[PROOF STATE]
proof (state)
this:
outSetOfComponents level2 {data1, data10, data11} = {sS1, sS3}

goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data10, data11} = {sS1, sS2, sS3}
[PROOF STEP]
have sS1:"Sources level2 sS1 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources level2 sS1 = {}
[PROOF STEP]
by (simp add: SourcesS1_L2)
[PROOF STATE]
proof (state)
this:
Sources level2 sS1 = {}

goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data10, data11} = {sS1, sS2, sS3}
[PROOF STEP]
have "Sources level2 sS3 = {sS2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources level2 sS3 = {sS2}
[PROOF STEP]
by (simp add: SourcesS3_L2)
[PROOF STATE]
proof (state)
this:
Sources level2 sS3 = {sS2}

goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data10, data11} = {sS1, sS2, sS3}
[PROOF STEP]
with sg1 sS1
[PROOF STATE]
proof (chain)
picking this:
outSetOfComponents level2 {data1, data10, data11} = {sS1, sS3}
Sources level2 sS1 = {}
Sources level2 sS3 = {sS2}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
outSetOfComponents level2 {data1, data10, data11} = {sS1, sS3}
Sources level2 sS1 = {}
Sources level2 sS3 = {sS2}

goal (1 subgoal):
 1. minSetOfComponents level2 {data1, data10, data11} = {sS1, sS2, sS3}
[PROOF STEP]
by (simp add:  minSetOfComponents_def, blast)
[PROOF STATE]
proof (state)
this:
minSetOfComponents level2 {data1, data10, data11} = {sS1, sS2, sS3}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in dcharacter) sum_dcharacter_block':
  "sum \<chi> {Suc 0..n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum \<chi> {Suc 0..n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum \<chi> {Suc 0..n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
let ?f = "\<lambda>k. if k = n then 0 else k" and ?g = "\<lambda>k. if k = 0 then n else k"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum \<chi> {Suc 0..n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
have "sum \<chi> {1..n} = sum \<chi> {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum \<chi> {1..n} = sum \<chi> {..<n}
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. sum \<chi> {1..n} = sum \<chi> {..<n}
[PROOF STEP]
by (intro sum.reindex_bij_witness[where j = ?f and i = ?g]) (auto simp: eq_zero_iff)
[PROOF STATE]
proof (state)
this:
sum \<chi> {1..n} = sum \<chi> {..<n}

goal (1 subgoal):
 1. sum \<chi> {Suc 0..n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sum \<chi> {1..n} = sum \<chi> {..<n}

goal (1 subgoal):
 1. sum \<chi> {Suc 0..n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
by (simp add: sum_dcharacter_block)
[PROOF STATE]
proof (state)
this:
sum \<chi> {Suc 0..n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in comm_monoid_cancel) multlist_prime_pos:
  assumes aprime: "prime G a" and carr: "a \<in> carrier G"
     and as: "set as \<subseteq> carrier G" "a divides (foldr (\<otimes>) as \<one>)"
   shows "\<exists>i<length as. a divides (as!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i<length as. a divides as ! i
[PROOF STEP]
using as
[PROOF STATE]
proof (prove)
using this:
set as \<subseteq> carrier G
a divides foldr (\<otimes>) as \<one>

goal (1 subgoal):
 1. \<exists>i<length as. a divides as ! i
[PROOF STEP]
proof (induction as)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier G; a divides foldr (\<otimes>) [] \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length []. a divides [] ! i
 2. \<And>aa as. \<lbrakk>\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i; set (aa # as) \<subseteq> carrier G; a divides foldr (\<otimes>) (aa # as) \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length (aa # as). a divides (aa # as) ! i
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> carrier G
a divides foldr (\<otimes>) [] \<one>

goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier G; a divides foldr (\<otimes>) [] \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length []. a divides [] ! i
 2. \<And>aa as. \<lbrakk>\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i; set (aa # as) \<subseteq> carrier G; a divides foldr (\<otimes>) (aa # as) \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length (aa # as). a divides (aa # as) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set [] \<subseteq> carrier G
a divides foldr (\<otimes>) [] \<one>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
set [] \<subseteq> carrier G
a divides foldr (\<otimes>) [] \<one>

goal (1 subgoal):
 1. \<exists>i<length []. a divides [] ! i
[PROOF STEP]
by simp (meson Units_one_closed aprime carr divides_unit primeE)
[PROOF STATE]
proof (state)
this:
\<exists>i<length []. a divides [] ! i

goal (1 subgoal):
 1. \<And>aa as. \<lbrakk>\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i; set (aa # as) \<subseteq> carrier G; a divides foldr (\<otimes>) (aa # as) \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length (aa # as). a divides (aa # as) ! i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa as. \<lbrakk>\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i; set (aa # as) \<subseteq> carrier G; a divides foldr (\<otimes>) (aa # as) \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length (aa # as). a divides (aa # as) ! i
[PROOF STEP]
case (Cons x as)
[PROOF STATE]
proof (state)
this:
\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i
set (x # as) \<subseteq> carrier G
a divides foldr (\<otimes>) (x # as) \<one>

goal (1 subgoal):
 1. \<And>aa as. \<lbrakk>\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i; set (aa # as) \<subseteq> carrier G; a divides foldr (\<otimes>) (aa # as) \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length (aa # as). a divides (aa # as) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i
set (x # as) \<subseteq> carrier G
a divides foldr (\<otimes>) (x # as) \<one>
[PROOF STEP]
have "x \<in> carrier G"  "set as \<subseteq> carrier G" and "a divides x \<otimes> foldr (\<otimes>) as \<one>"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i
set (x # as) \<subseteq> carrier G
a divides foldr (\<otimes>) (x # as) \<one>

goal (1 subgoal):
 1. (x \<in> carrier G &&& set as \<subseteq> carrier G) &&& a divides x \<otimes> foldr (\<otimes>) as \<one>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
set as \<subseteq> carrier G
a divides x \<otimes> foldr (\<otimes>) as \<one>

goal (1 subgoal):
 1. \<And>aa as. \<lbrakk>\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i; set (aa # as) \<subseteq> carrier G; a divides foldr (\<otimes>) (aa # as) \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length (aa # as). a divides (aa # as) ! i
[PROOF STEP]
with carr aprime
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier G
prime G a
x \<in> carrier G
set as \<subseteq> carrier G
a divides x \<otimes> foldr (\<otimes>) as \<one>
[PROOF STEP]
have "a divides x \<or> a divides foldr (\<otimes>) as \<one>"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G
prime G a
x \<in> carrier G
set as \<subseteq> carrier G
a divides x \<otimes> foldr (\<otimes>) as \<one>

goal (1 subgoal):
 1. a divides x \<or> a divides foldr (\<otimes>) as \<one>
[PROOF STEP]
by (intro prime_divides) simp+
[PROOF STATE]
proof (state)
this:
a divides x \<or> a divides foldr (\<otimes>) as \<one>

goal (1 subgoal):
 1. \<And>aa as. \<lbrakk>\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i; set (aa # as) \<subseteq> carrier G; a divides foldr (\<otimes>) (aa # as) \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length (aa # as). a divides (aa # as) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a divides x \<or> a divides foldr (\<otimes>) as \<one>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a divides x \<or> a divides foldr (\<otimes>) as \<one>

goal (1 subgoal):
 1. \<exists>i<length (x # as). a divides (x # as) ! i
[PROOF STEP]
using Cons.IH Cons.prems(1)
[PROOF STATE]
proof (prove)
using this:
a divides x \<or> a divides foldr (\<otimes>) as \<one>
\<lbrakk>set as \<subseteq> carrier G; a divides foldr (\<otimes>) as \<one>\<rbrakk> \<Longrightarrow> \<exists>i<length as. a divides as ! i
set (x # as) \<subseteq> carrier G

goal (1 subgoal):
 1. \<exists>i<length (x # as). a divides (x # as) ! i
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>i<length (x # as). a divides (x # as) ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_replicate [simp]: "map f (replicate n x) = replicate n (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (replicate n x) = replicate n (f x)
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma orthogonal_Basis: "pairwise orthogonal Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise orthogonal Basis
[PROOF STEP]
by (simp add: inner_not_same_Basis orthogonal_def pairwise_def)


[STATEMENT]
lemma pos_in_model: "M n \<Longrightarrow> 0 < n \<Longrightarrow> n < n_vars \<Longrightarrow> int n \<in> set (model_to_dimacs_model M [1..<n_vars])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M n; 0 < n; n < n_vars\<rbrakk> \<Longrightarrow> int n \<in> set (model_to_dimacs_model M [1..<n_vars])
[PROOF STEP]
by (induction n_vars) (auto simp add: less_Suc_eq model_to_dimacs_model_append )


[STATEMENT]
lemma subset_inter_diff_empty:
  assumes "s \<subseteq> t"
  shows "(s \<inter> (u - t) = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<inter> (u - t) = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s \<subseteq> t

goal (1 subgoal):
 1. s \<inter> (u - t) = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma phull_closed_mult_scalar: "p \<in> phull B \<Longrightarrow> monomial c 0 \<odot> p \<in> phull B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> phull B \<Longrightarrow> monomial c (0::'a) \<odot> p \<in> phull B
[PROOF STEP]
unfolding map_scale_eq_mult_scalar[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> phull B \<Longrightarrow> c \<cdot> p \<in> phull B
[PROOF STEP]
by (rule phull.span_scale)


[STATEMENT]
lemma dlist_member_empty: "(set (list_of_dlist Dlist.empty)) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (list_of_dlist Dlist.empty) = {}
[PROOF STEP]
by(simp add: Dlist.empty_def)


[STATEMENT]
lemma wellformed_uverts_0 :
  assumes "uwellformed G" and "uverts G = {}"
  shows "card (uedges G) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (uedges G) = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uwellformed G
uverts G = {}

goal (1 subgoal):
 1. card (uedges G) = 0
[PROOF STEP]
by (metis uwellformed_def card.empty ex_in_conv zero_neq_numeral)


[STATEMENT]
lemma big_small_asymmetric: "f \<in> L F (g) \<Longrightarrow> g \<in> l F (f) \<Longrightarrow> eventually (\<lambda>x. f x = 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> L F g; g \<in> l F f\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. f x = (0::'b)
[PROOF STEP]
by (drule (1) big_small_trans) (simp add: small_refl_iff)


[STATEMENT]
lemma ereal_mult_le_0_iff:
  fixes a b :: ereal
  shows "a * b \<le> 0 \<longleftrightarrow> (0 \<le> a \<and> b \<le> 0) \<or> (a \<le> 0 \<and> 0 \<le> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * b \<le> 0) = (0 \<le> a \<and> b \<le> 0 \<or> a \<le> 0 \<and> 0 \<le> b)
[PROOF STEP]
by (cases rule: ereal2_cases[of a b]) (simp_all add: mult_le_0_iff)


[STATEMENT]
lemma leadsETo_UNIV_eq_leadsTo: "(A leadsTo[UNIV] B) = (A leadsTo B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A leadsTo[UNIV] B = A \<longmapsto> B
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> A leadsTo[UNIV] B \<Longrightarrow> x \<in> A \<longmapsto> B
 2. \<And>x. x \<in> A \<longmapsto> B \<Longrightarrow> x \<in> A leadsTo[UNIV] B
[PROOF STEP]
apply (erule leadsETo_subset_leadsTo [THEN subsetD])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<longmapsto> B \<Longrightarrow> x \<in> A leadsTo[UNIV] B
[PROOF STEP]
apply (erule leadsTo_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x A B. x \<in> A ensures B \<Longrightarrow> x \<in> A leadsTo[UNIV] B
 2. \<And>x A B C. \<lbrakk>x \<in> A \<longmapsto> B; x \<in> A leadsTo[UNIV] B; x \<in> B \<longmapsto> C; x \<in> B leadsTo[UNIV] C\<rbrakk> \<Longrightarrow> x \<in> A leadsTo[UNIV] C
 3. \<And>x B S. \<forall>A\<in>S. x \<in> A \<longmapsto> B \<and> x \<in> A leadsTo[UNIV] B \<Longrightarrow> x \<in> \<Union> S leadsTo[UNIV] B
[PROOF STEP]
prefer 3
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x B S. \<forall>A\<in>S. x \<in> A \<longmapsto> B \<and> x \<in> A leadsTo[UNIV] B \<Longrightarrow> x \<in> \<Union> S leadsTo[UNIV] B
 2. \<And>x A B. x \<in> A ensures B \<Longrightarrow> x \<in> A leadsTo[UNIV] B
 3. \<And>x A B C. \<lbrakk>x \<in> A \<longmapsto> B; x \<in> A leadsTo[UNIV] B; x \<in> B \<longmapsto> C; x \<in> B leadsTo[UNIV] C\<rbrakk> \<Longrightarrow> x \<in> A leadsTo[UNIV] C
[PROOF STEP]
apply (blast intro: leadsETo_Union)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x A B. x \<in> A ensures B \<Longrightarrow> x \<in> A leadsTo[UNIV] B
 2. \<And>x A B C. \<lbrakk>x \<in> A \<longmapsto> B; x \<in> A leadsTo[UNIV] B; x \<in> B \<longmapsto> C; x \<in> B leadsTo[UNIV] C\<rbrakk> \<Longrightarrow> x \<in> A leadsTo[UNIV] C
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x A B C. \<lbrakk>x \<in> A \<longmapsto> B; x \<in> A leadsTo[UNIV] B; x \<in> B \<longmapsto> C; x \<in> B leadsTo[UNIV] C\<rbrakk> \<Longrightarrow> x \<in> A leadsTo[UNIV] C
 2. \<And>x A B. x \<in> A ensures B \<Longrightarrow> x \<in> A leadsTo[UNIV] B
[PROOF STEP]
apply (blast intro: leadsETo_Trans, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma positively_invariant_le_domain:
  fixes V :: "'a \<Rightarrow> real"
  assumes "positively_invariant D"
  assumes contg: "continuous_on D g"
  assumes "\<And>x. (V has_derivative V' x) (at x)" (* TODO: domain can be added here too ? *)
  assumes "\<And>s. s \<in> D \<Longrightarrow> V' s (f s) \<le> g s * V s"
  shows "positively_invariant (D \<inter> {x. V x \<le> 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positively_invariant (D \<inter> {x. V x \<le> 0})
[PROOF STEP]
apply (auto intro!:positively_invariant_left_inter[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> D; V x \<le> 0\<rbrakk> \<Longrightarrow> trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> D; V x \<le> 0\<rbrakk> \<Longrightarrow> trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> D; V x \<le> 0\<rbrakk> \<Longrightarrow> trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
assume "x \<in> D" "V x \<le> 0"
[PROOF STATE]
proof (state)
this:
x \<in> D
V x \<le> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> D; V x \<le> 0\<rbrakk> \<Longrightarrow> trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
have "continuous_on (flow0 x ` (existence_ivl0 x \<inter> {0..})) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (flow0 x ` (existence_ivl0 x \<inter> {0..})) g
[PROOF STEP]
by (meson \<open>x \<in> D\<close> assms(1) contg continuous_on_subset positively_invariant_def trapped_forward_def)
[PROOF STATE]
proof (state)
this:
continuous_on (flow0 x ` (existence_ivl0 x \<inter> {0..})) g

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> D; V x \<le> 0\<rbrakk> \<Longrightarrow> trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
from trapped_forward_le[OF \<open>V x \<le> 0\<close> this assms(3)]
[PROOF STATE]
proof (chain)
picking this:
(\<And>s. s \<in> existence_ivl0 x \<inter> {0..} \<Longrightarrow> V' (flow0 x s) (f (flow0 x s)) \<le> g (flow0 x s) * V (flow0 x s)) \<Longrightarrow> trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
show "trapped_forward x {x. V x \<le> 0}"
[PROOF STATE]
proof (prove)
using this:
(\<And>s. s \<in> existence_ivl0 x \<inter> {0..} \<Longrightarrow> V' (flow0 x s) (f (flow0 x s)) \<le> g (flow0 x s) * V (flow0 x s)) \<Longrightarrow> trapped_forward x {x. V x \<le> 0}

goal (1 subgoal):
 1. trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
(\<And>s. s \<in> existence_ivl0 x \<inter> {0..} \<Longrightarrow> V' (flow0 x s) (f (flow0 x s)) \<le> g (flow0 x s) * V (flow0 x s)) \<Longrightarrow> trapped_forward x {x. V x \<le> 0}
?s \<in> D \<Longrightarrow> V' ?s (f ?s) \<le> g ?s * V ?s

goal (1 subgoal):
 1. trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
using \<open>x \<in> D\<close> assms(1) positively_invariant_def trapped_forward_def
[PROOF STATE]
proof (prove)
using this:
(\<And>s. s \<in> existence_ivl0 x \<inter> {0..} \<Longrightarrow> V' (flow0 x s) (f (flow0 x s)) \<le> g (flow0 x s) * V (flow0 x s)) \<Longrightarrow> trapped_forward x {x. V x \<le> 0}
?s \<in> D \<Longrightarrow> V' ?s (f ?s) \<le> g ?s * V ?s
x \<in> D
positively_invariant D
positively_invariant ?M = (\<forall>x\<in>?M. trapped_forward x ?M)
trapped_forward ?x ?K = (flow0 ?x ` (existence_ivl0 ?x \<inter> {0..}) \<subseteq> ?K)

goal (1 subgoal):
 1. trapped_forward x {x. V x \<le> 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trapped_forward x {x. V x \<le> 0}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compare_reals_diff_sgnD:
  "a - (b :: real) < 0 \<Longrightarrow> a < b" "a - b = 0 \<Longrightarrow> a = b" "a - b > 0 \<Longrightarrow> a > b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - b < 0 \<Longrightarrow> a < b) &&& (a - b = 0 \<Longrightarrow> a = b) &&& (0 < a - b \<Longrightarrow> b < a)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma set_integral_mult_left [simp]:
  fixes a :: "'a::{real_normed_field, second_countable_topology}"
  shows "LINT t:A|M. f t * a = (LINT t:A|M. f t) * a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT t:A|M. f t * a = set_lebesgue_integral M A f * a
[PROOF STEP]
unfolding set_lebesgue_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. indicat_real A x *\<^sub>R (f x * a) = (LINT x|M. indicat_real A x *\<^sub>R f x) * a
[PROOF STEP]
by (subst integral_mult_left_zero[symmetric]) auto


[STATEMENT]
lemma image_add_ball [simp]:
  fixes a :: "'a::real_normed_vector"
  shows "(+) b ` ball a r = ball (a+b) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
fix x :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
assume "dist (a + b) x < r"
[PROOF STATE]
proof (state)
this:
dist (a + b) x < r

goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dist (a + b) x < r

goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
have "b + (x - b) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b + (x - b) = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b + (x - b) = x

goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dist (a + b) x < r
b + (x - b) = x
[PROOF STEP]
have "x \<in> (+) b ` ball a r"
[PROOF STATE]
proof (prove)
using this:
dist (a + b) x < r
b + (x - b) = x

goal (1 subgoal):
 1. x \<in> (+) b ` ball a r
[PROOF STEP]
by (metis add.commute dist_add_cancel image_eqI mem_ball)
[PROOF STATE]
proof (state)
this:
x \<in> (+) b ` ball a r

goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
dist (a + b) ?x2 < r \<Longrightarrow> ?x2 \<in> (+) b ` ball a r

goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist (a + b) ?x2 < r \<Longrightarrow> ?x2 \<in> (+) b ` ball a r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dist (a + b) ?x2 < r \<Longrightarrow> ?x2 \<in> (+) b ` ball a r

goal (1 subgoal):
 1. (+) b ` ball a r = ball (a + b) r
[PROOF STEP]
by (auto simp: add.commute)
[PROOF STATE]
proof (state)
this:
(+) b ` ball a r = ball (a + b) r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma between_equality:
  assumes "Bet A B C" and "Bet B A C"
  shows "A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
using assms(1) assms(2) between_identity inner_pasch
[PROOF STATE]
proof (prove)
using this:
Bet A B C
Bet B A C
\<forall>a b. Bet a b a \<longrightarrow> a = b
\<forall>a b c p q. Bet a p c \<and> Bet b q c \<longrightarrow> (\<exists>x. Bet p x b \<and> Bet q x a)

goal (1 subgoal):
 1. A = B
[PROOF STEP]
by blast


[STATEMENT]
lemma scc_root_transfer':
    assumes "discovered s = discovered s'" "tree_edges s = tree_edges s'"
    shows "scc_root s r scc \<longleftrightarrow> scc_root s' r scc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scc_root s r scc = scc_root s' r scc
[PROOF STEP]
unfolding scc_root_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (is_scc E scc \<and> r \<in> scc \<and> r \<in> dom (discovered s) \<and> scc \<inter> dom (discovered s) \<subseteq> (tree_edges s)\<^sup>* `` {r}) = (is_scc E scc \<and> r \<in> scc \<and> r \<in> dom (discovered s') \<and> scc \<inter> dom (discovered s') \<subseteq> (tree_edges s')\<^sup>* `` {r})
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma sums_enn2ereal[simp]: "(\<lambda>i. enn2ereal (f i)) sums enn2ereal x \<longleftrightarrow> f sums x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. enn2ereal (f i)) sums enn2ereal x = f sums x
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i<n. enn2ereal (f i)) \<longlonglongrightarrow> enn2ereal x = (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> x
[PROOF STEP]
by (simp add: always_eventually sum_nonneg)


[STATEMENT]
lemma has_vector_derivative_transform_within:
  assumes "(f has_vector_derivative f') (at x within S)"
    and "0 < d"
    and "x \<in> S"
    and "\<And>x'. \<lbrakk>x'\<in>S; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'"
    shows "(g has_vector_derivative f') (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_vector_derivative f') (at x within S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_vector_derivative f') (at x within S)
0 < d
x \<in> S
\<lbrakk>?x' \<in> S; dist ?x' x < d\<rbrakk> \<Longrightarrow> f ?x' = g ?x'

goal (1 subgoal):
 1. (g has_vector_derivative f') (at x within S)
[PROOF STEP]
unfolding has_vector_derivative_def
[PROOF STATE]
proof (prove)
using this:
(f has_derivative (\<lambda>x. x *\<^sub>R f')) (at x within S)
0 < d
x \<in> S
\<lbrakk>?x' \<in> S; dist ?x' x < d\<rbrakk> \<Longrightarrow> f ?x' = g ?x'

goal (1 subgoal):
 1. (g has_derivative (\<lambda>x. x *\<^sub>R f')) (at x within S)
[PROOF STEP]
by (rule has_derivative_transform_within)