[STATEMENT]
lemma (in ceuclidean_space) choice_CBasis_iff:
  fixes P :: "'a \<Rightarrow> complex \<Rightarrow> bool"
  shows "(\<forall>i\<in>CBasis. \<exists>x. P i x) \<longleftrightarrow> (\<exists>x. \<forall>i\<in>CBasis. P i (cinner x i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>CBasis. \<exists>x. P i x) = (\<exists>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i))
[PROOF STEP]
unfolding bchoice_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>f. \<forall>i\<in>CBasis. P i (f i)) = (\<exists>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. \<forall>i\<in>CBasis. P i (f i) \<Longrightarrow> \<exists>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i)
 2. \<And>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i) \<Longrightarrow> \<exists>f. \<forall>i\<in>CBasis. P i (f i)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. \<forall>i\<in>CBasis. P i (f i) \<Longrightarrow> \<exists>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i)
 2. \<And>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i) \<Longrightarrow> \<exists>f. \<forall>i\<in>CBasis. P i (f i)
[PROOF STEP]
assume "\<forall>i\<in>CBasis. P i (f i)"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>CBasis. P i (f i)

goal (2 subgoals):
 1. \<And>f. \<forall>i\<in>CBasis. P i (f i) \<Longrightarrow> \<exists>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i)
 2. \<And>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i) \<Longrightarrow> \<exists>f. \<forall>i\<in>CBasis. P i (f i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>CBasis. P i (f i)
[PROOF STEP]
show "\<exists>x. \<forall>i\<in>CBasis. P i (cinner x i)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>CBasis. P i (f i)

goal (1 subgoal):
 1. \<exists>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i)
[PROOF STEP]
by (auto intro!: exI[of _ "\<Sum>i\<in>CBasis. cnj (f i) *\<^sub>C i"])
[PROOF STATE]
proof (state)
this:
\<exists>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i)

goal (1 subgoal):
 1. \<And>x. \<forall>i\<in>CBasis. P i (x \<bullet>\<^sub>C i) \<Longrightarrow> \<exists>f. \<forall>i\<in>CBasis. P i (f i)
[PROOF STEP]
qed auto


[STATEMENT]
lemma leq_sum:
  fixes f g :: "'b::finite \<Rightarrow> 'a"
  shows "(\<forall>k . f k \<le> g k) \<Longrightarrow> (\<Squnion>\<^sub>k f k) \<le> (\<Squnion>\<^sub>k g k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f {k. True} \<le> comm_monoid_add.sum (\<squnion>) bot g {k. True}
[PROOF STEP]
proof (induct rule: one_sup_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<forall>k. f k \<le> g k \<Longrightarrow> f i \<le> g i
 2. \<And>j I. \<lbrakk>j \<notin> I; \<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f I \<le> comm_monoid_add.sum (\<squnion>) bot g I; \<forall>k. f k \<le> g k\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I
[PROOF STEP]
case one
[PROOF STATE]
proof (state)
this:
\<forall>k. f k \<le> g k

goal (2 subgoals):
 1. \<And>i. \<forall>k. f k \<le> g k \<Longrightarrow> f i \<le> g i
 2. \<And>j I. \<lbrakk>j \<notin> I; \<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f I \<le> comm_monoid_add.sum (\<squnion>) bot g I; \<forall>k. f k \<le> g k\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>k. f k \<le> g k

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

goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; \<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f I \<le> comm_monoid_add.sum (\<squnion>) bot g I; \<forall>k. f k \<le> g k\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; \<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f I \<le> comm_monoid_add.sum (\<squnion>) bot g I; \<forall>k. f k \<le> g k\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I
[PROOF STEP]
case (sup j I)
[PROOF STATE]
proof (state)
this:
j \<notin> I
\<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f I \<le> comm_monoid_add.sum (\<squnion>) bot g I
\<forall>k. f k \<le> g k

goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; \<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f I \<le> comm_monoid_add.sum (\<squnion>) bot g I; \<forall>k. f k \<le> g k\<rbrakk> \<Longrightarrow> f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
j \<notin> I
\<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f I \<le> comm_monoid_add.sum (\<squnion>) bot g I
\<forall>k. f k \<le> g k

goal (1 subgoal):
 1. f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I
[PROOF STEP]
using sup_mono
[PROOF STATE]
proof (prove)
using this:
j \<notin> I
\<forall>k. f k \<le> g k \<Longrightarrow> comm_monoid_add.sum (\<squnion>) bot f I \<le> comm_monoid_add.sum (\<squnion>) bot g I
\<forall>k. f k \<le> g k
\<lbrakk>?a \<le> ?c; ?b \<le> ?d\<rbrakk> \<Longrightarrow> ?a \<squnion> ?b \<le> ?c \<squnion> ?d

goal (1 subgoal):
 1. f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I \<le> g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem set_of_delete:
  "\<lbrakk> avl t; is_ord t \<rbrakk> \<Longrightarrow> set_of (delete x t) = (set_of t) - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>avl t; is_ord t\<rbrakk> \<Longrightarrow> set_of (delete x t) = set_of t - {x}
[PROOF STEP]
proof (induct t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>avl ET; is_ord ET\<rbrakk> \<Longrightarrow> set_of (delete x ET) = set_of ET - {x}
 2. \<And>x1 t1 t2 x4. \<lbrakk>\<lbrakk>avl t1; is_ord t1\<rbrakk> \<Longrightarrow> set_of (delete x t1) = set_of t1 - {x}; \<lbrakk>avl t2; is_ord t2\<rbrakk> \<Longrightarrow> set_of (delete x t2) = set_of t2 - {x}; avl (MKT x1 t1 t2 x4); is_ord (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> set_of (delete x (MKT x1 t1 t2 x4)) = set_of (MKT x1 t1 t2 x4) - {x}
[PROOF STEP]
case (MKT n l r h)
[PROOF STATE]
proof (state)
this:
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)

goal (2 subgoals):
 1. \<lbrakk>avl ET; is_ord ET\<rbrakk> \<Longrightarrow> set_of (delete x ET) = set_of ET - {x}
 2. \<And>x1 t1 t2 x4. \<lbrakk>\<lbrakk>avl t1; is_ord t1\<rbrakk> \<Longrightarrow> set_of (delete x t1) = set_of t1 - {x}; \<lbrakk>avl t2; is_ord t2\<rbrakk> \<Longrightarrow> set_of (delete x t2) = set_of t2 - {x}; avl (MKT x1 t1 t2 x4); is_ord (MKT x1 t1 t2 x4)\<rbrakk> \<Longrightarrow> set_of (delete x (MKT x1 t1 t2 x4)) = set_of (MKT x1 t1 t2 x4) - {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)

goal (1 subgoal):
 1. set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
proof(cases "x = n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x = n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
 2. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = n

goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x = n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
 2. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
with MKT set_of_delete_root[of "MKT n l r h"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
\<lbrakk>MKT n l r h = MKT ?n ?l ?r ?h; avl (MKT n l r h); is_ord (MKT n l r h)\<rbrakk> \<Longrightarrow> set_of (delete_root (MKT n l r h)) = set_of (MKT n l r h) - {?n}
x = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
\<lbrakk>MKT n l r h = MKT ?n ?l ?r ?h; avl (MKT n l r h); is_ord (MKT n l r h)\<rbrakk> \<Longrightarrow> set_of (delete_root (MKT n l r h)) = set_of (MKT n l r h) - {?n}
x = n

goal (1 subgoal):
 1. set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> n

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
with MKT
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
x \<noteq> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
x \<noteq> n

goal (1 subgoal):
 1. set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
proof(cases "x<n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n; x < n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
 2. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < n

goal (2 subgoals):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n; x < n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
 2. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
with True MKT
[PROOF STATE]
proof (chain)
picking this:
x < n
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
x < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < n
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
x < n

goal (1 subgoal):
 1. set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
by (force simp: avl_delete set_of_mkt_bal_r[of "(delete x l)" r n] simp del:mkt_bal_r.simps)
[PROOF STATE]
proof (state)
this:
set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < n

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}; \<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}; avl (MKT n l r h); is_ord (MKT n l r h); x \<noteq> n; \<not> x < n\<rbrakk> \<Longrightarrow> set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
with False MKT \<open>x\<noteq>n\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> x < n
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
x \<noteq> n
\<not> x < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> x < n
\<lbrakk>avl l; is_ord l\<rbrakk> \<Longrightarrow> set_of (delete x l) = set_of l - {x}
\<lbrakk>avl r; is_ord r\<rbrakk> \<Longrightarrow> set_of (delete x r) = set_of r - {x}
avl (MKT n l r h)
is_ord (MKT n l r h)
x \<noteq> n
\<not> x < n

goal (1 subgoal):
 1. set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}
[PROOF STEP]
by (force simp: avl_delete set_of_mkt_bal_l[of l "(delete x r)" n] simp del:mkt_bal_l.simps)
[PROOF STATE]
proof (state)
this:
set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_of (delete x (MKT n l r h)) = set_of (MKT n l r h) - {x}

goal (1 subgoal):
 1. \<lbrakk>avl ET; is_ord ET\<rbrakk> \<Longrightarrow> set_of (delete x ET) = set_of ET - {x}
[PROOF STEP]
qed simp


[STATEMENT]
lemma rbt_lookup_rbt_product:
  "\<lbrakk> ord.is_rbt (\<sqsubset>\<^sub>a) rbt1; ord.is_rbt (\<sqsubset>\<^sub>b) rbt2 \<rbrakk>
  \<Longrightarrow> ord.rbt_lookup (\<sqsubset>) (rbt_product f rbt1 rbt2) (a, c) =
     (case ord.rbt_lookup (\<sqsubset>\<^sub>a) rbt1 a of None \<Rightarrow> None
      | Some b \<Rightarrow> map_option (f a b c) (ord.rbt_lookup (\<sqsubset>\<^sub>b) rbt2 c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ord.is_rbt (\<sqsubset>\<^sub>a) rbt1; ord.is_rbt (\<sqsubset>\<^sub>b) rbt2\<rbrakk> \<Longrightarrow> ord.rbt_lookup (less_prod (\<sqsubseteq>\<^sub>a) (\<sqsubset>\<^sub>a) (\<sqsubset>\<^sub>b)) (rbt_product f rbt1 rbt2) (a, c) = (case ord.rbt_lookup (\<sqsubset>\<^sub>a) rbt1 a of None \<Rightarrow> None | Some b \<Rightarrow> map_option (f a b c) (ord.rbt_lookup (\<sqsubset>\<^sub>b) rbt2 c))
[PROOF STEP]
by(simp add: rbt_product_def linorder.rbt_lookup_rbtreeify[OF linorder_prod] linorder.is_rbt_rbtreeify[OF linorder_prod] sorted_alist_product linorder.rbt_sorted_entries[OF lin_a] ord.is_rbt_rbt_sorted linorder.distinct_entries[OF lin_a] linorder.rbt_sorted_entries[OF lin_b] distinct_alist_product linorder.distinct_entries[OF lin_b] map_of_alist_product linorder.map_of_entries[OF lin_a] linorder.map_of_entries[OF lin_b] cong: option.case_cong)


[STATEMENT]
lemma expands_to_exp_neg:
  assumes "(f expands_to MS (MSLCons (C, e) xs) g) basis" "basis_wf basis" "e - 0 < 0"
  shows   "((\<lambda>x. exp (f x)) expands_to MS (powser_ms_aux' exp_series_stream (MSLCons (C, e) xs))
             (\<lambda>x. exp (g x))) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (f x)) expands_to MS (powser_ms_aux' exp_series_stream (MSLCons (C, e) xs)) (\<lambda>x. exp (g x))) basis
[PROOF STEP]
using assms is_expansion_exp_neg[of C e xs g basis]
[PROOF STATE]
proof (prove)
using this:
(f expands_to MS (MSLCons (C, e) xs) g) basis
basis_wf basis
e - 0 < 0
\<lbrakk>is_expansion (MS (MSLCons (C, e) xs) g) basis; basis_wf basis; e < 0\<rbrakk> \<Longrightarrow> is_expansion (MS (powser_ms_aux' exp_series_stream (MSLCons (C, e) xs)) (\<lambda>x. exp (g x))) basis

goal (1 subgoal):
 1. ((\<lambda>x. exp (f x)) expands_to MS (powser_ms_aux' exp_series_stream (MSLCons (C, e) xs)) (\<lambda>x. exp (g x))) basis
[PROOF STEP]
by (auto simp: expands_to.simps)


[STATEMENT]
lemma rbtreeify_f_simps:
  "rbtreeify_f 0 kvs = (Empty, kvs)"
  "rbtreeify_f (Suc 0) ((k, v) # kvs) =
  (Branch R Empty k v Empty, kvs)"
  "0 < n \<Longrightarrow> rbtreeify_f (2 * n) kvs =
   (case rbtreeify_f n kvs of (t1, (k, v) # kvs') \<Rightarrow>
     apfst (Branch B t1 k v) (rbtreeify_g n kvs'))"
  "0 < n \<Longrightarrow> rbtreeify_f (Suc (2 * n)) kvs =
   (case rbtreeify_f n kvs of (t1, (k, v) # kvs') \<Rightarrow>
     apfst (Branch B t1 k v) (rbtreeify_f n kvs'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rbtreeify_f 0 kvs = (Empty, kvs) &&& rbtreeify_f (Suc 0) ((k, v) # kvs) = (Branch R Empty k v Empty, kvs)) &&& (0 < n \<Longrightarrow> rbtreeify_f (2 * n) kvs = (case rbtreeify_f n kvs of (t1, (k, v) # kvs') \<Rightarrow> apfst (Branch B t1 k v) (rbtreeify_g n kvs'))) &&& (0 < n \<Longrightarrow> rbtreeify_f (Suc (2 * n)) kvs = (case rbtreeify_f n kvs of (t1, (k, v) # kvs') \<Rightarrow> apfst (Branch B t1 k v) (rbtreeify_f n kvs')))
[PROOF STEP]
by(subst (1) rbtreeify_f.simps, simp add: Suc_double_half)+


[STATEMENT]
lemma  cross_matrix_mult: "transpose A *v ((A *v x) \<times> (A *v y)) = det A *\<^sub>R (x \<times> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Cartesian_Product.transpose A *v (A *v x) \<times> (A *v y) = det A *\<^sub>R x \<times> y
[PROOF STEP]
apply (simp add: vec_eq_iff   )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. ((A *v x) \<times> (A *v y) v* A) $ i = det A * (x \<times> y) $ i
[PROOF STEP]
apply (simp add: vector_matrix_mult_def matrix_vector_mult_def forall_3 cross3_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma size_multiset_union [simp]:
  "size_multiset f (M + N::'a multiset) = size_multiset f M + size_multiset f N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size_multiset f (M + N) = size_multiset f M + size_multiset f N
[PROOF STEP]
apply (simp add: size_multiset_def sum_Un_nat sum.distrib sum_wcount_Int wcount_union)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (wcount f M) (set_mset M) + sum (wcount f M) (set_mset N) - sum (wcount f M) (set_mset M \<inter> set_mset N) = sum (wcount f M) (set_mset M)
[PROOF STEP]
apply (subst Int_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (wcount f M) (set_mset M) + sum (wcount f M) (set_mset N) - sum (wcount f M) (set_mset N \<inter> set_mset M) = sum (wcount f M) (set_mset M)
[PROOF STEP]
apply (simp add: sum_wcount_Int)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_rtrancl_delta_Image:
  "\<lbrakk>wellformed1 r; wellformed2 s\<rbrakk> \<Longrightarrow>
  finite ({((r, s), (delta1 a r, delta2 b s))| a b r s.
    a \<in> set alphabet1 \<and> b \<in> set alphabet2 \<and> R a b}^* `` {(r, s)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wellformed1 r; wellformed2 s\<rbrakk> \<Longrightarrow> finite ({((r, s), delta1 a r, delta2 b s) |a b r s. a \<in> set alphabet1 \<and> b \<in> set alphabet2 \<and> R a b}\<^sup>* `` {(r, s)})
[PROOF STEP]
unfolding rtrancl_fold_product Image_singleton
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wellformed1 r; wellformed2 s\<rbrakk> \<Longrightarrow> finite {b. ((r, s), b) \<in> {((r, s), fold delta1 w1 r, fold delta2 w2 s) |w1 w2 r s. w1 \<in> lists (set alphabet1) \<and> w2 \<in> lists (set alphabet2) \<and> list_all2 R w1 w2}}
[PROOF STEP]
by (auto intro: finite_subset[OF _ finite_cartesian_product[OF M.fin N.fin]])


[STATEMENT]
lemma cos_plus_pi: "cos ((z :: 'a :: {real_normed_field,banach}) + of_real pi) = - cos z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (z + of_real pi) = - cos z
[PROOF STEP]
by (simp add: cos_add)


[STATEMENT]
lemma lt_\<omega>_lt_\<omega>_imp_times_lt_\<omega>: "M < \<omega> \<Longrightarrow> N < \<omega> \<Longrightarrow> M * N < \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M < \<omega>; N < \<omega>\<rbrakk> \<Longrightarrow> M * N < \<omega>
[PROOF STEP]
by (metis lt_\<omega>_imp_ex_of_nat of_nat_lt_\<omega> of_nat_mult)


[STATEMENT]
lemma t_list_of_B_log_bound:
  "braun t \<Longrightarrow> t_list_of_B t \<le> 3 * (nlog2 (size t + 1) + 1) * size t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. braun t \<Longrightarrow> t_list_of_B t \<le> 3 * (nat \<lceil>log 2 (real (size t + 1))\<rceil> + 1) * size t
[PROOF STEP]
apply (frule t_list_of_B_bound)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>braun t; t_list_of_B t \<le> 3 * (height t + 1) * size t\<rbrakk> \<Longrightarrow> t_list_of_B t \<le> 3 * (nat \<lceil>log 2 (real (size t + 1))\<rceil> + 1) * size t
[PROOF STEP]
apply (simp add: height_acomplete acomplete_if_braun size1_size)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem sum_of_two_squares:
    "is_sum2sq_nat n \<longleftrightarrow> (\<forall> k. prime (4*k+3) \<longrightarrow> even (multiplicity (4*k+3) n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_sum2sq_nat n = (\<forall>k. prime (4 * k + 3) \<longrightarrow> even (multiplicity (4 * k + 3) n))
[PROOF STEP]
using sots1[of n] sots2[of n]
[PROOF STATE]
proof (prove)
using this:
is_sum2sq_nat n \<Longrightarrow> prime (4 * ?k + 3) \<longrightarrow> even (multiplicity (4 * ?k + 3) n)
(\<And>k. prime (4 * k + 3) \<longrightarrow> even (multiplicity (4 * k + 3) n)) \<Longrightarrow> is_sum2sq_nat n

goal (1 subgoal):
 1. is_sum2sq_nat n = (\<forall>k. prime (4 * k + 3) \<longrightarrow> even (multiplicity (4 * k + 3) n))
[PROOF STEP]
by blast


[STATEMENT]
lemma mset_insertList:
  "\<lbrakk>\<forall>t \<in> set ts. rank t = 0 \<and> children t = [] ; queue_invar q\<rbrakk> \<Longrightarrow>
  queue_to_multiset (insertList ts q) =
  queue_to_multiset ts + queue_to_multiset q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q
[PROOF STEP]
proof (induct ts arbitrary: q)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q. \<lbrakk>\<forall>t\<in>set []. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList [] q) = queue_to_multiset [] + queue_to_multiset q
 2. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set []. rank t = 0 \<and> children t = []
queue_invar q

goal (2 subgoals):
 1. \<And>q. \<lbrakk>\<forall>t\<in>set []. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList [] q) = queue_to_multiset [] + queue_to_multiset q
 2. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>t\<in>set []. rank t = 0 \<and> children t = []
queue_invar q
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set []. rank t = 0 \<and> children t = []
queue_invar q

goal (1 subgoal):
 1. queue_to_multiset (insertList [] q) = queue_to_multiset [] + queue_to_multiset q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
queue_to_multiset (insertList [] q) = queue_to_multiset [] + queue_to_multiset q

goal (1 subgoal):
 1. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
case (Cons a ts)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar ?q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts ?q) = queue_to_multiset ts + queue_to_multiset ?q
\<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []
queue_invar q

goal (1 subgoal):
 1. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
from Cons(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []
[PROOF STEP]
have ball_ts: "\<forall>t\<in>set ts. rank t = 0 \<and> children t = []"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []

goal (1 subgoal):
 1. \<forall>t\<in>set ts. rank t = 0 \<and> children t = []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set ts. rank t = 0 \<and> children t = []

goal (1 subgoal):
 1. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
note inv_insert = insert_queue_invar[OF Cons(3), of "val a" "prio a"]
[PROOF STATE]
proof (state)
this:
queue_invar (local.insert (val a) (prio a) q)

goal (1 subgoal):
 1. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
note iv = Cons(1)[OF ball_ts inv_insert]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (insertList ts (local.insert (val a) (prio a) q)) = queue_to_multiset ts + queue_to_multiset (local.insert (val a) (prio a) q)

goal (1 subgoal):
 1. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
from Cons(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []
[PROOF STEP]
have mset_a: "tree_to_multiset a = {# (val a, prio a)#}"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []

goal (1 subgoal):
 1. tree_to_multiset a = {#(val a, prio a)#}
[PROOF STEP]
by (cases a) simp
[PROOF STATE]
proof (state)
this:
tree_to_multiset a = {#(val a, prio a)#}

goal (1 subgoal):
 1. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
note insert_mset[OF Cons(3), of "val a" "prio a"]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (local.insert (val a) (prio a) q) = queue_to_multiset q + {#(val a, prio a)#}

goal (1 subgoal):
 1. \<And>a ts q. \<lbrakk>\<And>q. \<lbrakk>\<forall>t\<in>set ts. rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList ts q) = queue_to_multiset ts + queue_to_multiset q; \<forall>t\<in>set (a # ts). rank t = 0 \<and> children t = []; queue_invar q\<rbrakk> \<Longrightarrow> queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
with mset_a iv
[PROOF STATE]
proof (chain)
picking this:
tree_to_multiset a = {#(val a, prio a)#}
queue_to_multiset (insertList ts (local.insert (val a) (prio a) q)) = queue_to_multiset ts + queue_to_multiset (local.insert (val a) (prio a) q)
queue_to_multiset (local.insert (val a) (prio a) q) = queue_to_multiset q + {#(val a, prio a)#}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
tree_to_multiset a = {#(val a, prio a)#}
queue_to_multiset (insertList ts (local.insert (val a) (prio a) q)) = queue_to_multiset ts + queue_to_multiset (local.insert (val a) (prio a) q)
queue_to_multiset (local.insert (val a) (prio a) q) = queue_to_multiset q + {#(val a, prio a)#}

goal (1 subgoal):
 1. queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q
[PROOF STEP]
by (simp add: union_ac)
[PROOF STATE]
proof (state)
this:
queue_to_multiset (insertList (a # ts) q) = queue_to_multiset (a # ts) + queue_to_multiset q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_semialg_mapE:
  assumes "is_semialg_map m n f"
  assumes "is_semialgebraic (n + k) S"
  shows " is_semialgebraic (m + k) (map_partial_pullback m f k S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic (m + k) (map_partial_pullback m f k S)
[PROOF STEP]
using is_semialg_map_def assms
[PROOF STATE]
proof (prove)
using this:
is_semialg_map ?m ?n ?f = (?f \<in> carrier (Q\<^sub>p\<^bsup>?m\<^esup>) \<rightarrow> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<and> (\<forall>l\<ge>0. \<forall>S\<in>semialg_sets (?n + l). is_semialgebraic (?m + l) (map_partial_pullback ?m ?f l S)))
is_semialg_map m n f
is_semialgebraic (n + k) S

goal (1 subgoal):
 1. is_semialgebraic (m + k) (map_partial_pullback m f k S)
[PROOF STEP]
by (meson is_semialgebraicE le0)


[STATEMENT]
lemma symmetry2: assumes "\<forall>x y. (x, y) \<in> {(x, y). R x y}\<^sup>* \<longrightarrow> (y, x) \<in> {(x, y). R x y}\<^sup>* "
shows "symp R^**"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. symp R\<^sup>*\<^sup>*
[PROOF STEP]
unfolding symp_def Enum.rtranclp_rtrancl_eq assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(x, y). R x y}\<^sup>* \<longrightarrow> (y, x) \<in> {(x, y). R x y}\<^sup>*
[PROOF STEP]
by (metis assms)


[STATEMENT]
lemma cov_invertible_nonneg_eq:
  fixes f :: "real^'n::{finite,wellorder} \<Rightarrow> real" and g :: "real^'n::_ \<Rightarrow> real^'n::_"
  assumes "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)"
      and "\<And>y. y \<in> T \<Longrightarrow> (h has_derivative h' y) (at y within T)"
      and "\<And>y. y \<in> T \<Longrightarrow> 0 \<le> f y"
      and "\<And>x. x \<in> S \<Longrightarrow> g x \<in> T \<and> h(g x) = x"
      and "\<And>y. y \<in> T \<Longrightarrow> h y \<in> S \<and> g(h y) = y"
      and "\<And>y. y \<in> T \<Longrightarrow> h' y \<circ> g'(h y) = id"
  shows "((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f(g x)) has_integral b) S \<longleftrightarrow> (f has_integral b) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x)) has_integral b) S = (f has_integral b) T
[PROOF STEP]
using cov_invertible_nonneg_le [OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> S \<Longrightarrow> x \<in> S; \<And>y. y \<in> T \<Longrightarrow> y \<in> T; \<And>y. y \<in> T \<Longrightarrow> ?y7 y \<in> T; \<And>x. x \<in> S \<Longrightarrow> x \<in> S; \<And>y. y \<in> T \<Longrightarrow> y \<in> T; \<And>y. y \<in> T \<Longrightarrow> y \<in> T\<rbrakk> \<Longrightarrow> ((\<lambda>y. f (?y7 y)) integrable_on T \<and> integral T (\<lambda>y. f (?y7 y)) \<le> ?b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (?y7 (g x))) integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (?y7 (g x))) \<le> ?b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> * f (g x)) has_integral b) S = (f has_integral b) T
[PROOF STEP]
by (simp add: has_integral_iff) (meson eq_iff)


[STATEMENT]
lemma ell2_norm_0:
  assumes "has_ell2_norm x"
  shows "ell2_norm x = 0 \<longleftrightarrow> x = (\<lambda>_. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ell2_norm x = 0) = (x = (\<lambda>_. 0))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ell2_norm x = 0 \<Longrightarrow> x = (\<lambda>_. 0)
 2. x = (\<lambda>_. 0) \<Longrightarrow> ell2_norm x = 0
[PROOF STEP]
assume u1: "x = (\<lambda>_. 0)"
[PROOF STATE]
proof (state)
this:
x = (\<lambda>_. 0)

goal (2 subgoals):
 1. ell2_norm x = 0 \<Longrightarrow> x = (\<lambda>_. 0)
 2. x = (\<lambda>_. 0) \<Longrightarrow> ell2_norm x = 0
[PROOF STEP]
have u2: "(SUP x::'a set\<in>Collect finite. (0::real)) = 0"
    if "x = (\<lambda>_. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>x\<in>Collect finite. 0) = 0
[PROOF STEP]
by (metis cSUP_const empty_Collect_eq finite.emptyI)
[PROOF STATE]
proof (state)
this:
x = (\<lambda>_. 0) \<Longrightarrow> (\<Squnion>x\<in>Collect finite. 0) = 0

goal (2 subgoals):
 1. ell2_norm x = 0 \<Longrightarrow> x = (\<lambda>_. 0)
 2. x = (\<lambda>_. 0) \<Longrightarrow> ell2_norm x = 0
[PROOF STEP]
show "ell2_norm x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ell2_norm x = 0
[PROOF STEP]
unfolding ell2_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2) = 0
[PROOF STEP]
using u1 u2
[PROOF STATE]
proof (prove)
using this:
x = (\<lambda>_. 0)
x = (\<lambda>_. 0) \<Longrightarrow> (\<Squnion>x\<in>Collect finite. 0) = 0

goal (1 subgoal):
 1. sqrt (\<Sum>\<^sub>\<infinity>i. (cmod (x i))\<^sup>2) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ell2_norm x = 0

goal (1 subgoal):
 1. ell2_norm x = 0 \<Longrightarrow> x = (\<lambda>_. 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ell2_norm x = 0 \<Longrightarrow> x = (\<lambda>_. 0)
[PROOF STEP]
assume norm0: "ell2_norm x = 0"
[PROOF STATE]
proof (state)
this:
ell2_norm x = 0

goal (1 subgoal):
 1. ell2_norm x = 0 \<Longrightarrow> x = (\<lambda>_. 0)
[PROOF STEP]
show "x = (\<lambda>_. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = (\<lambda>_. 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>uu_. x uu_ = 0
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>uu_. x uu_ = 0
[PROOF STEP]
have \<open>cmod (x i) \<le> ell2_norm x\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (x i) \<le> ell2_norm x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
has_ell2_norm x

goal (1 subgoal):
 1. cmod (x i) \<le> ell2_norm x
[PROOF STEP]
by (rule ell2_norm_point_bound)
[PROOF STATE]
proof (state)
this:
cmod (x i) \<le> ell2_norm x

goal (1 subgoal):
 1. \<And>uu_. x uu_ = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (x i) \<le> ell2_norm x

goal (1 subgoal):
 1. \<And>uu_. x uu_ = 0
[PROOF STEP]
have \<open>\<dots> = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ell2_norm x = 0
[PROOF STEP]
by (fact norm0)
[PROOF STATE]
proof (state)
this:
ell2_norm x = 0

goal (1 subgoal):
 1. \<And>uu_. x uu_ = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (x i) \<le> 0
[PROOF STEP]
show "x i = 0"
[PROOF STATE]
proof (prove)
using this:
cmod (x i) \<le> 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x = (\<lambda>_. 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pow_mono_exp: assumes a: "a \<ge> (1 :: 'a :: ordered_semiring_1)"
  shows "n \<ge> m \<Longrightarrow> a ^ n \<ge> a ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n
[PROOF STEP]
proof (induct m arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. 0 \<le> n \<Longrightarrow> a ^ 0 \<le> a ^ n
 2. \<And>m n. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n; Suc m \<le> n\<rbrakk> \<Longrightarrow> a ^ Suc m \<le> a ^ n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 \<le> n

goal (2 subgoals):
 1. \<And>n. 0 \<le> n \<Longrightarrow> a ^ 0 \<le> a ^ n
 2. \<And>m n. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n; Suc m \<le> n\<rbrakk> \<Longrightarrow> a ^ Suc m \<le> a ^ n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ 0 \<le> a ^ n
[PROOF STEP]
using pow_mono_one[OF a]
[PROOF STATE]
proof (prove)
using this:
(1::'a) \<le> a ^ ?n

goal (1 subgoal):
 1. a ^ 0 \<le> a ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a ^ 0 \<le> a ^ n

goal (1 subgoal):
 1. \<And>m n. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n; Suc m \<le> n\<rbrakk> \<Longrightarrow> a ^ Suc m \<le> a ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m n. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n; Suc m \<le> n\<rbrakk> \<Longrightarrow> a ^ Suc m \<le> a ^ n
[PROOF STEP]
case (Suc m nn)
[PROOF STATE]
proof (state)
this:
m \<le> ?n \<Longrightarrow> a ^ m \<le> a ^ ?n
Suc m \<le> nn

goal (1 subgoal):
 1. \<And>m n. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n; Suc m \<le> n\<rbrakk> \<Longrightarrow> a ^ Suc m \<le> a ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<le> ?n \<Longrightarrow> a ^ m \<le> a ^ ?n
Suc m \<le> nn
[PROOF STEP]
obtain n where nn: "nn = Suc n"
[PROOF STATE]
proof (prove)
using this:
m \<le> ?n \<Longrightarrow> a ^ m \<le> a ^ ?n
Suc m \<le> nn

goal (1 subgoal):
 1. (\<And>n. nn = Suc n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases nn, auto)
[PROOF STATE]
proof (state)
this:
nn = Suc n

goal (1 subgoal):
 1. \<And>m n. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n; Suc m \<le> n\<rbrakk> \<Longrightarrow> a ^ Suc m \<le> a ^ n
[PROOF STEP]
note Suc = Suc[unfolded nn]
[PROOF STATE]
proof (state)
this:
m \<le> ?n \<Longrightarrow> a ^ m \<le> a ^ ?n
Suc m \<le> Suc n

goal (1 subgoal):
 1. \<And>m n. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n; Suc m \<le> n\<rbrakk> \<Longrightarrow> a ^ Suc m \<le> a ^ n
[PROOF STEP]
hence rec: "a ^ n \<ge> a ^ m"
[PROOF STATE]
proof (prove)
using this:
m \<le> ?n \<Longrightarrow> a ^ m \<le> a ^ ?n
Suc m \<le> Suc n

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

goal (1 subgoal):
 1. \<And>m n. \<lbrakk>\<And>n. m \<le> n \<Longrightarrow> a ^ m \<le> a ^ n; Suc m \<le> n\<rbrakk> \<Longrightarrow> a ^ Suc m \<le> a ^ n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ Suc m \<le> a ^ nn
[PROOF STEP]
unfolding nn power_Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * a ^ m \<le> a * a ^ n
[PROOF STEP]
by (rule times_right_mono[OF ge_trans[OF a one_ge_zero] rec])
[PROOF STATE]
proof (state)
this:
a ^ Suc m \<le> a ^ nn

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Units_eq_invertible_mat:
  assumes "A \<in> carrier_mat n n"
  shows "A \<in> Group.Units (ring_mat TYPE('a::comm_ring_1) n b) = invertible_mat A" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> Group.Units (ring_mat TYPE('a) n b)) = invertible_mat A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<in> Group.Units (ring_mat TYPE('a) n b)) = invertible_mat A
[PROOF STEP]
interpret m: ring "ring_mat TYPE('a) n b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring (ring_mat TYPE('a) n b)
[PROOF STEP]
by (rule ring_mat)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<in> Group.Units (ring_mat TYPE('a) n b)) = invertible_mat A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> Group.Units (ring_mat TYPE('a) n b)) = invertible_mat A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<in> Group.Units (ring_mat TYPE('a) n b) \<Longrightarrow> invertible_mat A
 2. invertible_mat A \<Longrightarrow> A \<in> Group.Units (ring_mat TYPE('a) n b)
[PROOF STEP]
assume "?lhs"
[PROOF STATE]
proof (state)
this:
A \<in> Group.Units (ring_mat TYPE('a) n b)

goal (2 subgoals):
 1. A \<in> Group.Units (ring_mat TYPE('a) n b) \<Longrightarrow> invertible_mat A
 2. invertible_mat A \<Longrightarrow> A \<in> Group.Units (ring_mat TYPE('a) n b)
[PROOF STEP]
thus "?rhs"
[PROOF STATE]
proof (prove)
using this:
A \<in> Group.Units (ring_mat TYPE('a) n b)

goal (1 subgoal):
 1. invertible_mat A
[PROOF STEP]
unfolding Group.Units_def
[PROOF STATE]
proof (prove)
using this:
A \<in> {y \<in> carrier (ring_mat TYPE('a) n b). \<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> y = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> y \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>}

goal (1 subgoal):
 1. invertible_mat A
[PROOF STEP]
by (insert assms, auto simp add: ring_mat_def invertible_mat_def inverts_mat_def)
[PROOF STATE]
proof (state)
this:
invertible_mat A

goal (1 subgoal):
 1. invertible_mat A \<Longrightarrow> A \<in> Group.Units (ring_mat TYPE('a) n b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. invertible_mat A \<Longrightarrow> A \<in> Group.Units (ring_mat TYPE('a) n b)
[PROOF STEP]
assume "?rhs"
[PROOF STATE]
proof (state)
this:
invertible_mat A

goal (1 subgoal):
 1. invertible_mat A \<Longrightarrow> A \<in> Group.Units (ring_mat TYPE('a) n b)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
invertible_mat A
[PROOF STEP]
obtain B where AB: "A * B = 1\<^sub>m n" and BA: "B * A = 1\<^sub>m n" and B: "B \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
invertible_mat A

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>A * B = 1\<^sub>m n; B * A = 1\<^sub>m n; B \<in> carrier_mat n n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms carrier_matD(1) inverts_mat_def obtain_inverse_matrix)
[PROOF STATE]
proof (state)
this:
A * B = 1\<^sub>m n
B * A = 1\<^sub>m n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. invertible_mat A \<Longrightarrow> A \<in> Group.Units (ring_mat TYPE('a) n b)
[PROOF STEP]
hence "\<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>
      \<and> A \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>"
[PROOF STATE]
proof (prove)
using this:
A * B = 1\<^sub>m n
B * A = 1\<^sub>m n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. \<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> A \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>
[PROOF STEP]
unfolding ring_mat_def
[PROOF STATE]
proof (prove)
using this:
A * B = 1\<^sub>m n
B * A = 1\<^sub>m n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. \<exists>x\<in>carrier \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>. x \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> A = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> \<and> A \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> A \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>

goal (1 subgoal):
 1. invertible_mat A \<Longrightarrow> A \<in> Group.Units (ring_mat TYPE('a) n b)
[PROOF STEP]
thus "?lhs"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> A \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>

goal (1 subgoal):
 1. A \<in> Group.Units (ring_mat TYPE('a) n b)
[PROOF STEP]
unfolding Group.Units_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> A \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>

goal (1 subgoal):
 1. A \<in> {y \<in> carrier (ring_mat TYPE('a) n b). \<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> y = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> y \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> A \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>
A \<in> carrier_mat n n

goal (1 subgoal):
 1. A \<in> {y \<in> carrier (ring_mat TYPE('a) n b). \<exists>x\<in>carrier (ring_mat TYPE('a) n b). x \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> y = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<and> y \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>}
[PROOF STEP]
unfolding ring_mat_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>carrier \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>. x \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> A = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> \<and> A \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub>
A \<in> carrier_mat n n

goal (1 subgoal):
 1. A \<in> {y \<in> carrier \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>. \<exists>x\<in>carrier \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>. x \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> y = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> \<and> y \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> Group.Units (ring_mat TYPE('a) n b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(A \<in> Group.Units (ring_mat TYPE('a) n b)) = invertible_mat A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cont2cont_insert [simp, cont2cont]:
  assumes "cont (\<lambda>x. f x)"
  shows "cont (\<lambda>x. insert y (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cont (\<lambda>x. insert y (f x))
[PROOF STEP]
unfolding insert_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cont (\<lambda>x. {x. x = y} \<union> f x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cont f

goal (1 subgoal):
 1. cont (\<lambda>x. {x. x = y} \<union> f x)
[PROOF STEP]
by (intro cont2cont)


[STATEMENT]
lemma div_lt: "m < n*k \<Longrightarrow> m div n < (k::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < n * k \<Longrightarrow> m div n < k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m < n * k \<Longrightarrow> m div n < k
[PROOF STEP]
assume A: "m < n*k"
[PROOF STATE]
proof (state)
this:
m < n * k

goal (1 subgoal):
 1. m < n * k \<Longrightarrow> m div n < k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m div n < k
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> m div n < k \<Longrightarrow> False
[PROOF STEP]
assume "\<not> m div n < k"
[PROOF STATE]
proof (state)
this:
\<not> m div n < k

goal (1 subgoal):
 1. \<not> m div n < k \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> m div n < k
[PROOF STEP]
have S1: "k \<le> m div n"
[PROOF STATE]
proof (prove)
using this:
\<not> m div n < k

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

goal (1 subgoal):
 1. \<not> m div n < k \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<le> m div n
[PROOF STEP]
have S2: "n*k \<le> m"
[PROOF STATE]
proof (prove)
using this:
k \<le> m div n

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

goal (1 subgoal):
 1. \<not> m div n < k \<Longrightarrow> False
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
m < n * k
n * k \<le> m
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
m < n * k
n * k \<le> m

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
m div n < k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_on_mod_nat:
  fixes m :: nat
  assumes "m > 0"
  shows   "inj_on (\<lambda>x. x mod m) {a..<a+m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. x mod m) {a..<a + m}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {a..<a + m}; y \<in> {a..<a + m}; x mod m = y mod m\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {a..<a + m}; y \<in> {a..<a + m}; x mod m = y mod m\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume xy: "x \<in> {a..<a+m}" "y \<in> {a..<a+m}" and eq: "x mod m = y mod m"
[PROOF STATE]
proof (state)
this:
x \<in> {a..<a + m}
y \<in> {a..<a + m}
x mod m = y mod m

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {a..<a + m}; y \<in> {a..<a + m}; x mod m = y mod m\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from \<open>m > 0\<close> and xy
[PROOF STATE]
proof (chain)
picking this:
0 < m
x \<in> {a..<a + m}
y \<in> {a..<a + m}
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
0 < m
x \<in> {a..<a + m}
y \<in> {a..<a + m}

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (rule cong_nat_imp_eq) (use eq in \<open>simp_all add: cong_def\<close>)
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_1_prodinf2:
  fixes f :: "nat \<Rightarrow> real"
  assumes "convergent_prod f" "\<And>n. 1 \<le> f n" "1 < f i"
  shows "1 < prodinf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < prodinf f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < prodinf f
[PROOF STEP]
have "1 < (\<Prod>n<Suc i. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < prod f {..<Suc i}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
convergent_prod f
1 \<le> f ?n
1 < f i

goal (1 subgoal):
 1. 1 < prod f {..<Suc i}
[PROOF STEP]
by (intro less_1_prod2[where i=i]) auto
[PROOF STATE]
proof (state)
this:
1 < prod f {..<Suc i}

goal (1 subgoal):
 1. 1 < prodinf f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 < prod f {..<Suc i}

goal (1 subgoal):
 1. 1 < prodinf f
[PROOF STEP]
have "\<dots> \<le> prodinf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f {..<Suc i} \<le> prodinf f
[PROOF STEP]
by (intro prod_le_prodinf) (use assms order_trans zero_le_one in \<open>blast+\<close>)
[PROOF STATE]
proof (state)
this:
prod f {..<Suc i} \<le> prodinf f

goal (1 subgoal):
 1. 1 < prodinf f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < prodinf f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < prodinf f

goal (1 subgoal):
 1. 1 < prodinf f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
1 < prodinf f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_list_inc_le':
  assumes "length u = length y"
  shows "sum_list (inc y i u) \<le> sum_list u + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (inc y i u) \<le> sum_list u + 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length u = length y

goal (1 subgoal):
 1. sum_list (inc y i u) \<le> sum_list u + 1
[PROOF STEP]
by (induct y i u rule: inc.induct) (auto simp: inc.simps sum_list_update)


[STATEMENT]
lemma ZObisL_length[simp]:
assumes "ZObisL cl dl"
shows "length cl = length dl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length cl = length dl
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ZObisL cl dl

goal (1 subgoal):
 1. length cl = length dl
[PROOF STEP]
unfolding ZObisL_def
[PROOF STATE]
proof (prove)
using this:
length cl = length dl \<and> (\<forall>n<length cl. cl ! n \<approx>01 dl ! n)

goal (1 subgoal):
 1. length cl = length dl
[PROOF STEP]
by simp


[STATEMENT]
lemma convergent_cong:
  assumes "eventually (\<lambda>x. f x = g x) sequentially"
  shows "convergent f \<longleftrightarrow> convergent g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent f = convergent g
[PROOF STEP]
unfolding convergent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>L. f \<longlonglongrightarrow> L) = (\<exists>L. g \<longlonglongrightarrow> L)
[PROOF STEP]
by (subst filterlim_cong[OF refl refl assms]) (rule refl)


[STATEMENT]
lemma akra_bazzi_measure_decreases:
  assumes "x \<ge> x\<^sub>1" "i < k"
  shows   "akra_bazzi_measure (bs!i*x + (hs!i) x) < akra_bazzi_measure x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. akra_bazzi_measure (bs ! i * x + (hs ! i) x) < akra_bazzi_measure x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. akra_bazzi_measure (bs ! i * x + (hs ! i) x) < akra_bazzi_measure x
[PROOF STEP]
from step_diff assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i < k; x\<^sub>1 \<le> ?x\<rbrakk> \<Longrightarrow> bs ! ?i * ?x + (hs ! ?i) ?x + 1 < ?x
x\<^sub>1 \<le> x
i < k
[PROOF STEP]
have "(bs!i * x + (hs!i) x) + 1 < x"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < k; x\<^sub>1 \<le> ?x\<rbrakk> \<Longrightarrow> bs ! ?i * ?x + (hs ! ?i) ?x + 1 < ?x
x\<^sub>1 \<le> x
i < k

goal (1 subgoal):
 1. bs ! i * x + (hs ! i) x + 1 < x
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
bs ! i * x + (hs ! i) x + 1 < x

goal (1 subgoal):
 1. akra_bazzi_measure (bs ! i * x + (hs ! i) x) < akra_bazzi_measure x
[PROOF STEP]
hence "\<lceil>(bs!i * x + (hs!i) x) + 1\<rceil> \<le> \<lceil>x\<rceil>"
[PROOF STATE]
proof (prove)
using this:
bs ! i * x + (hs ! i) x + 1 < x

goal (1 subgoal):
 1. \<lceil>bs ! i * x + (hs ! i) x + 1\<rceil> \<le> \<lceil>x\<rceil>
[PROOF STEP]
by (intro ceiling_mono) simp
[PROOF STATE]
proof (state)
this:
\<lceil>bs ! i * x + (hs ! i) x + 1\<rceil> \<le> \<lceil>x\<rceil>

goal (1 subgoal):
 1. akra_bazzi_measure (bs ! i * x + (hs ! i) x) < akra_bazzi_measure x
[PROOF STEP]
hence "\<lceil>(bs!i * x + (hs!i) x)\<rceil> < \<lceil>x\<rceil>"
[PROOF STATE]
proof (prove)
using this:
\<lceil>bs ! i * x + (hs ! i) x + 1\<rceil> \<le> \<lceil>x\<rceil>

goal (1 subgoal):
 1. \<lceil>bs ! i * x + (hs ! i) x\<rceil> < \<lceil>x\<rceil>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lceil>bs ! i * x + (hs ! i) x\<rceil> < \<lceil>x\<rceil>

goal (1 subgoal):
 1. akra_bazzi_measure (bs ! i * x + (hs ! i) x) < akra_bazzi_measure x
[PROOF STEP]
with assms x1_pos
[PROOF STATE]
proof (chain)
picking this:
x\<^sub>1 \<le> x
i < k
0 < x\<^sub>1
\<lceil>bs ! i * x + (hs ! i) x\<rceil> < \<lceil>x\<rceil>
[PROOF STEP]
have "nat \<lceil>(bs!i * x + (hs!i) x)\<rceil> < nat \<lceil>x\<rceil>"
[PROOF STATE]
proof (prove)
using this:
x\<^sub>1 \<le> x
i < k
0 < x\<^sub>1
\<lceil>bs ! i * x + (hs ! i) x\<rceil> < \<lceil>x\<rceil>

goal (1 subgoal):
 1. nat \<lceil>bs ! i * x + (hs ! i) x\<rceil> < nat \<lceil>x\<rceil>
[PROOF STEP]
by (subst nat_mono_iff) simp_all
[PROOF STATE]
proof (state)
this:
nat \<lceil>bs ! i * x + (hs ! i) x\<rceil> < nat \<lceil>x\<rceil>

goal (1 subgoal):
 1. akra_bazzi_measure (bs ! i * x + (hs ! i) x) < akra_bazzi_measure x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
nat \<lceil>bs ! i * x + (hs ! i) x\<rceil> < nat \<lceil>x\<rceil>

goal (1 subgoal):
 1. akra_bazzi_measure (bs ! i * x + (hs ! i) x) < akra_bazzi_measure x
[PROOF STEP]
unfolding akra_bazzi_measure_def
[PROOF STATE]
proof (prove)
using this:
nat \<lceil>bs ! i * x + (hs ! i) x\<rceil> < nat \<lceil>x\<rceil>

goal (1 subgoal):
 1. nat \<lceil>bs ! i * x + (hs ! i) x\<rceil> < nat \<lceil>x\<rceil>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
akra_bazzi_measure (bs ! i * x + (hs ! i) x) < akra_bazzi_measure x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_contains_Inf_cl:
  fixes S :: "'a::{complete_linorder,linorder_topology,second_countable_topology} set"
  assumes "closed S"
    and "S \<noteq> {}"
  shows "Inf S \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf S \<in> S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf S \<in> S
[PROOF STEP]
from compact_eq_closed[of S] compact_attains_inf[of S] assms
[PROOF STATE]
proof (chain)
picking this:
compact S = closed S
\<lbrakk>compact S; S \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>s\<in>S. \<forall>t\<in>S. s \<le> t
closed S
S \<noteq> {}
[PROOF STEP]
obtain s where S: "s \<in> S" "\<forall>t\<in>S. s \<le> t"
[PROOF STATE]
proof (prove)
using this:
compact S = closed S
\<lbrakk>compact S; S \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>s\<in>S. \<forall>t\<in>S. s \<le> t
closed S
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>s \<in> S; \<forall>t\<in>S. s \<le> t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s \<in> S
\<forall>t\<in>S. s \<le> t

goal (1 subgoal):
 1. Inf S \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s \<in> S
\<forall>t\<in>S. s \<le> t
[PROOF STEP]
have "Inf S = s"
[PROOF STATE]
proof (prove)
using this:
s \<in> S
\<forall>t\<in>S. s \<le> t

goal (1 subgoal):
 1. Inf S = s
[PROOF STEP]
by (auto intro!: Inf_eqI)
[PROOF STATE]
proof (state)
this:
Inf S = s

goal (1 subgoal):
 1. Inf S \<in> S
[PROOF STEP]
with S
[PROOF STATE]
proof (chain)
picking this:
s \<in> S
\<forall>t\<in>S. s \<le> t
Inf S = s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s \<in> S
\<forall>t\<in>S. s \<le> t
Inf S = s

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infdist_union_min [mono_intros]:
  assumes "A \<noteq> {}" "B \<noteq> {}"
  shows "infdist x (A \<union> B) = min (infdist x A) (infdist x B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x (A \<union> B) = min (infdist x A) (infdist x B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
B \<noteq> {}

goal (1 subgoal):
 1. infdist x (A \<union> B) = min (infdist x A) (infdist x B)
[PROOF STEP]
by (simp add: infdist_def cINF_union inf_real_def)


[STATEMENT]
lemma ofsm_table_states :
  assumes "\<And> q . q \<in> states M \<Longrightarrow> f q \<subseteq> states M"
  and     "q \<in> states M"
shows  "ofsm_table M f k q \<subseteq> states M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ofsm_table M f k q \<subseteq> FSM.states M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ofsm_table M f k q \<subseteq> FSM.states M
[PROOF STEP]
have "ofsm_table M f k q \<subseteq> ofsm_table M f 0 q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ofsm_table M f k q \<subseteq> ofsm_table M f 0 q
[PROOF STEP]
using ofsm_table_subset[OF le0]
[PROOF STATE]
proof (prove)
using this:
ofsm_table ?M ?f ?j ?q \<subseteq> ofsm_table ?M ?f 0 ?q

goal (1 subgoal):
 1. ofsm_table M f k q \<subseteq> ofsm_table M f 0 q
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
ofsm_table M f k q \<subseteq> ofsm_table M f 0 q

goal (1 subgoal):
 1. ofsm_table M f k q \<subseteq> FSM.states M
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ofsm_table M f k q \<subseteq> ofsm_table M f 0 q

goal (1 subgoal):
 1. ofsm_table M f k q \<subseteq> FSM.states M
[PROOF STEP]
have "ofsm_table M f 0 q \<subseteq> states M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ofsm_table M f 0 q \<subseteq> FSM.states M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> f ?q \<subseteq> FSM.states M
q \<in> FSM.states M

goal (1 subgoal):
 1. ofsm_table M f 0 q \<subseteq> FSM.states M
[PROOF STEP]
unfolding ofsm_table.simps(1)
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> f ?q \<subseteq> FSM.states M
q \<in> FSM.states M

goal (1 subgoal):
 1. (if q \<in> FSM.states M then f q else {}) \<subseteq> FSM.states M
[PROOF STEP]
by (metis (full_types))
[PROOF STATE]
proof (state)
this:
ofsm_table M f 0 q \<subseteq> FSM.states M

goal (1 subgoal):
 1. ofsm_table M f k q \<subseteq> FSM.states M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ofsm_table M f k q \<subseteq> ofsm_table M f 0 q
ofsm_table M f 0 q \<subseteq> FSM.states M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ofsm_table M f k q \<subseteq> ofsm_table M f 0 q
ofsm_table M f 0 q \<subseteq> FSM.states M

goal (1 subgoal):
 1. ofsm_table M f k q \<subseteq> FSM.states M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ofsm_table M f k q \<subseteq> FSM.states M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem eq_fund_sym_poly_witI:
  fixes p :: "'a mpoly" and q :: "'a mpoly mpoly"
  assumes "finite A" "symmetric_mpoly A p"
          "insertion (sym_mpoly A) q = p"
          "\<And>m. vars (coeff q m) \<inter> A = {}"
          "vars q \<subseteq> {1..n}"
  shows   "q = fund_sym_poly_wit p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q = local.fund_sym_poly_wit p
[PROOF STEP]
using fund_sym_poly_wit_insertion[of p] fund_sym_poly_wit_vars[of p]
        fund_sym_poly_wit_coeffs[of p]
[PROOF STATE]
proof (prove)
using this:
symmetric_mpoly A p \<Longrightarrow> insertion (sym_mpoly A) (local.fund_sym_poly_wit p) = p
vars (local.fund_sym_poly_wit p) \<subseteq> {1..n}
symmetric_mpoly A p \<Longrightarrow> vars (MPoly_Type.coeff (local.fund_sym_poly_wit p) ?m) \<subseteq> vars p - A

goal (1 subgoal):
 1. q = local.fund_sym_poly_wit p
[PROOF STEP]
by (intro sym_mpoly_representation_unique)
     (insert assms, auto simp: fund_sym_poly_wit_insertion)


[STATEMENT]
lemma ceiling_le_neg_numeral [simp]: "\<lceil>x\<rceil> \<le> - numeral v \<longleftrightarrow> x \<le> - numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> \<le> - numeral v) = (x \<le> - numeral v)
[PROOF STEP]
by (simp add: ceiling_le_iff)


[STATEMENT]
lemma coupling_cond:
  assumes "coupling Q V D S"
  shows "(Q = Map.empty) \<longleftrightarrow> (\<forall>u. u\<notin>S \<longrightarrow> D u = \<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Q = Map.empty) = (\<forall>u. u \<notin> S \<longrightarrow> D u = \<infinity>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
coupling Q V D S

goal (1 subgoal):
 1. (Q = Map.empty) = (\<forall>u. u \<notin> S \<longrightarrow> D u = \<infinity>)
[PROOF STEP]
by (fastforce simp add: coupling_def)


[STATEMENT]
lemma mult_scalar_right_diff_distrib [algebra_simps]: "r \<odot> (p - q) = r \<odot> p - r \<odot> q"
  for r::"_ \<Rightarrow>\<^sub>0 'b::ring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<odot> (p - q) = r \<odot> p - r \<odot> q
[PROOF STEP]
using mult_scalar_distrib_left [of r p "- q"]
[PROOF STATE]
proof (prove)
using this:
r \<odot> (p + - q) = r \<odot> p + r \<odot> - q

goal (1 subgoal):
 1. r \<odot> (p - q) = r \<odot> p - r \<odot> q
[PROOF STEP]
by simp


[STATEMENT]
lemma UNC_I:
  "(\<And>a b. a \<in> NF A \<Longrightarrow> b \<in> NF A \<Longrightarrow> (a, b) \<in> A\<^sup>\<leftrightarrow>\<^sup>* \<Longrightarrow> a = b) \<Longrightarrow> UNC A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> NF A; b \<in> NF A; (a, b) \<in> A\<^sup>\<leftrightarrow>\<^sup>*\<rbrakk> \<Longrightarrow> a = b) \<Longrightarrow> UNC A
[PROOF STEP]
by (simp add: UNC_def)


[STATEMENT]
lemma sum_mset_eq_sum_on_supersets:
  assumes "finite A" "set_mset M \<subseteq> A"
  shows "(\<Sum>i\<in>set_mset M. count M i * i) = (\<Sum>i\<in>A. count M i * i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>set_mset M. count M i * i) = (\<Sum>i\<in>A. count M i * i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<in>set_mset M. count M i * i) = (\<Sum>i\<in>A. count M i * i)
[PROOF STEP]
note \<open>finite A\<close> \<open>set_mset M \<subseteq> A\<close>
[PROOF STATE]
proof (state)
this:
finite A
set_mset M \<subseteq> A

goal (1 subgoal):
 1. (\<Sum>i\<in>set_mset M. count M i * i) = (\<Sum>i\<in>A. count M i * i)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite A
set_mset M \<subseteq> A

goal (1 subgoal):
 1. (\<Sum>i\<in>set_mset M. count M i * i) = (\<Sum>i\<in>A. count M i * i)
[PROOF STEP]
have "\<forall>i\<in>A - set_mset M. count M i * i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>A - set_mset M. count M i * i = 0
[PROOF STEP]
using count_inI
[PROOF STATE]
proof (prove)
using this:
(count ?M ?x = 0 \<Longrightarrow> False) \<Longrightarrow> ?x \<in># ?M

goal (1 subgoal):
 1. \<forall>i\<in>A - set_mset M. count M i * i = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>A - set_mset M. count M i * i = 0

goal (1 subgoal):
 1. (\<Sum>i\<in>set_mset M. count M i * i) = (\<Sum>i\<in>A. count M i * i)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite A
set_mset M \<subseteq> A
\<forall>i\<in>A - set_mset M. count M i * i = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
set_mset M \<subseteq> A
\<forall>i\<in>A - set_mset M. count M i * i = 0

goal (1 subgoal):
 1. (\<Sum>i\<in>set_mset M. count M i * i) = (\<Sum>i\<in>A. count M i * i)
[PROOF STEP]
by (auto intro: sum.mono_neutral_cong_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>set_mset M. count M i * i) = (\<Sum>i\<in>A. count M i * i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monotone_if_bot:
  fixes bot
  assumes g: "\<And>x. g x = (if leq x bound then bot else f x)"
  and mono: "\<And>x y. \<lbrakk> leq x y; \<not> leq x bound \<rbrakk> \<Longrightarrow> ord (f x) (f y)"
  and bot: "\<And>x. \<not> leq x bound \<Longrightarrow> ord bot (f x)" "ord bot bot"
  shows "monotone leq ord g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone leq ord g
[PROOF STEP]
unfolding g[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone leq ord (\<lambda>x. if leq x bound then bot else f x)
[PROOF STEP]
using preorder mono bot
[PROOF STATE]
proof (prove)
using this:
class.preorder leq (mk_less leq)
\<lbrakk>leq ?x5 ?y5; \<not> leq ?x5 bound\<rbrakk> \<Longrightarrow> ord (f ?x5) (f ?y5)
\<not> leq ?x5 bound \<Longrightarrow> ord bot (f ?x5)
ord bot bot

goal (1 subgoal):
 1. monotone leq ord (\<lambda>x. if leq x bound then bot else f x)
[PROOF STEP]
by(rule preorder.monotone_if_bot)


[STATEMENT]
lemma real_floor_code [code]: "\<lfloor>Ratreal x\<rfloor> = \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>Ratreal x\<rfloor> = \<lfloor>x\<rfloor>
[PROOF STEP]
by (metis Ratreal_def floor_le_iff floor_unique le_floor_iff
      of_int_floor_le of_rat_of_int_eq real_less_eq_code)


[STATEMENT]
lemma negligible_divide_poly1:
  "\<lbrakk> f \<in> O(\<lambda>x. x powr n); negligible (\<lambda>\<eta>. 1 / g \<eta>) \<rbrakk> \<Longrightarrow> negligible (\<lambda>\<eta>. real (f \<eta>) / g \<eta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>x. real (f x)) \<in> O(\<lambda>x. real x powr n); negligible (\<lambda>\<eta>. 1 / g \<eta>)\<rbrakk> \<Longrightarrow> negligible (\<lambda>\<eta>. real (f \<eta>) / g \<eta>)
[PROOF STEP]
by(drule (1) negligible_times_poly) simp


[STATEMENT]
lemma Collect_disj_Un: "{f i |i. P i \<or> Q i} = {f i |i. P i} \<union> {f i |i. Q i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f i |i. P i \<or> Q i} = {f i |i. P i} \<union> {f i |i. Q i}
[PROOF STEP]
by auto


[STATEMENT]
lemma C_simp[simp]: "blinfun_apply (C x y) (dx, dy) =
  (dx * C11 x y + dy * C12 x y,
   dx * C21 x y + dy * C22 x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinfun_apply (C x y) (dx, dy) = (dx * C11 x y + dy * C12 x y, dx * C21 x y + dy * C22 x y)
[PROOF STEP]
by (auto simp: C_def blinfun_of_matrix_apply Basis_prod_def)


[STATEMENT]
lemma continuous_map_real_min [continuous_intros]:
   "\<lbrakk>continuous_map X euclideanreal f; continuous_map X euclideanreal g\<rbrakk>
   \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. min (f x) (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X euclideanreal f; continuous_map X euclideanreal g\<rbrakk> \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. min (f x) (g x))
[PROOF STEP]
by (simp add: continuous_map_atin tendsto_min)


[STATEMENT]
lemma ConjunctiveD:
  assumes "a \<in> Conjunctive"
  shows "times_abc a (Inf_b A) = Inf_c ((times_abc a) ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. times_abc a (Inf_b A) = Inf_c (times_abc a ` A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> Conjunctive

goal (1 subgoal):
 1. times_abc a (Inf_b A) = Inf_c (times_abc a ` A)
[PROOF STEP]
by (simp add: Conjunctive_def)


[STATEMENT]
lemma Cor_Plu_2_3:
  assumes K: "card (sumset A B) \<le> K * real (card A)"
    and   A: "finite A" "A \<subseteq> G" "A \<noteq> {}"
    and   B: "finite B" "B \<subseteq> G"
  obtains A' where "A' \<subseteq> A" "A' \<noteq> {}"
                   "\<And>r. card (sumset A' (sumset_iterated B r)) \<le> K^r * real (card A')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "B = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
B = {}

goal (2 subgoals):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "K \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> K
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real (card (sumset A B)) \<le> K * real (card A)
finite A
A \<subseteq> G
A \<noteq> {}
finite B
B \<subseteq> G

goal (1 subgoal):
 1. 0 \<le> K
[PROOF STEP]
by (simp add: True zero_le_mult_iff)
[PROOF STATE]
proof (state)
this:
0 \<le> K

goal (2 subgoals):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> K

goal (2 subgoals):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have *: "sumset_iterated B r = (if r=0 then {\<zero>} else {})" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset_iterated B r = (if r = 0 then {\<zero>} else {})
[PROOF STEP]
by (metis True sumset_iterated_0 sumset_iterated_empty zero_less_iff_neq_zero)
[PROOF STATE]
proof (state)
this:
sumset_iterated B ?r = (if ?r = 0 then {\<zero>} else {})

goal (2 subgoals):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 \<le> K
sumset_iterated B ?r = (if ?r = 0 then {\<zero>} else {})
[PROOF STEP]
have "real (card (sumset A (sumset_iterated B r)))
          \<le> K ^ r * real (card A)" for r
[PROOF STATE]
proof (prove)
using this:
0 \<le> K
sumset_iterated B ?r = (if ?r = 0 then {\<zero>} else {})

goal (1 subgoal):
 1. real (card (sumset A (sumset_iterated B r))) \<le> K ^ r * real (card A)
[PROOF STEP]
by (simp add: "*" Int_commute  Int_absorb2 \<open>A \<subseteq> G\<close>)
[PROOF STATE]
proof (state)
this:
real (card (sumset A (sumset_iterated B ?r))) \<le> K ^ ?r * real (card A)

goal (2 subgoals):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with \<open>A \<noteq> {}\<close> that
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
\<lbrakk>?A' \<subseteq> A; ?A' \<noteq> {}; \<And>r. real (card (sumset ?A' (sumset_iterated B r))) \<le> K ^ r * real (card ?A')\<rbrakk> \<Longrightarrow> thesis
real (card (sumset A (sumset_iterated B ?r))) \<le> K ^ ?r * real (card A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
\<lbrakk>?A' \<subseteq> A; ?A' \<noteq> {}; \<And>r. real (card (sumset ?A' (sumset_iterated B r))) \<le> K ^ r * real (card ?A')\<rbrakk> \<Longrightarrow> thesis
real (card (sumset A (sumset_iterated B ?r))) \<le> K ^ ?r * real (card A)

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

goal (1 subgoal):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
B \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain A' K'
    where A': "A' \<subseteq> A" "A' \<noteq> {}" "0 < K'" "K' \<le> K"
      and A'_card: "\<And>C. C \<subseteq> G \<Longrightarrow> finite C \<Longrightarrow> card (sumset A' (sumset B C)) \<le> K' * real (card(sumset A' C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A' K'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; 0 < K'; K' \<le> K; \<And>C. \<lbrakk>C \<subseteq> G; finite C\<rbrakk> \<Longrightarrow> real (card (sumset A' (sumset B C))) \<le> K' * real (card (sumset A' C))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis A B Plu_2_2 K False)
[PROOF STATE]
proof (state)
this:
A' \<subseteq> A
A' \<noteq> {}
0 < K'
K' \<le> K
\<lbrakk>?C \<subseteq> G; finite ?C\<rbrakk> \<Longrightarrow> real (card (sumset A' (sumset B ?C))) \<le> K' * real (card (sumset A' ?C))

goal (1 subgoal):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> G
A \<noteq> {}
A' \<subseteq> A
A' \<noteq> {}
0 < K'
K' \<le> K
\<lbrakk>?C \<subseteq> G; finite ?C\<rbrakk> \<Longrightarrow> real (card (sumset A' (sumset B ?C))) \<le> K' * real (card (sumset A' ?C))
[PROOF STEP]
have "A' \<subseteq> G"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> G
A \<noteq> {}
A' \<subseteq> A
A' \<noteq> {}
0 < K'
K' \<le> K
\<lbrakk>?C \<subseteq> G; finite ?C\<rbrakk> \<Longrightarrow> real (card (sumset A' (sumset B ?C))) \<le> K' * real (card (sumset A' ?C))

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

goal (1 subgoal):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have *: "card (sumset A' (sumset_iterated B (Suc r))) \<le> K' * card (sumset A' (sumset_iterated B r))"
          (is "?lhs \<le> ?rhs")
    for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
have "?lhs = card (sumset A' (sumset B (sumset_iterated B r)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) = real (card (sumset A' (sumset B (sumset_iterated B r))))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A' \<subseteq> A; ?A' \<noteq> {}; \<And>r. real (card (sumset ?A' (sumset_iterated B r))) \<le> K ^ r * real (card ?A')\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) = real (card (sumset A' (sumset B (sumset_iterated B r))))
[PROOF STEP]
by (simp add: sumset_iterated_r)
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B (Suc r)))) = real (card (sumset A' (sumset B (sumset_iterated B r))))

goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B (Suc r)))) = real (card (sumset A' (sumset B (sumset_iterated B r))))

goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
have "\<dots> \<le> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (sumset A' (sumset B (sumset_iterated B r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
using A'_card B finite_sumset_iterated sumset_iterated_subset_carrier
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?C \<subseteq> G; finite ?C\<rbrakk> \<Longrightarrow> real (card (sumset A' (sumset B ?C))) \<le> K' * real (card (sumset A' ?C))
finite B
B \<subseteq> G
finite ?A \<Longrightarrow> finite (sumset_iterated ?A ?r)
sumset_iterated ?A ?k \<subseteq> G

goal (1 subgoal):
 1. real (card (sumset A' (sumset B (sumset_iterated B r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset B (sumset_iterated B r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))

goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))

goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' * real (card (sumset A' (sumset_iterated B r)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B (Suc ?r)))) \<le> K' * real (card (sumset A' (sumset_iterated B ?r)))

goal (1 subgoal):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have **: "card (sumset A' (sumset_iterated B r)) \<le> K'^r * real (card A')" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A')
[PROOF STEP]
proof (induction r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real (card (sumset A' (sumset_iterated B 0))) \<le> K' ^ 0 * real (card A')
 2. \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A') \<Longrightarrow> real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' ^ Suc r * real (card A')
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. real (card (sumset A' (sumset_iterated B 0))) \<le> K' ^ 0 * real (card A')
 2. \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A') \<Longrightarrow> real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' ^ Suc r * real (card A')
[PROOF STEP]
with \<open>A' \<subseteq> G\<close>
[PROOF STATE]
proof (chain)
picking this:
A' \<subseteq> G
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A' \<subseteq> G

goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B 0))) \<le> K' ^ 0 * real (card A')
[PROOF STEP]
by (simp add: Int_absorb2)
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B 0))) \<le> K' ^ 0 * real (card A')

goal (1 subgoal):
 1. \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A') \<Longrightarrow> real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' ^ Suc r * real (card A')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A') \<Longrightarrow> real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' ^ Suc r * real (card A')
[PROOF STEP]
case (Suc r)
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A')

goal (1 subgoal):
 1. \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A') \<Longrightarrow> real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' ^ Suc r * real (card A')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A')
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real (card (sumset A' (sumset_iterated B r))) \<le> K' ^ r * real (card A')

goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' ^ Suc r * real (card A')
[PROOF STEP]
by (smt (verit) "*" \<open>0 < K'\<close> mult.commute mult.left_commute mult_le_cancel_left_pos power_Suc)
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B (Suc r)))) \<le> K' ^ Suc r * real (card A')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B ?r))) \<le> K' ^ ?r * real (card A')

goal (1 subgoal):
 1. \<lbrakk>\<And>A'. \<lbrakk>A' \<subseteq> A; A' \<noteq> {}; \<And>r. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')\<rbrakk> \<Longrightarrow> thesis; B \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?A' \<subseteq> A
 2. ?A' \<noteq> {}
 3. \<And>r. real (card (sumset ?A' (sumset_iterated B r))) \<le> K ^ r * real (card ?A')
[PROOF STEP]
show "real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card (sumset A' (sumset_iterated B r))) \<le> K ^ r * real (card A')
[PROOF STEP]
by (meson "**" A' order_trans less_eq_real_def mult_right_mono of_nat_0_le_iff power_mono)
[PROOF STATE]
proof (state)
this:
real (card (sumset A' (sumset_iterated B ?r))) \<le> K ^ ?r * real (card A')

goal (2 subgoals):
 1. A' \<subseteq> A
 2. A' \<noteq> {}
[PROOF STEP]
qed (use A' in auto)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nc_iff2: "x \<le> nc \<longleftrightarrow> x \<cdot> 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> nc) = (x \<cdot> (0::'a) = (0::'a))
[PROOF STEP]
using c_0 nc_iff1
[PROOF STATE]
proof (prove)
using this:
?x \<sqinter> 1\<^sub>\<pi> = ?x \<cdot> (0::'a)
(?x \<le> nc) = (?x \<sqinter> 1\<^sub>\<pi> = (0::'a))

goal (1 subgoal):
 1. (x \<le> nc) = (x \<cdot> (0::'a) = (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma Gramian_determinant_0 [simp]: "Gramian_determinant G 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gramian_determinant G 0 = (1::'b)
[PROOF STEP]
unfolding Gramian_determinant_def Gramian_matrix_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat 0 n (\<lambda>(i, y). G ! i $ y) * (mat 0 n (\<lambda>(i, y). G ! i $ y))\<^sup>T) = (1::'b)
[PROOF STEP]
by (simp add: times_mat_def)


[STATEMENT]
lemma fls_divide_nth_base:
  fixes f g :: "'a::division_ring fls"
  shows
    "(f div g) $$ (fls_subdegree f - fls_subdegree g) =
      f $$ fls_subdegree f / g $$ fls_subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f / g) $$ (fls_subdegree f - fls_subdegree g) = f $$ fls_subdegree f / g $$ fls_subdegree g
[PROOF STEP]
using fps_divide_nth_0'[of "fls_base_factor_to_fps g" "fls_base_factor_to_fps f"]
        fls_base_factor_to_fps_subdegree[of g]
[PROOF STATE]
proof (prove)
using this:
subdegree (fls_base_factor_to_fps g) = 0 \<Longrightarrow> (fls_base_factor_to_fps f / fls_base_factor_to_fps g) $ 0 = fls_base_factor_to_fps f $ 0 / fls_base_factor_to_fps g $ 0
subdegree (fls_base_factor_to_fps g) = 0

goal (1 subgoal):
 1. (f / g) $$ (fls_subdegree f - fls_subdegree g) = f $$ fls_subdegree f / g $$ fls_subdegree g
[PROOF STEP]
by    (simp add: fls_divide_def)


[STATEMENT]
lemma dconvfactor_convinv: "dconvfactor (convinv c) d = inverse (dconvfactor c d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dconvfactor (inv\<^sub>C c) d = inverse (dconvfactor c d)
[PROOF STEP]
by (simp add: dconvfactor_def intpow_inverse[THEN sym])


[STATEMENT]
lemma substs_preserve_finiteness :
  assumes "finite C"
  shows "finite (subst_cl C \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subst_cl C \<sigma>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (subst_cl C \<sigma>)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
finite C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite C

goal (1 subgoal):
 1. finite (subst_cl C \<sigma>)
[PROOF STEP]
using Finite_Set.finite_imageI
[PROOF STATE]
proof (prove)
using this:
finite C
finite ?F \<Longrightarrow> finite (?h ` ?F)

goal (1 subgoal):
 1. finite (subst_cl C \<sigma>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (subst_cl C \<sigma>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ldrop_enat_inf_llist:
  "ldrop (enat n) (inf_llist f) = inf_llist (\<lambda>m. f (m + n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ldrop (enat n) (inf_llist f) = inf_llist (\<lambda>m. f (m + n))
[PROOF STEP]
proof(induct n arbitrary: f)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. ldrop (enat 0) (inf_llist f) = inf_llist (\<lambda>m. f (m + 0))
 2. \<And>n f. (\<And>f. ldrop (enat n) (inf_llist f) = inf_llist (\<lambda>m. f (m + n))) \<Longrightarrow> ldrop (enat (Suc n)) (inf_llist f) = inf_llist (\<lambda>m. f (m + Suc n))
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
ldrop (enat n_) (inf_llist ?f) = inf_llist (\<lambda>m. ?f (m + n_))

goal (2 subgoals):
 1. \<And>f. ldrop (enat 0) (inf_llist f) = inf_llist (\<lambda>m. f (m + 0))
 2. \<And>n f. (\<And>f. ldrop (enat n) (inf_llist f) = inf_llist (\<lambda>m. f (m + n))) \<Longrightarrow> ldrop (enat (Suc n)) (inf_llist f) = inf_llist (\<lambda>m. f (m + Suc n))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
ldrop (enat n_) (inf_llist ?f) = inf_llist (\<lambda>m. ?f (m + n_))

goal (1 subgoal):
 1. ldrop (enat (Suc n_)) (inf_llist f) = inf_llist (\<lambda>m. f (m + Suc n_))
[PROOF STEP]
by(subst inf_llist_rec)(simp add: eSuc_enat[symmetric])
[PROOF STATE]
proof (state)
this:
ldrop (enat (Suc n_)) (inf_llist f) = inf_llist (\<lambda>m. f (m + Suc n_))

goal (1 subgoal):
 1. \<And>f. ldrop (enat 0) (inf_llist f) = inf_llist (\<lambda>m. f (m + 0))
[PROOF STEP]
qed(simp add: zero_enat_def[symmetric])