[STATEMENT]
theorem symrun_interp_expansion:
  \<open>\<lbrakk>\<lbrakk> \<Gamma>\<^sub>1 @ \<Gamma>\<^sub>2 \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m = \<lbrakk>\<lbrakk> \<Gamma>\<^sub>1 \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m \<inter> \<lbrakk>\<lbrakk> \<Gamma>\<^sub>2 \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk> \<Gamma>\<^sub>1 @ \<Gamma>\<^sub>2 \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m = \<lbrakk>\<lbrakk> \<Gamma>\<^sub>1 \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m \<inter> \<lbrakk>\<lbrakk> \<Gamma>\<^sub>2 \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m
[PROOF STEP]
by (induction \<Gamma>\<^sub>1, simp, auto)


[STATEMENT]
lemma gauss_neq_0:
  \<open>z \<noteq> 0 \<longleftrightarrow> (Re z)\<^sup>2 + (Im z)\<^sup>2 > 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<noteq> 0) = (0 < (Re z)\<^sup>2 + (Im z)\<^sup>2)
[PROOF STEP]
by (simp add: gauss_eq_0 sum_power2_ge_zero less_le)


[STATEMENT]
lemma some_gcd_0[intro!]: "is_gcd (some_gcd a 0) a 0" "is_gcd (some_gcd 0 b) 0 b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_gcd (some_gcd a (0::'a)) a (0::'a) &&& is_gcd (some_gcd (0::'a) b) (0::'a) b
[PROOF STEP]
by (auto intro!: is_gcd_some_gcdI intro: exI[of _ a] exI[of _ b])


[STATEMENT]
lemma continuous_on_ln [continuous_intros]:
  "continuous_on s f \<Longrightarrow> (\<forall>x\<in>s. f x \<noteq> 0) \<Longrightarrow> continuous_on s (\<lambda>x. ln (f x :: real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on s f; \<forall>x\<in>s. f x \<noteq> 0\<rbrakk> \<Longrightarrow> continuous_on s (\<lambda>x. ln (f x))
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s); \<forall>x\<in>s. f x \<noteq> 0\<rbrakk> \<Longrightarrow> \<forall>x\<in>s. ((\<lambda>x. ln (f x)) \<longlongrightarrow> ln (f x)) (at x within s)
[PROOF STEP]
by (auto intro: tendsto_ln)


[STATEMENT]
lemma inverse_mat_base_case_2_R:
  shows "inverts_mat (mat_of_rows_list 3 [[1,1,1], [0,1,0], [1,0,-1]]::rat mat) (mat_of_rows_list 3  [[1/2, -1/2, 1/2], [0, 1, 0], [1/2, -1/2, -1/2]]:: rat mat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverts_mat (mat_of_rows_list 3 [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) (mat_of_rows_list 3 [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]])
[PROOF STEP]
unfolding inverts_mat_def mat_of_rows_list_def mat_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y) * mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y)) = dim_row (1\<^sub>m (dim_row (mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y)))) \<and> dim_col (mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y) * mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y)) = dim_col (1\<^sub>m (dim_row (mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y)))) \<and> (\<forall>i j. i < dim_row (1\<^sub>m (dim_row (mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y)))) \<longrightarrow> j < dim_col (1\<^sub>m (dim_row (mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y)))) \<longrightarrow> (mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y) * mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y)) $$ (i, j) = 1\<^sub>m (dim_row (mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y))) $$ (i, j))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. j < Suc (Suc (Suc 0)) \<Longrightarrow> vec 3 ((!) ([[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! j)) \<bullet> vec (Suc (Suc (Suc 0))) (\<lambda>i. [[1 / 2, - (1 / 2), 1 / 2], [0, 1, 0], [1 / 2, - (1 / 2), - (1 / 2)]] ! i ! j) = 1
 2. \<And>i j. \<lbrakk>i < Suc (Suc (Suc 0)); i \<noteq> j; j < Suc (Suc (Suc 0))\<rbrakk> \<Longrightarrow> vec 3 ((!) ([[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i)) \<bullet> vec (Suc (Suc (Suc 0))) (\<lambda>i. [[1 / 2, - (1 / 2), 1 / 2], [0, 1, 0], [1 / 2, - (1 / 2), - (1 / 2)]] ! i ! j) = 0
[PROOF STEP]
unfolding less_three
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. j = 0 \<or> j = 1 \<or> j = 2 \<Longrightarrow> vec 3 ((!) ([[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! j)) \<bullet> vec (Suc (Suc (Suc 0))) (\<lambda>i. [[1 / 2, - (1 / 2), 1 / 2], [0, 1, 0], [1 / 2, - (1 / 2), - (1 / 2)]] ! i ! j) = 1
 2. \<And>i j. \<lbrakk>i = 0 \<or> i = 1 \<or> i = 2; i \<noteq> j; j = 0 \<or> j = 1 \<or> j = 2\<rbrakk> \<Longrightarrow> vec 3 ((!) ([[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i)) \<bullet> vec (Suc (Suc (Suc 0))) (\<lambda>i. [[1 / 2, - (1 / 2), 1 / 2], [0, 1, 0], [1 / 2, - (1 / 2), - (1 / 2)]] ! i ! j) = 0
[PROOF STEP]
by (auto simp add: scalar_prod_def)


[STATEMENT]
lemma inj_lowerPowers: "inj (lowerPowers b i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (lowerPowers b i)
[PROOF STEP]
using higherPowers_lowerPowers
[PROOF STATE]
proof (prove)
using this:
higherPowers ?n ?i (lowerPowers ?n ?i ?x) = ?x

goal (1 subgoal):
 1. inj (lowerPowers b i)
[PROOF STEP]
by (rule inj_on_inverseI)


[STATEMENT]
lemma imirror_bounds_iff:
  "(n \<in> imirror_bounds I l r) = (\<exists>x\<in>I. n = l + r - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n \<in> imirror_bounds I l r) = (\<exists>x\<in>I. n = l + r - x)
[PROOF STEP]
by (simp add: imirror_bounds_def nat_mirror_def image_iff)


[STATEMENT]
theorem LIM_NSLIM_iff: "f \<midarrow>x\<rightarrow> L \<longleftrightarrow> f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>x\<rightarrow> L = f \<midarrow>x\<rightarrow>\<^sub>N\<^sub>S L
[PROOF STEP]
by (blast intro: LIM_NSLIM NSLIM_LIM)


[STATEMENT]
lemma sq_norm_poly_ge_0 [intro!]:
  fixes p :: "'a :: conjugatable_ordered_ring poly"
  shows "\<parallel>p\<parallel>\<^sup>2 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> \<parallel>p\<parallel>\<^sup>2
[PROOF STEP]
by (unfold sq_norm_poly_def, rule sum_list_nonneg, auto intro!:conjugate_square_positive)


[STATEMENT]
lemma ile_add2: "(n::enat) \<le> m + n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m + n
[PROOF STEP]
by (simp only: add.commute[of m] ile_add1)


[STATEMENT]
lemma map_ext: "(\<And>x. x \<in> set xs \<longrightarrow> f x = g x) \<Longrightarrow> map f xs = map g xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<longrightarrow> f x = g x) \<Longrightarrow> map f xs = map g xs
[PROOF STEP]
by (induct xs) simp_all


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


[STATEMENT]
lemma mat_mult_row_code [code abstract]:
  "vec_nth (mat_mult_row m m' f) = (%c. sum (%k. ((m$f)$k) * ((m'$k)$c)) (UNIV :: 'n::finite set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (mat_mult_row m m' f) = (\<lambda>c. \<Sum>k\<in>UNIV. m $ f $ k * m' $ k $ c)
[PROOF STEP]
by(simp add: mat_mult_row_def fun_eq_iff)


[STATEMENT]
lemma val_plus:
  "val (qd1 + qd2) \<delta> = val qd1 \<delta> + val qd2 \<delta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (qd1 + qd2) \<delta> = val qd1 \<delta> + val qd2 \<delta>
[PROOF STEP]
by (simp add: field_simps val_def plus_QDelta_def)


[STATEMENT]
lemma section_map_eq:
   "\<lbrakk>section_map X Y f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> section_map X Y g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>section_map X Y f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> section_map X Y g
[PROOF STEP]
unfolding section_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>g. retraction_maps Y X g f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> \<exists>ga. retraction_maps Y X ga g
[PROOF STEP]
using retraction_maps_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>retraction_maps ?X ?Y ?f ?g; \<And>x. x \<in> topspace ?X \<Longrightarrow> ?f x = ?f' x; \<And>x. x \<in> topspace ?Y \<Longrightarrow> ?g x = ?g' x\<rbrakk> \<Longrightarrow> retraction_maps ?X ?Y ?f' ?g'

goal (1 subgoal):
 1. \<lbrakk>\<exists>g. retraction_maps Y X g f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> \<exists>ga. retraction_maps Y X ga g
[PROOF STEP]
by blast


[STATEMENT]
theorem meet_assoc: "(x \<sqinter> y) \<sqinter> z = x \<sqinter> (y \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqinter> z = x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x \<sqinter> y
 2. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
 3. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x \<sqinter> y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x
 2. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
have "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
have "\<dots> \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> z \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqinter> z \<sqsubseteq> y

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> x \<sqinter> y

goal (2 subgoals):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
 2. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
show "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
have "x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> y \<sqinter> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
have "\<dots> \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> z \<sqsubseteq> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqinter> z \<sqsubseteq> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z

goal (1 subgoal):
 1. x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<sqinter> (y \<sqinter> z) \<sqsubseteq> z

goal (1 subgoal):
 1. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
assume "w \<sqsubseteq> x \<sqinter> y" and "w \<sqsubseteq> z"
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y
w \<sqsubseteq> z

goal (1 subgoal):
 1. \<And>za. \<lbrakk>za \<sqsubseteq> x \<sqinter> y; za \<sqsubseteq> z\<rbrakk> \<Longrightarrow> za \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
show "w \<sqsubseteq> x \<sqinter> (y \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> x \<sqinter> (y \<sqinter> z)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w \<sqsubseteq> x
 2. w \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
show "w \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
have "w \<sqsubseteq> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> x \<sqinter> y
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y

goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y

goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
have "\<dots> \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> x

goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
w \<sqsubseteq> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w \<sqsubseteq> x

goal (1 subgoal):
 1. w \<sqsubseteq> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x

goal (1 subgoal):
 1. w \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
show "w \<sqsubseteq> y \<sqinter> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> y \<sqinter> z
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w \<sqsubseteq> y
 2. w \<sqsubseteq> z
[PROOF STEP]
show "w \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
have "w \<sqsubseteq> x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> x \<sqinter> y
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y

goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> y

goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
have "\<dots> \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> y

goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
w \<sqsubseteq> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w \<sqsubseteq> y

goal (1 subgoal):
 1. w \<sqsubseteq> y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> y

goal (1 subgoal):
 1. w \<sqsubseteq> z
[PROOF STEP]
show "w \<sqsubseteq> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqsubseteq> z
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> y \<sqinter> z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqsubseteq> x \<sqinter> (y \<sqinter> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wens_set_FF:
     "wens_set FF (atLeast k) = insert UNIV (atLeast ` atMost k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wens_set FF {k..} = insert UNIV (atLeast ` {..k})
[PROOF STEP]
apply (auto simp add: wens_set_single_eq [OF FF_eq single_valued_actFF]
                      wens_single_FF_eq_UNIV wens_single_finite_FF)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa xb. \<lbrakk>{xa..} \<notin> range (\<lambda>x. {k - int x..}); xa \<le> k\<rbrakk> \<Longrightarrow> xa \<le> xb
[PROOF STEP]
apply (erule notE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa xb. xa \<le> k \<Longrightarrow> {xa..} \<in> range (\<lambda>x. {k - int x..})
[PROOF STEP]
apply (rule_tac x="nat (k-xa)" in range_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa xb. xa \<le> k \<Longrightarrow> {xa..} = {k - int (nat (k - xa))..}
[PROOF STEP]
apply (simp add: wens_single_finite_FF)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma decide_exis_lem_helper:
  assumes "(fml_struct,polys) = convert fml"
  shows "(\<exists>x::real. lookup_sem fml_struct (map (\<lambda>p. rpoly p x) polys)) \<longleftrightarrow>
    (decide_existential fml)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml_struct (map (\<lambda>p. rpoly p x) polys)) = decide_existential fml
[PROOF STEP]
using existential_lookup_sem main_step
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>i. i \<in> set_fml ?fml \<Longrightarrow> i < length ?qs; set ?signs = consistent_sign_vectors ?qs UNIV\<rbrakk> \<Longrightarrow> (\<exists>x. lookup_sem ?fml (map (\<lambda>p. rpoly p x) ?qs)) = (find (lookup_sem ?fml) ?signs \<noteq> None)
set (find_consistent_signs ?qs) = consistent_sign_vectors ?qs UNIV

goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml_struct (map (\<lambda>p. rpoly p x) polys)) = decide_existential fml
[PROOF STEP]
unfolding decide_existential_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>i. i \<in> set_fml ?fml \<Longrightarrow> i < length ?qs; set ?signs = consistent_sign_vectors ?qs UNIV\<rbrakk> \<Longrightarrow> (\<exists>x. lookup_sem ?fml (map (\<lambda>p. rpoly p x) ?qs)) = (find (lookup_sem ?fml) ?signs \<noteq> None)
set (find_consistent_signs ?qs) = consistent_sign_vectors ?qs UNIV

goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml_struct (map (\<lambda>p. rpoly p x) polys)) = (let (fml_struct, polys) = convert fml; conds = find_consistent_signs polys in find (lookup_sem fml_struct) conds \<noteq> None)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>fml_structa polysa x. \<lbrakk>\<And>fml qs signs. \<lbrakk>\<And>i. i \<in> set_fml fml \<Longrightarrow> i < length qs; set signs = consistent_sign_vectors qs UNIV\<rbrakk> \<Longrightarrow> (\<exists>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = (\<exists>y. find (lookup_sem fml) signs = Some y); \<And>qs. set (find_consistent_signs qs) = consistent_sign_vectors qs UNIV; convert fml = (fml_structa, polysa); lookup_sem fml_struct (map (\<lambda>p. rpoly p x) polys)\<rbrakk> \<Longrightarrow> \<exists>y. find (lookup_sem fml_structa) (find_consistent_signs polysa) = Some y
 2. \<And>x y ya. \<lbrakk>\<And>fml qs signs. \<lbrakk>\<And>i. i \<in> set_fml fml \<Longrightarrow> i < length qs; set signs = consistent_sign_vectors qs UNIV\<rbrakk> \<Longrightarrow> (\<exists>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = (\<exists>y. find (lookup_sem fml) signs = Some y); \<And>qs. set (find_consistent_signs qs) = consistent_sign_vectors qs UNIV; convert fml = (x, y); find (lookup_sem x) (find_consistent_signs y) = Some ya\<rbrakk> \<Longrightarrow> \<exists>x. lookup_sem fml_struct (map (\<lambda>p. rpoly p x) polys)
[PROOF STEP]
apply (metis assms convert_closed fst_conv snd_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y ya. \<lbrakk>\<And>fml qs signs. \<lbrakk>\<And>i. i \<in> set_fml fml \<Longrightarrow> i < length qs; set signs = consistent_sign_vectors qs UNIV\<rbrakk> \<Longrightarrow> (\<exists>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = (\<exists>y. find (lookup_sem fml) signs = Some y); \<And>qs. set (find_consistent_signs qs) = consistent_sign_vectors qs UNIV; convert fml = (x, y); find (lookup_sem x) (find_consistent_signs y) = Some ya\<rbrakk> \<Longrightarrow> \<exists>x. lookup_sem fml_struct (map (\<lambda>p. rpoly p x) polys)
[PROOF STEP]
by (metis (full_types) assms convert_closed fst_conv snd_conv)


[STATEMENT]
lemma tendsto_power_strong [tendsto_intros]:
  fixes f :: "_ \<Rightarrow> 'b :: topological_monoid_mult"
  assumes "(f \<longlongrightarrow> a) F" "(g \<longlongrightarrow> b) F"
  shows   "((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
have "((\<lambda>x. f x ^ b) \<longlongrightarrow> a ^ b) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x ^ b) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
by (induction b) (auto intro: tendsto_intros assms)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x ^ b) \<longlongrightarrow> a ^ b) F

goal (1 subgoal):
 1. ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x ^ b) \<longlongrightarrow> a ^ b) F

goal (1 subgoal):
 1. ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
(g \<longlongrightarrow> b) F
[PROOF STEP]
have "eventually (\<lambda>x. g x = b) F"
[PROOF STATE]
proof (prove)
using this:
(g \<longlongrightarrow> b) F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. g x = b
[PROOF STEP]
by (simp add: nhds_discrete filterlim_principal)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. g x = b

goal (1 subgoal):
 1. ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
hence "eventually (\<lambda>x. f x ^ b = f x ^ g x) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. g x = b

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

goal (1 subgoal):
 1. ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
hence "((\<lambda>x. f x ^ b) \<longlongrightarrow> a ^ b) F \<longleftrightarrow> ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x ^ b = f x ^ g x

goal (1 subgoal):
 1. ((\<lambda>x. f x ^ b) \<longlongrightarrow> a ^ b) F = ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
by (intro filterlim_cong refl)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x ^ b) \<longlongrightarrow> a ^ b) F = ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F

goal (1 subgoal):
 1. ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F

goal (1 subgoal):
 1. ((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x ^ g x) \<longlongrightarrow> a ^ b) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_polynomial_function_diff [intro]:
    "\<lbrakk>real_polynomial_function f; real_polynomial_function g\<rbrakk> \<Longrightarrow> real_polynomial_function (\<lambda>x. f x - g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>real_polynomial_function f; real_polynomial_function g\<rbrakk> \<Longrightarrow> real_polynomial_function (\<lambda>x. f x - g x)
[PROOF STEP]
using polynomial_function_diff [of f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>polynomial_function f; polynomial_function ?g\<rbrakk> \<Longrightarrow> polynomial_function (\<lambda>x. f x - ?g x)

goal (1 subgoal):
 1. \<lbrakk>real_polynomial_function f; real_polynomial_function g\<rbrakk> \<Longrightarrow> real_polynomial_function (\<lambda>x. f x - g x)
[PROOF STEP]
by (simp add: real_polynomial_function_eq)


[STATEMENT]
lemma set_integrable_restrict_space:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes f: "set_integrable M S f" and T: "T \<in> sets (restrict_space M S)"
  shows "set_integrable M T f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M T f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_integrable M T f
[PROOF STEP]
obtain T' where T_eq: "T = S \<inter> T'" and "T' \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>T'. \<lbrakk>T = S \<inter> T'; T' \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using T
[PROOF STATE]
proof (prove)
using this:
T \<in> sets (restrict_space M S)

goal (1 subgoal):
 1. (\<And>T'. \<lbrakk>T = S \<inter> T'; T' \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: sets_restrict_space)
[PROOF STATE]
proof (state)
this:
T = S \<inter> T'
T' \<in> sets M

goal (1 subgoal):
 1. set_integrable M T f
[PROOF STEP]
have \<open>integrable M (\<lambda>x. indicator T' x *\<^sub>R (indicator S x *\<^sub>R f x))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real T' x *\<^sub>R indicat_real S x *\<^sub>R f x)
[PROOF STEP]
using \<open>T' \<in> sets M\<close> f integrable_mult_indicator set_integrable_def
[PROOF STATE]
proof (prove)
using this:
T' \<in> sets M
set_integrable M S f
\<lbrakk>?A \<in> sets ?M; integrable ?M ?f\<rbrakk> \<Longrightarrow> integrable ?M (\<lambda>x. indicat_real ?A x *\<^sub>R ?f x)
set_integrable ?M ?A ?f \<equiv> integrable ?M (\<lambda>x. indicat_real ?A x *\<^sub>R ?f x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real T' x *\<^sub>R indicat_real S x *\<^sub>R f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. indicat_real T' x *\<^sub>R indicat_real S x *\<^sub>R f x)

goal (1 subgoal):
 1. set_integrable M T f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. indicat_real T' x *\<^sub>R indicat_real S x *\<^sub>R f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. indicat_real T' x *\<^sub>R indicat_real S x *\<^sub>R f x)

goal (1 subgoal):
 1. set_integrable M T f
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. indicat_real T' x *\<^sub>R indicat_real S x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real T x *\<^sub>R f x)
[PROOF STEP]
unfolding T_eq indicator_inter_arith
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. indicat_real T' x *\<^sub>R indicat_real S x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. (indicat_real S x * indicat_real T' x) *\<^sub>R f x)
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
set_integrable M T f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma range_subset_upper:
  fixes c :: "'a ::linorder"
  shows "\<lbrakk> {a..b} \<subseteq> {c..d}; x \<in> {a..b} \<rbrakk> \<Longrightarrow> b \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{a..b} \<subseteq> {c..d}; x \<in> {a..b}\<rbrakk> \<Longrightarrow> b \<le> d
[PROOF STEP]
apply (frule (1) subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{a..b} \<subseteq> {c..d}; x \<in> {a..b}; x \<in> {c..d}\<rbrakk> \<Longrightarrow> b \<le> d
[PROOF STEP]
apply (rule classical)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{a..b} \<subseteq> {c..d}; x \<in> {a..b}; x \<in> {c..d}; \<not> b \<le> d\<rbrakk> \<Longrightarrow> b \<le> d
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Im3_tendsto_upperbound:
   "\<lbrakk>(f \<longlongrightarrow> l) net; \<forall>\<^sub>F x in net. Im3 (f x) \<le> b; net \<noteq> bot\<rbrakk> \<Longrightarrow> Im3 l \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> l) net; \<forall>\<^sub>F x in net. Im3 (f x) \<le> b; net \<noteq> bot\<rbrakk> \<Longrightarrow> Im3 l \<le> b
[PROOF STEP]
by (blast intro: tendsto_upperbound [OF tendsto_Im3])


[STATEMENT]
lemma map_key_PP_mapping_of [simp]: "Poly_Mapping.map_key PP (Poly_Mapping.map_key mapping_of p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly_Mapping.map_key PP (Poly_Mapping.map_key pp.mapping_of p) = p
[PROOF STEP]
by (simp add: map_key_compose[OF inj_PP inj_mapping_of] comp_def PP_inverse map_key_id)


[STATEMENT]
lemma sqmatrix_mult_0_left [simp]:
  "0 * (A::('a::{comm_monoid_add,mult_zero},'m) sqmatrix) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<cdot> A = 0
[PROOF STEP]
by (cases A, simp add: zero_sqmatrix_def)


[STATEMENT]
lemma DERIV_add_const: "DERIV f x :> D \<Longrightarrow> DERIV (\<lambda>x. a + f x :: 'a::real_normed_field) x :> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x) \<Longrightarrow> ((\<lambda>x. a + f x) has_field_derivative D) (at x)
[PROOF STEP]
by (rule DERIV_cong, rule DERIV_add) auto


[STATEMENT]
lemma tLength_tZip[iff]: "tLength xs = tLength ys \<Longrightarrow> tLength (tZip f xs ys) = tLength xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tLength xs = tLength ys \<Longrightarrow> tLength (tZip f xs ys) = tLength xs
[PROOF STEP]
by (induct rule: trace_induct2) simp_all


[STATEMENT]
lemma sgn_real_alg: "sgn (real_of x) = real_of (sgn x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (real_of x) = real_of (sgn x)
[PROOF STEP]
unfolding sgn_real_alg_def of_rat_real_alg[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (real_of x) = real_of_rat (sgn_real_alg_rat x)
[PROOF STEP]
by (transfer, simp add: sgn_3)


[STATEMENT]
lemma minorM_eq: "minorM M i j = to_vec (minor (from_vec M) i j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minorM M i j = to_vec (minor (from_vec M) i j)
[PROOF STEP]
unfolding minorM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>k l. if k = i \<and> l = j then 1::'a else if k = i \<or> l = j then 0::'a else M $ k $ l) = to_vec (minor (from_vec M) i j)
[PROOF STEP]
by transfer standard


[STATEMENT]
lemma rel_star_contl: "X ; Y^* = (\<Union>i. X ; rel_d.power Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X ; Y\<^sup>* = (\<Union>i. X ; rel_d.power Y i)
[PROOF STEP]
by (simp add: rel_star_def relcomp_UNION_distrib)


[STATEMENT]
lemma (in prob_space) char_distr_add:
  fixes X1 X2 :: "'a \<Rightarrow> real" and t :: real
  assumes "indep_var borel X1 borel X2"
  shows "char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t =
    char (distr M borel X1) t * char (distr M borel X2) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
indep_var borel X1 borel X2
[PROOF STEP]
have [measurable]: "random_variable borel X1"
[PROOF STATE]
proof (prove)
using this:
indep_var borel X1 borel X2

goal (1 subgoal):
 1. random_variable borel X1
[PROOF STEP]
by (elim indep_var_rv1)
[PROOF STATE]
proof (state)
this:
random_variable borel X1

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
indep_var borel X1 borel X2
[PROOF STEP]
have [measurable]: "random_variable borel X2"
[PROOF STATE]
proof (prove)
using this:
indep_var borel X1 borel X2

goal (1 subgoal):
 1. random_variable borel X2
[PROOF STEP]
by (elim indep_var_rv2)
[PROOF STATE]
proof (state)
this:
random_variable borel X2

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
have "char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = (CLINT x|M. iexp (t * (X1 x + X2 x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = expectation (\<lambda>x. iexp (t * (X1 x + X2 x)))
[PROOF STEP]
by (simp add: char_def integral_distr)
[PROOF STATE]
proof (state)
this:
char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = expectation (\<lambda>x. iexp (t * (X1 x + X2 x)))

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = expectation (\<lambda>x. iexp (t * (X1 x + X2 x)))

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
have "\<dots> = (CLINT x|M. iexp (t * (X1 x)) * iexp (t * (X2 x))) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. iexp (t * (X1 x + X2 x))) = expectation (\<lambda>x. iexp (t * X1 x) * iexp (t * X2 x))
[PROOF STEP]
by (simp add: field_simps exp_add)
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. iexp (t * (X1 x + X2 x))) = expectation (\<lambda>x. iexp (t * X1 x) * iexp (t * X2 x))

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. iexp (t * (X1 x + X2 x))) = expectation (\<lambda>x. iexp (t * X1 x) * iexp (t * X2 x))

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
have "\<dots> = (CLINT x|M. iexp (t * (X1 x))) * (CLINT x|M. iexp (t * (X2 x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. iexp (t * X1 x) * iexp (t * X2 x)) = expectation (\<lambda>x. iexp (t * X1 x)) * expectation (\<lambda>x. iexp (t * X2 x))
[PROOF STEP]
by (intro indep_var_lebesgue_integral indep_var_compose[unfolded comp_def, OF assms])
       (auto intro!: integrable_iexp)
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. iexp (t * X1 x) * iexp (t * X2 x)) = expectation (\<lambda>x. iexp (t * X1 x)) * expectation (\<lambda>x. iexp (t * X2 x))

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. iexp (t * X1 x) * iexp (t * X2 x)) = expectation (\<lambda>x. iexp (t * X1 x)) * expectation (\<lambda>x. iexp (t * X2 x))

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
have "\<dots> = char (distr M borel X1) t * char (distr M borel X2) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. iexp (t * X1 x)) * expectation (\<lambda>x. iexp (t * X2 x)) = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
by (simp add: char_def integral_distr)
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. iexp (t * X1 x)) * expectation (\<lambda>x. iexp (t * X2 x)) = char (distr M borel X1) t * char (distr M borel X2) t

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t

goal (1 subgoal):
 1. char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
char (distr M borel (\<lambda>\<omega>. X1 \<omega> + X2 \<omega>)) t = char (distr M borel X1) t * char (distr M borel X2) t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subspace_elems_embed:
  assumes "is_subspace S k n t"
  shows "S ` (cube k t) \<subseteq> cube n t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S ` cube k t \<subseteq> cube n t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_subspace S k n t

goal (1 subgoal):
 1. S ` cube k t \<subseteq> cube n t
[PROOF STEP]
unfolding cube_def is_subspace_def
[PROOF STATE]
proof (prove)
using this:
\<exists>B f. disjoint_family_on B {..k} \<and> \<Union> (B ` {..k}) = {..<n} \<and> {} \<notin> B ` {..<k} \<and> f \<in> B k \<rightarrow>\<^sub>E {..<t} \<and> S \<in> ({..<k} \<rightarrow>\<^sub>E {..<t}) \<rightarrow>\<^sub>E {..<n} \<rightarrow>\<^sub>E {..<t} \<and> (\<forall>y\<in>{..<k} \<rightarrow>\<^sub>E {..<t}. (\<forall>i\<in>B k. S y i = f i) \<and> (\<forall>j<k. \<forall>i\<in>B j. S y i = y j))

goal (1 subgoal):
 1. S ` ({..<k} \<rightarrow>\<^sub>E {..<t}) \<subseteq> {..<n} \<rightarrow>\<^sub>E {..<t}
[PROOF STEP]
by blast


[STATEMENT]
lemma fps_distl:
  "(f::('a::type,'b::{join_semilattice_zero,semiring}) fps) * (g + h) = (f * g) + (f * h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<cdot> (g + h) = f \<cdot> g + f \<cdot> h
[PROOF STEP]
by (simp add: fps_ext fps_mult_image distrib_left sum_fun_sum)


[STATEMENT]
lemma complex_nonneg_Reals_iff: "z \<in> \<real>\<^sub>\<ge>\<^sub>0 \<longleftrightarrow> Re z \<ge> 0 \<and> Im z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<in> \<real>\<^sub>\<ge>\<^sub>0) = (0 \<le> Re z \<and> Im z = 0)
[PROOF STEP]
by (auto simp: nonneg_Reals_def) (metis complex_of_real_def complex_surj)


[STATEMENT]
theorem E21[simp_unl]: "\<turnstile> \<box>\<diamond>\<box>F = \<diamond>\<box>F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>\<diamond>\<box>F = \<diamond>\<box>F
[PROOF STEP]
by (rule int_iffI[OF E18 E19])


[STATEMENT]
lemma tensor_smult_distr_right: "(\<alpha> + \<beta>) \<cdot> A = \<alpha> \<cdot> A  + \<beta> \<cdot> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<alpha> + \<beta>) \<cdot> A = \<alpha> \<cdot> A + \<beta> \<cdot> A
[PROOF STEP]
unfolding plus_def plus_base_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<alpha> + \<beta>) \<cdot> A = (if dims (\<alpha> \<cdot> A) = dims (\<beta> \<cdot> A) then tensor_from_vec (dims (\<alpha> \<cdot> A)) (vec_plus (vec (\<alpha> \<cdot> A)) (vec (\<beta> \<cdot> A))) else undefined)
[PROOF STEP]
by (auto; metis smult_def vec_smult_def vec_smult_distr_right)


[STATEMENT]
theorem gc_complete:
  assumes
    deriv: "chain (\<leadsto>GC) Ns" and
    init_state: "active_subset (lhd Ns) = {}" and
    final_state: "passive_subset (Liminf_llist Ns) = {}" and
    b_in: "B \<in> Bot_F" and
    bot_entailed: "no_labels.entails_\<G> (fst ` lhd Ns) {B}"
  shows "\<exists>i. enat i < llength Ns \<and> (\<exists>BL \<in> Bot_FL. BL \<in> lnth Ns i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. enat i < llength Ns \<and> (\<exists>BL\<in>Bot_FL. BL \<in> lnth Ns i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i. enat i < llength Ns \<and> (\<exists>BL\<in>Bot_FL. BL \<in> lnth Ns i)
[PROOF STEP]
note lhd_is = lhd_conv_lnth[OF chain_not_lnull[OF deriv]]
[PROOF STATE]
proof (state)
this:
lhd Ns = lnth Ns 0

goal (1 subgoal):
 1. \<exists>i. enat i < llength Ns \<and> (\<exists>BL\<in>Bot_FL. BL \<in> lnth Ns i)
[PROOF STEP]
have "\<exists>BL\<in>Bot_FL. BL \<in> Liminf_llist Ns"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>BL\<in>Bot_FL. BL \<in> Liminf_llist Ns
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
chain (\<leadsto>GC) Ns
active_subset (lhd Ns) = {}
passive_subset (Liminf_llist Ns) = {}
B \<in> Bot_F
fst ` lhd Ns \<Turnstile>\<inter>\<G> {B}

goal (1 subgoal):
 1. \<exists>BL\<in>Bot_FL. BL \<in> Liminf_llist Ns
[PROOF STEP]
by (rule gc_complete_Liminf)
[PROOF STATE]
proof (state)
this:
\<exists>BL\<in>Bot_FL. BL \<in> Liminf_llist Ns

goal (1 subgoal):
 1. \<exists>i. enat i < llength Ns \<and> (\<exists>BL\<in>Bot_FL. BL \<in> lnth Ns i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>BL\<in>Bot_FL. BL \<in> Liminf_llist Ns
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>BL\<in>Bot_FL. BL \<in> Liminf_llist Ns

goal (1 subgoal):
 1. \<exists>i. enat i < llength Ns \<and> (\<exists>BL\<in>Bot_FL. BL \<in> lnth Ns i)
[PROOF STEP]
unfolding Liminf_llist_def
[PROOF STATE]
proof (prove)
using this:
\<exists>BL\<in>Bot_FL. BL \<in> (\<Union>i\<in>{i. enat i < llength Ns}. \<Inter> (lnth Ns ` {j. i \<le> j \<and> enat j < llength Ns}))

goal (1 subgoal):
 1. \<exists>i. enat i < llength Ns \<and> (\<exists>BL\<in>Bot_FL. BL \<in> lnth Ns i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>i. enat i < llength Ns \<and> (\<exists>BL\<in>Bot_FL. BL \<in> lnth Ns i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quotient_of_split:
  "P (quotient_of q) = (\<forall>a b. b > 0 \<longrightarrow> coprime a b \<longrightarrow> q = Rat.Fract a b \<longrightarrow> P (a, b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (quotient_of q) = (\<forall>a b. 0 < b \<longrightarrow> coprime a b \<longrightarrow> q = Rat.Fract a b \<longrightarrow> P (a, b))
[PROOF STEP]
by (cases q) (auto simp: quotient_of_Fract dest: Fract_eq_coprime)


[STATEMENT]
lemma Pring_is_ring:
  shows "ring (Pring R I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring (Pring R I)
[PROOF STEP]
apply(rule ringI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. abelian_group (Pring R I)
 2. Group.monoid (Pring R I)
 3. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>Pring R I\<^esub> y) \<otimes>\<^bsub>Pring R I\<^esub> z = x \<otimes>\<^bsub>Pring R I\<^esub> z \<oplus>\<^bsub>Pring R I\<^esub> y \<otimes>\<^bsub>Pring R I\<^esub> z
 4. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> z \<otimes>\<^bsub>Pring R I\<^esub> (x \<oplus>\<^bsub>Pring R I\<^esub> y) = z \<otimes>\<^bsub>Pring R I\<^esub> x \<oplus>\<^bsub>Pring R I\<^esub> z \<otimes>\<^bsub>Pring R I\<^esub> y
[PROOF STEP]
apply (simp add: Pring_is_abelian_group)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. Group.monoid (Pring R I)
 2. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>Pring R I\<^esub> y) \<otimes>\<^bsub>Pring R I\<^esub> z = x \<otimes>\<^bsub>Pring R I\<^esub> z \<oplus>\<^bsub>Pring R I\<^esub> y \<otimes>\<^bsub>Pring R I\<^esub> z
 3. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> z \<otimes>\<^bsub>Pring R I\<^esub> (x \<oplus>\<^bsub>Pring R I\<^esub> y) = z \<otimes>\<^bsub>Pring R I\<^esub> x \<oplus>\<^bsub>Pring R I\<^esub> z \<otimes>\<^bsub>Pring R I\<^esub> y
[PROOF STEP]
apply (simp add: Pring_is_monoid)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> (x \<oplus>\<^bsub>Pring R I\<^esub> y) \<otimes>\<^bsub>Pring R I\<^esub> z = x \<otimes>\<^bsub>Pring R I\<^esub> z \<oplus>\<^bsub>Pring R I\<^esub> y \<otimes>\<^bsub>Pring R I\<^esub> z
 2. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> z \<otimes>\<^bsub>Pring R I\<^esub> (x \<oplus>\<^bsub>Pring R I\<^esub> y) = z \<otimes>\<^bsub>Pring R I\<^esub> x \<oplus>\<^bsub>Pring R I\<^esub> z \<otimes>\<^bsub>Pring R I\<^esub> y
[PROOF STEP]
apply (simp add: Pring_mult_ldistr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>x \<in> carrier (Pring R I); y \<in> carrier (Pring R I); z \<in> carrier (Pring R I)\<rbrakk> \<Longrightarrow> z \<otimes>\<^bsub>Pring R I\<^esub> (x \<oplus>\<^bsub>Pring R I\<^esub> y) = z \<otimes>\<^bsub>Pring R I\<^esub> x \<oplus>\<^bsub>Pring R I\<^esub> z \<otimes>\<^bsub>Pring R I\<^esub> y
[PROOF STEP]
by (simp add: Pring_mult_rdistr)


[STATEMENT]
lemma sets_restrict_restrict_space:
  "sets (restrict_space (restrict_space M A) B) = sets (restrict_space M (A \<inter> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (restrict_space (restrict_space M A) B) = sets (restrict_space M (A \<inter> B))
[PROOF STEP]
unfolding sets_restrict_space image_comp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<inter>) B \<circ> (\<inter>) A) ` sets M = sets.restricted_space M (A \<inter> B)
[PROOF STEP]
by (intro image_cong) auto


[STATEMENT]
lemma topological_tendstoI:
  "(\<And>S. open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>x. f x \<in> S) F) \<Longrightarrow> (f \<longlongrightarrow> l) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>open S; l \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. f x \<in> S) \<Longrightarrow> (f \<longlongrightarrow> l) F
[PROOF STEP]
by (auto simp: tendsto_def)


[STATEMENT]
lemma ideal_generated_dvd_eq_diff_set:
  assumes i_in_I: "i\<in>I" and i_in_J: "i \<notin> J" and i_dvd_j: "\<forall>j\<in>J. i dvd j"
  and f: "finite J"
  shows "ideal_generated I = ideal_generated (I - J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated I = ideal_generated (I - J)
[PROOF STEP]
using f i_in_J i_dvd_j i_in_I
[PROOF STATE]
proof (prove)
using this:
finite J
i \<notin> J
\<forall>j\<in>J. i dvd j
i \<in> I

goal (1 subgoal):
 1. ideal_generated I = ideal_generated (I - J)
[PROOF STEP]
proof (induct J arbitrary: I)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>I. \<lbrakk>i \<notin> {}; Ball {} ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - {})
 2. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
i \<notin> {}
\<forall>a\<in>{}. i dvd a
i \<in> I

goal (2 subgoals):
 1. \<And>I. \<lbrakk>i \<notin> {}; Ball {} ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - {})
 2. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<notin> {}
\<forall>a\<in>{}. i dvd a
i \<in> I
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i \<notin> {}
\<forall>a\<in>{}. i dvd a
i \<in> I

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

goal (1 subgoal):
 1. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
case (insert x J)
[PROOF STATE]
proof (state)
this:
finite J
x \<notin> J
\<lbrakk>i \<notin> J; \<forall>a\<in>J. i dvd a; i \<in> ?I\<rbrakk> \<Longrightarrow> ideal_generated ?I = ideal_generated (?I - J)
i \<notin> insert x J
\<forall>a\<in>insert x J. i dvd a
i \<in> I

goal (1 subgoal):
 1. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
have "ideal_generated I = ideal_generated (I-{x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated I = ideal_generated (I - {x})
[PROOF STEP]
by (rule ideal_generated_dvd_eq[of i], insert insert.prems , auto)
[PROOF STATE]
proof (state)
this:
ideal_generated I = ideal_generated (I - {x})

goal (1 subgoal):
 1. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ideal_generated I = ideal_generated (I - {x})

goal (1 subgoal):
 1. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
have "... = ideal_generated ((I-{x}) - J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated (I - {x}) = ideal_generated (I - {x} - J)
[PROOF STEP]
by (rule insert.hyps, insert insert.prems insert.hyps, auto)
[PROOF STATE]
proof (state)
this:
ideal_generated (I - {x}) = ideal_generated (I - {x} - J)

goal (1 subgoal):
 1. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ideal_generated (I - {x}) = ideal_generated (I - {x} - J)

goal (1 subgoal):
 1. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
have "... = ideal_generated (I - insert x J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated (I - {x} - J) = ideal_generated (I - insert x J)
[PROOF STEP]
using Diff_insert2[of I x J]
[PROOF STATE]
proof (prove)
using this:
I - insert x J = I - {x} - J

goal (1 subgoal):
 1. ideal_generated (I - {x} - J) = ideal_generated (I - insert x J)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ideal_generated (I - {x} - J) = ideal_generated (I - insert x J)

goal (1 subgoal):
 1. \<And>x F I. \<lbrakk>finite F; x \<notin> F; \<And>I. \<lbrakk>i \<notin> F; Ball F ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - F); i \<notin> insert x F; Ball (insert x F) ((dvd) i); i \<in> I\<rbrakk> \<Longrightarrow> ideal_generated I = ideal_generated (I - insert x F)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ideal_generated I = ideal_generated (I - insert x J)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ideal_generated I = ideal_generated (I - insert x J)

goal (1 subgoal):
 1. ideal_generated I = ideal_generated (I - insert x J)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ideal_generated I = ideal_generated (I - insert x J)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_var[simp]: "infinite (UNIV :: var set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
using card_of_var
[PROOF STATE]
proof (prove)
using this:
|UNIV| =o natLeq

goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
by (rule ordIso_natLeq_infinite1)


[STATEMENT]
theorem univ_is_not_pr: "univ_for_pr \<notin> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ_for_pr \<notin> PrimRec1
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> univ_for_pr \<notin> PrimRec1"
[PROOF STATE]
proof (state)
this:
\<not> univ_for_pr \<notin> PrimRec1

goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> univ_for_pr \<notin> PrimRec1
[PROOF STEP]
have A1: "univ_for_pr \<in> PrimRec1"
[PROOF STATE]
proof (prove)
using this:
\<not> univ_for_pr \<notin> PrimRec1

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

goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
let ?f = "\<lambda> n. univ_for_pr (c_pair n n) + 1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
let ?n0 = "index_of_pr ?f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
univ_for_pr \<in> PrimRec1
[PROOF STEP]
have S1: "?f \<in> PrimRec1"
[PROOF STATE]
proof (prove)
using this:
univ_for_pr \<in> PrimRec1

goal (1 subgoal):
 1. (\<lambda>n. univ_for_pr (c_pair n n) + 1) \<in> PrimRec1
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>n. univ_for_pr (c_pair n n) + 1) \<in> PrimRec1

goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. univ_for_pr (c_pair n n) + 1) \<in> PrimRec1
[PROOF STEP]
have S2: "nat_to_pr ?n0 = ?f"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. univ_for_pr (c_pair n n) + 1) \<in> PrimRec1

goal (1 subgoal):
 1. nat_to_pr (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) = (\<lambda>n. univ_for_pr (c_pair n n) + 1)
[PROOF STEP]
by (rule index_of_pr_is_real)
[PROOF STATE]
proof (state)
this:
nat_to_pr (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) = (\<lambda>n. univ_for_pr (c_pair n n) + 1)

goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_to_pr (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) = (\<lambda>n. univ_for_pr (c_pair n n) + 1)
[PROOF STEP]
have S3: "nat_to_pr ?n0 ?n0 = ?f ?n0"
[PROOF STATE]
proof (prove)
using this:
nat_to_pr (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) = (\<lambda>n. univ_for_pr (c_pair n n) + 1)

goal (1 subgoal):
 1. nat_to_pr (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) = univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_to_pr (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) = univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1

goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
have S4: "?f ?n0 = univ_for_pr (c_pair ?n0 ?n0) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1 = univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1 = univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1

goal (1 subgoal):
 1. \<not> univ_for_pr \<notin> PrimRec1 \<Longrightarrow> False
[PROOF STEP]
from S3 S4
[PROOF STATE]
proof (chain)
picking this:
nat_to_pr (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) = univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1
univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1 = univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
nat_to_pr (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) = univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1
univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1 = univ_for_pr (c_pair (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1)) (index_of_pr (\<lambda>n. univ_for_pr (c_pair n n) + 1))) + 1

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Group) tOp_assocTr44:"\<lbrakk>a \<in> carrier G; b \<in> carrier G; c \<in> carrier G;
      d \<in> carrier G \<rbrakk> \<Longrightarrow> (\<rho> a) \<cdot> b \<cdot> ((\<rho> c) \<cdot> d) =
                                         (\<rho>  a) \<cdot> ((b \<cdot> (\<rho> c)) \<cdot> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; b \<in> carrier G; c \<in> carrier G; d \<in> carrier G\<rbrakk> \<Longrightarrow> \<rho> a \<cdot> b \<cdot> (\<rho> c \<cdot> d) = \<rho> a \<cdot> (b \<cdot> \<rho> c \<cdot> d)
[PROOF STEP]
apply (frule i_closed[of "a"],
       frule i_closed[of "c"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; b \<in> carrier G; c \<in> carrier G; d \<in> carrier G; \<rho> a \<in> carrier G; \<rho> c \<in> carrier G\<rbrakk> \<Longrightarrow> \<rho> a \<cdot> b \<cdot> (\<rho> c \<cdot> d) = \<rho> a \<cdot> (b \<cdot> \<rho> c \<cdot> d)
[PROOF STEP]
apply (simp add:tassoc[of "b" "\<rho> c" "d"],
       frule mult_closed[of "\<rho> c" "d"], assumption+,
       simp add:tassoc[THEN sym, of "\<rho> a" "b" "(\<rho> c) \<cdot> d"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mapping_single_eq_iff [simp]:
  "Poly_Mapping.single a b = Poly_Mapping.single c d \<longleftrightarrow> b = 0 \<and> d = 0 \<or> a = c \<and> b = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Poly_Mapping.single a b = Poly_Mapping.single c d) = (b = (0::'b) \<and> d = (0::'b) \<or> a = c \<and> b = d)
[PROOF STEP]
by transfer (unfold fun_eq_iff when_def, metis)


[STATEMENT]
lemma ccw'_mirror_point3[simp]:
  "ccw' (mirror_point x y) (mirror_point x z) (mirror_point x w) \<longleftrightarrow> ccw' y z w "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw' (mirror_point x y) (mirror_point x z) (mirror_point x w) = ccw' y z w
[PROOF STEP]
by (auto simp: mirror_point_def det3_def' ccw'_def algebra_simps)


[STATEMENT]
lemma fundfoldpairs_induced_autormorph_order2:
  "(f,g) \<in> fundfoldpairs \<Longrightarrow> induced_automorph f g \<circ> induced_automorph f g = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f, g) \<in> fundfoldpairs \<Longrightarrow> induced_automorph f g \<circ> induced_automorph f g = id
[PROOF STEP]
using     OpposedThinChamberComplexFoldings.indaut_order2
[PROOF STATE]
proof (prove)
using this:
OpposedThinChamberComplexFoldings ?X ?f ?g ?C0.0 \<Longrightarrow> OpposedThinChamberComplexFoldings.induced_automorphism ?X ?f ?g \<circ> OpposedThinChamberComplexFoldings.induced_automorphism ?X ?f ?g = id

goal (1 subgoal):
 1. (f, g) \<in> fundfoldpairs \<Longrightarrow> induced_automorph f g \<circ> induced_automorph f g = id
[PROOF STEP]
unfolding fundfoldpairs_def
[PROOF STATE]
proof (prove)
using this:
OpposedThinChamberComplexFoldings ?X ?f ?g ?C0.0 \<Longrightarrow> OpposedThinChamberComplexFoldings.induced_automorphism ?X ?f ?g \<circ> OpposedThinChamberComplexFoldings.induced_automorphism ?X ?f ?g = id

goal (1 subgoal):
 1. (f, g) \<in> {(f, g). OpposedThinChamberComplexFoldings X f g C0} \<Longrightarrow> induced_automorph f g \<circ> induced_automorph f g = id
[PROOF STEP]
by        fast


[STATEMENT]
lemma (in prob_space) expectation_greater:
  fixes X :: "_ \<Rightarrow> real"
  assumes [simp]: "integrable M X"
  assumes gt: "AE x in M. a < X x"
  shows "a < expectation X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < expectation X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a < expectation X
[PROOF STEP]
have "expectation (\<lambda>x. a) < expectation X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. a) < expectation X
[PROOF STEP]
using gt emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
AE x in M. a < X x
emeasure M (space M) = 1

goal (1 subgoal):
 1. expectation (\<lambda>x. a) < expectation X
[PROOF STEP]
by (intro integral_less_AE_space) auto
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. a) < expectation X

goal (1 subgoal):
 1. a < expectation X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
expectation (\<lambda>x. a) < expectation X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
expectation (\<lambda>x. a) < expectation X

goal (1 subgoal):
 1. a < expectation X
[PROOF STEP]
using prob_space
[PROOF STATE]
proof (prove)
using this:
expectation (\<lambda>x. a) < expectation X
prob (space M) = 1

goal (1 subgoal):
 1. a < expectation X
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a < expectation X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sup_union[simp]: "Sup (range A) i =  (\<Union> w . A w i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>range A) i = (\<Union>w. A w i)
[PROOF STEP]
by (simp_all add: Sup_fun_def)


[STATEMENT]
lemma (in fixed_carrier_mat) sum_mat_insert:
  assumes "A x \<in> fc_mats" "A ` I \<subseteq> fc_mats"
    and A: "finite I" and x: "x \<notin> I"
  shows "sum_mat A (insert x I) = A x + sum_mat A I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat A (insert x I) = A x + local.sum_mat A I
[PROOF STEP]
unfolding sum_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_with (+) (0\<^sub>m dimR dimC) A (insert x I) = A x + sum_with (+) (0\<^sub>m dimR dimC) A I
[PROOF STEP]
using assms sum_with_insert[of A x I]
[PROOF STATE]
proof (prove)
using this:
A x \<in> fc_mats
A ` I \<subseteq> fc_mats
finite I
x \<notin> I
\<lbrakk>A x \<in> fc_mats; A ` I \<subseteq> fc_mats; finite I; x \<notin> I\<rbrakk> \<Longrightarrow> sum_with (+) (0\<^sub>m dimR dimC) A (insert x I) = A x + sum_with (+) (0\<^sub>m dimR dimC) A I

goal (1 subgoal):
 1. sum_with (+) (0\<^sub>m dimR dimC) A (insert x I) = A x + sum_with (+) (0\<^sub>m dimR dimC) A I
[PROOF STEP]
by simp


[STATEMENT]
lemma cf_prod_2_Rel_ArrMap_app[cat_cs_simps]:
  assumes "GF = [G, F]\<^sub>\<circ>" and "GF \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>C \<AA>)\<lparr>Arr\<rparr>"
  shows "G \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>cf_prod_2_Rel \<AA>\<^esub> F = G \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>cf_prod_2_Rel \<AA>\<^esub> F = G \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l F
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
GF \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>C \<AA>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. G \<otimes>\<^sub>H\<^sub>M\<^sub>.\<^sub>A\<^bsub>cf_prod_2_Rel \<AA>\<^esub> F = G \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l F
[PROOF STEP]
unfolding assms(1) cf_prod_2_Rel_components
[PROOF STATE]
proof (prove)
using this:
[G, F]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>C \<AA>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<lambda>ST\<in>\<^sub>\<circ>(\<AA> \<times>\<^sub>C \<AA>)\<lparr>Arr\<rparr>. ST\<lparr>[]\<^sub>\<circ>\<rparr> \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l ST\<lparr>1\<^sub>\<nat>\<rparr>) \<lparr>G, F\<rparr>\<^sub>\<bullet> = G \<^sub>A\<times>\<^sub>R\<^sub>e\<^sub>l F
[PROOF STEP]
by (simp add: nat_omega_simps)


[STATEMENT]
lemma upset_faithful: "\<up>x \<subseteq> \<up>y \<Longrightarrow> y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<up> x \<subseteq> \<up> y \<Longrightarrow> y \<le> x
[PROOF STEP]
by (metis inj_image_subset_iff downset_faithful dual_dual_ord inj_dual upset_to_downset3)


[STATEMENT]
lemma him_eq: "HIm p = HIm q \<longleftrightarrow> Im1 p = Im1 q \<and> Im2 p = Im2 q \<and> Im3 p = Im3 q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (HIm p = HIm q) = (Im1 p = Im1 q \<and> Im2 p = Im2 q \<and> Im3 p = Im3 q)
[PROOF STEP]
by (metis HIm_def vector_3)


[STATEMENT]
lemma closed_affine_hull [iff]:
  fixes S :: "'n::euclidean_space set"
  shows "closed (affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (affine hull S)
[PROOF STEP]
by (metis affine_affine_hull affine_closed)


[STATEMENT]
lemma ex_toCard_pred:
  "\<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists> f. toCard_pred A r f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists>f. toCard_pred A r f
[PROOF STEP]
unfolding toCard_pred_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists>f. inj_on f A \<and> f ` A \<subseteq> Field r \<and> Card_order r
[PROOF STEP]
using card_of_ordLeq[of A "Field r"]
    ordLeq_ordIso_trans[OF _ card_of_unique[of "Field r" r], of "|A|"]
[PROOF STATE]
proof (prove)
using this:
(\<exists>f. inj_on f A \<and> f ` A \<subseteq> Field r) = (|A| \<le>o |Field r|)
\<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> |A| \<le>o |Field r|

goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists>f. inj_on f A \<and> f ` A \<subseteq> Field r \<and> Card_order r
[PROOF STEP]
by blast


[STATEMENT]
lemma measure_spmf_map_pmf_Some [simp]:
  "measure (measure_spmf (map_pmf Some p)) A = measure (measure_pmf p) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (measure_spmf (map_pmf Some p)) A = measure_pmf.prob p A
[PROOF STEP]
using emeasure_spmf_map_pmf_Some[of p A]
[PROOF STATE]
proof (prove)
using this:
emeasure (measure_spmf (map_pmf Some p)) A = emeasure (measure_pmf p) A

goal (1 subgoal):
 1. Sigma_Algebra.measure (measure_spmf (map_pmf Some p)) A = measure_pmf.prob p A
[PROOF STEP]
by(simp add: measure_spmf.emeasure_eq_measure measure_pmf.emeasure_eq_measure)


[STATEMENT]
lemma Prefixes_altdef [code]: "Prefixes A = (\<Union>w\<in>A. set (prefixes w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Prefixes A = (\<Union>w\<in>A. set (prefixes w))
[PROOF STEP]
unfolding Prefixes_def set_prefixes_eq prefix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {w. \<exists>q. w @ q \<in> A} = (\<Union>w\<in>A. {ys. \<exists>zs. w = ys @ zs})
[PROOF STEP]
by blast


[STATEMENT]
lemma eventually_less_ceiling:
  fixes f :: "'a \<Rightarrow> 'b::{order_topology,floor_ceiling}"
  assumes f: "(f \<longlongrightarrow> l) F"
    and l: "l \<notin> \<int>"
  shows "\<forall>\<^sub>F x in F. f x < of_int (ceiling l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < of_int \<lceil>l\<rceil>
[PROOF STEP]
by (intro order_tendstoD[OF f]) (metis Ints_of_int l le_of_int_ceiling less_le)


[STATEMENT]
theorem Seq_Sbis[simp]:
assumes "c1 \<approx>s d1" and "c2 \<approx>s d2"
shows "c1 ;; c2 \<approx>s d1 ;; d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 ;; c2 \<approx>s d1 ;; d2
[PROOF STEP]
using assms thetaSeq_Sbis
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>s d1
c2 \<approx>s d2
thetaSeq \<subseteq> Sbis

goal (1 subgoal):
 1. c1 ;; c2 \<approx>s d1 ;; d2
[PROOF STEP]
unfolding thetaSeq_def
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>s d1
c2 \<approx>s d2
{(c1 ;; c2, d1 ;; d2) |c1 c2 d1 d2. c1 \<approx>s d1 \<and> c2 \<approx>s d2} \<subseteq> Sbis

goal (1 subgoal):
 1. c1 ;; c2 \<approx>s d1 ;; d2
[PROOF STEP]
by blast


[STATEMENT]
lemma prod_fBallI: "(\<And>a b. (a, b) |\<in>| M \<Longrightarrow> P a b) \<Longrightarrow> fBall M (\<lambda>(a, b). P a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. (a, b) |\<in>| M \<Longrightarrow> P a b) \<Longrightarrow> fBall M (\<lambda>(a, b). P a b)
[PROOF STEP]
by transfer (rule prod_BallI)


[STATEMENT]
lemma inner_divide_right:
  fixes a :: "'a :: {real_inner,real_div_algebra}"
  shows "inner a (b / of_real m) = (inner a b) / m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner a (b / of_real m) = inner a b / m
[PROOF STEP]
by (metis inner_commute inner_divide_left)


[STATEMENT]
lemma subdegree_power [simp]:
  "subdegree ((f :: ('a :: semiring_1_no_zero_divisors) fps) ^ n) = n * subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (f ^ n) = n * subdegree f
[PROOF STEP]
by (cases "f = 0"; induction n) simp_all


[STATEMENT]
lemma closed_Collect_eq:
  fixes f g :: "'a::topological_space \<Rightarrow> 'b::t2_space"
  assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"
  shows "closed {x. f x = g x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. f x = g x}
[PROOF STEP]
using open_Collect_neq[OF f g]
[PROOF STATE]
proof (prove)
using this:
open {x. f x \<noteq> g x}

goal (1 subgoal):
 1. closed {x. f x = g x}
[PROOF STEP]
by (simp add: closed_def Collect_neg_eq)


[STATEMENT]
lemma scale_pos_left:
  assumes "c > 0"
  shows "vNM_utility outcomes relation (\<lambda>x. c * u x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vNM_utility outcomes relation (\<lambda>x. c * u x)
[PROOF STEP]
proof(standard, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. relation \<subseteq> \<P> outcomes \<times> \<P> outcomes
 2. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. relation \<subseteq> \<P> outcomes \<times> \<P> outcomes
 2. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relation \<subseteq> \<P> outcomes \<times> \<P> outcomes
[PROOF STEP]
using vNM_utility_axioms vNM_utility_def
[PROOF STATE]
proof (prove)
using this:
vNM_utility outcomes relation u
vNM_utility ?outcomes ?relation ?u \<equiv> ?relation \<subseteq> \<P> ?outcomes \<times> \<P> ?outcomes \<and> (\<forall>p q. p \<in> \<P> ?outcomes \<longrightarrow> q \<in> \<P> ?outcomes \<longrightarrow> p \<succeq>[?relation] q = (measure_pmf.expectation q ?u \<le> measure_pmf.expectation p ?u))

goal (1 subgoal):
 1. relation \<subseteq> \<P> outcomes \<times> \<P> outcomes
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
relation \<subseteq> \<P> outcomes \<times> \<P> outcomes

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
case (2 p q)
[PROOF STATE]
proof (state)
this:
p \<in> \<P> outcomes
q \<in> \<P> outcomes

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
have "q \<in> lotteries_on outcomes" and "p \<in> lotteries_on outcomes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<in> \<P> outcomes &&& p \<in> \<P> outcomes
[PROOF STEP]
using "2"(2)
[PROOF STATE]
proof (prove)
using this:
q \<in> \<P> outcomes

goal (1 subgoal):
 1. q \<in> \<P> outcomes &&& p \<in> \<P> outcomes
[PROOF STEP]
by (simp add: fnt "2"(1))+
[PROOF STATE]
proof (state)
this:
q \<in> \<P> outcomes
p \<in> \<P> outcomes

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q \<in> \<P> outcomes
p \<in> \<P> outcomes
[PROOF STEP]
have *: "p \<succeq> q = (measure_pmf.expectation q u \<le> measure_pmf.expectation p u)"
[PROOF STATE]
proof (prove)
using this:
q \<in> \<P> outcomes
p \<in> \<P> outcomes

goal (1 subgoal):
 1. p \<succeq> q = (measure_pmf.expectation q u \<le> measure_pmf.expectation p u)
[PROOF STEP]
using expected_utility_weak_preference[of p q] assms
[PROOF STATE]
proof (prove)
using this:
q \<in> \<P> outcomes
p \<in> \<P> outcomes
\<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z))
0 < c

goal (1 subgoal):
 1. p \<succeq> q = (measure_pmf.expectation q u \<le> measure_pmf.expectation p u)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<succeq> q = (measure_pmf.expectation q u \<le> measure_pmf.expectation p u)

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
have dist_c: "(\<Sum>z\<in>outcomes. (pmf q z) * (c * u z)) = c * (\<Sum>z\<in>outcomes. (pmf q z) * (u z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)
[PROOF STEP]
using pos_distrib_left[of c q] assms
[PROOF STATE]
proof (prove)
using this:
0 < c \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)
0 < c

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
have dist_c': "(\<Sum>z\<in>outcomes. (pmf p z) * (c * u z)) = c * (\<Sum>z\<in>outcomes. (pmf p z) * (u z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using pos_distrib_left[of c p] assms
[PROOF STATE]
proof (prove)
using this:
0 < c \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)
0 < c

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
have "p \<succeq> q \<longleftrightarrow> ((\<Sum>z\<in>outcomes. (pmf q z) * (c * u z)) \<le> (\<Sum>z\<in>outcomes. (pmf p z) * (c * u z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)))
[PROOF STEP]
proof (rule iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<succeq> q \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
 2. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
assume "p \<succeq> q"
[PROOF STATE]
proof (state)
this:
p \<succeq> q

goal (2 subgoals):
 1. p \<succeq> q \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
 2. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<succeq> q
[PROOF STEP]
have "(\<Sum>z\<in>outcomes. pmf q z * (u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (u z))"
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using utility_ge
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q
?p \<succeq> ?q \<Longrightarrow> measure_pmf.expectation ?q u \<le> measure_pmf.expectation ?p u

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using "2"(1) "2"(2) sum_equals_pmf_expectation
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q
?p \<succeq> ?q \<Longrightarrow> measure_pmf.expectation ?q u \<le> measure_pmf.expectation ?p u
p \<in> \<P> outcomes
q \<in> \<P> outcomes
?p \<in> \<P> outcomes \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf ?p z * u z) = measure_pmf.expectation ?p u

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (2 subgoals):
 1. p \<succeq> q \<Longrightarrow> (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
 2. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
show "(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
[PROOF STEP]
using dist_c dist_c'
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf q z * u z)
(\<Sum>z\<in>outcomes. pmf p z * (c * u z)) = c * (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
assume "(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))"
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
[PROOF STEP]
have "(\<Sum>z\<in>outcomes. pmf q z * (u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (u z))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using "2"(1) mult_le_cancel_iff2 assms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z))
p \<in> \<P> outcomes
(0::?'a) < ?z \<Longrightarrow> (?z * ?x \<le> ?z * ?y) = (?x \<le> ?y)
0 < c

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
by (simp add: dist_c dist_c')
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)) \<Longrightarrow> p \<succeq> q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
show "p \<succeq> q"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)

goal (1 subgoal):
 1. p \<succeq> q
[PROOF STEP]
using "2"(2) assms "2"(1)
[PROOF STATE]
proof (prove)
using this:
(\<Sum>z\<in>outcomes. pmf q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf p z * u z)
q \<in> \<P> outcomes
0 < c
p \<in> \<P> outcomes

goal (1 subgoal):
 1. p \<succeq> q
[PROOF STEP]
by (simp add: * sum_equals_pmf_expectation)
[PROOF STATE]
proof (state)
this:
p \<succeq> q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)))

goal (1 subgoal):
 1. \<And>p q. \<lbrakk>p \<in> \<P> outcomes; q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q = ((\<Sum>z\<in>outcomes. pmf q z * (c * u z)) \<le> (\<Sum>z\<in>outcomes. pmf p z * (c * u z)))

goal (1 subgoal):
 1. p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))
[PROOF STEP]
by (simp add: "*" assms)
[PROOF STATE]
proof (state)
this:
p \<succeq> q = (measure_pmf.expectation q (\<lambda>x. c * u x) \<le> measure_pmf.expectation p (\<lambda>x. c * u x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma abs_summable_on_reindex:
  assumes "(\<lambda>x. f (g x)) abs_summable_on A"
  shows   "f abs_summable_on (g ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
define g' where "g' = inv_into A g"
[PROOF STATE]
proof (state)
this:
g' = inv_into A g

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (g x)) abs_summable_on A
[PROOF STEP]
have "(\<lambda>x. f (g x)) abs_summable_on (g' ` g ` A)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (g x)) abs_summable_on A

goal (1 subgoal):
 1. (\<lambda>x. f (g x)) abs_summable_on g' ` g ` A
[PROOF STEP]
by (rule abs_summable_on_subset) (auto simp: g'_def inv_into_into)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (g x)) abs_summable_on g' ` g ` A

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (g x)) abs_summable_on g' ` g ` A

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
have "?this \<longleftrightarrow> (\<lambda>x. f (g (g' x))) abs_summable_on (g ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) abs_summable_on g' ` g ` A) = ((\<lambda>x. f (g (g' x))) abs_summable_on g ` A)
[PROOF STEP]
unfolding g'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) abs_summable_on inv_into A g ` g ` A) = ((\<lambda>x. f (g (inv_into A g x))) abs_summable_on g ` A)
[PROOF STEP]
by (intro abs_summable_on_reindex_bij_betw [symmetric] inj_on_imp_bij_betw inj_on_inv_into) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (g x)) abs_summable_on g' ` g ` A) = ((\<lambda>x. f (g (g' x))) abs_summable_on g ` A)

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (g x)) abs_summable_on g' ` g ` A) = ((\<lambda>x. f (g (g' x))) abs_summable_on g ` A)

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
have "\<dots> \<longleftrightarrow> f abs_summable_on (g ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g (g' x))) abs_summable_on g ` A) = (f abs_summable_on g ` A)
[PROOF STEP]
by (intro abs_summable_on_cong refl) (auto simp: g'_def f_inv_into_f)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (g (g' x))) abs_summable_on g ` A) = (f abs_summable_on g ` A)

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f abs_summable_on g ` A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f abs_summable_on g ` A

goal (1 subgoal):
 1. f abs_summable_on g ` A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f abs_summable_on g ` A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_pos[intro]: "0 < n!"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n!
[PROOF STEP]
apply(induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < 0!
 2. \<And>n. 0 < n! \<Longrightarrow> 0 < Suc n!
[PROOF STEP]
apply(auto simp: fac.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mem_samp_primes_gt_2:
  shows "x \<in> set_spmf sample_primes \<Longrightarrow> x > 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set_spmf sample_primes \<Longrightarrow> 2 < x
[PROOF STEP]
apply (simp add: finite_prime_set sample_primes_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> prime_set \<Longrightarrow> 2 < x
[PROOF STEP]
using prime_set_ass
[PROOF STATE]
proof (prove)
using this:
prime_set \<subseteq> {x. prime x \<and> 2 < x}

goal (1 subgoal):
 1. x \<in> prime_set \<Longrightarrow> 2 < x
[PROOF STEP]
by blast


[STATEMENT]
lemma map_of_tabulate:
  "map_of (map (\<lambda>x. (x, f x)) xs) x \<noteq> None \<longleftrightarrow> x \<in> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_of (map (\<lambda>x. (x, f x)) xs) x \<noteq> None) = (x \<in> set xs)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma eventually_nonzero_inverse [eventually_nonzero_simps]:
  "eventually_nonzero F (\<lambda>x. inverse (f x)) \<longleftrightarrow> eventually_nonzero F f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonzero F (\<lambda>x. inverse (f x)) = eventually_nonzero F f
[PROOF STEP]
unfolding eventually_nonzero_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. inverse (f x) \<noteq> (0::'b)) = (\<forall>\<^sub>F x in F. f x \<noteq> (0::'b))
[PROOF STEP]
by simp


[STATEMENT]
lemma quasi_transD: "\<lbrakk> x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z; quasi_trans r \<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z; quasi_trans r\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z
[PROOF STEP]
unfolding quasi_trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<^bsub>r\<^esub>\<prec> y; y \<^bsub>r\<^esub>\<prec> z; \<forall>x y z. x \<^bsub>r\<^esub>\<prec> y \<and> y \<^bsub>r\<^esub>\<prec> z \<longrightarrow> x \<^bsub>r\<^esub>\<prec> z\<rbrakk> \<Longrightarrow> x \<^bsub>r\<^esub>\<prec> z
[PROOF STEP]
by blast


[STATEMENT]
lemma coeff_sym_mpoly_monom_of_set_eq_0:
  assumes "finite X" "Y \<subseteq> X" "card Y \<noteq> k"
  shows   "MPoly_Type.coeff (sym_mpoly X k) (monom_of_set Y) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff (sym_mpoly X k) (monom_of_set Y) = (0::'a)
[PROOF STEP]
using assms finite_subset[of _ X]
[PROOF STATE]
proof (prove)
using this:
finite X
Y \<subseteq> X
card Y \<noteq> k
\<lbrakk>?A \<subseteq> X; finite X\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. MPoly_Type.coeff (sym_mpoly X k) (monom_of_set Y) = (0::'a)
[PROOF STEP]
by (auto simp: coeff_sym_mpoly)


[STATEMENT]
lemma index_non_zero_implies_no_group:
  assumes "ps \<subseteq> \<V>"
    and  "card ps = 2"
    and "\<B> index ps = \<Lambda>"
  shows "size {#b \<in>#  mset_set \<G> . ps \<subseteq> b#} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
have "\<And> G . G \<in> \<G> \<Longrightarrow>  \<not> ps \<subseteq> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>G. G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> G
[PROOF STEP]
using index_not_zero_impl_diff_group assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?ps \<subseteq> \<V>; card ?ps = 2; int (\<B> index ?ps) = \<Lambda>; ?G \<in> \<G>\<rbrakk> \<Longrightarrow> \<not> ?ps \<subseteq> ?G
ps \<subseteq> \<V>
card ps = 2
int (\<B> index ps) = \<Lambda>

goal (1 subgoal):
 1. \<And>G. G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> ?G

goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> ?G
[PROOF STEP]
have "{#b \<in>#  mset_set \<G> . ps \<subseteq> b#} = {#}"
[PROOF STATE]
proof (prove)
using this:
?G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> ?G

goal (1 subgoal):
 1. filter_mset ((\<subseteq>) ps) (mset_set \<G>) = {#}
[PROOF STEP]
using filter_mset_empty_if_finite_and_filter_set_empty
[PROOF STATE]
proof (prove)
using this:
?G \<in> \<G> \<Longrightarrow> \<not> ps \<subseteq> ?G
\<lbrakk>{x \<in> ?X. ?P x} = {}; finite ?X\<rbrakk> \<Longrightarrow> filter_mset ?P (mset_set ?X) = {#}

goal (1 subgoal):
 1. filter_mset ((\<subseteq>) ps) (mset_set \<G>) = {#}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
filter_mset ((\<subseteq>) ps) (mset_set \<G>) = {#}

goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
filter_mset ((\<subseteq>) ps) (mset_set \<G>) = {#}

goal (1 subgoal):
 1. size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma harm_expand:
  "harm 0 = 0"
  "harm (Suc 0) = 1"
  "harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. harm 0 = (0::'a) &&& harm (Suc 0) = (1::'b) &&& harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
 3. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
have "numeral n = Suc (pred_numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral n = Suc (pred_numeral n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
numeral n = Suc (pred_numeral n)

goal (3 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
 3. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
numeral n = Suc (pred_numeral n)

goal (3 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
 3. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
have "harm \<dots> = harm (pred_numeral n) + inverse (numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. harm (Suc (pred_numeral n)) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
by (subst harm_Suc, subst numeral_eq_Suc[symmetric]) simp
[PROOF STATE]
proof (state)
this:
harm (Suc (pred_numeral n)) = harm (pred_numeral n) + inverse (numeral n)

goal (3 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
 3. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
show "harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)"
[PROOF STATE]
proof (prove)
using this:
harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)

goal (1 subgoal):
 1. harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
harm (numeral n) = harm (pred_numeral n) + inverse (numeral n)

goal (2 subgoals):
 1. harm 0 = (0::'a)
 2. harm (Suc 0) = (1::'b)
[PROOF STEP]
qed (simp_all add: harm_def)


[STATEMENT]
lemma mapM_None:
  "mapM f xs = None \<longleftrightarrow> (\<exists>x\<in>set xs. f x = None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mapM f xs = None) = (\<exists>x\<in>set xs. f x = None)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (mapM f [] = None) = (\<exists>x\<in>set []. f x = None)
 2. \<And>a xs. (mapM f xs = None) = (\<exists>x\<in>set xs. f x = None) \<Longrightarrow> (mapM f (a # xs) = None) = (\<exists>x\<in>set (a # xs). f x = None)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
(mapM f xs = None) = (\<exists>x\<in>set xs. f x = None)

goal (2 subgoals):
 1. (mapM f [] = None) = (\<exists>x\<in>set []. f x = None)
 2. \<And>a xs. (mapM f xs = None) = (\<exists>x\<in>set xs. f x = None) \<Longrightarrow> (mapM f (a # xs) = None) = (\<exists>x\<in>set (a # xs). f x = None)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(mapM f xs = None) = (\<exists>x\<in>set xs. f x = None)

goal (1 subgoal):
 1. (mapM f (x # xs) = None) = (\<exists>x\<in>set (x # xs). f x = None)
[PROOF STEP]
by (cases "f x", simp, cases "mapM f xs", auto)
[PROOF STATE]
proof (state)
this:
(mapM f (x # xs) = None) = (\<exists>x\<in>set (x # xs). f x = None)

goal (1 subgoal):
 1. (mapM f [] = None) = (\<exists>x\<in>set []. f x = None)
[PROOF STEP]
qed simp