[STATEMENT]
lemma scalar_prod_lincomb_gso:
  assumes k: "k \<le> m"
  shows "sumlist (map (\<lambda> i. g i \<cdot>\<^sub>v gso i) [0 ..< k]) \<bullet> sumlist (map (\<lambda> i. h i \<cdot>\<^sub>v gso i) [0 ..< k])
    = sum_list (map (\<lambda> i. g i * h i * (gso i \<bullet> gso i)) [0 ..< k])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
have id1: "map (\<lambda>i. g i \<cdot>\<^sub>v map (gso) [0..<m] ! i) [0..<k] = map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]" for g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. g i \<cdot>\<^sub>v map gso [0..<length fs] ! i) [0..<k] = map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
k \<le> length fs

goal (1 subgoal):
 1. map (\<lambda>i. g i \<cdot>\<^sub>v map gso [0..<length fs] ! i) [0..<k] = map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. ?g1 i \<cdot>\<^sub>v map gso [0..<length fs] ! i) [0..<k] = map (\<lambda>i. ?g1 i \<cdot>\<^sub>v gso i) [0..<k]

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
have id2: "(\<Sum>i\<leftarrow>[0..<k]. g i * h i * (map (gso) [0..<m] ! i \<bullet> map (gso) [0..<m] ! i))
    = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (map gso [0..<length fs] ! i \<bullet> map gso [0..<length fs] ! i)) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
k \<le> length fs

goal (1 subgoal):
 1. (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (map gso [0..<length fs] ! i \<bullet> map gso [0..<length fs] ! i)) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
by (intro arg_cong[OF map_cong], auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<leftarrow>[0..<k]. g i * h i * (map gso [0..<length fs] ! i \<bullet> map gso [0..<length fs] ! i)) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
define gs where "gs = map (gso) [0..<m]"
[PROOF STATE]
proof (state)
this:
gs = map gso [0..<length fs]

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
have gs_gso: "gs ! i = gso i" if "i < k" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gs ! i = gso i
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
i < k
k \<le> length fs

goal (1 subgoal):
 1. gs ! i = gso i
[PROOF STEP]
unfolding gs_def
[PROOF STATE]
proof (prove)
using this:
i < k
k \<le> length fs

goal (1 subgoal):
 1. map gso [0..<length fs] ! i = gso i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i1 < k \<Longrightarrow> gs ! ?i1 = gso ?i1

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
have "M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k]) =
        (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gs ! i \<bullet> gs ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gs ! i \<bullet> gs ! i))
[PROOF STEP]
unfolding gs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v map gso [0..<length fs] ! i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v map gso [0..<length fs] ! i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (map gso [0..<length fs] ! i \<bullet> map gso [0..<length fs] ! i))
[PROOF STEP]
using  assms  orthogonal_gso
[PROOF STATE]
proof (prove)
using this:
k \<le> length fs
orthogonal (map gso [0..<length fs])

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v map gso [0..<length fs] ! i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v map gso [0..<length fs] ! i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (map gso [0..<length fs] ! i \<bullet> map gso [0..<length fs] ! i))
[PROOF STEP]
by (intro scalar_prod_lincomb_orthogonal) auto
[PROOF STATE]
proof (state)
this:
M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gs ! i \<bullet> gs ! i))

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gs ! i \<bullet> gs ! i))

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
have "map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]
[PROOF STEP]
using gs_gso
[PROOF STATE]
proof (prove)
using this:
?i1 < k \<Longrightarrow> gs ! ?i1 = gso ?i1

goal (1 subgoal):
 1. map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]
[PROOF STEP]
by (intro map_cong) (auto)
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. g i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
have "map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]
[PROOF STEP]
using gs_gso
[PROOF STATE]
proof (prove)
using this:
?i1 < k \<Longrightarrow> gs ! ?i1 = gso ?i1

goal (1 subgoal):
 1. map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]
[PROOF STEP]
by (intro map_cong) (auto)
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. h i \<cdot>\<^sub>v gs ! i) [0..<k] = map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
have "map (\<lambda>i. g i * h i * (gs ! i \<bullet> gs ! i)) [0..<k] = map (\<lambda>i. g i * h i * (gso i \<bullet> gso i)) [0..<k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. g i * h i * (gs ! i \<bullet> gs ! i)) [0..<k] = map (\<lambda>i. g i * h i * (gso i \<bullet> gso i)) [0..<k]
[PROOF STEP]
using gs_gso
[PROOF STATE]
proof (prove)
using this:
?i1 < k \<Longrightarrow> gs ! ?i1 = gso ?i1

goal (1 subgoal):
 1. map (\<lambda>i. g i * h i * (gs ! i \<bullet> gs ! i)) [0..<k] = map (\<lambda>i. g i * h i * (gso i \<bullet> gso i)) [0..<k]
[PROOF STEP]
by (intro map_cong) (auto)
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. g i * h i * (gs ! i \<bullet> gs ! i)) [0..<k] = map (\<lambda>i. g i * h i * (gso i \<bullet> gso i)) [0..<k]

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))

goal (1 subgoal):
 1. M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
M.sumlist (map (\<lambda>i. g i \<cdot>\<^sub>v gso i) [0..<k]) \<bullet> M.sumlist (map (\<lambda>i. h i \<cdot>\<^sub>v gso i) [0..<k]) = (\<Sum>i\<leftarrow>[0..<k]. g i * h i * (gso i \<bullet> gso i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma resultant_1[simp]:
  fixes p :: "'a :: comm_ring_1 poly"
  shows "resultant 1 p = 1" "resultant p 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant 1 p = (1::'a) &&& resultant p 1 = (1::'a)
[PROOF STEP]
using resultant_const(1) [of 1 p] resultant_const(2) [of p 1]
[PROOF STATE]
proof (prove)
using this:
resultant [:1::'a:] p = (1::'a) ^ degree p
resultant p [:1::'a:] = (1::'a) ^ degree p

goal (1 subgoal):
 1. resultant 1 p = (1::'a) &&& resultant p 1 = (1::'a)
[PROOF STEP]
by (auto simp add: pCons_one)


[STATEMENT]
lemma no_solution_0_fst_int [simp]: "\<not>solution (0, b :: int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> solution (0, b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> solution (0, b)
[PROOF STEP]
have "1 + int D * b\<^sup>2 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + int D * b\<^sup>2
[PROOF STEP]
by (intro add_pos_nonneg) auto
[PROOF STATE]
proof (state)
this:
0 < 1 + int D * b\<^sup>2

goal (1 subgoal):
 1. \<not> solution (0, b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < 1 + int D * b\<^sup>2

goal (1 subgoal):
 1. \<not> solution (0, b)
[PROOF STEP]
by (auto simp add: solution_def)
[PROOF STATE]
proof (state)
this:
\<not> solution (0, b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_block_size_sum_alt:
  fixes M :: "'a :: {ring_1} mat"
  shows "elements_mat M \<subseteq> {0, 1} \<Longrightarrow> j < dim_col M \<Longrightarrow> of_nat (mat_block_size M j) = sum_vec (col M j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>elements_mat M \<subseteq> {0::'a, 1::'a}; j < dim_col M\<rbrakk> \<Longrightarrow> of_nat (mat_block_size M j) = sum_vec (col M j)
[PROOF STEP]
unfolding mat_block_size_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>elements_mat M \<subseteq> {0::'a, 1::'a}; j < dim_col M\<rbrakk> \<Longrightarrow> of_nat (count_vec (col M j) (1::'a)) = sum_vec (col M j)
[PROOF STEP]
using count_vec_sum_ones_alt col_elems_subset_mat subset_trans
[PROOF STATE]
proof (prove)
using this:
set\<^sub>v ?v \<subseteq> {0::?'a, 1::?'a} \<Longrightarrow> of_nat (count_vec ?v (1::?'a)) = sum_vec ?v
?i < dim_col ?N \<Longrightarrow> set\<^sub>v (col ?N ?i) \<subseteq> elements_mat ?N
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> ?C\<rbrakk> \<Longrightarrow> ?A \<subseteq> ?C

goal (1 subgoal):
 1. \<lbrakk>elements_mat M \<subseteq> {0::'a, 1::'a}; j < dim_col M\<rbrakk> \<Longrightarrow> of_nat (count_vec (col M j) (1::'a)) = sum_vec (col M j)
[PROOF STEP]
by metis


[STATEMENT]
lemma vars_vec_append_subset: "vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n+dim_vec v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}
[PROOF STEP]
let ?p = "(vec_to_lpoly (0\<^sub>v n @\<^sub>v v))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}
[PROOF STEP]
have "dim_poly ?p \<le> n+dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_poly (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<le> n + dim_vec v
[PROOF STEP]
using dim_poly_of_append_vec[of "0\<^sub>v n" "v"]
[PROOF STATE]
proof (prove)
using this:
dim_poly (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<le> dim_vec (0\<^sub>v n) + dim_vec v

goal (1 subgoal):
 1. dim_poly (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<le> n + dim_vec v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_poly (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<le> n + dim_vec v

goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}
[PROOF STEP]
have "vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {0..<n+dim_vec v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {0..<n + dim_vec v}
[PROOF STEP]
using vars_subset_dim_vec_to_lpoly_dim[of "(0\<^sub>v n @\<^sub>v v)"]
[PROOF STATE]
proof (prove)
using this:
vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {0..<dim_vec (0\<^sub>v n @\<^sub>v v)}

goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {0..<n + dim_vec v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {0..<n + dim_vec v}

goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {0..<n + dim_vec v}

goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}
[PROOF STEP]
have "\<forall>i < n. coeff ?p i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<n. Abstract_Linear_Poly.coeff (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) i = 0
[PROOF STEP]
using vec_coeff_append1[of _ "0\<^sub>v n" v]
[PROOF STATE]
proof (prove)
using this:
?i \<in> {0..<dim_vec (0\<^sub>v n)} \<Longrightarrow> Abstract_Linear_Poly.coeff (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) ?i = 0\<^sub>v n $ ?i

goal (1 subgoal):
 1. \<forall>i<n. Abstract_Linear_Poly.coeff (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) i = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<n. Abstract_Linear_Poly.coeff (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) i = 0

goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {0..<n + dim_vec v}
\<forall>i<n. Abstract_Linear_Poly.coeff (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) i = 0
[PROOF STEP]
show "vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n+dim_vec v}"
[PROOF STATE]
proof (prove)
using this:
vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {0..<n + dim_vec v}
\<forall>i<n. Abstract_Linear_Poly.coeff (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) i = 0

goal (1 subgoal):
 1. vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}
[PROOF STEP]
by (meson atLeastLessThan_iff coeff_zero not_le subsetCE subsetI)
[PROOF STATE]
proof (state)
this:
vars (vec_to_lpoly (0\<^sub>v n @\<^sub>v v)) \<subseteq> {n..<n + dim_vec v}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mem_rel_interior_cball:
  "x \<in> rel_interior S \<longleftrightarrow> x \<in> S \<and> (\<exists>e. e > 0 \<and> cball x e \<inter> affine hull S \<subseteq> S)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> rel_interior S) = (x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> rel_interior S \<Longrightarrow> x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S)
 2. x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S) \<Longrightarrow> x \<in> rel_interior S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S)

goal (2 subgoals):
 1. x \<in> rel_interior S \<Longrightarrow> x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S)
 2. x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S) \<Longrightarrow> x \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S)
[PROOF STEP]
obtain e where "x \<in> S" "e > 0" "cball x e \<inter> affine hull S \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S)

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>x \<in> S; 0 < e; cball x e \<inter> affine hull S \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: rel_interior)
[PROOF STATE]
proof (state)
this:
x \<in> S
0 < e
cball x e \<inter> affine hull S \<subseteq> S

goal (2 subgoals):
 1. x \<in> rel_interior S \<Longrightarrow> x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S)
 2. x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S) \<Longrightarrow> x \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
0 < e
cball x e \<inter> affine hull S \<subseteq> S
[PROOF STEP]
have "ball x e \<inter> affine hull S \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
x \<in> S
0 < e
cball x e \<inter> affine hull S \<subseteq> S

goal (1 subgoal):
 1. ball x e \<inter> affine hull S \<subseteq> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball x e \<inter> affine hull S \<subseteq> S

goal (2 subgoals):
 1. x \<in> rel_interior S \<Longrightarrow> x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S)
 2. x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S) \<Longrightarrow> x \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball x e \<inter> affine hull S \<subseteq> S
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
ball x e \<inter> affine hull S \<subseteq> S

goal (1 subgoal):
 1. x \<in> rel_interior S
[PROOF STEP]
using \<open>0 < e\<close> \<open>x \<in> S\<close> rel_interior_ball
[PROOF STATE]
proof (prove)
using this:
ball x e \<inter> affine hull S \<subseteq> S
0 < e
x \<in> S
rel_interior ?S = {x \<in> ?S. \<exists>e>0. ball x e \<inter> affine hull ?S \<subseteq> ?S}

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

goal (1 subgoal):
 1. x \<in> rel_interior S \<Longrightarrow> x \<in> S \<and> (\<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S)
[PROOF STEP]
qed (force simp: rel_interior open_contains_cball)


[STATEMENT]
lemma perm_comp:
  assumes f: "f \<in> perm" and g: "g \<in> perm"
  shows "(f \<circ> g) \<in> perm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> g \<in> perm
[PROOF STEP]
apply (rule permI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. bij (f \<circ> g)
 2. \<forall>\<^sub>\<infinity>x. (f \<circ> g) x = x
 3. \<And>a. sort_of ((f \<circ> g) a) = sort_of a
[PROOF STEP]
apply (rule bij_comp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. bij g
 2. bij f
 3. \<forall>\<^sub>\<infinity>x. (f \<circ> g) x = x
 4. \<And>a. sort_of ((f \<circ> g) a) = sort_of a
[PROOF STEP]
apply (rule perm_is_bij [OF g])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. bij f
 2. \<forall>\<^sub>\<infinity>x. (f \<circ> g) x = x
 3. \<And>a. sort_of ((f \<circ> g) a) = sort_of a
[PROOF STEP]
apply (rule perm_is_bij [OF f])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>\<^sub>\<infinity>x. (f \<circ> g) x = x
 2. \<And>a. sort_of ((f \<circ> g) a) = sort_of a
[PROOF STEP]
apply (rule MOST_rev_mp [OF perm_MOST [OF g]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>\<^sub>\<infinity>x. g x = x \<longrightarrow> (f \<circ> g) x = x
 2. \<And>a. sort_of ((f \<circ> g) a) = sort_of a
[PROOF STEP]
apply (rule MOST_rev_mp [OF perm_MOST [OF f]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>\<^sub>\<infinity>x. f x = x \<longrightarrow> g x = x \<longrightarrow> (f \<circ> g) x = x
 2. \<And>a. sort_of ((f \<circ> g) a) = sort_of a
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. sort_of ((f \<circ> g) a) = sort_of a
[PROOF STEP]
apply (simp add: perm_is_sort_respecting [OF f])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. sort_of (g a) = sort_of a
[PROOF STEP]
apply (simp add: perm_is_sort_respecting [OF g])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem join_commute: "x \<squnion> y = y \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y = y \<squnion> x
[PROOF STEP]
proof (rule joinI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x \<sqsubseteq> y \<squnion> x
 2. y \<sqsubseteq> y \<squnion> x
 3. \<And>z. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<squnion> x \<sqsubseteq> z
[PROOF STEP]
show "x \<sqsubseteq> y \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> y \<squnion> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> y \<squnion> x

goal (2 subgoals):
 1. y \<sqsubseteq> y \<squnion> x
 2. \<And>z. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<squnion> x \<sqsubseteq> z
[PROOF STEP]
show "y \<sqsubseteq> y \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqsubseteq> y \<squnion> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqsubseteq> y \<squnion> x

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<squnion> x \<sqsubseteq> z
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<squnion> x \<sqsubseteq> z
[PROOF STEP]
assume "y \<sqsubseteq> z" and "x \<sqsubseteq> z"
[PROOF STATE]
proof (state)
this:
y \<sqsubseteq> z
x \<sqsubseteq> z

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> z\<rbrakk> \<Longrightarrow> y \<squnion> x \<sqsubseteq> z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<sqsubseteq> z
x \<sqsubseteq> z
[PROOF STEP]
show "y \<squnion> x \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
using this:
y \<sqsubseteq> z
x \<sqsubseteq> z

goal (1 subgoal):
 1. y \<squnion> x \<sqsubseteq> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<squnion> x \<sqsubseteq> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_nonneg_add [eventually_nonzero_simps]:
  assumes "eventually_nonneg F f" "eventually_nonneg F g"
  shows   "eventually_nonneg F (\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x + g x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
eventually_nonneg F f
eventually_nonneg F g

goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x + g x)
[PROOF STEP]
unfolding eventually_nonneg_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. (0::'b) \<le> f x
\<forall>\<^sub>F x in F. (0::'b) \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. (0::'b) \<le> f x + g x
[PROOF STEP]
by eventually_elim simp


[STATEMENT]
lemma lUnionM_append [simp]: "lUnionM (A @ B) = lunionM (lUnionM A) (lUnionM B)" for A B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lUnionM (A @ B) = lunionM (lUnionM A) (lUnionM B)
[PROOF STEP]
by(subst lunionM_lUnionM1)(simp add: lUnionM_def)


[STATEMENT]
lemma lemma_2_5_16: "(a l\<rightarrow> b) \<le>  (b l\<rightarrow> c) r\<rightarrow> (a l\<rightarrow> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a l\<rightarrow> b \<le> (b l\<rightarrow> c) r\<rightarrow> a l\<rightarrow> c
[PROOF STEP]
apply (simp add: right_residual [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b l\<rightarrow> c) * (a l\<rightarrow> b) \<le> a l\<rightarrow> c
[PROOF STEP]
by (rule lemma_2_5_14)


[STATEMENT]
lemma t_eq_imp_bij_func:
  assumes "t xs = t ys"
  shows "\<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
t xs = t ys
[PROOF STEP]
have \<open>mset xs = mset ys\<close>
[PROOF STATE]
proof (prove)
using this:
t xs = t ys

goal (1 subgoal):
 1. mset xs = mset ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t xs = t ys
t xs = t ys

goal (1 subgoal):
 1. mset xs = mset ys
[PROOF STEP]
by (simp add: fun_eq_iff t_def multiset_eq_iff flip: count_mset)
[PROOF STATE]
proof (state)
this:
mset xs = mset ys

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mset xs = mset ys
[PROOF STEP]
obtain p where \<open>p permutes {..<length ys}\<close> \<open>permute_list p ys = xs\<close>
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule mset_eq_permutation)
[PROOF STATE]
proof (state)
this:
p permutes {..<length ys}
permute_list p ys = xs

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p permutes {..<length ys}
permute_list p ys = xs
[PROOF STEP]
have \<open>bij_betw p {..<length xs} {..<length ys}\<close> \<open>\<forall>i<length xs. xs ! i = ys ! p i\<close>
[PROOF STATE]
proof (prove)
using this:
p permutes {..<length ys}
permute_list p ys = xs

goal (1 subgoal):
 1. bij_betw p {..<length xs} {..<length ys} &&& \<forall>i<length xs. xs ! i = ys ! p i
[PROOF STEP]
by (auto dest: permutes_imp_bij simp add: permute_list_nth)
[PROOF STATE]
proof (state)
this:
bij_betw p {..<length xs} {..<length ys}
\<forall>i<length xs. xs ! i = ys ! p i

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw p {..<length xs} {..<length ys}
\<forall>i<length xs. xs ! i = ys ! p i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw p {..<length xs} {..<length ys}
\<forall>i<length xs. xs ! i = ys ! p i

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permutes_sum:
  assumes p: "p permutes S"
  shows "(\<Sum>s\<in>S. f (p s) s) = (\<Sum>s\<in>S. f s (inv p s))"
    (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>s\<in>S. f (p s) s) = (\<Sum>s\<in>S. f s (inv p s))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p permutes S

goal (1 subgoal):
 1. (\<Sum>s\<in>S. f (p s) s) = (\<Sum>s\<in>S. f s (inv p s))
[PROOF STEP]
by (fact sum.permutes_inv)


[STATEMENT]
theorem (in prob_space) central_limit_theorem:
  fixes X :: "nat \<Rightarrow> 'a \<Rightarrow> real"
    and \<mu> :: "real measure"
    and \<sigma> :: real
    and S :: "nat \<Rightarrow> 'a \<Rightarrow> real"
  assumes X_indep: "indep_vars (\<lambda>i. borel) X UNIV"
    and X_mean: "\<And>n. expectation (X n) = m"
    and \<sigma>_pos: "\<sigma> > 0"
    and X_square_integrable: "\<And>n. integrable M (\<lambda>x. (X n x)\<^sup>2)"
    and X_variance: "\<And>n. variance (X n) = \<sigma>\<^sup>2"
    and X_distrib: "\<And>n. distr M borel (X n) = \<mu>"
  defines "X' i x \<equiv> X i x - m"
  shows "weak_conv_m (\<lambda>n. distr M borel (\<lambda>x. (\<Sum>i<n. X' i x) / sqrt (n*\<sigma>\<^sup>2))) std_normal_distribution"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weak_conv_m (\<lambda>n. distr M borel (\<lambda>x. (\<Sum>i<n. X' i x) / sqrt (real n * \<sigma>\<^sup>2))) std_normal_distribution
[PROOF STEP]
proof (intro central_limit_theorem_zero_mean)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. indep_vars (\<lambda>i. borel) X' UNIV
 2. \<And>n. expectation (X' n) = 0
 3. 0 < \<sigma>
 4. \<And>n. integrable M (\<lambda>x. (X' n x)\<^sup>2)
 5. \<And>n. expectation (\<lambda>x. (X' n x - expectation (X' n))\<^sup>2) = \<sigma>\<^sup>2
 6. \<And>n. distr M borel (X' n) = ?\<mu>
[PROOF STEP]
show "indep_vars (\<lambda>i. borel) X' UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>i. borel) X' UNIV
[PROOF STEP]
unfolding X'_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>i. borel) (\<lambda>i x. X i x - m) UNIV
[PROOF STEP]
using X_indep
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>i. borel) X UNIV

goal (1 subgoal):
 1. indep_vars (\<lambda>i. borel) (\<lambda>i x. X i x - m) UNIV
[PROOF STEP]
by (rule indep_vars_compose2) auto
[PROOF STATE]
proof (state)
this:
indep_vars (\<lambda>i. borel) X' UNIV

goal (5 subgoals):
 1. \<And>n. expectation (X' n) = 0
 2. 0 < \<sigma>
 3. \<And>n. integrable M (\<lambda>x. (X' n x)\<^sup>2)
 4. \<And>n. expectation (\<lambda>x. (X' n x - expectation (X' n))\<^sup>2) = \<sigma>\<^sup>2
 5. \<And>n. distr M borel (X' n) = ?\<mu>
[PROOF STEP]
have X_rv [simp, measurable]: "random_variable borel (X n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. random_variable borel (X n)
[PROOF STEP]
using X_indep
[PROOF STATE]
proof (prove)
using this:
indep_vars (\<lambda>i. borel) X UNIV

goal (1 subgoal):
 1. random_variable borel (X n)
[PROOF STEP]
unfolding indep_vars_def2
[PROOF STATE]
proof (prove)
using this:
(\<forall>i\<in>UNIV. random_variable borel (X i)) \<and> indep_sets (\<lambda>i. {X i -` A \<inter> space M |A. A \<in> sets borel}) UNIV

goal (1 subgoal):
 1. random_variable borel (X n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
random_variable borel (X ?n12)

goal (5 subgoals):
 1. \<And>n. expectation (X' n) = 0
 2. 0 < \<sigma>
 3. \<And>n. integrable M (\<lambda>x. (X' n x)\<^sup>2)
 4. \<And>n. expectation (\<lambda>x. (X' n x - expectation (X' n))\<^sup>2) = \<sigma>\<^sup>2
 5. \<And>n. distr M borel (X' n) = ?\<mu>
[PROOF STEP]
have X_integrable [simp, intro]: "integrable M (X n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (X n)
[PROOF STEP]
by (rule square_integrable_imp_integrable[OF _ X_square_integrable]) simp_all
[PROOF STATE]
proof (state)
this:
integrable M (X ?n12)

goal (5 subgoals):
 1. \<And>n. expectation (X' n) = 0
 2. 0 < \<sigma>
 3. \<And>n. integrable M (\<lambda>x. (X' n x)\<^sup>2)
 4. \<And>n. expectation (\<lambda>x. (X' n x - expectation (X' n))\<^sup>2) = \<sigma>\<^sup>2
 5. \<And>n. distr M borel (X' n) = ?\<mu>
[PROOF STEP]
show "expectation (X' n) = 0" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (X' n) = 0
[PROOF STEP]
using X_mean
[PROOF STATE]
proof (prove)
using this:
expectation (X ?n12) = m

goal (1 subgoal):
 1. expectation (X' n) = 0
[PROOF STEP]
by (auto simp: X'_def[abs_def] prob_space)
[PROOF STATE]
proof (state)
this:
expectation (X' ?n12) = 0

goal (4 subgoals):
 1. 0 < \<sigma>
 2. \<And>n. integrable M (\<lambda>x. (X' n x)\<^sup>2)
 3. \<And>n. expectation (\<lambda>x. (X' n x - expectation (X' n))\<^sup>2) = \<sigma>\<^sup>2
 4. \<And>n. distr M borel (X' n) = ?\<mu>
[PROOF STEP]
show "\<sigma> > 0" "integrable M (\<lambda>x. (X' n x)\<^sup>2)" "variance (X' n) = \<sigma>\<^sup>2" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<sigma> &&& integrable M (\<lambda>x. (X' n x)\<^sup>2) &&& expectation (\<lambda>x. (X' n x - expectation (X' n))\<^sup>2) = \<sigma>\<^sup>2
[PROOF STEP]
using \<open>0 < \<sigma>\<close> X_integrable X_mean X_square_integrable X_variance
[PROOF STATE]
proof (prove)
using this:
0 < \<sigma>
integrable M (X ?n12)
expectation (X ?n12) = m
integrable M (\<lambda>x. (X ?n12 x)\<^sup>2)
expectation (\<lambda>x. (X ?n12 x - expectation (X ?n12))\<^sup>2) = \<sigma>\<^sup>2

goal (1 subgoal):
 1. 0 < \<sigma> &&& integrable M (\<lambda>x. (X' n x)\<^sup>2) &&& expectation (\<lambda>x. (X' n x - expectation (X' n))\<^sup>2) = \<sigma>\<^sup>2
[PROOF STEP]
unfolding X'_def
[PROOF STATE]
proof (prove)
using this:
0 < \<sigma>
integrable M (X ?n12)
expectation (X ?n12) = m
integrable M (\<lambda>x. (X ?n12 x)\<^sup>2)
expectation (\<lambda>x. (X ?n12 x - expectation (X ?n12))\<^sup>2) = \<sigma>\<^sup>2

goal (1 subgoal):
 1. 0 < \<sigma> &&& integrable M (\<lambda>x. (X n x - m)\<^sup>2) &&& expectation (\<lambda>x. (X n x - m - expectation (\<lambda>x. X n x - m))\<^sup>2) = \<sigma>\<^sup>2
[PROOF STEP]
by (auto simp: prob_space power2_diff)
[PROOF STATE]
proof (state)
this:
0 < \<sigma>
integrable M (\<lambda>x. (X' ?n12 x)\<^sup>2)
expectation (\<lambda>x. (X' ?n12 x - expectation (X' ?n12))\<^sup>2) = \<sigma>\<^sup>2

goal (1 subgoal):
 1. \<And>n. distr M borel (X' n) = ?\<mu>
[PROOF STEP]
show "distr M borel (X' n) = distr \<mu> borel (\<lambda>x. x - m)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr M borel (X' n) = distr \<mu> borel (\<lambda>x. x - m)
[PROOF STEP]
unfolding X_distrib[of n, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr M borel (X' n) = distr (distr M borel (X n)) borel (\<lambda>x. x - m)
[PROOF STEP]
using X_integrable
[PROOF STATE]
proof (prove)
using this:
integrable M (X ?n12)

goal (1 subgoal):
 1. distr M borel (X' n) = distr (distr M borel (X n)) borel (\<lambda>x. x - m)
[PROOF STEP]
by (subst distr_distr) (auto simp: X'_def[abs_def] comp_def)
[PROOF STATE]
proof (state)
this:
distr M borel (X' ?n12) = distr \<mu> borel (\<lambda>x. x - m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<exists>(x::'a::linordered_field) z. \<forall>w \<ge> 13 * x - 4 * z. \<exists>y. w \<ge> \<bar>x\<bar> + \<bar>y\<bar> + z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x z. \<forall>w\<ge>(13::'a) * x - (4::'a) * z. \<exists>y. \<bar>x\<bar> + \<bar>y\<bar> + z \<le> w
[PROOF STEP]
by ferrack


[STATEMENT]
lemma numeral_5_eq_5:"5 = Suc (Suc (Suc (Suc (Suc 0))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 5 = Suc (Suc (Suc (Suc (Suc 0))))
[PROOF STEP]
by simp


[STATEMENT]
lemma mset_concat_map_cons:
  "mset (concat (map (\<lambda>c. F c # G c) S)) = mset (map F S) + mset (concat (map G S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (concat (map (\<lambda>c. F c # G c) S)) = mset (map F S) + mset (concat (map G S))
[PROOF STEP]
by(induction S; simp add: add_mset_commute)


[STATEMENT]
lemma binomial_fact:
  assumes kn: "k \<le> n"
  shows "(of_nat (n choose k) :: 'a::field_char_0) = fact n / (fact k * fact (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (n choose k) = fact n / (fact k * fact (n - k))
[PROOF STEP]
using binomial_fact_lemma[OF kn]
[PROOF STATE]
proof (prove)
using this:
fact k * fact (n - k) * (n choose k) = fact n

goal (1 subgoal):
 1. of_nat (n choose k) = fact n / (fact k * fact (n - k))
[PROOF STEP]
by (metis (mono_tags, lifting) fact_nonzero mult_eq_0_iff nonzero_mult_div_cancel_left of_nat_fact of_nat_mult)


[STATEMENT]
lemma dist_fs_triangle_finite:
  shows "cmod(a - b) / (sqrt (1+(cmod a)\<^sup>2) * sqrt (1+(cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1+(cmod a)\<^sup>2) * sqrt (1+(cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1+(cmod b)\<^sup>2) * sqrt (1+(cmod c)\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
let ?cc = "1+(cmod c)\<^sup>2" and ?bb = "1+(cmod b)\<^sup>2" and ?aa = "1+(cmod a)\<^sup>2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
have "sqrt ?cc > 0" "sqrt ?aa > 0" "sqrt ?bb > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sqrt (1 + (cmod c)\<^sup>2) &&& 0 < sqrt (1 + (cmod a)\<^sup>2) &&& 0 < sqrt (1 + (cmod b)\<^sup>2)
[PROOF STEP]
by (smt real_sqrt_gt_zero zero_compare_simps(12))+
[PROOF STATE]
proof (state)
this:
0 < sqrt (1 + (cmod c)\<^sup>2)
0 < sqrt (1 + (cmod a)\<^sup>2)
0 < sqrt (1 + (cmod b)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
have "(a - b)*(1+cnj c*c) = (a-c)*(1+cnj c*b) + (c-b)*(1 + cnj c*a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - b) * (1 + cnj c * c) = (a - c) * (1 + cnj c * b) + (c - b) * (1 + cnj c * a)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(a - b) * (1 + cnj c * c) = (a - c) * (1 + cnj c * b) + (c - b) * (1 + cnj c * a)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a - b) * (1 + cnj c * c) = (a - c) * (1 + cnj c * b) + (c - b) * (1 + cnj c * a)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
have "1 + cnj c * c = 1 + (cmod c)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + cnj c * c = cor (1 + (cmod c)\<^sup>2)
[PROOF STEP]
using complex_norm_square
[PROOF STATE]
proof (prove)
using this:
cor ((cmod ?z)\<^sup>2) = ?z * cnj ?z

goal (1 subgoal):
 1. 1 + cnj c * c = cor (1 + (cmod c)\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 + cnj c * c = cor (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
hence "cmod ((a - b)*(1+cnj c*c)) = cmod(a - b) * (1+(cmod c)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
1 + cnj c * c = cor (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. cmod ((a - b) * (1 + cnj c * c)) = cmod (a - b) * (1 + (cmod c)\<^sup>2)
[PROOF STEP]
by (smt norm_mult norm_of_real zero_compare_simps(12))
[PROOF STATE]
proof (state)
this:
cmod ((a - b) * (1 + cnj c * c)) = cmod (a - b) * (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a - b) * (1 + cnj c * c) = (a - c) * (1 + cnj c * b) + (c - b) * (1 + cnj c * a)
cmod ((a - b) * (1 + cnj c * c)) = cmod (a - b) * (1 + (cmod c)\<^sup>2)
[PROOF STEP]
have "cmod(a - b) * (1+(cmod c)\<^sup>2) \<le> cmod (a-c) * cmod (1+cnj c*b) + cmod (c-b) * cmod(1 + cnj c*a)"
[PROOF STATE]
proof (prove)
using this:
(a - b) * (1 + cnj c * c) = (a - c) * (1 + cnj c * b) + (c - b) * (1 + cnj c * a)
cmod ((a - b) * (1 + cnj c * c)) = cmod (a - b) * (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a)
[PROOF STEP]
using complex_mod_triangle_ineq2[of "(a-c)*(1+cnj c*b)" "(c-b)*(1 + cnj c*a)"]
[PROOF STATE]
proof (prove)
using this:
(a - b) * (1 + cnj c * c) = (a - c) * (1 + cnj c * b) + (c - b) * (1 + cnj c * a)
cmod ((a - b) * (1 + cnj c * c)) = cmod (a - b) * (1 + (cmod c)\<^sup>2)
cmod ((a - c) * (1 + cnj c * b) + (c - b) * (1 + cnj c * a)) - cmod ((a - c) * (1 + cnj c * b)) \<le> cmod ((c - b) * (1 + cnj c * a))

goal (1 subgoal):
 1. cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a)
[PROOF STEP]
by (simp add: norm_mult)
[PROOF STATE]
proof (state)
this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
have *: "\<And> a b c d b' d'. \<lbrakk>b \<le> b'; d \<le> d'; a \<ge> (0::real); c \<ge> 0\<rbrakk> \<Longrightarrow> a*b + c*d \<le> a*b' + c*d'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c d b' d'. \<lbrakk>b \<le> b'; d \<le> d'; 0 \<le> a; 0 \<le> c\<rbrakk> \<Longrightarrow> a * b + c * d \<le> a * b' + c * d'
[PROOF STEP]
by (simp add: add_mono_thms_linordered_semiring(1) mult_left_mono)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b \<le> ?b'; ?d \<le> ?d'; 0 \<le> ?a; 0 \<le> ?c\<rbrakk> \<Longrightarrow> ?a * ?b + ?c * ?d \<le> ?a * ?b' + ?c * ?d'

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
have "cmod (a-c) * cmod (1+cnj c*b) + cmod (c-b) * cmod(1 + cnj c*a) \<le> cmod (a - c) * (sqrt (1+(cmod c)\<^sup>2) * sqrt (1+(cmod b)\<^sup>2)) + cmod (c - b) * (sqrt (1+(cmod c)\<^sup>2) * sqrt (1+(cmod a)\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a) \<le> cmod (a - c) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) + cmod (c - b) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2))
[PROOF STEP]
using *[OF cmod_1_plus_mult_le[of "cnj c" b] cmod_1_plus_mult_le[of "cnj c" a], of "cmod (a-c)" "cmod (c-b)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> cmod (a - c); 0 \<le> cmod (c - b)\<rbrakk> \<Longrightarrow> cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a) \<le> cmod (a - c) * sqrt ((1 + (cmod (cnj c))\<^sup>2) * (1 + (cmod b)\<^sup>2)) + cmod (c - b) * sqrt ((1 + (cmod (cnj c))\<^sup>2) * (1 + (cmod a)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a) \<le> cmod (a - c) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) + cmod (c - b) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2))
[PROOF STEP]
by (simp add: field_simps real_sqrt_mult[symmetric])
[PROOF STATE]
proof (state)
this:
cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a) \<le> cmod (a - c) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) + cmod (c - b) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a)
cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a) \<le> cmod (a - c) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) + cmod (c - b) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2))
[PROOF STEP]
have "cmod(a - b) * ?cc \<le> cmod (a - c) * sqrt ?cc * sqrt ?bb + cmod (c - b) * sqrt ?cc * sqrt ?aa"
[PROOF STATE]
proof (prove)
using this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a)
cmod (a - c) * cmod (1 + cnj c * b) + cmod (c - b) * cmod (1 + cnj c * a) \<le> cmod (a - c) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) + cmod (c - b) * (sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
hence "0 \<le> ?cc * sqrt ?aa * sqrt ?bb"
[PROOF STATE]
proof (prove)
using this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)

goal (1 subgoal):
 1. 0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)
[PROOF STEP]
using mult_right_mono[of 0 "sqrt ?aa"  "sqrt ?bb"]
[PROOF STATE]
proof (prove)
using this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)
\<lbrakk>0 \<le> sqrt (1 + (cmod a)\<^sup>2); 0 \<le> sqrt (1 + (cmod b)\<^sup>2)\<rbrakk> \<Longrightarrow> 0 * sqrt (1 + (cmod b)\<^sup>2) \<le> sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)

goal (1 subgoal):
 1. 0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)
[PROOF STEP]
using mult_right_mono[of 0 "?cc" "sqrt ?aa * sqrt ?bb"]
[PROOF STATE]
proof (prove)
using this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)
\<lbrakk>0 \<le> sqrt (1 + (cmod a)\<^sup>2); 0 \<le> sqrt (1 + (cmod b)\<^sup>2)\<rbrakk> \<Longrightarrow> 0 * sqrt (1 + (cmod b)\<^sup>2) \<le> sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)
\<lbrakk>0 \<le> 1 + (cmod c)\<^sup>2; 0 \<le> sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)\<rbrakk> \<Longrightarrow> 0 * (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> (1 + (cmod c)\<^sup>2) * (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2))

goal (1 subgoal):
 1. 0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
have "sqrt ?cc / ?cc = 1 / sqrt ?cc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)
[PROOF STEP]
using \<open>sqrt ?cc > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < sqrt (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
hence "sqrt ?cc / (?cc * sqrt ?aa) = 1 / (sqrt ?aa * sqrt ?cc)"
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = 1 / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
using times_divide_eq_right[of "1/sqrt ?aa" "sqrt ?cc" "?cc"]
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)
1 / sqrt (1 + (cmod a)\<^sup>2) * (sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2)) = 1 / sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = 1 / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
using \<open>sqrt ?aa > 0\<close>
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)
1 / sqrt (1 + (cmod a)\<^sup>2) * (sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2)) = 1 / sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2)
0 < sqrt (1 + (cmod a)\<^sup>2)

goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = 1 / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = 1 / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
hence "cmod (a - c) * sqrt ?cc / (?cc * sqrt ?aa) = cmod (a - c) / (sqrt ?aa * sqrt ?cc)"
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = 1 / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
using times_divide_eq_right[of "cmod (a - c)" "sqrt ?cc" "(?cc * sqrt ?aa)"]
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = 1 / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
cmod (a - c) * (sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2))) = cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
have "sqrt ?cc / ?cc = 1 / sqrt ?cc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)
[PROOF STEP]
using \<open>sqrt ?cc > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < sqrt (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
hence "sqrt ?cc / (?cc * sqrt ?bb) = 1 / (sqrt ?bb * sqrt ?cc)"
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = 1 / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
using times_divide_eq_right[of "1/sqrt ?bb" "sqrt ?cc" "?cc"]
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)
1 / sqrt (1 + (cmod b)\<^sup>2) * (sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2)) = 1 / sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = 1 / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
using \<open>sqrt ?bb > 0\<close>
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2) = 1 / sqrt (1 + (cmod c)\<^sup>2)
1 / sqrt (1 + (cmod b)\<^sup>2) * (sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2)) = 1 / sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2) / (1 + (cmod c)\<^sup>2)
0 < sqrt (1 + (cmod b)\<^sup>2)

goal (1 subgoal):
 1. sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = 1 / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = 1 / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
hence "cmod (c - b) * sqrt ?cc / (?cc * sqrt ?bb) = cmod (c - b) / (sqrt ?bb * sqrt ?cc)"
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = 1 / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal (1 subgoal):
 1. cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
using times_divide_eq_right[of "cmod (c - b)" "sqrt ?cc" "?cc * sqrt ?bb"]
[PROOF STATE]
proof (prove)
using this:
sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = 1 / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
cmod (c - b) * (sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2))) = cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2))

goal (1 subgoal):
 1. cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)
0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)
cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)
0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)
cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
using divide_right_mono[of "cmod (a - b) * ?cc" "cmod (a - c) * sqrt ?cc * sqrt ?bb + cmod (c - b) * sqrt ?cc * sqrt ?aa" "?cc * sqrt ?aa * sqrt ?bb"] \<open>sqrt ?aa > 0\<close> \<open>sqrt ?bb > 0\<close> \<open>sqrt ?cc > 0\<close>
[PROOF STATE]
proof (prove)
using this:
cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)
0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)
cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) = cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) = cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
\<lbrakk>cmod (a - b) * (1 + (cmod c)\<^sup>2) \<le> cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2); 0 \<le> (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)\<rbrakk> \<Longrightarrow> cmod (a - b) * (1 + (cmod c)\<^sup>2) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> (cmod (a - c) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2) + cmod (c - b) * sqrt (1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2)) / ((1 + (cmod c)\<^sup>2) * sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2))
0 < sqrt (1 + (cmod a)\<^sup>2)
0 < sqrt (1 + (cmod b)\<^sup>2)
0 < sqrt (1 + (cmod c)\<^sup>2)

goal (1 subgoal):
 1. cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))
[PROOF STEP]
by (simp add: add_divide_distrib)
[PROOF STATE]
proof (state)
this:
cmod (a - b) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod b)\<^sup>2)) \<le> cmod (a - c) / (sqrt (1 + (cmod a)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2)) + cmod (c - b) / (sqrt (1 + (cmod b)\<^sup>2) * sqrt (1 + (cmod c)\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_bit_mult:
  \<open>take_bit n (take_bit n k * take_bit n l) = take_bit n (k * l)\<close>
  for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit n (take_bit n k * take_bit n l) = take_bit n (k * l)
[PROOF STEP]
by (simp add: take_bit_eq_mod mod_mult_eq)


[STATEMENT]
lemma closedin_closed_subtopology:
     "closedin X S \<Longrightarrow> (closedin (subtopology X S) T \<longleftrightarrow> closedin X T \<and> T \<subseteq> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin X S \<Longrightarrow> closedin (subtopology X S) T = (closedin X T \<and> T \<subseteq> S)
[PROOF STEP]
by (metis closedin_Int closedin_imp_subset closedin_subtopology inf.orderE)


[STATEMENT]
lemma size_of_rhs:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "nat list list"
  shows "dim_vec (construct_rhs_vector p qs subsets) = length subsets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (v_vec p qs subsets) = length subsets
[PROOF STEP]
unfolding construct_rhs_vector_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_of_list (map (\<lambda>I. construct_NofI p (retrieve_polys qs I)) subsets)) = length subsets
[PROOF STEP]
by simp


[STATEMENT]
lemma stabilizer_subset_stabilizer_dvd:
  assumes "stabilizer A \<subseteq> stabilizer B"
  shows "card (stabilizer A) dvd card (stabilizer B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
proof(cases "finite (stabilizer B)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
 2. infinite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
case hB: True
[PROOF STATE]
proof (state)
this:
finite (stabilizer B)

goal (2 subgoals):
 1. finite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
 2. infinite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
interpret H: subgroup_of_group "stabilizer A" "stabilizer B" "(\<oplus>)" "\<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup_of_group (stabilizer A) (stabilizer B) (\<oplus>) \<zero>
[PROOF STEP]
proof(unfold_locales)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. stabilizer A \<subseteq> stabilizer B
 2. \<And>a b. \<lbrakk>a \<in> stabilizer A; b \<in> stabilizer A\<rbrakk> \<Longrightarrow> a \<oplus> b \<in> stabilizer A
 3. \<zero> \<in> stabilizer A
[PROOF STEP]
show "stabilizer A \<subseteq> stabilizer B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stabilizer A \<subseteq> stabilizer B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
stabilizer A \<subseteq> stabilizer B

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

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>a \<in> stabilizer A; b \<in> stabilizer A\<rbrakk> \<Longrightarrow> a \<oplus> b \<in> stabilizer A
 2. \<zero> \<in> stabilizer A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>a \<in> stabilizer A; b \<in> stabilizer A\<rbrakk> \<Longrightarrow> a \<oplus> b \<in> stabilizer A
 2. \<zero> \<in> stabilizer A
[PROOF STEP]
show "\<And>a b. a \<in> stabilizer A \<Longrightarrow> b \<in> stabilizer A \<Longrightarrow> a \<oplus> b \<in> stabilizer A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> stabilizer A; b \<in> stabilizer A\<rbrakk> \<Longrightarrow> a \<oplus> b \<in> stabilizer A
[PROOF STEP]
using stabilizer_is_subgroup group_axioms
[PROOF STATE]
proof (prove)
using this:
subgroup (stabilizer ?S) G (\<oplus>) \<zero>
Group_Theory.group G (\<oplus>) \<zero>

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> stabilizer A; b \<in> stabilizer A\<rbrakk> \<Longrightarrow> a \<oplus> b \<in> stabilizer A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> stabilizer A; ?b \<in> stabilizer A\<rbrakk> \<Longrightarrow> ?a \<oplus> ?b \<in> stabilizer A

goal (1 subgoal):
 1. \<zero> \<in> stabilizer A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<zero> \<in> stabilizer A
[PROOF STEP]
show "\<zero> \<in> stabilizer A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero> \<in> stabilizer A
[PROOF STEP]
using sub_unit_closed
[PROOF STATE]
proof (prove)
using this:
\<zero> \<in> stabilizer ?A

goal (1 subgoal):
 1. \<zero> \<in> stabilizer A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<zero> \<in> stabilizer A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
 2. infinite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
using H.lagrange hB
[PROOF STATE]
proof (prove)
using this:
finite (stabilizer B) \<Longrightarrow> card (stabilizer B) = card (stabilizer A) * H.index
finite (stabilizer B)

goal (1 subgoal):
 1. card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (stabilizer A) dvd card (stabilizer B)

goal (1 subgoal):
 1. infinite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite (stabilizer B)

goal (1 subgoal):
 1. infinite (stabilizer B) \<Longrightarrow> card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite (stabilizer B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (stabilizer B)

goal (1 subgoal):
 1. card (stabilizer A) dvd card (stabilizer B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (stabilizer A) dvd card (stabilizer B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_root_eq_1_iff [simp]: "0 < n \<Longrightarrow> root n x = 1 \<longleftrightarrow> x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> (root n x = 1) = (x = 1)
[PROOF STEP]
using real_root_eq_iff [where y=1]
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> (root ?n ?x = root ?n 1) = (?x = 1)

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


[STATEMENT]
lemma cdiv_in_iff' [simp]: "c \<noteq> 0 \<Longrightarrow> (\<lambda>x. f x / c) \<in> L F (g) \<longleftrightarrow> f \<in> L F (g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> ((\<lambda>x. f x / c) \<in> L F g) = (f \<in> L F g)
[PROOF STEP]
using cmult_in_iff'[of "inverse c" f]
[PROOF STATE]
proof (prove)
using this:
inverse c \<noteq> (0::'b) \<Longrightarrow> ((\<lambda>x. f x * inverse c) \<in> L ?F ?g) = (f \<in> L ?F ?g)

goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> ((\<lambda>x. f x / c) \<in> L F g) = (f \<in> L F g)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma mset_nth_drop_less: "i < length xs \<Longrightarrow> mset (nth_drop i xs) < mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length xs \<Longrightarrow> mset (nth_drop i xs) < mset xs
[PROOF STEP]
by (induct xs arbitrary: i) (auto simp: take_Cons' nth_drop_def gr0_conv_Suc)


[STATEMENT]
lemma pair_qbs_closed2: "qbs_closed2 (qbs_space X \<times> qbs_space Y) (pair_qbs_Mx X Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_closed2 (qbs_space X \<times> qbs_space Y) (pair_qbs_Mx X Y)
[PROOF STEP]
unfolding qbs_closed2_def pair_qbs_Mx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>qbs_space X \<times> qbs_space Y. (\<lambda>r. x) \<in> {f. fst \<circ> f \<in> qbs_Mx X \<and> snd \<circ> f \<in> qbs_Mx Y}
[PROOF STEP]
by auto


[STATEMENT]
theorem dfs_eq_rtrancl:
  assumes y: "is_node y"
    and x: "is_node x"
  shows "memb y (dfs empt [x]) = ((x,y) \<in> (succsr succs)\<^sup>*)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. memb y (dfs empt [x]) = ((x, y) \<in> (succsr succs)\<^sup>*)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. memb y (dfs empt [x]) = ((x, y) \<in> (succsr succs)\<^sup>*)
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
is_node x
[PROOF STEP]
have x': "list_all is_node [x]"
[PROOF STATE]
proof (prove)
using this:
is_node x

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

goal (1 subgoal):
 1. memb y (dfs empt [x]) = ((x, y) \<in> (succsr succs)\<^sup>*)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. memb y (dfs empt [x]) = ((x, y) \<in> (succsr succs)\<^sup>*)
[PROOF STEP]
by (simp only: dfs_eq_reachable [OF y x'] reachable_def succsr_def) (auto simp add: empt)
[PROOF STATE]
proof (state)
this:
memb y (dfs empt [x]) = ((x, y) \<in> (succsr succs)\<^sup>*)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dg_prod_ObjD:
  assumes "a \<in>\<^sub>\<circ> (\<Prod>\<^sub>D\<^sub>Gi\<in>\<^sub>\<circ>I. \<AA> i)\<lparr>Obj\<rparr>"
  shows "vsv a" and "\<D>\<^sub>\<circ> a = I" and "\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> a\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv a &&& \<D>\<^sub>\<circ> a = I &&& (\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> a\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Obj\<rparr>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> dg_prod I \<AA>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vsv a &&& \<D>\<^sub>\<circ> a = I &&& (\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> a\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Obj\<rparr>)
[PROOF STEP]
unfolding dg_prod_components
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. \<AA> i\<lparr>Obj\<rparr>)

goal (1 subgoal):
 1. vsv a &&& \<D>\<^sub>\<circ> a = I &&& (\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> a\<lparr>i\<rparr> \<in>\<^sub>\<circ> \<AA> i\<lparr>Obj\<rparr>)
[PROOF STEP]
by auto


[STATEMENT]
lemma table_append_Some_iff: "table_of (xs@ys) k = Some z =
 (table_of xs k = Some z \<or> (table_of xs k = None \<and> table_of ys k = Some z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (table_of (xs @ ys) k = Some z) = (table_of xs k = Some z \<or> table_of xs k = None \<and> table_of ys k = Some z)
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((table_of ys ++ table_of xs) k = Some z) = (table_of xs k = Some z \<or> table_of xs k = None \<and> table_of ys k = Some z)
[PROOF STEP]
apply (rule map_add_Some_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pcompose_conjugates_integer:
  assumes "\<And>i. poly.coeff p i \<in> \<int>"
  shows   "poly.coeff (pcompose p [:0, \<i>:] * pcompose p [:0, -\<i>:]) i \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
let ?c = "\<lambda>i. poly.coeff p i :: complex"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
have "poly.coeff (pcompose p [:0, \<i>:] * pcompose p [:0, -\<i>:]) i =
          \<i> ^ i * (\<Sum>k\<le>i. (-1) ^ (i - k) * ?c k * ?c (i - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i = \<i> ^ i * (\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k))
[PROOF STEP]
unfolding coeff_mult sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia\<le>i. coeff (p \<circ>\<^sub>p [:0, \<i>:]) ia * coeff (p \<circ>\<^sub>p [:0, - \<i>:]) (i - ia)) = (\<Sum>n\<le>i. \<i> ^ i * ((- 1) ^ (i - n) * coeff p n * coeff p (i - n)))
[PROOF STEP]
by (intro sum.cong) (auto simp: coeff_mult coeff_pcompose_linear power_minus'
                                    power_diff field_simps intro!: Ints_sum)
[PROOF STATE]
proof (state)
this:
coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i = \<i> ^ i * (\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k))

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i = \<i> ^ i * (\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k))

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
have "(\<Sum>k\<le>i. (-1) ^ (i - k) * ?c k * ?c (i - k)) =
          (\<Sum>k\<le>i. (-1) ^ k * ?c k * ?c (i - k))" (is "?S1 = ?S2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) = (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>k. i - k" "\<lambda>k. i - k"]) (auto simp: mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) = (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
hence "?S1 = (?S1 + ?S2) / 2"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) = (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))

goal (1 subgoal):
 1. (\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) = ((\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) + (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))) / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) = ((\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) + (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))) / 2

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) = ((\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) + (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))) / 2

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>i. ((-1) ^ k + (-1) ^ (i - k)) / 2 * ?c k * ?c (i - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) + (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))) / 2 = (\<Sum>k\<le>i. ((- 1) ^ k + (- 1) ^ (i - k)) / 2 * coeff p k * coeff p (i - k))
[PROOF STEP]
by (simp add: ring_distribs sum.distrib sum_divide_distrib [symmetric])
[PROOF STATE]
proof (state)
this:
((\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) + (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))) / 2 = (\<Sum>k\<le>i. ((- 1) ^ k + (- 1) ^ (i - k)) / 2 * coeff p k * coeff p (i - k))

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<Sum>k\<le>i. (- 1) ^ (i - k) * coeff p k * coeff p (i - k)) + (\<Sum>k\<le>i. (- 1) ^ k * coeff p k * coeff p (i - k))) / 2 = (\<Sum>k\<le>i. ((- 1) ^ k + (- 1) ^ (i - k)) / 2 * coeff p k * coeff p (i - k))

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>i. (1 + (-1) ^ i) / 2 * (-1) ^ k * ?c k * ?c (i - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>i. ((- 1) ^ k + (- 1) ^ (i - k)) / 2 * coeff p k * coeff p (i - k)) = (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k))
[PROOF STEP]
by (intro sum.cong) (auto simp: power_add power_diff field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>i. ((- 1) ^ k + (- 1) ^ (i - k)) / 2 * coeff p k * coeff p (i - k)) = (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k))

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>i. ((- 1) ^ k + (- 1) ^ (i - k)) / 2 * coeff p k * coeff p (i - k)) = (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k))

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
have "\<i> ^ i * \<dots> \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
proof (cases "even i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. even i \<Longrightarrow> \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
 2. odd i \<Longrightarrow> \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
even i

goal (2 subgoals):
 1. even i \<Longrightarrow> \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
 2. odd i \<Longrightarrow> \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
even i

goal (1 subgoal):
 1. \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
by (intro Ints_mult Ints_sum assms) (auto elim!: evenE simp: power_mult)
[PROOF STATE]
proof (state)
this:
\<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>

goal (1 subgoal):
 1. odd i \<Longrightarrow> \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd i \<Longrightarrow> \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
odd i

goal (1 subgoal):
 1. odd i \<Longrightarrow> \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
hence "1 + (-1) ^ i = (0 :: complex)"
[PROOF STATE]
proof (prove)
using this:
odd i

goal (1 subgoal):
 1. 1 + (- 1) ^ i = 0
[PROOF STEP]
by (auto elim!: oddE simp: power_mult)
[PROOF STATE]
proof (state)
this:
1 + (- 1) ^ i = 0

goal (1 subgoal):
 1. odd i \<Longrightarrow> \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
1 + (- 1) ^ i = 0

goal (1 subgoal):
 1. \<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<i> ^ i * (\<Sum>k\<le>i. (1 + (- 1) ^ i) / 2 * (- 1) ^ k * coeff p k * coeff p (i - k)) \<in> \<int>

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>

goal (1 subgoal):
 1. coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
coeff (p \<circ>\<^sub>p [:0, \<i>:] * p \<circ>\<^sub>p [:0, - \<i>:]) i \<in> \<int>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_sequences:
  assumes "finite A"
  shows "card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
obtain enum where "bij_betw enum {0..<card A} A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>enum. bij_betw enum {0..<card A} A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>finite A\<close> ex_bij_betw_nat_finite
[PROOF STATE]
proof (prove)
using this:
finite A
finite ?M \<Longrightarrow> \<exists>h. bij_betw h {0..<card ?M} ?M

goal (1 subgoal):
 1. (\<And>enum. bij_betw enum {0..<card A} A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
have "bij_betw (function_of A enum) {xs. set xs \<subseteq> B \<and> length xs = card A} (A \<rightarrow>\<^sub>E B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (function_of A enum) {xs. set xs \<subseteq> B \<and> length xs = card A} (A \<rightarrow>\<^sub>E B)
[PROOF STEP]
using \<open>bij_betw enum {0..<card A} A\<close>
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. bij_betw (function_of A enum) {xs. set xs \<subseteq> B \<and> length xs = card A} (A \<rightarrow>\<^sub>E B)
[PROOF STEP]
by (rule bij_betw_function_of)
[PROOF STATE]
proof (state)
this:
bij_betw (function_of A enum) {xs. set xs \<subseteq> B \<and> length xs = card A} (A \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
bij_betw (function_of A enum) {xs. set xs \<subseteq> B \<and> length xs = card A} (A \<rightarrow>\<^sub>E B)
[PROOF STEP]
have "card {xs. set xs \<subseteq> B \<and> length xs = card A} = card (A \<rightarrow>\<^sub>E B)"
[PROOF STATE]
proof (prove)
using this:
bij_betw (function_of A enum) {xs. set xs \<subseteq> B \<and> length xs = card A} (A \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card (A \<rightarrow>\<^sub>E B)
[PROOF STEP]
by (rule bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
card {xs. set xs \<subseteq> B \<and> length xs = card A} = card (A \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {xs. set xs \<subseteq> B \<and> length xs = card A} = card (A \<rightarrow>\<^sub>E B)

goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
have "card (A \<rightarrow>\<^sub>E B) = card B ^ card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (A \<rightarrow>\<^sub>E B) = card B ^ card A
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. card (A \<rightarrow>\<^sub>E B) = card B ^ card A
[PROOF STEP]
by (rule card_extensional_funcset)
[PROOF STATE]
proof (state)
this:
card (A \<rightarrow>\<^sub>E B) = card B ^ card A

goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A

goal (1 subgoal):
 1. card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card {xs. set xs \<subseteq> B \<and> length xs = card A} = card B ^ card A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel2p_fref[rel2p]: "rel2p (fref P R S)
    = (\<lambda>f g. (\<forall>x y. P y \<longrightarrow> rel2p R x y \<longrightarrow> rel2p S (f x) (g y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel2p ([P]\<^sub>f R \<rightarrow> S) = (\<lambda>f g. \<forall>x y. P y \<longrightarrow> rel2p R x y \<longrightarrow> rel2p S (f x) (g y))
[PROOF STEP]
by (auto simp: fref_def rel2p_def[abs_def])


[STATEMENT]
lemma ANR_homeomorphic_ANR:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "ANR T" "S homeomorphic T"
    shows "ANR S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ANR S
[PROOF STEP]
unfolding ANR_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>U S'. S homeomorphic S' \<and> closedin (top_of_set U) S' \<longrightarrow> (\<exists>T. openin (top_of_set U) T \<and> S' retract_of T)
[PROOF STEP]
by (metis assms ANR_imp_absolute_neighbourhood_retract homeomorphic_trans [of _ S] homeomorphic_sym)


[STATEMENT]
lemma fps_to_fls_of_nat:
  "fps_to_fls (of_nat n) = (of_nat n :: 'a::semiring_1 fls)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_to_fls (of_nat n) = of_nat n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fps_to_fls (of_nat n) = of_nat n
[PROOF STEP]
have "fps_to_fls (of_nat n) = fps_to_fls (fps_const (of_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_to_fls (of_nat n) = fps_to_fls (fps_const (of_nat n))
[PROOF STEP]
by (simp add: fps_of_nat)
[PROOF STATE]
proof (state)
this:
fps_to_fls (of_nat n) = fps_to_fls (fps_const (of_nat n))

goal (1 subgoal):
 1. fps_to_fls (of_nat n) = of_nat n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
fps_to_fls (of_nat n) = fps_to_fls (fps_const (of_nat n))

goal (1 subgoal):
 1. fps_to_fls (of_nat n) = of_nat n
[PROOF STEP]
by (simp add: fls_of_nat)
[PROOF STATE]
proof (state)
this:
fps_to_fls (of_nat n) = of_nat n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_cis [simp]: "norm (cis a) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (cis a) = 1
[PROOF STEP]
by (simp add: norm_complex_def)


[STATEMENT]
lemma bigthetaI [intro]: "f \<in> O[F](g) \<Longrightarrow> f \<in> \<Omega>[F](g) \<Longrightarrow> f \<in> \<Theta>[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O[F](g); f \<in> \<Omega>[F](g)\<rbrakk> \<Longrightarrow> f \<in> \<Theta>[F](g)
[PROOF STEP]
unfolding bigtheta_def bigomega_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O[F](g); f \<in> {f. \<exists>c>0. \<forall>\<^sub>F x in F. c * norm (g x) \<le> norm (f x)}\<rbrakk> \<Longrightarrow> f \<in> O[F](g) \<inter> {f. \<exists>c>0. \<forall>\<^sub>F x in F. c * norm (g x) \<le> norm (f x)}
[PROOF STEP]
by blast


[STATEMENT]
lemma card_suc_ge_insert:
  fixes A and x
  shows "card A + 1 \<ge> card (insert x A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert x A) \<le> card A + 1
[PROOF STEP]
using card_insert_le_m1
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?n; card ?y \<le> ?n - 1\<rbrakk> \<Longrightarrow> card (insert ?x ?y) \<le> ?n

goal (1 subgoal):
 1. card (insert x A) \<le> card A + 1
[PROOF STEP]
by fastforce


[STATEMENT]
lemma tendsto_componentwise_max:
  assumes f: "(f \<longlongrightarrow> l) F" and g: "(g \<longlongrightarrow> m) F"
  shows "((\<lambda>x. (\<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i)) \<longlongrightarrow> (\<Sum>i\<in>Basis. max (l \<bullet> i) (m \<bullet> i) *\<^sub>R i)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>i\<in>Basis. max (f x \<bullet> i) (g x \<bullet> i) *\<^sub>R i) \<longlongrightarrow> (\<Sum>i\<in>Basis. max (l \<bullet> i) (m \<bullet> i) *\<^sub>R i)) F
[PROOF STEP]
by (intro tendsto_intros assms)


[STATEMENT]
lemma tendsto_open_vimage: "(\<And>B. open B \<Longrightarrow> open (f -` B)) \<Longrightarrow> f \<midarrow>l\<rightarrow> f l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. open B \<Longrightarrow> open (f -` B)) \<Longrightarrow> f \<midarrow>l\<rightarrow> f l
[PROOF STEP]
using continuous_on_open_vimage[of UNIV f] continuous_on_def[of UNIV f]
[PROOF STATE]
proof (prove)
using this:
open UNIV \<Longrightarrow> continuous_on UNIV f = (\<forall>B. open B \<longrightarrow> open (f -` B \<inter> UNIV))
continuous_on UNIV f = (\<forall>x\<in>UNIV. f \<midarrow>x\<rightarrow> f x)

goal (1 subgoal):
 1. (\<And>B. open B \<Longrightarrow> open (f -` B)) \<Longrightarrow> f \<midarrow>l\<rightarrow> f l
[PROOF STEP]
by simp


[STATEMENT]
lemma poly_of_pm_zero [simp]: "poly_of_pm x 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_pm x 0 = 0
[PROOF STEP]
by (metis poly_of_pm_of_poly pm_of_poly_zero)


[STATEMENT]
lemma vec_index_le_linf_norm:
  fixes v :: "'a :: ring_1_abs_real_line vec"
  assumes "i < dim_vec v"
  shows "\<bar>v$i\<bar> \<le> \<parallel>v\<parallel>\<^sub>\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>v $ i\<bar> \<le> \<parallel>v\<parallel>\<^sub>\<infinity>
[PROOF STEP]
apply (unfold linf_norm_vec_def, rule le_max_list)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b. \<lbrakk>a \<in> set (map abs (list_of_vec v) @ [0::'a]); b \<in> set (map abs (list_of_vec v) @ [0::'a])\<rbrakk> \<Longrightarrow> a \<le> b \<or> b \<le> a
 2. \<bar>v $ i\<bar> \<le> ?b
 3. ?b \<in> set (map abs (list_of_vec v) @ [0::'a])
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_vec v

goal (3 subgoals):
 1. \<And>a b. \<lbrakk>a \<in> set (map abs (list_of_vec v) @ [0::'a]); b \<in> set (map abs (list_of_vec v) @ [0::'a])\<rbrakk> \<Longrightarrow> a \<le> b \<or> b \<le> a
 2. \<bar>v $ i\<bar> \<le> ?b
 3. ?b \<in> set (map abs (list_of_vec v) @ [0::'a])
[PROOF STEP]
apply (auto simp:  in_set_conv_nth intro!: imageI exI[of _ i])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.


[STATEMENT]
lemma move_matrix_le_zero[simp]: "0 <= j \<Longrightarrow> 0 <= i \<Longrightarrow> (move_matrix A j i <= 0) = (A <= (0::('a::{order,zero}) matrix))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> j; 0 \<le> i\<rbrakk> \<Longrightarrow> (move_matrix A j i \<le> 0) = (A \<le> 0)
[PROOF STEP]
apply (auto simp add: le_matrix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ja ia. \<lbrakk>0 \<le> j; 0 \<le> i; \<forall>ja ia. \<not> int ja < j \<and> \<not> int ia < i \<longrightarrow> Rep_matrix A (nat (int ja - j)) (nat (int ia - i)) \<le> (0::'a)\<rbrakk> \<Longrightarrow> Rep_matrix A ja ia \<le> (0::'a)
[PROOF STEP]
apply (drule_tac j="ja+(nat j)" and i="ia+(nat i)" in spec2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ja ia. \<lbrakk>0 \<le> j; 0 \<le> i; \<not> int (ja + nat j) < j \<and> \<not> int (ia + nat i) < i \<longrightarrow> Rep_matrix A (nat (int (ja + nat j) - j)) (nat (int (ia + nat i) - i)) \<le> (0::'a)\<rbrakk> \<Longrightarrow> Rep_matrix A ja ia \<le> (0::'a)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma aff_dim_empty_eq [simp]: "aff_dim ({}::'a::euclidean_space set) = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim {} = - 1
[PROOF STEP]
by (simp add: aff_dim_empty [symmetric])


[STATEMENT]
lemma inverse_composition_commute:
  assumes [simp]: "invertible x" "invertible y" "x \<in> M" "y \<in> M"
  shows "inverse (x \<cdot> y) = inverse y \<cdot> inverse x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (x \<cdot> y) = inverse y \<cdot> inverse x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inverse (x \<cdot> y) = inverse y \<cdot> inverse x
[PROOF STEP]
have "inverse (x \<cdot> y) \<cdot> (x \<cdot> y) = (inverse y \<cdot> inverse x) \<cdot> (x \<cdot> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (x \<cdot> y) \<cdot> (x \<cdot> y) = inverse y \<cdot> inverse x \<cdot> (x \<cdot> y)
[PROOF STEP]
by (simp add: invertible_left_inverse2 associative)
[PROOF STATE]
proof (state)
this:
inverse (x \<cdot> y) \<cdot> (x \<cdot> y) = inverse y \<cdot> inverse x \<cdot> (x \<cdot> y)

goal (1 subgoal):
 1. inverse (x \<cdot> y) = inverse y \<cdot> inverse x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (x \<cdot> y) \<cdot> (x \<cdot> y) = inverse y \<cdot> inverse x \<cdot> (x \<cdot> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inverse (x \<cdot> y) \<cdot> (x \<cdot> y) = inverse y \<cdot> inverse x \<cdot> (x \<cdot> y)

goal (1 subgoal):
 1. inverse (x \<cdot> y) = inverse y \<cdot> inverse x
[PROOF STEP]
by (simp del: invertible_left_inverse)
[PROOF STATE]
proof (state)
this:
inverse (x \<cdot> y) = inverse y \<cdot> inverse x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma order_mult_of: "finite (carrier R) \<Longrightarrow> order (mult_of R) = order R - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier R) \<Longrightarrow> order (mult_of R) = order R - 1
[PROOF STEP]
unfolding order_def carrier_mult_of
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier R) \<Longrightarrow> card (carrier R - {\<zero>}) = card (carrier R) - 1
[PROOF STEP]
by (simp add: card.remove)