[STATEMENT]
lemma bigo_plus_eq: "\<forall>x. 0 <= f x \<Longrightarrow> \<forall>x. 0 <= g x \<Longrightarrow> O(f + g) = O(f) + O(g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x\<rbrakk> \<Longrightarrow> O(f + g) = O(f) + O(g)
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x\<rbrakk> \<Longrightarrow> O(f + g) \<subseteq> O(f) + O(g)
 2. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x\<rbrakk> \<Longrightarrow> O(f) + O(g) \<subseteq> O(f + g)
[PROOF STEP]
apply (rule bigo_plus_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x\<rbrakk> \<Longrightarrow> O(f) + O(g) \<subseteq> O(f + g)
[PROOF STEP]
apply (simp add: bigo_alt_def set_plus_def func_plus)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x\<rbrakk> \<Longrightarrow> {c. \<exists>a. (\<exists>c>0::'b. \<forall>x. \<bar>a x\<bar> \<le> c * f x) \<and> (\<exists>b. (\<exists>c>0::'b. \<forall>x. \<bar>b x\<bar> \<le> c * g x) \<and> c = (\<lambda>x. a x + b x))} \<subseteq> {h. \<exists>c>0::'b. \<forall>x. \<bar>h x\<bar> \<le> c * (f x + g x)}
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a c b ca. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x; (0::'b) < c; \<forall>x. \<bar>a x\<bar> \<le> c * f x; (0::'b) < ca; \<forall>x. \<bar>b x\<bar> \<le> ca * g x\<rbrakk> \<Longrightarrow> \<exists>c>0::'b. \<forall>x. \<bar>a x + b x\<bar> \<le> c * (f x + g x)
[PROOF STEP]
apply (rule_tac x = "max c ca" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a c b ca. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x; (0::'b) < c; \<forall>x. \<bar>a x\<bar> \<le> c * f x; (0::'b) < ca; \<forall>x. \<bar>b x\<bar> \<le> ca * g x\<rbrakk> \<Longrightarrow> (0::'b) < max c ca \<and> (\<forall>x. \<bar>a x + b x\<bar> \<le> max c ca * (f x + g x))
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x a c b ca. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x; (0::'b) < c; \<forall>x. \<bar>a x\<bar> \<le> c * f x; (0::'b) < ca; \<forall>x. \<bar>b x\<bar> \<le> ca * g x\<rbrakk> \<Longrightarrow> (0::'b) < max c ca
 2. \<And>x a c b ca. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x; (0::'b) < c; \<forall>x. \<bar>a x\<bar> \<le> c * f x; (0::'b) < ca; \<forall>x. \<bar>b x\<bar> \<le> ca * g x\<rbrakk> \<Longrightarrow> \<forall>x. \<bar>a x + b x\<bar> \<le> max c ca * (f x + g x)
[PROOF STEP]
apply (metis less_max_iff_disj)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a c b ca. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x; (0::'b) < c; \<forall>x. \<bar>a x\<bar> \<le> c * f x; (0::'b) < ca; \<forall>x. \<bar>b x\<bar> \<le> ca * g x\<rbrakk> \<Longrightarrow> \<forall>x. \<bar>a x + b x\<bar> \<le> max c ca * (f x + g x)
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a c b ca xa. \<lbrakk>\<forall>x. (0::'b) \<le> f x; \<forall>x. (0::'b) \<le> g x; (0::'b) < c; \<forall>x. \<bar>a x\<bar> \<le> c * f x; (0::'b) < ca; \<forall>x. \<bar>b x\<bar> \<le> ca * g x\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> max c ca * (f xa + g xa)
[PROOF STEP]
apply (drule_tac x = "xa" in spec)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> max c ca * (f xa + g xa)
[PROOF STEP]
apply (subgoal_tac "0 <= f xa + g xa")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; (0::'b) \<le> f xa + g xa\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> max c ca * (f xa + g xa)
 2. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> (0::'b) \<le> f xa + g xa
[PROOF STEP]
apply (simp add: ring_distribs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> max c ca * f xa + max c ca * g xa
 2. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> (0::'b) \<le> f xa + g xa
[PROOF STEP]
apply (subgoal_tac "\<bar>a xa + b xa\<bar> <= \<bar>a xa\<bar> + \<bar>b xa\<bar>")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> max c ca * f xa + max c ca * g xa
 2. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>
 3. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> (0::'b) \<le> f xa + g xa
[PROOF STEP]
apply (subgoal_tac "\<bar>a xa\<bar> + \<bar>b xa\<bar> <= max c ca * f xa + max c ca * g xa")
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>; \<bar>a xa\<bar> + \<bar>b xa\<bar> \<le> max c ca * f xa + max c ca * g xa\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> max c ca * f xa + max c ca * g xa
 2. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>a xa\<bar> + \<bar>b xa\<bar> \<le> max c ca * f xa + max c ca * g xa
 3. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>
 4. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> (0::'b) \<le> f xa + g xa
[PROOF STEP]
apply (metis order_trans)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>a xa\<bar> + \<bar>b xa\<bar> \<le> max c ca * f xa + max c ca * g xa
 2. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>
 3. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> (0::'b) \<le> f xa + g xa
[PROOF STEP]
defer 1
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>
 2. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> (0::'b) \<le> f xa + g xa
 3. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>a xa\<bar> + \<bar>b xa\<bar> \<le> max c ca * f xa + max c ca * g xa
[PROOF STEP]
apply (metis abs_triangle_ineq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa\<rbrakk> \<Longrightarrow> (0::'b) \<le> f xa + g xa
 2. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>a xa\<bar> + \<bar>b xa\<bar> \<le> max c ca * f xa + max c ca * g xa
[PROOF STEP]
apply (metis add_nonneg_nonneg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>a xa\<bar> + \<bar>b xa\<bar> \<le> max c ca * f xa + max c ca * g xa
[PROOF STEP]
apply (rule add_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>a xa\<bar> \<le> max c ca * f xa
 2. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>b xa\<bar> \<le> max c ca * g xa
[PROOF STEP]
apply (metis max.cobounded2 linorder_linear max.absorb1 mult_right_mono xt1(6))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a c b ca xa. \<lbrakk>(0::'b) < c; (0::'b) < ca; (0::'b) \<le> f xa; (0::'b) \<le> g xa; \<bar>a xa\<bar> \<le> c * f xa; \<bar>b xa\<bar> \<le> ca * g xa; \<bar>a xa + b xa\<bar> \<le> \<bar>a xa\<bar> + \<bar>b xa\<bar>\<rbrakk> \<Longrightarrow> \<bar>b xa\<bar> \<le> max c ca * g xa
[PROOF STEP]
by (metis max.cobounded2 linorder_not_le mult_le_cancel_right order_trans)


[STATEMENT]
lemma integral_spmf_of_set: "integral\<^sup>L (measure_spmf (spmf_of_set A)) f = sum f A / card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (measure_spmf (spmf_of_set A)) f = sum f A / real (card A)
[PROOF STEP]
by(clarsimp simp add: spmf_of_set_def integral_pmf_of_set card_gt_0_iff simp del: spmf_of_pmf_pmf_of_set)


[STATEMENT]
lemma mult_minus2_right: "x * -2 = - (x * 2)"
  for x :: "'a::comm_ring_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * - (2::'a) = - (x * (2::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma "eq (Node (1::nat) (Node 2 Leaf Leaf) (Node 3 Leaf Leaf)) (Node (1::nat) (Node 2 Leaf Leaf) (Node 4 Leaf Leaf))
    \<longleftrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq (Node 1 (Node 2 Leaf Leaf) (Node 3 Leaf Leaf)) (Node 1 (Node 2 Leaf Leaf) (Node 4 Leaf Leaf)) = False
[PROOF STEP]
by eval


[STATEMENT]
lemma mapping_of_bind_pmf:
  assumes "finite (set_pmf p)"
  shows   "mapping_of_pmf (bind_pmf p f) =
             fold_combine_plus (\<lambda>x. Mapping.map_values (\<lambda>_. (*) (pmf p x))
               (mapping_of_pmf (f x))) (set_pmf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mapping_of_pmf (p \<bind> f) = fold_combine_plus (\<lambda>x. Mapping.map_values (\<lambda>_. (*) (pmf p x)) (mapping_of_pmf (f x))) (set_pmf p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (set_pmf p)

goal (1 subgoal):
 1. mapping_of_pmf (p \<bind> f) = fold_combine_plus (\<lambda>x. Mapping.map_values (\<lambda>_. (*) (pmf p x)) (mapping_of_pmf (f x))) (set_pmf p)
[PROOF STEP]
by (intro mapping_of_pmfI')
     (auto simp: keys_fold_combine_plus lookup_default_fold_combine_plus
                 pmf_bind integral_measure_pmf lookup_default_0_map_values
                 lookup_default_mapping_of_pmf mult_ac)


[STATEMENT]
lemma det_rows_sum:
  "det (upd_rows M T (\<lambda>i. \<Sum>s\<in>S. a i s)) = (\<Sum>f\<in>T \<rightarrow>\<^sub>E S. det (upd_rows M T (\<lambda>i. a i (f i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (upd_rows M T (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_rows M T (\<lambda>i. a i (f i))))
[PROOF STEP]
using det_cols_sum[of "transpose M" T a S]
[PROOF STATE]
proof (prove)
using this:
Square_Matrix.det (upd_cols (Square_Matrix.transpose M) T (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols (Square_Matrix.transpose M) T (\<lambda>i. a i (f i))))

goal (1 subgoal):
 1. Square_Matrix.det (upd_rows M T (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_rows M T (\<lambda>i. a i (f i))))
[PROOF STEP]
by (simp add: upd_cols_transpose det_transpose)


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


[STATEMENT]
lemma regularCard_all_ex:
assumes r: "Card_order r"   "regularCard r"
and As: "\<And> i j b. b \<in> B \<Longrightarrow> (i,j) \<in> r \<Longrightarrow> P i b \<Longrightarrow> P j b"
and Bsub: "\<forall> b \<in> B. \<exists> i \<in> Field r. P i b"
and cardB: "|B| <o r"
shows "\<exists> i \<in> Field r. \<forall> b \<in> B. P i b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i\<in>Field r. \<forall>b\<in>B. P i b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i\<in>Field r. \<forall>b\<in>B. P i b
[PROOF STEP]
let ?As = "\<lambda>i. {b \<in> B. P i b}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i\<in>Field r. \<forall>b\<in>B. P i b
[PROOF STEP]
have "\<exists>i \<in> Field r. B \<le> ?As i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i\<in>Field r. B \<subseteq> {b \<in> B. P i b}
[PROOF STEP]
apply(rule regularCard_UNION)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. Card_order r
 2. regularCard r
 3. relChain r (\<lambda>i. {b \<in> B. P i b})
 4. B \<subseteq> (\<Union>i\<in>Field r. {b \<in> B. P i b})
 5. |B| <o r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Card_order r
regularCard r
\<lbrakk>?b \<in> B; (?i, ?j) \<in> r; P ?i ?b\<rbrakk> \<Longrightarrow> P ?j ?b
\<forall>b\<in>B. \<exists>i\<in>Field r. P i b
|B| <o r

goal (5 subgoals):
 1. Card_order r
 2. regularCard r
 3. relChain r (\<lambda>i. {b \<in> B. P i b})
 4. B \<subseteq> (\<Union>i\<in>Field r. {b \<in> B. P i b})
 5. |B| <o r
[PROOF STEP]
unfolding relChain_def
[PROOF STATE]
proof (prove)
using this:
Card_order r
regularCard r
\<lbrakk>?b \<in> B; (?i, ?j) \<in> r; P ?i ?b\<rbrakk> \<Longrightarrow> P ?j ?b
\<forall>b\<in>B. \<exists>i\<in>Field r. P i b
|B| <o r

goal (5 subgoals):
 1. Card_order r
 2. regularCard r
 3. \<forall>i j. (i, j) \<in> r \<longrightarrow> {b \<in> B. P i b} \<subseteq> {b \<in> B. P j b}
 4. B \<subseteq> (\<Union>i\<in>Field r. {b \<in> B. P i b})
 5. |B| <o r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>i\<in>Field r. B \<subseteq> {b \<in> B. P i b}

goal (1 subgoal):
 1. \<exists>i\<in>Field r. \<forall>b\<in>B. P i b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>i\<in>Field r. B \<subseteq> {b \<in> B. P i b}

goal (1 subgoal):
 1. \<exists>i\<in>Field r. \<forall>b\<in>B. P i b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>i\<in>Field r. \<forall>b\<in>B. P i b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vifunion_vintersection_index_left[simp]: "(\<Union>\<^sub>\<circ>C\<in>\<^sub>\<circ>B. C \<inter>\<^sub>\<circ> A) = \<Union>\<^sub>\<circ>B \<inter>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>B. a \<inter>\<^sub>\<circ> A) `\<^sub>\<circ> B) = \<Union>\<^sub>\<circ> B \<inter>\<^sub>\<circ> A
[PROOF STEP]
by (force simp: vimage_VLambda_vrange_rep)


[STATEMENT]
lemma impl_prop [simp]: "\<lceil>P\<rceil> \<subseteq> \<lceil>Q\<rceil> \<longleftrightarrow> (\<forall>s. P s \<longrightarrow>  Q s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>P\<rceil> \<subseteq> \<lceil>Q\<rceil>) = (\<forall>s. P s \<longrightarrow> Q s)
[PROOF STEP]
by auto


[STATEMENT]
lemma rbt_height_bheight_if: "invc t \<Longrightarrow> invh t \<Longrightarrow>
  height t \<le> 2 * bheight t + (if color t = Black then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invc t; invh t\<rbrakk> \<Longrightarrow> height t \<le> 2 * bheight t + (if color t = Black then 0 else 1)
[PROOF STEP]
by(induction t) (auto split: if_split_asm)


[STATEMENT]
lemma limproc_is_thelub_fun:
assumes     "chain S"
shows       "(Lub S c) = lim_proc (range (\<lambda>x. (S x c)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lub S c = lim_proc (range (\<lambda>x. S x c))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Lub S c = lim_proc (range (\<lambda>x. S x c))
[PROOF STEP]
have    "\<And>xa. chain (\<lambda>x. S x xa)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. chain (\<lambda>x. S x xa)
[PROOF STEP]
using \<open>chain S\<close>
[PROOF STATE]
proof (prove)
using this:
chain S

goal (1 subgoal):
 1. \<And>xa. chain (\<lambda>x. S x xa)
[PROOF STEP]
by(auto intro!: chainI  simp: chain_def fun_belowD )
[PROOF STATE]
proof (state)
this:
chain (\<lambda>x. S x ?xa)

goal (1 subgoal):
 1. Lub S c = lim_proc (range (\<lambda>x. S x c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
chain (\<lambda>x. S x ?xa)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
chain (\<lambda>x. S x ?xa)

goal (1 subgoal):
 1. Lub S c = lim_proc (range (\<lambda>x. S x c))
[PROOF STEP]
by (metis contlub_lambda limproc_is_thelub)
[PROOF STATE]
proof (state)
this:
Lub S c = lim_proc (range (\<lambda>x. S x c))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_0_content:
  fixes p :: "int poly"
  assumes deg: "degree p = 0" shows "content p = abs (coeff p 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content p = \<bar>coeff p 0\<bar>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. content p = \<bar>coeff p 0\<bar>
[PROOF STEP]
from deg
[PROOF STATE]
proof (chain)
picking this:
degree p = 0
[PROOF STEP]
obtain a where p: "p = [:a:]"
[PROOF STATE]
proof (prove)
using this:
degree p = 0

goal (1 subgoal):
 1. (\<And>a. p = [:a:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto dest: degree0_coeffs)
[PROOF STATE]
proof (state)
this:
p = [:a:]

goal (1 subgoal):
 1. content p = \<bar>coeff p 0\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content p = \<bar>coeff p 0\<bar>
[PROOF STEP]
by (auto simp: p)
[PROOF STATE]
proof (state)
this:
content p = \<bar>coeff p 0\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uminus_Span_code[code]: "- X = range_cblinfun_code (id_cblinfun - Proj X)"
  \<comment> \<open>Code equation for the orthogonal complement of a subspace \<^term>\<open>X\<close>.
      Computed as the range of one minus the projector on \<^term>\<open>X\<close>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - X = range_cblinfun_code (id_cblinfun - Proj X)
[PROOF STEP]
unfolding range_cblinfun_code_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - X = (id_cblinfun - Proj X) *\<^sub>S \<top>
[PROOF STEP]
by (metis Proj_ortho_compl Proj_range)


[STATEMENT]
lemma Max_the: "
  \<lbrakk> A \<noteq> {}; finite A \<rbrakk> \<Longrightarrow>
  Max A = (THE x. x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; finite A\<rbrakk> \<Longrightarrow> Max A = (THE x. x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x))
[PROOF STEP]
apply (rule iffD1[OF eq_commute])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; finite A\<rbrakk> \<Longrightarrow> (THE x. x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)) = Max A
[PROOF STEP]
apply (rule the_equality, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<noteq> {}; finite A; x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> x = Max A
[PROOF STEP]
apply (rule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<noteq> {}; finite A; x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> Max A = x
[PROOF STEP]
apply (rule Max_equality)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>A \<noteq> {}; finite A; x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> x \<in> A
 2. \<And>x. \<lbrakk>A \<noteq> {}; finite A; x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> finite A
 3. \<And>x xa. \<lbrakk>A \<noteq> {}; finite A; x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x); xa \<in> A\<rbrakk> \<Longrightarrow> xa \<le> x
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in finite_measure) uncountable_disjoint_family_then_exists_zero_measure:
  assumes [measurable]: "\<And>i. i \<in> I \<Longrightarrow> A i \<in> sets M"
      and "uncountable I"
          "disjoint_family_on A I"
  shows "\<exists>i\<in>I. measure M (A i) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
define f where "f = (\<lambda>(r::real). {i \<in> I. measure M (A i) > r})"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>r. {i \<in> I. r < Sigma_Algebra.measure M (A i)})

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
have *: "finite (f r)" if "r > 0" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (f r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (f r)
[PROOF STEP]
obtain N::nat where N: "measure M (space M)/r \<le> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. Sigma_Algebra.measure M (space M) / r \<le> real N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using real_arch_simple
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ?x \<le> of_nat n

goal (1 subgoal):
 1. (\<And>N. Sigma_Algebra.measure M (space M) / r \<le> real N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (space M) / r \<le> real N

goal (1 subgoal):
 1. finite (f r)
[PROOF STEP]
have "finite (f r) \<and> card (f r) \<le> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (f r) \<and> card (f r) \<le> N
[PROOF STEP]
proof (rule finite_if_finite_subsets_card_bdd)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
fix G
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
assume G: "G \<subseteq> f r" "finite G"
[PROOF STATE]
proof (state)
this:
G \<subseteq> f r
finite G

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
G \<subseteq> f r
finite G
[PROOF STEP]
have "G \<subseteq> I"
[PROOF STATE]
proof (prove)
using this:
G \<subseteq> f r
finite G

goal (1 subgoal):
 1. G \<subseteq> I
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
G \<subseteq> {i \<in> I. r < Sigma_Algebra.measure M (A i)}
finite G

goal (1 subgoal):
 1. G \<subseteq> I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
G \<subseteq> I

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
have "card G * r = (\<Sum>i \<in> G. r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card G) * r = (\<Sum>i\<in>G. r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (card G) * r = (\<Sum>i\<in>G. r)

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (card G) * r = (\<Sum>i\<in>G. r)

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
have "... \<le> (\<Sum>i \<in> G. measure M (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>G. r) \<le> (\<Sum>i\<in>G. Sigma_Algebra.measure M (A i))
[PROOF STEP]
apply (rule sum_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> G \<Longrightarrow> r \<le> Sigma_Algebra.measure M (A i)
[PROOF STEP]
using G
[PROOF STATE]
proof (prove)
using this:
G \<subseteq> f r
finite G

goal (1 subgoal):
 1. \<And>i. i \<in> G \<Longrightarrow> r \<le> Sigma_Algebra.measure M (A i)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
G \<subseteq> {i \<in> I. r < Sigma_Algebra.measure M (A i)}
finite G

goal (1 subgoal):
 1. \<And>i. i \<in> G \<Longrightarrow> r \<le> Sigma_Algebra.measure M (A i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>G. r) \<le> (\<Sum>i\<in>G. Sigma_Algebra.measure M (A i))

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>G. r) \<le> (\<Sum>i\<in>G. Sigma_Algebra.measure M (A i))

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
have "... = measure M (\<Union>i\<in>G. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>G. Sigma_Algebra.measure M (A i)) = Sigma_Algebra.measure M (\<Union> (A ` G))
[PROOF STEP]
apply (rule finite_measure_finite_Union[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite G
 2. A ` G \<subseteq> sets M
 3. disjoint_family_on A G
[PROOF STEP]
using \<open>finite G\<close> \<open>G \<subseteq> I\<close> \<open>disjoint_family_on A I\<close> disjoint_family_on_mono
[PROOF STATE]
proof (prove)
using this:
finite G
G \<subseteq> I
disjoint_family_on A I
\<lbrakk>?A \<subseteq> ?B; disjoint_family_on ?f ?B\<rbrakk> \<Longrightarrow> disjoint_family_on ?f ?A

goal (3 subgoals):
 1. finite G
 2. A ` G \<subseteq> sets M
 3. disjoint_family_on A G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>G. Sigma_Algebra.measure M (A i)) = Sigma_Algebra.measure M (\<Union> (A ` G))

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>G. Sigma_Algebra.measure M (A i)) = Sigma_Algebra.measure M (\<Union> (A ` G))

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
have "... \<le> measure M (space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (\<Union> (A ` G)) \<le> Sigma_Algebra.measure M (space M)
[PROOF STEP]
by (simp add: bounded_measure)
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (\<Union> (A ` G)) \<le> Sigma_Algebra.measure M (space M)

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (card G) * r \<le> Sigma_Algebra.measure M (space M)
[PROOF STEP]
have "card G \<le> measure M (space M)/r"
[PROOF STATE]
proof (prove)
using this:
real (card G) * r \<le> Sigma_Algebra.measure M (space M)

goal (1 subgoal):
 1. real (card G) \<le> Sigma_Algebra.measure M (space M) / r
[PROOF STEP]
using \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
real (card G) * r \<le> Sigma_Algebra.measure M (space M)
0 < r

goal (1 subgoal):
 1. real (card G) \<le> Sigma_Algebra.measure M (space M) / r
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
real (card G) \<le> Sigma_Algebra.measure M (space M) / r

goal (1 subgoal):
 1. \<And>G. \<lbrakk>G \<subseteq> f r; finite G\<rbrakk> \<Longrightarrow> card G \<le> N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (card G) \<le> Sigma_Algebra.measure M (space M) / r
[PROOF STEP]
show "card G \<le> N"
[PROOF STATE]
proof (prove)
using this:
real (card G) \<le> Sigma_Algebra.measure M (space M) / r

goal (1 subgoal):
 1. card G \<le> N
[PROOF STEP]
using N
[PROOF STATE]
proof (prove)
using this:
real (card G) \<le> Sigma_Algebra.measure M (space M) / r
Sigma_Algebra.measure M (space M) / r \<le> real N

goal (1 subgoal):
 1. card G \<le> N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card G \<le> N

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite (f r) \<and> card (f r) \<le> N

goal (1 subgoal):
 1. finite (f r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (f r) \<and> card (f r) \<le> N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (f r) \<and> card (f r) \<le> N

goal (1 subgoal):
 1. finite (f r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (f r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?r \<Longrightarrow> finite (f ?r)

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
have "countable (\<Union>n. f (((1::real)/2)^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (\<Union>n. f ((1 / 2) ^ n))
[PROOF STEP]
by (rule countable_UN, auto intro!: countable_finite *)
[PROOF STATE]
proof (state)
this:
countable (\<Union>n. f ((1 / 2) ^ n))

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
countable (\<Union>n. f ((1 / 2) ^ n))
[PROOF STEP]
have "I - (\<Union>n. f (((1::real)/2)^n)) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
countable (\<Union>n. f ((1 / 2) ^ n))

goal (1 subgoal):
 1. I - (\<Union>n. f ((1 / 2) ^ n)) \<noteq> {}
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
countable (\<Union>n. f ((1 / 2) ^ n))
uncountable I

goal (1 subgoal):
 1. I - (\<Union>n. f ((1 / 2) ^ n)) \<noteq> {}
[PROOF STEP]
by (metis countable_empty uncountable_minus_countable)
[PROOF STATE]
proof (state)
this:
I - (\<Union>n. f ((1 / 2) ^ n)) \<noteq> {}

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
I - (\<Union>n. f ((1 / 2) ^ n)) \<noteq> {}
[PROOF STEP]
obtain i where "i \<in> I" "i \<notin> (\<Union>n. f ((1/2)^n))"
[PROOF STATE]
proof (prove)
using this:
I - (\<Union>n. f ((1 / 2) ^ n)) \<noteq> {}

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i \<in> I; i \<notin> (\<Union>n. f ((1 / 2) ^ n))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in> I
i \<notin> (\<Union>n. f ((1 / 2) ^ n))

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> I
i \<notin> (\<Union>n. f ((1 / 2) ^ n))
[PROOF STEP]
have "measure M (A i) \<le> (1 / 2) ^ n" for n
[PROOF STATE]
proof (prove)
using this:
i \<in> I
i \<notin> (\<Union>n. f ((1 / 2) ^ n))

goal (1 subgoal):
 1. Sigma_Algebra.measure M (A i) \<le> (1 / 2) ^ n
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
i \<in> I
i \<notin> (\<Union>n. {i \<in> I. (1 / 2) ^ n < Sigma_Algebra.measure M (A i)})

goal (1 subgoal):
 1. Sigma_Algebra.measure M (A i) \<le> (1 / 2) ^ n
[PROOF STEP]
using linorder_not_le
[PROOF STATE]
proof (prove)
using this:
i \<in> I
i \<notin> (\<Union>n. {i \<in> I. (1 / 2) ^ n < Sigma_Algebra.measure M (A i)})
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. Sigma_Algebra.measure M (A i) \<le> (1 / 2) ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (A i) \<le> (1 / 2) ^ ?n

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (A i) \<le> (1 / 2) ^ ?n

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
have "(\<lambda>n. ((1::real) / 2) ^ n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (^) (1 / 2) \<longlonglongrightarrow> 0
[PROOF STEP]
by (intro tendsto_intros, auto)
[PROOF STATE]
proof (state)
this:
(^) (1 / 2) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Sigma_Algebra.measure M (A i) \<le> (1 / 2) ^ ?n
(^) (1 / 2) \<longlonglongrightarrow> 0
[PROOF STEP]
have "measure M (A i) \<le> 0"
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (A i) \<le> (1 / 2) ^ ?n
(^) (1 / 2) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. Sigma_Algebra.measure M (A i) \<le> 0
[PROOF STEP]
using LIMSEQ_le_const
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (A i) \<le> (1 / 2) ^ ?n
(^) (1 / 2) \<longlonglongrightarrow> 0
\<lbrakk>?X \<longlonglongrightarrow> ?x; \<exists>N. \<forall>n\<ge>N. ?a \<le> ?X n\<rbrakk> \<Longrightarrow> ?a \<le> ?x

goal (1 subgoal):
 1. Sigma_Algebra.measure M (A i) \<le> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (A i) \<le> 0

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sigma_Algebra.measure M (A i) \<le> 0
[PROOF STEP]
have "measure M (A i) = 0"
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (A i) \<le> 0

goal (1 subgoal):
 1. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
by (simp add: measure_le_0_iff)
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M (A i) = 0

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (A i) = 0

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
using \<open>i \<in> I\<close>
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (A i) = 0
i \<in> I

goal (1 subgoal):
 1. \<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>i\<in>I. Sigma_Algebra.measure M (A i) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) subgroup_card_eq_order:
  assumes "subgroup H G"
  shows "card H = order (G\<lparr>carrier := H\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H = order (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H = card (carrier (G\<lparr>carrier := H\<rparr>))
[PROOF STEP]
by simp


[STATEMENT]
lemma mono_ge_id: \<open>\<forall> i. f i < f (Suc i) \<Longrightarrow> i \<le> f i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. f i < f (Suc i) \<Longrightarrow> i \<le> f i
[PROOF STEP]
apply (induction \<open>i\<close>,auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i \<le> f i; \<forall>i. f i < f (Suc i)\<rbrakk> \<Longrightarrow> Suc i \<le> f (Suc i)
[PROOF STEP]
by (metis not_le not_less_eq_eq order_trans)


[STATEMENT]
lemma norm_EM_remainder'_le:
  fixes f :: "real \<Rightarrow> 'a :: {real_normed_field, banach}"
    and g g' :: "real \<Rightarrow> real"
  assumes cont_f: "continuous_on {a..} f"
  assumes cont_g': "continuous_on {a..} g'"
  assumes f_bigo: "eventually (\<lambda>x. norm (f x) \<le> g' x) at_top"
  assumes deriv:  "eventually (\<lambda>x. (g has_field_derivative g' x) (at x)) at_top"
  obtains C D where
    "eventually (\<lambda>x. norm (EM_remainder' n f a x) \<le> C + D * g x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C D. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D * g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>C D. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D * g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
note cont = continuous_on_subset[OF cont_f] continuous_on_subset[OF cont_g']
[PROOF STATE]
proof (state)
this:
?t \<subseteq> {a..} \<Longrightarrow> continuous_on ?t f
?t \<subseteq> {a..} \<Longrightarrow> continuous_on ?t g'

goal (1 subgoal):
 1. (\<And>C D. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D * g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from bounded_pbernpoly[of n]
[PROOF STATE]
proof (chain)
picking this:
(\<And>c. (\<And>x. norm (pbernpoly n x) \<le> c) \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain D where D: "\<And>x. norm (pbernpoly n x) \<le> D"
[PROOF STATE]
proof (prove)
using this:
(\<And>c. (\<And>x. norm (pbernpoly n x) \<le> c) \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>D. (\<And>x. norm (pbernpoly n x) \<le> D) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm (pbernpoly n ?x) \<le> D

goal (1 subgoal):
 1. (\<And>C D. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D * g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from this[of 0]
[PROOF STATE]
proof (chain)
picking this:
norm (pbernpoly n 0) \<le> D
[PROOF STEP]
have D_nonneg: "D \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
norm (pbernpoly n 0) \<le> D

goal (1 subgoal):
 1. 0 \<le> D
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> D

goal (1 subgoal):
 1. (\<And>C D. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D * g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from eventually_conj[OF f_bigo eventually_conj[OF deriv eventually_ge_at_top[of a]]]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. norm (f x) \<le> g' x \<and> (g has_real_derivative g' x) (at x) \<and> a \<le> x
[PROOF STEP]
obtain x0 where x0:
      "x0 \<ge> a" "\<And>x. x \<ge> x0 \<Longrightarrow> norm (f x) \<le> g' x"
      "\<And>x. x \<ge> x0 \<Longrightarrow> (g has_field_derivative g' x) (at x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. norm (f x) \<le> g' x \<and> (g has_real_derivative g' x) (at x) \<and> a \<le> x

goal (1 subgoal):
 1. (\<And>x0. \<lbrakk>a \<le> x0; \<And>x. x0 \<le> x \<Longrightarrow> norm (f x) \<le> g' x; \<And>x. x0 \<le> x \<Longrightarrow> (g has_real_derivative g' x) (at x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_at_top_linorder)
[PROOF STATE]
proof (state)
this:
a \<le> x0
x0 \<le> ?x \<Longrightarrow> norm (f ?x) \<le> g' ?x
x0 \<le> ?x \<Longrightarrow> (g has_real_derivative g' ?x) (at ?x)

goal (1 subgoal):
 1. (\<And>C D. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D * g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define C where "C = (norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) - D * g x0) / fact n"
[PROOF STATE]
proof (state)
this:
C = (norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) - D * g x0) / fact n

goal (1 subgoal):
 1. (\<And>C D. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D * g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "eventually (\<lambda>x. norm (EM_remainder' n f a x) \<le> C + D / fact n * g x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
using eventually_ge_at_top[of x0]
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) x0) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
x0 \<le> x

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
have "integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t) =
            integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t) +
            integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)" (is "_ = ?I1 + ?I2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t) + integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)
[PROOF STEP]
using elim x0(1)
[PROOF STATE]
proof (prove)
using this:
x0 \<le> x
a \<le> x0

goal (1 subgoal):
 1. integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t) + integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)
[PROOF STEP]
by (intro Henstock_Kurzweil_Integration.integral_combine [symmetric] integrable_EM_remainder' cont) auto
[PROOF STATE]
proof (state)
this:
integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t) + integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t) + integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
have "norm \<dots> \<le> norm ?I1 + norm ?I2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t) + integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + norm (integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t))
[PROOF STEP]
by (rule norm_triangle_ineq)
[PROOF STATE]
proof (state)
this:
norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t) + integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + norm (integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t))

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t) + integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + norm (integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t))

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
have "norm ?I2 \<le> integral {x0..x} (\<lambda>t. D * g' t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> integral {x0..x} (\<lambda>t. D * g' t)
[PROOF STEP]
using x0 D D_nonneg
[PROOF STATE]
proof (prove)
using this:
a \<le> x0
x0 \<le> ?x \<Longrightarrow> norm (f ?x) \<le> g' ?x
x0 \<le> ?x \<Longrightarrow> (g has_real_derivative g' ?x) (at ?x)
norm (pbernpoly n ?x) \<le> D
0 \<le> D

goal (1 subgoal):
 1. norm (integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> integral {x0..x} (\<lambda>t. D * g' t)
[PROOF STEP]
by (intro integral_norm_bound_integral integrable_EM_remainder')
         (auto intro!: integrable_continuous_real continuous_intros cont mult_mono)
[PROOF STATE]
proof (state)
this:
norm (integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> integral {x0..x} (\<lambda>t. D * g' t)

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (integral {x0..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> integral {x0..x} (\<lambda>t. D * g' t)

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
have "\<dots> = D * integral {x0..x} g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {x0..x} (\<lambda>t. D * g' t) = D * integral {x0..x} g'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral {x0..x} (\<lambda>t. D * g' t) = D * integral {x0..x} g'

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {x0..x} (\<lambda>t. D * g' t) = D * integral {x0..x} g'

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
from elim
[PROOF STATE]
proof (chain)
picking this:
x0 \<le> x
[PROOF STEP]
have "(g' has_integral (g x - g x0)) {x0..x}"
[PROOF STATE]
proof (prove)
using this:
x0 \<le> x

goal (1 subgoal):
 1. (g' has_integral g x - g x0) {x0..x}
[PROOF STEP]
by (intro fundamental_theorem_of_calculus)
         (auto intro!: has_field_derivative_at_within[OF x0(3)]
               simp: has_real_derivative_iff_has_vector_derivative [symmetric])
[PROOF STATE]
proof (state)
this:
(g' has_integral g x - g x0) {x0..x}

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
hence "integral {x0..x} g' = g x - g x0"
[PROOF STATE]
proof (prove)
using this:
(g' has_integral g x - g x0) {x0..x}

goal (1 subgoal):
 1. integral {x0..x} g' = g x - g x0
[PROOF STEP]
by (simp add: has_integral_iff)
[PROOF STATE]
proof (state)
this:
integral {x0..x} g' = g x - g x0

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + x \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + y) \<Longrightarrow> norm (integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + D * (g x - g x0)
[PROOF STEP]
have "norm (integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm ?I1 + D * (g x - g x0)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + x \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + y) \<Longrightarrow> norm (integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + D * (g x - g x0)

goal (1 subgoal):
 1. norm (integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + D * (g x - g x0)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
norm (integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + D * (g x - g x0)

goal (1 subgoal):
 1. \<And>x. x0 \<le> x \<Longrightarrow> norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
thus "norm (EM_remainder' n f a x) \<le> C + D / fact n * g x"
[PROOF STATE]
proof (prove)
using this:
norm (integral {a..x} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) \<le> norm (integral {a..x0} (\<lambda>t. pbernpoly n t *\<^sub>R f t)) + D * (g x - g x0)

goal (1 subgoal):
 1. norm (EM_remainder' n f a x) \<le> C + D / fact n * g x
[PROOF STEP]
by (simp add: EM_remainder'_def field_simps C_def)
[PROOF STATE]
proof (state)
this:
norm (EM_remainder' n f a x) \<le> C + D / fact n * g x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D / fact n * g x

goal (1 subgoal):
 1. (\<And>C D. \<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D * g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. norm (EM_remainder' n f a x) \<le> C + D / fact n * g x

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (rule that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_insert_zero: "span (insert 0 B) = span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert (0::'b) B) = span B
[PROOF STEP]
using span_zero
[PROOF STATE]
proof (prove)
using this:
(0::'b) \<in> span ?S

goal (1 subgoal):
 1. span (insert (0::'b) B) = span B
[PROOF STEP]
by (rule span_insert_idI)


[STATEMENT]
lemma rtrancl_into_rtrancl2: "\<lbrakk>(a, b) \<in>  r; (b, c) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> (a, c) \<in> r\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a, b) \<in> r; (b, c) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> (a, c) \<in> r\<^sup>*
[PROOF STEP]
by (auto intro: rtrancl_trans)


[STATEMENT]
lemma path_connected_singleton [simp]: "path_connected {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected {a}
[PROOF STEP]
unfolding path_connected_def pathstart_def pathfinish_def path_image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{a}. \<forall>y\<in>{a}. \<exists>g. path g \<and> g ` {0..1} \<subseteq> {a} \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
using path_def
[PROOF STATE]
proof (prove)
using this:
path ?g = continuous_on {0..1} ?g

goal (1 subgoal):
 1. \<forall>x\<in>{a}. \<forall>y\<in>{a}. \<exists>g. path g \<and> g ` {0..1} \<subseteq> {a} \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma llist_all2_flip [flip_simps]: "llist_all2 (flip P) xs ys = llist_all2 P ys xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llist_all2 (flip P) xs ys = llist_all2 P ys xs
[PROOF STEP]
unfolding flip_def llist_all2_conv_all_lnth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (llength xs = llength ys \<and> (\<forall>n. enat n < llength ys \<longrightarrow> P (lnth ys n) (lnth xs n))) = (llength ys = llength xs \<and> (\<forall>n. enat n < llength xs \<longrightarrow> P (lnth ys n) (lnth xs n)))
[PROOF STEP]
by auto


[STATEMENT]
lemma T_slow_select_le: "T_slow_select k xs \<le> length xs ^ 2 + 3 * length xs + 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3
[PROOF STEP]
have "T_slow_select k xs \<le> (length xs + 1)\<^sup>2 + (length (insort xs) + 1) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_slow_select k xs \<le> (length xs + 1)\<^sup>2 + (length (Sorting.insort xs) + 1) + 1
[PROOF STEP]
unfolding T_slow_select_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_insort xs + T_nth (Sorting.insort xs) k + 1 \<le> (length xs + 1)\<^sup>2 + (length (Sorting.insort xs) + 1) + 1
[PROOF STEP]
by (intro add_mono T_insort_length) (auto simp: T_nth_eq)
[PROOF STATE]
proof (state)
this:
T_slow_select k xs \<le> (length xs + 1)\<^sup>2 + (length (Sorting.insort xs) + 1) + 1

goal (1 subgoal):
 1. T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
T_slow_select k xs \<le> (length xs + 1)\<^sup>2 + (length (Sorting.insort xs) + 1) + 1

goal (1 subgoal):
 1. T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3
[PROOF STEP]
have "\<dots> = length xs ^ 2 + 3 * length xs + 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs + 1)\<^sup>2 + (length (Sorting.insort xs) + 1) + 1 = (length xs)\<^sup>2 + 3 * length xs + 3
[PROOF STEP]
by (simp add: insort_correct algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(length xs + 1)\<^sup>2 + (length (Sorting.insort xs) + 1) + 1 = (length xs)\<^sup>2 + 3 * length xs + 3

goal (1 subgoal):
 1. T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3

goal (1 subgoal):
 1. T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
T_slow_select k xs \<le> (length xs)\<^sup>2 + 3 * length xs + 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_col_of_iter_tensor [simp]:
  fixes A n
  assumes "n \<ge> 1"
  shows "dim_col(A \<otimes>\<^bsup>n\<^esup>) = (dim_col A)^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n
[PROOF STEP]
proof (rule nat_induct_at_least)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_col (A \<otimes>\<^bsup>1\<^esup>) = dim_col A ^ 1
 2. \<And>n. \<lbrakk>1 \<le> n; dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n\<rbrakk> \<Longrightarrow> dim_col (A \<otimes>\<^bsup>Suc n\<^esup>) = dim_col A ^ Suc n
[PROOF STEP]
show "dim_col (A \<otimes>\<^bsup>1\<^esup>) = (dim_col A)^1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (A \<otimes>\<^bsup>1\<^esup>) = dim_col A ^ 1
[PROOF STEP]
using one_tensor_is_id
[PROOF STATE]
proof (prove)
using this:
?A \<otimes>\<^bsup>1\<^esup> = ?A

goal (1 subgoal):
 1. dim_col (A \<otimes>\<^bsup>1\<^esup>) = dim_col A ^ 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col (A \<otimes>\<^bsup>1\<^esup>) = dim_col A ^ 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n\<rbrakk> \<Longrightarrow> dim_col (A \<otimes>\<^bsup>Suc n\<^esup>) = dim_col A ^ Suc n
[PROOF STEP]
fix n:: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n\<rbrakk> \<Longrightarrow> dim_col (A \<otimes>\<^bsup>Suc n\<^esup>) = dim_col A ^ Suc n
[PROOF STEP]
assume "n \<ge> 1" and "dim_col (A \<otimes>\<^bsup>n\<^esup>) = (dim_col A)^n"
[PROOF STATE]
proof (state)
this:
1 \<le> n
dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 \<le> n; dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n\<rbrakk> \<Longrightarrow> dim_col (A \<otimes>\<^bsup>Suc n\<^esup>) = dim_col A ^ Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n
dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n
[PROOF STEP]
show "dim_col (A \<otimes>\<^bsup>Suc n\<^esup>) = (dim_col A)^Suc n"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n

goal (1 subgoal):
 1. dim_col (A \<otimes>\<^bsup>Suc n\<^esup>) = dim_col A ^ Suc n
[PROOF STEP]
using iter_tensor_suc assms dim_col_tensor_mat
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
dim_col (A \<otimes>\<^bsup>n\<^esup>) = dim_col A ^ n
1 \<le> ?n \<Longrightarrow> ?A \<otimes>\<^bsup>Suc ?n\<^esup> = ?A \<Otimes> ?A \<otimes>\<^bsup>?n\<^esup>
1 \<le> n
dim_col (?A \<Otimes> ?B) = dim_col ?A * dim_col ?B

goal (1 subgoal):
 1. dim_col (A \<otimes>\<^bsup>Suc n\<^esup>) = dim_col A ^ Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col (A \<otimes>\<^bsup>Suc n\<^esup>) = dim_col A ^ Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma freeword_funlift_Abs_freelist:
  "freeword_funlift f (Abs_freelist xs) = (\<Sum>x\<leftarrow>xs. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freeword_funlift f (Abs_freelist xs) = sum_list (map f xs)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. freeword_funlift f (Abs_freelist []) = sum_list (map f [])
 2. \<And>a xs. freeword_funlift f (Abs_freelist xs) = sum_list (map f xs) \<Longrightarrow> freeword_funlift f (Abs_freelist (a # xs)) = sum_list (map f (a # xs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
freeword_funlift f (Abs_freelist xs) = sum_list (map f xs)

goal (2 subgoals):
 1. freeword_funlift f (Abs_freelist []) = sum_list (map f [])
 2. \<And>a xs. freeword_funlift f (Abs_freelist xs) = sum_list (map f xs) \<Longrightarrow> freeword_funlift f (Abs_freelist (a # xs)) = sum_list (map f (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
freeword_funlift f (Abs_freelist xs) = sum_list (map f xs)

goal (1 subgoal):
 1. freeword_funlift f (Abs_freelist (x # xs)) = sum_list (map f (x # xs))
[PROOF STEP]
using Abs_freelist_Cons[of x xs]
[PROOF STATE]
proof (prove)
using this:
freeword_funlift f (Abs_freelist xs) = sum_list (map f xs)
Abs_freelist (x # xs) = Abs_freeletter x + Abs_freelist xs

goal (1 subgoal):
 1. freeword_funlift f (Abs_freelist (x # xs)) = sum_list (map f (x # xs))
[PROOF STEP]
by    (simp add: freeword_funlift_add freeword_funlift_Abs_freeletter)
[PROOF STATE]
proof (state)
this:
freeword_funlift f (Abs_freelist (x # xs)) = sum_list (map f (x # xs))

goal (1 subgoal):
 1. freeword_funlift f (Abs_freelist []) = sum_list (map f [])
[PROOF STEP]
qed (simp add: zero_freeword.abs_eq[THEN sym] freeword_funlift_0)


[STATEMENT]
lemma powr_mono:
  fixes x :: real
  assumes "a \<le> b" and "1 \<le> x" shows "x powr a \<le> x powr b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr a \<le> x powr b
[PROOF STEP]
using assms less_eq_real_def
[PROOF STATE]
proof (prove)
using this:
a \<le> b
1 \<le> x
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)

goal (1 subgoal):
 1. x powr a \<le> x powr b
[PROOF STEP]
by auto


[STATEMENT]
lemma open_Arg2pi2pi_gt: "open {z. t < Arg2pi z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {z. t < Arg2pi z}
[PROOF STEP]
proof (cases "t < 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
 2. \<not> t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
t < 0

goal (2 subgoals):
 1. t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
 2. \<not> t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t < 0
[PROOF STEP]
have "{z. t < Arg2pi z} = UNIV"
[PROOF STATE]
proof (prove)
using this:
t < 0

goal (1 subgoal):
 1. {z. t < Arg2pi z} = UNIV
[PROOF STEP]
using Arg2pi_ge_0 less_le_trans
[PROOF STATE]
proof (prove)
using this:
t < 0
0 \<le> Arg2pi ?z
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. {z. t < Arg2pi z} = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{z. t < Arg2pi z} = UNIV

goal (2 subgoals):
 1. t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
 2. \<not> t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{z. t < Arg2pi z} = UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{z. t < Arg2pi z} = UNIV

goal (1 subgoal):
 1. open {z. t < Arg2pi z}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
open {z. t < Arg2pi z}

goal (1 subgoal):
 1. \<not> t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> t < 0

goal (1 subgoal):
 1. \<not> t < 0 \<Longrightarrow> open {z. t < Arg2pi z}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> t < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> t < 0

goal (1 subgoal):
 1. open {z. t < Arg2pi z}
[PROOF STEP]
using open_Arg2pi2pi_less_Int [of t "2*pi"] Arg2pi_lt_2pi
[PROOF STATE]
proof (prove)
using this:
\<not> t < 0
\<lbrakk>0 \<le> t; 2 * pi \<le> 2 * pi\<rbrakk> \<Longrightarrow> open ({y. t < Arg2pi y} \<inter> {y. Arg2pi y < 2 * pi})
Arg2pi ?z < 2 * pi

goal (1 subgoal):
 1. open {z. t < Arg2pi z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open {z. t < Arg2pi z}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma taylor_bigo_linear:
  assumes "f field_differentiable at x0 within A"
  shows   "(\<lambda>x. f x - f x0) \<in> O[at x0 within A](\<lambda>x. x - x0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x - f x0) \<in> O[at x0 within A](\<lambda>x. x - x0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x - f x0) \<in> O[at x0 within A](\<lambda>x. x - x0)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f field_differentiable at x0 within A
[PROOF STEP]
obtain f' where "(f has_field_derivative f') (at x0 within A)"
[PROOF STATE]
proof (prove)
using this:
f field_differentiable at x0 within A

goal (1 subgoal):
 1. (\<And>f'. (f has_field_derivative f') (at x0 within A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: field_differentiable_def)
[PROOF STATE]
proof (state)
this:
(f has_field_derivative f') (at x0 within A)

goal (1 subgoal):
 1. (\<lambda>x. f x - f x0) \<in> O[at x0 within A](\<lambda>x. x - x0)
[PROOF STEP]
hence "((\<lambda>x. (f x - f x0) / (x - x0)) \<longlongrightarrow> f') (at x0 within A)"
[PROOF STATE]
proof (prove)
using this:
(f has_field_derivative f') (at x0 within A)

goal (1 subgoal):
 1. ((\<lambda>x. (f x - f x0) / (x - x0)) \<longlongrightarrow> f') (at x0 within A)
[PROOF STEP]
by (auto simp: has_field_derivative_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (f x - f x0) / (x - x0)) \<longlongrightarrow> f') (at x0 within A)

goal (1 subgoal):
 1. (\<lambda>x. f x - f x0) \<in> O[at x0 within A](\<lambda>x. x - x0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. (f x - f x0) / (x - x0)) \<longlongrightarrow> f') (at x0 within A)

goal (1 subgoal):
 1. (\<lambda>x. f x - f x0) \<in> O[at x0 within A](\<lambda>x. x - x0)
[PROOF STEP]
by (intro bigoI_tendsto[where c = f']) (auto simp: eventually_at_filter)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x - f x0) \<in> O[at x0 within A](\<lambda>x. x - x0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sup_upto_Suc: "(\<Sqinter>i\<in>{0..Suc n}. P \<^bold>^ i) = (\<Sqinter>i\<in>{0..n}. P \<^bold>^ i) \<sqinter> P \<^bold>^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` {0..n}) \<sqinter> power.power II (;;) P (Suc n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` {0..n}) \<sqinter> power.power II (;;) P (Suc n)
[PROOF STEP]
have "(\<Sqinter>i\<in>{0..Suc n}. P \<^bold>^ i) = (\<Sqinter>i\<in>insert (Suc n) {0..n}. P \<^bold>^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` insert (Suc n) {0..n})
[PROOF STEP]
by (simp add: atLeast0_atMost_Suc)
[PROOF STATE]
proof (state)
this:
\<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` insert (Suc n) {0..n})

goal (1 subgoal):
 1. \<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` {0..n}) \<sqinter> power.power II (;;) P (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` insert (Suc n) {0..n})

goal (1 subgoal):
 1. \<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` {0..n}) \<sqinter> power.power II (;;) P (Suc n)
[PROOF STEP]
have "... = P \<^bold>^ Suc n \<sqinter> (\<Sqinter>i\<in>{0..n}. P \<^bold>^ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Or>(power.power II (;;) P ` insert (Suc n) {0..n}) = power.power II (;;) P (Suc n) \<sqinter> \<Or>(power.power II (;;) P ` {0..n})
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
\<Or>(power.power II (;;) P ` insert (Suc n) {0..n}) = power.power II (;;) P (Suc n) \<sqinter> \<Or>(power.power II (;;) P ` {0..n})

goal (1 subgoal):
 1. \<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` {0..n}) \<sqinter> power.power II (;;) P (Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Or>(power.power II (;;) P ` {0..Suc n}) = power.power II (;;) P (Suc n) \<sqinter> \<Or>(power.power II (;;) P ` {0..n})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Or>(power.power II (;;) P ` {0..Suc n}) = power.power II (;;) P (Suc n) \<sqinter> \<Or>(power.power II (;;) P ` {0..n})

goal (1 subgoal):
 1. \<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` {0..n}) \<sqinter> power.power II (;;) P (Suc n)
[PROOF STEP]
by (simp add: Lattices.sup_commute)
[PROOF STATE]
proof (state)
this:
\<Or>(power.power II (;;) P ` {0..Suc n}) = \<Or>(power.power II (;;) P ` {0..n}) \<sqinter> power.power II (;;) P (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in encoding) indRelLSTPO_trans:
  fixes SRel :: "('procS \<times> 'procS) set"
    and TRel :: "('procT \<times> 'procT) set"
  shows "trans (indRelLSTPO SRel TRel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (indRelLSTPO SRel TRel)
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> y \<longrightarrow> y \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> z \<longrightarrow> x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> z
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> y \<and> y \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> z \<Longrightarrow> x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> z
[PROOF STEP]
fix P Q R
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> y \<and> y \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> z \<Longrightarrow> x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> z
[PROOF STEP]
assume "P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> Q" and "Q \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> R"
[PROOF STATE]
proof (state)
this:
P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> Q
Q \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> R

goal (1 subgoal):
 1. \<And>x y z. x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> y \<and> y \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> z \<Longrightarrow> x \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> z
[PROOF STEP]
thus "P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> R"
[PROOF STATE]
proof (prove)
using this:
P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> Q
Q \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> R

goal (1 subgoal):
 1. P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> R
[PROOF STEP]
by (rule indRelLSTPO.trans)
[PROOF STATE]
proof (state)
this:
P \<lesssim>\<lbrakk>\<cdot>\<rbrakk>L<SRel,TRel> R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bitlen_pow2 [simp]:
  "bitlen (b * 2 ^ c) = bitlen b + c" if "b > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitlen (b * 2 ^ c) = bitlen b + int c
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < b

goal (1 subgoal):
 1. bitlen (b * 2 ^ c) = bitlen b + int c
[PROOF STEP]
by (simp add: bitlen_def nat_mult_distrib nat_power_eq)


[STATEMENT]
lemma nth_root_nat_nth_power':
  assumes "k > 0" "k dvd m"
  shows   "nth_root_nat k (n ^ m) = n ^ (m div k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < k
k dvd m
[PROOF STEP]
have "m = (m div k) * k"
[PROOF STATE]
proof (prove)
using this:
0 < k
k dvd m

goal (1 subgoal):
 1. m = m div k * k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m = m div k * k

goal (1 subgoal):
 1. nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m = m div k * k

goal (1 subgoal):
 1. nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
have "n ^ \<dots> = (n ^ (m div k)) ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n ^ (m div k * k) = (n ^ (m div k)) ^ k
[PROOF STEP]
by (simp add: power_mult)
[PROOF STATE]
proof (state)
this:
n ^ (m div k * k) = (n ^ (m div k)) ^ k

goal (1 subgoal):
 1. nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n ^ (m div k * k) = (n ^ (m div k)) ^ k

goal (1 subgoal):
 1. nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < k
k dvd m
[PROOF STEP]
have "nth_root_nat k \<dots> = n ^ (m div k)"
[PROOF STATE]
proof (prove)
using this:
0 < k
k dvd m

goal (1 subgoal):
 1. nth_root_nat k ((n ^ (m div k)) ^ k) = n ^ (m div k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nth_root_nat k ((n ^ (m div k)) ^ k) = n ^ (m div k)

goal (1 subgoal):
 1. nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nth_root_nat k (n ^ m) = n ^ (m div k)

goal (1 subgoal):
 1. nth_root_nat k (n ^ m) = n ^ (m div k)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
nth_root_nat k (n ^ m) = n ^ (m div k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compact_continuous_image_eq:
  fixes f :: "'a::heine_borel \<Rightarrow> 'b::heine_borel"
  assumes f: "inj_on f S"
  shows "continuous_on S f \<longleftrightarrow> (\<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact(f ` T))"
           (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S f = (\<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on S f \<Longrightarrow> \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T)
 2. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
continuous_on S f

goal (2 subgoals):
 1. continuous_on S f \<Longrightarrow> \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T)
 2. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on S f
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
continuous_on S f

goal (1 subgoal):
 1. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T)
[PROOF STEP]
by (metis continuous_on_subset compact_continuous_image)
[PROOF STATE]
proof (state)
this:
\<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T)

goal (1 subgoal):
 1. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
assume RHS: ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T)

goal (1 subgoal):
 1. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
obtain g where gf: "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. (\<And>x. x \<in> S \<Longrightarrow> g (f x) = x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis inv_into_f_f f)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> S \<Longrightarrow> g (f ?x) = ?x
[PROOF STEP]
have *: "(S \<inter> f -` U) = g ` U" if "U \<subseteq> f ` S" for U
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. S \<inter> f -` U = g ` U
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> g (f ?x) = ?x
U \<subseteq> f ` S

goal (1 subgoal):
 1. S \<inter> f -` U = g ` U
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?U \<subseteq> f ` S \<Longrightarrow> S \<inter> f -` ?U = g ` ?U

goal (1 subgoal):
 1. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
have gfim: "g ` f ` S \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` f ` S \<subseteq> S
[PROOF STEP]
using gf
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. g ` f ` S \<subseteq> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g ` f ` S \<subseteq> S

goal (1 subgoal):
 1. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
have **: "compact (f ` S \<inter> g -` C)" if C: "C \<subseteq> S" "compact C" for C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (f ` S \<inter> g -` C)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. compact (f ` S \<inter> g -` C)
[PROOF STEP]
obtain h where "h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: C RHS)
[PROOF STATE]
proof (state)
this:
h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C)

goal (1 subgoal):
 1. compact (f ` S \<inter> g -` C)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C)

goal (1 subgoal):
 1. compact (f ` S \<inter> g -` C)
[PROOF STEP]
have "f ` C = (f ` S \<inter> g -` C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` C = f ` S \<inter> g -` C
[PROOF STEP]
using C gf
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> S
compact C
?x \<in> S \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. f ` C = f ` S \<inter> g -` C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` C = f ` S \<inter> g -` C

goal (1 subgoal):
 1. compact (f ` S \<inter> g -` C)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C)
f ` C = f ` S \<inter> g -` C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C)
f ` C = f ` S \<inter> g -` C

goal (1 subgoal):
 1. compact (f ` S \<inter> g -` C)
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C)
f ` C = f ` S \<inter> g -` C
C \<subseteq> S
compact C

goal (1 subgoal):
 1. compact (f ` S \<inter> g -` C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
compact (f ` S \<inter> g -` C)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?C \<subseteq> S; compact ?C\<rbrakk> \<Longrightarrow> compact (f ` S \<inter> g -` ?C)

goal (1 subgoal):
 1. \<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact (f ` T) \<Longrightarrow> continuous_on S f
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
using proper_map [OF _ _ gfim] **
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closedin (top_of_set (f ` S)) ?K; \<And>U. \<lbrakk>U \<subseteq> S; compact U\<rbrakk> \<Longrightarrow> compact (f ` S \<inter> g -` U)\<rbrakk> \<Longrightarrow> closedin (top_of_set S) (g ` ?K)
\<lbrakk>?C \<subseteq> S; compact ?C\<rbrakk> \<Longrightarrow> compact (f ` S \<inter> g -` ?C)

goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
by (simp add: continuous_on_closed * closedin_imp_subset)
[PROOF STATE]
proof (state)
this:
continuous_on S f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma concat_eq :
  "list_all2 (\<lambda>xs ys. length xs = length ys) xss yss \<Longrightarrow> concat xss = concat yss
        \<Longrightarrow> xss = yss"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all2 (\<lambda>xs ys. length xs = length ys) xss yss; concat xss = concat yss\<rbrakk> \<Longrightarrow> xss = yss
[PROOF STEP]
by  (induct xss yss rule: list_all2_induct) auto


[STATEMENT]
lemma similarity_comp [simp]:
  assumes "mat_det A1 \<noteq> 0" and "mat_det A2 \<noteq> 0"
  shows "similarity A1 (similarity A2 M) = similarity (A2*\<^sub>m\<^sub>mA1) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similarity A1 (similarity A2 M) = similarity (A2 *\<^sub>m\<^sub>m A1) M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det A1 \<noteq> 0
mat_det A2 \<noteq> 0

goal (1 subgoal):
 1. similarity A1 (similarity A2 M) = similarity (A2 *\<^sub>m\<^sub>m A1) M
[PROOF STEP]
unfolding similarity_def
[PROOF STATE]
proof (prove)
using this:
mat_det A1 \<noteq> 0
mat_det A2 \<noteq> 0

goal (1 subgoal):
 1. mat_inv A1 *\<^sub>m\<^sub>m (mat_inv A2 *\<^sub>m\<^sub>m M *\<^sub>m\<^sub>m A2) *\<^sub>m\<^sub>m A1 = mat_inv (A2 *\<^sub>m\<^sub>m A1) *\<^sub>m\<^sub>m M *\<^sub>m\<^sub>m (A2 *\<^sub>m\<^sub>m A1)
[PROOF STEP]
by (simp add: mult_mm_assoc mat_inv_mult_mm)


[STATEMENT]
lemma less_3_cases:
  assumes n: "n < 3" shows "n = 0 \<or> n = 1 \<or> n = (2::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = 0 \<or> n = 1 \<or> n = 2
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
n < 3

goal (1 subgoal):
 1. n = 0 \<or> n = 1 \<or> n = 2
[PROOF STEP]
by linarith


[STATEMENT]
lemma base_case_matrix_eq:
  fixes q p:: "real poly"
  assumes nonzero: "p \<noteq> 0"
  assumes rel_prime: "coprime p q"
  shows "(mult_mat_vec (mat_of_rows_list 2 [[1, 1], [1, -1]]) (construct_lhs_vector p [q] [[1],[-1]]) =
    (construct_rhs_vector p [q] [[],[0]]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows_list 2 [[1, 1], [1, - 1]] *\<^sub>v w_vec p [q] [[1], [- 1]] = v_vec p [q] [[], [0]]
[PROOF STEP]
using mat_base_case base_case_satisfy_equation
[PROOF STATE]
proof (prove)
using this:
M_mat [[1], [- 1]] [[], [0]] = mat_of_rows_list 2 [[1, 1], [1, - 1]]
\<lbrakk>?p \<noteq> 0; coprime ?p ?q\<rbrakk> \<Longrightarrow> satisfy_equation ?p [?q] [[], [0]] [[1], [- 1]]

goal (1 subgoal):
 1. mat_of_rows_list 2 [[1, 1], [1, - 1]] *\<^sub>v w_vec p [q] [[1], [- 1]] = v_vec p [q] [[], [0]]
[PROOF STEP]
unfolding satisfy_equation_def
[PROOF STATE]
proof (prove)
using this:
M_mat [[1], [- 1]] [[], [0]] = mat_of_rows_list 2 [[1, 1], [1, - 1]]
\<lbrakk>?p \<noteq> 0; coprime ?p ?q\<rbrakk> \<Longrightarrow> M_mat [[1], [- 1]] [[], [0]] *\<^sub>v w_vec ?p [?q] [[1], [- 1]] = v_vec ?p [?q] [[], [0]]

goal (1 subgoal):
 1. mat_of_rows_list 2 [[1, 1], [1, - 1]] *\<^sub>v w_vec p [q] [[1], [- 1]] = v_vec p [q] [[], [0]]
[PROOF STEP]
by (simp add: nonzero rel_prime)


[STATEMENT]
theorem assumes ms: "measure_space M" shows
  rv_ge_iff: "(f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
from ms
[PROOF STATE]
proof (chain)
picking this:
measure_space M
[PROOF STEP]
have "(f \<in> rv M) = (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M)"
[PROOF STATE]
proof (prove)
using this:
measure_space M

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M)
[PROOF STEP]
by (rule rv_le_iff)
[PROOF STATE]
proof (state)
this:
(f \<in> rv M) = (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M)

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<in> rv M) = (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M)

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
have "\<dots> = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
from ms
[PROOF STATE]
proof (chain)
picking this:
measure_space M
[PROOF STEP]
have sigma: "sigma_algebra (measurable_sets M)"
[PROOF STATE]
proof (prove)
using this:
measure_space M

goal (1 subgoal):
 1. sigma_algebra (measurable_sets M)
[PROOF STEP]
by (simp only: measure_space_def)
[PROOF STATE]
proof (state)
this:
sigma_algebra (measurable_sets M)

goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sigma_algebra (measurable_sets M)

goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
note less_ge le_less
[PROOF STATE]
proof (state)
this:
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w < a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a \<le> ?f w} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w \<le> a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w < a} \<in> ?A

goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sigma_algebra (measurable_sets M)
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w < a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a \<le> ?f w} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w \<le> a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w < a} \<in> ?A
[PROOF STEP]
have "?lhs \<Longrightarrow> ?rhs"
[PROOF STATE]
proof (prove)
using this:
sigma_algebra (measurable_sets M)
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w < a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a \<le> ?f w} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w \<le> a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w < a} \<in> ?A

goal (1 subgoal):
 1. \<forall>a. {w. f w \<le> a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>a. {w. f w \<le> a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M

goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<forall>a. {w. f w \<le> a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M

goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
from sigma gr_le ge_gr
[PROOF STATE]
proof (chain)
picking this:
sigma_algebra (measurable_sets M)
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a < ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w \<le> a} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a \<le> ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a < ?f w} \<in> ?A
[PROOF STEP]
have "?rhs \<Longrightarrow> ?lhs"
[PROOF STATE]
proof (prove)
using this:
sigma_algebra (measurable_sets M)
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a < ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w \<le> a} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a \<le> ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a < ?f w} \<in> ?A

goal (1 subgoal):
 1. \<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w \<le> a} \<in> measurable_sets M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w \<le> a} \<in> measurable_sets M

goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>a. {w. f w \<le> a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M
\<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w \<le> a} \<in> measurable_sets M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>a. {w. f w \<le> a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M
\<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w \<le> a} \<in> measurable_sets M

goal (1 subgoal):
 1. (\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>a. {w. f w \<le> a} \<in> measurable_sets M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_deriv_eq_iff_ex:
  fixes f g :: "'a::{ring_1_no_zero_divisors,ring_char_0} fls"
  shows "(fls_deriv f = fls_deriv g) \<longleftrightarrow> (\<exists>c. f = fls_const c + g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fls_deriv f = fls_deriv g) = (\<exists>c. f = fls_const c + g)
[PROOF STEP]
by    (auto simp: fls_deriv_eq_iff)


[STATEMENT]
lemma to_int_mod_ring_lift_01_eq:
  assumes "zero_one_matrix N"
  shows "to_int_mat N = (lift_01_mat) N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mat N = lift_01_mat N
[PROOF STEP]
apply (auto simp add: mat_eq_iff[of "to_int_mat N" "lift_01_mat N"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row N; j < dim_col N\<rbrakk> \<Longrightarrow> to_int_mod_ring (N $$ (i, j)) = of_zero_neq_one (N $$ (i, j))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
zero_one_matrix N

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row N; j < dim_col N\<rbrakk> \<Longrightarrow> to_int_mod_ring (N $$ (i, j)) = of_zero_neq_one (N $$ (i, j))
[PROOF STEP]
using zero_one_matrix.M_not_zero_simp
[PROOF STATE]
proof (prove)
using this:
zero_one_matrix N
\<lbrakk>zero_one_matrix ?matrix; ?j < dim_col ?matrix; ?i < dim_row ?matrix; ?matrix $$ (?i, ?j) \<noteq> (0::?'b)\<rbrakk> \<Longrightarrow> ?matrix $$ (?i, ?j) = (1::?'b)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row N; j < dim_col N\<rbrakk> \<Longrightarrow> to_int_mod_ring (N $$ (i, j)) = of_zero_neq_one (N $$ (i, j))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma "(\<lambda>x. 1 - (1 - 1 / x powr a) powr x) \<sim> (\<lambda>x. x powr (1 - a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 1 - (1 - 1 / x powr a) powr x) \<sim>[at_top] (\<lambda>x. x powr (1 - a))
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
1 < a

goal (1 subgoal):
 1. (\<lambda>x. 1 - (1 - 1 / x powr a) powr x) \<sim>[at_top] (\<lambda>x. x powr (1 - a))
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma "VARS (i::nat) j
  [ True ]
  WHILE 0 < i
    INV { True }
    VAR { z = i }
     DO i := i - 1; j := i;
        WHILE 0 < j
        INV { z = i+1 }
        VAR { j }
        DO j := j - 1 OD
     OD
  [ i \<le> 0 ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [True]
WHILE 0 < i INV {True}  VAR {z = i}
DO i := i - 1; j := i; WHILE 0 < j INV {z = i + 1}  VAR {j}
DO j := j - 1 OD OD
[i \<le> 0]
[PROOF STEP]
apply vcg_tc
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>z i j. (True \<and> 0 < i) \<and> i = z \<Longrightarrow> z = i - 1 + 1
 2. \<And>z n i j. (z = i + 1 \<and> 0 < j) \<and> j = n \<Longrightarrow> (i, j - 1) \<in> {s. (case s of (i, j) \<Rightarrow> z = i + 1) \<and> (case s of (i, j) \<Rightarrow> j) < n}
 3. \<And>z i j. z = i + 1 \<and> \<not> 0 < j \<Longrightarrow> True \<and> i < z
 4. \<And>i j. True \<and> \<not> 0 < i \<Longrightarrow> i \<le> 0
[PROOF STEP]
by auto