[STATEMENT]
lemma matrix_to_iarray_option_inverse_matrix:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
shows "matrix_to_iarray_option (inverse_matrix A) = (inverse_matrix_iarray (matrix_to_iarray A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray_option (inverse_matrix A) = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
proof (unfold inverse_matrix_def, auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. invertible A \<Longrightarrow> matrix_to_iarray_option (Some (matrix_inv A)) = inverse_matrix_iarray (matrix_to_iarray A)
 2. \<not> invertible A \<Longrightarrow> matrix_to_iarray_option None = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
assume inv_A: "invertible A"
[PROOF STATE]
proof (state)
this:
invertible A

goal (2 subgoals):
 1. invertible A \<Longrightarrow> matrix_to_iarray_option (Some (matrix_inv A)) = inverse_matrix_iarray (matrix_to_iarray A)
 2. \<not> invertible A \<Longrightarrow> matrix_to_iarray_option None = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
show "matrix_to_iarray_option (Some (matrix_inv A)) = inverse_matrix_iarray (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray_option (Some (matrix_inv A)) = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding matrix_to_iarray_option_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if Some (matrix_inv A) \<noteq> None then Some (matrix_to_iarray (the (Some (matrix_inv A)))) else None) = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding inverse_matrix_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if Some (matrix_inv A) \<noteq> None then Some (matrix_to_iarray (the (Some (matrix_inv A)))) else None) = (if invertible_iarray (matrix_to_iarray A) then Some (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) else None)
[PROOF STEP]
using inv_A
[PROOF STATE]
proof (prove)
using this:
invertible A

goal (1 subgoal):
 1. (if Some (matrix_inv A) \<noteq> None then Some (matrix_to_iarray (the (Some (matrix_inv A)))) else None) = (if invertible_iarray (matrix_to_iarray A) then Some (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) else None)
[PROOF STEP]
unfolding matrix_to_iarray_invertible
[PROOF STATE]
proof (prove)
using this:
invertible_iarray (matrix_to_iarray A)

goal (1 subgoal):
 1. (if Some (matrix_inv A) \<noteq> None then Some (matrix_to_iarray (the (Some (matrix_inv A)))) else None) = (if invertible_iarray (matrix_to_iarray A) then Some (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) else None)
[PROOF STEP]
using matrix_inv_Gauss_Jordan_iarrays_PA[OF inv_A]
[PROOF STATE]
proof (prove)
using this:
invertible_iarray (matrix_to_iarray A)
matrix_to_iarray (matrix_inv A) = fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))

goal (1 subgoal):
 1. (if Some (matrix_inv A) \<noteq> None then Some (matrix_to_iarray (the (Some (matrix_inv A)))) else None) = (if invertible_iarray (matrix_to_iarray A) then Some (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) else None)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_to_iarray_option (Some (matrix_inv A)) = inverse_matrix_iarray (matrix_to_iarray A)

goal (1 subgoal):
 1. \<not> invertible A \<Longrightarrow> matrix_to_iarray_option None = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> invertible A \<Longrightarrow> matrix_to_iarray_option None = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
assume not_inv_A: "\<not> invertible A"
[PROOF STATE]
proof (state)
this:
\<not> invertible A

goal (1 subgoal):
 1. \<not> invertible A \<Longrightarrow> matrix_to_iarray_option None = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
show "matrix_to_iarray_option None = inverse_matrix_iarray (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray_option None = inverse_matrix_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding matrix_to_iarray_option_def inverse_matrix_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if None \<noteq> None then Some (matrix_to_iarray (the None)) else None) = (if invertible_iarray (matrix_to_iarray A) then Some (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) else None)
[PROOF STEP]
using not_inv_A
[PROOF STATE]
proof (prove)
using this:
\<not> invertible A

goal (1 subgoal):
 1. (if None \<noteq> None then Some (matrix_to_iarray (the None)) else None) = (if invertible_iarray (matrix_to_iarray A) then Some (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) else None)
[PROOF STEP]
unfolding matrix_to_iarray_invertible
[PROOF STATE]
proof (prove)
using this:
\<not> invertible_iarray (matrix_to_iarray A)

goal (1 subgoal):
 1. (if None \<noteq> None then Some (matrix_to_iarray (the None)) else None) = (if invertible_iarray (matrix_to_iarray A) then Some (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A))) else None)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
matrix_to_iarray_option None = inverse_matrix_iarray (matrix_to_iarray A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Group) Nfunc_LeastTr2_1:"\<lbrakk>i \<le> n; \<forall>l \<le> n. G \<guillemotright> f l; \<forall>l \<le> n. G \<guillemotright> g l;
       NfuncPair_neq_at f g i\<rbrakk> \<Longrightarrow>
        NfuncPair_neq_at f g (LEAST k. (NfuncPair_neq_at f g k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> n; \<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; NfuncPair_neq_at f g i\<rbrakk> \<Longrightarrow> NfuncPair_neq_at f g (LEAST k. NfuncPair_neq_at f g k)
[PROOF STEP]
apply (simp add: LeastI [of "NfuncPair_neq_at f g" "i"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma poly_cards:
  assumes "K \<subseteq> carrier R"
  assumes "card K \<le> k"
  assumes "y ` K \<subseteq> (carrier R)"
  shows
    "card {\<omega> \<in> space. (\<forall>k \<in> K. eval \<omega> k = y k)} = field_size^(k-card K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {\<omega> \<in> local.space. \<forall>k\<in>K. local.eval \<omega> k = y k} = field_size ^ (k - card K)
[PROOF STEP]
unfolding space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R k. \<forall>k\<in>K. local.eval \<omega> k = y k} = field_size ^ (k - card K)
[PROOF STEP]
using interpolating_polynomials_card[where n="k-card K" and K="K"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite K; K \<subseteq> carrier R; ?f ` K \<subseteq> carrier R\<rbrakk> \<Longrightarrow> card {\<omega> \<in> bounded_degree_polynomials R (card K + (k - card K)). \<forall>k\<in>K. local.eval \<omega> k = ?f k} = field_size ^ (k - card K)
K \<subseteq> carrier R
card K \<le> k
y ` K \<subseteq> carrier R

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R k. \<forall>k\<in>K. local.eval \<omega> k = y k} = field_size ^ (k - card K)
[PROOF STEP]
using finite_carrier finite_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite K; K \<subseteq> carrier R; ?f ` K \<subseteq> carrier R\<rbrakk> \<Longrightarrow> card {\<omega> \<in> bounded_degree_polynomials R (card K + (k - card K)). \<forall>k\<in>K. local.eval \<omega> k = ?f k} = field_size ^ (k - card K)
K \<subseteq> carrier R
card K \<le> k
y ` K \<subseteq> carrier R
finite (carrier R)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. card {\<omega> \<in> bounded_degree_polynomials R k. \<forall>k\<in>K. local.eval \<omega> k = y k} = field_size ^ (k - card K)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma prv_eql_subst_trm_eqv:
  assumes "x \<in> var" and "\<phi> \<in> fmla" and "t1 \<in> trm" and "t2 \<in> trm"
  assumes "prv (eql t1 t2)"
  shows "prv (eqv (subst \<phi> t1 x) (subst \<phi> t2 x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (eqv (subst \<phi> t1 x) (subst \<phi> t2 x))
[PROOF STEP]
using assms prv_eql_subst_trm2[OF assms] prv_eql_subst_trm_rev2[OF assms]
    prv_eqvI
[PROOF STATE]
proof (prove)
using this:
x \<in> var
\<phi> \<in> fmla
t1 \<in> trm
t2 \<in> trm
prv (eql t1 t2)
prv (imp (subst \<phi> t1 x) (subst \<phi> t2 x))
prv (imp (subst \<phi> t2 x) (subst \<phi> t1 x))
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla; prv (imp ?\<phi> ?\<chi>); prv (imp ?\<chi> ?\<phi>)\<rbrakk> \<Longrightarrow> prv (eqv ?\<phi> ?\<chi>)

goal (1 subgoal):
 1. prv (eqv (subst \<phi> t1 x) (subst \<phi> t2 x))
[PROOF STEP]
by auto


[STATEMENT]
lemma all_iff_abs': "(\<forall>x<abs_nat m. P x) \<longleftrightarrow> (\<forall>n::nat<m. P (abs_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x<abs_nat m. P x) = (\<forall>n<m. P (abs_nat n))
[PROOF STEP]
by (metis abs_inverse rep_inverse ord_iff(2))


[STATEMENT]
lemma cong_0_1_int: "[0 = 1] (mod n) \<longleftrightarrow> n = 1 \<or> n = - 1"
  for n :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0 = 1] (mod n) = (n = 1 \<or> n = - 1)
[PROOF STEP]
by (auto simp: cong_def zmult_eq_1_iff)


[STATEMENT]
lemma sin_mono_le_eq:
  "- (pi/2) \<le> x \<Longrightarrow> x \<le> pi/2 \<Longrightarrow> - (pi/2) \<le> y \<Longrightarrow> y \<le> pi/2 \<Longrightarrow> sin x \<le> sin y \<longleftrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- (pi / 2) \<le> x; x \<le> pi / 2; - (pi / 2) \<le> y; y \<le> pi / 2\<rbrakk> \<Longrightarrow> (sin x \<le> sin y) = (x \<le> y)
[PROOF STEP]
by (meson leD le_less_linear sin_monotone_2pi sin_monotone_2pi_le)


[STATEMENT]
lemma tendsto_tan [tendsto_intros]:
  fixes f :: "'a \<Rightarrow> 'a::{real_normed_field,banach}"
  shows "(f \<longlongrightarrow> a) F \<Longrightarrow> cos a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. tan (f x)) \<longlongrightarrow> tan a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> a) F; cos a \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ((\<lambda>x. tan (f x)) \<longlongrightarrow> tan a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_tan])


[STATEMENT]
lemma countable_or_card_of:
assumes "countable A"
shows "(finite A \<and> |A| <o |UNIV::nat set| ) \<or>
       (infinite A  \<and> |A| =o |UNIV::nat set| )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<and> |A| <o |UNIV| \<or> infinite A \<and> |A| =o |UNIV|
[PROOF STEP]
by (metis assms countable_card_of_nat infinite_iff_card_of_nat ordIso_iff_ordLeq
      ordLeq_iff_ordLess_or_ordIso)


[STATEMENT]
lemma rel_star_contr: "X^* O Y = (\<Union>n. (rel_dioid.power X n) O Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X\<^sup>* O Y = (\<Union>n. rel_dioid.power X n O Y)
[PROOF STEP]
by (metis rel_star_def relcomp_UNION_distrib2)


[STATEMENT]
lemma epred_min [simp]: "epred (min a b) = min (epred a) (epred b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. epred (min a b) = min (epred a) (epred b)
[PROOF STEP]
by(cases a b rule: enat_coexhaust[case_product enat_coexhaust]) simp_all


[STATEMENT]
lemma arccos_arcsin_eq: "-1 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> arccos x = pi/2 - arcsin x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- 1 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> arccos x = pi / 2 - arcsin x
[PROOF STEP]
using arcsin_plus_arccos
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- 1 \<le> ?x; ?x \<le> 1\<rbrakk> \<Longrightarrow> arcsin ?x + arccos ?x = pi / 2

goal (1 subgoal):
 1. \<lbrakk>- 1 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> arccos x = pi / 2 - arcsin x
[PROOF STEP]
by force


[STATEMENT]
lemma (in wf_sub_rel) sp_append_one :
  "subpath g v1 (es @ [e]) v2 subs \<longleftrightarrow> subpath g v1 es (src e) subs
                                     \<and> e \<in> edges g
                                     \<and> (tgt e = v2 \<or> (tgt e, v2) \<in> subs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SubRel.subpath g v1 (es @ [e]) v2 subs = (SubRel.subpath g v1 es (src e) subs \<and> e \<in> edges g \<and> (tgt e = v2 \<or> (tgt e, v2) \<in> subs))
[PROOF STEP]
using sp_append_one in_trancl_imp
[PROOF STATE]
proof (prove)
using this:
SubRel.subpath ?g ?v1.0 (?es @ [?e]) ?v2.0 ?subs = (SubRel.subpath ?g ?v1.0 ?es (src ?e) ?subs \<and> ?e \<in> edges ?g \<and> (tgt ?e = ?v2.0 \<or> (tgt ?e, ?v2.0) \<in> ?subs\<^sup>+))
(?v, ?v') \<in> subs\<^sup>+ \<Longrightarrow> (?v, ?v') \<in> subs

goal (1 subgoal):
 1. SubRel.subpath g v1 (es @ [e]) v2 subs = (SubRel.subpath g v1 es (src e) subs \<and> e \<in> edges g \<and> (tgt e = v2 \<or> (tgt e, v2) \<in> subs))
[PROOF STEP]
by fast


[STATEMENT]
lemma cnj_one [simp]: "cnj 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Quaternions.cnj 1 = 1
[PROOF STEP]
by (simp add: quat_eq_iff)


[STATEMENT]
theorem p59: "\<forall>x::'a. F(x) \<longleftrightarrow> \<not>F(f(x)) \<Longrightarrow> \<exists>x. F(x) \<and> \<not>F(f(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. F x = (\<not> F (f x)) \<Longrightarrow> \<exists>x. F x \<and> \<not> F (f x)
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. F x = (\<not> F (f x)) \<Longrightarrow> \<exists>x. F x \<and> \<not> F (f x)
[PROOF STEP]
@obtain "x::'a" where "x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. F x = (\<not> F (f x)) \<Longrightarrow> \<exists>x. F x \<and> \<not> F (f x)
[PROOF STEP]
@case "F(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. F x = (\<not> F (f x)) \<Longrightarrow> \<exists>x. F x \<and> \<not> F (f x)
[PROOF STEP]
@qed


[STATEMENT]
lemma real_root_le_iff [simp]: "0 < n \<Longrightarrow> root n x \<le> root n y \<longleftrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (root n x \<le> root n y) = (x \<le> y)
[PROOF STEP]
by (cases "x \<le> y") (simp_all add: real_root_le_mono linorder_not_le real_root_less_mono)


[STATEMENT]
lemma (in group) rcosets_subset_PowG:
     "subgroup H G  \<Longrightarrow> rcosets H \<subseteq> Pow(carrier G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G \<Longrightarrow> rcosets H \<subseteq> Pow (carrier G)
[PROOF STEP]
using rcosets_part_G
[PROOF STATE]
proof (prove)
using this:
subgroup ?H G \<Longrightarrow> \<Union> (rcosets ?H) = carrier G

goal (1 subgoal):
 1. subgroup H G \<Longrightarrow> rcosets H \<subseteq> Pow (carrier G)
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_PiE: "finite S \<Longrightarrow> (\<And>i. i \<in> S \<Longrightarrow> finite (T i)) \<Longrightarrow> finite (\<Pi>\<^sub>E i \<in> S. T i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; \<And>i. i \<in> S \<Longrightarrow> finite (T i)\<rbrakk> \<Longrightarrow> finite (Pi\<^sub>E S T)
[PROOF STEP]
by (induct S arbitrary: T rule: finite_induct) (simp_all add: PiE_insert_eq)


[STATEMENT]
lemma size_Diff_submset:
  "M \<subseteq># M' \<Longrightarrow> size (M' - M) = size M' - size(M::'a multiset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq># M' \<Longrightarrow> size (M' - M) = size M' - size M
[PROOF STEP]
by (metis add_diff_cancel_left' size_union mset_subset_eq_exists_conv)


[STATEMENT]
lemma uniformly_convergent_add:
  "uniformly_convergent_on A f \<Longrightarrow> uniformly_convergent_on A g\<Longrightarrow>
      uniformly_convergent_on A (\<lambda>k x. f k x + g k x :: 'a :: {real_normed_algebra})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>uniformly_convergent_on A f; uniformly_convergent_on A g\<rbrakk> \<Longrightarrow> uniformly_convergent_on A (\<lambda>k x. f k x + g k x)
[PROOF STEP]
unfolding uniformly_convergent_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>l. uniform_limit A f l sequentially; \<exists>l. uniform_limit A g l sequentially\<rbrakk> \<Longrightarrow> \<exists>l. uniform_limit A (\<lambda>k x. f k x + g k x) l sequentially
[PROOF STEP]
by (blast dest: uniform_limit_add)


[STATEMENT]
lemma galois_char:
  "galois l u \<longleftrightarrow> (\<forall>x . x \<le> u (l x)) \<and> (\<forall>x . l (u x) \<le> x) \<and> isotone l \<and> isotone u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. galois l u = ((\<forall>x. x \<le> u (l x)) \<and> (\<forall>x. l (u x) \<le> x) \<and> isotone l \<and> isotone u)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. galois l u \<Longrightarrow> (\<forall>x. x \<le> u (l x)) \<and> (\<forall>x. l (u x) \<le> x) \<and> isotone l \<and> isotone u
 2. (\<forall>x. x \<le> u (l x)) \<and> (\<forall>x. l (u x) \<le> x) \<and> isotone l \<and> isotone u \<Longrightarrow> galois l u
[PROOF STEP]
apply (metis (full_types) galois_def isotone_def order_refl order_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<le> u (l x)) \<and> (\<forall>x. l (u x) \<le> x) \<and> isotone l \<and> isotone u \<Longrightarrow> galois l u
[PROOF STEP]
using galois_def isotone_def order_trans
[PROOF STATE]
proof (prove)
using this:
galois ?l ?u \<equiv> \<forall>x y. (?l x \<le> y) = (x \<le> ?u y)
isotone ?f \<equiv> \<forall>x y. x \<le> y \<longrightarrow> ?f x \<le> ?f y
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. (\<forall>x. x \<le> u (l x)) \<and> (\<forall>x. l (u x) \<le> x) \<and> isotone l \<and> isotone u \<Longrightarrow> galois l u
[PROOF STEP]
by blast


[STATEMENT]
lemma mat_mod_rep_num_eq:  "i < dim_row N \<Longrightarrow> elements_mat N \<subseteq> {0..<m} \<Longrightarrow>
    mat_rep_num (mat_mod N) i = mat_rep_num N i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < dim_row N; elements_mat N \<subseteq> {0..<m}\<rbrakk> \<Longrightarrow> mat_rep_num (local.mat_mod N) i = mat_rep_num N i
[PROOF STEP]
by (simp add: mat_mod_count_row_eq mat_rep_num_def)


[STATEMENT]
lemma confluent_unique_normal_form:
  "\<lbrakk> confluent R; R^** a b; R^** a c; \<not> Domainp R b; \<not> Domainp R c  \<rbrakk> \<Longrightarrow> b = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>confluent R; R\<^sup>*\<^sup>* a b; R\<^sup>*\<^sup>* a c; \<not> Domainp R b; \<not> Domainp R c\<rbrakk> \<Longrightarrow> b = c
[PROOF STEP]
by(fastforce dest!: confluentD[of R a b c] dest: tranclp_DomainP rtranclpD[where a=b] rtranclpD[where a=c])


[STATEMENT]
lemma gen_binomial_real':
  fixes x y a :: real
  assumes "\<bar>x\<bar> < y"
  shows   "(\<lambda>n. (a gchoose n) * x^n * y powr (a - of_nat n)) sums (x + y) powr a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> < y
[PROOF STEP]
have "y > 0"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < y

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

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a
[PROOF STEP]
note xy = this assms
[PROOF STATE]
proof (state)
this:
0 < y
\<bar>x\<bar> < y

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> < y
[PROOF STEP]
have "\<bar>x / y\<bar> < 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < y

goal (1 subgoal):
 1. \<bar>x / y\<bar> < 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>x / y\<bar> < 1

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a
[PROOF STEP]
hence "(\<lambda>n. (a gchoose n) * (x / y) ^ n) sums (1 + x / y) powr a"
[PROOF STATE]
proof (prove)
using this:
\<bar>x / y\<bar> < 1

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * (x / y) ^ n) sums (1 + x / y) powr a
[PROOF STEP]
by (rule gen_binomial_real)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (a gchoose n) * (x / y) ^ n) sums (1 + x / y) powr a

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a
[PROOF STEP]
hence "(\<lambda>n. (a gchoose n) * (x / y) ^ n * y powr a) sums ((1 + x / y) powr a * y powr a)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (a gchoose n) * (x / y) ^ n) sums (1 + x / y) powr a

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * (x / y) ^ n * y powr a) sums ((1 + x / y) powr a * y powr a)
[PROOF STEP]
by (rule sums_mult2)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (a gchoose n) * (x / y) ^ n * y powr a) sums ((1 + x / y) powr a * y powr a)

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a
[PROOF STEP]
with xy
[PROOF STATE]
proof (chain)
picking this:
0 < y
\<bar>x\<bar> < y
(\<lambda>n. (a gchoose n) * (x / y) ^ n * y powr a) sums ((1 + x / y) powr a * y powr a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < y
\<bar>x\<bar> < y
(\<lambda>n. (a gchoose n) * (x / y) ^ n * y powr a) sums ((1 + x / y) powr a * y powr a)

goal (1 subgoal):
 1. (\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a
[PROOF STEP]
by (simp add: field_simps powr_divide powr_diff powr_realpow)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (a gchoose n) * x ^ n * y powr (a - real n)) sums (x + y) powr a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_clinear_o_bounded_antilinear:
  assumes "bounded_clinear f"
    and "bounded_antilinear g"
  shows "bounded_antilinear (\<lambda>x. f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_antilinear (\<lambda>x. f (g x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. f (g (x + y)) = f (g x) + f (g y)
 2. \<And>r x. f (g (r *\<^sub>C x)) = cnj r *\<^sub>C f (g x)
 3. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
interpret f: bounded_clinear f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. f (g (x + y)) = f (g x) + f (g y)
 2. \<And>r x. f (g (r *\<^sub>C x)) = cnj r *\<^sub>C f (g x)
 3. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
interpret g: bounded_antilinear g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_antilinear g
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. f (g (x + y)) = f (g x) + f (g y)
 2. \<And>r x. f (g (r *\<^sub>C x)) = cnj r *\<^sub>C f (g x)
 3. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
show "f (g (x + y)) = f (g x) + f (g y)" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (g (x + y)) = f (g x) + f (g y)
[PROOF STEP]
by (simp only: f.add g.add)
[PROOF STATE]
proof (state)
this:
f (g (?x + ?y)) = f (g ?x) + f (g ?y)

goal (2 subgoals):
 1. \<And>r x. f (g (r *\<^sub>C x)) = cnj r *\<^sub>C f (g x)
 2. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
show "f (g (scaleC r x)) = scaleC (cnj r) (f (g x))" for r x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (g (r *\<^sub>C x)) = cnj r *\<^sub>C f (g x)
[PROOF STEP]
using f.scaleC g.scaleC
[PROOF STATE]
proof (prove)
using this:
f (?r *\<^sub>C ?b) = ?r *\<^sub>C f ?b
g (?r *\<^sub>C ?x) = cnj ?r *\<^sub>C g ?x

goal (1 subgoal):
 1. f (g (r *\<^sub>C x)) = cnj r *\<^sub>C f (g x)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f (g (?r *\<^sub>C ?x)) = cnj ?r *\<^sub>C f (g ?x)

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
have "bounded_linear (\<lambda>x. f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f (g x))
[PROOF STEP]
using f.bounded_linear g.bounded_linear
[PROOF STATE]
proof (prove)
using this:
bounded_linear f
bounded_linear g

goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f (g x))
[PROOF STEP]
by (rule bounded_linear_compose)
[PROOF STATE]
proof (state)
this:
bounded_linear (\<lambda>x. f (g x))

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_linear (\<lambda>x. f (g x))
[PROOF STEP]
show "\<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K"
[PROOF STATE]
proof (prove)
using this:
bounded_linear (\<lambda>x. f (g x))

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
by (rule bounded_linear.bounded)
[PROOF STATE]
proof (state)
this:
\<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_interior_closure_convex_segment:
  fixes S :: "'a::euclidean_space set"
  assumes "convex S" and a: "a \<in> interior S" and b: "b \<in> closure S"
    shows "open_segment a b \<subseteq> interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open_segment a b \<subseteq> interior S
[PROOF STEP]
proof (clarsimp simp: in_segment)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>a \<noteq> b; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S
[PROOF STEP]
fix u::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>a \<noteq> b; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S
[PROOF STEP]
assume u: "0 < u" "u < 1"
[PROOF STATE]
proof (state)
this:
0 < u
u < 1

goal (1 subgoal):
 1. \<And>u. \<lbrakk>a \<noteq> b; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S
[PROOF STEP]
have "(1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>a \<noteq> b; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)

goal (1 subgoal):
 1. \<And>u. \<lbrakk>a \<noteq> b; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S
[PROOF STEP]
have "... \<in> interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b - (1 - u) *\<^sub>R (b - a) \<in> interior S
[PROOF STEP]
using mem_interior_closure_convex_shrink [OF assms] u
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?e; ?e \<le> 1\<rbrakk> \<Longrightarrow> b - ?e *\<^sub>R (b - a) \<in> interior S
0 < u
u < 1

goal (1 subgoal):
 1. b - (1 - u) *\<^sub>R (b - a) \<in> interior S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b - (1 - u) *\<^sub>R (b - a) \<in> interior S

goal (1 subgoal):
 1. \<And>u. \<lbrakk>a \<noteq> b; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S
[PROOF STEP]
show "(1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S"
[PROOF STATE]
proof (prove)
using this:
(1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S

goal (1 subgoal):
 1. (1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pointwise_le_iff_nth:
  "x \<unlhd> y \<longleftrightarrow> length x = length y \<and> (\<forall>i < length x. x!i \<le> y!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<unlhd> y) = (length x = length y \<and> (\<forall>i<length x. x ! i \<le> y ! i))
[PROOF STEP]
by (simp add: list_all2_conv_all_nth pointwise_le_def)


[STATEMENT]
lemma sorted_wrt_insert_wrt [intro]:
  "linorder_on A R \<Longrightarrow> set (x # xs) \<subseteq> A \<Longrightarrow>
     sorted_wrt R xs \<Longrightarrow> sorted_wrt R (insert_wrt R x xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linorder_on A R; set (x # xs) \<subseteq> A; Linorder_Relations.sorted_wrt R xs\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x xs)
[PROOF STEP]
proof (induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>linorder_on A R; set [x] \<subseteq> A; Linorder_Relations.sorted_wrt R []\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x [])
 2. \<And>a xs. \<lbrakk>\<lbrakk>linorder_on A R; set (x # xs) \<subseteq> A; Linorder_Relations.sorted_wrt R xs\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x xs); linorder_on A R; set (x # a # xs) \<subseteq> A; Linorder_Relations.sorted_wrt R (a # xs)\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x (a # xs))
[PROOF STEP]
case (Cons y ys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>linorder_on A R; set (x # ys) \<subseteq> A; Linorder_Relations.sorted_wrt R ys\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x ys)
linorder_on A R
set (x # y # ys) \<subseteq> A
Linorder_Relations.sorted_wrt R (y # ys)

goal (2 subgoals):
 1. \<lbrakk>linorder_on A R; set [x] \<subseteq> A; Linorder_Relations.sorted_wrt R []\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x [])
 2. \<And>a xs. \<lbrakk>\<lbrakk>linorder_on A R; set (x # xs) \<subseteq> A; Linorder_Relations.sorted_wrt R xs\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x xs); linorder_on A R; set (x # a # xs) \<subseteq> A; Linorder_Relations.sorted_wrt R (a # xs)\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x (a # xs))
[PROOF STEP]
from Cons.prems
[PROOF STATE]
proof (chain)
picking this:
linorder_on A R
set (x # y # ys) \<subseteq> A
Linorder_Relations.sorted_wrt R (y # ys)
[PROOF STEP]
have "(x,y) \<in> R \<or> (y,x) \<in> R"
[PROOF STATE]
proof (prove)
using this:
linorder_on A R
set (x # y # ys) \<subseteq> A
Linorder_Relations.sorted_wrt R (y # ys)

goal (1 subgoal):
 1. (x, y) \<in> R \<or> (y, x) \<in> R
[PROOF STEP]
by (cases "x = y") (auto simp: linorder_on_def refl_on_def total_on_def)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> R \<or> (y, x) \<in> R

goal (2 subgoals):
 1. \<lbrakk>linorder_on A R; set [x] \<subseteq> A; Linorder_Relations.sorted_wrt R []\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x [])
 2. \<And>a xs. \<lbrakk>\<lbrakk>linorder_on A R; set (x # xs) \<subseteq> A; Linorder_Relations.sorted_wrt R xs\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x xs); linorder_on A R; set (x # a # xs) \<subseteq> A; Linorder_Relations.sorted_wrt R (a # xs)\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x (a # xs))
[PROOF STEP]
with Cons
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>linorder_on A R; set (x # ys) \<subseteq> A; Linorder_Relations.sorted_wrt R ys\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x ys)
linorder_on A R
set (x # y # ys) \<subseteq> A
Linorder_Relations.sorted_wrt R (y # ys)
(x, y) \<in> R \<or> (y, x) \<in> R
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>linorder_on A R; set (x # ys) \<subseteq> A; Linorder_Relations.sorted_wrt R ys\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x ys)
linorder_on A R
set (x # y # ys) \<subseteq> A
Linorder_Relations.sorted_wrt R (y # ys)
(x, y) \<in> R \<or> (y, x) \<in> R

goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R (insert_wrt R x (y # ys))
[PROOF STEP]
by (auto simp: sorted_wrt_Cons intro: transD simp: linorder_on_def)
[PROOF STATE]
proof (state)
this:
Linorder_Relations.sorted_wrt R (insert_wrt R x (y # ys))

goal (1 subgoal):
 1. \<lbrakk>linorder_on A R; set [x] \<subseteq> A; Linorder_Relations.sorted_wrt R []\<rbrakk> \<Longrightarrow> Linorder_Relations.sorted_wrt R (insert_wrt R x [])
[PROOF STEP]
qed auto


[STATEMENT]
lemma one_dim_onorm:
  fixes f :: "'a::one_dim \<Rightarrow> 'b::complex_normed_vector"
  assumes "clinear f"
  shows "onorm f = norm (f 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm f = norm (f (1::'a))
[PROOF STEP]
proof (rule onormI[where x=1])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. norm (f x) \<le> norm (f (1::'a)) * norm x
 2. (1::'a) \<noteq> (0::'a)
 3. norm (f (1::'a)) = norm (f (1::'a)) * norm (1::'a)
[PROOF STEP]
fix x :: 'a
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. norm (f x) \<le> norm (f (1::'a)) * norm x
 2. (1::'a) \<noteq> (0::'a)
 3. norm (f (1::'a)) = norm (f (1::'a)) * norm (1::'a)
[PROOF STEP]
have "norm x * norm (f 1) \<le> norm (f 1) * norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x * norm (f (1::'a)) \<le> norm (f (1::'a)) * norm x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm x * norm (f (1::'a)) \<le> norm (f (1::'a)) * norm x

goal (3 subgoals):
 1. \<And>x. norm (f x) \<le> norm (f (1::'a)) * norm x
 2. (1::'a) \<noteq> (0::'a)
 3. norm (f (1::'a)) = norm (f (1::'a)) * norm (1::'a)
[PROOF STEP]
hence "norm (f (one_dim_iso x *\<^sub>C 1)) \<le> norm (f 1) * norm x"
[PROOF STATE]
proof (prove)
using this:
norm x * norm (f (1::'a)) \<le> norm (f (1::'a)) * norm x

goal (1 subgoal):
 1. norm (f (one_dim_iso x *\<^sub>C (1::'a))) \<le> norm (f (1::'a)) * norm x
[PROOF STEP]
by (metis (mono_tags, lifting) assms complex_vector.linear_scale norm_scaleC one_dim_norm)
[PROOF STATE]
proof (state)
this:
norm (f (one_dim_iso x *\<^sub>C (1::'a))) \<le> norm (f (1::'a)) * norm x

goal (3 subgoals):
 1. \<And>x. norm (f x) \<le> norm (f (1::'a)) * norm x
 2. (1::'a) \<noteq> (0::'a)
 3. norm (f (1::'a)) = norm (f (1::'a)) * norm (1::'a)
[PROOF STEP]
thus "norm (f x) \<le> norm (f 1) * norm x"
[PROOF STATE]
proof (prove)
using this:
norm (f (one_dim_iso x *\<^sub>C (1::'a))) \<le> norm (f (1::'a)) * norm x

goal (1 subgoal):
 1. norm (f x) \<le> norm (f (1::'a)) * norm x
[PROOF STEP]
by (subst one_dim_scaleC_1 [symmetric])
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> norm (f (1::'a)) * norm x

goal (2 subgoals):
 1. (1::'a) \<noteq> (0::'a)
 2. norm (f (1::'a)) = norm (f (1::'a)) * norm (1::'a)
[PROOF STEP]
qed auto


[STATEMENT]
lemma AMax:"\<lbrakk>A \<subseteq> UBset (ant z); A \<noteq> {}\<rbrakk> \<Longrightarrow>
                    (AMax A) \<in> A \<and> (\<forall>x\<in>A. x \<le> (AMax A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> UBset (ant z); A \<noteq> {}\<rbrakk> \<Longrightarrow> AMax A \<in> A \<and> (\<forall>x\<in>A. x \<le> AMax A)
[PROOF STEP]
apply (simp add:AMax_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> UBset (ant z); A \<noteq> {}\<rbrakk> \<Longrightarrow> (THE m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)) \<in> A \<and> (\<forall>x\<in>A. x \<le> (THE m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)))
[PROOF STEP]
apply (frule aubs_ex_AMax[of "A" "z"], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> UBset (ant z); A \<noteq> {}; \<exists>!m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)\<rbrakk> \<Longrightarrow> (THE m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)) \<in> A \<and> (\<forall>x\<in>A. x \<le> (THE m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)))
[PROOF STEP]
apply (rule theI')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> UBset (ant z); A \<noteq> {}; \<exists>!m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)\<rbrakk> \<Longrightarrow> \<exists>!x. x \<in> A \<and> (\<forall>xa\<in>A. xa \<le> x)
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma contour_integral_const_linepath [simp]: "contour_integral (linepath a b) (\<lambda>x. c) = c*(b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) (\<lambda>x. c) = c * (b - a)
[PROOF STEP]
by (rule contour_integral_unique [OF has_contour_integral_const_linepath])


[STATEMENT]
lemma iter_hcomp_union:
  assumes "vs |\<inter>| ws = {||}"
  shows "(\<Otimes>x |\<in>| vs |\<union>| ws. p x) = ((\<Otimes>x |\<in>| vs. p x) \<otimes> (\<Otimes>x |\<in>| ws. p x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iter_hcomp (vs |\<union>| ws) p = (iter_hcomp vs p \<otimes> iter_hcomp ws p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
vs |\<inter>| ws = {||}

goal (1 subgoal):
 1. iter_hcomp (vs |\<union>| ws) p = (iter_hcomp vs p \<otimes> iter_hcomp ws p)
[PROOF STEP]
by (induct vs) (auto simp add: emp_hcomp iter_hcomp_empty iter_hcomp_insert hcomp_assoc)


[STATEMENT]
lemma vector_scaleR_component [simp]: "(scaleR r x)$i = scaleR r (x$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r *\<^sub>R x) $ i = r *\<^sub>R x $ i
[PROOF STEP]
unfolding scaleR_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. r *\<^sub>R x $ i) $ i = r *\<^sub>R x $ i
[PROOF STEP]
by simp


[STATEMENT]
lemma poly_div_diff_left: "(x - y) div z = x div z - y div z"
  for x y z :: "'a::field poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - y) div z = x div z - y div z
[PROOF STEP]
by (simp only: diff_conv_add_uminus poly_div_add_left poly_div_minus_left)


[STATEMENT]
lemma "2 \<le> (x::real) \<and> x \<le> 4 \<and> 2 \<le> y \<and> y \<le> 4 \<and> 2 \<le> z \<and> z \<le> 4 \<longrightarrow>
    12 \<le> 2 * (x * z + x * y + y * z) - (x * x + y * y + z * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> x \<and> x \<le> 4 \<and> 2 \<le> y \<and> y \<le> 4 \<and> 2 \<le> z \<and> z \<le> 4 \<longrightarrow> 12 \<le> 2 * (x * z + x * y + y * z) - (x * x + y * y + z * z)
[PROOF STEP]
by sos


[STATEMENT]
lemma (in vectorspace) nested_subspaces:
assumes "subspace K W V"
assumes "subspace K X V"
assumes "X \<subseteq> W"
shows "subspace K X (vs W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace K X (vs W)
[PROOF STEP]
using assms nested_submodules subspace_def subspace_is_vs
[PROOF STATE]
proof (prove)
using this:
subspace K W V
subspace K X V
X \<subseteq> W
\<lbrakk>LinearCombinations.submodule K ?W V; LinearCombinations.submodule K ?X V; ?X \<subseteq> ?W\<rbrakk> \<Longrightarrow> LinearCombinations.submodule K ?X (vs ?W)
subspace ?K ?W ?V \<equiv> vectorspace ?K ?V \<and> LinearCombinations.submodule ?K ?W ?V
subspace K ?W V \<Longrightarrow> vectorspace K (vs ?W)

goal (1 subgoal):
 1. subspace K X (vs W)
[PROOF STEP]
by blast


[STATEMENT]
lemma "\<lbrakk> x3 = \<bar>x2\<bar> - x1; x4 = \<bar>x3\<bar> - x2; x5 = \<bar>x4\<bar> - x3;
         x6 = \<bar>x5\<bar> - x4; x7 = \<bar>x6\<bar> - x5; x8 = \<bar>x7\<bar> - x6;
         x9 = \<bar>x8\<bar> - x7; x10 = \<bar>x9\<bar> - x8; x11 = \<bar>x10\<bar> - x9 \<rbrakk>
 \<Longrightarrow> x1 = x10 \<and> x2 = (x11::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x3 = \<bar>x2\<bar> - x1; x4 = \<bar>x3\<bar> - x2; x5 = \<bar>x4\<bar> - x3; x6 = \<bar>x5\<bar> - x4; x7 = \<bar>x6\<bar> - x5; x8 = \<bar>x7\<bar> - x6; x9 = \<bar>x8\<bar> - x7; x10 = \<bar>x9\<bar> - x8; x11 = \<bar>x10\<bar> - x9\<rbrakk> \<Longrightarrow> x1 = x10 \<and> x2 = x11
[PROOF STEP]
by smt


[STATEMENT]
lemma lnull_ldrop [simp]: "lnull (ldrop n xs) \<longleftrightarrow> llength xs \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lnull (ldrop n xs) = (llength xs \<le> n)
[PROOF STEP]
unfolding lnull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ldrop n xs = LNil) = (llength xs \<le> n)
[PROOF STEP]
by(fact ldrop_eq_LNil)


[STATEMENT]
lemma bset_map_closed:
  fixes f A
  defines "B \<equiv> image f A"
  assumes "finite A \<and> card A \<le> CARD('k)"
  shows "finite B \<and> card B \<le> CARD('k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B \<and> card B \<le> CARD('k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B \<equiv> f ` A
finite A \<and> card A \<le> CARD('k)

goal (1 subgoal):
 1. finite B \<and> card B \<le> CARD('k)
[PROOF STEP]
by(auto intro: card_image_le[THEN order_trans])


[STATEMENT]
lemma nn_integral_empty:
  assumes "space M = {}"
  shows "nn_integral M f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M f = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N M f = 0
[PROOF STEP]
have "(\<integral>\<^sup>+ x. f x \<partial>M) = (\<integral>\<^sup>+ x. 0 \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M f = \<integral>\<^sup>+ x. 0 \<partial>M
[PROOF STEP]
by(rule nn_integral_cong)(simp add: assms)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M f = \<integral>\<^sup>+ x. 0 \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M f = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M f = \<integral>\<^sup>+ x. 0 \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M f = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M f = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Hadjicostas_Chapman_formula:
  assumes z: "Re z > -2" "z \<noteq> -1"
  shows   "Hadjicostas_integral z = Gamma (z + 2) * (zeta (z + 2) - 1 / (z + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hadjicostas_integral z = Gamma (z + 2) * (zeta (z + 2) - 1 / (z + 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Hadjicostas_integral z = Gamma (z + 2) * (zeta (z + 2) - 1 / (z + 1))
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
- 2 < Re z
z \<noteq> - 1
[PROOF STEP]
have "z + 1 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
- 2 < Re z
z \<noteq> - 1

goal (1 subgoal):
 1. z + 1 \<noteq> 0
[PROOF STEP]
by (auto simp: complex_eq_iff)
[PROOF STATE]
proof (state)
this:
z + 1 \<noteq> 0

goal (1 subgoal):
 1. Hadjicostas_integral z = Gamma (z + 2) * (zeta (z + 2) - 1 / (z + 1))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
z + 1 \<noteq> 0

goal (1 subgoal):
 1. Hadjicostas_integral z = Gamma (z + 2) * (zeta (z + 2) - 1 / (z + 1))
[PROOF STEP]
using Hadjicostas_Chapman_formula_aux[of z] assms
[PROOF STATE]
proof (prove)
using this:
z + 1 \<noteq> 0
- 2 < Re z \<Longrightarrow> Hadjicostas_integral z = Gamma (z + 2) * pre_zeta 1 (z + 2)
- 2 < Re z
z \<noteq> - 1

goal (1 subgoal):
 1. Hadjicostas_integral z = Gamma (z + 2) * (zeta (z + 2) - 1 / (z + 1))
[PROOF STEP]
by (subst (asm) zeta_minus_pole_eq [symmetric]) (auto simp: add_ac)
[PROOF STATE]
proof (state)
this:
Hadjicostas_integral z = Gamma (z + 2) * (zeta (z + 2) - 1 / (z + 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hcomplex_hRe_hIm_cancel_iff: "\<And>w z. w = z \<longleftrightarrow> hRe w = hRe z \<and> hIm w = hIm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w z. (w = z) = (hRe w = hRe z \<and> hIm w = hIm z)
[PROOF STEP]
by transfer (rule complex_eq_iff)


[STATEMENT]
lemma fib_conv_gen_fib: "fib n = gen_fib 0 1 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib n = gen_fib 0 1 n
[PROOF STEP]
using gen_fib_fib[of 0 n]
[PROOF STATE]
proof (prove)
using this:
gen_fib (fib 0) (fib (Suc 0)) n = fib (0 + n)

goal (1 subgoal):
 1. fib n = gen_fib 0 1 n
[PROOF STEP]
by simp


[STATEMENT]
lemma consec_un_equality:
  "(consec i j \<and> k \<noteq> \<emptyset>)
    \<longrightarrow>( minimum (i \<squnion> j) = minimum (k) \<and> maximum (i \<squnion> j) = maximum (k))
      \<longrightarrow> i \<squnion> j = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consec i j \<and> k \<noteq> bot \<longrightarrow> minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k \<longrightarrow> i \<squnion> j = k
[PROOF STEP]
proof (rule impI)+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>consec i j \<and> k \<noteq> bot; minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k\<rbrakk> \<Longrightarrow> i \<squnion> j = k
[PROOF STEP]
assume cons:"consec i j \<and> k \<noteq> \<emptyset>"
[PROOF STATE]
proof (state)
this:
consec i j \<and> k \<noteq> bot

goal (1 subgoal):
 1. \<lbrakk>consec i j \<and> k \<noteq> bot; minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k\<rbrakk> \<Longrightarrow> i \<squnion> j = k
[PROOF STEP]
assume endpoints:" minimum(i \<squnion> j) = minimum(k) \<and> maximum(i \<squnion> j) = maximum(k)"
[PROOF STATE]
proof (state)
this:
minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k

goal (1 subgoal):
 1. \<lbrakk>consec i j \<and> k \<noteq> bot; minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k\<rbrakk> \<Longrightarrow> i \<squnion> j = k
[PROOF STEP]
have "Rep_nat_int( i \<squnion> j) = {minimum(i \<squnion> j)..maximum(i \<squnion> j)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_nat_int (i \<squnion> j) = {minimum (i \<squnion> j)..maximum (i \<squnion> j)}
[PROOF STEP]
by (metis cons leq_max_sup leq_min_inf local.consec_def nat_int.consec_un_element2
        nat_int.maximum_def nat_int.minimum_def nat_int.non_empty_elem_in rep_non_empty_means_seq)
[PROOF STATE]
proof (state)
this:
Rep_nat_int (i \<squnion> j) = {minimum (i \<squnion> j)..maximum (i \<squnion> j)}

goal (1 subgoal):
 1. \<lbrakk>consec i j \<and> k \<noteq> bot; minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k\<rbrakk> \<Longrightarrow> i \<squnion> j = k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Rep_nat_int (i \<squnion> j) = {minimum (i \<squnion> j)..maximum (i \<squnion> j)}
[PROOF STEP]
have 1:"Rep_nat_int( i \<squnion> j) = {minimum(k) .. maximum(k)}"
[PROOF STATE]
proof (prove)
using this:
Rep_nat_int (i \<squnion> j) = {minimum (i \<squnion> j)..maximum (i \<squnion> j)}

goal (1 subgoal):
 1. Rep_nat_int (i \<squnion> j) = {minimum k..maximum k}
[PROOF STEP]
using endpoints
[PROOF STATE]
proof (prove)
using this:
Rep_nat_int (i \<squnion> j) = {minimum (i \<squnion> j)..maximum (i \<squnion> j)}
minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k

goal (1 subgoal):
 1. Rep_nat_int (i \<squnion> j) = {minimum k..maximum k}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Rep_nat_int (i \<squnion> j) = {minimum k..maximum k}

goal (1 subgoal):
 1. \<lbrakk>consec i j \<and> k \<noteq> bot; minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k\<rbrakk> \<Longrightarrow> i \<squnion> j = k
[PROOF STEP]
have "Rep_nat_int( k) = {minimum(k) .. maximum(k)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_nat_int k = {minimum k..maximum k}
[PROOF STEP]
by (metis cons leq_max_sup leq_min_inf nat_int.maximum_def nat_int.minimum_def
        rep_non_empty_means_seq)
[PROOF STATE]
proof (state)
this:
Rep_nat_int k = {minimum k..maximum k}

goal (1 subgoal):
 1. \<lbrakk>consec i j \<and> k \<noteq> bot; minimum (i \<squnion> j) = minimum k \<and> maximum (i \<squnion> j) = maximum k\<rbrakk> \<Longrightarrow> i \<squnion> j = k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Rep_nat_int k = {minimum k..maximum k}
[PROOF STEP]
show " i \<squnion> j = k"
[PROOF STATE]
proof (prove)
using this:
Rep_nat_int k = {minimum k..maximum k}

goal (1 subgoal):
 1. i \<squnion> j = k
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
Rep_nat_int k = {minimum k..maximum k}
Rep_nat_int (i \<squnion> j) = {minimum k..maximum k}

goal (1 subgoal):
 1. i \<squnion> j = k
[PROOF STEP]
by (metis Rep_nat_int_inverse)
[PROOF STATE]
proof (state)
this:
i \<squnion> j = k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infsum_scaleC_left:
  fixes c :: \<open>'a :: complex_normed_vector\<close>
  assumes "c \<noteq> 0 \<Longrightarrow> f summable_on A"
  shows   "infsum (\<lambda>x. f x *\<^sub>C c) A = infsum f A *\<^sub>C c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. f x *\<^sub>C c) = infsum f A *\<^sub>C c
[PROOF STEP]
apply (cases \<open>c \<noteq> 0\<close>)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c \<noteq> (0::'a) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. f x *\<^sub>C c) = infsum f A *\<^sub>C c
 2. \<not> c \<noteq> (0::'a) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. f x *\<^sub>C c) = infsum f A *\<^sub>C c
[PROOF STEP]
apply (subst asm_rl[of \<open>(\<lambda>x. f x *\<^sub>C c) = (\<lambda>y. y *\<^sub>C c) o f\<close>], simp add: o_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c \<noteq> (0::'a) \<Longrightarrow> infsum ((\<lambda>y. y *\<^sub>C c) \<circ> f) A = infsum f A *\<^sub>C c
 2. \<not> c \<noteq> (0::'a) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. f x *\<^sub>C c) = infsum f A *\<^sub>C c
[PROOF STEP]
apply (rule infsum_comm_additive)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. c \<noteq> (0::'a) \<Longrightarrow> additive (\<lambda>y. y *\<^sub>C c)
 2. c \<noteq> (0::'a) \<Longrightarrow> isCont (\<lambda>y. y *\<^sub>C c) (infsum f A)
 3. c \<noteq> (0::'a) \<Longrightarrow> f summable_on A
 4. \<not> c \<noteq> (0::'a) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. f x *\<^sub>C c) = infsum f A *\<^sub>C c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a) \<Longrightarrow> f summable_on A

goal (4 subgoals):
 1. c \<noteq> (0::'a) \<Longrightarrow> additive (\<lambda>y. y *\<^sub>C c)
 2. c \<noteq> (0::'a) \<Longrightarrow> isCont (\<lambda>y. y *\<^sub>C c) (infsum f A)
 3. c \<noteq> (0::'a) \<Longrightarrow> f summable_on A
 4. \<not> c \<noteq> (0::'a) \<Longrightarrow> (\<Sum>\<^sub>\<infinity>x\<in>A. f x *\<^sub>C c) = infsum f A *\<^sub>C c
[PROOF STEP]
by (auto simp add: scaleC_left.additive_axioms)


[STATEMENT]
lemma length_Keys_to_list: "length (Keys_to_list ps) = card (Keys (set ps))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (Keys_to_list ps) = card (Keys (set ps))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (Keys_to_list ps) = card (Keys (set ps))
[PROOF STEP]
from distinct_Keys_to_list
[PROOF STATE]
proof (chain)
picking this:
distinct (Keys_to_list ?ps)
[PROOF STEP]
have "card (set (Keys_to_list ps)) = length (Keys_to_list ps)"
[PROOF STATE]
proof (prove)
using this:
distinct (Keys_to_list ?ps)

goal (1 subgoal):
 1. card (set (Keys_to_list ps)) = length (Keys_to_list ps)
[PROOF STEP]
by (rule distinct_card)
[PROOF STATE]
proof (state)
this:
card (set (Keys_to_list ps)) = length (Keys_to_list ps)

goal (1 subgoal):
 1. length (Keys_to_list ps) = card (Keys (set ps))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card (set (Keys_to_list ps)) = length (Keys_to_list ps)

goal (1 subgoal):
 1. length (Keys_to_list ps) = card (Keys (set ps))
[PROOF STEP]
by (simp only: set_Keys_to_list)
[PROOF STATE]
proof (state)
this:
length (Keys_to_list ps) = card (Keys (set ps))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_image_part_circlepath_subset':
  assumes "r \<ge> 0"
  shows   "path_image (part_circlepath z r s t) \<subseteq> sphere z r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
proof (cases "s \<le> t")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. s \<le> t \<Longrightarrow> path_image (part_circlepath z r s t) \<subseteq> sphere z r
 2. \<not> s \<le> t \<Longrightarrow> path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
s \<le> t

goal (2 subgoals):
 1. s \<le> t \<Longrightarrow> path_image (part_circlepath z r s t) \<subseteq> sphere z r
 2. \<not> s \<le> t \<Longrightarrow> path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
s \<le> t

goal (1 subgoal):
 1. path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
using path_image_part_circlepath_subset[of s t r z] assms
[PROOF STATE]
proof (prove)
using this:
s \<le> t
\<lbrakk>s \<le> t; 0 \<le> r\<rbrakk> \<Longrightarrow> path_image (part_circlepath z r s t) \<subseteq> sphere z r
0 \<le> r

goal (1 subgoal):
 1. path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
path_image (part_circlepath z r s t) \<subseteq> sphere z r

goal (1 subgoal):
 1. \<not> s \<le> t \<Longrightarrow> path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> s \<le> t \<Longrightarrow> path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> s \<le> t

goal (1 subgoal):
 1. \<not> s \<le> t \<Longrightarrow> path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> s \<le> t

goal (1 subgoal):
 1. path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
using path_image_part_circlepath_subset[of t s r z] assms
[PROOF STATE]
proof (prove)
using this:
\<not> s \<le> t
\<lbrakk>t \<le> s; 0 \<le> r\<rbrakk> \<Longrightarrow> path_image (part_circlepath z r t s) \<subseteq> sphere z r
0 \<le> r

goal (1 subgoal):
 1. path_image (part_circlepath z r s t) \<subseteq> sphere z r
[PROOF STEP]
by (subst reversepath_part_circlepath [symmetric], subst path_image_reversepath) simp_all
[PROOF STATE]
proof (state)
this:
path_image (part_circlepath z r s t) \<subseteq> sphere z r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma C_msort_le: "length xs = 2^k \<Longrightarrow> C_msort xs \<le> k * 2^k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k
[PROOF STEP]
proof(induction k arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. length xs = 2 ^ 0 \<Longrightarrow> C_msort xs \<le> 0 * 2 ^ 0
 2. \<And>k xs. \<lbrakk>\<And>xs. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k; length xs = 2 ^ Suc k\<rbrakk> \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
length xs = 2 ^ 0

goal (2 subgoals):
 1. \<And>xs. length xs = 2 ^ 0 \<Longrightarrow> C_msort xs \<le> 0 * 2 ^ 0
 2. \<And>k xs. \<lbrakk>\<And>xs. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k; length xs = 2 ^ Suc k\<rbrakk> \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length xs = 2 ^ 0

goal (1 subgoal):
 1. C_msort xs \<le> 0 * 2 ^ 0
[PROOF STEP]
by (simp add: C_msort.simps)
[PROOF STATE]
proof (state)
this:
C_msort xs \<le> 0 * 2 ^ 0

goal (1 subgoal):
 1. \<And>k xs. \<lbrakk>\<And>xs. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k; length xs = 2 ^ Suc k\<rbrakk> \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k xs. \<lbrakk>\<And>xs. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k; length xs = 2 ^ Suc k\<rbrakk> \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
length ?xs = 2 ^ k \<Longrightarrow> C_msort ?xs \<le> k * 2 ^ k
length xs = 2 ^ Suc k

goal (1 subgoal):
 1. \<And>k xs. \<lbrakk>\<And>xs. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k; length xs = 2 ^ Suc k\<rbrakk> \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
let ?n = "length xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k xs. \<lbrakk>\<And>xs. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k; length xs = 2 ^ Suc k\<rbrakk> \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
let ?ys = "take (?n div 2) xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k xs. \<lbrakk>\<And>xs. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k; length xs = 2 ^ Suc k\<rbrakk> \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
let ?zs = "drop (?n div 2) xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k xs. \<lbrakk>\<And>xs. length xs = 2 ^ k \<Longrightarrow> C_msort xs \<le> k * 2 ^ k; length xs = 2 ^ Suc k\<rbrakk> \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
proof (cases "?n \<le> 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
 2. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
length xs \<le> 1

goal (2 subgoals):
 1. length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
 2. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length xs \<le> 1

goal (1 subgoal):
 1. C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
by(simp add: C_msort.simps)
[PROOF STATE]
proof (state)
this:
C_msort xs \<le> Suc k * 2 ^ Suc k

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> length xs \<le> 1

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
have "C_msort(xs) =
      C_msort ?ys + C_msort ?zs + C_merge (msort ?ys) (msort ?zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C_msort xs = C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + C_merge (msort (take (length xs div 2) xs)) (msort (drop (length xs div 2) xs))
[PROOF STEP]
by (simp add: C_msort.simps msort.simps)
[PROOF STATE]
proof (state)
this:
C_msort xs = C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + C_merge (msort (take (length xs div 2) xs)) (msort (drop (length xs div 2) xs))

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C_msort xs = C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + C_merge (msort (take (length xs div 2) xs)) (msort (drop (length xs div 2) xs))

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
have "\<dots> \<le> C_msort ?ys + C_msort ?zs + length ?ys + length ?zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + C_merge (msort (take (length xs div 2) xs)) (msort (drop (length xs div 2) xs)) \<le> C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)
[PROOF STEP]
using C_merge_ub[of "msort ?ys" "msort ?zs"] length_msort[of ?ys] length_msort[of ?zs]
[PROOF STATE]
proof (prove)
using this:
C_merge (msort (take (length xs div 2) xs)) (msort (drop (length xs div 2) xs)) \<le> length (msort (take (length xs div 2) xs)) + length (msort (drop (length xs div 2) xs))
length (msort (take (length xs div 2) xs)) = length (take (length xs div 2) xs)
length (msort (drop (length xs div 2) xs)) = length (drop (length xs div 2) xs)

goal (1 subgoal):
 1. C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + C_merge (msort (take (length xs div 2) xs)) (msort (drop (length xs div 2) xs)) \<le> C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + C_merge (msort (take (length xs div 2) xs)) (msort (drop (length xs div 2) xs)) \<le> C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + C_merge (msort (take (length xs div 2) xs)) (msort (drop (length xs div 2) xs)) \<le> C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
have "\<dots> \<le> k * 2^k + C_msort ?zs + length ?ys + length ?zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) \<le> k * 2 ^ k + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)
[PROOF STEP]
using Suc.IH[of ?ys] Suc.prems
[PROOF STATE]
proof (prove)
using this:
length (take (length xs div 2) xs) = 2 ^ k \<Longrightarrow> C_msort (take (length xs div 2) xs) \<le> k * 2 ^ k
length xs = 2 ^ Suc k

goal (1 subgoal):
 1. C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) \<le> k * 2 ^ k + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) \<le> k * 2 ^ k + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C_msort (take (length xs div 2) xs) + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) \<le> k * 2 ^ k + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
have "\<dots> \<le> k * 2^k + k * 2^k + length ?ys + length ?zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * 2 ^ k + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) \<le> k * 2 ^ k + k * 2 ^ k + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)
[PROOF STEP]
using Suc.IH[of ?zs] Suc.prems
[PROOF STATE]
proof (prove)
using this:
length (drop (length xs div 2) xs) = 2 ^ k \<Longrightarrow> C_msort (drop (length xs div 2) xs) \<le> k * 2 ^ k
length xs = 2 ^ Suc k

goal (1 subgoal):
 1. k * 2 ^ k + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) \<le> k * 2 ^ k + k * 2 ^ k + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k * 2 ^ k + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) \<le> k * 2 ^ k + k * 2 ^ k + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k * 2 ^ k + C_msort (drop (length xs div 2) xs) + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) \<le> k * 2 ^ k + k * 2 ^ k + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs)

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
have "\<dots> = 2 * k * 2^k + 2 * 2 ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * 2 ^ k + k * 2 ^ k + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) = 2 * k * 2 ^ k + 2 * 2 ^ k
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
length xs = 2 ^ Suc k

goal (1 subgoal):
 1. k * 2 ^ k + k * 2 ^ k + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) = 2 * k * 2 ^ k + 2 * 2 ^ k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k * 2 ^ k + k * 2 ^ k + length (take (length xs div 2) xs) + length (drop (length xs div 2) xs) = 2 * k * 2 ^ k + 2 * 2 ^ k

goal (1 subgoal):
 1. \<not> length xs \<le> 1 \<Longrightarrow> C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
C_msort xs \<le> 2 * k * 2 ^ k + 2 * 2 ^ k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C_msort xs \<le> 2 * k * 2 ^ k + 2 * 2 ^ k

goal (1 subgoal):
 1. C_msort xs \<le> Suc k * 2 ^ Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
C_msort xs \<le> Suc k * 2 ^ Suc k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
C_msort xs \<le> Suc k * 2 ^ Suc k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Meet_empty: "\<Sqinter>{} = \<Squnion>UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>{} = \<Squnion>UNIV
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a \<in> {} \<Longrightarrow> \<Squnion>UNIV \<sqsubseteq> a
 2. \<And>b. \<forall>a\<in>{}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
fix a :: "'a::complete_lattice"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a \<in> {} \<Longrightarrow> \<Squnion>UNIV \<sqsubseteq> a
 2. \<And>b. \<forall>a\<in>{}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
assume "a \<in> {}"
[PROOF STATE]
proof (state)
this:
a \<in> {}

goal (2 subgoals):
 1. \<And>a. a \<in> {} \<Longrightarrow> \<Squnion>UNIV \<sqsubseteq> a
 2. \<And>b. \<forall>a\<in>{}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> {}
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
a \<in> {}

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

goal (2 subgoals):
 1. \<And>a. a \<in> {} \<Longrightarrow> \<Squnion>UNIV \<sqsubseteq> a
 2. \<And>b. \<forall>a\<in>{}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show "\<Squnion>UNIV \<sqsubseteq> a"
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. \<Squnion>UNIV \<sqsubseteq> a
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<Squnion>UNIV \<sqsubseteq> a

goal (1 subgoal):
 1. \<And>b. \<forall>a\<in>{}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. \<forall>a\<in>{}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
fix b :: "'a::complete_lattice"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. \<forall>a\<in>{}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
have "b \<in> UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> UNIV
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
b \<in> UNIV

goal (1 subgoal):
 1. \<And>b. \<forall>a\<in>{}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in> UNIV
[PROOF STEP]
show "b \<sqsubseteq> \<Squnion>UNIV"
[PROOF STATE]
proof (prove)
using this:
b \<in> UNIV

goal (1 subgoal):
 1. b \<sqsubseteq> \<Squnion>UNIV
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
b \<sqsubseteq> \<Squnion>UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma squash_prod_list:
  shows "squash (prod_list (ls::real list)) = prod_list (map squash ls)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. squash (prod_list ls) = prod_list (map squash ls)
[PROOF STEP]
apply (induction ls)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. squash (prod_list []) = prod_list (map squash [])
 2. \<And>a ls. squash (prod_list ls) = prod_list (map squash ls) \<Longrightarrow> squash (prod_list (a # ls)) = prod_list (map squash (a # ls))
[PROOF STEP]
unfolding squash_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (if 0 < prod_list [] then 1 else if prod_list [] < 0 then - 1 else 0) = (\<Prod>a\<leftarrow>[]. if 0 < a then 1 else if a < 0 then - 1 else 0)
 2. \<And>a ls. (if 0 < prod_list ls then 1 else if prod_list ls < 0 then - 1 else 0) = (\<Prod>a\<leftarrow>ls. if 0 < a then 1 else if a < 0 then - 1 else 0) \<Longrightarrow> (if 0 < prod_list (a # ls) then 1 else if prod_list (a # ls) < 0 then - 1 else 0) = (\<Prod>a\<leftarrow>a # ls. if 0 < a then 1 else if a < 0 then - 1 else 0)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a ls. \<lbrakk>(if 0 < prod_list ls then 1 else if prod_list ls < 0 then - 1 else 0) = (\<Prod>a\<leftarrow>ls. if 0 < a then 1 else if a < 0 then - 1 else 0); a < 0; a * prod_list ls < 0\<rbrakk> \<Longrightarrow> (\<Prod>a\<leftarrow>ls. if 0 < a then 1 else if a < 0 then - 1 else 0) = 1
 2. \<And>a ls. \<lbrakk>(if 0 < prod_list ls then 1 else if prod_list ls < 0 then - 1 else 0) = (\<Prod>a\<leftarrow>ls. if 0 < a then 1 else if a < 0 then - 1 else 0); a < 0; 0 < a * prod_list ls\<rbrakk> \<Longrightarrow> (\<Prod>a\<leftarrow>ls. if 0 < a then 1 else if a < 0 then - 1 else 0) = - 1
[PROOF STEP]
apply (simp add: mult_less_0_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ls. \<lbrakk>(if 0 < prod_list ls then 1 else if prod_list ls < 0 then - 1 else 0) = (\<Prod>a\<leftarrow>ls. if 0 < a then 1 else if a < 0 then - 1 else 0); a < 0; 0 < a * prod_list ls\<rbrakk> \<Longrightarrow> (\<Prod>a\<leftarrow>ls. if 0 < a then 1 else if a < 0 then - 1 else 0) = - 1
[PROOF STEP]
by (simp add: zero_less_mult_iff)


[STATEMENT]
lemma dotprod_pointwise_le_right:
  assumes "length z = length u"
    and "length u = length v"
    and "\<forall>i<length v. u ! i \<le> v ! i"
  shows "z \<bullet> u \<le> z \<bullet> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<bullet> u \<le> z \<bullet> v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length z = length u
length u = length v
\<forall>i<length v. u ! i \<le> v ! i

goal (1 subgoal):
 1. z \<bullet> u \<le> z \<bullet> v
[PROOF STEP]
by (intro dotprod_le_right) (auto intro: less_eqI)


[STATEMENT]
lemma strad1:
  fixes z x s e :: real
  assumes P: "(\<And>z. z \<noteq> x \<Longrightarrow> \<bar>z - x\<bar> < s \<Longrightarrow> \<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2)"
  assumes "\<bar>z - x\<bar> < s"
  shows "\<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
proof (cases "z = x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z = x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
 2. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z = x

goal (2 subgoals):
 1. z = x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
 2. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = x

goal (1 subgoal):
 1. \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>

goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> x

goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> x
[PROOF STEP]
have "inverse (z - x) * (f z - f x - f' x * (z - x)) = (f z - f x) / (z - x) - f' x"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> x

goal (1 subgoal):
 1. inverse (z - x) * (f z - f x - f' x * (z - x)) = (f z - f x) / (z - x) - f' x
[PROOF STEP]
apply (subst mult.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> (f z - f x - f' x * (z - x)) * inverse (z - x) = (f z - f x) / (z - x) - f' x
[PROOF STEP]
apply (simp add: left_diff_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> f z * inverse (z - x) - f x * inverse (z - x) - f' x * (z - x) * inverse (z - x) = (f z - f x) / (z - x) - f' x
[PROOF STEP]
apply (simp add: mult.assoc divide_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> f z * inverse (z - x) - f x * inverse (z - x) = (f z - f x) * inverse (z - x)
[PROOF STEP]
apply (simp add: ring_distribs)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inverse (z - x) * (f z - f x - f' x * (z - x)) = (f z - f x) / (z - x) - f' x

goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inverse (z - x) * (f z - f x - f' x * (z - x)) = (f z - f x) / (z - x) - f' x

goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
from False \<open>\<bar>z - x\<bar> < s\<close>
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> x
\<bar>z - x\<bar> < s
[PROOF STEP]
have "\<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> x
\<bar>z - x\<bar> < s

goal (1 subgoal):
 1. \<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2
[PROOF STEP]
by (rule P)
[PROOF STATE]
proof (state)
this:
\<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2

goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inverse (z - x) * (f z - f x - f' x * (z - x)) = (f z - f x) / (z - x) - f' x
\<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2
[PROOF STEP]
have "\<bar>inverse (z - x)\<bar> * (\<bar>f z - f x - f' x * (z - x)\<bar> * 2)
    \<le> \<bar>inverse (z - x)\<bar> * (e * \<bar>z - x\<bar>)"
[PROOF STATE]
proof (prove)
using this:
inverse (z - x) * (f z - f x - f' x * (z - x)) = (f z - f x) / (z - x) - f' x
\<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2

goal (1 subgoal):
 1. \<bar>inverse (z - x)\<bar> * (\<bar>f z - f x - f' x * (z - x)\<bar> * 2) \<le> \<bar>inverse (z - x)\<bar> * (e * \<bar>z - x\<bar>)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
inverse (z - x) * (f z - f x - f' x * (z - x)) = (f z - f x) / (z - x) - f' x
\<bar>(f z - f x) / (z - x) - f' x\<bar> < e / 2
z \<noteq> x

goal (1 subgoal):
 1. \<bar>inverse (z - x)\<bar> * (\<bar>f z - f x - f' x * (z - x)\<bar> * 2) \<le> \<bar>inverse (z - x)\<bar> * (e * \<bar>z - x\<bar>)
[PROOF STEP]
by (simp del: abs_inverse add: abs_mult [symmetric] ac_simps)
[PROOF STATE]
proof (state)
this:
\<bar>inverse (z - x)\<bar> * (\<bar>f z - f x - f' x * (z - x)\<bar> * 2) \<le> \<bar>inverse (z - x)\<bar> * (e * \<bar>z - x\<bar>)

goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> x
\<bar>inverse (z - x)\<bar> * (\<bar>f z - f x - f' x * (z - x)\<bar> * 2) \<le> \<bar>inverse (z - x)\<bar> * (e * \<bar>z - x\<bar>)
[PROOF STEP]
have "\<bar>f z - f x - f' x * (z - x)\<bar> * 2 \<le> e * \<bar>z - x\<bar>"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> x
\<bar>inverse (z - x)\<bar> * (\<bar>f z - f x - f' x * (z - x)\<bar> * 2) \<le> \<bar>inverse (z - x)\<bar> * (e * \<bar>z - x\<bar>)

goal (1 subgoal):
 1. \<bar>f z - f x - f' x * (z - x)\<bar> * 2 \<le> e * \<bar>z - x\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>f z - f x - f' x * (z - x)\<bar> * 2 \<le> e * \<bar>z - x\<bar>

goal (1 subgoal):
 1. z \<noteq> x \<Longrightarrow> \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>f z - f x - f' x * (z - x)\<bar> * 2 \<le> e * \<bar>z - x\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>f z - f x - f' x * (z - x)\<bar> * 2 \<le> e * \<bar>z - x\<bar>

goal (1 subgoal):
 1. \<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>f z - f x - f' x * (z - x)\<bar> \<le> e / 2 * \<bar>z - x\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_sum_ai:
  assumes "\<And>n. a n \<in> {0,1 :: nat}"
  shows "lim (\<lambda>n. (\<Sum>i=0..n. real (a i) * (1/2)^(Suc i))) = (\<Sum>n::nat. real (a n) * (1/2)^(Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lim (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) = (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lim (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) = (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
have "\<And>n::nat. {0..n} = {..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {0..n} = {..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..?n} = {..?n}

goal (1 subgoal):
 1. lim (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) = (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
hence "LIMSEQ (\<lambda>n. \<Sum>i=0..n. real (a i) * (1 / 2) ^ Suc i) (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)"
[PROOF STATE]
proof (prove)
using this:
{0..?n} = {..?n}

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) \<longlonglongrightarrow> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
using summable_LIMSEQ'[of "\<lambda>n. real (a n) * (1/2)^(Suc n)"] binary_expression_summable[of a] assms
[PROOF STATE]
proof (prove)
using this:
{0..?n} = {..?n}
summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n) \<Longrightarrow> (\<lambda>n. \<Sum>i\<le>n. real (a i) * (1 / 2) ^ Suc i) \<longlonglongrightarrow> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
(\<And>n. a n \<in> {0, 1}) \<Longrightarrow> summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
a ?n \<in> {0, 1}

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) \<longlonglongrightarrow> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) \<longlonglongrightarrow> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. lim (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) = (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
thus "lim (\<lambda>n. (\<Sum>i=0..n. real (a i) * (1/2)^(Suc i))) = (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) \<longlonglongrightarrow> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. lim (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) = (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
using limI
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) \<longlonglongrightarrow> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
?X \<longlonglongrightarrow> ?L \<Longrightarrow> lim ?X = ?L

goal (1 subgoal):
 1. lim (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) = (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lim (\<lambda>n. \<Sum>i = 0..n. real (a i) * (1 / 2) ^ Suc i) = (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma double_orthogonal_complement_increasing[simp]:
  shows "M \<subseteq> orthogonal_complement (orthogonal_complement M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
proof (rule subsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> M \<Longrightarrow> x \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> M \<Longrightarrow> x \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
assume s1: "x \<in> M"
[PROOF STATE]
proof (state)
this:
x \<in> M

goal (1 subgoal):
 1. \<And>x. x \<in> M \<Longrightarrow> x \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
have \<open>\<forall> y \<in> (orthogonal_complement M). is_orthogonal x y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>orthogonal_complement M. is_orthogonal x y
[PROOF STEP]
using s1 orthogonal_complement_orthoI'
[PROOF STATE]
proof (prove)
using this:
x \<in> M
\<lbrakk>?x \<in> ?M; ?y \<in> orthogonal_complement ?M\<rbrakk> \<Longrightarrow> is_orthogonal ?x ?y

goal (1 subgoal):
 1. \<forall>y\<in>orthogonal_complement M. is_orthogonal x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>orthogonal_complement M. is_orthogonal x y

goal (1 subgoal):
 1. \<And>x. x \<in> M \<Longrightarrow> x \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
hence \<open>x \<in> orthogonal_complement (orthogonal_complement M)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>orthogonal_complement M. is_orthogonal x y

goal (1 subgoal):
 1. x \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
by (simp add: orthogonal_complement_def)
[PROOF STATE]
proof (state)
this:
x \<in> orthogonal_complement (orthogonal_complement M)

goal (1 subgoal):
 1. \<And>x. x \<in> M \<Longrightarrow> x \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
show "x \<in> orthogonal_complement (orthogonal_complement M)"
[PROOF STATE]
proof (prove)
using this:
x \<in> orthogonal_complement (orthogonal_complement M)

goal (1 subgoal):
 1. x \<in> orthogonal_complement (orthogonal_complement M)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> orthogonal_complement (orthogonal_complement M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ftf_3: assumes dx: "dim_vec x = 3"
  and be: "x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False"
  shows "ceros_of_boolean_input x = {0,2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 2}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False

goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 2}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 2}
[PROOF STEP]
using less_3_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False
?n < 3 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 2}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma VUnion_def: "\<Union>\<^sub>\<circ>A = set {a. \<exists>x \<in>\<^sub>\<circ> A. a \<in>\<^sub>\<circ> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> A = set {a. \<exists>x\<in>elts A. a \<in>\<^sub>\<circ> x}
[PROOF STEP]
unfolding Sup_V_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if small (elts A) \<Rightarrow> set (\<Union> (elts ` elts A)) | otherwise \<Rightarrow> 0) = set {a. \<exists>x\<in>elts A. a \<in>\<^sub>\<circ> x}
[PROOF STEP]
by auto


[STATEMENT]
lemma tendsto_zero_mult_left_iff [simp]:
  fixes c::"'a::{topological_semigroup_mult,field}" assumes "c \<noteq> 0" shows "(\<lambda>n. c * a n)\<longlonglongrightarrow> 0 \<longleftrightarrow> a \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. c * a n) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
using assms tendsto_mult_left tendsto_mult_left_iff
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)
(?f \<longlongrightarrow> ?l) ?F \<Longrightarrow> ((\<lambda>x. ?c * ?f x) \<longlongrightarrow> ?c * ?l) ?F
?c \<noteq> (0::?'a) \<Longrightarrow> ((\<lambda>x. ?c * ?f x) \<longlongrightarrow> ?c * ?l) ?F = (?f \<longlongrightarrow> ?l) ?F

goal (1 subgoal):
 1. (\<lambda>n. c * a n) \<longlonglongrightarrow> (0::'a) = a \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sappend_NE[simp]: "A @@ B \<noteq> {} \<longleftrightarrow> A \<noteq> {} \<and> B \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @@ B \<noteq> {}) = (A \<noteq> {} \<and> B \<noteq> {})
[PROOF STEP]
unfolding sappend_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({al @ bl |al bl. al \<in> A \<and> bl \<in> B} \<noteq> {}) = (A \<noteq> {} \<and> B \<noteq> {})
[PROOF STEP]
by auto


[STATEMENT]
lemma diamond_top_left_edge_neq_diamond_top_right_edge:
     "diamond_top_left_edge \<noteq> diamond_top_right_edge"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diamond_top_left_edge \<noteq> diamond_top_right_edge
[PROOF STEP]
apply (simp add: diamond_top_left_edge_def diamond_top_right_edge_def diamond_x_def diamond_y_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ((x / 2 - 1 / 2) * d, (x / 2 - 1 / 2) * d + d / 2)) \<noteq> (\<lambda>x. (x * d / 2, d / 2 - x * d / 2))
[PROOF STEP]
using d_gt_0
[PROOF STATE]
proof (prove)
using this:
0 < d

goal (1 subgoal):
 1. (\<lambda>x. ((x / 2 - 1 / 2) * d, (x / 2 - 1 / 2) * d + d / 2)) \<noteq> (\<lambda>x. (x * d / 2, d / 2 - x * d / 2))
[PROOF STEP]
apply (auto simp add: algebra_simps divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < d; (\<lambda>x. ((x * d - d) / 2, x * d / 2)) = (\<lambda>x. (x * d / 2, (d - x * d) / 2))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis (no_types, opaque_lifting) diff_zero div_0 divide_divide_eq_right order_less_irrefl prod.inject field_sum_of_halves)


[STATEMENT]
lemma rel_set_set_rel_eq[pred_set_conv]:
    "rel_set (\<lambda> x y. (x, y) \<in> A) = (\<lambda> f g. (f, g) \<in> \<langle>A\<rangle> set_rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_set (\<lambda>x y. (x, y) \<in> A) = (\<lambda>f g. (f, g) \<in> \<langle>A\<rangle>set_rel)
[PROOF STEP]
unfolding rel_set_def set_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>Aa B. (\<forall>x\<in>Aa. \<exists>y\<in>B. (x, y) \<in> A) \<and> (\<forall>y\<in>B. \<exists>x\<in>Aa. (x, y) \<in> A)) = (\<lambda>f g. (f, g) \<in> {(Aa, B). (\<forall>x\<in>Aa. \<exists>y\<in>B. (x, y) \<in> A) \<and> (\<forall>y\<in>B. \<exists>x\<in>Aa. (x, y) \<in> A)})
[PROOF STEP]
by simp


[STATEMENT]
lemma smult_vec_length [simp]:
  assumes "x \<ge> 0"
  shows "\<parallel>complex_of_real(x) \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
have "(\<lambda>i::nat.(cmod (complex_of_real x * v $ i))\<^sup>2) = (\<lambda>i::nat. (cmod (v $ i))\<^sup>2 * x\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<lambda>i. (cmod (v $ i))\<^sup>2 * x\<^sup>2)
[PROOF STEP]
by (auto simp: norm_mult power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<lambda>i. (cmod (v $ i))\<^sup>2 * x\<^sup>2)

goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<lambda>i. (cmod (v $ i))\<^sup>2 * x\<^sup>2)
[PROOF STEP]
have "(\<Sum>i<dim_vec v. (cmod (complex_of_real x * v $ i))\<^sup>2) =
             (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<lambda>i. (cmod (v $ i))\<^sup>2 * x\<^sup>2)

goal (1 subgoal):
 1. (\<Sum>i<dim_vec v. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2)
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
(\<Sum>i<dim_vec v. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2)

goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i<dim_vec v. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2)

goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
have "(\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2) = x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2) = x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
by (metis (no_types) mult.commute sum_distrib_right)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2) = x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)

goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2) = x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)

goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
have "sqrt(x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)) =
                 sqrt(x\<^sup>2) * sqrt (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)) = sqrt (x\<^sup>2) * sqrt (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
using real_sqrt_mult
[PROOF STATE]
proof (prove)
using this:
sqrt (?x * ?y) = sqrt ?x * sqrt ?y

goal (1 subgoal):
 1. sqrt (x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)) = sqrt (x\<^sup>2) * sqrt (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sqrt (x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)) = sqrt (x\<^sup>2) * sqrt (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)

goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i<dim_vec v. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2)
(\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2) = x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
sqrt (x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)) = sqrt (x\<^sup>2) * sqrt (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<dim_vec v. (cmod (complex_of_real x * v $ i))\<^sup>2) = (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2)
(\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2 * x\<^sup>2) = x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
sqrt (x\<^sup>2 * (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)) = sqrt (x\<^sup>2) * sqrt (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)

goal (1 subgoal):
 1. \<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>
[PROOF STEP]
by(simp add: cpx_vec_length_def assms)
[PROOF STATE]
proof (state)
this:
\<parallel>complex_of_real x \<cdot>\<^sub>v v\<parallel> = x * \<parallel>v\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed