[STATEMENT]
lemma inj_on_iff_eq_0:
  assumes s: "m1.subspace s"
  shows "inj_on f s \<longleftrightarrow> (\<forall>x\<in>s. f x = 0 \<longrightarrow> x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
have "inj_on f s \<longleftrightarrow> (\<forall>x\<in>s. \<forall>y\<in>s. f x - f y = 0 \<longrightarrow> x - y = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. \<forall>y\<in>s. f x - f y = (0::'c) \<longrightarrow> x - y = (0::'b))
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (state)
this:
inj_on f s = (\<forall>x\<in>s. \<forall>y\<in>s. f x - f y = (0::'c) \<longrightarrow> x - y = (0::'b))

goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inj_on f s = (\<forall>x\<in>s. \<forall>y\<in>s. f x - f y = (0::'c) \<longrightarrow> x - y = (0::'b))

goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = 0 \<longrightarrow> x - y = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>s. \<forall>y\<in>s. f x - f y = (0::'c) \<longrightarrow> x - y = (0::'b)) = (\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b))
[PROOF STEP]
by (simp add: diff)
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>s. \<forall>y\<in>s. f x - f y = (0::'c) \<longrightarrow> x - y = (0::'b)) = (\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b))

goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>s. \<forall>y\<in>s. f x - f y = (0::'c) \<longrightarrow> x - y = (0::'b)) = (\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b))

goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<forall>x\<in>s. f x = 0 \<longrightarrow> x = 0)" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b)) = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b); x \<in> s; f x = (0::'c)\<rbrakk> \<Longrightarrow> x = (0::'b)
 2. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b); x \<in> s; f x = (0::'c)\<rbrakk> \<Longrightarrow> x = (0::'b)
 2. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
assume ?l
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b); x \<in> s; f x = (0::'c)\<rbrakk> \<Longrightarrow> x = (0::'b)
 2. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
assume "x \<in> s" "f x = 0"
[PROOF STATE]
proof (state)
this:
x \<in> s
f x = (0::'c)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b); x \<in> s; f x = (0::'c)\<rbrakk> \<Longrightarrow> x = (0::'b)
 2. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
with \<open>?l\<close>[rule_format, of x 0] s
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x \<in> s; (0::'b) \<in> s; f (x - (0::'b)) = (0::'c)\<rbrakk> \<Longrightarrow> x - (0::'b) = (0::'b)
m1.subspace s
x \<in> s
f x = (0::'c)
[PROOF STEP]
show "x = 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> s; (0::'b) \<in> s; f (x - (0::'b)) = (0::'c)\<rbrakk> \<Longrightarrow> x - (0::'b) = (0::'b)
m1.subspace s
x \<in> s
f x = (0::'c)

goal (1 subgoal):
 1. x = (0::'b)
[PROOF STEP]
by (auto simp: m1.subspace_0)
[PROOF STATE]
proof (state)
this:
x = (0::'b)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
assume ?r
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
assume "x \<in> s" "y \<in> s" "f (x - y) = 0"
[PROOF STATE]
proof (state)
this:
x \<in> s
y \<in> s
f (x - y) = (0::'c)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b); x \<in> s; y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
[PROOF STEP]
with \<open>?r\<close>[rule_format, of "x - y"] s
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x - y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
m1.subspace s
x \<in> s
y \<in> s
f (x - y) = (0::'c)
[PROOF STEP]
show "x - y = 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x - y \<in> s; f (x - y) = (0::'c)\<rbrakk> \<Longrightarrow> x - y = (0::'b)
m1.subspace s
x \<in> s
y \<in> s
f (x - y) = (0::'c)

goal (1 subgoal):
 1. x - y = (0::'b)
[PROOF STEP]
by (auto simp: m1.subspace_diff)
[PROOF STATE]
proof (state)
this:
x - y = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>s. \<forall>y\<in>s. f (x - y) = (0::'c) \<longrightarrow> x - y = (0::'b)) = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))

goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))

goal (1 subgoal):
 1. inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on f s = (\<forall>x\<in>s. f x = (0::'c) \<longrightarrow> x = (0::'b))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ssubst_Var_if [simp]:
  assumes "finite V"
    shows "ssubst (Var i) V F = (if i \<in> V then F i else Var i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ssubst (Var i) V F = (if i \<in> V then F i else Var i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite V

goal (1 subgoal):
 1. ssubst (Var i) V F = (if i \<in> V then F i else Var i)
[PROOF STEP]
apply (induction V, auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>Fa. \<lbrakk>finite Fa; i \<notin> Fa; ssubst (Var i) Fa F = Var i; finite V\<rbrakk> \<Longrightarrow> ssubst (Var i) (insert i Fa) F = F i
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; ssubst (Var i) Fa F = F i; finite V; i \<in> Fa\<rbrakk> \<Longrightarrow> ssubst (Var i) (insert x Fa) F = F i
 3. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; ssubst (Var i) Fa F = Var i; finite V; i \<noteq> x; i \<notin> Fa\<rbrakk> \<Longrightarrow> ssubst (Var i) (insert x Fa) F = Var i
[PROOF STEP]
apply (metis ssubst_insert subst.simps(2))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; ssubst (Var i) Fa F = F i; finite V; i \<in> Fa\<rbrakk> \<Longrightarrow> ssubst (Var i) (insert x Fa) F = F i
 2. \<And>x Fa. \<lbrakk>finite Fa; x \<notin> Fa; ssubst (Var i) Fa F = Var i; finite V; i \<noteq> x; i \<notin> Fa\<rbrakk> \<Longrightarrow> ssubst (Var i) (insert x Fa) F = Var i
[PROOF STEP]
apply (metis ssubst_insert2 subst.simps(2))+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prefixes_take_iff :
  "xs \<in> set (prefixes ys) \<longleftrightarrow> take (length xs) ys = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> set (prefixes ys)) = (take (length xs) ys = xs)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs \<in> set (prefixes ys) \<Longrightarrow> take (length xs) ys = xs
 2. take (length xs) ys = xs \<Longrightarrow> xs \<in> set (prefixes ys)
[PROOF STEP]
show "xs \<in> set (prefixes ys) \<Longrightarrow> take (length xs) ys = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> set (prefixes ys) \<Longrightarrow> take (length xs) ys = xs
[PROOF STEP]
unfolding prefixes_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> {xs'. \<exists>xs''. xs' @ xs'' = ys} \<Longrightarrow> take (length xs) ys = xs
[PROOF STEP]
by (simp add: append_eq_conv_conj)
[PROOF STATE]
proof (state)
this:
xs \<in> set (prefixes ys) \<Longrightarrow> take (length xs) ys = xs

goal (1 subgoal):
 1. take (length xs) ys = xs \<Longrightarrow> xs \<in> set (prefixes ys)
[PROOF STEP]
show "take (length xs) ys = xs \<Longrightarrow> xs \<in> set (prefixes ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take (length xs) ys = xs \<Longrightarrow> xs \<in> set (prefixes ys)
[PROOF STEP]
unfolding prefixes_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take (length xs) ys = xs \<Longrightarrow> xs \<in> {xs'. \<exists>xs''. xs' @ xs'' = ys}
[PROOF STEP]
by (metis (mono_tags, lifting) append_take_drop_id mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
take (length xs) ys = xs \<Longrightarrow> xs \<in> set (prefixes ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_time_nempty:
  assumes "0 < n"
  shows    "split_time s n (n * t) = s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. split_time s n (n * t) = s t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. split_time s n (n * t) = s t
[PROOF STEP]
by (simp add: split_time_def)


[STATEMENT]
lemma sum_list_ge_0_nth: fixes xs :: "('a :: ordered_semiring_0)list"
  assumes ge: "\<And> i. i < length xs \<Longrightarrow> xs ! i \<ge> 0"
  shows "sum_list xs \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
let ?l = "replicate  (length xs) (0 :: 'a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
have "length xs = length ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length (replicate (length xs) (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length xs = length (replicate (length xs) (0::'a))

goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
from sum_list_ge_mono[OF this] ge
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i < length (replicate (length xs) (0::'a)) \<Longrightarrow> replicate (length xs) (0::'a) ! i \<le> xs ! i) \<Longrightarrow> sum_list (replicate (length xs) (0::'a)) \<le> sum_list xs
?i < length xs \<Longrightarrow> (0::'a) \<le> xs ! ?i
[PROOF STEP]
have "sum_list xs \<ge> sum_list ?l"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i < length (replicate (length xs) (0::'a)) \<Longrightarrow> replicate (length xs) (0::'a) ! i \<le> xs ! i) \<Longrightarrow> sum_list (replicate (length xs) (0::'a)) \<le> sum_list xs
?i < length xs \<Longrightarrow> (0::'a) \<le> xs ! ?i

goal (1 subgoal):
 1. sum_list (replicate (length xs) (0::'a)) \<le> sum_list xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (replicate (length xs) (0::'a)) \<le> sum_list xs

goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (replicate (length xs) (0::'a)) \<le> sum_list xs

goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
have "sum_list ?l = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (replicate (length xs) (0::'a)) = (0::'a)
[PROOF STEP]
using sum_list_0[of ?l]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<leftarrow>replicate (length xs) (0::'a). (0::?'a)) = (0::?'a)

goal (1 subgoal):
 1. sum_list (replicate (length xs) (0::'a)) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum_list (replicate (length xs) (0::'a)) = (0::'a)

goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> sum_list xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> sum_list xs

goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> sum_list xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coin_set_lists_concat: "ps \<in> lists (\<CC> g h) \<Longrightarrow> g (concat (map fst ps)) = h (concat (map snd ps))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps \<in> lists (\<CC> g h) \<Longrightarrow> g (concat (map fst ps)) = h (concat (map snd ps))
[PROOF STEP]
unfolding coincidence_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps \<in> lists {(r, s). g r = h s} \<Longrightarrow> g (concat (map fst ps)) = h (concat (map snd ps))
[PROOF STEP]
by (induct ps, simp, auto simp add: g.morph h.morph)


[STATEMENT]
lemma compact_imp_fip_image:
  assumes "compact s"
    and P: "\<And>i. i \<in> I \<Longrightarrow> closed (f i)"
    and Q: "\<And>I'. finite I' \<Longrightarrow> I' \<subseteq> I \<Longrightarrow> (s \<inter> (\<Inter>i\<in>I'. f i) \<noteq> {})"
  shows "s \<inter> (\<Inter>i\<in>I. f i) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> closed (f ?i)
[PROOF STEP]
have "\<forall>i \<in> f ` I. closed i"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> closed (f ?i)

goal (1 subgoal):
 1. \<forall>i\<in>f ` I. closed i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>f ` I. closed i

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>f ` I. closed i

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
have "\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> (s \<inter> (\<Inter>A) \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}
[PROOF STEP]
by (metis Q finite_subset_image)
[PROOF STATE]
proof (state)
this:
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>f ` I. closed i
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}
[PROOF STEP]
show "s \<inter> (\<Inter>(f ` I)) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>f ` I. closed i
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
by (metis \<open>compact s\<close> compact_imp_fip)
[PROOF STATE]
proof (state)
this:
s \<inter> \<Inter> (f ` I) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefixes_fin: "let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1
[PROOF STEP]
proof(induct x, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a x. let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1 \<Longrightarrow> let prefixes = {t. \<exists>t2. a # x = t @ t2} in finite prefixes \<and> card prefixes = length (a # x) + 1
[PROOF STEP]
case (Cons a x)
[PROOF STATE]
proof (state)
this:
let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1

goal (1 subgoal):
 1. \<And>a x. let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1 \<Longrightarrow> let prefixes = {t. \<exists>t2. a # x = t @ t2} in finite prefixes \<and> card prefixes = length (a # x) + 1
[PROOF STEP]
hence A:"finite {t. (\<exists>t2. x = t @ t2)}"
[PROOF STATE]
proof (prove)
using this:
let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1

goal (1 subgoal):
 1. finite {t. \<exists>t2. x = t @ t2}
[PROOF STEP]
using not_add_less2
[PROOF STATE]
proof (prove)
using this:
let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1
\<not> ?j + ?i < ?i

goal (1 subgoal):
 1. finite {t. \<exists>t2. x = t @ t2}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
finite {t. \<exists>t2. x = t @ t2}

goal (1 subgoal):
 1. \<And>a x. let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1 \<Longrightarrow> let prefixes = {t. \<exists>t2. a # x = t @ t2} in finite prefixes \<and> card prefixes = length (a # x) + 1
[PROOF STEP]
have B:"inj_on Cons UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (#)
[PROOF STEP]
by (metis injI list.inject)
[PROOF STATE]
proof (state)
this:
inj (#)

goal (1 subgoal):
 1. \<And>a x. let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1 \<Longrightarrow> let prefixes = {t. \<exists>t2. a # x = t @ t2} in finite prefixes \<and> card prefixes = length (a # x) + 1
[PROOF STEP]
from Cons A B inj_on_iff_eq_card
[PROOF STATE]
proof (chain)
picking this:
let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1
finite {t. \<exists>t2. x = t @ t2}
inj (#)
finite ?A \<Longrightarrow> inj_on ?f ?A = (card (?f ` ?A) = card ?A)
[PROOF STEP]
have  C:"card ((\<lambda>x. a#x)`{t. (\<exists>t2. x = t @ t2)}) = length x + 1"
[PROOF STATE]
proof (prove)
using this:
let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1
finite {t. \<exists>t2. x = t @ t2}
inj (#)
finite ?A \<Longrightarrow> inj_on ?f ?A = (card (?f ` ?A) = card ?A)

goal (1 subgoal):
 1. card ((#) a ` {t. \<exists>t2. x = t @ t2}) = length x + 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card ((#) a ` {t. \<exists>t2. x = t @ t2}) = length x + 1

goal (1 subgoal):
 1. \<And>a x. let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1 \<Longrightarrow> let prefixes = {t. \<exists>t2. a # x = t @ t2} in finite prefixes \<and> card prefixes = length (a # x) + 1
[PROOF STEP]
have D:"{t. \<exists>t2. a # x = t @ t2} = {[]} \<union> (\<lambda>x. a#x)`{t. (\<exists>t2. x = t @ t2)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t. \<exists>t2. a # x = t @ t2} = {[]} \<union> (#) a ` {t. \<exists>t2. x = t @ t2}
[PROOF STEP]
by(intro set_eqI iffI, auto simp add:Cons_eq_append_conv)
[PROOF STATE]
proof (state)
this:
{t. \<exists>t2. a # x = t @ t2} = {[]} \<union> (#) a ` {t. \<exists>t2. x = t @ t2}

goal (1 subgoal):
 1. \<And>a x. let prefixes = {t. \<exists>t2. x = t @ t2} in finite prefixes \<and> card prefixes = length x + 1 \<Longrightarrow> let prefixes = {t. \<exists>t2. a # x = t @ t2} in finite prefixes \<and> card prefixes = length (a # x) + 1
[PROOF STEP]
from C D card_insert_if[of "(\<lambda>x. a#x)`{t. (\<exists>t2. x = t @ t2)}"]
[PROOF STATE]
proof (chain)
picking this:
card ((#) a ` {t. \<exists>t2. x = t @ t2}) = length x + 1
{t. \<exists>t2. a # x = t @ t2} = {[]} \<union> (#) a ` {t. \<exists>t2. x = t @ t2}
finite ((#) a ` {t. \<exists>t2. x = t @ t2}) \<Longrightarrow> card (insert ?x ((#) a ` {t. \<exists>t2. x = t @ t2})) = (if ?x \<in> (#) a ` {t. \<exists>t2. x = t @ t2} then card ((#) a ` {t. \<exists>t2. x = t @ t2}) else Suc (card ((#) a ` {t. \<exists>t2. x = t @ t2})))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card ((#) a ` {t. \<exists>t2. x = t @ t2}) = length x + 1
{t. \<exists>t2. a # x = t @ t2} = {[]} \<union> (#) a ` {t. \<exists>t2. x = t @ t2}
finite ((#) a ` {t. \<exists>t2. x = t @ t2}) \<Longrightarrow> card (insert ?x ((#) a ` {t. \<exists>t2. x = t @ t2})) = (if ?x \<in> (#) a ` {t. \<exists>t2. x = t @ t2} then card ((#) a ` {t. \<exists>t2. x = t @ t2}) else Suc (card ((#) a ` {t. \<exists>t2. x = t @ t2})))

goal (1 subgoal):
 1. let prefixes = {t. \<exists>t2. a # x = t @ t2} in finite prefixes \<and> card prefixes = length (a # x) + 1
[PROOF STEP]
by (metis (no_types, lifting) One_nat_def Suc_eq_plus1 Un_insert_left finite.insertI
        finite_imageI image_iff list.distinct(1) list.size(4) local.A sup_bot.left_neutral)
[PROOF STATE]
proof (state)
this:
let prefixes = {t. \<exists>t2. a # x = t @ t2} in finite prefixes \<and> card prefixes = length (a # x) + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_pow_rsp:
  assumes eq: "(b::nat) + e = d + c"
  assumes a_in_G [simp, intro]: "a \<in> Units G"
  shows "a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
proof(cases "b\<ge>c")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
 2. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
have [simp]: "a \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier G
[PROOF STEP]
using \<open>a \<in> _\<close>
[PROOF STATE]
proof (prove)
using this:
a \<in> Units G

goal (1 subgoal):
 1. a \<in> carrier G
[PROOF STEP]
by (rule Units_closed)
[PROOF STATE]
proof (state)
this:
a \<in> carrier G

goal (2 subgoals):
 1. c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
 2. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c \<le> b

goal (2 subgoals):
 1. c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
 2. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<le> b
[PROOF STEP]
obtain n where "b = n + c"
[PROOF STATE]
proof (prove)
using this:
c \<le> b

goal (1 subgoal):
 1. (\<And>n. b = n + c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis le_iff_add add.commute)
[PROOF STATE]
proof (state)
this:
b = n + c

goal (2 subgoals):
 1. c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
 2. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = n + c
[PROOF STEP]
have "d = n + e"
[PROOF STATE]
proof (prove)
using this:
b = n + c

goal (1 subgoal):
 1. d = n + e
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
b = n + c
b + e = d + c

goal (1 subgoal):
 1. d = n + e
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
d = n + e

goal (2 subgoals):
 1. c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
 2. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
from \<open>b = _\<close>
[PROOF STATE]
proof (chain)
picking this:
b = n + c
[PROOF STEP]
have "a [^] b \<otimes> inv (a [^] c) = a [^] n"
[PROOF STATE]
proof (prove)
using this:
b = n + c

goal (1 subgoal):
 1. a [^] b \<otimes> inv (a [^] c) = a [^] n
[PROOF STEP]
by (auto simp add: nat_pow_mult[symmetric] m_assoc)
[PROOF STATE]
proof (state)
this:
a [^] b \<otimes> inv (a [^] c) = a [^] n

goal (2 subgoals):
 1. c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
 2. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a [^] b \<otimes> inv (a [^] c) = a [^] n

goal (2 subgoals):
 1. c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
 2. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
from \<open>d = _\<close>
[PROOF STATE]
proof (chain)
picking this:
d = n + e
[PROOF STEP]
have "\<dots> = a [^] d \<otimes> inv (a [^] e)"
[PROOF STATE]
proof (prove)
using this:
d = n + e

goal (1 subgoal):
 1. a [^] n = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
by (auto simp add: nat_pow_mult[symmetric] m_assoc)
[PROOF STATE]
proof (state)
this:
a [^] n = a [^] d \<otimes> inv (a [^] e)

goal (2 subgoals):
 1. c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
 2. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)

goal (1 subgoal):
 1. a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)

goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
have [simp]: "a \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier G
[PROOF STEP]
using \<open>a \<in> _\<close>
[PROOF STATE]
proof (prove)
using this:
a \<in> Units G

goal (1 subgoal):
 1. a \<in> carrier G
[PROOF STEP]
by (rule Units_closed)
[PROOF STATE]
proof (state)
this:
a \<in> carrier G

goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> c \<le> b

goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> c \<le> b
[PROOF STEP]
obtain n where "c = n + b"
[PROOF STATE]
proof (prove)
using this:
\<not> c \<le> b

goal (1 subgoal):
 1. (\<And>n. c = n + b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis le_iff_add add.commute nat_le_linear)
[PROOF STATE]
proof (state)
this:
c = n + b

goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = n + b
[PROOF STEP]
have "e = n + d"
[PROOF STATE]
proof (prove)
using this:
c = n + b

goal (1 subgoal):
 1. e = n + d
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
c = n + b
b + e = d + c

goal (1 subgoal):
 1. e = n + d
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
e = n + d

goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
from \<open>c = _\<close>
[PROOF STATE]
proof (chain)
picking this:
c = n + b
[PROOF STEP]
have "a [^] b \<otimes> inv (a [^] c) = inv (a [^] n)"
[PROOF STATE]
proof (prove)
using this:
c = n + b

goal (1 subgoal):
 1. a [^] b \<otimes> inv (a [^] c) = inv (a [^] n)
[PROOF STEP]
by (auto simp add: nat_pow_mult[symmetric] m_assoc[symmetric] inv_mult_units)
[PROOF STATE]
proof (state)
this:
a [^] b \<otimes> inv (a [^] c) = inv (a [^] n)

goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a [^] b \<otimes> inv (a [^] c) = inv (a [^] n)

goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
from \<open>e = _\<close>
[PROOF STATE]
proof (chain)
picking this:
e = n + d
[PROOF STEP]
have "\<dots> = a [^] d \<otimes> inv (a [^] e)"
[PROOF STATE]
proof (prove)
using this:
e = n + d

goal (1 subgoal):
 1. inv (a [^] n) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
by (auto simp add: nat_pow_mult[symmetric] m_assoc[symmetric] inv_mult_units)
[PROOF STATE]
proof (state)
this:
inv (a [^] n) = a [^] d \<otimes> inv (a [^] e)

goal (1 subgoal):
 1. \<not> c \<le> b \<Longrightarrow> a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)

goal (1 subgoal):
 1. a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a [^] b \<otimes> inv (a [^] c) = a [^] d \<otimes> inv (a [^] e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trans_NS_point: "\<And> x y z. (x, y) \<in> NS \<Longrightarrow> (y, z) \<in> NS \<Longrightarrow> (x, z) \<in> NS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> NS; (y, z) \<in> NS\<rbrakk> \<Longrightarrow> (x, z) \<in> NS
[PROOF STEP]
using trans_NS
[PROOF STATE]
proof (prove)
using this:
trans NS

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> NS; (y, z) \<in> NS\<rbrakk> \<Longrightarrow> (x, z) \<in> NS
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y z. (x, y) \<in> NS \<longrightarrow> (y, z) \<in> NS \<longrightarrow> (x, z) \<in> NS

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> NS; (y, z) \<in> NS\<rbrakk> \<Longrightarrow> (x, z) \<in> NS
[PROOF STEP]
by blast


[STATEMENT]
lemma Max_by_Union_distrib:
  "\<lbrakk> finite A; A = \<Union>S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A \<rbrakk> \<Longrightarrow>
    Max_by cmp_f A = Max_by cmp_f (Max_by cmp_f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f A = Max_by cmp_f (Max_by cmp_f ` S)
[PROOF STEP]
proof(rule Max_by_eqI, assumption)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>y. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A; y \<in> A\<rbrakk> \<Longrightarrow> cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 3. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>y. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A; y \<in> A\<rbrakk> \<Longrightarrow> cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 3. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
assume assms: "finite A" "A = \<Union>S" "{} \<notin> S" "y \<in> A"
[PROOF STATE]
proof (state)
this:
finite A
A = \<Union> S
{} \<notin> S
y \<in> A

goal (3 subgoals):
 1. \<And>y. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A; y \<in> A\<rbrakk> \<Longrightarrow> cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 3. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite A
A = \<Union> S
{} \<notin> S
y \<in> A
[PROOF STEP]
obtain B where B_def: "B \<in> S" "y \<in> B"
[PROOF STATE]
proof (prove)
using this:
finite A
A = \<Union> S
{} \<notin> S
y \<in> A

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>B \<in> S; y \<in> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<in> S
y \<in> B

goal (3 subgoals):
 1. \<And>y. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A; y \<in> A\<rbrakk> \<Longrightarrow> cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 3. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
hence "cmp_f y \<le> cmp_f (Max_by cmp_f B)"
[PROOF STATE]
proof (prove)
using this:
B \<in> S
y \<in> B

goal (1 subgoal):
 1. cmp_f y \<le> cmp_f (Max_by cmp_f B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B \<in> S
y \<in> B
finite A
A = \<Union> S
{} \<notin> S
y \<in> A

goal (1 subgoal):
 1. cmp_f y \<le> cmp_f (Max_by cmp_f B)
[PROOF STEP]
by (metis Max_by_ge finite_UN_D)
[PROOF STATE]
proof (state)
this:
cmp_f y \<le> cmp_f (Max_by cmp_f B)

goal (3 subgoals):
 1. \<And>y. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A; y \<in> A\<rbrakk> \<Longrightarrow> cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 3. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmp_f y \<le> cmp_f (Max_by cmp_f B)

goal (3 subgoals):
 1. \<And>y. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A; y \<in> A\<rbrakk> \<Longrightarrow> cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 3. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
have "... \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmp_f (Max_by cmp_f B) \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
[PROOF STEP]
using B_def(1) assms
[PROOF STATE]
proof (prove)
using this:
B \<in> S
finite A
A = \<Union> S
{} \<notin> S
y \<in> A

goal (1 subgoal):
 1. cmp_f (Max_by cmp_f B) \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
[PROOF STEP]
by (metis Max_by_ge finite_UnionD finite_imageI imageI)
[PROOF STATE]
proof (state)
this:
cmp_f (Max_by cmp_f B) \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))

goal (3 subgoals):
 1. \<And>y. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A; y \<in> A\<rbrakk> \<Longrightarrow> cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 3. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
[PROOF STEP]
show "cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))"
[PROOF STATE]
proof (prove)
using this:
cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))

goal (1 subgoal):
 1. cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmp_f y \<le> cmp_f (Max_by cmp_f (Max_by cmp_f ` S))

goal (2 subgoals):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
assume assms: "finite A" "A = \<Union>S" "{} \<notin> S" "S \<noteq> {}"
[PROOF STATE]
proof (state)
this:
finite A
A = \<Union> S
{} \<notin> S
S \<noteq> {}

goal (2 subgoals):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
hence "Max_by cmp_f ` S \<noteq> {}" "finite (Max_by cmp_f ` S)"
[PROOF STATE]
proof (prove)
using this:
finite A
A = \<Union> S
{} \<notin> S
S \<noteq> {}

goal (1 subgoal):
 1. Max_by cmp_f ` S \<noteq> {} &&& finite (Max_by cmp_f ` S)
[PROOF STEP]
apply (metis image_is_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Max_by cmp_f ` S)
[PROOF STEP]
by (metis assms(1) assms(2) finite_UnionD finite_imageI)
[PROOF STATE]
proof (state)
this:
Max_by cmp_f ` S \<noteq> {}
finite (Max_by cmp_f ` S)

goal (2 subgoals):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
hence "Max_by cmp_f (Max_by cmp_f ` S) \<in> (Max_by cmp_f ` S)"
[PROOF STATE]
proof (prove)
using this:
Max_by cmp_f ` S \<noteq> {}
finite (Max_by cmp_f ` S)

goal (1 subgoal):
 1. Max_by cmp_f (Max_by cmp_f ` S) \<in> Max_by cmp_f ` S
[PROOF STEP]
by(blast intro!: Max_by_in)
[PROOF STATE]
proof (state)
this:
Max_by cmp_f (Max_by cmp_f ` S) \<in> Max_by cmp_f ` S

goal (2 subgoals):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Max_by cmp_f (Max_by cmp_f ` S) \<in> Max_by cmp_f ` S

goal (2 subgoals):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
have "(Max_by cmp_f ` S) \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max_by cmp_f ` S \<subseteq> A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Max_by cmp_f ` S \<subseteq> A
[PROOF STEP]
have f1: "\<forall>v0 v1. (\<not> finite v0 \<or> v0 = {}) \<or> Max_by (v1::'a \<Rightarrow> 'b) v0 \<in> v0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>v0 v1. (infinite v0 \<or> v0 = {}) \<or> Max_by v1 v0 \<in> v0
[PROOF STEP]
using Max_by_in
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max_by ?f ?A \<in> ?A

goal (1 subgoal):
 1. \<forall>v0 v1. (infinite v0 \<or> v0 = {}) \<or> Max_by v1 v0 \<in> v0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>v0 v1. (infinite v0 \<or> v0 = {}) \<or> Max_by v1 v0 \<in> v0

goal (1 subgoal):
 1. Max_by cmp_f ` S \<subseteq> A
[PROOF STEP]
have "\<forall>v1. v1 \<notin> S \<or> finite v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>v1. v1 \<notin> S \<or> finite v1
[PROOF STEP]
using assms(1) assms(2) finite_UN_D
[PROOF STATE]
proof (prove)
using this:
finite A
A = \<Union> S
finite (\<Union> ?S) \<Longrightarrow> \<forall>A\<in>?S. finite A

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

goal (1 subgoal):
 1. Max_by cmp_f ` S \<subseteq> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>v1. v1 \<notin> S \<or> finite v1
[PROOF STEP]
obtain v2_13 :: "'a set set \<Rightarrow> 'a \<Rightarrow> 'a set" where "Max_by cmp_f ` S \<subseteq> \<Union>S"
[PROOF STATE]
proof (prove)
using this:
\<forall>v1. v1 \<notin> S \<or> finite v1

goal (1 subgoal):
 1. (Max_by cmp_f ` S \<subseteq> \<Union> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using f1 assms(3)
[PROOF STATE]
proof (prove)
using this:
\<forall>v1. v1 \<notin> S \<or> finite v1
\<forall>v0 v1. (infinite v0 \<or> v0 = {}) \<or> Max_by v1 v0 \<in> v0
{} \<notin> S

goal (1 subgoal):
 1. (Max_by cmp_f ` S \<subseteq> \<Union> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Max_by cmp_f ` S \<subseteq> \<Union> S

goal (1 subgoal):
 1. Max_by cmp_f ` S \<subseteq> A
[PROOF STEP]
thus "Max_by cmp_f ` S \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
Max_by cmp_f ` S \<subseteq> \<Union> S

goal (1 subgoal):
 1. Max_by cmp_f ` S \<subseteq> A
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
Max_by cmp_f ` S \<subseteq> \<Union> S
A = \<Union> S

goal (1 subgoal):
 1. Max_by cmp_f ` S \<subseteq> A
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
Max_by cmp_f ` S \<subseteq> A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Max_by cmp_f ` S \<subseteq> A

goal (2 subgoals):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> Max_by cmp_f (Max_by cmp_f ` S) \<in> A
 2. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Max_by cmp_f (Max_by cmp_f ` S) \<in> A
[PROOF STEP]
show "Max_by cmp_f (Max_by cmp_f ` S) \<in> A"
[PROOF STATE]
proof (prove)
using this:
Max_by cmp_f (Max_by cmp_f ` S) \<in> A

goal (1 subgoal):
 1. Max_by cmp_f (Max_by cmp_f ` S) \<in> A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Max_by cmp_f (Max_by cmp_f ` S) \<in> A

goal (1 subgoal):
 1. \<lbrakk>finite A; A = \<Union> S; S \<noteq> {}; {} \<notin> S; inj_on cmp_f A\<rbrakk> \<Longrightarrow> inj_on cmp_f A
[PROOF STEP]
qed


[STATEMENT]
lemma SN_imp_acyclic: "SN R \<Longrightarrow> acyclic R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SN R \<Longrightarrow> acyclic R
[PROOF STEP]
using wf_acyclic [of "R\<inverse>", unfolded SN_iff_wf [symmetric]]
[PROOF STATE]
proof (prove)
using this:
SN R \<Longrightarrow> acyclic (R\<inverse>)

goal (1 subgoal):
 1. SN R \<Longrightarrow> acyclic R
[PROOF STEP]
by auto


[STATEMENT]
lemma augment_cf_split:
  assumes "edges1 \<inter> edges2 = {}" "edges1\<inverse> \<inter> edges2 = {}"
  shows "Graph.augment_cf c (edges1 \<union> edges2) cap
    = Graph.augment_cf (Graph.augment_cf c edges1 cap) edges2 cap"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. augment_cf (edges1 \<union> edges2) cap = Graph.augment_cf (augment_cf edges1 cap) edges2 cap
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
edges1 \<inter> edges2 = {}
edges1\<inverse> \<inter> edges2 = {}

goal (1 subgoal):
 1. augment_cf (edges1 \<union> edges2) cap = Graph.augment_cf (augment_cf edges1 cap) edges2 cap
[PROOF STEP]
by (fastforce simp: Graph.augment_cf_def intro!: ext)


[STATEMENT]
lemma distinct_indicesD: "distinct_indices as \<Longrightarrow> (i,x) \<in> set as \<Longrightarrow> (i,y) \<in> set as \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct_indices as; (i, x) \<in> set as; (i, y) \<in> set as\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
unfolding distinct_indices_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct (map fst as); (i, x) \<in> set as; (i, y) \<in> set as\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (rule eq_key_imp_eq_value)


[STATEMENT]
lemma transpose_infmatrix: "transpose_infmatrix (% j i. P j i) = (% j i. P i j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_infmatrix P = (\<lambda>j i. P i j)
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. transpose_infmatrix P j i = P i j
[PROOF STEP]
by simp


[STATEMENT]
lemma emp_ref: assumes "us \<in> lists \<langle>G\<rangle>\<^sub>+" and  "Ref G us = \<epsilon>" shows "us = \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. us = \<epsilon>
[PROOF STEP]
using emp_concat_emp[OF \<open>us \<in> lists \<langle>G\<rangle>\<^sub>+\<close>]
    concat_ref [OF lists_drop_emp[OF assms(1)], unfolded \<open>Ref G us = \<epsilon>\<close> concat.simps(1),symmetric]
[PROOF STATE]
proof (prove)
using this:
concat us = \<epsilon> \<Longrightarrow> us = \<epsilon>
concat us = \<epsilon>

goal (1 subgoal):
 1. us = \<epsilon>
[PROOF STEP]
by blast


[STATEMENT]
lemma periodic_set_tan_linear:
  assumes "a\<noteq>0" "c\<noteq>0"
  shows "periodic_set (roots (\<lambda>x. a*tan (x/c) + b)) (c*pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_set (roots (\<lambda>x. a * tan (x / c) + b)) (c * pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. periodic_set (roots (\<lambda>x. a * tan (x / c) + b)) (c * pi)
[PROOF STEP]
define B where "B = { c*arctan (- b / a), c*pi/2}"
[PROOF STATE]
proof (state)
this:
B = {c * arctan (- b / a), c * pi / 2}

goal (1 subgoal):
 1. periodic_set (roots (\<lambda>x. a * tan (x / c) + b)) (c * pi)
[PROOF STEP]
have "\<exists>b\<in>B. \<exists>k::int. x = b + k * (c*pi)" when "x\<in>roots (\<lambda>x. a * tan (x/c) + b)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
define C1 where "C1 = (\<exists>k::int. x = c*arctan (- b / a) + k * (c*pi))"
[PROOF STATE]
proof (state)
this:
C1 = (\<exists>xa. x = c * arctan (- b / a) + real_of_int xa * (c * pi))

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
define C2 where "C2 = (\<exists>k::int. x = c*pi / 2 + k  * (c*pi) \<and> - b / a = 0)"
[PROOF STATE]
proof (state)
this:
C2 = (\<exists>xa. x = c * pi / 2 + real_of_int xa * (c * pi) \<and> - b / a = 0)

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
have "tan (x/c) = - b/a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (x / c) = - b / a
[PROOF STEP]
using that \<open>a\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> roots (\<lambda>x. a * tan (x / c) + b)
a \<noteq> 0

goal (1 subgoal):
 1. tan (x / c) = - b / a
[PROOF STEP]
unfolding roots_within_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {x \<in> UNIV. a * tan (x / c) + b = 0}
a \<noteq> 0

goal (1 subgoal):
 1. tan (x / c) = - b / a
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
tan (x / c) = - b / a

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tan (x / c) = - b / a
[PROOF STEP]
have "C1 \<or> C2"
[PROOF STATE]
proof (prove)
using this:
tan (x / c) = - b / a

goal (1 subgoal):
 1. C1 \<or> C2
[PROOF STEP]
unfolding C1_def C2_def
[PROOF STATE]
proof (prove)
using this:
tan (x / c) = - b / a

goal (1 subgoal):
 1. (\<exists>xa. x = c * arctan (- b / a) + real_of_int xa * (c * pi)) \<or> (\<exists>xa. x = c * pi / 2 + real_of_int xa * (c * pi) \<and> - b / a = 0)
[PROOF STEP]
using tan_eq_arctan_Ex[of "x/c" "-b/a"]  \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
tan (x / c) = - b / a
(tan (x / c) = - b / a) = (\<exists>xa. x / c = arctan (- b / a) + real_of_int xa * pi \<or> x / c = pi / 2 + real_of_int xa * pi \<and> - b / a = 0)
c \<noteq> 0

goal (1 subgoal):
 1. (\<exists>xa. x = c * arctan (- b / a) + real_of_int xa * (c * pi)) \<or> (\<exists>xa. x = c * pi / 2 + real_of_int xa * (c * pi) \<and> - b / a = 0)
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
C1 \<or> C2

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
C1 \<or> C2

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
have ?thesis when C1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
C1

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
unfolding C1_def B_def
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. x = c * arctan (- b / a) + real_of_int xa * (c * pi)

goal (1 subgoal):
 1. \<exists>b\<in>{c * arctan (- b / a), c * pi / 2}. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
C1 \<Longrightarrow> \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
C1 \<Longrightarrow> \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
have ?thesis when C2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
C2

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
unfolding C2_def B_def
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. x = c * pi / 2 + real_of_int xa * (c * pi) \<and> - b / a = 0

goal (1 subgoal):
 1. \<exists>b\<in>{c * arctan (- b / a), c * pi / 2}. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
C2 \<Longrightarrow> \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
C1 \<or> C2
C1 \<Longrightarrow> \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
C2 \<Longrightarrow> \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C1 \<or> C2
C1 \<Longrightarrow> \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
C2 \<Longrightarrow> \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)

goal (1 subgoal):
 1. \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> roots (\<lambda>x. a * tan (x / c) + b) \<Longrightarrow> \<exists>b\<in>B. \<exists>x. ?x = b + real_of_int x * (c * pi)

goal (1 subgoal):
 1. periodic_set (roots (\<lambda>x. a * tan (x / c) + b)) (c * pi)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x \<in> roots (\<lambda>x. a * tan (x / c) + b) \<Longrightarrow> \<exists>b\<in>B. \<exists>x. ?x = b + real_of_int x * (c * pi)

goal (1 subgoal):
 1. periodic_set (roots (\<lambda>x. a * tan (x / c) + b)) (c * pi)
[PROOF STEP]
have "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {c * arctan (- b / a), c * pi / 2}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite B

goal (1 subgoal):
 1. periodic_set (roots (\<lambda>x. a * tan (x / c) + b)) (c * pi)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x \<in> roots (\<lambda>x. a * tan (x / c) + b) \<Longrightarrow> \<exists>b\<in>B. \<exists>x. ?x = b + real_of_int x * (c * pi)
finite B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> roots (\<lambda>x. a * tan (x / c) + b) \<Longrightarrow> \<exists>b\<in>B. \<exists>x. ?x = b + real_of_int x * (c * pi)
finite B

goal (1 subgoal):
 1. periodic_set (roots (\<lambda>x. a * tan (x / c) + b)) (c * pi)
[PROOF STEP]
unfolding periodic_set_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> roots (\<lambda>x. a * tan (x / c) + b) \<Longrightarrow> \<exists>b\<in>B. \<exists>x. ?x = b + real_of_int x * (c * pi)
finite B

goal (1 subgoal):
 1. \<exists>B. finite B \<and> (\<forall>x\<in>roots (\<lambda>x. a * tan (x / c) + b). \<exists>b\<in>B. \<exists>xa. x = b + real_of_int xa * (c * pi))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
periodic_set (roots (\<lambda>x. a * tan (x / c) + b)) (c * pi)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma delete_first_simps [simp] :
   "delete_first P [] = None"
   "P x \<Longrightarrow> delete_first P (x # xs) = Some xs"
   "\<not>(P x) \<Longrightarrow> delete_first P (x # xs) = map_option (\<lambda>xs'. x # xs') (delete_first P xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. delete_first P [] = None &&& (P x \<Longrightarrow> delete_first P (x # xs) = Some xs) &&& (\<not> P x \<Longrightarrow> delete_first P (x # xs) = map_option ((#) x) (delete_first P xs))
[PROOF STEP]
unfolding delete_first.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. None = None &&& (P x \<Longrightarrow> (if P x then Some xs else map_option ((#) x) (delete_first P xs)) = Some xs) &&& (\<not> P x \<Longrightarrow> (if P x then Some xs else map_option ((#) x) (delete_first P xs)) = map_option ((#) x) (delete_first P xs))
[PROOF STEP]
by auto


[STATEMENT]
lemma fds_exp_minus:
  fixes f :: "'a :: dirichlet_series fds"
  shows   "fds_exp (-f) = inverse (fds_exp f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_exp (- f) = inverse (fds_exp f)
[PROOF STEP]
proof (rule fds_right_inverse_unique)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_exp f * fds_exp (- f) = 1
[PROOF STEP]
have "fds_exp f * fds_exp (- f) = fds_exp (f + (-f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_exp f * fds_exp (- f) = fds_exp (f + - f)
[PROOF STEP]
by (subst fds_exp_add) simp_all
[PROOF STATE]
proof (state)
this:
fds_exp f * fds_exp (- f) = fds_exp (f + - f)

goal (1 subgoal):
 1. fds_exp f * fds_exp (- f) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_exp f * fds_exp (- f) = fds_exp (f + - f)

goal (1 subgoal):
 1. fds_exp f * fds_exp (- f) = 1
[PROOF STEP]
have "f + (-f) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f + - f = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f + - f = 0

goal (1 subgoal):
 1. fds_exp f * fds_exp (- f) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f + - f = 0

goal (1 subgoal):
 1. fds_exp f * fds_exp (- f) = 1
[PROOF STEP]
have "fds_exp \<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_exp 0 = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fds_exp 0 = 1

goal (1 subgoal):
 1. fds_exp f * fds_exp (- f) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_exp f * fds_exp (- f) = 1
[PROOF STEP]
show "fds_exp f * fds_exp (-f) = 1"
[PROOF STATE]
proof (prove)
using this:
fds_exp f * fds_exp (- f) = 1

goal (1 subgoal):
 1. fds_exp f * fds_exp (- f) = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds_exp f * fds_exp (- f) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cancel_times_left: "(a::'a N) * b = a * c \<Longrightarrow> b = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * b = a * c \<Longrightarrow> b = c
[PROOF STEP]
apply (simp add: times_N_def Abs_N_inverse Rep_N_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_N (Rep_N a + Rep_N b) = Abs_N (Rep_N a + Rep_N c) \<Longrightarrow> b = c
[PROOF STEP]
apply (subgoal_tac "Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c))")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Abs_N (Rep_N a + Rep_N b) = Abs_N (Rep_N a + Rep_N c); Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c))\<rbrakk> \<Longrightarrow> b = c
 2. Abs_N (Rep_N a + Rep_N b) = Abs_N (Rep_N a + Rep_N c) \<Longrightarrow> Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c))
[PROOF STEP]
apply (drule drop_assumption)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c)); True\<rbrakk> \<Longrightarrow> b = c
 2. Abs_N (Rep_N a + Rep_N b) = Abs_N (Rep_N a + Rep_N c) \<Longrightarrow> Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c))
[PROOF STEP]
apply (simp add: Abs_N_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_N b = Rep_N c \<Longrightarrow> b = c
 2. Abs_N (Rep_N a + Rep_N b) = Abs_N (Rep_N a + Rep_N c) \<Longrightarrow> Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c))
[PROOF STEP]
apply (subgoal_tac "Abs_N (Rep_N b) = Abs_N (Rep_N c)")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>Rep_N b = Rep_N c; Abs_N (Rep_N b) = Abs_N (Rep_N c)\<rbrakk> \<Longrightarrow> b = c
 2. Rep_N b = Rep_N c \<Longrightarrow> Abs_N (Rep_N b) = Abs_N (Rep_N c)
 3. Abs_N (Rep_N a + Rep_N b) = Abs_N (Rep_N a + Rep_N c) \<Longrightarrow> Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c))
[PROOF STEP]
apply (drule drop_assumption)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>Abs_N (Rep_N b) = Abs_N (Rep_N c); True\<rbrakk> \<Longrightarrow> b = c
 2. Rep_N b = Rep_N c \<Longrightarrow> Abs_N (Rep_N b) = Abs_N (Rep_N c)
 3. Abs_N (Rep_N a + Rep_N b) = Abs_N (Rep_N a + Rep_N c) \<Longrightarrow> Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c))
[PROOF STEP]
apply (simp add: Rep_N_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Rep_N b = Rep_N c \<Longrightarrow> Abs_N (Rep_N b) = Abs_N (Rep_N c)
 2. Abs_N (Rep_N a + Rep_N b) = Abs_N (Rep_N a + Rep_N c) \<Longrightarrow> Rep_N (Abs_N (Rep_N a + Rep_N b)) = Rep_N (Abs_N (Rep_N a + Rep_N c))
[PROOF STEP]
by simp_all


[STATEMENT]
lemma exp1_approx:
  assumes "n > 0"
  shows   "exp (1::real) - (\<Sum>k<n. 1 / fact k) \<in> {0..2 / fact n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp 1 - (\<Sum>k<n. 1 / fact k) \<in> {0..2 / fact n}
[PROOF STEP]
proof (unfold atLeastAtMost_iff, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> exp 1 - (\<Sum>k<n. 1 / fact k)
 2. exp 1 - (\<Sum>k<n. 1 / fact k) \<le> 2 / fact n
[PROOF STEP]
have "(\<lambda>k. 1^k / fact k) sums exp (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. 1 ^ k / fact k) sums exp 1
[PROOF STEP]
using exp_converges[of "1::real"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 ^ n /\<^sub>R fact n) sums exp 1

goal (1 subgoal):
 1. (\<lambda>k. 1 ^ k / fact k) sums exp 1
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 ^ k / fact k) sums exp 1

goal (2 subgoals):
 1. 0 \<le> exp 1 - (\<Sum>k<n. 1 / fact k)
 2. exp 1 - (\<Sum>k<n. 1 / fact k) \<le> 2 / fact n
[PROOF STEP]
from sums_split_initial_segment[OF this, of n]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. 1 ^ (i + n) / fact (i + n)) sums (exp 1 - (\<Sum>i<n. 1 ^ i / fact i))
[PROOF STEP]
have sums: "(\<lambda>k. 1 / fact (n+k)) sums (exp 1 - (\<Sum>k<n. 1 / fact k :: real))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. 1 ^ (i + n) / fact (i + n)) sums (exp 1 - (\<Sum>i<n. 1 ^ i / fact i))

goal (1 subgoal):
 1. (\<lambda>k. 1 / fact (n + k)) sums (exp 1 - (\<Sum>k<n. 1 / fact k))
[PROOF STEP]
by (simp add:  algebra_simps power_add)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 / fact (n + k)) sums (exp 1 - (\<Sum>k<n. 1 / fact k))

goal (2 subgoals):
 1. 0 \<le> exp 1 - (\<Sum>k<n. 1 / fact k)
 2. exp 1 - (\<Sum>k<n. 1 / fact k) \<le> 2 / fact n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
show "(exp 1 - (\<Sum>k<n. 1 / fact k :: real)) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 0 \<le> exp 1 - (\<Sum>k<n. 1 / fact k)
[PROOF STEP]
by (intro sums_le[OF _ sums_zero sums]) auto
[PROOF STATE]
proof (state)
this:
0 \<le> exp 1 - (\<Sum>k<n. 1 / fact k)

goal (1 subgoal):
 1. exp 1 - (\<Sum>k<n. 1 / fact k) \<le> 2 / fact n
[PROOF STEP]
show "(exp 1 - (\<Sum>k<n. 1 / fact k :: real)) \<le> 2 / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp 1 - (\<Sum>k<n. 1 / fact k) \<le> 2 / fact n
[PROOF STEP]
proof (rule sums_le)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. ?f n \<le> ?g n
 2. ?f sums (exp 1 - (\<Sum>k<n. 1 / fact k))
 3. ?g sums (2 / fact n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "(\<lambda>k. (1 / fact n) * (1 / 2)^k :: real) sums ((1 / fact n) * (1 / (1 - 1 / 2)))"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<lambda>k. 1 / fact n * (1 / 2) ^ k) sums (1 / fact n * (1 / (1 - 1 / 2)))
[PROOF STEP]
by (intro sums_mult geometric_sums) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 / fact n * (1 / 2) ^ k) sums (1 / fact n * (1 / (1 - 1 / 2)))

goal (3 subgoals):
 1. \<And>n. ?f n \<le> ?g n
 2. ?f sums (exp 1 - (\<Sum>k<n. 1 / fact k))
 3. ?g sums (2 / fact n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 / fact n * (1 / 2) ^ k) sums (1 / fact n * (1 / (1 - 1 / 2)))

goal (3 subgoals):
 1. \<And>n. ?f n \<le> ?g n
 2. ?f sums (exp 1 - (\<Sum>k<n. 1 / fact k))
 3. ?g sums (2 / fact n)
[PROOF STEP]
have "\<dots> = 2 / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / fact n * (1 / (1 - 1 / 2)) = 2 / fact n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / fact n * (1 / (1 - 1 / 2)) = 2 / fact n

goal (3 subgoals):
 1. \<And>n. ?f n \<le> ?g n
 2. ?f sums (exp 1 - (\<Sum>k<n. 1 / fact k))
 3. ?g sums (2 / fact n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>k. 1 / fact n * (1 / 2) ^ k) sums (2 / fact n)
[PROOF STEP]
show "(\<lambda>k. 1 / fact n * (1 / 2) ^ k) sums (2 / fact n :: real)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. 1 / fact n * (1 / 2) ^ k) sums (2 / fact n)

goal (1 subgoal):
 1. (\<lambda>k. 1 / fact n * (1 / 2) ^ k) sums (2 / fact n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 / fact n * (1 / 2) ^ k) sums (2 / fact n)

goal (2 subgoals):
 1. \<And>na. ?f na \<le> 1 / fact n * (1 / 2) ^ na
 2. ?f sums (exp 1 - (\<Sum>k<n. 1 / fact k))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>na. ?f na \<le> 1 / fact n * (1 / 2) ^ na
 2. ?f sums (exp 1 - (\<Sum>k<n. 1 / fact k))
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>na. ?f na \<le> 1 / fact n * (1 / 2) ^ na
 2. ?f sums (exp 1 - (\<Sum>k<n. 1 / fact k))
[PROOF STEP]
show "(1 / fact (n+k)) \<le> (1 / fact n) * (1 / 2 :: real)^k" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / fact (n + k) \<le> 1 / fact n * (1 / 2) ^ k
[PROOF STEP]
using two_power_fact_le_fact[of n k] assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> n \<Longrightarrow> (2::?'a) ^ k * fact n \<le> fact (n + k)
0 < n

goal (1 subgoal):
 1. 1 / fact (n + k) \<le> 1 / fact n * (1 / 2) ^ k
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
1 / fact (n + ?k) \<le> 1 / fact n * (1 / 2) ^ ?k

goal (1 subgoal):
 1. (\<lambda>na. 1 / fact (n + na)) sums (exp 1 - (\<Sum>k<n. 1 / fact k))
[PROOF STEP]
qed fact+
[PROOF STATE]
proof (state)
this:
exp 1 - (\<Sum>k<n. 1 / fact k) \<le> 2 / fact n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quotient_map_restriction:
  assumes quo: "quotient_map X Y f" and U: "{x \<in> topspace X. f x \<in> V} = U" and disj: "openin Y V \<or> closedin Y V"
 shows "quotient_map (subtopology X U) (subtopology Y V) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
using disj
[PROOF STATE]
proof (prove)
using this:
openin Y V \<or> closedin Y V

goal (1 subgoal):
 1. quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. openin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
 2. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
assume V: "openin Y V"
[PROOF STATE]
proof (state)
this:
openin Y V

goal (2 subgoals):
 1. openin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
 2. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
with U
[PROOF STATE]
proof (chain)
picking this:
{x \<in> topspace X. f x \<in> V} = U
openin Y V
[PROOF STEP]
have sub: "U \<subseteq> topspace X" "V \<subseteq> topspace Y"
[PROOF STATE]
proof (prove)
using this:
{x \<in> topspace X. f x \<in> V} = U
openin Y V

goal (1 subgoal):
 1. U \<subseteq> topspace X &&& V \<subseteq> topspace Y
[PROOF STEP]
by (auto simp: openin_subset)
[PROOF STATE]
proof (state)
this:
U \<subseteq> topspace X
V \<subseteq> topspace Y

goal (2 subgoals):
 1. openin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
 2. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
have fim: "f ` topspace X = topspace Y"
     and Y: "\<And>U. U \<subseteq> topspace Y \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U} = openin Y U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` topspace X = topspace Y &&& (\<And>U. U \<subseteq> topspace Y \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U} = openin Y U)
[PROOF STEP]
using quo
[PROOF STATE]
proof (prove)
using this:
quotient_map X Y f

goal (1 subgoal):
 1. f ` topspace X = topspace Y &&& (\<And>U. U \<subseteq> topspace Y \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U} = openin Y U)
[PROOF STEP]
unfolding quotient_map_def
[PROOF STATE]
proof (prove)
using this:
f ` topspace X = topspace Y \<and> (\<forall>U\<subseteq>topspace Y. openin X {x \<in> topspace X. f x \<in> U} = openin Y U)

goal (1 subgoal):
 1. f ` topspace X = topspace Y &&& (\<And>U. U \<subseteq> topspace Y \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U} = openin Y U)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` topspace X = topspace Y
?U \<subseteq> topspace Y \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> ?U} = openin Y ?U

goal (2 subgoals):
 1. openin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
 2. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
have "openin X U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin X U
[PROOF STEP]
using U V Y sub(2)
[PROOF STATE]
proof (prove)
using this:
{x \<in> topspace X. f x \<in> V} = U
openin Y V
?U \<subseteq> topspace Y \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> ?U} = openin Y ?U
V \<subseteq> topspace Y

goal (1 subgoal):
 1. openin X U
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
openin X U

goal (2 subgoals):
 1. openin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
 2. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
unfolding quotient_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` topspace (subtopology X U) = topspace (subtopology Y V) \<and> (\<forall>Ua\<subseteq>topspace (subtopology Y V). openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = openin (subtopology Y V) Ua)
[PROOF STEP]
proof (intro conjI allI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` topspace (subtopology X U) = topspace (subtopology Y V)
 2. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = openin (subtopology Y V) Ua
[PROOF STEP]
show "f ` topspace (subtopology X U) = topspace (subtopology Y V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` topspace (subtopology X U) = topspace (subtopology Y V)
[PROOF STEP]
using sub U fim
[PROOF STATE]
proof (prove)
using this:
U \<subseteq> topspace X
V \<subseteq> topspace Y
{x \<in> topspace X. f x \<in> V} = U
f ` topspace X = topspace Y

goal (1 subgoal):
 1. f ` topspace (subtopology X U) = topspace (subtopology Y V)
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
f ` topspace (subtopology X U) = topspace (subtopology Y V)

goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = openin (subtopology Y V) Ua
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = openin (subtopology Y V) Ua
[PROOF STEP]
fix Y' :: "'b set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = openin (subtopology Y V) Ua
[PROOF STEP]
assume "Y' \<subseteq> topspace (subtopology Y V)"
[PROOF STATE]
proof (state)
this:
Y' \<subseteq> topspace (subtopology Y V)

goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = openin (subtopology Y V) Ua
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y' \<subseteq> topspace (subtopology Y V)
[PROOF STEP]
have "Y' \<subseteq> topspace Y" "Y' \<subseteq> V"
[PROOF STATE]
proof (prove)
using this:
Y' \<subseteq> topspace (subtopology Y V)

goal (1 subgoal):
 1. Y' \<subseteq> topspace Y &&& Y' \<subseteq> V
[PROOF STEP]
by (simp_all)
[PROOF STATE]
proof (state)
this:
Y' \<subseteq> topspace Y
Y' \<subseteq> V

goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = openin (subtopology Y V) Ua
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y' \<subseteq> topspace Y
Y' \<subseteq> V
[PROOF STEP]
have eq: "{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}"
[PROOF STATE]
proof (prove)
using this:
Y' \<subseteq> topspace Y
Y' \<subseteq> V

goal (1 subgoal):
 1. {x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}
[PROOF STEP]
using U
[PROOF STATE]
proof (prove)
using this:
Y' \<subseteq> topspace Y
Y' \<subseteq> V
{x \<in> topspace X. f x \<in> V} = U

goal (1 subgoal):
 1. {x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}

goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = openin (subtopology Y V) Ua
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}
[PROOF STEP]
show "openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Y'} = openin (subtopology Y V) Y'"
[PROOF STATE]
proof (prove)
using this:
{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}

goal (1 subgoal):
 1. openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Y'} = openin (subtopology Y V) Y'
[PROOF STEP]
using U V Y \<open>openin X U\<close>  \<open>Y' \<subseteq> topspace Y\<close> \<open>Y' \<subseteq> V\<close>
[PROOF STATE]
proof (prove)
using this:
{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}
{x \<in> topspace X. f x \<in> V} = U
openin Y V
?U \<subseteq> topspace Y \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> ?U} = openin Y ?U
openin X U
Y' \<subseteq> topspace Y
Y' \<subseteq> V

goal (1 subgoal):
 1. openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Y'} = openin (subtopology Y V) Y'
[PROOF STEP]
by (simp add: openin_open_subtopology eq) (auto simp: openin_closedin_eq)
[PROOF STATE]
proof (state)
this:
openin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Y'} = openin (subtopology Y V) Y'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
quotient_map (subtopology X U) (subtopology Y V) f

goal (1 subgoal):
 1. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
assume V: "closedin Y V"
[PROOF STATE]
proof (state)
this:
closedin Y V

goal (1 subgoal):
 1. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
with U
[PROOF STATE]
proof (chain)
picking this:
{x \<in> topspace X. f x \<in> V} = U
closedin Y V
[PROOF STEP]
have sub: "U \<subseteq> topspace X" "V \<subseteq> topspace Y"
[PROOF STATE]
proof (prove)
using this:
{x \<in> topspace X. f x \<in> V} = U
closedin Y V

goal (1 subgoal):
 1. U \<subseteq> topspace X &&& V \<subseteq> topspace Y
[PROOF STEP]
by (auto simp: closedin_subset)
[PROOF STATE]
proof (state)
this:
U \<subseteq> topspace X
V \<subseteq> topspace Y

goal (1 subgoal):
 1. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
have fim: "f ` topspace X = topspace Y"
     and Y: "\<And>U. U \<subseteq> topspace Y \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> U} = closedin Y U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` topspace X = topspace Y &&& (\<And>U. U \<subseteq> topspace Y \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> U} = closedin Y U)
[PROOF STEP]
using quo
[PROOF STATE]
proof (prove)
using this:
quotient_map X Y f

goal (1 subgoal):
 1. f ` topspace X = topspace Y &&& (\<And>U. U \<subseteq> topspace Y \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> U} = closedin Y U)
[PROOF STEP]
unfolding quotient_map_closedin
[PROOF STATE]
proof (prove)
using this:
f ` topspace X = topspace Y \<and> (\<forall>U\<subseteq>topspace Y. closedin X {x \<in> topspace X. f x \<in> U} = closedin Y U)

goal (1 subgoal):
 1. f ` topspace X = topspace Y &&& (\<And>U. U \<subseteq> topspace Y \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> U} = closedin Y U)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` topspace X = topspace Y
?U \<subseteq> topspace Y \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> ?U} = closedin Y ?U

goal (1 subgoal):
 1. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
have "closedin X U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin X U
[PROOF STEP]
using U V Y sub(2)
[PROOF STATE]
proof (prove)
using this:
{x \<in> topspace X. f x \<in> V} = U
closedin Y V
?U \<subseteq> topspace Y \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> ?U} = closedin Y ?U
V \<subseteq> topspace Y

goal (1 subgoal):
 1. closedin X U
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closedin X U

goal (1 subgoal):
 1. closedin Y V \<Longrightarrow> quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_map (subtopology X U) (subtopology Y V) f
[PROOF STEP]
unfolding quotient_map_closedin
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` topspace (subtopology X U) = topspace (subtopology Y V) \<and> (\<forall>Ua\<subseteq>topspace (subtopology Y V). closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = closedin (subtopology Y V) Ua)
[PROOF STEP]
proof (intro conjI allI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` topspace (subtopology X U) = topspace (subtopology Y V)
 2. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = closedin (subtopology Y V) Ua
[PROOF STEP]
show "f ` topspace (subtopology X U) = topspace (subtopology Y V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` topspace (subtopology X U) = topspace (subtopology Y V)
[PROOF STEP]
using sub U fim
[PROOF STATE]
proof (prove)
using this:
U \<subseteq> topspace X
V \<subseteq> topspace Y
{x \<in> topspace X. f x \<in> V} = U
f ` topspace X = topspace Y

goal (1 subgoal):
 1. f ` topspace (subtopology X U) = topspace (subtopology Y V)
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
f ` topspace (subtopology X U) = topspace (subtopology Y V)

goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = closedin (subtopology Y V) Ua
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = closedin (subtopology Y V) Ua
[PROOF STEP]
fix Y' :: "'b set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = closedin (subtopology Y V) Ua
[PROOF STEP]
assume "Y' \<subseteq> topspace (subtopology Y V)"
[PROOF STATE]
proof (state)
this:
Y' \<subseteq> topspace (subtopology Y V)

goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = closedin (subtopology Y V) Ua
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y' \<subseteq> topspace (subtopology Y V)
[PROOF STEP]
have "Y' \<subseteq> topspace Y" "Y' \<subseteq> V"
[PROOF STATE]
proof (prove)
using this:
Y' \<subseteq> topspace (subtopology Y V)

goal (1 subgoal):
 1. Y' \<subseteq> topspace Y &&& Y' \<subseteq> V
[PROOF STEP]
by (simp_all)
[PROOF STATE]
proof (state)
this:
Y' \<subseteq> topspace Y
Y' \<subseteq> V

goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = closedin (subtopology Y V) Ua
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y' \<subseteq> topspace Y
Y' \<subseteq> V
[PROOF STEP]
have eq: "{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}"
[PROOF STATE]
proof (prove)
using this:
Y' \<subseteq> topspace Y
Y' \<subseteq> V

goal (1 subgoal):
 1. {x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}
[PROOF STEP]
using U
[PROOF STATE]
proof (prove)
using this:
Y' \<subseteq> topspace Y
Y' \<subseteq> V
{x \<in> topspace X. f x \<in> V} = U

goal (1 subgoal):
 1. {x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}

goal (1 subgoal):
 1. \<And>Ua. Ua \<subseteq> topspace (subtopology Y V) \<Longrightarrow> closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Ua} = closedin (subtopology Y V) Ua
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}
[PROOF STEP]
show "closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Y'} = closedin (subtopology Y V) Y'"
[PROOF STATE]
proof (prove)
using this:
{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}

goal (1 subgoal):
 1. closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Y'} = closedin (subtopology Y V) Y'
[PROOF STEP]
using U V Y \<open>closedin X U\<close>  \<open>Y' \<subseteq> topspace Y\<close> \<open>Y' \<subseteq> V\<close>
[PROOF STATE]
proof (prove)
using this:
{x \<in> topspace X. x \<in> U \<and> f x \<in> Y'} = {x \<in> topspace X. f x \<in> Y'}
{x \<in> topspace X. f x \<in> V} = U
closedin Y V
?U \<subseteq> topspace Y \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> ?U} = closedin Y ?U
closedin X U
Y' \<subseteq> topspace Y
Y' \<subseteq> V

goal (1 subgoal):
 1. closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Y'} = closedin (subtopology Y V) Y'
[PROOF STEP]
by (simp add: closedin_closed_subtopology eq) (auto simp: closedin_def)
[PROOF STATE]
proof (state)
this:
closedin (subtopology X U) {x \<in> topspace (subtopology X U). f x \<in> Y'} = closedin (subtopology Y V) Y'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
quotient_map (subtopology X U) (subtopology Y V) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_generated_subset_generator:
  assumes "ideal_generated A = I"
  shows "A \<subseteq> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ideal_generated A = I

goal (1 subgoal):
 1. A \<subseteq> I
[PROOF STEP]
unfolding ideal_generated_def
[PROOF STATE]
proof (prove)
using this:
\<Inter> {I. ideal I \<and> A \<subseteq> I} = I

goal (1 subgoal):
 1. A \<subseteq> I
[PROOF STEP]
by auto


[STATEMENT]
lemma num_abs_sbintr:
  "(numeral x :: 'a word) =
    word_of_int (signed_take_bit (LENGTH('a::len) - 1) (numeral x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral x = word_of_int (signed_take_bit (LENGTH('a) - 1) (numeral x))
[PROOF STEP]
by transfer (simp add: take_bit_signed_take_bit)


[STATEMENT]
lemma bifunctor_flip_ArrMap_app'[cat_cs_simps]:
  assumes "fg = [f, g]\<^sub>\<circ>"
    and "category \<alpha> \<AA>"
    and "category \<alpha> \<BB>"
    and "\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
    and "f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>"
  shows "bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ArrMap\<rparr>\<lparr>fg\<rparr> = \<FF>\<lparr>ArrMap\<rparr>\<lparr>g, f\<rparr>\<^sub>\<bullet>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ArrMap\<rparr>\<lparr>fg\<rparr> = g \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<FF>\<^esub> f
[PROOF STEP]
using assms(2-6)
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ArrMap\<rparr>\<lparr>fg\<rparr> = g \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<FF>\<^esub> f
[PROOF STEP]
unfolding assms(1)
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
g \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. f \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>bifunctor_flip \<AA> \<BB> \<FF>\<^esub> g = g \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>\<FF>\<^esub> f
[PROOF STEP]
by (rule bifunctor_flip_ArrMap_app)


[STATEMENT]
lemma helper_I2_proj_fst_proj_snd_iff:
  "(\<forall>j\<in>\<^sub>\<circ>2\<^sub>\<nat>. \<pi>'\<lparr>NTMap\<rparr>\<lparr>j\<rparr> = \<pi>\<lparr>NTMap\<rparr>\<lparr>j\<rparr> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f') \<longleftrightarrow>
    (proj_fst \<pi>' = proj_fst \<pi> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f' \<and> proj_snd \<pi>' = proj_snd \<pi> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>j\<in>elts (2\<^sub>\<nat>). \<pi>'\<lparr>NTMap\<rparr>\<lparr>j\<rparr> = \<pi>\<lparr>NTMap\<rparr>\<lparr>j\<rparr> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f') = (\<pi>'\<lparr>NTMap\<rparr>\<lparr>[]\<^sub>\<circ>\<rparr> = \<pi>\<lparr>NTMap\<rparr>\<lparr>[]\<^sub>\<circ>\<rparr> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f' \<and> \<pi>'\<lparr>NTMap\<rparr>\<lparr>1\<^sub>\<nat>\<rparr> = \<pi>\<lparr>NTMap\<rparr>\<lparr>1\<^sub>\<nat>\<rparr> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f')
[PROOF STEP]
unfolding two
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>j\<in>elts (ZFC_in_HOL.set {[]\<^sub>\<circ>, 1\<^sub>\<nat>}). \<pi>'\<lparr>NTMap\<rparr>\<lparr>j\<rparr> = \<pi>\<lparr>NTMap\<rparr>\<lparr>j\<rparr> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f') = (\<pi>'\<lparr>NTMap\<rparr>\<lparr>[]\<^sub>\<circ>\<rparr> = \<pi>\<lparr>NTMap\<rparr>\<lparr>[]\<^sub>\<circ>\<rparr> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f' \<and> \<pi>'\<lparr>NTMap\<rparr>\<lparr>1\<^sub>\<nat>\<rparr> = \<pi>\<lparr>NTMap\<rparr>\<lparr>1\<^sub>\<nat>\<rparr> \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> f')
[PROOF STEP]
by auto


[STATEMENT]
lemma fold_append_queue_rep: "linearize (fold (\<lambda>x q. append_queue x q) xs q) = linearize q @ xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linearize (fold append_queue xs q) = linearize q @ xs
[PROOF STEP]
by (induction xs arbitrary: q) (auto simp add: append_queue_rep)