[STATEMENT]
lemma scale_ms_aux:
  fixes xs :: "('a :: multiseries \<times> real) msllist"
  assumes "is_expansion_aux xs f basis" "basis_wf basis"
  shows   "is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis
[PROOF STEP]
proof (cases basis)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. basis = [] \<Longrightarrow> is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis
 2. \<And>a list. basis = a # list \<Longrightarrow> is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis
[PROOF STEP]
case (Cons b basis')
[PROOF STATE]
proof (state)
this:
basis = b # basis'

goal (2 subgoals):
 1. basis = [] \<Longrightarrow> is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis
 2. \<And>a list. basis = a # list \<Longrightarrow> is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis
[PROOF STEP]
proof (rule is_expansion_aux_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_expansion_aux (scale_ms_aux c xs) ?f basis
 2. \<forall>\<^sub>F x in at_top. ?f x = c * f x
[PROOF STEP]
show "is_expansion_aux (scale_ms_aux c xs)
            (\<lambda>x. eval (const_expansion c :: 'a) x * b x powr 0 * f x) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. eval (const_expansion c) x * b x powr 0 * f x) basis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_expansion_aux xs f basis
basis_wf basis

goal (1 subgoal):
 1. is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. eval (const_expansion c) x * b x powr 0 * f x) basis
[PROOF STEP]
unfolding scale_ms_aux_def Cons
[PROOF STATE]
proof (prove)
using this:
is_expansion_aux xs f (b # basis')
basis_wf (b # basis')

goal (1 subgoal):
 1. is_expansion_aux (scale_shift_ms_aux (const_expansion c, 0) xs) (\<lambda>x. eval (const_expansion c) x * b x powr 0 * f x) (b # basis')
[PROOF STEP]
by (intro scale_shift_ms_aux is_expansion_const)
         (auto simp: basis_wf_Cons dest: is_expansion_aux_expansion_level)
[PROOF STATE]
proof (state)
this:
is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. eval (const_expansion c) x * b x powr 0 * f x) basis

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. eval (const_expansion c) x * b x powr 0 * f x = c * f x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. eval (const_expansion c) x * b x powr 0 * f x = c * f x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_expansion_aux xs f basis
basis_wf basis
[PROOF STEP]
have "eventually (\<lambda>x. b x > 0) at_top"
[PROOF STATE]
proof (prove)
using this:
is_expansion_aux xs f basis
basis_wf basis

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < b x
[PROOF STEP]
by (simp add: basis_wf_Cons Cons filterlim_at_top_dense)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < b x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. eval (const_expansion c) x * b x powr 0 * f x = c * f x
[PROOF STEP]
thus "eventually (\<lambda>x. eval (const_expansion c :: 'a) x * b x powr 0 * f x = c * f x) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 0 < b x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. eval (const_expansion c) x * b x powr 0 * f x = c * f x
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. eval (const_expansion c) x * b x powr 0 * f x = c * f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis

goal (1 subgoal):
 1. basis = [] \<Longrightarrow> is_expansion_aux (scale_ms_aux c xs) (\<lambda>x. c * f x) basis
[PROOF STEP]
qed (insert assms, auto dest: is_expansion_aux_basis_nonempty)


[STATEMENT]
lemma vec_vec_Tensor_simpl:
   "i<(length y) \<longrightarrow> (vec_vec_Tensor (z#zs) y)!i = (times z y)!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
have a: "vec_vec_Tensor (z#zs) y = (times z y)@(vec_vec_Tensor zs y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_vec_Tensor (z # zs) y = local.times z y @ vec_vec_Tensor zs y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_vec_Tensor (z # zs) y = local.times z y @ vec_vec_Tensor zs y

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
have b: "length (times z y) = (length y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (local.times z y) = length y
[PROOF STEP]
using preserving_length
[PROOF STATE]
proof (prove)
using this:
length (local.times ?n ?y) = length ?y

goal (1 subgoal):
 1. length (local.times z y) = length y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (local.times z y) = length y

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
have "i<(length (times z y))
          \<longrightarrow> ((times z y)@(vec_vec_Tensor zs y))!i = (times z y)!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (local.times z y) \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i
[PROOF STEP]
using append_simpl
[PROOF STATE]
proof (prove)
using this:
?i < length ?xs \<longrightarrow> (?xs @ ?ys) ! ?i = ?xs ! ?i

goal (1 subgoal):
 1. i < length (local.times z y) \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
i < length (local.times z y) \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
with b
[PROOF STATE]
proof (chain)
picking this:
length (local.times z y) = length y
i < length (local.times z y) \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i
[PROOF STEP]
have "i<(length y)
          \<longrightarrow> ((times z y)@(vec_vec_Tensor zs y))!i = (times z y)!i"
[PROOF STATE]
proof (prove)
using this:
length (local.times z y) = length y
i < length (local.times z y) \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i

goal (1 subgoal):
 1. i < length y \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
with  a
[PROOF STATE]
proof (chain)
picking this:
vec_vec_Tensor (z # zs) y = local.times z y @ vec_vec_Tensor zs y
i < length y \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i
[PROOF STEP]
have "i<(length y)
          \<longrightarrow> (vec_vec_Tensor (z#zs) y)!i = (times z y)!i"
[PROOF STATE]
proof (prove)
using this:
vec_vec_Tensor (z # zs) y = local.times z y @ vec_vec_Tensor zs y
i < length y \<longrightarrow> (local.times z y @ vec_vec_Tensor zs y) ! i = local.times z y ! i

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm089:
  "Range(f outside X) \<supseteq> (Range f)-(f``X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Range f - f `` X \<subseteq> Range (f outside X)
[PROOF STEP]
using Outside_def
[PROOF STATE]
proof (prove)
using this:
?R outside ?X = ?R - ?X \<times> Range ?R

goal (1 subgoal):
 1. Range f - f `` X \<subseteq> Range (f outside X)
[PROOF STEP]
by blast


[STATEMENT]
lemma polysubst0_polybound0:
  assumes "polybound0 t"
  shows "polybound0 (polysubst0 t a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polybound0 (polysubst0 t a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
polybound0 t

goal (1 subgoal):
 1. polybound0 (polysubst0 t a)
[PROOF STEP]
by (induct a rule: poly.induct) auto


[STATEMENT]
lemma negligible_le: "\<lbrakk> negligible g; \<And>\<eta>. \<bar>f \<eta>\<bar> \<le> g \<eta> \<rbrakk> \<Longrightarrow> negligible f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>negligible g; \<And>\<eta>. \<bar>f \<eta>\<bar> \<le> g \<eta>\<rbrakk> \<Longrightarrow> negligible f
[PROOF STEP]
by(erule negligible_mono)(force intro: order_trans intro!: eventually_sequentiallyI landau_o.big_mono)


[STATEMENT]
lemma stabilizer_coset_Un:
  assumes "A \<subseteq> G"
  shows "(\<Union> x \<in> A. sumset {x} (stabilizer A)) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>A. sumset {x} (stabilizer A)) = A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Union>x\<in>A. sumset {x} (stabilizer A)) \<subseteq> A
 2. A \<subseteq> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
show "(\<Union>x\<in>A. sumset {x} (stabilizer A)) \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>A. sumset {x} (stabilizer A)) \<subseteq> A
[PROOF STEP]
using stabilizer_coset_subset assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> G; ?x \<in> ?A\<rbrakk> \<Longrightarrow> sumset {?x} (stabilizer ?A) \<subseteq> ?A
A \<subseteq> G

goal (1 subgoal):
 1. (\<Union>x\<in>A. sumset {x} (stabilizer A)) \<subseteq> A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>A. sumset {x} (stabilizer A)) \<subseteq> A

goal (1 subgoal):
 1. A \<subseteq> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<subseteq> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
show "A \<subseteq> (\<Union>x\<in>A. sumset {x} (stabilizer A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
assume hx: "x \<in> A"
[PROOF STATE]
proof (state)
this:
x \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
[PROOF STEP]
have "x \<in> sumset {x} (stabilizer A)"
[PROOF STATE]
proof (prove)
using this:
x \<in> A

goal (1 subgoal):
 1. x \<in> sumset {x} (stabilizer A)
[PROOF STEP]
using sub_unit_closed assms
[PROOF STATE]
proof (prove)
using this:
x \<in> A
\<zero> \<in> stabilizer ?A
A \<subseteq> G

goal (1 subgoal):
 1. x \<in> sumset {x} (stabilizer A)
[PROOF STEP]
by (metis in_mono right_unit singletonI sumset.sumsetI unit_closed)
[PROOF STATE]
proof (state)
this:
x \<in> sumset {x} (stabilizer A)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
thus "x \<in> (\<Union>x\<in>A. sumset {x} (stabilizer A))"
[PROOF STATE]
proof (prove)
using this:
x \<in> sumset {x} (stabilizer A)

goal (1 subgoal):
 1. x \<in> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
using hx
[PROOF STATE]
proof (prove)
using this:
x \<in> sumset {x} (stabilizer A)
x \<in> A

goal (1 subgoal):
 1. x \<in> (\<Union>x\<in>A. sumset {x} (stabilizer A))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>x\<in>A. sumset {x} (stabilizer A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<subseteq> (\<Union>x\<in>A. sumset {x} (stabilizer A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_fun_uminus_iff [simp]:
  "poly_fun (\<lambda>x. - f x) \<longleftrightarrow> poly_fun f" "poly_fun (- f) \<longleftrightarrow> poly_fun f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_fun (\<lambda>x. - f x) = poly_fun f &&& poly_fun (- f) = poly_fun f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_fun (\<lambda>x. - f x) = poly_fun f
 2. poly_fun (- f) = poly_fun f
[PROOF STEP]
show "poly_fun (\<lambda>x. - f x) \<longleftrightarrow> poly_fun f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_fun (\<lambda>x. - f x) = poly_fun f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_fun (\<lambda>x. - f x) \<Longrightarrow> poly_fun f
 2. poly_fun f \<Longrightarrow> poly_fun (\<lambda>x. - f x)
[PROOF STEP]
assume "poly_fun (\<lambda>x. - f x)"
[PROOF STATE]
proof (state)
this:
poly_fun (\<lambda>x. - f x)

goal (2 subgoals):
 1. poly_fun (\<lambda>x. - f x) \<Longrightarrow> poly_fun f
 2. poly_fun f \<Longrightarrow> poly_fun (\<lambda>x. - f x)
[PROOF STEP]
hence "poly_fun (\<lambda>x. - (- f x))"
[PROOF STATE]
proof (prove)
using this:
poly_fun (\<lambda>x. - f x)

goal (1 subgoal):
 1. poly_fun (\<lambda>x. - (- f x))
[PROOF STEP]
by (rule poly_fun_uminus)
[PROOF STATE]
proof (state)
this:
poly_fun (\<lambda>x. - (- f x))

goal (2 subgoals):
 1. poly_fun (\<lambda>x. - f x) \<Longrightarrow> poly_fun f
 2. poly_fun f \<Longrightarrow> poly_fun (\<lambda>x. - f x)
[PROOF STEP]
thus "poly_fun f"
[PROOF STATE]
proof (prove)
using this:
poly_fun (\<lambda>x. - (- f x))

goal (1 subgoal):
 1. poly_fun f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_fun f

goal (1 subgoal):
 1. poly_fun f \<Longrightarrow> poly_fun (\<lambda>x. - f x)
[PROOF STEP]
qed (rule poly_fun_uminus)
[PROOF STATE]
proof (state)
this:
poly_fun (\<lambda>x. - f x) = poly_fun f

goal (1 subgoal):
 1. poly_fun (- f) = poly_fun f
[PROOF STEP]
thus "poly_fun (- f) \<longleftrightarrow> poly_fun f"
[PROOF STATE]
proof (prove)
using this:
poly_fun (\<lambda>x. - f x) = poly_fun f

goal (1 subgoal):
 1. poly_fun (- f) = poly_fun f
[PROOF STEP]
by (simp only: fun_Compl_def)
[PROOF STATE]
proof (state)
this:
poly_fun (- f) = poly_fun f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comps_fixpointwise_imp_bij_betw:
  assumes "f`X\<subseteq>Y" "g`Y\<subseteq>X" "fixespointwise (g\<circ>f) X" "fixespointwise (f\<circ>g) Y"
  shows   "bij_betw f X Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f X Y
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f X \<and> f ` X = Y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on f X
 2. f ` X = Y
[PROOF STEP]
show "inj_on f X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f X
[PROOF STEP]
proof (rule inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X; f x = f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X; f x = f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
show "\<lbrakk> x\<in>X; y\<in>X; f x = f y \<rbrakk> \<Longrightarrow> x=y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> X; y \<in> X; f x = f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using fixespointwiseD[OF assms(3), of x] fixespointwiseD[OF assms(3), of y]
[PROOF STATE]
proof (prove)
using this:
x \<in> X \<Longrightarrow> (g \<circ> f) x = id x
y \<in> X \<Longrightarrow> (g \<circ> f) y = id y

goal (1 subgoal):
 1. \<lbrakk>x \<in> X; y \<in> X; f x = f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<in> X; y \<in> X; f x = f y\<rbrakk> \<Longrightarrow> x = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on f X

goal (1 subgoal):
 1. f ` X = Y
[PROOF STEP]
from assms(1,2)
[PROOF STATE]
proof (chain)
picking this:
f ` X \<subseteq> Y
g ` Y \<subseteq> X
[PROOF STEP]
show "f`X = Y"
[PROOF STATE]
proof (prove)
using this:
f ` X \<subseteq> Y
g ` Y \<subseteq> X

goal (1 subgoal):
 1. f ` X = Y
[PROOF STEP]
using fixespointwiseD[OF assms(4)]
[PROOF STATE]
proof (prove)
using this:
f ` X \<subseteq> Y
g ` Y \<subseteq> X
?a \<in> Y \<Longrightarrow> (f \<circ> g) ?a = id ?a

goal (1 subgoal):
 1. f ` X = Y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
f ` X = Y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ncoplanar_perm_10:
  assumes "\<not> Coplanar A B C D"
  shows "\<not> Coplanar B D A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Coplanar B D A C
[PROOF STEP]
using assms coplanar_perm_13
[PROOF STATE]
proof (prove)
using this:
\<not> Coplanar A B C D
Coplanar ?A ?B ?C ?D \<Longrightarrow> Coplanar ?C ?A ?D ?B

goal (1 subgoal):
 1. \<not> Coplanar B D A C
[PROOF STEP]
by blast


[STATEMENT]
lemma tendsto_snd [tendsto_intros]:
  assumes "(f \<longlongrightarrow> a) F"
  shows "((\<lambda>x. snd (f x)) \<longlongrightarrow> snd a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. snd (f x)) \<longlongrightarrow> snd a) F
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
assume "open S" and "snd a \<in> S"
[PROOF STATE]
proof (state)
this:
open S
snd a \<in> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open S
snd a \<in> S
[PROOF STEP]
have "open (snd -` S)" and "a \<in> snd -` S"
[PROOF STATE]
proof (prove)
using this:
open S
snd a \<in> S

goal (1 subgoal):
 1. open (snd -` S) &&& a \<in> snd -` S
[PROOF STEP]
by (simp_all add: open_vimage_snd)
[PROOF STATE]
proof (state)
this:
open (snd -` S)
a \<in> snd -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> a) F
open (snd -` S)
a \<in> snd -` S
[PROOF STEP]
have "eventually (\<lambda>x. f x \<in> snd -` S) F"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> a) F
open (snd -` S)
a \<in> snd -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<in> snd -` S
[PROOF STEP]
by (rule topological_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x \<in> snd -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f x \<in> snd -` S
[PROOF STEP]
show "eventually (\<lambda>x. snd (f x) \<in> S) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<in> snd -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. snd (f x) \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma MOST_eq_imp:
  "MOST x. x = a \<longrightarrow> P x"
  "MOST x. a = x \<longrightarrow> P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>\<infinity>x. x = a \<longrightarrow> P x &&& \<forall>\<^sub>\<infinity>x. a = x \<longrightarrow> P x
[PROOF STEP]
unfolding eventually_cofinite
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. \<not> (x = a \<longrightarrow> P x)} &&& finite {x. \<not> (a = x \<longrightarrow> P x)}
[PROOF STEP]
by simp_all


[STATEMENT]
lemma tendsto_iff_uniformity:
    \<comment> \<open>More general analogus of \<open>tendsto_iff\<close> below. Applies to all uniform spaces, not just metric ones.\<close>
  fixes l :: \<open>'b :: uniform_space\<close>
  shows \<open>(f \<longlongrightarrow> l) F \<longleftrightarrow> (\<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) F = (\<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)))
[PROOF STEP]
proof (intro iffI allI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>E. \<lbrakk>(f \<longlongrightarrow> l) F; eventually E uniformity\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. E (f x, l)
 2. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
fix E :: \<open>('b \<times> 'b) \<Rightarrow> bool\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>E. \<lbrakk>(f \<longlongrightarrow> l) F; eventually E uniformity\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. E (f x, l)
 2. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
assume \<open>(f \<longlongrightarrow> l) F\<close> and \<open>eventually E uniformity\<close>
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> l) F
eventually E uniformity

goal (2 subgoals):
 1. \<And>E. \<lbrakk>(f \<longlongrightarrow> l) F; eventually E uniformity\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. E (f x, l)
 2. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
from \<open>eventually E uniformity\<close>
[PROOF STATE]
proof (chain)
picking this:
eventually E uniformity
[PROOF STEP]
have \<open>eventually (\<lambda>(x, y). E (y, x)) uniformity\<close>
[PROOF STATE]
proof (prove)
using this:
eventually E uniformity

goal (1 subgoal):
 1. \<forall>\<^sub>F (x, y) in uniformity. E (y, x)
[PROOF STEP]
by (simp add: uniformity_sym)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F (x, y) in uniformity. E (y, x)

goal (2 subgoals):
 1. \<And>E. \<lbrakk>(f \<longlongrightarrow> l) F; eventually E uniformity\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. E (f x, l)
 2. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F (x, y) in uniformity. E (y, x)
[PROOF STEP]
have \<open>\<forall>\<^sub>F (y, x) in uniformity. y = l \<longrightarrow> E (x, y)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F (x, y) in uniformity. E (y, x)

goal (1 subgoal):
 1. \<forall>\<^sub>F (y, x) in uniformity. y = l \<longrightarrow> E (x, y)
[PROOF STEP]
using eventually_mono
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F (x, y) in uniformity. E (y, x)
\<lbrakk>eventually ?P ?F; \<And>x. ?P x \<Longrightarrow> ?Q x\<rbrakk> \<Longrightarrow> eventually ?Q ?F

goal (1 subgoal):
 1. \<forall>\<^sub>F (y, x) in uniformity. y = l \<longrightarrow> E (x, y)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F (y, x) in uniformity. y = l \<longrightarrow> E (x, y)

goal (2 subgoals):
 1. \<And>E. \<lbrakk>(f \<longlongrightarrow> l) F; eventually E uniformity\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. E (f x, l)
 2. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
with \<open>(f \<longlongrightarrow> l) F\<close>
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> l) F
\<forall>\<^sub>F (y, x) in uniformity. y = l \<longrightarrow> E (x, y)
[PROOF STEP]
have \<open>eventually (\<lambda>x. E (x ,l)) (filtermap f F)\<close>
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> l) F
\<forall>\<^sub>F (y, x) in uniformity. y = l \<longrightarrow> E (x, y)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in filtermap f F. E (x, l)
[PROOF STEP]
by (simp add: filterlim_def le_filter_def eventually_nhds_uniformity)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in filtermap f F. E (x, l)

goal (2 subgoals):
 1. \<And>E. \<lbrakk>(f \<longlongrightarrow> l) F; eventually E uniformity\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. E (f x, l)
 2. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in filtermap f F. E (x, l)
[PROOF STEP]
show \<open>\<forall>\<^sub>F x in F. E (f x, l)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in filtermap f F. E (x, l)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. E (f x, l)
[PROOF STEP]
by (simp add: eventually_filtermap)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. E (f x, l)

goal (1 subgoal):
 1. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
assume assm: \<open>\<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l))\<close>
[PROOF STATE]
proof (state)
this:
\<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l))

goal (1 subgoal):
 1. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
have \<open>eventually P (filtermap f F)\<close> if \<open>\<forall>\<^sub>F (x, y) in uniformity. x = l \<longrightarrow> P y\<close> for P
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (filtermap f F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eventually P (filtermap f F)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F (x, y) in uniformity. x = l \<longrightarrow> P y
[PROOF STEP]
have \<open>\<forall>\<^sub>F (y, x) in uniformity. x = l \<longrightarrow> P y\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F (x, y) in uniformity. x = l \<longrightarrow> P y

goal (1 subgoal):
 1. \<forall>\<^sub>F (y, x) in uniformity. x = l \<longrightarrow> P y
[PROOF STEP]
using uniformity_sym[where E=\<open>\<lambda>(x,y). x=l \<longrightarrow> P y\<close>]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F (x, y) in uniformity. x = l \<longrightarrow> P y
\<forall>\<^sub>F (x, y) in uniformity. x = l \<longrightarrow> P y \<Longrightarrow> \<forall>\<^sub>F (x, y) in uniformity. case (y, x) of (x, y) \<Rightarrow> x = l \<longrightarrow> P y

goal (1 subgoal):
 1. \<forall>\<^sub>F (y, x) in uniformity. x = l \<longrightarrow> P y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F (y, x) in uniformity. x = l \<longrightarrow> P y

goal (1 subgoal):
 1. eventually P (filtermap f F)
[PROOF STEP]
with assm
[PROOF STATE]
proof (chain)
picking this:
\<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l))
\<forall>\<^sub>F (y, x) in uniformity. x = l \<longrightarrow> P y
[PROOF STEP]
have \<open>\<forall>\<^sub>F x in F. P (f x)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l))
\<forall>\<^sub>F (y, x) in uniformity. x = l \<longrightarrow> P y

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. P (f x)

goal (1 subgoal):
 1. eventually P (filtermap f F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. P (f x)

goal (1 subgoal):
 1. eventually P (filtermap f F)
[PROOF STEP]
by (auto simp: eventually_filtermap)
[PROOF STATE]
proof (state)
this:
eventually P (filtermap f F)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F (x, y) in uniformity. x = l \<longrightarrow> ?P y \<Longrightarrow> eventually ?P (filtermap f F)

goal (1 subgoal):
 1. \<forall>E. eventually E uniformity \<longrightarrow> (\<forall>\<^sub>F x in F. E (f x, l)) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F (x, y) in uniformity. x = l \<longrightarrow> ?P y \<Longrightarrow> eventually ?P (filtermap f F)
[PROOF STEP]
show \<open>(f \<longlongrightarrow> l) F\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F (x, y) in uniformity. x = l \<longrightarrow> ?P y \<Longrightarrow> eventually ?P (filtermap f F)

goal (1 subgoal):
 1. (f \<longlongrightarrow> l) F
[PROOF STEP]
by (simp add: filterlim_def le_filter_def eventually_nhds_uniformity)
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> l) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma c': "c^2 - 3 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c\<^sup>2 - 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < c\<^sup>2 - 3
[PROOF STEP]
from c
[PROOF STATE]
proof (chain)
picking this:
2 \<le> c
[PROOF STEP]
have "c^2 \<ge> 2^2"
[PROOF STATE]
proof (prove)
using this:
2 \<le> c

goal (1 subgoal):
 1. 2\<^sup>2 \<le> c\<^sup>2
[PROOF STEP]
by (rule power_mono) auto
[PROOF STATE]
proof (state)
this:
2\<^sup>2 \<le> c\<^sup>2

goal (1 subgoal):
 1. 0 < c\<^sup>2 - 3
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
2\<^sup>2 \<le> c\<^sup>2

goal (1 subgoal):
 1. 0 < c\<^sup>2 - 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < c\<^sup>2 - 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bind_is_matrix_vector_mult: "(bind_pmf x (transition_of_st_mat A)) =
  pmf_as_measure.pmf_of_st_vec (A *st st_vec_of_pmf x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bind> transition_of_st_mat A = pmf_of_st_vec (A *st st_vec_of_pmf x)
[PROOF STEP]
proof (rule pmf_eqI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
case (1 i)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
define X where "X = st_vec_of_pmf x"
[PROOF STATE]
proof (state)
this:
X = st_vec_of_pmf x

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
have "pmf (bind_pmf x (transition_of_st_mat A)) i =
    (\<Sum>a\<in>UNIV. pmf x a *\<^sub>R pmf (transition_of_st_mat A a) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (x \<bind> transition_of_st_mat A) i = (\<Sum>a\<in>UNIV. pmf x a *\<^sub>R pmf (transition_of_st_mat A a) i)
[PROOF STEP]
unfolding pmf_bind
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation x (\<lambda>x. pmf (transition_of_st_mat A x) i) = (\<Sum>a\<in>UNIV. pmf x a *\<^sub>R pmf (transition_of_st_mat A a) i)
[PROOF STEP]
by (subst integral_measure_pmf[of UNIV], auto)
[PROOF STATE]
proof (state)
this:
pmf (x \<bind> transition_of_st_mat A) i = (\<Sum>a\<in>UNIV. pmf x a *\<^sub>R pmf (transition_of_st_mat A a) i)

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pmf (x \<bind> transition_of_st_mat A) i = (\<Sum>a\<in>UNIV. pmf x a *\<^sub>R pmf (transition_of_st_mat A a) i)

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
have "\<dots> = (\<Sum>a\<in>UNIV. st_mat A $ i $ a * st_vec X $ a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>UNIV. pmf x a *\<^sub>R pmf (transition_of_st_mat A a) i) = (\<Sum>a\<in>UNIV. st_mat A $h i $h a * st_vec X $h a)
[PROOF STEP]
by (rule sum.cong[OF refl], auto simp: X_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>UNIV. pmf x a *\<^sub>R pmf (transition_of_st_mat A a) i) = (\<Sum>a\<in>UNIV. st_mat A $h i $h a * st_vec X $h a)

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>UNIV. pmf x a *\<^sub>R pmf (transition_of_st_mat A a) i) = (\<Sum>a\<in>UNIV. st_mat A $h i $h a * st_vec X $h a)

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
have "\<dots> = (st_mat A *v st_vec X) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>UNIV. st_mat A $h i $h a * st_vec X $h a) = (st_mat A *v st_vec X) $h i
[PROOF STEP]
unfolding matrix_vector_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>UNIV. st_mat A $h i $h a * st_vec X $h a) = (\<chi>i. \<Sum>j\<in>UNIV. st_mat A $h i $h j * st_vec X $h j) $h i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>UNIV. st_mat A $h i $h a * st_vec X $h a) = (st_mat A *v st_vec X) $h i

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>UNIV. st_mat A $h i $h a * st_vec X $h a) = (st_mat A *v st_vec X) $h i

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
have "\<dots> = st_vec (A *st X) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (st_mat A *v st_vec X) $h i = st_vec (A *st X) $h i
[PROOF STEP]
unfolding st_mat_mult_st_vec
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. st_vec (A *st X) $h i = st_vec (A *st X) $h i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(st_mat A *v st_vec X) $h i = st_vec (A *st X) $h i

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(st_mat A *v st_vec X) $h i = st_vec (A *st X) $h i

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
have "\<dots> = pmf (pmf_of_st_vec (A *st X)) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. st_vec (A *st X) $h i = pmf (pmf_of_st_vec (A *st X)) i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
st_vec (A *st X) $h i = pmf (pmf_of_st_vec (A *st X)) i

goal (1 subgoal):
 1. \<And>i. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st X)) i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st X)) i

goal (1 subgoal):
 1. pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i
[PROOF STEP]
by (simp add: X_def)
[PROOF STATE]
proof (state)
this:
pmf (x \<bind> transition_of_st_mat A) i = pmf (pmf_of_st_vec (A *st st_vec_of_pmf x)) i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma borel_measurable_enn2real[measurable (raw)]:
  "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. enn2real (f x)) \<in> M \<rightarrow>\<^sub>M borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. enn2real (f x)) \<in> borel_measurable M
[PROOF STEP]
unfolding enn2real_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. real_of_ereal (enn2ereal (f x))) \<in> borel_measurable M
[PROOF STEP]
by measurable


[STATEMENT]
lemma hrabs_add_Infinitesimal_cancel:
  "e \<in> Infinitesimal \<Longrightarrow> e' \<in> Infinitesimal \<Longrightarrow> \<bar>x + e\<bar> = \<bar>y + e'\<bar> \<Longrightarrow> \<bar>x\<bar> \<approx> \<bar>y\<bar>"
  for e e' x y :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e \<in> Infinitesimal; e' \<in> Infinitesimal; \<bar>x + e\<bar> = \<bar>y + e'\<bar>\<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<approx> \<bar>y\<bar>
[PROOF STEP]
by (metis approx_hrabs_add_Infinitesimal approx_trans2)


[STATEMENT]
lemma ldeep_n_pos: "\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> ldeep_n f cf xs > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs
[PROOF STEP]
proof(induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>pos_list_cards cf []; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf []
 2. \<And>a xs. \<lbrakk>\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs; pos_list_cards cf (a # xs); sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf (a # xs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
pos_list_cards cf []
sel_reasonable f

goal (2 subgoals):
 1. \<lbrakk>pos_list_cards cf []; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf []
 2. \<And>a xs. \<lbrakk>\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs; pos_list_cards cf (a # xs); sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pos_list_cards cf []
sel_reasonable f
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
pos_list_cards cf []
sel_reasonable f

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

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs; pos_list_cards cf (a # xs); sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs; pos_list_cards cf (a # xs); sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf (a # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs
pos_list_cards cf (x # xs)
sel_reasonable f

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs; pos_list_cards cf (a # xs); sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs
pos_list_cards cf (x # xs)
sel_reasonable f
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs
pos_list_cards cf (x # xs)
sel_reasonable f

goal (1 subgoal):
 1. 0 < ldeep_n f cf (x # xs)
[PROOF STEP]
using list_sel_aux'_reasonable pos_list_cards_def mult_pos_pos set_subset_Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>pos_list_cards cf xs; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_n f cf xs
pos_list_cards cf (x # xs)
sel_reasonable f
sel_reasonable ?f \<Longrightarrow> list_sel_aux' ?f ?x ?y \<le> 1 \<and> 0 < list_sel_aux' ?f ?x ?y
pos_list_cards ?cf ?xs = (\<forall>x\<in>set ?xs. 0 < ?cf x)
\<lbrakk>(0::?'a) < ?a; (0::?'a) < ?b\<rbrakk> \<Longrightarrow> (0::?'a) < ?a * ?b
set ?xs \<subseteq> set (?x # ?xs)

goal (1 subgoal):
 1. 0 < ldeep_n f cf (x # xs)
[PROOF STEP]
by (metis list.set_intros(1) ldeep_n.simps(2) subset_code(1))
[PROOF STATE]
proof (state)
this:
0 < ldeep_n f cf (x # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma action_proj_inter_i: "fmrestrict_set V (fmrestrict_set W f) = fmrestrict_set (V \<inter> W) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrestrict_set V (fmrestrict_set W f) = fmrestrict_set (V \<inter> W) f
[PROOF STEP]
unfolding fmfilter_alt_defs(4)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmfilter (\<lambda>a. a \<in> V) (fmfilter (\<lambda>a. a \<in> W) f) = fmfilter (\<lambda>a. a \<in> V \<inter> W) f
[PROOF STEP]
by simp


[STATEMENT]
lemma (in topological_space) at_within_open: "a \<in> S \<Longrightarrow> open S \<Longrightarrow> at a within S = at a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> S; open S\<rbrakk> \<Longrightarrow> at a within S = at a
[PROOF STEP]
unfolding filter_eq_iff eventually_at_topological
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> S; open S\<rbrakk> \<Longrightarrow> \<forall>P. (\<exists>Sa. open Sa \<and> a \<in> Sa \<and> (\<forall>x\<in>Sa. x \<noteq> a \<longrightarrow> x \<in> S \<longrightarrow> P x)) = (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>S. x \<noteq> a \<longrightarrow> x \<in> UNIV \<longrightarrow> P x))
[PROOF STEP]
by (metis open_Int Int_iff UNIV_I)


[STATEMENT]
lemma (in gram_schmidt) Gramian_matrix_alt_alt_alt_def:
  assumes "k \<le> length fs" "set fs \<subseteq> carrier_vec n"
  shows "Gramian_matrix fs k = mat k k (\<lambda>(i,j). fs ! i \<bullet> fs ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gramian_matrix fs k = mat k k (\<lambda>(i, j). fs ! i \<bullet> fs ! j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gramian_matrix fs k = mat k k (\<lambda>(i, j). fs ! i \<bullet> fs ! j)
[PROOF STEP]
have *: "vec n (($) (fs ! i)) = fs ! i" if "i < length fs" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (($) (fs ! i)) = fs ! i
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
i < length fs
k \<le> length fs
set fs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. vec n (($) (fs ! i)) = fs ! i
[PROOF STEP]
by (metis carrier_vecD dim_vec eq_vecI index_vec nth_mem subsetCE)
[PROOF STATE]
proof (state)
this:
?i4 < length fs \<Longrightarrow> vec n (($) (fs ! ?i4)) = fs ! ?i4

goal (1 subgoal):
 1. Gramian_matrix fs k = mat k k (\<lambda>(i, j). fs ! i \<bullet> fs ! j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i4 < length fs \<Longrightarrow> vec n (($) (fs ! ?i4)) = fs ! ?i4
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i4 < length fs \<Longrightarrow> vec n (($) (fs ! ?i4)) = fs ! ?i4

goal (1 subgoal):
 1. Gramian_matrix fs k = mat k k (\<lambda>(i, j). fs ! i \<bullet> fs ! j)
[PROOF STEP]
unfolding Gramian_matrix_def
[PROOF STATE]
proof (prove)
using this:
?i4 < length fs \<Longrightarrow> vec n (($) (fs ! ?i4)) = fs ! ?i4

goal (1 subgoal):
 1. (let M = mat k n (\<lambda>(i, y). fs ! i $ y) in M * M\<^sup>T) = mat k k (\<lambda>(i, j). fs ! i \<bullet> fs ! j)
[PROOF STEP]
using  assms
[PROOF STATE]
proof (prove)
using this:
?i4 < length fs \<Longrightarrow> vec n (($) (fs ! ?i4)) = fs ! ?i4
k \<le> length fs
set fs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. (let M = mat k n (\<lambda>(i, y). fs ! i $ y) in M * M\<^sup>T) = mat k k (\<lambda>(i, j). fs ! i \<bullet> fs ! j)
[PROOF STEP]
by (intro eq_matI) (auto simp add: Let_def)
[PROOF STATE]
proof (state)
this:
Gramian_matrix fs k = mat k k (\<lambda>(i, j). fs ! i \<bullet> fs ! j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_rev_ffact_nat':
  fixes m :: nat
  assumes "n \<le> m"
  shows "\<Prod>{m - n + 1..m} = ffact n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
have "inj_on (\<lambda>i. m - n + i) {1::nat..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((+) (m - n)) {1..n}
[PROOF STEP]
by (auto intro: inj_onI)
[PROOF STATE]
proof (state)
this:
inj_on ((+) (m - n)) {1..n}

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on ((+) (m - n)) {1..n}

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
have "{m - n + 1..m} = (\<lambda>i. m - n + i) ` {1::nat..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m - n + 1..m} = (+) (m - n) ` {1..n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {m - n + 1..m} = (+) (m - n) ` {1..n}
[PROOF STEP]
have "i \<in> (\<lambda>i. m + i - n) ` {Suc 0..n}" if "i \<in> {m - n + 1..m}" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> (\<lambda>i. m + i - n) ` {Suc 0..n}
[PROOF STEP]
using that \<open>n \<le> m\<close>
[PROOF STATE]
proof (prove)
using this:
i \<in> {m - n + 1..m}
n \<le> m

goal (1 subgoal):
 1. i \<in> (\<lambda>i. m + i - n) ` {Suc 0..n}
[PROOF STEP]
by (auto intro!: image_eqI[where x="i - (m - n)"])
[PROOF STATE]
proof (state)
this:
?i \<in> {m - n + 1..m} \<Longrightarrow> ?i \<in> (\<lambda>i. m + i - n) ` {Suc 0..n}

goal (1 subgoal):
 1. {m - n + 1..m} = (+) (m - n) ` {1..n}
[PROOF STEP]
with \<open>n \<le> m\<close>
[PROOF STATE]
proof (chain)
picking this:
n \<le> m
?i \<in> {m - n + 1..m} \<Longrightarrow> ?i \<in> (\<lambda>i. m + i - n) ` {Suc 0..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> m
?i \<in> {m - n + 1..m} \<Longrightarrow> ?i \<in> (\<lambda>i. m + i - n) ` {Suc 0..n}

goal (1 subgoal):
 1. {m - n + 1..m} = (+) (m - n) ` {1..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{m - n + 1..m} = (+) (m - n) ` {1..n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{m - n + 1..m} = (+) (m - n) ` {1..n}

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{m - n + 1..m} = (+) (m - n) ` {1..n}

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
have "m - n + i = m - n + i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m - n + i = m - n + i
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
m - n + ?i = m - n + ?i

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on ((+) (m - n)) {1..n}
{m - n + 1..m} = (+) (m - n) ` {1..n}
m - n + ?i = m - n + ?i
[PROOF STEP]
have "\<Prod>{m - n + (1::nat)..m} = (\<Prod>i = 1..n. m - n + i)"
[PROOF STATE]
proof (prove)
using this:
inj_on ((+) (m - n)) {1..n}
{m - n + 1..m} = (+) (m - n) ` {1..n}
m - n + ?i = m - n + ?i

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = prod ((+) (m - n)) {1..n}
[PROOF STEP]
by (rule prod.reindex_cong)
[PROOF STATE]
proof (state)
this:
\<Prod>{m - n + 1..m} = prod ((+) (m - n)) {1..n}

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<Prod>{m - n + 1..m} = prod ((+) (m - n)) {1..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Prod>{m - n + 1..m} = prod ((+) (m - n)) {1..n}

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
using \<open>n \<le> m\<close>
[PROOF STATE]
proof (prove)
using this:
\<Prod>{m - n + 1..m} = prod ((+) (m - n)) {1..n}
n \<le> m

goal (1 subgoal):
 1. \<Prod>{m - n + 1..m} = ffact n m
[PROOF STEP]
by (simp only: prod_rev_ffact_nat)
[PROOF STATE]
proof (state)
this:
\<Prod>{m - n + 1..m} = ffact n m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eqvt_fresh_cong1: "(\<And>p x. p \<bullet> (f x) = f (p \<bullet> x)) \<Longrightarrow> a \<sharp> x \<Longrightarrow> a \<sharp> f x "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> a \<sharp> f x
[PROOF STEP]
apply (rule fresh_fun_eqvt_app[of f])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> eqvt f
 2. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> a \<sharp> x
[PROOF STEP]
apply (rule eqvtI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> p \<bullet> f \<equiv> f
 2. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> a \<sharp> x
[PROOF STEP]
apply (rule eq_reflection)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> p \<bullet> f = f
 2. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> a \<sharp> x
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p xa. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> (p \<bullet> f) xa = f xa
 2. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> a \<sharp> x
[PROOF STEP]
apply (metis permute_fun_def permute_minus_cancel(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>p x. p \<bullet> f x = f (p \<bullet> x); a \<sharp> x\<rbrakk> \<Longrightarrow> a \<sharp> x
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma facet_of_imp_subset: "F facet_of S \<Longrightarrow> F \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F facet_of S \<Longrightarrow> F \<subseteq> S
[PROOF STEP]
by (simp add: face_of_imp_subset facet_of_def)


[STATEMENT]
lemma binomial_pmf_altdef':
  fixes A :: "'a set"
  assumes "finite A" and "card A = n" and p: "p \<in> {0..1}"
  shows   "binomial_pmf n p =
             map_pmf (\<lambda>f. card {x\<in>A. f x}) (Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite A
card A = n
p \<in> {0..1}
[PROOF STEP]
have "?lhs = binomial_pmf (card A) p"
[PROOF STATE]
proof (prove)
using this:
finite A
card A = n
p \<in> {0..1}

goal (1 subgoal):
 1. binomial_pmf n p = binomial_pmf (card A) p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
binomial_pmf n p = binomial_pmf (card A) p

goal (1 subgoal):
 1. binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
binomial_pmf n p = binomial_pmf (card A) p

goal (1 subgoal):
 1. binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. binomial_pmf (card A) p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. binomial_pmf (card A) p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
proof (induction rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. binomial_pmf (card {}) p = map_pmf (\<lambda>f. card {x \<in> {}. f x}) (Pi_pmf.Pi_pmf {} dflt (\<lambda>_. bernoulli_pmf p))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. binomial_pmf (card {}) p = map_pmf (\<lambda>f. card {x \<in> {}. f x}) (Pi_pmf.Pi_pmf {} dflt (\<lambda>_. bernoulli_pmf p))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
p \<in> {0..1}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p \<in> {0..1}

goal (1 subgoal):
 1. binomial_pmf (card {}) p = map_pmf (\<lambda>f. card {x \<in> {}. f x}) (Pi_pmf.Pi_pmf {} dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
by (simp add: binomial_pmf_0)
[PROOF STATE]
proof (state)
this:
binomial_pmf (card {}) p = map_pmf (\<lambda>f. card {x \<in> {}. f x}) (Pi_pmf.Pi_pmf {} dflt (\<lambda>_. bernoulli_pmf p))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
binomial_pmf (card A) p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
from insert.hyps
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
[PROOF STEP]
have "card (insert x A) = Suc (card A)"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. card (insert x A) = Suc (card A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (insert x A) = Suc (card A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (insert x A) = Suc (card A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
have "binomial_pmf \<dots> p = do {
                                     b \<leftarrow> bernoulli_pmf p;
                                     f \<leftarrow> Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p);
                                     return_pmf ((if b then 1 else 0) + card {y \<in> A. f y})
                                   }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. binomial_pmf (Suc (card A)) p = bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf ((if b then 1 else 0) + card {y \<in> A. f y})))
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
p \<in> {0..1}

goal (1 subgoal):
 1. binomial_pmf (Suc (card A)) p = bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf ((if b then 1 else 0) + card {y \<in> A. f y})))
[PROOF STEP]
by (simp add: binomial_pmf_Suc insert.IH bind_map_pmf)
[PROOF STATE]
proof (state)
this:
binomial_pmf (Suc (card A)) p = bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf ((if b then 1 else 0) + card {y \<in> A. f y})))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
binomial_pmf (Suc (card A)) p = bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf ((if b then 1 else 0) + card {y \<in> A. f y})))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
have "\<dots> = do {
                      b \<leftarrow> bernoulli_pmf p;
                      f \<leftarrow> Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p);
                      return_pmf (card {y \<in> insert x A. (f(x := b)) y})
                    }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf ((if b then 1 else 0) + card {y \<in> A. f y}))) = bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf (card {y \<in> insert x A. (f(x := b)) y})))
[PROOF STEP]
proof (intro bind_pmf_cong refl, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set_pmf (bernoulli_pmf p); xaa \<in> set_pmf (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> return_pmf ((if xa then 1 else 0) + card {y \<in> A. xaa y}) = return_pmf (card {y \<in> insert x A. (xaa(x := xa)) y})
[PROOF STEP]
case (1 b f)
[PROOF STATE]
proof (state)
this:
b \<in> set_pmf (bernoulli_pmf p)
f \<in> set_pmf (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))

goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set_pmf (bernoulli_pmf p); xaa \<in> set_pmf (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> return_pmf ((if xa then 1 else 0) + card {y \<in> A. xaa y}) = return_pmf (card {y \<in> insert x A. (xaa(x := xa)) y})
[PROOF STEP]
have "(if b then 1 else 0) + card {y\<in>A. f y} = card ((if b then {x} else {}) \<union> {y\<in>A. f y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if b then 1 else 0) + card {y \<in> A. f y} = card ((if b then {x} else {}) \<union> {y \<in> A. f y})
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. (if b then 1 else 0) + card {y \<in> A. f y} = card ((if b then {x} else {}) \<union> {y \<in> A. f y})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if b then 1 else 0) + card {y \<in> A. f y} = card ((if b then {x} else {}) \<union> {y \<in> A. f y})

goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set_pmf (bernoulli_pmf p); xaa \<in> set_pmf (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> return_pmf ((if xa then 1 else 0) + card {y \<in> A. xaa y}) = return_pmf (card {y \<in> insert x A. (xaa(x := xa)) y})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if b then 1 else 0) + card {y \<in> A. f y} = card ((if b then {x} else {}) \<union> {y \<in> A. f y})

goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set_pmf (bernoulli_pmf p); xaa \<in> set_pmf (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> return_pmf ((if xa then 1 else 0) + card {y \<in> A. xaa y}) = return_pmf (card {y \<in> insert x A. (xaa(x := xa)) y})
[PROOF STEP]
have "(if b then {x} else {}) \<union> {y\<in>A. f y} = {y\<in>insert x A. (f(x := b)) y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if b then {x} else {}) \<union> {y \<in> A. f y} = {y \<in> insert x A. (f(x := b)) y}
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. (if b then {x} else {}) \<union> {y \<in> A. f y} = {y \<in> insert x A. (f(x := b)) y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if b then {x} else {}) \<union> {y \<in> A. f y} = {y \<in> insert x A. (f(x := b)) y}

goal (1 subgoal):
 1. \<And>xa xaa. \<lbrakk>xa \<in> set_pmf (bernoulli_pmf p); xaa \<in> set_pmf (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> return_pmf ((if xa then 1 else 0) + card {y \<in> A. xaa y}) = return_pmf (card {y \<in> insert x A. (xaa(x := xa)) y})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(if b then 1 else 0) + card {y \<in> A. f y} = card {y \<in> insert x A. (f(x := b)) y}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(if b then 1 else 0) + card {y \<in> A. f y} = card {y \<in> insert x A. (f(x := b)) y}

goal (1 subgoal):
 1. return_pmf ((if b then 1 else 0) + card {y \<in> A. f y}) = return_pmf (card {y \<in> insert x A. (f(x := b)) y})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
return_pmf ((if b then 1 else 0) + card {y \<in> A. f y}) = return_pmf (card {y \<in> insert x A. (f(x := b)) y})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf ((if b then 1 else 0) + card {y \<in> A. f y}))) = bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf (card {y \<in> insert x A. (f(x := b)) y})))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf ((if b then 1 else 0) + card {y \<in> A. f y}))) = bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf (card {y \<in> insert x A. (f(x := b)) y})))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
have "\<dots> = map_pmf (\<lambda>f. card {y\<in>insert x A. f y})
                      (Pi_pmf (insert x A) dflt (\<lambda>_. bernoulli_pmf p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf (card {y \<in> insert x A. (f(x := b)) y}))) = map_pmf (\<lambda>f. card {y \<in> insert x A. f y}) (Pi_pmf.Pi_pmf (insert x A) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf (card {y \<in> insert x A. (f(x := b)) y}))) = map_pmf (\<lambda>f. card {y \<in> insert x A. f y}) (Pi_pmf.Pi_pmf (insert x A) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
by (subst Pi_pmf_insert) (simp_all add: pair_pmf_def map_bind_pmf)
[PROOF STATE]
proof (state)
this:
bernoulli_pmf p \<bind> (\<lambda>b. Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p) \<bind> (\<lambda>f. return_pmf (card {y \<in> insert x A. (f(x := b)) y}))) = map_pmf (\<lambda>f. card {y \<in> insert x A. f y}) (Pi_pmf.Pi_pmf (insert x A) dflt (\<lambda>_. bernoulli_pmf p))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; binomial_pmf (card F) p = map_pmf (\<lambda>f. card {x \<in> F. f x}) (Pi_pmf.Pi_pmf F dflt (\<lambda>_. bernoulli_pmf p))\<rbrakk> \<Longrightarrow> binomial_pmf (card (insert x F)) p = map_pmf (\<lambda>f. card {xa \<in> insert x F. f xa}) (Pi_pmf.Pi_pmf (insert x F) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
binomial_pmf (card (insert x A)) p = map_pmf (\<lambda>f. card {y \<in> insert x A. f y}) (Pi_pmf.Pi_pmf (insert x A) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
binomial_pmf (card (insert x A)) p = map_pmf (\<lambda>f. card {y \<in> insert x A. f y}) (Pi_pmf.Pi_pmf (insert x A) dflt (\<lambda>_. bernoulli_pmf p))

goal (1 subgoal):
 1. binomial_pmf (card (insert x A)) p = map_pmf (\<lambda>f. card {xa \<in> insert x A. f xa}) (Pi_pmf.Pi_pmf (insert x A) dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
binomial_pmf (card (insert x A)) p = map_pmf (\<lambda>f. card {xa \<in> insert x A. f xa}) (Pi_pmf.Pi_pmf (insert x A) dflt (\<lambda>_. bernoulli_pmf p))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
binomial_pmf (card A) p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))

goal (1 subgoal):
 1. binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))

goal (1 subgoal):
 1. binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
binomial_pmf n p = map_pmf (\<lambda>f. card {x \<in> A. f x}) (Pi_pmf.Pi_pmf A dflt (\<lambda>_. bernoulli_pmf p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Max_lem1: "\<lbrakk> pc < length bp; (pc', s') \<in> set (exec (bp ! pc) (pc, s))\<rbrakk>
    \<Longrightarrow> pc' \<le> Max (insert x (max_next_pcs bp))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pc < length bp; (pc', s') \<in> set (exec (bp ! pc) (pc, s))\<rbrakk> \<Longrightarrow> pc' \<le> Max (insert x (max_next_pcs bp))
[PROOF STEP]
apply(rule le_Max_insertI2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>pc < length bp; (pc', s') \<in> set (exec (bp ! pc) (pc, s))\<rbrakk> \<Longrightarrow> finite (max_next_pcs bp)
 2. \<lbrakk>pc < length bp; (pc', s') \<in> set (exec (bp ! pc) (pc, s))\<rbrakk> \<Longrightarrow> max_next_pcs bp \<noteq> {}
 3. \<lbrakk>pc < length bp; (pc', s') \<in> set (exec (bp ! pc) (pc, s))\<rbrakk> \<Longrightarrow> pc' \<le> Max (max_next_pcs bp)
[PROOF STEP]
apply (simp add: finite_max_next_pcs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>pc < length bp; (pc', s') \<in> set (exec (bp ! pc) (pc, s))\<rbrakk> \<Longrightarrow> max_next_pcs bp \<noteq> {}
 2. \<lbrakk>pc < length bp; (pc', s') \<in> set (exec (bp ! pc) (pc, s))\<rbrakk> \<Longrightarrow> pc' \<le> Max (max_next_pcs bp)
[PROOF STEP]
apply(simp add: max_next_pcs_not_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pc < length bp; (pc', s') \<in> set (exec (bp ! pc) (pc, s))\<rbrakk> \<Longrightarrow> pc' \<le> Max (max_next_pcs bp)
[PROOF STEP]
apply(auto intro!: Max_lem2 simp del:exec.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fds_exp_times_fds_nth_0:
  "fds_const (exp (fds_nth f (Suc 0))) * fds_exp (f - fds_const (fds_nth f (Suc 0))) = fds_exp f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_const (exp (fds_nth f (Suc 0))) * fds_exp (f - fds_const (fds_nth f (Suc 0))) = fds_exp f
[PROOF STEP]
by (rule fds_eqI) (simp add: fds_exp_def fds_nth_fds' cong: if_cong)


[STATEMENT]
lemma Brouwer_degree2_homotopic:
  assumes "homotopic_with (\<lambda>x. True) (nsphere p) (nsphere p) f g"
  shows "Brouwer_degree2 p f = Brouwer_degree2 p g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Brouwer_degree2 p f = Brouwer_degree2 p g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Brouwer_degree2 p f = Brouwer_degree2 p g
[PROOF STEP]
have "continuous_map (nsphere p) (nsphere p) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (nsphere p) (nsphere p) f
[PROOF STEP]
using homotopic_with_imp_continuous_maps [OF assms]
[PROOF STATE]
proof (prove)
using this:
continuous_map (nsphere p) (nsphere p) f \<and> continuous_map (nsphere p) (nsphere p) g

goal (1 subgoal):
 1. continuous_map (nsphere p) (nsphere p) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_map (nsphere p) (nsphere p) f

goal (1 subgoal):
 1. Brouwer_degree2 p f = Brouwer_degree2 p g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Brouwer_degree2 p f = Brouwer_degree2 p g
[PROOF STEP]
using Brouwer_degree2_def assms homology_homotopy_empty
[PROOF STATE]
proof (prove)
using this:
Brouwer_degree2 ?p ?f \<equiv> SOME d. \<forall>x\<in>carrier (reduced_homology_group (int ?p) (nsphere ?p)). hom_induced (int ?p) (nsphere ?p) {} (nsphere ?p) {} ?f x = x [^]\<^bsub>reduced_homology_group (int ?p) (nsphere ?p)\<^esub> d
homotopic_with (\<lambda>x. True) (nsphere p) (nsphere p) f g
homotopic_with (\<lambda>h. True) ?X ?Y ?f ?g \<Longrightarrow> hom_induced ?p ?X {} ?Y {} ?f = hom_induced ?p ?X {} ?Y {} ?g

goal (1 subgoal):
 1. Brouwer_degree2 p f = Brouwer_degree2 p g
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Brouwer_degree2 p f = Brouwer_degree2 p g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_dependent_iff_dependent2:
  assumes "a \<in> S"
  shows "affine_dependent S \<longleftrightarrow> dependent ((\<lambda>x. -a + x) ` (S-{a}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_dependent S = dependent ((+) (- a) ` (S - {a}))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. affine_dependent S = dependent ((+) (- a) ` (S - {a}))
[PROOF STEP]
have "insert a (S - {a}) = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert a (S - {a}) = S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> S

goal (1 subgoal):
 1. insert a (S - {a}) = S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert a (S - {a}) = S

goal (1 subgoal):
 1. affine_dependent S = dependent ((+) (- a) ` (S - {a}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
insert a (S - {a}) = S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
insert a (S - {a}) = S

goal (1 subgoal):
 1. affine_dependent S = dependent ((+) (- a) ` (S - {a}))
[PROOF STEP]
using assms affine_dependent_iff_dependent[of a "S-{a}"]
[PROOF STATE]
proof (prove)
using this:
insert a (S - {a}) = S
a \<in> S
a \<notin> S - {a} \<Longrightarrow> affine_dependent (insert a (S - {a})) = dependent ((+) (- a) ` (S - {a}))

goal (1 subgoal):
 1. affine_dependent S = dependent ((+) (- a) ` (S - {a}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine_dependent S = dependent ((+) (- a) ` (S - {a}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in encoding) fully_abstract_wrt_target_relation:
  fixes RelT :: "('procT \<times> 'procT) set"
  shows "\<exists>RelS. fully_abstract RelS RelT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>RelS. \<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>RelS. \<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)
[PROOF STEP]
define RelS where "RelS = {(S1, S2). (\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT}"
[PROOF STATE]
proof (state)
this:
RelS = _Collect (S1, S2) ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)

goal (1 subgoal):
 1. \<exists>RelS. \<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)
[PROOF STEP]
hence "fully_abstract RelS RelT"
[PROOF STATE]
proof (prove)
using this:
RelS = _Collect (S1, S2) ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)

goal (1 subgoal):
 1. \<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)

goal (1 subgoal):
 1. \<exists>RelS. \<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)
[PROOF STEP]
thus "\<exists>RelS. fully_abstract RelS RelT"
[PROOF STATE]
proof (prove)
using this:
\<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)

goal (1 subgoal):
 1. \<exists>RelS. \<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>RelS. \<forall>S1 S2. ((S1, S2) \<in> RelS) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> RelT)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma graph_extI:
  "(\<And>x. x \<in> H \<Longrightarrow> h x = h' x) \<Longrightarrow> H \<subseteq> H'
    \<Longrightarrow> graph H h \<subseteq> graph H' h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> H \<Longrightarrow> h x = h' x; H \<subseteq> H'\<rbrakk> \<Longrightarrow> graph H h \<subseteq> graph H' h'
[PROOF STEP]
unfolding graph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> H \<Longrightarrow> h x = h' x; H \<subseteq> H'\<rbrakk> \<Longrightarrow> {(x, h x) |x. x \<in> H} \<subseteq> {(x, h' x) |x. x \<in> H'}
[PROOF STEP]
by blast


[STATEMENT]
lemma tendsto_snd [tendsto_intros]:
  assumes "(f \<longlongrightarrow> a) F"
  shows "((\<lambda>x. snd (f x)) \<longlongrightarrow> snd a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. snd (f x)) \<longlongrightarrow> snd a) F
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
assume "open S" and "snd a \<in> S"
[PROOF STATE]
proof (state)
this:
open S
snd a \<in> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open S
snd a \<in> S
[PROOF STEP]
have "open (snd -` S)" and "a \<in> snd -` S"
[PROOF STATE]
proof (prove)
using this:
open S
snd a \<in> S

goal (1 subgoal):
 1. open (snd -` S) &&& a \<in> snd -` S
[PROOF STEP]
by (simp_all add: open_vimage_snd)
[PROOF STATE]
proof (state)
this:
open (snd -` S)
a \<in> snd -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> a) F
open (snd -` S)
a \<in> snd -` S
[PROOF STEP]
have "eventually (\<lambda>x. f x \<in> snd -` S) F"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> a) F
open (snd -` S)
a \<in> snd -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<in> snd -` S
[PROOF STEP]
by (rule topological_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x \<in> snd -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; snd a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f x \<in> snd -` S
[PROOF STEP]
show "eventually (\<lambda>x. snd (f x) \<in> S) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<in> snd -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. snd (f x) \<in> S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. snd (f x) \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in domain) nonzero_pow_nonzero:
  assumes "a \<in> carrier R"
  assumes "a \<noteq>\<zero>"
  shows "a[^](n::nat) \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] n \<noteq> \<zero>
[PROOF STEP]
proof(induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a [^] 0 \<noteq> \<zero>
 2. \<And>n. a [^] n \<noteq> \<zero> \<Longrightarrow> a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. a [^] 0 \<noteq> \<zero>
 2. \<And>n. a [^] n \<noteq> \<zero> \<Longrightarrow> a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] 0 \<noteq> \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a [^] 0 \<noteq> \<zero>

goal (1 subgoal):
 1. \<And>n. a [^] n \<noteq> \<zero> \<Longrightarrow> a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. a [^] n \<noteq> \<zero> \<Longrightarrow> a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
a [^] n \<noteq> \<zero>

goal (1 subgoal):
 1. \<And>n. a [^] n \<noteq> \<zero> \<Longrightarrow> a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
fix n::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. a [^] n \<noteq> \<zero> \<Longrightarrow> a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
assume IH: "a[^] n \<noteq> \<zero>"
[PROOF STATE]
proof (state)
this:
a [^] n \<noteq> \<zero>

goal (1 subgoal):
 1. \<And>n. a [^] n \<noteq> \<zero> \<Longrightarrow> a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
show "a[^] (Suc n) \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
have "a[^] (Suc n) = a[^] n \<otimes> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] Suc n = a [^] n \<otimes> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a [^] Suc n = a [^] n \<otimes> a

goal (1 subgoal):
 1. a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a [^] Suc n = a [^] n \<otimes> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a [^] Suc n = a [^] n \<otimes> a

goal (1 subgoal):
 1. a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
using assms IH
[PROOF STATE]
proof (prove)
using this:
a [^] Suc n = a [^] n \<otimes> a
a \<in> carrier R
a \<noteq> \<zero>
a [^] n \<noteq> \<zero>

goal (1 subgoal):
 1. a [^] Suc n \<noteq> \<zero>
[PROOF STEP]
using IH assms(1) assms(2) local.integral
[PROOF STATE]
proof (prove)
using this:
a [^] Suc n = a [^] n \<otimes> a
a \<in> carrier R
a \<noteq> \<zero>
a [^] n \<noteq> \<zero>
a [^] n \<noteq> \<zero>
a \<in> carrier R
a \<noteq> \<zero>
\<lbrakk>?a \<otimes> ?b = \<zero>; ?a \<in> carrier R; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> ?a = \<zero> \<or> ?b = \<zero>

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a [^] Suc n \<noteq> \<zero>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ord_odiff_eq:
  assumes "\<alpha> \<le> \<beta>" "Ord \<alpha>" "Ord \<beta>"
  shows "\<alpha> + odiff \<beta> \<alpha> = \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> + odiff \<beta> \<alpha> = \<beta>
[PROOF STEP]
by (simp add: assms vle_iff_le_Ord vle_imp_odiff_eq)


[STATEMENT]
lemma sum_atMost_remove_nat:
  assumes "k \<le> (n :: nat)"
  shows "(\<Sum>i\<le>n. f i) = f k + (\<Sum>i\<in>{..n}-{k}. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..n} = f k + sum f ({..n} - {k})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<le> n

goal (1 subgoal):
 1. sum f {..n} = f k + sum f ({..n} - {k})
[PROOF STEP]
by (auto simp add: sum.remove[where x=k])


[STATEMENT]
lemma bangRelSubset:
  fixes Rel  :: "(ccs \<times> ccs) set"
  and   Rel' :: "(ccs \<times> ccs) set"

  assumes "(P, Q) \<in> bangRel Rel"
  and     "\<And>P Q. (P, Q) \<in> Rel \<Longrightarrow> (P, Q) \<in> Rel'"

  shows "(P, Q) \<in> bangRel Rel'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P, Q) \<in> bangRel Rel'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(P, Q) \<in> bangRel Rel
(?P, ?Q) \<in> Rel \<Longrightarrow> (?P, ?Q) \<in> Rel'

goal (1 subgoal):
 1. (P, Q) \<in> bangRel Rel'
[PROOF STEP]
by(induct rule:  bangRel.induct) (auto intro: BRBang BRPar)


[STATEMENT]
lemma Rep_Abs_mod: "Rep (Abs (m mod int CARD ('a))) = m mod int CARD ('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep (Abs (m mod int CARD('a))) = m mod int CARD('a)
[PROOF STEP]
using size0
[PROOF STATE]
proof (prove)
using this:
0 < int CARD('a)

goal (1 subgoal):
 1. Rep (Abs (m mod int CARD('a))) = m mod int CARD('a)
[PROOF STEP]
by (auto simp add: Abs_inverse)


[STATEMENT]
lemma (in topological_space) at_within_open: "a \<in> S \<Longrightarrow> open S \<Longrightarrow> at a within S = at a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> S; open S\<rbrakk> \<Longrightarrow> at a within S = at a
[PROOF STEP]
unfolding filter_eq_iff eventually_at_topological
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> S; open S\<rbrakk> \<Longrightarrow> \<forall>P. (\<exists>Sa. open Sa \<and> a \<in> Sa \<and> (\<forall>x\<in>Sa. x \<noteq> a \<longrightarrow> x \<in> S \<longrightarrow> P x)) = (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>S. x \<noteq> a \<longrightarrow> x \<in> UNIV \<longrightarrow> P x))
[PROOF STEP]
by (metis open_Int Int_iff UNIV_I)


[STATEMENT]
lemma trunc_bound_euclE:
  obtains err where
  "\<bar>err\<bar> \<le> snd (trunc_bound_eucl p x)"
  "fst (trunc_bound_eucl p x) = x + err"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>err. \<lbrakk>\<bar>err\<bar> \<le> snd (trunc_bound_eucl p x); fst (trunc_bound_eucl p x) = x + err\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof atomize_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>err. \<bar>err\<bar> \<le> snd (trunc_bound_eucl p x) \<and> fst (trunc_bound_eucl p x) = x + err
[PROOF STEP]
have "fst (trunc_bound_eucl p x) = x + (eucl_truncate_down p x - x)"
    (is "_ = _ + ?err")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (trunc_bound_eucl p x) = x + (eucl_truncate_down p x - x)
[PROOF STEP]
by (simp_all add: trunc_bound_eucl_def Let_def)
[PROOF STATE]
proof (state)
this:
fst (trunc_bound_eucl p x) = x + (eucl_truncate_down p x - x)

goal (1 subgoal):
 1. \<exists>err. \<bar>err\<bar> \<le> snd (trunc_bound_eucl p x) \<and> fst (trunc_bound_eucl p x) = x + err
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst (trunc_bound_eucl p x) = x + (eucl_truncate_down p x - x)

goal (1 subgoal):
 1. \<exists>err. \<bar>err\<bar> \<le> snd (trunc_bound_eucl p x) \<and> fst (trunc_bound_eucl p x) = x + err
[PROOF STEP]
have "abs ?err \<le> snd (trunc_bound_eucl p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>eucl_truncate_down p x - x\<bar> \<le> snd (trunc_bound_eucl p x)
[PROOF STEP]
by (simp add: trunc_bound_eucl_def Let_def eucl_truncate_up)
[PROOF STATE]
proof (state)
this:
\<bar>eucl_truncate_down p x - x\<bar> \<le> snd (trunc_bound_eucl p x)

goal (1 subgoal):
 1. \<exists>err. \<bar>err\<bar> \<le> snd (trunc_bound_eucl p x) \<and> fst (trunc_bound_eucl p x) = x + err
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst (trunc_bound_eucl p x) = x + (eucl_truncate_down p x - x)
\<bar>eucl_truncate_down p x - x\<bar> \<le> snd (trunc_bound_eucl p x)
[PROOF STEP]
show "\<exists>err. \<bar>err\<bar> \<le> snd (trunc_bound_eucl p x) \<and> fst (trunc_bound_eucl p x) = x + err"
[PROOF STATE]
proof (prove)
using this:
fst (trunc_bound_eucl p x) = x + (eucl_truncate_down p x - x)
\<bar>eucl_truncate_down p x - x\<bar> \<le> snd (trunc_bound_eucl p x)

goal (1 subgoal):
 1. \<exists>err. \<bar>err\<bar> \<le> snd (trunc_bound_eucl p x) \<and> fst (trunc_bound_eucl p x) = x + err
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>err. \<bar>err\<bar> \<le> snd (trunc_bound_eucl p x) \<and> fst (trunc_bound_eucl p x) = x + err

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_mult_zero[simp]:
  fixes a :: ereal
  shows "a * 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * 0 = 0
[PROOF STEP]
by (cases a) (simp_all add: zero_ereal_def)


[STATEMENT]
lemma split_scaleC_pos_le: "(0 \<le> a \<and> 0 \<le> b) \<or> (a \<le> 0 \<and> b \<le> 0) \<Longrightarrow> 0 \<le> a *\<^sub>C b"
  for b :: "'a::ordered_complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a \<and> (0::'a) \<le> b \<or> a \<le> 0 \<and> b \<le> (0::'a) \<Longrightarrow> (0::'a) \<le> a *\<^sub>C b
[PROOF STEP]
by (auto simp: scaleC_nonneg_nonneg scaleC_nonpos_nonpos)


[STATEMENT]
lemma iMin_greaterThanLessThan: "Suc m < n \<Longrightarrow> iMin {m<..<n} = Suc m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc m < n \<Longrightarrow> iMin {m<..<n} = Suc m
[PROOF STEP]
by (simp only: atLeastSucLessThan_greaterThanLessThan[symmetric] iMin_atLeastLessThan)


[STATEMENT]
lemma tw_is_semialg:
  assumes "n > 0"
  assumes "is_semialgebraic n S"
  assumes "n \<ge> i + j"
  shows "is_semialgebraic n ((tw i j)`S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic n (tw i j ` S)
[PROOF STEP]
unfolding tw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic n (permute_list (tp_1 j i) ` S)
[PROOF STEP]
using assms tp_1_permutes'[of j i "n - (j + i)"]
        permutation_is_semialgebraic[of n S]
[PROOF STATE]
proof (prove)
using this:
0 < n
is_semialgebraic n S
i + j \<le> n
tp_1 j i permutes {..<j + i + (n - (j + i))}
\<lbrakk>is_semialgebraic n S; ?\<sigma> permutes {..<n}\<rbrakk> \<Longrightarrow> is_semialgebraic n (permute_list ?\<sigma> ` S)

goal (1 subgoal):
 1. is_semialgebraic n (permute_list (tp_1 j i) ` S)
[PROOF STEP]
by (metis add.commute le_add_diff_inverse)


[STATEMENT]
lemma closed_cball [iff]: "closed (cball x e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (cball x e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed (cball x e)
[PROOF STEP]
have "closed (dist x -` {..e})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (dist x -` {..e})
[PROOF STEP]
by (intro closed_vimage closed_atMost continuous_intros)
[PROOF STATE]
proof (state)
this:
closed (dist x -` {..e})

goal (1 subgoal):
 1. closed (cball x e)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closed (dist x -` {..e})

goal (1 subgoal):
 1. closed (cball x e)
[PROOF STEP]
have "dist x -` {..e} = cball x e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist x -` {..e} = cball x e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist x -` {..e} = cball x e

goal (1 subgoal):
 1. closed (cball x e)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closed (cball x e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closed (cball x e)

goal (1 subgoal):
 1. closed (cball x e)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
closed (cball x e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in prob_space) distributed_affineI:
  fixes f :: "real \<Rightarrow> ennreal" and c :: real
  assumes f: "distributed M lborel (\<lambda>x. (X x - t) / c) (\<lambda>x. \<bar>c\<bar> * f (x * c + t))"
  assumes c: "c \<noteq> 0"
  shows "distributed M lborel X f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distributed M lborel X f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distributed M lborel X f
[PROOF STEP]
have eq: "f x * ennreal \<bar>c\<bar> / ennreal \<bar>c\<bar> = f x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x * ennreal \<bar>c\<bar> / ennreal \<bar>c\<bar> = f x
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. f x * ennreal \<bar>c\<bar> / ennreal \<bar>c\<bar> = f x
[PROOF STEP]
by (simp add: ennreal_times_divide[symmetric])
[PROOF STATE]
proof (state)
this:
f ?x12 * ennreal \<bar>c\<bar> / ennreal \<bar>c\<bar> = f ?x12

goal (1 subgoal):
 1. distributed M lborel X f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distributed M lborel X f
[PROOF STEP]
using distributed_affine[OF f c, where t=t] c
[PROOF STATE]
proof (prove)
using this:
distributed M lborel (\<lambda>x. t + c * ((X x - t) / c)) (\<lambda>x. ennreal \<bar>c\<bar> * f ((x - t) / c * c + t) / ennreal \<bar>c\<bar>)
c \<noteq> 0

goal (1 subgoal):
 1. distributed M lborel X f
[PROOF STEP]
by (simp add: field_simps eq)
[PROOF STATE]
proof (state)
this:
distributed M lborel X f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_convergent_prod_altdef:
  fixes f :: "nat \<Rightarrow> 'a :: {one,real_normed_vector}"
  shows  "abs_convergent_prod f \<longleftrightarrow> convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_convergent_prod f = convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - (1::'a)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. abs_convergent_prod f \<Longrightarrow> convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - (1::'a)))
 2. convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - (1::'a))) \<Longrightarrow> abs_convergent_prod f
[PROOF STEP]
assume "abs_convergent_prod f"
[PROOF STATE]
proof (state)
this:
abs_convergent_prod f

goal (2 subgoals):
 1. abs_convergent_prod f \<Longrightarrow> convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - (1::'a)))
 2. convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - (1::'a))) \<Longrightarrow> abs_convergent_prod f
[PROOF STEP]
thus "convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - 1))"
[PROOF STATE]
proof (prove)
using this:
abs_convergent_prod f

goal (1 subgoal):
 1. convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - (1::'a)))
[PROOF STEP]
by (auto simp: abs_convergent_prod_def intro!: convergent_prod_imp_convergent)
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - (1::'a)))

goal (1 subgoal):
 1. convergent (\<lambda>n. \<Prod>i\<le>n. 1 + norm (f i - (1::'a))) \<Longrightarrow> abs_convergent_prod f
[PROOF STEP]
qed (auto intro: abs_convergent_prodI)


[STATEMENT]
lemma Fvars_instInpP[simp]:
assumes "\<phi> \<in> fmla" and \<tau>: "\<tau> \<in> ptrm n"  "Variable (Suc (Suc n)) \<notin> Fvars \<phi>"
shows "Fvars (instInpP \<phi> n \<tau>) = Fvars \<phi> - {inp} \<union> Variable ` {(Suc 0)..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fvars (instInpP \<phi> n \<tau>) = Fvars \<phi> - {inp} \<union> Variable ` {Suc 0..n}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> fmla
\<tau> \<in> ptrm n
Variable (Suc (Suc n)) \<notin> Fvars \<phi>

goal (1 subgoal):
 1. Fvars (instInpP \<phi> n \<tau>) = Fvars \<phi> - {inp} \<union> Variable ` {Suc 0..n}
[PROOF STEP]
unfolding instInpP_def Let_def ptrm_def
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> fmla
\<tau> \<in> {\<sigma> \<in> fmla. Fvars \<sigma> = Variable ` {0..n} \<and> prv (exu out \<sigma>)}
Variable (Suc (Suc n)) \<notin> Fvars \<phi>

goal (1 subgoal):
 1. Fvars (exi (Variable (Suc (Suc n))) (cnj (subst \<tau> (Var (Variable (Suc (Suc n)))) out) (subst \<phi> (Var (Variable (Suc (Suc n)))) inp))) = Fvars \<phi> - {inp} \<union> Variable ` {Suc 0..n}
[PROOF STEP]
by auto


[STATEMENT]
theorem TESL_interp_unfold_stepwise_positive_atoms:
  assumes \<open>positive_atom \<phi>\<close>
    shows \<open>\<lbrakk> \<phi>::'\<tau>::linordered_field TESL_atomic \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L
            = \<Union> {Y. \<exists>n::nat. Y = \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L\<^bsup>\<ge> n\<^esup>}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Union> {Y. \<exists>n. Y = \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L\<^bsup>\<ge> n\<^esup>}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Union> {Y. \<exists>n. Y = \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L\<^bsup>\<ge> n\<^esup>}
[PROOF STEP]
from positive_atom.elims(2)[OF assms]
[PROOF STATE]
proof (chain)
picking this:
(\<And>uu_ uv_ uw_. \<phi> = uu_ sporadic uv_ on uw_ \<Longrightarrow> ?P) \<Longrightarrow> ?P
[PROOF STEP]
obtain u v w where \<open>\<phi> = (u sporadic v on w)\<close>
[PROOF STATE]
proof (prove)
using this:
(\<And>uu_ uv_ uw_. \<phi> = uu_ sporadic uv_ on uw_ \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>u v w. \<phi> = u sporadic v on w \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<phi> = u sporadic v on w

goal (1 subgoal):
 1. \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Union> {Y. \<exists>n. Y = \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L\<^bsup>\<ge> n\<^esup>}
[PROOF STEP]
with TESL_interp_unfold_stepwise_sporadicon
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk> ?K\<^sub>1 sporadic ?\<tau> on ?K\<^sub>2 \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Union> {Y. \<exists>n. Y = \<lbrakk> ?K\<^sub>1 sporadic ?\<tau> on ?K\<^sub>2 \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L\<^bsup>\<ge> n\<^esup>}
\<phi> = u sporadic v on w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk> ?K\<^sub>1 sporadic ?\<tau> on ?K\<^sub>2 \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Union> {Y. \<exists>n. Y = \<lbrakk> ?K\<^sub>1 sporadic ?\<tau> on ?K\<^sub>2 \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L\<^bsup>\<ge> n\<^esup>}
\<phi> = u sporadic v on w

goal (1 subgoal):
 1. \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Union> {Y. \<exists>n. Y = \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L\<^bsup>\<ge> n\<^esup>}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L = \<Union> {Y. \<exists>n. Y = \<lbrakk> \<phi> \<rbrakk>\<^sub>T\<^sub>E\<^sub>S\<^sub>L\<^bsup>\<ge> n\<^esup>}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unitary_XpZ:
  shows "Complex_Matrix.unitary XpZ"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary XpZ
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.unitary XpZ
[PROOF STEP]
have "Complex_Matrix.adjoint XpZ * XpZ = (1\<^sub>m 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint XpZ * XpZ = 1\<^sub>m 2
[PROOF STEP]
using XpZ_inv XpZ_hermitian
[PROOF STATE]
proof (prove)
using this:
XpZ * XpZ = 1\<^sub>m 2
hermitian XpZ

goal (1 subgoal):
 1. Complex_Matrix.adjoint XpZ * XpZ = 1\<^sub>m 2
[PROOF STEP]
unfolding hermitian_def
[PROOF STATE]
proof (prove)
using this:
XpZ * XpZ = 1\<^sub>m 2
Complex_Matrix.adjoint XpZ = XpZ

goal (1 subgoal):
 1. Complex_Matrix.adjoint XpZ * XpZ = 1\<^sub>m 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint XpZ * XpZ = 1\<^sub>m 2

goal (1 subgoal):
 1. Complex_Matrix.unitary XpZ
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint XpZ * XpZ = 1\<^sub>m 2

goal (1 subgoal):
 1. Complex_Matrix.unitary XpZ
[PROOF STEP]
unfolding unitary_def
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint XpZ * XpZ = 1\<^sub>m 2

goal (1 subgoal):
 1. XpZ \<in> carrier_mat (dim_row XpZ) (dim_row XpZ) \<and> inverts_mat XpZ (Complex_Matrix.adjoint XpZ)
[PROOF STEP]
by (metis Complex_Matrix.adjoint_adjoint Complex_Matrix.unitary_def XpZ_carrier adjoint_dim
        carrier_matD(1) inverts_mat_def unitary_adjoint)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.unitary XpZ

goal:
No subgoals!
[PROOF STEP]
qed