[STATEMENT]
theorem conj_fix_pt: "\<And>f::('a \<Rightarrow> 'b). \<And>g::('b \<Rightarrow> 'b). (bij f)
  \<Longrightarrow> ((inv f)`(Fix g)) = Fix ((inv f) \<circ> g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g. bij f \<Longrightarrow> inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f g. bij f \<Longrightarrow> inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
fix f::"'a \<Rightarrow> 'b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f g. bij f \<Longrightarrow> inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
assume bij_f: "bij f"
[PROOF STATE]
proof (state)
this:
bij f

goal (1 subgoal):
 1. \<And>f g. bij f \<Longrightarrow> inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
with bij_def
[PROOF STATE]
proof (chain)
picking this:
bij ?f = (inj ?f \<and> surj ?f)
bij f
[PROOF STEP]
have inj_f: "inj f"
[PROOF STATE]
proof (prove)
using this:
bij ?f = (inj ?f \<and> surj ?f)
bij f

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

goal (1 subgoal):
 1. \<And>f g. bij f \<Longrightarrow> inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
fix g::"'b\<Rightarrow>'b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f g. bij f \<Longrightarrow> inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
show "((inv f)`(Fix g)) = Fix ((inv f) \<circ> g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
thm set_eq_subset[of "(inv f)`(Fix g)" "Fix((inv f) \<circ> g \<circ> f)"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inv f ` Fix g \<subseteq> Fix (inv f \<circ> g \<circ> f)
 2. Fix (inv f \<circ> g \<circ> f) \<subseteq> inv f ` Fix g
[PROOF STEP]
show "(inv f)`(Fix g) \<subseteq> Fix ((inv f) \<circ> g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f ` Fix g \<subseteq> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
assume "x \<in> (inv f)`(Fix g)"
[PROOF STATE]
proof (state)
this:
x \<in> inv f ` Fix g

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
with image_def
[PROOF STATE]
proof (chain)
picking this:
?f ` ?A = {y. \<exists>x\<in>?A. y = ?f x}
x \<in> inv f ` Fix g
[PROOF STEP]
have "\<exists>y \<in> Fix g. x = (inv f) y"
[PROOF STATE]
proof (prove)
using this:
?f ` ?A = {y. \<exists>x\<in>?A. y = ?f x}
x \<in> inv f ` Fix g

goal (1 subgoal):
 1. \<exists>y\<in>Fix g. x = inv f y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>Fix g. x = inv f y

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>y\<in>Fix g. x = inv f y
[PROOF STEP]
obtain y where y_prop: "y \<in> Fix g \<and> x = (inv f) y"
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>Fix g. x = inv f y

goal (1 subgoal):
 1. (\<And>y. y \<in> Fix g \<and> x = inv f y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> Fix g \<and> x = inv f y

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
hence "x = (inv f) y"
[PROOF STATE]
proof (prove)
using this:
y \<in> Fix g \<and> x = inv f y

goal (1 subgoal):
 1. x = inv f y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x = inv f y

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
hence "f x = (f \<circ> inv f) y"
[PROOF STATE]
proof (prove)
using this:
x = inv f y

goal (1 subgoal):
 1. f x = (f \<circ> inv f) y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x = (f \<circ> inv f) y

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
with bij_f and bij_f_o_inf_f[of f]
[PROOF STATE]
proof (chain)
picking this:
bij f
bij f \<Longrightarrow> f \<circ> inv f = id
f x = (f \<circ> inv f) y
[PROOF STEP]
have f_x_y: "f x = y"
[PROOF STATE]
proof (prove)
using this:
bij f
bij f \<Longrightarrow> f \<circ> inv f = id
f x = (f \<circ> inv f) y

goal (1 subgoal):
 1. f x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x = y

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
from y_prop
[PROOF STATE]
proof (chain)
picking this:
y \<in> Fix g \<and> x = inv f y
[PROOF STEP]
have "y \<in> Fix g"
[PROOF STATE]
proof (prove)
using this:
y \<in> Fix g \<and> x = inv f y

goal (1 subgoal):
 1. y \<in> Fix g
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<in> Fix g

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
with Fix_def[of g]
[PROOF STATE]
proof (chain)
picking this:
Fix g = {n. g n = n}
y \<in> Fix g
[PROOF STEP]
have "g y = y"
[PROOF STATE]
proof (prove)
using this:
Fix g = {n. g n = n}
y \<in> Fix g

goal (1 subgoal):
 1. g y = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g y = y

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
with f_x_y
[PROOF STATE]
proof (chain)
picking this:
f x = y
g y = y
[PROOF STEP]
have "g (f x) = f x"
[PROOF STATE]
proof (prove)
using this:
f x = y
g y = y

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

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
hence "(inv f) (g (f x)) = inv f (f x)"
[PROOF STATE]
proof (prove)
using this:
g (f x) = f x

goal (1 subgoal):
 1. inv f (g (f x)) = inv f (f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv f (g (f x)) = inv f (f x)

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
with inv_f_f and inj_f
[PROOF STATE]
proof (chain)
picking this:
inj ?f \<Longrightarrow> inv ?f (?f ?x) = ?x
inj f
inv f (g (f x)) = inv f (f x)
[PROOF STEP]
have "(inv f) (g (f x)) = x"
[PROOF STATE]
proof (prove)
using this:
inj ?f \<Longrightarrow> inv ?f (?f ?x) = ?x
inj f
inv f (g (f x)) = inv f (f x)

goal (1 subgoal):
 1. inv f (g (f x)) = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv f (g (f x)) = x

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
hence "((inv f) \<circ> g \<circ> f) x = x"
[PROOF STATE]
proof (prove)
using this:
inv f (g (f x)) = x

goal (1 subgoal):
 1. (inv f \<circ> g \<circ> f) x = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(inv f \<circ> g \<circ> f) x = x

goal (1 subgoal):
 1. \<And>x. x \<in> inv f ` Fix g \<Longrightarrow> x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
with Fix_def[of "inv f \<circ> g \<circ> f"]
[PROOF STATE]
proof (chain)
picking this:
Fix (inv f \<circ> g \<circ> f) = {n. (inv f \<circ> g \<circ> f) n = n}
(inv f \<circ> g \<circ> f) x = x
[PROOF STEP]
show "x \<in> Fix ((inv f) \<circ> g \<circ> f)"
[PROOF STATE]
proof (prove)
using this:
Fix (inv f \<circ> g \<circ> f) = {n. (inv f \<circ> g \<circ> f) n = n}
(inv f \<circ> g \<circ> f) x = x

goal (1 subgoal):
 1. x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> Fix (inv f \<circ> g \<circ> f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inv f ` Fix g \<subseteq> Fix (inv f \<circ> g \<circ> f)

goal (1 subgoal):
 1. Fix (inv f \<circ> g \<circ> f) \<subseteq> inv f ` Fix g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Fix (inv f \<circ> g \<circ> f) \<subseteq> inv f ` Fix g
[PROOF STEP]
show "Fix (inv f \<circ> g \<circ> f) \<subseteq> (inv f)`(Fix g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fix (inv f \<circ> g \<circ> f) \<subseteq> inv f ` Fix g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
assume "x \<in> Fix (inv f \<circ> g \<circ> f)"
[PROOF STATE]
proof (state)
this:
x \<in> Fix (inv f \<circ> g \<circ> f)

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
with Fix_def[of "inv f \<circ> g \<circ> f"]
[PROOF STATE]
proof (chain)
picking this:
Fix (inv f \<circ> g \<circ> f) = {n. (inv f \<circ> g \<circ> f) n = n}
x \<in> Fix (inv f \<circ> g \<circ> f)
[PROOF STEP]
have x_fix: "(inv f \<circ> g \<circ> f) x = x"
[PROOF STATE]
proof (prove)
using this:
Fix (inv f \<circ> g \<circ> f) = {n. (inv f \<circ> g \<circ> f) n = n}
x \<in> Fix (inv f \<circ> g \<circ> f)

goal (1 subgoal):
 1. (inv f \<circ> g \<circ> f) x = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(inv f \<circ> g \<circ> f) x = x

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
hence "(inv f) (g(f(x))) = x"
[PROOF STATE]
proof (prove)
using this:
(inv f \<circ> g \<circ> f) x = x

goal (1 subgoal):
 1. inv f (g (f x)) = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv f (g (f x)) = x

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
hence "\<exists>y. (inv f) y = x"
[PROOF STATE]
proof (prove)
using this:
inv f (g (f x)) = x

goal (1 subgoal):
 1. \<exists>y. inv f y = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y. inv f y = x

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. inv f y = x
[PROOF STEP]
obtain y where x_inf_f_y: "x = (inv f) y"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. inv f y = x

goal (1 subgoal):
 1. (\<And>y. x = inv f y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = inv f y

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
with x_fix
[PROOF STATE]
proof (chain)
picking this:
(inv f \<circ> g \<circ> f) x = x
x = inv f y
[PROOF STEP]
have "(inv f \<circ> g \<circ> f)((inv f) y) = (inv f) y"
[PROOF STATE]
proof (prove)
using this:
(inv f \<circ> g \<circ> f) x = x
x = inv f y

goal (1 subgoal):
 1. (inv f \<circ> g \<circ> f) (inv f y) = inv f y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(inv f \<circ> g \<circ> f) (inv f y) = inv f y

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
hence "(f \<circ> inv f \<circ> g \<circ> f \<circ> inv f) (y) = (f \<circ> inv f)(y)"
[PROOF STATE]
proof (prove)
using this:
(inv f \<circ> g \<circ> f) (inv f y) = inv f y

goal (1 subgoal):
 1. (f \<circ> inv f \<circ> g \<circ> f \<circ> inv f) y = (f \<circ> inv f) y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f \<circ> inv f \<circ> g \<circ> f \<circ> inv f) y = (f \<circ> inv f) y

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
with o_assoc
[PROOF STATE]
proof (chain)
picking this:
?f \<circ> (?g \<circ> ?h) = ?f \<circ> ?g \<circ> ?h
(f \<circ> inv f \<circ> g \<circ> f \<circ> inv f) y = (f \<circ> inv f) y
[PROOF STEP]
have "((f \<circ> inv f) \<circ> g \<circ> (f \<circ> inv f)) y = (f \<circ> inv f)y"
[PROOF STATE]
proof (prove)
using this:
?f \<circ> (?g \<circ> ?h) = ?f \<circ> ?g \<circ> ?h
(f \<circ> inv f \<circ> g \<circ> f \<circ> inv f) y = (f \<circ> inv f) y

goal (1 subgoal):
 1. (f \<circ> inv f \<circ> g \<circ> (f \<circ> inv f)) y = (f \<circ> inv f) y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f \<circ> inv f \<circ> g \<circ> (f \<circ> inv f)) y = (f \<circ> inv f) y

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
with bij_f and bij_f_o_inf_f[of f]
[PROOF STATE]
proof (chain)
picking this:
bij f
bij f \<Longrightarrow> f \<circ> inv f = id
(f \<circ> inv f \<circ> g \<circ> (f \<circ> inv f)) y = (f \<circ> inv f) y
[PROOF STEP]
have "g y = y"
[PROOF STATE]
proof (prove)
using this:
bij f
bij f \<Longrightarrow> f \<circ> inv f = id
(f \<circ> inv f \<circ> g \<circ> (f \<circ> inv f)) y = (f \<circ> inv f) y

goal (1 subgoal):
 1. g y = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g y = y

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
with Fix_def[of g]
[PROOF STATE]
proof (chain)
picking this:
Fix g = {n. g n = n}
g y = y
[PROOF STEP]
have "y \<in> Fix g"
[PROOF STATE]
proof (prove)
using this:
Fix g = {n. g n = n}
g y = y

goal (1 subgoal):
 1. y \<in> Fix g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> Fix g

goal (1 subgoal):
 1. \<And>x. x \<in> Fix (inv f \<circ> g \<circ> f) \<Longrightarrow> x \<in> inv f ` Fix g
[PROOF STEP]
with x_inf_f_y
[PROOF STATE]
proof (chain)
picking this:
x = inv f y
y \<in> Fix g
[PROOF STEP]
show "x \<in> (inv f)`(Fix g)"
[PROOF STATE]
proof (prove)
using this:
x = inv f y
y \<in> Fix g

goal (1 subgoal):
 1. x \<in> inv f ` Fix g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> inv f ` Fix g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Fix (inv f \<circ> g \<circ> f) \<subseteq> inv f ` Fix g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inv f ` Fix g = Fix (inv f \<circ> g \<circ> f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma external_equiv_internal_invariant:
  "\<lbrakk> (obs S)`P = Q; observable (obs S) P \<rbrakk>
  \<Longrightarrow> (oreach S \<subseteq> Q) = (reach S \<subseteq> P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>obs S ` P = Q; observable (obs S) P\<rbrakk> \<Longrightarrow> (oreach S \<subseteq> Q) = (reach S \<subseteq> P)
[PROOF STEP]
by (rule external_equiv_internal_invariant_vimage) (auto)


[STATEMENT]
lemma [code abstract]: "vec_nth (mat k) = mat_row k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (mat k) = mat_row k
[PROOF STEP]
unfolding mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (\<chi>i j. if i = j then k else (0::'b)) = mat_row k
[PROOF STEP]
unfolding mat_row_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (\<chi>i j. if i = j then k else (0::'b)) = (\<lambda>i. \<chi>j. if i = j then k else (0::'b))
[PROOF STEP]
by auto


[STATEMENT]
lemma (in linorder) iterate_to_list_map_rev_linord_correct :
assumes it_OK: "map_iterator_rev_linord it m"
shows "map_of (iterate_to_list it) = m \<and> distinct (map fst (iterate_to_list it)) \<and>
       sorted (map fst (iterate_to_list it))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (iterate_to_list it) = m \<and> distinct (map fst (iterate_to_list it)) \<and> sorted (map fst (iterate_to_list it))
[PROOF STEP]
using it_OK
[PROOF STATE]
proof (prove)
using this:
map_iterator_rev_linord it m

goal (1 subgoal):
 1. map_of (iterate_to_list it) = m \<and> distinct (map fst (iterate_to_list it)) \<and> sorted (map fst (iterate_to_list it))
[PROOF STEP]
unfolding map_iterator_rev_linord_foldli_conv
[PROOF STATE]
proof (prove)
using this:
\<exists>l0. distinct (map fst l0) \<and> m = map_of l0 \<and> sorted (rev (map fst l0)) \<and> it = foldli l0

goal (1 subgoal):
 1. map_of (iterate_to_list it) = m \<and> distinct (map fst (iterate_to_list it)) \<and> sorted (map fst (iterate_to_list it))
[PROOF STEP]
by clarify (simp add: rev_map[symmetric])


[STATEMENT]
lemma rbl_word_not: "rev (to_bl (NOT x)) = map Not (rev (to_bl x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (to_bl (NOT x)) = map Not (rev (to_bl x))
[PROOF STEP]
by (simp add: bl_word_not rev_map)


[STATEMENT]
theorem SC_WbisT_Seq: "SC_WbisT (Seq c1 c2)  \<longleftrightarrow> (SC_WbisT c1 \<and> SC_WbisT c2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SC_WbisT (c1 ;; c2) = (SC_WbisT c1 \<and> SC_WbisT c2)
[PROOF STEP]
by auto


[STATEMENT]
lemma fls_mult_subdegree_ge:
  fixes   f g :: "'a::{comm_monoid_add,mult_zero} fls"
  assumes "f*g \<noteq> 0"
  shows   "fls_subdegree (f*g) \<ge> fls_subdegree f + fls_subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_subdegree f + fls_subdegree g \<le> fls_subdegree (f * g)
[PROOF STEP]
by      (auto intro: fls_subdegree_geI simp: assms fls_times_nth_eq0)


[STATEMENT]
lemma sum_list_filter_nonzero:
  "sum_list (filter (\<lambda>x. x \<noteq> 0) xs) = sum_list xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (filter (\<lambda>x. x \<noteq> (0::'a)) xs) = sum_list xs
[PROOF STEP]
by (induction xs) simp_all


[STATEMENT]
lemma aval_plus_symmetry: "aval (Plus x y) s = aval (Plus y x) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aval (Plus x y) s = aval (Plus y x) s
[PROOF STEP]
by (simp add: value_plus_symmetry)


[STATEMENT]
lemma at_infty_ereal_eq_at_top: "at \<infinity> = filtermap ereal at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at \<infinity> = filtermap ereal at_top
[PROOF STEP]
unfolding filter_eq_iff eventually_at_filter eventually_at_top_linorder eventually_filtermap
    top_ereal_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P. (\<forall>\<^sub>F x in nhds top. x \<noteq> top \<longrightarrow> x \<in> UNIV \<longrightarrow> P x) = (\<exists>N. \<forall>n\<ge>N. P (ereal n))
[PROOF STEP]
apply (subst eventually_nhds_top[of 0])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>P. 0 < top
 2. \<forall>P. (\<exists>b<top. \<forall>z>b. z \<noteq> top \<longrightarrow> z \<in> UNIV \<longrightarrow> P z) = (\<exists>N. \<forall>n\<ge>N. P (ereal n))
[PROOF STEP]
apply (auto simp: top_ereal_def less_le ereal_all_split ereal_ex_split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P b. \<forall>z. b \<le> z \<and> b \<noteq> z \<longrightarrow> P (ereal z) \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. P (ereal n)
[PROOF STEP]
apply (metis PInfty_neq_ereal(2) ereal_less_eq(3) ereal_top le_cases order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma closure_eq: "closure S = S \<longleftrightarrow> closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (closure S = S) = closed S
[PROOF STEP]
unfolding closure_hull
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (closed hull S = S) = closed S
[PROOF STEP]
using closed_Inter
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<in>?K. closed S \<Longrightarrow> closed (\<Inter> ?K)

goal (1 subgoal):
 1. (closed hull S = S) = closed S
[PROOF STEP]
by (rule hull_eq)


[STATEMENT]
lemma dimension_pair: "p.dimension = vs1.dimension + vs2.dimension"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p.dimension = vs1.dimension + vs2.dimension
[PROOF STEP]
using dim_Times[OF vs1.subspace_UNIV vs2.subspace_UNIV]
[PROOF STATE]
proof (prove)
using this:
p.dim (UNIV \<times> UNIV) = vs1.dim UNIV + vs2.dim UNIV

goal (1 subgoal):
 1. p.dimension = vs1.dimension + vs2.dimension
[PROOF STEP]
by (auto simp: p.dimension_def vs1.dimension_def vs2.dimension_def)


[STATEMENT]
lemma normalize_snd_quot_of_fract: "normalize (snd (quot_of_fract x)) = snd (quot_of_fract x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (snd (quot_of_fract x)) = snd (quot_of_fract x)
[PROOF STEP]
by (intro unit_factor_1_imp_normalized unit_factor_snd_quot_of_fract)


[STATEMENT]
lemma wp_whilei: "(\<forall>s. P s \<longrightarrow> I s) \<Longrightarrow> (\<forall>s. (I \<sqinter> -T) s \<longrightarrow> Q s) \<Longrightarrow> (\<forall>s. (I \<sqinter> T) s \<longrightarrow> \<lfloor>wp X \<lceil>I\<rceil>\<rfloor> s)
                  \<Longrightarrow> (\<forall>s. P s \<longrightarrow> \<lfloor>wp (WHILE T INV I DO X OD) \<lceil>Q\<rceil>\<rfloor> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>s. P s \<longrightarrow> I s; \<forall>s. (I \<sqinter> - T) s \<longrightarrow> Q s; \<forall>s. (I \<sqinter> T) s \<longrightarrow> \<lfloor>wp X \<lceil>I\<rceil>\<rfloor> s\<rbrakk> \<Longrightarrow> \<forall>s. P s \<longrightarrow> \<lfloor>wp (WHILE T INV I DO X OD) \<lceil>Q\<rceil>\<rfloor> s
[PROOF STEP]
apply (simp only: impl_prop_var[symmetric] wp_simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rdom \<lceil>P\<rceil> \<subseteq> rdom \<lceil>I\<rceil>; rdom \<lceil>I \<sqinter> - T\<rceil> \<subseteq> rdom \<lceil>Q\<rceil>; rdom \<lceil>I \<sqinter> T\<rceil> \<subseteq> wp X \<lceil>I\<rceil>\<rbrakk> \<Longrightarrow> rdom \<lceil>P\<rceil> \<subseteq> wp (WHILE T INV I DO X OD) \<lceil>Q\<rceil>
[PROOF STEP]
by (rule rel_antidomain_kleene_algebra.fbox_whilei, simp_all, simp_all add: p2r_def)


[STATEMENT]
lemma "(0::real) \<le> 1 + 2 * x + x\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> 1 + 2 * x + x\<^sup>2
[PROOF STEP]
by (sos "(((A<0 * R<1) + (R<1 * (R<1 * [x + 1]^2))))")


[STATEMENT]
lemma SUP_pair:
  fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: complete_lattice"
  shows "(SUP i \<in> A. SUP j \<in> B. f i j) = (SUP p \<in> A \<times> B. f (fst p) (snd p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i\<in>A. Sup (f i ` B)) = (SUP p\<in>A \<times> B. f (fst p) (snd p))
[PROOF STEP]
by (rule antisym) (auto intro!: SUP_least SUP_upper2)


[STATEMENT]
lemma differentiable_series':
  fixes f :: "nat \<Rightarrow> ('a :: {real_normed_field,banach}) \<Rightarrow> 'a"
  assumes "convex S" "open S"
  assumes "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)"
  assumes "uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)"
  assumes "x0 \<in> S" "summable (\<lambda>n. f n x0)"
  shows   "(\<lambda>x. \<Sum>n. f n x) differentiable (at x0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) differentiable at x0
[PROOF STEP]
using differentiable_series[OF assms, of x0] \<open>x0 \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>n x. x \<in> S \<Longrightarrow> x \<in> S; x0 \<in> S\<rbrakk> \<Longrightarrow> summable (\<lambda>n. f n x0)
\<lbrakk>\<And>n x. x \<in> S \<Longrightarrow> x \<in> S; x0 \<in> S\<rbrakk> \<Longrightarrow> (\<lambda>x. \<Sum>n. f n x) differentiable at x0
x0 \<in> S

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n. f n x) differentiable at x0
[PROOF STEP]
by blast+


[STATEMENT]
lemma det_four_block_mat_preliminary: assumes A: "(A :: 'a :: idom mat) \<in> carrier_mat n n"
  and B: "B \<in> carrier_mat n n"
  and C: "C \<in> carrier_mat n n"
  and D: "D \<in> carrier_mat n n"
  and commute: "C * D = D * C"
  and detD: "det D \<noteq> 0"
shows "det (four_block_mat A B C D) = det (A * D - B * C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
let ?m = "n + n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
let ?M = "four_block_mat A B C D"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
let ?N = "four_block_mat D (0\<^sub>m n n) (-C) (1\<^sub>m n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
have M: "?M \<in> carrier_mat ?m ?m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D \<in> carrier_mat (n + n) (n + n)
[PROOF STEP]
using A B C D
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n
D \<in> carrier_mat n n

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

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
have N: "?N \<in> carrier_mat ?m ?m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n) \<in> carrier_mat (n + n) (n + n)
[PROOF STEP]
using A B C D
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
C \<in> carrier_mat n n
D \<in> carrier_mat n n

goal (1 subgoal):
 1. four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n) \<in> carrier_mat (n + n) (n + n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n) \<in> carrier_mat (n + n) (n + n)

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
have "det ?M * det ?N = det (?M * ?N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat A B C D) * det (four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n)) = det (four_block_mat A B C D * four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n))
[PROOF STEP]
using det_mult[OF M N]
[PROOF STATE]
proof (prove)
using this:
det (four_block_mat A B C D * four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n)) = det (four_block_mat A B C D) * det (four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n))

goal (1 subgoal):
 1. det (four_block_mat A B C D) * det (four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n)) = det (four_block_mat A B C D * four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
det (four_block_mat A B C D) * det (four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n)) = det (four_block_mat A B C D * four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n))

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (four_block_mat A B C D) * det (four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n)) = det (four_block_mat A B C D * four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n))

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
have "?M * ?N = four_block_mat (A * D - B * C) B (0\<^sub>m n n) D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D * four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n) = four_block_mat (A * D - B * C) B (0\<^sub>m n n) D
[PROOF STEP]
by (subst mult_four_block_mat[OF A B C D D], insert A B C D, auto simp: commute)
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D * four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n) = four_block_mat (A * D - B * C) B (0\<^sub>m n n) D

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D * four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n) = four_block_mat (A * D - B * C) B (0\<^sub>m n n) D

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
have "det \<dots> = det (A * D - B * C) * det D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat (A * D - B * C) B (0\<^sub>m n n) D) = det (A * D - B * C) * det D
[PROOF STEP]
by (rule det_four_block_mat_lower_left_zero, insert A B C D, auto)
[PROOF STATE]
proof (state)
this:
det (four_block_mat (A * D - B * C) B (0\<^sub>m n n) D) = det (A * D - B * C) * det D

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (four_block_mat (A * D - B * C) B (0\<^sub>m n n) D) = det (A * D - B * C) * det D

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
have "det ?N = det D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n)) = det D
[PROOF STEP]
by (subst det_four_block_mat_upper_right_zero[OF D], insert C, auto)
[PROOF STATE]
proof (state)
this:
det (four_block_mat D (0\<^sub>m n n) (- C) (1\<^sub>m n)) = det D

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (four_block_mat A B C D) * det D = det (A * D - B * C) * det D
[PROOF STEP]
have "det ?M * det D = det (A * D - B * C) * det D"
[PROOF STATE]
proof (prove)
using this:
det (four_block_mat A B C D) * det D = det (A * D - B * C) * det D

goal (1 subgoal):
 1. det (four_block_mat A B C D) * det D = det (A * D - B * C) * det D
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (four_block_mat A B C D) * det D = det (A * D - B * C) * det D

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
with detD
[PROOF STATE]
proof (chain)
picking this:
det D \<noteq> (0::'a)
det (four_block_mat A B C D) * det D = det (A * D - B * C) * det D
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det D \<noteq> (0::'a)
det (four_block_mat A B C D) * det D = det (A * D - B * C) * det D

goal (1 subgoal):
 1. det (four_block_mat A B C D) = det (A * D - B * C)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (four_block_mat A B C D) = det (A * D - B * C)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_field:
  assumes "prime (q::nat)"
    and "a < q"
    and "a \<noteq> 0"
  shows "coprime a q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime a q
[PROOF STEP]
by (meson assms coprime_commute dvd_imp_le linorder_not_le neq0_conv prime_imp_coprime)


[STATEMENT]
lemma mk_poly2_col:
  fixes pv :: "'a :: comm_semiring_1 poly vec" and A :: "'a mat"
  assumes i: "i < dim_row A" and dim: "dim_row A = dim_vec pv"
  shows "mk_poly2_col A pv j $ i = pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_poly2_col A pv j $ i = pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
using dim
[PROOF STATE]
proof (prove)
using this:
dim_row A = dim_vec pv

goal (1 subgoal):
 1. mk_poly2_col A pv j $ i = pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
proof (induct j arbitrary: pv)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>pv. dim_row A = dim_vec pv \<Longrightarrow> mk_poly2_col A pv 0 $ i = pv $ i + (\<Sum>j'<0. monom (A $$ (i, dim_col A - Suc j')) j')
 2. \<And>j pv. \<lbrakk>\<And>pv. dim_row A = dim_vec pv \<Longrightarrow> mk_poly2_col A pv j $ i = pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j'); dim_row A = dim_vec pv\<rbrakk> \<Longrightarrow> mk_poly2_col A pv (Suc j) $ i = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
case (Suc j)
[PROOF STATE]
proof (state)
this:
dim_row A = dim_vec ?pv \<Longrightarrow> mk_poly2_col A ?pv j $ i = ?pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j')
dim_row A = dim_vec pv

goal (2 subgoals):
 1. \<And>pv. dim_row A = dim_vec pv \<Longrightarrow> mk_poly2_col A pv 0 $ i = pv $ i + (\<Sum>j'<0. monom (A $$ (i, dim_col A - Suc j')) j')
 2. \<And>j pv. \<lbrakk>\<And>pv. dim_row A = dim_vec pv \<Longrightarrow> mk_poly2_col A pv j $ i = pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j'); dim_row A = dim_vec pv\<rbrakk> \<Longrightarrow> mk_poly2_col A pv (Suc j) $ i = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_poly2_col A pv (Suc j) $ i = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
unfolding mk_poly2_col.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_poly2_row A j (dim_col A - Suc j) (mk_poly2_col A pv j) (dim_row A) $ i = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
apply (subst mk_poly2_row)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dim_row A \<le> dim_vec (mk_poly2_col A pv j)
 2. (if i < dim_row A then mk_poly2_col A pv j $ i + monom (A $$ (i, dim_col A - Suc j)) j else mk_poly2_col A pv j $ i) = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
dim_row A = dim_vec ?pv \<Longrightarrow> mk_poly2_col A ?pv j $ i = ?pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j')
dim_row A = dim_vec pv

goal (2 subgoals):
 1. dim_row A \<le> dim_vec (mk_poly2_col A pv j)
 2. (if i < dim_row A then mk_poly2_col A pv j $ i + monom (A $$ (i, dim_col A - Suc j)) j else mk_poly2_col A pv j $ i) = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dim_row A then mk_poly2_col A pv j $ i + monom (A $$ (i, dim_col A - Suc j)) j else mk_poly2_col A pv j $ i) = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
unfolding Suc(1)[OF Suc(2)]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dim_row A then pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j') + monom (A $$ (i, dim_col A - Suc j)) j else pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j')) = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < dim_row A

goal (1 subgoal):
 1. (if i < dim_row A then pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j') + monom (A $$ (i, dim_col A - Suc j)) j else pv $ i + (\<Sum>j'<j. monom (A $$ (i, dim_col A - Suc j')) j')) = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
by (simp add: add.assoc)
[PROOF STATE]
proof (state)
this:
mk_poly2_col A pv (Suc j) $ i = pv $ i + (\<Sum>j'<Suc j. monom (A $$ (i, dim_col A - Suc j')) j')

goal (1 subgoal):
 1. \<And>pv. dim_row A = dim_vec pv \<Longrightarrow> mk_poly2_col A pv 0 $ i = pv $ i + (\<Sum>j'<0. monom (A $$ (i, dim_col A - Suc j')) j')
[PROOF STEP]
qed simp


[STATEMENT]
lemma bl_bin_addition[simp]: "bl_bin (Oc\<up>(Suc aa) @ Bk # tape_of_nat_list (a # lista) @ [Bk, Oc]) =
              bl_bin (Oc\<up>(Suc aa) @ Bk # tape_of_nat_list (a # lista)) +
              2* 2^(length (Oc\<up>(Suc aa) @ Bk # tape_of_nat_list (a # lista)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl_bin (Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista) @ [Bk, Oc]) = bl_bin (Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista)) + 2 * 2 ^ length (Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista))
[PROOF STEP]
using bl_bin_bk_oc[of "Oc\<up>(Suc aa) @ Bk # tape_of_nat_list (a # lista)"]
[PROOF STATE]
proof (prove)
using this:
bl_bin ((Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista)) @ [Bk, Oc]) = bl_bin (Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista)) + 2 * 2 ^ length (Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista))

goal (1 subgoal):
 1. bl_bin (Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista) @ [Bk, Oc]) = bl_bin (Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista)) + 2 * 2 ^ length (Oc \<up> Suc aa @ Bk # tape_of_nat_list (a # lista))
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma witness_l0': "witness' Y [M] =
    (Pool
      (Conv (id_matrix Y M) (Input M))
      (Conv (id_matrix Y M) (Input M))
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. witness' Y [M] = Pool (Conv (id_matrix Y M) (Input M)) (Conv (id_matrix Y M) (Input M))
[PROOF STEP]
unfolding witness'.simps witness.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pool (Conv ((if length [] = 0 then id_matrix else if length [] = 1 then all1_matrix else copy_first_matrix) Y M) (Input M)) (Conv ((if length [] = 0 then id_matrix else if length [] = 1 then all1_matrix else copy_first_matrix) Y M) (Input M)) = Pool (Conv (id_matrix Y M) (Input M)) (Conv (id_matrix Y M) (Input M))
[PROOF STEP]
by simp


[STATEMENT]
lemma next_plus: "next (m+n) s = next m (next n s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. next (m + n) s = next m (next n s)
[PROOF STEP]
by (induct m, auto)


[STATEMENT]
lemma mult_less_iff1: "0 < z \<Longrightarrow> x * z < y * z \<longleftrightarrow> x < y"
  for x y z :: "'a::linordered_idom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < z \<Longrightarrow> (x * z < y * z) = (x < y)
[PROOF STEP]
by simp


[STATEMENT]
lemma cos_npi [simp]: "cos (real n * pi) = (- 1) ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (real n * pi) = (- 1) ^ n
[PROOF STEP]
by (induct n) (auto simp: distrib_right)


[STATEMENT]
lemma mpi_algo_opt:
  assumes "v0 \<le> \<L>\<^sub>b v0" "eps > 0" "d \<in> D\<^sub>D"
  shows "dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
let ?P = "\<lambda>n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) <  eps * (1 - l)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
let ?n = "Least ?P"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
have "mpi_algo d v0 m = mpi d v0 m ?n" and "?P ?n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpi_algo d v0 m = mpi d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l)) &&& 2 * l * dist (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l))) (\<L>\<^sub>b (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l)))) < eps * (1 - l)
[PROOF STEP]
using mpi_algo_eq_mpi LeastI_ex[OF mpi_val_term_ex] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?d \<in> D\<^sub>D; ?v \<le> \<L>\<^sub>b ?v; 0 < eps\<rbrakk> \<Longrightarrow> mpi_algo ?d ?v ?m = mpi ?d ?v ?m (LEAST n. 2 * l * dist (mpi_val ?d ?v ?m n) (\<L>\<^sub>b (mpi_val ?d ?v ?m n)) < eps * (1 - l))
\<lbrakk>?d0.1 \<in> D\<^sub>D; ?v0.1 \<le> \<L>\<^sub>b ?v0.1; 0 < ?eps1\<rbrakk> \<Longrightarrow> 2 * l * dist (mpi_val ?d0.1 ?v0.1 ?m1 (LEAST n. 2 * l * dist (mpi_val ?d0.1 ?v0.1 ?m1 n) (\<L>\<^sub>b (mpi_val ?d0.1 ?v0.1 ?m1 n)) < ?eps1 * (1 - l))) (\<L>\<^sub>b (mpi_val ?d0.1 ?v0.1 ?m1 (LEAST n. 2 * l * dist (mpi_val ?d0.1 ?v0.1 ?m1 n) (\<L>\<^sub>b (mpi_val ?d0.1 ?v0.1 ?m1 n)) < ?eps1 * (1 - l)))) < ?eps1 * (1 - l)
v0 \<le> \<L>\<^sub>b v0
0 < eps
d \<in> D\<^sub>D

goal (1 subgoal):
 1. mpi_algo d v0 m = mpi d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l)) &&& 2 * l * dist (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l))) (\<L>\<^sub>b (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l)))) < eps * (1 - l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mpi_algo d v0 m = mpi d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l))
2 * l * dist (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l))) (\<L>\<^sub>b (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l)))) < eps * (1 - l)

goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
mpi_algo d v0 m = mpi d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l))
2 * l * dist (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l))) (\<L>\<^sub>b (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l)))) < eps * (1 - l)

goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mpi_algo d v0 m = mpi d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l))
2 * l * dist (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l))) (\<L>\<^sub>b (mpi_val d v0 m (LEAST n. 2 * l * dist (mpi_val d v0 m n) (\<L>\<^sub>b (mpi_val d v0 m n)) < eps * (1 - l)))) < eps * (1 - l)
v0 \<le> \<L>\<^sub>b v0
0 < eps
d \<in> D\<^sub>D

goal (1 subgoal):
 1. dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps
[PROOF STEP]
by (auto simp: mpi_pol_opt mpi_pol_def[symmetric])
[PROOF STATE]
proof (state)
this:
dist (\<nu>\<^sub>b (mk_stationary_det (fst (mpi_algo d v0 m)))) \<nu>\<^sub>b_opt < eps

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_col_to_block_v2: "j < \<b> \<Longrightarrow> \<B>s ! j = (\<lambda> k . \<V>s ! k) ` map_col_to_block (col N j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < \<b> \<Longrightarrow> \<B>s ! j = (!) \<V>s ` map_col_to_block (col N j)
[PROOF STEP]
using matrix_col_to_block map_col_to_block_def
[PROOF STATE]
proof (prove)
using this:
?j < \<b> \<Longrightarrow> \<B>s ! ?j = (!) \<V>s ` {i \<in> {..<\<v>}. col N ?j $ i = 1}
map_col_to_block ?c \<equiv> {i \<in> {..<dim_vec ?c}. ?c $ i = (1::?'a)}

goal (1 subgoal):
 1. j < \<b> \<Longrightarrow> \<B>s ! j = (!) \<V>s ` map_col_to_block (col N j)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in gd_term) compute_trd_aux [code]:
  "trd_aux fs p r =
    (if is_zero p then
      r
    else
      case find_adds fs (lt p) of
        None   \<Rightarrow> trd_aux fs (tail p) (plus_monomial_less r (lc p) (lt p))
      | Some f \<Rightarrow> trd_aux fs (tail p - monom_mult (lc p / lc f) (lp p - lp f) (tail f)) r
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trd_aux fs p r = (if is_zero p then r else case find_adds fs (lt p) of None \<Rightarrow> trd_aux fs (tail p) (plus_monomial_less r (lc p) (lt p)) | Some f \<Rightarrow> trd_aux fs (tail p - monom_mult (lc p / lc f) (lp p - lp f) (tail f)) r)
[PROOF STEP]
by (simp only: trd_aux.simps[of fs p r] plus_monomial_less_def is_zero_def)


[STATEMENT]
lemma weak_equality_spec_weak_equality:
  \<open>(p, p') \<in> mset_poly_rel \<Longrightarrow>
    (r, r') \<in> mset_poly_rel \<Longrightarrow>
    weak_equality_spec p r \<le> weak_equality p' r'\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(p, p') \<in> mset_poly_rel; (r, r') \<in> mset_poly_rel\<rbrakk> \<Longrightarrow> weak_equality_spec p r \<le> weak_equality p' r'
[PROOF STEP]
unfolding weak_equality_spec_def weak_equality_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(p, p') \<in> mset_poly_rel; (r, r') \<in> mset_poly_rel\<rbrakk> \<Longrightarrow> SPEC (\<lambda>ra. ra \<longrightarrow> p = r) \<le> SPEC (\<lambda>r. r \<longrightarrow> p' = r')
[PROOF STEP]
by (auto simp: mset_poly_rel_def)


[STATEMENT]
lemma l15:
  "--(x \<squnion> y) = --x \<squnion> --y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - - (x \<squnion> y) = - - x \<squnion> - - y
[PROOF STEP]
by (simp add: l11 l12 l4)


[STATEMENT]
lemma powreal_le_cancel:
   "\<lbrakk> a pow\<^sub>\<real> r \<le> a pow\<^sub>\<real> s; a > 1 \<rbrakk> \<Longrightarrow> r \<le> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a pow\<^sub>\<real> r \<le> a pow\<^sub>\<real> s; 1 < a\<rbrakk> \<Longrightarrow> r \<le> s
[PROOF STEP]
by (metis not_le powreal_less_mono)


[STATEMENT]
lemma eventually_eventually:
  "eventually (\<lambda>y. eventually P (nhds y)) (nhds x) = eventually P (nhds x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F y in nhds x. eventually P (nhds y)) = eventually P (nhds x)
[PROOF STEP]
by (auto simp: eventually_nhds)


[STATEMENT]
lemma comm_common_power: assumes "r \<cdot> u = u \<cdot> r" shows "r\<^sup>@\<^bold>|u\<^bold>| = u\<^sup>@\<^bold>|r\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<^sup>@ \<^bold>|u\<^bold>| = u \<^sup>@ \<^bold>|r\<^bold>|
[PROOF STEP]
using eqd_eq[OF comm_add_exps[OF \<open>r \<cdot> u = u \<cdot> r\<close>], of "\<^bold>|u\<^bold>|" "\<^bold>|r\<^bold>|"]
[PROOF STATE]
proof (prove)
using this:
\<^bold>|r \<^sup>@ \<^bold>|u\<^bold>|\<^bold>| = \<^bold>|u \<^sup>@ \<^bold>|r\<^bold>|\<^bold>| \<Longrightarrow> r \<^sup>@ \<^bold>|u\<^bold>| = u \<^sup>@ \<^bold>|r\<^bold>| \<and> u \<^sup>@ \<^bold>|r\<^bold>| = r \<^sup>@ \<^bold>|u\<^bold>|

goal (1 subgoal):
 1. r \<^sup>@ \<^bold>|u\<^bold>| = u \<^sup>@ \<^bold>|r\<^bold>|
[PROOF STEP]
unfolding pow_len
[PROOF STATE]
proof (prove)
using this:
\<^bold>|u\<^bold>| * \<^bold>|r\<^bold>| = \<^bold>|r\<^bold>| * \<^bold>|u\<^bold>| \<Longrightarrow> r \<^sup>@ \<^bold>|u\<^bold>| = u \<^sup>@ \<^bold>|r\<^bold>| \<and> u \<^sup>@ \<^bold>|r\<^bold>| = r \<^sup>@ \<^bold>|u\<^bold>|

goal (1 subgoal):
 1. r \<^sup>@ \<^bold>|u\<^bold>| = u \<^sup>@ \<^bold>|r\<^bold>|
[PROOF STEP]
by fastforce


[STATEMENT]
lemma log_eq_div_ln_mult_log:
  "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < b \<Longrightarrow> b \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow>
    log a x = (ln b/ln a) * log b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; a \<noteq> 1; 0 < b; b \<noteq> 1; 0 < x\<rbrakk> \<Longrightarrow> log a x = ln b / ln a * log b x
[PROOF STEP]
by (simp add: log_def divide_inverse)


[STATEMENT]
lemma Suc_policy_measurable_step[measurable]:
  assumes "is_policy p"
  shows "(\<lambda>x. Suc_policy p (fst (fst x)) n (snd (fst x), snd x)) \<in>
    (M \<Otimes>\<^sub>M Pi\<^sub>M {0..<n} (\<lambda>_. M)) \<Otimes>\<^sub>M Ms \<rightarrow>\<^sub>M prob_algebra Ma"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Suc_policy p (fst (fst x)) n (snd (fst x), snd x)) \<in> (M \<Otimes>\<^sub>M Pi\<^sub>M {0..<n} (\<lambda>_. M)) \<Otimes>\<^sub>M Ms \<rightarrow>\<^sub>M prob_algebra Ma
[PROOF STEP]
unfolding Suc_policy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. case (snd (fst x), snd x) of (h, s) \<Rightarrow> p (Suc n) (case_nat (fst (fst x)) h, s)) \<in> (M \<Otimes>\<^sub>M Pi\<^sub>M {0..<n} (\<lambda>_. M)) \<Otimes>\<^sub>M Ms \<rightarrow>\<^sub>M prob_algebra Ma
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_policy p

goal (1 subgoal):
 1. (\<lambda>x. case (snd (fst x), snd x) of (h, s) \<Rightarrow> p (Suc n) (case_nat (fst (fst x)) h, s)) \<in> (M \<Otimes>\<^sub>M Pi\<^sub>M {0..<n} (\<lambda>_. M)) \<Otimes>\<^sub>M Ms \<rightarrow>\<^sub>M prob_algebra Ma
[PROOF STEP]
by measurable (auto
      intro: measurable_PiM_single'
      simp:  space_pair_measure PiE_iff space_PiM extensional_def
      split: nat.split)


[STATEMENT]
lemma of_nat_or_eq:
  \<open>of_nat (m OR n) = of_nat m OR of_nat n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (m OR n) = of_nat m OR of_nat n
[PROOF STEP]
by (rule bit_eqI) (simp add: bit_of_nat_iff bit_or_iff Bit_Operations.bit_or_iff)


[STATEMENT]
lemma borel_measurable_iff_greater:
  "(f::'a \<Rightarrow> real) \<in> borel_measurable M = (\<forall>a. {w \<in> space M. a < f w} \<in> sets M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> borel_measurable M) = (\<forall>a. {w \<in> space M. a < f w} \<in> sets M)
[PROOF STEP]
using borel_measurable_iff_halfspace_greater[where 'c=real]
[PROOF STATE]
proof (prove)
using this:
(?f \<in> borel_measurable ?M) = (\<forall>i\<in>Basis. \<forall>a. {w \<in> space ?M. a < ?f w \<bullet> i} \<in> sets ?M)

goal (1 subgoal):
 1. (f \<in> borel_measurable M) = (\<forall>a. {w \<in> space M. a < f w} \<in> sets M)
[PROOF STEP]
by simp


[STATEMENT]
lemma matrix_vector_mul_diag_mat: "diag_mat f *v s = (\<chi> i. f i * s$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat f *v s = (\<chi>i. f i * s $ i)
[PROOF STEP]
unfolding diag_mat_def matrix_vector_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. \<Sum>j\<in>UNIV. (\<chi>i j. if i = j then f i else (0::'a)) $ i $ j * s $ j) = (\<chi>i. f i * s $ i)
[PROOF STEP]
by simp


[STATEMENT]
lemma deriv_monom_deg_one:
  assumes "a \<in> carrier R"
  assumes "b \<in> carrier R"
  shows "deriv (monom P a 1) b = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (monom P a 1) b = a
[PROOF STEP]
unfolding derivative_def taylor_expansion_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cring_Poly.compose R (monom P a 1) (X_poly_plus R b) 1 = a
[PROOF STEP]
using assms cfs_X_plus[of b 1] sub_monom_deg_one X_plus_closed[of b]
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
b \<in> carrier R
b \<in> carrier R \<Longrightarrow> X_poly_plus R b 1 = (if 1 = 0 then b else if 1 = 1 then \<one> else \<zero>)
\<lbrakk>?p \<in> carrier P; ?a \<in> carrier R\<rbrakk> \<Longrightarrow> Cring_Poly.compose R (monom P ?a 1) ?p = ?a \<odot>\<^bsub>P\<^esub> ?p
b \<in> carrier R \<Longrightarrow> X_poly_plus R b \<in> carrier P

goal (1 subgoal):
 1. Cring_Poly.compose R (monom P a 1) (X_poly_plus R b) 1 = a
[PROOF STEP]
by simp


[STATEMENT]
lemma fpairwise_image[simp]: "fpairwise P (f |`| M) = fpairwise (\<lambda>x y. P (f x) (f y)) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpairwise P (f |`| M) = fpairwise (\<lambda>x y. P (f x) (f y)) M
[PROOF STEP]
by (auto dest: fpairwiseD)


[STATEMENT]
lemma transitive:
  fixes P :: pi
  and   Q :: pi
  and   R :: pi

  assumes "P \<simeq> Q"
  and     "Q \<simeq> R"

  shows "P \<simeq> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<simeq> R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<simeq> R
[PROOF STEP]
have Goal: "\<And>P Q R. \<lbrakk>P \<leadsto><weakBisim> Q; Q \<leadsto><weakBisim> R; P \<approx> Q\<rbrakk> \<Longrightarrow> P \<leadsto><weakBisim> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P Q R. \<lbrakk>P \<leadsto><weakBisim> Q; Q \<leadsto><weakBisim> R; P \<approx> Q\<rbrakk> \<Longrightarrow> P \<leadsto><weakBisim> R
[PROOF STEP]
using Weak_Late_Bisim.eqvt Weak_Late_Bisim.unfoldE Weak_Late_Bisim.transitive
[PROOF STATE]
proof (prove)
using this:
eqvt weakBisim
?P \<approx> ?Q \<Longrightarrow> ?P \<leadsto>\<^sup>^<weakBisim> ?Q
?P \<approx> ?Q \<Longrightarrow> ?Q \<approx> ?P
\<lbrakk>?P \<approx> ?Q; ?Q \<approx> ?R\<rbrakk> \<Longrightarrow> ?P \<approx> ?R

goal (1 subgoal):
 1. \<And>P Q R. \<lbrakk>P \<leadsto><weakBisim> Q; Q \<leadsto><weakBisim> R; P \<approx> Q\<rbrakk> \<Longrightarrow> P \<leadsto><weakBisim> R
[PROOF STEP]
by(blast intro: Weak_Late_Step_Sim.transitive)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?P \<leadsto><weakBisim> ?Q; ?Q \<leadsto><weakBisim> ?R; ?P \<approx> ?Q\<rbrakk> \<Longrightarrow> ?P \<leadsto><weakBisim> ?R

goal (1 subgoal):
 1. P \<simeq> R
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
P \<simeq> Q
Q \<simeq> R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P \<simeq> Q
Q \<simeq> R

goal (1 subgoal):
 1. P \<simeq> R
[PROOF STEP]
apply(simp add: congruence_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<leadsto><weakBisim> Q \<and> Q \<leadsto><weakBisim> P; Q \<leadsto><weakBisim> R \<and> R \<leadsto><weakBisim> Q\<rbrakk> \<Longrightarrow> P \<leadsto><weakBisim> R \<and> R \<leadsto><weakBisim> P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P \<simeq> Q
Q \<simeq> R

goal (1 subgoal):
 1. \<lbrakk>P \<leadsto><weakBisim> Q \<and> Q \<leadsto><weakBisim> P; Q \<leadsto><weakBisim> R \<and> R \<leadsto><weakBisim> Q\<rbrakk> \<Longrightarrow> P \<leadsto><weakBisim> R \<and> R \<leadsto><weakBisim> P
[PROOF STEP]
by(blast intro: Goal dest: congruenceWeakBisim symetric)
[PROOF STATE]
proof (state)
this:
P \<simeq> R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma decseq_eq_incseq: "decseq X = incseq (\<lambda>n. - X n)"
  for X :: "nat \<Rightarrow> 'a::ordered_ab_group_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decseq X = incseq (\<lambda>n. - X n)
[PROOF STEP]
by (simp add: decseq_def incseq_def)


[STATEMENT]
lemma span_delete_0 [simp]: "span(S - {0}) = span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (S - {0::'b}) = span S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. span (S - {0::'b}) \<subseteq> span S
 2. span S \<subseteq> span (S - {0::'b})
[PROOF STEP]
show "span (S - {0}) \<subseteq> span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (S - {0::'b}) \<subseteq> span S
[PROOF STEP]
by (blast intro!: span_mono)
[PROOF STATE]
proof (state)
this:
span (S - {0::'b}) \<subseteq> span S

goal (1 subgoal):
 1. span S \<subseteq> span (S - {0::'b})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span S \<subseteq> span (S - {0::'b})
[PROOF STEP]
have "span S \<subseteq> span(insert 0 (S - {0}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span S \<subseteq> span (insert (0::'b) (S - {0::'b}))
[PROOF STEP]
by (blast intro!: span_mono)
[PROOF STATE]
proof (state)
this:
span S \<subseteq> span (insert (0::'b) (S - {0::'b}))

goal (1 subgoal):
 1. span S \<subseteq> span (S - {0::'b})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
span S \<subseteq> span (insert (0::'b) (S - {0::'b}))

goal (1 subgoal):
 1. span S \<subseteq> span (S - {0::'b})
[PROOF STEP]
have "... \<subseteq> span(S - {0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert (0::'b) (S - {0::'b})) \<subseteq> span (S - {0::'b})
[PROOF STEP]
using span_insert_0
[PROOF STATE]
proof (prove)
using this:
span (insert (0::'b) ?S) = span ?S

goal (1 subgoal):
 1. span (insert (0::'b) (S - {0::'b})) \<subseteq> span (S - {0::'b})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
span (insert (0::'b) (S - {0::'b})) \<subseteq> span (S - {0::'b})

goal (1 subgoal):
 1. span S \<subseteq> span (S - {0::'b})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
span S \<subseteq> span (S - {0::'b})
[PROOF STEP]
show "span S \<subseteq> span (S - {0})"
[PROOF STATE]
proof (prove)
using this:
span S \<subseteq> span (S - {0::'b})

goal (1 subgoal):
 1. span S \<subseteq> span (S - {0::'b})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
span S \<subseteq> span (S - {0::'b})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bool_to_ternary_pullup1:
    "eval_ternary_Not (bool_to_ternary X) = bool_to_ternary (\<not> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_ternary_Not (bool_to_ternary X) = bool_to_ternary (\<not> X)
[PROOF STEP]
by(cases X)(simp_all)


[STATEMENT]
lemma size_union_distinct_cart_prod: "x1 \<noteq> x2 \<Longrightarrow> size (({#x1#} \<times># A) \<union># ({#x2#} \<times># B)) =
    size ({#x1#} \<times># A) + size ({#x2#} \<times># B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 \<noteq> x2 \<Longrightarrow> size ({#x1#} \<times># A \<union># {#x2#} \<times># B) = size ({#x1#} \<times># A) + size ({#x2#} \<times># B)
[PROOF STEP]
by (simp add: cart_product_single_intersect size_Un_disjoint)


[STATEMENT]
lemma homeomorphism_on_continuous:
  assumes "homeomorphism_on S f"
  shows "continuous_on S f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
homeomorphism_on S f

goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
unfolding homeomorphism_on_def homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
\<exists>g. (\<forall>x\<in>S. g (f x) = x) \<and> f ` S = f ` S \<and> continuous_on S f \<and> (\<forall>y\<in>f ` S. f (g y) = y) \<and> g ` f ` S = S \<and> continuous_on (f ` S) g

goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
by auto


[STATEMENT]
lemma nat_of_omega:
  assumes "n \<in>\<^sub>\<circ> \<omega>"
  obtains m where "n = m\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. n = m\<^sub>\<nat> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<in>\<^sub>\<circ> \<omega>

goal (1 subgoal):
 1. (\<And>m. n = m\<^sub>\<nat> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding \<omega>_def
[PROOF STATE]
proof (prove)
using this:
n \<in>\<^sub>\<circ> set (range ord_of_nat)

goal (1 subgoal):
 1. (\<And>m. n = m\<^sub>\<nat> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by clarsimp


[STATEMENT]
lemma cnf_of_big_or_of_literal_formulas_is[simp]:
  assumes "\<forall>f \<in> set fs. is_literal_formula f"
  shows "cnf (\<^bold>\<Or>fs) = {{ literal_formula_to_literal f | f. f \<in> set fs }}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>f\<in>set fs. is_literal_formula f

goal (1 subgoal):
 1. cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}
[PROOF STEP]
proof (induction fs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
case (Cons f fs)
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set fs. is_literal_formula a \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}
\<forall>a\<in>set (f # fs). is_literal_formula a

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set fs. is_literal_formula a \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}
\<forall>a\<in>set (f # fs). is_literal_formula a

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
have is_literal_formula_f: "is_literal_formula f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_literal_formula f
[PROOF STEP]
using Cons.prems(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (f # fs). is_literal_formula a

goal (1 subgoal):
 1. is_literal_formula f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_literal_formula f

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_literal_formula f
[PROOF STEP]
have "cnf f = {{ literal_formula_to_literal f }}"
[PROOF STATE]
proof (prove)
using this:
is_literal_formula f

goal (1 subgoal):
 1. cnf f = {{literal_formula_to_literal f}}
[PROOF STEP]
using cnf_of_literal_formula
[PROOF STATE]
proof (prove)
using this:
is_literal_formula f
is_literal_formula ?f \<Longrightarrow> cnf ?f = {{literal_formula_to_literal ?f}}

goal (1 subgoal):
 1. cnf f = {{literal_formula_to_literal f}}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cnf f = {{literal_formula_to_literal f}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
cnf f = {{literal_formula_to_literal f}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
note nb\<^sub>1 = this
[PROOF STATE]
proof (state)
this:
cnf f = {{literal_formula_to_literal f}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
cnf f = {{literal_formula_to_literal f}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
have "\<forall>f' \<in> set fs. is_literal_formula f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f'\<in>set fs. is_literal_formula f'
[PROOF STEP]
using Cons.prems
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (f # fs). is_literal_formula a

goal (1 subgoal):
 1. \<forall>f'\<in>set fs. is_literal_formula f'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>f'\<in>set fs. is_literal_formula f'

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
hence "cnf (\<^bold>\<Or>fs) = {{ literal_formula_to_literal f | f. f \<in> set fs }}"
[PROOF STATE]
proof (prove)
using this:
\<forall>f'\<in>set fs. is_literal_formula f'

goal (1 subgoal):
 1. cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}
[PROOF STEP]
using Cons.IH
[PROOF STATE]
proof (prove)
using this:
\<forall>f'\<in>set fs. is_literal_formula f'
\<forall>a\<in>set fs. is_literal_formula a \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}

goal (1 subgoal):
 1. cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
note nb\<^sub>2 = this
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
have "cnf (\<^bold>\<Or>(f # fs)) = (\<lambda>(g, h). g \<union> h)
      ` ({{ literal_formula_to_literal f}}
        \<times> {{ literal_formula_to_literal f' | f'. f' \<in> set fs }})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnf \<^bold>\<Or>f # fs = (\<lambda>(x, y). x \<union> y) ` ({{literal_formula_to_literal f}} \<times> {{literal_formula_to_literal f' |f'. f' \<in> set fs}})
[PROOF STEP]
using nb\<^sub>1 nb\<^sub>2
[PROOF STATE]
proof (prove)
using this:
cnf f = {{literal_formula_to_literal f}}
cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}

goal (1 subgoal):
 1. cnf \<^bold>\<Or>f # fs = (\<lambda>(x, y). x \<union> y) ` ({{literal_formula_to_literal f}} \<times> {{literal_formula_to_literal f' |f'. f' \<in> set fs}})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>f # fs = (\<lambda>(x, y). x \<union> y) ` ({{literal_formula_to_literal f}} \<times> {{literal_formula_to_literal f' |f'. f' \<in> set fs}})

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>f # fs = (\<lambda>(x, y). x \<union> y) ` ({{literal_formula_to_literal f}} \<times> {{literal_formula_to_literal f' |f'. f' \<in> set fs}})

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
have "\<dots> = {{ literal_formula_to_literal f}
      \<union> { literal_formula_to_literal f' | f'. f' \<in> set fs }}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). x \<union> y) ` ({{literal_formula_to_literal f}} \<times> {{literal_formula_to_literal f' |f'. f' \<in> set fs}}) = {{literal_formula_to_literal f} \<union> {literal_formula_to_literal f' |f'. f' \<in> set fs}}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
(\<lambda>(x, y). x \<union> y) ` ({{literal_formula_to_literal f}} \<times> {{literal_formula_to_literal f' |f'. f' \<in> set fs}}) = {{literal_formula_to_literal f} \<union> {literal_formula_to_literal f' |f'. f' \<in> set fs}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cnf \<^bold>\<Or>f # fs = {{literal_formula_to_literal f} \<union> {literal_formula_to_literal f' |f'. f' \<in> set fs}}
[PROOF STEP]
have "cnf (\<^bold>\<Or>(f # fs)) = {{ literal_formula_to_literal f' | f'. f' \<in> set (f # fs) }}"
[PROOF STATE]
proof (prove)
using this:
cnf \<^bold>\<Or>f # fs = {{literal_formula_to_literal f} \<union> {literal_formula_to_literal f' |f'. f' \<in> set fs}}

goal (1 subgoal):
 1. cnf \<^bold>\<Or>f # fs = {{literal_formula_to_literal f' |f'. f' \<in> set (f # fs)}}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>f # fs = {{literal_formula_to_literal f' |f'. f' \<in> set (f # fs)}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>f # fs = {{literal_formula_to_literal f' |f'. f' \<in> set (f # fs)}}

goal (2 subgoals):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>fs = {{literal_formula_to_literal f |f. f \<in> set fs}}; Ball (set (a # fs)) is_literal_formula\<rbrakk> \<Longrightarrow> cnf \<^bold>\<Or>a # fs = {{literal_formula_to_literal f |f. f \<in> set (a # fs)}}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
cnf \<^bold>\<Or>f # fs = {{literal_formula_to_literal f' |f'. f' \<in> set (f # fs)}}

goal (1 subgoal):
 1. cnf \<^bold>\<Or>f # fs = {{literal_formula_to_literal fa |fa. fa \<in> set (f # fs)}}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cnf \<^bold>\<Or>f # fs = {{literal_formula_to_literal fa |fa. fa \<in> set (f # fs)}}

goal (1 subgoal):
 1. Ball (set []) is_literal_formula \<Longrightarrow> cnf \<^bold>\<Or>[] = {{literal_formula_to_literal f |f. f \<in> set []}}
[PROOF STEP]
qed simp


[STATEMENT]
lemma lfilter_unique_weak:
  "(\<And>xs. f xs = (if \<forall>x \<in> lset xs. \<not> P x then LNil
    else if P (lhd xs) then LCons (lhd xs) (f (ltl xs))
    else lfilter P (ltl xs)))
   \<Longrightarrow> f = lfilter P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>xs. f xs = (if \<forall>x\<in>lset xs. \<not> P x then LNil else if P (lhd xs) then LCons (lhd xs) (f (ltl xs)) else lfilter P (ltl xs))) \<Longrightarrow> f = lfilter P
[PROOF STEP]
by(corec_unique)(rule ext lfilter.code)+


[STATEMENT]
lemma lm09: assumes "trivial X"
              shows "(Pow X \<subseteq> {{},X})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pow X \<subseteq> {{}, X}
[PROOF STEP]
using assms trivial_same
[PROOF STATE]
proof (prove)
using this:
trivial X
trivial ?X = (\<forall>x1\<in>?X. \<forall>x2\<in>?X. x1 = x2)

goal (1 subgoal):
 1. Pow X \<subseteq> {{}, X}
[PROOF STEP]
by fast


[STATEMENT]
lemma col_transpose[simp]:
  "i < dim_row A \<Longrightarrow> col (transpose_mat A) i = row A i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < dim_row A \<Longrightarrow> col (transpose_mat A) i = row A i
[PROOF STEP]
unfolding row_def col_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < dim_row A \<Longrightarrow> vec (dim_row (transpose_mat A)) (\<lambda>ia. transpose_mat A $$ (ia, i)) = vec (dim_col A) (\<lambda>j. A $$ (i, j))
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma sfirst_eq_enat_iff: "sfirst P \<omega> = enat n \<longleftrightarrow> ev_at P n \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sfirst P \<omega> = enat n) = ev_at P n \<omega>
[PROOF STEP]
by (induction n arbitrary: \<omega>)
     (simp_all add: eSuc_enat[symmetric] sfirst.simps enat_0)


[STATEMENT]
lemma union_diff2:
  assumes "finite A" and "finite B"
  shows "F g (A \<union> B) = F g (A - B) \<^bold>* F g (B - A) \<^bold>* F g (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g (A \<union> B) = F g (A - B) \<^bold>* F g (B - A) \<^bold>* F g (A \<inter> B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F g (A \<union> B) = F g (A - B) \<^bold>* F g (B - A) \<^bold>* F g (A \<inter> B)
[PROOF STEP]
have "A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B

goal (1 subgoal):
 1. F g (A \<union> B) = F g (A - B) \<^bold>* F g (B - A) \<^bold>* F g (A \<inter> B)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
A \<union> B = A - B \<union> (B - A) \<union> A \<inter> B

goal (1 subgoal):
 1. F g (A \<union> B) = F g (A - B) \<^bold>* F g (B - A) \<^bold>* F g (A \<inter> B)
[PROOF STEP]
by simp (subst union_disjoint, auto)+
[PROOF STATE]
proof (state)
this:
F g (A \<union> B) = F g (A - B) \<^bold>* F g (B - A) \<^bold>* F g (A \<inter> B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma single_valued_UN_chain:
  assumes "chain S" "(\<And>n. single_valued (S n))"
  shows "single_valued(UN n. S n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued (\<Union> (range S))
[PROOF STEP]
proof(auto simp: single_valued_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y xa z xb. \<lbrakk>(x, y) \<in> S xa; (x, z) \<in> S xb\<rbrakk> \<Longrightarrow> y = z
[PROOF STEP]
fix m n x y z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y xa z xb. \<lbrakk>(x, y) \<in> S xa; (x, z) \<in> S xb\<rbrakk> \<Longrightarrow> y = z
[PROOF STEP]
assume "(x, y) \<in> S m" "(x, z) \<in> S n"
[PROOF STATE]
proof (state)
this:
(x, y) \<in> S m
(x, z) \<in> S n

goal (1 subgoal):
 1. \<And>x y xa z xb. \<lbrakk>(x, y) \<in> S xa; (x, z) \<in> S xb\<rbrakk> \<Longrightarrow> y = z
[PROOF STEP]
with chain_total[OF assms(1), of m n] assms(2)
[PROOF STATE]
proof (chain)
picking this:
S m \<subseteq> S n \<or> S n \<subseteq> S m
single_valued (S ?n)
(x, y) \<in> S m
(x, z) \<in> S n
[PROOF STEP]
show "y = z"
[PROOF STATE]
proof (prove)
using this:
S m \<subseteq> S n \<or> S n \<subseteq> S m
single_valued (S ?n)
(x, y) \<in> S m
(x, z) \<in> S n

goal (1 subgoal):
 1. y = z
[PROOF STEP]
by (auto simp: single_valued_def)
[PROOF STATE]
proof (state)
this:
y = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sup_upto_llist_enat_0[simp]:
  "Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
proof (cases "lnull Xs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lnull Xs \<Longrightarrow> Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
 2. \<not> lnull Xs \<Longrightarrow> Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
lnull Xs

goal (2 subgoals):
 1. lnull Xs \<Longrightarrow> Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
 2. \<not> lnull Xs \<Longrightarrow> Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lnull Xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lnull Xs

goal (1 subgoal):
 1. Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
unfolding Sup_upto_llist_def
[PROOF STATE]
proof (prove)
using this:
lnull Xs

goal (1 subgoal):
 1. \<Union> (lnth Xs ` {i. enat i < llength Xs \<and> enat i \<le> enat 0}) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)

goal (1 subgoal):
 1. \<not> lnull Xs \<Longrightarrow> Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> lnull Xs \<Longrightarrow> Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> lnull Xs

goal (1 subgoal):
 1. \<not> lnull Xs \<Longrightarrow> Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
unfolding Sup_upto_llist_def image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {y. \<exists>x\<in>{i. enat i < llength Xs \<and> enat i \<le> enat 0}. y = lnth Xs x} = (if lnull Xs then {} else lhd Xs)
[PROOF STEP]
by (simp add: lhd_conv_lnth enat_0 enat_0_iff)
[PROOF STATE]
proof (state)
this:
Sup_upto_llist Xs (enat 0) = (if lnull Xs then {} else lhd Xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Mon2Rel_Rel2Mon_id: assumes det:"single_valued R" shows "(Mon2Rel \<circ> Rel2Mon) R = R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Mon2Rel \<circ> Rel2Mon) R = R
[PROOF STEP]
apply (simp add: comp_def Mon2Rel_def Rel2Mon_def,auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b. (if \<exists>\<sigma>'. (a, \<sigma>') \<in> R then Some ((), SOME \<sigma>'. (a, \<sigma>') \<in> R) else None) = Some ((), b) \<Longrightarrow> (a, b) \<in> R
 2. \<And>a b \<sigma>'. \<lbrakk>(a, b) \<in> R; (a, \<sigma>') \<in> R\<rbrakk> \<Longrightarrow> (SOME \<sigma>'. (a, \<sigma>') \<in> R) = b
 3. \<And>a b. (a, b) \<in> R \<Longrightarrow> \<exists>\<sigma>'. (a, \<sigma>') \<in> R
[PROOF STEP]
apply (case_tac "\<exists>\<sigma>'. (a, \<sigma>') \<in> R", auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a \<sigma>'. (a, \<sigma>') \<in> R \<Longrightarrow> (a, SOME \<sigma>'. (a, \<sigma>') \<in> R) \<in> R
 2. \<And>a b \<sigma>'. \<lbrakk>(a, b) \<in> R; (a, \<sigma>') \<in> R\<rbrakk> \<Longrightarrow> (SOME \<sigma>'. (a, \<sigma>') \<in> R) = b
[PROOF STEP]
apply (subst (2) some_eq_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a \<sigma>'. (a, \<sigma>') \<in> R \<Longrightarrow> \<exists>x. (a, x) \<in> R
 2. \<And>a b \<sigma>'. \<lbrakk>(a, b) \<in> R; (a, \<sigma>') \<in> R\<rbrakk> \<Longrightarrow> (SOME \<sigma>'. (a, \<sigma>') \<in> R) = b
[PROOF STEP]
using det[simplified single_valued_def]
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (x, y) \<in> R \<longrightarrow> (\<forall>z. (x, z) \<in> R \<longrightarrow> y = z)

goal (2 subgoals):
 1. \<And>a \<sigma>'. (a, \<sigma>') \<in> R \<Longrightarrow> \<exists>x. (a, x) \<in> R
 2. \<And>a b \<sigma>'. \<lbrakk>(a, b) \<in> R; (a, \<sigma>') \<in> R\<rbrakk> \<Longrightarrow> (SOME \<sigma>'. (a, \<sigma>') \<in> R) = b
[PROOF STEP]
by auto


[STATEMENT]
lemma (in prob_space) AE_I_eq_1:
  assumes "emeasure M {x\<in>space M. P x} = 1" "{x\<in>space M. P x} \<in> sets M"
  shows "AE x in M. P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere M P
[PROOF STEP]
proof (rule AE_I)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. {x \<in> space M. \<not> P x} \<subseteq> ?N
 2. emeasure M ?N = 0
 3. ?N \<in> events
[PROOF STEP]
show "emeasure M (space M - {x \<in> space M. P x}) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (space M - {x \<in> space M. P x}) = 0
[PROOF STEP]
using assms emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
emeasure M {x \<in> space M. P x} = 1
{x \<in> space M. P x} \<in> events
emeasure M (space M) = 1

goal (1 subgoal):
 1. emeasure M (space M - {x \<in> space M. P x}) = 0
[PROOF STEP]
by (simp add: emeasure_compl)
[PROOF STATE]
proof (state)
this:
emeasure M (space M - {x \<in> space M. P x}) = 0

goal (2 subgoals):
 1. {x \<in> space M. \<not> P x} \<subseteq> space M - {x \<in> space M. P x}
 2. space M - {x \<in> space M. P x} \<in> events
[PROOF STEP]
qed (insert assms, auto)


[STATEMENT]
lemma bounded_pos: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x \<le> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S = (\<exists>b>0. \<forall>x\<in>S. norm x \<le> b)
[PROOF STEP]
unfolding bounded_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>a. \<forall>x\<in>S. norm x \<le> a) = (\<exists>b>0. \<forall>x\<in>S. norm x \<le> b)
[PROOF STEP]
by (meson less_imp_le not_le order_trans zero_less_one)


[STATEMENT]
lemma eventually_nonneg_ln_const [eventually_nonzero_simps]:
  "b > 0 \<Longrightarrow> eventually_nonneg at_top (\<lambda>x. ln (b*x) :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> eventually_nonneg at_top (\<lambda>x. ln (b * x))
[PROOF STEP]
unfolding eventually_nonneg_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x)
[PROOF STEP]
using eventually_ge_at_top[of "inverse b"]
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) (inverse b)) at_top

goal (1 subgoal):
 1. 0 < b \<Longrightarrow> \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x)
[PROOF STEP]
by eventually_elim (simp_all add: field_simps)


[STATEMENT]
lemma S: "(A \<longrightarrow> B \<longrightarrow> C) \<longrightarrow> (A \<longrightarrow> B) \<longrightarrow> A \<longrightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<longrightarrow> B \<longrightarrow> C) \<longrightarrow> (A \<longrightarrow> B) \<longrightarrow> A \<longrightarrow> C
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<longrightarrow> B \<longrightarrow> C \<Longrightarrow> (A \<longrightarrow> B) \<longrightarrow> A \<longrightarrow> C
[PROOF STEP]
assume "A \<longrightarrow> B \<longrightarrow> C"
[PROOF STATE]
proof (state)
this:
A \<longrightarrow> B \<longrightarrow> C

goal (1 subgoal):
 1. A \<longrightarrow> B \<longrightarrow> C \<Longrightarrow> (A \<longrightarrow> B) \<longrightarrow> A \<longrightarrow> C
[PROOF STEP]
show "(A \<longrightarrow> B) \<longrightarrow> A \<longrightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<longrightarrow> B) \<longrightarrow> A \<longrightarrow> C
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<longrightarrow> B \<Longrightarrow> A \<longrightarrow> C
[PROOF STEP]
assume "A \<longrightarrow> B"
[PROOF STATE]
proof (state)
this:
A \<longrightarrow> B

goal (1 subgoal):
 1. A \<longrightarrow> B \<Longrightarrow> A \<longrightarrow> C
[PROOF STEP]
show "A \<longrightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<longrightarrow> C
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<Longrightarrow> C
[PROOF STEP]
assume A
[PROOF STATE]
proof (state)
this:
A

goal (1 subgoal):
 1. A \<Longrightarrow> C
[PROOF STEP]
show C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C
[PROOF STEP]
proof (rule mp)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<longrightarrow> C
 2. ?P
[PROOF STEP]
show "B \<longrightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<longrightarrow> C
[PROOF STEP]
by (rule mp) fact+
[PROOF STATE]
proof (state)
this:
B \<longrightarrow> C

goal (1 subgoal):
 1. B
[PROOF STEP]
show B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B
[PROOF STEP]
by (rule mp) fact+
[PROOF STATE]
proof (state)
this:
B

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<longrightarrow> C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(A \<longrightarrow> B) \<longrightarrow> A \<longrightarrow> C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma decseq_eq_incseq: "decseq X = incseq (\<lambda>n. - X n)"
  for X :: "nat \<Rightarrow> 'a::ordered_ab_group_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decseq X = incseq (\<lambda>n. - X n)
[PROOF STEP]
by (simp add: decseq_def incseq_def)


[STATEMENT]
lemma path_component_path_component [simp]:
   "path_component_set (path_component_set S x) x = path_component_set S x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_set (path_component_set S x) x = path_component_set S x
[PROOF STEP]
proof (cases "x \<in> S")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> S \<Longrightarrow> path_component_set (path_component_set S x) x = path_component_set S x
 2. x \<notin> S \<Longrightarrow> path_component_set (path_component_set S x) x = path_component_set S x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (2 subgoals):
 1. x \<in> S \<Longrightarrow> path_component_set (path_component_set S x) x = path_component_set S x
 2. x \<notin> S \<Longrightarrow> path_component_set (path_component_set S x) x = path_component_set S x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_component_set (path_component_set S x) x = path_component_set S x
[PROOF STEP]
by (metis True mem_Collect_eq path_component_refl path_connected_component_set path_connected_path_component)
[PROOF STATE]
proof (state)
this:
path_component_set (path_component_set S x) x = path_component_set S x

goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> path_component_set (path_component_set S x) x = path_component_set S x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> path_component_set (path_component_set S x) x = path_component_set S x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<notin> S

goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> path_component_set (path_component_set S x) x = path_component_set S x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<notin> S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<notin> S

goal (1 subgoal):
 1. path_component_set (path_component_set S x) x = path_component_set S x
[PROOF STEP]
by (metis False empty_iff path_component_eq_empty)
[PROOF STATE]
proof (state)
this:
path_component_set (path_component_set S x) x = path_component_set S x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_if_then_else:
  "inj_on f X \<Longrightarrow> inj_on g' (-X) \<Longrightarrow> -(f ` X) = g' ` (-X) \<Longrightarrow>
    h = (\<lambda>z. if z \<in> X then f z else g' z) \<Longrightarrow> inj h \<and> surj h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f X; inj_on g' (- X); - f ` X = g' ` (- X); h = (\<lambda>z. if z \<in> X then f z else g' z)\<rbrakk> \<Longrightarrow> inj h \<and> surj h
[PROOF STEP]
apply (unfold inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>X. \<forall>y\<in>X. f x = f y \<longrightarrow> x = y; \<forall>x\<in>- X. \<forall>y\<in>- X. g' x = g' y \<longrightarrow> x = y; - f ` X = g' ` (- X); h = (\<lambda>z. if z \<in> X then f z else g' z)\<rbrakk> \<Longrightarrow> (\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. h x = h y \<longrightarrow> x = y) \<and> surj h
[PROOF STEP]
apply (simp add: surj_if_then_else)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>X. \<forall>y\<in>X. f x = f y \<longrightarrow> x = y; \<forall>x\<in>- X. \<forall>y\<in>- X. g' x = g' y \<longrightarrow> x = y; - f ` X = g' ` (- X); h = (\<lambda>z. if z \<in> X then f z else g' z)\<rbrakk> \<Longrightarrow> (\<forall>x. (x \<in> X \<longrightarrow> (\<forall>y. y \<notin> X \<longrightarrow> f x = g' y \<longrightarrow> x = y)) \<and> (x \<notin> X \<longrightarrow> (\<forall>y. y \<in> X \<longrightarrow> g' x = f y \<longrightarrow> x = y))) \<and> f ` X \<union> g' ` {x. x \<notin> X} = UNIV
[PROOF STEP]
apply (blast dest: disj_lemma sym)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma val_ineq_cancel_le':
  assumes "a \<in> nonzero Q\<^sub>p"
  assumes "b \<in> carrier Q\<^sub>p"
  assumes "c \<in> carrier Q\<^sub>p"
  assumes "val b < val c"
  shows "val (a \<otimes> b) < val (a \<otimes> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (a \<otimes> b) < val (a \<otimes> c)
[PROOF STEP]
apply(rule val_ineq_cancel_le[of "inv a" "a \<otimes> b" "a \<otimes> c"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. inv a \<in> nonzero Q\<^sub>p
 2. a \<otimes> b \<in> carrier Q\<^sub>p
 3. a \<otimes> c \<in> carrier Q\<^sub>p
 4. val (inv a \<otimes> (a \<otimes> b)) < val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
using assms(1) nonzero_inverse_Qp
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
?u \<in> nonzero Q\<^sub>p \<Longrightarrow> inv ?u \<in> nonzero Q\<^sub>p

goal (4 subgoals):
 1. inv a \<in> nonzero Q\<^sub>p
 2. a \<otimes> b \<in> carrier Q\<^sub>p
 3. a \<otimes> c \<in> carrier Q\<^sub>p
 4. val (inv a \<otimes> (a \<otimes> b)) < val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a \<otimes> b \<in> carrier Q\<^sub>p
 2. a \<otimes> c \<in> carrier Q\<^sub>p
 3. val (inv a \<otimes> (a \<otimes> b)) < val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
using Qp.nonzero_closed assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
a \<in> nonzero Q\<^sub>p
b \<in> carrier Q\<^sub>p

goal (3 subgoals):
 1. a \<otimes> b \<in> carrier Q\<^sub>p
 2. a \<otimes> c \<in> carrier Q\<^sub>p
 3. val (inv a \<otimes> (a \<otimes> b)) < val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<otimes> c \<in> carrier Q\<^sub>p
 2. val (inv a \<otimes> (a \<otimes> b)) < val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
using Qp.nonzero_closed assms assms(2)
[PROOF STATE]
proof (prove)
using this:
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
a \<in> nonzero Q\<^sub>p
b \<in> carrier Q\<^sub>p
c \<in> carrier Q\<^sub>p
val b < val c
b \<in> carrier Q\<^sub>p

goal (2 subgoals):
 1. a \<otimes> c \<in> carrier Q\<^sub>p
 2. val (inv a \<otimes> (a \<otimes> b)) < val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (inv a \<otimes> (a \<otimes> b)) < val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
by (metis Qp.inv_cancelR(1) Qp.m_closed Qp.nonzero_closed Units_eq_nonzero assms(1) assms(2) assms(3) assms(4))


[STATEMENT]
lemma invertibleI: "A ** B = mat 1 \<Longrightarrow> B ** A = mat 1 \<Longrightarrow> invertible A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A ** B = mat (1::'a); B ** A = mat (1::'a)\<rbrakk> \<Longrightarrow> invertible A
[PROOF STEP]
unfolding invertible_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A ** B = mat (1::'a); B ** A = mat (1::'a)\<rbrakk> \<Longrightarrow> \<exists>A'. A ** A' = mat (1::'a) \<and> A' ** A = mat (1::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma elements_mat_transpose_mat[simp]: "elements_mat (A\<^sup>T) = elements_mat A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elements_mat A\<^sup>T = elements_mat A
[PROOF STEP]
unfolding elements_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (concat (map (\<lambda>i. map (\<lambda>j. A\<^sup>T $$ (i, j)) [0..<dim_col A\<^sup>T]) [0..<dim_row A\<^sup>T])) = set (concat (map (\<lambda>i. map (\<lambda>j. A $$ (i, j)) [0..<dim_col A]) [0..<dim_row A]))
[PROOF STEP]
by auto


[STATEMENT]
lemma rcoset0 : "Subgroup H \<Longrightarrow> (rcoset_rel H)``{0} = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Subgroup H \<Longrightarrow> rcoset_rel H `` {0::'g} = H
[PROOF STEP]
using zero_closed rcosets
[PROOF STATE]
proof (prove)
using this:
(0::'g) \<in> G
\<lbrakk>Subgroup ?H; ?g \<in> G\<rbrakk> \<Longrightarrow> rcoset_rel ?H `` {?g} = ?H + {?g}

goal (1 subgoal):
 1. Subgroup H \<Longrightarrow> rcoset_rel H `` {0::'g} = H
[PROOF STEP]
unfolding set_plus_def
[PROOF STATE]
proof (prove)
using this:
(0::'g) \<in> G
\<lbrakk>Subgroup ?H; ?g \<in> G\<rbrakk> \<Longrightarrow> rcoset_rel ?H `` {?g} = {c. \<exists>a\<in>?H. \<exists>b\<in>{?g}. c = a + b}

goal (1 subgoal):
 1. Subgroup H \<Longrightarrow> rcoset_rel H `` {0::'g} = H
[PROOF STEP]
by simp


[STATEMENT]
lemma length_tl_queue_rep: "\<not>is_empty q \<Longrightarrow>
  length (linearize (tl_queue q)) < length (linearize q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Optimized_MTL.is_empty q \<Longrightarrow> length (linearize (tl_queue q)) < length (linearize q)
[PROOF STEP]
by transfer (auto split: prod.splits list.splits elim: tl_queue_t.elims)


[STATEMENT]
lemma plus_of_nat_minus_of_nat_hmset:
  fixes k :: hmultiset
  assumes "n \<le> m"
  shows "k + of_nat m - of_nat n = k + of_nat (m - n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k + of_nat m - of_nat n = k + of_nat (m - n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<le> m

goal (1 subgoal):
 1. k + of_nat m - of_nat n = k + of_nat (m - n)
[PROOF STEP]
by (metis add.left_commute add_diff_cancel_left' le_add_diff_inverse of_nat_add)


[STATEMENT]
lemma poly_add_closed: "\<lbrakk> polynomial K p1; polynomial K p2 \<rbrakk> \<Longrightarrow> polynomial K (poly_add p1 p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>polynomial K p1; polynomial K p2\<rbrakk> \<Longrightarrow> polynomial K (poly_add p1 p2)
[PROOF STEP]
using poly_add_is_polynomial polynomial_incl
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set ?p1.0 \<subseteq> K; set ?p2.0 \<subseteq> K\<rbrakk> \<Longrightarrow> polynomial K (poly_add ?p1.0 ?p2.0)
polynomial ?K ?p \<Longrightarrow> set ?p \<subseteq> ?K

goal (1 subgoal):
 1. \<lbrakk>polynomial K p1; polynomial K p2\<rbrakk> \<Longrightarrow> polynomial K (poly_add p1 p2)
[PROOF STEP]
by simp


[STATEMENT]
lemma single_l:
  fixes s and x :: real assumes "s \<in> S"
  shows "(\<Sum>s'\<in>S. (if s' = s then 1 else 0) * l s') = x \<longleftrightarrow> l s = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>s'\<in>S. (if s' = s then 1 else 0) * l s') = x) = (l s = x)
[PROOF STEP]
by (simp add: assms if_distrib [of "\<lambda>x. x * a" for a] cong: if_cong)


[STATEMENT]
lemma (in Category) InvInv:
  assumes "ciso f"
  shows   "ciso (Cinv f)" and "(Cinv (Cinv f)) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ciso Cinv f &&& Cinv Cinv f = f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ciso Cinv f
 2. Cinv Cinv f = f
[PROOF STEP]
have "cinv f (Cinv f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinv f Cinv f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ciso f

goal (1 subgoal):
 1. cinv f Cinv f
[PROOF STEP]
by (simp add: iso2Inv)
[PROOF STATE]
proof (state)
this:
cinv f Cinv f

goal (2 subgoals):
 1. ciso Cinv f
 2. Cinv Cinv f = f
[PROOF STEP]
hence "cinv (Cinv f) f"
[PROOF STATE]
proof (prove)
using this:
cinv f Cinv f

goal (1 subgoal):
 1. cinv Cinv f f
[PROOF STEP]
by (simp add: Inverse_relSym[of f])
[PROOF STATE]
proof (state)
this:
cinv Cinv f f

goal (2 subgoals):
 1. ciso Cinv f
 2. Cinv Cinv f = f
[PROOF STEP]
thus  "ciso (Cinv f)" and "Cinv (Cinv f) = f"
[PROOF STATE]
proof (prove)
using this:
cinv Cinv f f

goal (1 subgoal):
 1. ciso Cinv f &&& Cinv Cinv f = f
[PROOF STEP]
by (auto simp add: inv2Inv)
[PROOF STATE]
proof (state)
this:
ciso Cinv f
Cinv Cinv f = f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interleavings_filter_eq2:
  assumes "interleavings xs ys zs"
  assumes "(\<forall>x\<in>set xs. \<not> P x) \<and> (\<forall>y\<in>set ys. P y)"
  shows "filter P zs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter P zs = ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
interleavings xs ys zs
(\<forall>x\<in>set xs. \<not> P x) \<and> (\<forall>y\<in>set ys. P y)

goal (1 subgoal):
 1. filter P zs = ys
[PROOF STEP]
by (induct rule: interleavings.induct) auto


[STATEMENT]
lemma open_Times: "open S \<Longrightarrow> open T \<Longrightarrow> open (S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open S; open T\<rbrakk> \<Longrightarrow> open (S \<times> T)
[PROOF STEP]
unfolding open_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open S; open T\<rbrakk> \<Longrightarrow> \<forall>x\<in>S \<times> T. \<exists>A B. open A \<and> open B \<and> x \<in> A \<times> B \<and> A \<times> B \<subseteq> S \<times> T
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_div_minus_right [simp]: "x div (- y) = - (x div y)"
  for x y :: "'a::field poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x div - y = - (x div y)
[PROOF STEP]
using div_smult_right [of _ "- 1::'a"]
[PROOF STATE]
proof (prove)
using this:
?x div smult (- (1::'a)) ?y = smult (inverse (- (1::'a))) (?x div ?y)

goal (1 subgoal):
 1. x div - y = - (x div y)
[PROOF STEP]
by (simp add: nonzero_inverse_minus_eq)