[STATEMENT]
lemma rsa_crypt_code [code]:
  "rsa_crypt M e n = (if e = 0 then 1 mod n
    else if even e then rsa_crypt M (e div 2) n ^ 2 mod n
    else (M * rsa_crypt M (e div 2) n ^ 2 mod n) mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
have "(M ^ m mod n)\<^sup>2 mod n = (M ^ m)\<^sup>2 mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M ^ m mod n)\<^sup>2 mod n = (M ^ m)\<^sup>2 mod n
[PROOF STEP]
by (simp add: power_mod)
[PROOF STATE]
proof (state)
this:
(M ^ m mod n)\<^sup>2 mod n = (M ^ m)\<^sup>2 mod n

goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(M ^ m mod n)\<^sup>2 mod n = (M ^ m)\<^sup>2 mod n
[PROOF STEP]
have "(M mod n) * ((M ^ m mod n)\<^sup>2 mod n) = (M mod n) * ((M ^ m)\<^sup>2 mod n)"
[PROOF STATE]
proof (prove)
using this:
(M ^ m mod n)\<^sup>2 mod n = (M ^ m)\<^sup>2 mod n

goal (1 subgoal):
 1. M mod n * ((M ^ m mod n)\<^sup>2 mod n) = M mod n * ((M ^ m)\<^sup>2 mod n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
M mod n * ((M ^ m mod n)\<^sup>2 mod n) = M mod n * ((M ^ m)\<^sup>2 mod n)

goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
have "M * (M ^ m mod n)\<^sup>2 mod n = M * (M ^ m)\<^sup>2 mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M * (M ^ m mod n)\<^sup>2 mod n = M * (M ^ m)\<^sup>2 mod n
[PROOF STEP]
by (metis mod_mult_right_eq power_mod)
[PROOF STATE]
proof (state)
this:
M * (M ^ m mod n)\<^sup>2 mod n = M * (M ^ m)\<^sup>2 mod n

goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
M * (M ^ ?m2 mod n)\<^sup>2 mod n = M * (M ^ ?m2)\<^sup>2 mod n

goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M * (M ^ ?m2 mod n)\<^sup>2 mod n = M * (M ^ ?m2)\<^sup>2 mod n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
M * (M ^ ?m2 mod n)\<^sup>2 mod n = M * (M ^ ?m2)\<^sup>2 mod n

goal (1 subgoal):
 1. rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)
[PROOF STEP]
by (auto simp add: cryptcorrect power_even_eq remainderexp elim!: evenE oddE)
[PROOF STATE]
proof (state)
this:
rsa_crypt M e n = (if e = 0 then 1 mod n else if even e then (rsa_crypt M (e div 2) n)\<^sup>2 mod n else M * (rsa_crypt M (e div 2) n)\<^sup>2 mod n mod n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tensor_mat_zero1:
  shows "tensor_mat (0\<^sub>m d1 d1) m1 = 0\<^sub>m d d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_mat (0\<^sub>m d1 d1) m1 = 0\<^sub>m d d
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (0\<^sub>m d d); j < dim_col (0\<^sub>m d d)\<rbrakk> \<Longrightarrow> tensor_mat (0\<^sub>m d1 d1) m1 $$ (i, j) = 0\<^sub>m d d $$ (i, j)
 2. dim_row (tensor_mat (0\<^sub>m d1 d1) m1) = dim_row (0\<^sub>m d d)
 3. dim_col (tensor_mat (0\<^sub>m d1 d1) m1) = dim_col (0\<^sub>m d d)
[PROOF STEP]
by (auto simp add: tensor_mat_eval)


[STATEMENT]
lemma (in abelian_subgroup) a_rcos_equation:
  shows
     "\<lbrakk>ha \<oplus> a = h \<oplus> b; a \<in> carrier G;  b \<in> carrier G;
        h \<in> H;  ha \<in> H;  hb \<in> H\<rbrakk>
      \<Longrightarrow> hb \<oplus> a \<in> (\<Union>h\<in>H. {h \<oplus> b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ha \<oplus> a = h \<oplus> b; a \<in> carrier G; b \<in> carrier G; h \<in> H; ha \<in> H; hb \<in> H\<rbrakk> \<Longrightarrow> hb \<oplus> a \<in> (\<Union>h\<in>H. {h \<oplus> b})
[PROOF STEP]
by (rule group.rcos_equation [OF a_group a_subgroup,
    folded a_r_congruent_def a_l_coset_def, simplified monoid_record_simps])


[STATEMENT]
lemma matrix_mul_diag_diag: "diag_mat f ** diag_mat g = diag_mat (\<lambda>i. f i * g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat f ** diag_mat g = diag_mat (\<lambda>i. f i * g i)
[PROOF STEP]
unfolding diag_mat_def matrix_matrix_mult_def vec_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i ia. (\<chi>i j. \<Sum>k\<in>UNIV. (\<chi>i j. if i = j then f i else (0::'a)) $ i $ k * (\<chi>i j. if i = j then g i else (0::'a)) $ k $ j) $ i $ ia = (\<chi>i j. if i = j then f i * g i else (0::'a)) $ i $ ia
[PROOF STEP]
by simp


[STATEMENT]
lemma card_eq_Suc_0_ex1: "card A = Suc 0 \<longleftrightarrow> (\<exists>!x. x \<in> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card A = Suc 0) = (\<exists>!x. x \<in> A)
[PROOF STEP]
by(auto simp only: One_nat_def[symmetric] card_eq_1_iff)


[STATEMENT]
lemma polyhedron_Int_affine_parallel:
  fixes S :: "'a :: euclidean_space set"
  shows "polyhedron S \<longleftrightarrow>
         (\<exists>F. finite F \<and>
              S = (affine hull S) \<inter> (\<Inter>F) \<and>
              (\<forall>h \<in> F. \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x \<le> b} \<and>
                             (\<forall>x \<in> affine hull S. (x + a) \<in> affine hull S)))"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polyhedron S = (\<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. polyhedron S \<Longrightarrow> \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
 2. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)) \<Longrightarrow> polyhedron S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
polyhedron S

goal (2 subgoals):
 1. polyhedron S \<Longrightarrow> \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
 2. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)) \<Longrightarrow> polyhedron S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
polyhedron S
[PROOF STEP]
obtain F where "finite F" and seq: "S = (affine hull S) \<inter> \<Inter>F"
                  and faces: "\<And>h. h \<in> F \<Longrightarrow> \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x \<le> b}"
[PROOF STATE]
proof (prove)
using this:
polyhedron S

goal (1 subgoal):
 1. (\<And>F. \<lbrakk>finite F; S = affine hull S \<inter> \<Inter> F; \<And>h. h \<in> F \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (fastforce simp add: polyhedron_Int_affine)
[PROOF STATE]
proof (state)
this:
finite F
S = affine hull S \<inter> \<Inter> F
?h \<in> F \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> ?h = {x. a \<bullet> x \<le> b}

goal (2 subgoals):
 1. polyhedron S \<Longrightarrow> \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
 2. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)) \<Longrightarrow> polyhedron S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
S = affine hull S \<inter> \<Inter> F
?h \<in> F \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> ?h = {x. a \<bullet> x \<le> b}
[PROOF STEP]
obtain a b where ab: "\<And>h. h \<in> F \<Longrightarrow> a h \<noteq> 0 \<and> h = {x. a h \<bullet> x \<le> b h}"
[PROOF STATE]
proof (prove)
using this:
finite F
S = affine hull S \<inter> \<Inter> F
?h \<in> F \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> ?h = {x. a \<bullet> x \<le> b}

goal (1 subgoal):
 1. (\<And>a b. (\<And>h. h \<in> F \<Longrightarrow> a h \<noteq> (0::'a) \<and> h = {x. a h \<bullet> x \<le> b h}) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?h \<in> F \<Longrightarrow> a ?h \<noteq> (0::'a) \<and> ?h = {x. a ?h \<bullet> x \<le> b ?h}

goal (2 subgoals):
 1. polyhedron S \<Longrightarrow> \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
 2. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)) \<Longrightarrow> polyhedron S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
[PROOF STEP]
have "\<exists>a' b'. a' \<noteq> 0 \<and>
                  affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and>
                  (\<forall>w \<in> affine hull S. (w + a') \<in> affine hull S)"
        if "h \<in> F" "\<not>(affine hull S \<subseteq> h)" for h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
have "a h \<noteq> 0" and "h = {x. a h \<bullet> x \<le> b h}" "h \<inter> \<Inter>F = \<Inter>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a h \<noteq> (0::'a) &&& h = {x. a h \<bullet> x \<le> b h} &&& h \<inter> \<Inter> F = \<Inter> F
[PROOF STEP]
using \<open>h \<in> F\<close> ab
[PROOF STATE]
proof (prove)
using this:
h \<in> F
?h \<in> F \<Longrightarrow> a ?h \<noteq> (0::'a) \<and> ?h = {x. a ?h \<bullet> x \<le> b ?h}

goal (1 subgoal):
 1. a h \<noteq> (0::'a) &&& h = {x. a h \<bullet> x \<le> b h} &&& h \<inter> \<Inter> F = \<Inter> F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a h \<noteq> (0::'a)
h = {x. a h \<bullet> x \<le> b h}
h \<inter> \<Inter> F = \<Inter> F

goal (1 subgoal):
 1. \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a h \<noteq> (0::'a)
h = {x. a h \<bullet> x \<le> b h}
h \<inter> \<Inter> F = \<Inter> F
[PROOF STEP]
have "(affine hull S) \<inter> {x. a h \<bullet> x \<le> b h} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
a h \<noteq> (0::'a)
h = {x. a h \<bullet> x \<le> b h}
h \<inter> \<Inter> F = \<Inter> F

goal (1 subgoal):
 1. affine hull S \<inter> {x. a h \<bullet> x \<le> b h} \<noteq> {}
[PROOF STEP]
by (metis (no_types) affine_hull_eq_empty inf.absorb_iff2 inf_assoc inf_bot_right inf_commute seq that(2))
[PROOF STATE]
proof (state)
this:
affine hull S \<inter> {x. a h \<bullet> x \<le> b h} \<noteq> {}

goal (1 subgoal):
 1. \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
affine hull S \<inter> {x. a h \<bullet> x \<le> b h} \<noteq> {}

goal (1 subgoal):
 1. \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
have "\<not> (affine hull S \<subseteq> {x. a h \<bullet> x \<le> b h})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> affine hull S \<subseteq> {x. a h \<bullet> x \<le> b h}
[PROOF STEP]
using \<open>h = {x. a h \<bullet> x \<le> b h}\<close> that(2)
[PROOF STATE]
proof (prove)
using this:
h = {x. a h \<bullet> x \<le> b h}
\<not> affine hull S \<subseteq> h

goal (1 subgoal):
 1. \<not> affine hull S \<subseteq> {x. a h \<bullet> x \<le> b h}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> affine hull S \<subseteq> {x. a h \<bullet> x \<le> b h}

goal (1 subgoal):
 1. \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
affine hull S \<inter> {x. a h \<bullet> x \<le> b h} \<noteq> {}
\<not> affine hull S \<subseteq> {x. a h \<bullet> x \<le> b h}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
affine hull S \<inter> {x. a h \<bullet> x \<le> b h} \<noteq> {}
\<not> affine hull S \<subseteq> {x. a h \<bullet> x \<le> b h}

goal (1 subgoal):
 1. \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
using affine_parallel_slice [of "affine hull S"]
[PROOF STATE]
proof (prove)
using this:
affine hull S \<inter> {x. a h \<bullet> x \<le> b h} \<noteq> {}
\<not> affine hull S \<subseteq> {x. a h \<bullet> x \<le> b h}
\<lbrakk>affine (affine hull S); affine hull S \<inter> {x. ?a \<bullet> x \<le> ?b} \<noteq> {}; \<not> affine hull S \<subseteq> {x. ?a \<bullet> x \<le> ?b}; \<And>a' b'. \<lbrakk>a' \<noteq> (0::'a); affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> {x. ?a \<bullet> x \<le> ?b}; affine hull S \<inter> {x. a' \<bullet> x = b'} = affine hull S \<inter> {x. ?a \<bullet> x = ?b}; \<And>w. w \<in> affine hull S \<Longrightarrow> w + a' \<in> affine hull S\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
by (metis \<open>h = {x. a h \<bullet> x \<le> b h}\<close> affine_affine_hull)
[PROOF STATE]
proof (state)
this:
\<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?h \<in> F; \<not> affine hull S \<subseteq> ?h\<rbrakk> \<Longrightarrow> \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> ?h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)

goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?h \<in> F; \<not> affine hull S \<subseteq> ?h\<rbrakk> \<Longrightarrow> \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> ?h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)
[PROOF STEP]
obtain a b
         where ab: "\<And>h. \<lbrakk>h \<in> F; \<not> (affine hull S \<subseteq> h)\<rbrakk>
             \<Longrightarrow> a h \<noteq> 0 \<and>
                  affine hull S \<inter> {x. a h \<bullet> x \<le> b h} = affine hull S \<inter> h \<and>
                  (\<forall>w \<in> affine hull S. (w + a h) \<in> affine hull S)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?h \<in> F; \<not> affine hull S \<subseteq> ?h\<rbrakk> \<Longrightarrow> \<exists>a' b'. a' \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a' \<bullet> x \<le> b'} = affine hull S \<inter> ?h \<and> (\<forall>w\<in>affine hull S. w + a' \<in> affine hull S)

goal (1 subgoal):
 1. (\<And>a b. (\<And>h. \<lbrakk>h \<in> F; \<not> affine hull S \<subseteq> h\<rbrakk> \<Longrightarrow> a h \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a h \<bullet> x \<le> b h} = affine hull S \<inter> h \<and> (\<forall>w\<in>affine hull S. w + a h \<in> affine hull S)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<lbrakk>?h \<in> F; \<not> affine hull S \<subseteq> ?h\<rbrakk> \<Longrightarrow> a ?h \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a ?h \<bullet> x \<le> b ?h} = affine hull S \<inter> ?h \<and> (\<forall>w\<in>affine hull S. w + a ?h \<in> affine hull S)

goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
[PROOF STEP]
have seq2: "S = affine hull S \<inter> (\<Inter>h\<in>{h \<in> F. \<not> affine hull S \<subseteq> h}. {x. a h \<bullet> x \<le> b h})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = affine hull S \<inter> (\<Inter>h\<in>{h \<in> F. \<not> affine hull S \<subseteq> h}. {x. a h \<bullet> x \<le> b h})
[PROOF STEP]
by (subst seq) (auto simp: ab INT_extend_simps)
[PROOF STATE]
proof (state)
this:
S = affine hull S \<inter> (\<Inter>h\<in>{h \<in> F. \<not> affine hull S \<subseteq> h}. {x. a h \<bullet> x \<le> b h})

goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
[PROOF STEP]
apply (rule_tac x="(\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h. h \<in> F \<and> \<not>(affine hull S \<subseteq> h)}" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h \<in> F. \<not> affine hull S \<subseteq> h}) \<and> S = affine hull S \<inter> (\<Inter>h\<in>{h \<in> F. \<not> affine hull S \<subseteq> h}. {x. a h \<bullet> x \<le> b h}) \<and> (\<forall>h\<in>(\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h \<in> F. \<not> affine hull S \<subseteq> h}. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
[PROOF STEP]
apply (intro conjI seq2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ((\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h \<in> F. \<not> affine hull S \<subseteq> h})
 2. \<forall>h\<in>(\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h \<in> F. \<not> affine hull S \<subseteq> h}. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)
[PROOF STEP]
using \<open>finite F\<close>
[PROOF STATE]
proof (prove)
using this:
finite F

goal (2 subgoals):
 1. finite ((\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h \<in> F. \<not> affine hull S \<subseteq> h})
 2. \<forall>h\<in>(\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h \<in> F. \<not> affine hull S \<subseteq> h}. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>h\<in>(\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h \<in> F. \<not> affine hull S \<subseteq> h}. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)
[PROOF STEP]
using ab
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?h \<in> F; \<not> affine hull S \<subseteq> ?h\<rbrakk> \<Longrightarrow> a ?h \<noteq> (0::'a) \<and> affine hull S \<inter> {x. a ?h \<bullet> x \<le> b ?h} = affine hull S \<inter> ?h \<and> (\<forall>w\<in>affine hull S. w + a ?h \<in> affine hull S)

goal (1 subgoal):
 1. \<forall>h\<in>(\<lambda>h. {x. a h \<bullet> x \<le> b h}) ` {h \<in> F. \<not> affine hull S \<subseteq> h}. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))

goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)) \<Longrightarrow> polyhedron S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)) \<Longrightarrow> polyhedron S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))

goal (1 subgoal):
 1. \<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S)) \<Longrightarrow> polyhedron S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<exists>F. finite F \<and> S = affine hull S \<inter> \<Inter> F \<and> (\<forall>h\<in>F. \<exists>a b. a \<noteq> (0::'a) \<and> h = {x. a \<bullet> x \<le> b} \<and> (\<forall>x\<in>affine hull S. x + a \<in> affine hull S))

goal (1 subgoal):
 1. polyhedron S
[PROOF STEP]
by (metis polyhedron_Int_affine)
[PROOF STATE]
proof (state)
this:
polyhedron S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinal_plus_not_0: "(0 < x + y) = (0 < x \<or> 0 < (y::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < x + y) = (0 < x \<or> 0 < y)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>0 < x + 0; y = 0\<rbrakk> \<Longrightarrow> 0 < x
 2. 0 < x \<Longrightarrow> 0 < x + y
 3. 0 < y \<Longrightarrow> 0 < x + y
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 0 < x + y
 2. 0 < y \<Longrightarrow> 0 < x + y
[PROOF STEP]
apply (erule order_less_le_trans, rule ordinal_le_plusR)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < y \<Longrightarrow> 0 < x + y
[PROOF STEP]
apply (erule order_less_le_trans, rule ordinal_le_plusL)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_of_odd_cubes:
  "(\<Sum>i=0..<n. Suc (2*i) * Suc (2*i) * Suc (2*i)) =
    n * n * (2 * n * n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. Suc (2 * i) * Suc (2 * i) * Suc (2 * i)) = n * n * (2 * n * n - 1)
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma normalize_0: "(normalize x = 0) = (x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Projections.normalize x = (0::'a)) = (x = (0::'a))
[PROOF STEP]
unfolding normalize_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1 / norm x) *\<^sub>R x = (0::'a)) = (x = (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma interpolation_poly_int_def: "distinct (map fst xs_ys) \<Longrightarrow>
  interpolation_poly_int alg xs_ys = (let
     rxs_ys = map (\<lambda> (x,y). (of_int x, of_int y)) xs_ys;
     rp = interpolation_poly alg rxs_ys
     in if (\<forall> x \<in> set (coeffs rp). is_int_rat x) then
       Some (map_poly int_of_rat rp) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst xs_ys) \<Longrightarrow> interpolation_poly_int alg xs_ys = (let rxs_ys = map (\<lambda>(x, y). (rat_of_int x, rat_of_int y)) xs_ys; rp = interpolation_poly alg rxs_ys in if \<forall>x\<in>set (coeffs rp). is_int_rat x then Some (map_poly int_of_rat rp) else None)
[PROOF STEP]
by (cases alg, auto simp: newton_interpolation_poly_int)


[STATEMENT]
lemma isCont_Re: "isCont f a \<Longrightarrow> isCont (\<lambda>x. Re (f x)) a"
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f a \<Longrightarrow> isCont (\<lambda>x. Re (f x)) a
[PROOF STEP]
by (simp add: isCont_def LIM_Re)


[STATEMENT]
lemma Ila''m_Ilam: "$(I^{l}a'')^{m}_n = (1+i).^(1/m) * $(I^{l}a)^{m}_n"
  if "l \<noteq> 0" "m \<noteq> 0" for l m n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $(I^{l}a'')^{m}_n = (1 + i) .^ (1 / real m) * $(I^{l}a)^{m}_n
[PROOF STEP]
unfolding ann_incr_def ann_due_incr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n * m. $v .^ (real k / real m) * real_of_int \<lceil>real (l * (k + 1)) / real m\<rceil> / (real l * real m)) = (1 + i) .^ (1 / real m) * (\<Sum>k<n * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (l * (k + 1)) / real m\<rceil> / (real l * real m))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
l \<noteq> 0
m \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>k<n * m. $v .^ (real k / real m) * real_of_int \<lceil>real (l * (k + 1)) / real m\<rceil> / (real l * real m)) = (1 + i) .^ (1 / real m) * (\<Sum>k<n * m. $v .^ (real (k + 1) / real m) * real_of_int \<lceil>real (l * (k + 1)) / real m\<rceil> / (real l * real m))
[PROOF STEP]
apply (subst i_v, subst powr_powr, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < l; 0 < m\<rbrakk> \<Longrightarrow> (\<Sum>k<n * m. $v .^ (real k / real m) * real_of_int \<lceil>(real l + real l * real k) / real m\<rceil> / (real l * real m)) = $v .^ - (1 / real m) * (\<Sum>k<n * m. $v .^ ((1 + real k) / real m) * real_of_int \<lceil>(real l + real l * real k) / real m\<rceil> / (real l * real m))
[PROOF STEP]
apply (subst sum_distrib_left)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < l; 0 < m\<rbrakk> \<Longrightarrow> (\<Sum>k<n * m. $v .^ (real k / real m) * real_of_int \<lceil>(real l + real l * real k) / real m\<rceil> / (real l * real m)) = (\<Sum>n<n * m. $v .^ - (1 / real m) * ($v .^ ((1 + real n) / real m) * real_of_int \<lceil>(real l + real l * real n) / real m\<rceil> / (real l * real m)))
[PROOF STEP]
apply (rule sum.cong; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < l; 0 < m; x < n * m\<rbrakk> \<Longrightarrow> \<lceil>(real l + real l * real x) / real m\<rceil> = 0 \<or> $v .^ (real x / real m) = $v .^ - (1 / real m) * $v .^ ((1 + real x) / real m)
[PROOF STEP]
apply (rule disjI2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < l; 0 < m; x < n * m\<rbrakk> \<Longrightarrow> $v .^ (real x / real m) = $v .^ - (1 / real m) * $v .^ ((1 + real x) / real m)
[PROOF STEP]
by (smt (verit) add_divide_distrib powr_add)


[STATEMENT]
lemma setdist_subset_left: "\<lbrakk>S \<noteq> {}; S \<subseteq> T\<rbrakk> \<Longrightarrow> setdist T u \<le> setdist S u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; S \<subseteq> T\<rbrakk> \<Longrightarrow> setdist T u \<le> setdist S u
[PROOF STEP]
by (metis setdist_subset_right setdist_sym)


[STATEMENT]
lemma positively_invariant_inner:
  shows "c.positively_invariant  {p. (\<lambda>p. 1/4 - ((fst p)\<^sup>2 + (snd p)\<^sup>2)) p \<le> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c.positively_invariant {p. 1 / 4 - ((fst p)\<^sup>2 + (snd p)\<^sup>2) \<le> 0}
[PROOF STEP]
apply (rule c.positively_invariant_le[of "\<lambda>p.-2*((fst p)^2+(snd p)^2)" _ "\<lambda>x p. - 2 * fst x * fst p - 2 * snd x * snd p"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on UNIV (\<lambda>p. - 2 * ((fst p)\<^sup>2 + (snd p)\<^sup>2))
 2. \<And>x. ((\<lambda>x. 1 / 4 - ((fst x)\<^sup>2 + (snd x)\<^sup>2)) has_derivative (\<lambda>p. - 2 * fst x * fst p - 2 * snd x * snd p)) (at x)
 3. \<And>s. - 2 * fst s * fst (case s of (x, y) \<Rightarrow> (cx x y, cy x y)) - 2 * snd s * snd (case s of (x, y) \<Rightarrow> (cx x y, cy x y)) \<le> - 2 * ((fst s)\<^sup>2 + (snd s)\<^sup>2) * (1 / 4 - ((fst s)\<^sup>2 + (snd s)\<^sup>2))
[PROOF STEP]
apply (auto intro!: continuous_intros derivative_eq_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. - (2 * a * cx a b) - 2 * b * cy a b \<le> (- (2 * a\<^sup>2) - 2 * b\<^sup>2) * (1 / 4 - (a\<^sup>2 + b\<^sup>2))
[PROOF STEP]
unfolding cx_def cy_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. - (2 * a * (- b + a * (1 - a\<^sup>2 - b\<^sup>2))) - 2 * b * (a + b * (1 - a\<^sup>2 - b\<^sup>2)) \<le> (- (2 * a\<^sup>2) - 2 * b\<^sup>2) * (1 / 4 - (a\<^sup>2 + b\<^sup>2))
[PROOF STEP]
by (sos "(((A<0 * R<1) + (R<1 * ((R<3/2 * [a]^2) + (R<3/2 * [b]^2)))))")


[STATEMENT]
lemma uncountable_Real_set: "uncountable (elts Real_set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable (elts Real_set)
[PROOF STEP]
using V_of_Real_set countable_iff_bij uncountable_UNIV_real
[PROOF STATE]
proof (prove)
using this:
bij_betw V_of UNIV (elts Real_set)
bij_betw ?f ?A ?B \<Longrightarrow> countable ?A = countable ?B
uncountable UNIV

goal (1 subgoal):
 1. uncountable (elts Real_set)
[PROOF STEP]
by blast


[STATEMENT]
lemma retraction_maps_eq:
   "\<lbrakk>retraction_maps X Y f g; \<And>x. x \<in> topspace X \<Longrightarrow> f x = f' x; \<And>x. x \<in> topspace Y \<Longrightarrow> g x = g' x\<rbrakk>
        \<Longrightarrow> retraction_maps X Y f' g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_maps X Y f g; \<And>x. x \<in> topspace X \<Longrightarrow> f x = f' x; \<And>x. x \<in> topspace Y \<Longrightarrow> g x = g' x\<rbrakk> \<Longrightarrow> retraction_maps X Y f' g'
[PROOF STEP]
unfolding retraction_maps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X Y f \<and> continuous_map Y X g \<and> (\<forall>x\<in>topspace Y. f (g x) = x); \<And>x. x \<in> topspace X \<Longrightarrow> f x = f' x; \<And>x. x \<in> topspace Y \<Longrightarrow> g x = g' x\<rbrakk> \<Longrightarrow> continuous_map X Y f' \<and> continuous_map Y X g' \<and> (\<forall>x\<in>topspace Y. f' (g' x) = x)
[PROOF STEP]
by (metis (no_types, lifting) continuous_map_def continuous_map_eq)


[STATEMENT]
lemma Gromov_extension_inv_fixed_point:
  assumes "isometry (f::'a::Gromov_hyperbolic_space \<Rightarrow> 'a)" "Gromov_extension f xi = xi"
  shows "Gromov_extension (inv f) xi = xi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gromov_extension (inv f) xi = xi
[PROOF STEP]
by (metis Gromov_extension_isometry_inv(1) Gromov_extension_isometry_inv(2) assms(1) assms(2) bij_betw_def inv_f_f)


[STATEMENT]
lemma Lim_emeasure_incseq:
  "range A \<subseteq> sets M \<Longrightarrow> incseq A \<Longrightarrow> (\<lambda>i. (emeasure M (A i))) \<longlonglongrightarrow> emeasure M (\<Union>i. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>range A \<subseteq> sets M; incseq A\<rbrakk> \<Longrightarrow> (\<lambda>i. emeasure M (A i)) \<longlonglongrightarrow> emeasure M (\<Union> (range A))
[PROOF STEP]
using emeasure_countably_additive
[PROOF STATE]
proof (prove)
using this:
countably_additive (sets ?M) (emeasure ?M)

goal (1 subgoal):
 1. \<lbrakk>range A \<subseteq> sets M; incseq A\<rbrakk> \<Longrightarrow> (\<lambda>i. emeasure M (A i)) \<longlonglongrightarrow> emeasure M (\<Union> (range A))
[PROOF STEP]
by (auto simp add: sets.countably_additive_iff_continuous_from_below emeasure_positive
    emeasure_additive)


[STATEMENT]
lemma INFM_conjI: "INFM x. P x \<Longrightarrow> MOST x. Q x \<Longrightarrow> INFM x. P x \<and> Q x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>\<^sub>\<infinity>x. P x; \<forall>\<^sub>\<infinity>x. Q x\<rbrakk> \<Longrightarrow> \<exists>\<^sub>\<infinity>x. P x \<and> Q x
[PROOF STEP]
by (rule frequently_rev_mp[of P]) (auto elim: eventually_mono)


[STATEMENT]
lemma higher_differentiable_on_sin: "higher_differentiable_on S (\<lambda>x. sin (f x::real)) n"
  and higher_differentiable_on_cos: "higher_differentiable_on S (\<lambda>x. cos (f x::real)) n"
  if f: "higher_differentiable_on S f n" and S: "open S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. sin (f x)) n &&& higher_differentiable_on S (\<lambda>x. cos (f x)) n
[PROOF STEP]
unfolding atomize_conj
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on S f n

goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. higher_differentiable_on S f 0 \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) 0 \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) 0
 2. \<And>n. \<lbrakk>higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n; higher_differentiable_on S f (Suc n)\<rbrakk> \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) (Suc n) \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n
higher_differentiable_on S f (Suc n)

goal (2 subgoals):
 1. higher_differentiable_on S f 0 \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) 0 \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) 0
 2. \<And>n. \<lbrakk>higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n; higher_differentiable_on S f (Suc n)\<rbrakk> \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) (Suc n) \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n
higher_differentiable_on S f (Suc n)
[PROOF STEP]
have "higher_differentiable_on S f n"
    "higher_differentiable_on S (\<lambda>x. sin (f x)) n"
    "higher_differentiable_on S (\<lambda>x. cos (f x)) n"
    "\<And>x. x \<in> S \<Longrightarrow> f differentiable at x"
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n
higher_differentiable_on S f (Suc n)

goal (1 subgoal):
 1. (higher_differentiable_on S f n &&& higher_differentiable_on S (\<lambda>x. sin (f x)) n) &&& higher_differentiable_on S (\<lambda>x. cos (f x)) n &&& (\<And>x. x \<in> S \<Longrightarrow> f differentiable at x)
[PROOF STEP]
using higher_differentiable_on_SucD
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n
higher_differentiable_on S f (Suc n)
higher_differentiable_on ?S ?f (Suc ?n) \<Longrightarrow> higher_differentiable_on ?S ?f ?n

goal (1 subgoal):
 1. (higher_differentiable_on S f n &&& higher_differentiable_on S (\<lambda>x. sin (f x)) n) &&& higher_differentiable_on S (\<lambda>x. cos (f x)) n &&& (\<And>x. x \<in> S \<Longrightarrow> f differentiable at x)
[PROOF STEP]
by (auto simp: higher_differentiable_on.simps)
[PROOF STATE]
proof (state)
this:
higher_differentiable_on S f n
higher_differentiable_on S (\<lambda>x. sin (f x)) n
higher_differentiable_on S (\<lambda>x. cos (f x)) n
?x \<in> S \<Longrightarrow> f differentiable at ?x

goal (2 subgoals):
 1. higher_differentiable_on S f 0 \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) 0 \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) 0
 2. \<And>n. \<lbrakk>higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n; higher_differentiable_on S f (Suc n)\<rbrakk> \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) (Suc n) \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) (Suc n)
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n
higher_differentiable_on S f (Suc n)
higher_differentiable_on S f n
higher_differentiable_on S (\<lambda>x. sin (f x)) n
higher_differentiable_on S (\<lambda>x. cos (f x)) n
?x \<in> S \<Longrightarrow> f differentiable at ?x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on S f n \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) n \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) n
higher_differentiable_on S f (Suc n)
higher_differentiable_on S f n
higher_differentiable_on S (\<lambda>x. sin (f x)) n
higher_differentiable_on S (\<lambda>x. cos (f x)) n
?x \<in> S \<Longrightarrow> f differentiable at ?x

goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. sin (f x)) (Suc n) \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) (Suc n)
[PROOF STEP]
by (auto simp: higher_differentiable_on.simps sin_differentiable_at cos_differentiable_at
        frechet_derivative_sin frechet_derivative_cos S
        intro!: higher_differentiable_on_mult higher_differentiable_on_uminus
        cong: higher_differentiable_on_cong[OF S])
[PROOF STATE]
proof (state)
this:
higher_differentiable_on S (\<lambda>x. sin (f x)) (Suc n) \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) (Suc n)

goal (1 subgoal):
 1. higher_differentiable_on S f 0 \<Longrightarrow> higher_differentiable_on S (\<lambda>x. sin (f x)) 0 \<and> higher_differentiable_on S (\<lambda>x. cos (f x)) 0
[PROOF STEP]
qed (auto simp: higher_differentiable_on.simps intro!: continuous_intros)


[STATEMENT]
lemma onorm_inner_left:
  assumes "bounded_linear r"
  shows "onorm (\<lambda>x. r x \<bullet> f) \<le> onorm r * norm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (\<lambda>x. r x \<bullet> f) \<le> onorm r * norm f
[PROOF STEP]
proof (rule onorm_bound)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x \<bullet> f) \<le> onorm r * norm f * norm x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x \<bullet> f) \<le> onorm r * norm f * norm x
[PROOF STEP]
have "norm (r x \<bullet> f) \<le> norm (r x) * norm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (r x \<bullet> f) \<le> norm (r x) * norm f
[PROOF STEP]
by (simp add: Cauchy_Schwarz_ineq2)
[PROOF STATE]
proof (state)
this:
norm (r x \<bullet> f) \<le> norm (r x) * norm f

goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x \<bullet> f) \<le> onorm r * norm f * norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (r x \<bullet> f) \<le> norm (r x) * norm f

goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x \<bullet> f) \<le> onorm r * norm f * norm x
[PROOF STEP]
have "\<dots> \<le> onorm r * norm x * norm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (r x) * norm f \<le> onorm r * norm x * norm f
[PROOF STEP]
by (intro mult_right_mono onorm assms norm_ge_zero)
[PROOF STATE]
proof (state)
this:
norm (r x) * norm f \<le> onorm r * norm x * norm f

goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x \<bullet> f) \<le> onorm r * norm f * norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (r x \<bullet> f) \<le> onorm r * norm x * norm f
[PROOF STEP]
show "norm (r x \<bullet> f) \<le> onorm r * norm f * norm x"
[PROOF STATE]
proof (prove)
using this:
norm (r x \<bullet> f) \<le> onorm r * norm x * norm f

goal (1 subgoal):
 1. norm (r x \<bullet> f) \<le> onorm r * norm f * norm x
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
norm (r x \<bullet> f) \<le> onorm r * norm f * norm x

goal (1 subgoal):
 1. 0 \<le> onorm r * norm f
[PROOF STEP]
qed (intro mult_nonneg_nonneg norm_ge_zero onorm_pos_le assms)


[STATEMENT]
lemma norm_ket_k_ge_K:
  "k \<ge> K \<Longrightarrow> inner_prod (ket_k k) (ket_k k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<le> k \<Longrightarrow> inner_prod (ket_k k) (ket_k k) = 0
[PROOF STEP]
unfolding ket_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<le> k \<Longrightarrow> inner_prod (Matrix.vec K (\<lambda>ka. if ka = k then 1 else 0)) (Matrix.vec K (\<lambda>ka. if ka = k then 1 else 0)) = 0
[PROOF STEP]
by (simp add: scalar_prod_def)


[STATEMENT]
lemma llist_all2_conv_lzip:
  "llist_all2 P xs ys \<longleftrightarrow> llength xs = llength ys \<and> (\<forall>(x, y) \<in> lset (lzip xs ys). P x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llist_all2 P xs ys = (llength xs = llength ys \<and> (\<forall>(x, y)\<in>lset (lzip xs ys). P x y))
[PROOF STEP]
by(auto 4 4 elim!: GrpE simp add:
  llist_all2_def lmap_fst_lzip_conv_ltake lmap_snd_lzip_conv_ltake ltake_all
  intro!: GrpI relcomppI[of _ xs _ _ ys])


[STATEMENT]
lemma d_dist2: "d x + (d y \<cdot> d z) = (d x + d y) \<cdot> (d x + d z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x + d y \<cdot> d z = (d x + d y) \<cdot> (d x + d z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d x + d y \<cdot> d z = (d x + d y) \<cdot> (d x + d z)
[PROOF STEP]
have "(d x + d y) \<cdot> (d x + d z) = d x \<cdot> d x + d x \<cdot> d z + d y \<cdot> d x + d y \<cdot> d z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d x + d y) \<cdot> (d x + d z) = d x \<cdot> d x + d x \<cdot> d z + d y \<cdot> d x + d y \<cdot> d z
[PROOF STEP]
using add_assoc d_dist1 local.s_prod_distr
[PROOF STATE]
proof (prove)
using this:
?a + ?b + ?c = ?a + (?b + ?c)
d ?x \<cdot> (d ?y + d ?z) = d ?x \<cdot> d ?y + d ?x \<cdot> d ?z
(?x + ?y) \<cdot> ?z = ?x \<cdot> ?z + ?y \<cdot> ?z

goal (1 subgoal):
 1. (d x + d y) \<cdot> (d x + d z) = d x \<cdot> d x + d x \<cdot> d z + d y \<cdot> d x + d y \<cdot> d z
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(d x + d y) \<cdot> (d x + d z) = d x \<cdot> d x + d x \<cdot> d z + d y \<cdot> d x + d y \<cdot> d z

goal (1 subgoal):
 1. d x + d y \<cdot> d z = (d x + d y) \<cdot> (d x + d z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(d x + d y) \<cdot> (d x + d z) = d x \<cdot> d x + d x \<cdot> d z + d y \<cdot> d x + d y \<cdot> d z

goal (1 subgoal):
 1. d x + d y \<cdot> d z = (d x + d y) \<cdot> (d x + d z)
[PROOF STEP]
have "... = d x + d x \<cdot> d z + d x \<cdot> d y + d y \<cdot> d z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x \<cdot> d x + d x \<cdot> d z + d y \<cdot> d x + d y \<cdot> d z = d x + d x \<cdot> d z + d x \<cdot> d y + d y \<cdot> d z
[PROOF STEP]
using local.d_comm_ax
[PROOF STATE]
proof (prove)
using this:
d ?x \<cdot> d ?y = d ?y \<cdot> d ?x

goal (1 subgoal):
 1. d x \<cdot> d x + d x \<cdot> d z + d y \<cdot> d x + d y \<cdot> d z = d x + d x \<cdot> d z + d x \<cdot> d y + d y \<cdot> d z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d x \<cdot> d x + d x \<cdot> d z + d y \<cdot> d x + d y \<cdot> d z = d x + d x \<cdot> d z + d x \<cdot> d y + d y \<cdot> d z

goal (1 subgoal):
 1. d x + d y \<cdot> d z = (d x + d y) \<cdot> (d x + d z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(d x + d y) \<cdot> (d x + d z) = d x + d x \<cdot> d z + d x \<cdot> d y + d y \<cdot> d z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(d x + d y) \<cdot> (d x + d z) = d x + d x \<cdot> d z + d x \<cdot> d y + d y \<cdot> d z

goal (1 subgoal):
 1. d x + d y \<cdot> d z = (d x + d y) \<cdot> (d x + d z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d x + d y \<cdot> d z = (d x + d y) \<cdot> (d x + d z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lim_transform_within_set:
  fixes a :: "'a::metric_space" and l :: "'b::metric_space"
  shows "\<lbrakk>(f \<longlongrightarrow> l) (at a within S); eventually (\<lambda>x. x \<in> S \<longleftrightarrow> x \<in> T) (at a)\<rbrakk>
         \<Longrightarrow> (f \<longlongrightarrow> l) (at a within T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> l) (at a within S); \<forall>\<^sub>F x in at a. (x \<in> S) = (x \<in> T)\<rbrakk> \<Longrightarrow> (f \<longlongrightarrow> l) (at a within T)
[PROOF STEP]
apply (clarsimp simp: eventually_at Lim_within)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>d e. \<lbrakk>\<forall>e>0. \<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<and> dist x a < d \<longrightarrow> dist (f x) l < e; 0 < d; \<forall>x. x \<noteq> a \<and> dist x a < d \<longrightarrow> (x \<in> S) = (x \<in> T); 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x\<in>T. x \<noteq> a \<and> dist x a < d \<longrightarrow> dist (f x) l < e
[PROOF STEP]
apply (drule_tac x=e in spec, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>d e da. \<lbrakk>0 < d; \<forall>x. x \<noteq> a \<and> dist x a < d \<longrightarrow> (x \<in> S) = (x \<in> T); 0 < e; 0 < da; \<forall>x\<in>S. x \<noteq> a \<and> dist x a < da \<longrightarrow> dist (f x) l < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x\<in>T. x \<noteq> a \<and> dist x a < d \<longrightarrow> dist (f x) l < e
[PROOF STEP]
apply (rename_tac k)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>d e k. \<lbrakk>0 < d; \<forall>x. x \<noteq> a \<and> dist x a < d \<longrightarrow> (x \<in> S) = (x \<in> T); 0 < e; 0 < k; \<forall>x\<in>S. x \<noteq> a \<and> dist x a < k \<longrightarrow> dist (f x) l < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x\<in>T. x \<noteq> a \<and> dist x a < d \<longrightarrow> dist (f x) l < e
[PROOF STEP]
apply (rule_tac x="min d k" in exI, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eventually_diff_zero_imp_eq:
  fixes f g :: "real \<Rightarrow> real"
  assumes "eventually (\<lambda>x. f x - g x = 0) at_top"
  shows   "eventually (\<lambda>x. f x = g x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x = g x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. f x - g x = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x = g x
[PROOF STEP]
by eventually_elim simp


[STATEMENT]
lemma last_fin_make_untimed_inf_truncate:
  assumes "z i = [a]"
  shows    "last (fin_make_untimed (inf_truncate z i)) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (fin_make_untimed (inf_truncate z i)) = a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z i = [a]

goal (1 subgoal):
 1. last (fin_make_untimed (inf_truncate z i)) = a
[PROOF STEP]
proof (induction i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z 0 = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z 0)) = a
 2. \<And>i. \<lbrakk>z i = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z i)) = a; z (Suc i) = [a]\<rbrakk> \<Longrightarrow> last (fin_make_untimed (inf_truncate z (Suc i))) = a
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
z 0 = [a]

goal (2 subgoals):
 1. z 0 = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z 0)) = a
 2. \<And>i. \<lbrakk>z i = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z i)) = a; z (Suc i) = [a]\<rbrakk> \<Longrightarrow> last (fin_make_untimed (inf_truncate z (Suc i))) = a
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
z 0 = [a]

goal (1 subgoal):
 1. last (fin_make_untimed (inf_truncate z 0)) = a
[PROOF STEP]
by (simp add: fin_make_untimed_def)
[PROOF STATE]
proof (state)
this:
last (fin_make_untimed (inf_truncate z 0)) = a

goal (1 subgoal):
 1. \<And>i. \<lbrakk>z i = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z i)) = a; z (Suc i) = [a]\<rbrakk> \<Longrightarrow> last (fin_make_untimed (inf_truncate z (Suc i))) = a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>z i = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z i)) = a; z (Suc i) = [a]\<rbrakk> \<Longrightarrow> last (fin_make_untimed (inf_truncate z (Suc i))) = a
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
z i = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z i)) = a
z (Suc i) = [a]

goal (1 subgoal):
 1. \<And>i. \<lbrakk>z i = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z i)) = a; z (Suc i) = [a]\<rbrakk> \<Longrightarrow> last (fin_make_untimed (inf_truncate z (Suc i))) = a
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
z i = [a] \<Longrightarrow> last (fin_make_untimed (inf_truncate z i)) = a
z (Suc i) = [a]

goal (1 subgoal):
 1. last (fin_make_untimed (inf_truncate z (Suc i))) = a
[PROOF STEP]
by (simp add: fin_make_untimed_def)
[PROOF STATE]
proof (state)
this:
last (fin_make_untimed (inf_truncate z (Suc i))) = a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conversep_in_rel: "(in_rel R)\<inverse>\<inverse> = in_rel (R\<inverse>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (in_rel R)\<inverse>\<inverse> = in_rel (R\<inverse>)
[PROOF STEP]
unfolding fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x xa. (in_rel R)\<inverse>\<inverse> x xa = in_rel (R\<inverse>) x xa
[PROOF STEP]
by auto


[STATEMENT]
lemma is_min2_union:
  "is_min2 x (ys \<union> zs)
  \<longleftrightarrow> (is_min2 x ys \<and> (\<forall>z\<in>zs. snd x \<le> snd z))
    \<or> ((\<forall>y\<in>ys. snd x \<le> snd y) \<and> is_min2 x zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_min2 x (ys \<union> zs) = (is_min2 x ys \<and> (\<forall>z\<in>zs. snd x \<le> snd z) \<or> (\<forall>y\<in>ys. snd x \<le> snd y) \<and> is_min2 x zs)
[PROOF STEP]
by (auto simp: is_min2_def)


[STATEMENT]
lemma invertible_invertible\<^sub>L_I: "invertible (blinfun_to_matrix f) \<Longrightarrow> invertible\<^sub>L f"
  "invertible\<^sub>L (matrix_to_blinfun X) \<Longrightarrow> invertible (X :: real^_^_)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (invertible (blinfun_to_matrix f) \<Longrightarrow> invertible\<^sub>L f) &&& (invertible\<^sub>L (matrix_to_blinfun X) \<Longrightarrow> invertible X)
[PROOF STEP]
using matrix_to_blinfun_inv\<^sub>L(2) blinfun_to_matrix_inverse(1) matrix_to_blinfun_inv blinfun_to_matrix_inv
[PROOF STATE]
proof (prove)
using this:
invertible ?m \<Longrightarrow> invertible\<^sub>L (matrix_to_blinfun ?m)
invertible\<^sub>L ?X \<Longrightarrow> invertible (blinfun_to_matrix ?X)
matrix_to_blinfun (blinfun_to_matrix ?f) = ?f
blinfun_to_matrix (matrix_to_blinfun ?f) = ?f

goal (1 subgoal):
 1. (invertible (blinfun_to_matrix f) \<Longrightarrow> invertible\<^sub>L f) &&& (invertible\<^sub>L (matrix_to_blinfun X) \<Longrightarrow> invertible X)
[PROOF STEP]
by metis+


[STATEMENT]
lemma  funct_14: "funct_OT_14 (m00,m01,m10,m11) (c0,c1)
                      = return_spmf ((),if c0 then (if c1 then m11 else m10) else (if c1 then m01 else m00))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. funct_OT_14 (m00, m01, m10, m11) (c0, c1) = return_spmf ((), if c0 then if c1 then m11 else m10 else if c1 then m01 else m00)
[PROOF STEP]
by(simp add: funct_OT_14_def)


[STATEMENT]
lemma keys_monom_multI:
  assumes "v \<in> keys p" and "c \<noteq> (0::'b::semiring_no_zero_divisors)"
  shows "t \<oplus> v \<in> keys (monom_mult c t p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<oplus> v \<in> keys (monom_mult c t p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> keys p
c \<noteq> (0::'b)

goal (1 subgoal):
 1. t \<oplus> v \<in> keys (monom_mult c t p)
[PROOF STEP]
unfolding in_keys_iff lookup_monom_mult_plus
[PROOF STATE]
proof (prove)
using this:
lookup p v \<noteq> (0::'b)
c \<noteq> (0::'b)

goal (1 subgoal):
 1. c * lookup p v \<noteq> (0::'b)
[PROOF STEP]
by simp


[STATEMENT]
lemma iso_points_ss_card:
  assumes "ps \<subseteq> \<V>"
  shows "card ps = card (\<pi> ` ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ps = card (\<pi> ` ps)
[PROOF STEP]
using assms bij bij_betw_same_card bij_betw_subset
[PROOF STATE]
proof (prove)
using this:
ps \<subseteq> \<V>
bij_betw \<pi> \<V> \<V>'
bij_betw ?f ?A ?B \<Longrightarrow> card ?A = card ?B
\<lbrakk>bij_betw ?f ?A ?A'; ?B \<subseteq> ?A; ?f ` ?B = ?B'\<rbrakk> \<Longrightarrow> bij_betw ?f ?B ?B'

goal (1 subgoal):
 1. card ps = card (\<pi> ` ps)
[PROOF STEP]
by blast


[STATEMENT]
lemma tanh_minus [simp]: "tanh (-x) = -tanh x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tanh (- x) = - tanh x
[PROOF STEP]
by (simp add: tanh_def)


[STATEMENT]
lemma ennreal_Inf_cmult:
  assumes "c>(0::real)"
  shows "Inf {ennreal c * x |x. P x} = ennreal c * Inf {x. P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {ennreal c * x |x. P x} = ennreal c * \<Sqinter> {x. P x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter> {ennreal c * x |x. P x} = ennreal c * \<Sqinter> {x. P x}
[PROOF STEP]
have "(\<lambda>x::ennreal. c * x) (Inf {x::ennreal. P x}) = Inf ((\<lambda>x::ennreal. c * x)`{x::ennreal. P x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal c * \<Sqinter> {x. P x} = \<Sqinter> ((*) (ennreal c) ` {x. P x})
[PROOF STEP]
apply (rule mono_bij_Inf)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mono ((*) (ennreal c))
 2. bij ((*) (ennreal c))
[PROOF STEP]
apply (simp add: monoI mult_left_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij ((*) (ennreal c))
[PROOF STEP]
apply (rule bij_betw_byWitness[of _ "\<lambda>x. (x::ennreal) / c"], auto simp add: assms)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. ennreal c * a / ennreal c = a
 2. \<And>a'. ennreal c * (a' / ennreal c) = a'
[PROOF STEP]
apply (metis assms ennreal_lessI ennreal_neq_top mult.commute mult_divide_eq_ennreal not_less_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a'. ennreal c * (a' / ennreal c) = a'
[PROOF STEP]
apply (metis assms divide_ennreal_def ennreal_less_zero_iff ennreal_neq_top less_irrefl mult.assoc mult.left_commute mult_divide_eq_ennreal)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
ennreal c * \<Sqinter> {x. P x} = \<Sqinter> ((*) (ennreal c) ` {x. P x})

goal (1 subgoal):
 1. \<Sqinter> {ennreal c * x |x. P x} = ennreal c * \<Sqinter> {x. P x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ennreal c * \<Sqinter> {x. P x} = \<Sqinter> ((*) (ennreal c) ` {x. P x})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ennreal c * \<Sqinter> {x. P x} = \<Sqinter> ((*) (ennreal c) ` {x. P x})

goal (1 subgoal):
 1. \<Sqinter> {ennreal c * x |x. P x} = ennreal c * \<Sqinter> {x. P x}
[PROOF STEP]
by (simp only: setcompr_eq_image[symmetric])
[PROOF STATE]
proof (state)
this:
\<Sqinter> {ennreal c * x |x. P x} = ennreal c * \<Sqinter> {x. P x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_partition_iT_Div_Int: "
  \<lbrakk> 0 < k; 0 < d \<rbrakk> \<Longrightarrow>
  (A \<inter> [n * k\<dots>,d * k - Suc 0]) \<oslash> k =
  (A \<oslash> k) \<inter> ([n * k\<dots>,d * k - Suc 0] \<oslash> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; 0 < d\<rbrakk> \<Longrightarrow> A \<inter> [n * k\<dots>,d * k - Suc 0] \<oslash> k = (A \<oslash> k) \<inter> ([n * k\<dots>,d * k - Suc 0] \<oslash> k)
[PROOF STEP]
apply (rule iIN_iT_Div_Int_mod_0, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; 0 < d\<rbrakk> \<Longrightarrow> \<forall>x\<in>A. x div k \<le> (n * k + d * k - Suc 0) div k \<longrightarrow> x \<le> n * k + d * k - Suc 0
[PROOF STEP]
apply (clarify, rename_tac x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < k; 0 < d; x \<in> A; x div k \<le> (n * k + d * k - Suc 0) div k\<rbrakk> \<Longrightarrow> x \<le> n * k + d * k - Suc 0
[PROOF STEP]
apply (simp add: mod_0_imp_sub_1_div_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < k; 0 < d; x \<in> A; x div k \<le> n + d - Suc 0\<rbrakk> \<Longrightarrow> x \<le> n * k + d * k - Suc 0
[PROOF STEP]
apply (rule ccontr, simp add: linorder_not_le pred_less_eq_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < k; 0 < d; x \<in> A; x div k \<le> n + d - Suc 0; n * k + d * k \<le> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule_tac n=x and k=k in div_le_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < k; 0 < d; x \<in> A; x div k \<le> n + d - Suc 0; (n * k + d * k) div k \<le> x div k\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma directed_alt: "directed X = (X \<noteq> {} \<and> (\<forall>x \<in> X. \<forall>y \<in> X. \<exists>z \<in> X. x \<le> z \<and> y \<le> z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directed X = (X \<noteq> {} \<and> (\<forall>x\<in>X. \<forall>y\<in>X. \<exists>z\<in>X. x \<le> z \<and> y \<le> z))
[PROOF STEP]
by (metis directed_prop directed_nonempty directed_ub)


[STATEMENT]
lemma subst_comp:
  "\<And> x y \<phi> t. \<phi> \<in> fmla \<Longrightarrow> t \<in> trm \<Longrightarrow> x \<in> var \<Longrightarrow> y \<in> var \<Longrightarrow>
  x \<noteq> y \<Longrightarrow> y \<notin> FvarsT t \<Longrightarrow>
  subst (subst \<phi> (Var x) y) t x = subst (subst \<phi> t x) t y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y \<phi> t. \<lbrakk>\<phi> \<in> fmla; t \<in> trm; x \<in> var; y \<in> var; x \<noteq> y; y \<notin> FvarsT t\<rbrakk> \<Longrightarrow> subst (subst \<phi> (Var x) y) t x = subst (subst \<phi> t x) t y
[PROOF STEP]
by (simp add: subst_compose_diff)


[STATEMENT]
lemma iMin_mono: "
  \<lbrakk> mono f; \<exists>x. x \<in> I \<rbrakk> \<Longrightarrow> iMin (f ` I) = f (iMin I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; \<exists>x. x \<in> I\<rbrakk> \<Longrightarrow> iMin (f ` I) = f (iMin I)
[PROOF STEP]
apply (unfold iMin_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; \<exists>x. x \<in> I\<rbrakk> \<Longrightarrow> (LEAST x. x \<in> f ` I) = f (LEAST x. x \<in> I)
[PROOF STEP]
apply (rule Least_mono[of f I], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; \<exists>x. x \<in> I\<rbrakk> \<Longrightarrow> \<exists>x\<in>I. \<forall>xa\<in>I. x \<le> xa
[PROOF STEP]
apply (rule_tac x="iMin I" in bexI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>mono f; \<exists>x. x \<in> I\<rbrakk> \<Longrightarrow> \<forall>x\<in>I. iMin I \<le> x
 2. \<lbrakk>mono f; \<exists>x. x \<in> I\<rbrakk> \<Longrightarrow> iMin I \<in> I
[PROOF STEP]
apply (simp add: iMin_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; \<exists>x. x \<in> I\<rbrakk> \<Longrightarrow> iMin I \<in> I
[PROOF STEP]
apply (simp add: iMinI_ex)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma isCont_eq_Ub:
  fixes f :: "real \<Rightarrow> 'a::linorder_topology"
  shows "a \<le> b \<Longrightarrow> \<forall>x::real. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x \<Longrightarrow>
    \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M) \<and> (\<exists>x. a \<le> x \<and> x \<le> b \<and> f x = M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M) \<and> (\<exists>x\<ge>a. x \<le> b \<and> f x = M)
[PROOF STEP]
using continuous_attains_sup[of "{a..b}" f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compact {a..b}; {a..b} \<noteq> {}; continuous_on {a..b} f\<rbrakk> \<Longrightarrow> \<exists>x\<in>{a..b}. \<forall>y\<in>{a..b}. f y \<le> f x

goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M) \<and> (\<exists>x\<ge>a. x \<le> b \<and> f x = M)
[PROOF STEP]
by (auto simp: continuous_at_imp_continuous_on Ball_def Bex_def)


[STATEMENT]
lemma iso_group_mul:
  assumes "comm_group G"
  shows "((\<lambda>(x,y). x \<otimes> y) \<in> iso (DirProd (subgroup_generated G A) (subgroup_generated G B)) G
     \<longleftrightarrow> A \<inter> B \<subseteq> {\<one>} \<and> A <#> B = carrier G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>(x, y). x \<otimes> y) \<in> Group.iso (subgroup_generated G A \<times>\<times> subgroup_generated G B) G) = (A \<inter> B \<subseteq> {\<one>} \<and> A <#> B = carrier G)
[PROOF STEP]
proof (rule iso_group_mul_gen)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<lhd> G
 2. B \<lhd> G
[PROOF STEP]
interpret comm_group
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group G
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<lhd> G
 2. B \<lhd> G
[PROOF STEP]
show "A \<lhd> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<lhd> G
[PROOF STEP]
by (simp add: AG.subgroup_axioms subgroup_imp_normal)
[PROOF STATE]
proof (state)
this:
A \<lhd> G

goal (1 subgoal):
 1. B \<lhd> G
[PROOF STEP]
show "B \<lhd> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<lhd> G
[PROOF STEP]
by (simp add: BG.subgroup_axioms subgroup_imp_normal)
[PROOF STATE]
proof (state)
this:
B \<lhd> G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_list_of_set_numbers_of_marks:
  "sorted_list_of_set (numbers_of_marks n bs) = map fst (filter snd (enumerate n bs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (numbers_of_marks n bs) = map fst (filter snd (enumerate n bs))
[PROOF STEP]
by (auto simp add: numbers_of_marks_def distinct_map
    intro!: sorted_filter distinct_filter inj_onI sorted_distinct_set_unique)


[STATEMENT]
lemma sqrt_rat_ceiling_code[code]: "sqrt_rat_ceiling x = - (sqrt_rat_floor (-x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_rat_ceiling x = - sqrt_rat_floor (- x)
[PROOF STEP]
unfolding sqrt_rat_ceiling_def sqrt_rat_floor_def root_rat_ceiling_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - root_rat_floor 2 (- x) = - root_rat_floor 2 (- x)
[PROOF STEP]
by simp


[STATEMENT]
lemma not_psubset_icard_mono: "\<exists>(A::nat set) B. A \<subset> B \<and> \<not> icard A < icard B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A B. A \<subset> B \<and> \<not> icard A < icard B
[PROOF STEP]
apply (rule_tac x="{1..}" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B. {1..} \<subset> B \<and> \<not> icard {1..} < icard B
[PROOF STEP]
apply (rule_tac x="{0..}" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {1..} \<subset> {0..} \<and> \<not> icard {1..} < icard {0..}
[PROOF STEP]
apply (fastforce simp add: infinite_atLeast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma union_mulex_on_mono:
  "mulex_on P F A C \<Longrightarrow> mulex_on P F B D \<Longrightarrow> mulex_on P F (A + B) (C + D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mulex_on P F A C; mulex_on P F B D\<rbrakk> \<Longrightarrow> mulex_on P F (A + B) (C + D)
[PROOF STEP]
by (metis mulex_on_multisetsD mulex_on_trans mulex_on_union mulex_on_union')


[STATEMENT]
lemma vector_derivative_chain_within:
  assumes "at x within S \<noteq> bot" "f differentiable (at x within S)"
    "(g has_derivative g') (at (f x) within f ` S)"
  shows "vector_derivative (g \<circ> f) (at x within S) =
        g' (vector_derivative f (at x within S)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (g \<circ> f) (at x within S) = g' (vector_derivative f (at x within S))
[PROOF STEP]
apply (rule vector_derivative_within [OF \<open>at x within S \<noteq> bot\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ> f has_vector_derivative g' (vector_derivative f (at x within S))) (at x within S)
[PROOF STEP]
apply (rule vector_derivative_diff_chain_within)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f has_vector_derivative vector_derivative f (at x within S)) (at x within S)
 2. (g has_derivative g') (at (f x) within f ` S)
[PROOF STEP]
using assms(2-3) vector_derivative_works
[PROOF STATE]
proof (prove)
using this:
f differentiable at x within S
(g has_derivative g') (at (f x) within f ` S)
(?f differentiable ?net) = (?f has_vector_derivative vector_derivative ?f ?net) ?net

goal (2 subgoals):
 1. (f has_vector_derivative vector_derivative f (at x within S)) (at x within S)
 2. (g has_derivative g') (at (f x) within f ` S)
[PROOF STEP]
by auto


[STATEMENT]
lemma bitset_2n1:
  "bitset (2 * n + 1) = insert 0 (Suc ` (bitset n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitset (2 * n + 1) = insert 0 (Suc ` bitset n)
[PROOF STEP]
by (subst bitset_Suc) (auto simp add: bitset_2n)


[STATEMENT]
lemma row_transpose [simp]: "row i (transpose A) = column i A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row i (Finite_Cartesian_Product.transpose A) = column i A
[PROOF STEP]
by (simp add: row_def column_def transpose_def vec_eq_iff)


[STATEMENT]
lemma prime_multiplicity_squarefree_part:
  assumes "prime p"
  shows   "multiplicity p (squarefree_part n) = multiplicity p n mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
 2. n \<noteq> (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> (0::'a)

goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
 2. n \<noteq> (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
hence n: "n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> (0::'a)

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

goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
 2. n \<noteq> (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
have "multiplicity p n mod 2 + 2 * (multiplicity p n div 2) = multiplicity p n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p n mod 2 + 2 * (multiplicity p n div 2) = multiplicity p n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
multiplicity p n mod 2 + 2 * (multiplicity p n div 2) = multiplicity p n

goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
 2. n \<noteq> (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity p n mod 2 + 2 * (multiplicity p n div 2) = multiplicity p n

goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
 2. n \<noteq> (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
have "\<dots> = multiplicity p (squarefree_part n * square_part n ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p n = multiplicity p (squarefree_part n * (square_part n)\<^sup>2)
[PROOF STEP]
by (subst squarefree_decompose[of n]) simp
[PROOF STATE]
proof (state)
this:
multiplicity p n = multiplicity p (squarefree_part n * (square_part n)\<^sup>2)

goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
 2. n \<noteq> (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity p n = multiplicity p (squarefree_part n * (square_part n)\<^sup>2)

goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
 2. n \<noteq> (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
from assms n
[PROOF STATE]
proof (chain)
picking this:
prime p
n \<noteq> (0::'a)
[PROOF STEP]
have "\<dots> = multiplicity p (squarefree_part n) + 2 * (multiplicity p n div 2)"
[PROOF STATE]
proof (prove)
using this:
prime p
n \<noteq> (0::'a)

goal (1 subgoal):
 1. multiplicity p (squarefree_part n * (square_part n)\<^sup>2) = multiplicity p (squarefree_part n) + 2 * (multiplicity p n div 2)
[PROOF STEP]
by (subst prime_elem_multiplicity_mult_distrib)
       (auto simp: prime_elem_multiplicity_power_distrib prime_multiplicity_square_part)
[PROOF STATE]
proof (state)
this:
multiplicity p (squarefree_part n * (square_part n)\<^sup>2) = multiplicity p (squarefree_part n) + 2 * (multiplicity p n div 2)

goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
 2. n \<noteq> (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
multiplicity p n mod 2 + 2 * (multiplicity p n div 2) = multiplicity p (squarefree_part n) + 2 * (multiplicity p n div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
multiplicity p n mod 2 + 2 * (multiplicity p n div 2) = multiplicity p (squarefree_part n) + 2 * (multiplicity p n div 2)

goal (1 subgoal):
 1. multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
by (subst (asm) add_right_cancel) simp
[PROOF STATE]
proof (state)
this:
multiplicity p (squarefree_part n) = multiplicity p n mod 2

goal (1 subgoal):
 1. n = (0::'a) \<Longrightarrow> multiplicity p (squarefree_part n) = multiplicity p n mod 2
[PROOF STEP]
qed auto


[STATEMENT]
lemma Conjunctive_distr_conj:
  assumes "Conjunctive(HC)"
  shows "HC(P \<and> Q) = (HC(P) \<and> HC(Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HC (P \<and> Q) = (HC P \<and> HC Q)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Conjunctive HC

goal (1 subgoal):
 1. HC (P \<and> Q) = (HC P \<and> HC Q)
[PROOF STEP]
unfolding Conjunctive_def
[PROOF STATE]
proof (prove)
using this:
\<exists>Q. \<forall>P. HC P = (P \<and> Q)

goal (1 subgoal):
 1. HC (P \<and> Q) = (HC P \<and> HC Q)
[PROOF STEP]
by (metis Conjunctive_conj assms utp_pred_laws.inf.assoc utp_pred_laws.inf_right_idem)


[STATEMENT]
lemma T_bal_tree: "n = size xs \<Longrightarrow> T_bal_tree n xs = 4*n+3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = size xs \<Longrightarrow> T_bal_tree n xs = 4 * n + 3
[PROOF STEP]
by(simp add: T_bal_tree_def bal_tree_tm_def tm_simps bal_list_tm_def
    surj_TM[OF inorder2_def T_inorder2_def] T_inorder2
    surj_TM[OF bal_def T_bal_def] T_bal size1_size
    split: tm.split prod.split)


[STATEMENT]
lemma poly_pos_geq:
  "(\<forall>x. x \<ge> a \<longrightarrow> poly p x > 0) \<longleftrightarrow>
   (p \<noteq> 0 \<and> poly_inf p = 1 \<and> poly p a \<noteq> 0 \<and> count_roots_above p a = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<ge>a. 0 < poly p x) = (p \<noteq> 0 \<and> poly_inf p = 1 \<and> poly p a \<noteq> 0 \<and> count_roots_above p a = 0)
[PROOF STEP]
by (simp only: poly_pos_geq Let_def poly_no_roots_geq, blast)


[STATEMENT]
lemma card_UNIV_length_enum:
  "card (UNIV :: 'a set) = length enum"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card UNIV = length enum
[PROOF STEP]
by (simp add: UNIV_enum distinct_card enum_distinct)


[STATEMENT]
lemma mod_pow2_div_pow2:
  fixes p m n :: nat
  shows "m < n \<Longrightarrow> p mod 2 ^ n div 2 ^ m = p div 2 ^ m mod 2 ^ (n - m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < n \<Longrightarrow> p mod 2 ^ n div 2 ^ m = p div 2 ^ m mod 2 ^ (n - m)
[PROOF STEP]
by (induct m arbitrary: p n) (auto simp: div_mult2_eq mod_mult2_eq Suc_less_eq2)


[STATEMENT]
lemma transpose_trans_board:
  "transpose_board (trans_board (k\<^sub>1,k\<^sub>2) b) = trans_board (k\<^sub>2,k\<^sub>1) (transpose_board b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_board (trans_board (k\<^sub>1, k\<^sub>2) b) = trans_board (k\<^sub>2, k\<^sub>1) (transpose_board b)
[PROOF STEP]
unfolding transpose_board_def trans_board_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(j, i) |i j. (i, j) \<in> (case (k\<^sub>1, k\<^sub>2) of (k\<^sub>1, k\<^sub>2) \<Rightarrow> {(i + k\<^sub>1, j + k\<^sub>2) |i j. (i, j) \<in> b})} = (case (k\<^sub>2, k\<^sub>1) of (k\<^sub>1, k\<^sub>2) \<Rightarrow> {(i + k\<^sub>1, j + k\<^sub>2) |i j. (i, j) \<in> {(j, i) |i j. (i, j) \<in> b}})
[PROOF STEP]
by blast


[STATEMENT]
lemma pow_Suc_subset_trancl: "R^^(Suc n) \<subseteq> R\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R ^^ Suc n \<subseteq> R\<^sup>+
[PROOF STEP]
using trancl_power [of _ R]
[PROOF STATE]
proof (prove)
using this:
(?p \<in> R\<^sup>+) = (\<exists>n>0. ?p \<in> R ^^ n)

goal (1 subgoal):
 1. R ^^ Suc n \<subseteq> R\<^sup>+
[PROOF STEP]
by blast


[STATEMENT]
lemma set_integral_space:
  assumes "integrable M f"
  shows "(\<integral>x \<in> space M. f x \<partial>M) = (\<integral>x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_lebesgue_integral M (space M) f = integral\<^sup>L M f
[PROOF STEP]
by (metis (no_types, lifting) indicator_simps(1) integral_cong scaleR_one set_lebesgue_integral_def)


[STATEMENT]
lemma binomial_ngt_0: "(n choose Suc n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose Suc n = 0
[PROOF STEP]
apply (subst binomial_ngt_diff,
         (subst binomial_n_n)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - 1 = 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma expl_cond_exp_diff:
  assumes "integrable M X"
  and "integrable M Z"
shows "\<forall>w\<in> space M. expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>w\<in>space M. expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. w \<in> space M \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. w \<in> space M \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
assume "w\<in> space M"
[PROOF STATE]
proof (state)
this:
w \<in> space M

goal (1 subgoal):
 1. \<And>w. w \<in> space M \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
define prY where "prY = measure M ((Y -` {Y w}) \<inter> space M)"
[PROOF STATE]
proof (state)
this:
prY = Sigma_Algebra.measure M (Y -` {Y w} \<inter> space M)

goal (1 subgoal):
 1. \<And>w. w \<in> space M \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
show "expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
proof (cases "prY = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. prY = 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
 2. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
prY = 0

goal (2 subgoals):
 1. prY = 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
 2. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
prY = 0

goal (1 subgoal):
 1. expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
unfolding expl_cond_expect_def img_dce_def prY_def
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (Y -` {Y w} \<inter> space M) = 0

goal (1 subgoal):
 1. ((\<lambda>y. if Sigma_Algebra.measure M (Y -` {y} \<inter> space M) = 0 then 0 else (LINT w|M. (X w - Z w) * indicat_real (Y -` {y} \<inter> space M) w) / Sigma_Algebra.measure M (Y -` {y} \<inter> space M)) \<circ> Y) w = ((\<lambda>y. if Sigma_Algebra.measure M (Y -` {y} \<inter> space M) = 0 then 0 else (LINT w|M. X w * indicat_real (Y -` {y} \<inter> space M) w) / Sigma_Algebra.measure M (Y -` {y} \<inter> space M)) \<circ> Y) w - ((\<lambda>y. if Sigma_Algebra.measure M (Y -` {y} \<inter> space M) = 0 then 0 else (LINT w|M. Z w * indicat_real (Y -` {y} \<inter> space M) w) / Sigma_Algebra.measure M (Y -` {y} \<inter> space M)) \<circ> Y) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
prY \<noteq> 0

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
hence "(Y -` {Y w}) \<inter> space M \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
prY \<noteq> 0

goal (1 subgoal):
 1. Y -` {Y w} \<inter> space M \<in> sets M
[PROOF STEP]
unfolding prY_def
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (Y -` {Y w} \<inter> space M) \<noteq> 0

goal (1 subgoal):
 1. Y -` {Y w} \<inter> space M \<in> sets M
[PROOF STEP]
using measure_notin_sets
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M (Y -` {Y w} \<inter> space M) \<noteq> 0
?A \<notin> sets ?M \<Longrightarrow> Sigma_Algebra.measure ?M ?A = 0

goal (1 subgoal):
 1. Y -` {Y w} \<inter> space M \<in> sets M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Y -` {Y w} \<inter> space M \<in> sets M

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
let ?indA = "indicator ((Y -` {Y w}) \<inter> space M)::('a\<Rightarrow>real)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
have "integrable M (\<lambda>x. X x * ?indA x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. X x * indicat_real (Y -` {Y w} \<inter> space M) x)
[PROOF STEP]
using \<open>Y -` {Y w} \<inter> space M \<in> sets M\<close> assms(1) integrable_real_mult_indicator
[PROOF STATE]
proof (prove)
using this:
Y -` {Y w} \<inter> space M \<in> sets M
integrable M X
\<lbrakk>?A \<in> sets ?M; integrable ?M ?f\<rbrakk> \<Longrightarrow> integrable ?M (\<lambda>x. ?f x * indicat_real ?A x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. X x * indicat_real (Y -` {Y w} \<inter> space M) x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. X x * indicat_real (Y -` {Y w} \<inter> space M) x)

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. X x * indicat_real (Y -` {Y w} \<inter> space M) x)

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
have "integrable M (\<lambda>x. Z x * ?indA x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
[PROOF STEP]
using \<open>Y -` {Y w} \<inter> space M \<in> sets M\<close> assms(2) integrable_real_mult_indicator
[PROOF STATE]
proof (prove)
using this:
Y -` {Y w} \<inter> space M \<in> sets M
integrable M Z
\<lbrakk>?A \<in> sets ?M; integrable ?M ?f\<rbrakk> \<Longrightarrow> integrable ?M (\<lambda>x. ?f x * indicat_real ?A x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. X x * indicat_real (Y -` {Y w} \<inter> space M) x)
integrable M (\<lambda>x. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
[PROOF STEP]
have "integral\<^sup>L M (\<lambda>x. X x * ?indA x - Z x * ?indA x) = integral\<^sup>L M (\<lambda>x. X x * ?indA x) - integral\<^sup>L M (\<lambda>x. Z x * ?indA x)"
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. X x * indicat_real (Y -` {Y w} \<inter> space M) x)
integrable M (\<lambda>x. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)

goal (1 subgoal):
 1. LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
[PROOF STEP]
using Bochner_Integration.integral_diff
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. X x * indicat_real (Y -` {Y w} \<inter> space M) x)
integrable M (\<lambda>x. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
\<lbrakk>integrable ?M ?f; integrable ?M ?g\<rbrakk> \<Longrightarrow> LINT x|?M. ?f x - ?g x = integral\<^sup>L ?M ?f - integral\<^sup>L ?M ?g

goal (1 subgoal):
 1. LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
have "\<forall>x\<in> space M. X x * ?indA x - Z x * ?indA x = (X x - Z x) * ?indA x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>space M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x
[PROOF STEP]
by (simp add: indicator_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>space M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
\<forall>x\<in>space M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x
[PROOF STEP]
have fsteq: "integral\<^sup>L M (\<lambda>x. (X x - Z x) * ?indA x) = integral\<^sup>L M (\<lambda>x. X x * ?indA x) - integral\<^sup>L M (\<lambda>x. Z x * ?indA x)"
[PROOF STATE]
proof (prove)
using this:
LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
\<forall>x\<in>space M. X x * indicat_real (Y -` {Y w} \<inter> space M) x - Z x * indicat_real (Y -` {Y w} \<inter> space M) x = (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x

goal (1 subgoal):
 1. LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)
[PROOF STEP]
by (metis (no_types, lifting) Bochner_Integration.integral_cong)
[PROOF STATE]
proof (state)
this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
have "integral\<^sup>L M (\<lambda>x. (X x - Z x) * ?indA x/prY) = integral\<^sup>L M (\<lambda>x. (X x - Z x) * ?indA x)/prY"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x) / prY
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x) / prY

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x) / prY

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
have "... = integral\<^sup>L M (\<lambda>x. X x * ?indA x)/prY - integral\<^sup>L M (\<lambda>x. Z x * ?indA x)/prY"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x) / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY
[PROOF STEP]
using fsteq
[PROOF STATE]
proof (prove)
using this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x)

goal (1 subgoal):
 1. (LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x) / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY
[PROOF STEP]
by (simp add: diff_divide_distrib)
[PROOF STATE]
proof (state)
this:
(LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x) / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x) / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
have "... = integral\<^sup>L M (\<lambda>x. X x * ?indA x/prY) - integral\<^sup>L M (\<lambda>x. Z x * ?indA x/prY)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x) / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)
[PROOF STEP]
have "integral\<^sup>L M (\<lambda>x. (X x - Z x) * ?indA x/prY) = integral\<^sup>L M (\<lambda>x. X x * ?indA x/prY) - integral\<^sup>L M (\<lambda>x. Z x * ?indA x/prY)"
[PROOF STATE]
proof (prove)
using this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)

goal (1 subgoal):
 1. LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)

goal (1 subgoal):
 1. prY \<noteq> 0 \<Longrightarrow> expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)

goal (1 subgoal):
 1. expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)
prY \<noteq> 0

goal (1 subgoal):
 1. expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w
[PROOF STEP]
unfolding expl_cond_expect_def img_dce_def
[PROOF STATE]
proof (prove)
using this:
LINT x|M. (X x - Z x) * indicat_real (Y -` {Y w} \<inter> space M) x / prY = (LINT x|M. X x * indicat_real (Y -` {Y w} \<inter> space M) x / prY) - (LINT x|M. Z x * indicat_real (Y -` {Y w} \<inter> space M) x / prY)
prY \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>y. if Sigma_Algebra.measure M (Y -` {y} \<inter> space M) = 0 then 0 else (LINT w|M. (X w - Z w) * indicat_real (Y -` {y} \<inter> space M) w) / Sigma_Algebra.measure M (Y -` {y} \<inter> space M)) \<circ> Y) w = ((\<lambda>y. if Sigma_Algebra.measure M (Y -` {y} \<inter> space M) = 0 then 0 else (LINT w|M. X w * indicat_real (Y -` {y} \<inter> space M) w) / Sigma_Algebra.measure M (Y -` {y} \<inter> space M)) \<circ> Y) w - ((\<lambda>y. if Sigma_Algebra.measure M (Y -` {y} \<inter> space M) = 0 then 0 else (LINT w|M. Z w * indicat_real (Y -` {y} \<inter> space M) w) / Sigma_Algebra.measure M (Y -` {y} \<inter> space M)) \<circ> Y) w
[PROOF STEP]
by (simp add: diff_divide_distrib fsteq)
[PROOF STATE]
proof (state)
this:
expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
expl_cond_expect M Y (\<lambda>x. X x - Z x) w = expl_cond_expect M Y X w - expl_cond_expect M Y Z w

goal:
No subgoals!
[PROOF STEP]
qed