[STATEMENT]
lemma aligned_add_offset_no_wrap:
  fixes off :: "('a::len) word"
  and     x :: "'a word"
  assumes al: "is_aligned x sz"
  and   offv: "off < 2 ^ sz"
  shows  "unat x + unat off < 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
 2. \<not> ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
assume szv: "sz < LENGTH('a)"
[PROOF STATE]
proof (state)
this:
sz < LENGTH('a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
 2. \<not> ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
from al
[PROOF STATE]
proof (chain)
picking this:
is_aligned x sz
[PROOF STEP]
obtain k where xv: "x = 2 ^ sz * (of_nat k)"
    and kl: "k < 2 ^ (LENGTH('a) - sz)"
[PROOF STATE]
proof (prove)
using this:
is_aligned x sz

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>x = 2 ^ sz * word_of_nat k; k < 2 ^ (LENGTH('a) - sz)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: is_alignedE)
[PROOF STATE]
proof (state)
this:
x = 2 ^ sz * word_of_nat k
k < 2 ^ (LENGTH('a) - sz)

goal (2 subgoals):
 1. ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
 2. \<not> ?P \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
using szv
[PROOF STATE]
proof (prove)
using this:
sz < LENGTH('a)

goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst xv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz * word_of_nat k) + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst unat_mult_power_lem[OF kl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sz < LENGTH('a) \<Longrightarrow> 2 ^ sz * k + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst mult.commute, rule nat_add_offset_less)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> unat off < 2 ^ sz
 2. sz < LENGTH('a) \<Longrightarrow> k < 2 ^ ?m1
 3. sz < LENGTH('a) \<Longrightarrow> LENGTH('a) = ?m1 + sz
[PROOF STEP]
apply (rule less_le_trans[OF unat_mono[OF offv, simplified]])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> unat (2 ^ sz) \<le> 2 ^ sz
 2. sz < LENGTH('a) \<Longrightarrow> k < 2 ^ ?m1
 3. sz < LENGTH('a) \<Longrightarrow> LENGTH('a) = ?m1 + sz
[PROOF STEP]
apply (erule eq_imp_le[OF unat_power_lower])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> k < 2 ^ ?m1
 2. sz < LENGTH('a) \<Longrightarrow> LENGTH('a) = ?m1 + sz
[PROOF STEP]
apply (rule kl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sz < LENGTH('a) \<Longrightarrow> LENGTH('a) = LENGTH('a) - sz + sz
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
unat x + unat off < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
assume "\<not> sz < LENGTH('a)"
[PROOF STATE]
proof (state)
this:
\<not> sz < LENGTH('a)

goal (1 subgoal):
 1. \<not> sz < LENGTH('a) \<Longrightarrow> unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
with offv
[PROOF STATE]
proof (chain)
picking this:
off < 2 ^ sz
\<not> sz < LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
off < 2 ^ sz
\<not> sz < LENGTH('a)

goal (1 subgoal):
 1. unat x + unat off < 2 ^ LENGTH('a)
[PROOF STEP]
by (simp add: not_less power_overflow )
[PROOF STATE]
proof (state)
this:
unat x + unat off < 2 ^ LENGTH('a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fresh_prod2[nominal_prod_simps,ms_fresh]: "x \<sharp> (a,b) = (x \<sharp> a \<and> x \<sharp> b )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sharp> (a, b) = (x \<sharp> a \<and> x \<sharp> b)
[PROOF STEP]
using fresh_def supp_Pair
[PROOF STATE]
proof (prove)
using this:
?a \<sharp> ?x \<equiv> ?a \<notin> supp ?x
supp (?x, ?y) = supp ?x \<union> supp ?y

goal (1 subgoal):
 1. x \<sharp> (a, b) = (x \<sharp> a \<and> x \<sharp> b)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma relabel_preserve_other: "u\<noteq>v \<Longrightarrow> relabel_effect f l u v = l v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> relabel_effect f l u v = l v
[PROOF STEP]
unfolding relabel_effect_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> (l(u := Min {l v |v. (u, v) \<in> cf.E} + 1)) v = l v
[PROOF STEP]
by auto


[STATEMENT]
lemma eval_monom_list[simp]: "eval_monom_list \<alpha> (m @ n) = eval_monom_list \<alpha> m * eval_monom_list \<alpha> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_monom_list \<alpha> (m @ n) = eval_monom_list \<alpha> m * eval_monom_list \<alpha> n
[PROOF STEP]
by (induct m, auto simp: field_simps)


[STATEMENT]
lemma (in Corps) npowf_inverse:"\<lbrakk>x \<in> carrier K; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>j\<^esup> = (x\<^bsup>\<hyphen>K\<^esup>)\<^bsub>K\<^esub>\<^bsup>(-j)\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier K; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>j\<^esup> = x\<^bsup>\<hyphen> K\<^esup>\<^bsub>K\<^esub>\<^bsup>- j\<^esup>
[PROOF STEP]
apply (case_tac "0 \<le> j")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> carrier K; x \<noteq> \<zero>; 0 \<le> j\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>j\<^esup> = x\<^bsup>\<hyphen> K\<^esup>\<^bsub>K\<^esub>\<^bsup>- j\<^esup>
 2. \<lbrakk>x \<in> carrier K; x \<noteq> \<zero>; \<not> 0 \<le> j\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>j\<^esup> = x\<^bsup>\<hyphen> K\<^esup>\<^bsub>K\<^esub>\<^bsup>- j\<^esup>
[PROOF STEP]
apply (simp add:npowf_inv, simp add:npowf_inv1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path_connected_Iio[simp]: "path_connected {..<a}" for a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected {..<a}
[PROOF STEP]
by (simp add: convex_imp_path_connected)


[STATEMENT]
lemma mat_of_row_index[simp]: "x < dim_vec y \<Longrightarrow> mat_of_row y $$ (0,x) = y $ x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < dim_vec y \<Longrightarrow> mat_of_row y $$ (0, x) = y $ x
[PROOF STEP]
unfolding mat_of_row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < dim_vec y \<Longrightarrow> mat 1 (dim_vec y) (\<lambda>ij. y $ snd ij) $$ (0, x) = y $ x
[PROOF STEP]
by auto


[STATEMENT]
lemma prime_coprime: "\<lbrakk>Prime x; Prime y; x\<noteq>y\<rbrakk> \<Longrightarrow> coprime x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Prime x; Prime y; x \<noteq> y\<rbrakk> \<Longrightarrow> coprime x y
[PROOF STEP]
proof (simp only: Prime.simps coprime_def, auto simp: dvd_def,
    rule_tac classical, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c k ka. \<lbrakk>Suc 0 < c * k; \<forall>u<c * k. \<forall>v<c * k. u * v \<noteq> c * k; Suc 0 < c * ka; \<forall>u<c * ka. \<forall>v<c * ka. u * v \<noteq> c * ka; x = c * k; y = c * ka; k \<noteq> ka; 0 < c; c \<noteq> Suc 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix d k ka
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c k ka. \<lbrakk>Suc 0 < c * k; \<forall>u<c * k. \<forall>v<c * k. u * v \<noteq> c * k; Suc 0 < c * ka; \<forall>u<c * ka. \<forall>v<c * ka. u * v \<noteq> c * ka; x = c * k; y = c * ka; k \<noteq> ka; 0 < c; c \<noteq> Suc 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume case_ka: "\<forall>u<d * ka. \<forall>v<d * ka. u * v \<noteq> d * ka"
    and case_k: "\<forall>u<d * k. \<forall>v<d * k. u * v \<noteq> d * k"
    and h: "(0::nat) < d" "d \<noteq> Suc 0" "Suc 0 < d * ka"
    "ka \<noteq> k" "Suc 0 < d * k"
[PROOF STATE]
proof (state)
this:
\<forall>u<d * ka. \<forall>v<d * ka. u * v \<noteq> d * ka
\<forall>u<d * k. \<forall>v<d * k. u * v \<noteq> d * k
0 < d
d \<noteq> Suc 0
Suc 0 < d * ka
ka \<noteq> k
Suc 0 < d * k

goal (1 subgoal):
 1. \<And>c k ka. \<lbrakk>Suc 0 < c * k; \<forall>u<c * k. \<forall>v<c * k. u * v \<noteq> c * k; Suc 0 < c * ka; \<forall>u<c * ka. \<forall>v<c * ka. u * v \<noteq> c * ka; x = c * k; y = c * ka; k \<noteq> ka; 0 < c; c \<noteq> Suc 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from h
[PROOF STATE]
proof (chain)
picking this:
0 < d
d \<noteq> Suc 0
Suc 0 < d * ka
ka \<noteq> k
Suc 0 < d * k
[PROOF STEP]
have "k > Suc 0 \<or> ka >Suc 0"
[PROOF STATE]
proof (prove)
using this:
0 < d
d \<noteq> Suc 0
Suc 0 < d * ka
ka \<noteq> k
Suc 0 < d * k

goal (1 subgoal):
 1. Suc 0 < k \<or> Suc 0 < ka
[PROOF STEP]
by (cases ka;cases k;force+)
[PROOF STATE]
proof (state)
this:
Suc 0 < k \<or> Suc 0 < ka

goal (1 subgoal):
 1. \<And>c k ka. \<lbrakk>Suc 0 < c * k; \<forall>u<c * k. \<forall>v<c * k. u * v \<noteq> c * k; Suc 0 < c * ka; \<forall>u<c * ka. \<forall>v<c * ka. u * v \<noteq> c * ka; x = c * k; y = c * ka; k \<noteq> ka; 0 < c; c \<noteq> Suc 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
Suc 0 < k \<or> Suc 0 < ka
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
Suc 0 < k \<or> Suc 0 < ka

goal (1 subgoal):
 1. False
[PROOF STEP]
proof(erule_tac disjE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Suc 0 < k \<Longrightarrow> False
 2. Suc 0 < ka \<Longrightarrow> False
[PROOF STEP]
assume  "(Suc 0::nat) < k"
[PROOF STATE]
proof (state)
this:
Suc 0 < k

goal (2 subgoals):
 1. Suc 0 < k \<Longrightarrow> False
 2. Suc 0 < ka \<Longrightarrow> False
[PROOF STEP]
hence "k < d*k \<and> d < d*k"
[PROOF STATE]
proof (prove)
using this:
Suc 0 < k

goal (1 subgoal):
 1. k < d * k \<and> d < d * k
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
Suc 0 < k
0 < d
d \<noteq> Suc 0
Suc 0 < d * ka
ka \<noteq> k
Suc 0 < d * k

goal (1 subgoal):
 1. k < d * k \<and> d < d * k
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
k < d * k \<and> d < d * k

goal (2 subgoals):
 1. Suc 0 < k \<Longrightarrow> False
 2. Suc 0 < ka \<Longrightarrow> False
[PROOF STEP]
thus "?thesis"
[PROOF STATE]
proof (prove)
using this:
k < d * k \<and> d < d * k

goal (1 subgoal):
 1. False
[PROOF STEP]
using case_k
[PROOF STATE]
proof (prove)
using this:
k < d * k \<and> d < d * k
\<forall>u<d * k. \<forall>v<d * k. u * v \<noteq> d * k

goal (1 subgoal):
 1. False
[PROOF STEP]
apply(erule_tac x = d in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k < d * k \<and> d < d * k; d < d * k \<longrightarrow> (\<forall>v<d * k. d * v \<noteq> d * k)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k \<and> Suc 0 < d \<and> 0 < d \<and> Suc 0 < k; \<forall>v<d * k. v \<noteq> k\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(erule_tac x = k in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k \<and> Suc 0 < d \<and> 0 < d \<and> Suc 0 < k; k < d * k \<longrightarrow> k \<noteq> k\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. Suc 0 < ka \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc 0 < ka \<Longrightarrow> False
[PROOF STEP]
assume "(Suc 0::nat) < ka"
[PROOF STATE]
proof (state)
this:
Suc 0 < ka

goal (1 subgoal):
 1. Suc 0 < ka \<Longrightarrow> False
[PROOF STEP]
hence "ka < d * ka \<and> d < d*ka"
[PROOF STATE]
proof (prove)
using this:
Suc 0 < ka

goal (1 subgoal):
 1. ka < d * ka \<and> d < d * ka
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
Suc 0 < ka
0 < d
d \<noteq> Suc 0
Suc 0 < d * ka
ka \<noteq> k
Suc 0 < d * k

goal (1 subgoal):
 1. ka < d * ka \<and> d < d * ka
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ka < d * ka \<and> d < d * ka

goal (1 subgoal):
 1. Suc 0 < ka \<Longrightarrow> False
[PROOF STEP]
thus "?thesis"
[PROOF STATE]
proof (prove)
using this:
ka < d * ka \<and> d < d * ka

goal (1 subgoal):
 1. False
[PROOF STEP]
using case_ka
[PROOF STATE]
proof (prove)
using this:
ka < d * ka \<and> d < d * ka
\<forall>u<d * ka. \<forall>v<d * ka. u * v \<noteq> d * ka

goal (1 subgoal):
 1. False
[PROOF STEP]
apply(erule_tac x = d in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ka < d * ka \<and> d < d * ka; d < d * ka \<longrightarrow> (\<forall>v<d * ka. d * v \<noteq> d * ka)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < ka \<and> Suc 0 < d \<and> 0 < d \<and> Suc 0 < ka; \<forall>v<d * ka. v \<noteq> ka\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(erule_tac x = ka in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < ka \<and> Suc 0 < d \<and> 0 < d \<and> Suc 0 < ka; ka < d * ka \<longrightarrow> ka \<noteq> ka\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
False

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma stream_rel_coinduct[case_names stream_rel, coinduct pred: stream_all2]:
    assumes "R u v"
    assumes "\<And> a u b v. R (a ## u) (b ## v) \<Longrightarrow> P a b \<and> R u v"
    shows "stream_all2 P u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stream_all2 P u v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R u v
R (?a ## ?u) (?b ## ?v) \<Longrightarrow> P ?a ?b \<and> R ?u ?v

goal (1 subgoal):
 1. stream_all2 P u v
[PROOF STEP]
by (coinduct) (metis stream.collapse)


[STATEMENT]
lemma img_unit_closed:"\<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow>
                                            \<one>\<^bsub>G\<^esub> \<in> f `(carrier F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> \<one>\<^bsub>G\<^esub> \<in> f ` carrier F
[PROOF STEP]
apply (cut_tac Group.unit_closed[of "F"],
      frule ghom_unit_unit[THEN sym, of "F" "G" "f"], assumption+,
      simp add:image_def, blast,
      assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bitlen_bounds:
  "2 ^ nat (bitlen x - 1) \<le> x \<and> x < 2 ^ nat (bitlen x)" if "x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ nat (bitlen x - 1) \<le> x \<and> x < 2 ^ nat (bitlen x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ nat (bitlen x - 1) \<le> x \<and> x < 2 ^ nat (bitlen x)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
0 < x
[PROOF STEP]
have "bitlen x \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. 1 \<le> bitlen x
[PROOF STEP]
by (auto simp: bitlen_alt_def)
[PROOF STATE]
proof (state)
this:
1 \<le> bitlen x

goal (1 subgoal):
 1. 2 ^ nat (bitlen x - 1) \<le> x \<and> x < 2 ^ nat (bitlen x)
[PROOF STEP]
with that floorlog_bounds[of "nat x" 2]
[PROOF STATE]
proof (chain)
picking this:
0 < x
\<lbrakk>0 < nat x; 1 < 2\<rbrakk> \<Longrightarrow> 2 ^ (floorlog 2 (nat x) - 1) \<le> nat x \<and> nat x < 2 ^ floorlog 2 (nat x)
1 \<le> bitlen x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < x
\<lbrakk>0 < nat x; 1 < 2\<rbrakk> \<Longrightarrow> 2 ^ (floorlog 2 (nat x) - 1) \<le> nat x \<and> nat x < 2 ^ floorlog 2 (nat x)
1 \<le> bitlen x

goal (1 subgoal):
 1. 2 ^ nat (bitlen x - 1) \<le> x \<and> x < 2 ^ nat (bitlen x)
[PROOF STEP]
by (auto simp add: bitlen_def le_nat_iff nat_less_iff nat_diff_distrib)
[PROOF STATE]
proof (state)
this:
2 ^ nat (bitlen x - 1) \<le> x \<and> x < 2 ^ nat (bitlen x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reals_Archimedean2: "\<exists>n. x < of_nat n"
  for x :: "'a::archimedean_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
obtain z where "x < of_int z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. x < of_int z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_less_of_int
[PROOF STATE]
proof (prove)
using this:
\<exists>z. ?x < of_int z

goal (1 subgoal):
 1. (\<And>z. x < of_int z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x < of_int z

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x < of_int z

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
have "\<dots> \<le> of_int (int (nat z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int z \<le> of_int (int (nat z))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int (int (nat z))

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int (int (nat z))

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
have "\<dots> = of_nat (nat z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (int (nat z)) = of_nat (nat z)
[PROOF STEP]
by (simp only: of_int_of_nat_eq)
[PROOF STATE]
proof (state)
this:
of_int (int (nat z)) = of_nat (nat z)

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x < of_nat (nat z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < of_nat (nat z)

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>n. x < of_nat n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r_constant_alt: "\<forall> x \<in> \<V>. \<B> rep x = \<Lambda> * (\<v> - 1) div (\<k> - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<V>. \<B> rep x = \<Lambda> * (\<v> - 1) div (\<k> - 1)
[PROOF STEP]
using r_constant replication_number_value
[PROOF STATE]
proof (prove)
using this:
?x \<in> \<V> \<Longrightarrow> \<B> rep ?x * (\<k> - 1) = \<Lambda> * (\<v> - 1)
?x \<in> \<V> \<Longrightarrow> \<B> rep ?x = \<Lambda> * (\<v> - 1) div (\<k> - 1)

goal (1 subgoal):
 1. \<forall>x\<in>\<V>. \<B> rep x = \<Lambda> * (\<v> - 1) div (\<k> - 1)
[PROOF STEP]
by blast


[STATEMENT]
lemma prob_space_restrict_space:
  "S \<in> sets M \<Longrightarrow> emeasure M S = 1 \<Longrightarrow> prob_space (restrict_space M S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<in> sets M; emeasure M S = 1\<rbrakk> \<Longrightarrow> prob_space (restrict_space M S)
[PROOF STEP]
by (intro prob_spaceI)
     (simp add: emeasure_restrict_space space_restrict_space)


[STATEMENT]
lemma foldli_diff:
    "det_fold_set X (\<lambda>_. True) (\<lambda>x s. op_set_delete x s) s ((-) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det_fold_set X (\<lambda>_. True) op_set_delete s ((-) s)
[PROOF STEP]
proof (rule, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. \<lbrakk>distinct l; sorted_wrt X l\<rbrakk> \<Longrightarrow> foldli l (\<lambda>_. True) op_set_delete s = s - set l
[PROOF STEP]
case (1 l)
[PROOF STATE]
proof (state)
this:
distinct l
sorted_wrt X l

goal (1 subgoal):
 1. \<And>l. \<lbrakk>distinct l; sorted_wrt X l\<rbrakk> \<Longrightarrow> foldli l (\<lambda>_. True) op_set_delete s = s - set l
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
distinct l
sorted_wrt X l

goal (1 subgoal):
 1. foldli l (\<lambda>_. True) op_set_delete s = s - set l
[PROOF STEP]
by (induct l arbitrary: s) auto
[PROOF STATE]
proof (state)
this:
foldli l (\<lambda>_. True) op_set_delete s = s - set l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_orbit_flow_compact:
  assumes "closed_orbit x"
  shows "compact(flow0 x ` UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
obtain Tp where "Tp \<noteq> 0" "Tp \<in> existence_ivl0 x" "flow0 x Tp = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Tp. \<lbrakk>Tp \<noteq> 0; Tp \<in> existence_ivl0 x; flow0 x Tp = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
closed_orbit x

goal (1 subgoal):
 1. (\<And>Tp. \<lbrakk>Tp \<noteq> 0; Tp \<in> existence_ivl0 x; flow0 x Tp = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding closed_orbit_def
[PROOF STATE]
proof (prove)
using this:
\<exists>T\<in>existence_ivl0 x. T \<noteq> 0 \<and> flow0 x T = x

goal (1 subgoal):
 1. (\<And>Tp. \<lbrakk>Tp \<noteq> 0; Tp \<in> existence_ivl0 x; flow0 x Tp = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Tp \<noteq> 0
Tp \<in> existence_ivl0 x
flow0 x Tp = x

goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Tp \<noteq> 0
Tp \<in> existence_ivl0 x
flow0 x Tp = x
[PROOF STEP]
obtain T where T: "T \<in> existence_ivl0 x" "T > 0" "flow0 x T = x"
[PROOF STATE]
proof (prove)
using this:
Tp \<noteq> 0
Tp \<in> existence_ivl0 x
flow0 x Tp = x

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<in> existence_ivl0 x; 0 < T; flow0 x T = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (smt recurrence_time_flip_sign)
[PROOF STATE]
proof (state)
this:
T \<in> existence_ivl0 x
0 < T
flow0 x T = x

goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
from recurrence_time_restricts_compact_flow[OF this]
[PROOF STATE]
proof (chain)
picking this:
range (flow0 x) = flow0 x ` {0..T}
[PROOF STEP]
have feq: "flow0 x ` UNIV = flow0 x ` {0..T}"
[PROOF STATE]
proof (prove)
using this:
range (flow0 x) = flow0 x ` {0..T}

goal (1 subgoal):
 1. range (flow0 x) = flow0 x ` {0..T}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
range (flow0 x) = flow0 x ` {0..T}

goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
have "continuous_on {0..T} (flow0 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..T} (flow0 x)
[PROOF STEP]
by (meson T(1) continuous_on_sequentially in_mono local.flow_continuous_on local.ivl_subset_existence_ivl)
[PROOF STATE]
proof (state)
this:
continuous_on {0..T} (flow0 x)

goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
from compact_continuous_image[OF this]
[PROOF STATE]
proof (chain)
picking this:
compact {0..T} \<Longrightarrow> compact (flow0 x ` {0..T})
[PROOF STEP]
have "compact (flow0 x ` {0..T})"
[PROOF STATE]
proof (prove)
using this:
compact {0..T} \<Longrightarrow> compact (flow0 x ` {0..T})

goal (1 subgoal):
 1. compact (flow0 x ` {0..T})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
compact (flow0 x ` {0..T})

goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
compact (flow0 x ` {0..T})

goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
using feq
[PROOF STATE]
proof (prove)
using this:
compact (flow0 x ` {0..T})
range (flow0 x) = flow0 x ` {0..T}

goal (1 subgoal):
 1. compact (range (flow0 x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
compact (range (flow0 x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_pre_zeta [continuous_intros]:
  assumes "continuous (at x within A) f" "a > 0"
  shows   "continuous (at x within A) (\<lambda>x. pre_zeta a (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at x within A) (\<lambda>x. pre_zeta a (f x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous (at x within A) (\<lambda>x. pre_zeta a (f x))
[PROOF STEP]
have "continuous (at z) (pre_zeta a)" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (pre_zeta a) z
[PROOF STEP]
by (rule continuous_on_interior[of UNIV]) (insert assms, auto intro!: continuous_intros)
[PROOF STATE]
proof (state)
this:
isCont (pre_zeta a) ?z

goal (1 subgoal):
 1. continuous (at x within A) (\<lambda>x. pre_zeta a (f x))
[PROOF STEP]
from continuous_within_compose3[OF this assms(1)]
[PROOF STATE]
proof (chain)
picking this:
continuous (at x within A) (\<lambda>x. pre_zeta a (f x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous (at x within A) (\<lambda>x. pre_zeta a (f x))

goal (1 subgoal):
 1. continuous (at x within A) (\<lambda>x. pre_zeta a (f x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
continuous (at x within A) (\<lambda>x. pre_zeta a (f x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma alternating_order2_cancel_1left:
  "s+s=0 \<Longrightarrow>
    sum_list (s # (alternating_list (Suc n) s t)) = sum_list (alternating_list n t s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s + s = (0::'a) \<Longrightarrow> sum_list (s # alternating_list (Suc n) s t) = sum_list (alternating_list n t s)
[PROOF STEP]
using add.assoc[of s s] alternating_list_Suc_Cons[of n s]
[PROOF STATE]
proof (prove)
using this:
s + s + ?c = s + (s + ?c)
alternating_list (Suc n) s ?t = s # alternating_list n ?t s

goal (1 subgoal):
 1. s + s = (0::'a) \<Longrightarrow> sum_list (s # alternating_list (Suc n) s t) = sum_list (alternating_list n t s)
[PROOF STEP]
by simp


[STATEMENT]
lemma find_result_props :
  assumes "find P xs = Some x"
  shows "x \<in> set xs" and "P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set xs &&& P x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> set xs
 2. P x
[PROOF STEP]
show "x \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
find P xs = Some x

goal (1 subgoal):
 1. x \<in> set xs
[PROOF STEP]
by (metis find_Some_iff nth_mem)
[PROOF STATE]
proof (state)
this:
x \<in> set xs

goal (1 subgoal):
 1. P x
[PROOF STEP]
show "P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
find P xs = Some x

goal (1 subgoal):
 1. P x
[PROOF STEP]
by (metis find_Some_iff)
[PROOF STATE]
proof (state)
this:
P x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finvimage_small[simp]: "small {a. \<exists>b\<in>\<^sub>\<circ>A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small {a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. small {a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}
[PROOF STEP]
have ss: "{a. \<exists>b\<in>\<^sub>\<circ>A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r} \<subseteq> (\<lambda>x. x\<lparr>0\<^sub>\<nat>\<rparr>) ` elts r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r} \<subseteq> (\<lambda>x. x\<lparr>0\<^sub>\<nat>\<rparr>) ` elts r
[PROOF STEP]
using image_iff
[PROOF STATE]
proof (prove)
using this:
(?z \<in> ?f ` ?A) = (\<exists>x\<in>?A. ?z = ?f x)

goal (1 subgoal):
 1. {a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r} \<subseteq> (\<lambda>x. x\<lparr>0\<^sub>\<nat>\<rparr>) ` elts r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r} \<subseteq> (\<lambda>x. x\<lparr>0\<^sub>\<nat>\<rparr>) ` elts r

goal (1 subgoal):
 1. small {a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}
[PROOF STEP]
have small: "small ((\<lambda>x. x\<lparr>0\<^sub>\<nat>\<rparr>) ` elts r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small ((\<lambda>x. x\<lparr>0\<^sub>\<nat>\<rparr>) ` elts r)
[PROOF STEP]
by (rule replacement) simp
[PROOF STATE]
proof (state)
this:
small ((\<lambda>x. x\<lparr>0\<^sub>\<nat>\<rparr>) ` elts r)

goal (1 subgoal):
 1. small {a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small {a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}
[PROOF STEP]
by (rule smaller_than_small, rule small, rule ss)
[PROOF STATE]
proof (state)
this:
small {a. \<exists>b\<in>elts A. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inducedHOMTr0_2:"\<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow>
    (f\<dieresis>\<^bsub>F,G\<^esub>) \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f) \<rightarrow> f ` (carrier F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> f\<dieresis>\<^bsub>F,G\<^esub> \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f) \<rightarrow> f ` carrier F
[PROOF STEP]
apply (rule Pi_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> set_rcs F (gker\<^bsub>F,G\<^esub> f)\<rbrakk> \<Longrightarrow> (f\<dieresis>\<^bsub>F,G\<^esub>) x \<in> f ` carrier F
[PROOF STEP]
apply (simp add:set_rcs_def, erule bexE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; x = gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a\<rbrakk> \<Longrightarrow> (f\<dieresis>\<^bsub>F,G\<^esub>) (gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a) \<in> f ` carrier F
[PROOF STEP]
apply (subst inducedHOMTr0[of "F" "G" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a. \<lbrakk>Group F; Group G; f \<in> gHom F G; a \<in> carrier F; x = gker\<^bsub>F,G\<^esub> f \<bullet>\<^bsub>F\<^esub> a\<rbrakk> \<Longrightarrow> f a \<in> f ` carrier F
[PROOF STEP]
apply (simp add:image_def, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma le_append_swap_iff:
  assumes "length y = length v"
  shows "y @ x \<le>\<^sub>v v @ w  \<longleftrightarrow> x @ y \<le>\<^sub>v w @ v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y @ x \<le>\<^sub>v v @ w) = (x @ y \<le>\<^sub>v w @ v)
[PROOF STEP]
using assms and le_append_swap
[PROOF STATE]
proof (prove)
using this:
length y = length v
\<lbrakk>length ?y = length ?v; ?x @ ?y \<le>\<^sub>v ?w @ ?v\<rbrakk> \<Longrightarrow> ?y @ ?x \<le>\<^sub>v ?v @ ?w

goal (1 subgoal):
 1. (y @ x \<le>\<^sub>v v @ w) = (x @ y \<le>\<^sub>v w @ v)
[PROOF STEP]
by (auto) (metis (no_types, lifting) add_left_imp_eq le_length length_append)


[STATEMENT]
lemma "\<And>s. (\<forall>l. I (l(x:=0)) s) = (\<forall>l. l x = 0 \<longrightarrow> I l s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. (\<forall>l. I (l(x := 0::'c)) s) = (\<forall>l. l x = (0::'c) \<longrightarrow> I l s)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s l. \<lbrakk>\<forall>l. I (l(x := 0::'c)) s; l x = (0::'c)\<rbrakk> \<Longrightarrow> I l s
[PROOF STEP]
by (metis fun_upd_triv)


[STATEMENT]
lemma (in Group) rcs_in_set_rcs:"\<lbrakk>G \<guillemotright> H; a \<in> carrier G\<rbrakk> \<Longrightarrow>
          H \<bullet> a \<in> set_rcs G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G\<rbrakk> \<Longrightarrow> H \<bullet> a \<in> set_rcs G H
[PROOF STEP]
apply (simp add:set_rcs_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G\<rbrakk> \<Longrightarrow> \<exists>aa\<in>carrier G. H \<bullet> a = H \<bullet> aa
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map2_times_proj:
  "map2 (*) xs (map (proj_poly k) ys) = map (proj_poly k \<circ> (\<lambda>(x, y). x \<odot> y)) (zip xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (*) xs (map (proj_poly k) ys) = map (proj_poly k \<circ> (\<lambda>(x, y). x \<odot> y)) (zip xs ys)
[PROOF STEP]
by (rule nth_equalityI, simp_all add: proj_mult_scalar)


[STATEMENT]
lemma (in Corps) val_Zmin_sym:"\<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K\<rbrakk>
                 \<Longrightarrow>  amin (v x) (v y) = amin (v y ) (v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K\<rbrakk> \<Longrightarrow> amin (v x) (v y) = amin (v y) (v x)
[PROOF STEP]
by (simp add:amin_commute)


[STATEMENT]
lemma abundant220ex: "abundant_number 220"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abundant_number 220
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. abundant_number 220
[PROOF STEP]
have "220 Amic 284"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 220 Amic 284
[PROOF STEP]
using Amicable_Example_Pythagoras
[PROOF STATE]
proof (prove)
using this:
220 Amic 284

goal (1 subgoal):
 1. 220 Amic 284
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
220 Amic 284

goal (1 subgoal):
 1. abundant_number 220
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
220 Amic 284

goal (1 subgoal):
 1. abundant_number 220
[PROOF STEP]
have "(220::nat) < 284"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 220 < 284
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
220 < 284

goal (1 subgoal):
 1. abundant_number 220
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
220 Amic 284
220 < 284
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
220 Amic 284
220 < 284

goal (1 subgoal):
 1. abundant_number 220
[PROOF STEP]
using Amicable_pair_abundant Amicable_pair_sym
[PROOF STATE]
proof (prove)
using this:
220 Amic 284
220 < 284
\<lbrakk>?n < ?m; ?m Amic ?n\<rbrakk> \<Longrightarrow> abundant_number ?n
?m Amic ?n \<Longrightarrow> ?n Amic ?m

goal (1 subgoal):
 1. abundant_number 220
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
abundant_number 220

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_field_derivative_Beta2 [derivative_intros]:
  assumes "y \<notin> \<int>\<^sub>\<le>\<^sub>0" "x + y \<notin> \<int>\<^sub>\<le>\<^sub>0"
  shows   "((\<lambda>y. Beta x y) has_field_derivative (Beta x y * (Digamma y - Digamma (x + y))))
               (at y within A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Beta x has_field_derivative Beta x y * (Digamma y - Digamma (x + y))) (at y within A)
[PROOF STEP]
using has_field_derivative_Beta1[of y x A] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>y \<notin> \<int>\<^sub>\<le>\<^sub>0; y + x \<notin> \<int>\<^sub>\<le>\<^sub>0\<rbrakk> \<Longrightarrow> ((\<lambda>xa. Beta xa x) has_field_derivative Beta y x * (Digamma y - Digamma (y + x))) (at y within A)
y \<notin> \<int>\<^sub>\<le>\<^sub>0
x + y \<notin> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. (Beta x has_field_derivative Beta x y * (Digamma y - Digamma (x + y))) (at y within A)
[PROOF STEP]
by (simp add: Beta_commute add_ac)


[STATEMENT]
lemma P920_example_gfp_F_match_value:
  shows "P920_example.match (P920_example_gfp_F UNIV) = {(D1, H1), (D2, H2)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P920_example.match (P920_example_gfp_F UNIV) = {(D1, H1), (D2, H2)}
[PROOF STEP]
unfolding P920_example_gfp_F_value
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P920_example.match ({(D1, H1), (D1, H2), (D2, H2)}, {(D1, H1), (D2, H1), (D2, H2)}) = {(D1, H1), (D2, H2)}
[PROOF STEP]
by simp


[STATEMENT]
lemma stream_rel_coinduct[case_names stream_rel, coinduct pred: stream_all2]:
    assumes "R u v"
    assumes "\<And> a u b v. R (a ## u) (b ## v) \<Longrightarrow> P a b \<and> R u v"
    shows "stream_all2 P u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stream_all2 P u v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R u v
R (?a ## ?u) (?b ## ?v) \<Longrightarrow> P ?a ?b \<and> R ?u ?v

goal (1 subgoal):
 1. stream_all2 P u v
[PROOF STEP]
by (coinduct) (metis stream.collapse)


[STATEMENT]
lemma small_det_csmall_det:
assumes "\<forall>\<sigma>. small P \<sigma> = {} \<or> (\<exists>\<sigma>'. small P \<sigma> = {\<sigma>'})"
shows "\<forall>\<sigma>. csmall P \<sigma> = {} \<or> (\<exists>o'. csmall P \<sigma> = {o'})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<sigma>. csmall P \<sigma> = {} \<or> (\<exists>o'. csmall P \<sigma> = {o'})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<sigma>. small P \<sigma> = {} \<or> (\<exists>\<sigma>'. small P \<sigma> = {\<sigma>'})

goal (1 subgoal):
 1. \<forall>\<sigma>. csmall P \<sigma> = {} \<or> (\<exists>o'. csmall P \<sigma> = {o'})
[PROOF STEP]
by(fastforce simp: csmall_def)


[STATEMENT]
lemma vector_smult_lzero[simp]: "(0::'a::mult_zero) *s x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) *s x = 0
[PROOF STEP]
by vector


[STATEMENT]
lemma sin_minus_converges: "(\<lambda>n. - (sin_coeff n *\<^sub>R (-x)^n)) sums sin x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - (sin_coeff n *\<^sub>R (- x) ^ n)) sums sin x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. - (sin_coeff n *\<^sub>R (- x) ^ n)) sums sin x
[PROOF STEP]
have [simp]: "\<And>n. - (sin_coeff n *\<^sub>R (-x)^n) = (sin_coeff n *\<^sub>R x^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. - (sin_coeff n *\<^sub>R (- x) ^ n) = sin_coeff n *\<^sub>R x ^ n
[PROOF STEP]
by (auto simp: sin_coeff_def elim!: oddE)
[PROOF STATE]
proof (state)
this:
- (sin_coeff ?n *\<^sub>R (- x) ^ ?n) = sin_coeff ?n *\<^sub>R x ^ ?n

goal (1 subgoal):
 1. (\<lambda>n. - (sin_coeff n *\<^sub>R (- x) ^ n)) sums sin x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - (sin_coeff n *\<^sub>R (- x) ^ n)) sums sin x
[PROOF STEP]
by (simp add: sin_def summable_norm_sin [THEN summable_norm_cancel, THEN summable_sums])
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - (sin_coeff n *\<^sub>R (- x) ^ n)) sums sin x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma op_cf_cf_la_of_ra_op[cat_op_simps]:
  "op_cf (cf_la_of_ra F (op_cf \<FF>) \<epsilon>) = cf_ra_of_la F \<FF> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf (cf_la_of_ra F (op_cf \<FF>) \<epsilon>) = cf_ra_of_la F \<FF> \<epsilon>
[PROOF STEP]
unfolding cf_ra_of_la_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf (cf_la_of_ra F (op_cf \<FF>) \<epsilon>) = op_cf (cf_la_of_ra F (op_cf \<FF>) \<epsilon>)
[PROOF STEP]
by simp


[STATEMENT]
lemma permutations_of_set_lists: "permutations_of_set A \<subseteq> lists A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permutations_of_set A \<subseteq> lists A
[PROOF STEP]
unfolding permutations_of_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. set xs = A \<and> distinct xs} \<subseteq> lists A
[PROOF STEP]
by auto


[STATEMENT]
lemma rbt_lookup_fold_rbt_insert_impl:
  "rbt_sorted t2 \<Longrightarrow>
  rbt_lookup (RBT_Impl.fold rbt_insert t1 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t1 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t1))
[PROOF STEP]
proof(induction t1 arbitrary: t2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert rbt.Empty t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries rbt.Empty))
 2. \<And>x1 t11 x3 x4 t12 t2. \<lbrakk>\<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t11 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t11)); \<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t12 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t12)); rbt_sorted t2\<rbrakk> \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert (Branch x1 t11 x3 x4 t12) t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries (Branch x1 t11 x3 x4 t12)))
[PROOF STEP]
case Empty
[PROOF STATE]
proof (state)
this:
rbt_sorted t2

goal (2 subgoals):
 1. \<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert rbt.Empty t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries rbt.Empty))
 2. \<And>x1 t11 x3 x4 t12 t2. \<lbrakk>\<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t11 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t11)); \<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t12 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t12)); rbt_sorted t2\<rbrakk> \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert (Branch x1 t11 x3 x4 t12) t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries (Branch x1 t11 x3 x4 t12)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
rbt_sorted t2

goal (1 subgoal):
 1. rbt_lookup (RBT_Impl.fold rbt_insert rbt.Empty t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries rbt.Empty))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rbt_lookup (RBT_Impl.fold rbt_insert rbt.Empty t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries rbt.Empty))

goal (1 subgoal):
 1. \<And>x1 t11 x3 x4 t12 t2. \<lbrakk>\<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t11 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t11)); \<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t12 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t12)); rbt_sorted t2\<rbrakk> \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert (Branch x1 t11 x3 x4 t12) t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries (Branch x1 t11 x3 x4 t12)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1 t11 x3 x4 t12 t2. \<lbrakk>\<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t11 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t11)); \<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t12 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t12)); rbt_sorted t2\<rbrakk> \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert (Branch x1 t11 x3 x4 t12) t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries (Branch x1 t11 x3 x4 t12)))
[PROOF STEP]
case (Branch c l x k r)
[PROOF STATE]
proof (state)
this:
rbt_sorted ?t2.0 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert l ?t2.0) = rbt_lookup ?t2.0 ++ map_of (rev (RBT_Impl.entries l))
rbt_sorted ?t2.0 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert r ?t2.0) = rbt_lookup ?t2.0 ++ map_of (rev (RBT_Impl.entries r))
rbt_sorted t2

goal (1 subgoal):
 1. \<And>x1 t11 x3 x4 t12 t2. \<lbrakk>\<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t11 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t11)); \<And>t2. rbt_sorted t2 \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert t12 t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries t12)); rbt_sorted t2\<rbrakk> \<Longrightarrow> rbt_lookup (RBT_Impl.fold rbt_insert (Branch x1 t11 x3 x4 t12) t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries (Branch x1 t11 x3 x4 t12)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt_lookup (RBT_Impl.fold rbt_insert (Branch c l x k r) t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries (Branch c l x k r)))
[PROOF STEP]
using Branch.prems
[PROOF STATE]
proof (prove)
using this:
rbt_sorted t2

goal (1 subgoal):
 1. rbt_lookup (RBT_Impl.fold rbt_insert (Branch c l x k r) t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries (Branch c l x k r)))
[PROOF STEP]
by(simp add: map_add_def Branch.IH rbt_insert_rbt_sorted rbt_sorted_fold_insert rbt_lookup_rbt_insert' fun_eq_iff split: option.split)
[PROOF STATE]
proof (state)
this:
rbt_lookup (RBT_Impl.fold rbt_insert (Branch c l x k r) t2) = rbt_lookup t2 ++ map_of (rev (RBT_Impl.entries (Branch c l x k r)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma swap_length[simp]: "length (swap l i j) = length l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (swap l i j) = length l
[PROOF STEP]
unfolding swap_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (l[i := l ! j, j := l ! i]) = length l
[PROOF STEP]
by auto


[STATEMENT]
lemma min_set_obtains_helper:
  "A \<in> B \<Longrightarrow> \<exists>C. C |\<subseteq>| A \<and> C \<in> min_set B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> B \<Longrightarrow> \<exists>C. C |\<subseteq>| A \<and> C \<in> min_set B
[PROOF STEP]
proof (induction "fcard A" arbitrary: A rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>\<And>Aa. \<lbrakk>fcard Aa < fcard A; Aa \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| Aa \<and> C \<in> min_set B; A \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| A \<and> C \<in> min_set B
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
\<lbrakk>fcard ?A < fcard A; ?A \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| ?A \<and> C \<in> min_set B
A \<in> B

goal (1 subgoal):
 1. \<And>A. \<lbrakk>\<And>Aa. \<lbrakk>fcard Aa < fcard A; Aa \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| Aa \<and> C \<in> min_set B; A \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| A \<and> C \<in> min_set B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>fcard ?A < fcard A; ?A \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| ?A \<and> C \<in> min_set B
A \<in> B
[PROOF STEP]
have "(\<forall>A'. A' \<notin> B \<or> \<not> A' |\<subseteq>| A \<or> A' = A) \<or> (\<exists>A'. A' |\<subseteq>| A \<and> A' \<in> min_set B)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>fcard ?A < fcard A; ?A \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| ?A \<and> C \<in> min_set B
A \<in> B

goal (1 subgoal):
 1. (\<forall>A'. A' \<notin> B \<or> \<not> A' |\<subseteq>| A \<or> A' = A) \<or> (\<exists>A'. A' |\<subseteq>| A \<and> A' \<in> min_set B)
[PROOF STEP]
by (metis (no_types) dual_order.trans order.not_eq_order_implies_strict pfsubset_fcard_mono)
[PROOF STATE]
proof (state)
this:
(\<forall>A'. A' \<notin> B \<or> \<not> A' |\<subseteq>| A \<or> A' = A) \<or> (\<exists>A'. A' |\<subseteq>| A \<and> A' \<in> min_set B)

goal (1 subgoal):
 1. \<And>A. \<lbrakk>\<And>Aa. \<lbrakk>fcard Aa < fcard A; Aa \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| Aa \<and> C \<in> min_set B; A \<in> B\<rbrakk> \<Longrightarrow> \<exists>C. C |\<subseteq>| A \<and> C \<in> min_set B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>A'. A' \<notin> B \<or> \<not> A' |\<subseteq>| A \<or> A' = A) \<or> (\<exists>A'. A' |\<subseteq>| A \<and> A' \<in> min_set B)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<forall>A'. A' \<notin> B \<or> \<not> A' |\<subseteq>| A \<or> A' = A) \<or> (\<exists>A'. A' |\<subseteq>| A \<and> A' \<in> min_set B)

goal (1 subgoal):
 1. \<exists>C. C |\<subseteq>| A \<and> C \<in> min_set B
[PROOF STEP]
using less.prems min_set_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>A'. A' \<notin> B \<or> \<not> A' |\<subseteq>| A \<or> A' = A) \<or> (\<exists>A'. A' |\<subseteq>| A \<and> A' \<in> min_set B)
A \<in> B
min_set ?X = {y \<in> ?X. \<forall>x\<in>?X. x \<le> y \<longrightarrow> x = y}

goal (1 subgoal):
 1. \<exists>C. C |\<subseteq>| A \<and> C \<in> min_set B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>C. C |\<subseteq>| A \<and> C \<in> min_set B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rcis_mult_cis[simp]: "rcis n a * cis b = rcis n (a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis n a * cis b = rcis n (a + b)
[PROOF STEP]
unfolding cis_rcis_eq rcis_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis (n * 1) (a + b) = rcis n (a + b)
[PROOF STEP]
by simp


[STATEMENT]
lemma RPDs_code[code]: "RPDs r = RPDs_aux {r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RPDs r = RPDs_aux {r}
[PROOF STEP]
unfolding RPDs_aux_def RPDs_code
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. saturate (\<lambda>S. insert r S \<union> (insert r S \<bind> RPD)) {} = saturate (\<lambda>S. S \<union> \<Union> (RPD ` S)) {r}
[PROOF STEP]
by (rule saturate_commute[where C="RPDs r"])
     (auto 0 3 simp: mono_def subset_singleton_iff RPDs_refl RPDs_trans finite_RPDs)


[STATEMENT]
lemma finite_fun_graph:
  "finite A \<Longrightarrow> finite (fun_graph f \<inter> (A \<times> UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> finite (fun_graph f \<inter> A \<times> UNIV)
[PROOF STEP]
apply(rule bij_betw_finite[where A=A and f="\<lambda>x. (x, f x)", THEN iffD1])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite A \<Longrightarrow> bij_betw (\<lambda>x. (x, f x)) A (fun_graph f \<inter> A \<times> UNIV)
 2. finite A \<Longrightarrow> finite A
[PROOF STEP]
by(auto simp add: fun_graph_def bij_betw_def inj_on_def)


[STATEMENT]
lemma lset_llist_of [simp]: "lset (llist_of xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lset (llist_of xs) = set xs
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma le_err_antisym [rule_format]:
  "order r \<Longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e2 \<longrightarrow> e2 \<sqsubseteq>\<^bsub>le r\<^esub> e1 \<longrightarrow> e1=e2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e2 \<longrightarrow> e2 \<sqsubseteq>\<^bsub>le r\<^esub> e1 \<longrightarrow> e1 = e2
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> e1 \<sqsubseteq>\<^bsub>le r\<^esub> e2 \<longrightarrow> e2 \<sqsubseteq>\<^bsub>le r\<^esub> e1 \<longrightarrow> e1 = e2
[PROOF STEP]
apply (unfold unfold_lesub_err le_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> (case e2 of Err \<Rightarrow> True | OK y \<Rightarrow> case e1 of Err \<Rightarrow> False | OK x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y) \<longrightarrow> (case e1 of Err \<Rightarrow> True | OK y \<Rightarrow> case e2 of Err \<Rightarrow> False | OK x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y) \<longrightarrow> e1 = e2
[PROOF STEP]
apply (simp split: err.split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order r \<Longrightarrow> \<forall>x2. e1 = OK x2 \<longrightarrow> (\<forall>x2a. e2 = OK x2a \<longrightarrow> x2 \<sqsubseteq>\<^bsub>r\<^esub> x2a \<longrightarrow> x2a \<sqsubseteq>\<^bsub>r\<^esub> x2 \<longrightarrow> x2 = x2a)
[PROOF STEP]
apply (blast intro: order_antisym)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prod_list_nonneg:
  fixes xs :: "('a :: {ordered_semiring_0,linordered_nonzero_semiring}) list"
  assumes "\<And>x. x \<in> set xs \<Longrightarrow> x \<ge> 0"
  shows "prod_list xs \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> prod_list xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> set xs \<Longrightarrow> (0::'a) \<le> ?x

goal (1 subgoal):
 1. (0::'a) \<le> prod_list xs
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma Reals_in_Complexs: "\<real> \<subseteq> \<complex>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<real> \<subseteq> \<complex>
[PROOF STEP]
unfolding Reals_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range of_real \<subseteq> \<complex>
[PROOF STEP]
by auto


[STATEMENT]
lemma nn_integral_indicator_singleton[simp]:
  assumes [measurable]: "{y} \<in> sets M" shows "(\<integral>\<^sup>+x. f x * indicator {y} x \<partial>M) = f y * emeasure M {y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = f y * emeasure M {y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = f y * emeasure M {y}
[PROOF STEP]
have "(\<integral>\<^sup>+x. f x * indicator {y} x \<partial>M) = (\<integral>\<^sup>+x. f y * indicator {y} x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = \<integral>\<^sup>+ x. f y * indicator {y} x \<partial>M
[PROOF STEP]
by (auto intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = \<integral>\<^sup>+ x. f y * indicator {y} x \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = f y * emeasure M {y}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = \<integral>\<^sup>+ x. f y * indicator {y} x \<partial>M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = \<integral>\<^sup>+ x. f y * indicator {y} x \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = f y * emeasure M {y}
[PROOF STEP]
by (simp add: nn_integral_cmult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f x * indicator {y} x \<partial>M = f y * emeasure M {y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simp_Plus_simps[simp]:
  "simp_Plus p1 p2 = (if (fst p1 = Zero) then (fst p2, F_RIGHT (snd p2))
                    else (if (fst p2 = Zero) then (fst p1, F_LEFT (snd p1))
                    else (Plus (fst p1) (fst p2), F_Plus (snd p1) (snd p2))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simp_Plus p1 p2 = (if fst p1 = Zero then (fst p2, F_RIGHT (snd p2)) else if fst p2 = Zero then (fst p1, F_LEFT (snd p1)) else (Plus (fst p1) (fst p2), F_Plus (snd p1) (snd p2)))
[PROOF STEP]
by (induct p1 p2 rule: simp_Plus.induct) (auto)


[STATEMENT]
lemma subst_cls_lists_length[simp]: "length (Cs \<cdot>\<cdot>cl \<sigma>s) = min (length Cs) (length \<sigma>s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (Cs \<cdot>\<cdot>cl \<sigma>s) = min (length Cs) (length \<sigma>s)
[PROOF STEP]
unfolding subst_cls_lists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (Map2.map2 (\<cdot>) Cs \<sigma>s) = min (length Cs) (length \<sigma>s)
[PROOF STEP]
by auto


[STATEMENT]
lemma ex_xi:
  assumes "vectorspace F"
  assumes r: "\<And>u v. u \<in> F \<Longrightarrow> v \<in> F \<Longrightarrow> a u \<le> b v"
  shows "\<exists>xi::real. \<forall>y \<in> F. a y \<le> xi \<and> xi \<le> b y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
interpret vectorspace F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace F
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
txt \<open>From the completeness of the reals follows:
    The set \<open>S = {a u. u \<in> F}\<close> has a supremum, if it is
    non-empty and has an upper bound.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
let ?S = "{a u | u. u \<in> F}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
have "\<exists>xi. lub ?S xi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xi. lub {a u |u. u \<in> F} xi
[PROOF STEP]
proof (rule real_complete)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>aa. aa \<in> {a u |u. u \<in> F}
 2. \<exists>y. \<forall>a\<in>{a u |u. u \<in> F}. a \<le> y
[PROOF STEP]
have "a 0 \<in> ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a (0::'a) \<in> {a u |u. u \<in> F}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a (0::'a) \<in> {a u |u. u \<in> F}

goal (2 subgoals):
 1. \<exists>aa. aa \<in> {a u |u. u \<in> F}
 2. \<exists>y. \<forall>a\<in>{a u |u. u \<in> F}. a \<le> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a (0::'a) \<in> {a u |u. u \<in> F}
[PROOF STEP]
show "\<exists>X. X \<in> ?S"
[PROOF STATE]
proof (prove)
using this:
a (0::'a) \<in> {a u |u. u \<in> F}

goal (1 subgoal):
 1. \<exists>X. X \<in> {a u |u. u \<in> F}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>X. X \<in> {a u |u. u \<in> F}

goal (1 subgoal):
 1. \<exists>y. \<forall>a\<in>{a u |u. u \<in> F}. a \<le> y
[PROOF STEP]
have "\<forall>y \<in> ?S. y \<le> b 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>{a u |u. u \<in> F}. y \<le> b (0::'a)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> {a u |u. u \<in> F} \<Longrightarrow> y \<le> b (0::'a)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> {a u |u. u \<in> F} \<Longrightarrow> y \<le> b (0::'a)
[PROOF STEP]
assume y: "y \<in> ?S"
[PROOF STATE]
proof (state)
this:
y \<in> {a u |u. u \<in> F}

goal (1 subgoal):
 1. \<And>y. y \<in> {a u |u. u \<in> F} \<Longrightarrow> y \<le> b (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> {a u |u. u \<in> F}
[PROOF STEP]
obtain u where u: "u \<in> F" and y: "y = a u"
[PROOF STATE]
proof (prove)
using this:
y \<in> {a u |u. u \<in> F}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>u \<in> F; y = a u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u \<in> F
y = a u

goal (1 subgoal):
 1. \<And>y. y \<in> {a u |u. u \<in> F} \<Longrightarrow> y \<le> b (0::'a)
[PROOF STEP]
from u and zero
[PROOF STATE]
proof (chain)
picking this:
u \<in> F
(0::'a) \<in> F
[PROOF STEP]
have "a u \<le> b 0"
[PROOF STATE]
proof (prove)
using this:
u \<in> F
(0::'a) \<in> F

goal (1 subgoal):
 1. a u \<le> b (0::'a)
[PROOF STEP]
by (rule r)
[PROOF STATE]
proof (state)
this:
a u \<le> b (0::'a)

goal (1 subgoal):
 1. \<And>y. y \<in> {a u |u. u \<in> F} \<Longrightarrow> y \<le> b (0::'a)
[PROOF STEP]
with y
[PROOF STATE]
proof (chain)
picking this:
y = a u
a u \<le> b (0::'a)
[PROOF STEP]
show "y \<le> b 0"
[PROOF STATE]
proof (prove)
using this:
y = a u
a u \<le> b (0::'a)

goal (1 subgoal):
 1. y \<le> b (0::'a)
[PROOF STEP]
by (simp only:)
[PROOF STATE]
proof (state)
this:
y \<le> b (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>{a u |u. u \<in> F}. y \<le> b (0::'a)

goal (1 subgoal):
 1. \<exists>y. \<forall>a\<in>{a u |u. u \<in> F}. a \<le> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<in>{a u |u. u \<in> F}. y \<le> b (0::'a)
[PROOF STEP]
show "\<exists>u. \<forall>y \<in> ?S. y \<le> u"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>{a u |u. u \<in> F}. y \<le> b (0::'a)

goal (1 subgoal):
 1. \<exists>u. \<forall>y\<in>{a u |u. u \<in> F}. y \<le> u
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>u. \<forall>y\<in>{a u |u. u \<in> F}. y \<le> u

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>xi. lub {a u |u. u \<in> F} xi

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>xi. lub {a u |u. u \<in> F} xi
[PROOF STEP]
obtain xi where xi: "lub ?S xi"
[PROOF STATE]
proof (prove)
using this:
\<exists>xi. lub {a u |u. u \<in> F} xi

goal (1 subgoal):
 1. (\<And>xi. lub {a u |u. u \<in> F} xi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
lub {a u |u. u \<in> F} xi

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
lub {a u |u. u \<in> F} xi

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
assume "y \<in> F"
[PROOF STATE]
proof (state)
this:
y \<in> F

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> F
[PROOF STEP]
have "a y \<in> ?S"
[PROOF STATE]
proof (prove)
using this:
y \<in> F

goal (1 subgoal):
 1. a y \<in> {a u |u. u \<in> F}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a y \<in> {a u |u. u \<in> F}

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
with xi
[PROOF STATE]
proof (chain)
picking this:
lub {a u |u. u \<in> F} xi
a y \<in> {a u |u. u \<in> F}
[PROOF STEP]
have "a y \<le> xi"
[PROOF STATE]
proof (prove)
using this:
lub {a u |u. u \<in> F} xi
a y \<in> {a u |u. u \<in> F}

goal (1 subgoal):
 1. a y \<le> xi
[PROOF STEP]
by (rule lub.upper)
[PROOF STATE]
proof (state)
this:
a y \<le> xi

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?y2 \<in> F \<Longrightarrow> a ?y2 \<le> xi

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?y2 \<in> F \<Longrightarrow> a ?y2 \<le> xi

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?y2 \<in> F \<Longrightarrow> a ?y2 \<le> xi

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
assume y: "y \<in> F"
[PROOF STATE]
proof (state)
this:
y \<in> F

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
from xi
[PROOF STATE]
proof (chain)
picking this:
lub {a u |u. u \<in> F} xi
[PROOF STEP]
have "xi \<le> b y"
[PROOF STATE]
proof (prove)
using this:
lub {a u |u. u \<in> F} xi

goal (1 subgoal):
 1. xi \<le> b y
[PROOF STEP]
proof (rule lub.least)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa. aa \<in> {a u |u. u \<in> F} \<Longrightarrow> aa \<le> b y
[PROOF STEP]
fix au
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa. aa \<in> {a u |u. u \<in> F} \<Longrightarrow> aa \<le> b y
[PROOF STEP]
assume "au \<in> ?S"
[PROOF STATE]
proof (state)
this:
au \<in> {a u |u. u \<in> F}

goal (1 subgoal):
 1. \<And>aa. aa \<in> {a u |u. u \<in> F} \<Longrightarrow> aa \<le> b y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
au \<in> {a u |u. u \<in> F}
[PROOF STEP]
obtain u where u: "u \<in> F" and au: "au = a u"
[PROOF STATE]
proof (prove)
using this:
au \<in> {a u |u. u \<in> F}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>u \<in> F; au = a u\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u \<in> F
au = a u

goal (1 subgoal):
 1. \<And>aa. aa \<in> {a u |u. u \<in> F} \<Longrightarrow> aa \<le> b y
[PROOF STEP]
from u y
[PROOF STATE]
proof (chain)
picking this:
u \<in> F
y \<in> F
[PROOF STEP]
have "a u \<le> b y"
[PROOF STATE]
proof (prove)
using this:
u \<in> F
y \<in> F

goal (1 subgoal):
 1. a u \<le> b y
[PROOF STEP]
by (rule r)
[PROOF STATE]
proof (state)
this:
a u \<le> b y

goal (1 subgoal):
 1. \<And>aa. aa \<in> {a u |u. u \<in> F} \<Longrightarrow> aa \<le> b y
[PROOF STEP]
with au
[PROOF STATE]
proof (chain)
picking this:
au = a u
a u \<le> b y
[PROOF STEP]
show "au \<le> b y"
[PROOF STATE]
proof (prove)
using this:
au = a u
a u \<le> b y

goal (1 subgoal):
 1. au \<le> b y
[PROOF STEP]
by (simp only:)
[PROOF STATE]
proof (state)
this:
au \<le> b y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
xi \<le> b y

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?y2 \<in> F \<Longrightarrow> xi \<le> b ?y2

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?y2 \<in> F \<Longrightarrow> a ?y2 \<le> xi
?y2 \<in> F \<Longrightarrow> xi \<le> b ?y2
[PROOF STEP]
show "\<exists>xi. \<forall>y \<in> F. a y \<le> xi \<and> xi \<le> b y"
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> F \<Longrightarrow> a ?y2 \<le> xi
?y2 \<in> F \<Longrightarrow> xi \<le> b ?y2

goal (1 subgoal):
 1. \<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>xi. \<forall>y\<in>F. a y \<le> xi \<and> xi \<le> b y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma properfactorE2:
  fixes G (structure)
  assumes pf: "properfactor G a b"
    and elim: "\<lbrakk>a divides b; \<not>(a \<sim> b)\<rbrakk> \<Longrightarrow> P"
  shows "P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P
[PROOF STEP]
using pf
[PROOF STATE]
proof (prove)
using this:
properfactor G a b

goal (1 subgoal):
 1. P
[PROOF STEP]
unfolding properfactor_def
[PROOF STATE]
proof (prove)
using this:
a divides b \<and> \<not> b divides a

goal (1 subgoal):
 1. P
[PROOF STEP]
by (fast elim: elim associatedE)


[STATEMENT]
lemma oalist_inv_raw_ConsD3:
  assumes "oalist_inv_raw ((k, v) # xs)" and "k' \<in> fst ` set xs"
  shows "lt k k'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lt k k'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lt k k'
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
k' \<in> fst ` set xs
[PROOF STEP]
obtain x where "x \<in> set xs" and "k' = fst x"
[PROOF STATE]
proof (prove)
using this:
k' \<in> fst ` set xs

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> set xs; k' = fst x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<in> set xs
k' = fst x

goal (1 subgoal):
 1. lt k k'
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
oalist_inv_raw ((k, v) # xs)
[PROOF STEP]
have "sorted_wrt lt (map fst ((k, v) # xs))"
[PROOF STATE]
proof (prove)
using this:
oalist_inv_raw ((k, v) # xs)

goal (1 subgoal):
 1. sorted_wrt lt (map fst ((k, v) # xs))
[PROOF STEP]
by (rule oalist_inv_rawD2)
[PROOF STATE]
proof (state)
this:
sorted_wrt lt (map fst ((k, v) # xs))

goal (1 subgoal):
 1. lt k k'
[PROOF STEP]
hence "\<forall>x\<in>set xs. lt k (fst x)"
[PROOF STATE]
proof (prove)
using this:
sorted_wrt lt (map fst ((k, v) # xs))

goal (1 subgoal):
 1. \<forall>x\<in>set xs. lt k (fst x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>set xs. lt k (fst x)

goal (1 subgoal):
 1. lt k k'
[PROOF STEP]
hence "lt k (fst x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set xs. lt k (fst x)

goal (1 subgoal):
 1. lt k (fst x)
[PROOF STEP]
using \<open>x \<in> set xs\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set xs. lt k (fst x)
x \<in> set xs

goal (1 subgoal):
 1. lt k (fst x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
lt k (fst x)

goal (1 subgoal):
 1. lt k k'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
lt k (fst x)

goal (1 subgoal):
 1. lt k k'
[PROOF STEP]
by (simp only: \<open>k' = fst x\<close>)
[PROOF STATE]
proof (state)
this:
lt k k'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_sum_superconst_infinite_ennreal:
  fixes f :: \<open>'a \<Rightarrow> ennreal\<close>
  assumes geqb: \<open>\<And>x. x \<in> S \<Longrightarrow> f x \<ge> b\<close>
  assumes b: \<open>b > 0\<close>
  assumes \<open>infinite S\<close>
  shows "has_sum f S \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum f S \<infinity>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. has_sum f S \<infinity>
[PROOF STEP]
have \<open>(sum f \<longlongrightarrow> \<infinity>) (finite_subsets_at_top S)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum f \<longlongrightarrow> \<infinity>) (finite_subsets_at_top S)
[PROOF STEP]
proof (rule order_tendstoI[rotated], simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. a < \<infinity> \<Longrightarrow> \<forall>\<^sub>F x in finite_subsets_at_top S. a < sum f x
[PROOF STEP]
fix y :: ennreal
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. a < \<infinity> \<Longrightarrow> \<forall>\<^sub>F x in finite_subsets_at_top S. a < sum f x
[PROOF STEP]
assume \<open>y < \<infinity>\<close>
[PROOF STATE]
proof (state)
this:
y < \<infinity>

goal (1 subgoal):
 1. \<And>a. a < \<infinity> \<Longrightarrow> \<forall>\<^sub>F x in finite_subsets_at_top S. a < sum f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y < \<infinity>
[PROOF STEP]
have \<open>y / b < \<infinity>\<close>
[PROOF STATE]
proof (prove)
using this:
y < \<infinity>

goal (1 subgoal):
 1. y / b < \<infinity>
[PROOF STEP]
by (metis b ennreal_divide_eq_top_iff gr_implies_not_zero infinity_ennreal_def top.not_eq_extremum)
[PROOF STATE]
proof (state)
this:
y / b < \<infinity>

goal (1 subgoal):
 1. \<And>a. a < \<infinity> \<Longrightarrow> \<forall>\<^sub>F x in finite_subsets_at_top S. a < sum f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y / b < \<infinity>
[PROOF STEP]
obtain F where \<open>finite F\<close> and \<open>F \<subseteq> S\<close> and cardF: \<open>card F > y / b\<close>
[PROOF STATE]
proof (prove)
using this:
y / b < \<infinity>

goal (1 subgoal):
 1. (\<And>F. \<lbrakk>finite F; F \<subseteq> S; y / b < of_nat (card F)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>infinite S\<close>
[PROOF STATE]
proof (prove)
using this:
y / b < \<infinity>
infinite S

goal (1 subgoal):
 1. (\<And>F. \<lbrakk>finite F; F \<subseteq> S; y / b < of_nat (card F)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis ennreal_Ex_less_of_nat infinite_arbitrarily_large infinity_ennreal_def)
[PROOF STATE]
proof (state)
this:
finite F
F \<subseteq> S
y / b < of_nat (card F)

goal (1 subgoal):
 1. \<And>a. a < \<infinity> \<Longrightarrow> \<forall>\<^sub>F x in finite_subsets_at_top S. a < sum f x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite F
F \<subseteq> S
y / b < of_nat (card F)

goal (1 subgoal):
 1. \<And>a. a < \<infinity> \<Longrightarrow> \<forall>\<^sub>F x in finite_subsets_at_top S. a < sum f x
[PROOF STEP]
have \<open>sum f Y > y\<close> if \<open>finite Y\<close> and \<open>F \<subseteq> Y\<close> and \<open>Y \<subseteq> S\<close> for Y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
have \<open>y < b * card F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < b * of_nat (card F)
[PROOF STEP]
by (metis \<open>y < \<infinity>\<close> b cardF divide_less_ennreal ennreal_mult_eq_top_iff gr_implies_not_zero infinity_ennreal_def mult.commute top.not_eq_extremum)
[PROOF STATE]
proof (state)
this:
y < b * of_nat (card F)

goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y < b * of_nat (card F)

goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
have \<open>\<dots> \<le> b * card Y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * of_nat (card F) \<le> b * of_nat (card Y)
[PROOF STEP]
by (meson b card_mono less_imp_le mult_left_mono of_nat_le_iff that(1) that(2))
[PROOF STATE]
proof (state)
this:
b * of_nat (card F) \<le> b * of_nat (card Y)

goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b * of_nat (card F) \<le> b * of_nat (card Y)

goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
have \<open>\<dots> = sum (\<lambda>_. b) Y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * of_nat (card Y) = (\<Sum>_\<in>Y. b)
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
b * of_nat (card Y) = (\<Sum>_\<in>Y. b)

goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b * of_nat (card Y) = (\<Sum>_\<in>Y. b)

goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
have \<open>\<dots> \<le> sum f Y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>_\<in>Y. b) \<le> sum f Y
[PROOF STEP]
using geqb
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> b \<le> f ?x

goal (1 subgoal):
 1. (\<Sum>_\<in>Y. b) \<le> sum f Y
[PROOF STEP]
by (meson subset_eq sum_mono that(3))
[PROOF STATE]
proof (state)
this:
(\<Sum>_\<in>Y. b) \<le> sum f Y

goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
y < sum f Y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y < sum f Y

goal (1 subgoal):
 1. y < sum f Y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
y < sum f Y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite ?Y; F \<subseteq> ?Y; ?Y \<subseteq> S\<rbrakk> \<Longrightarrow> y < sum f ?Y

goal (1 subgoal):
 1. \<And>a. a < \<infinity> \<Longrightarrow> \<forall>\<^sub>F x in finite_subsets_at_top S. a < sum f x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite F
F \<subseteq> S
y / b < of_nat (card F)
\<lbrakk>finite ?Y; F \<subseteq> ?Y; ?Y \<subseteq> S\<rbrakk> \<Longrightarrow> y < sum f ?Y
[PROOF STEP]
show \<open>\<forall>\<^sub>F x in finite_subsets_at_top S. y < sum f x\<close>
[PROOF STATE]
proof (prove)
using this:
finite F
F \<subseteq> S
y / b < of_nat (card F)
\<lbrakk>finite ?Y; F \<subseteq> ?Y; ?Y \<subseteq> S\<rbrakk> \<Longrightarrow> y < sum f ?Y

goal (1 subgoal):
 1. \<forall>\<^sub>F x in finite_subsets_at_top S. y < sum f x
[PROOF STEP]
unfolding eventually_finite_subsets_at_top
[PROOF STATE]
proof (prove)
using this:
finite F
F \<subseteq> S
y / b < of_nat (card F)
\<lbrakk>finite ?Y; F \<subseteq> ?Y; ?Y \<subseteq> S\<rbrakk> \<Longrightarrow> y < sum f ?Y

goal (1 subgoal):
 1. \<exists>X. finite X \<and> X \<subseteq> S \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> S \<longrightarrow> y < sum f Y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in finite_subsets_at_top S. y < sum f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(sum f \<longlongrightarrow> \<infinity>) (finite_subsets_at_top S)

goal (1 subgoal):
 1. has_sum f S \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(sum f \<longlongrightarrow> \<infinity>) (finite_subsets_at_top S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sum f \<longlongrightarrow> \<infinity>) (finite_subsets_at_top S)

goal (1 subgoal):
 1. has_sum f S \<infinity>
[PROOF STEP]
by (simp add: has_sum_def)
[PROOF STATE]
proof (state)
this:
has_sum f S \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_nonneg_ident_at_within [eventually_nonzero_simps]:
  fixes a :: "'a :: {linorder_topology, linordered_field}"
  shows "a > 0 \<Longrightarrow> eventually_nonneg (at a within A) (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < a \<Longrightarrow> eventually_nonneg (at a within A) (\<lambda>x. x)
[PROOF STEP]
using eventually_nonneg_ident_nhds[of a]
[PROOF STATE]
proof (prove)
using this:
(0::'a) < a \<Longrightarrow> eventually_nonneg (nhds a) (\<lambda>x. x)

goal (1 subgoal):
 1. (0::'a) < a \<Longrightarrow> eventually_nonneg (at a within A) (\<lambda>x. x)
[PROOF STEP]
by (auto simp: eventually_nonneg_def eventually_at_filter elim: eventually_mono)


[STATEMENT]
lemma prime_mod_4_cases:
  fixes p :: nat
  assumes "prime p"
  shows   "p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
proof (cases "p = 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 2

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
with prime_gt_1_nat[of p] assms
[PROOF STATE]
proof (chain)
picking this:
prime p \<Longrightarrow> 1 < p
prime p
p \<noteq> 2
[PROOF STEP]
have "p > 2"
[PROOF STATE]
proof (prove)
using this:
prime p \<Longrightarrow> 1 < p
prime p
p \<noteq> 2

goal (1 subgoal):
 1. 2 < p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 < p

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
have "\<not>4 dvd p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 4 dvd p
[PROOF STEP]
using assms product_dvd_irreducibleD[of p 2 2]
[PROOF STATE]
proof (prove)
using this:
prime p
\<lbrakk>irreducible p; 2 * 2 dvd p\<rbrakk> \<Longrightarrow> is_unit 2 \<or> is_unit 2

goal (1 subgoal):
 1. \<not> 4 dvd p
[PROOF STEP]
by (auto simp: prime_elem_iff_irreducible simp flip: prime_elem_nat_iff)
[PROOF STATE]
proof (state)
this:
\<not> 4 dvd p

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
hence "p mod 4 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 4 dvd p

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

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p mod 4 \<noteq> 0

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
have "p mod 4 \<noteq> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p mod 4 \<noteq> 2
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p mod 4 = 2 \<Longrightarrow> False
[PROOF STEP]
assume "p mod 4 = 2"
[PROOF STATE]
proof (state)
this:
p mod 4 = 2

goal (1 subgoal):
 1. p mod 4 = 2 \<Longrightarrow> False
[PROOF STEP]
hence "p mod 4 mod 2 = 0"
[PROOF STATE]
proof (prove)
using this:
p mod 4 = 2

goal (1 subgoal):
 1. p mod 4 mod 2 = 0
[PROOF STEP]
by (simp add: cong_def)
[PROOF STATE]
proof (state)
this:
p mod 4 mod 2 = 0

goal (1 subgoal):
 1. p mod 4 = 2 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
p mod 4 mod 2 = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>prime p\<close> \<open>p > 2\<close> prime_odd_nat[of p]
[PROOF STATE]
proof (prove)
using this:
p mod 4 mod 2 = 0
prime p
2 < p
\<lbrakk>prime p; 2 < p\<rbrakk> \<Longrightarrow> odd p

goal (1 subgoal):
 1. False
[PROOF STEP]
by (auto simp: mod_mod_cancel)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p mod 4 \<noteq> 2

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p mod 4 \<noteq> 2

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
have "p mod 4 \<in> {0,1,2,3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p mod 4 \<in> {0, 1, 2, 3}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p mod 4 \<in> {0, 1, 2, 3}

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
 2. p \<noteq> 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p mod 4 \<noteq> 0
p mod 4 \<noteq> 2
p mod 4 \<in> {0, 1, 2, 3}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p mod 4 \<noteq> 0
p mod 4 \<noteq> 2
p mod 4 \<in> {0, 1, 2, 3}

goal (1 subgoal):
 1. p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
by (auto simp: cong_def)
[PROOF STATE]
proof (state)
this:
p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)

goal (1 subgoal):
 1. p = 2 \<Longrightarrow> p = 2 \<or> [p = 1] (mod 4) \<or> [p = 3] (mod 4)
[PROOF STEP]
qed auto


[STATEMENT]
lemma fds_abs_converges_altdef':
  "fds_abs_converges f s \<longleftrightarrow> (\<lambda>n. fds_nth f n / nat_power n s) abs_summable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges f s = ((\<lambda>n. fds_nth f n / nat_power n s) abs_summable_on UNIV)
[PROOF STEP]
by (subst fds_abs_converges_altdef, rule abs_summable_on_cong_neutral) (auto simp: Suc_le_eq)


[STATEMENT]
lemma smcf_cn_comp_ObjMap_vdomain[smc_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>S\<^sub>M\<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<^sub>S\<^sub>M\<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>
[PROOF STEP]
interpret L: is_semifunctor \<alpha> \<open>op_smc \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_smc \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>
[PROOF STEP]
interpret R: is_semifunctor \<alpha> \<open>op_smc \<AA>\<close> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : op_smc \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>
[PROOF STEP]
by
      (
        rule dghm_cn_comp_ObjMap_vdomain
          [
            OF
              L.smcf_is_dghm[unfolded slicing_commute[symmetric]]
              R.smcf_is_dghm[unfolded slicing_commute[symmetric]],
            unfolded slicing_commute slicing_simps
          ]
      )
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> ((\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>) = \<AA>\<lparr>Obj\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_le:
  "\<lbrakk>finite S ; \<forall> r\<in>S. f r <= b \<rbrakk>
  \<Longrightarrow>
  (\<Sum>l\<in>S. f l) <= real (card S) * b"
  (is "\<lbrakk> finite S ; \<forall> r\<in>S. f r <= b \<rbrakk> \<Longrightarrow> ?P S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; \<forall>r\<in>S. f r \<le> b\<rbrakk> \<Longrightarrow> sum f S \<le> real (card S) * b
[PROOF STEP]
proof(induct S rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>r\<in>{}. f r \<le> b \<Longrightarrow> sum f {} \<le> real (card {}) * b
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
show "?P {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {} \<le> real (card {}) * b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {} \<le> real (card {}) * b

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
fix F x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
assume  finit: "finite F" and xnotinF: "x \<notin> F" and
          HI1: "\<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b"
          and HI2: "\<forall>r\<in>insert x F. f r \<le> b"
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b
\<forall>r\<in>insert x F. f r \<le> b

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
from HI1 HI2 and finit and xnotinF
[PROOF STATE]
proof (chain)
picking this:
\<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b
\<forall>r\<in>insert x F. f r \<le> b
finite F
x \<notin> F
[PROOF STEP]
have "sum f (insert x F) <= b + real (card F) * b"
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b
\<forall>r\<in>insert x F. f r \<le> b
finite F
x \<notin> F

goal (1 subgoal):
 1. sum f (insert x F) \<le> b + real (card F) * b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f (insert x F) \<le> b + real (card F) * b

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f (insert x F) \<le> b + real (card F) * b

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
have "... = real (Suc (card  F)) * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b + real (card F) * b = real (Suc (card F)) * b
[PROOF STEP]
by (simp add: distrib_right  of_nat_Suc)
[PROOF STATE]
proof (state)
this:
b + real (card F) * b = real (Suc (card F)) * b

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b + real (card F) * b = real (Suc (card F)) * b

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
from   finit xnotinF
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
[PROOF STEP]
have "...= real (card (insert x F)) * b"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F

goal (1 subgoal):
 1. real (Suc (card F)) * b = real (card (insert x F)) * b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (Suc (card F)) * b = real (card (insert x F)) * b

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>r\<in>F. f r \<le> b \<Longrightarrow> sum f F \<le> real (card F) * b; \<forall>r\<in>insert x F. f r \<le> b\<rbrakk> \<Longrightarrow> sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
show "?P (insert x F)"
[PROOF STATE]
proof (prove)
using this:
sum f (insert x F) \<le> real (card (insert x F)) * b

goal (1 subgoal):
 1. sum f (insert x F) \<le> real (card (insert x F)) * b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f (insert x F) \<le> real (card (insert x F)) * b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma extract_matrix_cong:
assumes "\<And>i. i < m * n \<Longrightarrow> a i = b i"
shows "extract_matrix a m n = extract_matrix b m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_matrix a m n = extract_matrix b m n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. extract_matrix a m n = extract_matrix b m n
[PROOF STEP]
have "\<And>i j. i < m \<Longrightarrow> j < n \<Longrightarrow> a (i*n + j) = b (i*n + j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < m; j < n\<rbrakk> \<Longrightarrow> a (i * n + j) = b (i * n + j)
[PROOF STEP]
using two_digit_le assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < ?m; ?j < ?n\<rbrakk> \<Longrightarrow> ?i * ?n + ?j < ?m * ?n
?i < m * n \<Longrightarrow> a ?i = b ?i

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < m; j < n\<rbrakk> \<Longrightarrow> a (i * n + j) = b (i * n + j)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < m; ?j < n\<rbrakk> \<Longrightarrow> a (?i * n + ?j) = b (?i * n + ?j)

goal (1 subgoal):
 1. extract_matrix a m n = extract_matrix b m n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i < m; ?j < n\<rbrakk> \<Longrightarrow> a (?i * n + ?j) = b (?i * n + ?j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < m; ?j < n\<rbrakk> \<Longrightarrow> a (?i * n + ?j) = b (?i * n + ?j)

goal (1 subgoal):
 1. extract_matrix a m n = extract_matrix b m n
[PROOF STEP]
unfolding extract_matrix_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < m; ?j < n\<rbrakk> \<Longrightarrow> a (?i * n + ?j) = b (?i * n + ?j)

goal (1 subgoal):
 1. mat m n (\<lambda>(i, j). a (i * n + j)) = mat m n (\<lambda>(i, j). b (i * n + j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
extract_matrix a m n = extract_matrix b m n

goal:
No subgoals!
[PROOF STEP]
qed