[STATEMENT]
lemma smods_smult_nth[rule_format]:
  fixes p q::"real poly"
  assumes "a\<noteq>0" "b\<noteq>0"
  defines "xs\<equiv>smods p q" and "ys\<equiv>smods (smult a p) (smult b q)"
  shows "\<forall>n<length xs. ys!n = (if even n then smult a (xs!n)  else smult b (xs!n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n<length xs. ys ! n = (if even n then smult a (xs ! n) else smult b (xs ! n))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
b \<noteq> 0
xs \<equiv> smods p q
ys \<equiv> smods (smult a p) (smult b q)

goal (1 subgoal):
 1. \<forall>n<length xs. ys ! n = (if even n then smult a (xs ! n) else smult b (xs ! n))
[PROOF STEP]
proof (induct "smods p q"  arbitrary:p q a b xs ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p q a b. \<lbrakk>[] = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n))
 2. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
[] = smods p q
a \<noteq> 0
b \<noteq> 0

goal (2 subgoals):
 1. \<And>p q a b. \<lbrakk>[] = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n))
 2. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
[] = smods p q
a \<noteq> 0
b \<noteq> 0

goal (1 subgoal):
 1. \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
by (simp split:if_splits)
[PROOF STATE]
proof (state)
this:
\<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n))

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>xs = smods ?p ?q; ?a \<noteq> 0; ?b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods ?p ?q). smods (smult ?a ?p) (smult ?b ?q) ! n = (if even n then smult ?a (smods ?p ?q ! n) else smult ?b (smods ?p ?q ! n))
x # xs = smods p q
a \<noteq> 0
b \<noteq> 0

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
hence "p\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>xs = smods ?p ?q; ?a \<noteq> 0; ?b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods ?p ?q). smods (smult ?a ?p) (smult ?b ?q) ! n = (if even n then smult ?a (smods ?p ?q ! n) else smult ?b (smods ?p ?q ! n))
x # xs = smods p q
a \<noteq> 0
b \<noteq> 0

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

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
define r where "r\<equiv>- (p mod q)"
[PROOF STATE]
proof (state)
this:
r \<equiv> - (p mod q)

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
have xs:"xs=smods q r" "p#xs=smods p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = smods q r &&& p # xs = smods p q
[PROOF STEP]
using Cons.hyps(2) `p\<noteq>0`
[PROOF STATE]
proof (prove)
using this:
x # xs = smods p q
p \<noteq> 0

goal (1 subgoal):
 1. xs = smods q r &&& p # xs = smods p q
[PROOF STEP]
unfolding r_def
[PROOF STATE]
proof (prove)
using this:
x # xs = smods p q
p \<noteq> 0

goal (1 subgoal):
 1. xs = smods q (- (p mod q)) &&& p # xs = smods p q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs = smods q r
p # xs = smods p q

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
define ys where "ys\<equiv>smods (smult b q) (smult a r)"
[PROOF STATE]
proof (state)
this:
ys \<equiv> smods (smult b q) (smult a r)

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
have "- ((smult a p) mod (smult b q)) = smult a r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (smult a p mod smult b q) = smult a r
[PROOF STEP]
by (simp add: Cons.hyps(4) mod_smult_left mod_smult_right r_def)
[PROOF STATE]
proof (state)
this:
- (smult a p mod smult b q) = smult a r

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
hence ys:"smult a p # ys = smods (smult a p) (smult b q)"
[PROOF STATE]
proof (prove)
using this:
- (smult a p mod smult b q) = smult a r

goal (1 subgoal):
 1. smult a p # ys = smods (smult a p) (smult b q)
[PROOF STEP]
using `p\<noteq>0` `a\<noteq>0`
[PROOF STATE]
proof (prove)
using this:
- (smult a p mod smult b q) = smult a r
p \<noteq> 0
a \<noteq> 0

goal (1 subgoal):
 1. smult a p # ys = smods (smult a p) (smult b q)
[PROOF STEP]
unfolding ys_def r_def
[PROOF STATE]
proof (prove)
using this:
- (smult a p mod smult b q) = smult a (- (p mod q))
p \<noteq> 0
a \<noteq> 0

goal (1 subgoal):
 1. smult a p # smods (smult b q) (smult a (- (p mod q))) = smods (smult a p) (smult b q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
smult a p # ys = smods (smult a p) (smult b q)

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
have hyps:"\<And>n. n<length xs \<Longrightarrow> ys ! n = (if even n then smult b (xs ! n) else smult a (xs ! n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n < length xs \<Longrightarrow> ys ! n = (if even n then smult b (xs ! n) else smult a (xs ! n))
[PROOF STEP]
using Cons.hyps(1)[of q r b a,folded xs ys_def] `a\<noteq>0` `b\<noteq>0`
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>xs = xs; b \<noteq> 0; a \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length xs. ys ! n = (if even n then smult b (xs ! n) else smult a (xs ! n))
a \<noteq> 0
b \<noteq> 0

goal (1 subgoal):
 1. \<And>n. n < length xs \<Longrightarrow> ys ! n = (if even n then smult b (xs ! n) else smult a (xs ! n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?n < length xs \<Longrightarrow> ys ! ?n = (if even ?n then smult b (xs ! ?n) else smult a (xs ! ?n))

goal (1 subgoal):
 1. \<And>a x p q aa b. \<lbrakk>\<And>p q a b. \<lbrakk>x = smods p q; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n)); a # x = smods p q; aa \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>n<length (smods p q). smods (smult aa p) (smult b q) ! n = (if even n then smult aa (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?n < length xs \<Longrightarrow> ys ! ?n = (if even ?n then smult b (xs ! ?n) else smult a (xs ! ?n))

goal (1 subgoal):
 1. \<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n))
[PROOF STEP]
apply (fold xs ys)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. n < length xs \<Longrightarrow> ys ! n = (if even n then smult b (xs ! n) else smult a (xs ! n))) \<Longrightarrow> \<forall>n<length (p # xs). (smult a p # ys) ! n = (if even n then smult a ((p # xs) ! n) else smult b ((p # xs) ! n))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<And>n. n < length xs \<Longrightarrow> ys ! n = (if even n then smult b (xs ! n) else smult a (xs ! n)); even n; n < Suc (length xs)\<rbrakk> \<Longrightarrow> (smult a p # ys) ! n = smult a ((p # xs) ! n)
 2. \<And>n. \<lbrakk>\<And>n. n < length xs \<Longrightarrow> ys ! n = (if even n then smult b (xs ! n) else smult a (xs ! n)); odd n; n < Suc (length xs)\<rbrakk> \<Longrightarrow> (smult a p # ys) ! n = smult b ((p # xs) ! n)
[PROOF STEP]
by (case_tac n,auto)+
[PROOF STATE]
proof (state)
this:
\<forall>n<length (smods p q). smods (smult a p) (smult b q) ! n = (if even n then smult a (smods p q ! n) else smult b (smods p q ! n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lfp_transfer:
  assumes \<alpha>: "sup_continuous \<alpha>" and f: "sup_continuous f" and mg: "mono g"
  assumes bot: "\<alpha> bot \<le> lfp g" and eq: "\<And>x. x \<le> lfp f \<Longrightarrow> \<alpha> (f x) = g (\<alpha> x)"
  shows "\<alpha> (lfp f) = lfp g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> (lfp f) = lfp g
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<alpha> (lfp f) \<le> lfp g
 2. lfp g \<le> \<alpha> (lfp f)
[PROOF STEP]
note mf = sup_continuous_mono[OF f]
[PROOF STATE]
proof (state)
this:
mono f

goal (2 subgoals):
 1. \<alpha> (lfp f) \<le> lfp g
 2. lfp g \<le> \<alpha> (lfp f)
[PROOF STEP]
have f_le_lfp: "(f ^^ i) bot \<le> lfp f" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ i) bot \<le> lfp f
[PROOF STEP]
by (induction i) (auto intro: le_lfp mf)
[PROOF STATE]
proof (state)
this:
(f ^^ ?i) bot \<le> lfp f

goal (2 subgoals):
 1. \<alpha> (lfp f) \<le> lfp g
 2. lfp g \<le> \<alpha> (lfp f)
[PROOF STEP]
have "\<alpha> ((f ^^ i) bot) \<le> lfp g" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> ((f ^^ i) bot) \<le> lfp g
[PROOF STEP]
by (induction i) (auto simp: bot eq f_le_lfp intro!: le_lfp mg)
[PROOF STATE]
proof (state)
this:
\<alpha> ((f ^^ ?i) bot) \<le> lfp g

goal (2 subgoals):
 1. \<alpha> (lfp f) \<le> lfp g
 2. lfp g \<le> \<alpha> (lfp f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> ((f ^^ ?i) bot) \<le> lfp g
[PROOF STEP]
show "\<alpha> (lfp f) \<le> lfp g"
[PROOF STATE]
proof (prove)
using this:
\<alpha> ((f ^^ ?i) bot) \<le> lfp g

goal (1 subgoal):
 1. \<alpha> (lfp f) \<le> lfp g
[PROOF STEP]
unfolding sup_continuous_lfp[OF f]
[PROOF STATE]
proof (prove)
using this:
\<alpha> ((f ^^ ?i) bot) \<le> lfp g

goal (1 subgoal):
 1. \<alpha> (SUP i. (f ^^ i) bot) \<le> lfp g
[PROOF STEP]
by (subst \<alpha>[THEN sup_continuousD])
       (auto intro!: mono_funpow sup_continuous_mono[OF f] SUP_least)
[PROOF STATE]
proof (state)
this:
\<alpha> (lfp f) \<le> lfp g

goal (1 subgoal):
 1. lfp g \<le> \<alpha> (lfp f)
[PROOF STEP]
show "lfp g \<le> \<alpha> (lfp f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp g \<le> \<alpha> (lfp f)
[PROOF STEP]
by (rule lfp_lowerbound) (simp add: eq[symmetric] lfp_fixpoint[OF mf])
[PROOF STATE]
proof (state)
this:
lfp g \<le> \<alpha> (lfp f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absolutely_integrable_imp_borel_measurable:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "f absolutely_integrable_on S" "S \<in> sets lebesgue"
  shows "f \<in> borel_measurable (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
using absolutely_integrable_measurable assms
[PROOF STATE]
proof (prove)
using this:
?S \<in> sets lebesgue \<Longrightarrow> (?f absolutely_integrable_on ?S) = (?f \<in> borel_measurable (lebesgue_on ?S) \<and> integrable (lebesgue_on ?S) (norm \<circ> ?f))
f absolutely_integrable_on S
S \<in> sets lebesgue

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
by blast


[STATEMENT]
lemma Vfrom: "Vfrom a i = a \<squnion> \<Squnion>((\<lambda>j. VPow(Vfrom a j)) ` elts i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Vfrom a i = a \<squnion> (\<Squnion>j\<in>elts i. VPow (Vfrom a j))
[PROOF STEP]
apply (subst Vfrom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transrec (\<lambda>f x. a \<squnion> (\<Squnion>y\<in>elts x. VPow (f y))) i = a \<squnion> (\<Squnion>j\<in>elts i. VPow (Vfrom a j))
[PROOF STEP]
apply (subst transrec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<squnion> (\<Squnion>y\<in>elts i. VPow (restrict (transrec (\<lambda>f x. a \<squnion> (\<Squnion>y\<in>elts x. VPow (f y)))) (elts i) y)) = a \<squnion> (\<Squnion>j\<in>elts i. VPow (Vfrom a j))
[PROOF STEP]
using Vfrom_def
[PROOF STATE]
proof (prove)
using this:
Vfrom ?a \<equiv> transrec (\<lambda>f x. ?a \<squnion> (\<Squnion>y\<in>elts x. VPow (f y)))

goal (1 subgoal):
 1. a \<squnion> (\<Squnion>y\<in>elts i. VPow (restrict (transrec (\<lambda>f x. a \<squnion> (\<Squnion>y\<in>elts x. VPow (f y)))) (elts i) y)) = a \<squnion> (\<Squnion>j\<in>elts i. VPow (Vfrom a j))
[PROOF STEP]
by auto


[STATEMENT]
lemma assoc'_apply[simp]: \<open>assoc' (a \<otimes>\<^sub>u (b \<otimes>\<^sub>u c)) =  ((a \<otimes>\<^sub>u b) \<otimes>\<^sub>u c)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. assoc' (a \<otimes>\<^sub>u b \<otimes>\<^sub>u c) = (a \<otimes>\<^sub>u b) \<otimes>\<^sub>u c
[PROOF STEP]
by (auto simp: assoc'_def register_pair_apply Fst_def Snd_def comp_tensor_op)


[STATEMENT]
lemma UINF_subset_mono: "A \<subseteq> B \<Longrightarrow> (\<Sqinter> P\<in>B \<bullet> F(P)) \<sqsubseteq> (\<Sqinter> P\<in>A \<bullet> F(P))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> (\<Sqinter> P \<in> B \<bullet> F P) \<sqsubseteq> (\<Sqinter> P \<in> A \<bullet> F P)
[PROOF STEP]
by (simp add: SUP_subset_mono UINF_as_Sup_collect)


[STATEMENT]
lemma efficient_code:
  assumes "set (ps ()) = (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n" "distinct (ps ())"
  shows   "f n = (if n = 0 then 0 else (\<Prod>(p,d) \<leftarrow> ps (). f_prime p ^ Suc d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n = (if n = 0 then 0::'a else \<Prod>(p, d)\<leftarrow>ps (). f_prime p ^ Suc d)
[PROOF STEP]
using efficient_code_aux[of n "ps ()"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < n; set (ps ()) = (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n; distinct (ps ())\<rbrakk> \<Longrightarrow> f n = (\<Prod>(p, d)\<leftarrow>ps (). f_prime p ^ Suc d)
set (ps ()) = (\<lambda>p. (p, multiplicity p n - 1)) ` prime_factors n
distinct (ps ())

goal (1 subgoal):
 1. f n = (if n = 0 then 0::'a else \<Prod>(p, d)\<leftarrow>ps (). f_prime p ^ Suc d)
[PROOF STEP]
by simp


[STATEMENT]
lemma relevant_vars_upd_bruijn_tl:
  assumes "sorted vs" "distinct vs"
  shows "map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted vs
distinct vs

goal (1 subgoal):
 1. map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs)
[PROOF STEP]
proof (induct vs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>sorted []; distinct []\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn []) = tl (map \<alpha> [])
 2. \<And>a vs. \<lbrakk>\<lbrakk>sorted vs; distinct vs\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs); sorted (a # vs); distinct (a # vs)\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn (a # vs)) = tl (map \<alpha> (a # vs))
[PROOF STEP]
case (Cons a vs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>sorted vs; distinct vs\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs)
sorted (a # vs)
distinct (a # vs)

goal (2 subgoals):
 1. \<lbrakk>sorted []; distinct []\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn []) = tl (map \<alpha> [])
 2. \<And>a vs. \<lbrakk>\<lbrakk>sorted vs; distinct vs\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs); sorted (a # vs); distinct (a # vs)\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn (a # vs)) = tl (map \<alpha> (a # vs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>sorted vs; distinct vs\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs)
sorted (a # vs)
distinct (a # vs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sorted vs; distinct vs\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs)
sorted (a # vs)
distinct (a # vs)

goal (1 subgoal):
 1. map (shift_right \<alpha>) (upd_bruijn (a # vs)) = tl (map \<alpha> (a # vs))
[PROOF STEP]
using le_antisym
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sorted vs; distinct vs\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn vs) = tl (map \<alpha> vs)
sorted (a # vs)
distinct (a # vs)
\<lbrakk>?m \<le> ?n; ?n \<le> ?m\<rbrakk> \<Longrightarrow> ?m = ?n

goal (1 subgoal):
 1. map (shift_right \<alpha>) (upd_bruijn (a # vs)) = tl (map \<alpha> (a # vs))
[PROOF STEP]
by (auto simp: upd_bruijn_def shift_right_def)
       (metis One_nat_def Suc_eq_plus1 le_0_eq shift_right_def shift_right_nt_0)
[PROOF STATE]
proof (state)
this:
map (shift_right \<alpha>) (upd_bruijn (a # vs)) = tl (map \<alpha> (a # vs))

goal (1 subgoal):
 1. \<lbrakk>sorted []; distinct []\<rbrakk> \<Longrightarrow> map (shift_right \<alpha>) (upd_bruijn []) = tl (map \<alpha> [])
[PROOF STEP]
qed (auto simp: upd_bruijn_def)


[STATEMENT]
lemma disjuncts: "(\<exists>q \<in> set (disjuncts p). Ifm bbs bs q) \<longleftrightarrow> Ifm bbs bs p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>q\<in>set (disjuncts p). Ifm bbs bs q) = Ifm bbs bs p
[PROOF STEP]
by (induct p rule: disjuncts.induct) auto


[STATEMENT]
lemma right_invertible_transpose:
  "(\<exists>(B). transpose (A) ** B = mat (1::'a::comm_semiring_1)) \<longleftrightarrow> (\<exists>(B). B ** A = mat 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>B. Finite_Cartesian_Product.transpose A ** B = mat (1::'a)) = (\<exists>B. B ** A = mat (1::'a))
[PROOF STEP]
by (metis matrix_transpose_mul transpose_mat transpose_transpose)


[STATEMENT]
lemma list_strict_desc_distinct: "list_strict_desc (xs::'a::preorder list) \<Longrightarrow> distinct xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_strict_desc xs \<Longrightarrow> distinct xs
[PROOF STEP]
apply (rule_tac ord="(>)" in list_ord_distinct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. list_strict_desc xs \<Longrightarrow> irrefl {(a, b). b < a}
 2. list_strict_desc xs \<Longrightarrow> trans {(x, y). y < x}
 3. list_strict_desc xs \<Longrightarrow> list_ord (\<lambda>x y. y < x) xs
[PROOF STEP]
apply (unfold irrefl_def list_strict_desc_def trans_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. list_ord (\<lambda>x y. y < x) xs \<Longrightarrow> \<forall>a. (a, a) \<notin> {(a, b). b < a}
 2. list_ord (\<lambda>x y. y < x) xs \<Longrightarrow> \<forall>x y z. (x, y) \<in> {(x, y). y < x} \<longrightarrow> (y, z) \<in> {(x, y). y < x} \<longrightarrow> (x, z) \<in> {(x, y). y < x}
 3. list_ord (\<lambda>x y. y < x) xs \<Longrightarrow> list_ord (\<lambda>x y. y < x) xs
[PROOF STEP]
apply (blast intro: less_trans)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma UINF_image_eq [simp]: "UINF (\<lambda>i. \<guillemotleft>i\<guillemotright> \<in>\<^sub>u \<guillemotleft>f ` A\<guillemotright>) g = (\<Sqinter> i\<in>A \<bullet> g(f(i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> i \<in> f ` A \<bullet> g i) = (\<Sqinter> i \<in> A \<bullet> g (f i))
[PROOF STEP]
by (pred_simp, rule_tac cong[of Sup Sup], auto)


[STATEMENT]
lemma new_notin:
 "\<lbrakk> ~finite(UNIV::('a::ref)set); finite(A::'a set); B \<subseteq> A \<rbrakk> \<Longrightarrow>
  new (A) \<notin> B & new A \<noteq> Null"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A\<rbrakk> \<Longrightarrow> new A \<notin> B \<and> new A \<noteq> Null
[PROOF STEP]
apply(unfold new_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A\<rbrakk> \<Longrightarrow> (SOME a. a \<notin> A \<and> a \<noteq> Null) \<notin> B \<and> (SOME a. a \<notin> A \<and> a \<noteq> Null) \<noteq> Null
[PROOF STEP]
apply(rule someI2_ex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A\<rbrakk> \<Longrightarrow> \<exists>a. a \<notin> A \<and> a \<noteq> Null
 2. \<And>x. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A; x \<notin> A \<and> x \<noteq> Null\<rbrakk> \<Longrightarrow> x \<notin> B \<and> x \<noteq> Null
[PROOF STEP]
apply (fast dest:ex_new_if_finite[of "insert Null A"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>infinite UNIV; finite A; B \<subseteq> A; x \<notin> A \<and> x \<noteq> Null\<rbrakk> \<Longrightarrow> x \<notin> B \<and> x \<noteq> Null
[PROOF STEP]
apply (fast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma submap_imp_state_succ_submap_a:
  assumes "s1 \<subseteq>\<^sub>f s2" "s2 \<subseteq>\<^sub>f s3"
  shows "s1 \<subseteq>\<^sub>f s3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s1 \<subseteq>\<^sub>f s3
[PROOF STEP]
using assms fmsubset.rep_eq map_le_trans
[PROOF STATE]
proof (prove)
using this:
s1 \<subseteq>\<^sub>f s2
s2 \<subseteq>\<^sub>f s3
(?x \<subseteq>\<^sub>f ?xa) = (fmlookup ?x \<subseteq>\<^sub>m fmlookup ?xa)
\<lbrakk>?m1.0 \<subseteq>\<^sub>m ?m2.0; ?m2.0 \<subseteq>\<^sub>m ?m3.0\<rbrakk> \<Longrightarrow> ?m1.0 \<subseteq>\<^sub>m ?m3.0

goal (1 subgoal):
 1. s1 \<subseteq>\<^sub>f s3
[PROOF STEP]
by blast

\<comment> \<open>NOTE added lemma.\<close>
\<comment> \<open>TODO refactor into FmapUtils?\<close>


[STATEMENT]
lemma card_fun: "CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
assume "0 < CARD('a)" and "0 < CARD('b)"
[PROOF STATE]
proof (state)
this:
0 < CARD('a)
0 < CARD('b)

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
hence fina: "finite (UNIV :: 'a set)" and finb: "finite (UNIV :: 'b set)"
[PROOF STATE]
proof (prove)
using this:
0 < CARD('a)
0 < CARD('b)

goal (1 subgoal):
 1. finite UNIV &&& finite UNIV
[PROOF STEP]
by(simp_all only: card_ge_0_finite)
[PROOF STATE]
proof (state)
this:
finite UNIV
finite UNIV

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
from finite_distinct_list[OF finb]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xs. set xs = UNIV \<and> distinct xs
[PROOF STEP]
obtain bs
      where bs: "set bs = (UNIV :: 'b set)" and distb: "distinct bs"
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. set xs = UNIV \<and> distinct xs

goal (1 subgoal):
 1. (\<And>bs. \<lbrakk>set bs = UNIV; distinct bs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set bs = UNIV
distinct bs

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
from finite_distinct_list[OF fina]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xs. set xs = UNIV \<and> distinct xs
[PROOF STEP]
obtain as
      where as: "set as = (UNIV :: 'a set)" and dista: "distinct as"
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. set xs = UNIV \<and> distinct xs

goal (1 subgoal):
 1. (\<And>as. \<lbrakk>set as = UNIV; distinct as\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set as = UNIV
distinct as

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
have cb: "CARD('b) = length bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('b) = length bs
[PROOF STEP]
unfolding bs[symmetric] distinct_card[OF distb]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length bs = length bs
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
CARD('b) = length bs

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
have ca: "CARD('a) = length as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a) = length as
[PROOF STEP]
unfolding as[symmetric] distinct_card[OF dista]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length as = length as
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
CARD('a) = length as

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
let ?xs = "map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
have "UNIV = set ?xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
[PROOF STEP]
proof(rule UNIV_eq_I)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
[PROOF STEP]
fix f :: "'a \<Rightarrow> 'b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
[PROOF STEP]
from as
[PROOF STATE]
proof (chain)
picking this:
set as = UNIV
[PROOF STEP]
have "f = the \<circ> map_of (zip as (map f as))"
[PROOF STATE]
proof (prove)
using this:
set as = UNIV

goal (1 subgoal):
 1. f = the \<circ> map_of (zip as (map f as))
[PROOF STEP]
by(auto simp add: map_of_zip_map)
[PROOF STATE]
proof (state)
this:
f = the \<circ> map_of (zip as (map f as))

goal (1 subgoal):
 1. \<And>x. x \<in> set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
[PROOF STEP]
thus "f \<in> set ?xs"
[PROOF STATE]
proof (prove)
using this:
f = the \<circ> map_of (zip as (map f as))

goal (1 subgoal):
 1. f \<in> set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
[PROOF STEP]
using bs
[PROOF STATE]
proof (prove)
using this:
f = the \<circ> map_of (zip as (map f as))
set bs = UNIV

goal (1 subgoal):
 1. f \<in> set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
[PROOF STEP]
by(auto simp add: set_n_lists)
[PROOF STATE]
proof (state)
this:
f \<in> set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
UNIV = set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
UNIV = set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
have "distinct ?xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
[PROOF STEP]
unfolding distinct_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (List.n_lists (length as) bs) \<and> inj_on (\<lambda>ys. the \<circ> map_of (zip as ys)) (set (List.n_lists (length as) bs))
[PROOF STEP]
proof(intro conjI distinct_n_lists distb inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> set (List.n_lists (length as) bs); y \<in> set (List.n_lists (length as) bs); the \<circ> map_of (zip as x) = the \<circ> map_of (zip as y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix xs ys :: "'b list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> set (List.n_lists (length as) bs); y \<in> set (List.n_lists (length as) bs); the \<circ> map_of (zip as x) = the \<circ> map_of (zip as y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume xs: "xs \<in> set (List.n_lists (length as) bs)"
        and ys: "ys \<in> set (List.n_lists (length as) bs)"
        and eq: "the \<circ> map_of (zip as xs) = the \<circ> map_of (zip as ys)"
[PROOF STATE]
proof (state)
this:
xs \<in> set (List.n_lists (length as) bs)
ys \<in> set (List.n_lists (length as) bs)
the \<circ> map_of (zip as xs) = the \<circ> map_of (zip as ys)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> set (List.n_lists (length as) bs); y \<in> set (List.n_lists (length as) bs); the \<circ> map_of (zip as x) = the \<circ> map_of (zip as y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from xs ys
[PROOF STATE]
proof (chain)
picking this:
xs \<in> set (List.n_lists (length as) bs)
ys \<in> set (List.n_lists (length as) bs)
[PROOF STEP]
have [simp]: "length xs = length as" "length ys = length as"
[PROOF STATE]
proof (prove)
using this:
xs \<in> set (List.n_lists (length as) bs)
ys \<in> set (List.n_lists (length as) bs)

goal (1 subgoal):
 1. length xs = length as &&& length ys = length as
[PROOF STEP]
by(simp_all add: length_n_lists_elem)
[PROOF STATE]
proof (state)
this:
length xs = length as
length ys = length as

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> set (List.n_lists (length as) bs); y \<in> set (List.n_lists (length as) bs); the \<circ> map_of (zip as x) = the \<circ> map_of (zip as y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "map_of (zip as xs) = map_of (zip as ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (zip as xs) = map_of (zip as ys)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. map_of (zip as xs) x = map_of (zip as ys) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. map_of (zip as xs) x = map_of (zip as ys) x
[PROOF STEP]
from as bs
[PROOF STATE]
proof (chain)
picking this:
set as = UNIV
set bs = UNIV
[PROOF STEP]
have "\<exists>y. map_of (zip as xs) x = Some y" "\<exists>y. map_of (zip as ys) x = Some y"
[PROOF STATE]
proof (prove)
using this:
set as = UNIV
set bs = UNIV

goal (1 subgoal):
 1. \<exists>y. map_of (zip as xs) x = Some y &&& \<exists>y. map_of (zip as ys) x = Some y
[PROOF STEP]
by(simp_all add: map_of_zip_is_Some[symmetric])
[PROOF STATE]
proof (state)
this:
\<exists>y. map_of (zip as xs) x = Some y
\<exists>y. map_of (zip as ys) x = Some y

goal (1 subgoal):
 1. \<And>x. map_of (zip as xs) x = map_of (zip as ys) x
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
the \<circ> map_of (zip as xs) = the \<circ> map_of (zip as ys)
\<exists>y. map_of (zip as xs) x = Some y
\<exists>y. map_of (zip as ys) x = Some y
[PROOF STEP]
show "map_of (zip as xs) x = map_of (zip as ys) x"
[PROOF STATE]
proof (prove)
using this:
the \<circ> map_of (zip as xs) = the \<circ> map_of (zip as ys)
\<exists>y. map_of (zip as xs) x = Some y
\<exists>y. map_of (zip as ys) x = Some y

goal (1 subgoal):
 1. map_of (zip as xs) x = map_of (zip as ys) x
[PROOF STEP]
by(auto dest: fun_cong[where x=x])
[PROOF STATE]
proof (state)
this:
map_of (zip as xs) x = map_of (zip as ys) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map_of (zip as xs) = map_of (zip as ys)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> set (List.n_lists (length as) bs); y \<in> set (List.n_lists (length as) bs); the \<circ> map_of (zip as x) = the \<circ> map_of (zip as y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
with dista
[PROOF STATE]
proof (chain)
picking this:
distinct as
map_of (zip as xs) = map_of (zip as ys)
[PROOF STEP]
show "xs = ys"
[PROOF STATE]
proof (prove)
using this:
distinct as
map_of (zip as xs) = map_of (zip as ys)

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
by(simp add: map_of_zip_inject)
[PROOF STATE]
proof (state)
this:
xs = ys

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
distinct (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
hence "card (set ?xs) = length ?xs"
[PROOF STATE]
proof (prove)
using this:
distinct (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))

goal (1 subgoal):
 1. card (set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))) = length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
[PROOF STEP]
by(simp only: distinct_card)
[PROOF STATE]
proof (state)
this:
card (set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))) = length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))) = length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
have "length ?xs = length bs ^ length as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs)) = length bs ^ length as
[PROOF STEP]
by(simp add: length_n_lists)
[PROOF STATE]
proof (state)
this:
length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs)) = length bs ^ length as

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
UNIV = set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
card (set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))) = length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs)) = length bs ^ length as
[PROOF STEP]
have "CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)"
[PROOF STATE]
proof (prove)
using this:
UNIV = set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
card (set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))) = length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs)) = length bs ^ length as

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)
[PROOF STEP]
using cb ca
[PROOF STATE]
proof (prove)
using this:
UNIV = set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
card (set (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))) = length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs))
length (map (\<lambda>ys. the \<circ> map_of (zip as ys)) (List.n_lists (length as) bs)) = length bs ^ length as
CARD('b) = length bs
CARD('a) = length as

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < CARD('a); 0 < CARD('b)\<rbrakk> \<Longrightarrow> CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < CARD('a); 0 < CARD('b)\<rbrakk> \<Longrightarrow> CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < CARD('a); 0 < CARD('b)\<rbrakk> \<Longrightarrow> CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
assume cb: "CARD('b) = 1"
[PROOF STATE]
proof (state)
this:
CARD('b) = 1

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
CARD('b) = 1
[PROOF STEP]
obtain b where b: "UNIV = {b :: 'b}"
[PROOF STATE]
proof (prove)
using this:
CARD('b) = 1

goal (1 subgoal):
 1. (\<And>b. UNIV = {b} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: card_Suc_eq)
[PROOF STATE]
proof (state)
this:
UNIV = {b}

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
have eq: "UNIV = {\<lambda>x :: 'a. b ::'b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = {\<lambda>x. b}
[PROOF STEP]
proof(rule UNIV_eq_I)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<lambda>x. b}
[PROOF STEP]
fix x :: "'a \<Rightarrow> 'b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<lambda>x. b}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<lambda>x. b}
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<lambda>x. b}
[PROOF STEP]
have "x y \<in> UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x y \<in> UNIV
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x y \<in> UNIV

goal (1 subgoal):
 1. \<And>x. x \<in> {\<lambda>x. b}
[PROOF STEP]
hence "x y = b"
[PROOF STATE]
proof (prove)
using this:
x y \<in> UNIV

goal (1 subgoal):
 1. x y = b
[PROOF STEP]
unfolding b
[PROOF STATE]
proof (prove)
using this:
x y \<in> {b}

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

goal (1 subgoal):
 1. \<And>x. x \<in> {\<lambda>x. b}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
x ?y2 = b

goal (1 subgoal):
 1. \<And>x. x \<in> {\<lambda>x. b}
[PROOF STEP]
thus "x \<in> {\<lambda>x. b}"
[PROOF STATE]
proof (prove)
using this:
x ?y2 = b

goal (1 subgoal):
 1. x \<in> {\<lambda>x. b}
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
x \<in> {\<lambda>x. b}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
UNIV = {\<lambda>x. b}

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
have "CARD('a \<Rightarrow> 'b) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = 1
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {\<lambda>x. b} = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
CARD('a \<Rightarrow> 'b) = 1

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
CARD('b) = 1 \<Longrightarrow> CARD('a \<Rightarrow> 'b) = 1

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < CARD('a); 0 < CARD('b)\<rbrakk> \<Longrightarrow> CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)
CARD('b) = 1 \<Longrightarrow> CARD('a \<Rightarrow> 'b) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < CARD('a); 0 < CARD('b)\<rbrakk> \<Longrightarrow> CARD('a \<Rightarrow> 'b) = CARD('b) ^ CARD('a)
CARD('b) = 1 \<Longrightarrow> CARD('a \<Rightarrow> 'b) = 1

goal (1 subgoal):
 1. CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)
[PROOF STEP]
by(auto simp del: One_nat_def)(auto simp add: card_eq_0_iff dest: finite_fun_UNIVD2 finite_fun_UNIVD1)
[PROOF STATE]
proof (state)
this:
CARD('a \<Rightarrow> 'b) = (if CARD('a) \<noteq> 0 \<and> CARD('b) \<noteq> 0 \<or> CARD('b) = 1 then CARD('b) ^ CARD('a) else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_sum:
 assumes "a \<ge> 0" and "b \<ge> 0"
 shows "nat (a+b) = (nat a) + (nat b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat (a + b) = nat a + nat b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> a
0 \<le> b

goal (1 subgoal):
 1. nat (a + b) = nat a + nat b
[PROOF STEP]
by auto


[STATEMENT]
lemma (in FinDimVectorSpace) endomorph_has_eigenvector :
  assumes alg_closed: "\<And>p::'a poly. degree p > 0 \<Longrightarrow> \<exists>c. poly p c = 0"
  and     dim       : "dim V > 0"
  and     endo      : "VectorSpaceEnd smult V T"
  shows   "\<exists>c u. u \<in> V \<and> u \<noteq> 0 \<and> T u = c \<cdot> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
define Tpolymap where "Tpolymap = VectorSpaceEnd.polymap smult V T"
[PROOF STATE]
proof (state)
this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
from dim
[PROOF STATE]
proof (chain)
picking this:
0 < dim_R V
[PROOF STEP]
obtain v where v: "v \<in> V" "v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < dim_R V

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> V; v \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using dim_nonzero nonempty
[PROOF STATE]
proof (prove)
using this:
0 < dim_R V
0 < dim_R ?M \<Longrightarrow> ?M \<noteq> 0
V \<noteq> {}

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> V; v \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> V
v \<noteq> (0::'b)

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
define Tpows where "Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim V)]"
[PROOF STATE]
proof (state)
this:
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
define Tpows_v where "Tpows_v = map (\<lambda>S. S v) Tpows"
[PROOF STATE]
proof (state)
this:
Tpows_v = map (\<lambda>S. S v) Tpows

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
with endo Tpows_def v(1)
[PROOF STATE]
proof (chain)
picking this:
VEnd T
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
v \<in> V
Tpows_v = map (\<lambda>S. S v) Tpows
[PROOF STEP]
have Tpows_v_V: "set Tpows_v \<subseteq> V"
[PROOF STATE]
proof (prove)
using this:
VEnd T
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
v \<in> V
Tpows_v = map (\<lambda>S. S v) Tpows

goal (1 subgoal):
 1. set Tpows_v \<subseteq> V
[PROOF STEP]
using VectorSpaceEnd.endpow_list_apply_closed
[PROOF STATE]
proof (prove)
using this:
VEnd T
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
v \<in> V
Tpows_v = map (\<lambda>S. S v) Tpows
\<lbrakk>VectorSpaceEnd ?smult ?V ?T; ?v \<in> ?V\<rbrakk> \<Longrightarrow> set (map (\<lambda>S. S ?v) (map (VectorSpaceEnd.endpow ?V ?T) [0..<?k])) \<subseteq> ?V

goal (1 subgoal):
 1. set Tpows_v \<subseteq> V
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
set Tpows_v \<subseteq> V

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set Tpows_v \<subseteq> V

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
from Tpows_v_def Tpows_def Tpows_v_V
[PROOF STATE]
proof (chain)
picking this:
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
set Tpows_v \<subseteq> V
[PROOF STEP]
have "\<not> lin_independent Tpows_v"
[PROOF STATE]
proof (prove)
using this:
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
set Tpows_v \<subseteq> V

goal (1 subgoal):
 1. \<not> R_lin_independent Tpows_v
[PROOF STEP]
using too_long_lin_dependent
[PROOF STATE]
proof (prove)
using this:
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
set Tpows_v \<subseteq> V
\<lbrakk>set ?us \<subseteq> V; dim_R V < length ?us\<rbrakk> \<Longrightarrow> \<not> R_lin_independent ?us

goal (1 subgoal):
 1. \<not> R_lin_independent Tpows_v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> R_lin_independent Tpows_v

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set Tpows_v \<subseteq> V
\<not> R_lin_independent Tpows_v
[PROOF STEP]
obtain as
    where as: "set as \<noteq> 0" "length as = length Tpows_v" "as \<bullet>\<cdot> Tpows_v = 0"
[PROOF STATE]
proof (prove)
using this:
set Tpows_v \<subseteq> V
\<not> R_lin_independent Tpows_v

goal (1 subgoal):
 1. (\<And>as. \<lbrakk>set as \<noteq> 0; length as = length Tpows_v; as \<bullet>\<cdot> Tpows_v = (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lin_dependent_dependence_relation
[PROOF STATE]
proof (prove)
using this:
set Tpows_v \<subseteq> V
\<not> R_lin_independent Tpows_v
\<lbrakk>set ?ms \<subseteq> V; \<not> R_lin_independent ?ms\<rbrakk> \<Longrightarrow> \<exists>rs. set rs \<subseteq> UNIV \<and> set rs \<noteq> 0 \<and> length rs = length ?ms \<and> rs \<bullet>\<cdot> ?ms = (0::'b)

goal (1 subgoal):
 1. (\<And>as. \<lbrakk>set as \<noteq> 0; length as = length Tpows_v; as \<bullet>\<cdot> Tpows_v = (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
set as \<noteq> 0
length as = length Tpows_v
as \<bullet>\<cdot> Tpows_v = (0::'b)

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
define p where "p = Poly as"
[PROOF STATE]
proof (state)
this:
p = Poly as

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
with dim Tpows_def Tpows_v_def as(1,2)
[PROOF STATE]
proof (chain)
picking this:
0 < dim_R V
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
Tpows_v = map (\<lambda>S. S v) Tpows
set as \<noteq> 0
length as = length Tpows_v
p = Poly as
[PROOF STEP]
have p_n0: "p \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < dim_R V
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
Tpows_v = map (\<lambda>S. S v) Tpows
set as \<noteq> 0
length as = length Tpows_v
p = Poly as

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
using nonzero_coeffs_nonzero_poly[of as]
[PROOF STATE]
proof (prove)
using this:
0 < dim_R V
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
Tpows_v = map (\<lambda>S. S v) Tpows
set as \<noteq> 0
length as = length Tpows_v
p = Poly as
\<lbrakk>as \<noteq> []; set as \<noteq> 0\<rbrakk> \<Longrightarrow> Poly as \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
define Tpows' where "Tpows' = map (VectorSpaceEnd.endpow V T) [0..<Suc (degree p)]"
[PROOF STATE]
proof (state)
this:
Tpows' = map (VectorSpaceEnd.endpow V T) [0..<Suc (degree p)]

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
define Tpows_v' where "Tpows_v' = map (\<lambda>S. S v) Tpows'"
[PROOF STATE]
proof (state)
this:
Tpows_v' = map (\<lambda>S. S v) Tpows'

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
have "Tpows' = take (Suc (degree p)) Tpows"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tpows' = take (Suc (degree p)) Tpows
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Tpows' = take (Suc (degree p)) Tpows
[PROOF STEP]
from Tpows_def
[PROOF STATE]
proof (chain)
picking this:
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
[PROOF STEP]
have  1: "take (Suc (degree p)) Tpows = map (VectorSpaceEnd.endpow V T)
                      (take (Suc (degree p)) [0..<Suc (dim V)])"
[PROOF STATE]
proof (prove)
using this:
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]

goal (1 subgoal):
 1. take (Suc (degree p)) Tpows = map (VectorSpaceEnd.endpow V T) (take (Suc (degree p)) [0..<Suc (dim_R V)])
[PROOF STEP]
using take_map[of _ _ "[0..<Suc (dim V)]"]
[PROOF STATE]
proof (prove)
using this:
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
take ?n (map ?f [0..<Suc (dim_R V)]) = map ?f (take ?n [0..<Suc (dim_R V)])

goal (1 subgoal):
 1. take (Suc (degree p)) Tpows = map (VectorSpaceEnd.endpow V T) (take (Suc (degree p)) [0..<Suc (dim_R V)])
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
take (Suc (degree p)) Tpows = map (VectorSpaceEnd.endpow V T) (take (Suc (degree p)) [0..<Suc (dim_R V)])

goal (1 subgoal):
 1. Tpows' = take (Suc (degree p)) Tpows
[PROOF STEP]
from p_n0 p_def as(2) Tpows_v_def Tpows_def
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
p = Poly as
length as = length Tpows_v
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
[PROOF STEP]
have  2: "take (Suc (degree p)) [0..<Suc (dim V)] = [0..<Suc (degree p)]"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
p = Poly as
length as = length Tpows_v
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]

goal (1 subgoal):
 1. take (Suc (degree p)) [0..<Suc (dim_R V)] = [0..<Suc (degree p)]
[PROOF STEP]
using length_coeffs_degree[of p] length_strip_while_le[of "(=) 0" as]
            take_upt[of 0 "Suc (degree p)" "Suc (dim V)"]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
p = Poly as
length as = length Tpows_v
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows = map (VectorSpaceEnd.endpow V T) [0..<Suc (dim_R V)]
p \<noteq> 0 \<Longrightarrow> length (coeffs p) = Suc (degree p)
length (strip_while ((=) (0::'a)) as) \<le> length as
0 + Suc (degree p) \<le> Suc (dim_R V) \<Longrightarrow> take (Suc (degree p)) [0..<Suc (dim_R V)] = [0..<0 + Suc (degree p)]

goal (1 subgoal):
 1. take (Suc (degree p)) [0..<Suc (dim_R V)] = [0..<Suc (degree p)]
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
take (Suc (degree p)) [0..<Suc (dim_R V)] = [0..<Suc (degree p)]

goal (1 subgoal):
 1. Tpows' = take (Suc (degree p)) Tpows
[PROOF STEP]
from 1 Tpows'_def
[PROOF STATE]
proof (chain)
picking this:
take (Suc (degree p)) Tpows = map (VectorSpaceEnd.endpow V T) (take (Suc (degree p)) [0..<Suc (dim_R V)])
Tpows' = map (VectorSpaceEnd.endpow V T) [0..<Suc (degree p)]
[PROOF STEP]
have "take (Suc (degree p)) Tpows = Tpows'"
[PROOF STATE]
proof (prove)
using this:
take (Suc (degree p)) Tpows = map (VectorSpaceEnd.endpow V T) (take (Suc (degree p)) [0..<Suc (dim_R V)])
Tpows' = map (VectorSpaceEnd.endpow V T) [0..<Suc (degree p)]

goal (1 subgoal):
 1. take (Suc (degree p)) Tpows = Tpows'
[PROOF STEP]
using subst[OF 2]
[PROOF STATE]
proof (prove)
using this:
take (Suc (degree p)) Tpows = map (VectorSpaceEnd.endpow V T) (take (Suc (degree p)) [0..<Suc (dim_R V)])
Tpows' = map (VectorSpaceEnd.endpow V T) [0..<Suc (degree p)]
?P (take (Suc (degree p)) [0..<Suc (dim_R V)]) \<Longrightarrow> ?P [0..<Suc (degree p)]

goal (1 subgoal):
 1. take (Suc (degree p)) Tpows = Tpows'
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
take (Suc (degree p)) Tpows = Tpows'

goal (1 subgoal):
 1. Tpows' = take (Suc (degree p)) Tpows
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
take (Suc (degree p)) Tpows = Tpows'

goal (1 subgoal):
 1. Tpows' = take (Suc (degree p)) Tpows
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Tpows' = take (Suc (degree p)) Tpows

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Tpows' = take (Suc (degree p)) Tpows

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
with Tpows_v_def Tpows_v'_def
[PROOF STATE]
proof (chain)
picking this:
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows_v' = map (\<lambda>S. S v) Tpows'
Tpows' = take (Suc (degree p)) Tpows
[PROOF STEP]
have "Tpows_v' = take (Suc (degree p)) Tpows_v"
[PROOF STATE]
proof (prove)
using this:
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows_v' = map (\<lambda>S. S v) Tpows'
Tpows' = take (Suc (degree p)) Tpows

goal (1 subgoal):
 1. Tpows_v' = take (Suc (degree p)) Tpows_v
[PROOF STEP]
using take_map[of _ "\<lambda>S. S v" Tpows]
[PROOF STATE]
proof (prove)
using this:
Tpows_v = map (\<lambda>S. S v) Tpows
Tpows_v' = map (\<lambda>S. S v) Tpows'
Tpows' = take (Suc (degree p)) Tpows
take ?n (map (\<lambda>S. S v) Tpows) = map (\<lambda>S. S v) (take ?n Tpows)

goal (1 subgoal):
 1. Tpows_v' = take (Suc (degree p)) Tpows_v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Tpows_v' = take (Suc (degree p)) Tpows_v

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Tpows_v' = take (Suc (degree p)) Tpows_v

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
from p_def Tpows_v_V as(3) Tpows_v'_def
[PROOF STATE]
proof (chain)
picking this:
p = Poly as
set Tpows_v \<subseteq> V
as \<bullet>\<cdot> Tpows_v = (0::'b)
Tpows_v' = map (\<lambda>S. S v) Tpows'
[PROOF STEP]
have "(coeffs p) \<bullet>\<cdot> Tpows_v = 0"
[PROOF STATE]
proof (prove)
using this:
p = Poly as
set Tpows_v \<subseteq> V
as \<bullet>\<cdot> Tpows_v = (0::'b)
Tpows_v' = map (\<lambda>S. S v) Tpows'

goal (1 subgoal):
 1. coeffs p \<bullet>\<cdot> Tpows_v = (0::'b)
[PROOF STEP]
using lincomb_strip_while_0coeffs
[PROOF STATE]
proof (prove)
using this:
p = Poly as
set Tpows_v \<subseteq> V
as \<bullet>\<cdot> Tpows_v = (0::'b)
Tpows_v' = map (\<lambda>S. S v) Tpows'
set ?ms \<subseteq> V \<Longrightarrow> strip_while ((=) (0::'a)) ?as \<bullet>\<cdot> ?ms = ?as \<bullet>\<cdot> ?ms

goal (1 subgoal):
 1. coeffs p \<bullet>\<cdot> Tpows_v = (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeffs p \<bullet>\<cdot> Tpows_v = (0::'b)

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Tpows_v' = take (Suc (degree p)) Tpows_v
coeffs p \<bullet>\<cdot> Tpows_v = (0::'b)
[PROOF STEP]
have "(coeffs p) \<bullet>\<cdot> Tpows_v' = 0"
[PROOF STATE]
proof (prove)
using this:
Tpows_v' = take (Suc (degree p)) Tpows_v
coeffs p \<bullet>\<cdot> Tpows_v = (0::'b)

goal (1 subgoal):
 1. coeffs p \<bullet>\<cdot> Tpows_v' = (0::'b)
[PROOF STEP]
using p_n0 lincomb_conv_take_right[of "coeffs p"] length_coeffs_degree[of p]
[PROOF STATE]
proof (prove)
using this:
Tpows_v' = take (Suc (degree p)) Tpows_v
coeffs p \<bullet>\<cdot> Tpows_v = (0::'b)
p \<noteq> 0
coeffs p \<bullet>\<cdot> ?ms = coeffs p \<bullet>\<cdot> take (length (coeffs p)) ?ms
p \<noteq> 0 \<Longrightarrow> length (coeffs p) = Suc (degree p)

goal (1 subgoal):
 1. coeffs p \<bullet>\<cdot> Tpows_v' = (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeffs p \<bullet>\<cdot> Tpows_v' = (0::'b)

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
with Tpolymap_def v(1) Tpows_v'_def Tpows'_def
[PROOF STATE]
proof (chain)
picking this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
v \<in> V
Tpows_v' = map (\<lambda>S. S v) Tpows'
Tpows' = map (VectorSpaceEnd.endpow V T) [0..<Suc (degree p)]
coeffs p \<bullet>\<cdot> Tpows_v' = (0::'b)
[PROOF STEP]
have "Tpolymap p v = 0"
[PROOF STATE]
proof (prove)
using this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
v \<in> V
Tpows_v' = map (\<lambda>S. S v) Tpows'
Tpows' = map (VectorSpaceEnd.endpow V T) [0..<Suc (degree p)]
coeffs p \<bullet>\<cdot> Tpows_v' = (0::'b)

goal (1 subgoal):
 1. Tpolymap p v = (0::'b)
[PROOF STEP]
using VectorSpaceEnd.polymap_apply[OF endo]
[PROOF STATE]
proof (prove)
using this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
v \<in> V
Tpows_v' = map (\<lambda>S. S v) Tpows'
Tpows' = map (VectorSpaceEnd.endpow V T) [0..<Suc (degree p)]
coeffs p \<bullet>\<cdot> Tpows_v' = (0::'b)
?v \<in> V \<Longrightarrow> VectorSpaceEnd.polymap (\<cdot>) V T ?p ?v = coeffs ?p \<bullet>\<cdot> map (\<lambda>S. S ?v) (map (VectorSpaceEnd.endpow V T) [0..<Suc (degree ?p)])

goal (1 subgoal):
 1. Tpolymap p v = (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Tpolymap p v = (0::'b)

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
with alg_closed Tpolymap_def v endo p_n0
[PROOF STATE]
proof (chain)
picking this:
0 < degree ?p3 \<Longrightarrow> \<exists>c. poly ?p3 c = (0::'a)
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
v \<in> V
v \<noteq> (0::'b)
VEnd T
p \<noteq> 0
Tpolymap p v = (0::'b)
[PROOF STEP]
obtain c
    where "\<not> inj_on (Tpolymap [:-c, 1:]) V"
[PROOF STATE]
proof (prove)
using this:
0 < degree ?p3 \<Longrightarrow> \<exists>c. poly ?p3 c = (0::'a)
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
v \<in> V
v \<noteq> (0::'b)
VEnd T
p \<noteq> 0
Tpolymap p v = (0::'b)

goal (1 subgoal):
 1. (\<And>c. \<not> inj_on (Tpolymap [:- c, 1::'a:]) V \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using VectorSpaceEnd.VEnd_polymap VectorSpaceEnd.nonzero_Ker_el_imp_n_inj
          VectorSpaceEnd.n_inj_polymap_findlinear[OF endo]
[PROOF STATE]
proof (prove)
using this:
0 < degree ?p3 \<Longrightarrow> \<exists>c. poly ?p3 c = (0::'a)
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
v \<in> V
v \<noteq> (0::'b)
VEnd T
p \<noteq> 0
Tpolymap p v = (0::'b)
VectorSpaceEnd ?smult ?V ?T \<Longrightarrow> VectorSpaceEnd ?smult ?V (VectorSpaceEnd.polymap ?smult ?V ?T ?p)
\<lbrakk>VectorSpaceEnd ?smult ?V ?T; ?g \<in> ?V; ?g \<noteq> (0::?'v); ?T ?g = (0::?'v)\<rbrakk> \<Longrightarrow> \<not> inj_on ?T ?V
\<lbrakk>\<And>p. 0 < degree p \<Longrightarrow> \<exists>c. poly p c = (0::'a); ?p \<noteq> 0; \<not> inj_on (VectorSpaceEnd.polymap (\<cdot>) V T ?p) V\<rbrakk> \<Longrightarrow> \<exists>c. \<not> inj_on (VectorSpaceEnd.polymap (\<cdot>) V T [:- c, 1::'a:]) V

goal (1 subgoal):
 1. (\<And>c. \<not> inj_on (Tpolymap [:- c, 1::'a:]) V \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
\<not> inj_on (Tpolymap [:- c, 1::'a:]) V

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
with Tpolymap_def
[PROOF STATE]
proof (chain)
picking this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
\<not> inj_on (Tpolymap [:- c, 1::'a:]) V
[PROOF STEP]
have "(GroupHom.Ker V (Tpolymap [:-c, 1:])) - 0 \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
\<not> inj_on (Tpolymap [:- c, 1::'a:]) V

goal (1 subgoal):
 1. ker (Tpolymap [:- c, 1::'a:]) \<inter> V - 0 \<noteq> {}
[PROOF STEP]
using VectorSpaceEnd.VEnd_polymap[OF endo] VectorSpaceEnd.Ker0_imp_inj_on
[PROOF STATE]
proof (prove)
using this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
\<not> inj_on (Tpolymap [:- c, 1::'a:]) V
VEnd (VectorSpaceEnd.polymap (\<cdot>) V T ?p)
\<lbrakk>VectorSpaceEnd ?smult ?V ?T; ker ?T \<inter> ?V \<subseteq> 0\<rbrakk> \<Longrightarrow> inj_on ?T ?V

goal (1 subgoal):
 1. ker (Tpolymap [:- c, 1::'a:]) \<inter> V - 0 \<noteq> {}
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
ker (Tpolymap [:- c, 1::'a:]) \<inter> V - 0 \<noteq> {}

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
ker (Tpolymap [:- c, 1::'a:]) \<inter> V - 0 \<noteq> {}
[PROOF STEP]
obtain u where "u \<in> V" "Tpolymap [:-c, 1:] u = 0" "u \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
ker (Tpolymap [:- c, 1::'a:]) \<inter> V - 0 \<noteq> {}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>u \<in> V; Tpolymap [:- c, 1::'a:] u = (0::'b); u \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using kerD
[PROOF STATE]
proof (prove)
using this:
ker (Tpolymap [:- c, 1::'a:]) \<inter> V - 0 \<noteq> {}
?a \<in> ker ?f \<Longrightarrow> ?f ?a = (0::?'b)

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>u \<in> V; Tpolymap [:- c, 1::'a:] u = (0::'b); u \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
u \<in> V
Tpolymap [:- c, 1::'a:] u = (0::'b)
u \<noteq> (0::'b)

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
with Tpolymap_def
[PROOF STATE]
proof (chain)
picking this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
u \<in> V
Tpolymap [:- c, 1::'a:] u = (0::'b)
u \<noteq> (0::'b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
u \<in> V
Tpolymap [:- c, 1::'a:] u = (0::'b)
u \<noteq> (0::'b)

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
using VectorSpaceEnd.polymap_apply_linear[OF endo]
[PROOF STATE]
proof (prove)
using this:
Tpolymap = VectorSpaceEnd.polymap (\<cdot>) V T
u \<in> V
Tpolymap [:- c, 1::'a:] u = (0::'b)
u \<noteq> (0::'b)
?v \<in> V \<Longrightarrow> VectorSpaceEnd.polymap (\<cdot>) V T [:- ?c, 1::'a:] ?v = T ?v - ?c \<cdot> ?v

goal (1 subgoal):
 1. \<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>c u. u \<in> V \<and> u \<noteq> (0::'b) \<and> T u = c \<cdot> u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_mset_sup [simp]:
  \<open>set_mset (A \<union># B) = set_mset A \<union> set_mset B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (A \<union># B) = set_mset A \<union> set_mset B
[PROOF STEP]
by (simp only: set_mset_def) (auto simp add: less_max_iff_disj)


[STATEMENT]
lemma power_float_interval_mono:
  "set_of (power_float_interval prec n A)
    \<subseteq> set_of (power_float_interval prec n B)"
  if "set_of A \<subseteq> set_of B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
define la where "la = real_of_float (lower A)"
[PROOF STATE]
proof (state)
this:
la = real_of_float (lower A)

goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
define ua where "ua = real_of_float (upper A)"
[PROOF STATE]
proof (state)
this:
ua = real_of_float (upper A)

goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
define lb where "lb = real_of_float (lower B)"
[PROOF STATE]
proof (state)
this:
lb = real_of_float (lower B)

goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
define ub where "ub = real_of_float (upper B)"
[PROOF STATE]
proof (state)
this:
ub = real_of_float (upper B)

goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
have ineqs: "lb \<le> la" "la \<le> ua" "ua \<le> ub" "lb \<le> ub"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lb \<le> la &&& la \<le> ua) &&& ua \<le> ub &&& lb \<le> ub
[PROOF STEP]
using that lower_le_upper[of A] lower_le_upper[of B]
[PROOF STATE]
proof (prove)
using this:
set_of A \<subseteq> set_of B
lower A \<le> upper A
lower B \<le> upper B

goal (1 subgoal):
 1. (lb \<le> la &&& la \<le> ua) &&& ua \<le> ub &&& lb \<le> ub
[PROOF STEP]
by (auto simp: la_def ua_def lb_def ub_def set_of_eq)
[PROOF STATE]
proof (state)
this:
lb \<le> la
la \<le> ua
ua \<le> ub
lb \<le> ub

goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
using ineqs
[PROOF STATE]
proof (prove)
using this:
lb \<le> la
la \<le> ua
ua \<le> ub
lb \<le> ub

goal (1 subgoal):
 1. set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)
[PROOF STEP]
by (simp add: set_of_subset_iff float_power_bnds_def max_def
        power_down_fl.rep_eq power_up_fl.rep_eq
        lower_power_float_interval upper_power_float_interval
        la_def[symmetric] ua_def[symmetric] lb_def[symmetric] ub_def[symmetric])
      (auto intro!: power_down_mono power_up_mono intro: order_trans[where y=0])
[PROOF STATE]
proof (state)
this:
set_of (power_float_interval prec n A) \<subseteq> set_of (power_float_interval prec n B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_lemmas: "length []=0" "length (x#xs) = Suc(length xs)"
    "(x#xs) ! 0 = x" "(x#xs) ! Suc n = xs ! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length [] = 0 &&& length (x # xs) = Suc (length xs)) &&& (x # xs) ! 0 = x &&& (x # xs) ! Suc n = xs ! n
[PROOF STEP]
by simp_all


[STATEMENT]
lemma supports_finite:
  fixes S :: "atom set"
  and   x :: "'a::pt"
  assumes a1: "S supports x"
  and     a2: "finite S"
  shows "finite (supp x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
have "(supp x) \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp x \<subseteq> S
[PROOF STEP]
using a1 a2
[PROOF STATE]
proof (prove)
using this:
S supports x
finite S

goal (1 subgoal):
 1. supp x \<subseteq> S
[PROOF STEP]
by (rule supp_is_subset)
[PROOF STATE]
proof (state)
this:
supp x \<subseteq> S

goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
supp x \<subseteq> S
[PROOF STEP]
show "finite (supp x)"
[PROOF STATE]
proof (prove)
using this:
supp x \<subseteq> S

goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
using a2
[PROOF STATE]
proof (prove)
using this:
supp x \<subseteq> S
finite S

goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
by (simp add: finite_subset)
[PROOF STATE]
proof (state)
this:
finite (supp x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_psi_bound_2_3:
  "psi n - psi (n div 2) \<le> ln (fact n) - 2 * ln (fact (n div 2))"
  "ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi n - psi (n div 2) \<le> ln (fact n) - 2 * ln (fact (n div 2)) &&& ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. psi n - psi (n div 2) \<le> ln (fact n) - 2 * ln (fact (n div 2))
 2. ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
show "psi n - psi (n div 2) \<le> ln (fact n) - 2 * ln (fact (n div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi n - psi (n div 2) \<le> ln (fact n) - 2 * ln (fact (n div 2))
[PROOF STEP]
by (rule psi_bounds_ln_fact (2))
[PROOF STATE]
proof (state)
this:
psi n - psi (n div 2) \<le> ln (fact n) - 2 * ln (fact (n div 2))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
from fact_psi_bound_odd[of 3 n]
[PROOF STATE]
proof (chain)
picking this:
odd 3 \<Longrightarrow> ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..3. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "ln (fact n) - 2 * ln (fact (n div 2))
  \<le> (\<Sum>d = 1..3. (- 1) ^ (d + 1) * psi (n div d))"
[PROOF STATE]
proof (prove)
using this:
odd 3 \<Longrightarrow> ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..3. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..3. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..3. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..3. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
have "\<dots> = psi n - psi (n div 2) + psi (n div 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..3. (- 1) ^ (d + 1) * psi (n div d)) = psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
by (simp add: sum.atLeast_Suc_atMost numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..3. (- 1) ^ (d + 1) * psi (n div d)) = psi n - psi (n div 2) + psi (n div 3)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
show "ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)"
[PROOF STATE]
proof (prove)
using this:
ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) \<le> psi n - psi (n div 2) + psi (n div 3)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem hyp2_axiom2: "\<forall> a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<longrightarrow> p q \<congruent>\<^sub>K r s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
proof standard+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
fix a b p q r s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
assume "a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s"
[PROOF STATE]
proof (state)
this:
a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s

goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s
[PROOF STEP]
obtain G and H where "is_K2_isometry G" and "is_K2_isometry H"
    and "hyp2_cltn2 a G = p" and "hyp2_cltn2 b G = q"
   and "hyp2_cltn2 a H = r" and "hyp2_cltn2 b H = s"
[PROOF STATE]
proof (prove)
using this:
a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s

goal (1 subgoal):
 1. (\<And>G H. \<lbrakk>is_K2_isometry G; is_K2_isometry H; hyp2_cltn2 a G = p; hyp2_cltn2 b G = q; hyp2_cltn2 a H = r; hyp2_cltn2 b H = s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (unfold real_hyp2_C_def) auto
[PROOF STATE]
proof (state)
this:
is_K2_isometry G
is_K2_isometry H
hyp2_cltn2 a G = p
hyp2_cltn2 b G = q
hyp2_cltn2 a H = r
hyp2_cltn2 b H = s

goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
let ?J = "cltn2_compose (cltn2_inverse G) H"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
from \<open>is_K2_isometry G\<close>
[PROOF STATE]
proof (chain)
picking this:
is_K2_isometry G
[PROOF STEP]
have "is_K2_isometry (cltn2_inverse G)"
[PROOF STATE]
proof (prove)
using this:
is_K2_isometry G

goal (1 subgoal):
 1. is_K2_isometry (cltn2_inverse G)
[PROOF STEP]
by (rule cltn2_inverse_is_K2_isometry)
[PROOF STATE]
proof (state)
this:
is_K2_isometry (cltn2_inverse G)

goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
with \<open>is_K2_isometry H\<close>
[PROOF STATE]
proof (chain)
picking this:
is_K2_isometry H
is_K2_isometry (cltn2_inverse G)
[PROOF STEP]
have "is_K2_isometry ?J"
[PROOF STATE]
proof (prove)
using this:
is_K2_isometry H
is_K2_isometry (cltn2_inverse G)

goal (1 subgoal):
 1. is_K2_isometry (cltn2_compose (cltn2_inverse G) H)
[PROOF STEP]
by (simp only: cltn2_compose_is_K2_isometry)
[PROOF STATE]
proof (state)
this:
is_K2_isometry (cltn2_compose (cltn2_inverse G) H)

goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
from \<open>is_K2_isometry G\<close> and \<open>hyp2_cltn2 a G = p\<close> and \<open>hyp2_cltn2 b G = q\<close>
    and K2_isometry.act_inv_iff
[PROOF STATE]
proof (chain)
picking this:
is_K2_isometry G
hyp2_cltn2 a G = p
hyp2_cltn2 b G = q
?g \<in> carrier \<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr> \<Longrightarrow> (hyp2_cltn2 ?b (inv\<^bsub>\<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr>\<^esub> ?g) = ?c) = (?b = hyp2_cltn2 ?c ?g)
[PROOF STEP]
have "hyp2_cltn2 p (cltn2_inverse G) = a"
    and "hyp2_cltn2 q (cltn2_inverse G) = b"
[PROOF STATE]
proof (prove)
using this:
is_K2_isometry G
hyp2_cltn2 a G = p
hyp2_cltn2 b G = q
?g \<in> carrier \<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr> \<Longrightarrow> (hyp2_cltn2 ?b (inv\<^bsub>\<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr>\<^esub> ?g) = ?c) = (?b = hyp2_cltn2 ?c ?g)

goal (1 subgoal):
 1. hyp2_cltn2 p (cltn2_inverse G) = a &&& hyp2_cltn2 q (cltn2_inverse G) = b
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
hyp2_cltn2 p (cltn2_inverse G) = a
hyp2_cltn2 q (cltn2_inverse G) = b

goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
with \<open>hyp2_cltn2 a H = r\<close> and \<open>hyp2_cltn2 b H = s\<close>
    and \<open>is_K2_isometry (cltn2_inverse G)\<close> and \<open>is_K2_isometry H\<close>
    and K2_isometry.act_act [symmetric]
[PROOF STATE]
proof (chain)
picking this:
hyp2_cltn2 a H = r
hyp2_cltn2 b H = s
is_K2_isometry (cltn2_inverse G)
is_K2_isometry H
\<lbrakk>?g \<in> carrier \<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr>; ?h \<in> carrier \<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr>\<rbrakk> \<Longrightarrow> hyp2_cltn2 ?b (?g \<otimes>\<^bsub>\<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr>\<^esub> ?h) = hyp2_cltn2 (hyp2_cltn2 ?b ?g) ?h
hyp2_cltn2 p (cltn2_inverse G) = a
hyp2_cltn2 q (cltn2_inverse G) = b
[PROOF STEP]
have "hyp2_cltn2 p ?J = r" and "hyp2_cltn2 q ?J = s"
[PROOF STATE]
proof (prove)
using this:
hyp2_cltn2 a H = r
hyp2_cltn2 b H = s
is_K2_isometry (cltn2_inverse G)
is_K2_isometry H
\<lbrakk>?g \<in> carrier \<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr>; ?h \<in> carrier \<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr>\<rbrakk> \<Longrightarrow> hyp2_cltn2 ?b (?g \<otimes>\<^bsub>\<lparr>carrier = Collect is_K2_isometry, monoid.mult = cltn2_compose, one = cltn2_id\<rparr>\<^esub> ?h) = hyp2_cltn2 (hyp2_cltn2 ?b ?g) ?h
hyp2_cltn2 p (cltn2_inverse G) = a
hyp2_cltn2 q (cltn2_inverse G) = b

goal (1 subgoal):
 1. hyp2_cltn2 p (cltn2_compose (cltn2_inverse G) H) = r &&& hyp2_cltn2 q (cltn2_compose (cltn2_inverse G) H) = s
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
hyp2_cltn2 p (cltn2_compose (cltn2_inverse G) H) = r
hyp2_cltn2 q (cltn2_compose (cltn2_inverse G) H) = s

goal (1 subgoal):
 1. \<And>a b p q r s. a b \<congruent>\<^sub>K p q \<and> a b \<congruent>\<^sub>K r s \<Longrightarrow> p q \<congruent>\<^sub>K r s
[PROOF STEP]
with \<open>is_K2_isometry ?J\<close>
[PROOF STATE]
proof (chain)
picking this:
is_K2_isometry (cltn2_compose (cltn2_inverse G) H)
hyp2_cltn2 p (cltn2_compose (cltn2_inverse G) H) = r
hyp2_cltn2 q (cltn2_compose (cltn2_inverse G) H) = s
[PROOF STEP]
show "p q \<congruent>\<^sub>K r s"
[PROOF STATE]
proof (prove)
using this:
is_K2_isometry (cltn2_compose (cltn2_inverse G) H)
hyp2_cltn2 p (cltn2_compose (cltn2_inverse G) H) = r
hyp2_cltn2 q (cltn2_compose (cltn2_inverse G) H) = s

goal (1 subgoal):
 1. p q \<congruent>\<^sub>K r s
[PROOF STEP]
by (unfold real_hyp2_C_def) (simp add: exI [of _ ?J])
[PROOF STATE]
proof (state)
this:
p q \<congruent>\<^sub>K r s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_less_rev_set_eq:
  assumes "sorted (rev xs) "
    shows "sorted_list_of_set (set xs) = rev xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (set xs) = rev xs
[PROOF STEP]
using assms sorted_less_set_eq[of "rev xs"]
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted (rev xs)
Sorted_Less.sorted (rev xs) \<Longrightarrow> rev xs = sorted_list_of_set (set (rev xs))

goal (1 subgoal):
 1. sorted_list_of_set (set xs) = rev xs
[PROOF STEP]
by auto


[STATEMENT]
lemma cf_ntcf_comp_cf_cat_cone'[cat_cs_intros]:
  assumes "\<NN> : c <\<^sub>C\<^sub>F\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
    and "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "c' = \<GG>\<lparr>ObjMap\<rparr>\<lparr>c\<rparr>"
    and "\<GG>\<FF> = \<GG> \<circ>\<^sub>C\<^sub>F \<FF>"
  shows "\<GG> \<circ>\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \<NN> : c' <\<^sub>C\<^sub>F\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<GG>\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M\<^sub>-\<^sub>T\<^sub>D\<^sub>G\<^sub>H\<^sub>M \<NN> : c' <\<^sub>C\<^sub>F\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<GG>\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
\<NN> : c <\<^sub>C\<^sub>F\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M\<^sub>-\<^sub>T\<^sub>D\<^sub>G\<^sub>H\<^sub>M \<NN> : c' <\<^sub>C\<^sub>F\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<GG>\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
unfolding assms(3,4)
[PROOF STATE]
proof (prove)
using this:
\<NN> : c <\<^sub>C\<^sub>F\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M\<^sub>-\<^sub>T\<^sub>D\<^sub>G\<^sub>H\<^sub>M \<NN> : \<GG>\<lparr>ObjMap\<rparr>\<lparr>c\<rparr> <\<^sub>C\<^sub>F\<^sub>.\<^sub>c\<^sub>o\<^sub>n\<^sub>e \<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule cf_ntcf_comp_cf_cat_cone)


[STATEMENT]
lemma orbit_conv_funpow_dist1:
  assumes "x \<in> orbit f x"
  shows "orbit f x = (\<lambda>n. (f ^^ n) x) ` {0..<funpow_dist1 f x x}" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit f x = (\<lambda>n. (f ^^ n) x) ` {0..<funpow_dist1 f x x}
[PROOF STEP]
using funpow_dist1_prop[OF assms]
[PROOF STATE]
proof (prove)
using this:
(f ^^ funpow_dist1 f x x) x = x

goal (1 subgoal):
 1. orbit f x = (\<lambda>n. (f ^^ n) x) ` {0..<funpow_dist1 f x x}
[PROOF STEP]
by (auto simp: orbit_altdef_bounded[where n="funpow_dist1 f x x"])


[STATEMENT]
lemma convergent_sum:
  fixes X :: "'a \<Rightarrow> nat \<Rightarrow> 'b::topological_comm_monoid_add"
  shows "(\<And>i. i \<in> A \<Longrightarrow> convergent (\<lambda>n. X i n)) \<Longrightarrow> convergent (\<lambda>n. \<Sum>i\<in>A. X i n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> A \<Longrightarrow> convergent (X i)) \<Longrightarrow> convergent (\<lambda>n. \<Sum>i\<in>A. X i n)
[PROOF STEP]
by (induct A rule: infinite_finite_induct) (simp_all add: convergent_const convergent_add)


[STATEMENT]
lemma gbinomial_addition_formula:
  "a gchoose (Suc k) = ((a - 1) gchoose (Suc k)) + ((a - 1) gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a gchoose Suc k = a - (1::'a) gchoose Suc k + (a - (1::'a) gchoose k)
[PROOF STEP]
using gbinomial_Suc_Suc[of "a - 1" k]
[PROOF STATE]
proof (prove)
using this:
a - (1::'a) + (1::'a) gchoose Suc k = a - (1::'a) gchoose k + (a - (1::'a) gchoose Suc k)

goal (1 subgoal):
 1. a gchoose Suc k = a - (1::'a) gchoose Suc k + (a - (1::'a) gchoose k)
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma diff_indexed_Ints_vec:
  "x \<in> carrier_vec n \<Longrightarrow> y \<in> carrier_vec n \<Longrightarrow> x \<in> indexed_Ints_vec I \<Longrightarrow> y \<in> indexed_Ints_vec I
  \<Longrightarrow> x - y \<in> indexed_Ints_vec I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier_vec n; y \<in> carrier_vec n; x \<in> indexed_Ints_vec I; y \<in> indexed_Ints_vec I\<rbrakk> \<Longrightarrow> x - y \<in> indexed_Ints_vec I
[PROOF STEP]
unfolding indexed_Ints_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier_vec n; y \<in> carrier_vec n; x \<in> {x. \<forall>i<dim_vec x. i \<in> I \<longrightarrow> x $ i \<in> \<int>}; y \<in> {x. \<forall>i<dim_vec x. i \<in> I \<longrightarrow> x $ i \<in> \<int>}\<rbrakk> \<Longrightarrow> x - y \<in> {x. \<forall>i<dim_vec x. i \<in> I \<longrightarrow> x $ i \<in> \<int>}
[PROOF STEP]
by auto


[STATEMENT]
lemma frag_cmul_distrib2: "frag_cmul c (a+b) = frag_cmul c a + frag_cmul c b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frag_cmul c (a + b) = frag_cmul c a + frag_cmul c b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. frag_cmul c (a + b) = frag_cmul c a + frag_cmul c b
[PROOF STEP]
have "finite {x. poly_mapping.lookup a x + poly_mapping.lookup b x \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. lookup a x + lookup b x \<noteq> 0}
[PROOF STEP]
using keys_add [of a b]
[PROOF STATE]
proof (prove)
using this:
keys (a + b) \<subseteq> keys a \<union> keys b

goal (1 subgoal):
 1. finite {x. lookup a x + lookup b x \<noteq> 0}
[PROOF STEP]
by (metis (no_types, lifting) finite_keys finite_subset keys.rep_eq lookup_add mem_Collect_eq subsetI)
[PROOF STATE]
proof (state)
this:
finite {x. lookup a x + lookup b x \<noteq> 0}

goal (1 subgoal):
 1. frag_cmul c (a + b) = frag_cmul c a + frag_cmul c b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {x. lookup a x + lookup b x \<noteq> 0}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {x. lookup a x + lookup b x \<noteq> 0}

goal (1 subgoal):
 1. frag_cmul c (a + b) = frag_cmul c a + frag_cmul c b
[PROOF STEP]
by (simp add: frag_cmul_def plus_poly_mapping_def int_distrib)
[PROOF STATE]
proof (state)
this:
frag_cmul c (a + b) = frag_cmul c a + frag_cmul c b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_maps_swap:
   "homeomorphic_maps (prod_topology X Y) (prod_topology Y X)
                          (\<lambda>(x,y). (y,x)) (\<lambda>(y,x). (x,y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_maps (prod_topology X Y) (prod_topology Y X) (\<lambda>(x, y). (y, x)) (\<lambda>(y, x). (x, y))
[PROOF STEP]
by (auto simp: homeomorphic_maps_def case_prod_unfold continuous_map_fst continuous_map_pairedI continuous_map_snd)


[STATEMENT]
lemma dom_m_fmrestrict_set': \<open>dom_m (fmrestrict_set xs N) = mset_set (xs \<inter> set_mset (dom_m N))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dom_m (fmrestrict_set xs N) = mset_set (xs \<inter> set_mset (dom_m N))
[PROOF STEP]
using fset_fmdom_fmrestrict_set[of \<open>xs\<close> N] distinct_mset_dom[of N]
[PROOF STATE]
proof (prove)
using this:
fset (fmdom (fmrestrict_set xs N)) = fset (fmdom N) \<inter> xs
distinct_mset (dom_m N)

goal (1 subgoal):
 1. dom_m (fmrestrict_set xs N) = mset_set (xs \<inter> set_mset (dom_m N))
[PROOF STEP]
by (auto simp: dom_m_def fset_mset_mset_fset finite_mset_set_inter multiset_inter_commute
    remdups_mset_def)


[STATEMENT]
lemma ideals_filters_dual: "(X \<in> ideals) = ((\<partial> ` X) \<in> filters)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. idealp X = filterp (\<partial> ` X)
[PROOF STEP]
by (smt comp_eq_dest_lhs directed_filtered_dual image_inv_f_f image_is_empty inv_unique_comp filters_def ideals_def inj_dual invol_dual mem_Collect_eq upset_setp_downset_setp_dual)


[STATEMENT]
lemma wf_pred_sexp: "wf(pred_sexp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf pred_sexp
[PROOF STEP]
apply (rule pred_sexp_subset_Sigma [THEN wfI])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x P. \<lbrakk>\<forall>x. (\<forall>y. (y, x) \<in> pred_sexp \<longrightarrow> P y) \<longrightarrow> P x; x \<in> sexp; x \<in> sexp\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply (erule sexp.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x P a. \<lbrakk>\<forall>x. (\<forall>y. (y, x) \<in> pred_sexp \<longrightarrow> P y) \<longrightarrow> P x; x \<in> sexp\<rbrakk> \<Longrightarrow> P (Leaf a)
 2. \<And>x P i. \<lbrakk>\<forall>x. (\<forall>y. (y, x) \<in> pred_sexp \<longrightarrow> P y) \<longrightarrow> P x; x \<in> sexp\<rbrakk> \<Longrightarrow> P (Numb i)
 3. \<And>x P M N. \<lbrakk>\<forall>x. (\<forall>y. (y, x) \<in> pred_sexp \<longrightarrow> P y) \<longrightarrow> P x; x \<in> sexp; M \<in> sexp; P M; N \<in> sexp; P N\<rbrakk> \<Longrightarrow> P (Scons M N)
[PROOF STEP]
apply (blast elim!: pred_sexpE)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done