[STATEMENT]
theorem fnt_carrier_exists_util_fun:
  assumes "finite carrier"
  assumes "rational_preference carrier relation"
  shows "\<exists>u. ordinal_utility carrier relation u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u
[PROOF STEP]
define f where
    f: "f = (\<lambda>x. card (no_better_than x carrier relation))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>x. card (no_better_than x carrier relation))

goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u
[PROOF STEP]
have "ordinal_utility carrier relation f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordinal_utility carrier relation (\<lambda>x. real (f x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> x \<succeq>[relation] y = (real (f y) \<le> real (f x))
 2. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> x \<in> carrier
 3. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> x \<succeq>[relation] y = (real (f y) \<le> real (f x))
 2. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> x \<in> carrier
 3. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
assume x_c: "x \<in> carrier"
[PROOF STATE]
proof (state)
this:
x \<in> carrier

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> x \<succeq>[relation] y = (real (f y) \<le> real (f x))
 2. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> x \<in> carrier
 3. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
assume y_c: "y \<in> carrier"
[PROOF STATE]
proof (state)
this:
y \<in> carrier

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> x \<succeq>[relation] y = (real (f y) \<le> real (f x))
 2. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> x \<in> carrier
 3. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
show "x \<succeq>[relation] y \<longleftrightarrow> (real (f y) \<le> real (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<succeq>[relation] y = (real (f y) \<le> real (f x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<succeq>[relation] y \<Longrightarrow> real (f y) \<le> real (f x)
 2. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
assume asm: "x \<succeq>[relation] y"
[PROOF STATE]
proof (state)
this:
x \<succeq>[relation] y

goal (2 subgoals):
 1. x \<succeq>[relation] y \<Longrightarrow> real (f y) \<le> real (f x)
 2. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
define yn where
        yn: "yn = no_better_than y carrier relation"
[PROOF STATE]
proof (state)
this:
yn = no_better_than y carrier relation

goal (2 subgoals):
 1. x \<succeq>[relation] y \<Longrightarrow> real (f y) \<le> real (f x)
 2. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
define xn where
        xn: "xn = no_better_than x carrier relation"
[PROOF STATE]
proof (state)
this:
xn = no_better_than x carrier relation

goal (2 subgoals):
 1. x \<succeq>[relation] y \<Longrightarrow> real (f y) \<le> real (f x)
 2. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xn = no_better_than x carrier relation
[PROOF STEP]
have "yn \<subseteq> xn"
[PROOF STATE]
proof (prove)
using this:
xn = no_better_than x carrier relation

goal (1 subgoal):
 1. yn \<subseteq> xn
[PROOF STEP]
by (simp add: asm yn assms(2) rational_preference.no_better_subset_pref)
[PROOF STATE]
proof (state)
this:
yn \<subseteq> xn

goal (2 subgoals):
 1. x \<succeq>[relation] y \<Longrightarrow> real (f y) \<le> real (f x)
 2. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
yn \<subseteq> xn
[PROOF STEP]
have "card yn \<le> card xn"
[PROOF STATE]
proof (prove)
using this:
yn \<subseteq> xn

goal (1 subgoal):
 1. card yn \<le> card xn
[PROOF STEP]
by (simp add: x_c y_c asm assms(1) assms(2) rational_preference.card_leq_pref xn yn)
[PROOF STATE]
proof (state)
this:
card yn \<le> card xn

goal (2 subgoals):
 1. x \<succeq>[relation] y \<Longrightarrow> real (f y) \<le> real (f x)
 2. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card yn \<le> card xn
[PROOF STEP]
show "(real (f y) \<le> real (f x))"
[PROOF STATE]
proof (prove)
using this:
card yn \<le> card xn

goal (1 subgoal):
 1. real (f y) \<le> real (f x)
[PROOF STEP]
using  f xn yn
[PROOF STATE]
proof (prove)
using this:
card yn \<le> card xn
f = (\<lambda>x. card (no_better_than x carrier relation))
xn = no_better_than x carrier relation
yn = no_better_than y carrier relation

goal (1 subgoal):
 1. real (f y) \<le> real (f x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (f y) \<le> real (f x)

goal (1 subgoal):
 1. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
assume "real (f y) \<le> real (f x)"
[PROOF STATE]
proof (state)
this:
real (f y) \<le> real (f x)

goal (1 subgoal):
 1. real (f y) \<le> real (f x) \<Longrightarrow> x \<succeq>[relation] y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (f y) \<le> real (f x)
[PROOF STEP]
show "x \<succeq>[relation] y"
[PROOF STATE]
proof (prove)
using this:
real (f y) \<le> real (f x)

goal (1 subgoal):
 1. x \<succeq>[relation] y
[PROOF STEP]
using assms(1) assms(2) f rational_preference.card_leq_pref x_c y_c
[PROOF STATE]
proof (prove)
using this:
real (f y) \<le> real (f x)
finite carrier
rational_preference carrier relation
f = (\<lambda>x. card (no_better_than x carrier relation))
\<lbrakk>rational_preference ?carrier ?relation; finite ?carrier; ?x \<in> ?carrier; ?y \<in> ?carrier\<rbrakk> \<Longrightarrow> (card (no_better_than ?x ?carrier ?relation) \<le> card (no_better_than ?y ?carrier ?relation)) = ?y \<succeq>[?relation] ?x
x \<in> carrier
y \<in> carrier

goal (1 subgoal):
 1. x \<succeq>[relation] y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<succeq>[relation] y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<succeq>[relation] y = (real (f y) \<le> real (f x))

goal (2 subgoals):
 1. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> x \<in> carrier
 2. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> x \<in> carrier
 2. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> x \<in> carrier
 2. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
assume asm: "x \<succeq>[relation] y"
[PROOF STATE]
proof (state)
this:
x \<succeq>[relation] y

goal (2 subgoals):
 1. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> x \<in> carrier
 2. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
show "x \<in> carrier"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier
[PROOF STEP]
by (meson asm assms(2) preference.not_outside rational_preference.axioms(1))
[PROOF STATE]
proof (state)
this:
x \<in> carrier

goal (1 subgoal):
 1. \<And>x y. x \<succeq>[relation] y \<Longrightarrow> y \<in> carrier
[PROOF STEP]
show "y \<in> carrier"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> carrier
[PROOF STEP]
by (meson asm assms(2) preference_def rational_preference_def)
[PROOF STATE]
proof (state)
this:
y \<in> carrier

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ordinal_utility carrier relation (\<lambda>x. real (f x))

goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ordinal_utility carrier relation (\<lambda>x. real (f x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ordinal_utility carrier relation (\<lambda>x. real (f x))

goal (1 subgoal):
 1. \<exists>u. ordinal_utility carrier relation u
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>u. ordinal_utility carrier relation u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_on_UNIV_mono_conv: "mono_on f UNIV = mono f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SetInterval2.mono_on f UNIV = mono f
[PROOF STEP]
unfolding mono_on_def mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a\<in>UNIV. \<forall>b\<in>UNIV. a \<le> b \<longrightarrow> f a \<le> f b) = (\<forall>x y. x \<le> y \<longrightarrow> f x \<le> f y)
[PROOF STEP]
by blast


[STATEMENT]
lemma qo_on_subset:
  "A \<subseteq> B \<Longrightarrow> qo_on P B \<Longrightarrow> qo_on P A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; qo_on P B\<rbrakk> \<Longrightarrow> qo_on P A
[PROOF STEP]
unfolding qo_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; Restricted_Predicates.reflp_on P B \<and> transp_on P B\<rbrakk> \<Longrightarrow> Restricted_Predicates.reflp_on P A \<and> transp_on P A
[PROOF STEP]
using reflp_on_subset
    and transp_on_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> ?B; Restricted_Predicates.reflp_on ?P ?B\<rbrakk> \<Longrightarrow> Restricted_Predicates.reflp_on ?P ?A
\<lbrakk>?A \<subseteq> ?B; transp_on ?P ?B\<rbrakk> \<Longrightarrow> transp_on ?P ?A

goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; Restricted_Predicates.reflp_on P B \<and> transp_on P B\<rbrakk> \<Longrightarrow> Restricted_Predicates.reflp_on P A \<and> transp_on P A
[PROOF STEP]
by blast


[STATEMENT]
lemma lex_sum_list: "(\<And>x. x \<in> set xs \<Longrightarrow> lex x 0) \<Longrightarrow> lex (sum_list xs) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> Counterclockwise_2D_Arbitrary.lex x 0) \<Longrightarrow> Counterclockwise_2D_Arbitrary.lex (sum_list xs) 0
[PROOF STEP]
by (induct xs) (auto simp: nlex_add)


[STATEMENT]
lemma shiftl_t2n: "shiftl w n = 2 ^ n * w"
  for w :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w << n = 2 ^ n * w
[PROOF STEP]
by (simp add: shiftl_def push_bit_eq_mult)


[STATEMENT]
lemma card_stabilizer_divide_sumset:
  assumes "A \<subseteq> G"
  shows "card (stabilizer B) dvd card (sumset A (stabilizer B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (stabilizer B) dvd card (sumset A (stabilizer B))
[PROOF STEP]
by (simp add: assms card_divide_sumset)


[STATEMENT]
lemma pair_less_iff1 [simp]: "((x,y), (x,z)) \<in> pair_less \<longleftrightarrow> y<z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((x, y), x, z) \<in> pair_less) = (y < z)
[PROOF STEP]
by (simp add: pair_less_def)


[STATEMENT]
lemma (in prob_space) exponential_distributedD_gt:
  assumes D: "distributed M lborel X (exponential_density l)" and a: "0 \<le> a" and l: "0 < l"
  shows "\<P>(x in M. a < X x ) = exp (- a * l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob {x \<in> space M. a < X x} = exp (- a * l)
[PROOF STEP]
using erlang_distributed_gt[OF D l a] a
[PROOF STATE]
proof (prove)
using this:
prob {x \<in> space M. a < X x} = 1 - erlang_CDF 0 l a
0 \<le> a

goal (1 subgoal):
 1. prob {x \<in> space M. a < X x} = exp (- a * l)
[PROOF STEP]
by (simp add: erlang_CDF_def)


[STATEMENT]
lemma poly_linepath_comp':
  fixes a::"'a::{real_normed_vector,comm_semiring_0,real_algebra_1}"
  shows "poly p (linepath a b t) = poly (p \<circ>\<^sub>p [:a, b-a:]) (of_real t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p (linepath a b t) = poly (p \<circ>\<^sub>p [:a, b - a:]) (of_real t)
[PROOF STEP]
by (auto simp add:poly_pcompose linepath_def scaleR_conv_of_real algebra_simps)


[STATEMENT]
lemma sum_list_rmv1:
  "a \<in> set xs \<Longrightarrow> \<Sum>:(remove1 a xs) = \<Sum>:xs - (a :: 'a :: ab_group_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> set xs \<Longrightarrow> sum_list (remove1 a xs) = sum_list xs - a
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma fds_abs_converges_norm_iff [simp]:
  fixes s :: "'a :: {nat_power_normed_field,banach}"
  shows "fds_abs_converges (fds_norm f) (s \<bullet> 1) \<longleftrightarrow> fds_abs_converges f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges (fds_norm f) (s \<bullet> (1::'a)) = fds_abs_converges f s
[PROOF STEP]
unfolding fds_abs_converges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (fds_nth (fds_norm f) n / nat_power n (s \<bullet> (1::'a)))) = summable (\<lambda>n. norm (fds_nth f n / nat_power n s))
[PROOF STEP]
by (rule summable_cong [OF eventually_mono[OF eventually_gt_at_top[of 0]]])
     (simp add: fds_abs_converges_def fds_norm_def fds_nth_fds' norm_divide norm_nat_power)


[STATEMENT]
lemma merge_overlap_helper2: "\<exists>s'\<in>set ss. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow>
          interval_of A \<union> (\<Union>s \<in> set ss. interval_of s) = (\<Union>s \<in> set (merge_overlap A ss). interval_of s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s'\<in>set ss. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set ss) = \<Union> (interval_of ` set (merge_overlap A ss))
[PROOF STEP]
apply(induction ss)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>s'\<in>set []. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set []) = \<Union> (interval_of ` set (merge_overlap A []))
 2. \<And>a ss. \<lbrakk>\<exists>s'\<in>set ss. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set ss) = \<Union> (interval_of ` set (merge_overlap A ss)); \<exists>s'\<in>set (a # ss). \<not> disjoint (interval_of A) (interval_of s')\<rbrakk> \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set (a # ss)) = \<Union> (interval_of ` set (merge_overlap A (a # ss)))
[PROOF STEP]
apply(simp; fail)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ss. \<lbrakk>\<exists>s'\<in>set ss. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set ss) = \<Union> (interval_of ` set (merge_overlap A ss)); \<exists>s'\<in>set (a # ss). \<not> disjoint (interval_of A) (interval_of s')\<rbrakk> \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set (a # ss)) = \<Union> (interval_of ` set (merge_overlap A (a # ss)))
[PROOF STEP]
apply(rename_tac x xs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap A xs)); \<exists>s'\<in>set (x # xs). \<not> disjoint (interval_of A) (interval_of s')\<rbrakk> \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set (x # xs)) = \<Union> (interval_of ` set (merge_overlap A (x # xs)))
[PROOF STEP]
apply(cases A, rename_tac a b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap A xs)); \<exists>s'\<in>set (x # xs). \<not> disjoint (interval_of A) (interval_of s'); A = (a, b)\<rbrakk> \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set (x # xs)) = \<Union> (interval_of ` set (merge_overlap A (x # xs)))
[PROOF STEP]
apply(case_tac x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap A xs)); \<exists>s'\<in>set (x # xs). \<not> disjoint (interval_of A) (interval_of s'); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> interval_of A \<union> \<Union> (interval_of ` set (x # xs)) = \<Union> (interval_of ` set (merge_overlap A (x # xs)))
[PROOF STEP]
apply(simp add: not_disjoint_intervals_def interval_of.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s') \<Longrightarrow> {a..b} \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap (a, b) xs)); disjoint {a..b} {aa..ba} \<longrightarrow> (\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s')); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> (\<not> disjoint {a..b} {aa..ba} \<longrightarrow> {a..b} \<union> ({aa..ba} \<union> \<Union> (interval_of ` set xs)) = {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs)) \<and> (disjoint {a..b} {aa..ba} \<longrightarrow> {a..b} \<union> ({aa..ba} \<union> \<Union> (interval_of ` set xs)) = {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs)))
[PROOF STEP]
apply(intro impI conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs a b aa ba. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s') \<Longrightarrow> {a..b} \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap (a, b) xs)); disjoint {a..b} {aa..ba} \<longrightarrow> (\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s')); A = (a, b); x = (aa, ba); \<not> disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {a..b} \<union> ({aa..ba} \<union> \<Union> (interval_of ` set xs)) = {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs)
 2. \<And>x xs a b aa ba. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s') \<Longrightarrow> {a..b} \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap (a, b) xs)); disjoint {a..b} {aa..ba} \<longrightarrow> (\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s')); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {a..b} \<union> ({aa..ba} \<union> \<Union> (interval_of ` set xs)) = {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs))
[PROOF STEP]
apply(drule not_disjoint_union)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs a b aa ba. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s') \<Longrightarrow> {a..b} \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap (a, b) xs)); disjoint {a..b} {aa..ba} \<longrightarrow> (\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s')); A = (a, b); x = (aa, ba); {a..b} \<union> {aa..ba} = {min a aa..max b ba}\<rbrakk> \<Longrightarrow> {a..b} \<union> ({aa..ba} \<union> \<Union> (interval_of ` set xs)) = {min a aa..max b ba} \<union> \<Union> (interval_of ` set xs)
 2. \<And>x xs a b aa ba. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s') \<Longrightarrow> {a..b} \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap (a, b) xs)); disjoint {a..b} {aa..ba} \<longrightarrow> (\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s')); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {a..b} \<union> ({aa..ba} \<union> \<Union> (interval_of ` set xs)) = {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s') \<Longrightarrow> {a..b} \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap (a, b) xs)); disjoint {a..b} {aa..ba} \<longrightarrow> (\<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s')); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {a..b} \<union> ({aa..ba} \<union> \<Union> (interval_of ` set xs)) = {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs))
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>{a..b} \<union> \<Union> (interval_of ` set xs) = \<Union> (interval_of ` set (merge_overlap (a, b) xs)); \<exists>s'\<in>set xs. \<not> disjoint {a..b} (interval_of s'); A = (a, b); x = (aa, ba); disjoint {a..b} {aa..ba}\<rbrakk> \<Longrightarrow> {a..b} \<union> ({aa..ba} \<union> \<Union> (interval_of ` set xs)) = {aa..ba} \<union> \<Union> (interval_of ` set (merge_overlap (a, b) xs))
[PROOF STEP]
by blast


[STATEMENT]
lemma prime_field: "a < (order \<G>) \<Longrightarrow> a \<noteq> 0 \<Longrightarrow> coprime a (order \<G>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < order \<G>; a \<noteq> 0\<rbrakk> \<Longrightarrow> coprime a (order \<G>)
[PROOF STEP]
by(metis dvd_imp_le neq0_conv not_le prime_imp_coprime prime_order coprime_commute)


[STATEMENT]
lemma A_insert: "is_root h \<Longrightarrow> T_insert a h + \<Phi>(insert a h) - \<Phi> h \<le> log 2 (size h + 1) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_root h \<Longrightarrow> real (T_insert a h) + \<Phi> (Pairing_Heap_Tree.insert a h) - \<Phi> h \<le> log 2 (real (size h + 1)) + 1
[PROOF STEP]
by(drule \<Delta>\<Phi>_insert) simp


[STATEMENT]
lemma delete_edge_commute: "delete_edge a1 a2 (delete_edge b1 b2 G) = delete_edge b1 b2 (delete_edge a1 a2 G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FiniteListGraph.delete_edge a1 a2 (FiniteListGraph.delete_edge b1 b2 G) = FiniteListGraph.delete_edge b1 b2 (FiniteListGraph.delete_edge a1 a2 G)
[PROOF STEP]
unfolding delete_edge_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>nodesL = nodesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> b1 \<or> e2 \<noteq> b2) (edgesL G)\<rparr>, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> a1 \<or> e2 \<noteq> a2) (edgesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> b1 \<or> e2 \<noteq> b2) (edgesL G)\<rparr>)\<rparr> = \<lparr>nodesL = nodesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> a1 \<or> e2 \<noteq> a2) (edgesL G)\<rparr>, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> b1 \<or> e2 \<noteq> b2) (edgesL \<lparr>nodesL = nodesL G, edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> a1 \<or> e2 \<noteq> a2) (edgesL G)\<rparr>)\<rparr>
[PROOF STEP]
by simp metis


[STATEMENT]
lemma cong_solve_nat: "a \<noteq> 0 \<Longrightarrow> \<exists>x. (a*x) mod n = (gcd a n) mod n"
  for a n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> \<exists>x. a * x mod n = gcd a n mod n
[PROOF STEP]
apply (cases "n=0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<noteq> 0; n = 0\<rbrakk> \<Longrightarrow> \<exists>x. a * x mod n = gcd a n mod n
 2. \<lbrakk>a \<noteq> 0; n \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>x. a * x mod n = gcd a n mod n
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < n\<rbrakk> \<Longrightarrow> \<exists>x. a * x mod n = gcd a n mod n
[PROOF STEP]
apply (insert bezout_nat [of a n], auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>0 < a; 0 < n; a * x = n * y + gcd a n\<rbrakk> \<Longrightarrow> \<exists>x. a * x mod n = gcd a n mod n
[PROOF STEP]
by (metis mod_mult_self4)


[STATEMENT]
lemma Ball_Cons: "(\<forall>x \<in> set (a#l). P x) = (P a \<and> (\<forall>x \<in> set l. P x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set (a # l). P x) = (P a \<and> (\<forall>x\<in>set l. P x))
[PROOF STEP]
by simp


[STATEMENT]
lemma in_Inter_image_nth_conv: "a \<in> \<Inter> (f ` set xs) = (\<forall>i < length xs. a \<in> f (xs!i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> \<Inter> (f ` set xs)) = (\<forall>i<length xs. a \<in> f (xs ! i))
[PROOF STEP]
by (force simp add:  in_set_conv_nth)


[STATEMENT]
lemma max_border_less_len: assumes "w \<noteq> \<epsilon>" shows "\<^bold>|max_border w\<^bold>| < \<^bold>|w\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>|max_border w\<^bold>| < \<^bold>|w\<^bold>|
[PROOF STEP]
using assms border_len(3) leI list.size(3) max_border_border' npos_len
[PROOF STATE]
proof (prove)
using this:
w \<noteq> \<epsilon>
?x \<le>b ?w \<Longrightarrow> \<^bold>|?x\<^bold>| < \<^bold>|?w\<^bold>|
\<not> ?x < ?y \<Longrightarrow> ?y \<le> ?x
\<^bold>|\<epsilon>\<^bold>| = 0
max_border ?w \<noteq> \<epsilon> \<Longrightarrow> max_border ?w \<le>b ?w
\<^bold>|?u\<^bold>| \<le> 0 \<Longrightarrow> ?u = \<epsilon>

goal (1 subgoal):
 1. \<^bold>|max_border w\<^bold>| < \<^bold>|w\<^bold>|
[PROOF STEP]
by metis


[STATEMENT]
lemma tensor_ell2_add1: \<open>tensor_ell2 (a + b) c = tensor_ell2 a c + tensor_ell2 b c\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) \<otimes>\<^sub>s c = a \<otimes>\<^sub>s c + b \<otimes>\<^sub>s c
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>has_ell2_norm a; has_ell2_norm b; has_ell2_norm c\<rbrakk> \<Longrightarrow> (\<lambda>(i, j). (a i + b i) * c j) = (\<lambda>x. (case x of (i, j) \<Rightarrow> a i * c j) + (case x of (i, j) \<Rightarrow> b i * c j))
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c x. \<lbrakk>has_ell2_norm a; has_ell2_norm b; has_ell2_norm c\<rbrakk> \<Longrightarrow> (case x of (i, j) \<Rightarrow> (a i + b i) * c j) = (case x of (i, j) \<Rightarrow> a i * c j) + (case x of (i, j) \<Rightarrow> b i * c j)
[PROOF STEP]
apply (auto simp: case_prod_beta)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c aa ba. (a aa + b aa) * c ba = a aa * c ba + b aa * c ba
[PROOF STEP]
by (simp add: vector_space_over_itself.scale_left_distrib)


[STATEMENT]
lemma bigo_sum2: "\<forall>y. 0 \<le> h y \<Longrightarrow>
    \<exists>c. \<forall>y. \<bar>f y\<bar> \<le> c * (h y) \<Longrightarrow>
      (\<lambda>x. \<Sum>y \<in> A x. f y) =o O(\<lambda>x. \<Sum>y \<in> A x. h y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y. (0::'b) \<le> h y; \<exists>c. \<forall>y. \<bar>f y\<bar> \<le> c * h y\<rbrakk> \<Longrightarrow> (\<lambda>x. sum f (A x)) \<in> O(\<lambda>x. sum h (A x))
[PROOF STEP]
by (rule bigo_sum1) auto


[STATEMENT]
lemma dom_m_fmrestrict_set: \<open>dom_m (fmrestrict_set (set xs) N) = mset xs \<inter># dom_m N\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dom_m (fmrestrict_set (set xs) N) = mset xs \<inter># dom_m N
[PROOF STEP]
using fset_fmdom_fmrestrict_set[of \<open>set xs\<close> N] distinct_mset_dom[of N]
  distinct_mset_inter_remdups_mset[of \<open>mset_fset (fmdom N)\<close> \<open>mset xs\<close>]
[PROOF STATE]
proof (prove)
using this:
fset (fmdom (fmrestrict_set (set xs) N)) = fset (fmdom N) \<inter> set xs
distinct_mset (dom_m N)
distinct_mset (mset_fset (fmdom N)) \<Longrightarrow> mset_fset (fmdom N) \<inter># remdups_mset (mset xs) = mset_fset (fmdom N) \<inter># mset xs

goal (1 subgoal):
 1. dom_m (fmrestrict_set (set xs) N) = mset xs \<inter># dom_m N
[PROOF STEP]
by (auto simp: dom_m_def fset_mset_mset_fset finite_mset_set_inter multiset_inter_commute
    remdups_mset_def)


[STATEMENT]
lemma abs_conv_abscissa_mult_leI:
  "abs_conv_abscissa (f :: 'a :: dirichlet_series fds) \<le> d \<Longrightarrow>
   abs_conv_abscissa g \<le> d \<Longrightarrow> abs_conv_abscissa (f * g) \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>abs_conv_abscissa f \<le> d; abs_conv_abscissa g \<le> d\<rbrakk> \<Longrightarrow> abs_conv_abscissa (f * g) \<le> d
[PROOF STEP]
using abs_conv_abscissa_mult_le[of f g]
[PROOF STATE]
proof (prove)
using this:
abs_conv_abscissa (f * g) \<le> max (abs_conv_abscissa f) (abs_conv_abscissa g)

goal (1 subgoal):
 1. \<lbrakk>abs_conv_abscissa f \<le> d; abs_conv_abscissa g \<le> d\<rbrakk> \<Longrightarrow> abs_conv_abscissa (f * g) \<le> d
[PROOF STEP]
by (auto simp add: le_max_iff_disj)


[STATEMENT]
lemma diff1_eq_iff: "n > 0 \<Longrightarrow> n - Suc 0 = m \<longleftrightarrow> n = m+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (n - Suc 0 = m) = (n = m + 1)
[PROOF STEP]
by arith


[STATEMENT]
lemma of_nat_less_t2n:
  "of_nat i < (2 :: ('a :: len) word) ^ n \<Longrightarrow> n < LENGTH('a) \<and> unat (of_nat i :: 'a word) < 2 ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_of_nat i < 2 ^ n \<Longrightarrow> n < LENGTH('a) \<and> unat (word_of_nat i) < 2 ^ n
[PROOF STEP]
by (metis order_less_trans p2_gt_0 unat_less_power word_neq_0_conv)


[STATEMENT]
lemma nn_integral_point_measure:
  "finite {a\<in>A. 0 < f a \<and> 0 < g a} \<Longrightarrow>
    integral\<^sup>N (point_measure A f) g = (\<Sum>a|a\<in>A \<and> 0 < f a \<and> 0 < g a. f a * g a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {a \<in> A. 0 < f a \<and> 0 < g a} \<Longrightarrow> integral\<^sup>N (point_measure A f) g = (\<Sum>a | a \<in> A \<and> 0 < f a \<and> 0 < g a. f a * g a)
[PROOF STEP]
unfolding point_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {a \<in> A. 0 < f a \<and> 0 < g a} \<Longrightarrow> integral\<^sup>N (density (count_space A) f) g = (\<Sum>a | a \<in> A \<and> 0 < f a \<and> 0 < g a. f a * g a)
[PROOF STEP]
by (subst nn_integral_density)
     (simp_all add: nn_integral_density nn_integral_count_space ennreal_zero_less_mult_iff)


[STATEMENT]
lemma mult_rat [simp]: "Fract a b * Fract c d = Fract (a * c) (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fract a b * Fract c d = Fract (a * c) (b * d)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma "filterlim (\<lambda>x::real. exp (exp (2*ln (x^5 + x) * ln (ln x))) /
                     exp (exp (10*ln x * ln (ln x)))) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. exp (exp (2 * ln (x ^ 5 + x) * ln (ln x))) / exp (exp (10 * ln x * ln (ln x))) :> at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma dual_inf_eq [simp]:
  "dual (inf x y) = sup (dual x) (dual y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual (inf x y) = sup (dual x) (dual y)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma mset_insort1: "mset (insort1 x xs) = {#x#} + mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (insort1 x xs) = {#x#} + mset xs
[PROOF STEP]
apply(induction xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mset (insort1 x []) = {#x#} + mset []
 2. \<And>a xs. mset (insort1 x xs) = {#x#} + mset xs \<Longrightarrow> mset (insort1 x (a # xs)) = {#x#} + mset (a # xs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map_component_comp: "map_component f (map_component g x) = map_component (\<lambda>k. f (g k)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_component f (map_component g x) = map_component (\<lambda>k. f (g k)) x
[PROOF STEP]
by (simp add: map_component_def term_simps)


[STATEMENT]
lemma split_two_block_non_interfering:
  assumes "split_block (two_block_non_interfering A B) (dim_row A) (dim_col A) = (Q1, Q2, Q3, Q4)"
  shows "Q1 = A" "Q4 = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q1 = A &&& Q4 = B
[PROOF STEP]
using split_four_block_dual_fst_lst[of A _ _ B Q1 Q2 Q3 Q4]
    assms
[PROOF STATE]
proof (prove)
using this:
split_block (four_block_mat A ?B ?C B) (dim_row A) (dim_col A) = (Q1, Q2, Q3, Q4) \<Longrightarrow> Q1 = A
split_block (four_block_mat A ?B ?C B) (dim_row A) (dim_col A) = (Q1, Q2, Q3, Q4) \<Longrightarrow> Q4 = B
split_block (two_block_non_interfering A B) (dim_row A) (dim_col A) = (Q1, Q2, Q3, Q4)

goal (1 subgoal):
 1. Q1 = A &&& Q4 = B
[PROOF STEP]
by auto


[STATEMENT]
lemma summable_on_Im:
  assumes "f summable_on M"
  shows "(\<lambda>x. Im (f x)) summable_on M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Im (f x)) summable_on M
[PROOF STEP]
apply (rule summable_on_comm_additive[where f=Im, unfolded o_def])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. additive Im
 2. isCont Im (infsum f M)
 3. f summable_on M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f summable_on M

goal (3 subgoals):
 1. additive Im
 2. isCont Im (infsum f M)
 3. f summable_on M
[PROOF STEP]
by (auto intro!: additive.intro)


[STATEMENT]
lemma sum_list_update :
  fixes xs :: "'a::ab_group_add list"
  shows "n < length xs \<Longrightarrow> sum_list (xs[n := y]) = sum_list xs - xs!n + y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length xs \<Longrightarrow> sum_list (xs[n := y]) = sum_list xs - xs ! n + y
[PROOF STEP]
proof (induct xs arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. n < length [] \<Longrightarrow> sum_list ([][n := y]) = sum_list [] - [] ! n + y
 2. \<And>a xs n. \<lbrakk>\<And>n. n < length xs \<Longrightarrow> sum_list (xs[n := y]) = sum_list xs - xs ! n + y; n < length (a # xs)\<rbrakk> \<Longrightarrow> sum_list ((a # xs)[n := y]) = sum_list (a # xs) - (a # xs) ! n + y
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
?n < length xs_ \<Longrightarrow> sum_list (xs_[?n := y]) = sum_list xs_ - xs_ ! ?n + y
n < length (a_ # xs_)

goal (2 subgoals):
 1. \<And>n. n < length [] \<Longrightarrow> sum_list ([][n := y]) = sum_list [] - [] ! n + y
 2. \<And>a xs n. \<lbrakk>\<And>n. n < length xs \<Longrightarrow> sum_list (xs[n := y]) = sum_list xs - xs ! n + y; n < length (a # xs)\<rbrakk> \<Longrightarrow> sum_list ((a # xs)[n := y]) = sum_list (a # xs) - (a # xs) ! n + y
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?n < length xs_ \<Longrightarrow> sum_list (xs_[?n := y]) = sum_list xs_ - xs_ ! ?n + y
n < length (a_ # xs_)

goal (1 subgoal):
 1. sum_list ((a_ # xs_)[n := y]) = sum_list (a_ # xs_) - (a_ # xs_) ! n + y
[PROOF STEP]
by (cases n) auto
[PROOF STATE]
proof (state)
this:
sum_list ((a_ # xs_)[n := y]) = sum_list (a_ # xs_) - (a_ # xs_) ! n + y

goal (1 subgoal):
 1. \<And>n. n < length [] \<Longrightarrow> sum_list ([][n := y]) = sum_list [] - [] ! n + y
[PROOF STEP]
qed simp


[STATEMENT]
lemma at_within_eq_bot_iff: "at c within A = bot \<longleftrightarrow> c \<notin> closure (A - {c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (at c within A = bot) = (c \<notin> closure (A - {c}))
[PROOF STEP]
using not_trivial_limit_within[of c A]
[PROOF STATE]
proof (prove)
using this:
(at c within A = bot) \<noteq> (c \<in> closure (A - {c}))

goal (1 subgoal):
 1. (at c within A = bot) = (c \<notin> closure (A - {c}))
[PROOF STEP]
by blast


[STATEMENT]
lemma deg_pm_eq_0_iff[simp]: "deg_pm s = 0 \<longleftrightarrow> s = 0" for s::"'a \<Rightarrow>\<^sub>0 'b::add_linorder_min"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deg_pm s = (0::'b)) = (s = 0)
[PROOF STEP]
by (simp only: deg_pm.rep_eq poly_mapping_eq_iff lookup_zero_fun, rule deg_fun_eq_0_iff,
      simp add: keys_eq_supp[symmetric])


[STATEMENT]
lemma sets_Pair2: assumes A: "A \<in> sets (M1 \<Otimes>\<^sub>M M2)" shows "(\<lambda>x. (x, y)) -` A \<in> sets M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (x, y)) -` A \<in> sets M1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. (x, y)) -` A \<in> sets M1
[PROOF STEP]
have "(\<lambda>x. (x, y)) -` A = (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (x, y)) -` A = (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {})
[PROOF STEP]
using A[THEN sets.sets_into_space]
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> space (M1 \<Otimes>\<^sub>M M2)

goal (1 subgoal):
 1. (\<lambda>x. (x, y)) -` A = (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {})
[PROOF STEP]
by (auto simp: space_pair_measure)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (x, y)) -` A = (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {})

goal (1 subgoal):
 1. (\<lambda>x. (x, y)) -` A \<in> sets M1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (x, y)) -` A = (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {})

goal (1 subgoal):
 1. (\<lambda>x. (x, y)) -` A \<in> sets M1
[PROOF STEP]
have "\<dots> \<in> sets M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {}) \<in> sets M1
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (M1 \<Otimes>\<^sub>M M2)

goal (1 subgoal):
 1. (if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {}) \<in> sets M1
[PROOF STEP]
by (auto simp add: measurable_Pair2' intro!: measurable_sets split: if_split_asm)
[PROOF STATE]
proof (state)
this:
(if y \<in> space M2 then (\<lambda>x. (x, y)) -` A \<inter> space M1 else {}) \<in> sets M1

goal (1 subgoal):
 1. (\<lambda>x. (x, y)) -` A \<in> sets M1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (x, y)) -` A \<in> sets M1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (x, y)) -` A \<in> sets M1

goal (1 subgoal):
 1. (\<lambda>x. (x, y)) -` A \<in> sets M1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (x, y)) -` A \<in> sets M1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma charslength_0: "(\<forall> t \<in> set ts. chars_of_token t = []) = (charslength ts = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>t\<in>set ts. chars_of_token t = []) = (charslength ts = 0)
[PROOF STEP]
by (induct ts, auto)


[STATEMENT]
lemma polyfun_extract_matrix:
assumes "i<m" "j<n"
shows "polyfun {..<a + (m * n + c)} (\<lambda>f. extract_matrix (\<lambda>i. f (i + a)) m n $$ (i,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polyfun {..<a + (m * n + c)} (\<lambda>f. extract_matrix (\<lambda>i. f (i + a)) m n $$ (i, j))
[PROOF STEP]
unfolding index_extract_matrix[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polyfun {..<a + (m * n + c)} (\<lambda>f. f (i * n + j + a))
[PROOF STEP]
apply (rule polyfun_single)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i * n + j + a \<in> {..<a + (m * n + c)}
[PROOF STEP]
using two_digit_le[OF assms]
[PROOF STATE]
proof (prove)
using this:
i * n + j < m * n

goal (1 subgoal):
 1. i * n + j + a \<in> {..<a + (m * n + c)}
[PROOF STEP]
by simp


[STATEMENT]
lemma nn_integral_disjoint_pair:
  assumes [measurable]: "f \<in> borel_measurable M"
          "B \<in> sets M" "C \<in> sets M"
          "B \<inter> C = {}"
  shows "(\<integral>\<^sup>+x \<in> B \<union> C. f x \<partial>M) = (\<integral>\<^sup>+x \<in> B. f x \<partial>M) + (\<integral>\<^sup>+x \<in> C. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
have mes: "\<And>D. D \<in> sets M \<Longrightarrow> (\<lambda>x. f x * indicator D x) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>D. D \<in> sets M \<Longrightarrow> (\<lambda>x. f x * indicator D x) \<in> borel_measurable M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?D \<in> sets M \<Longrightarrow> (\<lambda>x. f x * indicator ?D x) \<in> borel_measurable M

goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
have pos: "\<And>D. AE x in M. f x * indicator D x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>D. AE x in M. 0 \<le> f x * indicator D x
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
B \<in> sets M

goal (1 subgoal):
 1. \<And>D. AE x in M. 0 \<le> f x * indicator D x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. 0 \<le> f x * indicator ?D x

goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
have "\<And>x. f x * indicator (B \<union> C) x = f x * indicator B x + f x * indicator C x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. f x * indicator (B \<union> C) x = f x * indicator B x + f x * indicator C x
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
B \<inter> C = {}

goal (1 subgoal):
 1. \<And>x. f x * indicator (B \<union> C) x = f x * indicator B x + f x * indicator C x
[PROOF STEP]
by (auto split: split_indicator)
[PROOF STATE]
proof (state)
this:
f ?x * indicator (B \<union> C) ?x = f ?x * indicator B ?x + f ?x * indicator C ?x

goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ?x * indicator (B \<union> C) ?x = f ?x * indicator B ?x + f ?x * indicator C ?x
[PROOF STEP]
have "(\<integral>\<^sup>+x. f x * indicator (B \<union> C) x \<partial>M) = (\<integral>\<^sup>+x. f x * indicator B x + f x * indicator C x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
f ?x * indicator (B \<union> C) ?x = f ?x * indicator B ?x + f ?x * indicator C ?x

goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = \<integral>\<^sup>+ x. f x * indicator B x + f x * indicator C x \<partial>M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B \<union> C) f = \<integral>\<^sup>+ x. f x * indicator B x + f x * indicator C x \<partial>M

goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B \<union> C) f = \<integral>\<^sup>+ x. f x * indicator B x + f x * indicator C x \<partial>M

goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
have "... = (\<integral>\<^sup>+x. f x * indicator B x \<partial>M) + (\<integral>\<^sup>+x. f x * indicator C x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * indicator B x + f x * indicator C x \<partial>M = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
by (rule nn_integral_add) (auto simp add: assms mes pos)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f x * indicator B x + f x * indicator C x \<partial>M = set_nn_integral M B f + set_nn_integral M C f

goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f

goal (1 subgoal):
 1. set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B \<union> C) f = set_nn_integral M B f + set_nn_integral M C f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ALLC_eval: "eval ([\<forall><n] DF) a = (\<forall>k<n. eval (DF k) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval [\<forall><n] DF a = (\<forall>k<n. eval (DF k) a)
[PROOF STEP]
unfolding ALLC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval [\<forall> in [0..<n]] DF a = (\<forall>k<n. eval (DF k) a)
[PROOF STEP]
by (simp add: ALLC_LIST_eval)


[STATEMENT]
lemma diag_block_mat_dim_row_col_eq:
  assumes "\<forall>i < length Al. dim_row (Al!i) = dim_col (Al!i)"
  shows "dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
have "dim_row (diag_block_mat Al) = sum_list (map dim_row Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = sum_list (map dim_row Al)
[PROOF STEP]
by (simp add:dim_diag_block_mat(1))
[PROOF STATE]
proof (state)
this:
dim_row (diag_block_mat Al) = sum_list (map dim_row Al)

goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dim_row (diag_block_mat Al) = sum_list (map dim_row Al)

goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
have "... = sum_list (map dim_col Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map dim_row Al) = sum_list (map dim_col Al)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length Al. dim_row (Al ! i) = dim_col (Al ! i)

goal (1 subgoal):
 1. sum_list (map dim_row Al) = sum_list (map dim_col Al)
[PROOF STEP]
by (metis nth_map_conv)
[PROOF STATE]
proof (state)
this:
sum_list (map dim_row Al) = sum_list (map dim_col Al)

goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map dim_row Al) = sum_list (map dim_col Al)

goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
have "... = dim_col (diag_block_mat Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map dim_col Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
by (simp add:dim_diag_block_mat(2))
[PROOF STATE]
proof (state)
this:
sum_list (map dim_col Al) = dim_col (diag_block_mat Al)

goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)

goal (1 subgoal):
 1. dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cons_le_Cons [simp]: "a # x \<le> b # y \<longleftrightarrow> a < b \<or> a = b \<and> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a # x \<le> b # y) = (a < b \<or> a = b \<and> x \<le> y)
[PROOF STEP]
unfolding list_le_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a # x < b # y \<or> a # x = b # y) = (a < b \<or> a = b \<and> (x < y \<or> x = y))
[PROOF STEP]
by auto


[STATEMENT]
lemma bounded_scaleR_comp:
  fixes f :: "'a \<Rightarrow> 'b::real_normed_vector"
  assumes "bounded (f ` S)"
  shows "bounded ((\<lambda>x. r *\<^sub>R f x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded ((\<lambda>x. r *\<^sub>R f x) ` S)
[PROOF STEP]
using bounded_scaling[of "f ` S" r] assms
[PROOF STATE]
proof (prove)
using this:
bounded (f ` S) \<Longrightarrow> bounded ((*\<^sub>R) r ` f ` S)
bounded (f ` S)

goal (1 subgoal):
 1. bounded ((\<lambda>x. r *\<^sub>R f x) ` S)
[PROOF STEP]
by (auto simp: image_image)


[STATEMENT]
lemma butlast_rest_bl2bin: "bl_to_bin (butlast bl) = bl_to_bin bl div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bl_to_bin (butlast bl) = bl_to_bin bl div 2
[PROOF STEP]
by (cases bl) (auto simp: bl_to_bin_def butlast_rest_bl2bin_aux)


[STATEMENT]
lemma convex_halfspace_Re_le: "convex {x. Re x \<le> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {x. Re x \<le> b}
[PROOF STEP]
using convex_halfspace_le[of "1::complex" b]
[PROOF STATE]
proof (prove)
using this:
convex {x. 1 \<bullet> x \<le> b}

goal (1 subgoal):
 1. convex {x. Re x \<le> b}
[PROOF STEP]
by simp


[STATEMENT]
lemma set_less_aux_code:
  "\<lbrakk> sorted xs; distinct xs; sorted ys; distinct ys \<rbrakk>
  \<Longrightarrow> set xs \<sqsubset>' set ys \<longleftrightarrow> ord.lexordp (>) xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted xs; distinct xs; sorted ys; distinct ys\<rbrakk> \<Longrightarrow> (set xs \<sqsubset>' set ys) = ord.lexordp (\<lambda>x y. y < x) xs ys
[PROOF STEP]
apply(induct xs ys rule: list_induct2')
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>sorted []; distinct []; sorted []; distinct []\<rbrakk> \<Longrightarrow> (set [] \<sqsubset>' set []) = ord.lexordp (\<lambda>x y. y < x) [] []
 2. \<And>x xs. \<lbrakk>sorted (x # xs); distinct (x # xs); sorted []; distinct []\<rbrakk> \<Longrightarrow> (set (x # xs) \<sqsubset>' set []) = ord.lexordp (\<lambda>x y. y < x) (x # xs) []
 3. \<And>y ys. \<lbrakk>sorted []; distinct []; sorted (y # ys); distinct (y # ys)\<rbrakk> \<Longrightarrow> (set [] \<sqsubset>' set (y # ys)) = ord.lexordp (\<lambda>x y. y < x) [] (y # ys)
 4. \<And>x xs y ys. \<lbrakk>\<lbrakk>sorted xs; distinct xs; sorted ys; distinct ys\<rbrakk> \<Longrightarrow> (set xs \<sqsubset>' set ys) = ord.lexordp (\<lambda>x y. y < x) xs ys; sorted (x # xs); distinct (x # xs); sorted (y # ys); distinct (y # ys)\<rbrakk> \<Longrightarrow> (set (x # xs) \<sqsubset>' set (y # ys)) = ord.lexordp (\<lambda>x y. y < x) (x # xs) (y # ys)
[PROOF STEP]
apply(simp_all add: empty_set_less_aux_finite_iff sorted_Cons_Min set_less_aux_rec neq_Nil_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>(set xs \<sqsubset>' set ys) = ord.lexordp (\<lambda>x y. y < x) xs ys; (\<forall>xa\<in>set xs. x \<le> xa) \<and> sorted xs; x \<notin> set xs \<and> distinct xs; (\<forall>x\<in>set ys. y \<le> x) \<and> sorted ys; y \<notin> set ys \<and> distinct ys\<rbrakk> \<Longrightarrow> (y < x \<or> x = y \<and> set xs \<sqsubset>' insert y (set ys) - {x}) = (y < x \<or> \<not> x < y \<and> ord.lexordp (\<lambda>x y. y < x) xs ys)
[PROOF STEP]
apply(auto cong: conj_cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in infinite_coin_toss_space) pseudo_proj_Suc_prefix:
  assumes "pseudo_proj_True n w = pseudo_proj_True n x"
  shows "pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n x, pseudo_proj_False n x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n x, pseudo_proj_False n x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n x, pseudo_proj_False n x}
[PROOF STEP]
have "pseudo_proj_False n w = pseudo_proj_False n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pseudo_proj_False n w = pseudo_proj_False n x
[PROOF STEP]
using assms pseudo_proj_True_imp_False[of n w x]
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_True n w = pseudo_proj_True n x
pseudo_proj_True n w = pseudo_proj_True n x \<Longrightarrow> pseudo_proj_False n w = pseudo_proj_False n x

goal (1 subgoal):
 1. pseudo_proj_False n w = pseudo_proj_False n x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pseudo_proj_False n w = pseudo_proj_False n x

goal (1 subgoal):
 1. pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n x, pseudo_proj_False n x}
[PROOF STEP]
hence "{pseudo_proj_True n w, pseudo_proj_False n w} = {pseudo_proj_True n x, pseudo_proj_False n x}"
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_False n w = pseudo_proj_False n x

goal (1 subgoal):
 1. {pseudo_proj_True n w, pseudo_proj_False n w} = {pseudo_proj_True n x, pseudo_proj_False n x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pseudo_proj_False n w = pseudo_proj_False n x
pseudo_proj_True n w = pseudo_proj_True n x

goal (1 subgoal):
 1. {pseudo_proj_True n w, pseudo_proj_False n w} = {pseudo_proj_True n x, pseudo_proj_False n x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{pseudo_proj_True n w, pseudo_proj_False n w} = {pseudo_proj_True n x, pseudo_proj_False n x}

goal (1 subgoal):
 1. pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n x, pseudo_proj_False n x}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{pseudo_proj_True n w, pseudo_proj_False n w} = {pseudo_proj_True n x, pseudo_proj_False n x}

goal (1 subgoal):
 1. pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n x, pseudo_proj_False n x}
[PROOF STEP]
using pseudo_proj_True_suc_img[of n w]
[PROOF STATE]
proof (prove)
using this:
{pseudo_proj_True n w, pseudo_proj_False n w} = {pseudo_proj_True n x, pseudo_proj_False n x}
pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n w, pseudo_proj_False n w}

goal (1 subgoal):
 1. pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n x, pseudo_proj_False n x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pseudo_proj_True (Suc n) w \<in> {pseudo_proj_True n x, pseudo_proj_False n x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in vec_space) det_zero_low_rank:
assumes "A \<in> carrier_mat n n"
and "det A = 0"
shows "rank A < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A < n
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> rank A < n \<Longrightarrow> False
[PROOF STEP]
assume "\<not> rank A < n"
[PROOF STATE]
proof (state)
this:
\<not> rank A < n

goal (1 subgoal):
 1. \<not> rank A < n \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> rank A < n
[PROOF STEP]
have "rank A = n"
[PROOF STATE]
proof (prove)
using this:
\<not> rank A < n

goal (1 subgoal):
 1. rank A = n
[PROOF STEP]
using rank_le_nc assms le_neq_implies_less
[PROOF STATE]
proof (prove)
using this:
\<not> rank A < n
?A \<in> carrier_mat n ?nc \<Longrightarrow> rank ?A \<le> ?nc
A \<in> carrier_mat n n
det A = (0::'a)
\<lbrakk>?m \<le> ?n; ?m \<noteq> ?n\<rbrakk> \<Longrightarrow> ?m < ?n

goal (1 subgoal):
 1. rank A = n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rank A = n

goal (1 subgoal):
 1. \<not> rank A < n \<Longrightarrow> False
[PROOF STEP]
obtain v where "v \<in> carrier_vec n" "v \<noteq> 0\<^sub>v n" "A *\<^sub>v v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using det_0_iff_vec_prod_zero_field[OF assms(1)] assms(2)
[PROOF STATE]
proof (prove)
using this:
(det A = (0::'a)) = (\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> A *\<^sub>v v = 0\<^sub>v n)
det A = (0::'a)

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n
A *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. \<not> rank A < n \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n
A *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n
A *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. False
[PROOF STEP]
proof (cases "distinct (cols A)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; distinct (cols A)\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; \<not> distinct (cols A)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
distinct (cols A)

goal (2 subgoals):
 1. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; distinct (cols A)\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; \<not> distinct (cols A)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (cols A)
[PROOF STEP]
have "lin_indpt (set (cols A))"
[PROOF STATE]
proof (prove)
using this:
distinct (cols A)

goal (1 subgoal):
 1. lin_indpt (set (cols A))
[PROOF STEP]
using full_rank_lin_indpt
[PROOF STATE]
proof (prove)
using this:
distinct (cols A)
\<lbrakk>?A \<in> carrier_mat n ?nc; rank ?A = ?nc; distinct (cols ?A)\<rbrakk> \<Longrightarrow> lin_indpt (set (cols ?A))

goal (1 subgoal):
 1. lin_indpt (set (cols A))
[PROOF STEP]
using \<open>rank A = n\<close> assms(1)
[PROOF STATE]
proof (prove)
using this:
distinct (cols A)
\<lbrakk>?A \<in> carrier_mat n ?nc; rank ?A = ?nc; distinct (cols ?A)\<rbrakk> \<Longrightarrow> lin_indpt (set (cols ?A))
rank A = n
A \<in> carrier_mat n n

goal (1 subgoal):
 1. lin_indpt (set (cols A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt (set (cols A))

goal (2 subgoals):
 1. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; distinct (cols A)\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; \<not> distinct (cols A)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lin_indpt (set (cols A))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
lin_indpt (set (cols A))

goal (1 subgoal):
 1. False
[PROOF STEP]
using lin_depI[OF assms(1) \<open>v \<in> carrier_vec n\<close> \<open>v \<noteq> 0\<^sub>v n\<close> \<open>A *\<^sub>v v = 0\<^sub>v n\<close>] True
[PROOF STATE]
proof (prove)
using this:
lin_indpt (set (cols A))
distinct (cols A) \<Longrightarrow> lin_dep (set (cols A))
distinct (cols A)

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

goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; \<not> distinct (cols A)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; \<not> distinct (cols A)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> distinct (cols A)

goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; A *\<^sub>v v = 0\<^sub>v n; \<not> distinct (cols A)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> distinct (cols A)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> distinct (cols A)

goal (1 subgoal):
 1. False
[PROOF STEP]
using non_distinct_low_rank \<open>rank A = n\<close> \<open>\<not> rank A < n\<close> assms(1)
[PROOF STATE]
proof (prove)
using this:
\<not> distinct (cols A)
\<lbrakk>?A \<in> carrier_mat n n; \<not> distinct (cols ?A)\<rbrakk> \<Longrightarrow> rank ?A < n
rank A = n
\<not> rank A < n
A \<in> carrier_mat n n

goal (1 subgoal):
 1. False
[PROOF STEP]
by blast
[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 powa_one_eq_one [simp]: "1 powa a = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 powa a = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 powa a = 1
[PROOF STEP]
have "(\<lambda>n. 1 pow\<^sub>\<rat> incseq_of a n) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 pow\<^sub>\<rat> incseq_of a n) \<longlonglongrightarrow> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 1 pow\<^sub>\<rat> incseq_of a n) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. 1 powa a = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. 1 pow\<^sub>\<rat> incseq_of a n) \<longlonglongrightarrow> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 pow\<^sub>\<rat> incseq_of a n) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. 1 powa a = 1
[PROOF STEP]
by (metis Lim_def limI powa_def)
[PROOF STATE]
proof (state)
this:
1 powa a = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lower_triangular_pow_eq:
  assumes "lower_triangular_mat X" "lower_triangular_mat Y" "\<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y" "s' \<le> s"
  shows "row s' (matpow X i) = row s' (matpow Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row s' (matpow X i) = row s' (matpow Y i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lower_triangular_mat X
lower_triangular_mat Y
?s' \<le> s \<Longrightarrow> row ?s' X = row ?s' Y
s' \<le> s

goal (1 subgoal):
 1. row s' (matpow X i) = row s' (matpow Y i)
[PROOF STEP]
proof (induction i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X 0) = row s' (matpow Y 0)
 2. \<And>i. \<lbrakk>\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i); lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i)
lower_triangular_mat X
lower_triangular_mat Y
?s' \<le> s \<Longrightarrow> row ?s' X = row ?s' Y
s' \<le> s

goal (2 subgoals):
 1. \<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X 0) = row s' (matpow Y 0)
 2. \<And>i. \<lbrakk>\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i); lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i)
lower_triangular_mat X
lower_triangular_mat Y
?s' \<le> s \<Longrightarrow> row ?s' X = row ?s' Y
s' \<le> s

goal (1 subgoal):
 1. row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i); lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))
[PROOF STEP]
have ltX: "lower_triangular_mat (matpow X i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_triangular_mat (matpow X i)
[PROOF STEP]
by (simp add: Suc(2) lower_triangular_pow)
[PROOF STATE]
proof (state)
this:
lower_triangular_mat (matpow X i)

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i); lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))
[PROOF STEP]
have ltY: "lower_triangular_mat (matpow Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_triangular_mat (matpow Y i)
[PROOF STEP]
by (simp add: Suc(3) lower_triangular_pow)
[PROOF STATE]
proof (state)
this:
lower_triangular_mat (matpow Y i)

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i); lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))
[PROOF STEP]
have " (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)" for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
have "(\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. if s' < k then 0 else matpow Y i $ s' $ k * X $ k $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. if s' < k then 0::'a else matpow Y i $ s' $ k * X $ k $ j)
[PROOF STEP]
using Suc ltY
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i)
lower_triangular_mat X
lower_triangular_mat Y
?s' \<le> s \<Longrightarrow> row ?s' X = row ?s' Y
s' \<le> s
lower_triangular_mat (matpow Y i)

goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. if s' < k then 0::'a else matpow Y i $ s' $ k * X $ k $ j)
[PROOF STEP]
by (auto simp: row_def lower_triangular_mat_def intro!: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. if s' < k then 0::'a else matpow Y i $ s' $ k * X $ k $ j)

goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. if s' < k then 0::'a else matpow Y i $ s' $ k * X $ k $ j)

goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
have "\<dots> = (\<Sum>k \<in> UNIV . matpow Y i $ s' $ k * Y $ k $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. if s' < k then 0::'a else matpow Y i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
using Suc ltY
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i)
lower_triangular_mat X
lower_triangular_mat Y
?s' \<le> s \<Longrightarrow> row ?s' X = row ?s' Y
s' \<le> s
lower_triangular_mat (matpow Y i)

goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. if s' < k then 0::'a else matpow Y i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
by (auto simp: row_def lower_triangular_mat_def cong: if_cong intro!: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>UNIV. if s' < k then 0::'a else matpow Y i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)

goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)

goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ ?j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ ?j)

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X i) = row s' (matpow Y i); lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<in>UNIV. matpow X i $ s' $ k * X $ k $ ?j) = (\<Sum>k\<in>UNIV. matpow Y i $ s' $ k * Y $ k $ ?j)

goal (1 subgoal):
 1. row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))
[PROOF STEP]
by (auto simp: row_def matrix_matrix_mult_def)
[PROOF STATE]
proof (state)
this:
row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row s' (matpow X (Suc i)) = row s' (matpow Y (Suc i))

goal (1 subgoal):
 1. \<lbrakk>lower_triangular_mat X; lower_triangular_mat Y; \<And>s'. s' \<le> s \<Longrightarrow> row s' X = row s' Y; s' \<le> s\<rbrakk> \<Longrightarrow> row s' (matpow X 0) = row s' (matpow Y 0)
[PROOF STEP]
qed simp


[STATEMENT]
lemma (in Ring) sum_ideals_cont:"\<lbrakk>ideal R I;  A \<subseteq> I; B \<subseteq> I \<rbrakk> \<Longrightarrow> A \<minusplus> B \<subseteq> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; A \<subseteq> I; B \<subseteq> I\<rbrakk> \<Longrightarrow> A \<minusplus> B \<subseteq> I
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; A \<subseteq> I; B \<subseteq> I; aGroup R\<rbrakk> \<Longrightarrow> A \<minusplus> B \<subseteq> I
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>ideal R I; A \<subseteq> I; B \<subseteq> I; aGroup R; x \<in> A \<minusplus> B\<rbrakk> \<Longrightarrow> x \<in> I
[PROOF STEP]
apply (frule ideal_subset1[of I],
        frule subset_trans[of A I "carrier R"], assumption+,
        frule subset_trans[of B I "carrier R"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>ideal R I; A \<subseteq> I; B \<subseteq> I; aGroup R; x \<in> A \<minusplus> B; I \<subseteq> carrier R; A \<subseteq> carrier R; B \<subseteq> carrier R\<rbrakk> \<Longrightarrow> x \<in> I
[PROOF STEP]
apply (simp add:aGroup.set_sum[of R], (erule bexE)+, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x h k. \<lbrakk>ideal R I; A \<subseteq> I; B \<subseteq> I; aGroup R; I \<subseteq> carrier R; A \<subseteq> carrier R; B \<subseteq> carrier R; h \<in> A; k \<in> B; x = h \<plusminus> k\<rbrakk> \<Longrightarrow> h \<plusminus> k \<in> I
[PROOF STEP]
apply (frule_tac c = h in subsetD[of "A" "I"], assumption+,
        frule_tac c = k in subsetD[of "B" "I"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x h k. \<lbrakk>ideal R I; A \<subseteq> I; B \<subseteq> I; aGroup R; I \<subseteq> carrier R; A \<subseteq> carrier R; B \<subseteq> carrier R; h \<in> A; k \<in> B; x = h \<plusminus> k; h \<in> I; k \<in> I\<rbrakk> \<Longrightarrow> h \<plusminus> k \<in> I
[PROOF STEP]
apply (simp add:ideal_pOp_closed)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vunion_iff[simp]: "x \<in>\<^sub>\<circ> A \<union>\<^sub>\<circ> B \<longleftrightarrow> x \<in>\<^sub>\<circ> A \<or> x \<in>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in>\<^sub>\<circ> A \<union>\<^sub>\<circ> B) = (x \<in>\<^sub>\<circ> A \<or> x \<in>\<^sub>\<circ> B)
[PROOF STEP]
by (simp add: elts_sup_iff)


[STATEMENT]
lemma quat_inner_1 [simp]: "inner 1 x = Re x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<bullet> x = quat.Re x
[PROOF STEP]
unfolding inner_quat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat.Re 1 * quat.Re x + Im1 1 * Im1 x + Im2 1 * Im2 x + Im3 1 * Im3 x = quat.Re x
[PROOF STEP]
by simp


[STATEMENT]
lemma negative_mono:
     "\<And> N E' E. wf_graph \<lparr> nodes = N, edges = E \<rparr> \<Longrightarrow>
        E' \<subseteq> E \<Longrightarrow> \<not> c_sinvar m \<lparr> nodes = N, edges = E' \<rparr> \<Longrightarrow> \<not> c_sinvar m \<lparr> nodes = N, edges = E \<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N E' E. \<lbrakk>wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E; \<not> c_sinvar m \<lparr>nodes = N, edges = E'\<rparr>\<rbrakk> \<Longrightarrow> \<not> c_sinvar m \<lparr>nodes = N, edges = E\<rparr>
[PROOF STEP]
by(blast dest: mono_sinvar)


[STATEMENT]
lemma allocationMonotonicity:
  assumes "N1 \<subseteq> N2"
  shows "allAllocations'' N1 \<Omega> \<subseteq> allAllocations'' N2 \<Omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. allAllocations'' N1 \<Omega> \<subseteq> allAllocations'' N2 \<Omega>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N1 \<subseteq> N2

goal (1 subgoal):
 1. allAllocations'' N1 \<Omega> \<subseteq> allAllocations'' N2 \<Omega>
[PROOF STEP]
by auto


[STATEMENT]
lemma (in ring) indexed_padd_const:
  shows "(indexed_const k1) \<Oplus> (indexed_const k2) = indexed_const (k1 \<oplus> k2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indexed_const k1 \<Oplus> indexed_const k2 = indexed_const (k1 \<oplus> k2)
[PROOF STEP]
unfolding indexed_padd_def indexed_const_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. (if m = {#} then k1 else \<zero>) \<oplus> (if m = {#} then k2 else \<zero>)) = (\<lambda>m. if m = {#} then k1 \<oplus> k2 else \<zero>)
[PROOF STEP]
by auto


[STATEMENT]
lemma proj_psi_minus_1_mult_psi'_l:
  "(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
have eq1: "(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l - psi'_l l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l - psi'_l l
[PROOF STEP]
apply (subst minus_mult_distrib_mat_vec)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 2 \<cdot>\<^sub>m proj_psi \<in> carrier_mat ?nr ?nc
 2. 1\<^sub>m N \<in> carrier_mat ?nr ?nc
 3. psi'_l l \<in> carrier_vec ?nc
 4. 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l - 1\<^sub>m N *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l - psi'_l l
[PROOF STEP]
using psi'_l_dim proj_psi'_dim proj_psi_dim
[PROOF STATE]
proof (prove)
using this:
psi'_l ?l \<in> carrier_vec N
proj_psi'_l ?l \<in> carrier_mat N N
proj_psi \<in> carrier_mat N N

goal (4 subgoals):
 1. 2 \<cdot>\<^sub>m proj_psi \<in> carrier_mat ?nr ?nc
 2. 1\<^sub>m N \<in> carrier_mat ?nr ?nc
 3. psi'_l l \<in> carrier_vec ?nc
 4. 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l - 1\<^sub>m N *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l - psi'_l l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l - psi'_l l

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
have eq2: "2 \<cdot>\<^sub>m proj_psi *\<^sub>v (psi'_l l) = 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v (psi'_l l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l)
[PROOF STEP]
apply (subst smult_mat_mult_mat_vec_assoc)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. proj_psi \<in> carrier_mat ?n ?m
 2. psi'_l l \<in> carrier_vec ?m
 3. 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l) = 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l)
[PROOF STEP]
using proj_psi_dim psi'_l_dim
[PROOF STATE]
proof (prove)
using this:
proj_psi \<in> carrier_mat N N
psi'_l ?l \<in> carrier_vec N

goal (3 subgoals):
 1. proj_psi \<in> carrier_mat ?n ?m
 2. psi'_l l \<in> carrier_vec ?m
 3. 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l) = 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l)

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
have "proj_psi *\<^sub>v (psi'_l l) = inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_psi *\<^sub>v psi'_l l = inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
unfolding proj_psi_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod \<psi> \<psi> *\<^sub>v psi'_l l = inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
apply (subst outer_prod_mult_vec[of _ N _ N])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<psi> \<in> carrier_vec N
 2. psi'_l l \<in> carrier_vec N
 3. inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi> = inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
using \<psi>_dim psi'_l_dim
[PROOF STATE]
proof (prove)
using this:
\<psi> \<in> carrier_vec N
dim_vec \<psi> = N
psi'_l ?l \<in> carrier_vec N

goal (3 subgoals):
 1. \<psi> \<in> carrier_vec N
 2. psi'_l l \<in> carrier_vec N
 3. inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi> = inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
proj_psi *\<^sub>v psi'_l l = inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi>

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
proj_psi *\<^sub>v psi'_l l = inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi>

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
have "\<dots> = ((alpha_l l) * ccos (\<theta> / 2) - (beta_l l) * csin (\<theta> / 2)) \<cdot>\<^sub>v \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi> = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
using psi_inner_psi'_l
[PROOF STATE]
proof (prove)
using this:
inner_prod \<psi> (psi'_l ?l) = alpha_l ?l * complex_of_real (cos (\<theta> / 2)) - beta_l ?l * complex_of_real (sin (\<theta> / 2))

goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi> = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod \<psi> (psi'_l l) \<cdot>\<^sub>v \<psi> = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
proj_psi *\<^sub>v psi'_l l = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
have "proj_psi *\<^sub>v (psi'_l l) = ((alpha_l l) * ccos (\<theta> / 2) - (beta_l l) * csin (\<theta> / 2)) \<cdot>\<^sub>v \<psi>"
[PROOF STATE]
proof (prove)
using this:
proj_psi *\<^sub>v psi'_l l = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>

goal (1 subgoal):
 1. proj_psi *\<^sub>v psi'_l l = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
proj_psi *\<^sub>v psi'_l l = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
proj_psi *\<^sub>v psi'_l l = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
have eq3: "2 \<cdot>\<^sub>v (proj_psi *\<^sub>v (psi'_l l)) = 2 * ((alpha_l l) * ccos (\<theta> / 2) - (beta_l l) * csin (\<theta> / 2)) \<cdot>\<^sub>v \<psi>"
[PROOF STATE]
proof (prove)
using this:
proj_psi *\<^sub>v psi'_l l = (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>

goal (1 subgoal):
 1. 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l) = 2 * (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l) = 2 * (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l) = 2 * (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
[PROOF STEP]
show "(2 \<cdot>\<^sub>m proj_psi - (1\<^sub>m N)) *\<^sub>v (psi'_l l) = psi_l (l + 1)"
[PROOF STATE]
proof (prove)
using this:
2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l) = 2 * (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
using eq1 eq2 eq3 psi_l_Suc_l_derive
[PROOF STATE]
proof (prove)
using this:
2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l) = 2 * (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l - psi'_l l
2 \<cdot>\<^sub>m proj_psi *\<^sub>v psi'_l l = 2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l)
2 \<cdot>\<^sub>v (proj_psi *\<^sub>v psi'_l l) = 2 * (alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi>
2 * (alpha_l ?l * complex_of_real (cos (\<theta> / 2)) - beta_l ?l * complex_of_real (sin (\<theta> / 2))) \<cdot>\<^sub>v \<psi> - psi'_l ?l = psi_l (?l + 1)

goal (1 subgoal):
 1. (2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(2 \<cdot>\<^sub>m proj_psi - 1\<^sub>m N) *\<^sub>v psi'_l l = psi_l (l + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_mangoldt [simp]:
  "norm (mangoldt n :: 'a :: real_normed_algebra_1) = mangoldt n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (mangoldt n) = mangoldt n
[PROOF STEP]
proof (cases "primepow n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
 2. \<not> primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
primepow n

goal (2 subgoals):
 1. primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
 2. \<not> primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
[PROOF STEP]
hence "prime (aprimedivisor n)"
[PROOF STATE]
proof (prove)
using this:
primepow n

goal (1 subgoal):
 1. prime (aprimedivisor n)
[PROOF STEP]
by (intro prime_aprimedivisor')
       (auto simp: primepow_def prime_gt_0_nat)
[PROOF STATE]
proof (state)
this:
prime (aprimedivisor n)

goal (2 subgoals):
 1. primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
 2. \<not> primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
[PROOF STEP]
hence "aprimedivisor n > 1"
[PROOF STATE]
proof (prove)
using this:
prime (aprimedivisor n)

goal (1 subgoal):
 1. 1 < aprimedivisor n
[PROOF STEP]
by (simp add: prime_gt_Suc_0_nat)
[PROOF STATE]
proof (state)
this:
1 < aprimedivisor n

goal (2 subgoals):
 1. primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
 2. \<not> primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
primepow n
1 < aprimedivisor n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
primepow n
1 < aprimedivisor n

goal (1 subgoal):
 1. norm (mangoldt n) = mangoldt n
[PROOF STEP]
by (auto simp: mangoldt_def abs_if)
[PROOF STATE]
proof (state)
this:
norm (mangoldt n) = mangoldt n

goal (1 subgoal):
 1. \<not> primepow n \<Longrightarrow> norm (mangoldt n) = mangoldt n
[PROOF STEP]
qed (auto simp: mangoldt_def)


[STATEMENT]
theorem is_SNF_Smith_mxn:
  assumes A: "A \<in> carrier_mat m n"
  shows "is_SNF A (Smith_mxn A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_SNF A (Smith_mxn A)
[PROOF STEP]
using is_SNF_Smith_mxn_ge_2[OF A] is_SNF_Smith_mxn_less_2[OF A]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 < m; 2 < n\<rbrakk> \<Longrightarrow> is_SNF A (Smith_mxn A)
n \<le> 2 \<or> m \<le> 2 \<Longrightarrow> is_SNF A (Smith_mxn A)

goal (1 subgoal):
 1. is_SNF A (Smith_mxn A)
[PROOF STEP]
by linarith


[STATEMENT]
lemma ultraE:
  fixes T (structure)
  shows "\<lbrakk> ultra F; A \<subseteq> carrier;
     A \<in> F \<Longrightarrow> R;
     carrier - A \<in> F \<Longrightarrow> R
  \<rbrakk> \<Longrightarrow> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ultra F; A \<subseteq> carrier; A \<in> F \<Longrightarrow> R; carrier - A \<in> F \<Longrightarrow> R\<rbrakk> \<Longrightarrow> R
[PROOF STEP]
by (auto simp: ultr_def)


[STATEMENT]
lemma it_to_it_linord_correct:
    assumes "set_iterator_linord (it::('x::linorder,'x list) set_iterator) S"
    shows "set_iterator_linord ((it_to_it it)::('x,'\<sigma>) set_iterator) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_linord (it_to_it it) S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set_iterator_linord it S

goal (1 subgoal):
 1. set_iterator_linord (it_to_it it) S
[PROOF STEP]
unfolding set_iterator_linord_def
[PROOF STATE]
proof (prove)
using this:
set_iterator_genord it S (\<le>)

goal (1 subgoal):
 1. set_iterator_genord (it_to_it it) S (\<le>)
[PROOF STEP]
by (rule it_to_it_genord_correct)


[STATEMENT]
lemma lcp_pref_monotone: assumes "w \<le>p r" and "w' \<le>p s" shows "w \<and>\<^sub>p w' \<le>p (r \<and>\<^sub>p s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<and>\<^sub>p w' \<le>p r \<and>\<^sub>p s
[PROOF STEP]
by (intro pref_pref_lcp,
      intro pref_trans[OF _ \<open>w \<le>p r\<close>],
      intro lcp_pref,
      intro pref_trans[OF  _ \<open>w' \<le>p s\<close>],
      intro lcp_pref')


[STATEMENT]
lemma holomorphic_Dirichlet_L_weak:
  assumes "m > 0" "1 \<notin> A"
  shows   "Dirichlet_L m \<chi> holomorphic_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dirichlet_L m \<chi> holomorphic_on A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Dirichlet_L m \<chi> holomorphic_on A
[PROOF STEP]
have "(\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s))
           holomorphic_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s)) holomorphic_on A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < m
1 \<notin> A

goal (1 subgoal):
 1. (\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s)) holomorphic_on A
[PROOF STEP]
unfolding Dirichlet_L_def
[PROOF STATE]
proof (prove)
using this:
0 < m
1 \<notin> A

goal (1 subgoal):
 1. (\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s)) holomorphic_on A
[PROOF STEP]
by (intro holomorphic_intros) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s)) holomorphic_on A

goal (1 subgoal):
 1. Dirichlet_L m \<chi> holomorphic_on A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s)) holomorphic_on A

goal (1 subgoal):
 1. Dirichlet_L m \<chi> holomorphic_on A
[PROOF STEP]
have "?this \<longleftrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s)) holomorphic_on A) = (Dirichlet_L m \<chi> holomorphic_on A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < m
1 \<notin> A

goal (1 subgoal):
 1. ((\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s)) holomorphic_on A) = (Dirichlet_L m \<chi> holomorphic_on A)
[PROOF STEP]
by (intro holomorphic_cong refl) (auto simp: Dirichlet_L_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>s. of_nat m powr - s * (\<Sum>k = 1..m. \<chi> k * hurwitz_zeta (real k / real m) s)) holomorphic_on A) = (Dirichlet_L m \<chi> holomorphic_on A)

goal (1 subgoal):
 1. Dirichlet_L m \<chi> holomorphic_on A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Dirichlet_L m \<chi> holomorphic_on A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Dirichlet_L m \<chi> holomorphic_on A

goal (1 subgoal):
 1. Dirichlet_L m \<chi> holomorphic_on A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Dirichlet_L m \<chi> holomorphic_on A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filtrationI:
  assumes "\<forall>t. subalgebra M (F t)"
  and "\<forall>s t. s \<le> t \<longrightarrow> subalgebra (F t) (F s)"
shows "filtration M F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Filtration.filtration M F
[PROOF STEP]
unfolding filtration_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>t. subalgebra M (F t)) \<and> (\<forall>s t. s \<le> t \<longrightarrow> subalgebra (F t) (F s))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>t. subalgebra M (F t)
\<forall>s t. s \<le> t \<longrightarrow> subalgebra (F t) (F s)

goal (1 subgoal):
 1. (\<forall>t. subalgebra M (F t)) \<and> (\<forall>s t. s \<le> t \<longrightarrow> subalgebra (F t) (F s))
[PROOF STEP]
by simp


[STATEMENT]
lemma sums_mult: "f sums a \<Longrightarrow> (\<lambda>n. c * f n) sums (c * a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums a \<Longrightarrow> (\<lambda>n. c * f n) sums (c * a)
[PROOF STEP]
by (rule bounded_linear.sums [OF bounded_linear_mult_right])


[STATEMENT]
lemma "(x + y = y) = (x = (0::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y = y) = (x = 0)
[PROOF STEP]
by arith


[STATEMENT]
lemma scaleC_nonneg_nonneg: "0 \<le> a \<Longrightarrow> 0 \<le> x \<Longrightarrow> 0 \<le> a *\<^sub>C x"
  for x :: "'a::ordered_complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; (0::'a) \<le> x\<rbrakk> \<Longrightarrow> (0::'a) \<le> a *\<^sub>C x
[PROOF STEP]
using scaleC_left_mono [of 0 x a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) \<le> x; 0 \<le> a\<rbrakk> \<Longrightarrow> a *\<^sub>C (0::'a) \<le> a *\<^sub>C x

goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; (0::'a) \<le> x\<rbrakk> \<Longrightarrow> (0::'a) \<le> a *\<^sub>C x
[PROOF STEP]
by simp


[STATEMENT]
lemma leadsETo_Union:
    "(\<And>A. A \<in> S \<Longrightarrow> F \<in> A leadsTo[CC] B) \<Longrightarrow> F \<in> (\<Union>S) leadsTo[CC] B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> A leadsTo[CC] B) \<Longrightarrow> F \<in> \<Union> S leadsTo[CC] B
[PROOF STEP]
apply (unfold leadsETo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> {F. (A, B) \<in> elt CC F}) \<Longrightarrow> F \<in> {F. (\<Union> S, B) \<in> elt CC F}
[PROOF STEP]
apply (blast intro: elt.Union)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma N_zero_iff [simp]: "N n = 0 \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (N n = 0) = (n = 0)
[PROOF STEP]
using N_pos[of n]
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0 \<Longrightarrow> 0 < N n

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


[STATEMENT]
lemma surj_bullet_1: "surj (\<lambda>s::'a::{real_normed_algebra_1, real_inner}. s \<bullet> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj (\<lambda>s. s \<bullet> (1::'a))
[PROOF STEP]
proof (rule surjI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?f x \<bullet> (1::'a) = x
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ?f x \<bullet> (1::'a) = x
[PROOF STEP]
show "(x *\<^sub>R 1) \<bullet> (1 :: 'a) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>R (1::'a) \<bullet> (1::'a) = x
[PROOF STEP]
by (simp add: dot_square_norm)
[PROOF STATE]
proof (state)
this:
x *\<^sub>R (1::'a) \<bullet> (1::'a) = x

goal:
No subgoals!
[PROOF STEP]
qed