[STATEMENT]
lemma monic_square_free_irreducible_factorization: assumes mon: "monic (f :: 'b :: field poly)"
  and sf: "square_free f"
  shows "\<exists> P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}
[PROOF STEP]
from mon
[PROOF STATE]
proof (chain)
picking this:
monic f
[PROOF STEP]
have f0: "f \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
monic f

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

goal (1 subgoal):
 1. \<exists>P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}
[PROOF STEP]
from monic_irreducible_factorization[OF assms(1)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>as fa. finite as \<and> f = (\<Prod>a\<in>as. a ^ Suc (fa a)) \<and> as \<subseteq> {q. irreducible q \<and> monic q}
[PROOF STEP]
obtain P n where
    P: "finite P" "P \<subseteq> {q. irreducible\<^sub>d q \<and> monic q}" and f: "f = (\<Prod>a\<in>P. a ^ Suc (n a))"
[PROOF STATE]
proof (prove)
using this:
\<exists>as fa. finite as \<and> f = (\<Prod>a\<in>as. a ^ Suc (fa a)) \<and> as \<subseteq> {q. irreducible q \<and> monic q}

goal (1 subgoal):
 1. (\<And>P n. \<lbrakk>finite P; P \<subseteq> {q. irreducible\<^sub>d q \<and> monic q}; f = (\<Prod>a\<in>P. a ^ Suc (n a))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite P
P \<subseteq> {q. irreducible\<^sub>d q \<and> monic q}
f = (\<Prod>a\<in>P. a ^ Suc (n a))

goal (1 subgoal):
 1. \<exists>P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}
[PROOF STEP]
have *: "\<forall> a \<in> P. n a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>P. n a = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>a\<in>P. n a = 0) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>a\<in>P. n a = 0)

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>P. n a = 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>a\<in>P. n a = 0)
[PROOF STEP]
obtain a where a: "a \<in> P" and n: "n a \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>a\<in>P. n a = 0)

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

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>P. n a = 0) \<Longrightarrow> False
[PROOF STEP]
have "f = a ^ (Suc (n a)) * (\<Prod>b\<in>P - {a}. b ^ Suc (n b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = a ^ Suc (n a) * (\<Prod>b\<in>P - {a}. b ^ Suc (n b))
[PROOF STEP]
unfolding f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>a\<in>P. a ^ Suc (n a)) = a ^ Suc (n a) * (\<Prod>b\<in>P - {a}. b ^ Suc (n b))
[PROOF STEP]
by (rule prod.remove[OF P(1) a])
[PROOF STATE]
proof (state)
this:
f = a ^ Suc (n a) * (\<Prod>b\<in>P - {a}. b ^ Suc (n b))

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>P. n a = 0) \<Longrightarrow> False
[PROOF STEP]
with n
[PROOF STATE]
proof (chain)
picking this:
n a \<noteq> 0
f = a ^ Suc (n a) * (\<Prod>b\<in>P - {a}. b ^ Suc (n b))
[PROOF STEP]
have "a * a dvd f"
[PROOF STATE]
proof (prove)
using this:
n a \<noteq> 0
f = a ^ Suc (n a) * (\<Prod>b\<in>P - {a}. b ^ Suc (n b))

goal (1 subgoal):
 1. a * a dvd f
[PROOF STEP]
by (cases "n a", auto)
[PROOF STATE]
proof (state)
this:
a * a dvd f

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>P. n a = 0) \<Longrightarrow> False
[PROOF STEP]
with sf[unfolded square_free_def] f0
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> 0 \<and> (\<forall>q. 0 < degree q \<longrightarrow> \<not> q * q dvd f)
f \<noteq> 0
a * a dvd f
[PROOF STEP]
have "degree a = 0"
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0 \<and> (\<forall>q. 0 < degree q \<longrightarrow> \<not> q * q dvd f)
f \<noteq> 0
a * a dvd f

goal (1 subgoal):
 1. degree a = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree a = 0

goal (1 subgoal):
 1. \<not> (\<forall>a\<in>P. n a = 0) \<Longrightarrow> False
[PROOF STEP]
with a P(2)[unfolded irreducible\<^sub>d_def]
[PROOF STATE]
proof (chain)
picking this:
a \<in> P
P \<subseteq> {q. (0 < degree q \<and> (\<forall>qa r. degree qa < degree q \<longrightarrow> degree r < degree q \<longrightarrow> q \<noteq> qa * r)) \<and> monic q}
degree a = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a \<in> P
P \<subseteq> {q. (0 < degree q \<and> (\<forall>qa r. degree qa < degree q \<longrightarrow> degree r < degree q \<longrightarrow> q \<noteq> qa * r)) \<and> monic q}
degree a = 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>P. n a = 0

goal (1 subgoal):
 1. \<exists>P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}
[PROOF STEP]
have "f = \<Prod> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = \<Prod>P
[PROOF STEP]
unfolding f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>a\<in>P. a ^ Suc (n a)) = \<Prod>P
[PROOF STEP]
by (rule prod.cong[OF refl], insert *, auto)
[PROOF STATE]
proof (state)
this:
f = \<Prod>P

goal (1 subgoal):
 1. \<exists>P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}
[PROOF STEP]
with P
[PROOF STATE]
proof (chain)
picking this:
finite P
P \<subseteq> {q. irreducible\<^sub>d q \<and> monic q}
f = \<Prod>P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite P
P \<subseteq> {q. irreducible\<^sub>d q \<and> monic q}
f = \<Prod>P

goal (1 subgoal):
 1. \<exists>P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>P. finite P \<and> f = \<Prod>P \<and> P \<subseteq> {q. irreducible q \<and> monic q}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Minus_card: "card (k \<ominus> I) = card (I \<down>\<le> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (k \<ominus> I) = card (I \<down>\<le> k)
[PROOF STEP]
apply (simp add: iT_Minus_image_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((-) k ` I \<down>\<le> k) = card (I \<down>\<le> k)
[PROOF STEP]
apply (rule card_image)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((-) k) (I \<down>\<le> k)
[PROOF STEP]
apply (subst cut_le_Int_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((-) k) (I \<inter> {..k})
[PROOF STEP]
apply (rule subset_inj_on[OF _ Int_lower2])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((-) k) {..k}
[PROOF STEP]
apply (rule sub_right_inj_on)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_cls_val_process_Suc:
  assumes "portfolio pf1"
  and "portfolio pf2"
shows "\<forall>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w =
  (cls_val_process Mkt pf1) (Suc n) w + (cls_val_process Mkt pf2) (Suc n) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
proof (intro allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
fix n w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have vp1: "cls_val_process Mkt pf1 (Suc n) w =
    (\<Sum> x\<in> (support_set pf1)\<union> (support_set pf2). ((prices Mkt) x (Suc n) w) * (pf1 x (Suc n) w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf1 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cls_val_process Mkt pf1 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w)
[PROOF STEP]
have "finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf1 \<subseteq> support_set pf1 \<union> support_set pf2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf1 \<subseteq> support_set pf1 \<union> support_set pf2
[PROOF STEP]
by (meson assms(1) assms(2) finite_Un portfolio_def sup.cobounded1)
[PROOF STATE]
proof (state)
this:
finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf1 \<subseteq> support_set pf1 \<union> support_set pf2

goal (1 subgoal):
 1. cls_val_process Mkt pf1 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf1 \<subseteq> support_set pf1 \<union> support_set pf2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf1 \<subseteq> support_set pf1 \<union> support_set pf2

goal (1 subgoal):
 1. cls_val_process Mkt pf1 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w)
[PROOF STEP]
by (simp add: subset_cls_val_process)
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf1 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf1 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have vp2: "cls_val_process Mkt pf2 (Suc n) w = (\<Sum> x\<in> (support_set pf1)\<union> (support_set pf2). ((prices Mkt) x (Suc n) w) * (pf2 x (Suc n) w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)
[PROOF STEP]
have "finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf2 \<subseteq> support_set pf2 \<union> support_set pf1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf2 \<subseteq> support_set pf2 \<union> support_set pf1
[PROOF STEP]
by (meson assms(1) assms(2) finite_Un portfolio_def sup.cobounded1)
[PROOF STATE]
proof (state)
this:
finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf2 \<subseteq> support_set pf2 \<union> support_set pf1

goal (1 subgoal):
 1. cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf2 \<subseteq> support_set pf2 \<union> support_set pf1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (support_set pf1 \<union> support_set pf2) \<and> support_set pf2 \<subseteq> support_set pf2 \<union> support_set pf1

goal (1 subgoal):
 1. cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)
[PROOF STEP]
by (auto simp add: subset_cls_val_process)
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have pf:"portfolio (qty_sum pf1 pf2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. portfolio (qty_sum pf1 pf2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
portfolio pf1
portfolio pf2

goal (1 subgoal):
 1. portfolio (qty_sum pf1 pf2)
[PROOF STEP]
by (simp add:sum_portfolio)
[PROOF STATE]
proof (state)
this:
portfolio (qty_sum pf1 pf2)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have fin:"finite (support_set pf1 \<union> support_set pf2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (support_set pf1 \<union> support_set pf2)
[PROOF STEP]
using assms finite_Un
[PROOF STATE]
proof (prove)
using this:
portfolio pf1
portfolio pf2
finite (?F \<union> ?G) = (finite ?F \<and> finite ?G)

goal (1 subgoal):
 1. finite (support_set pf1 \<union> support_set pf2)
[PROOF STEP]
unfolding portfolio_def
[PROOF STATE]
proof (prove)
using this:
finite (support_set pf1)
finite (support_set pf2)
finite (?F \<union> ?G) = (finite ?F \<and> finite ?G)

goal (1 subgoal):
 1. finite (support_set pf1 \<union> support_set pf2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (support_set pf1 \<union> support_set pf2)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have "(cls_val_process Mkt pf1) (Suc n) w + (cls_val_process Mkt pf2) (Suc n) w =
    (\<Sum> x\<in> (support_set pf1)\<union> (support_set pf2). ((prices Mkt) x (Suc n) w) * (pf1 x (Suc n) w)) +
    (\<Sum> x\<in> (support_set pf1)\<union> (support_set pf2). ((prices Mkt) x (Suc n) w) * (pf2 x (Suc n) w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w) + (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)
[PROOF STEP]
using vp1 vp2
[PROOF STATE]
proof (prove)
using this:
cls_val_process Mkt pf1 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w)
cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)

goal (1 subgoal):
 1. cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w) + (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w) + (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w) + (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have "... = (\<Sum> x\<in> (support_set pf1)\<union> (support_set pf2).
    (((prices Mkt) x (Suc n) w) * (pf1 x (Suc n) w)) + ((prices Mkt) x (Suc n) w) * (pf2 x (Suc n) w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w) + (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w + prices Mkt x (Suc n) w * pf2 x (Suc n) w)
[PROOF STEP]
by (simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w) + (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w + prices Mkt x (Suc n) w * pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w) + (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf2 x (Suc n) w) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w + prices Mkt x (Suc n) w * pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have "... = (\<Sum> x\<in> (support_set pf1)\<union> (support_set pf2).
    ((prices Mkt) x (Suc n) w) * ((pf1 x (Suc n) w) + (pf2 x (Suc n) w)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w + prices Mkt x (Suc n) w * pf2 x (Suc n) w) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * (pf1 x (Suc n) w + pf2 x (Suc n) w))
[PROOF STEP]
by (simp add: distrib_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w + prices Mkt x (Suc n) w * pf2 x (Suc n) w) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * (pf1 x (Suc n) w + pf2 x (Suc n) w))

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * pf1 x (Suc n) w + prices Mkt x (Suc n) w * pf2 x (Suc n) w) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * (pf1 x (Suc n) w + pf2 x (Suc n) w))

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have "... = (\<Sum> x\<in> (support_set pf1)\<union> (support_set pf2).
    ((prices Mkt) x (Suc n) w) * ((qty_sum pf1 pf2) x (Suc n) w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * (pf1 x (Suc n) w + pf2 x (Suc n) w)) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)
[PROOF STEP]
by (simp add: qty_sum_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * (pf1 x (Suc n) w + pf2 x (Suc n) w)) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * (pf1 x (Suc n) w + pf2 x (Suc n) w)) = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have "... = (\<Sum> x\<in> (support_set (qty_sum pf1 pf2)).
    ((prices Mkt) x (Suc n) w) * ((qty_sum pf1 pf2) x (Suc n) w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w) = (\<Sum>x\<in>support_set (qty_sum pf1 pf2). prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)
[PROOF STEP]
using sum_support_set[of pf1 pf2]
    subset_cls_val_process[of "support_set pf1\<union> support_set pf2" "qty_sum pf1 pf2"] pf fin
[PROOF STATE]
proof (prove)
using this:
support_set (qty_sum pf1 pf2) \<subseteq> support_set pf1 \<union> support_set pf2
\<lbrakk>finite (support_set pf1 \<union> support_set pf2); support_set (qty_sum pf1 pf2) \<subseteq> support_set pf1 \<union> support_set pf2\<rbrakk> \<Longrightarrow> \<forall>n w. cls_val_process ?Mkt (qty_sum pf1 pf2) (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices ?Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)
portfolio (qty_sum pf1 pf2)
finite (support_set pf1 \<union> support_set pf2)

goal (1 subgoal):
 1. (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w) = (\<Sum>x\<in>support_set (qty_sum pf1 pf2). prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)
[PROOF STEP]
unfolding cls_val_process_def
[PROOF STATE]
proof (prove)
using this:
support_set (qty_sum pf1 pf2) \<subseteq> support_set pf1 \<union> support_set pf2
\<lbrakk>finite (support_set pf1 \<union> support_set pf2); support_set (qty_sum pf1 pf2) \<subseteq> support_set pf1 \<union> support_set pf2\<rbrakk> \<Longrightarrow> \<forall>n w. (if \<not> portfolio (qty_sum pf1 pf2) then \<lambda>n w. 0 else up_cl_proc ?Mkt (qty_sum pf1 pf2)) (Suc n) w = (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices ?Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)
portfolio (qty_sum pf1 pf2)
finite (support_set pf1 \<union> support_set pf2)

goal (1 subgoal):
 1. (\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w) = (\<Sum>x\<in>support_set (qty_sum pf1 pf2). prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w) = (\<Sum>x\<in>support_set (qty_sum pf1 pf2). prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set pf1 \<union> support_set pf2. prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w) = (\<Sum>x\<in>support_set (qty_sum pf1 pf2). prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w)

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
have "... = cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>support_set (qty_sum pf1 pf2). prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w) = cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w
[PROOF STEP]
by (metis (no_types, lifting) pf sum.cong up_cl_proc.simps(2) cls_val_process_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>support_set (qty_sum pf1 pf2). prices Mkt x (Suc n) w * qty_sum pf1 pf2 x (Suc n) w) = cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w
[PROOF STEP]
have "(cls_val_process Mkt pf1) (Suc n) w + (cls_val_process Mkt pf2) (Suc n) w =
    cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w"
[PROOF STATE]
proof (prove)
using this:
cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w

goal (1 subgoal):
 1. cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w

goal (1 subgoal):
 1. \<And>n w. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
thus "cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w =
    (cls_val_process Mkt pf1) (Suc n) w + (cls_val_process Mkt pf2) (Suc n) w"
[PROOF STATE]
proof (prove)
using this:
cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w = cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w

goal (1 subgoal):
 1. cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
cls_val_process Mkt (qty_sum pf1 pf2) (Suc n) w = cls_val_process Mkt pf1 (Suc n) w + cls_val_process Mkt pf2 (Suc n) w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_infsum_bound:
  fixes f :: "'b \<Rightarrow> 'a::real_normed_vector"
    and A :: "'b set"
  assumes "f abs_summable_on A"
  shows "norm (infsum f A) \<le> infsum (\<lambda>x. norm (f x)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
proof (cases "f summable_on A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
 2. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f summable_on A

goal (2 subgoals):
 1. f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
 2. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
apply (rule norm_has_sum_bound[where A=A and f=f and a=\<open>infsum f A\<close> and n=\<open>infsum (\<lambda>x. norm (f x)) A\<close>])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. has_sum (\<lambda>x. norm (f x)) A (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
 2. has_sum f A (infsum f A)
[PROOF STEP]
using assms True
[PROOF STATE]
proof (prove)
using this:
f abs_summable_on A
f summable_on A

goal (2 subgoals):
 1. has_sum (\<lambda>x. norm (f x)) A (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
 2. has_sum f A (infsum f A)
[PROOF STEP]
by (metis finite_subsets_at_top_neq_bot infsum_def summable_on_def has_sum_def tendsto_Lim)+
[PROOF STATE]
proof (state)
this:
norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))

goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> f summable_on A

goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
obtain t where t_def: "(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f abs_summable_on A

goal (1 subgoal):
 1. (\<And>t. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding summable_on_def has_sum_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> x) (finite_subsets_at_top A)

goal (1 subgoal):
 1. (\<And>t. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A)

goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
have sumpos: "sum (\<lambda>x. norm (f x)) X \<ge> 0"
    for X
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (\<Sum>x\<in>X. norm (f x))
[PROOF STEP]
by (simp add: sum_nonneg)
[PROOF STATE]
proof (state)
this:
0 \<le> (\<Sum>x\<in>?X. norm (f x))

goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
have tgeq0:"t \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> t
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
define S::"real set" where "S = {s. s < 0}"
[PROOF STATE]
proof (state)
this:
S = {s. s < 0}

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
assume "\<not> 0 \<le> t"
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> t

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
hence "t < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> t

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

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
hence "t \<in> S"
[PROOF STATE]
proof (prove)
using this:
t < 0

goal (1 subgoal):
 1. t \<in> S
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
t < 0

goal (1 subgoal):
 1. t \<in> {s. s < 0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
t \<in> S

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
t \<in> S

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
have "open S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open S
[PROOF STEP]
have "closed {s::real. s \<ge> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {s. 0 \<le> s}
[PROOF STEP]
using Elementary_Topology.closed_sequential_limits[where S = "{s::real. s \<ge> 0}"]
[PROOF STATE]
proof (prove)
using this:
closed {s. 0 \<le> s} = (\<forall>x l. (\<forall>n. x n \<in> {s. 0 \<le> s}) \<and> x \<longlonglongrightarrow> l \<longrightarrow> l \<in> {s. 0 \<le> s})

goal (1 subgoal):
 1. closed {s. 0 \<le> s}
[PROOF STEP]
by (metis Lim_bounded2 mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
closed {s. 0 \<le> s}

goal (1 subgoal):
 1. open S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
closed {s. 0 \<le> s}

goal (1 subgoal):
 1. open S
[PROOF STEP]
have "{s::real. s \<ge> 0} = UNIV - S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {s. 0 \<le> s} = UNIV - S
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {s. 0 \<le> s} = UNIV - {s. s < 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{s. 0 \<le> s} = UNIV - S

goal (1 subgoal):
 1. open S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
closed {s. 0 \<le> s}
{s. 0 \<le> s} = UNIV - S
[PROOF STEP]
have "closed (UNIV - S)"
[PROOF STATE]
proof (prove)
using this:
closed {s. 0 \<le> s}
{s. 0 \<le> s} = UNIV - S

goal (1 subgoal):
 1. closed (UNIV - S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closed (UNIV - S)

goal (1 subgoal):
 1. open S
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
closed (UNIV - S)

goal (1 subgoal):
 1. open S
[PROOF STEP]
by (simp add: Compl_eq_Diff_UNIV open_closed)
[PROOF STATE]
proof (state)
this:
open S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
open S

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
t \<in> S
open S
[PROOF STEP]
have "\<forall>\<^sub>F X in finite_subsets_at_top A. (\<Sum>x\<in>X. norm (f x)) \<in> S"
[PROOF STATE]
proof (prove)
using this:
t \<in> S
open S

goal (1 subgoal):
 1. \<forall>\<^sub>F X in finite_subsets_at_top A. (\<Sum>x\<in>X. norm (f x)) \<in> S
[PROOF STEP]
using t_def
[PROOF STATE]
proof (prove)
using this:
t \<in> S
open S
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A)

goal (1 subgoal):
 1. \<forall>\<^sub>F X in finite_subsets_at_top A. (\<Sum>x\<in>X. norm (f x)) \<in> S
[PROOF STEP]
unfolding tendsto_def
[PROOF STATE]
proof (prove)
using this:
t \<in> S
open S
\<forall>S. open S \<longrightarrow> t \<in> S \<longrightarrow> (\<forall>\<^sub>F x in finite_subsets_at_top A. (\<Sum>x\<in>x. norm (f x)) \<in> S)

goal (1 subgoal):
 1. \<forall>\<^sub>F X in finite_subsets_at_top A. (\<Sum>x\<in>X. norm (f x)) \<in> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F X in finite_subsets_at_top A. (\<Sum>x\<in>X. norm (f x)) \<in> S

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
hence "\<exists>X. (\<Sum>x\<in>X. norm (f x)) \<in> S"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F X in finite_subsets_at_top A. (\<Sum>x\<in>X. norm (f x)) \<in> S

goal (1 subgoal):
 1. \<exists>X. (\<Sum>x\<in>X. norm (f x)) \<in> S
[PROOF STEP]
by (metis (no_types, lifting) eventually_mono filterlim_iff finite_subsets_at_top_neq_bot tendsto_Lim)
[PROOF STATE]
proof (state)
this:
\<exists>X. (\<Sum>x\<in>X. norm (f x)) \<in> S

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>X. (\<Sum>x\<in>X. norm (f x)) \<in> S
[PROOF STEP]
obtain X where "(\<Sum>x\<in>X. norm (f x)) \<in> S"
[PROOF STATE]
proof (prove)
using this:
\<exists>X. (\<Sum>x\<in>X. norm (f x)) \<in> S

goal (1 subgoal):
 1. (\<And>X. (\<Sum>x\<in>X. norm (f x)) \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>X. norm (f x)) \<in> S

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
hence "(\<Sum>x\<in>X. norm (f x)) < 0"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>X. norm (f x)) \<in> S

goal (1 subgoal):
 1. (\<Sum>x\<in>X. norm (f x)) < 0
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>X. norm (f x)) \<in> {s. s < 0}

goal (1 subgoal):
 1. (\<Sum>x\<in>X. norm (f x)) < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>X. norm (f x)) < 0

goal (1 subgoal):
 1. \<not> 0 \<le> t \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>X. norm (f x)) < 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> t

goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
have "\<exists>!h. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> h) (finite_subsets_at_top A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!h. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> h) (finite_subsets_at_top A)
[PROOF STEP]
using t_def finite_subsets_at_top_neq_bot tendsto_unique
[PROOF STATE]
proof (prove)
using this:
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A)
finite_subsets_at_top ?A \<noteq> bot
\<lbrakk>?F \<noteq> bot; (?f \<longlongrightarrow> ?a) ?F; (?f \<longlongrightarrow> ?b) ?F\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. \<exists>!h. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> h) (finite_subsets_at_top A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>!h. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> h) (finite_subsets_at_top A)

goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
hence "t = (Topological_Spaces.Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x))))"
[PROOF STATE]
proof (prove)
using this:
\<exists>!h. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> h) (finite_subsets_at_top A)

goal (1 subgoal):
 1. t = Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))
[PROOF STEP]
using t_def
[PROOF STATE]
proof (prove)
using this:
\<exists>!h. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> h) (finite_subsets_at_top A)
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A)

goal (1 subgoal):
 1. t = Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))
[PROOF STEP]
unfolding Topological_Spaces.Lim_def
[PROOF STATE]
proof (prove)
using this:
\<exists>!h. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> h) (finite_subsets_at_top A)
(sum (\<lambda>x. norm (f x)) \<longlongrightarrow> t) (finite_subsets_at_top A)

goal (1 subgoal):
 1. t = (THE l. (sum (\<lambda>x. norm (f x)) \<longlongrightarrow> l) (finite_subsets_at_top A))
[PROOF STEP]
by (metis the_equality)
[PROOF STATE]
proof (state)
this:
t = Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))

goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
hence "Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x))) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
t = Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))

goal (1 subgoal):
 1. 0 \<le> Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))
[PROOF STEP]
using tgeq0
[PROOF STATE]
proof (prove)
using this:
t = Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))
0 \<le> t

goal (1 subgoal):
 1. 0 \<le> Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 \<le> Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))

goal (1 subgoal):
 1. \<not> f summable_on A \<Longrightarrow> norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))

goal (1 subgoal):
 1. norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))
[PROOF STEP]
unfolding infsum_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))

goal (1 subgoal):
 1. norm (if f summable_on A then Lim (finite_subsets_at_top A) (sum f) else (0::'a)) \<le> (if f abs_summable_on A then Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x))) else 0)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
0 \<le> Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x)))
\<not> f summable_on A

goal (1 subgoal):
 1. norm (if f summable_on A then Lim (finite_subsets_at_top A) (sum f) else (0::'a)) \<le> (if f abs_summable_on A then Lim (finite_subsets_at_top A) (sum (\<lambda>x. norm (f x))) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm (infsum f A) \<le> (\<Sum>\<^sub>\<infinity>x\<in>A. norm (f x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_split_head: "summable f \<Longrightarrow> (\<Sum>n. f (Suc n)) = suminf f - f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<Sum>n. f (Suc n)) = suminf f - f 0
[PROOF STEP]
using suminf_split_initial_segment[of 1]
[PROOF STATE]
proof (prove)
using this:
summable f \<Longrightarrow> suminf f = (\<Sum>n. f (n + 1)) + sum f {..<1}

goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<Sum>n. f (Suc n)) = suminf f - f 0
[PROOF STEP]
by simp


[STATEMENT]
lemma (in group) subgroup_conjugation_is_inj:
  assumes "g \<in> carrier G" "H1 \<subseteq> carrier G" "H2 \<subseteq> carrier G"
    and "g <# H1 #> (inv g) = g <# H2 #> (inv g)"
    shows "H1 = H2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H1 = H2
[PROOF STEP]
using subgroup_conjugation_is_inj_aux assms set_eq_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?g \<in> carrier G; ?H1.0 \<subseteq> carrier G; ?H2.0 \<subseteq> carrier G; ?g <# ?H1.0 #> inv ?g = ?g <# ?H2.0 #> inv ?g\<rbrakk> \<Longrightarrow> ?H1.0 \<subseteq> ?H2.0
g \<in> carrier G
H1 \<subseteq> carrier G
H2 \<subseteq> carrier G
g <# H1 #> inv g = g <# H2 #> inv g
(?A = ?B) = (?A \<subseteq> ?B \<and> ?B \<subseteq> ?A)

goal (1 subgoal):
 1. H1 = H2
[PROOF STEP]
by metis


[STATEMENT]
lemma floor_less_neg_numeral [simp]: "\<lfloor>x\<rfloor> < - numeral v \<longleftrightarrow> x < - numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < - numeral v) = (x < - numeral v)
[PROOF STEP]
by (simp add: floor_less_iff)


[STATEMENT]
lemma Union_components [simp]: "\<Union>(components u) = u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (components u) = u
[PROOF STEP]
apply (rule subset_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Union> (components u) \<subseteq> u
 2. u \<subseteq> \<Union> (components u)
[PROOF STEP]
using Union_connected_component components_def
[PROOF STATE]
proof (prove)
using this:
\<Union> (connected_component_set ?S ` ?S) = ?S
components ?S \<equiv> connected_component_set ?S ` ?S

goal (2 subgoals):
 1. \<Union> (components u) \<subseteq> u
 2. u \<subseteq> \<Union> (components u)
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<subseteq> \<Union> (components u)
[PROOF STEP]
apply (metis Union_connected_component components_def set_eq_subset)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map_iterator_genord_key_filter_correct :
  fixes it :: "('a \<times> 'b, '\<sigma>) set_iterator"
  assumes it_OK: "map_iterator_genord it m R"
  shows "map_iterator_genord (map_iterator_key_filter P it) (m |` {k . P k}) R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_iterator_genord (map_iterator_key_filter P it) (m |` {k. P k}) R
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map_iterator_genord (map_iterator_key_filter P it) (m |` {k. P k}) R
[PROOF STEP]
from set_iterator_genord_filter_correct [OF it_OK, of "P \<circ> fst",
    folded map_iterator_key_filter_def]
[PROOF STATE]
proof (chain)
picking this:
set_iterator_genord (map_iterator_key_filter P it) {x \<in> map_to_set m. (P \<circ> fst) x} R
[PROOF STEP]
have step1: "set_iterator_genord (map_iterator_key_filter P it)
                  {x \<in> map_to_set m. (P \<circ> fst) x} R"
[PROOF STATE]
proof (prove)
using this:
set_iterator_genord (map_iterator_key_filter P it) {x \<in> map_to_set m. (P \<circ> fst) x} R

goal (1 subgoal):
 1. set_iterator_genord (map_iterator_key_filter P it) {x \<in> map_to_set m. (P \<circ> fst) x} R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_iterator_genord (map_iterator_key_filter P it) {x \<in> map_to_set m. (P \<circ> fst) x} R

goal (1 subgoal):
 1. map_iterator_genord (map_iterator_key_filter P it) (m |` {k. P k}) R
[PROOF STEP]
have "{x \<in> map_to_set m. (P \<circ> fst) x} = map_to_set (m |` {k . P k})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> map_to_set m. (P \<circ> fst) x} = map_to_set (m |` {k. P k})
[PROOF STEP]
unfolding map_to_set_def restrict_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> {(k, v). m k = Some v}. (P \<circ> fst) x} = {(k, v). (if k \<in> Collect P then m k else None) = Some v}
[PROOF STEP]
by (auto split: if_splits)
[PROOF STATE]
proof (state)
this:
{x \<in> map_to_set m. (P \<circ> fst) x} = map_to_set (m |` {k. P k})

goal (1 subgoal):
 1. map_iterator_genord (map_iterator_key_filter P it) (m |` {k. P k}) R
[PROOF STEP]
with step1
[PROOF STATE]
proof (chain)
picking this:
set_iterator_genord (map_iterator_key_filter P it) {x \<in> map_to_set m. (P \<circ> fst) x} R
{x \<in> map_to_set m. (P \<circ> fst) x} = map_to_set (m |` {k. P k})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_iterator_genord (map_iterator_key_filter P it) {x \<in> map_to_set m. (P \<circ> fst) x} R
{x \<in> map_to_set m. (P \<circ> fst) x} = map_to_set (m |` {k. P k})

goal (1 subgoal):
 1. map_iterator_genord (map_iterator_key_filter P it) (m |` {k. P k}) R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map_iterator_genord (map_iterator_key_filter P it) (m |` {k. P k}) R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sets_pre_sigmaD: "stopping_time F T \<Longrightarrow> A \<in> sets (pre_sigma T) \<Longrightarrow> {\<omega>\<in>A. T \<omega> \<le> t} \<in> sets (F t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>stopping_time F T; A \<in> sets (pre_sigma T)\<rbrakk> \<Longrightarrow> {\<omega> \<in> A. T \<omega> \<le> t} \<in> sets (F t)
[PROOF STEP]
unfolding sets_pre_sigma
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>stopping_time F T; A \<in> {A. \<forall>t. {\<omega> \<in> A. T \<omega> \<le> t} \<in> sets (F t)}\<rbrakk> \<Longrightarrow> {\<omega> \<in> A. T \<omega> \<le> t} \<in> sets (F t)
[PROOF STEP]
by auto


[STATEMENT]
lemma closed_levelset: "closed {x. s x = (c::'a::t1_space)}" if "continuous_on UNIV s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. s x = c}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed {x. s x = c}
[PROOF STEP]
have "{x. s x = c} = s -` {c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. s x = c} = s -` {c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. s x = c} = s -` {c}

goal (1 subgoal):
 1. closed {x. s x = c}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x. s x = c} = s -` {c}

goal (1 subgoal):
 1. closed {x. s x = c}
[PROOF STEP]
have "closed \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (s -` {c})
[PROOF STEP]
apply (rule closed_vimage)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. closed {c}
 2. continuous_on UNIV s
[PROOF STEP]
apply (rule closed_singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV s
[PROOF STEP]
apply (rule that)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
closed (s -` {c})

goal (1 subgoal):
 1. closed {x. s x = c}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closed {x. s x = c}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closed {x. s x = c}

goal (1 subgoal):
 1. closed {x. s x = c}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
closed {x. s x = c}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma factor_bound: assumes "f \<noteq> 0" "g dvd f" "degree g \<le> n"
  shows "\<bar>coeff g k\<bar> \<le> factor_bound f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> factor_bound f n
[PROOF STEP]
unfolding factor_bound_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
by (rule mignotte_bound[OF assms])


[STATEMENT]
lemma language_coinduct:
fixes R (infixl "\<sim>" 50)
assumes "\<And>K L. K \<sim> L \<Longrightarrow> K \<subseteq> lists S \<and> L \<subseteq> lists S"
assumes "K \<sim> L"
assumes "\<And>K L. K \<sim> L \<Longrightarrow> ([] \<in> K \<longleftrightarrow> [] \<in> L)"
assumes "\<And>K L x. K \<sim> L \<Longrightarrow> x : S \<Longrightarrow> Deriv x K \<sim> Deriv x L"
shows "K = L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K = L
[PROOF STEP]
apply (rule equal_if_bisimilar)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. K \<subseteq> lists S
 2. L \<subseteq> lists S
 3. local.bisimilar K L
[PROOF STEP]
apply (metis assms(1) assms(2))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. L \<subseteq> lists S
 2. local.bisimilar K L
[PROOF STEP]
apply (metis assms(1) assms(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.bisimilar K L
[PROOF STEP]
apply (rule bisimilar.coinduct[of R, OF \<open>K \<sim> L\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2. x1 \<sim> x2 \<Longrightarrow> \<exists>K L. x1 = K \<and> x2 = L \<and> K \<subseteq> lists S \<and> L \<subseteq> lists S \<and> ([] \<in> K) = ([] \<in> L) \<and> (\<forall>x. x \<in> S \<longrightarrow> Deriv x K \<sim> Deriv x L \<or> local.bisimilar (Deriv x K) (Deriv x L))
[PROOF STEP]
apply (auto simp: assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bounded_clinear_mult_left: "bounded_clinear (\<lambda>x::'a::complex_normed_algebra. x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear (\<lambda>x. x * y)
[PROOF STEP]
using bounded_cbilinear_mult
[PROOF STATE]
proof (prove)
using this:
bounded_cbilinear (*)

goal (1 subgoal):
 1. bounded_clinear (\<lambda>x. x * y)
[PROOF STEP]
by (rule bounded_cbilinear.bounded_clinear_left)


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


[STATEMENT]
lemma (in idom) poly_exp_eq_zero[simp]: "poly (p %^ n) = poly [] \<longleftrightarrow> poly p = poly [] \<and> n \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (p %^ n) = poly []) = (poly p = poly [] \<and> n \<noteq> 0)
[PROOF STEP]
apply (simp only: fun_eq_iff add: HOL.all_simps [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. poly (p %^ n) x = poly [] x) = (\<forall>x. poly p x = poly [] x \<and> n \<noteq> 0)
[PROOF STEP]
apply (rule arg_cong [where f = All])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. poly (p %^ n) x = poly [] x) = (\<lambda>x. poly p x = poly [] x \<and> n \<noteq> 0)
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (poly (p %^ n) x = poly [] x) = (poly p x = poly [] x \<and> n \<noteq> 0)
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. (poly (p %^ 0) x = poly [] x) = (poly p x = poly [] x \<and> 0 \<noteq> 0)
 2. \<And>n x. (\<And>x. (poly (p %^ n) x = poly [] x) = (poly p x = poly [] x \<and> n \<noteq> 0)) \<Longrightarrow> (poly (p %^ Suc n) x = poly [] x) = (poly p x = poly [] x \<and> Suc n \<noteq> 0)
[PROOF STEP]
apply (auto simp add: poly_exp poly_mult)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma zip_path_eq_right :
  assumes "length xs1 = length xs2"
  and     "length xs2 = length ys1"
  and     "length ys1 = length ys2"
  and     "p_io xs2 = p_io ys2"
  and     "zip_path xs1 xs2 = zip_path ys1 ys2"
shows "xs2 = ys2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs2 = ys2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs1 = length xs2
length xs2 = length ys1
length ys1 = length ys2
p_io xs2 = p_io ys2
zip_path xs1 xs2 = zip_path ys1 ys2

goal (1 subgoal):
 1. xs2 = ys2
[PROOF STEP]
by (induction xs1 xs2 ys1 ys2 rule: list_induct4; auto)


[STATEMENT]
lemma pairwise_orthogonal_proj_set:
  assumes C: "finite C" and p: "pairwise orthogonal C"
  shows "pairwise orthogonal (insert (a - proj_onto a C) C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise orthogonal (insert (a - proj_onto a C) C)
[PROOF STEP]
by (rule pairwise_orthogonal_insert[OF p], auto simp add: orthogonal_proj_set C p)


[STATEMENT]
lemma oppositeSymmetry [simp]:
  fixes literal1::Literal and literal2::Literal
  shows "(opposite literal1 = literal2) = (opposite literal2 = literal1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (opposite literal1 = literal2) = (opposite literal2 = literal1)
[PROOF STEP]
by auto


[STATEMENT]
lemma Suc_natural_minus_one: "Suc n - 1 = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Code_Numeral.Suc n - 1 = n
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma (in Gromov_hyperbolic_space) hyperb_quad_ineq [mono_intros]:
  shows "dist x y + dist z t \<le> max (dist x z + dist y t) (dist x t + dist y z) + 2 * deltaG(TYPE('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x y + dist z t \<le> max (dist x z + dist y t) (dist x t + dist y z) + 2 * deltaG TYPE('a)
[PROOF STEP]
using hyperb_quad_ineq0
[PROOF STATE]
proof (prove)
using this:
Gromov_hyperbolic_subset (deltaG TYPE('a)) UNIV

goal (1 subgoal):
 1. dist x y + dist z t \<le> max (dist x z + dist y t) (dist x t + dist y z) + 2 * deltaG TYPE('a)
[PROOF STEP]
unfolding Gromov_hyperbolic_subset_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. \<forall>z\<in>UNIV. \<forall>t\<in>UNIV. dist x y + dist z t \<le> max (dist x z + dist y t) (dist x t + dist y z) + 2 * deltaG TYPE('a)

goal (1 subgoal):
 1. dist x y + dist z t \<le> max (dist x z + dist y t) (dist x t + dist y z) + 2 * deltaG TYPE('a)
[PROOF STEP]
by auto


[STATEMENT]
lemma T_ins3_Node[simp]: "T_ins3 n d x (Node l y r) =
  (case cmp x y of
     LT \<Rightarrow> T_ins3 n (d+1) x l + T_up3 y r False (ins3 n (d+1) x l) |
     EQ \<Rightarrow> 0 |
     GT \<Rightarrow> T_ins3 n (d+1) x r + T_up3 y l True (ins3 n (d+1) x r)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_ins3 n d x \<langle>l, y, r\<rangle> = (case cmp x y of LT \<Rightarrow> T_ins3 n (d + 1) x l + T_up3 y r False (ins3 n (d + 1) x l) | EQ \<Rightarrow> 0 | GT \<Rightarrow> T_ins3 n (d + 1) x r + T_up3 y l True (ins3 n (d + 1) x r)) + 1
[PROOF STEP]
apply(subst T_ins3_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. time (ins3_tm n d x \<langle>l, y, r\<rangle>) = (case cmp x y of LT \<Rightarrow> T_ins3 n (d + 1) x l + T_up3 y r False (ins3 n (d + 1) x l) | EQ \<Rightarrow> 0 | GT \<Rightarrow> T_ins3 n (d + 1) x r + T_up3 y l True (ins3 n (d + 1) x r)) + 1
[PROOF STEP]
apply(subst ins3_tm.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. time ((case cmp x y of LT \<Rightarrow> ins3_tm n (d + 1) x l \<bind> up3_tm y r False | EQ \<Rightarrow> return Same2 | GT \<Rightarrow> ins3_tm n (d + 1) x r \<bind> up3_tm y l True) \<bind> tick) = (case cmp x y of LT \<Rightarrow> T_ins3 n (d + 1) x l + T_up3 y r False (ins3 n (d + 1) x l) | EQ \<Rightarrow> 0 | GT \<Rightarrow> T_ins3 n (d + 1) x r + T_up3 y l True (ins3 n (d + 1) x r)) + 1
[PROOF STEP]
apply(auto simp add: tm_simps surj_TM[OF ins3_def T_ins3_def] surj_TM[OF up3_def T_up3_def]
           simp del: T_up3_def2 split: tm.splits up2.split)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma arctan_less_iff: "arctan x < arctan y \<longleftrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arctan x < arctan y) = (x < y)
[PROOF STEP]
by (metis tan_monotone' arctan_lbound arctan_ubound tan_arctan)


[STATEMENT]
lemma integral_bij_count_space:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes g: "bij_betw g A B"
  shows "integral\<^sup>L (count_space A) (\<lambda>x. f (g x)) = integral\<^sup>L (count_space B) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|count_space A. f (g x) = integral\<^sup>L (count_space B) f
[PROOF STEP]
using g[THEN bij_betw_imp_funcset]
[PROOF STATE]
proof (prove)
using this:
g \<in> A \<rightarrow> B

goal (1 subgoal):
 1. LINT x|count_space A. f (g x) = integral\<^sup>L (count_space B) f
[PROOF STEP]
apply (subst distr_bij_count_space[OF g, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> A \<rightarrow> B \<Longrightarrow> LINT x|count_space A. f (g x) = integral\<^sup>L (distr (count_space A) (count_space B) g) f
[PROOF STEP]
apply (intro integral_distr[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. g \<in> A \<rightarrow> B \<Longrightarrow> g \<in> count_space A \<rightarrow>\<^sub>M count_space B
 2. g \<in> A \<rightarrow> B \<Longrightarrow> f \<in> borel_measurable (count_space B)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma add_comm':
  "a \<in> carrier R \<Longrightarrow> b \<in> carrier R \<Longrightarrow> nonsingular a b \<Longrightarrow>
   on_curve a b p\<^sub>1 \<Longrightarrow> on_curve a b p\<^sub>2 \<Longrightarrow> on_curve a b p\<^sub>3 \<Longrightarrow>
   add a p\<^sub>2 (add a p\<^sub>1 p\<^sub>3) = add a p\<^sub>1 (add a p\<^sub>2 p\<^sub>3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; nonsingular a b; on_curve a b p\<^sub>1; on_curve a b p\<^sub>2; on_curve a b p\<^sub>3\<rbrakk> \<Longrightarrow> local.add a p\<^sub>2 (local.add a p\<^sub>1 p\<^sub>3) = local.add a p\<^sub>1 (local.add a p\<^sub>2 p\<^sub>3)
[PROOF STEP]
by (simp add: add_assoc add_comm)


[STATEMENT]
lemma vinsert_commute: "vinsert a (vinsert b C) = vinsert b (vinsert a C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vinsert a (vinsert b C) = vinsert b (vinsert a C)
[PROOF STEP]
by auto


[STATEMENT]
lemma DERIV_nonpos_imp_nonincreasing:
  fixes a b :: real
    and f :: "real \<Rightarrow> real"
  assumes "a \<le> b"
    and "\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> \<exists>y. DERIV f x :> y \<and> y \<le> 0"
  shows "f a \<ge> f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f b \<le> f a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f b \<le> f a
[PROOF STEP]
have "(\<lambda>x. -f x) a \<le> (\<lambda>x. -f x) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - f a \<le> - f b
[PROOF STEP]
using DERIV_nonneg_imp_nondecreasing [of a b "\<lambda>x. -f x"] assms DERIV_minus
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> b; \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at x) \<and> 0 \<le> y\<rbrakk> \<Longrightarrow> - f a \<le> - f b
a \<le> b
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> \<exists>y. (f has_real_derivative y) (at ?x) \<and> y \<le> 0
(?f has_field_derivative ?D) (at ?x within ?s) \<Longrightarrow> ((\<lambda>x. - ?f x) has_field_derivative - ?D) (at ?x within ?s)

goal (1 subgoal):
 1. - f a \<le> - f b
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
- f a \<le> - f b

goal (1 subgoal):
 1. f b \<le> f a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- f a \<le> - f b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- f a \<le> - f b

goal (1 subgoal):
 1. f b \<le> f a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f b \<le> f a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma GreenThm_typeII_divisible:
  assumes
    gen_division: "gen_division s (cubeImage ` two_chain)"    (*This should follow from the assumption that images are not negligible*)
  shows "integral s (partial_vector_derivative (\<lambda>x. (F x) \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)
[PROOF STEP]
let ?F_a' = "(partial_vector_derivative (\<lambda>x. (F x) \<bullet> j) i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)
[PROOF STEP]
have "integral s (\<lambda>x. ?F_a' x) = two_chain_integral two_chain (\<lambda>a. ?F_a' a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = two_chain_integral two_chain (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)
[PROOF STEP]
proof (simp add: two_chain_integral_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
have partial_deriv_integrable:
      "(?F_a' has_integral (integral (cubeImage twoCube) ?F_a')) (cubeImage twoCube)"
      if "twoCube \<in> two_chain" for twoCube
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) (cubeImage twoCube)
[PROOF STEP]
by (simp add: analytically_valid_imp_part_deriv_integrable_on F_anal_valid integrable_integral that)
[PROOF STATE]
proof (state)
this:
?twoCube \<in> two_chain \<Longrightarrow> (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral integral (cubeImage ?twoCube) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) (cubeImage ?twoCube)

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?twoCube \<in> two_chain \<Longrightarrow> (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral integral (cubeImage ?twoCube) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) (cubeImage ?twoCube)
[PROOF STEP]
have partial_deriv_integrable:
      "\<And>twoCubeImg. twoCubeImg \<in> cubeImage ` two_chain \<Longrightarrow> ((\<lambda>x. ?F_a' x) has_integral (integral (twoCubeImg) (\<lambda>x. ?F_a' x))) (twoCubeImg)"
[PROOF STATE]
proof (prove)
using this:
?twoCube \<in> two_chain \<Longrightarrow> (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral integral (cubeImage ?twoCube) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) (cubeImage ?twoCube)

goal (1 subgoal):
 1. \<And>twoCubeImg. twoCubeImg \<in> cubeImage ` two_chain \<Longrightarrow> (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral integral twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) twoCubeImg
[PROOF STEP]
using integrable_neg
[PROOF STATE]
proof (prove)
using this:
?twoCube \<in> two_chain \<Longrightarrow> (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral integral (cubeImage ?twoCube) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) (cubeImage ?twoCube)
?f integrable_on ?S \<Longrightarrow> (\<lambda>x. - ?f x) integrable_on ?S

goal (1 subgoal):
 1. \<And>twoCubeImg. twoCubeImg \<in> cubeImage ` two_chain \<Longrightarrow> (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral integral twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) twoCubeImg
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
?twoCubeImg \<in> cubeImage ` two_chain \<Longrightarrow> (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral integral ?twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) ?twoCubeImg

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
have finite_images: "finite (cubeImage ` two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (cubeImage ` two_chain)
[PROOF STEP]
using gen_division gen_division_def
[PROOF STATE]
proof (prove)
using this:
gen_division s (cubeImage ` two_chain)
gen_division ?s ?S \<equiv> finite ?S \<and> \<Union> ?S = ?s \<and> pairwise (\<lambda>X Y. negligible (X \<inter> Y)) ?S

goal (1 subgoal):
 1. finite (cubeImage ` two_chain)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (cubeImage ` two_chain)

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
have negligible_images: "pairwise (\<lambda>S S'. negligible (S \<inter> S')) (cubeImage ` two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise (\<lambda>S S'. negligible (S \<inter> S')) (cubeImage ` two_chain)
[PROOF STEP]
using gen_division
[PROOF STATE]
proof (prove)
using this:
gen_division s (cubeImage ` two_chain)

goal (1 subgoal):
 1. pairwise (\<lambda>S S'. negligible (S \<inter> S')) (cubeImage ` two_chain)
[PROOF STEP]
by (auto simp add: gen_division_def pairwise_def)
[PROOF STATE]
proof (state)
this:
pairwise (\<lambda>S S'. negligible (S \<inter> S')) (cubeImage ` two_chain)

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
have "inj_on cubeImage two_chain"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on cubeImage two_chain
[PROOF STEP]
using valid_typeII_div valid_two_chain_def
[PROOF STATE]
proof (prove)
using this:
valid_typeII_division s two_chain
valid_two_chain ?twoChain \<equiv> (\<forall>twoCube\<in>?twoChain. valid_two_cube twoCube) \<and> pairwise (\<lambda>c1 c2. boundary c1 \<inter> boundary c2 = {}) ?twoChain \<and> inj_on cubeImage ?twoChain

goal (1 subgoal):
 1. inj_on cubeImage two_chain
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on cubeImage two_chain

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on cubeImage two_chain
[PROOF STEP]
have "(\<Sum>twoCubeImg\<in>cubeImage ` two_chain. integral twoCubeImg (\<lambda>x. ?F_a' x))
             = (\<Sum>C\<in>two_chain. integral (cubeImage C) (\<lambda>a. ?F_a' a))"
[PROOF STATE]
proof (prove)
using this:
inj_on cubeImage two_chain

goal (1 subgoal):
 1. (\<Sum>twoCubeImg\<in>cubeImage ` two_chain. integral twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
using sum.reindex
[PROOF STATE]
proof (prove)
using this:
inj_on cubeImage two_chain
inj_on ?h ?A \<Longrightarrow> sum ?g (?h ` ?A) = sum (?g \<circ> ?h) ?A

goal (1 subgoal):
 1. (\<Sum>twoCubeImg\<in>cubeImage ` two_chain. integral twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>twoCubeImg\<in>cubeImage ` two_chain. integral twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>twoCubeImg\<in>cubeImage ` two_chain. integral twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
show "integral s (\<lambda>x. ?F_a' x) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (\<lambda>a. ?F_a' a))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>twoCubeImg\<in>cubeImage ` two_chain. integral twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
using has_integral_Union[OF finite_images partial_deriv_integrable negligible_images] gen_division
[PROOF STATE]
proof (prove)
using this:
(\<Sum>twoCubeImg\<in>cubeImage ` two_chain. integral twoCubeImg (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
(\<And>S. S \<in> cubeImage ` two_chain \<Longrightarrow> S \<in> cubeImage ` two_chain) \<Longrightarrow> (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i has_integral (\<Sum>S\<in>cubeImage ` two_chain. integral S (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))) (\<Union> (cubeImage ` two_chain))
gen_division s (cubeImage ` two_chain)

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))
[PROOF STEP]
by (auto simp add: gen_division_def)
[PROOF STATE]
proof (state)
this:
integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = (\<Sum>C\<in>two_chain. integral (cubeImage C) (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = two_chain_integral two_chain (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = two_chain_integral two_chain (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = two_chain_integral two_chain (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)
[PROOF STEP]
using GreenThm_typeII_twoChain F_anal_valid
[PROOF STATE]
proof (prove)
using this:
integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = two_chain_integral two_chain (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i)
two_chain_integral two_chain (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)
\<forall>twoC\<in>two_chain. analytically_valid (cubeImage twoC) (\<lambda>x. F x \<bullet> j) i

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} (two_chain_boundary two_chain)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma but_last_map2 [rule_format] :
  "\<forall>ys. length xs = length ys \<longrightarrow> xs \<noteq> [] \<longrightarrow>
    last (map2 f xs ys) = f (last xs) (last ys) \<and>
    butlast (map2 f xs ys) = map2 f (butlast xs) (butlast ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>ys. length xs = length ys \<longrightarrow> xs \<noteq> [] \<longrightarrow> last (map2 f xs ys) = f (last xs) (last ys) \<and> butlast (map2 f xs ys) = map2 f (butlast xs) (butlast ys)
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>ys. length [] = length ys \<longrightarrow> [] \<noteq> [] \<longrightarrow> last (map2 f [] ys) = f (last []) (last ys) \<and> butlast (map2 f [] ys) = map2 f (butlast []) (butlast ys)
 2. \<And>a xs. \<forall>ys. length xs = length ys \<longrightarrow> xs \<noteq> [] \<longrightarrow> last (map2 f xs ys) = f (last xs) (last ys) \<and> butlast (map2 f xs ys) = map2 f (butlast xs) (butlast ys) \<Longrightarrow> \<forall>ys. length (a # xs) = length ys \<longrightarrow> a # xs \<noteq> [] \<longrightarrow> last (map2 f (a # xs) ys) = f (last (a # xs)) (last ys) \<and> butlast (map2 f (a # xs) ys) = map2 f (butlast (a # xs)) (butlast ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a ys. Suc 0 = length ys \<Longrightarrow> last (map2 f [a] ys) = f a (last ys)
 2. \<And>a ys. Suc 0 = length ys \<Longrightarrow> butlast (map2 f [a] ys) = []
 3. \<And>a xs ys. \<lbrakk>\<forall>ys. length xs = length ys \<longrightarrow> last (map2 f xs ys) = f (last xs) (last ys) \<and> butlast (map2 f xs ys) = map2 f (butlast xs) (butlast ys); xs \<noteq> []; Suc (length xs) = length ys\<rbrakk> \<Longrightarrow> last (map2 f (a # xs) ys) = f (last xs) (last ys)
 4. \<And>a xs ys. \<lbrakk>\<forall>ys. length xs = length ys \<longrightarrow> last (map2 f xs ys) = f (last xs) (last ys) \<and> butlast (map2 f xs ys) = map2 f (butlast xs) (butlast ys); xs \<noteq> []; Suc (length xs) = length ys\<rbrakk> \<Longrightarrow> butlast (map2 f (a # xs) ys) = map2 f (a # butlast xs) (butlast ys)
[PROOF STEP]
apply ((case_tac ys, auto simp: neq_Nil_conv)[1])+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_partition_length :
  "List.length lrs = List.length (fst (sum_partition lrs)) + List.length (snd (sum_partition lrs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length lrs = length (fst (sum_partition lrs)) + length (snd (sum_partition lrs))
[PROOF STEP]
proof (induct lrs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length [] = length (fst (sum_partition [])) + length (snd (sum_partition []))
 2. \<And>a lrs. length lrs = length (fst (sum_partition lrs)) + length (snd (sum_partition lrs)) \<Longrightarrow> length (a # lrs) = length (fst (sum_partition (a # lrs))) + length (snd (sum_partition (a # lrs)))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. length [] = length (fst (sum_partition [])) + length (snd (sum_partition []))
 2. \<And>a lrs. length lrs = length (fst (sum_partition lrs)) + length (snd (sum_partition lrs)) \<Longrightarrow> length (a # lrs) = length (fst (sum_partition (a # lrs))) + length (snd (sum_partition (a # lrs)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [] = length (fst (sum_partition [])) + length (snd (sum_partition []))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length [] = length (fst (sum_partition [])) + length (snd (sum_partition []))

goal (1 subgoal):
 1. \<And>a lrs. length lrs = length (fst (sum_partition lrs)) + length (snd (sum_partition lrs)) \<Longrightarrow> length (a # lrs) = length (fst (sum_partition (a # lrs))) + length (snd (sum_partition (a # lrs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a lrs. length lrs = length (fst (sum_partition lrs)) + length (snd (sum_partition lrs)) \<Longrightarrow> length (a # lrs) = length (fst (sum_partition (a # lrs))) + length (snd (sum_partition (a # lrs)))
[PROOF STEP]
case (Cons lr lrs)
[PROOF STATE]
proof (state)
this:
length lrs = length (fst (sum_partition lrs)) + length (snd (sum_partition lrs))

goal (1 subgoal):
 1. \<And>a lrs. length lrs = length (fst (sum_partition lrs)) + length (snd (sum_partition lrs)) \<Longrightarrow> length (a # lrs) = length (fst (sum_partition (a # lrs))) + length (snd (sum_partition (a # lrs)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length lrs = length (fst (sum_partition lrs)) + length (snd (sum_partition lrs))

goal (1 subgoal):
 1. length (lr # lrs) = length (fst (sum_partition (lr # lrs))) + length (snd (sum_partition (lr # lrs)))
[PROOF STEP]
by (cases lr) (auto split: prod.split)
[PROOF STATE]
proof (state)
this:
length (lr # lrs) = length (fst (sum_partition (lr # lrs))) + length (snd (sum_partition (lr # lrs)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma num_reachable_mono:
  "wf_graph \<lparr>nodes=N, edges=E\<rparr> \<Longrightarrow> E' \<subseteq> E \<Longrightarrow> num_reachable \<lparr>nodes=N, edges=E'\<rparr> v \<le> num_reachable \<lparr>nodes=N, edges=E\<rparr> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E\<rbrakk> \<Longrightarrow> num_reachable \<lparr>nodes = N, edges = E'\<rparr> v \<le> num_reachable \<lparr>nodes = N, edges = E\<rparr> v
[PROOF STEP]
apply(simp add: num_reachable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E\<rbrakk> \<Longrightarrow> card (succ_tran \<lparr>nodes = N, edges = E'\<rparr> v) \<le> card (succ_tran \<lparr>nodes = N, edges = E\<rparr> v)
[PROOF STEP]
apply(frule_tac E'="E'" and v="v" in succ_tran_mono, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E; succ_tran \<lparr>nodes = N, edges = E'\<rparr> v \<subseteq> succ_tran \<lparr>nodes = N, edges = E\<rparr> v\<rbrakk> \<Longrightarrow> card (succ_tran \<lparr>nodes = N, edges = E'\<rparr> v) \<le> card (succ_tran \<lparr>nodes = N, edges = E\<rparr> v)
[PROOF STEP]
apply(frule_tac v="v" in succ_tran_finite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E; succ_tran \<lparr>nodes = N, edges = E'\<rparr> v \<subseteq> succ_tran \<lparr>nodes = N, edges = E\<rparr> v; finite (succ_tran \<lparr>nodes = N, edges = E\<rparr> v)\<rbrakk> \<Longrightarrow> card (succ_tran \<lparr>nodes = N, edges = E'\<rparr> v) \<le> card (succ_tran \<lparr>nodes = N, edges = E\<rparr> v)
[PROOF STEP]
apply(simp add: card_mono)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done

  \<comment> \<open>num_reachable_norefl\<close>


[STATEMENT]
lemma bijective_Id_on[intro!, simp]: "bijective (Id_on A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bijective (Id_on A)
[PROOF STEP]
unfolding bijective_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y z. (x, y) \<in> Id_on A \<and> (x, z) \<in> Id_on A \<longrightarrow> y = z) \<and> (\<forall>x y z. (x, z) \<in> Id_on A \<and> (y, z) \<in> Id_on A \<longrightarrow> x = y)
[PROOF STEP]
by auto


[STATEMENT]
lemma is_ortho_set_antimono: \<open>A \<subseteq> B \<Longrightarrow> is_ortho_set B \<Longrightarrow> is_ortho_set A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; is_ortho_set B\<rbrakk> \<Longrightarrow> is_ortho_set A
[PROOF STEP]
unfolding is_ortho_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; (\<forall>x\<in>B. \<forall>y\<in>B. x \<noteq> y \<longrightarrow> is_orthogonal x y) \<and> (0::'a) \<notin> B\<rbrakk> \<Longrightarrow> (\<forall>x\<in>A. \<forall>y\<in>A. x \<noteq> y \<longrightarrow> is_orthogonal x y) \<and> (0::'a) \<notin> A
[PROOF STEP]
by auto


[STATEMENT]
lemma (in ring) embed_char_eq_0_iff:
  fixes n :: int
  shows "int_embed R n = \<zero> \<longleftrightarrow> char R dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
proof (cases "char R > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < char R

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
define r where "r = n mod char R"
[PROOF STATE]
proof (state)
this:
r = n mod int (char R)

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
define s where "s = n div char R"
[PROOF STATE]
proof (state)
this:
s = n div int (char R)

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
have rs: "r < char R" "r \<ge> 0" "n = r + s * char R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r < int (char R) &&& 0 \<le> r &&& n = r + s * int (char R)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
0 < char R

goal (1 subgoal):
 1. r < int (char R) &&& 0 \<le> r &&& n = r + s * int (char R)
[PROOF STEP]
by (simp_all add:r_def s_def)
[PROOF STATE]
proof (state)
this:
r < int (char R)
0 \<le> r
n = r + s * int (char R)

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
have "int_embed R n = int_embed R r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_embed R n = int_embed R r
[PROOF STEP]
using int_embed_closed
[PROOF STATE]
proof (prove)
using this:
int_embed R ?k \<in> carrier R

goal (1 subgoal):
 1. int_embed R n = int_embed R r
[PROOF STEP]
unfolding rs(3)
[PROOF STATE]
proof (prove)
using this:
int_embed R ?k \<in> carrier R

goal (1 subgoal):
 1. int_embed R (r + s * int (char R)) = int_embed R r
[PROOF STEP]
by (simp add: int_embed_add  int_embed_mult embed_char_eq_0)
[PROOF STATE]
proof (state)
this:
int_embed R n = int_embed R r

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int_embed R n = int_embed R r

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
have "nat r < char R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat r < char R
[PROOF STEP]
using rs
[PROOF STATE]
proof (prove)
using this:
r < int (char R)
0 \<le> r
n = r + s * int (char R)

goal (1 subgoal):
 1. nat r < char R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat r < char R

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
hence "int_embed R (nat r) \<noteq> \<zero> \<or> nat r = 0"
[PROOF STATE]
proof (prove)
using this:
nat r < char R

goal (1 subgoal):
 1. int_embed R (int (nat r)) \<noteq> \<zero> \<or> nat r = 0
[PROOF STEP]
using True char_bound not_less
[PROOF STATE]
proof (prove)
using this:
nat r < char R
0 < char R
\<lbrakk>0 < ?x; int_embed R (int ?x) = \<zero>\<rbrakk> \<Longrightarrow> char R \<le> ?x
\<lbrakk>0 < ?x; int_embed R (int ?x) = \<zero>\<rbrakk> \<Longrightarrow> 0 < char R
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. int_embed R (int (nat r)) \<noteq> \<zero> \<or> nat r = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
int_embed R (int (nat r)) \<noteq> \<zero> \<or> nat r = 0

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
hence "int_embed R r \<noteq> \<zero> \<or> r = 0"
[PROOF STATE]
proof (prove)
using this:
int_embed R (int (nat r)) \<noteq> \<zero> \<or> nat r = 0

goal (1 subgoal):
 1. int_embed R r \<noteq> \<zero> \<or> r = 0
[PROOF STEP]
using rs
[PROOF STATE]
proof (prove)
using this:
int_embed R (int (nat r)) \<noteq> \<zero> \<or> nat r = 0
r < int (char R)
0 \<le> r
n = r + s * int (char R)

goal (1 subgoal):
 1. int_embed R r \<noteq> \<zero> \<or> r = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int_embed R r \<noteq> \<zero> \<or> r = 0

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
int_embed R n = int_embed R r
int_embed R r \<noteq> \<zero> \<or> r = 0
[PROOF STEP]
have "int_embed R n = \<zero> \<longleftrightarrow> r = 0"
[PROOF STATE]
proof (prove)
using this:
int_embed R n = int_embed R r
int_embed R r \<noteq> \<zero> \<or> r = 0

goal (1 subgoal):
 1. (int_embed R n = \<zero>) = (r = 0)
[PROOF STEP]
using int_embed_zero
[PROOF STATE]
proof (prove)
using this:
int_embed R n = int_embed R r
int_embed R r \<noteq> \<zero> \<or> r = 0
int_embed R 0 = \<zero>

goal (1 subgoal):
 1. (int_embed R n = \<zero>) = (r = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(int_embed R n = \<zero>) = (r = 0)

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(int_embed R n = \<zero>) = (r = 0)

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
have "r = 0 \<longleftrightarrow> char R dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r = 0) = (int (char R) dvd n)
[PROOF STEP]
using r_def
[PROOF STATE]
proof (prove)
using this:
r = n mod int (char R)

goal (1 subgoal):
 1. (r = 0) = (int (char R) dvd n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(r = 0) = (int (char R) dvd n)

goal (2 subgoals):
 1. 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
 2. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(int_embed R n = \<zero>) = (int (char R) dvd n)

goal (1 subgoal):
 1. (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(int_embed R n = \<zero>) = (int (char R) dvd n)

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < char R

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
hence "char R = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < char R

goal (1 subgoal):
 1. char R = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
char R = 0

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
hence a:"x > 0 \<Longrightarrow> int_embed R (int x) \<noteq> \<zero>" for x
[PROOF STATE]
proof (prove)
using this:
char R = 0

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> int_embed R (int x) \<noteq> \<zero>
[PROOF STEP]
using char_bound
[PROOF STATE]
proof (prove)
using this:
char R = 0
\<lbrakk>0 < ?x; int_embed R (int ?x) = \<zero>\<rbrakk> \<Longrightarrow> char R \<le> ?x
\<lbrakk>0 < ?x; int_embed R (int ?x) = \<zero>\<rbrakk> \<Longrightarrow> 0 < char R

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> int_embed R (int x) \<noteq> \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < ?x \<Longrightarrow> int_embed R (int ?x) \<noteq> \<zero>

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
have c:"int_embed R (abs x) \<noteq> \<zero> \<longleftrightarrow> int_embed R x \<noteq> \<zero>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int_embed R \<bar>x\<bar> \<noteq> \<zero>) = (int_embed R x \<noteq> \<zero>)
[PROOF STEP]
using int_embed_closed
[PROOF STATE]
proof (prove)
using this:
int_embed R ?k \<in> carrier R

goal (1 subgoal):
 1. (int_embed R \<bar>x\<bar> \<noteq> \<zero>) = (int_embed R x \<noteq> \<zero>)
[PROOF STEP]
by (cases "x > 0", simp, simp add:int_embed_inv)
[PROOF STATE]
proof (state)
this:
(int_embed R \<bar>?x\<bar> \<noteq> \<zero>) = (int_embed R ?x \<noteq> \<zero>)

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
have "int_embed R x \<noteq> \<zero>" if b:"x \<noteq> 0" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_embed R x \<noteq> \<zero>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int_embed R x \<noteq> \<zero>
[PROOF STEP]
have "nat (abs x) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < nat \<bar>x\<bar>
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

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

goal (1 subgoal):
 1. int_embed R x \<noteq> \<zero>
[PROOF STEP]
hence "int_embed R (nat (abs x)) \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
using this:
0 < nat \<bar>x\<bar>

goal (1 subgoal):
 1. int_embed R (int (nat \<bar>x\<bar>)) \<noteq> \<zero>
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
0 < nat \<bar>x\<bar>
0 < ?x \<Longrightarrow> int_embed R (int ?x) \<noteq> \<zero>

goal (1 subgoal):
 1. int_embed R (int (nat \<bar>x\<bar>)) \<noteq> \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
int_embed R (int (nat \<bar>x\<bar>)) \<noteq> \<zero>

goal (1 subgoal):
 1. int_embed R x \<noteq> \<zero>
[PROOF STEP]
hence "int_embed R (abs x) \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
using this:
int_embed R (int (nat \<bar>x\<bar>)) \<noteq> \<zero>

goal (1 subgoal):
 1. int_embed R \<bar>x\<bar> \<noteq> \<zero>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int_embed R \<bar>x\<bar> \<noteq> \<zero>

goal (1 subgoal):
 1. int_embed R x \<noteq> \<zero>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
int_embed R \<bar>x\<bar> \<noteq> \<zero>

goal (1 subgoal):
 1. int_embed R x \<noteq> \<zero>
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
int_embed R \<bar>x\<bar> \<noteq> \<zero>
(int_embed R \<bar>?x\<bar> \<noteq> \<zero>) = (int_embed R ?x \<noteq> \<zero>)

goal (1 subgoal):
 1. int_embed R x \<noteq> \<zero>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int_embed R x \<noteq> \<zero>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<noteq> 0 \<Longrightarrow> int_embed R ?x \<noteq> \<zero>

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
hence "int_embed R n = \<zero> \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> 0 \<Longrightarrow> int_embed R ?x \<noteq> \<zero>

goal (1 subgoal):
 1. (int_embed R n = \<zero>) = (n = 0)
[PROOF STEP]
using int_embed_zero
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> 0 \<Longrightarrow> int_embed R ?x \<noteq> \<zero>
int_embed R 0 = \<zero>

goal (1 subgoal):
 1. (int_embed R n = \<zero>) = (n = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(int_embed R n = \<zero>) = (n = 0)

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(int_embed R n = \<zero>) = (n = 0)

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
have "n = 0 \<longleftrightarrow> char R dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n = 0) = (int (char R) dvd n)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < char R

goal (1 subgoal):
 1. (n = 0) = (int (char R) dvd n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(n = 0) = (int (char R) dvd n)

goal (1 subgoal):
 1. \<not> 0 < char R \<Longrightarrow> (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(int_embed R n = \<zero>) = (int (char R) dvd n)

goal (1 subgoal):
 1. (int_embed R n = \<zero>) = (int (char R) dvd n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(int_embed R n = \<zero>) = (int (char R) dvd n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_upperhalf_Arg2pi: "continuous_on ({z. 0 \<le> Im z} - {0}) Arg2pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ({z. 0 \<le> Im z} - {0}) Arg2pi
[PROOF STEP]
unfolding continuous_on_eq_continuous_within
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{z. 0 \<le> Im z} - {0}. continuous (at x within {z. 0 \<le> Im z} - {0}) Arg2pi
[PROOF STEP]
by (metis DiffE Diff_subset continuous_within_subset continuous_within_upperhalf_Arg2pi insertCI)


[STATEMENT]
lemma map_prod_image: "map_prod f g ` (A \<times> B) = (f`A) \<times> (g`B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_prod f g ` (A \<times> B) = f ` A \<times> g ` B
[PROOF STEP]
using map_prod_surj_on[OF refl refl]
[PROOF STATE]
proof (prove)
using this:
map_prod ?f ?g ` (?A \<times> ?B) = ?f ` ?A \<times> ?g ` ?B

goal (1 subgoal):
 1. map_prod f g ` (A \<times> B) = f ` A \<times> g ` B
[PROOF STEP]
.


[STATEMENT]
lemma Gauss_Jordan_wrapper_code[code abstract]:
  "vec_nth (Gauss_Jordan_wrapper i j A B) = (%s. if s=i then A $ s else (row_add A s i (-(B$s$j))) $ s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (Gauss_Jordan_wrapper i j A B) = (\<lambda>s. if s = i then A $ s else row_add A s i (- B $ s $ j) $ s)
[PROOF STEP]
unfolding Gauss_Jordan_wrapper_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (\<chi>s. if s = i then A $ s else row_add A s i (- B $ s $ j) $ s) = (\<lambda>s. if s = i then A $ s else row_add A s i (- B $ s $ j) $ s)
[PROOF STEP]
by force


[STATEMENT]
lemma module_hom_eq_on_span: "f x = g x"
  if "module_hom s1 s2 f" "module_hom s1 s2 g"
  and "(\<And>x. x \<in> B \<Longrightarrow> f x = g x)" "x \<in> m1.span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x = g x
[PROOF STEP]
interpret module_hom s1 s2 "\<lambda>x. f x - g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module_hom s1 s2 (\<lambda>x. f x - g x)
[PROOF STEP]
by (rule module_hom_sub that)+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x = g x
[PROOF STEP]
from eq_0_on_span[OF _ that(4)] that(3)
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> B \<Longrightarrow> f x - g x = (0::'c)) \<Longrightarrow> f x - g x = (0::'c)
?x \<in> B \<Longrightarrow> f ?x = g ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> B \<Longrightarrow> f x - g x = (0::'c)) \<Longrightarrow> f x - g x = (0::'c)
?x \<in> B \<Longrightarrow> f ?x = g ?x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Limsup_obtain':
  fixes u::"'a \<Rightarrow> 'b::complete_linorder"
  assumes "Limsup F u > c" "eventually P F"
  shows "\<exists>n. P n \<and> u n > c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. P n \<and> c < u n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. P n \<and> c < u n
[PROOF STEP]
have *: "(INF P\<in>{P. eventually P F}. SUP x\<in>{x. P x}. u x) > c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (INF P\<in>{P. eventually P F}. Sup (u ` {x. P x}))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c < Limsup F u
eventually P F

goal (1 subgoal):
 1. c < (INF P\<in>{P. eventually P F}. Sup (u ` {x. P x}))
[PROOF STEP]
by (simp add: Limsup_def)
[PROOF STATE]
proof (state)
this:
c < (INF P\<in>{P. eventually P F}. Sup (u ` {x. P x}))

goal (1 subgoal):
 1. \<exists>n. P n \<and> c < u n
[PROOF STEP]
have **: "c < (SUP x\<in>{x. P x}. u x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < Sup (u ` {x. P x})
[PROOF STEP]
using less_INF_D[OF *, of P] assms
[PROOF STATE]
proof (prove)
using this:
P \<in> {P. eventually P F} \<Longrightarrow> c < Sup (u ` {x. P x})
c < Limsup F u
eventually P F

goal (1 subgoal):
 1. c < Sup (u ` {x. P x})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c < Sup (u ` {x. P x})

goal (1 subgoal):
 1. \<exists>n. P n \<and> c < u n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c < Sup (u ` {x. P x})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c < Sup (u ` {x. P x})

goal (1 subgoal):
 1. \<exists>n. P n \<and> c < u n
[PROOF STEP]
by (simp add: less_SUP_iff)
[PROOF STATE]
proof (state)
this:
\<exists>n. P n \<and> c < u n

goal:
No subgoals!
[PROOF STEP]
qed