[STATEMENT]
lemma adjoint_def_alter:
  fixes v w :: "'a::conjugatable_field vec"
    and A :: "'a::conjugatable_field mat"
  assumes dims: "v \<in> carrier_vec n" "w \<in> carrier_vec m" "A \<in> carrier_mat n m"
  shows "inner_prod v (A *\<^sub>v w) = inner_prod (adjoint A *\<^sub>v v) w" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v w) = inner_prod (adjoint A *\<^sub>v v) w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v w) = inner_prod (adjoint A *\<^sub>v v) w
[PROOF STEP]
from dims
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec n
w \<in> carrier_vec m
A \<in> carrier_mat n m
[PROOF STEP]
have "?lhs = (\<Sum>i=0..<dim_vec v. (\<Sum>j=0..<dim_vec w.
                conjugate (v$i) * A$$(i, j) * w$j))"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec m
A \<in> carrier_mat n m

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v w) = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)
[PROOF STEP]
apply (simp add: scalar_prod_def sum_distrib_right )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; w \<in> carrier_vec m; A \<in> carrier_mat n m\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<n. \<Sum>n = 0..<m. A $$ (i, n) * w $ n * conjugate (v $ i)) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (v $ i) * A $$ (i, j) * w $ j)
[PROOF STEP]
apply (rule sum.cong, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>v \<in> carrier_vec n; w \<in> carrier_vec m; A \<in> carrier_mat n m; x \<in> {0..<n}\<rbrakk> \<Longrightarrow> (\<Sum>n = 0..<m. A $$ (x, n) * w $ n * conjugate (v $ x)) = (\<Sum>j = 0..<m. conjugate (v $ x) * A $$ (x, j) * w $ j)
[PROOF STEP]
apply (rule sum.cong, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inner_prod v (A *\<^sub>v w) = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v w) = inner_prod (adjoint A *\<^sub>v v) w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inner_prod v (A *\<^sub>v w) = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v w) = inner_prod (adjoint A *\<^sub>v v) w
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec n
w \<in> carrier_vec m
A \<in> carrier_mat n m
[PROOF STEP]
have "?rhs = (\<Sum>i=0..<dim_vec v. (\<Sum>j=0..<dim_vec w.
                conjugate (v$i) * A$$(i, j) * w$j))"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec m
A \<in> carrier_mat n m

goal (1 subgoal):
 1. inner_prod (adjoint A *\<^sub>v v) w = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)
[PROOF STEP]
apply (simp add: scalar_prod_def  adjoint_eval
                     sum_conjugate conjugate_dist_mul sum_distrib_left)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; w \<in> carrier_vec m; A \<in> carrier_mat n m\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<m. \<Sum>n = 0..<n. w $ i * (A $$ (n, i) * conjugate (v $ n))) = (\<Sum>i = 0..<n. \<Sum>j = 0..<m. conjugate (v $ i) * A $$ (i, j) * w $ j)
[PROOF STEP]
apply (subst sum.swap[where ?A = "{0..<n}"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; w \<in> carrier_vec m; A \<in> carrier_mat n m\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<m. \<Sum>n = 0..<n. w $ i * (A $$ (n, i) * conjugate (v $ n))) = (\<Sum>j = 0..<m. \<Sum>i = 0..<n. conjugate (v $ i) * A $$ (i, j) * w $ j)
[PROOF STEP]
apply (rule sum.cong, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>v \<in> carrier_vec n; w \<in> carrier_vec m; A \<in> carrier_mat n m; x \<in> {0..<m}\<rbrakk> \<Longrightarrow> (\<Sum>n = 0..<n. w $ x * (A $$ (n, x) * conjugate (v $ n))) = (\<Sum>i = 0..<n. conjugate (v $ i) * A $$ (i, x) * w $ x)
[PROOF STEP]
apply (rule sum.cong, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inner_prod (adjoint A *\<^sub>v v) w = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v w) = inner_prod (adjoint A *\<^sub>v v) w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inner_prod v (A *\<^sub>v w) = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)
inner_prod (adjoint A *\<^sub>v v) w = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inner_prod v (A *\<^sub>v w) = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)
inner_prod (adjoint A *\<^sub>v v) w = (\<Sum>i = 0..<dim_vec v. \<Sum>j = 0..<dim_vec w. conjugate (v $ i) * A $$ (i, j) * w $ j)

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v w) = inner_prod (adjoint A *\<^sub>v v) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inner_prod v (A *\<^sub>v w) = inner_prod (adjoint A *\<^sub>v v) w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conv_radius_altdef:
  "conv_radius f = liminf (\<lambda>n. inverse (ereal (root n (norm (f n)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius f = liminf (\<lambda>n. inverse (ereal (root n (norm (f n)))))
[PROOF STEP]
by (subst Liminf_inverse_ereal) (simp_all add: real_root_ge_zero conv_radius_def)


[STATEMENT]
lemma singleton_matrix_add: "singleton_matrix j i ((a::_::monoid_add)+b) = (singleton_matrix j i a) + (singleton_matrix j i b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singleton_matrix j i (a + b) = singleton_matrix j i a + singleton_matrix j i b
[PROOF STEP]
apply (subst Rep_matrix_inject[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_matrix (singleton_matrix j i (a + b)) = Rep_matrix (singleton_matrix j i a + singleton_matrix j i b)
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. Rep_matrix (singleton_matrix j i (a + b)) x xa = Rep_matrix (singleton_matrix j i a + singleton_matrix j i b) x xa
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem (in Group) iso_class_reps :
  defines "GIRRS \<equiv> GIrrRep_repset :: ('f::field,'g) aezfun set set"
  assumes "of_nat (card G) \<noteq> (0::'f)"
  shows "finite GIRRS"
        "\<forall>U\<in>GIRRS. IrrFinGroupRepresentation G (*) U"
        "\<And>U W. \<lbrakk> U \<in> GIRRS; W \<in> GIRRS; U \<noteq> W \<rbrakk>
              \<Longrightarrow> \<not> (FGModule.isomorphic G (*) U (*) W)"
        "\<And>fgsmult V. IrrFinGroupRepresentation G fgsmult V
              \<Longrightarrow> \<exists>U\<in>GIRRS. FGModule.isomorphic G fgsmult V (*) U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (finite GIRRS &&& \<forall>U\<in>GIRRS. IrrFinGroupRepresentation G (*) U) &&& (\<And>U W. \<lbrakk>U \<in> GIRRS; W \<in> GIRRS; U \<noteq> W\<rbrakk> \<Longrightarrow> \<nexists>T. FGModuleIso G (*) U (*) T W) &&& (\<And>fgsmult V. IrrFinGroupRepresentation G fgsmult V \<Longrightarrow> \<exists>U\<in>GIRRS. \<exists>T. FGModuleIso G fgsmult V (*) T U)
[PROOF STEP]
using assms finite_GIrrRep_repset all_irr_GIrrRep_repset
        isodistinct_GIrrRep_repset IrrFinGroupRepresentation.iso_to_GIrrRep_rep
[PROOF STATE]
proof (prove)
using this:
GIRRS \<equiv> GIrrRep_repset
of_nat (card G) \<noteq> (0::'f)
finite GIrrRep_repset
of_nat (card G) \<noteq> (0::?'f) \<Longrightarrow> \<forall>U\<in>GIrrRep_repset. IrrFinGroupRepresentation G (*) U
\<lbrakk>of_nat (card G) \<noteq> (0::?'f); ?V \<in> GIrrRep_repset; ?W \<in> GIrrRep_repset; ?V \<noteq> ?W\<rbrakk> \<Longrightarrow> \<nexists>T. FGModuleIso G (*) ?V (*) T ?W
IrrFinGroupRepresentation ?G ?smult ?V \<Longrightarrow> \<exists>U\<in>Group.GIrrRep_repset ?G. \<exists>T. FGModuleIso ?G ?smult ?V (*) T U

goal (1 subgoal):
 1. (finite GIRRS &&& \<forall>U\<in>GIRRS. IrrFinGroupRepresentation G (*) U) &&& (\<And>U W. \<lbrakk>U \<in> GIRRS; W \<in> GIRRS; U \<noteq> W\<rbrakk> \<Longrightarrow> \<nexists>T. FGModuleIso G (*) U (*) T W) &&& (\<And>fgsmult V. IrrFinGroupRepresentation G fgsmult V \<Longrightarrow> \<exists>U\<in>GIRRS. \<exists>T. FGModuleIso G fgsmult V (*) T U)
[PROOF STEP]
by    auto


[STATEMENT]
lemma Z_alt_def: "Z n m = {f. f \<in> {0..<n} \<rightarrow> {0..<m} \<and> (\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i)} \<times> {\<pi>. \<pi> permutes {0..<n}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Z n m = {f \<in> {0..<n} \<rightarrow> {0..<m}. \<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i} \<times> {\<pi>. \<pi> permutes {0..<n}}
[PROOF STEP]
unfolding Z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(f, \<pi>) |f \<pi>. f \<in> {0..<n} \<rightarrow> {0..<m} \<and> (\<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i) \<and> \<pi> permutes {0..<n}} = {f \<in> {0..<n} \<rightarrow> {0..<m}. \<forall>i. i \<notin> {0..<n} \<longrightarrow> f i = i} \<times> {\<pi>. \<pi> permutes {0..<n}}
[PROOF STEP]
by auto


[STATEMENT]
lemma uniform_lim_mult:
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_algebra"
  assumes f: "uniform_limit S f l F"
      and g: "uniform_limit S g m F"
      and l: "bounded (l ` S)"
      and m: "bounded (m ` S)"
    shows "uniform_limit S (\<lambda>a b. f a b * g a b) (\<lambda>a. l a * m a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit S (\<lambda>a b. f a b * g a b) (\<lambda>a. l a * m a) F
[PROOF STEP]
by (intro bounded_bilinear_bounded_uniform_limit_intros assms)


[STATEMENT]
lemma (in vec_space) det_rank_iff:
assumes "A \<in> carrier_mat n n"
shows "det A \<noteq> 0 \<longleftrightarrow> rank A = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (det A \<noteq> (0::'a)) = (rank A = n)
[PROOF STEP]
using assms det_zero_low_rank low_rank_det_zero
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
\<lbrakk>?A \<in> carrier_mat n n; det ?A = (0::'a)\<rbrakk> \<Longrightarrow> rank ?A < n
\<lbrakk>?A \<in> carrier_mat n n; det ?A \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> rank ?A = n

goal (1 subgoal):
 1. (det A \<noteq> (0::'a)) = (rank A = n)
[PROOF STEP]
by force


[STATEMENT]
lemma size_fsubset_elem:
  assumes "\<exists>e. e |\<in>| x1 \<and> e |\<notin>| x2"
      and "\<nexists>e. e |\<in>| x2 \<and> e |\<notin>| x1"
    shows "size x2 < size x1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size x2 < size x1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>e. e |\<in>| x1 \<and> e |\<notin>| x2
\<nexists>e. e |\<in>| x2 \<and> e |\<notin>| x1

goal (1 subgoal):
 1. size x2 < size x1
[PROOF STEP]
apply (simp add: fmember_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>e. e \<in> fset x1 \<and> e \<notin> fset x2; \<forall>e. e \<in> fset x2 \<longrightarrow> e \<in> fset x1\<rbrakk> \<Longrightarrow> card (fset x2) < card (fset x1)
[PROOF STEP]
by (metis card_seteq finite_fset linorder_not_le subsetI)


[STATEMENT]
lemma similar_mat_wit_smult: fixes A :: "'a :: comm_ring_1 mat"
  assumes "similar_mat_wit A B P Q"
  shows "similar_mat_wit (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m B) P Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m B) P Q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat_wit (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m B) P Q
[PROOF STEP]
define n where "n = dim_row A"
[PROOF STATE]
proof (state)
this:
n = dim_row A

goal (1 subgoal):
 1. similar_mat_wit (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m B) P Q
[PROOF STEP]
note main = similar_mat_witD[OF n_def assms]
[PROOF STATE]
proof (state)
this:
P * Q = 1\<^sub>m n
Q * P = 1\<^sub>m n
A = P * B * Q
A \<in> carrier_mat n n
B \<in> carrier_mat n n
P \<in> carrier_mat n n
Q \<in> carrier_mat n n

goal (1 subgoal):
 1. similar_mat_wit (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m B) P Q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m B) P Q
[PROOF STEP]
by (rule similar_mat_witI[OF main(1-2) _ _ _ main(6-7)], insert main(3-), auto
      simp: mult_smult_distrib mult_smult_assoc_mat[of _ n n _ n])
[PROOF STATE]
proof (state)
this:
similar_mat_wit (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m B) P Q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in vectorspace) vsum_is_minimal:
  fixes W W1 W2
  assumes h1: "subspace K W1 V" and h2: "subspace K W2 V" and h3: "subspace K W V"
  shows "(subspace_sum W1 W2) \<subseteq> W \<longleftrightarrow> W1 \<subseteq> W \<and> W2 \<subseteq> W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subspace_sum W1 W2 \<subseteq> W) = (W1 \<subseteq> W \<and> W2 \<subseteq> W)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (subspace_sum W1 W2 \<subseteq> W) = (W1 \<subseteq> W \<and> W2 \<subseteq> W)
[PROOF STEP]
from h1 h2 h3
[PROOF STATE]
proof (chain)
picking this:
subspace K W1 V
subspace K W2 V
subspace K W V
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subspace K W1 V
subspace K W2 V
subspace K W V

goal (1 subgoal):
 1. (subspace_sum W1 W2 \<subseteq> W) = (W1 \<subseteq> W \<and> W2 \<subseteq> W)
[PROOF STEP]
by (intro sum_is_minimal, unfold subspace_def, auto)
[PROOF STATE]
proof (state)
this:
(subspace_sum W1 W2 \<subseteq> W) = (W1 \<subseteq> W \<and> W2 \<subseteq> W)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma insertion_diff:
  "insertion f (p - q :: 'a :: comm_ring_1 mpoly) = insertion f p - insertion f q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (p - q) = insertion f p - insertion f q
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f p q. \<lbrakk>finite {x. p x \<noteq> (0::'a)}; finite {x. q x \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> insertion_fun f (\<lambda>k. p k - q k) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
fix f :: "nat \<Rightarrow> 'a" and p q :: "(nat \<Rightarrow>\<^sub>0 nat) \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f p q. \<lbrakk>finite {x. p x \<noteq> (0::'a)}; finite {x. q x \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> insertion_fun f (\<lambda>k. p k - q k) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
assume fin: "finite {x. p x \<noteq> 0}" "finite {x. q x \<noteq> 0}"
[PROOF STATE]
proof (state)
this:
finite {x. p x \<noteq> (0::'a)}
finite {x. q x \<noteq> (0::'a)}

goal (1 subgoal):
 1. \<And>f p q. \<lbrakk>finite {x. p x \<noteq> (0::'a)}; finite {x. q x \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> insertion_fun f (\<lambda>k. p k - q k) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
have "insertion_fun f (\<lambda>x. p x - q x) =
          (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v) - q m * (\<Prod>v. f v ^ lookup m v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion_fun f (\<lambda>x. p x - q x) = (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v) - q m * (\<Prod>v. f v ^ lookup m v))
[PROOF STEP]
by (simp add: insertion_fun_def algebra_simps Sum_any_diff)
[PROOF STATE]
proof (state)
this:
insertion_fun f (\<lambda>x. p x - q x) = (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v) - q m * (\<Prod>v. f v ^ lookup m v))

goal (1 subgoal):
 1. \<And>f p q. \<lbrakk>finite {x. p x \<noteq> (0::'a)}; finite {x. q x \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> insertion_fun f (\<lambda>k. p k - q k) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
insertion_fun f (\<lambda>x. p x - q x) = (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v) - q m * (\<Prod>v. f v ^ lookup m v))

goal (1 subgoal):
 1. \<And>f p q. \<lbrakk>finite {x. p x \<noteq> (0::'a)}; finite {x. q x \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> insertion_fun f (\<lambda>k. p k - q k) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
have "\<dots> = (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v)) - (\<Sum>m. q m * (\<Prod>v. f v ^ lookup m v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v) - q m * (\<Prod>v. f v ^ lookup m v)) = (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v)) - (\<Sum>m. q m * (\<Prod>v. f v ^ lookup m v))
[PROOF STEP]
by (subst Sum_any_diff) (auto intro: finite_subset[OF _ fin(1)] finite_subset[OF _ fin(2)])
[PROOF STATE]
proof (state)
this:
(\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v) - q m * (\<Prod>v. f v ^ lookup m v)) = (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v)) - (\<Sum>m. q m * (\<Prod>v. f v ^ lookup m v))

goal (1 subgoal):
 1. \<And>f p q. \<lbrakk>finite {x. p x \<noteq> (0::'a)}; finite {x. q x \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> insertion_fun f (\<lambda>k. p k - q k) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v) - q m * (\<Prod>v. f v ^ lookup m v)) = (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v)) - (\<Sum>m. q m * (\<Prod>v. f v ^ lookup m v))

goal (1 subgoal):
 1. \<And>f p q. \<lbrakk>finite {x. p x \<noteq> (0::'a)}; finite {x. q x \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> insertion_fun f (\<lambda>k. p k - q k) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
have "\<dots> = insertion_fun f p - insertion_fun f q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v)) - (\<Sum>m. q m * (\<Prod>v. f v ^ lookup m v)) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
by (simp add: insertion_fun_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>m. p m * (\<Prod>v. f v ^ lookup m v)) - (\<Sum>m. q m * (\<Prod>v. f v ^ lookup m v)) = insertion_fun f p - insertion_fun f q

goal (1 subgoal):
 1. \<And>f p q. \<lbrakk>finite {x. p x \<noteq> (0::'a)}; finite {x. q x \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> insertion_fun f (\<lambda>k. p k - q k) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
insertion_fun f (\<lambda>x. p x - q x) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
show "insertion_fun f (\<lambda>x. p x - q x) = \<dots>"
[PROOF STATE]
proof (prove)
using this:
insertion_fun f (\<lambda>x. p x - q x) = insertion_fun f p - insertion_fun f q

goal (1 subgoal):
 1. insertion_fun f (\<lambda>x. p x - q x) = insertion_fun f p - insertion_fun f q
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
insertion_fun f (\<lambda>x. p x - q x) = insertion_fun f p - insertion_fun f q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cos_angle_den_scale [simp]:
  assumes "k1 > 0" and "k2 > 0"
  shows "sqrt (Re ((k1\<^sup>2 * mat_det H1) * (k2\<^sup>2 * mat_det H2))) =
         k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))
[PROOF STEP]
let ?lhs = "(k1\<^sup>2 * mat_det H1) * (k2\<^sup>2 * mat_det H2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))
[PROOF STEP]
let ?rhs = "mat_det H1 * mat_det H2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))
[PROOF STEP]
have 1: "?lhs = (k1\<^sup>2*k2\<^sup>2) * ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cor (k1\<^sup>2) * mat_det H1 * (cor (k2\<^sup>2) * mat_det H2) = cor (k1\<^sup>2 * k2\<^sup>2) * (mat_det H1 * mat_det H2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cor (k1\<^sup>2) * mat_det H1 * (cor (k2\<^sup>2) * mat_det H2) = cor (k1\<^sup>2 * k2\<^sup>2) * (mat_det H1 * mat_det H2)

goal (1 subgoal):
 1. sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))
[PROOF STEP]
hence "Re ?lhs = (k1\<^sup>2*k2\<^sup>2) * Re ?rhs"
[PROOF STATE]
proof (prove)
using this:
cor (k1\<^sup>2) * mat_det H1 * (cor (k2\<^sup>2) * mat_det H2) = cor (k1\<^sup>2 * k2\<^sup>2) * (mat_det H1 * mat_det H2)

goal (1 subgoal):
 1. Re (cor (k1\<^sup>2) * mat_det H1 * (cor (k2\<^sup>2) * mat_det H2)) = k1\<^sup>2 * k2\<^sup>2 * Re (mat_det H1 * mat_det H2)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
Re (cor (k1\<^sup>2) * mat_det H1 * (cor (k2\<^sup>2) * mat_det H2)) = k1\<^sup>2 * k2\<^sup>2 * Re (mat_det H1 * mat_det H2)

goal (1 subgoal):
 1. sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (cor (k1\<^sup>2) * mat_det H1 * (cor (k2\<^sup>2) * mat_det H2)) = k1\<^sup>2 * k2\<^sup>2 * Re (mat_det H1 * mat_det H2)

goal (1 subgoal):
 1. sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Re (cor (k1\<^sup>2) * mat_det H1 * (cor (k2\<^sup>2) * mat_det H2)) = k1\<^sup>2 * k2\<^sup>2 * Re (mat_det H1 * mat_det H2)
0 < k1
0 < k2

goal (1 subgoal):
 1. sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))
[PROOF STEP]
by (simp add: real_sqrt_mult)
[PROOF STATE]
proof (state)
this:
sqrt (Re ((cor k1)\<^sup>2 * mat_det H1 * ((cor k2)\<^sup>2 * mat_det H2))) = k1 * k2 * sqrt (Re (mat_det H1 * mat_det H2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma order_charpoly_smult: fixes A :: "complex ^ 'n ^ 'n"
  assumes k: "k \<noteq> 0"
  shows "order x (charpoly (k *k A)) = order (x / k) (charpoly A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x (charpoly (k *k A)) = order (x / k) (charpoly A)
[PROOF STEP]
by (transfer fixing: k, rule order_char_poly_smult[OF _ k])


[STATEMENT]
lemma Zp_defs:
"\<one> = padic_one p"
"\<zero> = padic_zero p"
"carrier Zp = padic_set p"
"(\<otimes>) = padic_mult p"
"(\<oplus>) = padic_add p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<one> = padic_one p &&& \<zero> = padic_zero p) &&& carrier Zp = padic_set p &&& (\<otimes>) = padic_mult p &&& (\<oplus>) = padic_add p
[PROOF STEP]
unfolding Zp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<one>\<^bsub>padic_int p\<^esub> = padic_one p &&& \<zero>\<^bsub>padic_int p\<^esub> = padic_zero p) &&& carrier (padic_int p) = padic_set p &&& (\<otimes>\<^bsub>padic_int p\<^esub>) = padic_mult p &&& (\<oplus>\<^bsub>padic_int p\<^esub>) = padic_add p
[PROOF STEP]
using padic_int_simps
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>padic_int ?p\<^esub> = padic_one ?p
\<zero>\<^bsub>padic_int ?p\<^esub> = padic_zero ?p
(\<oplus>\<^bsub>padic_int ?p\<^esub>) = padic_add ?p
(\<otimes>\<^bsub>padic_int ?p\<^esub>) = padic_mult ?p
carrier (padic_int ?p) = padic_set ?p

goal (1 subgoal):
 1. (\<one>\<^bsub>padic_int p\<^esub> = padic_one p &&& \<zero>\<^bsub>padic_int p\<^esub> = padic_zero p) &&& carrier (padic_int p) = padic_set p &&& (\<otimes>\<^bsub>padic_int p\<^esub>) = padic_mult p &&& (\<oplus>\<^bsub>padic_int p\<^esub>) = padic_add p
[PROOF STEP]
by auto


[STATEMENT]
lemma rref_upt_condition3:
  assumes r: "reduced_row_echelon_form_upt_k A k"
  shows "(\<forall>i. i<i+1 \<and> \<not> (is_zero_row_upt_k i k A) \<and> \<not> (is_zero_row_upt_k (i+1) k A) \<longrightarrow> ((LEAST n. A $ i $ n \<noteq> 0) < (LEAST n. A $ (i+1) $ n \<noteq> 0)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. i < i + (1::'c) \<and> \<not> is_zero_row_upt_k i k A \<and> \<not> is_zero_row_upt_k (i + (1::'c)) k A \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
reduced_row_echelon_form_upt_k A k

goal (1 subgoal):
 1. \<forall>i. i < i + (1::'c) \<and> \<not> is_zero_row_upt_k i k A \<and> \<not> is_zero_row_upt_k (i + (1::'c)) k A \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))
[PROOF STEP]
unfolding reduced_row_echelon_form_upt_k_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>i. is_zero_row_upt_k i k A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row_upt_k j k A)) \<and> (\<forall>i. \<not> is_zero_row_upt_k i k A \<longrightarrow> A $ i $ (LEAST k. A $ i $ k \<noteq> (0::'a)) = (1::'a)) \<and> (\<forall>i. i < i + (1::'c) \<and> \<not> is_zero_row_upt_k i k A \<and> \<not> is_zero_row_upt_k (i + (1::'c)) k A \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))) \<and> (\<forall>i. \<not> is_zero_row_upt_k i k A \<longrightarrow> (\<forall>j. i \<noteq> j \<longrightarrow> A $ j $ (LEAST n. A $ i $ n \<noteq> (0::'a)) = (0::'a)))

goal (1 subgoal):
 1. \<forall>i. i < i + (1::'c) \<and> \<not> is_zero_row_upt_k i k A \<and> \<not> is_zero_row_upt_k (i + (1::'c)) k A \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma primepow_gt_0_nat: "primepow n \<Longrightarrow> n > (0::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primepow n \<Longrightarrow> 0 < n
[PROOF STEP]
using primepow_gt_Suc_0[of n]
[PROOF STATE]
proof (prove)
using this:
primepow n \<Longrightarrow> Suc 0 < n

goal (1 subgoal):
 1. primepow n \<Longrightarrow> 0 < n
[PROOF STEP]
by simp


[STATEMENT]
lemma totient_conv_moebius_mu':
  assumes "n > (0::nat)"
  shows   "real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
have "real (totient n) = of_int (int (totient n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (totient n) = real_of_int (int (totient n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (totient n) = real_of_int (int (totient n))

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (totient n) = real_of_int (int (totient n))

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
have "int (totient n) = (\<Sum>d | d dvd n. moebius_mu d * int (n div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (totient n) = (\<Sum>d | d dvd n. moebius_mu d * int (n div d))
[PROOF STEP]
using totient_conv_moebius_mu
[PROOF STATE]
proof (prove)
using this:
int (totient ?n) = dirichlet_prod moebius_mu int ?n

goal (1 subgoal):
 1. int (totient n) = (\<Sum>d | d dvd n. moebius_mu d * int (n div d))
[PROOF STEP]
by (simp add: dirichlet_prod_def assms)
[PROOF STATE]
proof (state)
this:
int (totient n) = (\<Sum>d | d dvd n. moebius_mu d * int (n div d))

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int (totient n) = (\<Sum>d | d dvd n. moebius_mu d * int (n div d))

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
have "real_of_int (\<Sum>d | d dvd n. moebius_mu d * int (n div d)) =
               (\<Sum>d | d dvd n. moebius_mu d * real (n div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (\<Sum>d | d dvd n. moebius_mu d * int (n div d)) = (\<Sum>d | d dvd n. moebius_mu d * real (n div d))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int (\<Sum>d | d dvd n. moebius_mu d * int (n div d)) = (\<Sum>d | d dvd n. moebius_mu d * real (n div d))

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (\<Sum>d | d dvd n. moebius_mu d * int (n div d)) = (\<Sum>d | d dvd n. moebius_mu d * real (n div d))

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
have "\<dots> = (\<Sum>d | d dvd n. real n * moebius_mu d / real d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * real (n div d)) = (\<Sum>d | d dvd n. real n * moebius_mu d / real d)
[PROOF STEP]
by (rule sum.cong) (simp_all add: field_char_0_class.of_nat_div)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. moebius_mu d * real (n div d)) = (\<Sum>d | d dvd n. real n * moebius_mu d / real d)

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. moebius_mu d * real (n div d)) = (\<Sum>d | d dvd n. real n * moebius_mu d / real d)

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
have "\<dots> = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. real n * moebius_mu d / real d) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
by (simp add: sum_distrib_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. real n * moebius_mu d / real d) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)

goal (1 subgoal):
 1. real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real (totient n) = real n * (\<Sum>d | d dvd n. moebius_mu d / real d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parallelogram__coplanar:
  assumes "Parallelogram A B C D"
  shows "Coplanar A B C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
using Parallelogram_def assms plgf__coplanar plgs__coplanar
[PROOF STATE]
proof (prove)
using this:
Parallelogram ?A ?B ?A' ?B' \<equiv> ParallelogramStrict ?A ?B ?A' ?B' \<or> ParallelogramFlat ?A ?B ?A' ?B'
Parallelogram A B C D
ParallelogramFlat ?A ?B ?C ?D \<Longrightarrow> Coplanar ?A ?B ?C ?D
ParallelogramStrict ?A ?B ?C ?D \<Longrightarrow> Coplanar ?A ?B ?C ?D

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


[STATEMENT]
lemma r01_to_r01_r01_image:
 "r01_to_r01_r01 r \<in> {0..1}\<times>{0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r01_to_r01_r01 r \<in> {0..1} \<times> {0..1}
[PROOF STEP]
using r01_to_r01_r01_fst_def'[of r] r01_to_r01_r01_snd_def'[of r] real01_binary_expansion'_0or1
        binary_expression_gteq0[of "\<lambda>n. r01_binary_expansion' r (2*n)" 0] binary_expression_leeq1[of "\<lambda>n. r01_binary_expansion' r (2*n)" 0] binary_expression_gteq0[of "\<lambda>n. r01_binary_expansion' r (2*n+1)" 0] binary_expression_leeq1[of "\<lambda>n. r01_binary_expansion' r (2*n+1)" 0]
[PROOF STATE]
proof (prove)
using this:
r01_to_r01_r01_fst r = (\<Sum>n. real (r01_binary_expansion' r (2 * n)) * (1 / 2) ^ (n + 1))
r01_to_r01_r01_snd r = (\<Sum>n. real (r01_binary_expansion' r (2 * n + 1)) * (1 / 2) ^ (n + 1))
r01_binary_expansion' ?r ?n \<in> {0, 1}
(\<And>n. r01_binary_expansion' r (2 * n) \<in> {0, 1}) \<Longrightarrow> 0 \<le> (\<Sum>n. real (r01_binary_expansion' r (2 * (n + 0))) * (1 / 2) ^ Suc (n + 0))
(\<And>n. r01_binary_expansion' r (2 * n) \<in> {0, 1}) \<Longrightarrow> (\<Sum>n. real (r01_binary_expansion' r (2 * (n + 0))) * (1 / 2) ^ Suc (n + 0)) \<le> 1
(\<And>n. r01_binary_expansion' r (2 * n + 1) \<in> {0, 1}) \<Longrightarrow> 0 \<le> (\<Sum>n. real (r01_binary_expansion' r (2 * (n + 0) + 1)) * (1 / 2) ^ Suc (n + 0))
(\<And>n. r01_binary_expansion' r (2 * n + 1) \<in> {0, 1}) \<Longrightarrow> (\<Sum>n. real (r01_binary_expansion' r (2 * (n + 0) + 1)) * (1 / 2) ^ Suc (n + 0)) \<le> 1

goal (1 subgoal):
 1. r01_to_r01_r01 r \<in> {0..1} \<times> {0..1}
[PROOF STEP]
by(simp add: r01_to_r01_r01_def)


[STATEMENT]
lemma INF_Lim:
  fixes X :: "nat \<Rightarrow> 'a::{complete_linorder,linorder_topology}"
  assumes dec: "decseq X"
    and l: "X \<longlonglongrightarrow> l"
  shows "(INF n. X n) = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf (range X) = l
[PROOF STEP]
using LIMSEQ_INF[OF dec] tendsto_unique[OF trivial_limit_sequentially l]
[PROOF STATE]
proof (prove)
using this:
X \<longlonglongrightarrow> Inf (range X)
X \<longlonglongrightarrow> ?b \<Longrightarrow> l = ?b

goal (1 subgoal):
 1. Inf (range X) = l
[PROOF STEP]
by simp


[STATEMENT]
lemma divisor_count_primorial' [simp]: "divisor_count (primorial' k) = 2 ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_count (primorial' k) = 2 ^ k
[PROOF STEP]
by (subst divisor_count_squarefree) auto


[STATEMENT]
lemma cross_alt_linear_comp:
  fixes b c::real
  defines "h \<equiv> (\<lambda>p. pcompose p [:b,c:])"
  shows "cross_alt (h p) (h q) lb ub = cross_alt p q (c * lb + b) (c * ub + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_alt (h p) (h q) lb ub = cross_alt p q (c * lb + b) (c * ub + b)
[PROOF STEP]
unfolding cross_alt_def  h_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psign_diff (p \<circ>\<^sub>p [:b, c:]) (q \<circ>\<^sub>p [:b, c:]) lb - psign_diff (p \<circ>\<^sub>p [:b, c:]) (q \<circ>\<^sub>p [:b, c:]) ub = psign_diff p q (c * lb + b) - psign_diff p q (c * ub + b)
[PROOF STEP]
by (subst (1 2) psign_diff_linear_comp;simp)


[STATEMENT]
lemma continuous_on_prod [continuous_intros]:
  fixes f :: "'a \<Rightarrow> _ \<Rightarrow> 'c::{real_normed_algebra,comm_ring_1}"
  shows "(\<And>i. i \<in> S \<Longrightarrow> continuous_on s (f i)) \<Longrightarrow> continuous_on s (\<lambda>x. \<Prod>i\<in>S. f i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> S \<Longrightarrow> continuous_on s (f i)) \<Longrightarrow> continuous_on s (\<lambda>x. \<Prod>i\<in>S. f i x)
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> S \<Longrightarrow> \<forall>x\<in>s. (f i \<longlongrightarrow> f i x) (at x within s)) \<Longrightarrow> \<forall>x\<in>s. ((\<lambda>x. \<Prod>i\<in>S. f i x) \<longlongrightarrow> (\<Prod>i\<in>S. f i x)) (at x within s)
[PROOF STEP]
by (auto intro: tendsto_prod)


[STATEMENT]
lemma mat_of_cblinfun_proj:
  fixes a::"'a::onb_enum"
  defines   "d \<equiv> length (canonical_basis :: 'a list)"
    and "norm2 \<equiv> (vec_of_basis_enum a) \<bullet>c (vec_of_basis_enum a)"
  shows  "mat_of_cblinfun (proj a) =
      1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a]
                 * mat_of_rows d [conjugate (vec_of_basis_enum a)])" (is \<open>_ = ?rhs\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
have norm2: \<open>norm2 = (norm a)\<^sup>2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm2 = complex_of_real ((norm a)\<^sup>2)
[PROOF STEP]
by (simp add: cscalar_prod_vec_of_basis_enum norm2_def cdot_square_norm[symmetric, simplified])
[PROOF STATE]
proof (state)
this:
norm2 = complex_of_real ((norm a)\<^sup>2)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
have [simp]: \<open>vec_of_basis_enum a \<in> carrier_vec d\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum a \<in> carrier_vec d
[PROOF STEP]
by (simp add: carrier_vecI d_def)
[PROOF STATE]
proof (state)
this:
vec_of_basis_enum a \<in> carrier_vec d

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
have \<open>mat_of_cblinfun (proj a) = mat_of_cblinfun (proj (a /\<^sub>R norm a))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (proj a) = mat_of_cblinfun (proj (a /\<^sub>R norm a))
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) ccspan_singleton_scaleC complex_vector.scale_eq_0_iff
        nonzero_imp_inverse_nonzero norm_eq_zero scaleR_scaleC scale_left_imp_eq)
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (proj a) = mat_of_cblinfun (proj (a /\<^sub>R norm a))

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (proj a) = mat_of_cblinfun (proj (a /\<^sub>R norm a))

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
have \<open>\<dots> = mat_of_cblinfun (selfbutter (a /\<^sub>R norm a))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (proj (a /\<^sub>R norm a)) = mat_of_cblinfun (selfbutter (a /\<^sub>R norm a))
[PROOF STEP]
apply (subst butterfly_eq_proj)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. norm (a /\<^sub>R norm a) = 1
 2. mat_of_cblinfun (proj (a /\<^sub>R norm a)) = mat_of_cblinfun (proj (a /\<^sub>R norm a))
[PROOF STEP]
by (auto simp add: False)
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (proj (a /\<^sub>R norm a)) = mat_of_cblinfun (selfbutter (a /\<^sub>R norm a))

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (proj (a /\<^sub>R norm a)) = mat_of_cblinfun (selfbutter (a /\<^sub>R norm a))

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
have \<open>\<dots> = 1/norm2 \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (selfbutter (a /\<^sub>R norm a)) = 1 / norm2 \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a)
[PROOF STEP]
apply (simp add: mat_of_cblinfun_scaleC norm2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (complex_of_real (norm a)) * inverse (complex_of_real (norm a)) \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a) = 1 / (complex_of_real (norm a))\<^sup>2 \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a)
[PROOF STEP]
by (simp add: inverse_eq_divide power2_eq_square)
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (selfbutter (a /\<^sub>R norm a)) = 1 / norm2 \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (selfbutter (a /\<^sub>R norm a)) = 1 / norm2 \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
have \<open>\<dots> = 1 / norm2 \<cdot>\<^sub>m (mat_of_cblinfun (vector_to_cblinfun a :: complex \<Rightarrow>\<^sub>C\<^sub>L 'a) * mat_adjoint (mat_of_cblinfun (vector_to_cblinfun a :: complex \<Rightarrow>\<^sub>C\<^sub>L 'a)))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm2 \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cblinfun (vector_to_cblinfun a) * mat_adjoint (mat_of_cblinfun (vector_to_cblinfun a)))
[PROOF STEP]
by (simp add: butterfly_def mat_of_cblinfun_compose mat_of_cblinfun_adj)
[PROOF STATE]
proof (state)
this:
1 / norm2 \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cblinfun (vector_to_cblinfun a) * mat_adjoint (mat_of_cblinfun (vector_to_cblinfun a)))

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / norm2 \<cdot>\<^sub>m mat_of_cblinfun (selfbutter a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cblinfun (vector_to_cblinfun a) * mat_adjoint (mat_of_cblinfun (vector_to_cblinfun a)))

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
have \<open>\<dots> = ?rhs\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm2 \<cdot>\<^sub>m (mat_of_cblinfun (vector_to_cblinfun a) * mat_adjoint (mat_of_cblinfun (vector_to_cblinfun a))) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
by (simp add: mat_of_cblinfun_vector_to_cblinfun mat_adjoint_def flip: d_def)
[PROOF STATE]
proof (state)
this:
1 / norm2 \<cdot>\<^sub>m (mat_of_cblinfun (vector_to_cblinfun a) * mat_adjoint (mat_of_cblinfun (vector_to_cblinfun a))) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
 2. a \<noteq> (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])

goal (1 subgoal):
 1. mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])

goal (1 subgoal):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = (0::'a)

goal (1 subgoal):
 1. a = (0::'a) \<Longrightarrow> mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])); j < dim_col (1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)]))\<rbrakk> \<Longrightarrow> mat_of_cblinfun (proj a) $$ (i, j) = (1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])) $$ (i, j)
 2. dim_row (mat_of_cblinfun (proj a)) = dim_row (1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)]))
 3. dim_col (mat_of_cblinfun (proj a)) = dim_col (1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)]))
[PROOF STEP]
by (auto simp: True mat_of_cblinfun_zero vec_of_basis_enum_zero scalar_prod_def  mat_of_rows_index
        simp flip: d_def)
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (proj a) = 1 / norm2 \<cdot>\<^sub>m (mat_of_cols d [vec_of_basis_enum a] * mat_of_rows d [conjugate (vec_of_basis_enum a)])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_ge_UNIV[simp]: "card (UNIV::'a::finite set) \<le> card (S::'a set) \<longleftrightarrow> S=UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card UNIV \<le> card S) = (S = UNIV)
[PROOF STEP]
using card_mono[of "UNIV::'a::finite set" S, simplified]
[PROOF STATE]
proof (prove)
using this:
card S \<le> card UNIV

goal (1 subgoal):
 1. (card UNIV \<le> card S) = (S = UNIV)
[PROOF STEP]
by auto


[STATEMENT]
lemma box_Int_box:
  fixes a :: "'a::euclidean_space"
  shows "box a b \<inter> box c d =
    box (\<Sum>i\<in>Basis. max (a\<bullet>i) (c\<bullet>i) *\<^sub>R i) (\<Sum>i\<in>Basis. min (b\<bullet>i) (d\<bullet>i) *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. box a b \<inter> box c d = box (\<Sum>i\<in>Basis. max (a \<bullet> i) (c \<bullet> i) *\<^sub>R i) (\<Sum>i\<in>Basis. min (b \<bullet> i) (d \<bullet> i) *\<^sub>R i)
[PROOF STEP]
unfolding set_eq_iff and Int_iff and mem_box
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. ((\<forall>i\<in>Basis. a \<bullet> i < x \<bullet> i \<and> x \<bullet> i < b \<bullet> i) \<and> (\<forall>i\<in>Basis. c \<bullet> i < x \<bullet> i \<and> x \<bullet> i < d \<bullet> i)) = (\<forall>i\<in>Basis. (\<Sum>i\<in>Basis. max (a \<bullet> i) (c \<bullet> i) *\<^sub>R i) \<bullet> i < x \<bullet> i \<and> x \<bullet> i < (\<Sum>i\<in>Basis. min (b \<bullet> i) (d \<bullet> i) *\<^sub>R i) \<bullet> i)
[PROOF STEP]
by auto


[STATEMENT]
theorem CP_not_subseteq_NUM: "\<not> CP \<subseteq> NUM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> CP \<subseteq> NUM
[PROOF STEP]
using FIN_subseteq_CP FIN_not_subseteq_NUM
[PROOF STATE]
proof (prove)
using this:
FIN \<subseteq> CP
\<not> FIN \<subseteq> NUM

goal (1 subgoal):
 1. \<not> CP \<subseteq> NUM
[PROOF STEP]
by blast


[STATEMENT]
lemma arcs_eq_2verts: "card (arcs G) = 2 * (card (verts G) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (arcs G) = 2 * (card (verts G) - 1)
[PROOF STEP]
using bfs_tree.arcs_undir_G_eq_2vertsG[OF bfs_dir_tree_r undirected_tree_axioms] card_gt0
[PROOF STATE]
proof (prove)
using this:
?root \<in> verts G \<Longrightarrow> card (arcs G) = 2 * (card (verts G) - 1)
0 < card (verts G)

goal (1 subgoal):
 1. card (arcs G) = 2 * (card (verts G) - 1)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma contour_integral_eq:
    "(\<And>x. x \<in> path_image p \<Longrightarrow> f x = g x) \<Longrightarrow> contour_integral p f = contour_integral p g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> path_image p \<Longrightarrow> f x = g x) \<Longrightarrow> contour_integral p f = contour_integral p g
[PROOF STEP]
using contour_integral_cong contour_integral_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?g = ?g'; \<And>x. x \<in> path_image ?g \<Longrightarrow> ?f x = ?f' x\<rbrakk> \<Longrightarrow> contour_integral ?g ?f = contour_integral ?g' ?f'
contour_integral ?g ?f \<equiv> SOME i. (?f has_contour_integral i) ?g \<or> \<not> ?f contour_integrable_on ?g \<and> i = 0

goal (1 subgoal):
 1. (\<And>x. x \<in> path_image p \<Longrightarrow> f x = g x) \<Longrightarrow> contour_integral p f = contour_integral p g
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sin_squared_eq: "(sin x)\<^sup>2 = 1 - (cos x)\<^sup>2"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin x)\<^sup>2 = (1::'a) - (cos x)\<^sup>2
[PROOF STEP]
unfolding eq_diff_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin x)\<^sup>2 + (cos x)\<^sup>2 = (1::'a)
[PROOF STEP]
by (rule sin_cos_squared_add)


[STATEMENT]
lemma sin_45: "sin (pi / 4) = sqrt 2 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (pi / 4) = sqrt 2 / 2
[PROOF STEP]
by (simp add: sin_cos_eq cos_45)


[STATEMENT]
lemma M_gt_6: "M > 6"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 6 < M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 6 < M
[PROOF STEP]
from p_gt_2
[PROOF STATE]
proof (chain)
picking this:
2 < p
[PROOF STEP]
have "2 ^ p \<ge> (2 ^ 3 :: nat)"
[PROOF STATE]
proof (prove)
using this:
2 < p

goal (1 subgoal):
 1. 2 ^ 3 \<le> 2 ^ p
[PROOF STEP]
by (intro power_increasing) auto
[PROOF STATE]
proof (state)
this:
2 ^ 3 \<le> 2 ^ p

goal (1 subgoal):
 1. 6 < M
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
2 ^ 3 \<le> 2 ^ p

goal (1 subgoal):
 1. 6 < M
[PROOF STEP]
by (simp add: M_def)
[PROOF STATE]
proof (state)
this:
6 < M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transpose_invertible:
  fixes A :: "real^'n^'n"
  assumes "invertible A"
  shows "invertible (transpose A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (Finite_Cartesian_Product.transpose A)
[PROOF STEP]
by (meson assms invertible_def matrix_left_right_inverse right_invertible_transpose)


[STATEMENT]
lemma point_equations:
  assumes "is_point p"
  shows "p;1=p"
    and "1;p=1"
    and "p\<^sup>T;1=1"
    and "1;p\<^sup>T=p\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p ; 1 = p &&& 1 ; p = 1) &&& p\<^sup>T ; 1 = 1 &&& 1 ; p\<^sup>T = p\<^sup>T
[PROOF STEP]
apply (metis assms is_point_def is_vector_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 1 ; p = 1
 2. p\<^sup>T ; 1 = 1
 3. 1 ; p\<^sup>T = p\<^sup>T
[PROOF STEP]
using assms is_point_def is_vector_def tarski vector_comp
[PROOF STATE]
proof (prove)
using this:
is_point p
is_point ?x \<equiv> is_vector ?x \<and> is_inj ?x \<and> ?x \<noteq> 0
is_vector ?x \<equiv> ?x = ?x ; 1
(?x \<noteq> 0) = (1 ; ?x ; 1 = 1)
\<lbrakk>is_vector ?x; is_vector ?y\<rbrakk> \<Longrightarrow> is_vector (?x ; ?y)

goal (3 subgoals):
 1. 1 ; p = 1
 2. p\<^sup>T ; 1 = 1
 3. 1 ; p\<^sup>T = p\<^sup>T
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. p\<^sup>T ; 1 = 1
 2. 1 ; p\<^sup>T = p\<^sup>T
[PROOF STEP]
apply (metis assms conv_contrav conv_one conv_zero is_point_def is_vector_def tarski)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 ; p\<^sup>T = p\<^sup>T
[PROOF STEP]
by (metis assms conv_contrav conv_one is_point_def is_vector_def)


[STATEMENT]
lemma is_increasing_id:
"is_increasing (\<lambda> n. n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_increasing (\<lambda>n. n)
[PROOF STEP]
by (simp add: is_increasingI)


[STATEMENT]
lemma mat_of_cblinfun_Proj_code_code[code]:
  \<comment> \<open>Code equation for computing a projector onto a set S of vectors.
     We first make the vectors S into an orthonormal basis using
     the Gram-Schmidt procedure and then compute the projector
     as the sum of the "butterflies" \<open>x * x*\<close> of the vectors \<open>x\<in>S\<close>
     (done by \<^term>\<open>mk_projector_orthog\<close>).\<close>
  "mat_of_cblinfun_Proj_code (SPAN S :: 'a::onb_enum ccsubspace) =
    (let d = length (canonical_basis :: 'a list) in mk_projector_orthog d
              (gram_schmidt0 d (filter (\<lambda>v. dim_vec v = d) S)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun_Proj_code (SPAN S) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (filter (\<lambda>v. dim_vec v = d) S)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_of_cblinfun_Proj_code (SPAN S) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (filter (\<lambda>v. dim_vec v = d) S)))
[PROOF STEP]
have *: "map_option vec_of_basis_enum (if dim_vec x = length (canonical_basis :: 'a list) then Some (basis_enum_of_vec x :: 'a) else None)
      = (if dim_vec x = length (canonical_basis :: 'a list) then Some x else None)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_option vec_of_basis_enum (if dim_vec x = length canonical_basis then Some (basis_enum_of_vec x) else None) = (if dim_vec x = length canonical_basis then Some x else None)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map_option vec_of_basis_enum (if dim_vec ?x = length canonical_basis then Some (basis_enum_of_vec ?x) else None) = (if dim_vec ?x = length canonical_basis then Some ?x else None)

goal (1 subgoal):
 1. mat_of_cblinfun_Proj_code (SPAN S) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (filter (\<lambda>v. dim_vec v = d) S)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun_Proj_code (SPAN S) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (filter (\<lambda>v. dim_vec v = d) S)))
[PROOF STEP]
unfolding SPAN_def mat_of_cblinfun_Proj_code_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (Proj (let n = length canonical_basis in ccspan (basis_enum_of_vec ` Set.filter (\<lambda>v. dim_vec v = n) (set S)))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (filter (\<lambda>v. dim_vec v = d) S)))
[PROOF STEP]
using mat_of_cblinfun_Proj_ccspan[where S =
        "map basis_enum_of_vec (filter (\<lambda>v. dim_vec v = (length (canonical_basis :: 'a list))) S) :: 'a list"]
[PROOF STATE]
proof (prove)
using this:
mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec (filter (\<lambda>v. dim_vec v = length canonical_basis) S))))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum (map basis_enum_of_vec (filter (\<lambda>v. dim_vec v = length canonical_basis) S)))))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (let n = length canonical_basis in ccspan (basis_enum_of_vec ` Set.filter (\<lambda>v. dim_vec v = n) (set S)))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (filter (\<lambda>v. dim_vec v = d) S)))
[PROOF STEP]
apply (simp only: Let_def map_filter_map_filter filter_set image_set map_map_filter o_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set (List.map_filter (\<lambda>x. if dim_vec x = length canonical_basis then Some (basis_enum_of_vec x) else None) S)))) = mk_projector_orthog (length canonical_basis) (gram_schmidt0 (length canonical_basis) (List.map_filter (\<lambda>x. map_option vec_of_basis_enum (if dim_vec x = length canonical_basis then Some (basis_enum_of_vec x) else None)) S)) \<Longrightarrow> mk_projector_orthog (length canonical_basis) (gram_schmidt0 (length canonical_basis) (List.map_filter (\<lambda>x. map_option vec_of_basis_enum (if dim_vec x = length canonical_basis then Some (basis_enum_of_vec x) else None)) S)) = mk_projector_orthog (length canonical_basis) (gram_schmidt0 (length canonical_basis) (filter (\<lambda>v. dim_vec v = length canonical_basis) S))
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set (List.map_filter (\<lambda>x. if dim_vec x = length canonical_basis then Some (basis_enum_of_vec x) else None) S)))) = mk_projector_orthog (length canonical_basis) (gram_schmidt0 (length canonical_basis) (List.map_filter (\<lambda>x. if dim_vec x = length canonical_basis then Some x else None) S)) \<Longrightarrow> mk_projector_orthog (length canonical_basis) (gram_schmidt0 (length canonical_basis) (List.map_filter (\<lambda>x. if dim_vec x = length canonical_basis then Some x else None) S)) = mk_projector_orthog (length canonical_basis) (gram_schmidt0 (length canonical_basis) (filter (\<lambda>v. dim_vec v = length canonical_basis) S))
[PROOF STEP]
by (simp add: map_filter_map_filter[symmetric])
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun_Proj_code (SPAN S) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (filter (\<lambda>v. dim_vec v = d) S)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lfp_the_while_option_lattice:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  assumes "mono f" and "finite (UNIV :: 'a set)"
  shows "lfp f = the (while_option (\<lambda>A. f A \<noteq> A) f bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f = the (while_option (\<lambda>A. f A \<noteq> A) f bot)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lfp f = the (while_option (\<lambda>A. f A \<noteq> A) f bot)
[PROOF STEP]
obtain P where "while_option (\<lambda>A. f A \<noteq> A) f bot = Some P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. while_option (\<lambda>A. f A \<noteq> A) f bot = Some P \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using while_option_finite_increasing_Some[OF assms, where s=bot]
[PROOF STATE]
proof (prove)
using this:
bot \<le> f bot \<Longrightarrow> \<exists>P. while_option (\<lambda>A. f A \<noteq> A) f bot = Some P

goal (1 subgoal):
 1. (\<And>P. while_option (\<lambda>A. f A \<noteq> A) f bot = Some P \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp blast
[PROOF STATE]
proof (state)
this:
while_option (\<lambda>A. f A \<noteq> A) f bot = Some P

goal (1 subgoal):
 1. lfp f = the (while_option (\<lambda>A. f A \<noteq> A) f bot)
[PROOF STEP]
with while_option_stop2[OF this] lfp_Kleene_iter[OF assms(1)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. P = (f ^^ k) bot \<and> \<not> f P \<noteq> P
(f ^^ Suc ?k) bot = (f ^^ ?k) bot \<Longrightarrow> lfp f = (f ^^ ?k) bot
while_option (\<lambda>A. f A \<noteq> A) f bot = Some P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>k. P = (f ^^ k) bot \<and> \<not> f P \<noteq> P
(f ^^ Suc ?k) bot = (f ^^ ?k) bot \<Longrightarrow> lfp f = (f ^^ ?k) bot
while_option (\<lambda>A. f A \<noteq> A) f bot = Some P

goal (1 subgoal):
 1. lfp f = the (while_option (\<lambda>A. f A \<noteq> A) f bot)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lfp f = the (while_option (\<lambda>A. f A \<noteq> A) f bot)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_diff_of_int [simp]: "\<lceil>x - of_int z\<rceil> = \<lceil>x\<rceil> - z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>x - of_int z\<rceil> = \<lceil>x\<rceil> - z
[PROOF STEP]
using ceiling_add_of_int [of x "- z"]
[PROOF STATE]
proof (prove)
using this:
\<lceil>x + of_int (- z)\<rceil> = \<lceil>x\<rceil> + - z

goal (1 subgoal):
 1. \<lceil>x - of_int z\<rceil> = \<lceil>x\<rceil> - z
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma obtain_shortest_path:
  assumes CONN: "connected u v"
  obtains p where "isShortestPath u p v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. isShortestPath u p v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using min_dist_is_dist[OF CONN]
[PROOF STATE]
proof (prove)
using this:
dist u (min_dist u v) v

goal (1 subgoal):
 1. (\<And>p. isShortestPath u p v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dist_def isShortestPath_min_dist_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p. isPath u p v \<and> length p = min_dist u v

goal (1 subgoal):
 1. (\<And>p. isPath u p v \<and> length p = min_dist u v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma Im_Ln_tendsto_at_bot: "((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi/2 ) at_bot "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
proof (cases "a=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
 2. a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
 2. a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
define f where "f=(\<lambda>x. if a>0 then arctan (x/a) else arctan (x/a) - pi)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>x. if 0 < a then arctan (x / a) else arctan (x / a) - pi)

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
 2. a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
define g where "g=(\<lambda>x. Im (Ln (Complex a x)))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>x. Im (Ln (Complex a x)))

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
 2. a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
have "(f \<longlongrightarrow> - pi / 2) at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
proof (cases "a>0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
 2. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < a

goal (2 subgoals):
 1. 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
 2. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < a
[PROOF STEP]
have "(f \<longlongrightarrow> - pi / 2) at_bot \<longleftrightarrow> ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> - pi / 2) at_bot"
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. (f \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
unfolding f_def field_class.field_divide_inverse
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. ((\<lambda>x. if 0 < a then arctan (x * inverse a) else arctan (x * inverse a) - pi) \<longlongrightarrow> - pi * inverse 2) at_bot = ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> - pi * inverse 2) at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> - pi / 2) at_bot

goal (2 subgoals):
 1. 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
 2. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> - pi / 2) at_bot

goal (2 subgoals):
 1. 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
 2. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
have "... \<longleftrightarrow> (arctan \<longlongrightarrow> - pi / 2) at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> - pi / 2) at_bot = (arctan \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
apply (subst filterlim_at_bot_linear_iff[of "inverse a" arctan 0,simplified])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<noteq> 0
 2. (if 0 < a then (arctan \<longlongrightarrow> - pi / 2) at_bot else (arctan \<longlongrightarrow> - pi / 2) at_top) = (arctan \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (2 subgoals):
 1. a \<noteq> 0
 2. (if 0 < a then (arctan \<longlongrightarrow> - pi / 2) at_bot else (arctan \<longlongrightarrow> - pi / 2) at_top) = (arctan \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> - pi / 2) at_bot = (arctan \<longlongrightarrow> - pi / 2) at_bot

goal (2 subgoals):
 1. 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
 2. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> - pi / 2) at_bot = (arctan \<longlongrightarrow> - pi / 2) at_bot

goal (2 subgoals):
 1. 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
 2. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
have "..."
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arctan \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
using tendsto_arctan_at_bot
[PROOF STATE]
proof (prove)
using this:
(arctan \<longlongrightarrow> - (pi / 2)) at_bot

goal (1 subgoal):
 1. (arctan \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(arctan \<longlongrightarrow> - pi / 2) at_bot

goal (2 subgoals):
 1. 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
 2. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> - pi / 2) at_bot

goal (1 subgoal):
 1. (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> - pi / 2) at_bot

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < a

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < a
[PROOF STEP]
have "(f \<longlongrightarrow> - pi / 2) at_bot \<longleftrightarrow> ((\<lambda>x. arctan (x * inverse a) - pi) \<longlongrightarrow> - pi / 2) at_bot"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < a

goal (1 subgoal):
 1. (f \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a) - pi) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
unfolding f_def field_class.field_divide_inverse
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < a

goal (1 subgoal):
 1. ((\<lambda>x. if 0 < a then arctan (x * inverse a) else arctan (x * inverse a) - pi) \<longlongrightarrow> - pi * inverse 2) at_bot = ((\<lambda>x. arctan (x * inverse a) - pi) \<longlongrightarrow> - pi * inverse 2) at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a) - pi) \<longlongrightarrow> - pi / 2) at_bot

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a) - pi) \<longlongrightarrow> - pi / 2) at_bot

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
have "... \<longleftrightarrow> ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> pi / 2) at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. arctan (x * inverse a) - pi) \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> pi / 2) at_bot
[PROOF STEP]
apply (subst tendsto_add_const_iff[of "pi",symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. pi + (arctan (x * inverse a) - pi)) \<longlongrightarrow> pi + - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> pi / 2) at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. arctan (x * inverse a) - pi) \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> pi / 2) at_bot

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. arctan (x * inverse a) - pi) \<longlongrightarrow> - pi / 2) at_bot = ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> pi / 2) at_bot

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
have "... \<longleftrightarrow> (arctan \<longlongrightarrow> pi / 2) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> pi / 2) at_bot = (arctan \<longlongrightarrow> pi / 2) at_top
[PROOF STEP]
apply (subst filterlim_at_bot_linear_iff[of "inverse a" arctan 0,simplified])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<noteq> 0
 2. (if 0 < a then (arctan \<longlongrightarrow> pi / 2) at_bot else (arctan \<longlongrightarrow> pi / 2) at_top) = (arctan \<longlongrightarrow> pi / 2) at_top
[PROOF STEP]
using False \<open>a\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < a
a \<noteq> 0

goal (2 subgoals):
 1. a \<noteq> 0
 2. (if 0 < a then (arctan \<longlongrightarrow> pi / 2) at_bot else (arctan \<longlongrightarrow> pi / 2) at_top) = (arctan \<longlongrightarrow> pi / 2) at_top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> pi / 2) at_bot = (arctan \<longlongrightarrow> pi / 2) at_top

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. arctan (x * inverse a)) \<longlongrightarrow> pi / 2) at_bot = (arctan \<longlongrightarrow> pi / 2) at_top

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
have "..."
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arctan \<longlongrightarrow> pi / 2) at_top
[PROOF STEP]
using tendsto_arctan_at_top
[PROOF STATE]
proof (prove)
using this:
(arctan \<longlongrightarrow> pi / 2) at_top

goal (1 subgoal):
 1. (arctan \<longlongrightarrow> pi / 2) at_top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(arctan \<longlongrightarrow> pi / 2) at_top

goal (1 subgoal):
 1. \<not> 0 < a \<Longrightarrow> (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> - pi / 2) at_bot

goal (1 subgoal):
 1. (f \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> - pi / 2) at_bot

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> - pi / 2) at_bot

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
 2. a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> - pi / 2) at_bot

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
 2. a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
have "\<forall>\<^sub>F x in at_bot. f x = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_bot. f x = g x
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_bot. (if 0 < a then arctan (x / a) else arctan (x / a) - pi) = Im (Ln (Complex a x))
[PROOF STEP]
using \<open>a\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_bot. (if 0 < a then arctan (x / a) else arctan (x / a) - pi) = Im (Ln (Complex a x))
[PROOF STEP]
apply (subst Im_Ln_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. a \<noteq> 0 \<Longrightarrow> Complex a x \<noteq> 0
 2. a \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at_bot. (if 0 < a then arctan (x / a) else arctan (x / a) - pi) = (if Re (Complex a x) \<noteq> 0 then if 0 < Re (Complex a x) then arctan (Im (Complex a x) / Re (Complex a x)) else if 0 \<le> Im (Complex a x) then arctan (Im (Complex a x) / Re (Complex a x)) + pi else arctan (Im (Complex a x) / Re (Complex a x)) - pi else if 0 < Im (Complex a x) then pi / 2 else - pi / 2)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> Complex a x \<noteq> 0
[PROOF STEP]
using Complex_eq_0
[PROOF STATE]
proof (prove)
using this:
(Complex ?a ?b = 0) = (?a = 0 \<and> ?b = 0)

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> Complex a x \<noteq> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at_bot. (if 0 < a then arctan (x / a) else arctan (x / a) - pi) = (if Re (Complex a x) \<noteq> 0 then if 0 < Re (Complex a x) then arctan (Im (Complex a x) / Re (Complex a x)) else if 0 \<le> Im (Complex a x) then arctan (Im (Complex a x) / Re (Complex a x)) + pi else arctan (Im (Complex a x) / Re (Complex a x)) - pi else if 0 < Im (Complex a x) then pi / 2 else - pi / 2)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at_bot. (if 0 < a then arctan (x / a) else arctan (x / a) - pi) = (if Re (Complex a x) \<noteq> 0 then if 0 < Re (Complex a x) then arctan (Im (Complex a x) / Re (Complex a x)) else if 0 \<le> Im (Complex a x) then arctan (Im (Complex a x) / Re (Complex a x)) + pi else arctan (Im (Complex a x) / Re (Complex a x)) - pi else if 0 < Im (Complex a x) then pi / 2 else - pi / 2)
[PROOF STEP]
unfolding eventually_at_bot_linorder
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>n\<le>N. (if 0 < a then arctan (n / a) else arctan (n / a) - pi) = (if Re (Complex a n) \<noteq> 0 then if 0 < Re (Complex a n) then arctan (Im (Complex a n) / Re (Complex a n)) else if 0 \<le> Im (Complex a n) then arctan (Im (Complex a n) / Re (Complex a n)) + pi else arctan (Im (Complex a n) / Re (Complex a n)) - pi else if 0 < Im (Complex a n) then pi / 2 else - pi / 2)
[PROOF STEP]
by (auto intro:exI[where x="-1"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_bot. f x = g x

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
 2. a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> - pi / 2) at_bot
\<forall>\<^sub>F x in at_bot. f x = g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> - pi / 2) at_bot
\<forall>\<^sub>F x in at_bot. f x = g x

goal (1 subgoal):
 1. ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
using tendsto_cong[of f g at_bot]
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> - pi / 2) at_bot
\<forall>\<^sub>F x in at_bot. f x = g x
\<forall>\<^sub>F x in at_bot. f x = g x \<Longrightarrow> (f \<longlongrightarrow> ?c) at_bot = (g \<longlongrightarrow> ?c) at_bot

goal (1 subgoal):
 1. ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> - pi / 2) at_bot
\<forall>\<^sub>F x in at_bot. f x = Im (Ln (Complex a x))
\<forall>\<^sub>F x in at_bot. f x = Im (Ln (Complex a x)) \<Longrightarrow> (f \<longlongrightarrow> ?c) at_bot = ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> ?c) at_bot

goal (1 subgoal):
 1. ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot

goal (1 subgoal):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0

goal (1 subgoal):
 1. a = 0 \<Longrightarrow> ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot
[PROOF STEP]
apply (rule tendsto_eventually)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_bot. Im (Ln (Complex a x)) = - pi / 2
[PROOF STEP]
apply (rule eventually_at_bot_linorderI[of "-1"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<le> - 1 \<Longrightarrow> Im (Ln (Complex a x)) = - pi / 2
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
a = 0

goal (1 subgoal):
 1. \<And>x. x \<le> - 1 \<Longrightarrow> Im (Ln (Complex a x)) = - pi / 2
[PROOF STEP]
by (subst Im_Ln_eq,auto simp add:Complex_eq_0)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. Im (Ln (Complex a x))) \<longlongrightarrow> - pi / 2) at_bot

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem find_set:
  "VARS y
  [ find_set_precondition p x ]
  y := x;
  WHILE y \<noteq> p[[y]]
    INV { find_set_invariant p x y }
    VAR { (p\<^sup>T\<^sup>\<star> * y)\<down> }
     DO y := p[[y]]
     OD
  [ find_set_postcondition p x y ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [find_set_precondition p x]
y := x; WHILE y \<noteq> p[[y]] INV {find_set_invariant p x y}  VAR {(p\<^sup>T\<^sup>\<star> * y)\<down>}
DO y := p[[y]] OD
[find_set_postcondition p x y]
[PROOF STEP]
apply vcg_tc_simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. find_set_precondition p x \<Longrightarrow> find_set_invariant p x x
 2. \<And>y. find_set_invariant p x y \<and> y \<noteq> p[[y]] \<Longrightarrow> find_set_invariant p x (p[[y]]) \<and> (p\<^sup>T\<^sup>\<star> * (p[[y]]))\<down> < (p\<^sup>T\<^sup>\<star> * y)\<down>
 3. \<And>y. find_set_invariant p x y \<and> y = p[[y]] \<Longrightarrow> find_set_postcondition p x y
[PROOF STEP]
apply (fact find_set_1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y. find_set_invariant p x y \<and> y \<noteq> p[[y]] \<Longrightarrow> find_set_invariant p x (p[[y]]) \<and> (p\<^sup>T\<^sup>\<star> * (p[[y]]))\<down> < (p\<^sup>T\<^sup>\<star> * y)\<down>
 2. \<And>y. find_set_invariant p x y \<and> y = p[[y]] \<Longrightarrow> find_set_postcondition p x y
[PROOF STEP]
apply (fact find_set_2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. find_set_invariant p x y \<and> y = p[[y]] \<Longrightarrow> find_set_postcondition p x y
[PROOF STEP]
by (fact find_set_3)


[STATEMENT]
lemma supp_fun_plus_subset: "supp_fun (s + t) \<subseteq> supp_fun s \<union> supp_fun (t::'a \<Rightarrow> 'b::monoid_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp_fun (s + t) \<subseteq> supp_fun s \<union> supp_fun t
[PROOF STEP]
unfolding supp_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. (s + t) x \<noteq> (0::'b)} \<subseteq> {x. s x \<noteq> (0::'b)} \<union> {x. t x \<noteq> (0::'b)}
[PROOF STEP]
by force


[STATEMENT]
lemma bounded_uniformly_continuous_image:
  fixes f :: "'a :: heine_borel \<Rightarrow> 'b :: heine_borel"
  assumes "uniformly_continuous_on S f" "bounded S"
  shows "bounded(f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (f ` S)
[PROOF STEP]
by (metis (no_types, lifting) assms bounded_closure_image compact_closure compact_continuous_image compact_eq_bounded_closed image_cong uniformly_continuous_imp_continuous uniformly_continuous_on_extension_on_closure)


[STATEMENT]
lemma card_eq_2_iff_doubleton: "card A = 2 \<longleftrightarrow> (\<exists> x y. x \<noteq> y \<and> A = {x, y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card A = 2) = (\<exists>x y. x \<noteq> y \<and> A = {x, y})
[PROOF STEP]
using card_geq_2_iff_contains_2_elems[of A]
[PROOF STATE]
proof (prove)
using this:
(2 \<le> card A) = (finite A \<and> (\<exists>x y. x \<noteq> y \<and> x \<in> A \<and> y \<in> A))

goal (1 subgoal):
 1. (card A = 2) = (\<exists>x y. x \<noteq> y \<and> A = {x, y})
[PROOF STEP]
using card_geq_3_iff_contains_3_elems[of A]
[PROOF STATE]
proof (prove)
using this:
(2 \<le> card A) = (finite A \<and> (\<exists>x y. x \<noteq> y \<and> x \<in> A \<and> y \<in> A))
(3 \<le> card A) = (finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A))

goal (1 subgoal):
 1. (card A = 2) = (\<exists>x y. x \<noteq> y \<and> A = {x, y})
[PROOF STEP]
by auto (rule_tac x=x in exI, rule_tac x=y in exI, auto)


[STATEMENT]
lemma SUP_Lim:
  fixes X :: "nat \<Rightarrow> 'a::{complete_linorder,linorder_topology}"
  assumes inc: "incseq X"
    and l: "X \<longlonglongrightarrow> l"
  shows "(SUP n. X n) = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (range X) = l
[PROOF STEP]
using LIMSEQ_SUP[OF inc] tendsto_unique[OF trivial_limit_sequentially l]
[PROOF STATE]
proof (prove)
using this:
X \<longlonglongrightarrow> Sup (range X)
X \<longlonglongrightarrow> ?b \<Longrightarrow> l = ?b

goal (1 subgoal):
 1. Sup (range X) = l
[PROOF STEP]
by simp


[STATEMENT]
lemma matrix_left_invertible_span_rows:
  "(\<exists>(B::real^'m^'n). B ** (A::real^'n^'m) = mat 1) \<longleftrightarrow> span (rows A) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat 1) = (span (rows A) = UNIV)
[PROOF STEP]
using matrix_left_invertible_span_rows_gen[of A]
[PROOF STATE]
proof (prove)
using this:
(\<exists>B. B ** A = mat 1) = (vec.span (rows A) = UNIV)

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat 1) = (span (rows A) = UNIV)
[PROOF STEP]
by (simp add: span_vec_eq)


[STATEMENT]
lemma Max_Int_le1: "\<lbrakk> (A \<inter> B) \<noteq> {}; finite A \<rbrakk> \<Longrightarrow> Max (A \<inter> B) \<le> Max A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<inter> B \<noteq> {}; finite A\<rbrakk> \<Longrightarrow> Max (A \<inter> B) \<le> Max A
[PROOF STEP]
by (rule Max_subset[OF _ Int_lower1])


[STATEMENT]
lemma content_closed_segment_real:
  fixes a b::real
  shows "content (closed_segment a b) = abs (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content {a--b} = \<bar>b - a\<bar>
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl)


[STATEMENT]
lemma deterministic_alt_def :
  "deterministic M = (\<forall> q1 x y' y''  q1' q1'' . (q1,x,y',q1') \<in> transitions M \<and> (q1,x,y'',q1'') \<in> transitions M \<longrightarrow> y' = y'' \<and> q1' = q1'')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deterministic M = (\<forall>q1 x y' y'' q1' q1''. (q1, x, y', q1') \<in> FSM.transitions M \<and> (q1, x, y'', q1'') \<in> FSM.transitions M \<longrightarrow> y' = y'' \<and> q1' = q1'')
[PROOF STEP]
by auto


[STATEMENT]
lemma index_mat_multrow_mat[simp]:
  "i < n \<Longrightarrow> j < n \<Longrightarrow> multrow_mat n k a $$ (i,j) = (if k = i \<and> k = j then a else if i = j
     then 1 else 0)"
  "dim_row (multrow_mat n k a) = n" "dim_col (multrow_mat n k a) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < n; j < n\<rbrakk> \<Longrightarrow> multrow_mat n k a $$ (i, j) = (if k = i \<and> k = j then a else if i = j then 1::'a else (0::'a))) &&& dim_row (multrow_mat n k a) = n &&& dim_col (multrow_mat n k a) = n
[PROOF STEP]
unfolding multrow_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < n; j < n\<rbrakk> \<Longrightarrow> mat n n (\<lambda>(i, j). if k = i \<and> k = j then a else if i = j then 1::'a else (0::'a)) $$ (i, j) = (if k = i \<and> k = j then a else if i = j then 1::'a else (0::'a))) &&& dim_row (mat n n (\<lambda>(i, j). if k = i \<and> k = j then a else if i = j then 1::'a else (0::'a))) = n &&& dim_col (mat n n (\<lambda>(i, j). if k = i \<and> k = j then a else if i = j then 1::'a else (0::'a))) = n
[PROOF STEP]
by auto


[STATEMENT]
theorem summatory_totient_asymptotics':
  "(\<lambda>x. sum_upto (\<lambda>n. real (totient n)) x) =o (\<lambda>x. 3 / pi\<^sup>2 * x\<^sup>2) +o O(\<lambda>x. x * ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. real (totient n)) \<in> (\<lambda>x. 3 / pi\<^sup>2 * x\<^sup>2) +o O(\<lambda>x. x * ln x)
[PROOF STEP]
using summatory_totient_asymptotics
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. sum_upto (\<lambda>n. real (totient n)) x - 3 / pi\<^sup>2 * x\<^sup>2) \<in> O(\<lambda>x. x * ln x)

goal (1 subgoal):
 1. sum_upto (\<lambda>n. real (totient n)) \<in> (\<lambda>x. 3 / pi\<^sup>2 * x\<^sup>2) +o O(\<lambda>x. x * ln x)
[PROOF STEP]
by (subst set_minus_plus [symmetric]) (simp_all add: fun_diff_def)


[STATEMENT]
lemma integral_minus_sets:
  fixes f::"real \<Rightarrow> 'a::banach"
  shows "c \<le> a \<Longrightarrow> c \<le> b \<Longrightarrow> f integrable_on {c .. max a b} \<Longrightarrow>
    integral {c .. a} f - integral {c .. b} f =
    (if a \<le> b then - integral {a .. b} f else integral {b .. a} f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<le> a; c \<le> b; f integrable_on {c..max a b}\<rbrakk> \<Longrightarrow> integral {c..a} f - integral {c..b} f = (if a \<le> b then - integral {a..b} f else integral {b..a} f)
[PROOF STEP]
using integral_combine[of c a b f]  integral_combine[of c b a f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>c \<le> a; a \<le> b; f integrable_on {c..b}\<rbrakk> \<Longrightarrow> integral {c..a} f + integral {a..b} f = integral {c..b} f
\<lbrakk>c \<le> b; b \<le> a; f integrable_on {c..a}\<rbrakk> \<Longrightarrow> integral {c..b} f + integral {b..a} f = integral {c..a} f

goal (1 subgoal):
 1. \<lbrakk>c \<le> a; c \<le> b; f integrable_on {c..max a b}\<rbrakk> \<Longrightarrow> integral {c..a} f - integral {c..b} f = (if a \<le> b then - integral {a..b} f else integral {b..a} f)
[PROOF STEP]
by (auto simp: algebra_simps max_def)


[STATEMENT]
lemma ordinal_times_eq_0:
"((x::ordinal) * y = 0) = (x = 0 \<or> y = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y = 0) = (x = 0 \<or> y = 0)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x * y = 0 \<Longrightarrow> x = 0 \<or> y = 0
 2. x = 0 \<or> y = 0 \<Longrightarrow> x * y = 0
[PROOF STEP]
apply (erule contrapos_pp, clarsimp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < x; 0 < y\<rbrakk> \<Longrightarrow> 0 < x * y
 2. x = 0 \<or> y = 0 \<Longrightarrow> x * y = 0
[PROOF STEP]
apply (drule oSuc_leI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < y; oSuc 0 \<le> x\<rbrakk> \<Longrightarrow> 0 < x * y
 2. x = 0 \<or> y = 0 \<Longrightarrow> x * y = 0
[PROOF STEP]
apply (erule order_less_le_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. oSuc 0 \<le> x \<Longrightarrow> y \<le> x * y
 2. x = 0 \<or> y = 0 \<Longrightarrow> x * y = 0
[PROOF STEP]
apply (drule ordinal_times_monoL, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = 0 \<or> y = 0 \<Longrightarrow> x * y = 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma even_count_lconjseq_alternating_order2:
  fixes   s t :: 'a
  assumes "s+s=0" "t+t=0" "(s+t)+^k = 0"
  shows   "even (count_list (lconjseq (alternating_list (2*k) s t)) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (count_list (lconjseq (alternating_list (2 * k) s t)) x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even (count_list (lconjseq (alternating_list (2 * k) s t)) x)
[PROOF STEP]
define xs where xs: "xs \<equiv> lconjseq (alternating_list (2*k) s t)"
[PROOF STATE]
proof (state)
this:
xs \<equiv> lconjseq (alternating_list (2 * k) s t)

goal (1 subgoal):
 1. even (count_list (lconjseq (alternating_list (2 * k) s t)) x)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
s + s = (0::'a)
t + t = (0::'a)
(s + t) +^ k = (0::'a)
xs \<equiv> lconjseq (alternating_list (2 * k) s t)
[PROOF STEP]
obtain as where "xs = as@as"
[PROOF STATE]
proof (prove)
using this:
s + s = (0::'a)
t + t = (0::'a)
(s + t) +^ k = (0::'a)
xs \<equiv> lconjseq (alternating_list (2 * k) s t)

goal (1 subgoal):
 1. (\<And>as. xs = as @ as \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lconjseq_alternating_order2_repeats
[PROOF STATE]
proof (prove)
using this:
s + s = (0::'a)
t + t = (0::'a)
(s + t) +^ k = (0::'a)
xs \<equiv> lconjseq (alternating_list (2 * k) s t)
\<lbrakk>?s + ?s = (0::'a); ?t + ?t = (0::'a); (?s + ?t) +^ ?k = (0::'a)\<rbrakk> \<Longrightarrow> lconjseq (alternating_list (2 * ?k) ?s ?t) = lconjseq (alternating_list ?k ?s ?t) @ lconjseq (alternating_list ?k ?s ?t)

goal (1 subgoal):
 1. (\<And>as. xs = as @ as \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
xs = as @ as

goal (1 subgoal):
 1. even (count_list (lconjseq (alternating_list (2 * k) s t)) x)
[PROOF STEP]
hence "count_list xs x = 2 * (count_list as x)"
[PROOF STATE]
proof (prove)
using this:
xs = as @ as

goal (1 subgoal):
 1. count_list xs x = 2 * count_list as x
[PROOF STEP]
by (simp add: times2_conv_add)
[PROOF STATE]
proof (state)
this:
count_list xs x = 2 * count_list as x

goal (1 subgoal):
 1. even (count_list (lconjseq (alternating_list (2 * k) s t)) x)
[PROOF STEP]
with xs
[PROOF STATE]
proof (chain)
picking this:
xs \<equiv> lconjseq (alternating_list (2 * k) s t)
count_list xs x = 2 * count_list as x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
xs \<equiv> lconjseq (alternating_list (2 * k) s t)
count_list xs x = 2 * count_list as x

goal (1 subgoal):
 1. even (count_list (lconjseq (alternating_list (2 * k) s t)) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
even (count_list (lconjseq (alternating_list (2 * k) s t)) x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma non_contractible_space_nsphere: "\<not> (contractible_space(nsphere n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> contractible_space (nsphere n)
[PROOF STEP]
proof (clarsimp simp add: contractible_eq_homotopy_equivalent_singleton_subtopology)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<in> topspace (nsphere n); nsphere n homotopy_equivalent_space subtopology (nsphere n) {a}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix a :: "nat \<Rightarrow> real"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<in> topspace (nsphere n); nsphere n homotopy_equivalent_space subtopology (nsphere n) {a}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume a: "a \<in> topspace (nsphere n)"
    and he: "nsphere n homotopy_equivalent_space subtopology (nsphere n) {a}"
[PROOF STATE]
proof (state)
this:
a \<in> topspace (nsphere n)
nsphere n homotopy_equivalent_space subtopology (nsphere n) {a}

goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<in> topspace (nsphere n); nsphere n homotopy_equivalent_space subtopology (nsphere n) {a}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "trivial_group (reduced_homology_group (int n) (subtopology (nsphere n) {a}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group (reduced_homology_group (int n) (subtopology (nsphere n) {a}))
[PROOF STEP]
by (simp add: a homology_dimension_reduced [where a=a])
[PROOF STATE]
proof (state)
this:
trivial_group (reduced_homology_group (int n) (subtopology (nsphere n) {a}))

goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<in> topspace (nsphere n); nsphere n homotopy_equivalent_space subtopology (nsphere n) {a}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
trivial_group (reduced_homology_group (int n) (subtopology (nsphere n) {a}))
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
trivial_group (reduced_homology_group (int n) (subtopology (nsphere n) {a}))

goal (1 subgoal):
 1. False
[PROOF STEP]
using isomorphic_group_triviality [OF homotopy_equivalent_space_imp_isomorphic_reduced_homology_groups [OF he, of n]]
[PROOF STATE]
proof (prove)
using this:
trivial_group (reduced_homology_group (int n) (subtopology (nsphere n) {a}))
\<lbrakk>Group.group (reduced_homology_group (int n) (nsphere n)); Group.group (reduced_homology_group (int n) (subtopology (nsphere n) {a}))\<rbrakk> \<Longrightarrow> trivial_group (reduced_homology_group (int n) (nsphere n)) = trivial_group (reduced_homology_group (int n) (subtopology (nsphere n) {a}))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cosh_minus [simp]: "cosh (- x) = cosh x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cosh (- x) = cosh x
[PROOF STEP]
by (simp add: cosh_def algebra_simps)