[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 fls_shift_eq0_iff: "fls_shift m f = 0 \<longleftrightarrow> f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fls_shift m f = 0) = (f = 0)
[PROOF STEP]
using fls_shift_eq_iff[of m f 0]
[PROOF STATE]
proof (prove)
using this:
(fls_shift m f = fls_shift m 0) = (f = 0)

goal (1 subgoal):
 1. (fls_shift m f = 0) = (f = 0)
[PROOF STEP]
by simp


[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 right_zero_vec[simp]: "(v :: 'a :: monoid_add vec) \<in> carrier_vec n  \<Longrightarrow> v + 0\<^sub>v n = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> carrier_vec n \<Longrightarrow> v + 0\<^sub>v n = v
[PROOF STEP]
by auto


[STATEMENT]
lemma inj_list_encode: "inj_on list_encode A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on list_encode A
[PROOF STEP]
by (rule inj_on_inverseI) (rule list_encode_inverse)


[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


[STATEMENT]
lemma proots_pcompose:
  fixes p q::"'a::field poly"
  assumes "p\<noteq>0" "degree q=1"
  shows "proots_count (pcompose p q) s = proots_count p (poly q ` s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
obtain a b where ab:"q=[:a,b:]" "b\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>q = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>degree q=1\<close> degree_eq_oneE
[PROOF STATE]
proof (prove)
using this:
degree q = 1
\<lbrakk>degree ?p = 1; \<And>a b. \<lbrakk>?p = [:a, b:]; b \<noteq> (0::?'a)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>q = [:a, b:]; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
q = [:a, b:]
b \<noteq> (0::'a)

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
define f where "f=(\<lambda>y. (y-a)/b)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>y. (y - a) / b)

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
have f_eq:"f (poly q x) = x" "poly q (f x) = x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (poly q x) = x &&& poly q (f x) = x
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly q x - a) / b = x &&& poly q ((x - a) / b) = x
[PROOF STEP]
using ab
[PROOF STATE]
proof (prove)
using this:
q = [:a, b:]
b \<noteq> (0::'a)

goal (1 subgoal):
 1. (poly q x - a) / b = x &&& poly q ((x - a) / b) = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (poly q ?x) = ?x
poly q (f ?x) = ?x

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
have "proots_count (p \<circ>\<^sub>p q) s = (\<Sum>r\<in> f ` proots_within p (poly q ` s). order r (p \<circ>\<^sub>p q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = (\<Sum>r\<in>f ` proots_within p (poly q ` s). order r (p \<circ>\<^sub>p q))
[PROOF STEP]
unfolding proots_count_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r\<in>proots_within (p \<circ>\<^sub>p q) s. order r (p \<circ>\<^sub>p q)) = (\<Sum>r\<in>f ` proots_within p (poly q ` s). order r (p \<circ>\<^sub>p q))
[PROOF STEP]
apply (rule arg_cong2[where f =sum])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>r. order r (p \<circ>\<^sub>p q)) = (\<lambda>r. order r (p \<circ>\<^sub>p q))
 2. proots_within (p \<circ>\<^sub>p q) s = f ` proots_within p (poly q ` s)
[PROOF STEP]
apply (auto simp:poly_pcompose proots_within_def f_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> s; poly p (poly q x) = (0::'a)\<rbrakk> \<Longrightarrow> x \<in> f ` {x \<in> poly q ` s. poly p x = (0::'a)}
[PROOF STEP]
by (metis (mono_tags, lifting) f_eq(1) image_eqI mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
proots_count (p \<circ>\<^sub>p q) s = (\<Sum>r\<in>f ` proots_within p (poly q ` s). order r (p \<circ>\<^sub>p q))

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
proots_count (p \<circ>\<^sub>p q) s = (\<Sum>r\<in>f ` proots_within p (poly q ` s). order r (p \<circ>\<^sub>p q))

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
have "... = (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r\<in>f ` proots_within p (poly q ` s). order r (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q))
[PROOF STEP]
apply (subst sum.reindex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on f (proots_within p (poly q ` s))
 2. sum ((\<lambda>r. order r (p \<circ>\<^sub>p q)) \<circ> f) (proots_within p (poly q ` s)) = (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (proots_within p (poly q ` s))
[PROOF STEP]
unfolding f_def inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>proots_within p (poly q ` s). \<forall>y\<in>proots_within p (poly q ` s). (x - a) / b = (y - a) / b \<longrightarrow> x = y
[PROOF STEP]
using \<open>b\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)

goal (1 subgoal):
 1. \<forall>x\<in>proots_within p (poly q ` s). \<forall>y\<in>proots_within p (poly q ` s). (x - a) / b = (y - a) / b \<longrightarrow> x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((\<lambda>r. order r (p \<circ>\<^sub>p q)) \<circ> f) (proots_within p (poly q ` s)) = (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>r\<in>f ` proots_within p (poly q ` s). order r (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q))

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r\<in>f ` proots_within p (poly q ` s). order r (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q))

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
have "... = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)
[PROOF STEP]
have "p \<circ>\<^sub>p q \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<circ>\<^sub>p q \<noteq> 0
[PROOF STEP]
using assms(1) assms(2) pcompose_eq_0
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
degree q = 1
\<lbrakk>?p \<circ>\<^sub>p ?q = 0; 0 < degree ?q\<rbrakk> \<Longrightarrow> ?p = 0

goal (1 subgoal):
 1. p \<circ>\<^sub>p q \<noteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
p \<circ>\<^sub>p q \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p \<circ>\<^sub>p q \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)
[PROOF STEP]
have "order (f x) (q - [:x:]) = 1" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order (f x) (q - [:x:]) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order (f x) (q - [:x:]) = 1
[PROOF STEP]
have "order (f x) (q - [:x:]) = order (f x) (smult b [:-((x - a) / b),1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order (f x) (q - [:x:]) = order (f x) (smult b [:- ((x - a) / b), 1::'a:])
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order ((x - a) / b) (q - [:x:]) = order ((x - a) / b) (smult b [:- ((x - a) / b), 1::'a:])
[PROOF STEP]
using ab
[PROOF STATE]
proof (prove)
using this:
q = [:a, b:]
b \<noteq> (0::'a)

goal (1 subgoal):
 1. order ((x - a) / b) (q - [:x:]) = order ((x - a) / b) (smult b [:- ((x - a) / b), 1::'a:])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
order (f x) (q - [:x:]) = order (f x) (smult b [:- ((x - a) / b), 1::'a:])

goal (1 subgoal):
 1. order (f x) (q - [:x:]) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
order (f x) (q - [:x:]) = order (f x) (smult b [:- ((x - a) / b), 1::'a:])

goal (1 subgoal):
 1. order (f x) (q - [:x:]) = 1
[PROOF STEP]
have "... = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order (f x) (smult b [:- ((x - a) / b), 1::'a:]) = 1
[PROOF STEP]
apply (subst order_smult)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. b \<noteq> (0::'a)
 2. order (f x) [:- ((x - a) / b), 1::'a:] = 1
[PROOF STEP]
using \<open>b\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)

goal (2 subgoals):
 1. b \<noteq> (0::'a)
 2. order (f x) [:- ((x - a) / b), 1::'a:] = 1
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)

goal (2 subgoals):
 1. b \<noteq> (0::'a)
 2. order ((x - a) / b) [:- ((x - a) / b), 1::'a:] = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
order (f x) (smult b [:- ((x - a) / b), 1::'a:]) = 1

goal (1 subgoal):
 1. order (f x) (q - [:x:]) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
order (f x) (q - [:x:]) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
order (f x) (q - [:x:]) = 1

goal (1 subgoal):
 1. order (f x) (q - [:x:]) = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
order (f x) (q - [:x:]) = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
order (f ?x) (q - [:?x:]) = 1

goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p \<circ>\<^sub>p q \<noteq> 0
order (f ?x) (q - [:?x:]) = 1
[PROOF STEP]
have "order (f x) (p \<circ>\<^sub>p q) = order x p" for x
[PROOF STATE]
proof (prove)
using this:
p \<circ>\<^sub>p q \<noteq> 0
order (f ?x) (q - [:?x:]) = 1

goal (1 subgoal):
 1. order (f x) (p \<circ>\<^sub>p q) = order x p
[PROOF STEP]
apply (subst order_pcompose)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>p \<circ>\<^sub>p q \<noteq> 0; \<And>x. order (f x) (q - [:x:]) = 1\<rbrakk> \<Longrightarrow> p \<circ>\<^sub>p q \<noteq> 0
 2. \<lbrakk>p \<circ>\<^sub>p q \<noteq> 0; \<And>x. order (f x) (q - [:x:]) = 1\<rbrakk> \<Longrightarrow> order (f x) (q - [:poly q (f x):]) * order (poly q (f x)) p = order x p
[PROOF STEP]
using f_eq
[PROOF STATE]
proof (prove)
using this:
f (poly q ?x) = ?x
poly q (f ?x) = ?x

goal (2 subgoals):
 1. \<lbrakk>p \<circ>\<^sub>p q \<noteq> 0; \<And>x. order (f x) (q - [:x:]) = 1\<rbrakk> \<Longrightarrow> p \<circ>\<^sub>p q \<noteq> 0
 2. \<lbrakk>p \<circ>\<^sub>p q \<noteq> 0; \<And>x. order (f x) (q - [:x:]) = 1\<rbrakk> \<Longrightarrow> order (f x) (q - [:poly q (f x):]) * order (poly q (f x)) p = order x p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
order (f ?x) (p \<circ>\<^sub>p q) = order ?x p

goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
order (f ?x) (p \<circ>\<^sub>p q) = order ?x p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
order (f ?x) (p \<circ>\<^sub>p q) = order ?x p

goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>proots_within p (poly q ` s). order (f x) (p \<circ>\<^sub>p q)) = (\<Sum>x\<in>proots_within p (poly q ` s). order x p)

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
have "... =  proots_count p (poly q ` s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order x p) = proots_count p (poly q ` s)
[PROOF STEP]
unfolding proots_count_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>proots_within p (poly q ` s). order x p) = (\<Sum>r\<in>proots_within p (poly q ` s). order r p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>proots_within p (poly q ` s). order x p) = proots_count p (poly q ` s)

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)

goal (1 subgoal):
 1. proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
proots_count (p \<circ>\<^sub>p q) s = proots_count p (poly q ` s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma the_riesz_rep_add: \<open>the_riesz_rep (f + g) = the_riesz_rep f + the_riesz_rep g\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the_riesz_rep (f + g) = the_riesz_rep f + the_riesz_rep g
[PROOF STEP]
apply (rule the_riesz_rep_unique[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (f + g) *\<^sub>V x = (the_riesz_rep f + the_riesz_rep g) \<bullet>\<^sub>C x
[PROOF STEP]
by (auto simp: cinner_add_left cblinfun.add_left)


[STATEMENT]
lemma path_set_induct:
  assumes "path E u p v" and "u\<in>I" and "E``I \<subseteq> I"
  shows "set p \<subseteq> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set p \<subseteq> I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path E u p v
u \<in> I
E `` I \<subseteq> I

goal (1 subgoal):
 1. set p \<subseteq> I
[PROOF STEP]
by (induction rule: path.induct) auto


[STATEMENT]
lemma nth_fibs:
  assumes "defined i" and "\<lbrakk> i \<rbrakk> \<ge> 0" shows "defined (fibs !! i)" and "\<lbrakk> fibs !! i \<rbrakk> = fib \<lbrakk> i \<rbrakk>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. defined (fibs !! i) &&& \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
defined i
0 \<le> \<lbrakk>i\<rbrakk>

goal (1 subgoal):
 1. defined (fibs !! i) &&& \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
[PROOF STEP]
proof(induction i rule:nonneg_full_Int_induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>i. \<lbrakk>defined i; \<lbrakk>i\<rbrakk> < 0; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 2. \<And>i. \<lbrakk>defined i; \<lbrakk>i\<rbrakk> < 0; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
 3. \<And>i. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 4. \<And>i. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
defined i
0 \<le> \<lbrakk>i\<rbrakk>
\<lbrakk>defined ?j; \<lbrakk>?j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>?j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! ?j)
\<lbrakk>defined ?j; \<lbrakk>?j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>?j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! ?j\<rbrakk> = fib \<lbrakk>?j\<rbrakk>

goal (4 subgoals):
 1. \<And>i. \<lbrakk>defined i; \<lbrakk>i\<rbrakk> < 0; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 2. \<And>i. \<lbrakk>defined i; \<lbrakk>i\<rbrakk> < 0; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
 3. \<And>i. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 4. \<And>i. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
0 \<le> \<lbrakk>i\<rbrakk>

goal (4 subgoals):
 1. \<And>i. \<lbrakk>defined i; \<lbrakk>i\<rbrakk> < 0; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 2. \<And>i. \<lbrakk>defined i; \<lbrakk>i\<rbrakk> < 0; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
 3. \<And>i. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 4. \<And>i. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
defined i
0 \<le> \<lbrakk>i\<rbrakk>
\<lbrakk>defined ?j; \<lbrakk>?j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>?j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! ?j)
\<lbrakk>defined ?j; \<lbrakk>?j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>?j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! ?j\<rbrakk> = fib \<lbrakk>?j\<rbrakk>
0 \<le> \<lbrakk>i\<rbrakk>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
defined i
0 \<le> \<lbrakk>i\<rbrakk>
\<lbrakk>defined ?j; \<lbrakk>?j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>?j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! ?j)
\<lbrakk>defined ?j; \<lbrakk>?j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>?j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! ?j\<rbrakk> = fib \<lbrakk>?j\<rbrakk>
0 \<le> \<lbrakk>i\<rbrakk>

goal (1 subgoal):
 1. defined (fibs !! i)
[PROOF STEP]
apply (cases "\<lbrakk>i\<rbrakk> = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>; \<lbrakk>i\<rbrakk> = 0\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 2. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>; \<lbrakk>i\<rbrakk> \<noteq> 0\<rbrakk> \<Longrightarrow> defined (fibs !! i)
[PROOF STEP]
apply (subst fibs.simps, (subst fib.simps)?, simp add: nth_zipWith nth_tail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>; \<lbrakk>i\<rbrakk> \<noteq> 0\<rbrakk> \<Longrightarrow> defined (fibs !! i)
[PROOF STEP]
apply (cases "\<lbrakk>i\<rbrakk> = 1")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>; \<lbrakk>i\<rbrakk> \<noteq> 0; \<lbrakk>i\<rbrakk> = 1\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 2. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>; \<lbrakk>i\<rbrakk> \<noteq> 0; \<lbrakk>i\<rbrakk> \<noteq> 1\<rbrakk> \<Longrightarrow> defined (fibs !! i)
[PROOF STEP]
apply (subst fibs.simps, (subst fib.simps)?, simp add: nth_zipWith nth_tail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>; \<lbrakk>i\<rbrakk> \<noteq> 0; \<lbrakk>i\<rbrakk> \<noteq> 1\<rbrakk> \<Longrightarrow> defined (fibs !! i)
[PROOF STEP]
apply (subst fibs.simps, (subst fib.simps)?, simp add: nth_zipWith nth_tail)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
defined (fibs !! i)

goal (3 subgoals):
 1. \<And>i. \<lbrakk>defined i; \<lbrakk>i\<rbrakk> < 0; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! i)
 2. \<And>i. \<lbrakk>defined i; \<lbrakk>i\<rbrakk> < 0; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
 3. \<And>i. \<lbrakk>defined i; 0 \<le> \<lbrakk>i\<rbrakk>; \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> defined (fibs !! j); \<And>j. \<lbrakk>defined j; \<lbrakk>j\<rbrakk> < \<lbrakk>i\<rbrakk>; 0 \<le> \<lbrakk>j\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! j\<rbrakk> = fib \<lbrakk>j\<rbrakk>; 0 \<le> \<lbrakk>i\<rbrakk>\<rbrakk> \<Longrightarrow> \<lbrakk>fibs !! i\<rbrakk> = fib \<lbrakk>i\<rbrakk>
[PROOF STEP]
qed (subst fibs.simps, (subst fib.simps)?, simp add: nth_zipWith nth_tail)+


[STATEMENT]
lemma map_shuffle:
  assumes "length xs = length ys"
  shows "[xs[\<mapsto>]ys,x\<mapsto>y] = [(xs@[x])[\<mapsto>](ys@[y])]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [xs [\<mapsto>] ys, x \<mapsto> y] = [xs @ [x] [\<mapsto>] ys @ [y]]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys

goal (1 subgoal):
 1. [xs [\<mapsto>] ys, x \<mapsto> y] = [xs @ [x] [\<mapsto>] ys @ [y]]
[PROOF STEP]
by (induct "xs" "ys" rule:list_induct2) (auto simp add:map_upds_append1)


[STATEMENT]
lemma scale_piecewise_C1_differentiable_on:
  assumes "f piecewise_C1_differentiable_on s"
  shows "(\<lambda>x. (c::real) * (f x)) piecewise_C1_differentiable_on s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * f x) piecewise_C1_differentiable_on s
[PROOF STEP]
proof (simp add: piecewise_C1_differentiable_on_def, intro conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on s (\<lambda>x. c * f x)
 2. \<exists>S. finite S \<and> (\<lambda>x. c * f x) C1_differentiable_on s - S
[PROOF STEP]
show "continuous_on s (\<lambda>x. c * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on s (\<lambda>x. c * f x)
[PROOF STEP]
using assms continuous_on_mult_left
[PROOF STATE]
proof (prove)
using this:
f piecewise_C1_differentiable_on s
continuous_on ?s ?f \<Longrightarrow> continuous_on ?s (\<lambda>x. ?c * ?f x)

goal (1 subgoal):
 1. continuous_on s (\<lambda>x. c * f x)
[PROOF STEP]
by (auto simp add: piecewise_C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
continuous_on s (\<lambda>x. c * f x)

goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. c * f x) C1_differentiable_on s - S
[PROOF STEP]
show "\<exists>t. finite t \<and> (\<lambda>x. c * f x) C1_differentiable_on s - t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t. finite t \<and> (\<lambda>x. c * f x) C1_differentiable_on s - t
[PROOF STEP]
using assms continuous_on_mult_left
[PROOF STATE]
proof (prove)
using this:
f piecewise_C1_differentiable_on s
continuous_on ?s ?f \<Longrightarrow> continuous_on ?s (\<lambda>x. ?c * ?f x)

goal (1 subgoal):
 1. \<exists>t. finite t \<and> (\<lambda>x. c * f x) C1_differentiable_on s - t
[PROOF STEP]
by (auto simp add: piecewise_C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
\<exists>t. finite t \<and> (\<lambda>x. c * f x) C1_differentiable_on s - t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma except_zero [simp]: "except 0 S = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. except 0 S = 0
[PROOF STEP]
by (rule poly_mapping_eqI) (simp add: lookup_except)


[STATEMENT]
lemma mult_less_le_imp_less:
  assumes t1: "a < b" and t2: "c \<le> d" and t3: "0 \<le> a" and t4: "0 < c"
  shows "a * c < b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
using local.mult_strict_mono' local.mult_strict_right_mono local.order.order_iff_strict
    t1 t2 t3 t4
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a < ?b; ?c < ?d; (0::'a) \<le> ?a; (0::'a) \<le> ?c\<rbrakk> \<Longrightarrow> ?a * ?c < ?b * ?d
\<lbrakk>?a < ?b; (0::'a) < ?c\<rbrakk> \<Longrightarrow> ?a * ?c < ?b * ?c
(?a \<le> ?b) = (?a < ?b \<or> ?a = ?b)
a < b
c \<le> d
(0::'a) \<le> a
(0::'a) < c

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
by auto


[STATEMENT]
lemma i_f_join_union: "
  \<lbrakk> finite A; finite B; Max A < iMin B \<rbrakk> \<Longrightarrow>
  f \<Join>\<^bsub>i-f\<^esub> (A \<union> B) = f \<Join>\<^bsub>i-f\<^esub> A @ f \<Join>\<^bsub>i-f\<^esub> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; Max A < iMin B\<rbrakk> \<Longrightarrow> f \<Join>\<^sub> (A \<union> B) = f \<Join>\<^sub> A @ f \<Join>\<^sub> B
[PROOF STEP]
apply (case_tac "A = {}", simp add: i_f_join_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; Max A < iMin B; A \<noteq> {}\<rbrakk> \<Longrightarrow> f \<Join>\<^sub> (A \<union> B) = f \<Join>\<^sub> A @ f \<Join>\<^sub> B
[PROOF STEP]
apply (case_tac "B = {}", simp add: i_f_join_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; Max A < iMin B; A \<noteq> {}; B \<noteq> {}\<rbrakk> \<Longrightarrow> f \<Join>\<^sub> (A \<union> B) = f \<Join>\<^sub> A @ f \<Join>\<^sub> B
[PROOF STEP]
apply (simp add: i_f_join_def f_join_union del: Max_less_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; Max A < iMin B; A \<noteq> {}; B \<noteq> {}\<rbrakk> \<Longrightarrow> f \<Down> Suc (Max (A \<union> B)) \<Join>\<^sub> A @ f \<Down> Suc (Max (A \<union> B)) \<Join>\<^sub> B = f \<Down> Suc (Max A) \<Join>\<^sub> A @ f \<Down> Suc (Max B) \<Join>\<^sub> B
[PROOF STEP]
apply (subgoal_tac "Max A < Max B")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite A; finite B; Max A < iMin B; A \<noteq> {}; B \<noteq> {}; Max A < Max B\<rbrakk> \<Longrightarrow> f \<Down> Suc (Max (A \<union> B)) \<Join>\<^sub> A @ f \<Down> Suc (Max (A \<union> B)) \<Join>\<^sub> B = f \<Down> Suc (Max A) \<Join>\<^sub> A @ f \<Down> Suc (Max B) \<Join>\<^sub> B
 2. \<lbrakk>finite A; finite B; Max A < iMin B; A \<noteq> {}; B \<noteq> {}\<rbrakk> \<Longrightarrow> Max A < Max B
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite A; finite B; Max A < iMin B; A \<noteq> {}; B \<noteq> {}\<rbrakk> \<Longrightarrow> Max A < Max B
 2. \<lbrakk>finite A; finite B; Max A < iMin B; A \<noteq> {}; B \<noteq> {}; Max A < Max B\<rbrakk> \<Longrightarrow> f \<Down> Suc (Max (A \<union> B)) \<Join>\<^sub> A @ f \<Down> Suc (Max (A \<union> B)) \<Join>\<^sub> B = f \<Down> Suc (Max A) \<Join>\<^sub> A @ f \<Down> Suc (Max B) \<Join>\<^sub> B
[PROOF STEP]
apply (rule order_less_le_trans[OF _ iMin_le_Max], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; Max A < iMin B; A \<noteq> {}; B \<noteq> {}; Max A < Max B\<rbrakk> \<Longrightarrow> f \<Down> Suc (Max (A \<union> B)) \<Join>\<^sub> A @ f \<Down> Suc (Max (A \<union> B)) \<Join>\<^sub> B = f \<Down> Suc (Max A) \<Join>\<^sub> A @ f \<Down> Suc (Max B) \<Join>\<^sub> B
[PROOF STEP]
apply (simp add: Max_Un max_eqR[OF less_imp_le])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; \<forall>a\<in>A. a < iMin B; A \<noteq> {}; B \<noteq> {}; \<forall>a\<in>A. a < Max B\<rbrakk> \<Longrightarrow> f \<Down> Suc (Max B) \<Join>\<^sub> A = f \<Down> Suc (Max A) \<Join>\<^sub> A
[PROOF STEP]
apply (rule take_Suc_Max_eq_imp_f_join_eq, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; \<forall>a\<in>A. a < iMin B; A \<noteq> {}; B \<noteq> {}; \<forall>a\<in>A. a < Max B\<rbrakk> \<Longrightarrow> f \<Down> Suc (Max B) \<down> Suc (Max A) = f \<Down> Suc (Max A) \<down> Suc (Max A)
[PROOF STEP]
apply (simp add: min_eqR[OF less_imp_le])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem Hbd_regularCard: "regularCard Hbd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regularCard Hbd
[PROOF STEP]
by (tactic \<open>BNF_Comp_Tactics.mk_comp_bd_regularCard_tac @{context}
  @{thms F1.bd_regularCard F2.bd_regularCard F3.bd_regularCard} @{thm G.bd_regularCard}
  @{thms F1.bd_Cinfinite F2.bd_Cinfinite F3.bd_Cinfinite} @{thm G.bd_Cinfinite}\<close>)


[STATEMENT]
lemma wp_cond [simp]: "wp (if p then x else y fi) q = (d p \<cdot> wp x q) + (ad p \<cdot> wp y q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wp (if p then x else y fi) q = d p \<cdot> wp x q + ad p \<cdot> wp y q
[PROOF STEP]
by (metis as3 distrib_right dom_op_def mult_1_left wp_cond_aux2 wp_cond_aux1)


[STATEMENT]
lemma a_zdz:"(ant m) - (ant n) = ant (m - n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ant m - ant n = ant (m - n)
[PROOF STEP]
apply (simp add:diff_ant_def minus_ant_def ant_def,
       cut_tac ant_z_in_Ainteg[of "n"],
       simp add:Abs_Ainteg_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n, 0) \<in> Ainteg \<Longrightarrow> Abs_Ainteg (m, 0) + Abs_Ainteg (- n, 0) = Abs_Ainteg (m - n, 0)
[PROOF STEP]
apply (simp add:add_ant_def,
       cut_tac ant_z_in_Ainteg[of "m"],
       cut_tac ant_z_in_Ainteg[of "-n"],
       simp add:Abs_Ainteg_inverse zag_pl_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sets_PiF_singleton:
  "sets (PiF {I} M) = sigma_sets (\<Pi>' j\<in>I. space (M j))
    {(\<Pi>' j\<in>I. X j) |X. X \<in> (\<Pi> j\<in>I. sets (M j))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Pi\<^sub>F {I} M) = sigma_sets (\<Pi>' j\<in>I. space (M j)) {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}
[PROOF STEP]
unfolding sets_PiF
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets (\<Union>J\<in>{I}. \<Pi>' j\<in>J. space (M j)) {Pi' J X |X J. J \<in> {I} \<and> X \<in> (\<Pi> j\<in>J. sets (M j))} = sigma_sets (\<Pi>' j\<in>I. space (M j)) {Pi' I X |X. X \<in> (\<Pi> j\<in>I. sets (M j))}
[PROOF STEP]
by simp


[STATEMENT]
lemma SetNonSingleton:
  "\<lbrakk>G \<noteq> {A}; A \<in> G\<rbrakk> \<Longrightarrow> \<exists>B. B \<noteq> A \<and> B \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<noteq> {A}; A \<in> G\<rbrakk> \<Longrightarrow> \<exists>B. B \<noteq> A \<and> B \<in> G
[PROOF STEP]
by auto


[STATEMENT]
lemma CoxeterComplex: "CoxeterComplex S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CoxeterComplex (\<Union>(f, g)\<in>fundfoldpairs. {Abs_induced_automorph f g})
[PROOF STEP]
by  (
        rule CoxeterComplex.intro, rule CoxeterSystem, unfold_locales,
        rule finite_S
      )


[STATEMENT]
lemma polytope_Int:
  fixes S :: "'a :: euclidean_space set"
  shows "\<lbrakk>polytope S; polytope T\<rbrakk> \<Longrightarrow> polytope(S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>polytope S; polytope T\<rbrakk> \<Longrightarrow> polytope (S \<inter> T)
[PROOF STEP]
by (simp add: polytope_eq_bounded_polyhedron bounded_Int)


[STATEMENT]
lemma Ord_rank [simp]: "Ord (rank a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord (rank a)
[PROOF STEP]
by (metis Ord_succ_iff Vset_non hemptyE in_Vset_rank)


[STATEMENT]
lemma dual_lfp: "lfp = dual_complete_lattice.gfp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp = complete_lattice.gfp Inf (\<lambda>x y. y \<le> x)
[PROOF STEP]
by (simp add: dual_complete_lattice.dual_gfp)


[STATEMENT]
lemma rel_fun_eq: "((=) ===> (=)) = (=)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (=) ===> (=) = (=)
[PROOF STEP]
by(fact fun.rel_eq)


[STATEMENT]
lemma sin_n_hIm_hcis_hcpow_n: "( *f* sin) (hypreal_of_hypnat n * a) = hIm (hcis a pow n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*f* sin) (hypreal_of_hypnat n * a) = hIm (hcis a pow n)
[PROOF STEP]
by (simp add: NSDeMoivre_ext)


[STATEMENT]
lemma inv_join: "\<lbrakk> invc l; invh l; invc r; invh r \<rbrakk> \<Longrightarrow> invc(join l x r) \<and> invh(join l x r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invc l; invh l; invc r; invh r\<rbrakk> \<Longrightarrow> invc (Set2_Join_RBT.join l x r) \<and> invh (Set2_Join_RBT.join l x r)
[PROOF STEP]
by (simp add: invc2_joinL invc2_joinR invh_joinL invh_joinR invh_paint join_def)


[STATEMENT]
lemma nat_nonzero_pos:"(a::nat) \<noteq> 0 \<Longrightarrow> 0 < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> 0 < a
[PROOF STEP]
by simp


[STATEMENT]
lemma capped_omega_omega:
  "y \<le> u \<Longrightarrow> u * v \<le> v \<Longrightarrow> (y\<^sup>\<omega>\<^sub>u)\<^sup>\<omega>\<^sub>v \<le> y\<^sup>\<omega>\<^sub>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<le> u; u * v \<le> v\<rbrakk> \<Longrightarrow> y\<^sup>\<omega>\<^sub>u\<^sup>\<omega>\<^sub>v \<le> y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
by (metis capped_omega_below capped_omega_sub_vector unfold_capped_omega)


[STATEMENT]
lemma finite_measure_lebesgue_on: "S \<in> lmeasurable \<Longrightarrow> finite_measure (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<in> lmeasurable \<Longrightarrow> finite_measure (lebesgue_on S)
[PROOF STEP]
by (auto simp: finite_measureI fmeasurable_def emeasure_restrict_space)


[STATEMENT]
lemma epsilon_squares [simp]:
  "(e1 :: ('a :: ring_1) hyperdual) * e1 = 0"
  "(e2 :: ('a :: ring_1) hyperdual) * e2 = 0"
  "(e12 :: ('a :: ring_1) hyperdual) * e12 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e1 * e1 = 0 &&& e2 * e2 = 0 &&& e12 * e12 = 0
[PROOF STEP]
by (simp_all add: hyperdual_bases)


[STATEMENT]
lemma count_image_mset_eq_card_vimage:
  assumes "finite A"
  shows "count (image_mset f (mset_set A)) b = card {a \<in> A. f a = b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (image_mset f (mset_set A)) b = card {a \<in> A. f a = b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. count (image_mset f (mset_set A)) b = card {a \<in> A. f a = b}
[PROOF STEP]
proof (induct A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. count (image_mset f (mset_set {})) b = card {a \<in> {}. f a = b}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}\<rbrakk> \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. count (image_mset f (mset_set {})) b = card {a \<in> {}. f a = b}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}\<rbrakk> \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (image_mset f (mset_set {})) b = card {a \<in> {}. f a = b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count (image_mset f (mset_set {})) b = card {a \<in> {}. f a = b}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}\<rbrakk> \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}\<rbrakk> \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}\<rbrakk> \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
proof (cases "f x = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f x = b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
 2. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f x = b

goal (2 subgoals):
 1. f x = b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
 2. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
with insert.hyps
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}
f x = b
[PROOF STEP]
have "count (image_mset f (mset_set (insert x F))) b = Suc (card {a \<in> F. f a = f x})"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}
f x = b

goal (1 subgoal):
 1. count (image_mset f (mset_set (insert x F))) b = Suc (card {a \<in> F. f a = f x})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
count (image_mset f (mset_set (insert x F))) b = Suc (card {a \<in> F. f a = f x})

goal (2 subgoals):
 1. f x = b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
 2. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count (image_mset f (mset_set (insert x F))) b = Suc (card {a \<in> F. f a = f x})

goal (2 subgoals):
 1. f x = b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
 2. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
from insert.hyps(1,2)
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
[PROOF STEP]
have "\<dots> = card (insert x {a \<in> F. f a = f x})"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F

goal (1 subgoal):
 1. Suc (card {a \<in> F. f a = f x}) = card (insert x {a \<in> F. f a = f x})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (card {a \<in> F. f a = f x}) = card (insert x {a \<in> F. f a = f x})

goal (2 subgoals):
 1. f x = b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
 2. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (card {a \<in> F. f a = f x}) = card (insert x {a \<in> F. f a = f x})

goal (2 subgoals):
 1. f x = b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
 2. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
from \<open>f x = b\<close>
[PROOF STATE]
proof (chain)
picking this:
f x = b
[PROOF STEP]
have "card (insert x {a \<in> F. f a = f x}) = card {a \<in> insert x F. f a = b}"
[PROOF STATE]
proof (prove)
using this:
f x = b

goal (1 subgoal):
 1. card (insert x {a \<in> F. f a = f x}) = card {a \<in> insert x F. f a = b}
[PROOF STEP]
by (auto intro: arg_cong[where f="card"])
[PROOF STATE]
proof (state)
this:
card (insert x {a \<in> F. f a = f x}) = card {a \<in> insert x F. f a = b}

goal (2 subgoals):
 1. f x = b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
 2. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}

goal (1 subgoal):
 1. count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
finite F
x \<notin> F
count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}

goal (1 subgoal):
 1. count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}

goal (1 subgoal):
 1. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f x \<noteq> b

goal (1 subgoal):
 1. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f x \<noteq> b
[PROOF STEP]
have "{a \<in> F. f a = b} = {a \<in> insert x F. f a = b}"
[PROOF STATE]
proof (prove)
using this:
f x \<noteq> b

goal (1 subgoal):
 1. {a \<in> F. f a = b} = {a \<in> insert x F. f a = b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a \<in> F. f a = b} = {a \<in> insert x F. f a = b}

goal (1 subgoal):
 1. f x \<noteq> b \<Longrightarrow> count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
with insert False
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}
f x \<noteq> b
{a \<in> F. f a = b} = {a \<in> insert x F. f a = b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
count (image_mset f (mset_set F)) b = card {a \<in> F. f a = b}
f x \<noteq> b
{a \<in> F. f a = b} = {a \<in> insert x F. f a = b}

goal (1 subgoal):
 1. count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
count (image_mset f (mset_set (insert x F))) b = card {a \<in> insert x F. f a = b}

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>Prove \<open>image_mset_eq_implies_permutes\<close> ...\<close>


[STATEMENT]
lemma "p \<sqinter> p' = \<bottom> \<Longrightarrow> ({.p.} o [:r:]) \<squnion> ({.p'.} o [:r':]) = {.p \<squnion> p'.} o [:(\<lambda> x y . p x \<longrightarrow> r x y) \<sqinter> ((\<lambda> x y . p' x \<longrightarrow> r' x y)):]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<sqinter> p' = \<bottom> \<Longrightarrow> ({. p .} \<circ> [: r :]) \<squnion> ({. p' .} \<circ> [: r' :]) = {. p \<squnion> p' .} \<circ> [: (\<lambda>x y. p x \<longrightarrow> r x y) \<sqinter> (\<lambda>x y. p' x \<longrightarrow> r' x y) :]
[PROOF STEP]
by (simp add: fun_eq_iff assert_def demonic_def, auto)


[STATEMENT]
lemma isom_gch_unitsTr1_7_7:"\<lbrakk>Ugp E; Gchain (Suc n) h; k \<noteq> Suc n;
      k \<le> (Suc n); h (Suc n) \<cong> E; \<not> h k \<cong> E\<rbrakk> \<Longrightarrow>
      {i. i \<le> (Suc n) \<and>  h i \<cong> E} =
       insert (Suc n) ({i. i \<le> (Suc n) \<and> h i \<cong> E} - {k, Suc n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ugp E; Gchain (Suc n) h; k \<noteq> Suc n; k \<le> Suc n; h (Suc n) \<cong> E; \<not> h k \<cong> E\<rbrakk> \<Longrightarrow> {i. i \<le> Suc n \<and> h i \<cong> E} = insert (Suc n) ({i. i \<le> Suc n \<and> h i \<cong> E} - {k, Suc n})
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done