[STATEMENT]
lemma rtrancl3p_converseD:
  "rtrancl3p r a bs a' \<Longrightarrow> rtrancl3p (converse3p r) a' (rev bs) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rtrancl3p r a bs a' \<Longrightarrow> rtrancl3p (converse3p r) a' (rev bs) a
[PROOF STEP]
proof(induct rule: rtrancl3p.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. rtrancl3p (converse3p r) a (rev []) a
 2. \<And>a bs a' b a''. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p (converse3p r) a' (rev bs) a; r a' b a''\<rbrakk> \<Longrightarrow> rtrancl3p (converse3p r) a'' (rev (bs @ [b])) a
[PROOF STEP]
case rtrancl3p_refl
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a. rtrancl3p (converse3p r) a (rev []) a
 2. \<And>a bs a' b a''. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p (converse3p r) a' (rev bs) a; r a' b a''\<rbrakk> \<Longrightarrow> rtrancl3p (converse3p r) a'' (rev (bs @ [b])) a
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rtrancl3p (converse3p r) a_ (rev []) a_
[PROOF STEP]
by(auto intro: rtrancl3p.intros)
[PROOF STATE]
proof (state)
this:
rtrancl3p (converse3p r) a_ (rev []) a_

goal (1 subgoal):
 1. \<And>a bs a' b a''. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p (converse3p r) a' (rev bs) a; r a' b a''\<rbrakk> \<Longrightarrow> rtrancl3p (converse3p r) a'' (rev (bs @ [b])) a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a bs a' b a''. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p (converse3p r) a' (rev bs) a; r a' b a''\<rbrakk> \<Longrightarrow> rtrancl3p (converse3p r) a'' (rev (bs @ [b])) a
[PROOF STEP]
case rtrancl3p_step
[PROOF STATE]
proof (state)
this:
rtrancl3p r a_ bs_ a'_
rtrancl3p (converse3p r) a'_ (rev bs_) a_
r a'_ b_ a''_

goal (1 subgoal):
 1. \<And>a bs a' b a''. \<lbrakk>rtrancl3p r a bs a'; rtrancl3p (converse3p r) a' (rev bs) a; r a' b a''\<rbrakk> \<Longrightarrow> rtrancl3p (converse3p r) a'' (rev (bs @ [b])) a
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
rtrancl3p r a_ bs_ a'_
rtrancl3p (converse3p r) a'_ (rev bs_) a_
r a'_ b_ a''_

goal (1 subgoal):
 1. rtrancl3p (converse3p r) a''_ (rev (bs_ @ [b_])) a_
[PROOF STEP]
by(auto intro: rtrancl3p_step_converse converse3p.intros)
[PROOF STATE]
proof (state)
this:
rtrancl3p (converse3p r) a''_ (rev (bs_ @ [b_])) a_

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sq_norm_fs_via_sum_mu_gso: assumes i: "i < m"
  shows "of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
let ?G = "map (gs.gso) [0 ..< m]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
let ?gso = "\<lambda> fs j. ?G ! j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
have "of_int \<parallel>fs ! i\<parallel>\<^sup>2 = \<parallel>RAT fs ! i\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = \<parallel>map of_int_hom.vec_hom fs ! i\<parallel>\<^sup>2
[PROOF STEP]
unfolding sq_norm_of_int[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>of_int_hom.vec_hom (fs ! i)\<parallel>\<^sup>2 = \<parallel>map of_int_hom.vec_hom fs ! i\<parallel>\<^sup>2
[PROOF STEP]
using insert i
[PROOF STATE]
proof (prove)
using this:
ListMem ?x ?xs \<Longrightarrow> ListMem ?x (?y # ?xs)
i < length fs

goal (1 subgoal):
 1. \<parallel>of_int_hom.vec_hom (fs ! i)\<parallel>\<^sup>2 = \<parallel>map of_int_hom.vec_hom fs ! i\<parallel>\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = \<parallel>map of_int_hom.vec_hom fs ! i\<parallel>\<^sup>2

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = \<parallel>map of_int_hom.vec_hom fs ! i\<parallel>\<^sup>2

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
have "RAT fs ! i = gs.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map of_int_hom.vec_hom fs ! i = gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i])
[PROOF STEP]
using gs.fi_is_sum_of_mu_gso i
[PROOF STATE]
proof (prove)
using this:
?i < length (map of_int_hom.vec_hom fs) \<Longrightarrow> map of_int_hom.vec_hom fs ! ?i = gs.M.sumlist (map (\<lambda>j. gs.\<mu> ?i j \<cdot>\<^sub>v gs.gso j) [0..<Suc ?i])
i < length fs

goal (1 subgoal):
 1. map of_int_hom.vec_hom fs ! i = gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map of_int_hom.vec_hom fs ! i = gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i])

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map of_int_hom.vec_hom fs ! i = gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i])

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
have id: "map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i] = map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v ?gso fs j) [0..<Suc i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i] = map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i]
[PROOF STEP]
by (rule nth_equalityI, insert i, auto simp: nth_append)
[PROOF STATE]
proof (state)
this:
map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i] = map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i]

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i] = map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i]

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
have "sq_norm (gs.sumlist \<dots>) = sum_list (map sq_norm (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i])\<parallel>\<^sup>2 = sum_list (map sq_norm (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i]))
[PROOF STEP]
unfolding map_map o_def sq_norm_smult_vec
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i])\<parallel>\<^sup>2 = (\<Sum>x\<leftarrow>[0..<Suc i]. sq_norm_conjugate (gs.\<mu> i x) * \<parallel>gs.gso x\<parallel>\<^sup>2)
[PROOF STEP]
unfolding sq_norm_vec_as_cscalar_prod cscalar_prod_is_scalar_prod conjugate_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i]) \<bullet> gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i]) = (\<Sum>x\<leftarrow>[0..<Suc i]. gs.\<mu> i x * gs.\<mu> i x * (gs.gso x \<bullet> gs.gso x))
[PROOF STEP]
proof (subst gs.scalar_prod_lincomb_orthogonal)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. orthogonal (map gs.gso [0..<length fs])
 2. set (map gs.gso [0..<length fs]) \<subseteq> carrier_vec n
 3. Suc i \<le> length (map gs.gso [0..<length fs])
 4. (\<Sum>ia\<leftarrow>[0..<Suc i]. gs.\<mu> i ia * gs.\<mu> i ia * (map gs.gso [0..<length fs] ! ia \<bullet> map gs.gso [0..<length fs] ! ia)) = (\<Sum>x\<leftarrow>[0..<Suc i]. gs.\<mu> i x * gs.\<mu> i x * (gs.gso x \<bullet> gs.gso x))
[PROOF STEP]
show "Suc i \<le> length ?G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc i \<le> length (map gs.gso [0..<length fs])
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < length fs

goal (1 subgoal):
 1. Suc i \<le> length (map gs.gso [0..<length fs])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc i \<le> length (map gs.gso [0..<length fs])

goal (3 subgoals):
 1. orthogonal (map gs.gso [0..<length fs])
 2. set (map gs.gso [0..<length fs]) \<subseteq> carrier_vec n
 3. (\<Sum>ia\<leftarrow>[0..<Suc i]. gs.\<mu> i ia * gs.\<mu> i ia * (map gs.gso [0..<length fs] ! ia \<bullet> map gs.gso [0..<length fs] ! ia)) = (\<Sum>x\<leftarrow>[0..<Suc i]. gs.\<mu> i x * gs.\<mu> i x * (gs.gso x \<bullet> gs.gso x))
[PROOF STEP]
show "set ?G \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map gs.gso [0..<length fs]) \<subseteq> carrier_vec n
[PROOF STEP]
using gs.gso_carrier
[PROOF STATE]
proof (prove)
using this:
?i < length (map of_int_hom.vec_hom fs) \<Longrightarrow> gs.gso ?i \<in> carrier_vec n

goal (1 subgoal):
 1. set (map gs.gso [0..<length fs]) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map gs.gso [0..<length fs]) \<subseteq> carrier_vec n

goal (2 subgoals):
 1. orthogonal (map gs.gso [0..<length fs])
 2. (\<Sum>ia\<leftarrow>[0..<Suc i]. gs.\<mu> i ia * gs.\<mu> i ia * (map gs.gso [0..<length fs] ! ia \<bullet> map gs.gso [0..<length fs] ! ia)) = (\<Sum>x\<leftarrow>[0..<Suc i]. gs.\<mu> i x * gs.\<mu> i x * (gs.gso x \<bullet> gs.gso x))
[PROOF STEP]
show "orthogonal ?G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal (map gs.gso [0..<length fs])
[PROOF STEP]
using gs.orthogonal_gso
[PROOF STATE]
proof (prove)
using this:
orthogonal (map gs.gso [0..<length (map of_int_hom.vec_hom fs)])

goal (1 subgoal):
 1. orthogonal (map gs.gso [0..<length fs])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orthogonal (map gs.gso [0..<length fs])

goal (1 subgoal):
 1. (\<Sum>ia\<leftarrow>[0..<Suc i]. gs.\<mu> i ia * gs.\<mu> i ia * (map gs.gso [0..<length fs] ! ia \<bullet> map gs.gso [0..<length fs] ! ia)) = (\<Sum>x\<leftarrow>[0..<Suc i]. gs.\<mu> i x * gs.\<mu> i x * (gs.gso x \<bullet> gs.gso x))
[PROOF STEP]
qed (rule arg_cong[of _ _ sum_list], intro nth_equalityI, insert i, auto simp: nth_append)
[PROOF STATE]
proof (state)
this:
\<parallel>gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i])\<parallel>\<^sup>2 = sum_list (map sq_norm (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i]))

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>gs.M.sumlist (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v map gs.gso [0..<length fs] ! j) [0..<Suc i])\<parallel>\<^sup>2 = sum_list (map sq_norm (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i]))

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
have "map sq_norm (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i]) = map (\<lambda>j. (gs.\<mu> i j)^2 * sq_norm (gs.gso j)) [0..<Suc i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map sq_norm (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i]) = map (\<lambda>j. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2) [0..<Suc i]
[PROOF STEP]
unfolding map_map o_def sq_norm_smult_vec
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>x. sq_norm_conjugate (gs.\<mu> i x) * \<parallel>gs.gso x\<parallel>\<^sup>2) [0..<Suc i] = map (\<lambda>j. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2) [0..<Suc i]
[PROOF STEP]
by (rule map_cong, auto simp: power2_eq_square)
[PROOF STATE]
proof (state)
this:
map sq_norm (map (\<lambda>j. gs.\<mu> i j \<cdot>\<^sub>v gs.gso j) [0..<Suc i]) = map (\<lambda>j. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2) [0..<Suc i]

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)

goal (1 subgoal):
 1. rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rat_of_int \<parallel>fs ! i\<parallel>\<^sup>2 = (\<Sum>j\<leftarrow>[0..<Suc i]. (gs.\<mu> i j)\<^sup>2 * \<parallel>gs.gso j\<parallel>\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_akiyama_tanigawa_row:
  "i < u - l \<Longrightarrow> akiyama_tanigawa_row n l u ! i = akiyama_tanigawa n (i + l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < u - l \<Longrightarrow> akiyama_tanigawa_row n l u ! i = akiyama_tanigawa n (i + l)
[PROOF STEP]
by (simp add: akiyama_tanigawa_row_def add_ac)


[STATEMENT]
lemma in_lset_lmergeD: "x \<in> lset (lmerge xs ys) \<Longrightarrow> x \<in> lset xs \<or> x \<in> lset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> lset (lmerge xs ys) \<Longrightarrow> x \<in> lset xs \<or> x \<in> lset ys
[PROOF STEP]
by(induct zs\<equiv>"lmerge xs ys" arbitrary: xs ys rule: llist_set_induct)(auto simp add: lhd_lmerge ltl_lmerge split: if_split_asm dest: in_lset_ltlD)


[STATEMENT]
lemma i_cut_Int_disj: "
  \<lbrakk> cut_op = (\<down><) \<or> cut_op = (\<down>\<le>) \<or>
    cut_op = (\<down>>) \<or> cut_op = (\<down>\<ge>) \<rbrakk>
  \<Longrightarrow> cut_op (A \<inter> B) t = cut_op A t \<inter> cut_op B t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cut_op = (\<down><) \<or> cut_op = (\<down>\<le>) \<or> cut_op = (\<down>>) \<or> cut_op = (\<down>\<ge>) \<Longrightarrow> cut_op (A \<inter> B) t = cut_op A t \<inter> cut_op B t
[PROOF STEP]
apply (drule i_cut_set_restriction_disj[where f="\<lambda>I. cut_op I t"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_restriction (\<lambda>I. cut_op I t) \<Longrightarrow> cut_op (A \<inter> B) t = cut_op A t \<inter> cut_op B t
[PROOF STEP]
by (rule set_restriction_Int)


[STATEMENT]
lemma poly_map_append:
  assumes "a \<in> carrier (R\<^bsup>n\<^esup>)"
  shows  "poly_map n (fs@gs) a = (poly_map n fs a) @ (poly_map n gs a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a
[PROOF STEP]
proof(induction fs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_map n ([] @ gs) a = poly_map n [] a @ poly_map n gs a
 2. \<And>aa fs. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a \<Longrightarrow> poly_map n ((aa # fs) @ gs) a = poly_map n (aa # fs) a @ poly_map n gs a
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. poly_map n ([] @ gs) a = poly_map n [] a @ poly_map n gs a
 2. \<And>aa fs. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a \<Longrightarrow> poly_map n ((aa # fs) @ gs) a = poly_map n (aa # fs) a @ poly_map n gs a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map n ([] @ gs) a = poly_map n [] a @ poly_map n gs a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (R\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. poly_map n ([] @ gs) a = poly_map n [] a @ poly_map n gs a
[PROOF STEP]
unfolding poly_map_def poly_tuple_eval_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (R\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. (\<lambda>as\<in>carrier (R\<^bsup>n\<^esup>). map (eval_at_point R as) ([] @ gs)) a = (\<lambda>as\<in>carrier (R\<^bsup>n\<^esup>). map (eval_at_point R as) []) a @ (\<lambda>as\<in>carrier (R\<^bsup>n\<^esup>). map (eval_at_point R as) gs) a
[PROOF STEP]
by (metis (no_types, lifting) map_append restrict_apply')
[PROOF STATE]
proof (state)
this:
poly_map n ([] @ gs) a = poly_map n [] a @ poly_map n gs a

goal (1 subgoal):
 1. \<And>aa fs. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a \<Longrightarrow> poly_map n ((aa # fs) @ gs) a = poly_map n (aa # fs) a @ poly_map n gs a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa fs. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a \<Longrightarrow> poly_map n ((aa # fs) @ gs) a = poly_map n (aa # fs) a @ poly_map n gs a
[PROOF STEP]
case (Cons f fs)
[PROOF STATE]
proof (state)
this:
poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a

goal (1 subgoal):
 1. \<And>aa fs. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a \<Longrightarrow> poly_map n ((aa # fs) @ gs) a = poly_map n (aa # fs) a @ poly_map n gs a
[PROOF STEP]
have "poly_map n ((f # fs) @ gs) a = (eval_at_point R a f)#(poly_map n (fs@gs) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n (fs @ gs) a
[PROOF STEP]
using poly_map_cons
[PROOF STATE]
proof (prove)
using this:
?a \<in> carrier (R\<^bsup>?n\<^esup>) \<Longrightarrow> poly_map ?n (?f # ?fs) ?a = eval_at_point R ?a ?f # poly_map ?n ?fs ?a

goal (1 subgoal):
 1. poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n (fs @ gs) a
[PROOF STEP]
by (metis append_Cons assms)
[PROOF STATE]
proof (state)
this:
poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n (fs @ gs) a

goal (1 subgoal):
 1. \<And>aa fs. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a \<Longrightarrow> poly_map n ((aa # fs) @ gs) a = poly_map n (aa # fs) a @ poly_map n gs a
[PROOF STEP]
hence "poly_map n ((f # fs) @ gs) a = (eval_at_point R a f)#(poly_map n fs a)@(poly_map n gs a)"
[PROOF STATE]
proof (prove)
using this:
poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n (fs @ gs) a

goal (1 subgoal):
 1. poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n fs a @ poly_map n gs a
[PROOF STEP]
using Cons.IH
[PROOF STATE]
proof (prove)
using this:
poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n (fs @ gs) a
poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a

goal (1 subgoal):
 1. poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n fs a @ poly_map n gs a
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n fs a @ poly_map n gs a

goal (1 subgoal):
 1. \<And>aa fs. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a \<Longrightarrow> poly_map n ((aa # fs) @ gs) a = poly_map n (aa # fs) a @ poly_map n gs a
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
poly_map n ((f # fs) @ gs) a = eval_at_point R a f # poly_map n fs a @ poly_map n gs a

goal (1 subgoal):
 1. poly_map n ((f # fs) @ gs) a = poly_map n (f # fs) a @ poly_map n gs a
[PROOF STEP]
by (metis Cons_eq_appendI assms poly_map_cons)
[PROOF STATE]
proof (state)
this:
poly_map n ((f # fs) @ gs) a = poly_map n (f # fs) a @ poly_map n gs a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sset_orbits_list:
  assumes "permutation f" shows "sset (orbits_list f xs) = (orbit f) ` set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
proof (induct "length xs" arbitrary: xs rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xs. (\<And>xsa. length xsa < length xs \<Longrightarrow> sset (orbits_list f xsa) = orbit f ` set xsa) \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
length ?xs < length xs \<Longrightarrow> sset (orbits_list f ?xs) = orbit f ` set ?xs

goal (1 subgoal):
 1. \<And>xs. (\<And>xsa. length xsa < length xs \<Longrightarrow> sset (orbits_list f xsa) = orbit f ` set xsa) \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
proof (cases xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
 2. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
xs = []

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
 2. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs = []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
xs = []

goal (1 subgoal):
 1. sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sset (orbits_list f xs) = orbit f ` set xs

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
case (Cons x' xs')
[PROOF STATE]
proof (state)
this:
xs = x' # xs'

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
let ?xs'' = "fold remove1 (orbit_list f x') xs'"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
have A: "sset (orbits_list f ?xs'') = orbit f ` set ?xs''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sset (orbits_list f (fold remove1 (orbit_list f x') xs')) = orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
xs = x' # xs'

goal (1 subgoal):
 1. sset (orbits_list f (fold remove1 (orbit_list f x') xs')) = orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
by (simp add: less_Suc_eq_le length_fold_remove1_le less.hyps)
[PROOF STATE]
proof (state)
this:
sset (orbits_list f (fold remove1 (orbit_list f x') xs')) = orbit f ` set (fold remove1 (orbit_list f x') xs')

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
have B: "set (orbit_list f x') = orbit f x'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (orbit_list f x') = orbit f x'
[PROOF STEP]
by (rule set_orbit_list) (simp add: permutation_self_in_orbit assms)
[PROOF STATE]
proof (state)
this:
set (orbit_list f x') = orbit f x'

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
have "orbit f ` set (fold remove1 (orbit_list f x') xs') \<subseteq> orbit f ` set xs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit f ` set (fold remove1 (orbit_list f x') xs') \<subseteq> orbit f ` set xs'
[PROOF STEP]
using set_fold_remove1[of _ xs']
[PROOF STATE]
proof (prove)
using this:
set (fold remove1 ?xs xs') \<subseteq> set xs'

goal (1 subgoal):
 1. orbit f ` set (fold remove1 (orbit_list f x') xs') \<subseteq> orbit f ` set xs'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
orbit f ` set (fold remove1 (orbit_list f x') xs') \<subseteq> orbit f ` set xs'

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
orbit f ` set (fold remove1 (orbit_list f x') xs') \<subseteq> orbit f ` set xs'

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
have "orbit f ` set xs' - {orbit f x'} \<subseteq> (orbit f ` set (fold remove1 (orbit_list f x') xs'))" (is "?L \<subseteq> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit f ` set xs' - {orbit f x'} \<subseteq> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> orbit f ` set xs' - {orbit f x'} \<Longrightarrow> x \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> orbit f ` set xs' - {orbit f x'} \<Longrightarrow> x \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
assume "A \<in> ?L"
[PROOF STATE]
proof (state)
this:
A \<in> orbit f ` set xs' - {orbit f x'}

goal (1 subgoal):
 1. \<And>x. x \<in> orbit f ` set xs' - {orbit f x'} \<Longrightarrow> x \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> orbit f ` set xs' - {orbit f x'}
[PROOF STEP]
obtain y where "A = orbit f y" "y \<in> set xs'"
[PROOF STATE]
proof (prove)
using this:
A \<in> orbit f ` set xs' - {orbit f x'}

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>A = orbit f y; y \<in> set xs'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = orbit f y
y \<in> set xs'

goal (1 subgoal):
 1. \<And>x. x \<in> orbit f ` set xs' - {orbit f x'} \<Longrightarrow> x \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
have "A \<noteq> orbit f x'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> orbit f x'
[PROOF STEP]
using \<open>A \<in> ?L\<close>
[PROOF STATE]
proof (prove)
using this:
A \<in> orbit f ` set xs' - {orbit f x'}

goal (1 subgoal):
 1. A \<noteq> orbit f x'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<noteq> orbit f x'

goal (1 subgoal):
 1. \<And>x. x \<in> orbit f ` set xs' - {orbit f x'} \<Longrightarrow> x \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
from \<open>A = _\<close> \<open>A \<noteq> _\<close>
[PROOF STATE]
proof (chain)
picking this:
A = orbit f y
A \<noteq> orbit f x'
[PROOF STEP]
have "y \<notin> orbit f x'"
[PROOF STATE]
proof (prove)
using this:
A = orbit f y
A \<noteq> orbit f x'

goal (1 subgoal):
 1. y \<notin> orbit f x'
[PROOF STEP]
by (meson assms cyclic_on_orbit orbit_cyclic_eq3 permutation_permutes)
[PROOF STATE]
proof (state)
this:
y \<notin> orbit f x'

goal (1 subgoal):
 1. \<And>x. x \<in> orbit f ` set xs' - {orbit f x'} \<Longrightarrow> x \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
with \<open>y \<in> _\<close>
[PROOF STATE]
proof (chain)
picking this:
y \<in> set xs'
y \<notin> orbit f x'
[PROOF STEP]
have "y \<in> set (fold remove1 (orbit_list f x') xs')"
[PROOF STATE]
proof (prove)
using this:
y \<in> set xs'
y \<notin> orbit f x'

goal (1 subgoal):
 1. y \<in> set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
by (auto simp: set_fold_remove1' set_orbit_list permutation_self_in_orbit assms)
[PROOF STATE]
proof (state)
this:
y \<in> set (fold remove1 (orbit_list f x') xs')

goal (1 subgoal):
 1. \<And>x. x \<in> orbit f ` set xs' - {orbit f x'} \<Longrightarrow> x \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
show "A \<in> ?R"
[PROOF STATE]
proof (prove)
using this:
y \<in> set (fold remove1 (orbit_list f x') xs')

goal (1 subgoal):
 1. A \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
using \<open>A = _\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> set (fold remove1 (orbit_list f x') xs')
A = orbit f y

goal (1 subgoal):
 1. A \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> orbit f ` set (fold remove1 (orbit_list f x') xs')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
orbit f ` set xs' - {orbit f x'} \<subseteq> orbit f ` set (fold remove1 (orbit_list f x') xs')

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
orbit f ` set (fold remove1 (orbit_list f x') xs') \<subseteq> orbit f ` set xs'
orbit f ` set xs' - {orbit f x'} \<subseteq> orbit f ` set (fold remove1 (orbit_list f x') xs')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
orbit f ` set (fold remove1 (orbit_list f x') xs') \<subseteq> orbit f ` set xs'
orbit f ` set xs' - {orbit f x'} \<subseteq> orbit f ` set (fold remove1 (orbit_list f x') xs')

goal (1 subgoal):
 1. sset (orbits_list f xs) = orbit f ` set xs
[PROOF STEP]
by (auto simp: A B Cons)
[PROOF STATE]
proof (state)
this:
sset (orbits_list f xs) = orbit f ` set xs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sset (orbits_list f xs) = orbit f ` set xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma addrow_mat_Unit: assumes k: "k < n" and l: "l < n" and neq: "k \<noteq> l"
  shows "addrow_mat n a k l \<in> Units (ring_mat TYPE('a :: comm_ring_1) n b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow_mat n a k l \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. addrow_mat n a k l \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
interpret m: semiring "ring_mat TYPE('a) n b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semiring (ring_mat TYPE('a) n b)
[PROOF STEP]
by (rule semiring_mat)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. addrow_mat n a k l \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow_mat n a k l \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
unfolding Units_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow_mat n a k l \<in> {y \<in> carrier (ring_mat TYPE('a) n b). \<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> y = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> y \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>}
[PROOF STEP]
by (rule, rule conjI[OF _ bexI[of _ "addrow_mat n (- a) k l"]], insert neq,
    auto simp: ring_mat_def addrow_mat_inv[OF k l neq],
    rule trans[OF _ addrow_mat_inv[OF k l neq, of "- a"]], auto)
[PROOF STATE]
proof (state)
this:
addrow_mat n a k l \<in> Units (ring_mat TYPE('a) n b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_nonneg: "summable f \<Longrightarrow> (\<And>n. 0 \<le> f n) \<Longrightarrow> 0 \<le> suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>n. (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> (0::'a) \<le> suminf f
[PROOF STEP]
using sum_le_suminf
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>summable f; finite ?I; \<And>n. n \<in> - ?I \<Longrightarrow> (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> sum f ?I \<le> suminf f

goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>n. (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> (0::'a) \<le> suminf f
[PROOF STEP]
by force


[STATEMENT]
lemma strict_weak_trans: "a \<prec>[le] b \<Longrightarrow> b \<preceq>[le] c \<Longrightarrow> a \<prec>[le] c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<prec>[le] b; le b c\<rbrakk> \<Longrightarrow> a \<prec>[le] c
[PROOF STEP]
unfolding strongly_preferred_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>le a b \<and> \<not> le b a; le b c\<rbrakk> \<Longrightarrow> le a c \<and> \<not> le c a
[PROOF STEP]
by (blast intro: trans)


[STATEMENT]
lemma LIM_compose_eventually:
  assumes "f \<midarrow>a\<rightarrow> b"
    and "g \<midarrow>b\<rightarrow> c"
    and "eventually (\<lambda>x. f x \<noteq> b) (at a)"
  shows "(\<lambda>x. g (f x)) \<midarrow>a\<rightarrow> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g (f x)) \<midarrow>a\<rightarrow> c
[PROOF STEP]
using assms(2,1,3)
[PROOF STATE]
proof (prove)
using this:
g \<midarrow>b\<rightarrow> c
f \<midarrow>a\<rightarrow> b
\<forall>\<^sub>F x in at a. f x \<noteq> b

goal (1 subgoal):
 1. (\<lambda>x. g (f x)) \<midarrow>a\<rightarrow> c
[PROOF STEP]
by (rule tendsto_compose_eventually)


[STATEMENT]
lemma ACC_union: "ACC (X \<union> Y) = ACC X \<union> ACC Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ACC (X \<union> Y) = ACC X \<union> ACC Y
[PROOF STEP]
unfolding ACC_def accepts_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {G \<in> \<G>. \<exists>D\<in>X \<union> Y. D \<subseteq> G} = {G \<in> \<G>. \<exists>D\<in>X. D \<subseteq> G} \<union> {G \<in> \<G>. \<exists>D\<in>Y. D \<subseteq> G}
[PROOF STEP]
by blast


[STATEMENT]
lemma bi_unique_rel_resource [transfer_rule]:
  "\<lbrakk> bi_total A; bi_unique B \<rbrakk> \<Longrightarrow> bi_unique (rel_resource A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bi_total A; bi_unique B\<rbrakk> \<Longrightarrow> bi_unique (rel_resource A B)
[PROOF STEP]
unfolding bi_unique_alt_def bi_total_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>left_total A \<and> right_total A; left_unique B \<and> right_unique B\<rbrakk> \<Longrightarrow> left_unique (rel_resource A B) \<and> right_unique (rel_resource A B)
[PROOF STEP]
by(blast intro: left_unique_rel_resource right_unique_rel_resource)


[STATEMENT]
lemma ordered_complement_mat: "ordered_comp.N = mat \<v> \<b> (\<lambda> (i,j) . if (\<V>s ! i) \<in> (\<B>s ! j) then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_comp.N = mat ordered_comp.\<v> \<b> (\<lambda>(i, j). if \<V>s ! i \<in> \<B>s ! j then 0 else 1)
[PROOF STEP]
using complement_mat_entries_val
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < ordered_comp.\<v>; ?j < \<b>\<rbrakk> \<Longrightarrow> ordered_comp.N $$ (?i, ?j) = (if \<V>s ! ?i \<in> \<B>s ! ?j then 0 else 1)

goal (1 subgoal):
 1. ordered_comp.N = mat ordered_comp.\<v> \<b> (\<lambda>(i, j). if \<V>s ! i \<in> \<B>s ! j then 0 else 1)
[PROOF STEP]
by (intro eq_matI, simp_all)


[STATEMENT]
lemma vconverseE[elim]:
  assumes "x \<in>\<^sub>\<circ> vconverse A"
  obtains r where "x = \<langle>r, r\<inverse>\<^sub>\<circ>\<rangle>" and "r \<in>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>x = \<langle>r, r\<inverse>\<^sub>\<circ>\<rangle>; r \<in>\<^sub>\<circ> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> vconverse A

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>x = \<langle>r, r\<inverse>\<^sub>\<circ>\<rangle>; r \<in>\<^sub>\<circ> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding vconverse_def
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> (\<lambda>r\<in>\<^sub>\<circ>A. set {\<langle>b, a\<rangle> |a b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r})

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>x = \<langle>r, (\<lambda>r\<in>\<^sub>\<circ>set {r}. set {\<langle>b, a\<rangle> |a b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r})\<lparr>r\<rparr>\<rangle>; r \<in>\<^sub>\<circ> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma antisymmetric_linorder_matrix:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  shows "matrix_stone_relation_algebra.antisymmetric f \<longleftrightarrow> (\<forall>i j . i \<noteq> j \<longrightarrow> f (i,j) = bot \<or> f (j,i) = bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.antisymmetric f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) = bot \<or> f (j, i) = bot)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.antisymmetric f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) = bot \<or> f (j, i) = bot)
[PROOF STEP]
have "matrix_stone_relation_algebra.antisymmetric f \<longleftrightarrow> (\<forall>i j . i \<noteq> j \<longrightarrow> f (i,j) \<sqinter> f (j,i) \<le> bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.antisymmetric f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) \<sqinter> f (j, i) \<le> bot)
[PROOF STEP]
by (simp add: conv_matrix_def inf_matrix_def less_eq_matrix_def one_matrix_def)
[PROOF STATE]
proof (state)
this:
matrix_stone_relation_algebra.antisymmetric f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) \<sqinter> f (j, i) \<le> bot)

goal (1 subgoal):
 1. matrix_stone_relation_algebra.antisymmetric f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) = bot \<or> f (j, i) = bot)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
matrix_stone_relation_algebra.antisymmetric f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) \<sqinter> f (j, i) \<le> bot)

goal (1 subgoal):
 1. matrix_stone_relation_algebra.antisymmetric f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) = bot \<or> f (j, i) = bot)
[PROOF STEP]
by (metis (no_types, opaque_lifting) inf.absorb_iff1 inf.cobounded1 inf_bot_right inf_dense)
[PROOF STATE]
proof (state)
this:
matrix_stone_relation_algebra.antisymmetric f = (\<forall>i j. i \<noteq> j \<longrightarrow> f (i, j) = bot \<or> f (j, i) = bot)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ufa_union_correct: "\<lbrakk> ufa_invar l; x<length l; y<length l \<rbrakk>
  \<Longrightarrow> ufa_\<alpha> (ufa_union l x y) = per_union (ufa_\<alpha> l) x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ufa_invar l; x < length l; y < length l\<rbrakk> \<Longrightarrow> ufa_\<alpha> (ufa_union l x y) = per_union (ufa_\<alpha> l) x y
[PROOF STEP]
unfolding ufa_\<alpha>_def per_union_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ufa_invar l; x < length l; y < length l\<rbrakk> \<Longrightarrow> {(xa, ya). xa < length (ufa_union l x y) \<and> ya < length (ufa_union l x y) \<and> rep_of (ufa_union l x y) xa = rep_of (ufa_union l x y) ya} = {(x, y). x < length l \<and> y < length l \<and> rep_of l x = rep_of l y} \<union> {(xa, ya). (xa, x) \<in> {(x, y). x < length l \<and> y < length l \<and> rep_of l x = rep_of l y} \<and> (ya, y) \<in> {(x, y). x < length l \<and> y < length l \<and> rep_of l x = rep_of l y}} \<union> {(ya, xa). (xa, x) \<in> {(x, y). x < length l \<and> y < length l \<and> rep_of l x = rep_of l y} \<and> (ya, y) \<in> {(x, y). x < length l \<and> y < length l \<and> rep_of l x = rep_of l y}}
[PROOF STEP]
by (auto simp: ufa_union_aux
    split: if_split_asm
  )


[STATEMENT]
lemma strictly_exact_sep_conj:
  "\<lbrakk> strictly_exact P; strictly_exact Q \<rbrakk> \<Longrightarrow> strictly_exact (P \<and>* Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>strictly_exact P; strictly_exact Q\<rbrakk> \<Longrightarrow> strictly_exact (P \<and>* Q)
[PROOF STEP]
apply (rule strictly_exactI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h h'. \<lbrakk>strictly_exact P; strictly_exact Q; (P \<and>* Q) h; (P \<and>* Q) h'\<rbrakk> \<Longrightarrow> h = h'
[PROOF STEP]
apply (erule sep_conjE)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h h' x y xa ya. \<lbrakk>strictly_exact P; strictly_exact Q; P x; Q y; x ## y; h = x + y; P xa; Q ya; xa ## ya; h' = xa + ya\<rbrakk> \<Longrightarrow> h = h'
[PROOF STEP]
apply (drule_tac h="x" and h'="xa" in strictly_exactD, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h h' x y xa ya. \<lbrakk>strictly_exact Q; P x; Q y; x ## y; h = x + y; P xa; Q ya; xa ## ya; h' = xa + ya; x = xa\<rbrakk> \<Longrightarrow> h = h'
[PROOF STEP]
apply (drule_tac h="y" and h'="ya" in strictly_exactD, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h h' x y xa ya. \<lbrakk>P x; Q y; x ## y; h = x + y; P xa; Q ya; xa ## ya; h' = xa + ya; x = xa; y = ya\<rbrakk> \<Longrightarrow> h = h'
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma LIMSEQ_inverse_real_of_nat_add_minus_mult: "(\<lambda>n. r * (1 + - inverse (real (Suc n)))) \<longlonglongrightarrow> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. r * (1 + - inverse (real (Suc n)))) \<longlonglongrightarrow> r
[PROOF STEP]
using tendsto_mult [OF tendsto_const LIMSEQ_inverse_real_of_nat_add_minus [of 1]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ?a * (1 + - inverse (real (Suc x)))) \<longlonglongrightarrow> ?a * 1

goal (1 subgoal):
 1. (\<lambda>n. r * (1 + - inverse (real (Suc n)))) \<longlonglongrightarrow> r
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_in_Reals [intro,simp]: "(\<And>i. i \<in> s \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> sum f s \<in> \<real>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> s \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> sum f s \<in> \<real>
[PROOF STEP]
proof (induct s rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>i. i \<in> A \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> sum f A \<in> \<real>
 2. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> sum f {} \<in> \<real>
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> sum f F \<in> \<real>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> sum f (insert x F) \<in> \<real>
[PROOF STEP]
case infinite
[PROOF STATE]
proof (state)
this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<real>

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>i. i \<in> A \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> sum f A \<in> \<real>
 2. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> sum f {} \<in> \<real>
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> sum f F \<in> \<real>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> sum f (insert x F) \<in> \<real>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<real>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<real>

goal (1 subgoal):
 1. sum f A_ \<in> \<real>
[PROOF STEP]
by (metis Reals_0 sum.infinite)
[PROOF STATE]
proof (state)
this:
sum f A_ \<in> \<real>

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> sum f {} \<in> \<real>
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> sum f F \<in> \<real>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<real>\<rbrakk> \<Longrightarrow> sum f (insert x F) \<in> \<real>
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma Joints_appendD2:
  "ys@xs\<in>Joints (YS@XS) \<Longrightarrow> length ys = length YS \<Longrightarrow> ys \<in> Joints YS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ys @ xs \<in> Joints (YS @ XS); length ys = length YS\<rbrakk> \<Longrightarrow> ys \<in> Joints YS
[PROOF STEP]
by (force simp: Joints_def valuate_def)


[STATEMENT]
lemma digit_decode_lt:
assumes "is \<lhd> ds"
shows "digit_decode ds is < prod_list ds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. digit_decode ds is < prod_list ds
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is \<lhd> ds

goal (1 subgoal):
 1. digit_decode ds is < prod_list ds
[PROOF STEP]
proof (induction rule:valid_index.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. digit_decode [] [] < prod_list []
 2. \<And>is ds i d. \<lbrakk>is \<lhd> ds; digit_decode ds is < prod_list ds; i < d\<rbrakk> \<Longrightarrow> digit_decode (d # ds) (i # is) < prod_list (d # ds)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. digit_decode [] [] < prod_list []
 2. \<And>is ds i d. \<lbrakk>is \<lhd> ds; digit_decode ds is < prod_list ds; i < d\<rbrakk> \<Longrightarrow> digit_decode (d # ds) (i # is) < prod_list (d # ds)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. digit_decode [] [] < prod_list []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
digit_decode [] [] < prod_list []

goal (1 subgoal):
 1. \<And>is ds i d. \<lbrakk>is \<lhd> ds; digit_decode ds is < prod_list ds; i < d\<rbrakk> \<Longrightarrow> digit_decode (d # ds) (i # is) < prod_list (d # ds)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>is ds i d. \<lbrakk>is \<lhd> ds; digit_decode ds is < prod_list ds; i < d\<rbrakk> \<Longrightarrow> digit_decode (d # ds) (i # is) < prod_list (d # ds)
[PROOF STEP]
case (Cons "is" ds i d)
[PROOF STATE]
proof (state)
this:
is \<lhd> ds
i < d
digit_decode ds is < prod_list ds

goal (1 subgoal):
 1. \<And>is ds i d. \<lbrakk>is \<lhd> ds; digit_decode ds is < prod_list ds; i < d\<rbrakk> \<Longrightarrow> digit_decode (d # ds) (i # is) < prod_list (d # ds)
[PROOF STEP]
have "(i + d * digit_decode ds is) div (d * prod_list ds) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i + d * digit_decode ds is) div (d * prod_list ds) = 0
[PROOF STEP]
using Cons.IH Cons.hyps(2) div_mult2_eq
[PROOF STATE]
proof (prove)
using this:
digit_decode ds is < prod_list ds
i < d
?m div (?n * ?q) = ?m div ?n div ?q

goal (1 subgoal):
 1. (i + d * digit_decode ds is) div (d * prod_list ds) = 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(i + d * digit_decode ds is) div (d * prod_list ds) = 0

goal (1 subgoal):
 1. \<And>is ds i d. \<lbrakk>is \<lhd> ds; digit_decode ds is < prod_list ds; i < d\<rbrakk> \<Longrightarrow> digit_decode (d # ds) (i # is) < prod_list (d # ds)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(i + d * digit_decode ds is) div (d * prod_list ds) = 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(i + d * digit_decode ds is) div (d * prod_list ds) = 0

goal (1 subgoal):
 1. digit_decode (d # ds) (i # is) < prod_list (d # ds)
[PROOF STEP]
unfolding digit_decode.simps prod_list.Cons
[PROOF STATE]
proof (prove)
using this:
(i + d * digit_decode ds is) div (d * prod_list ds) = 0

goal (1 subgoal):
 1. i + d * digit_decode ds is < d * prod_list ds
[PROOF STEP]
by (metis (no_types) Cons.IH Cons.hyps(2) div_eq_0_iff mult_eq_0_iff not_less0)
[PROOF STATE]
proof (state)
this:
digit_decode (d # ds) (i # is) < prod_list (d # ds)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) subgroups_card_coprime_imp_compl:
  assumes "subgroup H G" "subgroup J G" "coprime (card H) (card J)"
  shows "complementary H J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complementary H J
[PROOF STEP]
unfolding complementary_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H \<inter> J = {\<one>}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H \<inter> J = {\<one>}
[PROOF STEP]
interpret JH: subgroup "(H \<inter> J)" G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (H \<inter> J) G
[PROOF STEP]
using assms subgroups_Inter_pair
[PROOF STATE]
proof (prove)
using this:
subgroup H G
subgroup J G
coprime (card H) (card J)
\<lbrakk>subgroup ?I G; subgroup ?J G\<rbrakk> \<Longrightarrow> subgroup (?I \<inter> ?J) G

goal (1 subgoal):
 1. subgroup (H \<inter> J) G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H \<inter> J = {\<one>}
[PROOF STEP]
from subgroups_card_coprime_inter_card_one[OF assms]
[PROOF STATE]
proof (chain)
picking this:
card (H \<inter> J) = 1
[PROOF STEP]
show "H \<inter> J = {\<one>}"
[PROOF STATE]
proof (prove)
using this:
card (H \<inter> J) = 1

goal (1 subgoal):
 1. H \<inter> J = {\<one>}
[PROOF STEP]
using JH.one_closed
[PROOF STATE]
proof (prove)
using this:
card (H \<inter> J) = 1
\<one> \<in> H \<inter> J

goal (1 subgoal):
 1. H \<inter> J = {\<one>}
[PROOF STEP]
by (metis card_1_singletonE singletonD)
[PROOF STATE]
proof (state)
this:
H \<inter> J = {\<one>}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pr_index_enumerator_increase2: "pr_index_enumerator n m < pr_index_enumerator n (m + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
let ?a = "pr_index_enumerator n m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
have S1: "pr_index_enumerator n (m + 1) = comp_by_index index_of_id ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_index_enumerator n (m + 1) = comp_by_index index_of_id (pr_index_enumerator n m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pr_index_enumerator n (m + 1) = comp_by_index index_of_id (pr_index_enumerator n m)

goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
have S2: "comp_by_index index_of_id ?a = c_pair 4 (c_pair index_of_id ?a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_by_index index_of_id (pr_index_enumerator n m) = c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
[PROOF STEP]
by (simp add: comp_by_index_def)
[PROOF STATE]
proof (state)
this:
comp_by_index index_of_id (pr_index_enumerator n m) = c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))

goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
have S3: "4 + c_pair index_of_id ?a \<le> c_pair 4 (c_pair index_of_id ?a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 + c_pair index_of_id (pr_index_enumerator n m) \<le> c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
[PROOF STEP]
by (rule sum_le_c_pair)
[PROOF STATE]
proof (state)
this:
4 + c_pair index_of_id (pr_index_enumerator n m) \<le> c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))

goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
4 + c_pair index_of_id (pr_index_enumerator n m) \<le> c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
[PROOF STEP]
have S4: "c_pair index_of_id ?a < c_pair 4 (c_pair index_of_id ?a)"
[PROOF STATE]
proof (prove)
using this:
4 + c_pair index_of_id (pr_index_enumerator n m) \<le> c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))

goal (1 subgoal):
 1. c_pair index_of_id (pr_index_enumerator n m) < c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c_pair index_of_id (pr_index_enumerator n m) < c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))

goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
have S5: "?a \<le> c_pair index_of_id ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr_index_enumerator n m \<le> c_pair index_of_id (pr_index_enumerator n m)
[PROOF STEP]
by (rule arg2_le_c_pair)
[PROOF STATE]
proof (state)
this:
pr_index_enumerator n m \<le> c_pair index_of_id (pr_index_enumerator n m)

goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
from S4 S5
[PROOF STATE]
proof (chain)
picking this:
c_pair index_of_id (pr_index_enumerator n m) < c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
pr_index_enumerator n m \<le> c_pair index_of_id (pr_index_enumerator n m)
[PROOF STEP]
have S6: "?a < c_pair 4 (c_pair index_of_id ?a)"
[PROOF STATE]
proof (prove)
using this:
c_pair index_of_id (pr_index_enumerator n m) < c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
pr_index_enumerator n m \<le> c_pair index_of_id (pr_index_enumerator n m)

goal (1 subgoal):
 1. pr_index_enumerator n m < c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pr_index_enumerator n m < c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))

goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
with S1 S2
[PROOF STATE]
proof (chain)
picking this:
pr_index_enumerator n (m + 1) = comp_by_index index_of_id (pr_index_enumerator n m)
comp_by_index index_of_id (pr_index_enumerator n m) = c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
pr_index_enumerator n m < c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pr_index_enumerator n (m + 1) = comp_by_index index_of_id (pr_index_enumerator n m)
comp_by_index index_of_id (pr_index_enumerator n m) = c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))
pr_index_enumerator n m < c_pair 4 (c_pair index_of_id (pr_index_enumerator n m))

goal (1 subgoal):
 1. pr_index_enumerator n m < pr_index_enumerator n (m + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pr_index_enumerator n m < pr_index_enumerator n (m + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem closedt_mono: assumes le: \<open>i \<le> j\<close>
  shows \<open>closedt i (t::'a term) \<Longrightarrow> closedt j t\<close>
    and \<open>closedts i (ts::'a term list) \<Longrightarrow> closedts j ts\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (closedt i t \<Longrightarrow> closedt j t) &&& (closedts i ts \<Longrightarrow> closedts j ts)
[PROOF STEP]
using le
[PROOF STATE]
proof (prove)
using this:
i \<le> j

goal (1 subgoal):
 1. (closedt i t \<Longrightarrow> closedt j t) &&& (closedts i ts \<Longrightarrow> closedts j ts)
[PROOF STEP]
by (induct t and ts rule: closedt.induct closedts.induct) simp_all


[STATEMENT]
lemma mem_box_real[simp]:
  "(x::real) \<in> box a b \<longleftrightarrow> a < x \<and> x < b"
  "(x::real) \<in> cbox a b \<longleftrightarrow> a \<le> x \<and> x \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> box a b) = (a < x \<and> x < b) &&& (x \<in> cbox a b) = (a \<le> x \<and> x \<le> b)
[PROOF STEP]
by (auto simp: mem_box)


[STATEMENT]
lemma gram_schmidt_triv[simp]: "gram_schmidt_triv n ws = map (\<lambda> x. (x,sq_norm x)) (gram_schmidt n ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gram_schmidt_triv n ws = map (\<lambda>x. (x, \<parallel>x\<parallel>\<^sup>2)) (gram_schmidt n ws)
[PROOF STEP]
unfolding gram_schmidt_def gram_schmidt_triv_def rev_map[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (gram_schmidt_sub_triv n [] ws) = rev (map (\<lambda>x. (x, \<parallel>x\<parallel>\<^sup>2)) (gram_schmidt_sub n [] ws))
[PROOF STEP]
by (auto simp: gram_schmidt_sub_triv[symmetric])


[STATEMENT]
lemma Ln_approx_linear:
  fixes z :: complex
  assumes "norm z < 1"
  shows   "norm (ln (1 + z) - z) \<le> norm z^2 / (1 - norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
let ?f = "\<lambda>n. (-1)^Suc n / of_nat n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
cmod z < 1
[PROOF STEP]
have "(\<lambda>n. ?f n * z^n) sums ln (1 + z)"
[PROOF STATE]
proof (prove)
using this:
cmod z < 1

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
using Ln_series
[PROOF STATE]
proof (prove)
using this:
cmod z < 1
cmod ?z < 1 \<Longrightarrow> (\<lambda>n. (- 1) ^ Suc n / of_nat n * ?z ^ n) sums Ln (1 + ?z)

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
have "(\<lambda>n. (if n = 1 then 1 else 0) * z^n) sums z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (if n = 1 then 1 else 0) * z ^ n) sums z
[PROOF STEP]
using powser_sums_if[of 1]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (if n = 1 then 1::?'a else (0::?'a)) * ?z ^ n) sums ?z ^ 1

goal (1 subgoal):
 1. (\<lambda>n. (if n = 1 then 1 else 0) * z ^ n) sums z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (if n = 1 then 1 else 0) * z ^ n) sums z

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
(\<lambda>n. (if n = 1 then 1 else 0) * z ^ n) sums z
[PROOF STEP]
have "(\<lambda>n. (?f n - (if n = 1 then 1 else 0)) * z^n) sums (ln (1 + z) - z)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
(\<lambda>n. (if n = 1 then 1 else 0) * z ^ n) sums z

goal (1 subgoal):
 1. (\<lambda>n. ((- 1) ^ Suc n / of_nat n - (if n = 1 then 1 else 0)) * z ^ n) sums (Ln (1 + z) - z)
[PROOF STEP]
by (subst left_diff_distrib, intro sums_diff) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ((- 1) ^ Suc n / of_nat n - (if n = 1 then 1 else 0)) * z ^ n) sums (Ln (1 + z) - z)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
from sums_split_initial_segment[OF this, of "Suc 1"]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. ((- 1) ^ Suc (i + Suc 1) / of_nat (i + Suc 1) - (if i + Suc 1 = 1 then 1 else 0)) * z ^ (i + Suc 1)) sums (Ln (1 + z) - z - (\<Sum>i<Suc 1. ((- 1) ^ Suc i / of_nat i - (if i = 1 then 1 else 0)) * z ^ i))
[PROOF STEP]
have "(\<lambda>i. (-(z^2)) * inverse (2 + of_nat i) * (- z)^i) sums (Ln (1 + z) - z)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. ((- 1) ^ Suc (i + Suc 1) / of_nat (i + Suc 1) - (if i + Suc 1 = 1 then 1 else 0)) * z ^ (i + Suc 1)) sums (Ln (1 + z) - z - (\<Sum>i<Suc 1. ((- 1) ^ Suc i / of_nat i - (if i = 1 then 1 else 0)) * z ^ i))

goal (1 subgoal):
 1. (\<lambda>i. - z\<^sup>2 * inverse (2 + of_nat i) * (- z) ^ i) sums (Ln (1 + z) - z)
[PROOF STEP]
by (simp add: power2_eq_square mult_ac power_minus[of z] divide_inverse)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. - z\<^sup>2 * inverse (2 + of_nat i) * (- z) ^ i) sums (Ln (1 + z) - z)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
hence "(Ln (1 + z) - z) = (\<Sum>i. (-(z^2)) * inverse (of_nat (i+2)) * (-z)^i)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. - z\<^sup>2 * inverse (2 + of_nat i) * (- z) ^ i) sums (Ln (1 + z) - z)

goal (1 subgoal):
 1. Ln (1 + z) - z = (\<Sum>i. - z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i)
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
Ln (1 + z) - z = (\<Sum>i. - z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Ln (1 + z) - z = (\<Sum>i. - z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
have A: "summable (\<lambda>n. norm z^2 * (inverse (real_of_nat (Suc (Suc n))) * cmod z ^ n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. (cmod z)\<^sup>2 * (inverse (real (Suc (Suc n))) * cmod z ^ n))
[PROOF STEP]
by (rule summable_mult, rule summable_comparison_test_ev[OF _ summable_geometric[of "norm z"]])
       (auto simp: assms field_simps intro!: always_eventually)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (cmod z)\<^sup>2 * (inverse (real (Suc (Suc n))) * cmod z ^ n))

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
hence "norm (\<Sum>i. (-(z^2)) * inverse (of_nat (i+2)) * (-z)^i)
      \<le> (\<Sum>i. norm (-(z^2) * inverse (of_nat (i+2)) * (-z)^i))"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (cmod z)\<^sup>2 * (inverse (real (Suc (Suc n))) * cmod z ^ n))

goal (1 subgoal):
 1. cmod (\<Sum>i. - z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i) \<le> (\<Sum>i. cmod (- z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i))
[PROOF STEP]
by (intro summable_norm)
       (auto simp: norm_power norm_inverse norm_mult mult_ac simp del: of_nat_add of_nat_Suc)
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>i. - z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i) \<le> (\<Sum>i. cmod (- z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i))

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>i. - z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i) \<le> (\<Sum>i. cmod (- z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i))

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
have "norm ((-z)^2 * (-z)^i) * inverse (of_nat (i+2)) \<le> norm ((-z)^2 * (-z)^i) * 1" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod ((- z)\<^sup>2 * (- z) ^ i) * inverse (real (i + 2)) \<le> cmod ((- z)\<^sup>2 * (- z) ^ i) * 1
[PROOF STEP]
by (intro mult_left_mono) (simp_all add: field_split_simps)
[PROOF STATE]
proof (state)
this:
cmod ((- z)\<^sup>2 * (- z) ^ ?i1) * inverse (real (?i1 + 2)) \<le> cmod ((- z)\<^sup>2 * (- z) ^ ?i1) * 1

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
hence "(\<Sum>i. norm (-(z^2) * inverse (of_nat (i+2)) * (-z)^i))
       \<le> (\<Sum>i. norm (-(z^2) * (-z)^i))"
[PROOF STATE]
proof (prove)
using this:
cmod ((- z)\<^sup>2 * (- z) ^ ?i1) * inverse (real (?i1 + 2)) \<le> cmod ((- z)\<^sup>2 * (- z) ^ ?i1) * 1

goal (1 subgoal):
 1. (\<Sum>i. cmod (- z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i)) \<le> (\<Sum>i. cmod (- z\<^sup>2 * (- z) ^ i))
[PROOF STEP]
using A assms
[PROOF STATE]
proof (prove)
using this:
cmod ((- z)\<^sup>2 * (- z) ^ ?i1) * inverse (real (?i1 + 2)) \<le> cmod ((- z)\<^sup>2 * (- z) ^ ?i1) * 1
summable (\<lambda>n. (cmod z)\<^sup>2 * (inverse (real (Suc (Suc n))) * cmod z ^ n))
cmod z < 1

goal (1 subgoal):
 1. (\<Sum>i. cmod (- z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i)) \<le> (\<Sum>i. cmod (- z\<^sup>2 * (- z) ^ i))
[PROOF STEP]
unfolding norm_power norm_inverse norm_divide norm_mult
[PROOF STATE]
proof (prove)
using this:
(cmod (- z))\<^sup>2 * cmod (- z) ^ ?i1 * inverse (real (?i1 + 2)) \<le> (cmod (- z))\<^sup>2 * cmod (- z) ^ ?i1 * 1
summable (\<lambda>n. (cmod z)\<^sup>2 * (inverse (real (Suc (Suc n))) * cmod z ^ n))
cmod z < 1

goal (1 subgoal):
 1. (\<Sum>i. cmod (- z\<^sup>2) * inverse (cmod (of_nat (i + 2))) * cmod (- z) ^ i) \<le> (\<Sum>i. cmod (- z\<^sup>2) * cmod (- z) ^ i)
[PROOF STEP]
apply (intro suminf_le summable_mult summable_geometric)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n. \<lbrakk>\<And>i. (cmod (- z))\<^sup>2 * cmod (- z) ^ i * inverse (real (i + 2)) \<le> (cmod (- z))\<^sup>2 * cmod (- z) ^ i * 1; summable (\<lambda>n. (cmod z)\<^sup>2 * (inverse (real (Suc (Suc n))) * cmod z ^ n)); cmod z < 1\<rbrakk> \<Longrightarrow> cmod (- z\<^sup>2) * inverse (cmod (of_nat (n + 2))) * cmod (- z) ^ n \<le> cmod (- z\<^sup>2) * cmod (- z) ^ n
 2. \<lbrakk>\<And>i. (cmod (- z))\<^sup>2 * cmod (- z) ^ i * inverse (real (i + 2)) \<le> (cmod (- z))\<^sup>2 * cmod (- z) ^ i * 1; summable (\<lambda>n. (cmod z)\<^sup>2 * (inverse (real (Suc (Suc n))) * cmod z ^ n)); cmod z < 1\<rbrakk> \<Longrightarrow> summable (\<lambda>i. cmod (- z\<^sup>2) * inverse (cmod (of_nat (i + 2))) * cmod (- z) ^ i)
 3. \<lbrakk>\<And>i. (cmod (- z))\<^sup>2 * cmod (- z) ^ i * inverse (real (i + 2)) \<le> (cmod (- z))\<^sup>2 * cmod (- z) ^ i * 1; summable (\<lambda>n. (cmod z)\<^sup>2 * (inverse (real (Suc (Suc n))) * cmod z ^ n)); cmod z < 1\<rbrakk> \<Longrightarrow> norm (cmod (- z)) < 1
[PROOF STEP]
apply (auto simp: norm_power field_simps simp del: of_nat_add of_nat_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>i. cmod (- z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i)) \<le> (\<Sum>i. cmod (- z\<^sup>2 * (- z) ^ i))

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i. cmod (- z\<^sup>2 * inverse (of_nat (i + 2)) * (- z) ^ i)) \<le> (\<Sum>i. cmod (- z\<^sup>2 * (- z) ^ i))

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
have "\<dots> = norm z^2 * (\<Sum>i. norm z^i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. cmod (- z\<^sup>2 * (- z) ^ i)) = (cmod z)\<^sup>2 * (\<Sum>i. cmod z ^ i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cmod z < 1

goal (1 subgoal):
 1. (\<Sum>i. cmod (- z\<^sup>2 * (- z) ^ i)) = (cmod z)\<^sup>2 * (\<Sum>i. cmod z ^ i)
[PROOF STEP]
by (subst suminf_mult [symmetric]) (auto intro!: summable_geometric simp: norm_mult norm_power)
[PROOF STATE]
proof (state)
this:
(\<Sum>i. cmod (- z\<^sup>2 * (- z) ^ i)) = (cmod z)\<^sup>2 * (\<Sum>i. cmod z ^ i)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i. cmod (- z\<^sup>2 * (- z) ^ i)) = (cmod z)\<^sup>2 * (\<Sum>i. cmod z ^ i)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
have "(\<Sum>i. norm z^i) = inverse (1 - norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. cmod z ^ i) = inverse (1 - cmod z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cmod z < 1

goal (1 subgoal):
 1. (\<Sum>i. cmod z ^ i) = inverse (1 - cmod z)
[PROOF STEP]
by (subst suminf_geometric) (simp_all add: divide_inverse)
[PROOF STATE]
proof (state)
this:
(\<Sum>i. cmod z ^ i) = inverse (1 - cmod z)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i. cmod z ^ i) = inverse (1 - cmod z)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
have "norm z^2 * \<dots> = norm z^2 / (1 - norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod z)\<^sup>2 * inverse (1 - cmod z) = (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
by (simp add: divide_inverse)
[PROOF STATE]
proof (state)
this:
(cmod z)\<^sup>2 * inverse (1 - cmod z) = (cmod z)\<^sup>2 / (1 - cmod z)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)

goal (1 subgoal):
 1. cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (Ln (1 + z) - z) \<le> (cmod z)\<^sup>2 / (1 - cmod z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_length_sum_list_rec:
  assumes "m \<ge> 1"
  shows "card {l::nat list. length l = m \<and> sum_list l = N} =
      card {l. length l = (m - 1) \<and> sum_list l = N} +
      card {l. length l = m \<and> sum_list l + 1 = N}"
    (is "card ?C = card ?A + card ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
let ?A' = "{l. length l = m \<and> sum_list l = N \<and> hd l = 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
let ?B' = "{l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
let ?f = "\<lambda>l. 0 # l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
let ?g = "\<lambda>l. (hd l + 1) # tl l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have 1: "xs \<noteq> [] \<Longrightarrow> x = hd xs \<Longrightarrow> x # tl xs = xs" for x :: nat and xs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; x = hd xs\<rbrakk> \<Longrightarrow> x # tl xs = xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?xs2 \<noteq> []; ?x2 = hd ?xs2\<rbrakk> \<Longrightarrow> ?x2 # tl ?xs2 = ?xs2

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have 2: "xs \<noteq> [] \<Longrightarrow> sum_list(tl xs) = sum_list xs - hd xs" for xs :: "nat list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> sum_list (tl xs) = sum_list xs - hd xs
[PROOF STEP]
by (auto simp add: neq_Nil_conv)
[PROOF STATE]
proof (state)
this:
?xs2 \<noteq> [] \<Longrightarrow> sum_list (tl ?xs2) = sum_list ?xs2 - hd ?xs2

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have f: "bij_betw ?f ?A ?A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw ((#) 0) {l. length l = m - 1 \<and> sum_list l = N} {l. length l = m \<and> sum_list l = N \<and> hd l = 0}
[PROOF STEP]
by (rule bij_betw_byWitness[where f' = tl]) (use assms in \<open>auto simp: 2 1 simp flip: length_0_conv\<close>)
[PROOF STATE]
proof (state)
this:
bij_betw ((#) 0) {l. length l = m - 1 \<and> sum_list l = N} {l. length l = m \<and> sum_list l = N \<and> hd l = 0}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have 3: "xs \<noteq> [] \<Longrightarrow> hd xs + (sum_list xs - hd xs) = sum_list xs" for xs :: "nat list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> hd xs + (sum_list xs - hd xs) = sum_list xs
[PROOF STEP]
by (metis 1 sum_list_simps(2) 2)
[PROOF STATE]
proof (state)
this:
?xs2 \<noteq> [] \<Longrightarrow> hd ?xs2 + (sum_list ?xs2 - hd ?xs2) = sum_list ?xs2

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have g: "bij_betw ?g ?B ?B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>l. (hd l + 1) # tl l) {l. length l = m \<and> sum_list l + 1 = N} {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}
[PROOF STEP]
apply (rule bij_betw_byWitness[where f' = "\<lambda>l. (hd l - 1) # tl l"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<forall>a\<in>{l. length l = m \<and> sum_list l + 1 = N}. (hd ((hd a + 1) # tl a) - 1) # tl ((hd a + 1) # tl a) = a
 2. \<forall>a'\<in>{l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}. (hd ((hd a' - 1) # tl a') + 1) # tl ((hd a' - 1) # tl a') = a'
 3. (\<lambda>l. (hd l + 1) # tl l) ` {l. length l = m \<and> sum_list l + 1 = N} \<subseteq> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}
 4. (\<lambda>l. (hd l - 1) # tl l) ` {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0} \<subseteq> {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> m

goal (4 subgoals):
 1. \<forall>a\<in>{l. length l = m \<and> sum_list l + 1 = N}. (hd ((hd a + 1) # tl a) - 1) # tl ((hd a + 1) # tl a) = a
 2. \<forall>a'\<in>{l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}. (hd ((hd a' - 1) # tl a') + 1) # tl ((hd a' - 1) # tl a') = a'
 3. (\<lambda>l. (hd l + 1) # tl l) ` {l. length l = m \<and> sum_list l + 1 = N} \<subseteq> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}
 4. (\<lambda>l. (hd l - 1) # tl l) ` {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0} \<subseteq> {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
by (auto simp: 2 simp flip: length_0_conv intro!: 3)
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>l. (hd l + 1) # tl l) {l. length l = m \<and> sum_list l + 1 = N} {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have fin: "finite {xs. size xs = M \<and> set xs \<subseteq> {0..<N}}" for M N :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. length xs = M \<and> set xs \<subseteq> {0..<N}}
[PROOF STEP]
using finite_lists_length_eq[OF finite_atLeastLessThan] conj_commute
[PROOF STATE]
proof (prove)
using this:
finite {xs. set xs \<subseteq> {?l1..<?u1} \<and> length xs = ?n}
(?P \<and> ?Q) = (?Q \<and> ?P)

goal (1 subgoal):
 1. finite {xs. length xs = M \<and> set xs \<subseteq> {0..<N}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {xs. length xs = ?M2 \<and> set xs \<subseteq> {0..<?N2}}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have fin_A: "finite ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {l. length l = m - 1 \<and> sum_list l = N}
[PROOF STEP]
using fin[of _ "N+1"]
[PROOF STATE]
proof (prove)
using this:
finite {xs. length xs = ?M2 \<and> set xs \<subseteq> {0..<N + 1}}

goal (1 subgoal):
 1. finite {l. length l = m - 1 \<and> sum_list l = N}
[PROOF STEP]
by (intro finite_subset[where ?A = "?A" and ?B = "{xs. size xs = m - 1 \<and> set xs \<subseteq> {0..<N+1}}"])
      (auto simp: member_le_sum_list less_Suc_eq_le)
[PROOF STATE]
proof (state)
this:
finite {l. length l = m - 1 \<and> sum_list l = N}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have fin_B: "finite ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
by (intro finite_subset[where ?A = "?B" and ?B = "{xs. size xs = m \<and> set xs \<subseteq> {0..<N}}"])
      (auto simp: member_le_sum_list less_Suc_eq_le fin)
[PROOF STATE]
proof (state)
this:
finite {l. length l = m \<and> sum_list l + 1 = N}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have uni: "?C = ?A' \<union> ?B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {l. length l = m \<and> sum_list l = N} = {l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{l. length l = m \<and> sum_list l = N} = {l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have disj: "?A' \<inter> ?B' = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<inter> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0} = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<inter> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0} = {}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have "card ?C = card(?A' \<union> ?B')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card ({l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0})
[PROOF STEP]
using uni
[PROOF STATE]
proof (prove)
using this:
{l. length l = m \<and> sum_list l = N} = {l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card ({l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {l. length l = m \<and> sum_list l = N} = card ({l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0})

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {l. length l = m \<and> sum_list l = N} = card ({l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0})

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
have "\<dots> = card ?A + card ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}) = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
using card_Un_disjoint[OF _ _ disj] bij_betw_finite[OF f] bij_betw_finite[OF g]
      bij_betw_same_card[OF f] bij_betw_same_card[OF g] fin_A fin_B
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {l. length l = m \<and> sum_list l = N \<and> hd l = 0}; finite {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}\<rbrakk> \<Longrightarrow> card ({l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}) = card {l. length l = m \<and> sum_list l = N \<and> hd l = 0} + card {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}
finite {l. length l = m - 1 \<and> sum_list l = N} = finite {l. length l = m \<and> sum_list l = N \<and> hd l = 0}
finite {l. length l = m \<and> sum_list l + 1 = N} = finite {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}
card {l. length l = m - 1 \<and> sum_list l = N} = card {l. length l = m \<and> sum_list l = N \<and> hd l = 0}
card {l. length l = m \<and> sum_list l + 1 = N} = card {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}
finite {l. length l = m - 1 \<and> sum_list l = N}
finite {l. length l = m \<and> sum_list l + 1 = N}

goal (1 subgoal):
 1. card ({l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}) = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
card ({l. length l = m \<and> sum_list l = N \<and> hd l = 0} \<union> {l. length l = m \<and> sum_list l = N \<and> hd l \<noteq> 0}) = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}

goal (1 subgoal):
 1. card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card {l. length l = m \<and> sum_list l = N} = card {l. length l = m - 1 \<and> sum_list l = N} + card {l. length l = m \<and> sum_list l + 1 = N}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fmap_ball_all2:
  fixes
  Px :: "'c \<Rightarrow> 'd \<Rightarrow> bool" and
  P :: "'c \<Rightarrow> 'd \<Rightarrow> 'b option \<Rightarrow> bool"
  assumes
  "\<forall>l\<in>dom (f::('a::finite) -~> 'b). \<forall>(x::'c) (y::'d). Px x y \<longrightarrow> P x y (f l)"
  shows
  "\<forall>x y. Px x y \<longrightarrow> (\<forall>l\<in>dom f. P x y (f l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. Px x y \<longrightarrow> (\<forall>l\<in>dom f. P x y (f l))
[PROOF STEP]
proof (intro strip)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y l. \<lbrakk>Px x y; l \<in> dom f\<rbrakk> \<Longrightarrow> P x y (f l)
[PROOF STEP]
fix x y l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y l. \<lbrakk>Px x y; l \<in> dom f\<rbrakk> \<Longrightarrow> P x y (f l)
[PROOF STEP]
assume "Px x y" and "l \<in> dom f"
[PROOF STATE]
proof (state)
this:
Px x y
l \<in> dom f

goal (1 subgoal):
 1. \<And>x y l. \<lbrakk>Px x y; l \<in> dom f\<rbrakk> \<Longrightarrow> P x y (f l)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>l\<in>dom f. \<forall>x y. Px x y \<longrightarrow> P x y (f l)
Px x y
l \<in> dom f
[PROOF STEP]
show "P x y (f l)"
[PROOF STATE]
proof (prove)
using this:
\<forall>l\<in>dom f. \<forall>x y. Px x y \<longrightarrow> P x y (f l)
Px x y
l \<in> dom f

goal (1 subgoal):
 1. P x y (f l)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P x y (f l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma chain_meet1:
  fixes y :: "'a :: Finite_Meet_cpo"
  assumes "chain Y"
  shows "chain (\<lambda> i. Y i \<sqinter> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain (\<lambda>i. Y i \<sqinter> y)
[PROOF STEP]
by (rule chainI) (auto simp add: meet_above_iff intro: chainI chainE[OF assms])


[STATEMENT]
lemma rotate_Suc2[simp]: "rotate n (rotate1 xs) = rotate (Suc n) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rotate n (rotate1 xs) = rotate (Suc n) xs
[PROOF STEP]
apply (simp add:rotate_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rotate1 ^^ n) (rotate1 xs) = rotate1 ((rotate1 ^^ n) xs)
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (rotate1 ^^ 0) (rotate1 xs) = rotate1 ((rotate1 ^^ 0) xs)
 2. \<And>n. (rotate1 ^^ n) (rotate1 xs) = rotate1 ((rotate1 ^^ n) xs) \<Longrightarrow> (rotate1 ^^ Suc n) (rotate1 xs) = rotate1 ((rotate1 ^^ Suc n) xs)
[PROOF STEP]
by auto


[STATEMENT]
lemma additive_strictly_solvent:
  assumes "strictly_solvent \<alpha>\<^sub>1" and "strictly_solvent \<alpha>\<^sub>2"
  shows "strictly_solvent (\<alpha>\<^sub>1 + \<alpha>\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strictly_solvent (\<alpha>\<^sub>1 + \<alpha>\<^sub>2)
[PROOF STEP]
using assms Rep_account_plus
[PROOF STATE]
proof (prove)
using this:
strictly_solvent \<alpha>\<^sub>1
strictly_solvent \<alpha>\<^sub>2
\<pi> (?\<alpha>\<^sub>1 + ?\<alpha>\<^sub>2) = (\<lambda>n. \<pi> ?\<alpha>\<^sub>1 n + \<pi> ?\<alpha>\<^sub>2 n)

goal (1 subgoal):
 1. strictly_solvent (\<alpha>\<^sub>1 + \<alpha>\<^sub>2)
[PROOF STEP]
unfolding strictly_solvent_def plus_account_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 \<le> sum (\<pi> \<alpha>\<^sub>1) {..n}
\<forall>n. 0 \<le> sum (\<pi> \<alpha>\<^sub>2) {..n}
\<pi> (\<iota> (\<lambda>n. \<pi> ?\<alpha>\<^sub>1 n + \<pi> ?\<alpha>\<^sub>2 n)) = (\<lambda>n. \<pi> ?\<alpha>\<^sub>1 n + \<pi> ?\<alpha>\<^sub>2 n)

goal (1 subgoal):
 1. \<forall>n. 0 \<le> sum (\<pi> (\<iota> (\<lambda>n. \<pi> \<alpha>\<^sub>1 n + \<pi> \<alpha>\<^sub>2 n))) {..n}
[PROOF STEP]
by (simp add: Abs_account_inverse sum.distrib)


[STATEMENT]
lemma S_intersections_incident:
  assumes "p \<noteq> 0" and "q \<noteq> 0" and "proj2_abs p \<noteq> proj2_abs q" (is "?pp \<noteq> ?pq")
  and "proj2_incident (proj2_abs p) l" and "proj2_incident (proj2_abs q) l"
  shows "proj2_incident (S_intersection1 p q) l" (is "proj2_incident ?pr l")
  and "proj2_incident (S_intersection2 p q) l" (is "proj2_incident ?ps l")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident (S_intersection1 p q) l &&& proj2_incident (S_intersection2 p q) l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. proj2_incident (S_intersection1 p q) l
 2. proj2_incident (S_intersection2 p q) l
[PROOF STEP]
from \<open>p \<noteq> 0\<close> and \<open>q \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
q \<noteq> 0
[PROOF STEP]
have "proj2_Col ?pp ?pq ?pr" and "proj2_Col ?pp ?pq ?ps"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. proj2_Col (proj2_abs p) (proj2_abs q) (S_intersection1 p q) &&& proj2_Col (proj2_abs p) (proj2_abs q) (S_intersection2 p q)
[PROOF STEP]
by (rule S_intersections_Col)+
[PROOF STATE]
proof (state)
this:
proj2_Col (proj2_abs p) (proj2_abs q) (S_intersection1 p q)
proj2_Col (proj2_abs p) (proj2_abs q) (S_intersection2 p q)

goal (2 subgoals):
 1. proj2_incident (S_intersection1 p q) l
 2. proj2_incident (S_intersection2 p q) l
[PROOF STEP]
with \<open>?pp \<noteq> ?pq\<close> and \<open>proj2_incident ?pp l\<close> and \<open>proj2_incident ?pq l\<close>
    and proj2_incident_iff_Col
[PROOF STATE]
proof (chain)
picking this:
proj2_abs p \<noteq> proj2_abs q
proj2_incident (proj2_abs p) l
proj2_incident (proj2_abs q) l
\<lbrakk>?p \<noteq> ?q; proj2_incident ?p ?l; proj2_incident ?q ?l\<rbrakk> \<Longrightarrow> proj2_incident ?r ?l = proj2_Col ?p ?q ?r
proj2_Col (proj2_abs p) (proj2_abs q) (S_intersection1 p q)
proj2_Col (proj2_abs p) (proj2_abs q) (S_intersection2 p q)
[PROOF STEP]
show "proj2_incident ?pr l" and "proj2_incident ?ps l"
[PROOF STATE]
proof (prove)
using this:
proj2_abs p \<noteq> proj2_abs q
proj2_incident (proj2_abs p) l
proj2_incident (proj2_abs q) l
\<lbrakk>?p \<noteq> ?q; proj2_incident ?p ?l; proj2_incident ?q ?l\<rbrakk> \<Longrightarrow> proj2_incident ?r ?l = proj2_Col ?p ?q ?r
proj2_Col (proj2_abs p) (proj2_abs q) (S_intersection1 p q)
proj2_Col (proj2_abs p) (proj2_abs q) (S_intersection2 p q)

goal (1 subgoal):
 1. proj2_incident (S_intersection1 p q) l &&& proj2_incident (S_intersection2 p q) l
[PROOF STEP]
by fast+
[PROOF STATE]
proof (state)
this:
proj2_incident (S_intersection1 p q) l
proj2_incident (S_intersection2 p q) l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) hom_unique_by_gens:
  assumes "group H"
      and gens: "\<langle>gens\<rangle>\<^bsub>G\<^esub> = carrier G"
      and "h \<in> hom G H"
      and "h' \<in> hom G H"
      and "\<forall>g \<in> gens. h g = h' g"
  shows "\<forall>x \<in> carrier G. h x = h' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>carrier G. h x = h' x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> h x = h' x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> h x = h' x
[PROOF STEP]
from gens
[PROOF STATE]
proof (chain)
picking this:
\<langle>gens\<rangle> = carrier G
[PROOF STEP]
have "gens \<subseteq> carrier G"
[PROOF STATE]
proof (prove)
using this:
\<langle>gens\<rangle> = carrier G

goal (1 subgoal):
 1. gens \<subseteq> carrier G
[PROOF STEP]
by (auto intro:gen_span.gen_gens)
[PROOF STATE]
proof (state)
this:
gens \<subseteq> carrier G

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> h x = h' x
[PROOF STEP]
with assms and group_axioms
[PROOF STATE]
proof (chain)
picking this:
Group.group H
\<langle>gens\<rangle> = carrier G
h \<in> hom G H
h' \<in> hom G H
\<forall>g\<in>gens. h g = h' g
Group.group G
gens \<subseteq> carrier G
[PROOF STEP]
have r: "\<forall>x \<in> \<langle>gens\<rangle>\<^bsub>G\<^esub>. h x = h' x"
[PROOF STATE]
proof (prove)
using this:
Group.group H
\<langle>gens\<rangle> = carrier G
h \<in> hom G H
h' \<in> hom G H
\<forall>g\<in>gens. h g = h' g
Group.group G
gens \<subseteq> carrier G

goal (1 subgoal):
 1. \<forall>x\<in>\<langle>gens\<rangle>. h x = h' x
[PROOF STEP]
by -(erule hom_unique_on_span, auto)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>\<langle>gens\<rangle>. h x = h' x

goal (1 subgoal):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> h x = h' x
[PROOF STEP]
with gens
[PROOF STATE]
proof (chain)
picking this:
\<langle>gens\<rangle> = carrier G
\<forall>x\<in>\<langle>gens\<rangle>. h x = h' x
[PROOF STEP]
show "x \<in> carrier G \<Longrightarrow> h x = h' x"
[PROOF STATE]
proof (prove)
using this:
\<langle>gens\<rangle> = carrier G
\<forall>x\<in>\<langle>gens\<rangle>. h x = h' x

goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> h x = h' x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier G \<Longrightarrow> h x = h' x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_product_group [simp]: "(\<otimes>\<^bsub>product_group I G\<^esub>) = (\<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<otimes>\<^bsub>product_group I G\<^esub>) = (\<lambda>x y. \<lambda>i\<in>I. x i \<otimes>\<^bsub>G i\<^esub> y i)
[PROOF STEP]
by (simp add: product_group_def)


[STATEMENT]
lemma fps_of_poly_sum: "fps_of_poly (sum f A) = sum (\<lambda>x. fps_of_poly (f x)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (sum f A) = (\<Sum>x\<in>A. fps_of_poly (f x))
[PROOF STEP]
by (cases "finite A", induction rule: finite_induct) (simp_all add: fps_of_poly_add)


[STATEMENT]
lemma zip_eq_butlast_last:
  assumes len_gt0: "length xs > 0" and len_eq: "length xs = length ys"
  shows "zip xs ys = zip (butlast xs) (butlast ys) @ [(last xs, last ys)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip xs ys = zip (butlast xs) (butlast ys) @ [(last xs, last ys)]
[PROOF STEP]
using len_eq len_gt0
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
0 < length xs

goal (1 subgoal):
 1. zip xs ys = zip (butlast xs) (butlast ys) @ [(last xs, last ys)]
[PROOF STEP]
by (induct rule: list_induct2) auto


[STATEMENT]
lemma Cauchy_higher_derivative_integral_circlepath:
  assumes contf: "continuous_on (cball z r) f"
      and holf: "f holomorphic_on ball z r"
      and w: "w \<in> ball z r"
    shows "(\<lambda>u. f u / (u - w)^(Suc k)) contour_integrable_on (circlepath z r)"
           (is "?thes1")
      and "(deriv ^^ k) f w = (fact k) / (2 * pi * \<i>) * contour_integral(circlepath z r) (\<lambda>u. f u/(u - w)^(Suc k))"
           (is "?thes2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r &&& (deriv ^^ k) f w = fact k / (complex_of_real (2 * pi) * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
 2. (deriv ^^ k) f w = fact k / (complex_of_real (2 * pi) * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)
[PROOF STEP]
have *: "((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral (2 * pi) * \<i> / (fact k) * (deriv ^^ k) f w)
           (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r)
[PROOF STEP]
using Cauchy_has_contour_integral_higher_derivative_circlepath [OF assms]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>u. f u / (u - w) ^ Suc ?k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact ?k * (deriv ^^ ?k) f w) (circlepath z r)

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r)

goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
 2. (deriv ^^ k) f w = fact k / (complex_of_real (2 * pi) * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)
[PROOF STEP]
show ?thes1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r)

goal (1 subgoal):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
[PROOF STEP]
using contour_integrable_on_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w) (circlepath z r)
?f contour_integrable_on ?g \<equiv> \<exists>i. (?f has_contour_integral i) ?g

goal (1 subgoal):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r

goal (1 subgoal):
 1. (deriv ^^ k) f w = fact k / (complex_of_real (2 * pi) * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)
[PROOF STEP]
show ?thes2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ k) f w = fact k / (complex_of_real (2 * pi) * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)
[PROOF STEP]
unfolding contour_integral_unique [OF *]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ k) f w = fact k / (complex_of_real (2 * pi) * \<i>) * (complex_of_real (2 * pi) * \<i> / fact k * (deriv ^^ k) f w)
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
(deriv ^^ k) f w = fact k / (complex_of_real (2 * pi) * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_poly_nat_pow:
  assumes "a \<in> carrier R"
  shows "(to_poly a) [^]\<^bsub>P\<^esub> (n::nat)= to_poly (a[^]n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_polynomial R a [^]\<^bsub>P\<^esub> n = to_polynomial R (a [^] n)
[PROOF STEP]
using assms UP_cring UP_cring_axioms UP_cring_def UnivPoly.ring_hom_cringI ring_hom_cring.hom_pow to_poly_is_ring_hom
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
cring P
UP_cring R
UP_cring ?R \<equiv> cring ?R
\<lbrakk>cring ?R; cring ?S; ?h \<in> ring_hom ?R ?S\<rbrakk> \<Longrightarrow> ring_hom_cring ?R ?S ?h
\<lbrakk>ring_hom_cring ?R ?S ?h; ?x \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x [^]\<^bsub>?R\<^esub> ?n) = ?h ?x [^]\<^bsub>?S\<^esub> ?n
to_polynomial R \<in> ring_hom R P

goal (1 subgoal):
 1. to_polynomial R a [^]\<^bsub>P\<^esub> n = to_polynomial R (a [^] n)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma pred_unfold:
  "pred n = n - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pred n = n - 1
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma fls_fps_normalized_product_of_inverses:
  assumes "f * g = 1"
  shows   "fls_base_factor_to_fps f * fls_base_factor_to_fps g =
            fps_X ^ (nat (-(fls_subdegree f+fls_subdegree g)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor_to_fps f * fls_base_factor_to_fps g = fps_X ^ nat (- (fls_subdegree f + fls_subdegree g))
[PROOF STEP]
using fls_times_conv_regpart[of "fls_base_factor f" "fls_base_factor g"]
        fls_base_factor_subdegree[of f] fls_base_factor_subdegree[of g]
        fls_normalized_product_of_inverses(1)[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> fls_subdegree (fls_base_factor f); 0 \<le> fls_subdegree (fls_base_factor g)\<rbrakk> \<Longrightarrow> fls_regpart (fls_base_factor f * fls_base_factor g) = fls_base_factor_to_fps f * fls_base_factor_to_fps g
fls_subdegree (fls_base_factor f) = 0
fls_subdegree (fls_base_factor g) = 0
fls_base_factor f * fls_base_factor g = fls_X ^ nat (- (fls_subdegree f + fls_subdegree g))

goal (1 subgoal):
 1. fls_base_factor_to_fps f * fls_base_factor_to_fps g = fps_X ^ nat (- (fls_subdegree f + fls_subdegree g))
[PROOF STEP]
by    (force simp: fls_X_pow_conv_fps_X_pow)