[STATEMENT]
lemma linear_plus_norm:
  includes notation_norm
  assumes \<open>linear f\<close>
  shows \<open>\<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
text \<open>
  Explanation: For arbitrary \<^term>\<open>x\<close> and a linear operator \<^term>\<open>f\<close>,
  \<^term>\<open>norm (f \<xi>)\<close> is upper bounded by the maximum of the norms
  of the shifts of \<^term>\<open>f\<close> (i.e., \<^term>\<open>f (x + \<xi>)\<close> and \<^term>\<open>f (x - \<xi>)\<close>).
\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
have \<open>norm (f \<xi>) = norm ( (inverse (of_nat 2)) *\<^sub>R (f (x + \<xi>) - f (x - \<xi>)) )\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> = \<parallel>(f (x + \<xi>) - f (x - \<xi>)) /\<^sub>R real 2\<parallel>
[PROOF STEP]
by (smt add_diff_cancel_left' assms diff_add_cancel diff_diff_add linear_diff midpoint_def
        midpoint_plus_self of_nat_1 of_nat_add one_add_one scaleR_half_double)
[PROOF STATE]
proof (state)
this:
\<parallel>f \<xi>\<parallel> = \<parallel>(f (x + \<xi>) - f (x - \<xi>)) /\<^sub>R real 2\<parallel>

goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>f \<xi>\<parallel> = \<parallel>(f (x + \<xi>) - f (x - \<xi>)) /\<^sub>R real 2\<parallel>

goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
have \<open>\<dots> = inverse (of_nat 2) * norm (f (x + \<xi>) - f (x - \<xi>))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>(f (x + \<xi>) - f (x - \<xi>)) /\<^sub>R real 2\<parallel> = inverse (real 2) * \<parallel>f (x + \<xi>) - f (x - \<xi>)\<parallel>
[PROOF STEP]
using Real_Vector_Spaces.real_normed_vector_class.norm_scaleR
[PROOF STATE]
proof (prove)
using this:
\<parallel>?a *\<^sub>R ?x\<parallel> = \<bar>?a\<bar> * \<parallel>?x\<parallel>

goal (1 subgoal):
 1. \<parallel>(f (x + \<xi>) - f (x - \<xi>)) /\<^sub>R real 2\<parallel> = inverse (real 2) * \<parallel>f (x + \<xi>) - f (x - \<xi>)\<parallel>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>(f (x + \<xi>) - f (x - \<xi>)) /\<^sub>R real 2\<parallel> = inverse (real 2) * \<parallel>f (x + \<xi>) - f (x - \<xi>)\<parallel>

goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>(f (x + \<xi>) - f (x - \<xi>)) /\<^sub>R real 2\<parallel> = inverse (real 2) * \<parallel>f (x + \<xi>) - f (x - \<xi>)\<parallel>

goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
have \<open>\<dots> \<le> inverse (of_nat 2) * (norm (f (x + \<xi>)) + norm (f (x - \<xi>)))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (real 2) * \<parallel>f (x + \<xi>) - f (x - \<xi>)\<parallel> \<le> inverse (real 2) * (\<parallel>f (x + \<xi>)\<parallel> + \<parallel>f (x - \<xi>)\<parallel>)
[PROOF STEP]
by (simp add: norm_triangle_ineq4)
[PROOF STATE]
proof (state)
this:
inverse (real 2) * \<parallel>f (x + \<xi>) - f (x - \<xi>)\<parallel> \<le> inverse (real 2) * (\<parallel>f (x + \<xi>)\<parallel> + \<parallel>f (x - \<xi>)\<parallel>)

goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse (real 2) * \<parallel>f (x + \<xi>) - f (x - \<xi>)\<parallel> \<le> inverse (real 2) * (\<parallel>f (x + \<xi>)\<parallel> + \<parallel>f (x - \<xi>)\<parallel>)

goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
have \<open>\<dots> \<le>  max (norm (f (x + \<xi>))) (norm (f (x - \<xi>)))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (real 2) * (\<parallel>f (x + \<xi>)\<parallel> + \<parallel>f (x - \<xi>)\<parallel>) \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inverse (real 2) * (\<parallel>f (x + \<xi>)\<parallel> + \<parallel>f (x - \<xi>)\<parallel>) \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>

goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>

goal (1 subgoal):
 1. \<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<parallel>f \<xi>\<parallel> \<le> max \<parallel>f (x + \<xi>)\<parallel> \<parallel>f (x - \<xi>)\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in weak_upper_semilattice) finite_sup_closed [simp]:
  "[| finite A; A \<subseteq> carrier L; A \<noteq> {} |] ==> \<Squnion>A \<in> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<subseteq> carrier L; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>A \<in> carrier L
[PROOF STEP]
proof (induct set: finite)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>{} \<subseteq> carrier L; {} \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>{} \<in> carrier L
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier L; F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>F \<in> carrier L; insert x F \<subseteq> carrier L; insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>insert x F \<in> carrier L
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
{} \<subseteq> carrier L
{} \<noteq> {}

goal (2 subgoals):
 1. \<lbrakk>{} \<subseteq> carrier L; {} \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>{} \<in> carrier L
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier L; F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>F \<in> carrier L; insert x F \<subseteq> carrier L; insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>insert x F \<in> carrier L
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{} \<subseteq> carrier L
{} \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
{} \<subseteq> carrier L
{} \<noteq> {}

goal (1 subgoal):
 1. \<Squnion>{} \<in> carrier L
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Squnion>{} \<in> carrier L

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier L; F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>F \<in> carrier L; insert x F \<subseteq> carrier L; insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>insert x F \<in> carrier L
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier L; F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>F \<in> carrier L; insert x F \<subseteq> carrier L; insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>insert x F \<in> carrier L
[PROOF STEP]
case insert
[PROOF STATE]
proof (state)
this:
finite F_
x_ \<notin> F_
\<lbrakk>F_ \<subseteq> carrier L; F_ \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>F_ \<in> carrier L
insert x_ F_ \<subseteq> carrier L
insert x_ F_ \<noteq> {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier L; F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>F \<in> carrier L; insert x F \<subseteq> carrier L; insert x F \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>insert x F \<in> carrier L
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F_
x_ \<notin> F_
\<lbrakk>F_ \<subseteq> carrier L; F_ \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>F_ \<in> carrier L
insert x_ F_ \<subseteq> carrier L
insert x_ F_ \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F_
x_ \<notin> F_
\<lbrakk>F_ \<subseteq> carrier L; F_ \<noteq> {}\<rbrakk> \<Longrightarrow> \<Squnion>F_ \<in> carrier L
insert x_ F_ \<subseteq> carrier L
insert x_ F_ \<noteq> {}

goal (1 subgoal):
 1. \<Squnion>insert x_ F_ \<in> carrier L
[PROOF STEP]
by - (rule finite_sup_insertI, simp_all)
[PROOF STATE]
proof (state)
this:
\<Squnion>insert x_ F_ \<in> carrier L

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma jumpF_pos_has_sgnx:
  assumes "jumpF f F > 0"
  shows "(f has_sgnx 1) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_sgnx 1) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_sgnx 1) F
[PROOF STEP]
have "filterlim f at_top F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < jumpF f F

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
0 < (if filterlim f at_top F then 1 / 2 else if filterlim f at_bot F then - 1 / 2 else 0)

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
filterlim f at_top F

goal (1 subgoal):
 1. (f has_sgnx 1) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top F
[PROOF STEP]
have "eventually (\<lambda>x. f x>0) F"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 < f x
[PROOF STEP]
using filterlim_at_top_dense[of f F]
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F
filterlim f at_top F = (\<forall>Z. \<forall>\<^sub>F x in F. Z < f x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 < f x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. (f has_sgnx 1) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. 0 < f x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. (f has_sgnx 1) F
[PROOF STEP]
unfolding has_sgnx_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. sgn (f x) = 1
[PROOF STEP]
apply (elim eventually_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < f x \<Longrightarrow> sgn (f x) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f has_sgnx 1) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_rev_ffact:
  fixes m :: "'a :: {ord, ring_1, comm_monoid_mult, comm_semiring_1_cancel}"
  shows "(\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
have "inj_on (\<lambda>i. i + 1) {0..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>i. i + 1) {0..<n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>i. i + 1) {0..<n}

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>i. i + 1) {0..<n}

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
have "{1..n} = (\<lambda>i. i + 1) ` {0..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {1..n} = (\<lambda>i. i + 1) ` {0..<n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{1..n} = (\<lambda>i. i + 1) ` {0..<n}

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{1..n} = (\<lambda>i. i + 1) ` {0..<n}

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
have "m - of_nat n + of_nat (i + 1) = m + 1 - of_nat n + of_nat i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m - of_nat n + of_nat (i + 1) = m + (1::'a) - of_nat n + of_nat i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m - of_nat n + of_nat (?i + 1) = m + (1::'a) - of_nat n + of_nat ?i

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on (\<lambda>i. i + 1) {0..<n}
{1..n} = (\<lambda>i. i + 1) ` {0..<n}
m - of_nat n + of_nat (?i + 1) = m + (1::'a) - of_nat n + of_nat ?i
[PROOF STEP]
have "(\<Prod>i = 1..n. m - of_nat n + of_nat i) = (\<Prod>i = 0..<n. m + 1 - of_nat n + of_nat i)"
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>i. i + 1) {0..<n}
{1..n} = (\<lambda>i. i + 1) ` {0..<n}
m - of_nat n + of_nat (?i + 1) = m + (1::'a) - of_nat n + of_nat ?i

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = (\<Prod>i = 0..<n. m + (1::'a) - of_nat n + of_nat i)
[PROOF STEP]
by (rule prod.reindex_cong[where l="\<lambda>i. i + 1"])
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 1..n. m - of_nat n + of_nat i) = (\<Prod>i = 0..<n. m + (1::'a) - of_nat n + of_nat i)

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i = 1..n. m - of_nat n + of_nat i) = (\<Prod>i = 0..<n. m + (1::'a) - of_nat n + of_nat i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 1..n. m - of_nat n + of_nat i) = (\<Prod>i = 0..<n. m + (1::'a) - of_nat n + of_nat i)

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m
[PROOF STEP]
unfolding ffact_def
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 1..n. m - of_nat n + of_nat i) = (\<Prod>i = 0..<n. m + (1::'a) - of_nat n + of_nat i)

goal (1 subgoal):
 1. (\<Prod>i = 1..n. m - of_nat n + of_nat i) = pochhammer (m + (1::'a) - of_nat n) n
[PROOF STEP]
by (simp only: pochhammer_prod)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 1..n. m - of_nat n + of_nat i) = ffact n m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r01_binary_expansion_well_formed:
  assumes "0 < r" "r < 1"
  shows "biexp01_well_formed (r01_binary_expansion' r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. biexp01_well_formed (r01_binary_expansion' r)
[PROOF STEP]
using r01_binary_expression_ex0_strong[of r] assms real01_binary_expansion'_0or1[of r]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < r; r < 1\<rbrakk> \<Longrightarrow> \<exists>i\<ge>?n. r01_binary_expansion' r i = 0
0 < r
r < 1
r01_binary_expansion' r ?n \<in> {0, 1}

goal (1 subgoal):
 1. biexp01_well_formed (r01_binary_expansion' r)
[PROOF STEP]
by(simp add: biexp01_well_formed_def)


[STATEMENT]
lemma fps_integral0_neg:
  fixes a :: "'a::{ring_1,inverse} fps"
  shows "fps_integral0 (-a) = - fps_integral0 a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_integral0 (- a) = - fps_integral0 a
[PROOF STEP]
using fps_integral0_fps_const_mult_right[of a "-1"]
[PROOF STATE]
proof (prove)
using this:
fps_integral0 (a * fps_const (- (1::'a))) = fps_integral0 a * fps_const (- (1::'a))

goal (1 subgoal):
 1. fps_integral0 (- a) = - fps_integral0 a
[PROOF STEP]
by    (simp add: fps_const_neg[symmetric])


[STATEMENT]
lemma key_compare_key_order_of_le:
  "key_compare key_order_of_le = (\<lambda>x y. if x < y then Lt else if x = y then Eq else Gt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. key_compare key_order_of_le = (\<lambda>x y. if x < y then Lt else if x = y then Eq else Gt)
[PROOF STEP]
by (transfer, intro ext, fact comparator_of_def)


[STATEMENT]
lemma finite_dom_comp:
  assumes "finite (dom f)" "inj_on g (dom (f \<circ> g))"
  shows "finite (dom (f \<circ> g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (dom (f \<circ> g))
[PROOF STEP]
proof (rule finite_imageD)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (?f ` dom (f \<circ> g))
 2. inj_on ?f (dom (f \<circ> g))
[PROOF STEP]
have "g ` dom (f \<circ> g) \<subseteq> dom f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` dom (f \<circ> g) \<subseteq> dom f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g ` dom (f \<circ> g) \<subseteq> dom f

goal (2 subgoals):
 1. finite (?f ` dom (f \<circ> g))
 2. inj_on ?f (dom (f \<circ> g))
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
finite (dom f)
g ` dom (f \<circ> g) \<subseteq> dom f
[PROOF STEP]
show "finite (g ` dom (f \<circ> g))"
[PROOF STATE]
proof (prove)
using this:
finite (dom f)
g ` dom (f \<circ> g) \<subseteq> dom f

goal (1 subgoal):
 1. finite (g ` dom (f \<circ> g))
[PROOF STEP]
by - (rule finite_subset)
[PROOF STATE]
proof (state)
this:
finite (g ` dom (f \<circ> g))

goal (1 subgoal):
 1. inj_on g (dom (f \<circ> g))
[PROOF STEP]
qed (simp add:assms(2))


[STATEMENT]
lemma gen_shleg_poly_n: "gen_shleg_poly n = smult (fact n) shleg_poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
obtain r where r: "gen_shleg_poly n = [:fact n:] * r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. local.gen_shleg_poly n = [:fact n:] * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding gen_shleg_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. (pderiv ^^ n) ([:0, 1, - 1:] ^ n) = [:fact n:] * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using fact_dvd_higher_pderiv[of n "[:0,1,-1:]^n"]
[PROOF STATE]
proof (prove)
using this:
[:fact n:] dvd (pderiv ^^ n) ([:0, 1, - 1:] ^ n)

goal (1 subgoal):
 1. (\<And>r. (pderiv ^^ n) ([:0, 1, - 1:] ^ n) = [:fact n:] * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
local.gen_shleg_poly n = [:fact n:] * r

goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
have "smult (fact n) shleg_poly = smult (fact n) (gen_shleg_poly n div [:fact n:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (fact n) local.shleg_poly = Polynomial.smult (fact n) (local.gen_shleg_poly n div [:fact n:])
[PROOF STEP]
by (simp add: shleg_poly_def)
[PROOF STATE]
proof (state)
this:
Polynomial.smult (fact n) local.shleg_poly = Polynomial.smult (fact n) (local.gen_shleg_poly n div [:fact n:])

goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polynomial.smult (fact n) local.shleg_poly = Polynomial.smult (fact n) (local.gen_shleg_poly n div [:fact n:])

goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
note r
[PROOF STATE]
proof (state)
this:
local.gen_shleg_poly n = [:fact n:] * r

goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.gen_shleg_poly n = [:fact n:] * r

goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
have "[:fact n:] * r div [:fact n:] = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:fact n:] * r div [:fact n:] = r
[PROOF STEP]
by (rule nonzero_mult_div_cancel_left) auto
[PROOF STATE]
proof (state)
this:
[:fact n:] * r div [:fact n:] = r

goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Polynomial.smult (fact n) local.shleg_poly = Polynomial.smult (fact n) r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult (fact n) local.shleg_poly = Polynomial.smult (fact n) r

goal (1 subgoal):
 1. local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly
[PROOF STEP]
by (simp add: r)
[PROOF STATE]
proof (state)
this:
local.gen_shleg_poly n = Polynomial.smult (fact n) local.shleg_poly

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma remaining_steps_n_steps_plus [simp]:
  "\<lbrakk>n \<le> remaining_steps states; invar (states :: 'a states)\<rbrakk>
    \<Longrightarrow> remaining_steps ((step ^^ n) states) + n = remaining_steps states"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<le> remaining_steps states; invar states\<rbrakk> \<Longrightarrow> remaining_steps ((step ^^ n) states) + n = remaining_steps states
[PROOF STEP]
by(induction n arbitrary: states)(auto simp: funpow_swap1 invar_step)


[STATEMENT]
lemma sumhr_add: "\<And>m n. sumhr (m, n, f) + sumhr (m, n, g) = sumhr (m, n, \<lambda>i. f i + g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. sumhr (m, n, f) + sumhr (m, n, g) = sumhr (m, n, \<lambda>i. f i + g i)
[PROOF STEP]
unfolding sumhr_app
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. (*f2* (\<lambda>m n. sum f {m..<n})) m n + (*f2* (\<lambda>m n. sum g {m..<n})) m n = (*f2* (\<lambda>m n. \<Sum>i = m..<n. f i + g i)) m n
[PROOF STEP]
by transfer (rule sum.distrib [symmetric])


[STATEMENT]
lemma cmod_eqE:
  assumes "cmod z1 = cmod z2"
  shows "z1 * cnj z1 = z2 * cnj z2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z1 * cnj z1 = z2 * cnj z2
[PROOF STEP]
by (simp add: assms complex_mult_cnj_cmod)


[STATEMENT]
theorem quot_rep: "\<exists>a. A = \<lfloor>a\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
proof (cases A)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>A = Abs_quot y; y \<in> quot\<rbrakk> \<Longrightarrow> \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
fix R
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>A = Abs_quot y; y \<in> quot\<rbrakk> \<Longrightarrow> \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
assume R: "A = Abs_quot R"
[PROOF STATE]
proof (state)
this:
A = Abs_quot R

goal (1 subgoal):
 1. \<And>y. \<lbrakk>A = Abs_quot y; y \<in> quot\<rbrakk> \<Longrightarrow> \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
assume "R \<in> quot"
[PROOF STATE]
proof (state)
this:
R \<in> quot

goal (1 subgoal):
 1. \<And>y. \<lbrakk>A = Abs_quot y; y \<in> quot\<rbrakk> \<Longrightarrow> \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
R \<in> quot
[PROOF STEP]
have "\<exists>a. R = {x. a \<sim> x}"
[PROOF STATE]
proof (prove)
using this:
R \<in> quot

goal (1 subgoal):
 1. \<exists>a. R = {x. a \<sim> x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. R = {x. a \<sim> x}

goal (1 subgoal):
 1. \<And>y. \<lbrakk>A = Abs_quot y; y \<in> quot\<rbrakk> \<Longrightarrow> \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
with R
[PROOF STATE]
proof (chain)
picking this:
A = Abs_quot R
\<exists>a. R = {x. a \<sim> x}
[PROOF STEP]
have "\<exists>a. A = Abs_quot {x. a \<sim> x}"
[PROOF STATE]
proof (prove)
using this:
A = Abs_quot R
\<exists>a. R = {x. a \<sim> x}

goal (1 subgoal):
 1. \<exists>a. A = Abs_quot {x. a \<sim> x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. A = Abs_quot {x. a \<sim> x}

goal (1 subgoal):
 1. \<And>y. \<lbrakk>A = Abs_quot y; y \<in> quot\<rbrakk> \<Longrightarrow> \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. A = Abs_quot {x. a \<sim> x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>a. A = Abs_quot {x. a \<sim> x}

goal (1 subgoal):
 1. \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
by (unfold eqv_class_def)
[PROOF STATE]
proof (state)
this:
\<exists>a. A = \<lfloor>a\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_count_space_nat:
  fixes f :: "nat \<Rightarrow> _::{banach,second_countable_topology}"
  shows "integrable (count_space UNIV) f \<Longrightarrow> integral\<^sup>L (count_space UNIV) f = (\<Sum>x. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (count_space UNIV) f \<Longrightarrow> integral\<^sup>L (count_space UNIV) f = (\<Sum>x. f x)
[PROOF STEP]
using sums_integral_count_space_nat
[PROOF STATE]
proof (prove)
using this:
integrable (count_space UNIV) ?f \<Longrightarrow> ?f sums integral\<^sup>L (count_space UNIV) ?f

goal (1 subgoal):
 1. integrable (count_space UNIV) f \<Longrightarrow> integral\<^sup>L (count_space UNIV) f = (\<Sum>x. f x)
[PROOF STEP]
by (rule sums_unique)


[STATEMENT]
lemma card_sccs_iso[simp]: "card (app_iso hom ` sccs) = card sccs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (app_iso hom ` sccs) = card sccs
[PROOF STEP]
apply (rule card_image)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (app_iso hom) sccs
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. inj_on (app_iso hom) sccs
[PROOF STEP]
apply (rule inj_on_app_iso)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sccs \<subseteq> {H. subgraph H G}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma arctan_double: "\<bar>x\<bar> < 1 \<Longrightarrow> 2 * arctan x = arctan ((2 * x) / (1 - x\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> < 1 \<Longrightarrow> 2 * arctan x = arctan (2 * x / (1 - x\<^sup>2))
[PROOF STEP]
by (metis arctan_add linear mult_2 not_less power2_eq_square)


[STATEMENT]
lemma degree_interpolation_poly:
  shows "degree (interpolation_poly alg xs_ys) \<le> length xs_ys - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (interpolation_poly alg xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
using degree_lagrange_interpolation_poly[of xs_ys]
    degree_newton_interpolation_poly[of xs_ys]
    degree_neville_aitken_interpolation_poly[of xs_ys]
[PROOF STATE]
proof (prove)
using this:
degree (lagrange_interpolation_poly xs_ys) \<le> length xs_ys - 1
degree (newton_interpolation_poly xs_ys) \<le> length xs_ys - 1
degree (neville_aitken_interpolation_poly xs_ys) \<le> length xs_ys - 1

goal (1 subgoal):
 1. degree (interpolation_poly alg xs_ys) \<le> length xs_ys - 1
[PROOF STEP]
by (cases alg, auto)


[STATEMENT]
lemma shift_vars_mult:
  assumes "p \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  assumes "Q \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  shows "shift_vars n m (p \<otimes>\<^bsub>R[\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<otimes>\<^bsub>R[\<X>\<^bsub>n+m\<^esub>]\<^esub> shift_vars n m Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shift_vars n m (p \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<otimes>\<^bsub>R [\<X>\<^bsub>n + m\<^esub>]\<^esub> shift_vars n m Q
[PROOF STEP]
using assms shift_vars_char(1)[of n m]
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
Q \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
ring_hom_ring (R [\<X>\<^bsub>n\<^esub>]) (R [\<X>\<^bsub>n + m\<^esub>]) (shift_vars n m)

goal (1 subgoal):
 1. shift_vars n m (p \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<otimes>\<^bsub>R [\<X>\<^bsub>n + m\<^esub>]\<^esub> shift_vars n m Q
[PROOF STEP]
unfolding ring_hom_ring_def ring_hom_ring_axioms_def
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
Q \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
ring (R [\<X>\<^bsub>n\<^esub>]) \<and> ring (R [\<X>\<^bsub>n + m\<^esub>]) \<and> shift_vars n m \<in> ring_hom (R [\<X>\<^bsub>n\<^esub>]) (R [\<X>\<^bsub>n + m\<^esub>])

goal (1 subgoal):
 1. shift_vars n m (p \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> Q) = shift_vars n m p \<otimes>\<^bsub>R [\<X>\<^bsub>n + m\<^esub>]\<^esub> shift_vars n m Q
[PROOF STEP]
unfolding coord_ring_def
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (Pring R {..<n})
Q \<in> carrier (Pring R {..<n})
ring (Pring R {..<n}) \<and> ring (Pring R {..<n + m}) \<and> shift_vars n m \<in> ring_hom (Pring R {..<n}) (Pring R {..<n + m})

goal (1 subgoal):
 1. shift_vars n m (p \<otimes>\<^bsub>Pring R {..<n}\<^esub> Q) = shift_vars n m p \<otimes>\<^bsub>Pring R {..<n + m}\<^esub> shift_vars n m Q
[PROOF STEP]
using ring_hom_mult
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (Pring R {..<n})
Q \<in> carrier (Pring R {..<n})
ring (Pring R {..<n}) \<and> ring (Pring R {..<n + m}) \<and> shift_vars n m \<in> ring_hom (Pring R {..<n}) (Pring R {..<n + m})
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<otimes>\<^bsub>?R\<^esub> ?y) = ?h ?x \<otimes>\<^bsub>?S\<^esub> ?h ?y

goal (1 subgoal):
 1. shift_vars n m (p \<otimes>\<^bsub>Pring R {..<n}\<^esub> Q) = shift_vars n m p \<otimes>\<^bsub>Pring R {..<n + m}\<^esub> shift_vars n m Q
[PROOF STEP]
by metis


[STATEMENT]
lemma GreekMortal :
  assumes  "Mortal Q Human" and "Human Q Greek "
  shows " Mortal Q Greek "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mortal Q Greek
[PROOF STEP]
using assms Barbara
[PROOF STATE]
proof (prove)
using this:
Mortal Q Human
Human Q Greek
\<lbrakk>?A Q ?B; ?B Q ?C\<rbrakk> \<Longrightarrow> ?A Q ?C

goal (1 subgoal):
 1. Mortal Q Greek
[PROOF STEP]
by auto


[STATEMENT]
lemma adjoint_dim_col [simp]:
  "dim_col (adjoint A) = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (adjoint A) = dim_row A
[PROOF STEP]
by (simp add: mat_adjoint_def)


[STATEMENT]
theorem exEE: "\<turnstile> (\<exists>x. \<diamond>(F x)) = \<diamond>(\<exists>x. F x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (\<exists>x. \<diamond>F x) = \<diamond>(\<exists>x. F x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> (\<exists>x. \<diamond>F x) = \<diamond>(\<exists>x. F x)
[PROOF STEP]
have "\<turnstile> \<not>(\<exists> x. \<diamond>(F x)) = \<not>\<diamond>(\<exists> x. F x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<not> (\<exists>x. \<diamond>F x) = \<not> \<diamond>(\<exists>x. F x)
[PROOF STEP]
by (auto simp: eventually_def Not_Rex[int_rewrite] allBox)
[PROOF STATE]
proof (state)
this:
\<turnstile> \<not> (\<exists>x. \<diamond>F x) = \<not> \<diamond>(\<exists>x. F x)

goal (1 subgoal):
 1. \<turnstile> (\<exists>x. \<diamond>F x) = \<diamond>(\<exists>x. F x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<not> (\<exists>x. \<diamond>F x) = \<not> \<diamond>(\<exists>x. F x)

goal (1 subgoal):
 1. \<turnstile> (\<exists>x. \<diamond>F x) = \<diamond>(\<exists>x. F x)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<turnstile> (\<exists>x. \<diamond>F x) = \<diamond>(\<exists>x. F x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma numeral_not_Infinitesimal [simp]:
  "numeral w \<noteq> (0::hcomplex) \<Longrightarrow> (numeral w::hcomplex) \<notin> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral w \<noteq> 0 \<Longrightarrow> numeral w \<notin> Infinitesimal
[PROOF STEP]
by (fast dest: Standard_numeral [THEN SComplex_Infinitesimal_zero])


[STATEMENT]
lemma ln_ln_pos:
  assumes "(x::real) \<ge> 3"
  shows   "ln (ln x) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < ln (ln x)
[PROOF STEP]
proof (subst ln_gt_zero_iff)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ln x
 2. 1 < ln x
[PROOF STEP]
from assms exp_1_lt_3
[PROOF STATE]
proof (chain)
picking this:
3 \<le> x
exp 1 < 3
[PROOF STEP]
have "ln x > ln (exp 1)"
[PROOF STATE]
proof (prove)
using this:
3 \<le> x
exp 1 < 3

goal (1 subgoal):
 1. ln (exp 1) < ln x
[PROOF STEP]
by (intro ln_mono_strict) simp_all
[PROOF STATE]
proof (state)
this:
ln (exp 1) < ln x

goal (2 subgoals):
 1. 0 < ln x
 2. 1 < ln x
[PROOF STEP]
thus "ln x > 0" "ln x > 1"
[PROOF STATE]
proof (prove)
using this:
ln (exp 1) < ln x

goal (1 subgoal):
 1. 0 < ln x &&& 1 < ln x
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 < ln x
1 < ln x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma binUNIV_card: "card binUNIV = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card binUNIV = 2
[PROOF STEP]
unfolding bin_UNIV card_2_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. {bin0, bin1} = {x, y} \<and> x \<noteq> y
[PROOF STEP]
by auto


[STATEMENT]
lemma succ_eq_add1: "succ x = x + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.succ x = x + 1
[PROOF STEP]
by (simp add: plus_V_succ_right one_V_def)


[STATEMENT]
lemma residue_group_simple:
  assumes "prime p" and "subgroup H {0..(p :: nat)-1} (\<lambda> x y. ((x + y) mod p)) (0 :: int)"
  shows "H = {0} \<or> H = {0..int(p-1)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H = {0} \<or> H = {0..int (p - 1)}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H = {0} \<or> H = {0..int (p - 1)}
[PROOF STEP]
have hprime: "prime (card {0..int(p-1)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime (card {0..int (p - 1)})
[PROOF STEP]
using card_atLeastAtMost_int assms int_ops
[PROOF STATE]
proof (prove)
using this:
card {?l..?u} = nat (?u - ?l + 1)
prime p
subgroup H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0
int 0 = 0
int 1 = 1
int (numeral ?n) = numeral ?n
int (Suc ?a) = int ?a + 1
int (?a + ?b) = int ?a + int ?b
int (?a - ?b) = (if int ?a < int ?b then 0 else int ?a - int ?b)
int (?a * ?b) = int ?a * int ?b
int (?a div ?b) = int ?a div int ?b
int (?a mod ?b) = int ?a mod int ?b

goal (1 subgoal):
 1. prime (card {0..int (p - 1)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime (card {0..int (p - 1)})

goal (1 subgoal):
 1. H = {0} \<or> H = {0..int (p - 1)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prime (card {0..int (p - 1)})

goal (1 subgoal):
 1. H = {0} \<or> H = {0..int (p - 1)}
[PROOF STEP]
have hsub:"subgroup_of_group H {0..(p :: nat)-1} (\<lambda> x y. ((x + y) mod p)) (0 :: int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup_of_group H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0
[PROOF STEP]
using subgroup_of_group_def assms abelian_group_def residue_group
[PROOF STATE]
proof (prove)
using this:
subgroup_of_group ?H ?G ?composition ?unit \<equiv> subgroup ?H ?G ?composition ?unit \<and> Group_Theory.group ?G ?composition ?unit
prime p
subgroup H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0
abelian_group ?G ?composition ?unit \<equiv> Group_Theory.group ?G ?composition ?unit \<and> commutative_monoid ?G ?composition ?unit
abelian_group {0..int (?m - 1)} (\<lambda>x y. (x + y) mod int ?m) 0

goal (1 subgoal):
 1. subgroup_of_group H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
subgroup_of_group H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0

goal (1 subgoal):
 1. H = {0} \<or> H = {0..int (p - 1)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
prime (card {0..int (p - 1)})
subgroup_of_group H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime (card {0..int (p - 1)})
subgroup_of_group H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0

goal (1 subgoal):
 1. H = {0} \<or> H = {0..int (p - 1)}
[PROOF STEP]
using assms subgroup_of_group.prime_order_simple[OF hsub hprime]
[PROOF STATE]
proof (prove)
using this:
prime (card {0..int (p - 1)})
subgroup_of_group H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0
prime p
subgroup H {0..int (p - 1)} (\<lambda>x y. (x + y) mod int p) 0
H = {0} \<or> H = {0..int (p - 1)}

goal (1 subgoal):
 1. H = {0} \<or> H = {0..int (p - 1)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
H = {0} \<or> H = {0..int (p - 1)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma d_delta_arctan_upper_11_pos: "x \<noteq> 0 \<Longrightarrow> diff_delta_arctan_upper_11 x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> 0 < diff_delta_arctan_upper_11 x
[PROOF STEP]
unfolding diff_delta_arctan_upper_11_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> 0 < 1 / (x\<^sup>2 * (1 + x\<^sup>2))
[PROOF STEP]
by (simp add: divide_simps zero_less_mult_iff add_pos_pos)


[STATEMENT]
lemma ENR_rel_frontier_convex:
  fixes S :: "'a::euclidean_space set"
  assumes "bounded S" "convex S"
    shows "ENR(rel_frontier S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ENR (rel_frontier S)
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> ENR (rel_frontier S)
 2. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> ENR (rel_frontier S)
 2. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {}

goal (1 subgoal):
 1. ENR (rel_frontier S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ENR (rel_frontier S)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
bounded S
convex S
S \<noteq> {}
[PROOF STEP]
have "rel_interior S \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
bounded S
convex S
S \<noteq> {}

goal (1 subgoal):
 1. rel_interior S \<noteq> {}
[PROOF STEP]
by (simp add: rel_interior_eq_empty)
[PROOF STATE]
proof (state)
this:
rel_interior S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_interior S \<noteq> {}
[PROOF STEP]
obtain a where a: "a \<in> rel_interior S"
[PROOF STATE]
proof (prove)
using this:
rel_interior S \<noteq> {}

goal (1 subgoal):
 1. (\<And>a. a \<in> rel_interior S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> rel_interior S

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
have ahS: "affine hull S - {a} \<subseteq> {x. closest_point (affine hull S) x \<noteq> a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S - {a} \<subseteq> {x. closest_point (affine hull S) x \<noteq> a}
[PROOF STEP]
by (auto simp: closest_point_self)
[PROOF STATE]
proof (state)
this:
affine hull S - {a} \<subseteq> {x. closest_point (affine hull S) x \<noteq> a}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
have "rel_frontier S retract_of affine hull S - {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier S retract_of affine hull S - {a}
[PROOF STEP]
by (simp add: assms a rel_frontier_retract_of_punctured_affine_hull)
[PROOF STATE]
proof (state)
this:
rel_frontier S retract_of affine hull S - {a}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rel_frontier S retract_of affine hull S - {a}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
have "\<dots> retract_of {x. closest_point (affine hull S) x \<noteq> a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S - {a} retract_of {x. closest_point (affine hull S) x \<noteq> a}
[PROOF STEP]
unfolding retract_of_def retraction_def ahS
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r. affine hull S - {a} \<subseteq> {x. closest_point (affine hull S) x \<noteq> a} \<and> continuous_on {x. closest_point (affine hull S) x \<noteq> a} r \<and> r ` {x. closest_point (affine hull S) x \<noteq> a} \<subseteq> affine hull S - {a} \<and> (\<forall>x\<in>affine hull S - {a}. r x = x)
[PROOF STEP]
apply (rule_tac x="closest_point (affine hull S)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S - {a} \<subseteq> {x. closest_point (affine hull S) x \<noteq> a} \<and> continuous_on {x. closest_point (affine hull S) x \<noteq> a} (closest_point (affine hull S)) \<and> closest_point (affine hull S) ` {x. closest_point (affine hull S) x \<noteq> a} \<subseteq> affine hull S - {a} \<and> (\<forall>x\<in>affine hull S - {a}. closest_point (affine hull S) x = x)
[PROOF STEP]
apply (auto simp: False closest_point_self affine_imp_convex closest_point_in_set continuous_on_closest_point)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
affine hull S - {a} retract_of {x. closest_point (affine hull S) x \<noteq> a}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rel_frontier S retract_of {x. closest_point (affine hull S) x \<noteq> a}
[PROOF STEP]
have "rel_frontier S retract_of {x. closest_point (affine hull S) x \<noteq> a}"
[PROOF STATE]
proof (prove)
using this:
rel_frontier S retract_of {x. closest_point (affine hull S) x \<noteq> a}

goal (1 subgoal):
 1. rel_frontier S retract_of {x. closest_point (affine hull S) x \<noteq> a}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rel_frontier S retract_of {x. closest_point (affine hull S) x \<noteq> a}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rel_frontier S retract_of {x. closest_point (affine hull S) x \<noteq> a}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
have "openin (top_of_set UNIV) (UNIV \<inter> closest_point (affine hull S) -` (- {a}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set UNIV) (UNIV \<inter> closest_point (affine hull S) -` (- {a}))
[PROOF STEP]
by (intro continuous_openin_preimage_gen) (auto simp: False affine_imp_convex continuous_on_closest_point)
[PROOF STATE]
proof (state)
this:
openin (top_of_set UNIV) (UNIV \<inter> closest_point (affine hull S) -` (- {a}))

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ENR (rel_frontier S)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rel_frontier S retract_of {x. closest_point (affine hull S) x \<noteq> a}
openin (top_of_set UNIV) (UNIV \<inter> closest_point (affine hull S) -` (- {a}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rel_frontier S retract_of {x. closest_point (affine hull S) x \<noteq> a}
openin (top_of_set UNIV) (UNIV \<inter> closest_point (affine hull S) -` (- {a}))

goal (1 subgoal):
 1. ENR (rel_frontier S)
[PROOF STEP]
by (meson ENR_convex_closed ENR_delete ENR_retract_of_ENR \<open>rel_frontier S retract_of affine hull S - {a}\<close>
              closed_affine_hull convex_affine_hull)
[PROOF STATE]
proof (state)
this:
ENR (rel_frontier S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Polygamma_approx_2_real:
  assumes "x > (0::real)" "m > 0"
  shows   "Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
have "Polygamma_approx (Suc (Suc 0)) m x = deriv (Polygamma_approx (Suc 0) m) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = deriv (Polygamma_approx (Suc 0) m) x
[PROOF STEP]
by (simp add: Polygamma_approx_Suc)
[PROOF STATE]
proof (state)
this:
Polygamma_approx (Suc (Suc 0)) m x = deriv (Polygamma_approx (Suc 0) m) x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polygamma_approx (Suc (Suc 0)) m x = deriv (Polygamma_approx (Suc 0) m) x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
have "\<dots> = deriv (\<lambda>x. ln x - 1 / (2*x) + stirling_sum (Suc 0) m x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (Polygamma_approx (Suc 0) m) x = deriv (\<lambda>x. ln x - 1 / (2 * x) + stirling_sum (Suc 0) m x) x
[PROOF STEP]
using eventually_nhds_in_open[of "{0<..}" x] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open {0<..}; x \<in> {0<..}\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F y in nhds x. y \<in> {0<..}
0 < x
0 < m

goal (1 subgoal):
 1. deriv (Polygamma_approx (Suc 0) m) x = deriv (\<lambda>x. ln x - 1 / (2 * x) + stirling_sum (Suc 0) m x) x
[PROOF STEP]
by (intro deriv_cong_ev) (auto elim!: eventually_mono simp: Polygamma_approx_1_real)
[PROOF STATE]
proof (state)
this:
deriv (Polygamma_approx (Suc 0) m) x = deriv (\<lambda>x. ln x - 1 / (2 * x) + stirling_sum (Suc 0) m x) x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deriv (Polygamma_approx (Suc 0) m) x = deriv (\<lambda>x. ln x - 1 / (2 * x) + stirling_sum (Suc 0) m x) x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
have "\<dots> = 1 / x + 1 / (2*x^2) + stirling_sum (Suc (Suc 0)) m x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. ln x - 1 / (2 * x) + stirling_sum (Suc 0) m x) x = 1 / x + 1 / (2 * x\<^sup>2) + stirling_sum (Suc (Suc 0)) m x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m

goal (1 subgoal):
 1. deriv (\<lambda>x. ln x - 1 / (2 * x) + stirling_sum (Suc 0) m x) x = 1 / x + 1 / (2 * x\<^sup>2) + stirling_sum (Suc (Suc 0)) m x
[PROOF STEP]
by (intro DERIV_imp_deriv) (auto intro!: derivative_eq_intros
           elim!: nonpos_Reals_cases simp: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. ln x - 1 / (2 * x) + stirling_sum (Suc 0) m x) x = 1 / x + 1 / (2 * x\<^sup>2) + stirling_sum (Suc (Suc 0)) m x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. ln x - 1 / (2 * x) + stirling_sum (Suc 0) m x) x = 1 / x + 1 / (2 * x\<^sup>2) + stirling_sum (Suc (Suc 0)) m x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
have "\<dots> = stirling_sum' 1 m x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / x + 1 / (2 * x\<^sup>2) + stirling_sum (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
using stirling_sum_2_conv_stirling_sum'_1[of m x] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < m; x \<noteq> 0\<rbrakk> \<Longrightarrow> stirling_sum' 1 m x = 1 / x + 1 / (2 * x\<^sup>2) + stirling_sum 2 m x
0 < x
0 < m

goal (1 subgoal):
 1. 1 / x + 1 / (2 * x\<^sup>2) + stirling_sum (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
by (simp add: eval_nat_numeral)
[PROOF STATE]
proof (state)
this:
1 / x + 1 / (2 * x\<^sup>2) + stirling_sum (Suc (Suc 0)) m x = stirling_sum' 1 m x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' 1 m x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma choose_3:
  assumes "card S = 3"
  shows "\<exists> x y z. S = {x,y,z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y z. S = {x, y, z}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x y z. S = {x, y, z}
[PROOF STEP]
from \<open>card S = 3\<close> and card_eq_SucD [of S 2]
[PROOF STATE]
proof (chain)
picking this:
card S = 3
card S = Suc 2 \<Longrightarrow> \<exists>b B. S = insert b B \<and> b \<notin> B \<and> card B = 2 \<and> (2 = 0 \<longrightarrow> B = {})
[PROOF STEP]
obtain x and T where "S = insert x T" and "card T = 2"
[PROOF STATE]
proof (prove)
using this:
card S = 3
card S = Suc 2 \<Longrightarrow> \<exists>b B. S = insert b B \<and> b \<notin> B \<and> card B = 2 \<and> (2 = 0 \<longrightarrow> B = {})

goal (1 subgoal):
 1. (\<And>x T. \<lbrakk>S = insert x T; card T = 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S = insert x T
card T = 2

goal (1 subgoal):
 1. \<exists>x y z. S = {x, y, z}
[PROOF STEP]
from \<open>card T = 2\<close> and choose_2 [of T]
[PROOF STATE]
proof (chain)
picking this:
card T = 2
card T = 2 \<Longrightarrow> \<exists>x y. T = {x, y}
[PROOF STEP]
obtain y and z where "T = {y,z}"
[PROOF STATE]
proof (prove)
using this:
card T = 2
card T = 2 \<Longrightarrow> \<exists>x y. T = {x, y}

goal (1 subgoal):
 1. (\<And>y z. T = {y, z} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
T = {y, z}

goal (1 subgoal):
 1. \<exists>x y z. S = {x, y, z}
[PROOF STEP]
with \<open>S = insert x T\<close>
[PROOF STATE]
proof (chain)
picking this:
S = insert x T
T = {y, z}
[PROOF STEP]
have "S = {x,y,z}"
[PROOF STATE]
proof (prove)
using this:
S = insert x T
T = {y, z}

goal (1 subgoal):
 1. S = {x, y, z}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S = {x, y, z}

goal (1 subgoal):
 1. \<exists>x y z. S = {x, y, z}
[PROOF STEP]
thus "\<exists> x y z. S = {x,y,z}"
[PROOF STATE]
proof (prove)
using this:
S = {x, y, z}

goal (1 subgoal):
 1. \<exists>x y z. S = {x, y, z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x y z. S = {x, y, z}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma picard_lindeloef_affine:
  fixes A :: "real \<Rightarrow> 'a::{banach,real_normed_algebra_1,heine_borel}^'n^'n"
  assumes Ahyp: "matrix_continuous_on T A"
      and "\<And>\<tau> \<epsilon>. \<tau> \<in> T \<Longrightarrow> \<epsilon> > 0 \<Longrightarrow> bdd_above {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. dist \<tau> t \<le> \<epsilon>}"
      and Bhyp: "continuous_on T B" and "open S"
      and "t\<^sub>0 \<in> T" and Thyp: "open T" "is_interval T"
    shows "picard_lindeloef (\<lambda> t s. A t *v s + B t) T S t\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. picard_lindeloef (\<lambda>t s. A t *v s + B t) T S t\<^sub>0
[PROOF STEP]
apply (unfold_locales, simp_all add: assms, clarsimp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. s \<in> S \<Longrightarrow> continuous_on T (\<lambda>t. A t *v s + B t)
 2. local_lipschitz T S (\<lambda>t s. A t *v s + B t)
[PROOF STEP]
apply (rule continuous_on_add[OF continuous_on_matrix_vector_multl[OF Ahyp] Bhyp])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. A t *v s + B t)
[PROOF STEP]
by (rule local_lipschitz_affine) (simp_all add: assms)


[STATEMENT]
lemma eventually_at_snd:
  assumes "eventually P (at (snd x))"
  assumes "P (snd x)"
  shows "eventually (\<lambda>h. P (snd h)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F h in at x. P (snd h)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
eventually P (at (snd x))
P (snd x)

goal (1 subgoal):
 1. \<forall>\<^sub>F h in at x. P (snd h)
[PROOF STEP]
unfolding eventually_at_topological
[PROOF STATE]
proof (prove)
using this:
\<exists>S. open S \<and> snd x \<in> S \<and> (\<forall>xa\<in>S. xa \<noteq> snd x \<longrightarrow> xa \<in> UNIV \<longrightarrow> P xa)
P (snd x)

goal (1 subgoal):
 1. \<exists>S. open S \<and> x \<in> S \<and> (\<forall>xa\<in>S. xa \<noteq> x \<longrightarrow> xa \<in> UNIV \<longrightarrow> P (snd xa))
[PROOF STEP]
by (metis open_vimage_snd rangeI range_snd vimageE vimageI)


[STATEMENT]
lemma p_recurrence''': "k > 3 \<Longrightarrow> p k = p (k-3) / 6 + p (k-2) / 2 + p (k-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 < k \<Longrightarrow> p k = p (k - 3) / 6 + p (k - 2) / 2 + p (k - 1)
[PROOF STEP]
using p_recurrence''[of k]
[PROOF STATE]
proof (prove)
using this:
3 < k \<Longrightarrow> p k = - (\<Sum>i = 1..3. (- 1) ^ i * e i * p (k - i))

goal (1 subgoal):
 1. 3 < k \<Longrightarrow> p k = p (k - 3) / 6 + p (k - 2) / 2 + p (k - 1)
[PROOF STEP]
by (simp add: atLeastAtMost_nat_numeral)


[STATEMENT]
lemma mat_inv_mult_sm:
  assumes "k \<noteq> 0"
  shows "mat_inv (k *\<^sub>s\<^sub>m A) = (1 / k) *\<^sub>s\<^sub>m mat_inv A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_inv (k *\<^sub>s\<^sub>m A) = (1 / k) *\<^sub>s\<^sub>m mat_inv A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_inv (k *\<^sub>s\<^sub>m A) = (1 / k) *\<^sub>s\<^sub>m mat_inv A
[PROOF STEP]
obtain a b c d where "A = (a, b, c, d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b c d. A = (a, b, c, d) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases A) auto
[PROOF STATE]
proof (state)
this:
A = (a, b, c, d)

goal (1 subgoal):
 1. mat_inv (k *\<^sub>s\<^sub>m A) = (1 / k) *\<^sub>s\<^sub>m mat_inv A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A = (a, b, c, d)

goal (1 subgoal):
 1. mat_inv (k *\<^sub>s\<^sub>m A) = (1 / k) *\<^sub>s\<^sub>m mat_inv A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A = (a, b, c, d)
k \<noteq> 0

goal (1 subgoal):
 1. mat_inv (k *\<^sub>s\<^sub>m A) = (1 / k) *\<^sub>s\<^sub>m mat_inv A
[PROOF STEP]
by auto (subst mult.assoc[of k a "k*d"], subst mult.assoc[of k b "k*c"], subst right_diff_distrib[of k "a*(k*d)" "b*(k*c)", symmetric], simp, simp add: field_simps)+
[PROOF STATE]
proof (state)
this:
mat_inv (k *\<^sub>s\<^sub>m A) = (1 / k) *\<^sub>s\<^sub>m mat_inv A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_integral_delta:
  assumes "m \<noteq> -1"
  shows
    "fls_integral (Abs_fls (\<lambda>n. if n=m then c else 0)) =
      Abs_fls (\<lambda>n. if n=m+1 then inverse (of_int (m+1)) * c else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (Abs_fls (\<lambda>n. if n = m then c else (0::'a))) = Abs_fls (\<lambda>n. if n = m + 1 then inverse (of_int (m + 1)) * c else (0::'a))
[PROOF STEP]
using   assms
[PROOF STATE]
proof (prove)
using this:
m \<noteq> - 1

goal (1 subgoal):
 1. fls_integral (Abs_fls (\<lambda>n. if n = m then c else (0::'a))) = Abs_fls (\<lambda>n. if n = m + 1 then inverse (of_int (m + 1)) * c else (0::'a))
[PROOF STEP]
by      (intro fls_eqI) auto


[STATEMENT]
lemma orthonormal_system_eq: "orthonormal_system S w \<Longrightarrow> l2product S (w m) (w n) = (if m = n then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthonormal_system S w \<Longrightarrow> l2product S (w m) (w n) = (if m = n then 1 else 0)
[PROOF STEP]
by (simp add: orthonormal_system_def)


[STATEMENT]
lemma infsetsum_mono_neutral_right:
  fixes f g :: "'a \<Rightarrow> real"
  assumes "f abs_summable_on A" and "g abs_summable_on B"
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<le> g x"
  assumes "B \<subseteq> A"
  assumes "\<And>x. x \<in> A - B \<Longrightarrow> f x \<le> 0"
  shows   "infsetsum f A \<le> infsetsum g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsetsum f A \<le> infsetsum g B
[PROOF STEP]
using \<open>B \<subseteq> A\<close>
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> A

goal (1 subgoal):
 1. infsetsum f A \<le> infsetsum g B
[PROOF STEP]
by (intro infsetsum_mono_neutral assms) auto


[STATEMENT]
lemma ccSUP_mono:
  "countable A \<Longrightarrow> countable B \<Longrightarrow> (\<And>n. n \<in> A \<Longrightarrow> \<exists>m\<in>B. f n \<le> g m) \<Longrightarrow> (SUP n\<in>A. f n) \<le> (SUP n\<in>B. g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; countable B; \<And>n. n \<in> A \<Longrightarrow> \<exists>m\<in>B. f n \<le> g m\<rbrakk> \<Longrightarrow> Sup (f ` A) \<le> Sup (g ` B)
[PROOF STEP]
using ccSup_mono [of "g ` B" "f ` A"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable (g ` B); countable (f ` A); \<And>a. a \<in> f ` A \<Longrightarrow> \<exists>b\<in>g ` B. a \<le> b\<rbrakk> \<Longrightarrow> Sup (f ` A) \<le> Sup (g ` B)

goal (1 subgoal):
 1. \<lbrakk>countable A; countable B; \<And>n. n \<in> A \<Longrightarrow> \<exists>m\<in>B. f n \<le> g m\<rbrakk> \<Longrightarrow> Sup (f ` A) \<le> Sup (g ` B)
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_IVT_pos: "a < b \<Longrightarrow> poly p a < 0 \<Longrightarrow> 0 < poly p b \<Longrightarrow> \<exists>x. a < x \<and> x < b \<and> poly p x = 0"
  for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; poly p a < 0; 0 < poly p b\<rbrakk> \<Longrightarrow> \<exists>x>a. x < b \<and> poly p x = 0
[PROOF STEP]
using IVT [of "poly p" a 0 b]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>poly p a \<le> 0; 0 \<le> poly p b; a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont (poly p) x\<rbrakk> \<Longrightarrow> \<exists>x\<ge>a. x \<le> b \<and> poly p x = 0

goal (1 subgoal):
 1. \<lbrakk>a < b; poly p a < 0; 0 < poly p b\<rbrakk> \<Longrightarrow> \<exists>x>a. x < b \<and> poly p x = 0
[PROOF STEP]
by (auto simp add: order_le_less)


[STATEMENT]
lemma invariance_of_domain_gen:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "open S" "continuous_on S f" "inj_on f S" "DIM('b) \<le> DIM('a)"
    shows "open(f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` S)
[PROOF STEP]
using invariance_of_domain_subspaces [of UNIV S UNIV f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>openin (top_of_set UNIV) S; subspace UNIV; subspace UNIV; dim UNIV \<le> dim UNIV; continuous_on S f; f ` S \<subseteq> UNIV; inj_on f S\<rbrakk> \<Longrightarrow> openin (top_of_set UNIV) (f ` S)
open S
continuous_on S f
inj_on f S
DIM('b) \<le> DIM('a)

goal (1 subgoal):
 1. open (f ` S)
[PROOF STEP]
by auto


[STATEMENT]
lemma vector_mul_eq_0[simp]: "(a *s x = 0) \<longleftrightarrow> a = (0::'a::idom) \<or> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *s x = 0) = (a = (0::'a) \<or> x = 0)
[PROOF STEP]
by vector


[STATEMENT]
lemma ln_prod: "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i > 0) \<Longrightarrow> ln (prod f I) = sum (\<lambda>x. ln(f x)) I"
  for f :: "'a \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> 0 < f i\<rbrakk> \<Longrightarrow> ln (prod f I) = (\<Sum>x\<in>I. ln (f x))
[PROOF STEP]
by (induct I rule: finite_induct) (auto simp: ln_mult prod_pos)


[STATEMENT]
lemma eventually_int_real_at_bot:
  assumes "eventually P (at_bot :: real filter)"
  shows   "eventually (\<lambda>x. P (of_int x)) (at_bot :: int filter)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_bot. P (real_of_int x)
[PROOF STEP]
using assms filterlim_of_int_at_bot filterlim_iff filterlim_real_of_int_at_bot
[PROOF STATE]
proof (prove)
using this:
eventually P at_bot
filterlim ?f ?F at_bot \<Longrightarrow> LIM x at_bot. ?f (real_of_int x) :> ?F
filterlim ?f ?F2.0 ?F1.0 = (\<forall>P. eventually P ?F2.0 \<longrightarrow> (\<forall>\<^sub>F x in ?F1.0. P (?f x)))
filterlim real_of_int at_bot at_bot

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_bot. P (real_of_int x)
[PROOF STEP]
by blast


[STATEMENT]
lemma tendsto_def:
   "(f \<longlongrightarrow> l) F \<longleftrightarrow> (\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> eventually (\<lambda>x. f x \<in> S) F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) F = (\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> S))
[PROOF STEP]
unfolding nhds_def filterlim_INF filterlim_principal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>b\<in>{S. open S \<and> l \<in> S}. \<forall>\<^sub>F x in F. f x \<in> b) = (\<forall>S. open S \<longrightarrow> l \<in> S \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> S))
[PROOF STEP]
by auto


[STATEMENT]
lemma equiv_trans: "equiv V R \<Longrightarrow> (x,y)\<in>R \<Longrightarrow> (y,z)\<in>R \<Longrightarrow> (x,z)\<in>R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>equiv V R; (x, y) \<in> R; (y, z) \<in> R\<rbrakk> \<Longrightarrow> (x, z) \<in> R
[PROOF STEP]
by (metis equiv_def transD)


[STATEMENT]
lemma isDiagonal_Diagonal_to_Smith_row_i:
  assumes "isDiagonal A" and "i < min (nrows A) (ncols A)"
  shows "isDiagonal (Diagonal_to_Smith_row_i A i bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isDiagonal (Diagonal_to_Smith_row_i A i bezout)
[PROOF STEP]
using assms isDiagonal_diagonal_to_Smith_i
[PROOF STATE]
proof (prove)
using this:
isDiagonal A
i < min (nrows A) (ncols A)
\<lbrakk>isDiagonal ?A; \<forall>x. x \<in> set ?xs \<longrightarrow> x < min (nrows ?A) (ncols ?A); ?i < min (nrows ?A) (ncols ?A)\<rbrakk> \<Longrightarrow> isDiagonal (diagonal_to_Smith_i ?xs ?A ?i ?bezout)

goal (1 subgoal):
 1. isDiagonal (Diagonal_to_Smith_row_i A i bezout)
[PROOF STEP]
unfolding Diagonal_to_Smith_row_i_def
[PROOF STATE]
proof (prove)
using this:
isDiagonal A
i < min (nrows A) (ncols A)
\<lbrakk>isDiagonal ?A; \<forall>x. x \<in> set ?xs \<longrightarrow> x < min (nrows ?A) (ncols ?A); ?i < min (nrows ?A) (ncols ?A)\<rbrakk> \<Longrightarrow> isDiagonal (diagonal_to_Smith_i ?xs ?A ?i ?bezout)

goal (1 subgoal):
 1. isDiagonal (diagonal_to_Smith_i [i + 1..<min (nrows A) (ncols A)] A i bezout)
[PROOF STEP]
by force


[STATEMENT]
lemma less_imp_Suc_mult_pred_less: "\<lbrakk> m < n; 0 < k \<rbrakk> \<Longrightarrow> Suc m * k - Suc 0 < n * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m < n; 0 < k\<rbrakk> \<Longrightarrow> Suc m * k - Suc 0 < n * k
[PROOF STEP]
apply (rule Suc_le_lessD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m < n; 0 < k\<rbrakk> \<Longrightarrow> Suc (Suc m * k - Suc 0) \<le> n * k
[PROOF STEP]
apply (simp only: Suc_pred[OF nat_0_less_mult_iff[THEN iffD2, OF conjI, OF zero_less_Suc]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m < n; 0 < k\<rbrakk> \<Longrightarrow> Suc m * k \<le> n * k
[PROOF STEP]
apply (rule less_imp_Suc_mult_le, assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma formulaTrueAssociativity:
  fixes f1 :: Formula and f2 :: Formula and f3 :: Formula and valuation :: Valuation
  shows "formulaTrue ((f1 @ f2) @ f3) valuation = formulaTrue (f1 @ (f2 @ f3)) valuation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. formulaTrue ((f1 @ f2) @ f3) valuation = formulaTrue (f1 @ f2 @ f3) valuation
[PROOF STEP]
by (auto simp add:formulaTrueIffAllClausesAreTrue)


[STATEMENT]
lemma prod_le_prodinf:
  fixes f :: "nat \<Rightarrow> 'a::{linordered_idom,linorder_topology}"
  assumes "f has_prod a" "\<And>i. 0 \<le> f i" "\<And>i. i\<ge>n \<Longrightarrow> 1 \<le> f i"
  shows "prod f {..<n} \<le> prodinf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f {..<n} \<le> prodinf f
[PROOF STEP]
by(rule has_prod_le[OF has_prod_If_finite_set]) (use assms has_prod_unique in auto)


[STATEMENT]
lemma Quadratic_Reciprocity:
  "Legendre p q * Legendre q p = (-1::int) ^ ((p - 1) div 2 * ((q - 1) div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Legendre (int p) (int q) * Legendre (int q) (int p) = (- 1) ^ ((p - 1) div 2 * ((q - 1) div 2))
[PROOF STEP]
using Gpq Gqp GAUSS.gauss_lemma power_add[of "-1::int" m n] QR_lemma_14
[PROOF STATE]
proof (prove)
using this:
GAUSS p (int q)
GAUSS q (int p)
GAUSS ?p ?a \<Longrightarrow> Legendre ?a (int ?p) = (- 1) ^ card (GAUSS.E ?p ?a)
(- 1) ^ (m + n) = (- 1) ^ m * (- 1) ^ n
(- 1) ^ (m + n) = (- 1) ^ r

goal (1 subgoal):
 1. Legendre (int p) (int q) * Legendre (int q) (int p) = (- 1) ^ ((p - 1) div 2 * ((q - 1) div 2))
[PROOF STEP]
unfolding r_def m_def n_def
[PROOF STATE]
proof (prove)
using this:
GAUSS p (int q)
GAUSS q (int p)
GAUSS ?p ?a \<Longrightarrow> Legendre ?a (int ?p) = (- 1) ^ card (GAUSS.E ?p ?a)
(- 1) ^ (card (GAUSS.E p (int q)) + card (GAUSS.E q (int p))) = (- 1) ^ card (GAUSS.E p (int q)) * (- 1) ^ card (GAUSS.E q (int p))
(- 1) ^ (card (GAUSS.E p (int q)) + card (GAUSS.E q (int p))) = (- 1) ^ ((p - 1) div 2 * ((q - 1) div 2))

goal (1 subgoal):
 1. Legendre (int p) (int q) * Legendre (int q) (int p) = (- 1) ^ ((p - 1) div 2 * ((q - 1) div 2))
[PROOF STEP]
by auto


[STATEMENT]
lemma stoch_proc_filt_eq_sets:
  assumes "space M = space N"
  shows "sets (stoch_proc_filt M X P n) = sets (stoch_proc_filt N X P n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (stoch_proc_filt M X P n) = sets (stoch_proc_filt N X P n)
[PROOF STEP]
unfolding stoch_proc_filt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (gen_subalgebra M (sigma_sets (space M) (\<Union>i\<in>{m. m \<le> n}. {X i -` A \<inter> space M |A. A \<in> sets P}))) = sets (gen_subalgebra N (sigma_sets (space N) (\<Union>i\<in>{m. m \<le> n}. {X i -` A \<inter> space N |A. A \<in> sets P})))
[PROOF STEP]
proof (rule gen_subalgebra_eq_space_sets, (simp add: assms)+)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sigma_sets (space N) (\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)
[PROOF STEP]
show "sigma_sets (space N) (\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets (space N) (\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)
[PROOF STEP]
proof (rule sigma_algebra.sigma_sets_subset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sigma_algebra (space N) (Pow (space N))
 2. (\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)
[PROOF STEP]
show "sigma_algebra (space N) (Pow (space N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra (space N) (Pow (space N))
[PROOF STEP]
by (simp add: sigma_algebra_Pow)
[PROOF STATE]
proof (state)
this:
sigma_algebra (space N) (Pow (space N))

goal (1 subgoal):
 1. (\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)
[PROOF STEP]
show "(\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sigma_sets (space N) (\<Union>x\<in>{m. m \<le> n}. {X x -` A \<inter> space N |A. A \<in> sets P}) \<subseteq> Pow (space N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem distributivity:
 assumes  "matrix_match A1 A2 B1 B2"
 shows "((A1 \<circ> A2)\<otimes>(B1\<circ>B2)) = ((A1 \<otimes> B1)\<circ>(A2 \<otimes> B2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
let ?nr = " ((row_length A1)*(row_length B1))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
let ?nc = "((length A2)*(length B2))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
have "mat ?nr ?nc ((A1\<circ>A2)\<otimes>(B1\<circ>B2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (row_length A1 * row_length B1) (length A2 * length B2) (A1 \<circ> A2 \<otimes> B1 \<circ> B2)
[PROOF STEP]
by (metis assms effective_tensor_compose_distribution1)
[PROOF STATE]
proof (state)
this:
mat (row_length A1 * row_length B1) (length A2 * length B2) (A1 \<circ> A2 \<otimes> B1 \<circ> B2)

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat (row_length A1 * row_length B1) (length A2 * length B2) (A1 \<circ> A2 \<otimes> B1 \<circ> B2)

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
have "mat ?nr ?nc ((A1 \<otimes> B1)\<circ>(A2 \<otimes> B2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (row_length A1 * row_length B1) (length A2 * length B2) ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
matrix_match A1 A2 B1 B2

goal (1 subgoal):
 1. mat (row_length A1 * row_length B1) (length A2 * length B2) ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2))
[PROOF STEP]
by (metis effective_tensor_compose_distribution2)
[PROOF STATE]
proof (state)
this:
mat (row_length A1 * row_length B1) (length A2 * length B2) ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2))

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat (row_length A1 * row_length B1) (length A2 * length B2) ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2))

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
have "\<forall>j<?nc.\<forall>i<?nr.
                   (((A1 \<circ> A2)\<otimes>(B1 \<circ>B2))!j!i
                                = ((A1 \<otimes> B1)\<circ>(A2 \<otimes> B2))!j!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j<length A2 * length B2. \<forall>i<row_length A1 * row_length B1. (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
using element_match assms
[PROOF STATE]
proof (prove)
using this:
matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> \<forall>i<row_length ?A1.0 * row_length ?B1.0. \<forall>j<length ?A2.0 * length ?B2.0. (?A1.0 \<circ> ?A2.0 \<otimes> ?B1.0 \<circ> ?B2.0) ! j ! i = ((?A1.0 \<otimes> ?B1.0) \<circ> (?A2.0 \<otimes> ?B2.0)) ! j ! i
matrix_match A1 A2 B1 B2

goal (1 subgoal):
 1. \<forall>j<length A2 * length B2. \<forall>i<row_length A1 * row_length B1. (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>j<length A2 * length B2. \<forall>i<row_length A1 * row_length B1. (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
mat (row_length A1 * row_length B1) (length A2 * length B2) (A1 \<circ> A2 \<otimes> B1 \<circ> B2)
mat (row_length A1 * row_length B1) (length A2 * length B2) ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2))
\<forall>j<length A2 * length B2. \<forall>i<row_length A1 * row_length B1. (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat (row_length A1 * row_length B1) (length A2 * length B2) (A1 \<circ> A2 \<otimes> B1 \<circ> B2)
mat (row_length A1 * row_length B1) (length A2 * length B2) ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2))
\<forall>j<length A2 * length B2. \<forall>i<row_length A1 * row_length B1. (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
using application
[PROOF STATE]
proof (prove)
using this:
mat (row_length A1 * row_length B1) (length A2 * length B2) (A1 \<circ> A2 \<otimes> B1 \<circ> B2)
mat (row_length A1 * row_length B1) (length A2 * length B2) ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2))
\<forall>j<length A2 * length B2. \<forall>i<row_length A1 * row_length B1. (A1 \<circ> A2 \<otimes> B1 \<circ> B2) ! j ! i = ((A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)) ! j ! i
\<forall>m1 m2. mat ?nr ?nc m1 \<and> mat ?nr ?nc m2 \<and> (\<forall>j<?nc. \<forall>i<?nr. m1 ! j ! i = m2 ! j ! i) \<longrightarrow> m1 = m2

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A1 \<circ> A2 \<otimes> B1 \<circ> B2 = (A1 \<otimes> B1) \<circ> (A2 \<otimes> B2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_lucas_lehmer_sequence'_Suc':
  "gen_lucas_lehmer_sequence' m a (Suc n) = (gen_lucas_lehmer_sequence' m a n ^ 2 - 2) mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gen_lucas_lehmer_sequence' m a (Suc n) = ((gen_lucas_lehmer_sequence' m a n)\<^sup>2 - 2) mod m
[PROOF STEP]
by (induction n arbitrary: a) auto


[STATEMENT]
lemma matrix_inv_mat[simp]: "c \<noteq> 0 \<Longrightarrow> (mat c)\<^sup>-\<^sup>1 = mat (inverse c)" for c :: "'a::division_ring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> mat c\<^sup>-\<^sup>1 = mat (inverse c)
[PROOF STEP]
by (simp add: matrix_inv_unique)


[STATEMENT]
lemma (in conjugatable_ring) conjugate_minus: "conjugate (x - y) = conjugate x - conjugate y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (x - y) = conjugate x - conjugate y
[PROOF STEP]
by (unfold diff_conv_add_uminus conjugate_dist_add conjugate_neg, rule)


[STATEMENT]
lemma lm08: fixes f l
            shows "argmaxList f l =
                   [ l!n . n <- [0..<size l], f (l!n) \<ge> Max (f`(set l))]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. argmaxList f l = concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l])
[PROOF STEP]
unfolding lm07 argmaxList_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((!) l) (concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [n] else []) [0..<length l])) = concat (map (\<lambda>n. if Max (f ` set l) \<le> f (l ! n) then [l ! n] else []) [0..<length l])
[PROOF STEP]
by (metis lm06)


[STATEMENT]
lemma (in Module) generator_generator:"\<lbrakk>generator R M H; H1 \<subseteq> carrier M;
           H \<subseteq> linear_span R M (carrier R) H1\<rbrakk>  \<Longrightarrow>  generator R M H1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>generator R M H; H1 \<subseteq> carrier M; H \<subseteq> linear_span R M (carrier R) H1\<rbrakk> \<Longrightarrow> generator R M H1
[PROOF STEP]
apply (cut_tac sc_Ring,
       frule Ring.whole_ideal[of R],
       frule linear_span_subModule[of "carrier R" H1], assumption,
       frule l_span_sub_submodule[of "carrier R"
            "linear_span R M (carrier R) H1" H], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>generator R M H; H1 \<subseteq> carrier M; H \<subseteq> linear_span R M (carrier R) H1; Ring R; ideal R (carrier R); submodule R M (linear_span R M (carrier R) H1); linear_span R M (carrier R) H \<subseteq> linear_span R M (carrier R) H1\<rbrakk> \<Longrightarrow> generator R M H1
[PROOF STEP]
apply (simp add:generator_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M \<and> linear_span R M (carrier R) H = carrier M; H1 \<subseteq> carrier M; H \<subseteq> linear_span R M (carrier R) H1; Ring R; ideal R (carrier R); submodule R M (linear_span R M (carrier R) H1); carrier M \<subseteq> linear_span R M (carrier R) H1\<rbrakk> \<Longrightarrow> linear_span R M (carrier R) H1 = carrier M
[PROOF STEP]
apply (rule equalityI,
       simp add:submodule_subset, assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_partition: "\<lbrakk> bst_wrt (\<le>) t; partition p t = (l',r') \<rbrakk>
 \<Longrightarrow> set_tree t = set_tree l' \<union> set_tree r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bst_wrt (\<le>) t; Splay_Heap.partition p t = (l', r')\<rbrakk> \<Longrightarrow> set_tree t = set_tree l' \<union> set_tree r'
[PROOF STEP]
by (metis mset_partition set_mset_tree set_mset_union)


[STATEMENT]
lemma vinsert_set_insert_eq:
  assumes "small B"
  shows "set (insert a (insert b B)) = vinsert a (set (insert b B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (insert a (insert b B)) = vinsert a (set (insert b B))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
small B

goal (1 subgoal):
 1. set (insert a (insert b B)) = vinsert a (set (insert b B))
[PROOF STEP]
by (simp add: ZFC_in_HOL.vinsert_def)


[STATEMENT]
lemma bit_numeral_Bit0_Suc_iff [simp]:
  \<open>bit (numeral (Num.Bit0 m)) (Suc n) \<longleftrightarrow> bit (numeral m) n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit (numeral (num.Bit0 m)) (Suc n) = bit (numeral m) n
[PROOF STEP]
by (simp add: bit_Suc numeral_Bit0_div_2)


[STATEMENT]
lemma cInf_le_iff_less:
  fixes x :: "'a :: {conditionally_complete_linorder, dense_linorder}"
  shows "A \<noteq> {} \<Longrightarrow> bdd_below (f`A) \<Longrightarrow> (INF i\<in>A. f i) \<le> x \<longleftrightarrow> (\<forall>y>x. \<exists>i\<in>A. f i \<le> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; bdd_below (f ` A)\<rbrakk> \<Longrightarrow> (Inf (f ` A) \<le> x) = (\<forall>y>x. \<exists>i\<in>A. f i \<le> y)
[PROOF STEP]
by (simp add: cINF_le_iff)
     (blast intro: less_imp_le less_trans le_less_trans dest: dense)


[STATEMENT]
lemma stabilizer_unchanged:
  assumes "a \<in> G" and "b \<in> G"
  shows "stabilizer (sumset A B) = stabilizer (sumset A (sumset (differenceset B {b}) {a}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stabilizer (sumset A B) = stabilizer (sumset A (sumset (differenceset B {b}) {a}))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. stabilizer (sumset A B) = stabilizer (sumset A (sumset (differenceset B {b}) {a}))
[PROOF STEP]
have "sumset A (sumset (differenceset B {b}) {a}) = sumset (differenceset (sumset A B) {b}) {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset A (sumset (differenceset B {b}) {a}) = sumset (differenceset (sumset A B) {b}) {a}
[PROOF STEP]
by (simp add: sumset_assoc)
[PROOF STATE]
proof (state)
this:
sumset A (sumset (differenceset B {b}) {a}) = sumset (differenceset (sumset A B) {b}) {a}

goal (1 subgoal):
 1. stabilizer (sumset A B) = stabilizer (sumset A (sumset (differenceset B {b}) {a}))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sumset A (sumset (differenceset B {b}) {a}) = sumset (differenceset (sumset A B) {b}) {a}

goal (1 subgoal):
 1. stabilizer (sumset A B) = stabilizer (sumset A (sumset (differenceset B {b}) {a}))
[PROOF STEP]
using stabilizer_right_sumset_invariant
    stabilizer_right_differenceset_invariant assms sumset_subset_carrier
[PROOF STATE]
proof (prove)
using this:
sumset A (sumset (differenceset B {b}) {a}) = sumset (differenceset (sumset A B) {b}) {a}
\<lbrakk>?a \<in> G; ?A \<subseteq> G\<rbrakk> \<Longrightarrow> stabilizer (sumset ?A {?a}) = stabilizer ?A
\<lbrakk>?b \<in> G; ?A \<subseteq> G\<rbrakk> \<Longrightarrow> stabilizer (differenceset ?A {?b}) = stabilizer ?A
a \<in> G
b \<in> G
sumset ?A ?B \<subseteq> G

goal (1 subgoal):
 1. stabilizer (sumset A B) = stabilizer (sumset A (sumset (differenceset B {b}) {a}))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
stabilizer (sumset A B) = stabilizer (sumset A (sumset (differenceset B {b}) {a}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_Int_subset: "span (A \<inter> B) \<subseteq> span A \<inter> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
have "span (A \<inter> B) = span (\<Inter>x\<in>{A, B}. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (A \<inter> B) = span (\<Inter>x\<in>{A, B}. x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
span (A \<inter> B) = span (\<Inter>x\<in>{A, B}. x)

goal (1 subgoal):
 1. span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
span (A \<inter> B) = span (\<Inter>x\<in>{A, B}. x)

goal (1 subgoal):
 1. span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
have "\<dots> \<subseteq> (\<Inter>x\<in>{A, B}. span x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (\<Inter>x\<in>{A, B}. x) \<subseteq> \<Inter> (span ` {A, B})
[PROOF STEP]
by (fact span_INT_subset)
[PROOF STATE]
proof (state)
this:
span (\<Inter>x\<in>{A, B}. x) \<subseteq> \<Inter> (span ` {A, B})

goal (1 subgoal):
 1. span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
span (\<Inter>x\<in>{A, B}. x) \<subseteq> \<Inter> (span ` {A, B})

goal (1 subgoal):
 1. span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
have "\<dots> = span A \<inter> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> (span ` {A, B}) = span A \<inter> span B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Inter> (span ` {A, B}) = span A \<inter> span B

goal (1 subgoal):
 1. span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
span (A \<inter> B) \<subseteq> span A \<inter> span B

goal (1 subgoal):
 1. span (A \<inter> B) \<subseteq> span A \<inter> span B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
span (A \<inter> B) \<subseteq> span A \<inter> span B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennreal_SUP_of_nat_eq_top: "(SUP x. of_nat x :: ennreal) = top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (range of_nat) = top
[PROOF STEP]
proof (intro antisym top_greatest le_SUP_iff[THEN iffD2] allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y < top \<Longrightarrow> \<exists>i\<in>UNIV. y < of_nat i
[PROOF STEP]
fix y :: ennreal
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y < top \<Longrightarrow> \<exists>i\<in>UNIV. y < of_nat i
[PROOF STEP]
assume "y < top"
[PROOF STATE]
proof (state)
this:
y < top

goal (1 subgoal):
 1. \<And>y. y < top \<Longrightarrow> \<exists>i\<in>UNIV. y < of_nat i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y < top
[PROOF STEP]
obtain r where "y = ennreal r"
[PROOF STATE]
proof (prove)
using this:
y < top

goal (1 subgoal):
 1. (\<And>r. y = ennreal r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases y rule: ennreal_cases) auto
[PROOF STATE]
proof (state)
this:
y = ennreal r

goal (1 subgoal):
 1. \<And>y. y < top \<Longrightarrow> \<exists>i\<in>UNIV. y < of_nat i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = ennreal r
[PROOF STEP]
show "\<exists>i\<in>UNIV. y < of_nat i"
[PROOF STATE]
proof (prove)
using this:
y = ennreal r

goal (1 subgoal):
 1. \<exists>i\<in>UNIV. y < of_nat i
[PROOF STEP]
using reals_Archimedean2[of "max 1 r"] zero_less_one
[PROOF STATE]
proof (prove)
using this:
y = ennreal r
\<exists>n. max 1 r < real n
(0::?'a) < (1::?'a)

goal (1 subgoal):
 1. \<exists>i\<in>UNIV. y < of_nat i
[PROOF STEP]
by (simp add: ennreal_Ex_less_of_nat)
[PROOF STATE]
proof (state)
this:
\<exists>i\<in>UNIV. y < of_nat i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rank_mul_le_right:
  fixes A :: "real^'n^'m" and B :: "real^'p^'n"
  shows "rank(A ** B) \<le> rank B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (A ** B) \<le> rank B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank (A ** B) \<le> rank B
[PROOF STEP]
have "rank(A ** B) \<le> dim ((*v) A ` range ((*v) B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (A ** B) \<le> dim ((*v) A ` range ((*v) B))
[PROOF STEP]
by (auto simp: rank_dim_range image_comp o_def matrix_vector_mul_assoc)
[PROOF STATE]
proof (state)
this:
rank (A ** B) \<le> dim ((*v) A ` range ((*v) B))

goal (1 subgoal):
 1. rank (A ** B) \<le> rank B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank (A ** B) \<le> dim ((*v) A ` range ((*v) B))

goal (1 subgoal):
 1. rank (A ** B) \<le> rank B
[PROOF STEP]
have "\<dots> \<le> rank B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim ((*v) A ` range ((*v) B)) \<le> rank B
[PROOF STEP]
by (simp add: rank_dim_range dim_image_le)
[PROOF STATE]
proof (state)
this:
dim ((*v) A ` range ((*v) B)) \<le> rank B

goal (1 subgoal):
 1. rank (A ** B) \<le> rank B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rank (A ** B) \<le> rank B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rank (A ** B) \<le> rank B

goal (1 subgoal):
 1. rank (A ** B) \<le> rank B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rank (A ** B) \<le> rank B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  PLS_nempty_and_has_min:
  fixes s as
  shows "(\<exists>x. (x \<in> PLS s as) \<and> (x = Inf (PLS s as)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)
[PROOF STEP]
have "PLS s as \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PLS s as \<noteq> {}
[PROOF STEP]
using PLS_NEMPTY
[PROOF STATE]
proof (prove)
using this:
PLS ?s ?as \<noteq> {}

goal (1 subgoal):
 1. PLS s as \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
PLS s as \<noteq> {}

goal (1 subgoal):
 1. \<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
PLS s as \<noteq> {}
[PROOF STEP]
have "Inf (PLS s as) \<in> PLS s as"
[PROOF STATE]
proof (prove)
using this:
PLS s as \<noteq> {}

goal (1 subgoal):
 1. Inf (PLS s as) \<in> PLS s as
[PROOF STEP]
unfolding Inf_nat_def
[PROOF STATE]
proof (prove)
using this:
PLS s as \<noteq> {}

goal (1 subgoal):
 1. (LEAST n. n \<in> PLS s as) \<in> PLS s as
[PROOF STEP]
using LeastI_ex Max_in finite_PLS
[PROOF STATE]
proof (prove)
using this:
PLS s as \<noteq> {}
\<exists>x. ?P x \<Longrightarrow> ?P (Least ?P)
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max ?A \<in> ?A
finite (PLS ?s ?as)

goal (1 subgoal):
 1. (LEAST n. n \<in> PLS s as) \<in> PLS s as
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Inf (PLS s as) \<in> PLS s as

goal (1 subgoal):
 1. \<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Inf (PLS s as) \<in> PLS s as
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Inf (PLS s as) \<in> PLS s as

goal (1 subgoal):
 1. \<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> PLS s as \<and> x = Inf (PLS s as)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Union_connected_component: "\<Union>(connected_component_set S ` S) = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (connected_component_set S ` S) = S
[PROOF STEP]
apply (rule subset_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (connected_component_set S ` S) \<subseteq> S
 2. S \<subseteq> \<Union> (connected_component_set S ` S)
[PROOF STEP]
apply (simp add: SUP_least connected_component_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> \<Union> (connected_component_set S ` S)
[PROOF STEP]
using connected_component_refl_eq
[PROOF STATE]
proof (prove)
using this:
connected_component ?S ?x ?x = (?x \<in> ?S)

goal (1 subgoal):
 1. S \<subseteq> \<Union> (connected_component_set S ` S)
[PROOF STEP]
by force


[STATEMENT]
theorem c_len_th_1: "c_len (list_to_nat ls) = length ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_len (list_to_nat ls) = length ls
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> c_len (list_to_nat ls) = length ls
 2. \<not> ?P \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
assume "ls=[]"
[PROOF STATE]
proof (state)
this:
ls = []

goal (2 subgoals):
 1. ?P \<Longrightarrow> c_len (list_to_nat ls) = length ls
 2. \<not> ?P \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
ls = []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ls = []

goal (1 subgoal):
 1. c_len (list_to_nat ls) = length ls
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_len (list_to_nat ls) = length ls

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
assume S1: "ls \<noteq> []"
[PROOF STATE]
proof (state)
this:
ls \<noteq> []

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ls \<noteq> []
[PROOF STEP]
have S2: "list_to_nat ls = c_pair ((length ls)-(1::nat)) (c_fold ls)+1"
[PROOF STATE]
proof (prove)
using this:
ls \<noteq> []

goal (1 subgoal):
 1. list_to_nat ls = c_pair (length ls - 1) (c_fold ls) + 1
[PROOF STEP]
by (simp add: list_to_nat_def)
[PROOF STATE]
proof (state)
this:
list_to_nat ls = c_pair (length ls - 1) (c_fold ls) + 1

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
let ?u = "list_to_nat ls"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
from S2
[PROOF STATE]
proof (chain)
picking this:
list_to_nat ls = c_pair (length ls - 1) (c_fold ls) + 1
[PROOF STEP]
have u_not_zero: "?u > 0"
[PROOF STATE]
proof (prove)
using this:
list_to_nat ls = c_pair (length ls - 1) (c_fold ls) + 1

goal (1 subgoal):
 1. 0 < list_to_nat ls
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < list_to_nat ls

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
from S2
[PROOF STATE]
proof (chain)
picking this:
list_to_nat ls = c_pair (length ls - 1) (c_fold ls) + 1
[PROOF STEP]
have S3: "?u-(1::nat) = c_pair ((length ls)-(1::nat)) (c_fold ls)"
[PROOF STATE]
proof (prove)
using this:
list_to_nat ls = c_pair (length ls - 1) (c_fold ls) + 1

goal (1 subgoal):
 1. list_to_nat ls - 1 = c_pair (length ls - 1) (c_fold ls)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
list_to_nat ls - 1 = c_pair (length ls - 1) (c_fold ls)

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_to_nat ls - 1 = c_pair (length ls - 1) (c_fold ls)
[PROOF STEP]
have S4: "c_fst(?u-(1::nat)) = (length ls)-(1::nat)"
[PROOF STATE]
proof (prove)
using this:
list_to_nat ls - 1 = c_pair (length ls - 1) (c_fold ls)

goal (1 subgoal):
 1. c_fst (list_to_nat ls - 1) = length ls - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_fst (list_to_nat ls - 1) = length ls - 1

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
from S1 this
[PROOF STATE]
proof (chain)
picking this:
ls \<noteq> []
c_fst (list_to_nat ls - 1) = length ls - 1
[PROOF STEP]
have S5: "c_fst(?u-(1::nat))+1=length ls"
[PROOF STATE]
proof (prove)
using this:
ls \<noteq> []
c_fst (list_to_nat ls - 1) = length ls - 1

goal (1 subgoal):
 1. c_fst (list_to_nat ls - 1) + 1 = length ls
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_fst (list_to_nat ls - 1) + 1 = length ls

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
from u_not_zero S5
[PROOF STATE]
proof (chain)
picking this:
0 < list_to_nat ls
c_fst (list_to_nat ls - 1) + 1 = length ls
[PROOF STEP]
have S6: "c_len (?u) = length ls"
[PROOF STATE]
proof (prove)
using this:
0 < list_to_nat ls
c_fst (list_to_nat ls - 1) + 1 = length ls

goal (1 subgoal):
 1. c_len (list_to_nat ls) = length ls
[PROOF STEP]
by (simp add: c_len_2)
[PROOF STATE]
proof (state)
this:
c_len (list_to_nat ls) = length ls

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> c_len (list_to_nat ls) = length ls
[PROOF STEP]
from S1 S6
[PROOF STATE]
proof (chain)
picking this:
ls \<noteq> []
c_len (list_to_nat ls) = length ls
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ls \<noteq> []
c_len (list_to_nat ls) = length ls

goal (1 subgoal):
 1. c_len (list_to_nat ls) = length ls
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_len (list_to_nat ls) = length ls

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Network) sum_height_measure_is_OV2:
  "sum_heights_measure l \<le> 2*(card V)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_heights_measure l \<le> 2 * (card V)\<^sup>2
[PROOF STEP]
unfolding  sum_heights_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)\<^sup>2
[PROOF STEP]
have "2 * card V - l v \<le> 2 * card V" for v
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * card V - l v \<le> 2 * card V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * card V - l ?v \<le> 2 * card V

goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * card V - l ?v \<le> 2 * card V
[PROOF STEP]
have "(\<Sum>v\<in>V. 2 * card V - l v) \<le> (\<Sum>v\<in>V. 2 * card V)"
[PROOF STATE]
proof (prove)
using this:
2 * card V - l ?v \<le> 2 * card V

goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - l v) \<le> (\<Sum>v\<in>V. 2 * card V)
[PROOF STEP]
by (meson sum_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>V. 2 * card V - l v) \<le> (\<Sum>v\<in>V. 2 * card V)

goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>V. 2 * card V - l v) \<le> (\<Sum>v\<in>V. 2 * card V)

goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)\<^sup>2
[PROOF STEP]
have "(\<Sum>v\<in>V. 2 * card V) = card V * (2 * card V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V) = card V * (2 * card V)
[PROOF STEP]
using finite_V
[PROOF STATE]
proof (prove)
using this:
finite V

goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V) = card V * (2 * card V)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>V. 2 * card V) = card V * (2 * card V)

goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>v\<in>V. 2 * card V - l v) \<le> card V * (2 * card V)
[PROOF STEP]
show "(\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)^2"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>v\<in>V. 2 * card V - l v) \<le> card V * (2 * card V)

goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>V. 2 * card V - l v) \<le> 2 * (card V)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zmult_div_aux1:
  assumes b: "b \<noteq> 0"
  shows "(a - a mod b) div b = (a::int) div b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - a mod b) div b = a div b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a - a mod b) div b = a div b
[PROOF STEP]
from minus_mod_eq_mult_div [symmetric, of b a]
[PROOF STATE]
proof (chain)
picking this:
b * (a div b) = a - a mod b
[PROOF STEP]
have "(b * (a div b)) div b = (a - a mod b) div b"
[PROOF STATE]
proof (prove)
using this:
b * (a div b) = a - a mod b

goal (1 subgoal):
 1. b * (a div b) div b = (a - a mod b) div b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b * (a div b) div b = (a - a mod b) div b

goal (1 subgoal):
 1. (a - a mod b) div b = a div b
[PROOF STEP]
with b
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> 0
b * (a div b) div b = (a - a mod b) div b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0
b * (a div b) div b = (a - a mod b) div b

goal (1 subgoal):
 1. (a - a mod b) div b = a div b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a - a mod b) div b = a div b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_add_1_add_1: "(n::nat) + 1 + 1 = n + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n + 1 + 1 = n + 2
[PROOF STEP]
by simp


[STATEMENT]
lemma mult_add_distrib_mat_vec[algebra_simps]: assumes m: "A \<in> carrier_mat nr nc"
  "v\<^sub>1 \<in> carrier_vec nc" "v\<^sub>2 \<in> carrier_vec nc"
  shows "A *\<^sub>v (v\<^sub>1 + v\<^sub>2) = A *\<^sub>v v\<^sub>1 + A *\<^sub>v v\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v (v\<^sub>1 + v\<^sub>2) = A *\<^sub>v v\<^sub>1 + A *\<^sub>v v\<^sub>2
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
v\<^sub>1 \<in> carrier_vec nc
v\<^sub>2 \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v (v\<^sub>1 + v\<^sub>2) = A *\<^sub>v v\<^sub>1 + A *\<^sub>v v\<^sub>2
[PROOF STEP]
by (intro eq_vecI, auto simp: scalar_prod_add_distrib[of _ nc])


[STATEMENT]
lemma relImage_Gr:
  "\<lbrakk>R \<subseteq> A \<times> A\<rbrakk> \<Longrightarrow> relImage R f = (Gr A f)\<inverse> O R O Gr A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<subseteq> A \<times> A \<Longrightarrow> relImage R f = (Gr A f)\<inverse> O R O Gr A f
[PROOF STEP]
unfolding relImage_def Gr_def relcomp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<subseteq> A \<times> A \<Longrightarrow> {(f a1, f a2) |a1 a2. (a1, a2) \<in> R} = {(x, y). ((\<lambda>x xa. (x, xa) \<in> {(a, f a) |a. a \<in> A}\<inverse>) OO (\<lambda>x xa. (x, xa) \<in> {(x, y). ((\<lambda>x xa. (x, xa) \<in> R) OO (\<lambda>x xa. (x, xa) \<in> {(a, f a) |a. a \<in> A})) x y})) x y}
[PROOF STEP]
by auto