[STATEMENT]
lemma proots_count_smult:
  fixes a::"'a::{semiring_no_zero_divisors,idom}"
  assumes "a\<noteq>0"
  shows "proots_count (smult a p) s= proots_count p s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (smult a p) s = proots_count p s
[PROOF STEP]
proof (cases "p=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> proots_count (smult a p) s = proots_count p s
 2. p \<noteq> 0 \<Longrightarrow> proots_count (smult a p) s = proots_count p s
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> proots_count (smult a p) s = proots_count p s
 2. p \<noteq> 0 \<Longrightarrow> proots_count (smult a p) s = proots_count p s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. proots_count (smult a p) s = proots_count p s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
proots_count (smult a p) s = proots_count p s

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> proots_count (smult a p) s = proots_count p s
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> proots_count (smult a p) s = proots_count p s
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> proots_count (smult a p) s = proots_count p s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. proots_count (smult a p) s = proots_count p s
[PROOF STEP]
unfolding proots_count_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>r\<in>proots_within (smult a p) s. order r (smult a p)) = (\<Sum>r\<in>proots_within p s. order r p)
[PROOF STEP]
using order_smult[OF assms] proots_within_smult[OF assms]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
order ?x (smult a ?p) = order ?x ?p
proots_within (smult a ?p) ?s = proots_within ?p ?s

goal (1 subgoal):
 1. (\<Sum>r\<in>proots_within (smult a p) s. order r (smult a p)) = (\<Sum>r\<in>proots_within p s. order r p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
proots_count (smult a p) s = proots_count p s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gcd_primes64: "p \<in> set gcd_primes64 \<Longrightarrow> prime p \<and> p \<le> 4294967295"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> set gcd_primes64 \<Longrightarrow> prime p \<and> p \<le> 4294967295
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<in> set gcd_primes64 \<Longrightarrow> prime p \<and> p \<le> 4294967295
[PROOF STEP]
have "list_all (\<lambda> p. prime p \<and> p \<le> 4294967295) gcd_primes64"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>p. prime p \<and> p \<le> 4294967295) gcd_primes64
[PROOF STEP]
by eval
[PROOF STATE]
proof (state)
this:
list_all (\<lambda>p. prime p \<and> p \<le> 4294967295) gcd_primes64

goal (1 subgoal):
 1. p \<in> set gcd_primes64 \<Longrightarrow> prime p \<and> p \<le> 4294967295
[PROOF STEP]
thus "p \<in> set gcd_primes64 \<Longrightarrow> prime p \<and> p \<le> 4294967295"
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>p. prime p \<and> p \<le> 4294967295) gcd_primes64

goal (1 subgoal):
 1. p \<in> set gcd_primes64 \<Longrightarrow> prime p \<and> p \<le> 4294967295
[PROOF STEP]
by (auto simp: list_all_iff)
[PROOF STATE]
proof (state)
this:
p \<in> set gcd_primes64 \<Longrightarrow> prime p \<and> p \<le> 4294967295

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr_numeral_simproc_aux:
  assumes "Num.pow y n = x"
  shows   "numeral x powr (m / numeral n :: real) \<equiv> numeral y powr m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral x powr (m / numeral n) \<equiv> numeral y powr m
[PROOF STEP]
by (subst assms [symmetric], subst numeral_pow, subst powr_numeral [symmetric])
     (simp, subst powr_powr, simp_all)


[STATEMENT]
lemma plgf__coplanar:
  assumes "ParallelogramFlat A B C D"
  shows "Coplanar A B C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
using ParallelogramFlat_def assms col__coplanar
[PROOF STATE]
proof (prove)
using this:
ParallelogramFlat ?A ?B ?A' ?B' \<equiv> Col ?A ?B ?A' \<and> Col ?A ?B ?B' \<and> Cong ?A ?B ?A' ?B' \<and> Cong ?A ?B' ?A' ?B \<and> (?A \<noteq> ?A' \<or> ?B \<noteq> ?B')
ParallelogramFlat A B C D
Col ?A ?B ?C \<Longrightarrow> Coplanar ?A ?B ?C ?D

goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
by auto


[STATEMENT]
lemma lspace_1:
  assumes "S \<in> sets lebesgue"
  shows "f \<in> lspace (lebesgue_on S) 1 \<longleftrightarrow> f absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> lspace (lebesgue_on S) 1) = (f absolutely_integrable_on S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<in> sets lebesgue

goal (1 subgoal):
 1. (f \<in> lspace (lebesgue_on S) 1) = (f absolutely_integrable_on S)
[PROOF STEP]
by (simp add: L1_space integrable_restrict_space set_integrable_def)


[STATEMENT]
lemma SIod_self_le:"\<lbrakk>Order D; Order E;
         carrier E \<subseteq> carrier D;
        \<forall>a\<in>carrier E. \<forall>b\<in>carrier E. (a \<preceq>\<^bsub>E\<^esub> b) = (a \<preceq>\<^bsub>D\<^esub> b) \<rbrakk> \<Longrightarrow>
         E = SIod D (carrier E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; carrier E \<subseteq> carrier D; \<forall>a\<in>carrier E. \<forall>b\<in>carrier E. a \<preceq>\<^bsub>E\<^esub> b = a \<preceq>\<^bsub>D\<^esub> b\<rbrakk> \<Longrightarrow> E = SIod D (carrier E)
[PROOF STEP]
apply (rule Order_comp_eq[of "E" "SIod D (carrier E)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Order D; Order E; carrier E \<subseteq> carrier D; \<forall>a\<in>carrier E. \<forall>b\<in>carrier E. a \<preceq>\<^bsub>E\<^esub> b = a \<preceq>\<^bsub>D\<^esub> b\<rbrakk> \<Longrightarrow> carrier E = carrier (SIod D (carrier E))
 2. \<lbrakk>Order D; Order E; carrier E \<subseteq> carrier D; \<forall>a\<in>carrier E. \<forall>b\<in>carrier E. a \<preceq>\<^bsub>E\<^esub> b = a \<preceq>\<^bsub>D\<^esub> b\<rbrakk> \<Longrightarrow> rel E = rel (SIod D (carrier E))
[PROOF STEP]
apply (simp add:SIod_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; carrier E \<subseteq> carrier D; \<forall>a\<in>carrier E. \<forall>b\<in>carrier E. a \<preceq>\<^bsub>E\<^esub> b = a \<preceq>\<^bsub>D\<^esub> b\<rbrakk> \<Longrightarrow> rel E = rel (SIod D (carrier E))
[PROOF STEP]
apply (rule rel_SIod[of "D" "E"], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma T_spaceM_stable [simp]:
  assumes "x \<in> space M"
  shows "T x \<in> space M"
        "(T^^n) x \<in> space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T x \<in> space M &&& (T ^^ n) x \<in> space M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. T x \<in> space M
 2. (T ^^ n) x \<in> space M
[PROOF STEP]
show "T x \<in> space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T x \<in> space M
[PROOF STEP]
by (meson measurable_space T_meas measurable_def assms)
[PROOF STATE]
proof (state)
this:
T x \<in> space M

goal (1 subgoal):
 1. (T ^^ n) x \<in> space M
[PROOF STEP]
show "(T^^n) x \<in> space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T ^^ n) x \<in> space M
[PROOF STEP]
by (meson measurable_space Tn_meas measurable_def assms)
[PROOF STATE]
proof (state)
this:
(T ^^ n) x \<in> space M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem "l_count x (l_sort xs) = l_count x xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
let ?X = "(xs, [], [])"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
have "l_sort_aux ?X \<in> l_sort_set ?X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l_sort_aux (xs, [], []) \<in> l_sort_set (xs, [], [])
[PROOF STEP]
by (rule l_sort_aux_set)
[PROOF STATE]
proof (state)
this:
l_sort_aux (xs, [], []) \<in> l_sort_set (xs, [], [])

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l_sort_aux (xs, [], []) \<in> l_sort_set (xs, [], [])

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
have "l_sort_inv_2 x xs ?X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l_sort_inv_2 x xs (xs, [], [])
[PROOF STEP]
by (rule l_sort_input_2)
[PROOF STATE]
proof (state)
this:
l_sort_inv_2 x xs (xs, [], [])

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
l_sort_aux (xs, [], []) \<in> l_sort_set (xs, [], [])
l_sort_inv_2 x xs (xs, [], [])
[PROOF STEP]
have "l_sort_inv_2 x xs (l_sort_aux ?X)"
[PROOF STATE]
proof (prove)
using this:
l_sort_aux (xs, [], []) \<in> l_sort_set (xs, [], [])
l_sort_inv_2 x xs (xs, [], [])

goal (1 subgoal):
 1. l_sort_inv_2 x xs (l_sort_aux (xs, [], []))
[PROOF STEP]
by (rule l_sort_invariance_2)
[PROOF STATE]
proof (state)
this:
l_sort_inv_2 x xs (l_sort_aux (xs, [], []))

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l_sort_inv_2 x xs (l_sort_aux (xs, [], []))

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
have "l_sort_form (l_sort_aux ?X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l_sort_form (l_sort_aux (xs, [], []))
[PROOF STEP]
by (rule l_sort_form_aux)
[PROOF STATE]
proof (state)
this:
l_sort_form (l_sort_aux (xs, [], []))

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
l_sort_inv_2 x xs (l_sort_aux (xs, [], []))
l_sort_form (l_sort_aux (xs, [], []))
[PROOF STEP]
have "l_count x (l_sort_out (l_sort_aux ?X)) = l_count x xs"
[PROOF STATE]
proof (prove)
using this:
l_sort_inv_2 x xs (l_sort_aux (xs, [], []))
l_sort_form (l_sort_aux (xs, [], []))

goal (1 subgoal):
 1. l_count x (l_sort_out (l_sort_aux (xs, [], []))) = l_count x xs
[PROOF STEP]
by (rule l_sort_intro_2)
[PROOF STATE]
proof (state)
this:
l_count x (l_sort_out (l_sort_aux (xs, [], []))) = l_count x xs

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l_count x (l_sort_out (l_sort_aux (xs, [], []))) = l_count x xs

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
have "?X = l_sort_in xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, [], []) = l_sort_in xs
[PROOF STEP]
by (simp add: l_sort_in_def)
[PROOF STATE]
proof (state)
this:
(xs, [], []) = l_sort_in xs

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
l_count x (l_sort_out (l_sort_aux (xs, [], []))) = l_count x xs
(xs, [], []) = l_sort_in xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
l_count x (l_sort_out (l_sort_aux (xs, [], []))) = l_count x xs
(xs, [], []) = l_sort_in xs

goal (1 subgoal):
 1. l_count x (l_sort xs) = l_count x xs
[PROOF STEP]
by (simp add: l_sort_def)
[PROOF STATE]
proof (state)
this:
l_count x (l_sort xs) = l_count x xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma changes_poly_at_alternative:
  "changes_poly_at ps a= changes (map (\<lambda>p. sign(poly p a)) ps)"
  "changes_poly_at ps a= changes (map (\<lambda>p. sgn(poly p a)) ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes_poly_at ps a = changes (map (\<lambda>p. sign (poly p a)) ps) &&& changes_poly_at ps a = changes (map (\<lambda>p. sgn (poly p a)) ps)
[PROOF STEP]
unfolding changes_poly_at_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (map (\<lambda>p. poly p a) ps) = changes (map (\<lambda>p. sign (poly p a)) ps) &&& changes (map (\<lambda>p. poly p a) ps) = changes (map (\<lambda>p. sgn (poly p a)) ps)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (map (\<lambda>p. poly p a) ps) = changes (map (\<lambda>p. sign (poly p a)) ps)
[PROOF STEP]
by (subst changes_map_sign_eq) (auto simp add:comp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (map (\<lambda>p. poly p a) ps) = changes (map (\<lambda>p. sgn (poly p a)) ps)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (map (\<lambda>p. poly p a) ps) = changes (map (\<lambda>p. sgn (poly p a)) ps)
[PROOF STEP]
by (subst changes_map_sgn_eq) (auto simp add:comp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem integral_cts_step_conv_imp_weak_conv:
  assumes integral_conv: "\<And>x y. x < y \<Longrightarrow> (\<lambda>n. integral\<^sup>L (M_seq n) (cts_step x y)) \<longlonglongrightarrow> integral\<^sup>L M (cts_step x y)"
  shows "weak_conv_m M_seq M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_conv_m M_seq M
[PROOF STEP]
unfolding weak_conv_m_def weak_conv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. isCont (cdf M) x \<longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
proof (clarsimp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
interpret real_distribution M
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_distribution M
[PROOF STEP]
by (rule distr_M)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
assume "isCont (cdf M) x"
[PROOF STATE]
proof (state)
this:
isCont (cdf M) x

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
hence left_cont: "continuous (at_left x) (cdf M)"
[PROOF STATE]
proof (prove)
using this:
isCont (cdf M) x

goal (1 subgoal):
 1. continuous (at_left x) (cdf M)
[PROOF STEP]
unfolding continuous_at_split
[PROOF STATE]
proof (prove)
using this:
continuous (at_left x) (cdf M) \<and> continuous (at_right x) (cdf M)

goal (1 subgoal):
 1. continuous (at_left x) (cdf M)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
continuous (at_left x) (cdf M)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
continuous (at_left x) (cdf M)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
fix y :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
assume [arith]: "x < y"
[PROOF STATE]
proof (state)
this:
x < y

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
have "limsup (\<lambda>n. cdf (M_seq n) x) \<le> limsup (\<lambda>n. integral\<^sup>L (M_seq n) (cts_step x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> limsup (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step x y)))
[PROOF STEP]
by (auto intro!: Limsup_mono always_eventually real_distribution.cdf_cts_step)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> limsup (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step x y)))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> limsup (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step x y)))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
have "\<dots> = integral\<^sup>L M (cts_step x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step x y))) = ereal (expectation (cts_step x y))
[PROOF STEP]
by (intro lim_imp_Limsup) (auto intro: integral_conv)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step x y))) = ereal (expectation (cts_step x y))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step x y))) = ereal (expectation (cts_step x y))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
have "\<dots> \<le> cdf M y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (expectation (cts_step x y)) \<le> ereal (cdf M y)
[PROOF STEP]
by (simp add: cdf_cts_step)
[PROOF STATE]
proof (state)
this:
ereal (expectation (cts_step x y)) \<le> ereal (cdf M y)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M y)
[PROOF STEP]
have "limsup (\<lambda>n. cdf (M_seq n) x) \<le> cdf M y"
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M y)

goal (1 subgoal):
 1. limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M y)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
x < ?y3 \<Longrightarrow> limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M ?y3)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
x < ?y3 \<Longrightarrow> limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M ?y3)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
x < ?y3 \<Longrightarrow> limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M ?y3)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
fix y :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
assume [arith]: "x > y"
[PROOF STATE]
proof (state)
this:
y < x

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
have "cdf M y \<le> ereal (integral\<^sup>L M (cts_step y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (cdf M y) \<le> ereal (expectation (cts_step y x))
[PROOF STEP]
by (simp add: cdf_cts_step)
[PROOF STATE]
proof (state)
this:
ereal (cdf M y) \<le> ereal (expectation (cts_step y x))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (cdf M y) \<le> ereal (expectation (cts_step y x))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
have "\<dots> = liminf (\<lambda>n. integral\<^sup>L (M_seq n) (cts_step y x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (expectation (cts_step y x)) = liminf (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step y x)))
[PROOF STEP]
by (intro lim_imp_Liminf[symmetric]) (auto intro: integral_conv)
[PROOF STATE]
proof (state)
this:
ereal (expectation (cts_step y x)) = liminf (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step y x)))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (expectation (cts_step y x)) = liminf (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step y x)))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
have "\<dots> \<le> liminf (\<lambda>n. cdf (M_seq n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step y x))) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))
[PROOF STEP]
by (auto intro!: Liminf_mono always_eventually real_distribution.cdf_cts_step)
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>xa. ereal (integral\<^sup>L (M_seq xa) (cts_step y x))) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal (cdf M y) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))
[PROOF STEP]
have "liminf (\<lambda>n. cdf (M_seq n) x) \<ge> cdf M y"
[PROOF STATE]
proof (prove)
using this:
ereal (cdf M y) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))

goal (1 subgoal):
 1. ereal (cdf M y) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ereal (cdf M y) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?y3 < x \<Longrightarrow> ereal (cdf M ?y3) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
note ** = this
[PROOF STATE]
proof (state)
this:
?y3 < x \<Longrightarrow> ereal (cdf M ?y3) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
have "limsup (\<lambda>n. cdf (M_seq n) x) \<le> cdf M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M x)
[PROOF STEP]
proof (rule tendsto_lowerbound)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (?f \<longlongrightarrow> ereal (cdf M x)) ?F
 2. \<forall>\<^sub>F i in ?F. limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ?f i
 3. ?F \<noteq> bot
[PROOF STEP]
show "\<forall>\<^sub>F i in at_right x. limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F i in at_right x. limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M i)
[PROOF STEP]
by (subst eventually_at_right[of _ "x + 1"]) (auto simp: * intro: exI [of _ "x+1"])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in at_right x. limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M i)

goal (2 subgoals):
 1. ((\<lambda>i. ereal (cdf M i)) \<longlongrightarrow> ereal (cdf M x)) (at_right x)
 2. at_right x \<noteq> bot
[PROOF STEP]
qed (insert cdf_is_right_cont, auto simp: continuous_within)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M x)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M x)

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
have "cdf M x \<le> liminf (\<lambda>n. cdf (M_seq n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (cdf M x) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))
[PROOF STEP]
proof (rule tendsto_upperbound)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (?f \<longlongrightarrow> ereal (cdf M x)) ?F
 2. \<forall>\<^sub>F i in ?F. ?f i \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))
 3. ?F \<noteq> bot
[PROOF STEP]
show "\<forall>\<^sub>F i in at_left x. ereal (cdf M i) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F i in at_left x. ereal (cdf M i) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))
[PROOF STEP]
by (subst eventually_at_left[of "x - 1"]) (auto simp: ** intro: exI [of _ "x-1"])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in at_left x. ereal (cdf M i) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))

goal (2 subgoals):
 1. ((\<lambda>i. ereal (cdf M i)) \<longlongrightarrow> ereal (cdf M x)) (at_left x)
 2. at_left x \<noteq> bot
[PROOF STEP]
qed (insert left_cont, auto simp: continuous_within)
[PROOF STATE]
proof (state)
this:
ereal (cdf M x) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))

goal (1 subgoal):
 1. \<And>x. isCont (cdf M) x \<Longrightarrow> (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M x)
ereal (cdf M x) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))
[PROOF STEP]
show "(\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x"
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>xa. ereal (cdf (M_seq xa) x)) \<le> ereal (cdf M x)
ereal (cdf M x) \<le> liminf (\<lambda>xa. ereal (cdf (M_seq xa) x))

goal (1 subgoal):
 1. (\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x
[PROOF STEP]
by (elim limsup_le_liminf_real)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cdf (M_seq n) x) \<longlonglongrightarrow> cdf M x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_word_rsplit_rcat_size:
  "word_rcat ws = frcw \<Longrightarrow> size frcw = length ws * LENGTH('a)
    \<Longrightarrow> length (word_rsplit frcw::'a word list) = length ws"
  for ws :: "'a::len word list" and frcw :: "'b::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>word_rcat ws = frcw; size frcw = length ws * LENGTH('a)\<rbrakk> \<Longrightarrow> length (word_rsplit frcw) = length ws
[PROOF STEP]
by (cases \<open>LENGTH('a)\<close>) (simp_all add: word_size length_word_rsplit_exp_size' div_nat_eqI)


[STATEMENT]
lemma convergent_prodI_nonneg_bounded:
  fixes f :: "nat \<Rightarrow> real"
  assumes "\<And>n. 1 \<le> f n" "\<And>n. (\<Prod>i<n. f i) \<le> x"
  shows "convergent_prod f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
using convergent_prod_def raw_has_prodI_bounded [OF assms]
[PROOF STATE]
proof (prove)
using this:
convergent_prod ?f \<equiv> \<exists>M p. raw_has_prod ?f M p
\<exists>p. raw_has_prod f 0 p

goal (1 subgoal):
 1. convergent_prod f
[PROOF STEP]
by blast


[STATEMENT]
lemma bouncing_ball_dyn: "g < 0 \<Longrightarrow> h \<ge> 0 \<Longrightarrow>
  \<^bold>{\<lambda>s. s$1 = h \<and> s$2 = 0\<^bold>}
  (LOOP
      ((EVOL (\<phi> g) (\<lambda> s. s$1 \<ge> 0) T);
       (IF (\<lambda> s. s$1 = 0) THEN (2 ::= (\<lambda>s. - s$2)) ELSE skip))
    INV (\<lambda>s. 0 \<le> s$1 \<and> 2 \<cdot> g \<cdot> s$1 = 2 \<cdot> g \<cdot> h + s$2 \<cdot> s$2)
  ) \<^bold>{\<lambda>s. 0 \<le> s$1 \<and> s$1 \<le> h\<^bold>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> \<^bold>{\<lambda>s. s $ 1 = h \<and> s $ 2 = 0\<^bold>}LOOP EVOL (\<lambda>\<tau> s. \<chi>i. if i = 1 then g \<cdot> \<tau>\<^sup>2 / 2 + s $ 2 \<cdot> \<tau> + s $ 1 else g \<cdot> \<tau> + s $ 2) (\<lambda>s. 0 \<le> s $ 1) T ; (IF (\<lambda>s. s $ 1 = 0) THEN (2 ::= (\<lambda>s. - s $ 2)) ELSE skip) INV (\<lambda>s. 0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2) \<^bold>{\<lambda>s. 0 \<le> s $ 1 \<and> s $ 1 \<le> h\<^bold>}
[PROOF STEP]
apply(hyb_hoare "\<lambda>s::real^2. 0 \<le> s$1 \<and> 2 \<cdot> g \<cdot> s$1 = 2 \<cdot> g \<cdot> h + s$2 \<cdot> s$2")
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> \<^bold>{\<lambda>s. 0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2\<^bold>}EVOL (\<lambda>\<tau> s. \<chi>i. if i = 1 then g \<cdot> \<tau>\<^sup>2 / 2 + s $ 2 \<cdot> \<tau> + s $ 1 else g \<cdot> \<tau> + s $ 2) (\<lambda>s. 0 \<le> s $ 1) T\<^bold>{\<lambda>s. 0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2\<^bold>}
 2. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> \<forall>s. 0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2 \<and> s $ 1 = 0 \<longrightarrow> 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2 = 0
 3. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> \<^bold>{\<lambda>s. (0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2) \<and> s $ 1 \<noteq> 0\<^bold>}skip\<^bold>{\<lambda>s. 0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2\<^bold>}
 4. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> \<lceil>\<lambda>s. s $ 1 = h \<and> s $ 2 = 0\<rceil> \<subseteq> \<lceil>\<lambda>s. 0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2\<rceil>
 5. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> \<lceil>\<lambda>s. 0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2\<rceil> \<subseteq> \<lceil>\<lambda>s. 0 \<le> s $ 1 \<and> s $ 1 \<le> h\<rceil>
[PROOF STEP]
by (auto simp: bb_real_arith)

\<comment> \<open>Verified with the flow \<close>


[STATEMENT]
lemma append_eq_append_conv [simp]:
  "length xs = length ys \<or> length us = length vs
  \<Longrightarrow> (xs@us = ys@vs) = (xs=ys \<and> us=vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<or> length us = length vs \<Longrightarrow> (xs @ us = ys @ vs) = (xs = ys \<and> us = vs)
[PROOF STEP]
by (induct xs arbitrary: ys; case_tac ys; force)


[STATEMENT]
lemma sset_szip_finite[iff]: "finite (sset (u ||| v)) \<longleftrightarrow> finite (sset u) \<and> finite (sset v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (sset (u ||| v)) = (finite (sset u) \<and> finite (sset v))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite (sset (u ||| v)) \<Longrightarrow> finite (sset u)
 2. finite (sset (u ||| v)) \<Longrightarrow> finite (sset v)
 3. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
assume 1: "finite (sset (u ||| v))"
[PROOF STATE]
proof (state)
this:
finite (sset (u ||| v))

goal (3 subgoals):
 1. finite (sset (u ||| v)) \<Longrightarrow> finite (sset u)
 2. finite (sset (u ||| v)) \<Longrightarrow> finite (sset v)
 3. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
have 2: "finite (fst ` sset (u ||| v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (fst ` sset (u ||| v))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
finite (sset (u ||| v))

goal (1 subgoal):
 1. finite (fst ` sset (u ||| v))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (fst ` sset (u ||| v))

goal (3 subgoals):
 1. finite (sset (u ||| v)) \<Longrightarrow> finite (sset u)
 2. finite (sset (u ||| v)) \<Longrightarrow> finite (sset v)
 3. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
have 3: "finite (snd ` sset (u ||| v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (snd ` sset (u ||| v))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
finite (sset (u ||| v))

goal (1 subgoal):
 1. finite (snd ` sset (u ||| v))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (snd ` sset (u ||| v))

goal (3 subgoals):
 1. finite (sset (u ||| v)) \<Longrightarrow> finite (sset u)
 2. finite (sset (u ||| v)) \<Longrightarrow> finite (sset v)
 3. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
show "finite (sset u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (sset u)
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
finite (fst ` sset (u ||| v))

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

goal (2 subgoals):
 1. finite (sset (u ||| v)) \<Longrightarrow> finite (sset v)
 2. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
show "finite (sset v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (sset v)
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
finite (snd ` sset (u ||| v))

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

goal (1 subgoal):
 1. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
assume 1: "finite (sset u)" "finite (sset v)"
[PROOF STATE]
proof (state)
this:
finite (sset u)
finite (sset v)

goal (1 subgoal):
 1. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
have "sset (u ||| v) \<subseteq> sset u \<times> sset v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sset (u ||| v) \<subseteq> sset u \<times> sset v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sset (u ||| v) \<subseteq> sset u \<times> sset v

goal (1 subgoal):
 1. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sset (u ||| v) \<subseteq> sset u \<times> sset v

goal (1 subgoal):
 1. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
have "finite \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (sset u \<times> sset v)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
finite (sset u)
finite (sset v)

goal (1 subgoal):
 1. finite (sset u \<times> sset v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (sset u \<times> sset v)

goal (1 subgoal):
 1. \<lbrakk>finite (sset u); finite (sset v)\<rbrakk> \<Longrightarrow> finite (sset (u ||| v))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finite (sset (u ||| v))
[PROOF STEP]
show "finite (sset (u ||| v))"
[PROOF STATE]
proof (prove)
using this:
finite (sset (u ||| v))

goal (1 subgoal):
 1. finite (sset (u ||| v))
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
finite (sset (u ||| v))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_del:
  "sorted(inorder t) \<Longrightarrow>
  inorder(case del x t of None \<Rightarrow> t | Some t' \<Rightarrow> t') = del_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (inorder t) \<Longrightarrow> inorder (case del x t of None \<Rightarrow> t | Some t' \<Rightarrow> t') = del_list x (inorder t)
[PROOF STEP]
by(induction t)
  (auto simp add: del_list_simps split_minD split: option.splits prod.splits)


[STATEMENT]
lemma (in aGroup) ag_p_inv:"\<lbrakk>x \<in> carrier A; y \<in> carrier A\<rbrakk> \<Longrightarrow>
                                     (-\<^sub>a (x \<plusminus> y)) = (-\<^sub>a x) \<plusminus> (-\<^sub>a y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier A; y \<in> carrier A\<rbrakk> \<Longrightarrow> -\<^sub>a (x \<plusminus> y) = -\<^sub>a x \<plusminus> -\<^sub>a y
[PROOF STEP]
apply (frule ag_mOp_closed[of "x"], frule ag_mOp_closed[of "y"],
       frule ag_pOp_closed[of "x" "y"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier A; y \<in> carrier A; -\<^sub>a x \<in> carrier A; -\<^sub>a y \<in> carrier A; x \<plusminus> y \<in> carrier A\<rbrakk> \<Longrightarrow> -\<^sub>a (x \<plusminus> y) = -\<^sub>a x \<plusminus> -\<^sub>a y
[PROOF STEP]
apply (frule aassoc[of "x \<plusminus> y" "-\<^sub>a x" "-\<^sub>a y"], assumption+,
       simp add:pOp_assocTr43, simp add:pop_commute[of "y" "-\<^sub>a x"],
       simp add:aassoc[THEN sym, of "x" "-\<^sub>a x" "y"],
       simp add:ag_r_inv1 l_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier A; y \<in> carrier A; -\<^sub>a x \<in> carrier A; -\<^sub>a y \<in> carrier A; x \<plusminus> y \<in> carrier A; x \<plusminus> y \<plusminus> -\<^sub>a x \<plusminus> -\<^sub>a y = \<zero>\<rbrakk> \<Longrightarrow> -\<^sub>a (x \<plusminus> y) = -\<^sub>a x \<plusminus> -\<^sub>a y
[PROOF STEP]
apply (frule ag_pOp_closed[of "-\<^sub>a x" "-\<^sub>a y"], assumption+,
       simp add:pOp_assocTr41,
       rule ag_inv_unique[THEN sym, of "x \<plusminus> y" "-\<^sub>a x \<plusminus> -\<^sub>a y"], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subspace_cone_decomp:
  assumes "cone_decomp T ps"
  shows "phull.subspace (T::(_ \<Rightarrow>\<^sub>0 _::field) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phull.subspace T
[PROOF STEP]
proof (rule phull.subspace_direct_decomp)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. direct_decomp T ?ss
 2. \<And>s. s \<in> set ?ss \<Longrightarrow> phull.subspace s
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
cone_decomp T ps
[PROOF STEP]
show "direct_decomp T (map cone ps)"
[PROOF STATE]
proof (prove)
using this:
cone_decomp T ps

goal (1 subgoal):
 1. direct_decomp T (map cone ps)
[PROOF STEP]
by (rule cone_decompD)
[PROOF STATE]
proof (state)
this:
direct_decomp T (map cone ps)

goal (1 subgoal):
 1. \<And>s. s \<in> set (map cone ps) \<Longrightarrow> phull.subspace s
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s. s \<in> set (map cone ps) \<Longrightarrow> phull.subspace s
[PROOF STEP]
fix cn
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s. s \<in> set (map cone ps) \<Longrightarrow> phull.subspace s
[PROOF STEP]
assume "cn \<in> set (map cone ps)"
[PROOF STATE]
proof (state)
this:
cn \<in> set (map cone ps)

goal (1 subgoal):
 1. \<And>s. s \<in> set (map cone ps) \<Longrightarrow> phull.subspace s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cn \<in> set (map cone ps)
[PROOF STEP]
obtain hU where "hU \<in> set ps" and cn: "cn = cone hU"
[PROOF STATE]
proof (prove)
using this:
cn \<in> set (map cone ps)

goal (1 subgoal):
 1. (\<And>hU. \<lbrakk>hU \<in> set ps; cn = cone hU\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding set_map
[PROOF STATE]
proof (prove)
using this:
cn \<in> cone ` set ps

goal (1 subgoal):
 1. (\<And>hU. \<lbrakk>hU \<in> set ps; cn = cone hU\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
hU \<in> set ps
cn = cone hU

goal (1 subgoal):
 1. \<And>s. s \<in> set (map cone ps) \<Longrightarrow> phull.subspace s
[PROOF STEP]
show "phull.subspace cn"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phull.subspace cn
[PROOF STEP]
unfolding cn
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phull.subspace (cone hU)
[PROOF STEP]
by (rule subspace_cone)
[PROOF STATE]
proof (state)
this:
phull.subspace cn

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma borel_integrable_compact:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes "compact S" "continuous_on S f"
  shows "integrable lborel (\<lambda>x. indicator S x *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
 2. \<not> ?P \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
assume "S \<noteq> {}"
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (2 subgoals):
 1. ?P \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
 2. \<not> ?P \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
have "continuous_on S (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. norm (f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compact S
continuous_on S f

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. norm (f x))
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on S (\<lambda>x. norm (f x))

goal (2 subgoals):
 1. ?P \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
 2. \<not> ?P \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
from continuous_attains_sup[OF \<open>compact S\<close> \<open>S \<noteq> {}\<close> this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>S. \<forall>y\<in>S. norm (f y) \<le> norm (f x)
[PROOF STEP]
obtain M where M: "\<And>x. x \<in> S \<Longrightarrow> norm (f x) \<le> M"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>S. \<forall>y\<in>S. norm (f y) \<le> norm (f x)

goal (1 subgoal):
 1. (\<And>M. (\<And>x. x \<in> S \<Longrightarrow> norm (f x) \<le> M) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> norm (f ?x) \<le> M

goal (2 subgoals):
 1. ?P \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
 2. \<not> ?P \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
proof (rule integrable_bound)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. integrable lborel ?f
 2. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lborel
 3. AE x in lborel. norm (indicat_real S x *\<^sub>R f x) \<le> norm (?f x)
[PROOF STEP]
show "integrable lborel (\<lambda>x. indicator S x * M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real S x * M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compact S
continuous_on S f

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real S x * M)
[PROOF STEP]
by (auto intro!: emeasure_compact_finite borel_compact integrable_mult_left)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. indicat_real S x * M)

goal (2 subgoals):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lborel
 2. AE x in lborel. norm (indicat_real S x *\<^sub>R f x) \<le> norm (indicat_real S x * M)
[PROOF STEP]
show "(\<lambda>x. indicator S x *\<^sub>R f x) \<in> borel_measurable lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lborel
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compact S
continuous_on S f

goal (1 subgoal):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lborel
[PROOF STEP]
by (auto intro!: borel_measurable_continuous_on_indicator borel_compact)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lborel

goal (1 subgoal):
 1. AE x in lborel. norm (indicat_real S x *\<^sub>R f x) \<le> norm (indicat_real S x * M)
[PROOF STEP]
show "AE x in lborel. norm (indicator S x *\<^sub>R f x) \<le> norm (indicator S x * M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in lborel. norm (indicat_real S x *\<^sub>R f x) \<le> norm (indicat_real S x * M)
[PROOF STEP]
by (auto split: split_indicator simp: abs_real_def dest!: M)
[PROOF STATE]
proof (state)
this:
AE x in lborel. norm (indicat_real S x *\<^sub>R f x) \<le> norm (indicat_real S x * M)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)

goal (1 subgoal):
 1. \<not> S \<noteq> {} \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
qed simp


[STATEMENT]
lemma map_poly_homo_polyadd_eq_zero_iff:
  "map_poly f (p +\<^sub>p q) = 0\<^sub>p \<longleftrightarrow> p +\<^sub>p q = 0\<^sub>p"
  if [symmetric, simp]: "\<And>x y. f (x + y) = f x + f y" "\<And>x. f x = 0 \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_poly f (p +\<^sub>p q) = 0\<^sub>p) = (p +\<^sub>p q = 0\<^sub>p)
[PROOF STEP]
by (induction p q rule: polyadd.induct) auto


[STATEMENT]
lemma ntrunc_equality: "(!!k. ntrunc k M = ntrunc k N) ==> M=N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. ntrunc k M = ntrunc k N) \<Longrightarrow> M = N
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>k. ntrunc k M = ntrunc k N) \<Longrightarrow> M \<subseteq> N
 2. (\<And>k. ntrunc k M = ntrunc k N) \<Longrightarrow> N \<subseteq> M
[PROOF STEP]
apply (rule_tac [!] ntrunc_subsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k. (\<And>k. ntrunc k M = ntrunc k N) \<Longrightarrow> ntrunc k M \<subseteq> N
 2. \<And>k. (\<And>k. ntrunc k M = ntrunc k N) \<Longrightarrow> ntrunc k N \<subseteq> M
[PROOF STEP]
apply (rule_tac [!] ntrunc_subsetI [THEN [2] subset_trans], auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nat_eventually_critical:
  assumes "P i" "\<not> P j" "i < j"
  shows "\<exists> k \<ge> i. P k \<and> \<not> P (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k\<ge>i. P k \<and> \<not> P (Suc k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P i
\<not> P j
i < j

goal (1 subgoal):
 1. \<exists>k\<ge>i. P k \<and> \<not> P (Suc k)
[PROOF STEP]
by (metis dec_induct less_le)


[STATEMENT]
lemma cong_four_block_mat: "A1 = B1 \<Longrightarrow> A2 = B2 \<Longrightarrow> A3 = B3 \<Longrightarrow> A4 = B4 \<Longrightarrow>
  four_block_mat A1 A2 A3 A4 = four_block_mat B1 B2 B3 B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A1 = B1; A2 = B2; A3 = B3; A4 = B4\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 A3 A4 = four_block_mat B1 B2 B3 B4
[PROOF STEP]
by auto


[STATEMENT]
lemma soundness_mat_x_leq:
  assumes "dim_row A = dim_vec b"
  assumes "simplex (mat_x_leq_vec A b) = Sat X"
  shows "\<exists>x. [A *\<^sub>v x]\<le>b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. [A*\<^sub>vx]\<le>b
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [A*\<^sub>v?x]\<le>b
[PROOF STEP]
define x where x: "x = fst (split_n_m_x (dim_col A) (dim_row A) X)"
[PROOF STATE]
proof (state)
this:
x = fst (split_n_m_x (dim_col A) (dim_row A) X)

goal (1 subgoal):
 1. [A*\<^sub>v?x]\<le>b
[PROOF STEP]
have *: "dim_vec x = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec x = dim_col A
[PROOF STEP]
by (simp add: split_i_j_x_def x)
[PROOF STATE]
proof (state)
this:
dim_vec x = dim_col A

goal (1 subgoal):
 1. [A*\<^sub>v?x]\<le>b
[PROOF STEP]
have "\<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
proof (standard, standard)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
assume "i < dim_vec b"
[PROOF STATE]
proof (state)
this:
i < dim_vec b

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
have "row A i \<bullet> x \<le> b$i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row A i \<bullet> x \<le> b $ i
[PROOF STEP]
using mat_x_leq_vec_sol[of A b X i]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_x_leq_vec A b); i < dim_vec b\<rbrakk> \<Longrightarrow> matrix_to_lpolies A ! i \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i

goal (1 subgoal):
 1. row A i \<bullet> x \<le> b $ i
[PROOF STEP]
by (metis \<open>i < dim_vec b\<close> assms(1) assms(2) eval_lpoly_eq_dot_prod_split1
          fst_conv index_row(2) matrix_to_lp_vec_to_lpoly_row simplex(3) split_i_j_x_def x)
[PROOF STATE]
proof (state)
this:
row A i \<bullet> x \<le> b $ i

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
row A i \<bullet> x \<le> b $ i
[PROOF STEP]
show "(A *\<^sub>v x) $ i \<le> b $ i"
[PROOF STATE]
proof (prove)
using this:
row A i \<bullet> x \<le> b $ i

goal (1 subgoal):
 1. (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
by (simp add: \<open>i < dim_vec b\<close> assms(1))
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v x) $ i \<le> b $ i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i

goal (1 subgoal):
 1. [A*\<^sub>v?x]\<le>b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
show "[A *\<^sub>v x]\<le>b"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i

goal (1 subgoal):
 1. [A*\<^sub>vx]\<le>b
[PROOF STEP]
using mat_times_vec_leqI[of A b x, OF assms(1) *[symmetric]]
[PROOF STATE]
proof (prove)
using this:
\<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i
(\<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i) \<Longrightarrow> [A*\<^sub>vx]\<le>b

goal (1 subgoal):
 1. [A*\<^sub>vx]\<le>b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[A*\<^sub>vx]\<le>b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma orthogonal_col_of_unitary [simp]:
  assumes "unitary U" and "dim_col U = n" and "i < n" and "j < n" and "i \<noteq> j"
  shows "\<langle>col U i|col U j\<rangle> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = 0
[PROOF STEP]
have "\<langle>col U i|col U j\<rangle> = \<langle>U * |unit_vec n i\<rangle>| U * |unit_vec n j\<rangle>\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = \<langle>col_fst (U * |unit_vec n i\<rangle>)|col_fst (U * |unit_vec n j\<rangle>)\<rangle>
[PROOF STEP]
using assms(2-4) unit_vec_to_col
[PROOF STATE]
proof (prove)
using this:
dim_col U = n
i < n
j < n
\<lbrakk>dim_col ?A = ?n; ?i < ?n\<rbrakk> \<Longrightarrow> col ?A ?i = col_fst (?A * |unit_vec ?n ?i\<rangle>)

goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = \<langle>col_fst (U * |unit_vec n i\<rangle>)|col_fst (U * |unit_vec n j\<rangle>)\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<langle>col U i|col U j\<rangle> = \<langle>col_fst (U * |unit_vec n i\<rangle>)|col_fst (U * |unit_vec n j\<rangle>)\<rangle>

goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<langle>col U i|col U j\<rangle> = \<langle>col_fst (U * |unit_vec n i\<rangle>)|col_fst (U * |unit_vec n j\<rangle>)\<rangle>

goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = 0
[PROOF STEP]
have "\<dots> = \<langle>unit_vec n i |unit_vec n j\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>col_fst (U * |unit_vec n i\<rangle>)|col_fst (U * |unit_vec n j\<rangle>)\<rangle> = \<langle>unit_vec n i|unit_vec n j\<rangle>
[PROOF STEP]
using assms(1-2) inner_prod_with_unitary_mat index_unit_vec(3)
[PROOF STATE]
proof (prove)
using this:
unitary U
dim_col U = n
\<lbrakk>unitary ?U; dim_vec ?u = dim_col ?U; dim_vec ?v = dim_col ?U\<rbrakk> \<Longrightarrow> \<langle>col_fst (?U * |?u\<rangle>)|col_fst (?U * |?v\<rangle>)\<rangle> = \<langle>?u|?v\<rangle>
dim_vec (unit_vec ?n ?i) = ?n

goal (1 subgoal):
 1. \<langle>col_fst (U * |unit_vec n i\<rangle>)|col_fst (U * |unit_vec n j\<rangle>)\<rangle> = \<langle>unit_vec n i|unit_vec n j\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<langle>col_fst (U * |unit_vec n i\<rangle>)|col_fst (U * |unit_vec n j\<rangle>)\<rangle> = \<langle>unit_vec n i|unit_vec n j\<rangle>

goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<langle>col U i|col U j\<rangle> = \<langle>unit_vec n i|unit_vec n j\<rangle>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<langle>col U i|col U j\<rangle> = \<langle>unit_vec n i|unit_vec n j\<rangle>

goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = 0
[PROOF STEP]
using assms(3-5)
[PROOF STATE]
proof (prove)
using this:
\<langle>col U i|col U j\<rangle> = \<langle>unit_vec n i|unit_vec n j\<rangle>
i < n
j < n
i \<noteq> j

goal (1 subgoal):
 1. \<langle>col U i|col U j\<rangle> = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<langle>col U i|col U j\<rangle> = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diameter_gt_eccentricity: "v \<in> V \<Longrightarrow> diameter \<ge> eccentricity v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> V \<Longrightarrow> eccentricity v \<le> diameter
[PROOF STEP]
using diameter_def
[PROOF STATE]
proof (prove)
using this:
diameter \<equiv> Sup (eccentricity ` V)

goal (1 subgoal):
 1. v \<in> V \<Longrightarrow> eccentricity v \<le> diameter
[PROOF STEP]
by (simp add: SUP_upper)


[STATEMENT]
lemma rel_fun_comp:
  assumes "(R1 ===> S1) f g" "(R2 ===> S2) g h"
  shows "(R1 OO R2 ===> S1 OO S2) f h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (R1 OO R2 ===> S1 OO S2) f h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(R1 ===> S1) f g
(R2 ===> S2) g h

goal (1 subgoal):
 1. (R1 OO R2 ===> S1 OO S2) f h
[PROOF STEP]
by (auto intro!: rel_funI dest!: rel_funD)


[STATEMENT]
lemma ascending_chain_dual:
  "ascending_chain f \<longleftrightarrow> descending_chain (dual o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ascending_chain f = descending_chain (dual \<circ> f)
[PROOF STEP]
using ascending_chain_def descending_chain_def dual_le
[PROOF STATE]
proof (prove)
using this:
ascending_chain ?f \<equiv> \<forall>n. ?f n \<le> ?f (Suc n)
descending_chain ?f \<equiv> \<forall>n. ?f (Suc n) \<le> ?f n
(?x \<le> ?y) = (?y ^ o \<le> ?x ^ o)

goal (1 subgoal):
 1. ascending_chain f = descending_chain (dual \<circ> f)
[PROOF STEP]
by auto


[STATEMENT]
lemma det_zero[simp]: assumes "n > 0" shows "det (0\<^sub>m n n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (0\<^sub>m n n) = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (0\<^sub>m n n) = (0::'a)
[PROOF STEP]
have "det (0\<^sub>m n n) = prod_list (diag_mat (0\<^sub>m n n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (0\<^sub>m n n) = prod_list (diag_mat (0\<^sub>m n n))
[PROOF STEP]
by (rule det_upper_triangular[of _ n], auto)
[PROOF STATE]
proof (state)
this:
det (0\<^sub>m n n) = prod_list (diag_mat (0\<^sub>m n n))

goal (1 subgoal):
 1. det (0\<^sub>m n n) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (0\<^sub>m n n) = prod_list (diag_mat (0\<^sub>m n n))

goal (1 subgoal):
 1. det (0\<^sub>m n n) = (0::'a)
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (diag_mat (0\<^sub>m n n)) = (0::'b)
[PROOF STEP]
using \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. prod_list (diag_mat (0\<^sub>m n n)) = (0::'b)
[PROOF STEP]
by (cases n, auto)
[PROOF STATE]
proof (state)
this:
prod_list (diag_mat (0\<^sub>m n n)) = (0::?'b2)

goal (1 subgoal):
 1. det (0\<^sub>m n n) = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (0\<^sub>m n n) = (0::?'b3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (0\<^sub>m n n) = (0::?'b3)

goal (1 subgoal):
 1. det (0\<^sub>m n n) = (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (0\<^sub>m n n) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_list_list_update_Suc:
  assumes "i < length u"
  shows "sum_list (u[i := Suc (u ! i)]) = Suc (sum_list u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (u[i := Suc (u ! i)]) = Suc (sum_list u)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < length u

goal (1 subgoal):
 1. sum_list (u[i := Suc (u ! i)]) = Suc (sum_list u)
[PROOF STEP]
proof (induct u arbitrary: i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < length [] \<Longrightarrow> sum_list ([][i := Suc ([] ! i)]) = Suc (sum_list [])
 2. \<And>a u i. \<lbrakk>\<And>i. i < length u \<Longrightarrow> sum_list (u[i := Suc (u ! i)]) = Suc (sum_list u); i < length (a # u)\<rbrakk> \<Longrightarrow> sum_list ((a # u)[i := Suc ((a # u) ! i)]) = Suc (sum_list (a # u))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
?i < length xs \<Longrightarrow> sum_list (xs[?i := Suc (xs ! ?i)]) = Suc (sum_list xs)
i < length (x # xs)

goal (2 subgoals):
 1. \<And>i. i < length [] \<Longrightarrow> sum_list ([][i := Suc ([] ! i)]) = Suc (sum_list [])
 2. \<And>a u i. \<lbrakk>\<And>i. i < length u \<Longrightarrow> sum_list (u[i := Suc (u ! i)]) = Suc (sum_list u); i < length (a # u)\<rbrakk> \<Longrightarrow> sum_list ((a # u)[i := Suc ((a # u) ! i)]) = Suc (sum_list (a # u))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i < length xs \<Longrightarrow> sum_list (xs[?i := Suc (xs ! ?i)]) = Suc (sum_list xs)
i < length (x # xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i < length xs \<Longrightarrow> sum_list (xs[?i := Suc (xs ! ?i)]) = Suc (sum_list xs)
i < length (x # xs)

goal (1 subgoal):
 1. sum_list ((x # xs)[i := Suc ((x # xs) ! i)]) = Suc (sum_list (x # xs))
[PROOF STEP]
by (simp_all split: nat.splits)
[PROOF STATE]
proof (state)
this:
sum_list ((x # xs)[i := Suc ((x # xs) ! i)]) = Suc (sum_list (x # xs))

goal (1 subgoal):
 1. \<And>i. i < length [] \<Longrightarrow> sum_list ([][i := Suc ([] ! i)]) = Suc (sum_list [])
[PROOF STEP]
qed (simp)


[STATEMENT]
lemma primes_infinite: "\<not> (finite {(p::nat). prime p})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {p. prime p}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {p. prime p} \<Longrightarrow> False
[PROOF STEP]
assume "finite {(p::nat). prime p}"
[PROOF STATE]
proof (state)
this:
finite {p. prime p}

goal (1 subgoal):
 1. finite {p. prime p} \<Longrightarrow> False
[PROOF STEP]
with Max_ge
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> ?x \<le> Max ?A
finite {p. prime p}
[PROOF STEP]
have "(\<exists>b. (\<forall>x \<in> {(p::nat). prime p}. x \<le> b))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> ?x \<le> Max ?A
finite {p. prime p}

goal (1 subgoal):
 1. \<exists>b. \<forall>x\<in>{p. prime p}. x \<le> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>b. \<forall>x\<in>{p. prime p}. x \<le> b

goal (1 subgoal):
 1. finite {p. prime p} \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>b. \<forall>x\<in>{p. prime p}. x \<le> b
[PROOF STEP]
obtain b where "\<forall>(x::nat). prime x \<longrightarrow> x \<le> b"
[PROOF STATE]
proof (prove)
using this:
\<exists>b. \<forall>x\<in>{p. prime p}. x \<le> b

goal (1 subgoal):
 1. (\<And>b. \<forall>x. prime x \<longrightarrow> x \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. prime x \<longrightarrow> x \<le> b

goal (1 subgoal):
 1. finite {p. prime p} \<Longrightarrow> False
[PROOF STEP]
with bigger_prime [of b]
[PROOF STATE]
proof (chain)
picking this:
\<exists>p. prime p \<and> b < p
\<forall>x. prime x \<longrightarrow> x \<le> b
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<exists>p. prime p \<and> b < p
\<forall>x. prime x \<longrightarrow> x \<le> b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convolution_assoc :
  fixes   f h g :: "'a::group_add \<Rightarrow> 'b::semiring_0"
  assumes f_aez: "f \<in> aezfun_set" and h_aez: "h \<in> aezfun_set"
  shows   "convolution (convolution f g) h = convolution f (convolution g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution (convolution f g) h = convolution f (convolution g h)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. convolution (convolution f g) h x = convolution f (convolution g h) x
[PROOF STEP]
define fg gh where "fg = convolution f g" and "gh = convolution g h"
[PROOF STATE]
proof (state)
this:
fg = convolution f g
gh = convolution g h

goal (1 subgoal):
 1. \<And>x. convolution (convolution f g) h x = convolution f (convolution g h) x
[PROOF STEP]
fix x::'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. convolution (convolution f g) h x = convolution f (convolution g h) x
[PROOF STEP]
have "convolution fg h x
              = (\<Sum>y\<in>supp f. (\<Sum>z\<in>supp h. f y * g (-y + x - z) * h z) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
have "convolution fg h x = (\<Sum>z\<in>supp h. fg (x - z) * h z )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution fg h x = (\<Sum>z\<in>supp h. fg (x - z) * h z)
[PROOF STEP]
using h_aez convolution_eq_sum_over_supp_right[of h fg]
[PROOF STATE]
proof (prove)
using this:
h \<in> aezfun_set
h \<in> aezfun_set \<Longrightarrow> convolution fg h = (\<lambda>x. \<Sum>y\<in>supp h. fg (x - y) * h y)

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>z\<in>supp h. fg (x - z) * h z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convolution fg h x = (\<Sum>z\<in>supp h. fg (x - z) * h z)

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
convolution fg h x = (\<Sum>z\<in>supp h. fg (x - z) * h z)

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
have "\<And>z. fg (x - z) * h z
                        = (\<Sum>y\<in>supp f. f y * g (-y + x - z) * h z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
[PROOF STEP]
fix z::'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
[PROOF STEP]
have "fg (x - z) = (\<Sum>y\<in>supp f. f y * g (-y + (x - z)) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fg (x - z) = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)))
[PROOF STEP]
using fg_def f_aez convolution_symm_eq_sum_over_supp_left
[PROOF STATE]
proof (prove)
using this:
fg = convolution f g
f \<in> aezfun_set
?f \<in> aezfun_set \<Longrightarrow> convolution ?f ?g = (\<lambda>x. \<Sum>y\<in>supp ?f. ?f y * ?g (- y + x))

goal (1 subgoal):
 1. fg (x - z) = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
fg (x - z) = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)))

goal (1 subgoal):
 1. \<And>z. fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
[PROOF STEP]
hence "fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (-y + (x - z)) * h z )"
[PROOF STATE]
proof (prove)
using this:
fg (x - z) = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)))

goal (1 subgoal):
 1. fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)) * h z)
[PROOF STEP]
using sum_distrib_right
[PROOF STATE]
proof (prove)
using this:
fg (x - z) = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)))
sum ?f ?A * ?r = (\<Sum>n\<in>?A. ?f n * ?r)

goal (1 subgoal):
 1. fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)) * h z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)) * h z)

goal (1 subgoal):
 1. \<And>z. fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
[PROOF STEP]
thus "fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (-y + x - z) * h z )"
[PROOF STATE]
proof (prove)
using this:
fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + (x - z)) * h z)

goal (1 subgoal):
 1. fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
fg (x - z) * h z = (\<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fg (x - ?z) * h ?z = (\<Sum>y\<in>supp f. f y * g (- y + x - ?z) * h ?z)

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
convolution fg h x = (\<Sum>z\<in>supp h. fg (x - z) * h z)
fg (x - ?z) * h ?z = (\<Sum>y\<in>supp f. f y * g (- y + x - ?z) * h ?z)
[PROOF STEP]
have  "convolution fg h x
                  = (\<Sum>z\<in>supp h. (\<Sum>y\<in>supp f. f y * g (-y + x - z) * h z) )"
[PROOF STATE]
proof (prove)
using this:
convolution fg h x = (\<Sum>z\<in>supp h. fg (x - z) * h z)
fg (x - ?z) * h ?z = (\<Sum>y\<in>supp f. f y * g (- y + x - ?z) * h ?z)

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>z\<in>supp h. \<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
[PROOF STEP]
using sum.cong
[PROOF STATE]
proof (prove)
using this:
convolution fg h x = (\<Sum>z\<in>supp h. fg (x - z) * h z)
fg (x - ?z) * h ?z = (\<Sum>y\<in>supp f. f y * g (- y + x - ?z) * h ?z)
\<lbrakk>?A = ?B; \<And>x. x \<in> ?B \<Longrightarrow> ?g x = ?h x\<rbrakk> \<Longrightarrow> sum ?g ?A = sum ?h ?B

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>z\<in>supp h. \<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
convolution fg h x = (\<Sum>z\<in>supp h. \<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
convolution fg h x = (\<Sum>z\<in>supp h. \<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
using sum.swap
[PROOF STATE]
proof (prove)
using this:
convolution fg h x = (\<Sum>z\<in>supp h. \<Sum>y\<in>supp f. f y * g (- y + x - z) * h z)
(\<Sum>i\<in>?A. sum (?g i) ?B) = (\<Sum>j\<in>?B. \<Sum>i\<in>?A. ?g i j)

goal (1 subgoal):
 1. convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal (1 subgoal):
 1. \<And>x. convolution (convolution f g) h x = convolution f (convolution g h) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal (1 subgoal):
 1. \<And>x. convolution (convolution f g) h x = convolution f (convolution g h) x
[PROOF STEP]
have "convolution f gh x
                      = (\<Sum>y\<in>supp f. (\<Sum>z\<in>supp h. f y * g (-y + x - z) * h z) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
have "convolution f gh x = (\<Sum>y\<in>supp f. f y * gh (-y + x) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. f y * gh (- y + x))
[PROOF STEP]
using f_aez convolution_symm_eq_sum_over_supp_left[of f gh]
[PROOF STATE]
proof (prove)
using this:
f \<in> aezfun_set
f \<in> aezfun_set \<Longrightarrow> convolution f gh = (\<lambda>x. \<Sum>y\<in>supp f. f y * gh (- y + x))

goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. f y * gh (- y + x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convolution f gh x = (\<Sum>y\<in>supp f. f y * gh (- y + x))

goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
convolution f gh x = (\<Sum>y\<in>supp f. f y * gh (- y + x))

goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
have "\<And>y. f y * gh (-y + x)
                        = (\<Sum>z\<in>supp h. f y * g (-y + x - z) * h z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
fix y::'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
have triple_cong: "\<And>z. f y * (g (-y + x - z) * h z)
                              = f y * g (-y + x - z) * h z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. f y * (g (- y + x - z) * h z) = f y * g (- y + x - z) * h z
[PROOF STEP]
using mult.assoc[of "f y"]
[PROOF STATE]
proof (prove)
using this:
f y * ?b * ?c = f y * (?b * ?c)

goal (1 subgoal):
 1. \<And>z. f y * (g (- y + x - z) * h z) = f y * g (- y + x - z) * h z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f y * (g (- y + x - ?z) * h ?z) = f y * g (- y + x - ?z) * h ?z

goal (1 subgoal):
 1. \<And>y. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
have "gh (-y + x) = (\<Sum>z\<in>supp h. g (-y + x - z) * h z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gh (- y + x) = (\<Sum>z\<in>supp h. g (- y + x - z) * h z)
[PROOF STEP]
using gh_def h_aez convolution_eq_sum_over_supp_right
[PROOF STATE]
proof (prove)
using this:
gh = convolution g h
h \<in> aezfun_set
?g \<in> aezfun_set \<Longrightarrow> convolution ?f ?g = (\<lambda>x. \<Sum>y\<in>supp ?g. ?f (x - y) * ?g y)

goal (1 subgoal):
 1. gh (- y + x) = (\<Sum>z\<in>supp h. g (- y + x - z) * h z)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
gh (- y + x) = (\<Sum>z\<in>supp h. g (- y + x - z) * h z)

goal (1 subgoal):
 1. \<And>y. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
hence "f y * gh (-y + x) = (\<Sum>z\<in>supp h. f y * (g (-y + x - z) * h z))"
[PROOF STATE]
proof (prove)
using this:
gh (- y + x) = (\<Sum>z\<in>supp h. g (- y + x - z) * h z)

goal (1 subgoal):
 1. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * (g (- y + x - z) * h z))
[PROOF STEP]
using sum_distrib_left
[PROOF STATE]
proof (prove)
using this:
gh (- y + x) = (\<Sum>z\<in>supp h. g (- y + x - z) * h z)
?r * sum ?f ?A = (\<Sum>n\<in>?A. ?r * ?f n)

goal (1 subgoal):
 1. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * (g (- y + x - z) * h z))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * (g (- y + x - z) * h z))

goal (1 subgoal):
 1. \<And>y. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * (g (- y + x - z) * h z))

goal (1 subgoal):
 1. \<And>y. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
have "\<dots> = (\<Sum>z\<in>supp h. f y * g (-y + x - z) * h z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>z\<in>supp h. f y * (g (- y + x - z) * h z)) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
using triple_cong sum.cong
[PROOF STATE]
proof (prove)
using this:
f y * (g (- y + x - ?z) * h ?z) = f y * g (- y + x - ?z) * h ?z
\<lbrakk>?A = ?B; \<And>x. x \<in> ?B \<Longrightarrow> ?g x = ?h x\<rbrakk> \<Longrightarrow> sum ?g ?A = sum ?h ?B

goal (1 subgoal):
 1. (\<Sum>z\<in>supp h. f y * (g (- y + x - z) * h z)) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>supp h. f y * (g (- y + x - z) * h z)) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal (1 subgoal):
 1. \<And>y. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
show "f y * gh (-y + x) = (\<Sum>z\<in>supp h. f y * g (-y + x - z) * h z)"
[PROOF STATE]
proof (prove)
using this:
f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal (1 subgoal):
 1. f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
by   fast
[PROOF STATE]
proof (state)
this:
f y * gh (- y + x) = (\<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ?y * gh (- ?y + x) = (\<Sum>z\<in>supp h. f ?y * g (- ?y + x - z) * h z)

goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
convolution f gh x = (\<Sum>y\<in>supp f. f y * gh (- y + x))
f ?y * gh (- ?y + x) = (\<Sum>z\<in>supp h. f ?y * g (- ?y + x - z) * h z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
convolution f gh x = (\<Sum>y\<in>supp f. f y * gh (- y + x))
f ?y * gh (- ?y + x) = (\<Sum>z\<in>supp h. f ?y * g (- ?y + x - z) * h z)

goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
using sum.cong
[PROOF STATE]
proof (prove)
using this:
convolution f gh x = (\<Sum>y\<in>supp f. f y * gh (- y + x))
f ?y * gh (- ?y + x) = (\<Sum>z\<in>supp h. f ?y * g (- ?y + x - z) * h z)
\<lbrakk>?A = ?B; \<And>x. x \<in> ?B \<Longrightarrow> ?g x = ?h x\<rbrakk> \<Longrightarrow> sum ?g ?A = sum ?h ?B

goal (1 subgoal):
 1. convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal (1 subgoal):
 1. \<And>x. convolution (convolution f g) h x = convolution f (convolution g h) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
[PROOF STEP]
show "convolution fg h x = convolution f gh x"
[PROOF STATE]
proof (prove)
using this:
convolution fg h x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)
convolution f gh x = (\<Sum>y\<in>supp f. \<Sum>z\<in>supp h. f y * g (- y + x - z) * h z)

goal (1 subgoal):
 1. convolution fg h x = convolution f gh x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convolution fg h x = convolution f gh x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  unitary_hermitian_Re_spectrum:
  fixes U::"complex Matrix.mat"
  assumes "unitary U"
  and "hermitian U"
  and "U \<in> carrier_mat n n"
  and "0 < n"
  shows "{Re x|x. x\<in> spectrum U} \<subseteq> {-1,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Re x |x. x \<in> spectrum U} \<subseteq> {- 1, 1}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {Re x |x. x \<in> spectrum U} \<Longrightarrow> x \<in> {- 1, 1}
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {Re x |x. x \<in> spectrum U} \<Longrightarrow> x \<in> {- 1, 1}
[PROOF STEP]
assume "y\<in> {Re x|x. x\<in> spectrum U}"
[PROOF STATE]
proof (state)
this:
y \<in> {Re x |x. x \<in> spectrum U}

goal (1 subgoal):
 1. \<And>x. x \<in> {Re x |x. x \<in> spectrum U} \<Longrightarrow> x \<in> {- 1, 1}
[PROOF STEP]
hence "\<exists>x \<in> spectrum U. y = Re x"
[PROOF STATE]
proof (prove)
using this:
y \<in> {Re x |x. x \<in> spectrum U}

goal (1 subgoal):
 1. \<exists>x\<in>spectrum U. y = Re x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>spectrum U. y = Re x

goal (1 subgoal):
 1. \<And>x. x \<in> {Re x |x. x \<in> spectrum U} \<Longrightarrow> x \<in> {- 1, 1}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>spectrum U. y = Re x
[PROOF STEP]
obtain x where "x\<in> spectrum U" and "y = Re x"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>spectrum U. y = Re x

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> spectrum U; y = Re x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> spectrum U
y = Re x

goal (1 subgoal):
 1. \<And>x. x \<in> {Re x |x. x \<in> spectrum U} \<Longrightarrow> x \<in> {- 1, 1}
[PROOF STEP]
hence "x\<in> {-1,1}"
[PROOF STATE]
proof (prove)
using this:
x \<in> spectrum U
y = Re x

goal (1 subgoal):
 1. x \<in> {- 1, 1}
[PROOF STEP]
using unitary_hermitian_eigenvalues assms
[PROOF STATE]
proof (prove)
using this:
x \<in> spectrum U
y = Re x
\<lbrakk>Complex_Matrix.unitary ?U; hermitian ?U; ?U \<in> carrier_mat ?n ?n; 0 < ?n; ?k \<in> spectrum ?U\<rbrakk> \<Longrightarrow> ?k \<in> {- 1, 1}
Complex_Matrix.unitary U
hermitian U
U \<in> carrier_mat n n
0 < n

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

goal (1 subgoal):
 1. \<And>x. x \<in> {Re x |x. x \<in> spectrum U} \<Longrightarrow> x \<in> {- 1, 1}
[PROOF STEP]
thus "y \<in> {-1, 1}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {- 1, 1}

goal (1 subgoal):
 1. y \<in> {- 1, 1}
[PROOF STEP]
using \<open>y = Re x\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> {- 1, 1}
y = Re x

goal (1 subgoal):
 1. y \<in> {- 1, 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> {- 1, 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indexed_const_intersect:
  assumes "j1 < \<b>"
  assumes "j2 < \<b>"
  assumes "j1 \<noteq> j2"
  shows "(\<B>s ! j1) |\<inter>| (\<B>s ! j2) = \<m>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B>s ! j1 |\<inter>| \<B>s ! j2 = \<m>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<B>s ! j1 |\<inter>| \<B>s ! j2 = \<m>
[PROOF STEP]
obtain bl1 bl2 where "bl1 \<in># \<B>" and "\<B>s ! j1 = bl1" and "bl2 \<in># \<B> - {#bl1#}" and "\<B>s ! j2 = bl2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>bl1 bl2. \<lbrakk>bl1 \<in># \<B>; \<B>s ! j1 = bl1; bl2 \<in># remove1_mset bl1 \<B>; \<B>s ! j2 = bl2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using obtains_two_diff_block_indexes assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?j1.0 < \<b>; ?j2.0 < \<b>; ?j1.0 \<noteq> ?j2.0; 2 \<le> \<b>; \<And>bl1 bl2. \<lbrakk>bl1 \<in># \<B>; \<B>s ! ?j1.0 = bl1; bl2 \<in># remove1_mset bl1 \<B>; \<B>s ! ?j2.0 = bl2\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
j1 < \<b>
j2 < \<b>
j1 \<noteq> j2

goal (1 subgoal):
 1. (\<And>bl1 bl2. \<lbrakk>bl1 \<in># \<B>; \<B>s ! j1 = bl1; bl2 \<in># remove1_mset bl1 \<B>; \<B>s ! j2 = bl2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
bl1 \<in># \<B>
\<B>s ! j1 = bl1
bl2 \<in># remove1_mset bl1 \<B>
\<B>s ! j2 = bl2

goal (1 subgoal):
 1. \<B>s ! j1 |\<inter>| \<B>s ! j2 = \<m>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bl1 \<in># \<B>
\<B>s ! j1 = bl1
bl2 \<in># remove1_mset bl1 \<B>
\<B>s ! j2 = bl2

goal (1 subgoal):
 1. \<B>s ! j1 |\<inter>| \<B>s ! j2 = \<m>
[PROOF STEP]
by (simp add: const_intersect)
[PROOF STATE]
proof (state)
this:
\<B>s ! j1 |\<inter>| \<B>s ! j2 = \<m>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rbt_min_opt_in_set:
  fixes t :: "('a :: linorder, unit) RBT_Impl.rbt"
  assumes "t \<noteq> rbt.Empty"
  shows "rbt_min_opt t \<in> set (RBT_Impl.keys t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt_min_opt t \<in> set (RBT_Impl.keys t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t \<noteq> rbt.Empty

goal (1 subgoal):
 1. rbt_min_opt t \<in> set (RBT_Impl.keys t)
[PROOF STEP]
by (induction t rule: rbt_min_opt.induct) (auto)


[STATEMENT]
lemma higher_deriv_add_at:
  assumes "f analytic_on {z}" "g analytic_on {z}"
    shows "(deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z
[PROOF STEP]
have "f analytic_on {z} \<and> g analytic_on {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f analytic_on {z} \<and> g analytic_on {z}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f analytic_on {z}
g analytic_on {z}

goal (1 subgoal):
 1. f analytic_on {z} \<and> g analytic_on {z}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f analytic_on {z} \<and> g analytic_on {z}

goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z
[PROOF STEP]
with higher_deriv_add
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?f holomorphic_on ?S; ?g holomorphic_on ?S; open ?S; ?z \<in> ?S\<rbrakk> \<Longrightarrow> (deriv ^^ ?n) (\<lambda>w. ?f w + ?g w) ?z = (deriv ^^ ?n) ?f ?z + (deriv ^^ ?n) ?g ?z
f analytic_on {z} \<and> g analytic_on {z}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f holomorphic_on ?S; ?g holomorphic_on ?S; open ?S; ?z \<in> ?S\<rbrakk> \<Longrightarrow> (deriv ^^ ?n) (\<lambda>w. ?f w + ?g w) ?z = (deriv ^^ ?n) ?f ?z + (deriv ^^ ?n) ?g ?z
f analytic_on {z} \<and> g analytic_on {z}

goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z
[PROOF STEP]
by (auto simp: analytic_at_two)
[PROOF STATE]
proof (state)
this:
(deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lists_accD: "xs \<in> lists (Wellfounded.acc r) \<Longrightarrow> xs \<in> Wellfounded.acc (listrel1 r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> lists (Wellfounded.acc r) \<Longrightarrow> xs \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
proof (induct set: lists)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. [] \<in> Wellfounded.acc (listrel1 r)
 2. \<And>a l. \<lbrakk>a \<in> Wellfounded.acc r; l \<in> lists (Wellfounded.acc r); l \<in> Wellfounded.acc (listrel1 r)\<rbrakk> \<Longrightarrow> a # l \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. [] \<in> Wellfounded.acc (listrel1 r)
 2. \<And>a l. \<lbrakk>a \<in> Wellfounded.acc r; l \<in> lists (Wellfounded.acc r); l \<in> Wellfounded.acc (listrel1 r)\<rbrakk> \<Longrightarrow> a # l \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [] \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
by (meson acc.intros not_listrel1_Nil)
[PROOF STATE]
proof (state)
this:
[] \<in> Wellfounded.acc (listrel1 r)

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>a \<in> Wellfounded.acc r; l \<in> lists (Wellfounded.acc r); l \<in> Wellfounded.acc (listrel1 r)\<rbrakk> \<Longrightarrow> a # l \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l. \<lbrakk>a \<in> Wellfounded.acc r; l \<in> lists (Wellfounded.acc r); l \<in> Wellfounded.acc (listrel1 r)\<rbrakk> \<Longrightarrow> a # l \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
case (Cons a l)
[PROOF STATE]
proof (state)
this:
a \<in> Wellfounded.acc r
l \<in> lists (Wellfounded.acc r)
l \<in> Wellfounded.acc (listrel1 r)

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>a \<in> Wellfounded.acc r; l \<in> lists (Wellfounded.acc r); l \<in> Wellfounded.acc (listrel1 r)\<rbrakk> \<Longrightarrow> a # l \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> Wellfounded.acc r
l \<in> lists (Wellfounded.acc r)
l \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a \<in> Wellfounded.acc r
l \<in> lists (Wellfounded.acc r)
l \<in> Wellfounded.acc (listrel1 r)

goal (1 subgoal):
 1. a # l \<in> Wellfounded.acc (listrel1 r)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a # l \<in> Wellfounded.acc (listrel1 r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<exists>x::'a::linordered_field. 0 < x \<and> x < 1 \<longrightarrow> (\<forall>y > 1. x + y \<noteq> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. (0::'a) < x \<and> x < (1::'a) \<longrightarrow> (\<forall>y>1::'a. x + y \<noteq> (1::'a))
[PROOF STEP]
by ferrack


[STATEMENT]
lemma log_base_10_eq2: "0 < x \<Longrightarrow> log 10 x = (log 10 (exp 1)) * ln x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> log 10 x = log 10 (exp 1) * ln x
[PROOF STEP]
by (simp add: log_def)


[STATEMENT]
lemma "((P=Q) --> P&Q&R) &
       ((Q=R) --> P&Q&R) &
       ((R=P) --> P&Q&R) --> P&Q&R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P = Q \<longrightarrow> P \<and> Q \<and> R) \<and> (Q = R \<longrightarrow> P \<and> Q \<and> R) \<and> (R = P \<longrightarrow> P \<and> Q \<and> R) \<longrightarrow> P \<and> Q \<and> R
[PROOF STEP]
by iprover


[STATEMENT]
theorem wls_vsubst_compose2:
assumes  "wls s X"
and "ys \<noteq> zs \<or> y \<notin> {z,z1}"
shows "((X #[y1 // y]_ys) #[z1 // z]_zs) = ((X #[z1 // z]_zs) #[(y1 @ys[z1 / z]_zs) // y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X #[y1 // y]_ys #[z1 // z]_zs = X #[z1 // z]_zs #[y1 @ys[z1 / z]_zs // y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
ys \<noteq> zs \<or> y \<notin> {z, z1}

goal (1 subgoal):
 1. X #[y1 // y]_ys #[z1 // z]_zs = X #[z1 // z]_zs #[y1 @ys[z1 / z]_zs // y]_ys
[PROOF STEP]
by(simp add: vsubst_compose2)


[STATEMENT]
lemma "Gale_Shapley1
  [[4,6,0,1,5,7,3,2], [1,2,6,4,3,0,7,5], [7,4,0,3,5,1,2,6], [2,1,6,3,0,5,7,4],
   [6,1,4,0,2,5,7,3], [0,5,6,4,7,3,1,2], [1,4,6,5,2,3,7,0], [2,7,3,4,6,1,5,0]]
  [[4,2,6,5,0,1,7,3], [7,5,2,4,6,1,0,3], [0,4,5,1,3,7,6,2], [7,6,2,1,3,0,4,5],
   [5,3,6,2,7,0,1,4], [1,7,4,2,3,5,6,0], [6,4,1,0,7,5,3,2], [6,3,0,4,1,2,5,7]]
  = Some [0, 1, 0, 5, 0, 0, 0, 2]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gale_Shapley1 [[4, 6, 0, 1, 5, 7, 3, 2], [1, 2, 6, 4, 3, 0, 7, 5], [7, 4, 0, 3, 5, 1, 2, 6], [2, 1, 6, 3, 0, 5, 7, 4], [6, 1, 4, 0, 2, 5, 7, 3], [0, 5, 6, 4, 7, 3, 1, 2], [1, 4, 6, 5, 2, 3, 7, 0], [2, 7, 3, 4, 6, 1, 5, 0]] [[4, 2, 6, 5, 0, 1, 7, 3], [7, 5, 2, 4, 6, 1, 0, 3], [0, 4, 5, 1, 3, 7, 6, 2], [7, 6, 2, 1, 3, 0, 4, 5], [5, 3, 6, 2, 7, 0, 1, 4], [1, 7, 4, 2, 3, 5, 6, 0], [6, 4, 1, 0, 7, 5, 3, 2], [6, 3, 0, 4, 1, 2, 5, 7]] = Some [0, 1, 0, 5, 0, 0, 0, 2]
[PROOF STEP]
by eval


[STATEMENT]
lemma hd_construct:
  assumes "\<not> is_empty q"
  shows "hd (alist_of q) = (min q, the (priority q (min q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (alist_of q) = (PQ.min q, the (priority q (PQ.min q)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hd (alist_of q) = (PQ.min q, the (priority q (PQ.min q)))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<not> is_empty q
[PROOF STEP]
have "the (priority q (min q)) = snd (hd (alist_of q))"
[PROOF STATE]
proof (prove)
using this:
\<not> is_empty q

goal (1 subgoal):
 1. the (priority q (PQ.min q)) = snd (hd (alist_of q))
[PROOF STEP]
using Min_snd_hd [of "alist_of q"]
[PROOF STATE]
proof (prove)
using this:
\<not> is_empty q
\<lbrakk>alist_of q \<noteq> []; sorted (map snd (alist_of q))\<rbrakk> \<Longrightarrow> Min (snd ` set (alist_of q)) = snd (hd (alist_of q))

goal (1 subgoal):
 1. the (priority q (PQ.min q)) = snd (hd (alist_of q))
[PROOF STEP]
by (auto simp add: priority_Min_priorities priorities_def)
[PROOF STATE]
proof (state)
this:
the (priority q (PQ.min q)) = snd (hd (alist_of q))

goal (1 subgoal):
 1. hd (alist_of q) = (PQ.min q, the (priority q (PQ.min q)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
the (priority q (PQ.min q)) = snd (hd (alist_of q))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
the (priority q (PQ.min q)) = snd (hd (alist_of q))

goal (1 subgoal):
 1. hd (alist_of q) = (PQ.min q, the (priority q (PQ.min q)))
[PROOF STEP]
by (simp add: min_def)
[PROOF STATE]
proof (state)
this:
hd (alist_of q) = (PQ.min q, the (priority q (PQ.min q)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transform_filter_img_empty_rm:
  assumes "\<And> g . g \<in> G \<Longrightarrow> g \<noteq> {}"
  shows "{g - {x} | g. g \<in> G \<and> g \<noteq> {x}} = {g - {x} | g. g \<in> G } - {{}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {g - {x} |g. g \<in> G \<and> g \<noteq> {x}} = {g - {x} |g. g \<in> G} - {{}}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {g - {x} |g. g \<in> G \<and> g \<noteq> {x}} = {g - {x} |g. g \<in> G} - {{}}
[PROOF STEP]
let ?f = "\<lambda> g . g - {x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {g - {x} |g. g \<in> G \<and> g \<noteq> {x}} = {g - {x} |g. g \<in> G} - {{}}
[PROOF STEP]
have "\<And> g . g \<in> G \<Longrightarrow> g \<noteq> {x} \<longleftrightarrow> ?f g \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. g \<in> G \<Longrightarrow> (g \<noteq> {x}) = (g - {x} \<noteq> {})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?g \<in> G \<Longrightarrow> ?g \<noteq> {}

goal (1 subgoal):
 1. \<And>g. g \<in> G \<Longrightarrow> (g \<noteq> {x}) = (g - {x} \<noteq> {})
[PROOF STEP]
by (metis Diff_cancel Diff_empty Diff_insert0 insert_Diff)
[PROOF STATE]
proof (state)
this:
?g \<in> G \<Longrightarrow> (?g \<noteq> {x}) = (?g - {x} \<noteq> {})

goal (1 subgoal):
 1. {g - {x} |g. g \<in> G \<and> g \<noteq> {x}} = {g - {x} |g. g \<in> G} - {{}}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?g \<in> G \<Longrightarrow> (?g \<noteq> {x}) = (?g - {x} \<noteq> {})

goal (1 subgoal):
 1. {g - {x} |g. g \<in> G \<and> g \<noteq> {x}} = {g - {x} |g. g \<in> G} - {{}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{g - {x} |g. g \<in> G \<and> g \<noteq> {x}} = {g - {x} |g. g \<in> G} - {{}}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma single_set_distinct_sublist: "\<lbrakk>set ys = set x; distinct ys; sublist x ys\<rbrakk> \<Longrightarrow> x = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set ys = set x; distinct ys; sublist x ys\<rbrakk> \<Longrightarrow> x = ys
[PROOF STEP]
unfolding sublist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set ys = set x; distinct ys; \<exists>ps ss. ys = ps @ x @ ss\<rbrakk> \<Longrightarrow> x = ys
[PROOF STEP]
by (metis DiffD2 append.assoc append.left_neutral append.right_neutral list.set_intros(1)
      append_Cons distinct_set_diff neq_Nil_conv distinct_app_trans_l)


[STATEMENT]
lemma vec_eq_0_iff:
  "v = 0\<^sub>v n \<longleftrightarrow> n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0})" (is "?l \<longleftrightarrow> ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v = 0\<^sub>v n) = (n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0::'a}))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v = 0\<^sub>v n \<Longrightarrow> n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0::'a})
 2. n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0::'a}) \<Longrightarrow> v = 0\<^sub>v n
[PROOF STEP]
show "?l \<Longrightarrow> ?r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = 0\<^sub>v n \<Longrightarrow> n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0::'a})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v = 0\<^sub>v n \<Longrightarrow> n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0::'a})

goal (1 subgoal):
 1. n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0::'a}) \<Longrightarrow> v = 0\<^sub>v n
[PROOF STEP]
show "?r \<Longrightarrow> ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0::'a}) \<Longrightarrow> v = 0\<^sub>v n
[PROOF STEP]
by (intro iffI eq_vecI, force simp: set_conv_nth, force)
[PROOF STATE]
proof (state)
this:
n = dim_vec v \<and> (n = 0 \<or> set (list_of_vec v) = {0::'a}) \<Longrightarrow> v = 0\<^sub>v n

goal:
No subgoals!
[PROOF STEP]
qed