[STATEMENT]
lemma finite_carrier: "finite (carrier tetrahedral_group)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier tetrahedral_group)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (carrier tetrahedral_group)
[PROOF STEP]
(* This follows from the instantiation above *)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (carrier tetrahedral_group)
[PROOF STEP]
have "finite (UNIV :: (Vertex \<Rightarrow> Vertex) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite UNIV

goal (1 subgoal):
 1. finite (carrier tetrahedral_group)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite UNIV

goal (1 subgoal):
 1. finite (carrier tetrahedral_group)
[PROOF STEP]
have "complex_rotations \<subseteq> (UNIV :: (Vertex \<Rightarrow> Vertex) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_rotations \<subseteq> UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_rotations \<subseteq> UNIV

goal (1 subgoal):
 1. finite (carrier tetrahedral_group)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite UNIV
complex_rotations \<subseteq> UNIV
[PROOF STEP]
show "finite (carrier tetrahedral_group)"
[PROOF STATE]
proof (prove)
using this:
finite UNIV
complex_rotations \<subseteq> UNIV

goal (1 subgoal):
 1. finite (carrier tetrahedral_group)
[PROOF STEP]
using finite_subset top_greatest
[PROOF STATE]
proof (prove)
using this:
finite UNIV
complex_rotations \<subseteq> UNIV
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
?a \<le> top_class.top

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gauss_poly_degree:
  assumes "n > 1"
  shows "degree (gauss_poly R n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (gauss_poly R n) = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (gauss_poly R n) = n
[PROOF STEP]
have "degree (gauss_poly R n) = max n 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (gauss_poly R n) = max n 1
[PROOF STEP]
unfolding gauss_poly_def a_minus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> X) = max n 1
[PROOF STEP]
using var_pow_carr var_carr degree_var
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P - {\<zero>\<^bsub>P\<^esub>}
X \<in> carrier P - {\<zero>\<^bsub>P\<^esub>}
degree X = 1

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> X) = max n 1
[PROOF STEP]
using var_pow_degree univ_poly_a_inv_degree
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P - {\<zero>\<^bsub>P\<^esub>}
X \<in> carrier P - {\<zero>\<^bsub>P\<^esub>}
degree X = 1
degree (X [^]\<^bsub>P\<^esub> ?n) = ?n
?p \<in> carrier P \<Longrightarrow> degree (\<ominus>\<^bsub>P\<^esub> ?p) = degree ?p

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> X) = max n 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
X [^]\<^bsub>P\<^esub> ?n \<in> carrier P - {\<zero>\<^bsub>P\<^esub>}
X \<in> carrier P - {\<zero>\<^bsub>P\<^esub>}
degree X = 1
degree (X [^]\<^bsub>P\<^esub> ?n) = ?n
?p \<in> carrier P \<Longrightarrow> degree (\<ominus>\<^bsub>P\<^esub> ?p) = degree ?p
1 < n

goal (1 subgoal):
 1. degree (X [^]\<^bsub>P\<^esub> n \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> X) = max n 1
[PROOF STEP]
by (subst degree_add_distinct, auto)
[PROOF STATE]
proof (state)
this:
degree (gauss_poly R n) = max n 1

goal (1 subgoal):
 1. degree (gauss_poly R n) = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (gauss_poly R n) = max n 1

goal (1 subgoal):
 1. degree (gauss_poly R n) = n
[PROOF STEP]
have "... = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max n 1 = n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < n

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

goal (1 subgoal):
 1. degree (gauss_poly R n) = n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree (gauss_poly R n) = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (gauss_poly R n) = n

goal (1 subgoal):
 1. degree (gauss_poly R n) = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (gauss_poly R n) = n

goal:
No subgoals!
[PROOF STEP]
qed


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


[STATEMENT]
lemma times_diff_plus_sym_hmset: "a * (c - b) + a * b = a * (b - c) + a * c" for a b c :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (c - b) + a * b = a * (b - c) + a * c
[PROOF STEP]
by (metis distrib_left diff_plus_sym_hmset)


[STATEMENT]
lemma floor_eq4: "real n \<le> x \<Longrightarrow> x < real (Suc n) \<Longrightarrow> nat \<lfloor>x\<rfloor> = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>real n \<le> x; x < real (Suc n)\<rbrakk> \<Longrightarrow> nat \<lfloor>x\<rfloor> = n
[PROOF STEP]
by linarith


[STATEMENT]
lemma connecting_paths_sym_length: "i \<in> connecting_paths u v \<Longrightarrow> \<exists>j\<in>connecting_paths v u. (walk_length j) = (walk_length i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> connecting_paths u v \<Longrightarrow> \<exists>j\<in>connecting_paths v u. walk_length j = walk_length i
[PROOF STEP]
using connecting_paths_sym
[PROOF STATE]
proof (prove)
using this:
(?xs \<in> connecting_paths ?u ?v) = (rev ?xs \<in> connecting_paths ?v ?u)

goal (1 subgoal):
 1. i \<in> connecting_paths u v \<Longrightarrow> \<exists>j\<in>connecting_paths v u. walk_length j = walk_length i
[PROOF STEP]
by (metis walk_length_rev)


[STATEMENT]
lemma uniformly_continuous_on_minus[continuous_intros]:
  fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector"
  shows "uniformly_continuous_on s f \<Longrightarrow> uniformly_continuous_on s (\<lambda>x. - f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_continuous_on s f \<Longrightarrow> uniformly_continuous_on s (\<lambda>x. - f x)
[PROOF STEP]
unfolding uniformly_continuous_on_def dist_minus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. \<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e \<Longrightarrow> \<forall>e>0. \<exists>d>0. \<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e
[PROOF STEP]
.


[STATEMENT]
lemma cblinfun_norm_approx_witness:
  fixes A :: \<open>'a::{not_singleton,complex_normed_vector} \<Rightarrow>\<^sub>C\<^sub>L 'b::complex_normed_vector\<close>
  assumes \<open>\<epsilon> > 0\<close>
  shows \<open>\<exists>\<psi>. norm (A *\<^sub>V \<psi>) \<ge> norm A - \<epsilon> \<and> norm \<psi> = 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<psi>. norm A - \<epsilon> \<le> norm (A *\<^sub>V \<psi>) \<and> norm \<psi> = 1
[PROOF STEP]
proof (transfer fixing: \<epsilon>)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. bounded_clinear A \<Longrightarrow> \<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1
[PROOF STEP]
fix A :: \<open>'a \<Rightarrow> 'b\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. bounded_clinear A \<Longrightarrow> \<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1
[PROOF STEP]
assume [simp]: \<open>bounded_clinear A\<close>
[PROOF STATE]
proof (state)
this:
bounded_clinear A

goal (1 subgoal):
 1. \<And>A. bounded_clinear A \<Longrightarrow> \<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1
[PROOF STEP]
have \<open>\<exists>y\<in>{norm (A x) |x. norm x = 1}. y > \<Squnion> {norm (A x) |x. norm x = 1} - \<epsilon>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>{norm (A x) |x. norm x = 1}. \<Squnion> {norm (A x) |x. norm x = 1} - \<epsilon> < y
[PROOF STEP]
apply (rule Sup_real_close)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < \<epsilon>
 2. bdd_above {norm (A x) |x. norm x = 1}
 3. {norm (A x) |x. norm x = 1} \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>

goal (3 subgoals):
 1. 0 < \<epsilon>
 2. bdd_above {norm (A x) |x. norm x = 1}
 3. {norm (A x) |x. norm x = 1} \<noteq> {}
[PROOF STEP]
by (auto simp: ex_norm1 bounded_clinear.bounded_linear bdd_above_norm_f)
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>{norm (A x) |x. norm x = 1}. \<Squnion> {norm (A x) |x. norm x = 1} - \<epsilon> < y

goal (1 subgoal):
 1. \<And>A. bounded_clinear A \<Longrightarrow> \<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>{norm (A x) |x. norm x = 1}. \<Squnion> {norm (A x) |x. norm x = 1} - \<epsilon> < y

goal (1 subgoal):
 1. \<And>A. bounded_clinear A \<Longrightarrow> \<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1
[PROOF STEP]
have \<open>\<Squnion> {norm (A x) |x. norm x = 1} = onorm A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> {norm (A x) |x. norm x = 1} = onorm A
[PROOF STEP]
by (simp add: bounded_clinear.bounded_linear onorm_sphere)
[PROOF STATE]
proof (state)
this:
\<Squnion> {norm (A x) |x. norm x = 1} = onorm A

goal (1 subgoal):
 1. \<And>A. bounded_clinear A \<Longrightarrow> \<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<exists>y\<in>{norm (A x) |x. norm x = 1}. onorm A - \<epsilon> < y
[PROOF STEP]
show \<open>\<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>{norm (A x) |x. norm x = 1}. onorm A - \<epsilon> < y

goal (1 subgoal):
 1. \<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>\<psi>. onorm A - \<epsilon> \<le> norm (A \<psi>) \<and> norm \<psi> = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_prts: "\<bar>a\<bar> = pprt a - nprt a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a\<bar> = pprt a - nprt a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>a\<bar> = pprt a - nprt a
[PROOF STEP]
have "0 \<le> \<bar>a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> \<bar>a\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'a) \<le> \<bar>a\<bar>
[PROOF STEP]
have a: "a \<le> \<bar>a\<bar>" and b: "- a \<le> \<bar>a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> \<bar>a\<bar> &&& - a \<le> \<bar>a\<bar>
[PROOF STEP]
by (auto simp add: abs_lattice)
[PROOF STATE]
proof (state)
this:
a \<le> \<bar>a\<bar>
- a \<le> \<bar>a\<bar>

goal (1 subgoal):
 1. (0::'a) \<le> \<bar>a\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> \<bar>a\<bar>
[PROOF STEP]
by (rule add_mono [OF a b, simplified])
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> \<bar>a\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> \<bar>a\<bar>

goal (1 subgoal):
 1. \<bar>a\<bar> = pprt a - nprt a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> \<bar>a\<bar>
[PROOF STEP]
have "0 \<le> sup a (- a)"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> \<bar>a\<bar>

goal (1 subgoal):
 1. (0::'a) \<le> sup a (- a)
[PROOF STEP]
unfolding abs_lattice
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> sup a (- a)

goal (1 subgoal):
 1. (0::'a) \<le> sup a (- a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> sup a (- a)

goal (1 subgoal):
 1. \<bar>a\<bar> = pprt a - nprt a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> sup a (- a)
[PROOF STEP]
have "sup (sup a (- a)) 0 = sup a (- a)"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> sup a (- a)

goal (1 subgoal):
 1. sup (sup a (- a)) (0::'a) = sup a (- a)
[PROOF STEP]
by (rule sup_absorb1)
[PROOF STATE]
proof (state)
this:
sup (sup a (- a)) (0::'a) = sup a (- a)

goal (1 subgoal):
 1. \<bar>a\<bar> = pprt a - nprt a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sup (sup a (- a)) (0::'a) = sup a (- a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sup (sup a (- a)) (0::'a) = sup a (- a)

goal (1 subgoal):
 1. \<bar>a\<bar> = pprt a - nprt a
[PROOF STEP]
by (simp add: add_sup_inf_distribs ac_simps pprt_def nprt_def abs_lattice)
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> = pprt a - nprt a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Arcsin_range_lemma: "\<bar>Re z\<bar> < 1 \<Longrightarrow> 0 < Re(\<i> * z + csqrt(1 - z\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Re z\<bar> < 1 \<Longrightarrow> 0 < Re (\<i> * z + csqrt (1 - z\<^sup>2))
[PROOF STEP]
using Complex.cmod_power2 [of z, symmetric]
[PROOF STATE]
proof (prove)
using this:
(Re z)\<^sup>2 + (Im z)\<^sup>2 = (cmod z)\<^sup>2

goal (1 subgoal):
 1. \<bar>Re z\<bar> < 1 \<Longrightarrow> 0 < Re (\<i> * z + csqrt (1 - z\<^sup>2))
[PROOF STEP]
by (simp add: real_less_rsqrt algebra_simps Re_power2 cmod_square_less_1_plus)


[STATEMENT]
lemma norm_cblinfun_Sup: \<open>norm A = (SUP \<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm A = (\<Squnion>\<psi>. norm (A *\<^sub>V \<psi>) / norm \<psi>)
[PROOF STEP]
by (simp add: norm_cblinfun.rep_eq onorm_def)


[STATEMENT]
lemma ordering_oSuc:
"ordering A (oSuc x) = (LEAST z. z \<in> A \<and> ordering A x < z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OrdinalVeblen.ordering A (oSuc x) = (LEAST z. z \<in> A \<and> OrdinalVeblen.ordering A x < z)
[PROOF STEP]
by (simp add: ordering_def)


[STATEMENT]
lemma bag_of_nths_UN_disjoint [rule_format]:
     "[| finite I; \<forall>i\<in>I. \<forall>j\<in>I. i\<noteq>j \<longrightarrow> A i Int A j = {} |]
      ==> bag_of (nths l (\<Union>(A ` I))) =
          (\<Sum>i\<in>I. bag_of (nths l (A i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> A j = {}\<rbrakk> \<Longrightarrow> mset (nths l (\<Union> (A ` I))) = (\<Sum>i\<in>I. mset (nths l (A i)))
[PROOF STEP]
apply (auto simp add: bag_of_nths)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> A j = {}\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>\<Union> (A ` I) \<inter> {..<length l}. {#l ! x#}) = (\<Sum>x\<in>I. \<Sum>i\<in>A x \<inter> {..<length l}. {#l ! i#})
[PROOF STEP]
unfolding UN_simps [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> A j = {}\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>(\<Union>x\<in>I. A x \<inter> {..<length l}). {#l ! x#}) = (\<Sum>x\<in>I. \<Sum>i\<in>A x \<inter> {..<length l}. {#l ! i#})
[PROOF STEP]
apply (subst sum.UNION_disjoint)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>finite I; \<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> A j = {}\<rbrakk> \<Longrightarrow> finite I
 2. \<lbrakk>finite I; \<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> A j = {}\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. finite (A i \<inter> {..<length l})
 3. \<lbrakk>finite I; \<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> A j = {}\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> {..<length l} \<inter> (A j \<inter> {..<length l}) = {}
 4. \<lbrakk>finite I; \<forall>i\<in>I. \<forall>j\<in>I. i \<noteq> j \<longrightarrow> A i \<inter> A j = {}\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>I. \<Sum>x\<in>A x \<inter> {..<length l}. {#l ! x#}) = (\<Sum>x\<in>I. \<Sum>i\<in>A x \<inter> {..<length l}. {#l ! i#})
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma log_mult_ext2:
  "0 \<le> x \<Longrightarrow> 0 < y \<Longrightarrow> x * log b (x*y) = x * log b x + x * log b y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 < y\<rbrakk> \<Longrightarrow> x * log b (x * y) = x * log b x + x * log b y
[PROOF STEP]
using log_mult_ext3[where y=1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?x; 0 < 1; 0 < ?z\<rbrakk> \<Longrightarrow> ?x * log b (?x * 1 * ?z) = ?x * log b (?x * 1) + ?x * log b ?z

goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 < y\<rbrakk> \<Longrightarrow> x * log b (x * y) = x * log b x + x * log b y
[PROOF STEP]
by simp


[STATEMENT]
lemma mult_less_multiset\<^sub>H\<^sub>O: "(M, N) \<in> mult {(x, y). x < y} \<longleftrightarrow> less_multiset\<^sub>H\<^sub>O M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M, N) \<in> mult {(x, y). x < y}) = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
unfolding multp_def[of "(<)", symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
using multp_eq_multp\<^sub>H\<^sub>O[of "(<)", simplified]
[PROOF STATE]
proof (prove)
using this:
multp (<) = multp\<^sub>H\<^sub>O (<)

goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
by (simp add: multp\<^sub>H\<^sub>O_def less_multiset\<^sub>H\<^sub>O_def)


[STATEMENT]
lemma hlog_eq_div_starfun_ln_mult_hlog:
  "\<And>a b x. 0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < b \<Longrightarrow> b \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow>
    hlog a x = (( *f* ln) b / ( *f* ln) a) * hlog b x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>0 < a; a \<noteq> 1; 0 < b; b \<noteq> 1; 0 < x\<rbrakk> \<Longrightarrow> hlog a x = (*f* real_ln) b / (*f* real_ln) a * hlog b x
[PROOF STEP]
by transfer (rule log_eq_div_ln_mult_log)


[STATEMENT]
lemma pmf_bernoulli_half [simp]: "pmf (bernoulli_pmf (1 / 2)) x = 1 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (bernoulli_pmf (1 / 2)) x = 1 / 2
[PROOF STEP]
by(cases x) simp_all


[STATEMENT]
lemma Inf_insert:
  fixes S :: "real set"
  shows "bounded S \<Longrightarrow> Inf (insert x S) = (if S = {} then x else min x (Inf S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S \<Longrightarrow> Inf (insert x S) = (if S = {} then x else min x (Inf S))
[PROOF STEP]
by (auto simp: bounded_imp_bdd_below inf_min cInf_insert_If)


[STATEMENT]
lemma hnorm_le_Infinitesimal: "e \<in> Infinitesimal \<Longrightarrow> hnorm x \<le> e \<Longrightarrow> x \<in> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e \<in> Infinitesimal; hnorm x \<le> e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal
[PROOF STEP]
by (auto simp: Infinitesimal_def abs_less_iff)


[STATEMENT]
lemma length_generate_PS: "length (generate_PS emBits 160) = (roundup emBits 8)*8 - sLen - 160 - 16"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (generate_PS emBits 160) = roundup emBits 8 * 8 - sLen - 160 - 16
[PROOF STEP]
by (simp add: generate_PS_def length_bv_prepend)


[STATEMENT]
lemma resultant_sub: "resultant p q = resultant_sub (degree p) (degree q) p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant p q = resultant_sub (degree p) (degree q) p q
[PROOF STEP]
unfolding resultant_def sylvester_mat_def resultant_sub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (sylvester_mat_sub (degree p) (degree q) p q) = det (sylvester_mat_sub (degree p) (degree q) p q)
[PROOF STEP]
by auto


[STATEMENT]
lemma fst_sum_list: "fst (sum_list xs) = sum_list (map fst xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (sum_list xs) = sum_list (map fst xs)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma less_oFix_0D:
"\<lbrakk>x < oFix F 0; mono F\<rbrakk> \<Longrightarrow> x < F x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < oFix F 0; mono F\<rbrakk> \<Longrightarrow> x < F x
[PROOF STEP]
apply (unfold oFix_def, drule less_oLimitD, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>mono F; x < iter n F 0\<rbrakk> \<Longrightarrow> x < F x
[PROOF STEP]
apply (erule_tac P="x < iter n F 0" in rev_mp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. mono F \<Longrightarrow> x < iter n F 0 \<longrightarrow> x < F x
[PROOF STEP]
apply (induct_tac n, auto simp add: linorder_not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>mono F; x < F (iter na F 0); iter na F 0 \<le> x\<rbrakk> \<Longrightarrow> x < F x
[PROOF STEP]
apply (erule order_less_le_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>mono F; iter na F 0 \<le> x\<rbrakk> \<Longrightarrow> F (iter na F 0) \<le> F x
[PROOF STEP]
apply (erule monoD, assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Suc_Un_eq: "{n. n < Suc m} = {n. n < m} Un {n. n = m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. n < Suc m} = {n. n < m} \<union> {n. n = m}
[PROOF STEP]
by (auto simp add: less_Suc_eq)


[STATEMENT]
lemma T_integral_preserving:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes "integrable M f"
  shows "integrable M (\<lambda>x. f(T x))" "(\<integral>x. f(T x) \<partial>M) = (\<integral>x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. f (T x)) &&& LINT x|M. f (T x) = integral\<^sup>L M f
[PROOF STEP]
using measure_preserving_preserves_integral[OF Tm assms]
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. f (T x))
integral\<^sup>L M f = LINT x|M. f (T x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. f (T x)) &&& LINT x|M. f (T x) = integral\<^sup>L M f
[PROOF STEP]
by auto


[STATEMENT]
lemma prob_proj_inter: "prob_proj (prob_proj PROB vs1) vs2 = prob_proj PROB (vs1 \<inter> vs2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_proj (prob_proj PROB vs1) vs2 = prob_proj PROB (vs1 \<inter> vs2)
[PROOF STEP]
unfolding prob_proj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. action_proj a vs2) ` (\<lambda>a. action_proj a vs1) ` PROB = (\<lambda>a. action_proj a (vs1 \<inter> vs2)) ` PROB
[PROOF STEP]
using set_eq_iff image_iff action_proj_inter
[PROOF STATE]
proof (prove)
using this:
(?A = ?B) = (\<forall>x. (x \<in> ?A) = (x \<in> ?B))
(?z \<in> ?f ` ?A) = (\<exists>x\<in>?A. ?z = ?f x)
action_proj (action_proj ?a ?vs1.0) ?vs2.0 = action_proj ?a (?vs1.0 \<inter> ?vs2.0)

goal (1 subgoal):
 1. (\<lambda>a. action_proj a vs2) ` (\<lambda>a. action_proj a vs1) ` PROB = (\<lambda>a. action_proj a (vs1 \<inter> vs2)) ` PROB
[PROOF STEP]
supply[[smt_timeout=100]]
[PROOF STATE]
proof (prove)
using this:
(?A = ?B) = (\<forall>x. (x \<in> ?A) = (x \<in> ?B))
(?z \<in> ?f ` ?A) = (\<exists>x\<in>?A. ?z = ?f x)
action_proj (action_proj ?a ?vs1.0) ?vs2.0 = action_proj ?a (?vs1.0 \<inter> ?vs2.0)

goal (1 subgoal):
 1. (\<lambda>a. action_proj a vs2) ` (\<lambda>a. action_proj a vs1) ` PROB = (\<lambda>a. action_proj a (vs1 \<inter> vs2)) ` PROB
[PROOF STEP]
by (smt image_cong image_image)


[STATEMENT]
lemma comp_anti: "x \<le> y \<longleftrightarrow> -y \<le> -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (- y \<le> - x)
[PROOF STEP]
by (metis compl_le_swap2 double_compl)


[STATEMENT]
lemma expands_to_cos_ms_zero_exp:
  assumes e: "e = 0" and basis: "basis_wf (b # basis)"
  assumes F: "(f expands_to MS (MSLCons (C, e) xs) g) (b # basis)"
  assumes Sin: "((\<lambda>x. sin (c x)) expands_to Sin) basis"
  assumes Cos: "((\<lambda>x. cos (c x)) expands_to Cos) basis"
  assumes C: "eval C = c"
  shows   "((\<lambda>x. cos (f x)) expands_to
             MS (minus_ms_aux (scale_shift_ms_aux (Cos, 0) (cos_ms_aux' xs))
                              (scale_shift_ms_aux (Sin, 0) (sin_ms_aux' xs)))
                (\<lambda>x. cos (g x))) (b # basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. cos (f x)) expands_to MS (minus_ms_aux (scale_shift_ms_aux (Cos, 0) (cos_ms_aux' xs)) (scale_shift_ms_aux (Sin, 0) (sin_ms_aux' xs))) (\<lambda>x. cos (g x))) (b # basis)
[PROOF STEP]
using is_expansion_cos_ms_zero_exp[of b basis C xs g Sin Cos] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>basis_wf (b # basis); is_expansion (MS (MSLCons (C, 0) xs) g) (b # basis); ((\<lambda>x. sin (eval C x)) expands_to Sin) basis; ((\<lambda>x. cos (eval C x)) expands_to Cos) basis\<rbrakk> \<Longrightarrow> is_expansion (MS (minus_ms_aux (scale_shift_ms_aux (Cos, 0) (cos_ms_aux' xs)) (scale_shift_ms_aux (Sin, 0) (sin_ms_aux' xs))) (\<lambda>x. cos (g x))) (b # basis)
e = 0
basis_wf (b # basis)
(f expands_to MS (MSLCons (C, e) xs) g) (b # basis)
((\<lambda>x. sin (c x)) expands_to Sin) basis
((\<lambda>x. cos (c x)) expands_to Cos) basis
eval C = c

goal (1 subgoal):
 1. ((\<lambda>x. cos (f x)) expands_to MS (minus_ms_aux (scale_shift_ms_aux (Cos, 0) (cos_ms_aux' xs)) (scale_shift_ms_aux (Sin, 0) (sin_ms_aux' xs))) (\<lambda>x. cos (g x))) (b # basis)
[PROOF STEP]
by (auto simp: expands_to.simps elim: eventually_mono)


[STATEMENT]
lemma matrix_to_iarray_echelon_form_of_det[code_unfold]:
  "matrix_to_iarray (snd (echelon_form_of_det A bezout))
  = snd (echelon_form_of_det_iarrays (matrix_to_iarray A) bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (snd (echelon_form_of_det A bezout)) = snd (echelon_form_of_det_iarrays (matrix_to_iarray A) bezout)
[PROOF STEP]
unfolding echelon_form_of_det_def echelon_form_of_det_iarrays_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (ncols A - 1))) = snd (echelon_form_of_upt_k_det_iarrays (1::'a, matrix_to_iarray A) (ncols_iarray (matrix_to_iarray A) - 1) bezout)
[PROOF STEP]
unfolding matrix_to_iarray_ncols[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (ncols A - 1))) = snd (echelon_form_of_upt_k_det_iarrays (1::'a, matrix_to_iarray A) (ncols A - 1) bezout)
[PROOF STEP]
by (rule matrix_to_iarray_snd_echelon_form_of_upt_k_det, simp add: ncols_def)


[STATEMENT]
lemma mono_mndet_FD[simp]: "\<forall>x \<in> A. P x \<le> P' x \<Longrightarrow> (\<sqinter> x \<in> A \<rightarrow> (P x)) \<le> (\<sqinter> x \<in> A \<rightarrow> (P' x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. P x \<le> P' x \<Longrightarrow> mndet A P \<le> mndet A P'
[PROOF STEP]
apply(cases "A \<noteq> {}", auto simp:le_ref_def D_mndet F_mndet)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa xb. \<lbrakk>\<forall>x\<in>A. D (P' x) \<subseteq> D (P x) \<and> F (P' x) \<subseteq> F (P x); x \<in> A; xb \<in> A; xa \<in> D (xb \<rightarrow> P' xb)\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. xa \<in> D (x \<rightarrow> P x)
 2. \<And>x a b xa. \<lbrakk>\<forall>x\<in>A. D (P' x) \<subseteq> D (P x) \<and> F (P' x) \<subseteq> F (P x); x \<in> A; xa \<in> A; (a, b) \<in> F (xa \<rightarrow> P' xa)\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. (a, b) \<in> F (x \<rightarrow> P x)
[PROOF STEP]
by(meson contra_subsetD le_ref_def mono_write0_FD)+


[STATEMENT]
lemma C_nmsort:
  assumes [simp]: "length xs = n"
  shows "C_nmsort xs \<le> n + n * \<lceil>log 2 n\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
have [simp]: "xs = [] \<longleftrightarrow> length xs = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs = []) = (length xs = 0)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(xs = []) = (length xs = 0)

goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
have "int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (length (runs xs))\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real (length (runs xs)))\<rceil>
[PROOF STEP]
using C_merge_all' [of "runs xs"]
[PROOF STATE]
proof (prove)
using this:
int (C_merge_all (runs xs)) \<le> int (length (concat (runs xs))) * \<lceil>log 2 (real (length (runs xs)))\<rceil>

goal (1 subgoal):
 1. int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real (length (runs xs)))\<rceil>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real (length (runs xs)))\<rceil>

goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real (length (runs xs)))\<rceil>

goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
have "\<dots> \<le> int n * \<lceil>log 2 n\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int n * \<lceil>log 2 (real (length (runs xs)))\<rceil> \<le> int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
using length_runs [of xs]
[PROOF STATE]
proof (prove)
using this:
length (runs xs) \<le> length xs

goal (1 subgoal):
 1. int n * \<lceil>log 2 (real (length (runs xs)))\<rceil> \<le> int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
by (cases n) (auto intro!: runs_ne mult_mono ceiling_mono log2_mono)
[PROOF STATE]
proof (state)
this:
int n * \<lceil>log 2 (real (length (runs xs)))\<rceil> \<le> int n * \<lceil>log 2 (real n)\<rceil>

goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
have "int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 n\<rceil>"
[PROOF STATE]
proof (prove)
using this:
int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real n)\<rceil>

goal (1 subgoal):
 1. int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real n)\<rceil>

goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real n)\<rceil>

goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
have "C_runs xs \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C_runs xs \<le> n
[PROOF STEP]
using C_runs [of xs]
[PROOF STATE]
proof (prove)
using this:
C_runs xs \<le> length xs - 1

goal (1 subgoal):
 1. C_runs xs \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C_runs xs \<le> n

goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real n)\<rceil>
C_runs xs \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (C_merge_all (runs xs)) \<le> int n * \<lceil>log 2 (real n)\<rceil>
C_runs xs \<le> n

goal (1 subgoal):
 1. int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>
[PROOF STEP]
by (auto intro: add_mono)
[PROOF STATE]
proof (state)
this:
int (C_nmsort xs) \<le> int n + int n * \<lceil>log 2 (real n)\<rceil>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_less_multiset\<^sub>H\<^sub>O: "(M, N) \<in> mult {(x, y). x < y} \<longleftrightarrow> less_multiset\<^sub>H\<^sub>O M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M, N) \<in> mult {(x, y). x < y}) = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
unfolding multp_def[of "(<)", symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
using multp_eq_multp\<^sub>H\<^sub>O[of "(<)", simplified]
[PROOF STATE]
proof (prove)
using this:
multp (<) = multp\<^sub>H\<^sub>O (<)

goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>H\<^sub>O M N
[PROOF STEP]
by (simp add: multp\<^sub>H\<^sub>O_def less_multiset\<^sub>H\<^sub>O_def)


[STATEMENT]
lemma (in Corps) val_nscal_ge_selfTr:"\<lbrakk>valuation K v; x \<in> carrier K; 0 \<le> v x\<rbrakk>
       \<Longrightarrow>  v x \<le>  v (n \<times>\<^bsub>K\<^esub> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; 0 \<le> v x\<rbrakk> \<Longrightarrow> v x \<le> v ( n \<times>\<^bsub>K\<^esub> x)
[PROOF STEP]
apply (cut_tac field_is_ring, induct_tac n, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>valuation K v; x \<in> carrier K; 0 \<le> v x; Ring K\<rbrakk> \<Longrightarrow> v x \<le> v \<zero>
 2. \<And>n. \<lbrakk>valuation K v; x \<in> carrier K; 0 \<le> v x; Ring K; v x \<le> v ( n \<times>\<^bsub>K\<^esub> x)\<rbrakk> \<Longrightarrow> v x \<le> v ( Suc n \<times>\<^bsub>K\<^esub> x)
[PROOF STEP]
apply (simp add:value_of_zero,
       simp,
       frule_tac y = "n \<times>\<^bsub>K\<^esub> x" in amin_le_plus[of "v" "x"], assumption+,
       rule Ring.nsClose, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>valuation K v; x \<in> carrier K; 0 \<le> v x; Ring K; v x \<le> v ( n \<times>\<^bsub>K\<^esub> x); amin (v x) (v ( n \<times>\<^bsub>K\<^esub> x)) \<le> v (x \<plusminus>  n \<times>\<^bsub>K\<^esub> x)\<rbrakk> \<Longrightarrow> v x \<le> v ( n \<times>\<^bsub>K\<^esub> x \<plusminus> x)
[PROOF STEP]
apply (simp add:amin_def,
       frule Ring.ring_is_ag[of K],
       frule_tac n = n in Ring.nsClose[of K x], assumption+,
       simp add:aGroup.ag_pOp_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma length_finite_permutations_of_set:
  "xs \<in> permutations_of_set A \<Longrightarrow> length xs = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> permutations_of_set A \<Longrightarrow> length xs = card A
[PROOF STEP]
by (auto simp: permutations_of_set_def distinct_card)


[STATEMENT]
lemma vec_count_eq_list_count: "count (mset xs) a = count_vec (vec_of_list xs) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (mset xs) a = count_vec (vec_of_list xs) a
[PROOF STEP]
by (simp add: list_vec mset_vec_eq_mset_list)


[STATEMENT]
lemma maddux_24: "-(x ; y) + x ; z = -(x ; (y \<cdot> -z)) + x ; z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x ; y) + x ; z = - (x ; (y \<cdot> - z)) + x ; z
[PROOF STEP]
by (metis de_morgan_3 double_compl maddux_23)


[STATEMENT]
lemma word_less_sub_le[simp]:
  fixes x :: "'a :: len word"
  assumes nv: "n < LENGTH('a)"
  shows "(x \<le> 2 ^ n - 1) = (x < 2 ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> 2 ^ n - 1) = (x < 2 ^ n)
[PROOF STEP]
using le_less_trans word_le_minus_one_leq nv power_2_ge_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z
?x < ?y \<Longrightarrow> ?x \<le> ?y - 1
n < LENGTH('a)
(2 ^ ?n - 1 < 2 ^ ?n) = (?n < LENGTH(?'a))

goal (1 subgoal):
 1. (x \<le> 2 ^ n - 1) = (x < 2 ^ n)
[PROOF STEP]
by blast


[STATEMENT]
lemma sum_image_inj_card_helper :
  fixes l :: nat
  assumes "\<And> i . i \<le> l \<Longrightarrow> finite (I i)"
  and     "\<And> i j . i \<le> l \<Longrightarrow> j \<le> l \<Longrightarrow> i \<noteq> j \<Longrightarrow> I i \<inter> I j = {}"
shows "(\<Sum> i \<in> {..l} . (card (I i))) = card (\<Union> i \<in> {..l} . I i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<le> l \<Longrightarrow> finite (I ?i)
\<lbrakk>?i \<le> l; ?j \<le> l; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}

goal (1 subgoal):
 1. (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
[PROOF STEP]
proof (induction l)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<le> 0 \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> 0; j \<le> 0; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>0. card (I i)) = card (\<Union> (I ` {..0}))
 2. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?i \<le> 0 \<Longrightarrow> finite (I ?i)
\<lbrakk>?i \<le> 0; ?j \<le> 0; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<le> 0 \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> 0; j \<le> 0; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>0. card (I i)) = card (\<Union> (I ` {..0}))
 2. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<le> 0 \<Longrightarrow> finite (I ?i)
\<lbrakk>?i \<le> 0; ?j \<le> 0; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i \<le> 0 \<Longrightarrow> finite (I ?i)
\<lbrakk>?i \<le> 0; ?j \<le> 0; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}

goal (1 subgoal):
 1. (\<Sum>i\<le>0. card (I i)) = card (\<Union> (I ` {..0}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>0. card (I i)) = card (\<Union> (I ` {..0}))

goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
case (Suc l)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
?i \<le> Suc l \<Longrightarrow> finite (I ?i)
\<lbrakk>?i \<le> Suc l; ?j \<le> Suc l; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}

goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
?i \<le> Suc l \<Longrightarrow> finite (I ?i)
\<lbrakk>?i \<le> Suc l; ?j \<le> Suc l; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}
[PROOF STEP]
have "(\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
?i \<le> Suc l \<Longrightarrow> finite (I ?i)
\<lbrakk>?i \<le> Suc l; ?j \<le> Suc l; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}

goal (1 subgoal):
 1. (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
[PROOF STEP]
using le_Suc_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
?i \<le> Suc l \<Longrightarrow> finite (I ?i)
\<lbrakk>?i \<le> Suc l; ?j \<le> Suc l; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}
(?m \<le> Suc ?n) = (?m \<le> ?n \<or> ?m = Suc ?n)

goal (1 subgoal):
 1. (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))

goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))

goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
have "(\<Sum>i\<le>Suc l. card (I i)) = card (I (Suc l)) + (\<Sum>i\<le>l. card (I i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>Suc l. card (I i)) = card (I (Suc l)) + (\<Sum>i\<le>l. card (I i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc l. card (I i)) = card (I (Suc l)) + (\<Sum>i\<le>l. card (I i))

goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc l. card (I i)) = card (I (Suc l)) + (\<Sum>i\<le>l. card (I i))

goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
have "card (\<Union> (I ` {..Suc l})) = card (I (Suc l)) + card (\<Union> (I ` {..l}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> (I ` {..Suc l})) = card (I (Suc l)) + card (\<Union> (I ` {..l}))
[PROOF STEP]
using Suc.prems(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<le> Suc l; ?j \<le> Suc l; ?i \<noteq> ?j\<rbrakk> \<Longrightarrow> I ?i \<inter> I ?j = {}

goal (1 subgoal):
 1. card (\<Union> (I ` {..Suc l})) = card (I (Suc l)) + card (\<Union> (I ` {..l}))
[PROOF STEP]
by (simp add: Suc.prems(1) card_UN_disjoint)
[PROOF STATE]
proof (state)
this:
card (\<Union> (I ` {..Suc l})) = card (I (Suc l)) + card (\<Union> (I ` {..l}))

goal (1 subgoal):
 1. \<And>l. \<lbrakk>\<lbrakk>\<And>i. i \<le> l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> l; j \<le> l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l})); \<And>i. i \<le> Suc l \<Longrightarrow> finite (I i); \<And>i j. \<lbrakk>i \<le> Suc l; j \<le> Suc l; i \<noteq> j\<rbrakk> \<Longrightarrow> I i \<inter> I j = {}\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
(\<Sum>i\<le>Suc l. card (I i)) = card (I (Suc l)) + (\<Sum>i\<le>l. card (I i))
card (\<Union> (I ` {..Suc l})) = card (I (Suc l)) + card (\<Union> (I ` {..l}))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>l. card (I i)) = card (\<Union> (I ` {..l}))
(\<Sum>i\<le>Suc l. card (I i)) = card (I (Suc l)) + (\<Sum>i\<le>l. card (I i))
card (\<Union> (I ` {..Suc l})) = card (I (Suc l)) + card (\<Union> (I ` {..l}))

goal (1 subgoal):
 1. (\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc l. card (I i)) = card (\<Union> (I ` {..Suc l}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma outside_frontier_eq_complement_closure:
  fixes S :: "'a :: {real_normed_vector, perfect_space} set"
    assumes "bounded S" "convex S"
      shows "outside(frontier S) = - closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outside (frontier S) = - closure S
[PROOF STEP]
by (metis Diff_subset assms convex_closure frontier_def outside_frontier_misses_closure
          outside_subset_convex subset_antisym)


[STATEMENT]
lemma borel_eq_sigmaI4:
  fixes F :: "'i \<Rightarrow> 'a::topological_space set"
    and G :: "'l \<Rightarrow> 'k \<Rightarrow> 'a::topological_space set"
  assumes borel_eq: "borel = sigma UNIV ((\<lambda>(i, j). G i j)`A)"
  assumes X: "\<And>i j. (i, j) \<in> A \<Longrightarrow> G i j \<in> sets (sigma UNIV (range F))"
  assumes F: "\<And>i. F i \<in> sets borel"
  shows "borel = sigma UNIV (range F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. borel = sigma UNIV (range F)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
borel = sigma UNIV ((\<lambda>(i, j). G i j) ` A)
(?i, ?j) \<in> A \<Longrightarrow> G ?i ?j \<in> sets (sigma UNIV (range F))
F ?i \<in> sets borel

goal (1 subgoal):
 1. borel = sigma UNIV (range F)
[PROOF STEP]
by (intro borel_eq_sigmaI1[where X="(\<lambda>(i, j). G i j) ` A" and F=F]) auto


[STATEMENT]
theorem set_category_is_categorical:
  assumes "set_category S setp" and "set_category S' setp'"
  and "bij_betw \<phi> (set_category_data.Univ S) (set_category_data.Univ S')"
  and "\<And>A. A \<subseteq> set_category_data.Univ S \<Longrightarrow> setp' (\<phi> ` A) \<longleftrightarrow> setp A"
  shows "\<exists>\<Phi>. invertible_functor S S' \<Phi> \<and>
             (\<forall>m. set_category.incl S setp m \<longrightarrow> set_category.incl S' setp' (\<Phi> m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. set_category.incl S setp m \<longrightarrow> set_category.incl S' setp' (\<Phi> m))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. set_category.incl S setp m \<longrightarrow> set_category.incl S' setp' (\<Phi> m))
[PROOF STEP]
interpret S: set_category S setp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_category S setp
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
set_category S setp

goal (1 subgoal):
 1. set_category S setp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. S.incl m \<longrightarrow> set_category.incl S' setp' (\<Phi> m))
[PROOF STEP]
interpret S': set_category S' setp'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_category S' setp'
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
set_category S' setp'

goal (1 subgoal):
 1. set_category S' setp'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. S.incl m \<longrightarrow> S'.incl (\<Phi> m))
[PROOF STEP]
interpret two_set_categories_bij_betw_Univ S setp S' setp' \<phi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_set_categories_bij_betw_Univ S setp S' setp' \<phi>
[PROOF STEP]
apply (unfold_locales)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bij_betw \<phi> S.Univ S'.Univ
 2. \<And>A. A \<subseteq> S.Univ \<Longrightarrow> setp' (\<phi> ` A) = setp A
[PROOF STEP]
using assms(3-4)
[PROOF STATE]
proof (prove)
using this:
bij_betw \<phi> S.Univ S'.Univ
?A \<subseteq> S.Univ \<Longrightarrow> setp' (\<phi> ` ?A) = setp ?A

goal (2 subgoals):
 1. bij_betw \<phi> S.Univ S'.Univ
 2. \<And>A. A \<subseteq> S.Univ \<Longrightarrow> setp' (\<phi> ` A) = setp A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. S.incl m \<longrightarrow> S'.incl (\<Phi> m))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. S.incl m \<longrightarrow> S'.incl (\<Phi> m))
[PROOF STEP]
using are_isomorphic
[PROOF STATE]
proof (prove)
using this:
\<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. S.incl m \<longrightarrow> S'.incl (\<Phi> m))

goal (1 subgoal):
 1. \<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. S.incl m \<longrightarrow> S'.incl (\<Phi> m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>\<Phi>. invertible_functor S S' \<Phi> \<and> (\<forall>m. S.incl m \<longrightarrow> S'.incl (\<Phi> m))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in LCD) foldD_nest_Un_Int:
  "\<lbrakk>finite A; finite C; e \<in> D; A \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow>
   foldD D f (foldD D f e C) A = foldD D f (foldD D f e (A Int C)) (A Un C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite C; e \<in> D; A \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) A = foldD D (\<cdot>) (foldD D (\<cdot>) e (A \<inter> C)) (A \<union> C)
[PROOF STEP]
proof (induction set: finite)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>finite C; e \<in> D; {} \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) {} = foldD D (\<cdot>) (foldD D (\<cdot>) e ({} \<inter> C)) ({} \<union> C)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite C; e \<in> D; F \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) F = foldD D (\<cdot>) (foldD D (\<cdot>) e (F \<inter> C)) (F \<union> C); finite C; e \<in> D; insert x F \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) (insert x F) = foldD D (\<cdot>) (foldD D (\<cdot>) e (insert x F \<inter> C)) (insert x F \<union> C)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>finite C; e \<in> D; F \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) F = foldD D (\<cdot>) (foldD D (\<cdot>) e (F \<inter> C)) (F \<union> C)
finite C
e \<in> D
insert x F \<subseteq> B
C \<subseteq> B

goal (2 subgoals):
 1. \<lbrakk>finite C; e \<in> D; {} \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) {} = foldD D (\<cdot>) (foldD D (\<cdot>) e ({} \<inter> C)) ({} \<union> C)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>finite C; e \<in> D; F \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) F = foldD D (\<cdot>) (foldD D (\<cdot>) e (F \<inter> C)) (F \<union> C); finite C; e \<in> D; insert x F \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) (insert x F) = foldD D (\<cdot>) (foldD D (\<cdot>) e (insert x F \<inter> C)) (insert x F \<union> C)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
\<lbrakk>finite C; e \<in> D; F \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) F = foldD D (\<cdot>) (foldD D (\<cdot>) e (F \<inter> C)) (F \<union> C)
finite C
e \<in> D
insert x F \<subseteq> B
C \<subseteq> B
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>finite C; e \<in> D; F \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) F = foldD D (\<cdot>) (foldD D (\<cdot>) e (F \<inter> C)) (F \<union> C)
finite C
e \<in> D
insert x F \<subseteq> B
C \<subseteq> B

goal (1 subgoal):
 1. foldD D (\<cdot>) (foldD D (\<cdot>) e C) (insert x F) = foldD D (\<cdot>) (foldD D (\<cdot>) e (insert x F \<inter> C)) (insert x F \<union> C)
[PROOF STEP]
by (simp add: foldD_insert foldD_commute Int_insert_left insert_absorb Int_mono2)
[PROOF STATE]
proof (state)
this:
foldD D (\<cdot>) (foldD D (\<cdot>) e C) (insert x F) = foldD D (\<cdot>) (foldD D (\<cdot>) e (insert x F \<inter> C)) (insert x F \<union> C)

goal (1 subgoal):
 1. \<lbrakk>finite C; e \<in> D; {} \<subseteq> B; C \<subseteq> B\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) (foldD D (\<cdot>) e C) {} = foldD D (\<cdot>) (foldD D (\<cdot>) e ({} \<inter> C)) ({} \<union> C)
[PROOF STEP]
qed simp


[STATEMENT]
lemma locally_path_connected_space_retraction_map_image:
   "\<lbrakk>retraction_map X Y r; locally_path_connected_space X\<rbrakk>
        \<Longrightarrow> locally_path_connected_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_map X Y r; locally_path_connected_space X\<rbrakk> \<Longrightarrow> locally_path_connected_space Y
[PROOF STEP]
using Abstract_Topology.retraction_imp_quotient_map locally_path_connected_space_quotient_map_image
[PROOF STATE]
proof (prove)
using this:
retraction_map ?X ?Y ?f \<Longrightarrow> quotient_map ?X ?Y ?f
\<lbrakk>quotient_map ?X ?Y ?f; locally_path_connected_space ?X\<rbrakk> \<Longrightarrow> locally_path_connected_space ?Y

goal (1 subgoal):
 1. \<lbrakk>retraction_map X Y r; locally_path_connected_space X\<rbrakk> \<Longrightarrow> locally_path_connected_space Y
[PROOF STEP]
by blast


[STATEMENT]
lemma Cauchy_Schwarz_ineq_sum:
  fixes a :: "'a \<Rightarrow> 'b::linordered_field"
  shows "(\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
proof (cases "(\<Sum>i\<in>I. (b i)\<^sup>2) > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
 2. \<not> (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (2 subgoals):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
 2. \<not> (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
consider "\<And>i. i\<in>I \<Longrightarrow> b i = 0" | "infinite I"
[PROOF STATE]
proof (prove)
using this:
\<not> (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. \<lbrakk>(\<And>i. i \<in> I \<Longrightarrow> b i = (0::'b)) \<Longrightarrow> thesis; infinite I \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (metis (mono_tags, lifting) sum_pos2 zero_le_power2 zero_less_power2)
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<And>i. i \<in> I \<Longrightarrow> b i = (0::'b)) \<Longrightarrow> ?thesis; infinite I \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (2 subgoals):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
 2. \<not> (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<And>i. i \<in> I \<Longrightarrow> b i = (0::'b)) \<Longrightarrow> ?thesis; infinite I \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
(0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
define r where "r \<equiv> (\<Sum>i\<in>I. a i * b i) / (\<Sum>i\<in>I. (b i)\<^sup>2)"
[PROOF STATE]
proof (state)
this:
r \<equiv> (\<Sum>i\<in>I. a i * b i) / (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
(0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2)
r \<equiv> (\<Sum>i\<in>I. a i * b i) / (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
have *: "(\<Sum>i\<in>I. a i * b i) = r * (\<Sum>i\<in>I. (b i)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
(0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2)
r \<equiv> (\<Sum>i\<in>I. a i * b i) / (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (\<Sum>i\<in>I. a i * b i) = r * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. a i * b i) = r * (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
have "0 \<le> (\<Sum>i\<in>I. (a i - r * b i)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'b) \<le> (\<Sum>i\<in>I. (a i - r * b i)\<^sup>2)
[PROOF STEP]
by (meson sum_nonneg zero_le_power2)
[PROOF STATE]
proof (state)
this:
(0::'b) \<le> (\<Sum>i\<in>I. (a i - r * b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'b) \<le> (\<Sum>i\<in>I. (a i - r * b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
have "... = (\<Sum>i\<in>I. (a i)\<^sup>2) - 2 * r * (\<Sum>i\<in>I. a i * b i) + r\<^sup>2 * (\<Sum>i\<in>I. (b i)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. (a i - r * b i)\<^sup>2) = (\<Sum>i\<in>I. (a i)\<^sup>2) - (2::'b) * r * (\<Sum>i\<in>I. a i * b i) + r\<^sup>2 * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square sum_distrib_left flip: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. (a i - r * b i)\<^sup>2) = (\<Sum>i\<in>I. (a i)\<^sup>2) - (2::'b) * r * (\<Sum>i\<in>I. a i * b i) + r\<^sup>2 * (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. (a i - r * b i)\<^sup>2) = (\<Sum>i\<in>I. (a i)\<^sup>2) - (2::'b) * r * (\<Sum>i\<in>I. a i * b i) + r\<^sup>2 * (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i) * r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. (a i)\<^sup>2) - (2::'b) * r * (\<Sum>i\<in>I. a i * b i) + r\<^sup>2 * (\<Sum>i\<in>I. (b i)\<^sup>2) = (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i) * r
[PROOF STEP]
by (simp add: * power2_eq_square)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. (a i)\<^sup>2) - (2::'b) * r * (\<Sum>i\<in>I. a i * b i) + r\<^sup>2 * (\<Sum>i\<in>I. (b i)\<^sup>2) = (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i) * r

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. (a i)\<^sup>2) - (2::'b) * r * (\<Sum>i\<in>I. a i * b i) + r\<^sup>2 * (\<Sum>i\<in>I. (b i)\<^sup>2) = (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i) * r

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>I. (a i)\<^sup>2) - ((\<Sum>i\<in>I. a i * b i))\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i) * r = (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
by (simp add: r_def power2_eq_square)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i) * r = (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'b) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
have "0 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) - ((\<Sum>i\<in>I. a i * b i))\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
(0::'b) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'b) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
hence "((\<Sum>i\<in>I. a i * b i))\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
(0::'b) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) - (\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2)

goal (1 subgoal):
 1. (\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2)
[PROOF STEP]
by (simp add: le_diff_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2)

goal (1 subgoal):
 1. (0::'b) < (\<Sum>i\<in>I. (b i)\<^sup>2) \<Longrightarrow> (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
thus "((\<Sum>i\<in>I. a i * b i))\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>I. a i * b i)\<^sup>2 / (\<Sum>i\<in>I. (b i)\<^sup>2) \<le> (\<Sum>i\<in>I. (a i)\<^sup>2)

goal (1 subgoal):
 1. (\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)
[PROOF STEP]
by (simp add: pos_divide_le_eq True)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. a i * b i)\<^sup>2 \<le> (\<Sum>i\<in>I. (a i)\<^sup>2) * (\<Sum>i\<in>I. (b i)\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polymul_degreen:
  assumes "SORT_CONSTRAINT('a::field_char_0)"
  shows "isnpolyh p n0 \<Longrightarrow> isnpolyh q n1 \<Longrightarrow> m \<le> min n0 n1 \<Longrightarrow>
    degreen (p *\<^sub>p q) m = (if p = 0\<^sub>p \<or> q = 0\<^sub>p then 0 else degreen p m + degreen q m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isnpolyh p n0; isnpolyh q n1; m \<le> min n0 n1\<rbrakk> \<Longrightarrow> degreen (p *\<^sub>p q) m = (if p = 0\<^sub>p \<or> q = 0\<^sub>p then 0 else degreen p m + degreen q m)
[PROOF STEP]
by (fact polymul_properties(3))


[STATEMENT]
lemma "~~((P = Q) = ((Q | ~P) & (~Q|P)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (P = Q) \<noteq> ((Q \<or> \<not> P) \<and> (\<not> Q \<or> P))
[PROOF STEP]
by iprover


[STATEMENT]
lemma inf_absorb_less[simp]:
    "a < b \<Longrightarrow> inf a b = a"
    "a < b \<Longrightarrow> inf b a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a < b \<Longrightarrow> inf a b = a) &&& (a < b \<Longrightarrow> inf b a = a)
[PROOF STEP]
apply (metis le_iff_inf less_imp_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b \<Longrightarrow> inf b a = a
[PROOF STEP]
by (metis inf_commute le_iff_inf less_imp_le)


[STATEMENT]
lemma concat_pp_less: assumes "concat (take k ws) <p concat (take n ws)" shows "k < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < n
[PROOF STEP]
using le_take_pref[of n k ws, THEN pref_concat_pref] conjunct1[OF sprefD[OF assms]]
    conjunct2[OF sprefD[OF assms]] pref_antisym[of "concat(take k ws)" "concat(take n ws)"]
[PROOF STATE]
proof (prove)
using this:
n \<le> k \<Longrightarrow> concat (take n ws) \<le>p concat (take k ws)
concat (take k ws) \<le>p concat (take n ws)
concat (take k ws) \<noteq> concat (take n ws)
\<lbrakk>concat (take k ws) \<le>p concat (take n ws); concat (take n ws) \<le>p concat (take k ws)\<rbrakk> \<Longrightarrow> concat (take k ws) = concat (take n ws)

goal (1 subgoal):
 1. k < n
[PROOF STEP]
by fastforce


[STATEMENT]
lemma is_Arg_exp_Im: "is_Arg (exp z) (Im z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_Arg (exp z) (Im z)
[PROOF STEP]
using exp_eq_polar is_Arg_def norm_exp_eq_Re
[PROOF STATE]
proof (prove)
using this:
exp ?z = complex_of_real (exp (Re ?z)) * cis (Im ?z)
is_Arg ?z ?r \<equiv> ?z = complex_of_real (cmod ?z) * exp (\<i> * complex_of_real ?r)
cmod (exp ?z) = exp (Re ?z)

goal (1 subgoal):
 1. is_Arg (exp z) (Im z)
[PROOF STEP]
by auto


[STATEMENT]
lemma ack_less_mono1: "i < j \<Longrightarrow> ack i k < ack j k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < j \<Longrightarrow> ack i k < ack j k
[PROOF STEP]
using ack_less_mono1_aux less_iff_Suc_add
[PROOF STATE]
proof (prove)
using this:
ack ?i ?k < ack (Suc (?i + ?j)) ?k
(?m < ?n) = (\<exists>k. ?n = Suc (?m + k))

goal (1 subgoal):
 1. i < j \<Longrightarrow> ack i k < ack j k
[PROOF STEP]
by auto


[STATEMENT]
lemma mult_add_states:
  "multiply_mask (padd a b) \<pi> = add_masks (multiply_mask a \<pi>) (multiply_mask b \<pi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiply_mask (padd a b) \<pi> = add_masks (multiply_mask a \<pi>) (multiply_mask b \<pi>)
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. multiply_mask (padd a b) \<pi> x = add_masks (multiply_mask a \<pi>) (multiply_mask b \<pi>) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. multiply_mask (padd a b) \<pi> x = add_masks (multiply_mask a \<pi>) (multiply_mask b \<pi>) x
[PROOF STEP]
show "multiply_mask (padd a b) \<pi> x = add_masks (multiply_mask a \<pi>) (multiply_mask b \<pi>) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiply_mask (padd a b) \<pi> x = add_masks (multiply_mask a \<pi>) (multiply_mask b \<pi>) x
[PROOF STEP]
by (simp add: multiply_mask_def pmult_comm pmult_distr)
[PROOF STATE]
proof (state)
this:
multiply_mask (padd a b) \<pi> x = add_masks (multiply_mask a \<pi>) (multiply_mask b \<pi>) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Qp_p_int_pow_pow:
  fixes n::int
  fixes m::int
  shows "(\<pp> [^] (n*m)) = ((\<pp>[^]n)[^]m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pp> [^] (n * m) = (\<pp> [^] n) [^] m
[PROOF STEP]
using Qp_int_pow_pow p_nonzero
[PROOF STATE]
proof (prove)
using this:
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a [^] (?n * ?m) = (?a [^] ?n) [^] ?m
\<pp> \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. \<pp> [^] (n * m) = (\<pp> [^] n) [^] m
[PROOF STEP]
by blast


[STATEMENT]
lemma bigI:
  "c > 0 \<Longrightarrow> eventually (\<lambda>x. R (norm (f x)) (c * norm (g x))) F \<Longrightarrow> f \<in> L F (g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))\<rbrakk> \<Longrightarrow> f \<in> L F g
[PROOF STEP]
unfolding L_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))\<rbrakk> \<Longrightarrow> f \<in> {f. \<exists>c>0. \<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))}
[PROOF STEP]
by blast


[STATEMENT]
lemma Nset2_finite:"\<lbrakk> finite A; card A = Suc n\<rbrakk> \<Longrightarrow>
                       \<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; card A = Suc n\<rbrakk> \<Longrightarrow> \<exists>f. f \<in> {i. i \<le> n} \<rightarrow> A \<and> surj_to f {i. i \<le> n} A
[PROOF STEP]
by (simp add:Nset2_finiteTr)


[STATEMENT]
lemma all_lt_Max_imp_lt_mset: "N \<noteq> {#} \<Longrightarrow> (\<forall>a \<in># M. a < Max (set_mset N)) \<Longrightarrow> M < N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>N \<noteq> {#}; \<forall>a\<in>#M. a < Max_mset N\<rbrakk> \<Longrightarrow> M < N
[PROOF STEP]
by (meson Max_in[OF finite_set_mset] ex_gt_imp_less_multiset set_mset_eq_empty_iff)


[STATEMENT]
lemma (in monoid) inv_eq_one_eq: "x \<in> Units G \<Longrightarrow> inv x = \<one> \<longleftrightarrow> x = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Units G \<Longrightarrow> (inv x = \<one>) = (x = \<one>)
[PROOF STEP]
by (metis Units_inv_inv inv_one)


[STATEMENT]
lemma bigoI_tendsto:
  assumes "((\<lambda>x. f x / g x) \<longlongrightarrow> c) F"
  assumes "eventually (\<lambda>x. g x \<noteq> 0) F"
  shows   "f \<in> O[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x / g x) \<longlongrightarrow> c) F
\<forall>\<^sub>F x in F. g x \<noteq> (0::'b)

goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
by (rule bigoI_tendsto_norm[OF tendsto_norm])


[STATEMENT]
lemma closed_Un'':
  assumes "S \<subseteq> U"
    and "T \<subseteq> U"
    and "topological_space_ow U \<tau>"
    and "closed_ow U \<tau> S"
    and "closed_ow U \<tau> T"
  shows "closed_ow U \<tau> (S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_ow U \<tau> (S \<union> T)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> U
T \<subseteq> U
topological_space_ow U \<tau>
closed_ow U \<tau> S
closed_ow U \<tau> T

goal (1 subgoal):
 1. closed_ow U \<tau> (S \<union> T)
[PROOF STEP]
unfolding topological_space_ow_def
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> U
T \<subseteq> U
\<tau> U \<and> (\<forall>K\<in>Pow (Pow U). Ball K \<tau> \<longrightarrow> \<tau> (\<Union> K)) \<and> (\<forall>S\<in>Pow U. \<forall>T\<in>Pow U. \<tau> S \<longrightarrow> \<tau> T \<longrightarrow> \<tau> (S \<inter> T))
closed_ow U \<tau> S
closed_ow U \<tau> T

goal (1 subgoal):
 1. closed_ow U \<tau> (S \<union> T)
[PROOF STEP]
by (cases \<open>U = {}\<close>) (auto simp: assms(3) closed_Un' subset_iff)


[STATEMENT]
lemma orthogonal_self: "orthogonal x x \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal x x = (x = (0::'a))
[PROOF STEP]
by (simp add: orthogonal_def)


[STATEMENT]
lemma 3: "poly_mod_prime_type TYPE('b) m = (m = int CARD('b))"
  and 4: "class.prime_card TYPE('b :: prime_card) = prime CARD('b :: prime_card)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mod_prime_type TYPE('b) m = (m = int CARD('b)) &&& class.prime_card TYPE('b) = prime CARD('b)
[PROOF STEP]
unfolding poly_mod_type_def class.prime_card_def class.nontriv_def poly_mod_prime_type_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m = int CARD('b)) = (m = int CARD('b)) &&& prime CARD('b) = prime CARD('b)
[PROOF STEP]
by auto


[STATEMENT]
lemma ChiRel_ChiPlus_trans:
   "\<lbrakk> (U,S) \<in> ChiPlus A; (S,T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (U,T) \<in> ChiPlus A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(U, S) \<in> ChiPlus A; (S, T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (U, T) \<in> ChiPlus A
[PROOF STEP]
apply (unfold ChiPlus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(U, S) \<in> (ChiRel A)\<^sup>+; (S, T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (U, T) \<in> (ChiRel A)\<^sup>+
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mset_le_subtract_right: "A+B \<subseteq># (X::'a multiset) \<Longrightarrow> A \<subseteq># X-B \<and> B\<subseteq>#X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B \<subseteq># X \<Longrightarrow> A \<subseteq># X - B \<and> B \<subseteq># X
[PROOF STEP]
by (auto dest: mset_le_subtract[of "A+B" "X" "B"] mset_union_subset)


[STATEMENT]
lemma frequently_at_top:
  "(\<exists>\<^sub>F t in at_top. P t) \<longleftrightarrow> (\<forall>t0. \<exists>t>t0. P t)"
  for P::"'a::{linorder,no_top}\<Rightarrow>bool"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frequently P at_top = (\<forall>t0. \<exists>t>t0. P t)
[PROOF STEP]
by (auto simp: frequently_def eventually_at_top_dense)


[STATEMENT]
lemma negligible_divide_polynomial1 [negligible_intros]:
  "\<lbrakk> polynomial f; negligible (\<lambda>\<eta>. 1 / g \<eta>) \<rbrakk> \<Longrightarrow> negligible (\<lambda>\<eta>. real (f \<eta>) / g \<eta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>polynomial (\<lambda>x. real (f x)); negligible (\<lambda>\<eta>. 1 / g \<eta>)\<rbrakk> \<Longrightarrow> negligible (\<lambda>\<eta>. real (f \<eta>) / g \<eta>)
[PROOF STEP]
by(clarsimp simp add: polynomial.simps negligible_divide_poly1)


[STATEMENT]
lemma (in Ring) ideal_nsum_closedTr:"ideal R I \<Longrightarrow>
                                      (\<forall>j \<le> n. f j \<in> I) \<longrightarrow>  nsum R f n \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal R I \<Longrightarrow> (\<forall>j\<le>n. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> I
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ideal R I \<Longrightarrow> (\<forall>j\<le>0. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f 0 \<in> I
 2. \<And>n. \<lbrakk>ideal R I; (\<forall>j\<le>n. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> I\<rbrakk> \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> I
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>ideal R I; \<forall>j\<le>0. f j \<in> I\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R f 0 \<in> I
 2. \<And>n. \<lbrakk>ideal R I; (\<forall>j\<le>n. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> I\<rbrakk> \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> I
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R I; (\<forall>j\<le>n. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> I\<rbrakk> \<Longrightarrow> (\<forall>j\<le>Suc n. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> I
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R I; (\<forall>j\<le>n. f j \<in> I) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> I; \<forall>j\<le>Suc n. f j \<in> I\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> I
[PROOF STEP]
apply (cut_tac n = n in Nsetn_sub_mem1, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R I; \<Sigma>\<^sub>e R f n \<in> I; \<forall>j\<le>Suc n. f j \<in> I\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R f n \<plusminus> f (Suc n) \<in> I
[PROOF STEP]
apply (rule ideal_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R I; \<Sigma>\<^sub>e R f n \<in> I; \<forall>j\<le>Suc n. f j \<in> I\<rbrakk> \<Longrightarrow> f (Suc n) \<in> I
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pairs_le_eq_Sigma: "{(i, j). i + j \<le> m} = Sigma (atMost m) (\<lambda>r. atMost (m - r))"
  for m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(i, j). i + j \<le> m} = (SIGMA r:{..m}. {..m - r})
[PROOF STEP]
by auto


[STATEMENT]
lemma gi_is_fi_minus_sum_mu_gso:
  assumes i: "i < m"
  shows "gso i = fs ! i - sumlist (map (\<lambda> j. \<mu> i j \<cdot>\<^sub>v gso j) [0 ..< i])" (is "_ = _ - ?sum")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gso i = fs ! i - M.sumlist (map (\<lambda>j. \<mu> i j \<cdot>\<^sub>v gso j) [0..<i])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gso i = fs ! i - M.sumlist (map (\<lambda>j. \<mu> i j \<cdot>\<^sub>v gso j) [0..<i])
[PROOF STEP]
have sum: "?sum \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M.sumlist (map (\<lambda>j. \<mu> i j \<cdot>\<^sub>v gso j) [0..<i]) \<in> carrier_vec n
[PROOF STEP]
by (rule sumlist_carrier, insert gso_carrier i, auto)
[PROOF STATE]
proof (state)
this:
M.sumlist (map (\<lambda>j. \<mu> i j \<cdot>\<^sub>v gso j) [0..<i]) \<in> carrier_vec n

goal (1 subgoal):
 1. gso i = fs ! i - M.sumlist (map (\<lambda>j. \<mu> i j \<cdot>\<^sub>v gso j) [0..<i])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gso i = fs ! i - M.sumlist (map (\<lambda>j. \<mu> i j \<cdot>\<^sub>v gso j) [0..<i])
[PROOF STEP]
unfolding fs_by_gso_def[OF i]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gso i = gso i + M.sumlist (map (\<lambda>ja. \<mu> i ja \<cdot>\<^sub>v gso ja) [0..<i]) - M.sumlist (map (\<lambda>j. \<mu> i j \<cdot>\<^sub>v gso j) [0..<i])
[PROOF STEP]
by (intro eq_vecI, insert gso_carrier[OF i] sum, auto)
[PROOF STATE]
proof (state)
this:
gso i = fs ! i - M.sumlist (map (\<lambda>j. \<mu> i j \<cdot>\<^sub>v gso j) [0..<i])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_span_eq_card_independent: "independent B \<Longrightarrow> dim (span B) = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent B \<Longrightarrow> dim (span B) = card B
[PROOF STEP]
by (simp add: dim_eq_card)


[STATEMENT]
lemma zero_less_double_add_iff_zero_less_single_add [simp]: "0 < a + a \<longleftrightarrow> 0 < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) < a + a) = ((0::'a) < a)
[PROOF STEP]
by (meson le_less_trans less_add_same_cancel2 less_le_not_le
      zero_le_double_add_iff_zero_le_single_add)


[STATEMENT]
lemma convex_hull_translation:
  "convex hull ((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` (convex hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull (+) a ` S = (+) a ` (convex hull S)
[PROOF STEP]
unfolding translation_eq_singleton_plus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull ({a} + S) = {a} + convex hull S
[PROOF STEP]
by (simp only: convex_hull_set_plus convex_hull_singleton)


[STATEMENT]
lemma p_gt_2: "p > 2" and odd_p: "odd p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 < p &&& odd p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 < p
 2. odd p
[PROOF STEP]
from prime_p and cong_1_p
[PROOF STATE]
proof (chain)
picking this:
prime p
[p = 1] (mod 4)
[PROOF STEP]
have "p > 1" "p \<noteq> 2"
[PROOF STATE]
proof (prove)
using this:
prime p
[p = 1] (mod 4)

goal (1 subgoal):
 1. 1 < p &&& p \<noteq> 2
[PROOF STEP]
by (auto simp: prime_gt_Suc_0_nat cong_def)
[PROOF STATE]
proof (state)
this:
1 < p
p \<noteq> 2

goal (2 subgoals):
 1. 2 < p
 2. odd p
[PROOF STEP]
thus "p > 2"
[PROOF STATE]
proof (prove)
using this:
1 < p
p \<noteq> 2

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

goal (1 subgoal):
 1. odd p
[PROOF STEP]
with prime_p
[PROOF STATE]
proof (chain)
picking this:
prime p
2 < p
[PROOF STEP]
show "odd p"
[PROOF STATE]
proof (prove)
using this:
prime p
2 < p

goal (1 subgoal):
 1. odd p
[PROOF STEP]
using primes_dvd_imp_eq two_is_prime_nat
[PROOF STATE]
proof (prove)
using this:
prime p
2 < p
\<lbrakk>prime ?p; prime ?q; ?p dvd ?q\<rbrakk> \<Longrightarrow> ?p = ?q
prime 2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measure_count_space: "measure (count_space A) X = (if X \<subseteq> A then of_nat (card X) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (count_space A) X = (if X \<subseteq> A then real (card X) else 0)
[PROOF STEP]
by (cases "finite X") (auto simp: measure_notin_sets ennreal_of_nat_eq_real_of_nat
                                    measure_zero_top measure_eq_emeasure_eq_ennreal)


[STATEMENT]
lemma f_pos:
  assumes "g \<in> \<Omega>(h)"
  assumes "eventually (\<lambda>x. h x > 0) at_top"
  shows   "eventually (\<lambda>x. f x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 < f x
[PROOF STEP]
using g_pos[OF assms(1,2)] eventually_ge_at_top[of x\<^sub>1]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. 0 < g x
eventually ((\<le>) x\<^sub>1) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. 0 < f x
[PROOF STEP]
by (eventually_elim) (subst f_rec, insert step_ge_x0,
         auto intro!: add_pos_nonneg sum_nonneg mult_nonneg_nonneg[OF a_ge_0] f_nonneg)


[STATEMENT]
lemma deformation_retract_relative_homology_group_isomorphism_id:
   "\<lbrakk>retraction_maps X Y r id; V \<subseteq> U; r ` U \<subseteq> V; homotopic_with (\<lambda>h. h ` U \<subseteq> U) X X r id\<rbrakk>
    \<Longrightarrow> (hom_induced p Y V X U id) \<in> iso (relative_homology_group p Y V) (relative_homology_group p X U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_maps X Y r id; V \<subseteq> U; r ` U \<subseteq> V; homotopic_with (\<lambda>h. h ` U \<subseteq> U) X X r id\<rbrakk> \<Longrightarrow> hom_induced p Y V X U id \<in> Group.iso (relative_homology_group p Y V) (relative_homology_group p X U)
[PROOF STEP]
by (metis deformation_retract_relative_homology_group_isomorphisms group_isomorphisms_imp_iso group_isomorphisms_sym)


[STATEMENT]
lemma Sublists_conv_Prefixes: "Sublists A = Prefixes (Suffixes A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sublists A = Prefixes (Suffixes A)
[PROOF STEP]
by (auto simp: Sublists_def Prefixes_def Suffixes_def sublist_def)


[STATEMENT]
lemma con_Suc_card_arcs_eq_card_verts:
  "\<lbrakk>graph G; connected G\<rbrakk> \<Longrightarrow> Suc (card (arcs T)) = card (verts G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>graph G; Digraph_Component.connected G\<rbrakk> \<Longrightarrow> Suc (card (arcs T)) = card (verts G)
[PROOF STEP]
using Suc_card_arcs_eq_card_verts connected_verts_G_eq_T Suc_card_if_graph
[PROOF STATE]
proof (prove)
using this:
finite (verts T) \<Longrightarrow> Suc (card (arcs T)) = card (verts T)
\<lbrakk>graph G; Digraph_Component.connected G\<rbrakk> \<Longrightarrow> verts T = verts G
graph G \<Longrightarrow> \<exists>n. Suc n = card (verts G)

goal (1 subgoal):
 1. \<lbrakk>graph G; Digraph_Component.connected G\<rbrakk> \<Longrightarrow> Suc (card (arcs T)) = card (verts G)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma int_of_uint64_shift: "int_of_uint64 (drop_bit k n) = (int_of_uint64 n) div (2 ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_uint64 (drop_bit k n) = int_of_uint64 n div 2 ^ k
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k n. uint (drop_bit k n) = uint n div 2 ^ k
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k n. take_bit LENGTH(64) ((drop_bit k \<circ> take_bit LENGTH(64)) n) = take_bit LENGTH(64) n div 2 ^ k
[PROOF STEP]
apply (simp add: take_bit_drop_bit min_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k n. 0 < k \<longrightarrow> drop_bit k (take_bit 64 n) = take_bit 64 n div 2 ^ k
[PROOF STEP]
apply (simp add: drop_bit_eq_div)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma addcol_mat: assumes A: "A \<in> carrier_mat nr n"
  and k: "k < n"
  shows "addcol (a :: 'a :: comm_semiring_1) l k A = A * addrow_mat n a k l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addcol a l k A = A * addrow_mat n a k l
[PROOF STEP]
by (rule eq_matI, insert A k, auto simp: col_addrow
  scalar_prod_add_distrib[of _ n] scalar_prod_smult_distrib[of _ n])


[STATEMENT]
lemma sublist_list_if_is_Nil_conv: "
  (sublist_list_if xs ys = []) = (list_all (\<lambda>i. length xs \<le> i) ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sublist_list_if xs ys = []) = list_all ((\<le>) (length xs)) ys
[PROOF STEP]
by (simp add: sublist_list_if_sublist_list_filter_conv sublist_list_is_Nil_conv filter_empty_conv list_all_iff linorder_not_less)


[STATEMENT]
lemma degree_of_int_poly':
  assumes "of_int (lead_coeff p) \<noteq> (0 :: 'a :: ring_1)"
  shows "degree (of_int_poly p :: 'a poly) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (of_int_poly p) = degree p
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree (of_int_poly p) \<le> degree p
 2. degree p \<le> degree (of_int_poly p)
[PROOF STEP]
show "degree (of_int_poly p) \<le> degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (of_int_poly p) \<le> degree p
[PROOF STEP]
by (intro degree_le) (auto simp: coeff_eq_0)
[PROOF STATE]
proof (state)
this:
degree (of_int_poly p) \<le> degree p

goal (1 subgoal):
 1. degree p \<le> degree (of_int_poly p)
[PROOF STEP]
show "degree (of_int_poly p :: 'a poly) \<ge> degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p \<le> degree (of_int_poly p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
of_int (lead_coeff p) \<noteq> (0::'a)

goal (1 subgoal):
 1. degree p \<le> degree (of_int_poly p)
[PROOF STEP]
by (intro le_degree) auto
[PROOF STATE]
proof (state)
this:
degree p \<le> degree (of_int_poly p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enat_Suc_nonzero[simp]:
shows "enat (Suc n)\<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat (Suc n) \<noteq> 0
[PROOF STEP]
by (metis Zero_not_Suc enat.inject zero_enat_def)


[STATEMENT]
lemma sylvester_index_mat:
  fixes p q
  defines "m \<equiv> degree p" and "n \<equiv> degree q"
  assumes i: "i < m+n" and j: "j < m+n"
  shows "sylvester_mat p q $$ (i,j) =
    (if i < n then
       if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else 0
     else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sylvester_mat p q $$ (i, j) = (if i < n then if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else (0::'a) else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a))
[PROOF STEP]
unfolding sylvester_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sylvester_mat_sub (degree p) (degree q) p q $$ (i, j) = (if i < n then if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else (0::'a) else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a))
[PROOF STEP]
using sylvester_mat_sub_index[OF i j]
[PROOF STATE]
proof (prove)
using this:
sylvester_mat_sub m n ?p ?q $$ (i, j) = (if i < n then if i \<le> j \<and> j - i \<le> m then coeff ?p (m + i - j) else (0::?'a) else if i - n \<le> j \<and> j \<le> i then coeff ?q (i - j) else (0::?'a))

goal (1 subgoal):
 1. sylvester_mat_sub (degree p) (degree q) p q $$ (i, j) = (if i < n then if i \<le> j \<and> j - i \<le> m then coeff p (m + i - j) else (0::'a) else if i - n \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a))
[PROOF STEP]
unfolding m_def n_def
[PROOF STATE]
proof (prove)
using this:
sylvester_mat_sub (degree p) (degree q) ?p ?q $$ (i, j) = (if i < degree q then if i \<le> j \<and> j - i \<le> degree p then coeff ?p (degree p + i - j) else (0::?'a) else if i - degree q \<le> j \<and> j \<le> i then coeff ?q (i - j) else (0::?'a))

goal (1 subgoal):
 1. sylvester_mat_sub (degree p) (degree q) p q $$ (i, j) = (if i < degree q then if i \<le> j \<and> j - i \<le> degree p then coeff p (degree p + i - j) else (0::'a) else if i - degree q \<le> j \<and> j \<le> i then coeff q (i - j) else (0::'a))
[PROOF STEP]
.


[STATEMENT]
lemma ChiRel_ChiStar_trans:
  "\<lbrakk> (S,U) \<in> ChiStar A; (U,T) \<in> ChiRel A \<rbrakk> \<Longrightarrow> (S,T) \<in> ChiStar A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(S, U) \<in> ChiStar A; (U, T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (S, T) \<in> ChiStar A
[PROOF STEP]
apply (unfold ChiStar_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(S, U) \<in> (ChiRel A)\<^sup>*; (U, T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (S, T) \<in> (ChiRel A)\<^sup>*
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ereal_of_enat_le_iff[simp]: "ereal_of_enat m \<le> ereal_of_enat n \<longleftrightarrow> m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ereal_of_enat m \<le> ereal_of_enat n) = (m \<le> n)
[PROOF STEP]
by (cases m n rule: enat2_cases) auto


[STATEMENT]
lemma intrinsic_border_take_less: "j > 0 \<Longrightarrow> w \<noteq> [] \<Longrightarrow> length (intrinsic_border (take j w)) < length w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < j; w \<noteq> []\<rbrakk> \<Longrightarrow> length (intrinsic_border (take j w)) < length w
[PROOF STEP]
by (metis intrinsic_border_less length_take less_not_refl2 min_less_iff_conj take_eq_Nil)