[STATEMENT]
lemma AE_sum:
  assumes "finite I"
  and  "\<forall> i\<in>I. AE w in M. f i w = g i w"
  shows "AE w in M. (\<Sum>i\<in> I. f i w) = (\<Sum>i\<in> I. g i w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AEeq M (\<lambda>w. \<Sum>i\<in>I. f i w) (\<lambda>w. \<Sum>i\<in>I. g i w)
[PROOF STEP]
using assms(1) subset_refl[of I]
[PROOF STATE]
proof (prove)
using this:
finite I
I \<subseteq> I

goal (1 subgoal):
 1. AEeq M (\<lambda>w. \<Sum>i\<in>I. f i w) (\<lambda>w. \<Sum>i\<in>I. g i w)
[PROOF STEP]
proof (induct rule: finite_subset_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. AEeq M (\<lambda>w. \<Sum>i\<in>{}. f i w) (\<lambda>w. \<Sum>i\<in>{}. g i w)
 2. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. AEeq M (\<lambda>w. \<Sum>i\<in>{}. f i w) (\<lambda>w. \<Sum>i\<in>{}. g i w)
 2. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AEeq M (\<lambda>w. \<Sum>i\<in>{}. f i w) (\<lambda>w. \<Sum>i\<in>{}. g i w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. \<Sum>i\<in>{}. f i w) (\<lambda>w. \<Sum>i\<in>{}. g i w)

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
case (insert a F)
[PROOF STATE]
proof (state)
this:
finite F
a \<in> I
a \<notin> F
AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
have "AEeq M (f a) (g a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AEeq M (f a) (g a)
[PROOF STEP]
using assms(2) insert.hyps(2)
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>I. AEeq M (f i) (g i)
a \<in> I

goal (1 subgoal):
 1. AEeq M (f a) (g a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AEeq M (f a) (g a)

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
have "AE w in M. (\<Sum>i\<in> insert a F. f i w) = f a w + (\<Sum>i\<in> F. f i w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. f a w + (\<Sum>i\<in>F. f i w))
[PROOF STEP]
by (simp add: insert.hyps(1) insert.hyps(3))
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. f a w + (\<Sum>i\<in>F. f i w))

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. f a w + (\<Sum>i\<in>F. f i w))

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
have "AE w in M. f a w + (\<Sum>i\<in> F. f i w) = g a w + (\<Sum>i\<in> F. f i w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AEeq M (\<lambda>w. f a w + (\<Sum>i\<in>F. f i w)) (\<lambda>w. g a w + (\<Sum>i\<in>F. f i w))
[PROOF STEP]
using \<open>AEeq M (f a) (g a)\<close>
[PROOF STATE]
proof (prove)
using this:
AEeq M (f a) (g a)

goal (1 subgoal):
 1. AEeq M (\<lambda>w. f a w + (\<Sum>i\<in>F. f i w)) (\<lambda>w. g a w + (\<Sum>i\<in>F. f i w))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. f a w + (\<Sum>i\<in>F. f i w)) (\<lambda>w. g a w + (\<Sum>i\<in>F. f i w))

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. f a w + (\<Sum>i\<in>F. f i w)) (\<lambda>w. g a w + (\<Sum>i\<in>F. f i w))

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
have "AE w in M. g a w + (\<Sum>i\<in> F. f i w) = g a w + (\<Sum>i\<in> F. g i w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AEeq M (\<lambda>w. g a w + (\<Sum>i\<in>F. f i w)) (\<lambda>w. g a w + (\<Sum>i\<in>F. g i w))
[PROOF STEP]
using insert.hyps(4)
[PROOF STATE]
proof (prove)
using this:
AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)

goal (1 subgoal):
 1. AEeq M (\<lambda>w. g a w + (\<Sum>i\<in>F. f i w)) (\<lambda>w. g a w + (\<Sum>i\<in>F. g i w))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. g a w + (\<Sum>i\<in>F. f i w)) (\<lambda>w. g a w + (\<Sum>i\<in>F. g i w))

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. g a w + (\<Sum>i\<in>F. f i w)) (\<lambda>w. g a w + (\<Sum>i\<in>F. g i w))

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
have "AE w in M. g a w + (\<Sum>i\<in> F. g i w) = (\<Sum>i\<in> insert a F. g i w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AEeq M (\<lambda>w. g a w + (\<Sum>i\<in>F. g i w)) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
by (simp add: insert.hyps(1) insert.hyps(3))
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. g a w + (\<Sum>i\<in>F. g i w)) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)

goal (1 subgoal):
 1. \<And>a F. \<lbrakk>finite F; a \<in> I; a \<notin> F; AEeq M (\<lambda>w. \<Sum>i\<in>F. f i w) (\<lambda>w. \<Sum>i\<in>F. g i w)\<rbrakk> \<Longrightarrow> AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
AEeq M (\<lambda>x. \<Sum>i\<in>insert a F. f i x) (\<lambda>x. \<Sum>i\<in>insert a F. g i x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
AEeq M (\<lambda>x. \<Sum>i\<in>insert a F. f i x) (\<lambda>x. \<Sum>i\<in>insert a F. g i x)

goal (1 subgoal):
 1. AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AEeq M (\<lambda>w. \<Sum>i\<in>insert a F. f i w) (\<lambda>w. \<Sum>i\<in>insert a F. g i w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_imp_AR:
  fixes S :: "'a::euclidean_space set"
  shows "\<lbrakk>convex S; S \<noteq> {}\<rbrakk> \<Longrightarrow> AR S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>convex S; S \<noteq> {}\<rbrakk> \<Longrightarrow> AR S
[PROOF STEP]
by (metis (mono_tags, lifting) Dugundji absolute_extensor_imp_AR)


[STATEMENT]
lemma sin_arcsin [simp]: "- 1 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> sin (arcsin y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- 1 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> sin (arcsin y) = y
[PROOF STEP]
by (blast dest: arcsin)


[STATEMENT]
lemma infinite_part1: "infinite V \<Longrightarrow> infinite (part1 V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite V \<Longrightarrow> infinite (part1 V)
[PROOF STEP]
using part12
[PROOF STATE]
proof (prove)
using this:
infinite ?V \<Longrightarrow> part12_pred ?V (part12 ?V)

goal (1 subgoal):
 1. infinite V \<Longrightarrow> infinite (part1 V)
[PROOF STEP]
unfolding part1_def part12_pred_def
[PROOF STATE]
proof (prove)
using this:
infinite ?V \<Longrightarrow> ?V = fst (part12 ?V) \<union> snd (part12 ?V) \<and> fst (part12 ?V) \<inter> snd (part12 ?V) = {} \<and> infinite (fst (part12 ?V)) \<and> infinite (snd (part12 ?V))

goal (1 subgoal):
 1. infinite V \<Longrightarrow> infinite ((fst \<circ> part12) V)
[PROOF STEP]
by auto


[STATEMENT]
lemma fls_residue_fls_X_intpow:
  "fls_residue (fls_X_intpow i) = (if i=-1 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_residue (fls_X_intpow i) = (if i = - 1 then 1::'a else (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma (in Corps)  val_neg_nonzero:"\<lbrakk>valuation K v; x \<in> carrier K; v x < 0\<rbrakk> \<Longrightarrow>
                                     x \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; v x < 0\<rbrakk> \<Longrightarrow> x \<noteq> \<zero>
[PROOF STEP]
apply (rule contrapos_pp, simp+, simp add:value_of_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; \<zero> \<in> carrier K; \<infinity> < 0; x = \<zero>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule aless_imp_le[of "\<infinity>" "0"],
        cut_tac inf_ge_any[of "0"],
        frule ale_antisym[of "0" "\<infinity>"], assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma space_stream_space: "space (stream_space M) = streams (space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (stream_space M) = streams (space M)
[PROOF STEP]
by (simp add: stream_space_def)


[STATEMENT]
lemma mult_cancel_le: "b \<noteq> 0 \<Longrightarrow> a*b \<le> c*b \<Longrightarrow> a \<le> (c::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> 0; a * b \<le> c * b\<rbrakk> \<Longrightarrow> a \<le> c
[PROOF STEP]
by simp


[STATEMENT]
lemma float_lt_trans: "is_finite a \<Longrightarrow> is_finite b \<Longrightarrow> is_finite c \<Longrightarrow> a < b \<Longrightarrow> b < c \<Longrightarrow> a < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_finite a; is_finite b; is_finite c; a < b; b < c\<rbrakk> \<Longrightarrow> a < c
[PROOF STEP]
by (auto simp: le_trans)


[STATEMENT]
lemma bulk_update_loan_closed_form:
  assumes "\<rho> k \<noteq> 1"
  and "\<rho> k > 0"
  and "\<rho> 0 = 0"
  and "i \<ge> 0"
  shows "bulk_update_account n \<rho> i (\<delta> k c) =
           just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k))
           + \<delta> k ((1 - \<rho> k) ^ n * c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bulk_update_account 0 \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ 0 - (1 - \<rho> k) ^ 0) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ 0 * c)
 2. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. bulk_update_account 0 \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ 0 - (1 - \<rho> k) ^ 0) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ 0 * c)
 2. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bulk_update_account 0 \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ 0 - (1 - \<rho> k) ^ 0) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ 0 * c)
[PROOF STEP]
by (simp add: zero_account_alt_def)
[PROOF STATE]
proof (state)
this:
bulk_update_account 0 \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ 0 - (1 - \<rho> k) ^ 0) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ 0 * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
have "i + \<rho> k > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < i + \<rho> k
[PROOF STEP]
using assms(2) assms(4)
[PROOF STATE]
proof (prove)
using this:
0 < \<rho> k
0 \<le> i

goal (1 subgoal):
 1. 0 < i + \<rho> k
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < i + \<rho> k

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
hence "(i + \<rho> k) / (i + \<rho> k) = 1"
[PROOF STATE]
proof (prove)
using this:
0 < i + \<rho> k

goal (1 subgoal):
 1. (i + \<rho> k) / (i + \<rho> k) = 1
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(i + \<rho> k) / (i + \<rho> k) = 1

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
hence "bulk_update_account (Suc n) \<rho> i (\<delta> k c) =
            just_cash
              ((c * i) / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) +
               c * i * (1 - \<rho> k) ^ n * ((i + \<rho> k) / (i + \<rho> k)))
            + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)"
[PROOF STATE]
proof (prove)
using this:
(i + \<rho> k) / (i + \<rho> k) = 1

goal (1 subgoal):
 1. bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i * (1 - \<rho> k) ^ n * ((i + \<rho> k) / (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(i + \<rho> k) / (i + \<rho> k) = 1
bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c)

goal (1 subgoal):
 1. bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i * (1 - \<rho> k) ^ n * ((i + \<rho> k) / (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)
[PROOF STEP]
by (simp add:
            return_loans_plus
            \<open>\<rho> 0 = 0\<close>
            return_loans_just_cash
            update_account_def
            net_asset_value_plus
            net_asset_value_just_cash_left_inverse
            add.commute
            add.left_commute
            distrib_left
            mult.assoc
            add_divide_distrib
            distrib_right
            mult.commute
            mult.left_commute)
[PROOF STATE]
proof (state)
this:
bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i * (1 - \<rho> k) ^ n * ((i + \<rho> k) / (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i * (1 - \<rho> k) ^ n * ((i + \<rho> k) / (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
have
    "\<dots> =
      just_cash
        ((c * i) / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) +
         (c * i) / (i + \<rho> k) * (1 - \<rho> k) ^ n * (i + \<rho> k))
      + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i * (1 - \<rho> k) ^ n * ((i + \<rho> k) / (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i / (i + \<rho> k) * (1 - \<rho> k) ^ n * (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)
[PROOF STEP]
by (metis (no_types, lifting) times_divide_eq_left times_divide_eq_right)
[PROOF STATE]
proof (state)
this:
just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i * (1 - \<rho> k) ^ n * ((i + \<rho> k) / (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i / (i + \<rho> k) * (1 - \<rho> k) ^ n * (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i * (1 - \<rho> k) ^ n * ((i + \<rho> k) / (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i / (i + \<rho> k) * (1 - \<rho> k) ^ n * (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
have
    "\<dots> =
      just_cash
        ((c * i) / (i + \<rho> k) * (
              (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n)
            + (1 - \<rho> k) ^ n * (i + \<rho> k)))
      + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i / (i + \<rho> k) * (1 - \<rho> k) ^ n * (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)
[PROOF STEP]
by (metis (no_types, lifting) mult.assoc ring_class.ring_distribs(1))
[PROOF STATE]
proof (state)
this:
just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i / (i + \<rho> k) * (1 - \<rho> k) ^ n * (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
just_cash (c * i / (i + \<rho> k) * (1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + c * i / (i + \<rho> k) * (1 - \<rho> k) ^ n * (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
have
    "\<dots> =
      just_cash
        ((c * i) / (i + \<rho> k) * ((1 + i) ^ (n + 1) - (1 - \<rho> k) ^ (n + 1)))
      + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) ^ (n + 1) - (1 - \<rho> k) ^ (n + 1))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)
[PROOF STEP]
by (simp add: mult.commute mult_diff_mult)
[PROOF STATE]
proof (state)
this:
just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) ^ (n + 1) - (1 - \<rho> k) ^ (n + 1))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)

goal (1 subgoal):
 1. \<And>n. bulk_update_account n \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ n - (1 - \<rho> k) ^ n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ n * c) \<Longrightarrow> bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)
just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) ^ (n + 1) - (1 - \<rho> k) ^ (n + 1))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)
just_cash (c * i / (i + \<rho> k) * ((1 + i) * ((1 + i) ^ n - (1 - \<rho> k) ^ n) + (1 - \<rho> k) ^ n * (i + \<rho> k))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c) = just_cash (c * i / (i + \<rho> k) * ((1 + i) ^ (n + 1) - (1 - \<rho> k) ^ (n + 1))) + \<delta> k ((1 - \<rho> k) ^ (n + 1) * c)

goal (1 subgoal):
 1. bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bulk_update_account (Suc n) \<rho> i (\<delta> k c) = just_cash (c * i * ((1 + i) ^ Suc n - (1 - \<rho> k) ^ Suc n) / (i + \<rho> k)) + \<delta> k ((1 - \<rho> k) ^ Suc n * c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monom_sub:
  assumes "a \<in> carrier R"
  assumes "g \<in> carrier P"
  shows "(monom P a n) of g = a \<odot>\<^bsub>P\<^esub> g[^]\<^bsub>P\<^esub> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cring_Poly.compose R (monom P a n) g = a \<odot>\<^bsub>P\<^esub> g [^]\<^bsub>P\<^esub> n
[PROOF STEP]
unfolding compose_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval R (UP R) (to_polynomial R) g (monom P a n) = a \<odot>\<^bsub>P\<^esub> g [^]\<^bsub>P\<^esub> n
[PROOF STEP]
using assms UP_pre_univ_prop.eval_monom[of R P to_poly a g n] to_poly_UP_pre_univ_prop
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
g \<in> carrier P
\<lbrakk>UP_pre_univ_prop R P (to_polynomial R); a \<in> carrier R; g \<in> carrier P\<rbrakk> \<Longrightarrow> eval R P (to_polynomial R) g (monom (UP R) a n) = to_polynomial R a \<otimes>\<^bsub>P\<^esub> g [^]\<^bsub>P\<^esub> n
UP_pre_univ_prop R P (to_polynomial R)

goal (1 subgoal):
 1. eval R (UP R) (to_polynomial R) g (monom P a n) = a \<odot>\<^bsub>P\<^esub> g [^]\<^bsub>P\<^esub> n
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
g \<in> carrier (UP R)
\<lbrakk>UP_pre_univ_prop R (UP R) (to_polynomial R); a \<in> carrier R; g \<in> carrier (UP R)\<rbrakk> \<Longrightarrow> eval R (UP R) (to_polynomial R) g (monom (UP R) a n) = to_polynomial R a \<otimes>\<^bsub>UP R\<^esub> g [^]\<^bsub>UP R\<^esub> n
UP_pre_univ_prop R (UP R) (to_polynomial R)

goal (1 subgoal):
 1. eval R (UP R) (to_polynomial R) g (monom (UP R) a n) = a \<odot>\<^bsub>UP R\<^esub> g [^]\<^bsub>UP R\<^esub> n
[PROOF STEP]
using P.nat_pow_closed P_def  to_poly_mult_simp(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
g \<in> carrier (UP R)
\<lbrakk>UP_pre_univ_prop R (UP R) (to_polynomial R); a \<in> carrier R; g \<in> carrier (UP R)\<rbrakk> \<Longrightarrow> eval R (UP R) (to_polynomial R) g (monom (UP R) a n) = to_polynomial R a \<otimes>\<^bsub>UP R\<^esub> g [^]\<^bsub>UP R\<^esub> n
UP_pre_univ_prop R (UP R) (to_polynomial R)
?x \<in> carrier P \<Longrightarrow> ?x [^]\<^bsub>P\<^esub> ?n \<in> carrier P
P \<equiv> UP R
\<lbrakk>?b \<in> carrier R; ?f \<in> carrier (UP R)\<rbrakk> \<Longrightarrow> to_polynomial R ?b \<otimes>\<^bsub>UP R\<^esub> ?f = ?b \<odot>\<^bsub>UP R\<^esub> ?f

goal (1 subgoal):
 1. eval R (UP R) (to_polynomial R) g (monom (UP R) a n) = a \<odot>\<^bsub>UP R\<^esub> g [^]\<^bsub>UP R\<^esub> n
[PROOF STEP]
by (simp add: to_poly_mult_simp(1) UP_cring_axioms)


[STATEMENT]
lemma VectorSpace_VectorSpaceHomSet :
  fixes   smult'    :: "'f \<Rightarrow> 'w::ab_group_add \<Rightarrow> 'w" (infixr "\<star>" 70)
  and     hom_smult :: "'f \<Rightarrow> ('v \<Rightarrow> 'w) \<Rightarrow> ('v \<Rightarrow> 'w)" (infixr "\<star>\<cdot>" 70)
  defines hom_smult: "hom_smult \<equiv> \<lambda>a T v. a \<star> T v"
  assumes VSpW: "VectorSpace smult' W"
  shows   "VectorSpace hom_smult (VectorSpaceHomSet smult V smult' W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VectorSpace (\<star>\<cdot>) (VectorSpaceHomSet (\<cdot>) V (\<star>) W)
[PROOF STEP]
proof (rule VectorSpace.intro, rule Module.intro, rule RModule.intro, rule R_scalar_mult)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Group (VectorSpaceHomSet (\<cdot>) V (\<star>) W)
 2. RModule_axioms UNIV (\<star>\<cdot>) (VectorSpaceHomSet (\<cdot>) V (\<star>) W)
[PROOF STEP]
from VSpW
[PROOF STATE]
proof (chain)
picking this:
VectorSpace (\<star>) W
[PROOF STEP]
show "Group (VectorSpaceHomSet (\<cdot>) V (\<star>) W)"
[PROOF STATE]
proof (prove)
using this:
VectorSpace (\<star>) W

goal (1 subgoal):
 1. Group (VectorSpaceHomSet (\<cdot>) V (\<star>) W)
[PROOF STEP]
using Group_VectorSpaceHomSet
[PROOF STATE]
proof (prove)
using this:
VectorSpace (\<star>) W
VectorSpace ?smult' ?W \<Longrightarrow> Group (VectorSpaceHomSet (\<cdot>) V ?smult' ?W)

goal (1 subgoal):
 1. Group (VectorSpaceHomSet (\<cdot>) V (\<star>) W)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Group (VectorSpaceHomSet (\<cdot>) V (\<star>) W)

goal (1 subgoal):
 1. RModule_axioms UNIV (\<star>\<cdot>) (VectorSpaceHomSet (\<cdot>) V (\<star>) W)
[PROOF STEP]
show "RModule_axioms UNIV hom_smult (VectorSpaceHomSet (\<cdot>) V (\<star>) W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RModule_axioms UNIV (\<star>\<cdot>) (VectorSpaceHomSet (\<cdot>) V (\<star>) W)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>r m. \<lbrakk>r \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
 2. \<And>r m n. \<lbrakk>r \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W; n \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> (m + n) = r \<star>\<cdot> m + r \<star>\<cdot> n
 3. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> (r + s) \<star>\<cdot> m = r \<star>\<cdot> m + s \<star>\<cdot> m
 4. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> s \<star>\<cdot> m = (r * s) \<star>\<cdot> m
 5. \<And>m. m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W \<Longrightarrow> (1::'f) \<star>\<cdot> m = m
[PROOF STEP]
fix a b S T
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>r m. \<lbrakk>r \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
 2. \<And>r m n. \<lbrakk>r \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W; n \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> (m + n) = r \<star>\<cdot> m + r \<star>\<cdot> n
 3. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> (r + s) \<star>\<cdot> m = r \<star>\<cdot> m + s \<star>\<cdot> m
 4. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> s \<star>\<cdot> m = (r * s) \<star>\<cdot> m
 5. \<And>m. m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W \<Longrightarrow> (1::'f) \<star>\<cdot> m = m
[PROOF STEP]
assume S: "S \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W"
      and  T: "T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W"
[PROOF STATE]
proof (state)
this:
S \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W

goal (5 subgoals):
 1. \<And>r m. \<lbrakk>r \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
 2. \<And>r m n. \<lbrakk>r \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W; n \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> (m + n) = r \<star>\<cdot> m + r \<star>\<cdot> n
 3. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> (r + s) \<star>\<cdot> m = r \<star>\<cdot> m + s \<star>\<cdot> m
 4. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> s \<star>\<cdot> m = (r * s) \<star>\<cdot> m
 5. \<And>m. m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W \<Longrightarrow> (1::'f) \<star>\<cdot> m = m
[PROOF STEP]
show "a \<star>\<cdot> T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<star>\<cdot> T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
[PROOF STEP]
proof (rule VectorSpaceHomSetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. VectorSpaceHom (\<cdot>) V (\<star>) (a \<star>\<cdot> T)
 2. (a \<star>\<cdot> T) ` V \<subseteq> W
[PROOF STEP]
from assms T
[PROOF STATE]
proof (chain)
picking this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
[PROOF STEP]
show "VectorSpaceHom (\<cdot>) V (\<star>) (a \<star>\<cdot> T)"
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W

goal (1 subgoal):
 1. VectorSpaceHom (\<cdot>) V (\<star>) (a \<star>\<cdot> T)
[PROOF STEP]
using VectorSpaceHomSetD_VectorSpaceHom VectorSpaceHomSetD_Im
              VectorSpaceHom.VectorSpaceHom_scalar_mul
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
?T \<in> VectorSpaceHomSet ?fsmult ?V ?fsmult' ?N \<Longrightarrow> VectorSpaceHom ?fsmult ?V ?fsmult' ?T
?T \<in> VectorSpaceHomSet ?fsmult ?V ?fsmult' ?W \<Longrightarrow> ?T ` ?V \<subseteq> ?W
VectorSpaceHom ?smult ?V ?smult' ?T \<Longrightarrow> VectorSpaceHom ?smult ?V ?smult' (\<lambda>v. ?smult' ?a (?T v))

goal (1 subgoal):
 1. VectorSpaceHom (\<cdot>) V (\<star>) (a \<star>\<cdot> T)
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
VectorSpaceHom (\<cdot>) V (\<star>) (a \<star>\<cdot> T)

goal (1 subgoal):
 1. (a \<star>\<cdot> T) ` V \<subseteq> W
[PROOF STEP]
from hom_smult
[PROOF STATE]
proof (chain)
picking this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
[PROOF STEP]
show "(a \<star>\<cdot> T) ` V \<subseteq> W"
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v

goal (1 subgoal):
 1. (a \<star>\<cdot> T) ` V \<subseteq> W
[PROOF STEP]
using VectorSpaceHomSetD_Im[OF T] VectorSpace.smult_closed[OF VSpW]
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
T ` V \<subseteq> W
\<lbrakk>?r \<in> UNIV; ?m \<in> W\<rbrakk> \<Longrightarrow> ?r \<star> ?m \<in> W

goal (1 subgoal):
 1. (a \<star>\<cdot> T) ` V \<subseteq> W
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
(a \<star>\<cdot> T) ` V \<subseteq> W

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<star>\<cdot> T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W

goal (4 subgoals):
 1. \<And>r m n. \<lbrakk>r \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W; n \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> (m + n) = r \<star>\<cdot> m + r \<star>\<cdot> n
 2. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> (r + s) \<star>\<cdot> m = r \<star>\<cdot> m + s \<star>\<cdot> m
 3. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> s \<star>\<cdot> m = (r * s) \<star>\<cdot> m
 4. \<And>m. m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W \<Longrightarrow> (1::'f) \<star>\<cdot> m = m
[PROOF STEP]
show "a \<star>\<cdot> (S + T) = a \<star>\<cdot> S + a \<star>\<cdot> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<star>\<cdot> (S + T) = a \<star>\<cdot> S + a \<star>\<cdot> T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (a \<star>\<cdot> (S + T)) x = (a \<star>\<cdot> S + a \<star>\<cdot> T) x
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (a \<star>\<cdot> (S + T)) x = (a \<star>\<cdot> S + a \<star>\<cdot> T) x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
[PROOF STEP]
show "(a \<star>\<cdot> (S + T)) v = (a \<star>\<cdot> S + a \<star>\<cdot> T) v"
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W

goal (1 subgoal):
 1. (a \<star>\<cdot> (S + T)) v = (a \<star>\<cdot> S + a \<star>\<cdot> T) v
[PROOF STEP]
using VectorSpaceHomSetD_Im[OF S] VectorSpaceHomSetD_Im[OF T]
              VectorSpace.smult_distrib_left[OF VSpW, of a "S v" "T v"]
              VectorSpaceHomSetD_VectorSpaceHom[OF S]
              VectorSpaceHomSetD_VectorSpaceHom[OF S]
              VectorSpaceHom.supp suppI_contra[of v S] suppI_contra[of v T]
              VectorSpace.smult_zero
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
S ` V \<subseteq> W
T ` V \<subseteq> W
\<lbrakk>a \<in> UNIV; S v \<in> W; T v \<in> W\<rbrakk> \<Longrightarrow> a \<star> (S v + T v) = a \<star> S v + a \<star> T v
VectorSpaceHom (\<cdot>) V (\<star>) S
VectorSpaceHom (\<cdot>) V (\<star>) S
VectorSpaceHom ?smult ?V ?smult' ?T \<Longrightarrow> supp ?T \<subseteq> ?V
v \<notin> supp S \<Longrightarrow> S v = (0::'w)
v \<notin> supp T \<Longrightarrow> T v = (0::'w)
\<lbrakk>VectorSpace ?smult ?V; ?r \<in> UNIV\<rbrakk> \<Longrightarrow> ?smult ?r (0::?'v) = (0::?'v)

goal (1 subgoal):
 1. (a \<star>\<cdot> (S + T)) v = (a \<star>\<cdot> S + a \<star>\<cdot> T) v
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
(a \<star>\<cdot> (S + T)) v = (a \<star>\<cdot> S + a \<star>\<cdot> T) v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<star>\<cdot> (S + T) = a \<star>\<cdot> S + a \<star>\<cdot> T

goal (3 subgoals):
 1. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> (r + s) \<star>\<cdot> m = r \<star>\<cdot> m + s \<star>\<cdot> m
 2. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> s \<star>\<cdot> m = (r * s) \<star>\<cdot> m
 3. \<And>m. m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W \<Longrightarrow> (1::'f) \<star>\<cdot> m = m
[PROOF STEP]
show "(a + b) \<star>\<cdot> T = a \<star>\<cdot> T + b \<star>\<cdot> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) \<star>\<cdot> T = a \<star>\<cdot> T + b \<star>\<cdot> T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ((a + b) \<star>\<cdot> T) x = (a \<star>\<cdot> T + b \<star>\<cdot> T) x
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ((a + b) \<star>\<cdot> T) x = (a \<star>\<cdot> T + b \<star>\<cdot> T) x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
[PROOF STEP]
show "((a + b) \<star>\<cdot> T) v = (a \<star>\<cdot> T + b \<star>\<cdot> T) v"
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W

goal (1 subgoal):
 1. ((a + b) \<star>\<cdot> T) v = (a \<star>\<cdot> T + b \<star>\<cdot> T) v
[PROOF STEP]
using VectorSpaceHomSetD_Im[OF T] VectorSpace.smult_distrib_right
              VectorSpaceHomSetD_VectorSpaceHom[OF T] VectorSpaceHom.supp
              suppI_contra[of v] VectorSpace.smult_zero
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
T ` V \<subseteq> W
\<lbrakk>VectorSpace ?smult ?V; ?r \<in> UNIV; ?s \<in> UNIV; ?m \<in> ?V\<rbrakk> \<Longrightarrow> ?smult (?r + ?s) ?m = ?smult ?r ?m + ?smult ?s ?m
VectorSpaceHom (\<cdot>) V (\<star>) T
VectorSpaceHom ?smult ?V ?smult' ?T \<Longrightarrow> supp ?T \<subseteq> ?V
v \<notin> supp ?f \<Longrightarrow> ?f v = (0::?'b)
\<lbrakk>VectorSpace ?smult ?V; ?r \<in> UNIV\<rbrakk> \<Longrightarrow> ?smult ?r (0::?'v) = (0::?'v)

goal (1 subgoal):
 1. ((a + b) \<star>\<cdot> T) v = (a \<star>\<cdot> T + b \<star>\<cdot> T) v
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
((a + b) \<star>\<cdot> T) v = (a \<star>\<cdot> T + b \<star>\<cdot> T) v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(a + b) \<star>\<cdot> T = a \<star>\<cdot> T + b \<star>\<cdot> T

goal (2 subgoals):
 1. \<And>r s m. \<lbrakk>r \<in> UNIV; s \<in> UNIV; m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W\<rbrakk> \<Longrightarrow> r \<star>\<cdot> s \<star>\<cdot> m = (r * s) \<star>\<cdot> m
 2. \<And>m. m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W \<Longrightarrow> (1::'f) \<star>\<cdot> m = m
[PROOF STEP]
show "a \<star>\<cdot> b \<star>\<cdot> T = (a * b) \<star>\<cdot> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<star>\<cdot> b \<star>\<cdot> T = (a * b) \<star>\<cdot> T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (a \<star>\<cdot> b \<star>\<cdot> T) x = ((a * b) \<star>\<cdot> T) x
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (a \<star>\<cdot> b \<star>\<cdot> T) x = ((a * b) \<star>\<cdot> T) x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
[PROOF STEP]
show "(a \<star>\<cdot> b \<star>\<cdot> T) v = ((a * b) \<star>\<cdot> T) v"
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W

goal (1 subgoal):
 1. (a \<star>\<cdot> b \<star>\<cdot> T) v = ((a * b) \<star>\<cdot> T) v
[PROOF STEP]
using VectorSpaceHomSetD_Im[OF T] VectorSpace.smult_assoc
              VectorSpaceHomSetD_VectorSpaceHom[OF T]
              VectorSpaceHom.supp suppI_contra[of v]
              VectorSpace.smult_zero[OF VSpW, of b]
              VectorSpace.smult_zero[OF VSpW, of a]
              VectorSpace.smult_zero[OF VSpW, of "a * b"]
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
T ` V \<subseteq> W
\<lbrakk>VectorSpace ?smult ?V; ?r \<in> UNIV; ?s \<in> UNIV; ?m \<in> ?V\<rbrakk> \<Longrightarrow> ?smult ?r (?smult ?s ?m) = ?smult (?r * ?s) ?m
VectorSpaceHom (\<cdot>) V (\<star>) T
VectorSpaceHom ?smult ?V ?smult' ?T \<Longrightarrow> supp ?T \<subseteq> ?V
v \<notin> supp ?f \<Longrightarrow> ?f v = (0::?'b)
b \<in> UNIV \<Longrightarrow> b \<star> (0::'w) = (0::'w)
a \<in> UNIV \<Longrightarrow> a \<star> (0::'w) = (0::'w)
a * b \<in> UNIV \<Longrightarrow> (a * b) \<star> (0::'w) = (0::'w)

goal (1 subgoal):
 1. (a \<star>\<cdot> b \<star>\<cdot> T) v = ((a * b) \<star>\<cdot> T) v
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
(a \<star>\<cdot> b \<star>\<cdot> T) v = ((a * b) \<star>\<cdot> T) v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<star>\<cdot> b \<star>\<cdot> T = (a * b) \<star>\<cdot> T

goal (1 subgoal):
 1. \<And>m. m \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W \<Longrightarrow> (1::'f) \<star>\<cdot> m = m
[PROOF STEP]
show "1 \<star>\<cdot> T = T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'f) \<star>\<cdot> T = T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ((1::'f) \<star>\<cdot> T) x = T x
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ((1::'f) \<star>\<cdot> T) x = T x
[PROOF STEP]
from assms T
[PROOF STATE]
proof (chain)
picking this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
[PROOF STEP]
show "(1 \<star>\<cdot> T) v = T v"
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W

goal (1 subgoal):
 1. ((1::'f) \<star>\<cdot> T) v = T v
[PROOF STEP]
using VectorSpaceHomSetD_Im VectorSpace.one_smult
              VectorSpaceHomSetD_VectorSpaceHom VectorSpaceHom.supp
              suppI_contra[of v] VectorSpace.smult_zero
[PROOF STATE]
proof (prove)
using this:
(\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<star> T v
VectorSpace (\<star>) W
T \<in> VectorSpaceHomSet (\<cdot>) V (\<star>) W
?T \<in> VectorSpaceHomSet ?fsmult ?V ?fsmult' ?W \<Longrightarrow> ?T ` ?V \<subseteq> ?W
\<lbrakk>VectorSpace ?smult ?V; ?m \<in> ?V\<rbrakk> \<Longrightarrow> ?smult (1::?'f) ?m = ?m
?T \<in> VectorSpaceHomSet ?fsmult ?V ?fsmult' ?N \<Longrightarrow> VectorSpaceHom ?fsmult ?V ?fsmult' ?T
VectorSpaceHom ?smult ?V ?smult' ?T \<Longrightarrow> supp ?T \<subseteq> ?V
v \<notin> supp ?f \<Longrightarrow> ?f v = (0::?'b)
\<lbrakk>VectorSpace ?smult ?V; ?r \<in> UNIV\<rbrakk> \<Longrightarrow> ?smult ?r (0::?'v) = (0::?'v)

goal (1 subgoal):
 1. ((1::'f) \<star>\<cdot> T) v = T v
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
((1::'f) \<star>\<cdot> T) v = T v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1::'f) \<star>\<cdot> T = T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
RModule_axioms UNIV (\<star>\<cdot>) (VectorSpaceHomSet (\<cdot>) V (\<star>) W)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_coefs_gt_0: "sum_coefs M > 0 \<longleftrightarrow> M > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < sum_coefs M) = (0 < M)
[PROOF STEP]
by (auto simp: sum_coefs_def zero_hmultiset_def hmsetmset_less[symmetric] less_multiset_ext\<^sub>D\<^sub>M_less
    nonempty_has_size[symmetric])


[STATEMENT]
lemma sup_subdistl: "(x \<cdot> y) \<squnion> (x \<cdot> z) \<le> x \<cdot> (y \<squnion> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> y \<squnion> x \<cdot> z \<le> x \<cdot> (y \<squnion> z)
[PROOF STEP]
using Sup_subdistl[where Y="{y, z}"] Sup_le_iff
[PROOF STATE]
proof (prove)
using this:
\<Squnion>{?x \<cdot> ya |ya. ya \<in> {y, z}} \<le> ?x \<cdot> \<Squnion>{y, z}
(\<Squnion>?A \<le> ?b) = (\<forall>a\<in>?A. a \<le> ?b)

goal (1 subgoal):
 1. x \<cdot> y \<squnion> x \<cdot> z \<le> x \<cdot> (y \<squnion> z)
[PROOF STEP]
by auto


[STATEMENT]
lemma sumset_commute:
  shows "sumset A B = sumset B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset A B = sumset B A
[PROOF STEP]
by (auto simp: sumset_eq; meson Int_iff commutative)


[STATEMENT]
lemma fact_Suc_0 [simp]: "fact (Suc 0) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (Suc 0) = (1::'a)
[PROOF STEP]
by (simp add: fact_prod)


[STATEMENT]
lemma All_mapping_mono:
  "(\<And>k v. k \<in> keys m \<Longrightarrow> P k v \<Longrightarrow> Q k v) \<Longrightarrow> All_mapping m P \<Longrightarrow> All_mapping m Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>k v. \<lbrakk>k \<in> keys m; P k v\<rbrakk> \<Longrightarrow> Q k v; All_mapping m P\<rbrakk> \<Longrightarrow> All_mapping m Q
[PROOF STEP]
unfolding All_mapping_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>k v. \<lbrakk>k \<in> keys m; P k v\<rbrakk> \<Longrightarrow> Q k v; \<forall>x. case lookup m x of None \<Rightarrow> True | Some xa \<Rightarrow> P x xa\<rbrakk> \<Longrightarrow> \<forall>x. case lookup m x of None \<Rightarrow> True | Some xa \<Rightarrow> Q x xa
[PROOF STEP]
by transfer (auto simp: All_mapping_def dom_def split: option.splits)


[STATEMENT]
lemma monotone_lprefix_case_lfp [cont_intro, simp]:
  fixes f :: "_ \<Rightarrow> _ :: order_bot"
  assumes mono: "\<And>x. monotone (\<sqsubseteq>) (\<le>) (\<lambda>xs. f x xs (LCons x xs))"
  shows "monotone (\<sqsubseteq>) (\<le>) (\<lambda>xs. case xs of LNil \<Rightarrow> \<bottom> | LCons x xs \<Rightarrow> f x xs (LCons x xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone (\<sqsubseteq>) (\<le>) (\<lambda>xs. case xs of LNil \<Rightarrow> \<bottom> | LCons x xs \<Rightarrow> f x xs (LCons x xs))
[PROOF STEP]
by(rule llist.monotone_if_bot[where bound=LNil and bot=\<bottom> and f="\<lambda>xs. f (lhd xs) (ltl xs) xs"])(auto 4 3 simp add: not_lnull_conv LCons_lprefix_conv dest: monotoneD[OF mono] split: llist.split)


[STATEMENT]
lemma Hermite_of_Least:
  fixes A::"'a::{bezout_ring_div,normalization_semidom,unique_euclidean_ring}^'cols::{mod_type}^'rows::{mod_type}"
  assumes i: "\<not> is_zero_row i (Hermite_of A ass res bezout)"
  and a: "ass_function ass"
  and r: "res_function res"
  and b: "is_bezout_ext bezout"
  shows "(LEAST n. Hermite_of A ass res bezout $ i $ n \<noteq> 0) = (LEAST n. (echelon_form_of A bezout) $ i $ n \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. Hermite_of A ass res bezout $ i $ n \<noteq> (0::'a)) = (LEAST n. echelon_form_of A bezout $ i $ n \<noteq> (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (LEAST n. Hermite_of A ass res bezout $ i $ n \<noteq> (0::'a)) = (LEAST n. echelon_form_of A bezout $ i $ n \<noteq> (0::'a))
[PROOF STEP]
have non_zero_i_eA: "\<not> is_zero_row i (echelon_form_of A bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_zero_row i (echelon_form_of A bezout)
[PROOF STEP]
using Hermite_of_preserves_zero_rows[OF _ a r b] i
[PROOF STATE]
proof (prove)
using this:
is_zero_row ?i (echelon_form_of ?A bezout) \<Longrightarrow> is_zero_row ?i (Hermite_of ?A ass res bezout)
\<not> is_zero_row i (Hermite_of A ass res bezout)

goal (1 subgoal):
 1. \<not> is_zero_row i (echelon_form_of A bezout)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> is_zero_row i (echelon_form_of A bezout)

goal (1 subgoal):
 1. (LEAST n. Hermite_of A ass res bezout $ i $ n \<noteq> (0::'a)) = (LEAST n. echelon_form_of A bezout $ i $ n \<noteq> (0::'a))
[PROOF STEP]
have e: "echelon_form (echelon_form_of A bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form (echelon_form_of A bezout)
[PROOF STEP]
by (rule echelon_form_echelon_form_of[OF b])
[PROOF STATE]
proof (state)
this:
echelon_form (echelon_form_of A bezout)

goal (1 subgoal):
 1. (LEAST n. Hermite_of A ass res bezout $ i $ n \<noteq> (0::'a)) = (LEAST n. echelon_form_of A bezout $ i $ n \<noteq> (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. Hermite_of A ass res bezout $ i $ n \<noteq> (0::'a)) = (LEAST n. echelon_form_of A bezout $ i $ n \<noteq> (0::'a))
[PROOF STEP]
unfolding Hermite_of_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. Hermite_of_upt_row_i (echelon_form_of A bezout) (nrows A) ass res $ i $ n \<noteq> (0::'a)) = (LEAST n. echelon_form_of A bezout $ i $ n \<noteq> (0::'a))
[PROOF STEP]
by (rule Hermite_of_upt_row_i_Least[OF non_zero_i_eA e a r], simp add: nrows_def)
[PROOF STATE]
proof (state)
this:
(LEAST n. Hermite_of A ass res bezout $ i $ n \<noteq> (0::'a)) = (LEAST n. echelon_form_of A bezout $ i $ n \<noteq> (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "lset (lextup a xs) \<subseteq> {a} \<union> lset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lset (lextup a xs) \<subseteq> {a} \<union> lset xs
[PROOF STEP]
apply (rule tendsto_le_ccpo[where g="\<lambda>xs. lset (lextup a xs)" and f="\<lambda>xs. {a} \<union> lset xs" and F="at' xs"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. at' xs \<noteq> \<bottom>
 2. ((\<lambda>xs. {a} \<union> lset xs) \<longlongrightarrow> {a} \<union> lset xs) (at' xs)
 3. ((\<lambda>xs. lset (lextup a xs)) \<longlongrightarrow> lset (lextup a xs)) (at' xs)
 4. \<forall>\<^sub>F x in at' xs. lset (lextup a x) \<subseteq> {a} \<union> lset x
[PROOF STEP]
apply (rule tendsto_intros at'_bot tendsto_lup eventually_at'_llistI tendsto_id_at')+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xsa. \<lbrakk>lfinite xsa; xsa \<le> xs\<rbrakk> \<Longrightarrow> lset (lextup a xsa) \<subseteq> {a} \<union> lset xsa
[PROOF STEP]
apply (auto dest!: lprefix_lsetD set_ext[THEN subsetD])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma small_vreal_le[simp]:
  "small
    {[a, b]\<^sub>\<circ> | a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat> \<and> real_of_vreal a \<le> real_of_vreal b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small {[a, b]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat> \<and> real_of_vreal a \<le> real_of_vreal b}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. small {[a, b]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat> \<and> real_of_vreal a \<le> real_of_vreal b}
[PROOF STEP]
have small: "small {[a, b]\<^sub>\<circ> | a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small {[a, b]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat>}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
small {[a, b]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat>}

goal (1 subgoal):
 1. small {[a, b]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat> \<and> real_of_vreal a \<le> real_of_vreal b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small {[a, b]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat> \<and> real_of_vreal a \<le> real_of_vreal b}
[PROOF STEP]
by (rule smaller_than_small[OF small]) auto
[PROOF STATE]
proof (state)
this:
small {[a, b]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> \<real>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat> \<and> real_of_vreal a \<le> real_of_vreal b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sets_mapmeasure[simp]: "sets (mapmeasure M N) = sets (PiF (Collect finite) N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (mapmeasure M N) = sets (Pi\<^sub>F (Collect finite) N)
[PROOF STEP]
unfolding mapmeasure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (distr M (Pi\<^sub>F (Collect finite) N) fm) = sets (Pi\<^sub>F (Collect finite) N)
[PROOF STEP]
by simp


[STATEMENT]
lemma mutual_exclusion: "Mutex \<in> Always {s. ~ (m s = 3 & n s = 3)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mutex \<in> Always {s. \<not> (m s = 3 \<and> n s = 3)}
[PROOF STEP]
apply (rule Always_weaken)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Mutex \<in> Always ?A
 2. ?A \<subseteq> {s. \<not> (m s = 3 \<and> n s = 3)}
[PROOF STEP]
apply (rule Always_Int_I [OF IU IV], auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma restate_tarski2:
  fixes q::"real poly"
  assumes "p \<noteq> 0"
  shows "changes_R_smods p ((pderiv p) * q) =
        int(card {x. poly p x = 0 \<and> poly q x > 0}) -
        int(card {x. poly p x = 0 \<and> poly q x < 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes_R_smods p (pderiv p * q) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
unfolding sturm_tarski_R[symmetric] taq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
let ?all = "{x. poly p x=0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
let ?lt = "{x. poly p x=0 \<and> poly q x < 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
let ?gt = "{x. poly p x=0 \<and> poly q x > 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
let ?eq = "{x. poly p x=0 \<and> poly q x = 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
have eq: "?all = ?lt \<union> ?gt \<union> ?eq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. poly p x = 0} = {x. poly p x = 0 \<and> poly q x < 0} \<union> {x. poly p x = 0 \<and> 0 < poly q x} \<union> {x. poly p x = 0 \<and> poly q x = 0}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{x. poly p x = 0} = {x. poly p x = 0 \<and> poly q x < 0} \<union> {x. poly p x = 0 \<and> 0 < poly q x} \<union> {x. poly p x = 0 \<and> poly q x = 0}

goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
from poly_roots_finite[OF assms]
[PROOF STATE]
proof (chain)
picking this:
finite {x. poly p x = 0}
[PROOF STEP]
have fin: "finite ?all"
[PROOF STATE]
proof (prove)
using this:
finite {x. poly p x = 0}

goal (1 subgoal):
 1. finite {x. poly p x = 0}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite {x. poly p x = 0}

goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
show  "(\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card ?gt) - int (card ?lt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{x. poly p x = 0 \<and> poly q x < 0} \<union> {x. poly p x = 0 \<and> 0 < poly q x} \<union> {x. poly p x = 0 \<and> poly q x = 0}. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
apply (subst sum_Un)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite ({x. poly p x = 0 \<and> poly q x < 0} \<union> {x. poly p x = 0 \<and> 0 < poly q x})
 2. finite {x. poly p x = 0 \<and> poly q x = 0}
 3. (\<Sum>x\<in>{x. poly p x = 0 \<and> poly q x < 0} \<union> {x. poly p x = 0 \<and> 0 < poly q x}. Sturm_Tarski.sign (poly q x)) + (\<Sum>x | poly p x = 0 \<and> poly q x = 0. Sturm_Tarski.sign (poly q x)) - (\<Sum>x\<in>({x. poly p x = 0 \<and> poly q x < 0} \<union> {x. poly p x = 0 \<and> 0 < poly q x}) \<inter> {x. poly p x = 0 \<and> poly q x = 0}. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
apply (auto simp add:fin)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{x. poly p x = 0 \<and> poly q x < 0} \<union> {x. poly p x = 0 \<and> 0 < poly q x}. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
apply (subst sum_Un)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {x. poly p x = 0 \<and> poly q x < 0}
 2. finite {x. poly p x = 0 \<and> 0 < poly q x}
 3. (\<Sum>x | poly p x = 0 \<and> poly q x < 0. Sturm_Tarski.sign (poly q x)) + (\<Sum>x | poly p x = 0 \<and> 0 < poly q x. Sturm_Tarski.sign (poly q x)) - (\<Sum>x\<in>{x. poly p x = 0 \<and> poly q x < 0} \<inter> {x. poly p x = 0 \<and> 0 < poly q x}. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})
[PROOF STEP]
by (auto simp add:fin)
[PROOF STATE]
proof (state)
this:
(\<Sum>x | poly p x = 0. Sturm_Tarski.sign (poly q x)) = int (card {x. poly p x = 0 \<and> 0 < poly q x}) - int (card {x. poly p x = 0 \<and> poly q x < 0})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma A_ncong_p: "x \<in> A \<Longrightarrow> [x \<noteq> 0](mod p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> [x \<noteq> 0] (mod int p)
[PROOF STEP]
by (rule nonzero_mod_p) (auto simp add: A_def)


[STATEMENT]
lemma continuation_generat_lub:
  "\<forall>x\<in>A. \<not> is_Pure x \<Longrightarrow> continuation (generat_lub lub1 lub2 lub3 A) = lub3 (continuation ` (A \<inter> {f. \<not> is_Pure f}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. \<not> is_Pure x \<Longrightarrow> continuation (generat_lub lub1 lub2 lub3 A) = lub3 (continuation ` (A \<inter> {f. \<not> is_Pure f}))
[PROOF STEP]
by(simp add: generat_lub_def)


[STATEMENT]
lemma Ord_rank [simp]: "Ord(rank a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord (rank a)
[PROOF STEP]
proof (induction a rule: eps_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<And>y. y \<in> elts x \<Longrightarrow> Ord (rank y)) \<Longrightarrow> Ord (rank x)
[PROOF STEP]
case (step x)
[PROOF STATE]
proof (state)
this:
?y \<in> elts x \<Longrightarrow> Ord (rank ?y)

goal (1 subgoal):
 1. \<And>x. (\<And>y. y \<in> elts x \<Longrightarrow> Ord (rank y)) \<Longrightarrow> Ord (rank x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?y \<in> elts x \<Longrightarrow> Ord (rank ?y)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?y \<in> elts x \<Longrightarrow> Ord (rank ?y)

goal (1 subgoal):
 1. Ord (rank x)
[PROOF STEP]
unfolding rank_Sup [of x]
[PROOF STATE]
proof (prove)
using this:
?y \<in> elts x \<Longrightarrow> Ord (rank ?y)

goal (1 subgoal):
 1. Ord (\<Squnion>y\<in>elts x. ZFC_in_HOL.succ (rank y))
[PROOF STEP]
by (metis (mono_tags, lifting) Ord_Sup Ord_succ imageE)
[PROOF STATE]
proof (state)
this:
Ord (rank x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) inj_on_f':
    "\<lbrakk>H \<subseteq> carrier G;  a \<in> carrier G\<rbrakk> \<Longrightarrow> inj_on (\<lambda>y. y \<otimes> inv a) (a <# H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G\<rbrakk> \<Longrightarrow> inj_on (\<lambda>y. y \<otimes> inv a) (a <# H)
[PROOF STEP]
apply (rule inj_onI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; x \<otimes> inv a = y \<otimes> inv a\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (subgoal_tac "x \<in> carrier G & y \<in> carrier G")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; x \<otimes> inv a = y \<otimes> inv a; x \<in> carrier G \<and> y \<in> carrier G\<rbrakk> \<Longrightarrow> x = y
 2. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; x \<otimes> inv a = y \<otimes> inv a\<rbrakk> \<Longrightarrow> x \<in> carrier G \<and> y \<in> carrier G
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; x \<otimes> inv a = y \<otimes> inv a\<rbrakk> \<Longrightarrow> x \<in> carrier G \<and> y \<in> carrier G
 2. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; x \<otimes> inv a = y \<otimes> inv a; x \<in> carrier G \<and> y \<in> carrier G\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (blast intro: l_coset_subset_G [THEN subsetD])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>H \<subseteq> carrier G; a \<in> carrier G; x \<in> a <# H; y \<in> a <# H; x \<otimes> inv a = y \<otimes> inv a; x \<in> carrier G \<and> y \<in> carrier G\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (simp add: subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma spmf_mk_lossless [simp]: "spmf (mk_lossless p) x = spmf p x / weight_spmf p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spmf (mk_lossless p) x = spmf p x / weight_spmf p
[PROOF STEP]
by(simp add: mk_lossless_def spmf_scale_spmf inverse_eq_divide max_def)


[STATEMENT]
lemma smooth_on_add_fun: "k-smooth_on S f \<Longrightarrow> k-smooth_on S g \<Longrightarrow> open S \<Longrightarrow> k-smooth_on S (f + g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k-smooth_on S f; k-smooth_on S g; open S\<rbrakk> \<Longrightarrow> k-smooth_on S (f + g)
[PROOF STEP]
by (auto simp: smooth_on_def higher_differentiable_on_add plus_fun_def)


[STATEMENT]
lemma is_aligned_diff:
  fixes m :: "'a::len word"
  assumes alm: "is_aligned m s1"
  and     aln: "is_aligned n s2"
  and    s2wb: "s2 < LENGTH('a)"
  and      nm: "m \<in> {n .. n + (2 ^ s2 - 1)}"
  and    s1s2: "s1 \<le> s2"
  and     s10: "0 < s1" (* Probably can be folded into the proof \<dots> *)
shows  "\<exists>q. m - n = of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
have rl: "\<And>m s. \<lbrakk> m < 2 ^ (LENGTH('a) - s); s < LENGTH('a) \<rbrakk> \<Longrightarrow> unat ((2::'a word) ^ s * of_nat m) = 2 ^ s * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m s. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> unat (2 ^ s * word_of_nat m) = 2 ^ s * m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m s. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> unat (2 ^ s * word_of_nat m) = 2 ^ s * m
[PROOF STEP]
fix m :: nat and  s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m s. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> unat (2 ^ s * word_of_nat m) = 2 ^ s * m
[PROOF STEP]
assume m: "m < 2 ^ (LENGTH('a) - s)" and s: "s < LENGTH('a)"
[PROOF STATE]
proof (state)
this:
m < 2 ^ (LENGTH('a) - s)
s < LENGTH('a)

goal (1 subgoal):
 1. \<And>m s. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> unat (2 ^ s * word_of_nat m) = 2 ^ s * m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m < 2 ^ (LENGTH('a) - s)
s < LENGTH('a)
[PROOF STEP]
have "unat ((of_nat m) :: 'a word) = m"
[PROOF STATE]
proof (prove)
using this:
m < 2 ^ (LENGTH('a) - s)
s < LENGTH('a)

goal (1 subgoal):
 1. unat (word_of_nat m) = m
[PROOF STEP]
apply (subst unat_of_nat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> m mod 2 ^ LENGTH('a) = m
[PROOF STEP]
apply (subst mod_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> m < 2 ^ LENGTH('a)
 2. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> m = m
[PROOF STEP]
apply (erule order_less_le_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. s < LENGTH('a) \<Longrightarrow> 2 ^ (LENGTH('a) - s) \<le> 2 ^ LENGTH('a)
 2. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> m = m
[PROOF STEP]
apply (rule power_increasing)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. s < LENGTH('a) \<Longrightarrow> LENGTH('a) - s \<le> LENGTH('a)
 2. s < LENGTH('a) \<Longrightarrow> 1 \<le> 2
 3. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> m = m
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
unat (word_of_nat m) = m

goal (1 subgoal):
 1. \<And>m s. \<lbrakk>m < 2 ^ (LENGTH('a) - s); s < LENGTH('a)\<rbrakk> \<Longrightarrow> unat (2 ^ s * word_of_nat m) = 2 ^ s * m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
unat (word_of_nat m) = m
[PROOF STEP]
show "?thesis m s"
[PROOF STATE]
proof (prove)
using this:
unat (word_of_nat m) = m

goal (1 subgoal):
 1. unat (2 ^ s * word_of_nat m) = 2 ^ s * m
[PROOF STEP]
using s m
[PROOF STATE]
proof (prove)
using this:
unat (word_of_nat m) = m
s < LENGTH('a)
m < 2 ^ (LENGTH('a) - s)

goal (1 subgoal):
 1. unat (2 ^ s * word_of_nat m) = 2 ^ s * m
[PROOF STEP]
apply (subst iffD1 [OF unat_mult_lem])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat (word_of_nat m) = m; s < LENGTH('a); m < 2 ^ (LENGTH('a) - s)\<rbrakk> \<Longrightarrow> unat (2 ^ s) * unat (word_of_nat m) < 2 ^ LENGTH('a)
 2. \<lbrakk>unat (word_of_nat m) = m; s < LENGTH('a); m < 2 ^ (LENGTH('a) - s)\<rbrakk> \<Longrightarrow> unat (2 ^ s) * unat (word_of_nat m) = 2 ^ s * m
[PROOF STEP]
apply (simp add: nat_less_power_trans)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
unat (2 ^ s * word_of_nat m) = 2 ^ s * m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?m < 2 ^ (LENGTH('a) - ?s); ?s < LENGTH('a)\<rbrakk> \<Longrightarrow> unat (2 ^ ?s * word_of_nat ?m) = 2 ^ ?s * ?m

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
have s1wb: "s1 < LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s1 < LENGTH('a)
[PROOF STEP]
using s2wb s1s2
[PROOF STATE]
proof (prove)
using this:
s2 < LENGTH('a)
s1 \<le> s2

goal (1 subgoal):
 1. s1 < LENGTH('a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
s1 < LENGTH('a)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
from alm
[PROOF STATE]
proof (chain)
picking this:
is_aligned m s1
[PROOF STEP]
obtain mq where mmq: "m = 2 ^ s1 * of_nat mq" and mq: "mq < 2 ^ (LENGTH('a) - s1)"
[PROOF STATE]
proof (prove)
using this:
is_aligned m s1

goal (1 subgoal):
 1. (\<And>mq. \<lbrakk>m = 2 ^ s1 * word_of_nat mq; mq < 2 ^ (LENGTH('a) - s1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: is_alignedE simp: field_simps)
[PROOF STATE]
proof (state)
this:
m = 2 ^ s1 * word_of_nat mq
mq < 2 ^ (LENGTH('a) - s1)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
from aln
[PROOF STATE]
proof (chain)
picking this:
is_aligned n s2
[PROOF STEP]
obtain nq where nnq: "n = 2 ^ s2 * of_nat nq" and nq: "nq < 2 ^ (LENGTH('a) - s2)"
[PROOF STATE]
proof (prove)
using this:
is_aligned n s2

goal (1 subgoal):
 1. (\<And>nq. \<lbrakk>n = 2 ^ s2 * word_of_nat nq; nq < 2 ^ (LENGTH('a) - s2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: is_alignedE simp: field_simps)
[PROOF STATE]
proof (state)
this:
n = 2 ^ s2 * word_of_nat nq
nq < 2 ^ (LENGTH('a) - s2)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
from s1s2
[PROOF STATE]
proof (chain)
picking this:
s1 \<le> s2
[PROOF STEP]
obtain sq where sq: "s2 = s1 + sq"
[PROOF STATE]
proof (prove)
using this:
s1 \<le> s2

goal (1 subgoal):
 1. (\<And>sq. s2 = s1 + sq \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: le_iff_add)
[PROOF STATE]
proof (state)
this:
s2 = s1 + sq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
note us1 = rl [OF mq s1wb]
[PROOF STATE]
proof (state)
this:
unat (2 ^ s1 * word_of_nat mq) = 2 ^ s1 * mq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
note us2 = rl [OF nq s2wb]
[PROOF STATE]
proof (state)
this:
unat (2 ^ s2 * word_of_nat nq) = 2 ^ s2 * nq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
from nm
[PROOF STATE]
proof (chain)
picking this:
m \<in> {n..n + (2 ^ s2 - 1)}
[PROOF STEP]
have "n \<le> m"
[PROOF STATE]
proof (prove)
using this:
m \<in> {n..n + (2 ^ s2 - 1)}

goal (1 subgoal):
 1. n \<le> m
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
n \<le> m

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<le> m
[PROOF STEP]
have "(2::'a word) ^ s2 * of_nat nq \<le> 2 ^ s1 * of_nat mq"
[PROOF STATE]
proof (prove)
using this:
n \<le> m

goal (1 subgoal):
 1. 2 ^ s2 * word_of_nat nq \<le> 2 ^ s1 * word_of_nat mq
[PROOF STEP]
using nnq mmq
[PROOF STATE]
proof (prove)
using this:
n \<le> m
n = 2 ^ s2 * word_of_nat nq
m = 2 ^ s1 * word_of_nat mq

goal (1 subgoal):
 1. 2 ^ s2 * word_of_nat nq \<le> 2 ^ s1 * word_of_nat mq
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ s2 * word_of_nat nq \<le> 2 ^ s1 * word_of_nat mq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ s2 * word_of_nat nq \<le> 2 ^ s1 * word_of_nat mq
[PROOF STEP]
have "2 ^ s2 * nq \<le> 2 ^ s1 * mq"
[PROOF STATE]
proof (prove)
using this:
2 ^ s2 * word_of_nat nq \<le> 2 ^ s1 * word_of_nat mq

goal (1 subgoal):
 1. 2 ^ s2 * nq \<le> 2 ^ s1 * mq
[PROOF STEP]
using s1wb s2wb
[PROOF STATE]
proof (prove)
using this:
2 ^ s2 * word_of_nat nq \<le> 2 ^ s1 * word_of_nat mq
s1 < LENGTH('a)
s2 < LENGTH('a)

goal (1 subgoal):
 1. 2 ^ s2 * nq \<le> 2 ^ s1 * mq
[PROOF STEP]
by (simp add: word_le_nat_alt us1 us2)
[PROOF STATE]
proof (state)
this:
2 ^ s2 * nq \<le> 2 ^ s1 * mq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ s2 * nq \<le> 2 ^ s1 * mq
[PROOF STEP]
have nqmq: "2 ^ sq * nq \<le> mq"
[PROOF STATE]
proof (prove)
using this:
2 ^ s2 * nq \<le> 2 ^ s1 * mq

goal (1 subgoal):
 1. 2 ^ sq * nq \<le> mq
[PROOF STEP]
using sq
[PROOF STATE]
proof (prove)
using this:
2 ^ s2 * nq \<le> 2 ^ s1 * mq
s2 = s1 + sq

goal (1 subgoal):
 1. 2 ^ sq * nq \<le> mq
[PROOF STEP]
by (simp add: power_add)
[PROOF STATE]
proof (state)
this:
2 ^ sq * nq \<le> mq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
have "m - n = 2 ^ s1 * of_nat mq - 2 ^ s2 * of_nat nq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m - n = 2 ^ s1 * word_of_nat mq - 2 ^ s2 * word_of_nat nq
[PROOF STEP]
using mmq nnq
[PROOF STATE]
proof (prove)
using this:
m = 2 ^ s1 * word_of_nat mq
n = 2 ^ s2 * word_of_nat nq

goal (1 subgoal):
 1. m - n = 2 ^ s1 * word_of_nat mq - 2 ^ s2 * word_of_nat nq
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m - n = 2 ^ s1 * word_of_nat mq - 2 ^ s2 * word_of_nat nq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m - n = 2 ^ s1 * word_of_nat mq - 2 ^ s2 * word_of_nat nq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
have "\<dots> = 2 ^ s1 * of_nat mq - 2 ^ s1 * 2 ^ sq * of_nat nq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ s1 * word_of_nat mq - 2 ^ s2 * word_of_nat nq = 2 ^ s1 * word_of_nat mq - 2 ^ s1 * 2 ^ sq * word_of_nat nq
[PROOF STEP]
using sq
[PROOF STATE]
proof (prove)
using this:
s2 = s1 + sq

goal (1 subgoal):
 1. 2 ^ s1 * word_of_nat mq - 2 ^ s2 * word_of_nat nq = 2 ^ s1 * word_of_nat mq - 2 ^ s1 * 2 ^ sq * word_of_nat nq
[PROOF STEP]
by (simp add: power_add)
[PROOF STATE]
proof (state)
this:
2 ^ s1 * word_of_nat mq - 2 ^ s2 * word_of_nat nq = 2 ^ s1 * word_of_nat mq - 2 ^ s1 * 2 ^ sq * word_of_nat nq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ s1 * word_of_nat mq - 2 ^ s2 * word_of_nat nq = 2 ^ s1 * word_of_nat mq - 2 ^ s1 * 2 ^ sq * word_of_nat nq

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
have "\<dots> = 2 ^ s1 * (of_nat mq - 2 ^ sq * of_nat nq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ s1 * word_of_nat mq - 2 ^ s1 * 2 ^ sq * word_of_nat nq = 2 ^ s1 * (word_of_nat mq - 2 ^ sq * word_of_nat nq)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
2 ^ s1 * word_of_nat mq - 2 ^ s1 * 2 ^ sq * word_of_nat nq = 2 ^ s1 * (word_of_nat mq - 2 ^ sq * word_of_nat nq)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ s1 * word_of_nat mq - 2 ^ s1 * 2 ^ sq * word_of_nat nq = 2 ^ s1 * (word_of_nat mq - 2 ^ sq * word_of_nat nq)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
have "\<dots> = 2 ^ s1 * of_nat (mq - 2 ^ sq * nq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ s1 * (word_of_nat mq - 2 ^ sq * word_of_nat nq) = 2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq)
[PROOF STEP]
using s1wb s2wb us1 us2 nqmq
[PROOF STATE]
proof (prove)
using this:
s1 < LENGTH('a)
s2 < LENGTH('a)
unat (2 ^ s1 * word_of_nat mq) = 2 ^ s1 * mq
unat (2 ^ s2 * word_of_nat nq) = 2 ^ s2 * nq
2 ^ sq * nq \<le> mq

goal (1 subgoal):
 1. 2 ^ s1 * (word_of_nat mq - 2 ^ sq * word_of_nat nq) = 2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq)
[PROOF STEP]
by (simp add: of_nat_diff)
[PROOF STATE]
proof (state)
this:
2 ^ s1 * (word_of_nat mq - 2 ^ sq * word_of_nat nq) = 2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
m - n = 2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq)
[PROOF STEP]
have mn: "m - n = of_nat (mq - 2 ^ sq * nq) * 2 ^ s1"
[PROOF STATE]
proof (prove)
using this:
m - n = 2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq)

goal (1 subgoal):
 1. m - n = word_of_nat (mq - 2 ^ sq * nq) * 2 ^ s1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m - n = word_of_nat (mq - 2 ^ sq * nq) * 2 ^ s1

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
m - n = word_of_nat (mq - 2 ^ sq * nq) * 2 ^ s1

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
from nm
[PROOF STATE]
proof (chain)
picking this:
m \<in> {n..n + (2 ^ s2 - 1)}
[PROOF STEP]
have "m - n \<le> 2 ^ s2 - 1"
[PROOF STATE]
proof (prove)
using this:
m \<in> {n..n + (2 ^ s2 - 1)}

goal (1 subgoal):
 1. m - n \<le> 2 ^ s2 - 1
[PROOF STEP]
by - (rule word_diff_ls', (simp add: field_simps)+)
[PROOF STATE]
proof (state)
this:
m - n \<le> 2 ^ s2 - 1

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m - n \<le> 2 ^ s2 - 1
[PROOF STEP]
have "(2::'a word) ^ s1 * of_nat (mq - 2 ^ sq * nq) < 2 ^ s2"
[PROOF STATE]
proof (prove)
using this:
m - n \<le> 2 ^ s2 - 1

goal (1 subgoal):
 1. 2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq) < 2 ^ s2
[PROOF STEP]
using mn s2wb
[PROOF STATE]
proof (prove)
using this:
m - n \<le> 2 ^ s2 - 1
m - n = word_of_nat (mq - 2 ^ sq * nq) * 2 ^ s1
s2 < LENGTH('a)

goal (1 subgoal):
 1. 2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq) < 2 ^ s2
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq) < 2 ^ s2

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq) < 2 ^ s2
[PROOF STEP]
have "of_nat (mq - 2 ^ sq * nq) < (2::'a word) ^ (s2 - s1)"
[PROOF STATE]
proof (prove)
using this:
2 ^ s1 * word_of_nat (mq - 2 ^ sq * nq) < 2 ^ s2

goal (1 subgoal):
 1. word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (s2 - s1)
[PROOF STEP]
proof (rule word_power_less_diff)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
have mm: "mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
using mq
[PROOF STATE]
proof (prove)
using this:
mq < 2 ^ (LENGTH('a) - s1)

goal (1 subgoal):
 1. mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1)

goal (1 subgoal):
 1. word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1)

goal (1 subgoal):
 1. word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
from s10
[PROOF STATE]
proof (chain)
picking this:
0 < s1
[PROOF STEP]
have "LENGTH('a) - s1 < LENGTH('a)"
[PROOF STATE]
proof (prove)
using this:
0 < s1

goal (1 subgoal):
 1. LENGTH('a) - s1 < LENGTH('a)
[PROOF STEP]
by (rule diff_less, simp)
[PROOF STATE]
proof (state)
this:
LENGTH('a) - s1 < LENGTH('a)

goal (1 subgoal):
 1. word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1)
LENGTH('a) - s1 < LENGTH('a)
[PROOF STEP]
show "of_nat (mq - 2 ^ sq * nq) < (2::'a word) ^ (LENGTH('a) - s1)"
[PROOF STATE]
proof (prove)
using this:
mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1)
LENGTH('a) - s1 < LENGTH('a)

goal (1 subgoal):
 1. word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
using take_bit_nat_less_self_iff [of \<open>LENGTH('a)\<close> \<open>mq - 2 ^ sq * nq\<close>]
[PROOF STATE]
proof (prove)
using this:
mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1)
LENGTH('a) - s1 < LENGTH('a)
(take_bit LENGTH('a) (mq - 2 ^ sq * nq) < mq - 2 ^ sq * nq) = (2 ^ LENGTH('a) \<le> mq - 2 ^ sq * nq)

goal (1 subgoal):
 1. word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
apply (auto simp add: word_less_nat_alt not_le not_less unsigned_of_nat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mq - 2 ^ sq * nq < 2 ^ (LENGTH('a) - s1); LENGTH('a) - s1 < LENGTH('a); mq - 2 ^ sq * nq \<le> take_bit LENGTH('a) (mq - 2 ^ sq * nq); mq - 2 ^ sq * nq < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> take_bit LENGTH('a) (mq - 2 ^ sq * nq) < 2 ^ (LENGTH('a) - s1)
[PROOF STEP]
apply (metis take_bit_nat_eq_self_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (LENGTH('a) - s1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (s2 - s1)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (s2 - s1)
[PROOF STEP]
have "mq - 2 ^ sq * nq < 2 ^ (s2 - s1)"
[PROOF STATE]
proof (prove)
using this:
word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (s2 - s1)

goal (1 subgoal):
 1. mq - 2 ^ sq * nq < 2 ^ (s2 - s1)
[PROOF STEP]
using mq s2wb
[PROOF STATE]
proof (prove)
using this:
word_of_nat (mq - 2 ^ sq * nq) < 2 ^ (s2 - s1)
mq < 2 ^ (LENGTH('a) - s1)
s2 < LENGTH('a)

goal (1 subgoal):
 1. mq - 2 ^ sq * nq < 2 ^ (s2 - s1)
[PROOF STEP]
apply (simp add: word_less_nat_alt take_bit_eq_mod unsigned_of_nat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(mq - 2 ^ sq * nq) mod 2 ^ LENGTH('a) < 2 ^ (s2 - s1); mq < 2 ^ (LENGTH('a) - s1); s2 < LENGTH('a)\<rbrakk> \<Longrightarrow> mq - 2 ^ sq * nq < 2 ^ (s2 - s1)
[PROOF STEP]
apply (subst (asm) mod_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>mq < 2 ^ (LENGTH('a) - s1); s2 < LENGTH('a)\<rbrakk> \<Longrightarrow> mq - 2 ^ sq * nq < 2 ^ LENGTH('a)
 2. \<lbrakk>mq - 2 ^ sq * nq < 2 ^ (s2 - s1); mq < 2 ^ (LENGTH('a) - s1); s2 < LENGTH('a)\<rbrakk> \<Longrightarrow> mq - 2 ^ sq * nq < 2 ^ (s2 - s1)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mq < 2 ^ (LENGTH('a) - s1); s2 < LENGTH('a)\<rbrakk> \<Longrightarrow> mq - 2 ^ sq * nq < 2 ^ LENGTH('a)
[PROOF STEP]
apply (rule order_le_less_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>mq < 2 ^ (LENGTH('a) - s1); s2 < LENGTH('a)\<rbrakk> \<Longrightarrow> mq - 2 ^ sq * nq \<le> ?y71
 2. \<lbrakk>mq < 2 ^ (LENGTH('a) - s1); s2 < LENGTH('a)\<rbrakk> \<Longrightarrow> ?y71 < 2 ^ LENGTH('a)
[PROOF STEP]
apply (rule diff_le_self)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mq < 2 ^ (LENGTH('a) - s1); s2 < LENGTH('a)\<rbrakk> \<Longrightarrow> mq < 2 ^ LENGTH('a)
[PROOF STEP]
apply (erule order_less_le_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s2 < LENGTH('a) \<Longrightarrow> 2 ^ (LENGTH('a) - s1) \<le> 2 ^ LENGTH('a)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
mq - 2 ^ sq * nq < 2 ^ (s2 - s1)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
m - n = word_of_nat (mq - 2 ^ sq * nq) * 2 ^ s1
mq - 2 ^ sq * nq < 2 ^ (s2 - s1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m - n = word_of_nat (mq - 2 ^ sq * nq) * 2 ^ s1
mq - 2 ^ sq * nq < 2 ^ (s2 - s1)

goal (1 subgoal):
 1. \<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>q. m - n = word_of_nat q * 2 ^ s1 \<and> q < 2 ^ (s2 - s1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parent_lower_bound: "l \<le> parent l c \<longleftrightarrow> l < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l \<le> parent l c) = (l < c)
[PROOF STEP]
unfolding parent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l \<le> l + (c - l - 1) div 2) = (l < c)
[PROOF STEP]
by linarith


[STATEMENT]
lemma infinite_iff_alw_ev: "infinite {m. P (sdrop m \<omega>)} \<longleftrightarrow> alw (ev P) \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {m. P (sdrop m \<omega>)} = alw (ev P) \<omega>
[PROOF STEP]
unfolding infinite_nat_iff_unbounded_le alw_iff_sdrop ev_iff_sdrop
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>m. \<exists>n\<ge>m. n \<in> {m. P (sdrop m \<omega>)}) = (\<forall>m. \<exists>ma. P (sdrop ma (sdrop m \<omega>)))
[PROOF STEP]
by simp (metis le_Suc_ex le_add1)


[STATEMENT]
lemma sublist_Y_cases_UV:
  assumes "\<forall>xs \<in> Y. \<forall>ys \<in> Y. xs = ys \<or> set xs \<inter> set ys = {}"
      and "U \<in> Y"
      and "V \<in> Y"
      and "U \<noteq> []"
      and "V \<noteq> []"
      and "(\<forall>xs \<in> Y. sublist xs (as@U@bs@V@cs))"
      and "xs \<in> Y"
    shows "sublist xs as \<or> sublist xs bs \<or> sublist xs cs \<or> U = xs \<or> V = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sublist xs as \<or> sublist xs bs \<or> sublist xs cs \<or> U = xs \<or> V = xs
[PROOF STEP]
using assms append_assoc sublist_not_mid
[PROOF STATE]
proof (prove)
using this:
\<forall>xs\<in>Y. \<forall>ys\<in>Y. xs = ys \<or> set xs \<inter> set ys = {}
U \<in> Y
V \<in> Y
U \<noteq> []
V \<noteq> []
\<forall>xs\<in>Y. sublist xs (as @ U @ bs @ V @ cs)
xs \<in> Y
(?xs @ ?ys) @ ?zs = ?xs @ ?ys @ ?zs
\<lbrakk>sublist ?U ((?A @ ?V) @ ?B); set ?U \<inter> set ?V = {}; ?V \<noteq> []\<rbrakk> \<Longrightarrow> sublist ?U ?A \<or> sublist ?U ?B

goal (1 subgoal):
 1. sublist xs as \<or> sublist xs bs \<or> sublist xs cs \<or> U = xs \<or> V = xs
[PROOF STEP]
by metis


[STATEMENT]
lemma affine_alg_set_closed:
  shows "affine_alg_set R n as \<subseteq> carrier (R\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_alg_set R n as \<subseteq> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
unfolding affine_alg_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> carrier (R\<^bsup>n\<^esup>). \<forall>b\<in>as. a \<in> V n b} \<subseteq> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
lemma PiE_empty_range[simp]: "i \<in> I \<Longrightarrow> F i = {} \<Longrightarrow> (\<Pi>\<^sub>E i\<in>I. F i) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<in> I; F i = {}\<rbrakk> \<Longrightarrow> Pi\<^sub>E I F = {}
[PROOF STEP]
unfolding PiE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<in> I; F i = {}\<rbrakk> \<Longrightarrow> Pi I F \<inter> extensional I = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma len_div_pow2[simp]: "len (x div 2 ^ m) = len x - m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. len (x div 2 ^ m) = len x - m
[PROOF STEP]
by (induct m arbitrary: x) (auto simp: div_mult2_eq)


[STATEMENT]
lemma (in topological_space) at_within_union:
  "at x within (S \<union> T) = sup (at x within S) (at x within T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within S \<union> T = sup (at x within S) (at x within T)
[PROOF STEP]
unfolding filter_eq_iff eventually_sup eventually_at_filter
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P. (\<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> S \<union> T \<longrightarrow> P xa) = ((\<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> S \<longrightarrow> P xa) \<and> (\<forall>\<^sub>F xa in nhds x. xa \<noteq> x \<longrightarrow> xa \<in> T \<longrightarrow> P xa))
[PROOF STEP]
by (auto elim!: eventually_rev_mp)


[STATEMENT]
lemma isin_set: "sorted(inorder t) \<Longrightarrow> isin t x = (x \<in> set (inorder t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (inorder t) \<Longrightarrow> isin t x = (x \<in> set (inorder t))
[PROOF STEP]
by (auto simp: isin_def is_root_def dest: splay_elemsD split: tree.splits)


[STATEMENT]
lemma PNT1_imp_PNT2:
  assumes "\<pi> \<sim>[at_top] (\<lambda>x. x / ln x)"
  shows   "(\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)
[PROOF STEP]
have "(\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x / ln x * ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x / ln x * ln x)
[PROOF STEP]
by (intro asymp_equiv_intros assms PNT1_imp_PNT1')
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x / ln x * ln x)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x / ln x * ln x)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)
[PROOF STEP]
have "\<dots> \<sim>[at_top] (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x / ln x * ln x) \<sim>[at_top] (\<lambda>x. x)
[PROOF STEP]
by (intro asymp_equiv_refl_ev eventually_mono[OF eventually_gt_at_top[of 1]])
       (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x / ln x * ln x) \<sim>[at_top] (\<lambda>x. x)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>c d. c \<sim>[at_top] d \<Longrightarrow> c \<sim>[at_top] d) \<Longrightarrow> (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>a. a)
[PROOF STEP]
show "(\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
using this:
(\<And>c d. c \<sim>[at_top] d \<Longrightarrow> c \<sim>[at_top] d) \<Longrightarrow> (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>a. a)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> x * ln (\<pi> x)) \<sim>[at_top] (\<lambda>x. x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma canonical_separator_transitions_def :
  assumes "q1 \<in> states M" and "q2 \<in> states M"
  shows "transitions (canonical_separator M q1 q2) =
        {(Inl (q1',q2'), x, y, (Inl (q1'',q2''))) | q1' q2' x y q1'' q2'' . ((q1',q2'), x, y, (q1'',q2'')) \<in> transitions (product (from_FSM M q1) (from_FSM M q2))}
        \<union> (distinguishing_transitions_left M q1 q2)
        \<union> (distinguishing_transitions_right M q1 q2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FSM.transitions (canonical_separator M q1 q2) = {(Inl (q1', q2'), x, y, Inl (q1'', q2'')) |q1' q2' x y q1'' q2''. ((q1', q2'), x, y, q1'', q2'') \<in> FSM.transitions (Product_FSM.product (from_FSM M q1) (from_FSM M q2))} \<union> distinguishing_transitions_left M q1 q2 \<union> distinguishing_transitions_right M q1 q2
[PROOF STEP]
unfolding canonical_separator_transitions_helper[OF assms]
            shifted_transitions_alt_def
            distinguishing_transitions_left_def
            distinguishing_transitions_right_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(Inl (q1', q2'), x, y, Inl (q1'', q2'')) |q1' q2' x y q1'' q2''. ((q1', q2'), x, y, q1'', q2'') \<in> FSM.transitions (Product_FSM.product (from_FSM M q1) (from_FSM M q2))} \<union> {(Inl (q1', q2'), x, y, Inr q1) |q1' q2' x y. (q1', q2') \<in> FSM.states (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) \<and> (\<exists>q'. (q1', x, y, q') \<in> FSM.transitions M) \<and> (\<nexists>q'. (q2', x, y, q') \<in> FSM.transitions M)} \<union> {(Inl (q1', q2'), x, y, Inr q2) |q1' q2' x y. (q1', q2') \<in> FSM.states (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) \<and> (\<nexists>q'. (q1', x, y, q') \<in> FSM.transitions M) \<and> (\<exists>q'. (q2', x, y, q') \<in> FSM.transitions M)} = {(Inl (q1', q2'), x, y, Inl (q1'', q2'')) |q1' q2' x y q1'' q2''. ((q1', q2'), x, y, q1'', q2'') \<in> FSM.transitions (Product_FSM.product (from_FSM M q1) (from_FSM M q2))} \<union> {(Inl (q1', q2'), x, y, Inr q1) |q1' q2' x y. (q1', q2') \<in> FSM.states (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) \<and> (\<exists>q'. (q1', x, y, q') \<in> FSM.transitions M) \<and> (\<nexists>q'. (q2', x, y, q') \<in> FSM.transitions M)} \<union> {(Inl (q1', q2'), x, y, Inr q2) |q1' q2' x y. (q1', q2') \<in> FSM.states (Product_FSM.product (from_FSM M q1) (from_FSM M q2)) \<and> (\<nexists>q'. (q1', x, y, q') \<in> FSM.transitions M) \<and> (\<exists>q'. (q2', x, y, q') \<in> FSM.transitions M)}
[PROOF STEP]
by simp


[STATEMENT]
lemma small_categories_vsubset_Vset: "set {\<CC>. tiny_category \<alpha> \<CC>} \<subseteq>\<^sub>\<circ> Vset \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.set {\<CC>. tiny_category \<alpha> \<CC>} \<subseteq>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
by (rule vsubsetI) (simp_all add: tiny_category.tiny_cat_in_Vset)


[STATEMENT]
lemma closed_sum_left_subset: \<open>0 \<in> B \<Longrightarrow> A \<subseteq> A +\<^sub>M B\<close> for A B :: "_::monoid_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'c) \<in> B \<Longrightarrow> A \<subseteq> A +\<^sub>M B
[PROOF STEP]
by (metis add.right_neutral closed_sum_def closure_subset in_mono set_plus_intro subsetI)


[STATEMENT]
lemma rev_inv: "inv rev = rev"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv rev = rev
[PROOF STEP]
using inv_unique_comp[OF rev_involution' rev_involution']
[PROOF STATE]
proof (prove)
using this:
inv rev = rev

goal (1 subgoal):
 1. inv rev = rev
[PROOF STEP]
.