[STATEMENT]
theorem ring_monomorphism_iff_kernel_unit:
  "ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>' \<longleftrightarrow> additive.Ker = {\<zero>}" (is "?monom \<longleftrightarrow> ?ker")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>' = (additive.Ker = {\<zero>})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>' \<Longrightarrow> additive.Ker = {\<zero>}
 2. additive.Ker = {\<zero>} \<Longrightarrow> ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
assume ?monom
[PROOF STATE]
proof (state)
this:
ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'

goal (2 subgoals):
 1. ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>' \<Longrightarrow> additive.Ker = {\<zero>}
 2. additive.Ker = {\<zero>} \<Longrightarrow> ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
interpret ring_monomorphism
[PROOF STATE]
proof (prove)
using this:
ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'

goal (1 subgoal):
 1. ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>' \<Longrightarrow> additive.Ker = {\<zero>}
 2. additive.Ker = {\<zero>} \<Longrightarrow> ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
show ?ker
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. additive.Ker = {\<zero>}
[PROOF STEP]
by (simp add: additive.injective_iff_kernel_unit [symmetric])
[PROOF STATE]
proof (state)
this:
additive.Ker = {\<zero>}

goal (1 subgoal):
 1. additive.Ker = {\<zero>} \<Longrightarrow> ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. additive.Ker = {\<zero>} \<Longrightarrow> ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
assume ?ker
[PROOF STATE]
proof (state)
this:
additive.Ker = {\<zero>}

goal (1 subgoal):
 1. additive.Ker = {\<zero>} \<Longrightarrow> ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
additive.Ker = {\<zero>}
[PROOF STEP]
show ?monom
[PROOF STATE]
proof (prove)
using this:
additive.Ker = {\<zero>}

goal (1 subgoal):
 1. ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'
[PROOF STEP]
by unfold_locales (simp add: additive.injective_iff_kernel_unit)
[PROOF STATE]
proof (state)
this:
ring_monomorphism \<eta> R (+) (\<cdot>) \<zero> \<one> R' (+') (\<cdot>') \<zero>' \<one>'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma swaps_filtered: "swaps (filter (\<lambda>x. Suc x < length xs) ys) xs = swaps (ys) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaps (filter (\<lambda>x. Suc x < length xs) ys) xs = swaps ys xs
[PROOF STEP]
apply (induct ys)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. swaps (filter (\<lambda>x. Suc x < length xs) []) xs = swaps [] xs
 2. \<And>a ys. swaps (filter (\<lambda>x. Suc x < length xs) ys) xs = swaps ys xs \<Longrightarrow> swaps (filter (\<lambda>x. Suc x < length xs) (a # ys)) xs = swaps (a # ys) xs
[PROOF STEP]
by auto


[STATEMENT]
lemma Re_rcis [simp]: "Re(rcis r a) = r * cos a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (rcis r a) = r * cos a
[PROOF STEP]
by (simp add: rcis_def)


[STATEMENT]
lemma continuous_on_log[continuous_intros]:
  assumes "continuous_on s f" "continuous_on s g"
    and "\<forall>x\<in>s. 0 < f x" "\<forall>x\<in>s. f x \<noteq> 1" "\<forall>x\<in>s. 0 < g x"
  shows "continuous_on s (\<lambda>x. log (f x) (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on s (\<lambda>x. log (f x) (g x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on s f
continuous_on s g
\<forall>x\<in>s. 0 < f x
\<forall>x\<in>s. f x \<noteq> 1
\<forall>x\<in>s. 0 < g x

goal (1 subgoal):
 1. continuous_on s (\<lambda>x. log (f x) (g x))
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s)
\<forall>x\<in>s. (g \<longlongrightarrow> g x) (at x within s)
\<forall>x\<in>s. 0 < f x
\<forall>x\<in>s. f x \<noteq> 1
\<forall>x\<in>s. 0 < g x

goal (1 subgoal):
 1. \<forall>x\<in>s. ((\<lambda>x. log (f x) (g x)) \<longlongrightarrow> log (f x) (g x)) (at x within s)
[PROOF STEP]
by (fast intro: tendsto_log)


[STATEMENT]
lemma imperative_append: "VARS x y
 {x=X & y=Y}
 x := rev(x);
 WHILE x~=[]
 INV {rev(x)@y = X@Y}
 DO y := (hd x # y);
    x := tl x
 OD
 {y = X@Y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x = X \<and> y = Y}
x := rev x; WHILE x \<noteq> [] INV {rev x @ y = X @ Y}  VAR {0}
DO y := hd x # y; x := tl x OD
{y = X @ Y}
[PROOF STEP]
apply vcg_simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. rev x @ y = X @ Y \<and> x \<noteq> [] \<Longrightarrow> rev (tl x) @ hd x # y = X @ Y
[PROOF STEP]
apply(simp add: neq_Nil_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. rev x @ y = X @ Y \<and> (\<exists>y ys. x = y # ys) \<Longrightarrow> rev (tl x) @ hd x # y = X @ Y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subcocycle_bounded_by_birkhoff1:
  assumes "subcocycle u" "n > 0"
  shows "u n x \<le> birkhoff_sum (u 1) n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (u 1) n x
[PROOF STEP]
using \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (u 1) n x
[PROOF STEP]
proof (induction rule: ind_from_1)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u 1 x \<le> birkhoff_sum (u 1) 1 x
 2. \<And>n. \<lbrakk>0 < n; u n x \<le> birkhoff_sum (u 1) n x\<rbrakk> \<Longrightarrow> u (Suc n) x \<le> birkhoff_sum (u 1) (Suc n) x
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. u 1 x \<le> birkhoff_sum (u 1) 1 x
 2. \<And>n. \<lbrakk>0 < n; u n x \<le> birkhoff_sum (u 1) n x\<rbrakk> \<Longrightarrow> u (Suc n) x \<le> birkhoff_sum (u 1) (Suc n) x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u 1 x \<le> birkhoff_sum (u 1) 1 x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u 1 x \<le> birkhoff_sum (u 1) 1 x

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u n x \<le> birkhoff_sum (u 1) n x\<rbrakk> \<Longrightarrow> u (Suc n) x \<le> birkhoff_sum (u 1) (Suc n) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u n x \<le> birkhoff_sum (u 1) n x\<rbrakk> \<Longrightarrow> u (Suc n) x \<le> birkhoff_sum (u 1) (Suc n) x
[PROOF STEP]
case (Suc p)
[PROOF STATE]
proof (state)
this:
0 < p
u p x \<le> birkhoff_sum (u 1) p x

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u n x \<le> birkhoff_sum (u 1) n x\<rbrakk> \<Longrightarrow> u (Suc n) x \<le> birkhoff_sum (u 1) (Suc n) x
[PROOF STEP]
have "u (Suc p) x \<le> u p x + u 1 ((T^^p)x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (Suc p) x \<le> u p x + u 1 ((T ^^ p) x)
[PROOF STEP]
using assms(1) subcocycle_def
[PROOF STATE]
proof (prove)
using this:
subcocycle u
subcocycle ?u = ((\<forall>n. integrable M (?u n)) \<and> (\<forall>n m x. ?u (n + m) x \<le> ?u n x + ?u m ((T ^^ n) x)))

goal (1 subgoal):
 1. u (Suc p) x \<le> u p x + u 1 ((T ^^ p) x)
[PROOF STEP]
by (metis Suc_eq_plus1)
[PROOF STATE]
proof (state)
this:
u (Suc p) x \<le> u p x + u 1 ((T ^^ p) x)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u n x \<le> birkhoff_sum (u 1) n x\<rbrakk> \<Longrightarrow> u (Suc n) x \<le> birkhoff_sum (u 1) (Suc n) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u (Suc p) x \<le> u p x + u 1 ((T ^^ p) x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
u (Suc p) x \<le> u p x + u 1 ((T ^^ p) x)

goal (1 subgoal):
 1. u (Suc p) x \<le> birkhoff_sum (u 1) (Suc p) x
[PROOF STEP]
using Suc birkhoff_sum_cocycle[where ?n = p and ?m = 1] \<open> p>0 \<close>
[PROOF STATE]
proof (prove)
using this:
u (Suc p) x \<le> u p x + u 1 ((T ^^ p) x)
0 < p
u p x \<le> birkhoff_sum (u 1) p x
birkhoff_sum ?f (p + 1) ?x = birkhoff_sum ?f p ?x + birkhoff_sum ?f 1 ((T ^^ p) ?x)
0 < p

goal (1 subgoal):
 1. u (Suc p) x \<le> birkhoff_sum (u 1) (Suc p) x
[PROOF STEP]
by (simp add: birkhoff_sum_def)
[PROOF STATE]
proof (state)
this:
u (Suc p) x \<le> birkhoff_sum (u 1) (Suc p) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem infinite_UNIV_option [simp]:
"infinite (UNIV :: 'a set) \<Longrightarrow>
 infinite (UNIV :: 'a option set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV \<Longrightarrow> infinite UNIV
[PROOF STEP]
apply (erule contrapos_nn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> finite UNIV
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma less_oLimitD: "x < oLimit f \<Longrightarrow> \<exists>n. x < f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < oLimit f \<Longrightarrow> \<exists>n. x < f n
[PROOF STEP]
apply (unfold oLimit_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < (LEAST k. \<forall>n. f n \<le> k) \<Longrightarrow> \<exists>n. x < f n
[PROOF STEP]
apply (drule not_less_Least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>n. f n \<le> x) \<Longrightarrow> \<exists>n. x < f n
[PROOF STEP]
apply (simp add: linorder_not_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma create_unique_indiff_using_distinct_best_worst:
  assumes "l \<in> \
"
  assumes "b \<in> best"
  assumes "w \<in> worst"
  assumes "b \<succ>[\<R>] w"
  shows "\<exists>!\<alpha> \<in>{0..1}. l \<approx>[\<R>] mix_pmf \<alpha> b w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w
[PROOF STEP]
have "b \<succeq>[\<R>] l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<succeq>[\<R>] l
[PROOF STEP]
using best_def
[PROOF STATE]
proof (prove)
using this:
best = {x \<in> local.\
. \<forall>y\<in>local.\
. x \<succeq>[\<R>] y}

goal (1 subgoal):
 1. b \<succeq>[\<R>] l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
best = {x \<in> local.\
. \<forall>y\<in>local.\
. x \<succeq>[\<R>] y}
l \<in> local.\

b \<in> best
w \<in> worst
b \<succeq>[\<R>] w \<and> (w, b) \<notin> \<R>

goal (1 subgoal):
 1. b \<succeq>[\<R>] l
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<succeq>[\<R>] l

goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
b \<succeq>[\<R>] l

goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w
[PROOF STEP]
have "l \<succeq>[\<R>] w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<succeq>[\<R>] w
[PROOF STEP]
using worst_def assms
[PROOF STATE]
proof (prove)
using this:
worst = {x \<in> local.\
. \<forall>y\<in>local.\
. y \<succeq>[\<R>] x}
l \<in> local.\

b \<in> best
w \<in> worst
b \<succeq>[\<R>] w \<and> (w, b) \<notin> \<R>

goal (1 subgoal):
 1. l \<succeq>[\<R>] w
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
l \<succeq>[\<R>] w

goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
b \<succeq>[\<R>] l
l \<succeq>[\<R>] w
[PROOF STEP]
show "\<exists>!\<alpha>\<in>{0..1}. l \<approx>[\<R>] mix_pmf \<alpha> b w"
[PROOF STATE]
proof (prove)
using this:
b \<succeq>[\<R>] l
l \<succeq>[\<R>] w

goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w
[PROOF STEP]
using step_2_unique_continuous_unfolding[of b l w] assms
[PROOF STATE]
proof (prove)
using this:
b \<succeq>[\<R>] l
l \<succeq>[\<R>] w
\<lbrakk>b \<succeq>[\<R>] l; l \<succeq>[\<R>] w; b \<succeq>[\<R>] w \<and> (w, b) \<notin> \<R>\<rbrakk> \<Longrightarrow> \<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w
l \<in> local.\

b \<in> best
w \<in> worst
b \<succeq>[\<R>] w \<and> (w, b) \<notin> \<R>

goal (1 subgoal):
 1. \<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<exists>!\<alpha>. \<alpha> \<in> {0..1} \<and> l \<approx>[\<R>] mix_pmf \<alpha> b w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complement_index_2:
  assumes "{x, y} \<subseteq> \<V>"
  shows "\<B>\<^sup>C index {x, y} = size {# b \<in># \<B> . x \<notin> b \<and> y \<notin> b #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B>\<^sup>C index {x, y} = size {#b \<in># \<B>. x \<notin> b \<and> y \<notin> b#}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<B>\<^sup>C index {x, y} = size {#b \<in># \<B>. x \<notin> b \<and> y \<notin> b#}
[PROOF STEP]
have a: "\<And> b. b \<in># \<B> \<Longrightarrow> \<forall> x' \<in> {x, y} . x' \<notin> b \<Longrightarrow> x \<notin> b \<and> y \<notin> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<lbrakk>b \<in># \<B>; \<forall>x'\<in>{x, y}. x' \<notin> b\<rbrakk> \<Longrightarrow> x \<notin> b \<and> y \<notin> b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b \<in># \<B>; \<forall>x'\<in>{x, y}. x' \<notin> ?b\<rbrakk> \<Longrightarrow> x \<notin> ?b \<and> y \<notin> ?b

goal (1 subgoal):
 1. \<B>\<^sup>C index {x, y} = size {#b \<in># \<B>. x \<notin> b \<and> y \<notin> b#}
[PROOF STEP]
have "\<And> b. b \<in># \<B> \<Longrightarrow> x \<notin> b \<and> y \<notin> b \<Longrightarrow> \<forall> x' \<in> {x, y} . x' \<notin> b "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<lbrakk>b \<in># \<B>; x \<notin> b \<and> y \<notin> b\<rbrakk> \<Longrightarrow> \<forall>x'\<in>{x, y}. x' \<notin> b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b \<in># \<B>; x \<notin> ?b \<and> y \<notin> ?b\<rbrakk> \<Longrightarrow> \<forall>x'\<in>{x, y}. x' \<notin> ?b

goal (1 subgoal):
 1. \<B>\<^sup>C index {x, y} = size {#b \<in># \<B>. x \<notin> b \<and> y \<notin> b#}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b \<in># \<B>; x \<notin> ?b \<and> y \<notin> ?b\<rbrakk> \<Longrightarrow> \<forall>x'\<in>{x, y}. x' \<notin> ?b

goal (1 subgoal):
 1. \<B>\<^sup>C index {x, y} = size {#b \<in># \<B>. x \<notin> b \<and> y \<notin> b#}
[PROOF STEP]
using assms a complement_index
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b \<in># \<B>; x \<notin> ?b \<and> y \<notin> ?b\<rbrakk> \<Longrightarrow> \<forall>x'\<in>{x, y}. x' \<notin> ?b
{x, y} \<subseteq> \<V>
\<lbrakk>?b \<in># \<B>; \<forall>x'\<in>{x, y}. x' \<notin> ?b\<rbrakk> \<Longrightarrow> x \<notin> ?b \<and> y \<notin> ?b
?ps \<subseteq> \<V> \<Longrightarrow> \<B>\<^sup>C index ?ps = size {#b \<in># \<B>. \<forall>x\<in>?ps. x \<notin> b#}

goal (1 subgoal):
 1. \<B>\<^sup>C index {x, y} = size {#b \<in># \<B>. x \<notin> b \<and> y \<notin> b#}
[PROOF STEP]
by (smt (verit) filter_mset_cong)
[PROOF STATE]
proof (state)
this:
\<B>\<^sup>C index {x, y} = size {#b \<in># \<B>. x \<notin> b \<and> y \<notin> b#}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma algebraic_prod_mset [intro]:
  "(\<And>x. x \<in># A \<Longrightarrow> algebraic x) \<Longrightarrow> algebraic (prod_mset A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in># A \<Longrightarrow> algebraic x) \<Longrightarrow> algebraic (\<Prod>\<^sub># A)
[PROOF STEP]
by (induction A) (auto intro!: algebraic_times)


[STATEMENT]
lemma keys_sum:
  assumes "finite A" and "\<And>a1 a2. a1 \<in> A \<Longrightarrow> a2 \<in> A \<Longrightarrow> a1 \<noteq> a2 \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}"
  shows "keys (sum f A) = (\<Union>a\<in>A. keys (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (sum f A) = (\<Union>a\<in>A. keys (f a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
\<lbrakk>?a1.0 \<in> A; ?a2.0 \<in> A; ?a1.0 \<noteq> ?a2.0\<rbrakk> \<Longrightarrow> keys (f ?a1.0) \<inter> keys (f ?a2.0) = {}

goal (1 subgoal):
 1. keys (sum f A) = (\<Union>a\<in>A. keys (f a))
[PROOF STEP]
proof (induct A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>a1 a2. \<lbrakk>a1 \<in> {}; a2 \<in> {}; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f {}) = (\<Union>a\<in>{}. keys (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a1.0 \<in> {}; ?a2.0 \<in> {}; ?a1.0 \<noteq> ?a2.0\<rbrakk> \<Longrightarrow> keys (f ?a1.0) \<inter> keys (f ?a2.0) = {}

goal (2 subgoals):
 1. (\<And>a1 a2. \<lbrakk>a1 \<in> {}; a2 \<in> {}; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f {}) = (\<Union>a\<in>{}. keys (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (sum f {}) = (\<Union>a\<in>{}. keys (f a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
keys (sum f {}) = (\<Union>a\<in>{}. keys (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
case (insert a A)
[PROOF STATE]
proof (state)
this:
finite A
a \<notin> A
(\<And>a1 a2. \<lbrakk>a1 \<in> A; a2 \<in> A; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f A) = (\<Union>a\<in>A. keys (f a))
\<lbrakk>?a1.0 \<in> insert a A; ?a2.0 \<in> insert a A; ?a1.0 \<noteq> ?a2.0\<rbrakk> \<Longrightarrow> keys (f ?a1.0) \<inter> keys (f ?a2.0) = {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
have IH: "keys (sum f A) = (\<Union>i\<in>A. keys (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (sum f A) = (\<Union>i\<in>A. keys (f i))
[PROOF STEP]
by (rule insert(3), rule insert.prems, simp_all)
[PROOF STATE]
proof (state)
this:
keys (sum f A) = (\<Union>i\<in>A. keys (f i))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
have "keys (sum f (insert a A)) = keys (f a) \<union> keys (sum f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (sum f (insert a A)) = keys (f a) \<union> keys (sum f A)
[PROOF STEP]
proof (simp only: comm_monoid_add_class.sum.insert[OF insert(1) insert(2)], rule keys_add[symmetric])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. keys (f a) \<inter> keys (sum f A) = {}
[PROOF STEP]
have "keys (f a) \<inter> keys (sum f A) = (\<Union>i\<in>A. keys (f a) \<inter> keys (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (f a) \<inter> keys (sum f A) = (\<Union>i\<in>A. keys (f a) \<inter> keys (f i))
[PROOF STEP]
by (simp only: IH Int_UN_distrib)
[PROOF STATE]
proof (state)
this:
keys (f a) \<inter> keys (sum f A) = (\<Union>i\<in>A. keys (f a) \<inter> keys (f i))

goal (1 subgoal):
 1. keys (f a) \<inter> keys (sum f A) = {}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
keys (f a) \<inter> keys (sum f A) = (\<Union>i\<in>A. keys (f a) \<inter> keys (f i))

goal (1 subgoal):
 1. keys (f a) \<inter> keys (sum f A) = {}
[PROOF STEP]
have "... = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i\<in>A. keys (f a) \<inter> keys (f i)) = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>i\<in>A. keys (f a) \<inter> keys (f i)) = {}
[PROOF STEP]
have "i \<in> A \<Longrightarrow> keys (f a) \<inter> keys (f i) = {}" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> A \<Longrightarrow> keys (f a) \<inter> keys (f i) = {}
[PROOF STEP]
proof (rule insert.prems)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. i \<in> A \<Longrightarrow> a \<in> insert a A
 2. i \<in> A \<Longrightarrow> i \<in> insert a A
 3. i \<in> A \<Longrightarrow> a \<noteq> i
[PROOF STEP]
assume "i \<in> A"
[PROOF STATE]
proof (state)
this:
i \<in> A

goal (3 subgoals):
 1. i \<in> A \<Longrightarrow> a \<in> insert a A
 2. i \<in> A \<Longrightarrow> i \<in> insert a A
 3. i \<in> A \<Longrightarrow> a \<noteq> i
[PROOF STEP]
with insert(2)
[PROOF STATE]
proof (chain)
picking this:
a \<notin> A
i \<in> A
[PROOF STEP]
show "a \<noteq> i"
[PROOF STATE]
proof (prove)
using this:
a \<notin> A
i \<in> A

goal (1 subgoal):
 1. a \<noteq> i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<noteq> i

goal (2 subgoals):
 1. i \<in> A \<Longrightarrow> a \<in> insert a A
 2. i \<in> A \<Longrightarrow> i \<in> insert a A
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
?i \<in> A \<Longrightarrow> keys (f a) \<inter> keys (f ?i) = {}

goal (1 subgoal):
 1. (\<Union>i\<in>A. keys (f a) \<inter> keys (f i)) = {}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?i \<in> A \<Longrightarrow> keys (f a) \<inter> keys (f ?i) = {}

goal (1 subgoal):
 1. (\<Union>i\<in>A. keys (f a) \<inter> keys (f i)) = {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Union>i\<in>A. keys (f a) \<inter> keys (f i)) = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Union>i\<in>A. keys (f a) \<inter> keys (f i)) = {}

goal (1 subgoal):
 1. keys (f a) \<inter> keys (sum f A) = {}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
keys (f a) \<inter> keys (sum f A) = {}
[PROOF STEP]
show "keys (f a) \<inter> keys (sum f A) = {}"
[PROOF STATE]
proof (prove)
using this:
keys (f a) \<inter> keys (sum f A) = {}

goal (1 subgoal):
 1. keys (f a) \<inter> keys (sum f A) = {}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
keys (f a) \<inter> keys (sum f A) = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
keys (sum f (insert a A)) = keys (f a) \<union> keys (sum f A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
keys (sum f (insert a A)) = keys (f a) \<union> keys (sum f A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
have "... = (\<Union>a\<in>insert a A. keys (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (f a) \<union> keys (sum f A) = (\<Union>a\<in>insert a A. keys (f a))
[PROOF STEP]
by (simp add: IH)
[PROOF STATE]
proof (state)
this:
keys (f a) \<union> keys (sum f A) = (\<Union>a\<in>insert a A. keys (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a1 a2. \<lbrakk>a1 \<in> F; a2 \<in> F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}) \<Longrightarrow> keys (sum f F) = (\<Union>a\<in>F. keys (f a)); \<And>a1 a2. \<lbrakk>a1 \<in> insert x F; a2 \<in> insert x F; a1 \<noteq> a2\<rbrakk> \<Longrightarrow> keys (f a1) \<inter> keys (f a2) = {}\<rbrakk> \<Longrightarrow> keys (sum f (insert x F)) = (\<Union>a\<in>insert x F. keys (f a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
keys (sum f (insert a A)) = (\<Union>a\<in>insert a A. keys (f a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
keys (sum f (insert a A)) = (\<Union>a\<in>insert a A. keys (f a))

goal (1 subgoal):
 1. keys (sum f (insert a A)) = (\<Union>a\<in>insert a A. keys (f a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
keys (sum f (insert a A)) = (\<Union>a\<in>insert a A. keys (f a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closedin_Union_locally_finite_closure:
   "locally_finite_in X \<A> \<Longrightarrow> closedin X (\<Union>((\<lambda>S. X closure_of S) ` \<A>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_finite_in X \<A> \<Longrightarrow> closedin X (\<Union> ((closure_of) X ` \<A>))
[PROOF STEP]
by (metis (mono_tags) closedin_closure_of closedin_locally_finite_Union imageE locally_finite_in_closure)


[STATEMENT]
lemma closed_imp_rtrancl_closed: assumes L: "L \<subseteq> A"
  and R: "R `` A \<subseteq> A"
  shows "{t | s. s \<in> L \<and> (s,t) \<in> R^*} \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A
[PROOF STEP]
fix s t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A
[PROOF STEP]
assume "(s,t) \<in> R^*" and "s \<in> L"
[PROOF STATE]
proof (state)
this:
(s, t) \<in> R\<^sup>*
s \<in> L

goal (1 subgoal):
 1. {uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A
[PROOF STEP]
hence "t \<in> A"
[PROOF STATE]
proof (prove)
using this:
(s, t) \<in> R\<^sup>*
s \<in> L

goal (1 subgoal):
 1. t \<in> A
[PROOF STEP]
by (induct, insert L R, auto)
[PROOF STATE]
proof (state)
this:
t \<in> A

goal (1 subgoal):
 1. {uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>(?s2, ?ta2) \<in> R\<^sup>*; ?s2 \<in> L\<rbrakk> \<Longrightarrow> ?ta2 \<in> A

goal (1 subgoal):
 1. {uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?s2, ?ta2) \<in> R\<^sup>*; ?s2 \<in> L\<rbrakk> \<Longrightarrow> ?ta2 \<in> A

goal (1 subgoal):
 1. {uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{uu_. \<exists>s. uu_ = t \<and> s \<in> L \<and> (s, t) \<in> R\<^sup>*} \<subseteq> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_circle_fix_preserve_is_poincare_line_iff [simp]:
  assumes "unit_circle_fix M"
  shows "is_poincare_line (moebius_circline M H) \<longleftrightarrow> is_poincare_line H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poincare_line (moebius_circline M H) = is_poincare_line H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M

goal (1 subgoal):
 1. is_poincare_line (moebius_circline M H) = is_poincare_line H
[PROOF STEP]
using unit_circle_fix_preserve_is_poincare_line[of M H]
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
\<lbrakk>unit_circle_fix M; is_poincare_line H\<rbrakk> \<Longrightarrow> is_poincare_line (moebius_circline M H)

goal (1 subgoal):
 1. is_poincare_line (moebius_circline M H) = is_poincare_line H
[PROOF STEP]
using unit_circle_fix_preserve_is_poincare_line[of "moebius_inv M" "moebius_circline M H"]
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
\<lbrakk>unit_circle_fix M; is_poincare_line H\<rbrakk> \<Longrightarrow> is_poincare_line (moebius_circline M H)
\<lbrakk>unit_circle_fix (moebius_inv M); is_poincare_line (moebius_circline M H)\<rbrakk> \<Longrightarrow> is_poincare_line (moebius_circline (moebius_inv M) (moebius_circline M H))

goal (1 subgoal):
 1. is_poincare_line (moebius_circline M H) = is_poincare_line H
[PROOF STEP]
by (auto simp del: unit_circle_fix_preserve_is_poincare_line)


[STATEMENT]
lemma pochhammer_of_nat: "pochhammer (of_nat x) n = of_nat (pochhammer x n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (of_nat x) n = of_nat (pochhammer x n)
[PROOF STEP]
by (simp add: pochhammer_prod Factorial.pochhammer_prod)


[STATEMENT]
lemma inorder_balR:
  "inorder (balR l a r) = inorder l @ a # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tree2.inorder (balR l a r) = Tree2.inorder l @ a # Tree2.inorder r
[PROOF STEP]
by (auto simp: node_def balR_def split:tree.splits)


[STATEMENT]
lemma lset_ltake_prefix [simp]: "n \<le> m \<Longrightarrow> lset (ltake n xs) \<subseteq> lset (ltake m xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m \<Longrightarrow> lset (ltake n xs) \<subseteq> lset (ltake m xs)
[PROOF STEP]
by (simp add: lprefix_lsetD)


[STATEMENT]
lemma enn2real_1[simp]: "enn2real 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real 1 = 1
[PROOF STEP]
unfolding enn2real_def one_ennreal.rep_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal 1 = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma eq_fin_lproject_visible:
      assumes "u =\<^sub>F v"
      shows "lproject visible (llist_of u) = lproject visible (llist_of v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lproject visible (llist_of u) = lproject visible (llist_of v)
[PROOF STEP]
using assms eq_swap_lproject_visible
[PROOF STATE]
proof (prove)
using this:
u =\<^sub>F v
?u =\<^sub>S ?v \<Longrightarrow> lproject visible (llist_of ?u) = lproject visible (llist_of ?v)

goal (1 subgoal):
 1. lproject visible (llist_of u) = lproject visible (llist_of v)
[PROOF STEP]
by (induct, auto)


[STATEMENT]
theorem strong_fusion: "\<exists>x. F x \<Longrightarrow>
  \<exists>x. (\<forall>y. F y \<longrightarrow> P y x) \<and> (\<forall>y. P y x \<longrightarrow> (\<exists>z. F z \<and> O y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. F x \<Longrightarrow> \<exists>x. (\<forall>y. F y \<longrightarrow> P y x) \<and> (\<forall>y. P y x \<longrightarrow> (\<exists>z. F z \<and> O y z))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. F x \<Longrightarrow> \<exists>x. (\<forall>y. F y \<longrightarrow> P y x) \<and> (\<forall>y. P y x \<longrightarrow> (\<exists>z. F z \<and> O y z))
[PROOF STEP]
assume "\<exists>x. F x"
[PROOF STATE]
proof (state)
this:
\<exists>x. F x

goal (1 subgoal):
 1. \<exists>x. F x \<Longrightarrow> \<exists>x. (\<forall>y. F y \<longrightarrow> P y x) \<and> (\<forall>y. P y x \<longrightarrow> (\<exists>z. F z \<and> O y z))
[PROOF STEP]
have "(\<forall>y. F y \<longrightarrow> P y (\<sigma> v. F v)) \<and>
     (\<forall>y. P y (\<sigma> v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y. F y \<longrightarrow> P y (\<sigma>v. F v)) \<and> (\<forall>y. P y (\<sigma>v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>y. F y \<longrightarrow> P y (\<sigma>v. F v)
 2. \<forall>y. P y (\<sigma>v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z)
[PROOF STEP]
show "\<forall>y. F y \<longrightarrow> P y (\<sigma> v. F v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. F y \<longrightarrow> P y (\<sigma>v. F v)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. F y \<longrightarrow> P y (\<sigma>v. F v)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. F y \<longrightarrow> P y (\<sigma>v. F v)
[PROOF STEP]
show "F y \<longrightarrow> P y (\<sigma> v. F v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F y \<longrightarrow> P y (\<sigma>v. F v)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F y \<Longrightarrow> P y (\<sigma>v. F v)
[PROOF STEP]
assume "F y"
[PROOF STATE]
proof (state)
this:
F y

goal (1 subgoal):
 1. F y \<Longrightarrow> P y (\<sigma>v. F v)
[PROOF STEP]
thus "P y (\<sigma> v. F v)"
[PROOF STATE]
proof (prove)
using this:
F y

goal (1 subgoal):
 1. P y (\<sigma>v. F v)
[PROOF STEP]
by (rule fusion_part)
[PROOF STATE]
proof (state)
this:
P y (\<sigma>v. F v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
F y \<longrightarrow> P y (\<sigma>v. F v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y. F y \<longrightarrow> P y (\<sigma>v. F v)

goal (1 subgoal):
 1. \<forall>y. P y (\<sigma>v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>y. P y (\<sigma>v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z)
[PROOF STEP]
have "(\<forall>y. P y (\<sigma> v. F v) \<longleftrightarrow>
      (\<forall>w. P w y \<longrightarrow> (\<exists>v. F v \<and> O w v)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. P y (\<sigma>v. F v) = (\<forall>w. P w y \<longrightarrow> (\<exists>v. F v \<and> O w v))
[PROOF STEP]
using \<open>\<exists>x. F x\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>x. F x

goal (1 subgoal):
 1. \<forall>y. P y (\<sigma>v. F v) = (\<forall>w. P w y \<longrightarrow> (\<exists>v. F v \<and> O w v))
[PROOF STEP]
by (rule fusion_part_character)
[PROOF STATE]
proof (state)
this:
\<forall>y. P y (\<sigma>v. F v) = (\<forall>w. P w y \<longrightarrow> (\<exists>v. F v \<and> O w v))

goal (1 subgoal):
 1. \<forall>y. P y (\<sigma>v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z)
[PROOF STEP]
hence "P (\<sigma> v. F v) (\<sigma> v. F v) \<longleftrightarrow> (\<forall>w. P w (\<sigma> v. F v) \<longrightarrow>
      (\<exists>v. F v \<and> O w v))"
[PROOF STATE]
proof (prove)
using this:
\<forall>y. P y (\<sigma>v. F v) = (\<forall>w. P w y \<longrightarrow> (\<exists>v. F v \<and> O w v))

goal (1 subgoal):
 1. P (\<sigma>v. F v) (\<sigma>v. F v) = (\<forall>w. P w (\<sigma>v. F v) \<longrightarrow> (\<exists>v. F v \<and> O w v))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
P (\<sigma>v. F v) (\<sigma>v. F v) = (\<forall>w. P w (\<sigma>v. F v) \<longrightarrow> (\<exists>v. F v \<and> O w v))

goal (1 subgoal):
 1. \<forall>y. P y (\<sigma>v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z)
[PROOF STEP]
thus "\<forall>w. P w (\<sigma> v. F v) \<longrightarrow> (\<exists>v. F v \<and> O w v)"
[PROOF STATE]
proof (prove)
using this:
P (\<sigma>v. F v) (\<sigma>v. F v) = (\<forall>w. P w (\<sigma>v. F v) \<longrightarrow> (\<exists>v. F v \<and> O w v))

goal (1 subgoal):
 1. \<forall>w. P w (\<sigma>v. F v) \<longrightarrow> (\<exists>v. F v \<and> O w v)
[PROOF STEP]
using part_reflexivity
[PROOF STATE]
proof (prove)
using this:
P (\<sigma>v. F v) (\<sigma>v. F v) = (\<forall>w. P w (\<sigma>v. F v) \<longrightarrow> (\<exists>v. F v \<and> O w v))
P ?x ?x

goal (1 subgoal):
 1. \<forall>w. P w (\<sigma>v. F v) \<longrightarrow> (\<exists>v. F v \<and> O w v)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>w. P w (\<sigma>v. F v) \<longrightarrow> (\<exists>v. F v \<and> O w v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>y. F y \<longrightarrow> P y (\<sigma>v. F v)) \<and> (\<forall>y. P y (\<sigma>v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z))

goal (1 subgoal):
 1. \<exists>x. F x \<Longrightarrow> \<exists>x. (\<forall>y. F y \<longrightarrow> P y x) \<and> (\<forall>y. P y x \<longrightarrow> (\<exists>z. F z \<and> O y z))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>y. F y \<longrightarrow> P y (\<sigma>v. F v)) \<and> (\<forall>y. P y (\<sigma>v. F v) \<longrightarrow> (\<exists>z. F z \<and> O y z))

goal (1 subgoal):
 1. \<exists>x. (\<forall>y. F y \<longrightarrow> P y x) \<and> (\<forall>y. P y x \<longrightarrow> (\<exists>z. F z \<and> O y z))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>x. (\<forall>y. F y \<longrightarrow> P y x) \<and> (\<forall>y. P y x \<longrightarrow> (\<exists>z. F z \<and> O y z))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalize_poly_spec_alt_def:
  \<open>normalize_poly_spec p = SPEC (\<lambda>r. r - p \<in> ideal polynomial_bool \<and> vars r \<subseteq> vars p)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize_poly_spec p = SPEC (\<lambda>r. r - p \<in> More_Modules.ideal polynomial_bool \<and> vars r \<subseteq> vars p)
[PROOF STEP]
unfolding normalize_poly_spec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SPEC (\<lambda>r. p - r \<in> More_Modules.ideal polynomial_bool \<and> vars r \<subseteq> vars p) = SPEC (\<lambda>r. r - p \<in> More_Modules.ideal polynomial_bool \<and> vars r \<subseteq> vars p)
[PROOF STEP]
by (auto dest: ideal.span_neg)


[STATEMENT]
lemma connectedin_connected_component_of:
   "connectedin X (connected_component_of_set X x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connectedin X (connected_component_of_set X x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. connectedin X (connected_component_of_set X x)
[PROOF STEP]
have "connected_component_of_set X x = \<Union> {T. connectedin X T \<and> x \<in> T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_component_of_set X x = \<Union> {T. connectedin X T \<and> x \<in> T}
[PROOF STEP]
by (auto simp: connected_component_of_def)
[PROOF STATE]
proof (state)
this:
connected_component_of_set X x = \<Union> {T. connectedin X T \<and> x \<in> T}

goal (1 subgoal):
 1. connectedin X (connected_component_of_set X x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
connected_component_of_set X x = \<Union> {T. connectedin X T \<and> x \<in> T}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
connected_component_of_set X x = \<Union> {T. connectedin X T \<and> x \<in> T}

goal (1 subgoal):
 1. connectedin X (connected_component_of_set X x)
[PROOF STEP]
apply (rule ssubst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connectedin X (\<Union> {T. connectedin X T \<and> x \<in> T})
[PROOF STEP]
by (blast intro: connectedin_Union)
[PROOF STATE]
proof (state)
this:
connectedin X (connected_component_of_set X x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filtermap_exp_at_top: "filtermap (exp::real \<Rightarrow> real) at_top = at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap exp at_top = at_top
[PROOF STEP]
by (intro filtermap_fun_inverse[of ln] exp_at_top ln_at_top)
     (auto simp: eventually_at_top_dense)


[STATEMENT]
lemma bf_ifex_eq: "(af, at) \<in> bf_ifex_rel \<Longrightarrow> (bf, bt) \<in> bf_ifex_rel \<Longrightarrow> (af = bf) \<longleftrightarrow> (at = bt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(af, at) \<in> bf_ifex_rel; (bf, bt) \<in> bf_ifex_rel\<rbrakk> \<Longrightarrow> (af = bf) = (at = bt)
[PROOF STEP]
unfolding bf_ifex_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(af, at) \<in> {(a, b). (\<forall>ass. a ass = val_ifex b ass) \<and> ro_ifex b}; (bf, bt) \<in> {(a, b). (\<forall>ass. a ass = val_ifex b ass) \<and> ro_ifex b}\<rbrakk> \<Longrightarrow> (af = bf) = (at = bt)
[PROOF STEP]
using ro_ifex_unique
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ro_ifex ?x; ro_ifex ?y; \<And>ass. val_ifex ?x ass = val_ifex ?y ass\<rbrakk> \<Longrightarrow> ?x = ?y

goal (1 subgoal):
 1. \<lbrakk>(af, at) \<in> {(a, b). (\<forall>ass. a ass = val_ifex b ass) \<and> ro_ifex b}; (bf, bt) \<in> {(a, b). (\<forall>ass. a ass = val_ifex b ass) \<and> ro_ifex b}\<rbrakk> \<Longrightarrow> (af = bf) = (at = bt)
[PROOF STEP]
by auto


[STATEMENT]
lemma neg_numeral_fps_const:
  "(- numeral k :: 'a :: ring_1 fps) = fps_const (- numeral k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - numeral k = fps_const (- numeral k)
[PROOF STEP]
by (simp add: numeral_fps_const)


[STATEMENT]
lemma Union_path_components_of:
     "\<Union>(path_components_of X) = topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (path_components_of X) = topspace X
[PROOF STEP]
by (auto simp: path_components_of_def path_component_of_equiv)


[STATEMENT]
lemma Y_arr_ide [simp]:
    assumes "C.ide b" and "\<guillemotleft>f : a \<rightarrow> a'\<guillemotright>"
    shows "\<guillemotleft>Y f b : Hom.map (b, a) \<rightarrow>\<^sub>S Hom.map (b, a')\<guillemotright>"
    and "Y f b = S.mkArr (Hom.set (b, a)) (Hom.set (b, a')) (\<phi> (b, a') o C f o \<psi> (b, a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>Y f b : Hom.map (b, a) \<rightarrow>\<^sub>S Hom.map (b, a')\<guillemotright> &&& Y f b = S.mkArr (Hom.set (b, a)) (Hom.set (b, a')) (\<phi> (b, a') \<circ> (\<cdot>) f \<circ> \<psi> (b, a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
C.ide b
\<guillemotleft>f : a \<rightarrow> a'\<guillemotright>

goal (1 subgoal):
 1. \<guillemotleft>Y f b : Hom.map (b, a) \<rightarrow>\<^sub>S Hom.map (b, a')\<guillemotright> &&& Y f b = S.mkArr (Hom.set (b, a)) (Hom.set (b, a')) (\<phi> (b, a') \<circ> (\<cdot>) f \<circ> \<psi> (b, a))
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y f b = S.mkArr (Hom.set (b, a)) (Hom.set (b, a')) (\<phi> (b, a') \<circ> (\<cdot>) f \<circ> \<psi> (b, a))
[PROOF STEP]
using assms Hom.map_simp_2
[PROOF STATE]
proof (prove)
using this:
C.ide b
\<guillemotleft>f : a \<rightarrow> a'\<guillemotright>
\<lbrakk>C.ide ?b; C.arr ?f\<rbrakk> \<Longrightarrow> Hom.map (?b, ?f) = S.mkArr (Hom.set (?b, C.dom ?f)) (Hom.set (?b, C.cod ?f)) (\<phi> (?b, C.cod ?f) \<circ> (\<cdot>) ?f \<circ> \<psi> (?b, C.dom ?f))

goal (1 subgoal):
 1. Y f b = S.mkArr (Hom.set (b, a)) (Hom.set (b, a')) (\<phi> (b, a') \<circ> (\<cdot>) f \<circ> \<psi> (b, a))
[PROOF STEP]
by auto


[STATEMENT]
lemma heap_merge:
  "\<lbrakk> heap t1;  heap t2 \<rbrakk> \<Longrightarrow> heap (merge t1 t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>heap t1; heap t2\<rbrakk> \<Longrightarrow> heap (merge t1 t2)
[PROOF STEP]
by (induction t1 t2 rule: merge.induct)(auto simp: ball_Un set_merge)


[STATEMENT]
lemma compact_AR:
  fixes S :: "'a::euclidean_space set"
  shows "compact S \<and> AR S \<longleftrightarrow> compact S \<and> S retract_of UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (compact S \<and> AR S) = (compact S \<and> S retract_of UNIV)
[PROOF STEP]
using compact_imp_closed retract_of_UNIV
[PROOF STATE]
proof (prove)
using this:
compact ?s \<Longrightarrow> closed ?s
(?S retract_of UNIV) = (AR ?S \<and> closed ?S)

goal (1 subgoal):
 1. (compact S \<and> AR S) = (compact S \<and> S retract_of UNIV)
[PROOF STEP]
by blast


[STATEMENT]
lemma AE_measure_spmf_iff [simp]: "(AE x in measure_spmf p. P x) \<longleftrightarrow> (\<forall>x\<in>set_spmf p. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere (measure_spmf p) P = (\<forall>x\<in>set_spmf p. P x)
[PROOF STEP]
by(auto 4 3 simp add: measure_spmf_def AE_distr_iff AE_restrict_space_iff AE_measure_pmf_iff set_spmf_def cong del: AE_cong)


[STATEMENT]
lemma Limsup_ereal_mult_left:
  assumes "F \<noteq> bot" "(c::real) \<ge> 0"
  shows   "Limsup F (\<lambda>n. ereal c * f n) = ereal c * Limsup F f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup F (\<lambda>n. ereal c * f n) = ereal c * Limsup F f
[PROOF STEP]
using Limsup_ereal_mult_right[OF assms]
[PROOF STATE]
proof (prove)
using this:
Limsup F (\<lambda>n. ?f n * ereal c) = Limsup F ?f * ereal c

goal (1 subgoal):
 1. Limsup F (\<lambda>n. ereal c * f n) = ereal c * Limsup F f
[PROOF STEP]
by (subst (1 2) mult.commute)


[STATEMENT]
lemma add_mult_distrib: "x * (y+z) = x*y + x*z" for x::V
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * (y + z) = x * y + x * z
[PROOF STEP]
by (simp add: mult_lift mult_lift_imp_distrib)


[STATEMENT]
lemma count_lift_profile:
  assumes "\<forall>Y\<in>#A. y \<notin> Y"
  shows   "count (lift_profile A) X =
             (if x \<in> X \<longleftrightarrow> y \<in> X then count A (X - {y}) else 0) +
             (if X = {x, y} then l else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (lift_profile A) X = (if (x \<in> X) = (y \<in> X) then count A (X - {y}) else 0) + (if X = {x, y} then l else 0)
[PROOF STEP]
using assms xy
[PROOF STATE]
proof (prove)
using this:
\<forall>Y\<in>#A. y \<notin> Y
x \<in> parties
y \<notin> parties

goal (1 subgoal):
 1. count (lift_profile A) X = (if (x \<in> X) = (y \<in> X) then count A (X - {y}) else 0) + (if X = {x, y} then l else 0)
[PROOF STEP]
by (induction A) (auto simp: lift_applist_def)


[STATEMENT]
theorem p12: "((p \<longleftrightarrow> q) \<longleftrightarrow> r) \<longleftrightarrow> (p \<longleftrightarrow> (q \<longleftrightarrow> r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((p = q) = r) = (p = (q = r))
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((p = q) = r) = (p = (q = r))
[PROOF STEP]
@case "p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((p = q) = r) = (p = (q = r))
[PROOF STEP]
@case "q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((p = q) = r) = (p = (q = r))
[PROOF STEP]
@qed


[STATEMENT]
lemma powa_minus:"a \<ge> 1 \<Longrightarrow> a powa (-x) = inverse (a powa x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> a \<Longrightarrow> a powa - x = inverse (a powa x)
[PROOF STEP]
by (metis powreal_eq_powa powreal_minus)


[STATEMENT]
lemma osum_Total: "\<lbrakk>Total r; Total r'\<rbrakk> \<Longrightarrow> Total (r +o r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Total r; Total r'\<rbrakk> \<Longrightarrow> Total (r +o r')
[PROOF STEP]
unfolding total_on_def Field_osum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>Field r. \<forall>y\<in>Field r. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r; \<forall>x\<in>Field r'. \<forall>y\<in>Field r'. x \<noteq> y \<longrightarrow> (x, y) \<in> r' \<or> (y, x) \<in> r'\<rbrakk> \<Longrightarrow> \<forall>x\<in>Inl ` Field r \<union> Inr ` Field r'. \<forall>y\<in>Inl ` Field r \<union> Inr ` Field r'. x \<noteq> y \<longrightarrow> (x, y) \<in> r +o r' \<or> (y, x) \<in> r +o r'
[PROOF STEP]
unfolding osum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>Field r. \<forall>y\<in>Field r. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r; \<forall>x\<in>Field r'. \<forall>y\<in>Field r'. x \<noteq> y \<longrightarrow> (x, y) \<in> r' \<or> (y, x) \<in> r'\<rbrakk> \<Longrightarrow> \<forall>x\<in>Inl ` Field r \<union> Inr ` Field r'. \<forall>y\<in>Inl ` Field r \<union> Inr ` Field r'. x \<noteq> y \<longrightarrow> (x, y) \<in> map_prod Inl Inl ` r \<union> map_prod Inr Inr ` r' \<union> {(Inl a, Inr a') |a a'. a \<in> Field r \<and> a' \<in> Field r'} \<or> (y, x) \<in> map_prod Inl Inl ` r \<union> map_prod Inr Inr ` r' \<union> {(Inl a, Inr a') |a a'. a \<in> Field r \<and> a' \<in> Field r'}
[PROOF STEP]
by blast


[STATEMENT]
lemma has_integral:
  "(f has_integral y) (cbox a b) \<longleftrightarrow>
    (\<forall>e>0. \<exists>\<gamma>. gauge \<gamma> \<and>
      (\<forall>\<D>. \<D> tagged_division_of (cbox a b) \<and> \<gamma> fine \<D> \<longrightarrow>
        norm (sum (\<lambda>(x,k). content(k) *\<^sub>R f x) \<D> - y) < e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral y) (cbox a b) = (\<forall>e>0. \<exists>\<gamma>. gauge \<gamma> \<and> (\<forall>\<D>. \<D> tagged_division_of cbox a b \<and> \<gamma> fine \<D> \<longrightarrow> norm ((\<Sum>(x, k)\<in>\<D>. content k *\<^sub>R f x) - y) < e))
[PROOF STEP]
by (auto simp: dist_norm eventually_division_filter has_integral_def tendsto_iff)


[STATEMENT]
lemma vcard_vsingleton[simp]: "vcard (set {a}) = 1\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (set {a}) = 1\<^sub>\<nat>
[PROOF STEP]
by auto


[STATEMENT]
lemma equiv_sym: "x \<approx> y \<longleftrightarrow> y \<approx> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<approx> y) = (y \<approx> x)
[PROOF STEP]
by (auto simp add: equiv_def)


[STATEMENT]
lemma add_zero : "P + Const 0 = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P + Const (0::'a) = P
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P + Const (0::'a) = P
[PROOF STEP]
have h:"P + 0 = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P + 0 = P
[PROOF STEP]
using add_0_right
[PROOF STATE]
proof (prove)
using this:
?a + (0::?'a) = ?a

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

goal (1 subgoal):
 1. P + Const (0::'a) = P
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P + Const (0::'a) = P
[PROOF STEP]
unfolding Const_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P + map_fun id MPoly Const\<^sub>0 (0::'a) = P
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
P + 0 = P

goal (1 subgoal):
 1. P + map_fun id MPoly Const\<^sub>0 (0::'a) = P
[PROOF STEP]
by (simp add: Const\<^sub>0_zero zero_mpoly.abs_eq)
[PROOF STATE]
proof (state)
this:
P + Const (0::'a) = P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transpose_zero[simp]: "transpose 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.transpose 0 = 0
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma "ipset_from_netmask (ipv4addr_of_dotdecimal (192,168,0,42)) (ipv4addr_of_dotdecimal (255,255,0,0)) =
          {ipv4addr_of_dotdecimal (192,168,0,0) .. ipv4addr_of_dotdecimal (192,168,255,255)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipset_from_netmask (ipv4addr_of_dotdecimal (192, 168, 0, 42)) (ipv4addr_of_dotdecimal (255, 255, 0, 0)) = {ipv4addr_of_dotdecimal (192, 168, 0, 0)..ipv4addr_of_dotdecimal (192, 168, 255, 255)}
[PROOF STEP]
by(simp add: ipset_from_netmask_def ipv4addr_of_dotdecimal.simps ipv4addr_of_nat_def)


[STATEMENT]
theorem wls_freshAbs_substAbs_E2:
assumes "wlsAbs (us,s) A" and "wls (asSort ys) Y"
and "freshAbs zs z (A $[Y / y]_ys)"
shows "freshAbs ys y A \<or> fresh zs z Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshAbs ys y A \<or> fresh zs z Y
[PROOF STEP]
using assms freshAbs_substAbs_E2[of A Y zs z ys]
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wls (asSort ys) Y
freshAbs zs z (A $[Y / y]_ys)
\<lbrakk>goodAbs A; good Y; freshAbs zs z (A $[Y / ?y]_ys)\<rbrakk> \<Longrightarrow> freshAbs ys ?y A \<or> fresh zs z Y

goal (1 subgoal):
 1. freshAbs ys y A \<or> fresh zs z Y
[PROOF STEP]
by simp


[STATEMENT]
lemma "ldrop' n (LCons x xs) = (case n of 0 \<Rightarrow> LCons x xs | eSuc n \<Rightarrow> ldrop' n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ldrop' n (LCons x xs) = (case n of 0 \<Rightarrow> LCons x xs | eSuc n \<Rightarrow> ldrop' n xs)
[PROOF STEP]
by (rule tendsto_closed[where x=xs, OF closed_Collect_eq_isCont])
     (auto intro!: isCont_ldrop' isCont_enat_case isCont_LCons split: enat_cosplit)


[STATEMENT]
lemma poly_roots_conv_sum_prime_factors:
  "poly_roots q = (\<Sum>p\<in>#prime_factorization q. poly_roots p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
proof (cases "q = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
case [simp]: False
[PROOF STATE]
proof (state)
this:
q \<noteq> 0

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
have "(\<Sum>p\<in>#prime_factorization q. poly_roots p) =
        poly_roots (prod_mset (prime_factorization q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q)) = poly_roots (\<Prod>\<^sub># (prime_factorization q))
[PROOF STEP]
by (rule poly_roots_prod_mset [symmetric]) auto
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset poly_roots (prime_factorization q)) = poly_roots (\<Prod>\<^sub># (prime_factorization q))

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset poly_roots (prime_factorization q)) = poly_roots (\<Prod>\<^sub># (prime_factorization q))

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
have "\<dots> = poly_roots (normalize (prod_mset (prime_factorization q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_roots (\<Prod>\<^sub># (prime_factorization q)) = poly_roots (normalize (\<Prod>\<^sub># (prime_factorization q)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_roots (\<Prod>\<^sub># (prime_factorization q)) = poly_roots (normalize (\<Prod>\<^sub># (prime_factorization q)))

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly_roots (\<Prod>\<^sub># (prime_factorization q)) = poly_roots (normalize (\<Prod>\<^sub># (prime_factorization q)))

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
have "normalize (prod_mset (prime_factorization q)) = normalize q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (\<Prod>\<^sub># (prime_factorization q)) = normalize q
[PROOF STEP]
by (rule prod_mset_prime_factorization_weak) auto
[PROOF STATE]
proof (state)
this:
normalize (\<Prod>\<^sub># (prime_factorization q)) = normalize q

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
normalize (\<Prod>\<^sub># (prime_factorization q)) = normalize q

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
have "poly_roots \<dots> = poly_roots q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_roots (normalize q) = poly_roots q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_roots (normalize q) = poly_roots q

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
 2. q \<noteq> 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Sum>\<^sub># (image_mset poly_roots (prime_factorization q)) = poly_roots q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># (image_mset poly_roots (prime_factorization q)) = poly_roots q

goal (1 subgoal):
 1. poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))

goal (1 subgoal):
 1. q = 0 \<Longrightarrow> poly_roots q = \<Sum>\<^sub># (image_mset poly_roots (prime_factorization q))
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in prob_space) erlang_distributed_sum:
  assumes finI : "finite I"
  assumes A: "I \<noteq> {}"
  assumes [simp, arith]: "0 < l"
  assumes expX: "\<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (erlang_density (k i) l)"
  assumes ind: "indep_vars (\<lambda>i. borel) X I"
  shows "distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (erlang_density ((\<Sum>i\<in>I. Suc (k i)) - 1) l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>I. Suc (k i)) - 1) l x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
I \<noteq> {}
0 < l
?i12 \<in> I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X I

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>I. Suc (k i)) - 1) l x))
[PROOF STEP]
proof (induct rule: finite_ne_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>0 < l; \<And>i. i \<in> {x} \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X {x}\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>{x}. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>{x}. Suc (k i)) - 1) l xa))
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
case (singleton i)
[PROOF STATE]
proof (state)
this:
0 < l
?i12 \<in> {i} \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X {i}

goal (2 subgoals):
 1. \<And>x. \<lbrakk>0 < l; \<And>i. i \<in> {x} \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X {x}\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>{x}. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>{x}. Suc (k i)) - 1) l xa))
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < l
?i12 \<in> {i} \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X {i}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < l
?i12 \<in> {i} \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X {i}

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. \<Sum>i\<in>{i}. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>{i}. Suc (k i)) - 1) l x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distributed M lborel (\<lambda>x. \<Sum>i\<in>{i}. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>{i}. Suc (k i)) - 1) l x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
case (insert i I)
[PROOF STATE]
proof (state)
this:
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>0 < l; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>I. Suc (k i)) - 1) l x))
0 < l
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X (insert i I)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>0 < l; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>I. Suc (k i)) - 1) l x))
0 < l
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X (insert i I)
[PROOF STEP]
have "distributed M lborel (\<lambda>x. (X i x) + (\<Sum>i\<in> I. X i x)) (erlang_density (Suc (k i) + Suc ((\<Sum>i\<in>I. Suc (k i)) - 1) - 1) l)"
[PROOF STATE]
proof (prove)
using this:
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>0 < l; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>I. Suc (k i)) - 1) l x))
0 < l
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X (insert i I)

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. X i x + (\<Sum>i\<in>I. X i x)) (\<lambda>x. ennreal (erlang_density (Suc (k i) + Suc ((\<Sum>i\<in>I. Suc (k i)) - 1) - 1) l x))
[PROOF STEP]
by(intro sum_indep_erlang indep_vars_sum) (auto intro!: indep_vars_subset)
[PROOF STATE]
proof (state)
this:
distributed M lborel (\<lambda>x. X i x + (\<Sum>i\<in>I. X i x)) (\<lambda>x. ennreal (erlang_density (Suc (k i) + Suc ((\<Sum>i\<in>I. Suc (k i)) - 1) - 1) l x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
distributed M lborel (\<lambda>x. X i x + (\<Sum>i\<in>I. X i x)) (\<lambda>x. ennreal (erlang_density (Suc (k i) + Suc ((\<Sum>i\<in>I. Suc (k i)) - 1) - 1) l x))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
have "(\<lambda>x. (X i x) + (\<Sum>i\<in> I. X i x)) = (\<lambda>x. \<Sum>i\<in>insert i I. X i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. X i x + (\<Sum>i\<in>I. X i x)) = (\<lambda>x. \<Sum>i\<in>insert i I. X i x)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>0 < l; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>I. Suc (k i)) - 1) l x))
0 < l
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X (insert i I)

goal (1 subgoal):
 1. (\<lambda>x. X i x + (\<Sum>i\<in>I. X i x)) = (\<lambda>x. \<Sum>i\<in>insert i I. X i x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. X i x + (\<Sum>i\<in>I. X i x)) = (\<lambda>x. \<Sum>i\<in>insert i I. X i x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. X i x + (\<Sum>i\<in>I. X i x)) = (\<lambda>x. \<Sum>i\<in>insert i I. X i x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
have "Suc(k i) + Suc ((\<Sum>i\<in>I. Suc (k i)) - 1) - 1 = (\<Sum>i\<in>insert i I. Suc (k i)) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (k i) + Suc ((\<Sum>i\<in>I. Suc (k i)) - 1) - 1 = (\<Sum>i\<in>insert i I. Suc (k i)) - 1
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite I
I \<noteq> {}
i \<notin> I
\<lbrakk>0 < l; \<And>i. i \<in> I \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X I\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>I. Suc (k i)) - 1) l x))
0 < l
?i12 \<in> insert i I \<Longrightarrow> distributed M lborel (X ?i12) (\<lambda>x. ennreal (erlang_density (k ?i12) l x))
indep_vars (\<lambda>i. borel) X (insert i I)

goal (1 subgoal):
 1. Suc (k i) + Suc ((\<Sum>i\<in>I. Suc (k i)) - 1) - 1 = (\<Sum>i\<in>insert i I. Suc (k i)) - 1
[PROOF STEP]
by (auto intro!: Suc_pred simp: ac_simps)
[PROOF STATE]
proof (state)
this:
Suc (k i) + Suc ((\<Sum>i\<in>I. Suc (k i)) - 1) - 1 = (\<Sum>i\<in>insert i I. Suc (k i)) - 1

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<lbrakk>0 < l; \<And>i. i \<in> F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X F\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>x. \<Sum>i\<in>F. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>F. Suc (k i)) - 1) l x)); 0 < l; \<And>i. i \<in> insert x F \<Longrightarrow> distributed M lborel (X i) (\<lambda>x. ennreal (erlang_density (k i) l x)); indep_vars (\<lambda>i. borel) X (insert x F)\<rbrakk> \<Longrightarrow> distributed M lborel (\<lambda>xa. \<Sum>i\<in>insert x F. X i xa) (\<lambda>xa. ennreal (erlang_density ((\<Sum>i\<in>insert x F. Suc (k i)) - 1) l xa))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
distributed M lborel (\<lambda>x. \<Sum>i\<in>insert i I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>insert i I. Suc (k i)) - 1) l x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
distributed M lborel (\<lambda>x. \<Sum>i\<in>insert i I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>insert i I. Suc (k i)) - 1) l x))

goal (1 subgoal):
 1. distributed M lborel (\<lambda>x. \<Sum>i\<in>insert i I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>insert i I. Suc (k i)) - 1) l x))
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
distributed M lborel (\<lambda>x. \<Sum>i\<in>insert i I. X i x) (\<lambda>x. ennreal (erlang_density ((\<Sum>i\<in>insert i I. Suc (k i)) - 1) l x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isomorphic_group_integer_free_Abelian_group_singleton:
  "integer_group \<cong> free_Abelian_group {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_group \<cong> free_Abelian_group {x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integer_group \<cong> free_Abelian_group {x}
[PROOF STEP]
have "(\<lambda>n. frag_cmul n (frag_of x)) \<in> iso integer_group (free_Abelian_group {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. frag_cmul n (frag_of x)) \<in> Group.iso integer_group (free_Abelian_group {x})
[PROOF STEP]
proof (rule isoI [OF homI])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>xa. xa \<in> carrier integer_group \<Longrightarrow> frag_cmul xa (frag_of x) \<in> carrier (free_Abelian_group {x})
 2. \<And>xa y. \<lbrakk>xa \<in> carrier integer_group; y \<in> carrier integer_group\<rbrakk> \<Longrightarrow> frag_cmul (xa \<otimes>\<^bsub>integer_group\<^esub> y) (frag_of x) = frag_cmul xa (frag_of x) \<otimes>\<^bsub>free_Abelian_group {x}\<^esub> frag_cmul y (frag_of x)
 3. bij_betw (\<lambda>n. frag_cmul n (frag_of x)) (carrier integer_group) (carrier (free_Abelian_group {x}))
[PROOF STEP]
show "bij_betw (\<lambda>n. frag_cmul n (frag_of x)) (carrier integer_group) (carrier (free_Abelian_group {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>n. frag_cmul n (frag_of x)) (carrier integer_group) (carrier (free_Abelian_group {x}))
[PROOF STEP]
apply (rule bij_betwI [where g = "\<lambda>y. Poly_Mapping.lookup y x"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. (\<lambda>n. frag_cmul n (frag_of x)) \<in> carrier integer_group \<rightarrow> carrier (free_Abelian_group {x})
 2. (\<lambda>y. poly_mapping.lookup y x) \<in> carrier (free_Abelian_group {x}) \<rightarrow> carrier integer_group
 3. \<And>xa. xa \<in> carrier integer_group \<Longrightarrow> poly_mapping.lookup (frag_cmul xa (frag_of x)) x = xa
 4. \<And>y. y \<in> carrier (free_Abelian_group {x}) \<Longrightarrow> frag_cmul (poly_mapping.lookup y x) (frag_of x) = y
[PROOF STEP]
by (auto simp: integer_group_def in_keys_iff intro!: poly_mapping_eqI)
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>n. frag_cmul n (frag_of x)) (carrier integer_group) (carrier (free_Abelian_group {x}))

goal (2 subgoals):
 1. \<And>xa. xa \<in> carrier integer_group \<Longrightarrow> frag_cmul xa (frag_of x) \<in> carrier (free_Abelian_group {x})
 2. \<And>xa y. \<lbrakk>xa \<in> carrier integer_group; y \<in> carrier integer_group\<rbrakk> \<Longrightarrow> frag_cmul (xa \<otimes>\<^bsub>integer_group\<^esub> y) (frag_of x) = frag_cmul xa (frag_of x) \<otimes>\<^bsub>free_Abelian_group {x}\<^esub> frag_cmul y (frag_of x)
[PROOF STEP]
qed (auto simp: frag_cmul_distrib)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. frag_cmul n (frag_of x)) \<in> Group.iso integer_group (free_Abelian_group {x})

goal (1 subgoal):
 1. integer_group \<cong> free_Abelian_group {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. frag_cmul n (frag_of x)) \<in> Group.iso integer_group (free_Abelian_group {x})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. frag_cmul n (frag_of x)) \<in> Group.iso integer_group (free_Abelian_group {x})

goal (1 subgoal):
 1. integer_group \<cong> free_Abelian_group {x}
[PROOF STEP]
unfolding is_iso_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. frag_cmul n (frag_of x)) \<in> Group.iso integer_group (free_Abelian_group {x})

goal (1 subgoal):
 1. Group.iso integer_group (free_Abelian_group {x}) \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integer_group \<cong> free_Abelian_group {x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ln_approx_abs'':
  fixes x :: real and n :: nat
  defines "y \<equiv> (x-1)/(x+1)"
  defines "approx \<equiv> (\<Sum>k<n. 2*y^(2*k+1) / of_nat (2*k+1))"
  defines "d \<equiv> y^(2*n+1) / (1 - y^2) / of_nat (2*n+1)"
  assumes x: "x > 1"
  assumes A: "ln_approx_aux1 x' e n x"
  shows   "\<bar>ln x - x'\<bar> \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>ln x - x'\<bar> \<le> e
[PROOF STEP]
proof (rule approx_coarsen[OF ln_approx_abs[OF x, of n]], goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
ln_approx_aux1 x' e n x
[PROOF STEP]
have "\<bar>2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) + d - x'\<bar> \<le> e - d"
[PROOF STATE]
proof (prove)
using this:
ln_approx_aux1 x' e n x

goal (1 subgoal):
 1. \<bar>2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) + d - x'\<bar> \<le> e - d
[PROOF STEP]
by (simp only: ln_approx_aux3_def ln_approx_aux2_def ln_approx_aux1_def
                   y_def [symmetric] d_def [symmetric])
[PROOF STATE]
proof (state)
this:
\<bar>2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) + d - x'\<bar> \<le> e - d

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) + d - x'\<bar> \<le> e - d

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
have "2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) =
               (\<Sum>k<n. 2 * y^(2*k+1) / (real (2 * k + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) = (\<Sum>k<n. 2 * y ^ (2 * k + 1) / real (2 * k + 1))
[PROOF STEP]
by (subst sum_distrib_left, simp, subst power_mult)
       (simp_all add: field_split_simps mult_ac power_mult)
[PROOF STATE]
proof (state)
this:
2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) = (\<Sum>k<n. 2 * y ^ (2 * k + 1) / real (2 * k + 1))

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>(\<Sum>k<n. 2 * y ^ (2 * k + 1) / real (2 * k + 1)) + d - x'\<bar> \<le> e - d
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>(\<Sum>k<n. 2 * y ^ (2 * k + 1) / real (2 * k + 1)) + d - x'\<bar> \<le> e - d

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
by (simp only: d_def y_def approx_def)
[PROOF STATE]
proof (state)
this:
\<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_interior_convex_cone_aux:
  fixes S :: "'m::euclidean_space set"
  assumes "convex S"
  shows "(c, x) \<in> rel_interior (cone hull ({(1 :: real)} \<times> S)) \<longleftrightarrow>
    c > 0 \<and> x \<in> (((*\<^sub>R) c) ` (rel_interior S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
 2. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
 2. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {}

goal (1 subgoal):
 1. ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
by (simp add: cone_hull_empty)
[PROOF STATE]
proof (state)
this:
((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
obtain s where "s \<in> S"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

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

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
have conv: "convex ({(1 :: real)} \<times> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex ({1} \<times> S)
[PROOF STEP]
using convex_Times[of "{(1 :: real)}" S] assms convex_singleton[of "1 :: real"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>convex {1}; convex S\<rbrakk> \<Longrightarrow> convex ({1} \<times> S)
convex S
convex {1}

goal (1 subgoal):
 1. convex ({1} \<times> S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
convex ({1} \<times> S)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
define f where "f y = {z. (y, z) \<in> cone hull ({1 :: real} \<times> S)}" for y
[PROOF STATE]
proof (state)
this:
f ?y = {z. (?y, z) \<in> cone hull {1} \<times> S}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ?y = {z. (?y, z) \<in> cone hull {1} \<times> S}
[PROOF STEP]
have *: "(c, x) \<in> rel_interior (cone hull ({(1 :: real)} \<times> S)) =
    (c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))"
[PROOF STATE]
proof (prove)
using this:
f ?y = {z. (?y, z) \<in> cone hull {1} \<times> S}

goal (1 subgoal):
 1. ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))
[PROOF STEP]
using convex_cone_hull[of "{(1 :: real)} \<times> S"] conv
[PROOF STATE]
proof (prove)
using this:
f ?y = {z. (?y, z) \<in> cone hull {1} \<times> S}
convex ({1} \<times> S) \<Longrightarrow> convex (cone hull {1} \<times> S)
convex ({1} \<times> S)

goal (1 subgoal):
 1. ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))
[PROOF STEP]
by (subst rel_interior_projection) auto
[PROOF STATE]
proof (state)
this:
((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
fix y :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
assume "y \<ge> 0"
[PROOF STATE]
proof (state)
this:
0 \<le> y

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> y
[PROOF STEP]
have "y *\<^sub>R (1,s) \<in> cone hull ({1 :: real} \<times> S)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> y

goal (1 subgoal):
 1. y *\<^sub>R (1, s) \<in> cone hull {1} \<times> S
[PROOF STEP]
using cone_hull_expl[of "{(1 :: real)} \<times> S"] \<open>s \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> y
cone hull {1} \<times> S = {c *\<^sub>R x |c x. 0 \<le> c \<and> x \<in> {1} \<times> S}
s \<in> S

goal (1 subgoal):
 1. y *\<^sub>R (1, s) \<in> cone hull {1} \<times> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y *\<^sub>R (1, s) \<in> cone hull {1} \<times> S

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y *\<^sub>R (1, s) \<in> cone hull {1} \<times> S
[PROOF STEP]
have "f y \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
y *\<^sub>R (1, s) \<in> cone hull {1} \<times> S

goal (1 subgoal):
 1. f y \<noteq> {}
[PROOF STEP]
using f_def
[PROOF STATE]
proof (prove)
using this:
y *\<^sub>R (1, s) \<in> cone hull {1} \<times> S
f ?y = {z. (?y, z) \<in> cone hull {1} \<times> S}

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

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 \<le> ?y2 \<Longrightarrow> f ?y2 \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> ?y2 \<Longrightarrow> f ?y2 \<noteq> {}
[PROOF STEP]
have "{y. f y \<noteq> {}} = {0..}"
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?y2 \<Longrightarrow> f ?y2 \<noteq> {}

goal (1 subgoal):
 1. {y. f y \<noteq> {}} = {0..}
[PROOF STEP]
using f_def cone_hull_expl[of "{1 :: real} \<times> S"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?y2 \<Longrightarrow> f ?y2 \<noteq> {}
f ?y = {z. (?y, z) \<in> cone hull {1} \<times> S}
cone hull {1} \<times> S = {c *\<^sub>R x |c x. 0 \<le> c \<and> x \<in> {1} \<times> S}

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

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{y. f y \<noteq> {}} = {0..}
[PROOF STEP]
have **: "rel_interior {y. f y \<noteq> {}} = {0<..}"
[PROOF STATE]
proof (prove)
using this:
{y. f y \<noteq> {}} = {0..}

goal (1 subgoal):
 1. rel_interior {y. f y \<noteq> {}} = {0<..}
[PROOF STEP]
using rel_interior_real_semiline
[PROOF STATE]
proof (prove)
using this:
{y. f y \<noteq> {}} = {0..}
rel_interior {?a..} = {?a<..}

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

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
rel_interior {y. f y \<noteq> {}} = {0<..}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
fix c :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
assume "c > 0"
[PROOF STATE]
proof (state)
this:
0 < c

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < c
[PROOF STEP]
have "f c = ((*\<^sub>R) c ` S)"
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. f c = (*\<^sub>R) c ` S
[PROOF STEP]
using f_def cone_hull_expl[of "{1 :: real} \<times> S"]
[PROOF STATE]
proof (prove)
using this:
0 < c
f ?y = {z. (?y, z) \<in> cone hull {1} \<times> S}
cone hull {1} \<times> S = {c *\<^sub>R x |c x. 0 \<le> c \<and> x \<in> {1} \<times> S}

goal (1 subgoal):
 1. f c = (*\<^sub>R) c ` S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f c = (*\<^sub>R) c ` S

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f c = (*\<^sub>R) c ` S
[PROOF STEP]
have "rel_interior (f c) = (*\<^sub>R) c ` rel_interior S"
[PROOF STATE]
proof (prove)
using this:
f c = (*\<^sub>R) c ` S

goal (1 subgoal):
 1. rel_interior (f c) = (*\<^sub>R) c ` rel_interior S
[PROOF STEP]
using rel_interior_convex_scaleR[of S c] assms
[PROOF STATE]
proof (prove)
using this:
f c = (*\<^sub>R) c ` S
convex S \<Longrightarrow> (*\<^sub>R) c ` rel_interior S = rel_interior ((*\<^sub>R) c ` S)
convex S

goal (1 subgoal):
 1. rel_interior (f c) = (*\<^sub>R) c ` rel_interior S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior (f c) = (*\<^sub>R) c ` rel_interior S

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?ca2 \<Longrightarrow> rel_interior (f ?ca2) = (*\<^sub>R) ?ca2 ` rel_interior S

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?ca2 \<Longrightarrow> rel_interior (f ?ca2) = (*\<^sub>R) ?ca2 ` rel_interior S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < ?ca2 \<Longrightarrow> rel_interior (f ?ca2) = (*\<^sub>R) ?ca2 ` rel_interior S

goal (1 subgoal):
 1. ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
using * **
[PROOF STATE]
proof (prove)
using this:
0 < ?ca2 \<Longrightarrow> rel_interior (f ?ca2) = (*\<^sub>R) ?ca2 ` rel_interior S
((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))
rel_interior {y. f y \<noteq> {}} = {0<..}

goal (1 subgoal):
 1. ((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((c, x) \<in> rel_interior (cone hull {1} \<times> S)) = (0 < c \<and> x \<in> (*\<^sub>R) c ` rel_interior S)

goal:
No subgoals!
[PROOF STEP]
qed