[STATEMENT]
lemma decseq_def: "decseq X \<longleftrightarrow> (\<forall>m. \<forall>n\<ge>m. X n \<le> X m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decseq X = (\<forall>m n. m \<le> n \<longrightarrow> X n \<le> X m)
[PROOF STEP]
unfolding antimono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. x \<le> y \<longrightarrow> X y \<le> X x) = (\<forall>m n. m \<le> n \<longrightarrow> X n \<le> X m)
[PROOF STEP]
..


[STATEMENT]
lemma separating_hyperplane_closed_0:
  assumes "convex (S::('a::euclidean_space) set)"
    and "closed S"
    and "0 \<notin> S"
  shows "\<exists>a b. a \<noteq> 0 \<and> 0 < b \<and> (\<forall>x\<in>S. inner a x > b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
have "(SOME i. i\<in>Basis) \<noteq> (0::'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME i. i \<in> Basis) \<noteq> (0::'a)
[PROOF STEP]
by (metis Basis_zero SOME_Basis)
[PROOF STATE]
proof (state)
this:
(SOME i. i \<in> Basis) \<noteq> (0::'a)

goal (2 subgoals):
 1. S = {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
 2. S \<noteq> {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(SOME i. i \<in> Basis) \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(SOME i. i \<in> Basis) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
using True zero_less_one
[PROOF STATE]
proof (prove)
using this:
(SOME i. i \<in> Basis) \<noteq> (0::'a)
S = {}
(0::?'a) < (1::?'a)

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
S \<noteq> {}

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
using separating_hyperplane_closed_point[OF assms]
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
S \<noteq> {}
\<exists>a b. a \<bullet> (0::'a) < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)

goal (1 subgoal):
 1. \<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
by (metis all_not_in_conv inner_zero_left inner_zero_right less_eq_real_def not_le)
[PROOF STATE]
proof (state)
this:
\<exists>a b. a \<noteq> (0::'a) \<and> 0 < b \<and> (\<forall>x\<in>S. b < a \<bullet> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_int_vec_eq_iff [simp]:
  "(of_int_vec a :: ('a :: ring_char_0) ^ 'n) = of_int_vec b \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int_vec a = of_int_vec b) = (a = b)
[PROOF STEP]
by (simp add: of_int_vec_def vec_eq_iff)


[STATEMENT]
lemma up_minus_closed:
  "[| p \<in> up R; q \<in> up R |] ==> (\<lambda>i. p i \<ominus> q i) \<in> up R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> up R; q \<in> up R\<rbrakk> \<Longrightarrow> (\<lambda>i. p i \<ominus> q i) \<in> up R
[PROOF STEP]
unfolding a_minus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> up R; q \<in> up R\<rbrakk> \<Longrightarrow> (\<lambda>i. p i \<oplus> \<ominus> q i) \<in> up R
[PROOF STEP]
using mem_upD [of p R] mem_upD [of q R] up_add_closed up_a_inv_closed
[PROOF STATE]
proof (prove)
using this:
p \<in> up R \<Longrightarrow> p ?n \<in> carrier R
q \<in> up R \<Longrightarrow> q ?n \<in> carrier R
\<lbrakk>?p \<in> up R; ?q \<in> up R\<rbrakk> \<Longrightarrow> (\<lambda>i. ?p i \<oplus> ?q i) \<in> up R
?p \<in> up R \<Longrightarrow> (\<lambda>i. \<ominus> ?p i) \<in> up R

goal (1 subgoal):
 1. \<lbrakk>p \<in> up R; q \<in> up R\<rbrakk> \<Longrightarrow> (\<lambda>i. p i \<oplus> \<ominus> q i) \<in> up R
[PROOF STEP]
by auto


[STATEMENT]
lemma subgraph_finite: "\<lbrakk> finite_graph G; subgraph G' G \<rbrakk> \<Longrightarrow> finite_graph G'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite_graph G; subgraph G' G\<rbrakk> \<Longrightarrow> finite_graph G'
[PROOF STEP]
unfolding finite_graph_def subgraph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (uverts G) \<and> finite (uedges G); uverts G' \<subseteq> uverts G \<and> uedges G' \<subseteq> uedges G\<rbrakk> \<Longrightarrow> finite (uverts G') \<and> finite (uedges G')
[PROOF STEP]
by (metis rev_finite_subset)


[STATEMENT]
lemma U_bounded: "0 \<le> U x y" "U x y \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> U x y &&& U x y \<le> 1
[PROOF STEP]
unfolding U_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> T.prob x {\<omega> \<in> space (T x). ev (HLD {y}) \<omega>} &&& T.prob x {\<omega> \<in> space (T x). ev (HLD {y}) \<omega>} \<le> 1
[PROOF STEP]
by simp_all


[STATEMENT]
lemma Inf_closed_cl_op_var:
  fixes X :: "'a set"
  shows "\<forall>x \<in> X. x \<in> range cl_op \<Longrightarrow> \<Sqinter>X \<in> range cl_op"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>X. x \<in> range cl_op \<Longrightarrow> \<Sqinter> X \<in> range cl_op
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>X. x \<in> range cl_op \<Longrightarrow> \<Sqinter> X \<in> range cl_op
[PROOF STEP]
assume h: "\<forall>x \<in> X. x \<in> range cl_op"
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>X. x \<in> range cl_op

goal (1 subgoal):
 1. \<forall>x\<in>X. x \<in> range cl_op \<Longrightarrow> \<Sqinter> X \<in> range cl_op
[PROOF STEP]
hence "\<forall>x \<in> X. cl_op x = x"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>X. x \<in> range cl_op

goal (1 subgoal):
 1. \<forall>x\<in>X. cl_op x = x
[PROOF STEP]
by (simp add: retraction_prop)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>X. cl_op x = x

goal (1 subgoal):
 1. \<forall>x\<in>X. x \<in> range cl_op \<Longrightarrow> \<Sqinter> X \<in> range cl_op
[PROOF STEP]
hence "cl_op (\<Sqinter>X) = \<Sqinter>X"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>X. cl_op x = x

goal (1 subgoal):
 1. cl_op (\<Sqinter> X) = \<Sqinter> X
[PROOF STEP]
by (metis Inf_lower clop_ext clop_iso dual_order.antisym le_Inf_iff)
[PROOF STATE]
proof (state)
this:
cl_op (\<Sqinter> X) = \<Sqinter> X

goal (1 subgoal):
 1. \<forall>x\<in>X. x \<in> range cl_op \<Longrightarrow> \<Sqinter> X \<in> range cl_op
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cl_op (\<Sqinter> X) = \<Sqinter> X

goal (1 subgoal):
 1. \<Sqinter> X \<in> range cl_op
[PROOF STEP]
by (metis rangeI)
[PROOF STATE]
proof (state)
this:
\<Sqinter> X \<in> range cl_op

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fv_subset_subterms: "t \<in> subterms\<^sub>s\<^sub>e\<^sub>t M \<Longrightarrow> fv t \<subseteq> fv\<^sub>s\<^sub>e\<^sub>t M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<sqsubseteq>\<^sub>s\<^sub>e\<^sub>t M \<Longrightarrow> fv t \<subseteq> fv\<^sub>s\<^sub>e\<^sub>t M
[PROOF STEP]
using fv_subset fv_subterms_set
[PROOF STATE]
proof (prove)
using this:
?t \<in> ?M \<Longrightarrow> fv ?t \<subseteq> fv\<^sub>s\<^sub>e\<^sub>t ?M
fv\<^sub>s\<^sub>e\<^sub>t (subterms\<^sub>s\<^sub>e\<^sub>t ?M) = fv\<^sub>s\<^sub>e\<^sub>t ?M

goal (1 subgoal):
 1. t \<sqsubseteq>\<^sub>s\<^sub>e\<^sub>t M \<Longrightarrow> fv t \<subseteq> fv\<^sub>s\<^sub>e\<^sub>t M
[PROOF STEP]
by metis


[STATEMENT]
lemma image_map_of:
  assumes "distinct (map fst xs)"
  shows "map_of xs ` set (map fst xs) = Some ` set (map snd xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of xs ` set (map fst xs) = Some ` set (map snd xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct (map fst xs)

goal (1 subgoal):
 1. map_of xs ` set (map fst xs) = Some ` set (map snd xs)
[PROOF STEP]
by (auto simp: rev_image_eqI)


[STATEMENT]
lemma pderiv_pcompose: "pderiv (pcompose p q) = pcompose (pderiv p) q * pderiv q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (p \<circ>\<^sub>p q) = pderiv p \<circ>\<^sub>p q * pderiv q
[PROOF STEP]
by (induction p rule: pCons_induct)
     (auto simp: pcompose_pCons pderiv_add pderiv_mult pderiv_pCons pcompose_add algebra_simps)


[STATEMENT]
lemma pochhammer_pos:
  fixes x :: "'a :: linordered_semidom"
  shows "x > 0 \<Longrightarrow> pochhammer x n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < x \<Longrightarrow> (0::'a) < pochhammer x n
[PROOF STEP]
by (induction n) (auto simp: pochhammer_Suc intro!: mult_pos_pos add_pos_nonneg)


[STATEMENT]
lemma real_greaterThanLessThan_minus_infinity_eq:
  "real_of_ereal ` {-\<infinity><..<N::ereal} =
    (if N = \<infinity> then UNIV else if N = -\<infinity> then {} else {..<real_of_ereal N})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal ` {- \<infinity><..<N} = (if N = \<infinity> then UNIV else if N = - \<infinity> then {} else {..<real_of_ereal N})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_ereal ` {- \<infinity><..<N} = (if N = \<infinity> then UNIV else if N = - \<infinity> then {} else {..<real_of_ereal N})
[PROOF STEP]
have "real_of_ereal ` {-\<infinity><..<N::ereal} = uminus ` real_of_ereal ` {-N<..<\<infinity>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal ` {- \<infinity><..<N} = uminus ` real_of_ereal ` {- N<..<\<infinity>}
[PROOF STEP]
by (auto simp: ereal_uminus_less_reorder intro!: image_eqI[where x="-x" for x])
[PROOF STATE]
proof (state)
this:
real_of_ereal ` {- \<infinity><..<N} = uminus ` real_of_ereal ` {- N<..<\<infinity>}

goal (1 subgoal):
 1. real_of_ereal ` {- \<infinity><..<N} = (if N = \<infinity> then UNIV else if N = - \<infinity> then {} else {..<real_of_ereal N})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_ereal ` {- \<infinity><..<N} = uminus ` real_of_ereal ` {- N<..<\<infinity>}

goal (1 subgoal):
 1. real_of_ereal ` {- \<infinity><..<N} = (if N = \<infinity> then UNIV else if N = - \<infinity> then {} else {..<real_of_ereal N})
[PROOF STEP]
note real_greaterThanLessThan_infinity_eq
[PROOF STATE]
proof (state)
this:
real_of_ereal ` {?N<..<\<infinity>} = (if ?N = \<infinity> then {} else if ?N = - \<infinity> then UNIV else {real_of_ereal ?N<..})

goal (1 subgoal):
 1. real_of_ereal ` {- \<infinity><..<N} = (if N = \<infinity> then UNIV else if N = - \<infinity> then {} else {..<real_of_ereal N})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_ereal ` {- \<infinity><..<N} = uminus ` (if - N = \<infinity> then {} else if - N = - \<infinity> then UNIV else {real_of_ereal (- N)<..})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_ereal ` {- \<infinity><..<N} = uminus ` (if - N = \<infinity> then {} else if - N = - \<infinity> then UNIV else {real_of_ereal (- N)<..})

goal (1 subgoal):
 1. real_of_ereal ` {- \<infinity><..<N} = (if N = \<infinity> then UNIV else if N = - \<infinity> then {} else {..<real_of_ereal N})
[PROOF STEP]
by (auto intro!: image_eqI[where x="-x" for x])
[PROOF STATE]
proof (state)
this:
real_of_ereal ` {- \<infinity><..<N} = (if N = \<infinity> then UNIV else if N = - \<infinity> then {} else {..<real_of_ereal N})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_higher_pderiv: "degree ((pderiv ^^ n) p) = degree p - n"
  for p :: "'a::{comm_semiring_1,semiring_no_zero_divisors,semiring_char_0} poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree ((pderiv ^^ n) p) = degree p - n
[PROOF STEP]
by (induction n arbitrary: p) (auto simp: degree_pderiv)


[STATEMENT]
lemma finite_spectrum: fixes A :: "'a :: field ^ 'n ^ 'n"
  shows "finite (Collect (eigen_value A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Collect (eigen_value A))
[PROOF STEP]
by (transfer_hma rule: card_finite_spectrum(1)[unfolded spectrum_def])


[STATEMENT]
lemma vs_criteria:
  fixes K and V
  assumes field: "field K"
      and zero: "\<zero>\<^bsub>V\<^esub>\<in> carrier V"
      and add: "\<forall>v w. v\<in>carrier V \<and> w\<in>carrier V\<longrightarrow> v\<oplus>\<^bsub>V\<^esub> w\<in> carrier V"
      and neg: "\<forall>v\<in>carrier V. (\<exists>neg_v\<in>carrier V. v\<oplus>\<^bsub>V\<^esub>neg_v=\<zero>\<^bsub>V\<^esub>)"
      and smult: "\<forall>c v. c\<in> carrier K \<and> v\<in>carrier V\<longrightarrow> c\<odot>\<^bsub>V\<^esub> v \<in> carrier V"
      and comm: "\<forall>v w. v\<in>carrier V \<and> w\<in>carrier V\<longrightarrow> v\<oplus>\<^bsub>V\<^esub> w=w\<oplus>\<^bsub>V\<^esub> v"
      and assoc: "\<forall>v w x. v\<in>carrier V \<and> w\<in>carrier V \<and> x\<in>carrier V\<longrightarrow> (v\<oplus>\<^bsub>V\<^esub> w)\<oplus>\<^bsub>V\<^esub> x= v\<oplus>\<^bsub>V\<^esub> (w\<oplus>\<^bsub>V\<^esub> x)"
      and add_id: "\<forall>v\<in>carrier V. (v\<oplus>\<^bsub>V\<^esub> \<zero>\<^bsub>V\<^esub> =v)"
      and compat: "\<forall>a b v. a\<in> carrier K \<and> b\<in> carrier K \<and> v\<in>carrier V\<longrightarrow> (a\<otimes>\<^bsub>K\<^esub> b)\<odot>\<^bsub>V\<^esub> v =a\<odot>\<^bsub>V\<^esub> (b\<odot>\<^bsub>V\<^esub> v)"
      and smult_id: "\<forall>v\<in>carrier V. (\<one>\<^bsub>K\<^esub> \<odot>\<^bsub>V\<^esub> v =v)"
      and dist_f: "\<forall>a b v. a\<in> carrier K \<and> b\<in> carrier K \<and> v\<in>carrier V\<longrightarrow> (a\<oplus>\<^bsub>K\<^esub> b)\<odot>\<^bsub>V\<^esub> v =(a\<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> (b\<odot>\<^bsub>V\<^esub> v)"
      and dist_add: "\<forall>a v w. a\<in> carrier K \<and> v\<in>carrier V \<and> w\<in>carrier V\<longrightarrow> a\<odot>\<^bsub>V\<^esub> (v\<oplus>\<^bsub>V\<^esub> w) =(a\<odot>\<^bsub>V\<^esub> v) \<oplus>\<^bsub>V\<^esub> (a\<odot>\<^bsub>V\<^esub> w)"
  shows "vectorspace K V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace K V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace K V
[PROOF STEP]
from field
[PROOF STATE]
proof (chain)
picking this:
field K
[PROOF STEP]
have 1: "cring K"
[PROOF STATE]
proof (prove)
using this:
field K

goal (1 subgoal):
 1. cring K
[PROOF STEP]
by (unfold field_def domain_def, auto)
[PROOF STATE]
proof (state)
this:
cring K

goal (1 subgoal):
 1. vectorspace K V
[PROOF STEP]
from assms 1
[PROOF STATE]
proof (chain)
picking this:
field K
\<zero>\<^bsub>V\<^esub> \<in> carrier V
\<forall>v w. v \<in> carrier V \<and> w \<in> carrier V \<longrightarrow> v \<oplus>\<^bsub>V\<^esub> w \<in> carrier V
\<forall>v\<in>carrier V. \<exists>neg_v\<in>carrier V. v \<oplus>\<^bsub>V\<^esub> neg_v = \<zero>\<^bsub>V\<^esub>
\<forall>c v. c \<in> carrier K \<and> v \<in> carrier V \<longrightarrow> c \<odot>\<^bsub>V\<^esub> v \<in> carrier V
\<forall>v w. v \<in> carrier V \<and> w \<in> carrier V \<longrightarrow> v \<oplus>\<^bsub>V\<^esub> w = w \<oplus>\<^bsub>V\<^esub> v
\<forall>v w x. v \<in> carrier V \<and> w \<in> carrier V \<and> x \<in> carrier V \<longrightarrow> v \<oplus>\<^bsub>V\<^esub> w \<oplus>\<^bsub>V\<^esub> x = v \<oplus>\<^bsub>V\<^esub> (w \<oplus>\<^bsub>V\<^esub> x)
\<forall>v\<in>carrier V. v \<oplus>\<^bsub>V\<^esub> \<zero>\<^bsub>V\<^esub> = v
\<forall>a b v. a \<in> carrier K \<and> b \<in> carrier K \<and> v \<in> carrier V \<longrightarrow> a \<otimes>\<^bsub>K\<^esub> b \<odot>\<^bsub>V\<^esub> v = a \<odot>\<^bsub>V\<^esub> (b \<odot>\<^bsub>V\<^esub> v)
\<forall>v\<in>carrier V. \<one>\<^bsub>K\<^esub> \<odot>\<^bsub>V\<^esub> v = v
\<forall>a b v. a \<in> carrier K \<and> b \<in> carrier K \<and> v \<in> carrier V \<longrightarrow> (a \<oplus>\<^bsub>K\<^esub> b) \<odot>\<^bsub>V\<^esub> v = a \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> b \<odot>\<^bsub>V\<^esub> v
\<forall>a v w. a \<in> carrier K \<and> v \<in> carrier V \<and> w \<in> carrier V \<longrightarrow> a \<odot>\<^bsub>V\<^esub> (v \<oplus>\<^bsub>V\<^esub> w) = a \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> a \<odot>\<^bsub>V\<^esub> w
cring K
[PROOF STEP]
have 2: "module K V"
[PROOF STATE]
proof (prove)
using this:
field K
\<zero>\<^bsub>V\<^esub> \<in> carrier V
\<forall>v w. v \<in> carrier V \<and> w \<in> carrier V \<longrightarrow> v \<oplus>\<^bsub>V\<^esub> w \<in> carrier V
\<forall>v\<in>carrier V. \<exists>neg_v\<in>carrier V. v \<oplus>\<^bsub>V\<^esub> neg_v = \<zero>\<^bsub>V\<^esub>
\<forall>c v. c \<in> carrier K \<and> v \<in> carrier V \<longrightarrow> c \<odot>\<^bsub>V\<^esub> v \<in> carrier V
\<forall>v w. v \<in> carrier V \<and> w \<in> carrier V \<longrightarrow> v \<oplus>\<^bsub>V\<^esub> w = w \<oplus>\<^bsub>V\<^esub> v
\<forall>v w x. v \<in> carrier V \<and> w \<in> carrier V \<and> x \<in> carrier V \<longrightarrow> v \<oplus>\<^bsub>V\<^esub> w \<oplus>\<^bsub>V\<^esub> x = v \<oplus>\<^bsub>V\<^esub> (w \<oplus>\<^bsub>V\<^esub> x)
\<forall>v\<in>carrier V. v \<oplus>\<^bsub>V\<^esub> \<zero>\<^bsub>V\<^esub> = v
\<forall>a b v. a \<in> carrier K \<and> b \<in> carrier K \<and> v \<in> carrier V \<longrightarrow> a \<otimes>\<^bsub>K\<^esub> b \<odot>\<^bsub>V\<^esub> v = a \<odot>\<^bsub>V\<^esub> (b \<odot>\<^bsub>V\<^esub> v)
\<forall>v\<in>carrier V. \<one>\<^bsub>K\<^esub> \<odot>\<^bsub>V\<^esub> v = v
\<forall>a b v. a \<in> carrier K \<and> b \<in> carrier K \<and> v \<in> carrier V \<longrightarrow> (a \<oplus>\<^bsub>K\<^esub> b) \<odot>\<^bsub>V\<^esub> v = a \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> b \<odot>\<^bsub>V\<^esub> v
\<forall>a v w. a \<in> carrier K \<and> v \<in> carrier V \<and> w \<in> carrier V \<longrightarrow> a \<odot>\<^bsub>V\<^esub> (v \<oplus>\<^bsub>V\<^esub> w) = a \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> a \<odot>\<^bsub>V\<^esub> w
cring K

goal (1 subgoal):
 1. module K V
[PROOF STEP]
by (intro module_criteria, auto)
[PROOF STATE]
proof (state)
this:
module K V

goal (1 subgoal):
 1. vectorspace K V
[PROOF STEP]
from field 2
[PROOF STATE]
proof (chain)
picking this:
field K
module K V
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
field K
module K V

goal (1 subgoal):
 1. vectorspace K V
[PROOF STEP]
by (unfold vectorspace_def module_def, auto)
[PROOF STATE]
proof (state)
this:
vectorspace K V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isLub_isUb: "isLub R S x \<Longrightarrow> isUb R S x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isLub R S x \<Longrightarrow> isUb R S x
[PROOF STEP]
unfolding isUb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isLub R S x \<Longrightarrow> S *<= x \<and> x \<in> R
[PROOF STEP]
by (blast dest: isLubD1 isLubD1a)


[STATEMENT]
theorem tangle_compose_matrix:
"((is_tangle_diagram ws1) \<and> (is_tangle_diagram ws2)
\<and>(domain_wall ws2 = codomain_wall ws1)) \<Longrightarrow>
kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)
[PROOF STEP]
proof(induct ws1)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. is_tangle_diagram (basic x) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (basic x) \<Longrightarrow> kauff_mat (basic x \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (basic x)) (kauff_mat ws2)
 2. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
case (basic w1)
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (basic w1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (basic w1)

goal (2 subgoals):
 1. \<And>x. is_tangle_diagram (basic x) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (basic x) \<Longrightarrow> kauff_mat (basic x \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (basic x)) (kauff_mat ws2)
 2. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
have "(basic w1) \<circ> (ws2) = (w1)*(ws2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basic w1 \<circ> ws2 = w1 * ws2
[PROOF STEP]
using compose.simps
[PROOF STATE]
proof (prove)
using this:
basic ?x \<circ> ?ys = ?x * ?ys
(?x * ?xs) \<circ> ?ys = ?x * ?xs \<circ> ?ys

goal (1 subgoal):
 1. basic w1 \<circ> ws2 = w1 * ws2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
basic w1 \<circ> ws2 = w1 * ws2

goal (2 subgoals):
 1. \<And>x. is_tangle_diagram (basic x) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (basic x) \<Longrightarrow> kauff_mat (basic x \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (basic x)) (kauff_mat ws2)
 2. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
basic w1 \<circ> ws2 = w1 * ws2

goal (2 subgoals):
 1. \<And>x. is_tangle_diagram (basic x) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (basic x) \<Longrightarrow> kauff_mat (basic x \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (basic x)) (kauff_mat ws2)
 2. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
have "kauff_mat ((basic w1) \<circ> ws2) =rat_poly.matrix_mult (blockmat w1) (kauff_mat ws2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (blockmat w1) (kauff_mat ws2)
[PROOF STEP]
using kauff_mat.simps(2)
[PROOF STATE]
proof (prove)
using this:
kauff_mat (?w * ?ws) = rat_poly.matrix_mult (blockmat ?w) (kauff_mat ?ws)

goal (1 subgoal):
 1. kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (blockmat w1) (kauff_mat ws2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (blockmat w1) (kauff_mat ws2)

goal (2 subgoals):
 1. \<And>x. is_tangle_diagram (basic x) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (basic x) \<Longrightarrow> kauff_mat (basic x \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (basic x)) (kauff_mat ws2)
 2. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (blockmat w1) (kauff_mat ws2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (blockmat w1) (kauff_mat ws2)

goal (1 subgoal):
 1. kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (basic w1)) (kauff_mat ws2)
[PROOF STEP]
using kauff_mat.simps(1)
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (blockmat w1) (kauff_mat ws2)
kauff_mat (basic ?w) = blockmat ?w

goal (1 subgoal):
 1. kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (basic w1)) (kauff_mat ws2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic w1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (basic w1)) (kauff_mat ws2)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
case (prod w1 ws1)
[PROOF STATE]
proof (state)
this:
is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)
is_tangle_diagram (w1 * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (w1 * ws1)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
have 1:"is_tangle_diagram (w1*ws1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram (w1 * ws1)
[PROOF STEP]
using prod.prems
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (w1 * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (w1 * ws1)

goal (1 subgoal):
 1. is_tangle_diagram (w1 * ws1)
[PROOF STEP]
by (rule conjE)
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (w1 * ws1)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram (w1 * ws1)
[PROOF STEP]
have 2:"(is_tangle_diagram ws1)
                 \<and> (codomain_block w1 = domain_wall ws1)"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (w1 * ws1)

goal (1 subgoal):
 1. is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1
[PROOF STEP]
using is_tangle_diagram.simps(2)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (w1 * ws1)
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1
[PROOF STEP]
have
       "mat (2^(nat (domain_wall ws1))) (2^(nat (codomain_wall ws1))) (kauff_mat ws1)"
            and "mat (2^(nat (domain_block w1))) (2^(nat (codomain_block w1))) (blockmat w1)"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1

goal (1 subgoal):
 1. mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (codomain_wall ws1)) (kauff_mat ws1) &&& mat (2 ^ nat (domain_block w1)) (2 ^ nat (codomain_block w1)) (blockmat w1)
[PROOF STEP]
using  effective_matrix_kauff_mat   matrix_blockmat  length_codomain_block
               row_length_domain_block
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)
mat (rat_poly.row_length (blockmat ?ls)) (length (blockmat ?ls)) (blockmat ?ls)
length (blockmat ?ls) = 2 ^ nat (codomain_block ?ls)
rat_poly.row_length (blockmat ?ls) = 2 ^ nat (domain_block ?ls)

goal (1 subgoal):
 1. mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (codomain_wall ws1)) (kauff_mat ws1) &&& mat (2 ^ nat (domain_block w1)) (2 ^ nat (codomain_block w1)) (blockmat w1)
[PROOF STEP]
by (auto) (metis)
[PROOF STATE]
proof (state)
this:
mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (codomain_wall ws1)) (kauff_mat ws1)
mat (2 ^ nat (domain_block w1)) (2 ^ nat (codomain_block w1)) (blockmat w1)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
with 2
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1
mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (codomain_wall ws1)) (kauff_mat ws1)
mat (2 ^ nat (domain_block w1)) (2 ^ nat (codomain_block w1)) (blockmat w1)
[PROOF STEP]
have 3:"mat
                     (rat_poly.row_length (blockmat w1))
                     (2^(nat (domain_wall ws1)))
                               (blockmat w1)"
         and   "mat
                   (2^(nat (domain_wall ws1)))
                   (2^(nat (domain_wall ws2)))
                               (kauff_mat ws1)"
         and "(2^(nat (domain_wall ws1)))
                           = (rat_poly.row_length (kauff_mat ws1))"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1
mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (codomain_wall ws1)) (kauff_mat ws1)
mat (2 ^ nat (domain_block w1)) (2 ^ nat (codomain_block w1)) (blockmat w1)

goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w1)) (2 ^ nat (domain_wall ws1)) (blockmat w1) &&& mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1) &&& 2 ^ nat (domain_wall ws1) = rat_poly.row_length (kauff_mat ws1)
[PROOF STEP]
using  effective_matrix_kauff_mat prod.prems matrix_blockmat
                row_length_domain_block
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1
mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (codomain_wall ws1)) (kauff_mat ws1)
mat (2 ^ nat (domain_block w1)) (2 ^ nat (codomain_block w1)) (blockmat w1)
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)
is_tangle_diagram (w1 * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (w1 * ws1)
mat (rat_poly.row_length (blockmat ?ls)) (length (blockmat ?ls)) (blockmat ?ls)
rat_poly.row_length (blockmat ?ls) = 2 ^ nat (domain_block ?ls)

goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w1)) (2 ^ nat (domain_wall ws1)) (blockmat w1) &&& mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1) &&& 2 ^ nat (domain_wall ws1) = rat_poly.row_length (kauff_mat ws1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (blockmat w1)) (2 ^ nat (domain_wall ws1)) (blockmat w1)
mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1)
2 ^ nat (domain_wall ws1) = rat_poly.row_length (kauff_mat ws1)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mat (rat_poly.row_length (blockmat w1)) (2 ^ nat (domain_wall ws1)) (blockmat w1)
mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1)
2 ^ nat (domain_wall ws1) = rat_poly.row_length (kauff_mat ws1)
[PROOF STEP]
have "mat
                  (rat_poly.row_length (blockmat w1))
                  (rat_poly.row_length (kauff_mat ws1))
                       (blockmat w1)"
         and   "mat
                 (rat_poly.row_length (kauff_mat ws1))
                 (2^(nat (domain_wall ws2)))
                       (kauff_mat ws1)"
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (blockmat w1)) (2 ^ nat (domain_wall ws1)) (blockmat w1)
mat (2 ^ nat (domain_wall ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1)
2 ^ nat (domain_wall ws1) = rat_poly.row_length (kauff_mat ws1)

goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1) &&& mat (rat_poly.row_length (kauff_mat ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1)
mat (rat_poly.row_length (kauff_mat ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1)
mat (rat_poly.row_length (kauff_mat ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
have "mat
                     (2^(nat (domain_wall ws2)))
                      (2^(nat (codomain_wall ws2)))
                            (kauff_mat ws2)"
           and "(2^(nat (domain_wall ws2)))
                    = rat_poly.row_length (kauff_mat ws2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (2 ^ nat (domain_wall ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2) &&& 2 ^ nat (domain_wall ws2) = rat_poly.row_length (kauff_mat ws2)
[PROOF STEP]
using prod.prems  effective_matrix_kauff_mat
              effective_matrix_kauff_mat
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (w1 * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (w1 * ws1)
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)

goal (1 subgoal):
 1. mat (2 ^ nat (domain_wall ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2) &&& 2 ^ nat (domain_wall ws2) = rat_poly.row_length (kauff_mat ws2)
[PROOF STEP]
by (auto) (metis prod.prems)
[PROOF STATE]
proof (state)
this:
mat (2 ^ nat (domain_wall ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2)
2 ^ nat (domain_wall ws2) = rat_poly.row_length (kauff_mat ws2)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1)
mat (rat_poly.row_length (kauff_mat ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1)
mat (2 ^ nat (domain_wall ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2)
2 ^ nat (domain_wall ws2) = rat_poly.row_length (kauff_mat ws2)
[PROOF STEP]
have "mat
                     (rat_poly.row_length (blockmat w1))
                     (rat_poly.row_length (kauff_mat ws1))
                               (blockmat w1)"
             and  "mat
                     (rat_poly.row_length (kauff_mat ws1))
                     (rat_poly.row_length (kauff_mat ws2))
                               (kauff_mat ws1)"
              and "mat
                      (rat_poly.row_length (kauff_mat ws2))
                      (2^(nat (codomain_wall ws2)))
                               (kauff_mat ws2)"
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1)
mat (rat_poly.row_length (kauff_mat ws1)) (2 ^ nat (domain_wall ws2)) (kauff_mat ws1)
mat (2 ^ nat (domain_wall ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2)
2 ^ nat (domain_wall ws2) = rat_poly.row_length (kauff_mat ws2)

goal (1 subgoal):
 1. mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1) &&& mat (rat_poly.row_length (kauff_mat ws1)) (rat_poly.row_length (kauff_mat ws2)) (kauff_mat ws1) &&& mat (rat_poly.row_length (kauff_mat ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1)
mat (rat_poly.row_length (kauff_mat ws1)) (rat_poly.row_length (kauff_mat ws2)) (kauff_mat ws1)
mat (rat_poly.row_length (kauff_mat ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
with 3
[PROOF STATE]
proof (chain)
picking this:
mat (rat_poly.row_length (blockmat w1)) (2 ^ nat (domain_wall ws1)) (blockmat w1)
mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1)
mat (rat_poly.row_length (kauff_mat ws1)) (rat_poly.row_length (kauff_mat ws2)) (kauff_mat ws1)
mat (rat_poly.row_length (kauff_mat ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2)
[PROOF STEP]
have "rat_poly.matrix_mult
                         (blockmat w1)
                          (rat_poly.matrix_mult (kauff_mat ws1)
                                      (kauff_mat ws2))
                      = rat_poly.matrix_mult
                             (rat_poly.matrix_mult
                                     (blockmat w1)
                                     (kauff_mat ws1))
                                           (kauff_mat ws2)"
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (blockmat w1)) (2 ^ nat (domain_wall ws1)) (blockmat w1)
mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1)
mat (rat_poly.row_length (kauff_mat ws1)) (rat_poly.row_length (kauff_mat ws2)) (kauff_mat ws1)
mat (rat_poly.row_length (kauff_mat ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat w1) (rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)) = rat_poly.matrix_mult (rat_poly.matrix_mult (blockmat w1) (kauff_mat ws1)) (kauff_mat ws2)
[PROOF STEP]
using associative_rat_poly_mat
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (blockmat w1)) (2 ^ nat (domain_wall ws1)) (blockmat w1)
mat (rat_poly.row_length (blockmat w1)) (rat_poly.row_length (kauff_mat ws1)) (blockmat w1)
mat (rat_poly.row_length (kauff_mat ws1)) (rat_poly.row_length (kauff_mat ws2)) (kauff_mat ws1)
mat (rat_poly.row_length (kauff_mat ws2)) (2 ^ nat (codomain_wall ws2)) (kauff_mat ws2)
\<lbrakk>mat (rat_poly.row_length ?m1.0) (rat_poly.row_length ?m2.0) ?m1.0; mat (rat_poly.row_length ?m2.0) (rat_poly.row_length ?m3.0) ?m2.0; mat (rat_poly.row_length ?m3.0) ?nc ?m3.0\<rbrakk> \<Longrightarrow> rat_poly.matrix_mult ?m1.0 (rat_poly.matrix_mult ?m2.0 ?m3.0) = rat_poly.matrix_mult (rat_poly.matrix_mult ?m1.0 ?m2.0) ?m3.0

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat w1) (rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)) = rat_poly.matrix_mult (rat_poly.matrix_mult (blockmat w1) (kauff_mat ws1)) (kauff_mat ws2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat w1) (rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)) = rat_poly.matrix_mult (rat_poly.matrix_mult (blockmat w1) (kauff_mat ws1)) (kauff_mat ws2)

goal (1 subgoal):
 1. \<And>x1a ws1. \<lbrakk>is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2); is_tangle_diagram (x1a * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (x1a * ws1)\<rbrakk> \<Longrightarrow> kauff_mat ((x1a * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (x1a * ws1)) (kauff_mat ws2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat w1) (rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)) = rat_poly.matrix_mult (rat_poly.matrix_mult (blockmat w1) (kauff_mat ws1)) (kauff_mat ws2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat w1) (rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)) = rat_poly.matrix_mult (rat_poly.matrix_mult (blockmat w1) (kauff_mat ws1)) (kauff_mat ws2)

goal (1 subgoal):
 1. kauff_mat ((w1 * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (w1 * ws1)) (kauff_mat ws2)
[PROOF STEP]
using  "2" codomain_wall.simps(2) compose_Cons
         prod.hyps prod.prems kauff_mat.simps(2)
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat w1) (rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)) = rat_poly.matrix_mult (rat_poly.matrix_mult (blockmat w1) (kauff_mat ws1)) (kauff_mat ws2)
is_tangle_diagram ws1 \<and> codomain_block w1 = domain_wall ws1
codomain_wall (?x * ?ys) = codomain_wall ?ys
(?x * ?xs) \<circ> ?ys = ?x * ?xs \<circ> ?ys
is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall ws1 \<Longrightarrow> kauff_mat (ws1 \<circ> ws2) = rat_poly.matrix_mult (kauff_mat ws1) (kauff_mat ws2)
is_tangle_diagram (w1 * ws1) \<and> is_tangle_diagram ws2 \<and> domain_wall ws2 = codomain_wall (w1 * ws1)
kauff_mat (?w * ?ws) = rat_poly.matrix_mult (blockmat ?w) (kauff_mat ?ws)

goal (1 subgoal):
 1. kauff_mat ((w1 * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (w1 * ws1)) (kauff_mat ws2)
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
kauff_mat ((w1 * ws1) \<circ> ws2) = rat_poly.matrix_mult (kauff_mat (w1 * ws1)) (kauff_mat ws2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma assumes sigma: "sigma_algebra A" and gr: "\<forall>a. {w. a < f w} \<in> A"
  shows gr_le: "\<forall>a. {w. f w \<le> (a::real)} \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. {w. f w \<le> a} \<in> A
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. {w. f w \<le> a} \<in> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. {w. f w \<le> a} \<in> A
[PROOF STEP]
fix a::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. {w. f w \<le> a} \<in> A
[PROOF STEP]
from gr sigma
[PROOF STATE]
proof (chain)
picking this:
\<forall>a. {w. a < f w} \<in> A
sigma_algebra A
[PROOF STEP]
have "-{w. a < f w} \<in> A"
[PROOF STATE]
proof (prove)
using this:
\<forall>a. {w. a < f w} \<in> A
sigma_algebra A

goal (1 subgoal):
 1. - {w. a < f w} \<in> A
[PROOF STEP]
by (simp add: sigma_algebra_def)
[PROOF STATE]
proof (state)
this:
- {w. a < f w} \<in> A

goal (1 subgoal):
 1. \<And>a. {w. f w \<le> a} \<in> A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- {w. a < f w} \<in> A

goal (1 subgoal):
 1. \<And>a. {w. f w \<le> a} \<in> A
[PROOF STEP]
have "-{w. a < f w} = {w. f w \<le> a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - {w. a < f w} = {w. f w \<le> a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- {w. a < f w} = {w. f w \<le> a}

goal (1 subgoal):
 1. \<And>a. {w. f w \<le> a} \<in> A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{w. f w \<le> a} \<in> A
[PROOF STEP]
show "{w. f w \<le> a} \<in> A"
[PROOF STATE]
proof (prove)
using this:
{w. f w \<le> a} \<in> A

goal (1 subgoal):
 1. {w. f w \<le> a} \<in> A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{w. f w \<le> a} \<in> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma butlast_nth:
  assumes "n + 1 < length l"
  shows "butlast l ! n = l ! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast l ! n = l ! n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n + 1 < length l

goal (1 subgoal):
 1. butlast l ! n = l ! n
[PROOF STEP]
by (induct l rule: rev_induct) (auto simp add: nth_append)


[STATEMENT]
lemma gso_inj[intro]:
  assumes "i < m"
  shows "inj_on gso {0..<i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
assume assms': "i < m" "x \<in> {0..<i}" "y \<in> {0..<i}" "gso x = gso y"
[PROOF STATE]
proof (state)
this:
i < length fs
x \<in> {0..<i}
y \<in> {0..<i}
gso x = gso y

goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
have "distinct (map gso [0..<m])" "x < length (map gso [0..<m])" "y < length (map gso [0..<m])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map gso [0..<length fs]) &&& x < length (map gso [0..<length fs]) &&& y < length (map gso [0..<length fs])
[PROOF STEP]
using dist_gso assms mn assms'
[PROOF STATE]
proof (prove)
using this:
distinct (map gso [0..<length fs])
i < length fs
length fs \<le> n
i < length fs
x \<in> {0..<i}
y \<in> {0..<i}
gso x = gso y

goal (1 subgoal):
 1. distinct (map gso [0..<length fs]) &&& x < length (map gso [0..<length fs]) &&& y < length (map gso [0..<length fs])
[PROOF STEP]
by (auto intro!: dist_gso)
[PROOF STATE]
proof (state)
this:
distinct (map gso [0..<length fs])
x < length (map gso [0..<length fs])
y < length (map gso [0..<length fs])

goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
from nth_eq_iff_index_eq[OF this] assms'
[PROOF STATE]
proof (chain)
picking this:
(map gso [0..<length fs] ! x = map gso [0..<length fs] ! y) = (x = y)
i < length fs
x \<in> {0..<i}
y \<in> {0..<i}
gso x = gso y
[PROOF STEP]
have "x = y"
[PROOF STATE]
proof (prove)
using this:
(map gso [0..<length fs] ! x = map gso [0..<length fs] ! y) = (x = y)
i < length fs
x \<in> {0..<i}
y \<in> {0..<i}
gso x = gso y

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

goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>i < length fs; ?x3 \<in> {0..<i}; ?y3 \<in> {0..<i}; gso ?x3 = gso ?y3\<rbrakk> \<Longrightarrow> ?x3 = ?y3

goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>i < length fs; ?x3 \<in> {0..<i}; ?y3 \<in> {0..<i}; gso ?x3 = gso ?y3\<rbrakk> \<Longrightarrow> ?x3 = ?y3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < length fs; ?x3 \<in> {0..<i}; ?y3 \<in> {0..<i}; gso ?x3 = gso ?y3\<rbrakk> \<Longrightarrow> ?x3 = ?y3

goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < length fs; ?x3 \<in> {0..<i}; ?y3 \<in> {0..<i}; gso ?x3 = gso ?y3\<rbrakk> \<Longrightarrow> ?x3 = ?y3
i < length fs

goal (1 subgoal):
 1. inj_on gso {0..<i}
[PROOF STEP]
by (intro inj_onI) auto
[PROOF STATE]
proof (state)
this:
inj_on gso {0..<i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem D_sound:
  "(c,s) \<rightarrow>* (c',s') \<Longrightarrow> D (dom s) c A'
   \<Longrightarrow> (\<exists>cs''. (c',s') \<rightarrow> cs'') \<or> c' = SKIP"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(c, s) \<rightarrow>* (c', s'); D (dom s) c A'\<rbrakk> \<Longrightarrow> (\<exists>cs''. (c', s') \<rightarrow> cs'') \<or> c' = SKIP
[PROOF STEP]
apply(induction arbitrary: A' rule:star_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b A'. D (dom b) a A' \<Longrightarrow> Ex ((\<rightarrow>) (a, b)) \<or> a = SKIP
 2. \<And>a b aa ba ab bb A'. \<lbrakk>(a, b) \<rightarrow> (aa, ba); (aa, ba) \<rightarrow>* (ab, bb); \<And>A'. D (dom ba) aa A' \<Longrightarrow> Ex ((\<rightarrow>) (ab, bb)) \<or> ab = SKIP; D (dom b) a A'\<rbrakk> \<Longrightarrow> Ex ((\<rightarrow>) (ab, bb)) \<or> ab = SKIP
[PROOF STEP]
apply (metis progress)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b aa ba ab bb A'. \<lbrakk>(a, b) \<rightarrow> (aa, ba); (aa, ba) \<rightarrow>* (ab, bb); \<And>A'. D (dom ba) aa A' \<Longrightarrow> Ex ((\<rightarrow>) (ab, bb)) \<or> ab = SKIP; D (dom b) a A'\<rbrakk> \<Longrightarrow> Ex ((\<rightarrow>) (ab, bb)) \<or> ab = SKIP
[PROOF STEP]
by (metis D_preservation)


[STATEMENT]
lemma card_pick_inf:
assumes "infinite S"
shows "card {a\<in>S. a < pick S n} = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {a \<in> S. a < pick S n} = n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
infinite S

goal (1 subgoal):
 1. card {a \<in> S. a < pick S n} = n
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. infinite S \<Longrightarrow> card {a \<in> S. a < pick S 0} = 0
 2. \<And>n. \<lbrakk>infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n; infinite S\<rbrakk> \<Longrightarrow> card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
infinite S

goal (2 subgoals):
 1. infinite S \<Longrightarrow> card {a \<in> S. a < pick S 0} = 0
 2. \<And>n. \<lbrakk>infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n; infinite S\<rbrakk> \<Longrightarrow> card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite S
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
infinite S

goal (1 subgoal):
 1. card {a \<in> S. a < pick S 0} = 0
[PROOF STEP]
unfolding pick.simps
[PROOF STATE]
proof (prove)
using this:
infinite S

goal (1 subgoal):
 1. card {a \<in> S. a < (LEAST a. a \<in> S)} = 0
[PROOF STEP]
using not_less_Least
[PROOF STATE]
proof (prove)
using this:
infinite S
?k < (LEAST x. ?P x) \<Longrightarrow> \<not> ?P ?k

goal (1 subgoal):
 1. card {a \<in> S. a < (LEAST a. a \<in> S)} = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {a \<in> S. a < pick S 0} = 0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n; infinite S\<rbrakk> \<Longrightarrow> card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n; infinite S\<rbrakk> \<Longrightarrow> card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n
infinite S

goal (1 subgoal):
 1. \<And>n. \<lbrakk>infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n; infinite S\<rbrakk> \<Longrightarrow> card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n
infinite S
[PROOF STEP]
show "card {a\<in>S. a < pick S (Suc n)} = Suc n"
[PROOF STATE]
proof (prove)
using this:
infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n
infinite S

goal (1 subgoal):
 1. card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n; infinite S\<rbrakk> \<Longrightarrow> card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
have "{a \<in> S. a < pick S (Suc n)} = {a \<in> S. a < pick S n} \<union> {pick S n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> S. a < pick S (Suc n)} = {a \<in> S. a < pick S n} \<union> {pick S n}
[PROOF STEP]
apply (rule subset_antisym; rule subsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {a \<in> S. a < pick S (Suc n)} \<Longrightarrow> x \<in> {a \<in> S. a < pick S n} \<union> {pick S n}
 2. \<And>x. x \<in> {a \<in> S. a < pick S n} \<union> {pick S n} \<Longrightarrow> x \<in> {a \<in> S. a < pick S (Suc n)}
[PROOF STEP]
using not_less_Least UnCI mem_Collect_eq nat_neq_iff singleton_conv
       pick_mono_inf[OF Suc.prems, of n "Suc n"] pick_in_set_inf[OF Suc.prems, of n]
[PROOF STATE]
proof (prove)
using this:
?k < (LEAST x. ?P x) \<Longrightarrow> \<not> ?P ?k
(?c \<notin> ?B \<Longrightarrow> ?c \<in> ?A) \<Longrightarrow> ?c \<in> ?A \<union> ?B
(?a \<in> Collect ?P) = ?P ?a
(?m \<noteq> ?n) = (?m < ?n \<or> ?n < ?m)
{x. x = ?a} = {?a}
n < Suc n \<Longrightarrow> pick S n < pick S (Suc n)
pick S n \<in> S

goal (2 subgoals):
 1. \<And>x. x \<in> {a \<in> S. a < pick S (Suc n)} \<Longrightarrow> x \<in> {a \<in> S. a < pick S n} \<union> {pick S n}
 2. \<And>x. x \<in> {a \<in> S. a < pick S n} \<union> {pick S n} \<Longrightarrow> x \<in> {a \<in> S. a < pick S (Suc n)}
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
{a \<in> S. a < pick S (Suc n)} = {a \<in> S. a < pick S n} \<union> {pick S n}

goal (1 subgoal):
 1. \<lbrakk>infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n; infinite S\<rbrakk> \<Longrightarrow> card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{a \<in> S. a < pick S (Suc n)} = {a \<in> S. a < pick S n} \<union> {pick S n}
[PROOF STEP]
have "card {a \<in> S. a < pick S (Suc n)} = card {a \<in> S. a < pick S n} + card {pick S n}"
[PROOF STATE]
proof (prove)
using this:
{a \<in> S. a < pick S (Suc n)} = {a \<in> S. a < pick S n} \<union> {pick S n}

goal (1 subgoal):
 1. card {a \<in> S. a < pick S (Suc n)} = card {a \<in> S. a < pick S n} + card {pick S n}
[PROOF STEP]
using card_Un_disjoint
[PROOF STATE]
proof (prove)
using this:
{a \<in> S. a < pick S (Suc n)} = {a \<in> S. a < pick S n} \<union> {pick S n}
\<lbrakk>finite ?A; finite ?B; ?A \<inter> ?B = {}\<rbrakk> \<Longrightarrow> card (?A \<union> ?B) = card ?A + card ?B

goal (1 subgoal):
 1. card {a \<in> S. a < pick S (Suc n)} = card {a \<in> S. a < pick S n} + card {pick S n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {a \<in> S. a < pick S (Suc n)} = card {a \<in> S. a < pick S n} + card {pick S n}

goal (1 subgoal):
 1. \<lbrakk>infinite S \<Longrightarrow> card {a \<in> S. a < pick S n} = n; infinite S\<rbrakk> \<Longrightarrow> card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {a \<in> S. a < pick S (Suc n)} = card {a \<in> S. a < pick S n} + card {pick S n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {a \<in> S. a < pick S (Suc n)} = card {a \<in> S. a < pick S n} + card {pick S n}

goal (1 subgoal):
 1. card {a \<in> S. a < pick S (Suc n)} = Suc n
[PROOF STEP]
by (metis One_nat_def Suc_eq_plus1 Suc card.empty card_insert_if empty_iff finite.emptyI)
[PROOF STATE]
proof (state)
this:
card {a \<in> S. a < pick S (Suc n)} = Suc n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card {a \<in> S. a < pick S (Suc n)} = Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compl_mono:
  assumes "x \<le> y"
  shows "- y \<le> - x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - y \<le> - x
[PROOF STEP]
by (simp add: assms local.ortho_antimono)


[STATEMENT]
lemma group_closure_mult_all_eq:
  "group_closure (times k ` S) = times k ` group_closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_closure ((*) k ` S) = (*) k ` group_closure S
[PROOF STEP]
proof (rule; rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> group_closure ((*) k ` S) \<Longrightarrow> x \<in> (*) k ` group_closure S
 2. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> group_closure ((*) k ` S) \<Longrightarrow> x \<in> (*) k ` group_closure S
 2. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
have *: "k * a + k * b = k * (a + b)"
    "k * a - k * b = k * (a - b)" for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * a + k * b = k * (a + b) &&& k * a - k * b = k * (a - b)
[PROOF STEP]
by (simp_all add: algebra_simps)
[PROOF STATE]
proof (state)
this:
k * ?a1 + k * ?b1 = k * (?a1 + ?b1)
k * ?a1 - k * ?b1 = k * (?a1 - ?b1)

goal (2 subgoals):
 1. \<And>x. x \<in> group_closure ((*) k ` S) \<Longrightarrow> x \<in> (*) k ` group_closure S
 2. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
assume "s \<in> group_closure (times k ` S)"
[PROOF STATE]
proof (state)
this:
s \<in> group_closure ((*) k ` S)

goal (2 subgoals):
 1. \<And>x. x \<in> group_closure ((*) k ` S) \<Longrightarrow> x \<in> (*) k ` group_closure S
 2. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s \<in> group_closure ((*) k ` S)
[PROOF STEP]
show "s \<in> times k ` group_closure S"
[PROOF STATE]
proof (prove)
using this:
s \<in> group_closure ((*) k ` S)

goal (1 subgoal):
 1. s \<in> (*) k ` group_closure S
[PROOF STEP]
by induction (auto simp add: * image_iff intro: group_closure.base group_closure.diff bexI [of _ 0])
[PROOF STATE]
proof (state)
this:
s \<in> (*) k ` group_closure S

goal (1 subgoal):
 1. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
assume "s \<in> times k ` group_closure S"
[PROOF STATE]
proof (state)
this:
s \<in> (*) k ` group_closure S

goal (1 subgoal):
 1. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s \<in> (*) k ` group_closure S
[PROOF STEP]
obtain r where r: "r \<in> group_closure S" and s: "s = k * r"
[PROOF STATE]
proof (prove)
using this:
s \<in> (*) k ` group_closure S

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>r \<in> group_closure S; s = k * r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r \<in> group_closure S
s = k * r

goal (1 subgoal):
 1. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
from r
[PROOF STATE]
proof (chain)
picking this:
r \<in> group_closure S
[PROOF STEP]
have "k * r \<in> group_closure (times k ` S)"
[PROOF STATE]
proof (prove)
using this:
r \<in> group_closure S

goal (1 subgoal):
 1. k * r \<in> group_closure ((*) k ` S)
[PROOF STEP]
by (induction arbitrary: s) (auto simp add: algebra_simps intro: group_closure.intros)
[PROOF STATE]
proof (state)
this:
k * r \<in> group_closure ((*) k ` S)

goal (1 subgoal):
 1. \<And>x. x \<in> (*) k ` group_closure S \<Longrightarrow> x \<in> group_closure ((*) k ` S)
[PROOF STEP]
with s
[PROOF STATE]
proof (chain)
picking this:
s = k * r
k * r \<in> group_closure ((*) k ` S)
[PROOF STEP]
show "s \<in> group_closure (times k ` S)"
[PROOF STATE]
proof (prove)
using this:
s = k * r
k * r \<in> group_closure ((*) k ` S)

goal (1 subgoal):
 1. s \<in> group_closure ((*) k ` S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
s \<in> group_closure ((*) k ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_prod_imp_sums_ln_real:
  fixes f :: "nat \<Rightarrow> real"
  assumes "raw_has_prod f 0 p" and 0: "\<And>x. f x > 0"
  shows "(\<lambda>i. ln (f i)) sums (ln p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. ln (f i)) sums ln p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>i. ln (f i)) sums ln p
[PROOF STEP]
have "p > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
raw_has_prod f 0 p
0 < f ?x

goal (1 subgoal):
 1. 0 < p
[PROOF STEP]
unfolding prod_defs
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>i\<le>n. f (i + 0)) \<longlonglongrightarrow> p \<and> p \<noteq> 0
0 < f ?x

goal (1 subgoal):
 1. 0 < p
[PROOF STEP]
by (metis LIMSEQ_prod_nonneg less_eq_real_def)
[PROOF STATE]
proof (state)
this:
0 < p

goal (1 subgoal):
 1. (\<lambda>i. ln (f i)) sums ln p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < p

goal (1 subgoal):
 1. (\<lambda>i. ln (f i)) sums ln p
[PROOF STEP]
using assms continuous_on_ln [of "{0<..}" "\<lambda>x. x"]
[PROOF STATE]
proof (prove)
using this:
0 < p
raw_has_prod f 0 p
0 < f ?x
\<lbrakk>continuous_on {0<..} (\<lambda>x. x); \<forall>x\<in>{0<..}. x \<noteq> 0\<rbrakk> \<Longrightarrow> continuous_on {0<..} ln

goal (1 subgoal):
 1. (\<lambda>i. ln (f i)) sums ln p
[PROOF STEP]
using continuous_on_tendsto_compose [of "{0<..}" ln "(\<lambda>n. prod f {..n})" p]
[PROOF STATE]
proof (prove)
using this:
0 < p
raw_has_prod f 0 p
0 < f ?x
\<lbrakk>continuous_on {0<..} (\<lambda>x. x); \<forall>x\<in>{0<..}. x \<noteq> 0\<rbrakk> \<Longrightarrow> continuous_on {0<..} ln
\<lbrakk>continuous_on {0<..} ln; ((\<lambda>n. prod f {..n}) \<longlongrightarrow> p) ?F; p \<in> {0<..}; \<forall>\<^sub>F x in ?F. prod f {..x} \<in> {0<..}\<rbrakk> \<Longrightarrow> ((\<lambda>x. ln (prod f {..x})) \<longlongrightarrow> ln p) ?F

goal (1 subgoal):
 1. (\<lambda>i. ln (f i)) sums ln p
[PROOF STEP]
by (auto simp: prod_defs sums_def_le ln_prod order_tendstoD)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. ln (f i)) sums ln p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_seqs_diff_closed:
  assumes "s \<in> closed_seqs Zp"
  assumes "a \<in> carrier Zp"
  shows "s m \<ominus> a \<in> carrier Zp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s m \<ominus> a \<in> carrier Zp
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
s \<in> carrier Zp\<^bsup>\<omega>\<^esup>
a \<in> carrier Zp

goal (1 subgoal):
 1. s m \<ominus> a \<in> carrier Zp
[PROOF STEP]
by (simp add: closed_seqs_memE)


[STATEMENT]
lemma pick_one_gt:
  fixes xs::"real list" and m::real
  defines m: "m \<equiv> (mean xs)" and neq: "noteq \<equiv> list_neq xs m"
  assumes asum: "noteq\<noteq>[]"
  shows "\<exists>e. e : set noteq \<and> e > m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e. e \<in> set noteq \<and> m < e
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
let ?m = "(mean xs)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
let ?neq = "list_neq xs ?m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
let ?eq = "list_eq xs ?m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
from list_eq_sum
[PROOF STATE]
proof (chain)
picking this:
sum_list (list_eq ?xs ?m) = ?m * real (length (list_eq ?xs ?m))
[PROOF STEP]
have "(\<Sum>:?eq) = ?m * (real (length ?eq))"
[PROOF STATE]
proof (prove)
using this:
sum_list (list_eq ?xs ?m) = ?m * real (length (list_eq ?xs ?m))

goal (1 subgoal):
 1. sum_list (list_eq xs (mean xs)) = mean xs * real (length (list_eq xs (mean xs)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (list_eq xs (mean xs)) = mean xs * real (length (list_eq xs (mean xs)))

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
from asum
[PROOF STATE]
proof (chain)
picking this:
noteq \<noteq> []
[PROOF STEP]
have neq_ne: " ?neq \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
noteq \<noteq> []

goal (1 subgoal):
 1. list_neq xs (mean xs) \<noteq> []
[PROOF STEP]
unfolding m neq
[PROOF STATE]
proof (prove)
using this:
list_neq xs (mean xs) \<noteq> []

goal (1 subgoal):
 1. list_neq xs (mean xs) \<noteq> []
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
list_neq xs (mean xs) \<noteq> []

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
assume not_el: "\<not>(\<exists>e. e : set noteq \<and> m < e)"
[PROOF STATE]
proof (state)
this:
\<nexists>e. e \<in> set noteq \<and> m < e

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
hence not_el_exp: "\<not>(\<exists>e. e : set ?neq \<and> ?m < e)"
[PROOF STATE]
proof (prove)
using this:
\<nexists>e. e \<in> set noteq \<and> m < e

goal (1 subgoal):
 1. \<nexists>e. e \<in> set (list_neq xs (mean xs)) \<and> mean xs < e
[PROOF STEP]
unfolding m neq
[PROOF STATE]
proof (prove)
using this:
\<nexists>e. e \<in> set (list_neq xs (mean xs)) \<and> mean xs < e

goal (1 subgoal):
 1. \<nexists>e. e \<in> set (list_neq xs (mean xs)) \<and> mean xs < e
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<nexists>e. e \<in> set (list_neq xs (mean xs)) \<and> mean xs < e

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
hence "\<forall>e. \<not>(e : set ?neq) \<or> \<not>(e > ?m)"
[PROOF STATE]
proof (prove)
using this:
\<nexists>e. e \<in> set (list_neq xs (mean xs)) \<and> mean xs < e

goal (1 subgoal):
 1. \<forall>e. e \<notin> set (list_neq xs (mean xs)) \<or> \<not> mean xs < e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>e. e \<notin> set (list_neq xs (mean xs)) \<or> \<not> mean xs < e

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
hence "\<forall>e. e : set ?neq \<longrightarrow> \<not>(e > ?m)"
[PROOF STATE]
proof (prove)
using this:
\<forall>e. e \<notin> set (list_neq xs (mean xs)) \<or> \<not> mean xs < e

goal (1 subgoal):
 1. \<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> \<not> mean xs < e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> \<not> mean xs < e

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
hence "\<forall>e. e : set ?neq \<longrightarrow> e \<le> ?m"
[PROOF STATE]
proof (prove)
using this:
\<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> \<not> mean xs < e

goal (1 subgoal):
 1. \<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> e \<le> mean xs
[PROOF STEP]
by (simp add: linorder_not_less)
[PROOF STATE]
proof (state)
this:
\<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> e \<le> mean xs

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
hence "\<forall>e. e : set ?neq \<longrightarrow> e < ?m"
[PROOF STATE]
proof (prove)
using this:
\<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> e \<le> mean xs

goal (1 subgoal):
 1. \<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> e < mean xs
[PROOF STEP]
by (simp add:order_le_less)
[PROOF STATE]
proof (state)
this:
\<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> e < mean xs

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
with assms sum_list_mono_lt
[PROOF STATE]
proof (chain)
picking this:
m \<equiv> mean xs
noteq \<equiv> list_neq xs m
noteq \<noteq> []
?xs \<noteq> [] \<and> (\<forall>x\<in>set ?xs. x < ?m) \<Longrightarrow> sum_list ?xs < ?m * real (length ?xs)
\<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> e < mean xs
[PROOF STEP]
have "(\<Sum>:?neq) < ?m * (real (length ?neq))"
[PROOF STATE]
proof (prove)
using this:
m \<equiv> mean xs
noteq \<equiv> list_neq xs m
noteq \<noteq> []
?xs \<noteq> [] \<and> (\<forall>x\<in>set ?xs. x < ?m) \<Longrightarrow> sum_list ?xs < ?m * real (length ?xs)
\<forall>e. e \<in> set (list_neq xs (mean xs)) \<longrightarrow> e < mean xs

goal (1 subgoal):
 1. sum_list (list_neq xs (mean xs)) < mean xs * real (length (list_neq xs (mean xs)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sum_list (list_neq xs (mean xs)) < mean xs * real (length (list_neq xs (mean xs)))

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
hence
    "(\<Sum>:?neq) + (\<Sum>:?eq) < ?m * (real (length ?neq)) + (\<Sum>:?eq)"
[PROOF STATE]
proof (prove)
using this:
sum_list (list_neq xs (mean xs)) < mean xs * real (length (list_neq xs (mean xs)))

goal (1 subgoal):
 1. sum_list (list_neq xs (mean xs)) + sum_list (list_eq xs (mean xs)) < mean xs * real (length (list_neq xs (mean xs))) + sum_list (list_eq xs (mean xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (list_neq xs (mean xs)) + sum_list (list_eq xs (mean xs)) < mean xs * real (length (list_neq xs (mean xs))) + sum_list (list_eq xs (mean xs))

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (list_neq xs (mean xs)) + sum_list (list_eq xs (mean xs)) < mean xs * real (length (list_neq xs (mean xs))) + sum_list (list_eq xs (mean xs))

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
have
    "\<dots> = (?m * ((real (length ?neq) + (real (length ?eq)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mean xs * real (length (list_neq xs (mean xs))) + sum_list (list_eq xs (mean xs)) = mean xs * (real (length (list_neq xs (mean xs))) + real (length (list_eq xs (mean xs))))
[PROOF STEP]
by (simp add:field_simps)
[PROOF STATE]
proof (state)
this:
mean xs * real (length (list_neq xs (mean xs))) + sum_list (list_eq xs (mean xs)) = mean xs * (real (length (list_neq xs (mean xs))) + real (length (list_eq xs (mean xs))))

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mean xs * real (length (list_neq xs (mean xs))) + sum_list (list_eq xs (mean xs)) = mean xs * (real (length (list_neq xs (mean xs))) + real (length (list_eq xs (mean xs))))

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
have
    "\<dots> = (?m * (real (length xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mean xs * (real (length (list_neq xs (mean xs))) + real (length (list_eq xs (mean xs)))) = mean xs * real (length xs)
[PROOF STEP]
apply (subst of_nat_add [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mean xs * real (length (list_neq xs (mean xs)) + length (list_eq xs (mean xs))) = mean xs * real (length xs)
[PROOF STEP]
by (simp add: sum_list_length_split [symmetric])
[PROOF STATE]
proof (state)
this:
mean xs * (real (length (list_neq xs (mean xs))) + real (length (list_eq xs (mean xs)))) = mean xs * real (length xs)

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mean xs * (real (length (list_neq xs (mean xs))) + real (length (list_eq xs (mean xs)))) = mean xs * real (length xs)

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
have
    "\<dots> = \<Sum>:xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mean xs * real (length xs) = sum_list xs
[PROOF STEP]
by (simp add: list_sum_mean [symmetric])
[PROOF STATE]
proof (state)
this:
mean xs * real (length xs) = sum_list xs

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mean xs * real (length xs) = sum_list xs

goal (1 subgoal):
 1. \<nexists>e. e \<in> set noteq \<and> m < e \<Longrightarrow> False
[PROOF STEP]
from not_el calculation
[PROOF STATE]
proof (chain)
picking this:
\<nexists>e. e \<in> set noteq \<and> m < e
sum_list (list_neq xs (mean xs)) + sum_list (list_eq xs (mean xs)) < sum_list xs
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<nexists>e. e \<in> set noteq \<and> m < e
sum_list (list_neq xs (mean xs)) + sum_list (list_eq xs (mean xs)) < sum_list xs

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_nat_ge_zero[intro!]: "of_nat n \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> of_nat n
[PROOF STEP]
using add_right_mono[of _ _ 1]
[PROOF STATE]
proof (prove)
using this:
?a \<le> ?b \<Longrightarrow> ?a + (1::'a) \<le> ?b + (1::'a)

goal (1 subgoal):
 1. (0::'a) \<le> of_nat n
[PROOF STEP]
by (induct n, auto)


[STATEMENT]
lemma B_theorem_3_b: "\<Theta> i * f i = ff (lead_coeff (H i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Theta> i * f i = ff (lead_coeff (H i))
[PROOF STEP]
using arg_cong[OF fundamental_theorem_eq_6[folded H_def, OF i], of lead_coeff]
[PROOF STATE]
proof (prove)
using this:
lead_coeff (ffp (H i)) = lead_coeff (Polynomial.smult (\<Theta> i) (F i))

goal (1 subgoal):
 1. \<Theta> i * f i = ff (lead_coeff (H i))
[PROOF STEP]
unfolding f[of i]
  lead_coeff_smult
[PROOF STATE]
proof (prove)
using this:
lead_coeff (ffp (H i)) = \<Theta> i * lead_coeff (F i)

goal (1 subgoal):
 1. \<Theta> i * lead_coeff (F i) = ff (lead_coeff (H i))
[PROOF STEP]
by simp


[STATEMENT]
lemma append_assoc [simp]: "append (append t1 t2) t3 = append t1 (append t2 t3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Binary_Tree.append (Binary_Tree.append t1 t2) t3 = Binary_Tree.append t1 (Binary_Tree.append t2 t3)
[PROOF STEP]
apply (induct t1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Binary_Tree.append (Binary_Tree.append Lf t2) t3 = Binary_Tree.append Lf (Binary_Tree.append t2 t3)
 2. \<And>x1 t11 t12. \<lbrakk>Binary_Tree.append (Binary_Tree.append t11 t2) t3 = Binary_Tree.append t11 (Binary_Tree.append t2 t3); Binary_Tree.append (Binary_Tree.append t12 t2) t3 = Binary_Tree.append t12 (Binary_Tree.append t2 t3)\<rbrakk> \<Longrightarrow> Binary_Tree.append (Binary_Tree.append (Br x1 t11 t12) t2) t3 = Binary_Tree.append (Br x1 t11 t12) (Binary_Tree.append t2 t3)
[PROOF STEP]
apply (metis append.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 t11 t12. \<lbrakk>Binary_Tree.append (Binary_Tree.append t11 t2) t3 = Binary_Tree.append t11 (Binary_Tree.append t2 t3); Binary_Tree.append (Binary_Tree.append t12 t2) t3 = Binary_Tree.append t12 (Binary_Tree.append t2 t3)\<rbrakk> \<Longrightarrow> Binary_Tree.append (Binary_Tree.append (Br x1 t11 t12) t2) t3 = Binary_Tree.append (Br x1 t11 t12) (Binary_Tree.append t2 t3)
[PROOF STEP]
by (metis append.simps(2))


[STATEMENT]
lemma fdisjnt_subset_left: "N' |\<subseteq>| N \<Longrightarrow> fdisjnt N M \<Longrightarrow> fdisjnt N' M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>N' |\<subseteq>| N; fdisjnt N M\<rbrakk> \<Longrightarrow> fdisjnt N' M
[PROOF STEP]
unfolding fdisjnt_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>N' |\<subseteq>| N; N |\<inter>| M = {||}\<rbrakk> \<Longrightarrow> N' |\<inter>| M = {||}
[PROOF STEP]
by auto


[STATEMENT]
lemma varsC_substC:
"varsC (substC \<pi> c) = (\<Union> x \<in> varsC c. vars (\<pi> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. varsC (substC \<pi> c) = (\<Union>x\<in>varsC c. vars (\<pi> x))
[PROOF STEP]
apply(induct c)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. varsC (substC \<pi> []) = (\<Union>x\<in>varsC []. vars (\<pi> x))
 2. \<And>a c. varsC (substC \<pi> c) = (\<Union>x\<in>varsC c. vars (\<pi> x)) \<Longrightarrow> varsC (substC \<pi> (a # c)) = (\<Union>x\<in>varsC (a # c). vars (\<pi> x))
[PROOF STEP]
unfolding substC_def varsC_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (set (map varsL (map (substL \<pi>) []))) = (\<Union>x\<in>\<Union> (set (map varsL [])). vars (\<pi> x))
 2. \<And>a c. \<Union> (set (map varsL (map (substL \<pi>) c))) = (\<Union>x\<in>\<Union> (set (map varsL c)). vars (\<pi> x)) \<Longrightarrow> \<Union> (set (map varsL (map (substL \<pi>) (a # c)))) = (\<Union>x\<in>\<Union> (set (map varsL (a # c))). vars (\<pi> x))
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a c. \<Union> (set (map varsL (map (substL \<pi>) c))) = (\<Union>x\<in>\<Union> (set (map varsL c)). vars (\<pi> x)) \<Longrightarrow> \<Union> (set (map varsL (map (substL \<pi>) (a # c)))) = (\<Union>x\<in>\<Union> (set (map varsL (a # c))). vars (\<pi> x))
[PROOF STEP]
unfolding substC_def varsC_def map_map set_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a c. \<Union> ((varsL \<circ> substL \<pi>) ` set c) = (\<Union>x\<in>\<Union> (varsL ` set c). vars (\<pi> x)) \<Longrightarrow> \<Union> ((varsL \<circ> substL \<pi>) ` set (a # c)) = (\<Union>x\<in>\<Union> (varsL ` set (a # c)). vars (\<pi> x))
[PROOF STEP]
unfolding comp_def varsL_substL
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a c. (\<Union>x\<in>set c. \<Union>x\<in>varsL x. vars (\<pi> x)) = (\<Union>x\<in>\<Union> (varsL ` set c). vars (\<pi> x)) \<Longrightarrow> (\<Union>x\<in>set (a # c). \<Union>x\<in>varsL x. vars (\<pi> x)) = (\<Union>x\<in>\<Union> (varsL ` set (a # c)). vars (\<pi> x))
[PROOF STEP]
by blast


[STATEMENT]
lemma tan_monotone:
  assumes "- (pi/2) < y" and "y < x" and "x < pi/2"
  shows "tan y < tan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
have "DERIV tan x' :> inverse ((cos x')\<^sup>2)" if "y \<le> x'" "x' \<le> x" for x'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tan has_real_derivative inverse ((cos x')\<^sup>2)) (at x')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (tan has_real_derivative inverse ((cos x')\<^sup>2)) (at x')
[PROOF STEP]
have "-(pi/2) < x'" and "x' < pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (pi / 2) < x' &&& x' < pi / 2
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
y \<le> x'
x' \<le> x
- (pi / 2) < y
y < x
x < pi / 2

goal (1 subgoal):
 1. - (pi / 2) < x' &&& x' < pi / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (pi / 2) < x'
x' < pi / 2

goal (1 subgoal):
 1. (tan has_real_derivative inverse ((cos x')\<^sup>2)) (at x')
[PROOF STEP]
with cos_gt_zero_pi
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>- (pi / 2) < ?x; ?x < pi / 2\<rbrakk> \<Longrightarrow> 0 < cos ?x
- (pi / 2) < x'
x' < pi / 2
[PROOF STEP]
have "cos x' \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- (pi / 2) < ?x; ?x < pi / 2\<rbrakk> \<Longrightarrow> 0 < cos ?x
- (pi / 2) < x'
x' < pi / 2

goal (1 subgoal):
 1. cos x' \<noteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
cos x' \<noteq> 0

goal (1 subgoal):
 1. (tan has_real_derivative inverse ((cos x')\<^sup>2)) (at x')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cos x' \<noteq> 0
[PROOF STEP]
show "DERIV tan x' :> inverse ((cos x')\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
cos x' \<noteq> 0

goal (1 subgoal):
 1. (tan has_real_derivative inverse ((cos x')\<^sup>2)) (at x')
[PROOF STEP]
by (rule DERIV_tan)
[PROOF STATE]
proof (state)
this:
(tan has_real_derivative inverse ((cos x')\<^sup>2)) (at x')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>y \<le> ?x'; ?x' \<le> x\<rbrakk> \<Longrightarrow> (tan has_real_derivative inverse ((cos ?x')\<^sup>2)) (at ?x')

goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
from MVT2[OF \<open>y < x\<close> this]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>xa. \<lbrakk>y \<le> xa; xa \<le> x\<rbrakk> \<Longrightarrow> y \<le> xa; \<And>xa. \<lbrakk>y \<le> xa; xa \<le> x\<rbrakk> \<Longrightarrow> xa \<le> x\<rbrakk> \<Longrightarrow> \<exists>z>y. z < x \<and> tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)
[PROOF STEP]
obtain z where "y < z" and "z < x"
    and tan_diff: "tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>xa. \<lbrakk>y \<le> xa; xa \<le> x\<rbrakk> \<Longrightarrow> y \<le> xa; \<And>xa. \<lbrakk>y \<le> xa; xa \<le> x\<rbrakk> \<Longrightarrow> xa \<le> x\<rbrakk> \<Longrightarrow> \<exists>z>y. z < x \<and> tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>y < z; z < x; tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y < z
z < x
tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)

goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y < z
z < x
tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)
[PROOF STEP]
have "- (pi/2) < z" and "z < pi/2"
[PROOF STATE]
proof (prove)
using this:
y < z
z < x
tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)

goal (1 subgoal):
 1. - (pi / 2) < z &&& z < pi / 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y < z
z < x
tan x - tan y = (x - y) * inverse ((cos z)\<^sup>2)
- (pi / 2) < y
y < x
x < pi / 2

goal (1 subgoal):
 1. - (pi / 2) < z &&& z < pi / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- (pi / 2) < z
z < pi / 2

goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- (pi / 2) < z
z < pi / 2
[PROOF STEP]
have "0 < cos z"
[PROOF STATE]
proof (prove)
using this:
- (pi / 2) < z
z < pi / 2

goal (1 subgoal):
 1. 0 < cos z
[PROOF STEP]
using cos_gt_zero_pi
[PROOF STATE]
proof (prove)
using this:
- (pi / 2) < z
z < pi / 2
\<lbrakk>- (pi / 2) < ?x; ?x < pi / 2\<rbrakk> \<Longrightarrow> 0 < cos ?x

goal (1 subgoal):
 1. 0 < cos z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < cos z

goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < cos z
[PROOF STEP]
have inv_pos: "0 < inverse ((cos z)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
0 < cos z

goal (1 subgoal):
 1. 0 < inverse ((cos z)\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < inverse ((cos z)\<^sup>2)

goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
have "0 < x - y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x - y
[PROOF STEP]
using \<open>y < x\<close>
[PROOF STATE]
proof (prove)
using this:
y < x

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

goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
with inv_pos
[PROOF STATE]
proof (chain)
picking this:
0 < inverse ((cos z)\<^sup>2)
0 < x - y
[PROOF STEP]
have "0 < tan x - tan y"
[PROOF STATE]
proof (prove)
using this:
0 < inverse ((cos z)\<^sup>2)
0 < x - y

goal (1 subgoal):
 1. 0 < tan x - tan y
[PROOF STEP]
unfolding tan_diff
[PROOF STATE]
proof (prove)
using this:
0 < inverse ((cos z)\<^sup>2)
0 < x - y

goal (1 subgoal):
 1. 0 < (x - y) * inverse ((cos z)\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < tan x - tan y

goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < tan x - tan y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < tan x - tan y

goal (1 subgoal):
 1. tan y < tan x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tan y < tan x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_bv_nat [simp]: "nat_to_bv (bv_to_nat w) = norm_unsigned w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_bv (bv_to_nat w) = norm_unsigned w
[PROOF STEP]
proof (rule bit_list_induct [of _ w],simp_all)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>bs. nat_to_bv (bv_to_nat bs) = norm_unsigned bs \<Longrightarrow> nat_to_bv (2 ^ length bs + bv_to_nat bs) = \<one> # bs
[PROOF STEP]
fix xs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>bs. nat_to_bv (bv_to_nat bs) = norm_unsigned bs \<Longrightarrow> nat_to_bv (2 ^ length bs + bv_to_nat bs) = \<one> # bs
[PROOF STEP]
assume "nat_to_bv (bv_to_nat xs) = norm_unsigned xs"
[PROOF STATE]
proof (state)
this:
nat_to_bv (bv_to_nat xs) = norm_unsigned xs

goal (1 subgoal):
 1. \<And>bs. nat_to_bv (bv_to_nat bs) = norm_unsigned bs \<Longrightarrow> nat_to_bv (2 ^ length bs + bv_to_nat bs) = \<one> # bs
[PROOF STEP]
have "bv_to_nat xs = bv_to_nat (norm_unsigned xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bv_to_nat xs = bv_to_nat (norm_unsigned xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bv_to_nat xs = bv_to_nat (norm_unsigned xs)

goal (1 subgoal):
 1. \<And>bs. nat_to_bv (bv_to_nat bs) = norm_unsigned bs \<Longrightarrow> nat_to_bv (2 ^ length bs + bv_to_nat bs) = \<one> # bs
[PROOF STEP]
have "bv_to_nat xs < 2 ^ length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bv_to_nat xs < 2 ^ length xs
[PROOF STEP]
by (rule bv_to_nat_upper_range)
[PROOF STATE]
proof (state)
this:
bv_to_nat xs < 2 ^ length xs

goal (1 subgoal):
 1. \<And>bs. nat_to_bv (bv_to_nat bs) = norm_unsigned bs \<Longrightarrow> nat_to_bv (2 ^ length bs + bv_to_nat bs) = \<one> # bs
[PROOF STEP]
show "nat_to_bv (2 ^ length xs + bv_to_nat xs) = \<one> # xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_bv (2 ^ length xs + bv_to_nat xs) = \<one> # xs
[PROOF STEP]
by (rule nat_helper2)
[PROOF STATE]
proof (state)
this:
nat_to_bv (2 ^ length xs + bv_to_nat xs) = \<one> # xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mangoldt_le:
  assumes "n > 0"
  shows   "mangoldt n \<le> ln n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mangoldt n \<le> ln (real n)
[PROOF STEP]
proof (cases "primepow n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
 2. \<not> primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
primepow n

goal (2 subgoals):
 1. primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
 2. \<not> primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
primepow n
[PROOF STEP]
have "prime (aprimedivisor n)"
[PROOF STATE]
proof (prove)
using this:
primepow n

goal (1 subgoal):
 1. prime (aprimedivisor n)
[PROOF STEP]
by (intro prime_aprimedivisor')
       (auto simp: primepow_def prime_gt_0_nat)
[PROOF STATE]
proof (state)
this:
prime (aprimedivisor n)

goal (2 subgoals):
 1. primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
 2. \<not> primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
[PROOF STEP]
hence gt_1: "aprimedivisor n > 1"
[PROOF STATE]
proof (prove)
using this:
prime (aprimedivisor n)

goal (1 subgoal):
 1. 1 < aprimedivisor n
[PROOF STEP]
by (simp add: prime_gt_Suc_0_nat)
[PROOF STATE]
proof (state)
this:
1 < aprimedivisor n

goal (2 subgoals):
 1. primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
 2. \<not> primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
primepow n
[PROOF STEP]
have "mangoldt n = ln (aprimedivisor n)"
[PROOF STATE]
proof (prove)
using this:
primepow n

goal (1 subgoal):
 1. mangoldt n = ln (real (aprimedivisor n))
[PROOF STEP]
by (simp add: mangoldt_def)
[PROOF STATE]
proof (state)
this:
mangoldt n = ln (real (aprimedivisor n))

goal (2 subgoals):
 1. primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
 2. \<not> primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mangoldt n = ln (real (aprimedivisor n))

goal (2 subgoals):
 1. primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
 2. \<not> primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
[PROOF STEP]
have "\<dots> \<le> ln n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (real (aprimedivisor n)) \<le> ln (real n)
[PROOF STEP]
using True gt_1
[PROOF STATE]
proof (prove)
using this:
primepow n
1 < aprimedivisor n

goal (1 subgoal):
 1. ln (real (aprimedivisor n)) \<le> ln (real n)
[PROOF STEP]
by (subst ln_le_cancel_iff) (auto intro!: Nat.gr0I dvd_imp_le aprimedivisor_dvd')
[PROOF STATE]
proof (state)
this:
ln (real (aprimedivisor n)) \<le> ln (real n)

goal (2 subgoals):
 1. primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
 2. \<not> primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mangoldt n \<le> ln (real n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mangoldt n \<le> ln (real n)

goal (1 subgoal):
 1. mangoldt n \<le> ln (real n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mangoldt n \<le> ln (real n)

goal (1 subgoal):
 1. \<not> primepow n \<Longrightarrow> mangoldt n \<le> ln (real n)
[PROOF STEP]
qed (insert assms, auto simp: mangoldt_def)


[STATEMENT]
lemma oppOrdering_simps [simp]:
  "oppOrdering\<cdot>LT = GT"
  "oppOrdering\<cdot>EQ = EQ"
  "oppOrdering\<cdot>GT = LT"
  "oppOrdering\<cdot>\<bottom> = \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (oppOrdering\<cdot>LT = GT &&& oppOrdering\<cdot>EQ = EQ) &&& oppOrdering\<cdot>GT = LT &&& oppOrdering\<cdot>\<bottom> = \<bottom>
[PROOF STEP]
unfolding oppOrdering_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs_cfun (Rep_cfun (Ordering_case\<cdot>GT\<cdot>EQ\<cdot>LT))\<cdot>LT = GT &&& Abs_cfun (Rep_cfun (Ordering_case\<cdot>GT\<cdot>EQ\<cdot>LT))\<cdot>EQ = EQ) &&& Abs_cfun (Rep_cfun (Ordering_case\<cdot>GT\<cdot>EQ\<cdot>LT))\<cdot>GT = LT &&& Abs_cfun (Rep_cfun (Ordering_case\<cdot>GT\<cdot>EQ\<cdot>LT))\<cdot>\<bottom> = \<bottom>
[PROOF STEP]
by simp_all


[STATEMENT]
lemma mahler_measure_factor[simplified,simp]: "mahler_measure_poly [:- a, 1:] = max 1 (cmod a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure_poly [:- a, 1:] = max 1 (cmod a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure_poly [:- a, 1:] = max 1 (cmod a)
[PROOF STEP]
have main: "complex_roots_complex [:- a, 1:] = [a]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_roots_complex [:- a, 1:] = [a]
[PROOF STEP]
unfolding complex_roots_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME as. Polynomial.smult (lead_coeff [:- a, 1:]) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = [:- a, 1:] \<and> length as = degree [:- a, 1:]) = [a]
[PROOF STEP]
proof (rule some_equality, auto, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>as. \<lbrakk>(\<Prod>a\<leftarrow>as. pCons (- a) 1) = pCons (- a) 1; length as = Suc 0\<rbrakk> \<Longrightarrow> as = [a]
[PROOF STEP]
case (1 as)
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<leftarrow>as. pCons (- a) 1) = pCons (- a) 1
length as = Suc 0

goal (1 subgoal):
 1. \<And>as. \<lbrakk>(\<Prod>a\<leftarrow>as. pCons (- a) 1) = pCons (- a) 1; length as = Suc 0\<rbrakk> \<Longrightarrow> as = [a]
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(\<Prod>a\<leftarrow>as. pCons (- a) 1) = pCons (- a) 1
length as = Suc 0

goal (1 subgoal):
 1. as = [a]
[PROOF STEP]
by (cases as, auto)
[PROOF STATE]
proof (state)
this:
as = [a]

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
complex_roots_complex [:- a, 1:] = [a]

goal (1 subgoal):
 1. mahler_measure_poly [:- a, 1:] = max 1 (cmod a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure_poly [:- a, 1:] = max 1 (cmod a)
[PROOF STEP]
unfolding mahler_measure_poly_def main
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (lead_coeff [:- a, 1:]) * (\<Prod>a\<leftarrow>[a]. max 1 (cmod a)) = max 1 (cmod a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mahler_measure_poly [:- a, 1:] = max 1 (cmod a)

goal:
No subgoals!
[PROOF STEP]
qed