[STATEMENT]
lemma vec_sum:
  assumes "finite S"
  shows "vec(sum f S) = sum (vec \<circ> f) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (sum f S) = sum (vec \<circ> f) S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. vec (sum f S) = sum (vec \<circ> f) S
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vec (sum f {}) = sum (vec \<circ> f) {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; vec (sum f F) = sum (vec \<circ> f) F\<rbrakk> \<Longrightarrow> vec (sum f (insert x F)) = sum (vec \<circ> f) (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. vec (sum f {}) = sum (vec \<circ> f) {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; vec (sum f F) = sum (vec \<circ> f) F\<rbrakk> \<Longrightarrow> vec (sum f (insert x F)) = sum (vec \<circ> f) (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (sum f {}) = sum (vec \<circ> f) {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec (sum f {}) = sum (vec \<circ> f) {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; vec (sum f F) = sum (vec \<circ> f) F\<rbrakk> \<Longrightarrow> vec (sum f (insert x F)) = sum (vec \<circ> f) (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; vec (sum f F) = sum (vec \<circ> f) F\<rbrakk> \<Longrightarrow> vec (sum f (insert x F)) = sum (vec \<circ> f) (insert x F)
[PROOF STEP]
case insert
[PROOF STATE]
proof (state)
this:
finite F_
x_ \<notin> F_
vec (sum f F_) = sum (vec \<circ> f) F_

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; vec (sum f F) = sum (vec \<circ> f) F\<rbrakk> \<Longrightarrow> vec (sum f (insert x F)) = sum (vec \<circ> f) (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F_
x_ \<notin> F_
vec (sum f F_) = sum (vec \<circ> f) F_
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F_
x_ \<notin> F_
vec (sum f F_) = sum (vec \<circ> f) F_

goal (1 subgoal):
 1. vec (sum f (insert x_ F_)) = sum (vec \<circ> f) (insert x_ F_)
[PROOF STEP]
by (auto simp add: vec_add)
[PROOF STATE]
proof (state)
this:
vec (sum f (insert x_ F_)) = sum (vec \<circ> f) (insert x_ F_)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma len_le_concat: "\<epsilon> \<notin>  set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<epsilon> \<notin> set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|
[PROOF STEP]
proof (induct ws, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ws. \<lbrakk>\<epsilon> \<notin> set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|; \<epsilon> \<notin> set (a # ws)\<rbrakk> \<Longrightarrow> \<^bold>|a # ws\<^bold>| \<le> \<^bold>|concat (a # ws)\<^bold>|
[PROOF STEP]
case (Cons a ws)
[PROOF STATE]
proof (state)
this:
\<epsilon> \<notin> set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|
\<epsilon> \<notin> set (a # ws)

goal (1 subgoal):
 1. \<And>a ws. \<lbrakk>\<epsilon> \<notin> set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|; \<epsilon> \<notin> set (a # ws)\<rbrakk> \<Longrightarrow> \<^bold>|a # ws\<^bold>| \<le> \<^bold>|concat (a # ws)\<^bold>|
[PROOF STEP]
hence "1 \<le> \<^bold>|a\<^bold>|"
[PROOF STATE]
proof (prove)
using this:
\<epsilon> \<notin> set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|
\<epsilon> \<notin> set (a # ws)

goal (1 subgoal):
 1. 1 \<le> \<^bold>|a\<^bold>|
[PROOF STEP]
using list.set_intros(1)[of a ws] nemp_le_len[of a]
[PROOF STATE]
proof (prove)
using this:
\<epsilon> \<notin> set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|
\<epsilon> \<notin> set (a # ws)
a \<in> set (a # ws)
a \<noteq> \<epsilon> \<Longrightarrow> 1 \<le> \<^bold>|a\<^bold>|

goal (1 subgoal):
 1. 1 \<le> \<^bold>|a\<^bold>|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 \<le> \<^bold>|a\<^bold>|

goal (1 subgoal):
 1. \<And>a ws. \<lbrakk>\<epsilon> \<notin> set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|; \<epsilon> \<notin> set (a # ws)\<rbrakk> \<Longrightarrow> \<^bold>|a # ws\<^bold>| \<le> \<^bold>|concat (a # ws)\<^bold>|
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> \<^bold>|a\<^bold>|
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
1 \<le> \<^bold>|a\<^bold>|

goal (1 subgoal):
 1. \<^bold>|a # ws\<^bold>| \<le> \<^bold>|concat (a # ws)\<^bold>|
[PROOF STEP]
unfolding   concat.simps(2)
[PROOF STATE]
proof (prove)
using this:
1 \<le> \<^bold>|a\<^bold>|

goal (1 subgoal):
 1. \<^bold>|a # ws\<^bold>| \<le> \<^bold>|a \<cdot> concat ws\<^bold>|
[PROOF STEP]
unfolding  lenmorph hd_word[of a ws] sing_len
[PROOF STATE]
proof (prove)
using this:
1 \<le> \<^bold>|a\<^bold>|

goal (1 subgoal):
 1. 1 + \<^bold>|ws\<^bold>| \<le> \<^bold>|a\<^bold>| + \<^bold>|concat ws\<^bold>|
[PROOF STEP]
using Cons.hyps Cons.prems
[PROOF STATE]
proof (prove)
using this:
1 \<le> \<^bold>|a\<^bold>|
\<epsilon> \<notin> set ws \<Longrightarrow> \<^bold>|ws\<^bold>| \<le> \<^bold>|concat ws\<^bold>|
\<epsilon> \<notin> set (a # ws)

goal (1 subgoal):
 1. 1 + \<^bold>|ws\<^bold>| \<le> \<^bold>|a\<^bold>| + \<^bold>|concat ws\<^bold>|
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<^bold>|a # ws\<^bold>| \<le> \<^bold>|concat (a # ws)\<^bold>|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hyperb_ineq_4_points [mono_intros]:
  "Min {Gromov_product_at (e::'a) x y, Gromov_product_at e y z, Gromov_product_at e z t} - 2 * deltaG(TYPE('a)) \<le> Gromov_product_at e x t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min {Gromov_product_at e x y, Gromov_product_at e y z, Gromov_product_at e z t} - 2 * deltaG TYPE('a) \<le> Gromov_product_at e x t
[PROOF STEP]
using hyperb_ineq[of e x y z] hyperb_ineq[of e x z t]
[PROOF STATE]
proof (prove)
using this:
min (Gromov_product_at e x y) (Gromov_product_at e y z) - deltaG TYPE('a) \<le> Gromov_product_at e x z
min (Gromov_product_at e x z) (Gromov_product_at e z t) - deltaG TYPE('a) \<le> Gromov_product_at e x t

goal (1 subgoal):
 1. Min {Gromov_product_at e x y, Gromov_product_at e y z, Gromov_product_at e z t} - 2 * deltaG TYPE('a) \<le> Gromov_product_at e x t
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>min (Gromov_product_at e x y) (Gromov_product_at e y z) - deltaG TYPE('a) \<le> Gromov_product_at e x z; min (Gromov_product_at e x z) (Gromov_product_at e z t) - deltaG TYPE('a) \<le> Gromov_product_at e x t\<rbrakk> \<Longrightarrow> min (Gromov_product_at e x y) (min (Gromov_product_at e y z) (Gromov_product_at e z t)) - 2 * deltaG TYPE('a) \<le> Gromov_product_at e x t
[PROOF STEP]
using delta_nonneg
[PROOF STATE]
proof (prove)
using this:
0 \<le> deltaG TYPE('a)

goal (1 subgoal):
 1. \<lbrakk>min (Gromov_product_at e x y) (Gromov_product_at e y z) - deltaG TYPE('a) \<le> Gromov_product_at e x z; min (Gromov_product_at e x z) (Gromov_product_at e z t) - deltaG TYPE('a) \<le> Gromov_product_at e x t\<rbrakk> \<Longrightarrow> min (Gromov_product_at e x y) (min (Gromov_product_at e y z) (Gromov_product_at e z t)) - 2 * deltaG TYPE('a) \<le> Gromov_product_at e x t
[PROOF STEP]
by linarith


[STATEMENT]
lemma conjugate_comp: "residuated f \<Longrightarrow> residuated g \<Longrightarrow> conjugate (f o g) = conjugate g o conjugate f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> conjugate (f \<circ> g) = conjugate g \<circ> conjugate f
[PROOF STEP]
proof (rule ext, rule indirect_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x z. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> (conjugate (f \<circ> g) x \<le> z) = ((conjugate g \<circ> conjugate f) x \<le> z)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x z. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> (conjugate (f \<circ> g) x \<le> z) = ((conjugate g \<circ> conjugate f) x \<le> z)
[PROOF STEP]
assume assms: "residuated f" "residuated g"
[PROOF STATE]
proof (state)
this:
residuated f
residuated g

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> (conjugate (f \<circ> g) x \<le> z) = ((conjugate g \<circ> conjugate f) x \<le> z)
[PROOF STEP]
have "conjugate (f o g) x \<le> y \<longleftrightarrow> x \<le> -f(g(-y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (conjugate (f \<circ> g) x \<le> y) = (x \<le> - f (g (- y)))
[PROOF STEP]
apply (subst residuated_conjugate_ineq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. residuated (f \<circ> g)
 2. (x \<le> - (f \<circ> g) (- y)) = (x \<le> - f (g (- y)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
residuated f
residuated g

goal (2 subgoals):
 1. residuated (f \<circ> g)
 2. (x \<le> - (f \<circ> g) (- y)) = (x \<le> - f (g (- y)))
[PROOF STEP]
by (auto intro!: residuated_comp_closed)
[PROOF STATE]
proof (state)
this:
(conjugate (f \<circ> g) x \<le> y) = (x \<le> - f (g (- y)))

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> (conjugate (f \<circ> g) x \<le> z) = ((conjugate g \<circ> conjugate f) x \<le> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(conjugate (f \<circ> g) x \<le> y) = (x \<le> - f (g (- y)))

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> (conjugate (f \<circ> g) x \<le> z) = ((conjugate g \<circ> conjugate f) x \<le> z)
[PROOF STEP]
have "... \<longleftrightarrow> conjugate g (conjugate f x) \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> - f (g (- y))) = (conjugate g (conjugate f x) \<le> y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
residuated f
residuated g

goal (1 subgoal):
 1. (x \<le> - f (g (- y))) = (conjugate g (conjugate f x) \<le> y)
[PROOF STEP]
by (simp add: residuated_conjugate_ineq)
[PROOF STATE]
proof (state)
this:
(x \<le> - f (g (- y))) = (conjugate g (conjugate f x) \<le> y)

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>residuated f; residuated g\<rbrakk> \<Longrightarrow> (conjugate (f \<circ> g) x \<le> z) = ((conjugate g \<circ> conjugate f) x \<le> z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(conjugate (f \<circ> g) x \<le> y) = (conjugate g (conjugate f x) \<le> y)
[PROOF STEP]
show "(conjugate (f \<circ> g) x \<le> y) = ((conjugate g \<circ> conjugate f) x \<le> y)"
[PROOF STATE]
proof (prove)
using this:
(conjugate (f \<circ> g) x \<le> y) = (conjugate g (conjugate f x) \<le> y)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ltlr_rel_id[relator_props]: "\<lbrakk> R = Id \<rbrakk> \<Longrightarrow> \<langle>R\<rangle>ltlr_rel = Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R = Id \<Longrightarrow> \<langle>R\<rangle>ltlr_rel = Id
[PROOF STEP]
proof (intro equalityI subsetI, clarsimp_all)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>R = Id; (a, b) \<in> \<langle>Id\<rangle>ltlr_rel\<rbrakk> \<Longrightarrow> a = b
 2. \<And>b. R = Id \<Longrightarrow> (b, b) \<in> \<langle>Id\<rangle>ltlr_rel
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>R = Id; (a, b) \<in> \<langle>Id\<rangle>ltlr_rel\<rbrakk> \<Longrightarrow> a = b
 2. \<And>b. R = Id \<Longrightarrow> (b, b) \<in> \<langle>Id\<rangle>ltlr_rel
[PROOF STEP]
assume "(a,b)\<in>\<langle>Id\<rangle>ltlr_rel"
[PROOF STATE]
proof (state)
this:
(a, b) \<in> \<langle>Id\<rangle>ltlr_rel

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>R = Id; (a, b) \<in> \<langle>Id\<rangle>ltlr_rel\<rbrakk> \<Longrightarrow> a = b
 2. \<And>b. R = Id \<Longrightarrow> (b, b) \<in> \<langle>Id\<rangle>ltlr_rel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> \<langle>Id\<rangle>ltlr_rel
[PROOF STEP]
show "a=b"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> \<langle>Id\<rangle>ltlr_rel

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by induction auto
[PROOF STATE]
proof (state)
this:
a = b

goal (1 subgoal):
 1. \<And>b. R = Id \<Longrightarrow> (b, b) \<in> \<langle>Id\<rangle>ltlr_rel
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. R = Id \<Longrightarrow> (b, b) \<in> \<langle>Id\<rangle>ltlr_rel
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. R = Id \<Longrightarrow> (b, b) \<in> \<langle>Id\<rangle>ltlr_rel
[PROOF STEP]
show "(a,a)\<in>\<langle>Id\<rangle>ltlr_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a, a) \<in> \<langle>Id\<rangle>ltlr_rel
[PROOF STEP]
by (induction a) (auto intro: ltlr_rel_intros)
[PROOF STATE]
proof (state)
this:
(a, a) \<in> \<langle>Id\<rangle>ltlr_rel

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_subtuple_antisym:
  "strict_subtuple (\<lambda>x y. f x y \<or> x = y) xm ym \<Longrightarrow>
   strict_subtuple (\<lambda>x y. f x y \<and> \<not> f y x \<or> x = y) ym xm \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>strict_subtuple (\<lambda>x y. f x y \<or> x = y) xm ym; strict_subtuple (\<lambda>x y. f x y \<and> \<not> f y x \<or> x = y) ym xm\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (auto simp add: subtuple_antisym)


[STATEMENT]
lemma (in dcharacter) sum_dcharacter_block:
  "(\<Sum>x<n. \<chi> x) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum \<chi> {..<n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum \<chi> {..<n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
have "(\<Sum>x<n. \<chi> x) = (\<Sum>x\<in>totatives n. \<chi> x)"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. sum \<chi> {..<n} = sum \<chi> (totatives n)
[PROOF STEP]
by (intro sum.mono_neutral_right)
       (auto simp: totatives_def eq_zero_iff intro!: Nat.gr0I order.not_eq_order_implies_strict)
[PROOF STATE]
proof (state)
this:
sum \<chi> {..<n} = sum \<chi> (totatives n)

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

goal (1 subgoal):
 1. sum \<chi> {..<n} = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
have "\<dots> = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
by (rule sum_dcharacter_totatives)
[PROOF STATE]
proof (state)
this:
sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_const_mult_right:
  "f * fps_const (c::'a::{comm_monoid_add,mult_zero}) = Abs_fps (\<lambda>n. f$n * c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * fps_const c = Abs_fps (\<lambda>n. f $ n * c)
[PROOF STEP]
unfolding fps_eq_iff fps_mult_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. (\<Sum>i = 0..n. f $ i * fps_const c $ (n - i)) = Abs_fps (\<lambda>n. f $ n * c) $ n
[PROOF STEP]
by (simp add: fps_const_def mult_delta_right)


[STATEMENT]
lemma non_sdominate_succ: "(i,j ) \<in> g_E G \<Longrightarrow> k \<noteq> i \<Longrightarrow> non_strict_dominate k i \<Longrightarrow> non_strict_dominate k j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(i, j) \<in> g_E G; k \<noteq> i; non_strict_dominate k i\<rbrakk> \<Longrightarrow> non_strict_dominate k j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>(i, j) \<in> g_E G; k \<noteq> i; non_strict_dominate k i\<rbrakk> \<Longrightarrow> non_strict_dominate k j
[PROOF STEP]
assume i_j: "(i,j ) \<in> g_E G" and k_neq_i: "k \<noteq> i" and "non_strict_dominate k i"
[PROOF STATE]
proof (state)
this:
(i, j) \<in> g_E G
k \<noteq> i
non_strict_dominate k i

goal (1 subgoal):
 1. \<lbrakk>(i, j) \<in> g_E G; k \<noteq> i; non_strict_dominate k i\<rbrakk> \<Longrightarrow> non_strict_dominate k j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(i, j) \<in> g_E G
k \<noteq> i
non_strict_dominate k i
[PROOF STEP]
obtain pa where "path_entry (g_E G) pa i" and k_nin_pa: "k \<notin> set pa"
[PROOF STATE]
proof (prove)
using this:
(i, j) \<in> g_E G
k \<noteq> i
non_strict_dominate k i

goal (1 subgoal):
 1. (\<And>pa. \<lbrakk>path_entry (g_E G) pa i; k \<notin> set pa\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add:non_strict_dominate_def)
[PROOF STATE]
proof (state)
this:
path_entry (g_E G) pa i
k \<notin> set pa

goal (1 subgoal):
 1. \<lbrakk>(i, j) \<in> g_E G; k \<noteq> i; non_strict_dominate k i\<rbrakk> \<Longrightarrow> non_strict_dominate k j
[PROOF STEP]
with i_j
[PROOF STATE]
proof (chain)
picking this:
(i, j) \<in> g_E G
path_entry (g_E G) pa i
k \<notin> set pa
[PROOF STEP]
have "path_entry (g_E G) (i#pa) j"
[PROOF STATE]
proof (prove)
using this:
(i, j) \<in> g_E G
path_entry (g_E G) pa i
k \<notin> set pa

goal (1 subgoal):
 1. path_entry (g_E G) (i # pa) j
[PROOF STEP]
by (auto simp add:path_entry_prepend)
[PROOF STATE]
proof (state)
this:
path_entry (g_E G) (i # pa) j

goal (1 subgoal):
 1. \<lbrakk>(i, j) \<in> g_E G; k \<noteq> i; non_strict_dominate k i\<rbrakk> \<Longrightarrow> non_strict_dominate k j
[PROOF STEP]
with k_neq_i k_nin_pa
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> i
k \<notin> set pa
path_entry (g_E G) (i # pa) j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k \<noteq> i
k \<notin> set pa
path_entry (g_E G) (i # pa) j

goal (1 subgoal):
 1. non_strict_dominate k j
[PROOF STEP]
by (auto simp add:non_strict_dominate_def)
[PROOF STATE]
proof (state)
this:
non_strict_dominate k j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bv_to_int_upper_range: "bv_to_int w < 2 ^ (length w - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bv_to_int w < 2 ^ (length w - 1)
[PROOF STEP]
proof (rule bit_list_cases [of w],simp_all add: bv_to_nat_upper_range)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>bs. w = \<one> # bs \<Longrightarrow> - 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs
[PROOF STEP]
fix bs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>bs. w = \<one> # bs \<Longrightarrow> - 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs
[PROOF STEP]
have "-1 - int (bv_to_nat (bv_not bs)) \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 - int (bv_to_nat (bv_not bs)) \<le> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- 1 - int (bv_to_nat (bv_not bs)) \<le> 0

goal (1 subgoal):
 1. \<And>bs. w = \<one> # bs \<Longrightarrow> - 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- 1 - int (bv_to_nat (bv_not bs)) \<le> 0

goal (1 subgoal):
 1. \<And>bs. w = \<one> # bs \<Longrightarrow> - 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs
[PROOF STEP]
have "... < 2 ^ length bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ length bs
[PROOF STEP]
by (induct bs) simp_all
[PROOF STATE]
proof (state)
this:
0 < 2 ^ length bs

goal (1 subgoal):
 1. \<And>bs. w = \<one> # bs \<Longrightarrow> - 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs
[PROOF STEP]
show "-1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs"
[PROOF STATE]
proof (prove)
using this:
- 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs

goal (1 subgoal):
 1. - 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
- 1 - int (bv_to_nat (bv_not bs)) < 2 ^ length bs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma toSet_big_union[simp]:
  "toSet (big_union f X) = (\<Union>x \<in> set X. toSet (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toSet (big_union f X) = (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. toSet (big_union f X) = (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. toSet (big_union f X) = (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
fix X Y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. toSet (big_union f X) = (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
have "toSet (foldr (\<lambda>x A. ODList.union (f x) A) X Y) = toSet Y \<union> (\<Union>x \<in> set X. toSet (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toSet (foldr (\<lambda>x. ODList.union (f x)) X Y) = toSet Y \<union> (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
by (induct X arbitrary: Y) auto
[PROOF STATE]
proof (state)
this:
toSet (foldr (\<lambda>x. ODList.union (f x)) X Y) = toSet Y \<union> (\<Union>x\<in>set X. toSet (f x))

goal (1 subgoal):
 1. toSet (big_union f X) = (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
toSet (foldr (\<lambda>x. ODList.union (f x)) ?Xa2 ?Y2) = toSet ?Y2 \<union> (\<Union>x\<in>set ?Xa2. toSet (f x))

goal (1 subgoal):
 1. toSet (big_union f X) = (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
toSet (foldr (\<lambda>x. ODList.union (f x)) ?Xa2 ?Y2) = toSet ?Y2 \<union> (\<Union>x\<in>set ?Xa2. toSet (f x))

goal (1 subgoal):
 1. toSet (big_union f X) = (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
unfolding big_union_def
[PROOF STATE]
proof (prove)
using this:
toSet (foldr (\<lambda>x. ODList.union (f x)) ?Xa2 ?Y2) = toSet ?Y2 \<union> (\<Union>x\<in>set ?Xa2. toSet (f x))

goal (1 subgoal):
 1. toSet (foldr (\<lambda>a. ODList.union (f a)) X ODList.empty) = (\<Union>x\<in>set X. toSet (f x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
toSet (big_union f X) = (\<Union>x\<in>set X. toSet (f x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parts_trans: "[| X \<in> parts G;  G \<subseteq> parts H |] ==> X\<in> parts H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> parts G; G \<subseteq> parts H\<rbrakk> \<Longrightarrow> X \<in> parts H
[PROOF STEP]
by (drule parts_mono, blast)


[STATEMENT]
lemma filterlim_at_infinity_imp_filterlim_at_top:
  assumes "filterlim (f :: 'a \<Rightarrow> real) at_infinity F"
  assumes "eventually (\<lambda>x. f x > 0) F"
  shows   "filterlim f at_top F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. 0 < f x
[PROOF STEP]
have *: "eventually (\<lambda>x. norm (f x) = f x) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) = f x
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x) = f x

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_infinity F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim f at_infinity F

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
unfolding filterlim_at_infinity_conv_norm_at_top
[PROOF STATE]
proof (prove)
using this:
LIM x F. norm (f x) :> at_top

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
by (subst (asm) filterlim_cong[OF refl refl *])
[PROOF STATE]
proof (state)
this:
filterlim f at_top F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distance0_at_most_sd4r:
  assumes "a\<^sub>o > a\<^sub>e"
  shows "distance0 \<le> safe_distance_4r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distance0 \<le> safe_distance_4r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distance0 \<le> safe_distance_4r
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a\<^sub>e < a\<^sub>o
[PROOF STEP]
have "a\<^sub>o \<ge> a\<^sub>e"
[PROOF STATE]
proof (prove)
using this:
a\<^sub>e < a\<^sub>o

goal (1 subgoal):
 1. a\<^sub>e \<le> a\<^sub>o
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a\<^sub>e \<le> a\<^sub>o

goal (1 subgoal):
 1. distance0 \<le> safe_distance_4r
[PROOF STEP]
have "0 \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / (2 * a\<^sub>o - 2 * a\<^sub>e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / (2 * a\<^sub>o - 2 * a\<^sub>e)
[PROOF STEP]
by (rule divide_nonneg_nonneg) (auto simp add:assms \<open>a\<^sub>e \<le> a\<^sub>o\<close>)
[PROOF STATE]
proof (state)
this:
0 \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / (2 * a\<^sub>o - 2 * a\<^sub>e)

goal (1 subgoal):
 1. distance0 \<le> safe_distance_4r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / (2 * a\<^sub>o - 2 * a\<^sub>e)

goal (1 subgoal):
 1. distance0 \<le> safe_distance_4r
[PROOF STEP]
unfolding distance0_def safe_distance_4r_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / (2 * a\<^sub>o - 2 * a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> - v\<^sub>o * \<delta> - a\<^sub>o * \<delta>\<^sup>2 / 2 \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distance0 \<le> safe_distance_4r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible_primitive_part_fract:
  fixes p :: "'a :: {idom_divide, ring_gcd, factorial_semiring, semiring_Gcd,semiring_gcd_mult_normalize} fract poly"
  assumes "irreducible p"
  shows   "irreducible (primitive_part_fract p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
irreducible p
[PROOF STEP]
have deg: "degree (primitive_part_fract p) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
irreducible p

goal (1 subgoal):
 1. degree (primitive_part_fract p) \<noteq> 0
[PROOF STEP]
by (intro notI)
       (auto elim!: degree_eq_zeroE simp: irreducible_def is_unit_poly_iff dvd_field_iff)
[PROOF STATE]
proof (state)
this:
degree (primitive_part_fract p) \<noteq> 0

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
hence [simp]: "p \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
degree (primitive_part_fract p) \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
note \<open>irreducible p\<close>
[PROOF STATE]
proof (state)
this:
irreducible p

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
irreducible p

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
have "p = [:fract_content p:] * fract_poly (primitive_part_fract p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = [:fract_content p:] * map_poly to_fract (primitive_part_fract p)
[PROOF STEP]
by (simp add: content_times_primitive_part_fract)
[PROOF STATE]
proof (state)
this:
p = [:fract_content p:] * map_poly to_fract (primitive_part_fract p)

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p = [:fract_content p:] * map_poly to_fract (primitive_part_fract p)

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
have "irreducible \<dots> \<longleftrightarrow> irreducible (fract_poly (primitive_part_fract p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible ([:fract_content p:] * map_poly to_fract (primitive_part_fract p)) = irreducible (map_poly to_fract (primitive_part_fract p))
[PROOF STEP]
by (intro irreducible_mult_unit_left) (simp_all add: is_unit_poly_iff dvd_field_iff)
[PROOF STATE]
proof (state)
this:
irreducible ([:fract_content p:] * map_poly to_fract (primitive_part_fract p)) = irreducible (map_poly to_fract (primitive_part_fract p))

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
irreducible (map_poly to_fract (primitive_part_fract p))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
irreducible (map_poly to_fract (primitive_part_fract p))

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
using deg
[PROOF STATE]
proof (prove)
using this:
irreducible (map_poly to_fract (primitive_part_fract p))
degree (primitive_part_fract p) \<noteq> 0

goal (1 subgoal):
 1. irreducible (primitive_part_fract p)
[PROOF STEP]
by (simp add: nonconst_poly_irreducible_iff)
[PROOF STATE]
proof (state)
this:
irreducible (primitive_part_fract p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma RDirProd_list_truncate:
  shows "monoid.truncate (RDirProd_list Rs) = DirProd_list Rs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs
[PROOF STEP]
proof (induct Rs, simp add: RDirProd_list_def DirProd_list_def monoid.defs)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
case (Cons R Rs)
[PROOF STATE]
proof (state)
this:
monoid.truncate (RDirProd_list Rs) = DirProd_list Rs

goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
have "monoid.truncate (RDirProd_list (R # Rs)) =
        monoid.truncate (image_ring (\<lambda>(a, as). a # as) (RDirProd R (RDirProd_list Rs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid.truncate (RDirProd_list (R # Rs)) = monoid.truncate (image_ring (\<lambda>(a, as). a # as) (RDirProd R (RDirProd_list Rs)))
[PROOF STEP]
unfolding RDirProd_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid.truncate (foldr (\<lambda>R S. image_ring (\<lambda>(x, y). x # y) (RDirProd R S)) (R # Rs) nil_ring) = monoid.truncate (image_ring (\<lambda>(a, as). a # as) (RDirProd R (foldr (\<lambda>R S. image_ring (\<lambda>(x, y). x # y) (RDirProd R S)) Rs nil_ring)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
monoid.truncate (RDirProd_list (R # Rs)) = monoid.truncate (image_ring (\<lambda>(a, as). a # as) (RDirProd R (RDirProd_list Rs)))

goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
monoid.truncate (RDirProd_list (R # Rs)) = monoid.truncate (image_ring (\<lambda>(a, as). a # as) (RDirProd R (RDirProd_list Rs)))

goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
have " ... = image_group (\<lambda>(a, as). a # as) (monoid.truncate (RDirProd R (RDirProd_list Rs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoid.truncate (image_ring (\<lambda>(a, as). a # as) (RDirProd R (RDirProd_list Rs))) = image_group (\<lambda>(a, as). a # as) (monoid.truncate (RDirProd R (RDirProd_list Rs)))
[PROOF STEP]
by (simp add: image_ring_def image_group_def monoid.defs)
[PROOF STATE]
proof (state)
this:
monoid.truncate (image_ring (\<lambda>(a, as). a # as) (RDirProd R (RDirProd_list Rs))) = image_group (\<lambda>(a, as). a # as) (monoid.truncate (RDirProd R (RDirProd_list Rs)))

goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
monoid.truncate (image_ring (\<lambda>(a, as). a # as) (RDirProd R (RDirProd_list Rs))) = image_group (\<lambda>(a, as). a # as) (monoid.truncate (RDirProd R (RDirProd_list Rs)))

goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
have " ... = image_group (\<lambda>(a, as). a # as) (R \<times>\<times> (monoid.truncate (RDirProd_list Rs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_group (\<lambda>(a, as). a # as) (monoid.truncate (RDirProd R (RDirProd_list Rs))) = image_group (\<lambda>(a, as). a # as) (R \<times>\<times> monoid.truncate (RDirProd_list Rs))
[PROOF STEP]
by (simp add: RDirProd_def DirProd_def monoid.defs)
[PROOF STATE]
proof (state)
this:
image_group (\<lambda>(a, as). a # as) (monoid.truncate (RDirProd R (RDirProd_list Rs))) = image_group (\<lambda>(a, as). a # as) (R \<times>\<times> monoid.truncate (RDirProd_list Rs))

goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
image_group (\<lambda>(a, as). a # as) (monoid.truncate (RDirProd R (RDirProd_list Rs))) = image_group (\<lambda>(a, as). a # as) (R \<times>\<times> monoid.truncate (RDirProd_list Rs))

goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
have " ... = DirProd_list (R # Rs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_group (\<lambda>(a, as). a # as) (R \<times>\<times> monoid.truncate (RDirProd_list Rs)) = DirProd_list (R # Rs)
[PROOF STEP]
unfolding Cons DirProd_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_group (\<lambda>(a, as). a # as) (R \<times>\<times> foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) Rs nil_monoid) = foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) (R # Rs) nil_monoid
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
image_group (\<lambda>(a, as). a # as) (R \<times>\<times> monoid.truncate (RDirProd_list Rs)) = DirProd_list (R # Rs)

goal (1 subgoal):
 1. \<And>a Rs. monoid.truncate (RDirProd_list Rs) = DirProd_list Rs \<Longrightarrow> monoid.truncate (RDirProd_list (a # Rs)) = DirProd_list (a # Rs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
monoid.truncate (RDirProd_list (R # Rs)) = DirProd_list (R # Rs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
monoid.truncate (RDirProd_list (R # Rs)) = DirProd_list (R # Rs)

goal (1 subgoal):
 1. monoid.truncate (RDirProd_list (R # Rs)) = DirProd_list (R # Rs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
monoid.truncate (RDirProd_list (R # Rs)) = DirProd_list (R # Rs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_emb_eq_length_P:
  assumes "length xs = length ys"
    and "list_emb P xs ys"
  shows "\<forall>i<length xs. P (xs ! i) (ys ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length xs. P (xs ! i) (ys ! i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
list_emb P xs ys

goal (1 subgoal):
 1. \<forall>i<length xs. P (xs ! i) (ys ! i)
[PROOF STEP]
proof (induct rule: list_emb_eq_length_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>i<length []. P ([] ! i) ([] ! i)
 2. \<And>x y xs ys. \<lbrakk>P x y; list_emb P xs ys; \<forall>i<length xs. P (xs ! i) (ys ! i)\<rbrakk> \<Longrightarrow> \<forall>i<length (x # xs). P ((x # xs) ! i) ((y # ys) ! i)
[PROOF STEP]
case (Cons x y xs ys)
[PROOF STATE]
proof (state)
this:
P x y
list_emb P xs ys
\<forall>i<length xs. P (xs ! i) (ys ! i)

goal (2 subgoals):
 1. \<forall>i<length []. P ([] ! i) ([] ! i)
 2. \<And>x y xs ys. \<lbrakk>P x y; list_emb P xs ys; \<forall>i<length xs. P (xs ! i) (ys ! i)\<rbrakk> \<Longrightarrow> \<forall>i<length (x # xs). P ((x # xs) ! i) ((y # ys) ! i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (x # xs). P ((x # xs) ! i) ((y # ys) ! i)
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (x # xs) \<Longrightarrow> P ((x # xs) ! i) ((y # ys) ! i)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (x # xs) \<Longrightarrow> P ((x # xs) ! i) ((y # ys) ! i)
[PROOF STEP]
assume "i < length (x # xs)"
[PROOF STATE]
proof (state)
this:
i < length (x # xs)

goal (1 subgoal):
 1. \<And>i. i < length (x # xs) \<Longrightarrow> P ((x # xs) ! i) ((y # ys) ! i)
[PROOF STEP]
with Cons
[PROOF STATE]
proof (chain)
picking this:
P x y
list_emb P xs ys
\<forall>i<length xs. P (xs ! i) (ys ! i)
i < length (x # xs)
[PROOF STEP]
show "P ((x#xs)!i) ((y#ys)!i)"
[PROOF STATE]
proof (prove)
using this:
P x y
list_emb P xs ys
\<forall>i<length xs. P (xs ! i) (ys ! i)
i < length (x # xs)

goal (1 subgoal):
 1. P ((x # xs) ! i) ((y # ys) ! i)
[PROOF STEP]
by (cases i) simp_all
[PROOF STATE]
proof (state)
this:
P ((x # xs) ! i) ((y # ys) ! i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<length (x # xs). P ((x # xs) ! i) ((y # ys) ! i)

goal (1 subgoal):
 1. \<forall>i<length []. P ([] ! i) ([] ! i)
[PROOF STEP]
qed simp


[STATEMENT]
lemma float_le_trans: "is_finite a \<Longrightarrow> is_finite b \<Longrightarrow> is_finite c \<Longrightarrow> a \<le> b \<Longrightarrow> b \<le> c \<Longrightarrow> a \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_finite a; is_finite b; is_finite c; a \<le> b; b \<le> c\<rbrakk> \<Longrightarrow> a \<le> c
[PROOF STEP]
by (auto simp: le_trans)


[STATEMENT]
lemma sublist_Cons_right: "sublist xs (y # ys) \<longleftrightarrow> prefix xs (y # ys) \<or> sublist xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sublist xs (y # ys) = (prefix xs (y # ys) \<or> sublist xs ys)
[PROOF STEP]
by (auto simp: sublist_def prefix_def Cons_eq_append_conv)


[STATEMENT]
lemma fls_prpart_of_int [simp]: "fls_prpart (of_int n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_prpart (of_int n) = 0
[PROOF STEP]
by (simp add: fls_prpart_eq0_iff)


[STATEMENT]
lemma coeffs_minus: "poly_of_list (coeffs_minus f1 f0) = poly_of_list f1 - poly_of_list f0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_list (coeffs_minus f1 f0) = poly_of_list f1 - poly_of_list f0
[PROOF STEP]
proof (rule poly_eqI, unfold poly_of_list_def coeff_diff coeff_Poly)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. nth_default (0::'a) (coeffs_minus f1 f0) n = nth_default (0::'a) f1 n - nth_default (0::'a) f0 n
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. nth_default (0::'a) (coeffs_minus f1 f0) n = nth_default (0::'a) f1 n - nth_default (0::'a) f0 n
[PROOF STEP]
show "nth_default 0 (coeffs_minus f1 f0) i = nth_default 0 f1 i - nth_default 0 f0 i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_default (0::'a) (coeffs_minus f1 f0) i = nth_default (0::'a) f1 i - nth_default (0::'a) f0 i
[PROOF STEP]
proof (induct f1 f0 arbitrary: i rule: coeffs_minus.induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x xs y ys i. (\<And>i. nth_default (0::'a) (coeffs_minus xs ys) i = nth_default (0::'a) xs i - nth_default (0::'a) ys i) \<Longrightarrow> nth_default (0::'a) (coeffs_minus (x # xs) (y # ys)) i = nth_default (0::'a) (x # xs) i - nth_default (0::'a) (y # ys) i
 2. \<And>xs i. nth_default (0::'a) (coeffs_minus xs []) i = nth_default (0::'a) xs i - nth_default (0::'a) [] i
 3. \<And>v va i. nth_default (0::'a) (coeffs_minus [] (v # va)) i = nth_default (0::'a) [] i - nth_default (0::'a) (v # va) i
[PROOF STEP]
case (1 x xs y ys)
[PROOF STATE]
proof (state)
this:
nth_default (0::'a) (coeffs_minus xs ys) ?i = nth_default (0::'a) xs ?i - nth_default (0::'a) ys ?i

goal (3 subgoals):
 1. \<And>x xs y ys i. (\<And>i. nth_default (0::'a) (coeffs_minus xs ys) i = nth_default (0::'a) xs i - nth_default (0::'a) ys i) \<Longrightarrow> nth_default (0::'a) (coeffs_minus (x # xs) (y # ys)) i = nth_default (0::'a) (x # xs) i - nth_default (0::'a) (y # ys) i
 2. \<And>xs i. nth_default (0::'a) (coeffs_minus xs []) i = nth_default (0::'a) xs i - nth_default (0::'a) [] i
 3. \<And>v va i. nth_default (0::'a) (coeffs_minus [] (v # va)) i = nth_default (0::'a) [] i - nth_default (0::'a) (v # va) i
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
nth_default (0::'a) (coeffs_minus xs ys) ?i = nth_default (0::'a) xs ?i - nth_default (0::'a) ys ?i

goal (1 subgoal):
 1. nth_default (0::'a) (coeffs_minus (x # xs) (y # ys)) i = nth_default (0::'a) (x # xs) i - nth_default (0::'a) (y # ys) i
[PROOF STEP]
by (cases i, auto)
[PROOF STATE]
proof (state)
this:
nth_default (0::'a) (coeffs_minus (x # xs) (y # ys)) i = nth_default (0::'a) (x # xs) i - nth_default (0::'a) (y # ys) i

goal (2 subgoals):
 1. \<And>xs i. nth_default (0::'a) (coeffs_minus xs []) i = nth_default (0::'a) xs i - nth_default (0::'a) [] i
 2. \<And>v va i. nth_default (0::'a) (coeffs_minus [] (v # va)) i = nth_default (0::'a) [] i - nth_default (0::'a) (v # va) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs i. nth_default (0::'a) (coeffs_minus xs []) i = nth_default (0::'a) xs i - nth_default (0::'a) [] i
 2. \<And>v va i. nth_default (0::'a) (coeffs_minus [] (v # va)) i = nth_default (0::'a) [] i - nth_default (0::'a) (v # va) i
[PROOF STEP]
case (3 x xs)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>xs i. nth_default (0::'a) (coeffs_minus xs []) i = nth_default (0::'a) xs i - nth_default (0::'a) [] i
 2. \<And>v va i. nth_default (0::'a) (coeffs_minus [] (v # va)) i = nth_default (0::'a) [] i - nth_default (0::'a) (v # va) i
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_default (0::'a) (coeffs_minus [] (x # xs)) i = nth_default (0::'a) [] i - nth_default (0::'a) (x # xs) i
[PROOF STEP]
unfolding coeffs_minus.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_default (0::'a) (map uminus (x # xs)) i = nth_default (0::'a) [] i - nth_default (0::'a) (x # xs) i
[PROOF STEP]
by (subst nth_default_map_eq[of uminus 0 0], auto)
[PROOF STATE]
proof (state)
this:
nth_default (0::'a) (coeffs_minus [] (x # xs)) i = nth_default (0::'a) [] i - nth_default (0::'a) (x # xs) i

goal (1 subgoal):
 1. \<And>xs i. nth_default (0::'a) (coeffs_minus xs []) i = nth_default (0::'a) xs i - nth_default (0::'a) [] i
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
nth_default (0::'a) (coeffs_minus f1 f0) i = nth_default (0::'a) f1 i - nth_default (0::'a) f0 i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma derangements_drop_minimal_cycle:
  assumes "d \<in> derangements S" "d (d x) = x"
  shows "Fun.swap x (d x) d \<in> derangements (S - {x, d x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<circ> Transposition.transpose x (d x) \<in> derangements (S - {x, d x})
[PROOF STEP]
proof (rule derangementsI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d \<circ> Transposition.transpose x (d x) permutes S - {x, d x}
 2. \<And>xa. xa \<in> S - {x, d x} \<Longrightarrow> (d \<circ> Transposition.transpose x (d x)) xa \<noteq> xa
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
d \<in> derangements S
d (d x) = x
[PROOF STEP]
show "Fun.swap x (d x) d permutes (S - {x, d x})"
[PROOF STATE]
proof (prove)
using this:
d \<in> derangements S
d (d x) = x

goal (1 subgoal):
 1. d \<circ> Transposition.transpose x (d x) permutes S - {x, d x}
[PROOF STEP]
by (meson derangementsE permutes_drop_cycle_size_two)
[PROOF STATE]
proof (state)
this:
d \<circ> Transposition.transpose x (d x) permutes S - {x, d x}

goal (1 subgoal):
 1. \<And>xa. xa \<in> S - {x, d x} \<Longrightarrow> (d \<circ> Transposition.transpose x (d x)) xa \<noteq> xa
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> S - {x, d x} \<Longrightarrow> (d \<circ> Transposition.transpose x (d x)) xa \<noteq> xa
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> S - {x, d x} \<Longrightarrow> (d \<circ> Transposition.transpose x (d x)) xa \<noteq> xa
[PROOF STEP]
assume "y \<in> S - {x, d x}"
[PROOF STATE]
proof (state)
this:
y \<in> S - {x, d x}

goal (1 subgoal):
 1. \<And>xa. xa \<in> S - {x, d x} \<Longrightarrow> (d \<circ> Transposition.transpose x (d x)) xa \<noteq> xa
[PROOF STEP]
from assms this
[PROOF STATE]
proof (chain)
picking this:
d \<in> derangements S
d (d x) = x
y \<in> S - {x, d x}
[PROOF STEP]
show "Fun.swap x (d x) d y \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
d \<in> derangements S
d (d x) = x
y \<in> S - {x, d x}

goal (1 subgoal):
 1. (d \<circ> Transposition.transpose x (d x)) y \<noteq> y
[PROOF STEP]
by (auto elim: derangementsE)
[PROOF STATE]
proof (state)
this:
(d \<circ> Transposition.transpose x (d x)) y \<noteq> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm1_ge_norm: "norm1 v \<ge> norm v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm v \<le> norm1 v
[PROOF STEP]
unfolding norm1_def norm_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L2_set (\<lambda>i. norm (v $h i)) UNIV \<le> (\<Sum>i\<in>UNIV. norm (v $h i))
[PROOF STEP]
by (rule L2_set_le_sum, auto)


[STATEMENT]
lemma Compl_set_less_aux_Compl:
  "finite (UNIV :: 'a set) \<Longrightarrow> - A \<sqsubset>' - B \<longleftrightarrow> B \<sqsubset>' A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> (- A \<sqsubset>' - B) = (B \<sqsubset>' A)
[PROOF STEP]
by(auto simp add: set_less_aux_def finite_subset[OF subset_UNIV])


[STATEMENT]
lemma sinpoly_ub_imp_cospoly_lb:
  assumes x0: "0 \<le> x" and k0: "k>0" and "\<And>x. 0 \<le> x \<Longrightarrow> sin x \<le> sinpoly (k - 1) x"
    shows "cospoly k x \<le> cos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cospoly k x \<le> cos x
[PROOF STEP]
apply (rule gen_lower_bound_increasing [OF x0])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ((\<lambda>x. cospoly k x - cos x) has_real_derivative ?g y) (at y)
 2. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?g y \<le> 0
 3. cospoly k 0 = cos 0
[PROOF STEP]
apply (intro derivative_eq_intros | simp)+
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> (cospoly k has_real_derivative ?f'5 y) (at y)
 2. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> 1 = ?Db7 y
 3. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> - sin y * ?Db7 y = ?g'5 y
 4. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?f'5 y - ?g'5 y = ?g y
 5. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?g y \<le> 0
 6. cospoly k 0 = cos 0
[PROOF STEP]
using d_cospoly_sinpoly [of "k - 1"] assms
[PROOF STATE]
proof (prove)
using this:
(cospoly (Suc (k - 1)) has_real_derivative - sinpoly (k - 1) ?x) (at ?x)
0 \<le> x
0 < k
0 \<le> ?x \<Longrightarrow> sin ?x \<le> sinpoly (k - 1) ?x

goal (6 subgoals):
 1. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> (cospoly k has_real_derivative ?f'5 y) (at y)
 2. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> 1 = ?Db7 y
 3. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> - sin y * ?Db7 y = ?g'5 y
 4. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?f'5 y - ?g'5 y = ?g y
 5. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?g y \<le> 0
 6. cospoly k 0 = cos 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. (cospoly k has_real_derivative - sinpoly (k - Suc 0) x) (at x); 0 \<le> x; 0 < k; \<And>x. 0 \<le> x \<Longrightarrow> sin x \<le> sinpoly (k - Suc 0) x\<rbrakk> \<Longrightarrow> cospoly k 0 = 1
[PROOF STEP]
apply (simp add: cospoly_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma point_mult_mult:
  "on_curve a b p \<Longrightarrow> nonsingular a b \<Longrightarrow>
   point_mult a (m * n) p = point_mult a n (point_mult a m p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>on_curve a b p; nonsingular a b\<rbrakk> \<Longrightarrow> point_mult a (m * n) p = point_mult a n (point_mult a m p)
[PROOF STEP]
by (induct n) (simp_all add: point_mult_add)


[STATEMENT]
lemma prod_star_closure: "x \<le> z\<^sup>\<star> \<Longrightarrow> y \<le> z\<^sup>\<star> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> z\<^sup>\<star>; y \<le> z\<^sup>\<star>\<rbrakk> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<le> z\<^sup>\<star>; y \<le> z\<^sup>\<star>\<rbrakk> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
assume assm: "x \<le> z\<^sup>\<star>" "y \<le> z\<^sup>\<star>"
[PROOF STATE]
proof (state)
this:
x \<le> z\<^sup>\<star>
y \<le> z\<^sup>\<star>

goal (1 subgoal):
 1. \<lbrakk>x \<le> z\<^sup>\<star>; y \<le> z\<^sup>\<star>\<rbrakk> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
hence "y + z\<^sup>\<star> \<cdot> z\<^sup>\<star> \<le> z\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
x \<le> z\<^sup>\<star>
y \<le> z\<^sup>\<star>

goal (1 subgoal):
 1. y + z\<^sup>\<star> \<cdot> z\<^sup>\<star> \<le> z\<^sup>\<star>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y + z\<^sup>\<star> \<cdot> z\<^sup>\<star> \<le> z\<^sup>\<star>

goal (1 subgoal):
 1. \<lbrakk>x \<le> z\<^sup>\<star>; y \<le> z\<^sup>\<star>\<rbrakk> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
hence "z\<^sup>\<star> \<cdot> y \<le> z\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
y + z\<^sup>\<star> \<cdot> z\<^sup>\<star> \<le> z\<^sup>\<star>

goal (1 subgoal):
 1. z\<^sup>\<star> \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
by (simp add: star_inductl)
[PROOF STATE]
proof (state)
this:
z\<^sup>\<star> \<cdot> y \<le> z\<^sup>\<star>

goal (1 subgoal):
 1. \<lbrakk>x \<le> z\<^sup>\<star>; y \<le> z\<^sup>\<star>\<rbrakk> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z\<^sup>\<star> \<cdot> y \<le> z\<^sup>\<star>

goal (1 subgoal):
 1. \<lbrakk>x \<le> z\<^sup>\<star>; y \<le> z\<^sup>\<star>\<rbrakk> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
have "x \<cdot> y \<le> z\<^sup>\<star> \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> y \<le> z\<^sup>\<star> \<cdot> y
[PROOF STEP]
by (simp add: assm mult_isor)
[PROOF STATE]
proof (state)
this:
x \<cdot> y \<le> z\<^sup>\<star> \<cdot> y

goal (1 subgoal):
 1. \<lbrakk>x \<le> z\<^sup>\<star>; y \<le> z\<^sup>\<star>\<rbrakk> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
thus "x \<cdot> y \<le> z\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
x \<cdot> y \<le> z\<^sup>\<star> \<cdot> y

goal (1 subgoal):
 1. x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
using calculation order.trans
[PROOF STATE]
proof (prove)
using this:
x \<cdot> y \<le> z\<^sup>\<star> \<cdot> y
z\<^sup>\<star> \<cdot> y \<le> z\<^sup>\<star>
\<lbrakk>?a \<le> ?b; ?b \<le> ?c\<rbrakk> \<Longrightarrow> ?a \<le> ?c

goal (1 subgoal):
 1. x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<cdot> y \<le> z\<^sup>\<star>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Pow_set_conv_fold:
  "Pow (set xs \<union> A) = fold (\<lambda>x A. A \<union> insert x ` A) xs (Pow A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pow (set xs \<union> A) = fold (\<lambda>x A. A \<union> insert x ` A) xs (Pow A)
[PROOF STEP]
by(induct xs rule: rev_induct)(auto simp add: Pow_insert)


[STATEMENT]
lemma card_verts_iso[simp]: "card (iso_verts hom ` verts G) = card (verts G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (iso_verts hom ` verts G) = card (verts G)
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. card (iso_verts hom ` verts G) = card (verts G)
[PROOF STEP]
by (intro card_image digraph_isomorphism_inj_on_verts)


[STATEMENT]
lemma (in abelian_group) right_inv_add:
  assumes "a \<in> carrier G" and "b \<in> carrier G" and "c \<in> carrier G"
  shows "c \<ominus> a \<ominus> b = c \<ominus> (a \<oplus> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<ominus> a \<ominus> b = c \<ominus> (a \<oplus> b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier G
b \<in> carrier G
c \<in> carrier G

goal (1 subgoal):
 1. c \<ominus> a \<ominus> b = c \<ominus> (a \<oplus> b)
[PROOF STEP]
by (simp add: a_minus_def add.m_assoc local.minus_add)


[STATEMENT]
lemma times_divide_eq_right [simp]:
  "a \<in> carrier R \<Longrightarrow> b \<in> carrier R \<Longrightarrow> c \<in> carrier R \<Longrightarrow> c \<noteq> \<zero> \<Longrightarrow>
    a \<otimes> (b \<oslash> c) = a \<otimes> b \<oslash> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>\<rbrakk> \<Longrightarrow> a \<otimes> (b \<oslash> c) = a \<otimes> b \<oslash> c
[PROOF STEP]
by (simp add: m_div_def m_ac)


[STATEMENT]
lemma interval_integrable_continuous_on:
  fixes a b :: real and f
  assumes "a \<le> b" and "continuous_on {a..b} f"
  shows "interval_lebesgue_integrable lborel a b f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integrable lborel (ereal a) (ereal b) f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
continuous_on {a..b} f

goal (1 subgoal):
 1. interval_lebesgue_integrable lborel (ereal a) (ereal b) f
[PROOF STEP]
unfolding interval_lebesgue_integrable_def
[PROOF STATE]
proof (prove)
using this:
a \<le> b
continuous_on {a..b} f

goal (1 subgoal):
 1. if ereal a \<le> ereal b then set_integrable lborel (einterval (ereal a) (ereal b)) f else set_integrable lborel (einterval (ereal b) (ereal a)) f
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; continuous_on {a..b} f\<rbrakk> \<Longrightarrow> set_integrable lborel {a<..<b} f
[PROOF STEP]
by (rule set_integrable_subset, rule borel_integrable_atLeastAtMost' [of a b], auto)


[STATEMENT]
lemma (in ring) eval_append:
  assumes "set p \<subseteq> carrier R" "set q \<subseteq> carrier R" and "a \<in> carrier R"
  shows "eval (p @ q) a = ((eval p a) \<otimes> (a [^] (length q))) \<oplus> (eval q a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
set q \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
proof (induct "length q" arbitrary: q)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q. \<lbrakk>0 = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
 2. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 = length q
set q \<subseteq> carrier R

goal (2 subgoals):
 1. \<And>q. \<lbrakk>0 = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
 2. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 = length q
set q \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
using eval_in_carrier[OF assms(1,3)]
[PROOF STATE]
proof (prove)
using this:
0 = length q
set q \<subseteq> carrier R
local.eval p a \<in> carrier R

goal (1 subgoal):
 1. local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = length ?q; set ?q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ ?q) a = local.eval p a \<otimes> a [^] length ?q \<oplus> local.eval ?q a
Suc n = length q
set q \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = length ?q; set ?q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ ?q) a = local.eval p a \<otimes> a [^] length ?q \<oplus> local.eval ?q a
Suc n = length q
set q \<subseteq> carrier R
[PROOF STEP]
obtain b q' where q: "q = q' @ [ b ]"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = length ?q; set ?q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ ?q) a = local.eval p a \<otimes> a [^] length ?q \<oplus> local.eval ?q a
Suc n = length q
set q \<subseteq> carrier R

goal (1 subgoal):
 1. (\<And>q' b. q = q' @ [b] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis length_Suc_conv list.simps(3) rev_exhaust)
[PROOF STATE]
proof (state)
this:
q = q' @ [b]

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
hence in_carrier: "eval p a \<in> carrier R" "eval q' a \<in> carrier R"
                    "a [^] (length q') \<in> carrier R" "b \<in> carrier R"
[PROOF STATE]
proof (prove)
using this:
q = q' @ [b]

goal (1 subgoal):
 1. (local.eval p a \<in> carrier R &&& local.eval q' a \<in> carrier R) &&& a [^] length q' \<in> carrier R &&& b \<in> carrier R
[PROOF STEP]
using assms(1,3) Suc(3) eval_in_carrier[OF _ assms(3)]
[PROOF STATE]
proof (prove)
using this:
q = q' @ [b]
set p \<subseteq> carrier R
a \<in> carrier R
set q \<subseteq> carrier R
set ?p \<subseteq> carrier R \<Longrightarrow> local.eval ?p a \<in> carrier R

goal (1 subgoal):
 1. (local.eval p a \<in> carrier R &&& local.eval q' a \<in> carrier R) &&& a [^] length q' \<in> carrier R &&& b \<in> carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval p a \<in> carrier R
local.eval q' a \<in> carrier R
a [^] length q' \<in> carrier R
b \<in> carrier R

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
have "eval (p @ q) a = ((eval (p @ q') a) \<otimes> a) \<oplus> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (p @ q) a = local.eval (p @ q') a \<otimes> a \<oplus> b
[PROOF STEP]
using eval_append_aux[OF _ _ assms(3), of "p @ q'" b] assms(1) Suc(3)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set (p @ q') \<subseteq> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> local.eval ((p @ q') @ [b]) a = local.eval (p @ q') a \<otimes> a \<oplus> b
set p \<subseteq> carrier R
set q \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (p @ q) a = local.eval (p @ q') a \<otimes> a \<oplus> b
[PROOF STEP]
unfolding q
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set (p @ q') \<subseteq> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> local.eval ((p @ q') @ [b]) a = local.eval (p @ q') a \<otimes> a \<oplus> b
set p \<subseteq> carrier R
set (q' @ [b]) \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (p @ q' @ [b]) a = local.eval (p @ q') a \<otimes> a \<oplus> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval (p @ q) a = local.eval (p @ q') a \<otimes> a \<oplus> b

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.eval (p @ q) a = local.eval (p @ q') a \<otimes> a \<oplus> b

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
have " ... = ((((eval p a) \<otimes> (a [^] (length q'))) \<oplus> (eval q' a)) \<otimes> a) \<oplus> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (p @ q') a \<otimes> a \<oplus> b = (local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = length ?q; set ?q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ ?q) a = local.eval p a \<otimes> a [^] length ?q \<oplus> local.eval ?q a
Suc n = length q
set q \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (p @ q') a \<otimes> a \<oplus> b = (local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b
[PROOF STEP]
unfolding q
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = length ?q; set ?q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ ?q) a = local.eval p a \<otimes> a [^] length ?q \<oplus> local.eval ?q a
Suc n = length (q' @ [b])
set (q' @ [b]) \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval (p @ q') a \<otimes> a \<oplus> b = (local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval (p @ q') a \<otimes> a \<oplus> b = (local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.eval (p @ q') a \<otimes> a \<oplus> b = (local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
have " ... = (((eval p a) \<otimes> ((a [^] (length q')) \<otimes> a))) \<oplus> (((eval q' a) \<otimes> a) \<oplus> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b = local.eval p a \<otimes> (a [^] length q' \<otimes> a) \<oplus> (local.eval q' a \<otimes> a \<oplus> b)
[PROOF STEP]
using assms(3) in_carrier
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
local.eval p a \<in> carrier R
local.eval q' a \<in> carrier R
a [^] length q' \<in> carrier R
b \<in> carrier R

goal (1 subgoal):
 1. (local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b = local.eval p a \<otimes> (a [^] length q' \<otimes> a) \<oplus> (local.eval q' a \<otimes> a \<oplus> b)
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
(local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b = local.eval p a \<otimes> (a [^] length q' \<otimes> a) \<oplus> (local.eval q' a \<otimes> a \<oplus> b)

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(local.eval p a \<otimes> a [^] length q' \<oplus> local.eval q' a) \<otimes> a \<oplus> b = local.eval p a \<otimes> (a [^] length q' \<otimes> a) \<oplus> (local.eval q' a \<otimes> a \<oplus> b)

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
have " ... = (eval p a) \<otimes> (a [^] (length q)) \<oplus> (eval q a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval p a \<otimes> (a [^] length q' \<otimes> a) \<oplus> (local.eval q' a \<otimes> a \<oplus> b) = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
using eval_append_aux[OF _ in_carrier(4) assms(3), of q'] Suc(3)
[PROOF STATE]
proof (prove)
using this:
set q' \<subseteq> carrier R \<Longrightarrow> local.eval (q' @ [b]) a = local.eval q' a \<otimes> a \<oplus> b
set q \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval p a \<otimes> (a [^] length q' \<otimes> a) \<oplus> (local.eval q' a \<otimes> a \<oplus> b) = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
unfolding q
[PROOF STATE]
proof (prove)
using this:
set q' \<subseteq> carrier R \<Longrightarrow> local.eval (q' @ [b]) a = local.eval q' a \<otimes> a \<oplus> b
set (q' @ [b]) \<subseteq> carrier R

goal (1 subgoal):
 1. local.eval p a \<otimes> (a [^] length q' \<otimes> a) \<oplus> (local.eval q' a \<otimes> a \<oplus> b) = local.eval p a \<otimes> a [^] length (q' @ [b]) \<oplus> local.eval (q' @ [b]) a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval p a \<otimes> (a [^] length q' \<otimes> a) \<oplus> (local.eval q' a \<otimes> a \<oplus> b) = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a

goal (1 subgoal):
 1. \<And>x q. \<lbrakk>\<And>q. \<lbrakk>x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a; Suc x = length q; set q \<subseteq> carrier R\<rbrakk> \<Longrightarrow> local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a

goal (1 subgoal):
 1. local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.eval (p @ q) a = local.eval p a \<otimes> a [^] length q \<oplus> local.eval q a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_hmset_zhmsetE:
  assumes m_lt_n: "M < N"
  obtains A B C where "M = zhmset_of A + C" and "N = zhmset_of B + C" and "A < B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A C B. \<lbrakk>M = zhmset_of A + C; N = zhmset_of B + C; A < B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule less_mset_zmsetE[OF m_lt_n[folded zhmsetmset_less]])
    (metis hmsetmset_less hmultiset.sel ZHMSet_plus zhmsetmset_inverse)


[STATEMENT]
lemma holomorphic_fun_eq_0_on_ball:
   "\<lbrakk>f holomorphic_on ball z r;  w \<in> ball z r;
     \<And>n. (deriv ^^ n) f z = 0\<rbrakk>
     \<Longrightarrow> f w = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f holomorphic_on ball z r; w \<in> ball z r; \<And>n. (deriv ^^ n) f z = 0\<rbrakk> \<Longrightarrow> f w = 0
[PROOF STEP]
by (auto simp: holomorphic_iff_power_series sums_unique2 [of "\<lambda>n. (deriv ^^ n) f z / (fact n) * (w - z)^n"])


[STATEMENT]
lemma rcis_eq_zero_iff [simp]: "rcis r a = 0 \<longleftrightarrow> r = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rcis r a = 0) = (r = 0)
[PROOF STEP]
by (simp add: rcis_def)


[STATEMENT]
lemma bin_rest_OR [simp]: "(\<lambda>k::int. k div 2) (x OR y) = (\<lambda>k::int. k div 2) x OR (\<lambda>k::int. k div 2) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x OR y) div 2 = x div 2 OR y div 2
[PROOF STEP]
by (subst or_int_rec) auto


[STATEMENT]
lemma corthogonalI[intro]:
  "(\<And>i j. i < length vs \<Longrightarrow> j < length vs \<Longrightarrow> vs ! i \<bullet>c vs ! j = 0 \<longleftrightarrow> i \<noteq> j) \<Longrightarrow>
   corthogonal vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i < length vs; j < length vs\<rbrakk> \<Longrightarrow> (vs ! i \<bullet>c vs ! j = (0::'a)) = (i \<noteq> j)) \<Longrightarrow> corthogonal vs
[PROOF STEP]
unfolding corthogonal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>i < length vs; j < length vs\<rbrakk> \<Longrightarrow> (vs ! i \<bullet>c vs ! j = (0::'a)) = (i \<noteq> j)) \<Longrightarrow> \<forall>i<length vs. \<forall>j<length vs. (vs ! i \<bullet>c vs ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
by auto


[STATEMENT]
lemma int_of_integer_0_iff: "int_of_integer n = 0 \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int_of_integer n = 0) = (n = 0)
[PROOF STEP]
using integer_eqI
[PROOF STATE]
proof (prove)
using this:
int_of_integer ?k = int_of_integer ?l \<Longrightarrow> ?k = ?l

goal (1 subgoal):
 1. (int_of_integer n = 0) = (n = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma tendsto_diff_ennreal_general [tendsto_intros]:
  fixes u v::"'a \<Rightarrow> ennreal"
  assumes "(u \<longlongrightarrow> l) F" "(v \<longlongrightarrow> m) F" "\<not>(l = \<infinity> \<and> m = \<infinity>)"
  shows "((\<lambda>n. u n - v n) \<longlongrightarrow> l - m) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. u n - v n) \<longlongrightarrow> l - m) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>n. u n - v n) \<longlongrightarrow> l - m) F
[PROOF STEP]
have "((\<lambda>n. e2ennreal(enn2ereal(u n) - enn2ereal(v n))) \<longlongrightarrow> e2ennreal(enn2ereal l - enn2ereal m)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. e2ennreal (enn2ereal (u n) - enn2ereal (v n))) \<longlongrightarrow> e2ennreal (enn2ereal l - enn2ereal m)) F
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (u \<longlongrightarrow> l) F
 2. (v \<longlongrightarrow> m) F
 3. \<not> (enn2ereal l = \<infinity> \<and> enn2ereal m = \<infinity> \<or> enn2ereal l = - \<infinity> \<and> enn2ereal m = - \<infinity>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(u \<longlongrightarrow> l) F
(v \<longlongrightarrow> m) F
\<not> (l = \<infinity> \<and> m = \<infinity>)

goal (3 subgoals):
 1. (u \<longlongrightarrow> l) F
 2. (v \<longlongrightarrow> m) F
 3. \<not> (enn2ereal l = \<infinity> \<and> enn2ereal m = \<infinity> \<or> enn2ereal l = - \<infinity> \<and> enn2ereal m = - \<infinity>)
[PROOF STEP]
by  auto
[PROOF STATE]
proof (state)
this:
((\<lambda>n. e2ennreal (enn2ereal (u n) - enn2ereal (v n))) \<longlongrightarrow> e2ennreal (enn2ereal l - enn2ereal m)) F

goal (1 subgoal):
 1. ((\<lambda>n. u n - v n) \<longlongrightarrow> l - m) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>n. e2ennreal (enn2ereal (u n) - enn2ereal (v n))) \<longlongrightarrow> e2ennreal (enn2ereal l - enn2ereal m)) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>n. e2ennreal (enn2ereal (u n) - enn2ereal (v n))) \<longlongrightarrow> e2ennreal (enn2ereal l - enn2ereal m)) F

goal (1 subgoal):
 1. ((\<lambda>n. u n - v n) \<longlongrightarrow> l - m) F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>n. u n - v n) \<longlongrightarrow> l - m) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma representation_sum:
  "independent basis \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> v i \<in> span basis) \<Longrightarrow>
    representation basis (sum v I) = (\<lambda>b. \<Sum>i\<in>I. representation basis (v i) b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>independent basis; \<And>i. i \<in> I \<Longrightarrow> v i \<in> span basis\<rbrakk> \<Longrightarrow> representation basis (sum v I) = (\<lambda>b. \<Sum>i\<in>I. representation basis (v i) b)
[PROOF STEP]
by (induction I rule: infinite_finite_induct)
     (auto simp: representation_zero representation_add span_sum)


[STATEMENT]
lemma refl_O_iff: "refl A \<longleftrightarrow> Id \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl A = (Id \<subseteq> A)
[PROOF STEP]
unfolding refl_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<subseteq> UNIV \<times> UNIV \<and> (\<forall>x\<in>UNIV. (x, x) \<in> A)) = (Id \<subseteq> A)
[PROOF STEP]
by auto


[STATEMENT]
lemma transymcl_into:
  "(x, y) \<in> r \<Longrightarrow> (x, y) \<in> transymcl r"
  "(x, y) \<in> r \<Longrightarrow> (y, x) \<in> transymcl r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> r \<Longrightarrow> (x, y) \<in> transymcl r) &&& ((x, y) \<in> r \<Longrightarrow> (y, x) \<in> transymcl r)
[PROOF STEP]
unfolding transymcl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> r \<Longrightarrow> (x, y) \<in> (symcl r)\<^sup>+) &&& ((x, y) \<in> r \<Longrightarrow> (y, x) \<in> (symcl r)\<^sup>+)
[PROOF STEP]
by (blast intro: in_symclI r_into_trancl')+


[STATEMENT]
lemma matrix_eq:
  fixes A B :: "'a::semiring_1 ^ 'n ^ 'm"
  shows "A = B \<longleftrightarrow> (\<forall>x. A *v x = B *v x)" (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A = B) = (\<forall>x. A *v x = B *v x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = B \<Longrightarrow> \<forall>x. A *v x = B *v x
 2. \<forall>x. A *v x = B *v x \<Longrightarrow> A = B
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>x. A *v x = B *v x

goal (2 subgoals):
 1. A = B \<Longrightarrow> \<forall>x. A *v x = B *v x
 2. \<forall>x. A *v x = B *v x \<Longrightarrow> A = B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. A *v x = B *v x
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<forall>x. A *v x = B *v x

goal (1 subgoal):
 1. A = B
[PROOF STEP]
apply (subst vec_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. A *v x = B *v x \<Longrightarrow> \<forall>i. A $ i = B $ i
[PROOF STEP]
apply (clarsimp simp add: matrix_vector_mult_def if_distrib if_distribR vec_eq_iff cong: if_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia. \<forall>x i. (\<Sum>j\<in>UNIV. A $ i $ j * x $ j) = (\<Sum>j\<in>UNIV. B $ i $ j * x $ j) \<Longrightarrow> A $ i $ ia = B $ i $ ia
[PROOF STEP]
apply (erule_tac x="axis ia 1" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia. \<forall>i. (\<Sum>j\<in>UNIV. A $ i $ j * axis ia (1::'a) $ j) = (\<Sum>j\<in>UNIV. B $ i $ j * axis ia (1::'a) $ j) \<Longrightarrow> A $ i $ ia = B $ i $ ia
[PROOF STEP]
apply (erule_tac x="i" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia. (\<Sum>j\<in>UNIV. A $ i $ j * axis ia (1::'a) $ j) = (\<Sum>j\<in>UNIV. B $ i $ j * axis ia (1::'a) $ j) \<Longrightarrow> A $ i $ ia = B $ i $ ia
[PROOF STEP]
apply (auto simp add: if_distrib if_distribR axis_def
        sum.delta[OF finite] cong del: if_weak_cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
A = B

goal (1 subgoal):
 1. A = B \<Longrightarrow> \<forall>x. A *v x = B *v x
[PROOF STEP]
qed auto


[STATEMENT]
lemma unordered_pair_element_equality:
  assumes "{p, q} = {r, s}" and "p = r"
  shows "q = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q = s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
{p, q} = {r, s}
p = r

goal (1 subgoal):
 1. q = s
[PROOF STEP]
by (auto simp: doubleton_eq_iff)


[STATEMENT]
lemma prod_one_func:"\<forall>k\<in>I. Ring (A k) \<Longrightarrow>
                           prod_one I A \<in> carr_prodag I A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k\<in>I. Ring (A k) \<Longrightarrow> prod_one I A \<in> carr_prodag I A
[PROOF STEP]
apply (simp add:prod_one_def carr_prodag_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k\<in>I. Ring (A k) \<Longrightarrow> (\<lambda>x\<in>I. 1\<^sub>r\<^bsub>A x\<^esub>) \<in> I \<rightarrow> Un_carrier I A \<and> (\<forall>i\<in>I. 1\<^sub>r\<^bsub>A i\<^esub> \<in> carrier (A i))
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>k\<in>I. Ring (A k) \<Longrightarrow> (\<lambda>x\<in>I. 1\<^sub>r\<^bsub>A x\<^esub>) \<in> I \<rightarrow> Un_carrier I A
 2. \<forall>k\<in>I. Ring (A k) \<Longrightarrow> \<forall>i\<in>I. 1\<^sub>r\<^bsub>A i\<^esub> \<in> carrier (A i)
[PROOF STEP]
apply (rule Pi_I)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>k\<in>I. Ring (A k); x \<in> I\<rbrakk> \<Longrightarrow> (\<lambda>x\<in>I. 1\<^sub>r\<^bsub>A x\<^esub>) x \<in> Un_carrier I A
 2. \<forall>k\<in>I. Ring (A k) \<Longrightarrow> \<forall>i\<in>I. 1\<^sub>r\<^bsub>A i\<^esub> \<in> carrier (A i)
[PROOF STEP]
apply (simp add:Un_carrier_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>k\<in>I. Ring (A k); x \<in> I\<rbrakk> \<Longrightarrow> \<exists>xa. (\<exists>i\<in>I. xa = carrier (A i)) \<and> 1\<^sub>r\<^bsub>A x\<^esub> \<in> xa
 2. \<forall>k\<in>I. Ring (A k) \<Longrightarrow> \<forall>i\<in>I. 1\<^sub>r\<^bsub>A i\<^esub> \<in> carrier (A i)
[PROOF STEP]
apply (blast dest: Ring.ring_one)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k\<in>I. Ring (A k) \<Longrightarrow> \<forall>i\<in>I. 1\<^sub>r\<^bsub>A i\<^esub> \<in> carrier (A i)
[PROOF STEP]
apply (simp add: Ring.ring_one)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma compos_invfun_r:"\<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; g \<in> A \<rightarrow> C; h \<in> B \<rightarrow> C;
       g \<in> extensional A; compose B g (invfun A B f) = h\<rbrakk> \<Longrightarrow>
       g = compose A h f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; g \<in> A \<rightarrow> C; h \<in> B \<rightarrow> C; g \<in> extensional A; compose B g (f\<inverse>\<^bsub>B,A\<^esub>) = h\<rbrakk> \<Longrightarrow> g = compose A h f
[PROOF STEP]
apply (rule funcset_eq[of g A "compose A h f"], assumption)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; g \<in> A \<rightarrow> C; h \<in> B \<rightarrow> C; g \<in> extensional A; compose B g (f\<inverse>\<^bsub>B,A\<^esub>) = h\<rbrakk> \<Longrightarrow> compose A h f \<in> extensional A
 2. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; g \<in> A \<rightarrow> C; h \<in> B \<rightarrow> C; g \<in> extensional A; compose B g (f\<inverse>\<^bsub>B,A\<^esub>) = h\<rbrakk> \<Longrightarrow> \<forall>x\<in>A. g x = compose A h f x
[PROOF STEP]
apply (simp add:compose_def extensional_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; g \<in> A \<rightarrow> C; h \<in> B \<rightarrow> C; g \<in> extensional A; compose B g (f\<inverse>\<^bsub>B,A\<^esub>) = h\<rbrakk> \<Longrightarrow> \<forall>x\<in>A. g x = compose A h f x
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; g \<in> A \<rightarrow> C; h \<in> B \<rightarrow> C; g \<in> extensional A; compose B g (f\<inverse>\<^bsub>B,A\<^esub>) = h; x \<in> A\<rbrakk> \<Longrightarrow> g x = compose A h f x
[PROOF STEP]
apply (frule sym, thin_tac "compose B g (invfun A B f) = h", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; g \<in> A \<rightarrow> C; compose B g (f\<inverse>\<^bsub>B,A\<^esub>) \<in> B \<rightarrow> C; g \<in> extensional A; x \<in> A; h = compose B g (f\<inverse>\<^bsub>B,A\<^esub>)\<rbrakk> \<Longrightarrow> g x = compose A (compose B g (f\<inverse>\<^bsub>B,A\<^esub>)) f x
[PROOF STEP]
apply (simp add:compose_def Pi_def invfun_l1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vec_of_basis_enum_times:
  fixes \<psi> \<phi> :: "'a::one_dim"
  shows "vec_of_basis_enum (\<psi> * \<phi>)
   = vec_of_list [vec_index (vec_of_basis_enum \<psi>) 0 * vec_index (vec_of_basis_enum \<phi>) 0]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (\<psi> * \<phi>) = vec_of_list [vec_of_basis_enum \<psi> $ 0 * vec_of_basis_enum \<phi> $ 0]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_of_basis_enum (\<psi> * \<phi>) = vec_of_list [vec_of_basis_enum \<psi> $ 0 * vec_of_basis_enum \<phi> $ 0]
[PROOF STEP]
have [simp]: \<open>crepresentation {1} x 1 = one_dim_iso x\<close> for x :: 'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. crepresentation {1::'a} x (1::'a) = one_dim_iso x
[PROOF STEP]
apply (subst one_dim_scaleC_1[where x=x, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. crepresentation {1::'a} (one_dim_iso x *\<^sub>C (1::'a)) (1::'a) = one_dim_iso x
[PROOF STEP]
apply (subst complex_vector.representation_scale)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. cindependent {1::'a}
 2. (1::'a) \<in> cspan {1::'a}
 3. one_dim_iso x * crepresentation {1::'a} (1::'a) (1::'a) = one_dim_iso x
[PROOF STEP]
by (auto simp add: complex_vector.span_base complex_vector.representation_basis)
[PROOF STATE]
proof (state)
this:
crepresentation {1::'a} ?x (1::'a) = one_dim_iso ?x

goal (1 subgoal):
 1. vec_of_basis_enum (\<psi> * \<phi>) = vec_of_list [vec_of_basis_enum \<psi> $ 0 * vec_of_basis_enum \<phi> $ 0]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (\<psi> * \<phi>) = vec_of_list [vec_of_basis_enum \<psi> $ 0 * vec_of_basis_enum \<phi> $ 0]
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (vec_of_list [vec_of_basis_enum \<psi> $ 0 * vec_of_basis_enum \<phi> $ 0]) \<Longrightarrow> vec_of_basis_enum (\<psi> * \<phi>) $ i = vec_of_list [vec_of_basis_enum \<psi> $ 0 * vec_of_basis_enum \<phi> $ 0] $ i
 2. dim_vec (vec_of_basis_enum (\<psi> * \<phi>)) = dim_vec (vec_of_list [vec_of_basis_enum \<psi> $ 0 * vec_of_basis_enum \<phi> $ 0])
[PROOF STEP]
by (auto simp: vec_of_basis_enum_def)
[PROOF STATE]
proof (state)
this:
vec_of_basis_enum (\<psi> * \<phi>) = vec_of_list [vec_of_basis_enum \<psi> $ 0 * vec_of_basis_enum \<phi> $ 0]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_fv_Proof: "finite (fv_Proof P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (fv_Proof P)
[PROOF STEP]
by (induction P) auto


[STATEMENT]
lemma mat_max_ge_0: "A \<in> carrier_mat nr nc \<Longrightarrow> B \<in> carrier_mat nr nc \<Longrightarrow> A \<ge>\<^sub>m B \<Longrightarrow> max\<^sub>m A B = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; B \<in> carrier_mat nr nc; A \<ge>\<^sub>m B\<rbrakk> \<Longrightarrow> max\<^sub>m A B = A
[PROOF STEP]
unfolding mat_max_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; B \<in> carrier_mat nr nc; A \<ge>\<^sub>m B\<rbrakk> \<Longrightarrow> mat (dim_row A) (dim_col A) (\<lambda>ij. max (A $$ ij) (B $$ ij)) = A
[PROOF STEP]
by (intro eq_matI, auto simp: max_id)


[STATEMENT]
lemma neg_minus_divide_less_eq [field_simps]: "c < 0 \<Longrightarrow> - (b / c) < a \<longleftrightarrow> a * c < - b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> (- (b / c) < a) = (a * c < - b)
[PROOF STEP]
unfolding minus_divide_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> (- b / c < a) = (a * c < - b)
[PROOF STEP]
by (rule neg_divide_less_eq)


[STATEMENT]
lemma append_eq_conv_conj:
  "(xs @ ys = zs) = (xs = take (length xs) zs \<and> ys = drop (length xs) zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs @ ys = zs) = (xs = take (length xs) zs \<and> ys = drop (length xs) zs)
[PROOF STEP]
proof (induct xs arbitrary: zs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>zs. ([] @ ys = zs) = ([] = take (length []) zs \<and> ys = drop (length []) zs)
 2. \<And>a xs zs. (\<And>zs. (xs @ ys = zs) = (xs = take (length xs) zs \<and> ys = drop (length xs) zs)) \<Longrightarrow> ((a # xs) @ ys = zs) = (a # xs = take (length (a # xs)) zs \<and> ys = drop (length (a # xs)) zs)
[PROOF STEP]
case (Cons x xs zs)
[PROOF STATE]
proof (state)
this:
(xs @ ys = ?zs) = (xs = take (length xs) ?zs \<and> ys = drop (length xs) ?zs)

goal (2 subgoals):
 1. \<And>zs. ([] @ ys = zs) = ([] = take (length []) zs \<and> ys = drop (length []) zs)
 2. \<And>a xs zs. (\<And>zs. (xs @ ys = zs) = (xs = take (length xs) zs \<and> ys = drop (length xs) zs)) \<Longrightarrow> ((a # xs) @ ys = zs) = (a # xs = take (length (a # xs)) zs \<and> ys = drop (length (a # xs)) zs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(xs @ ys = ?zs) = (xs = take (length xs) ?zs \<and> ys = drop (length xs) ?zs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(xs @ ys = ?zs) = (xs = take (length xs) ?zs \<and> ys = drop (length xs) ?zs)

goal (1 subgoal):
 1. ((x # xs) @ ys = zs) = (x # xs = take (length (x # xs)) zs \<and> ys = drop (length (x # xs)) zs)
[PROOF STEP]
by (cases zs, auto)
[PROOF STATE]
proof (state)
this:
((x # xs) @ ys = zs) = (x # xs = take (length (x # xs)) zs \<and> ys = drop (length (x # xs)) zs)

goal (1 subgoal):
 1. \<And>zs. ([] @ ys = zs) = ([] = take (length []) zs \<and> ys = drop (length []) zs)
[PROOF STEP]
qed auto


[STATEMENT]
lemma upper_triangular_imp_basis:
  assumes A: "A \<in> carrier_mat n n"
    and tri: "upper_triangular A"
    and diag: "0 \<notin> set (diag_mat A)"
  shows "basis (set (rows A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis (set (rows A))
[PROOF STEP]
using upper_triangular_imp_distinct[OF assms]
[PROOF STATE]
proof (prove)
using this:
distinct (rows A)

goal (1 subgoal):
 1. basis (set (rows A))
[PROOF STEP]
using upper_triangular_imp_lin_indpt_rows[OF assms] A
[PROOF STATE]
proof (prove)
using this:
distinct (rows A)
lin_indpt (set (rows A))
A \<in> carrier_mat n n

goal (1 subgoal):
 1. basis (set (rows A))
[PROOF STEP]
by (auto intro: dim_li_is_basis simp: distinct_card dim_is_n set_rows_carrier)


[STATEMENT]
lemma ZFfun_ext:
  assumes "\<forall> x . x |\<in>| A \<longrightarrow> f x = g x"
  shows   "(ZFfun A B f) = (ZFfun A B g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFfun A B f = ZFfun A B g
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ZFfun A B f = ZFfun A B g
[PROOF STEP]
have "Lambda A f = Lambda A g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lambda A f = Lambda A g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x |\<in>| A \<longrightarrow> f x = g x

goal (1 subgoal):
 1. Lambda A f = Lambda A g
[PROOF STEP]
by (auto simp add: Lambda_ext)
[PROOF STATE]
proof (state)
this:
Lambda A f = Lambda A g

goal (1 subgoal):
 1. ZFfun A B f = ZFfun A B g
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Lambda A f = Lambda A g

goal (1 subgoal):
 1. ZFfun A B f = ZFfun A B g
[PROOF STEP]
by (simp add: ZFfun_def)
[PROOF STATE]
proof (state)
this:
ZFfun A B f = ZFfun A B g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma negligible_convex_interior:
   "convex S \<Longrightarrow> (negligible S \<longleftrightarrow> interior S = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex S \<Longrightarrow> negligible S = (interior S = {})
[PROOF STEP]
by (metis Diff_empty closure_subset frontier_def interior_subset negligible_convex_frontier negligible_subset open_interior open_not_negligible)


[STATEMENT]
lemma the_left_leI:
  assumes "\<forall>k. j<k \<and> k<i \<longrightarrow> \<not>xs!k<xs!i"
  assumes "has_left i"
  shows "the_left i \<le> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.the_left i \<le> j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>k. j < k \<and> k < i \<longrightarrow> \<not> xs ! k < xs ! i
local.has_left i

goal (1 subgoal):
 1. local.the_left i \<le> j
[PROOF STEP]
unfolding the_left_def has_left_def
[PROOF STATE]
proof (prove)
using this:
\<forall>k. j < k \<and> k < i \<longrightarrow> \<not> xs ! k < xs ! i
\<exists>ia<i. xs ! ia < xs ! i

goal (1 subgoal):
 1. (GREATEST ia. ia < i \<and> xs ! ia < xs ! i) \<le> j
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ia. \<lbrakk>\<forall>k. j < k \<and> k < i \<longrightarrow> \<not> xs ! k < xs ! i; ia < i; xs ! ia < xs ! i\<rbrakk> \<Longrightarrow> (GREATEST ia. ia < i \<and> xs ! ia < xs ! i) \<le> j
[PROOF STEP]
by (metis (full_types) the_leftI assms(2) not_le the_left_def)


[STATEMENT]
lemma equiv_ord0rel: "equiv UNIV ord0rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv UNIV ord0rel
[PROOF STEP]
apply (unfold equiv_def refl_on_def sym_def trans_def ord0rel_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({(x, y). x \<le> y \<and> y \<le> x} \<subseteq> UNIV \<times> UNIV \<and> (\<forall>x\<in>UNIV. (x, x) \<in> {(x, y). x \<le> y \<and> y \<le> x})) \<and> (\<forall>x y. (x, y) \<in> {(x, y). x \<le> y \<and> y \<le> x} \<longrightarrow> (y, x) \<in> {(x, y). x \<le> y \<and> y \<le> x}) \<and> (\<forall>x y z. (x, y) \<in> {(x, y). x \<le> y \<and> y \<le> x} \<longrightarrow> (y, z) \<in> {(x, y). x \<le> y \<and> y \<le> x} \<longrightarrow> (x, z) \<in> {(x, y). x \<le> y \<and> y \<le> x})
[PROOF STEP]
apply (auto elim: ord0_order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem parallel_termination:
    assumes "0 < n"
      and "reachable x n ts (\<lambda>_. 0) s"
    shows "\<exists>s'. final n s' \<and> (step x n)\<^sup>*\<^sup>* s s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s'. final n s' \<and> (step x n)\<^sup>*\<^sup>* s s'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n
reachable x n ts (\<lambda>_. 0) s

goal (1 subgoal):
 1. \<exists>s'. final n s' \<and> (step x n)\<^sup>*\<^sup>* s s'
[PROOF STEP]
by (rule "termination")


[STATEMENT]
lemma iMOD_mult_div_right_inj_on: "
  inj_on (\<lambda>x. x div (k::nat)) [r, mod (k * m)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. x div k) [ r, mod k * m ]
[PROOF STEP]
apply (case_tac "k * m = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. k * m = 0 \<Longrightarrow> inj_on (\<lambda>x. x div k) [ r, mod k * m ]
 2. k * m \<noteq> 0 \<Longrightarrow> inj_on (\<lambda>x. x div k) [ r, mod k * m ]
[PROOF STEP]
apply (simp del: mult_is_0 mult_eq_0_iff add: iMOD_0 iIN_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * m \<noteq> 0 \<Longrightarrow> inj_on (\<lambda>x. x div k) [ r, mod k * m ]
[PROOF STEP]
apply (simp add: iMOD_div_right_inj_on)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done