[STATEMENT]
lemma Amax_ge:"\<lbrakk>f \<in> {j. j \<le> n} \<rightarrow> Z\<^sub>-\<^sub>\<infinity>; j \<in> {j. j \<le> n}\<rbrakk> \<Longrightarrow>
                                                 (f j) \<le> (Amax n f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {j. j \<le> n} \<rightarrow> Z\<^sub>-\<^sub>\<infinity>; j \<in> {j. j \<le> n}\<rbrakk> \<Longrightarrow> f j \<le> Amax n f
[PROOF STEP]
apply (simp add:Amax_geTr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inj_on_inv_image_inv_of_rat_Pow_rat: "inj_on (image (inv of_rat)) (Pow \<rat>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((`) (inv of_rat)) (Pow \<rat>)
[PROOF STEP]
by (simp add: inj_on_inv_of_rat_rat inj_on_image_Pow)


[STATEMENT]
lemma app_tl_empty_length[rule_format]: "tl (map f [0..<length l] @ [a]) = []
                                        \<Longrightarrow> l = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tl (map f [0..<length l] @ [a]) = [] \<Longrightarrow> l = []
[PROOF STEP]
by (drule tl_hd_empty, simp)


[STATEMENT]
lemma lemma_2_5_13_a: "a \<le> b \<Longrightarrow>  b l\<rightarrow> c \<le> a l\<rightarrow> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> b l\<rightarrow> c \<le> a l\<rightarrow> c
[PROOF STEP]
apply (simp add: left_residual [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> (b l\<rightarrow> c) * a \<le> c
[PROOF STEP]
apply (rule_tac y = "(b l\<rightarrow> c) * b" in order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> (b l\<rightarrow> c) * a \<le> (b l\<rightarrow> c) * b
 2. a \<le> b \<Longrightarrow> (b l\<rightarrow> c) * b \<le> c
[PROOF STEP]
apply (simp add: mult_left_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> (b l\<rightarrow> c) * b \<le> c
[PROOF STEP]
by (simp add: left_residual)


[STATEMENT]
lemma sum_upto_ln_conv_sum_upto_mangoldt:
  "sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * nat \<lfloor>x / real n\<rfloor>) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
have "sum_upto (\<lambda>n. ln (real n)) x =
          sum_upto (\<lambda>n. \<Sum>d | d dvd n. mangoldt d) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. \<Sum>d | d dvd n. mangoldt d) x
[PROOF STEP]
by (intro sum_upto_cong) (simp_all add: mangoldt_sum)
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. \<Sum>d | d dvd n. mangoldt d) x

goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. \<Sum>d | d dvd n. mangoldt d) x

goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
have "\<dots> = sum_upto (\<lambda>k. sum_upto (\<lambda>d. mangoldt k) (x / real k)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>n. \<Sum>d | d dvd n. mangoldt d) x = sum_upto (\<lambda>k. sum_upto (\<lambda>d. mangoldt k) (x / real k)) x
[PROOF STEP]
by (rule sum_upto_sum_divisors)
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>n. \<Sum>d | d dvd n. mangoldt d) x = sum_upto (\<lambda>k. sum_upto (\<lambda>d. mangoldt k) (x / real k)) x

goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>n. \<Sum>d | d dvd n. mangoldt d) x = sum_upto (\<lambda>k. sum_upto (\<lambda>d. mangoldt k) (x / real k)) x

goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
have "\<dots> = sum_upto (\<lambda>n. mangoldt n * nat \<lfloor>x / real n\<rfloor>) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto (\<lambda>k. sum_upto (\<lambda>d. mangoldt k) (x / real k)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
unfolding sum_upto_altdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>{0<..nat \<lfloor>x\<rfloor>}. \<Sum>d\<in>{0<..nat \<lfloor>x / real k\<rfloor>}. mangoldt k) = (\<Sum>n\<in>{0<..nat \<lfloor>x\<rfloor>}. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>))
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>k. sum_upto (\<lambda>d. mangoldt k) (x / real k)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x

goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x

goal (1 subgoal):
 1. sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum_upto (\<lambda>n. ln (real n)) x = sum_upto (\<lambda>n. mangoldt n * real (nat \<lfloor>x / real n\<rfloor>)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dot2_rearrange:
  fixes u x :: "real^2"
  assumes "u \<bullet> x = 0" and "x \<noteq> 0"
  shows "\<exists>k. u = k *\<^sub>R (rotate2 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
 2. \<not> ?P \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
assume "x$1 = 0"
[PROOF STATE]
proof (state)
this:
x $ 1 = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
 2. \<not> ?P \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
with real2_eq [of x 0] and \<open>x \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x $ 1 = 0 $ 1; x $ 2 = 0 $ 2\<rbrakk> \<Longrightarrow> x = 0
x \<noteq> 0
x $ 1 = 0
[PROOF STEP]
have "x$2 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x $ 1 = 0 $ 1; x $ 2 = 0 $ 2\<rbrakk> \<Longrightarrow> x = 0
x \<noteq> 0
x $ 1 = 0

goal (1 subgoal):
 1. x $ 2 \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x $ 2 \<noteq> 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
 2. \<not> ?P \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
with dot2_rearrange_2 and \<open>u \<bullet> x = 0\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?u \<bullet> ?x = 0; ?x $ 2 \<noteq> 0\<rbrakk> \<Longrightarrow> ?u = - (?u $ 1 / ?x $ 2) *\<^sub>R rotate2 ?x
u \<bullet> x = 0
x $ 2 \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?u \<bullet> ?x = 0; ?x $ 2 \<noteq> 0\<rbrakk> \<Longrightarrow> ?u = - (?u $ 1 / ?x $ 2) *\<^sub>R rotate2 ?x
u \<bullet> x = 0
x $ 2 \<noteq> 0

goal (1 subgoal):
 1. \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. u = k *\<^sub>R rotate2 x

goal (1 subgoal):
 1. x $ 1 \<noteq> 0 \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x $ 1 \<noteq> 0 \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
assume "x$1 \<noteq> 0"
[PROOF STATE]
proof (state)
this:
x $ 1 \<noteq> 0

goal (1 subgoal):
 1. x $ 1 \<noteq> 0 \<Longrightarrow> \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
with dot2_rearrange_1 and \<open>u \<bullet> x = 0\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?u \<bullet> ?x = 0; ?x $ 1 \<noteq> 0\<rbrakk> \<Longrightarrow> ?u = (?u $ 2 / ?x $ 1) *\<^sub>R rotate2 ?x
u \<bullet> x = 0
x $ 1 \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?u \<bullet> ?x = 0; ?x $ 1 \<noteq> 0\<rbrakk> \<Longrightarrow> ?u = (?u $ 2 / ?x $ 1) *\<^sub>R rotate2 ?x
u \<bullet> x = 0
x $ 1 \<noteq> 0

goal (1 subgoal):
 1. \<exists>k. u = k *\<^sub>R rotate2 x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. u = k *\<^sub>R rotate2 x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma splus_adds_term_iff: "t \<oplus> u adds\<^sub>t v \<longleftrightarrow> (t adds\<^sub>p v \<and> u adds\<^sub>t (v \<ominus> t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<oplus> u adds\<^sub>t v) = (t adds\<^sub>p v \<and> u adds\<^sub>t v \<ominus> t)
[PROOF STEP]
by (metis adds_ppI adds_pp_splus adds_termE splus_adds_termI_1 splus_adds_term_0)


[STATEMENT]
lemma pivot_valuation_id: "\<lbrakk>\<triangle> (\<T> s); x\<^sub>i \<in> lvars (\<T> s); x\<^sub>j \<in> rvars_of_lvar (\<T> s) x\<^sub>i\<rbrakk> \<Longrightarrow> \<V> (pivot x\<^sub>i x\<^sub>j s) = \<V> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<triangle> (\<T> s); x\<^sub>i \<in> lvars (\<T> s); x\<^sub>j \<in> rvars_eq (eq_for_lvar (\<T> s) x\<^sub>i)\<rbrakk> \<Longrightarrow> \<V> (pivot x\<^sub>i x\<^sub>j s) = \<V> s
[PROOF STEP]
using pivot_id
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<triangle> (\<T> ?s); ?x\<^sub>i \<in> lvars (\<T> ?s); ?x\<^sub>j \<in> rvars_eq (eq_for_lvar (\<T> ?s) ?x\<^sub>i)\<rbrakk> \<Longrightarrow> let s' = pivot ?x\<^sub>i ?x\<^sub>j ?s in \<V> s' = \<V> ?s \<and> \<B>\<^sub>i s' = \<B>\<^sub>i ?s \<and> \<U> s' = \<U> ?s \<and> \<U>\<^sub>c s' = \<U>\<^sub>c ?s

goal (1 subgoal):
 1. \<lbrakk>\<triangle> (\<T> s); x\<^sub>i \<in> lvars (\<T> s); x\<^sub>j \<in> rvars_eq (eq_for_lvar (\<T> s) x\<^sub>i)\<rbrakk> \<Longrightarrow> \<V> (pivot x\<^sub>i x\<^sub>j s) = \<V> s
[PROOF STEP]
by (simp add: Let_def)


[STATEMENT]
lemma Pi_gr_1[simp]: "Pi n > Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < Pi n
[PROOF STEP]
proof(induct n, auto simp: Pi.simps Np.simps)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. Suc 0 < Pi n \<Longrightarrow> Suc 0 < Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. Suc 0 < Pi n \<Longrightarrow> Suc 0 < Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
let ?setx = "{y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. Suc 0 < Pi n \<Longrightarrow> Suc 0 < Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
have "finite ?setx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}

goal (1 subgoal):
 1. \<And>n. Suc 0 < Pi n \<Longrightarrow> Suc 0 < Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}

goal (1 subgoal):
 1. \<And>n. Suc 0 < Pi n \<Longrightarrow> Suc 0 < Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
have "?setx \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}
[PROOF STEP]
using prime_ex[of "Pi n"]
[PROOF STATE]
proof (prove)
using this:
\<exists>p>Pi n. p \<le> Suc (Pi n!) \<and> Prime p

goal (1 subgoal):
 1. {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
{y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}

goal (1 subgoal):
 1. \<And>n. Suc 0 < Pi n \<Longrightarrow> Suc 0 < Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
{y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}
[PROOF STEP]
show "Suc 0 < Min ?setx"
[PROOF STATE]
proof (prove)
using this:
finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
{y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}

goal (1 subgoal):
 1. Suc 0 < Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
apply(simp add: Min_gr_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x>Pi n. x \<le> Suc (Pi n!) \<and> Prime x \<Longrightarrow> \<forall>x. x \<le> Suc (Pi n!) \<and> Pi n < x \<and> Prime x \<longrightarrow> Suc 0 < x
[PROOF STEP]
apply(auto simp: Prime.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Suc 0 < Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma omega_le_Aleph [simp]: "\<omega> \<le> \<aleph>\<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega> \<le> \<aleph>\<alpha>
[PROOF STEP]
using InfCard_def
[PROOF STATE]
proof (prove)
using this:
InfCard ?\<kappa> \<equiv> Card ?\<kappa> \<and> \<omega> \<le> ?\<kappa>

goal (1 subgoal):
 1. \<omega> \<le> \<aleph>\<alpha>
[PROOF STEP]
by auto


[STATEMENT]
lemma conjl2_iff: "x \<lhd> y \<le> z \<longleftrightarrow> y \<le> -(-z \<rhd> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<lhd> y \<le> z) = (y \<le> - (- z \<rhd> x))
[PROOF STEP]
by (metis conjl1_iff conjugate_r_def compl_le_swap2 double_compl resr_galois)


[STATEMENT]
theorem sum_max_code_correct:
  assumes "ls.\<alpha> V \<noteq> {}"
  shows "sum_max_code V = dRETURN (s,m) \<Longrightarrow> s=\<Sum>(ls.\<alpha> V) \<and> m=Max (ls.\<alpha> V)"
    and "sum_max_code V \<noteq> dFAIL"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum_max_code V = dRETURN (s, m) \<Longrightarrow> s = \<Sum> (ls.\<alpha> V) \<and> m = Max (ls.\<alpha> V)) &&& sum_max_code V \<noteq> dFAIL
[PROOF STEP]
txt \<open>The proof is done by transitivity, and unfolding some
    definitions:\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum_max_code V = dRETURN (s, m) \<Longrightarrow> s = \<Sum> (ls.\<alpha> V) \<and> m = Max (ls.\<alpha> V)) &&& sum_max_code V \<noteq> dFAIL
[PROOF STEP]
using nres_correctD[OF order_trans[OF sum_max_code.refine sum_max_impl_correct,
    of V "ls.\<alpha> V"]] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(V, ls.\<alpha> V) \<in> br ls.\<alpha> ls.invar; ls.\<alpha> V \<noteq> {}; sum_max_code V = dRETURN ?x\<rbrakk> \<Longrightarrow> case ?x of (s, m) \<Rightarrow> s = \<Sum> (ls.\<alpha> V) \<and> m = Max (ls.\<alpha> V)
\<lbrakk>(V, ls.\<alpha> V) \<in> br ls.\<alpha> ls.invar; ls.\<alpha> V \<noteq> {}\<rbrakk> \<Longrightarrow> sum_max_code V \<noteq> dFAIL
ls.\<alpha> V \<noteq> {}

goal (1 subgoal):
 1. (sum_max_code V = dRETURN (s, m) \<Longrightarrow> s = \<Sum> (ls.\<alpha> V) \<and> m = Max (ls.\<alpha> V)) &&& sum_max_code V \<noteq> dFAIL
[PROOF STEP]
by (auto simp: refine_rel_defs)


[STATEMENT]
lemma pre_post_compose_3:
  "(-p\<stileturn>-q)*(-q\<stileturn>-q) = -p\<stileturn>-q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- p \<stileturn> - q) * (- q \<stileturn> - q) = - p \<stileturn> - q
[PROOF STEP]
by (metis order.antisym mult_right_isotone mult_1_right pre_post_compose_1 pre_post_reflexive)


[STATEMENT]
lemma bernoulli_denom_dvd: "bernoulli_denom n dvd (2 * (2 ^ n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
proof (cases "even n \<and> n > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. even n \<and> 0 < n \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
 2. \<not> (even n \<and> 0 < n) \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
even n \<and> 0 < n

goal (2 subgoals):
 1. even n \<and> 0 < n \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
 2. \<not> (even n \<and> 0 < n) \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
hence "bernoulli_denom n = \<Prod>{p. prime p \<and> (p - 1) dvd n}"
[PROOF STATE]
proof (prove)
using this:
even n \<and> 0 < n

goal (1 subgoal):
 1. bernoulli_denom n = \<Prod>{p. prime p \<and> p - 1 dvd n}
[PROOF STEP]
by (auto simp: bernoulli_denom_def)
[PROOF STATE]
proof (state)
this:
bernoulli_denom n = \<Prod>{p. prime p \<and> p - 1 dvd n}

goal (2 subgoals):
 1. even n \<and> 0 < n \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
 2. \<not> (even n \<and> 0 < n) \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bernoulli_denom n = \<Prod>{p. prime p \<and> p - 1 dvd n}

goal (2 subgoals):
 1. even n \<and> 0 < n \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
 2. \<not> (even n \<and> 0 < n) \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
have "\<dots> dvd (2 * (2 ^ n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>{p. prime p \<and> p - 1 dvd n} dvd 2 * (2 ^ n - 1)
[PROOF STEP]
proof (rule prime_prod_dvdI; clarify?)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite {p. prime p \<and> p - 1 dvd n}
 2. \<And>x. \<lbrakk>prime x; x - 1 dvd n\<rbrakk> \<Longrightarrow> x dvd 2 * (2 ^ n - 1)
 3. inj_on (\<lambda>x. x) {p. prime p \<and> p - 1 dvd n}
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
even n \<and> 0 < n
[PROOF STEP]
show "finite {p. prime p \<and> (p - 1) dvd n}"
[PROOF STATE]
proof (prove)
using this:
even n \<and> 0 < n

goal (1 subgoal):
 1. finite {p. prime p \<and> p - 1 dvd n}
[PROOF STEP]
by (intro finite_bernoulli_denom_set) auto
[PROOF STATE]
proof (state)
this:
finite {p. prime p \<and> p - 1 dvd n}

goal (2 subgoals):
 1. \<And>x. \<lbrakk>prime x; x - 1 dvd n\<rbrakk> \<Longrightarrow> x dvd 2 * (2 ^ n - 1)
 2. inj_on (\<lambda>x. x) {p. prime p \<and> p - 1 dvd n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>prime x; x - 1 dvd n\<rbrakk> \<Longrightarrow> x dvd 2 * (2 ^ n - 1)
 2. inj_on (\<lambda>x. x) {p. prime p \<and> p - 1 dvd n}
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>prime x; x - 1 dvd n\<rbrakk> \<Longrightarrow> x dvd 2 * (2 ^ n - 1)
 2. inj_on (\<lambda>x. x) {p. prime p \<and> p - 1 dvd n}
[PROOF STEP]
assume p: "prime p" "(p - 1) dvd n"
[PROOF STATE]
proof (state)
this:
prime p
p - 1 dvd n

goal (2 subgoals):
 1. \<And>x. \<lbrakk>prime x; x - 1 dvd n\<rbrakk> \<Longrightarrow> x dvd 2 * (2 ^ n - 1)
 2. inj_on (\<lambda>x. x) {p. prime p \<and> p - 1 dvd n}
[PROOF STEP]
show "p dvd (2 * (2 ^ n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd 2 * (2 ^ n - 1)
[PROOF STEP]
proof (cases "p = 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
 2. p \<noteq> 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 2

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
 2. p \<noteq> 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
prime p
p - 1 dvd n
p \<noteq> 2
[PROOF STEP]
have "p > 2"
[PROOF STATE]
proof (prove)
using this:
prime p
p - 1 dvd n
p \<noteq> 2

goal (1 subgoal):
 1. 2 < p
[PROOF STEP]
using prime_gt_1_nat[of p]
[PROOF STATE]
proof (prove)
using this:
prime p
p - 1 dvd n
p \<noteq> 2
prime p \<Longrightarrow> 1 < p

goal (1 subgoal):
 1. 2 < p
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
2 < p

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
 2. p \<noteq> 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
[PROOF STEP]
have "[2 ^ n - 1 = 1 - 1] (mod p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [2 ^ n - 1 = 1 - 1] (mod p)
[PROOF STEP]
using p \<open>p > 2\<close> prime_odd_nat
[PROOF STATE]
proof (prove)
using this:
prime p
p - 1 dvd n
2 < p
\<lbrakk>prime ?p; 2 < ?p\<rbrakk> \<Longrightarrow> odd ?p

goal (1 subgoal):
 1. [2 ^ n - 1 = 1 - 1] (mod p)
[PROOF STEP]
by (intro cong_diff_nat Carmichael_divides) (auto simp: Carmichael_prime)
[PROOF STATE]
proof (state)
this:
[2 ^ n - 1 = 1 - 1] (mod p)

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
 2. p \<noteq> 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
[PROOF STEP]
hence "p dvd (2 ^ n - 1)"
[PROOF STATE]
proof (prove)
using this:
[2 ^ n - 1 = 1 - 1] (mod p)

goal (1 subgoal):
 1. p dvd 2 ^ n - 1
[PROOF STEP]
by (simp add: cong_0_iff)
[PROOF STATE]
proof (state)
this:
p dvd 2 ^ n - 1

goal (2 subgoals):
 1. p = 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
 2. p \<noteq> 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p dvd 2 ^ n - 1

goal (1 subgoal):
 1. p dvd 2 * (2 ^ n - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p dvd 2 * (2 ^ n - 1)

goal (1 subgoal):
 1. p = 2 \<Longrightarrow> p dvd 2 * (2 ^ n - 1)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
p dvd 2 * (2 ^ n - 1)

goal (1 subgoal):
 1. inj_on (\<lambda>x. x) {p. prime p \<and> p - 1 dvd n}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<Prod>{p. prime p \<and> p - 1 dvd n} dvd 2 * (2 ^ n - 1)

goal (2 subgoals):
 1. even n \<and> 0 < n \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
 2. \<not> (even n \<and> 0 < n) \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bernoulli_denom n dvd 2 * (2 ^ n - 1)

goal (1 subgoal):
 1. bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
bernoulli_denom n dvd 2 * (2 ^ n - 1)

goal (1 subgoal):
 1. \<not> (even n \<and> 0 < n) \<Longrightarrow> bernoulli_denom n dvd 2 * (2 ^ n - 1)
[PROOF STEP]
qed (auto simp: bernoulli_denom_def)


[STATEMENT]
lemma repeat_zmset_distrib_add_zmset[simp]:
  "repeat_zmset n (add_zmset a A) = replicate_zmset n a + repeat_zmset n A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. repeat_zmset n (add_zmset a A) = replicate_zmset n a + repeat_zmset n A
[PROOF STEP]
by (auto simp: zmultiset_eq_iff int_distrib(2))


[STATEMENT]
lemma cnj_units [simp]: "cnj e1 = -e1" "cnj e2 = -e2" "cnj e3 = -e3"
 "cnj e4 = -e4"   "cnj e5 = -e5"   "cnj e6 = -e6"  "cnj e7 = -e7"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Octonions.cnj e1 = - e1 &&& Octonions.cnj e2 = - e2 &&& Octonions.cnj e3 = - e3) &&& (Octonions.cnj e4 = - e4 &&& Octonions.cnj e5 = - e5) &&& Octonions.cnj e6 = - e6 &&& Octonions.cnj e7 = - e7
[PROOF STEP]
by (simp_all add: octo_eq_iff)


[STATEMENT]
lemma nn_integral_spmf_neq_top: "(\<integral>\<^sup>+ x. spmf p x \<partial>count_space UNIV) \<noteq> \<top>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (spmf p x) \<partial>count_space UNIV \<noteq> \<top>
[PROOF STEP]
using nn_integral_measure_spmf[where f="\<lambda>_. 1", of p, symmetric]
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (spmf p x) * 1 \<partial>count_space UNIV = \<integral>\<^sup>+ x. 1 \<partial>measure_spmf p

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (spmf p x) \<partial>count_space UNIV \<noteq> \<top>
[PROOF STEP]
by simp


[STATEMENT]
lemma comp_sym_sym [simp]:
    assumes "ide a0" and "ide a1"
    shows "\<s>[a1, a0] \<cdot> \<s>[a0, a1] = (a0 \<otimes> a1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<s>[a1, a0] \<cdot> \<s>[a0, a1] = a0 \<otimes> a1
[PROOF STEP]
using assms sym_def comp_tuple_arr
[PROOF STATE]
proof (prove)
using this:
ide a0
ide a1
\<s>[?a1.0, ?a0.0] \<equiv> if ide ?a0.0 \<and> ide ?a1.0 then \<langle>\<pp>\<^sub>0[?a1.0, ?a0.0], \<pp>\<^sub>1[?a1.0, ?a0.0]\<rangle> else null
\<lbrakk>span ?f ?g; arr ?h; local.dom ?f = cod ?h\<rbrakk> \<Longrightarrow> \<langle>?f, ?g\<rangle> \<cdot> ?h = \<langle>?f \<cdot> ?h, ?g \<cdot> ?h\<rangle>

goal (1 subgoal):
 1. \<s>[a1, a0] \<cdot> \<s>[a0, a1] = a0 \<otimes> a1
[PROOF STEP]
by auto


[STATEMENT]
lemma f1'_gr0[arith]: "f1' > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < f1'
[PROOF STEP]
using f1_less_f1'
[PROOF STATE]
proof (prove)
using this:
f1 < f1'

goal (1 subgoal):
 1. 0 < f1'
[PROOF STEP]
by linarith


[STATEMENT]
lemma zmset_of_subset_iff[simp]: "zmset_of M \<subset>#\<^sub>z zmset_of N \<longleftrightarrow> M \<subset># N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (zmset_of M \<subset>#\<^sub>z zmset_of N) = (M \<subset># N)
[PROOF STEP]
by (simp add: subset_zmset_def subset_mset_def)


[STATEMENT]
lemma Always_allocAsk_le_ask: "System \<in> Always (INT i: lessThan Nclients.
                       {s. (sub i o allocAsk) s \<le> (ask o sub i o client) s})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. System \<in> Always (\<Inter>i<Nclients. {s. (sub i \<circ> allocAsk) s \<le> (ask \<circ> sub i \<circ> client) s})
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x < Nclients \<Longrightarrow> System \<in> Always {s. (sub x \<circ> allocAsk) s \<le> (ask \<circ> sub x \<circ> client) s}
[PROOF STEP]
apply (erule System_Follows_ask [THEN Follows_Bounded])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma measure_pmf_eq_density: "measure_pmf p = density (count_space UNIV) (pmf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf p = density (count_space UNIV) (\<lambda>x. ennreal (pmf p x))
[PROOF STEP]
proof (transfer, elim conjE)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>prob_space p; sets p = UNIV; AE x in p. Sigma_Algebra.measure p {x} \<noteq> 0\<rbrakk> \<Longrightarrow> p = density (count_space UNIV) (\<lambda>x. ennreal (Sigma_Algebra.measure p {x}))
[PROOF STEP]
fix M :: "'a measure"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>prob_space p; sets p = UNIV; AE x in p. Sigma_Algebra.measure p {x} \<noteq> 0\<rbrakk> \<Longrightarrow> p = density (count_space UNIV) (\<lambda>x. ennreal (Sigma_Algebra.measure p {x}))
[PROOF STEP]
assume [simp]: "sets M = UNIV" and ae: "AE x in M. measure M {x} \<noteq> 0"
[PROOF STATE]
proof (state)
this:
sets M = UNIV
AE x in M. Sigma_Algebra.measure M {x} \<noteq> 0

goal (1 subgoal):
 1. \<And>p. \<lbrakk>prob_space p; sets p = UNIV; AE x in p. Sigma_Algebra.measure p {x} \<noteq> 0\<rbrakk> \<Longrightarrow> p = density (count_space UNIV) (\<lambda>x. ennreal (Sigma_Algebra.measure p {x}))
[PROOF STEP]
assume "prob_space M"
[PROOF STATE]
proof (state)
this:
prob_space M

goal (1 subgoal):
 1. \<And>p. \<lbrakk>prob_space p; sets p = UNIV; AE x in p. Sigma_Algebra.measure p {x} \<noteq> 0\<rbrakk> \<Longrightarrow> p = density (count_space UNIV) (\<lambda>x. ennreal (Sigma_Algebra.measure p {x}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
prob_space M
[PROOF STEP]
interpret prob_space M
[PROOF STATE]
proof (prove)
using this:
prob_space M

goal (1 subgoal):
 1. prob_space M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>prob_space p; sets p = UNIV; AE x in p. Sigma_Algebra.measure p {x} \<noteq> 0\<rbrakk> \<Longrightarrow> p = density (count_space UNIV) (\<lambda>x. ennreal (Sigma_Algebra.measure p {x}))
[PROOF STEP]
show "M = density (count_space UNIV) (\<lambda>x. ennreal (measure M {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))
[PROOF STEP]
proof (rule measure_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
fix A :: "'a set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
have "(\<integral>\<^sup>+ x. ennreal (measure M {x}) * indicator A x \<partial>count_space UNIV) =
      (\<integral>\<^sup>+ x. emeasure M {x} * indicator (A \<inter> {x. measure M {x} \<noteq> 0}) x \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>A. ennreal (prob {x})\<partial>count_space UNIV = \<integral>\<^sup>+x\<in>A \<inter> {x. prob {x} \<noteq> 0}. emeasure M {x}\<partial>count_space UNIV
[PROOF STEP]
by (auto intro!: nn_integral_cong simp: emeasure_eq_measure split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>A. ennreal (prob {x})\<partial>count_space UNIV = \<integral>\<^sup>+x\<in>A \<inter> {x. prob {x} \<noteq> 0}. emeasure M {x}\<partial>count_space UNIV

goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>A. ennreal (prob {x})\<partial>count_space UNIV = \<integral>\<^sup>+x\<in>A \<inter> {x. prob {x} \<noteq> 0}. emeasure M {x}\<partial>count_space UNIV

goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. emeasure M {x} \<partial>count_space (A \<inter> {x. measure M {x} \<noteq> 0}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>A \<inter> {x. prob {x} \<noteq> 0}. emeasure M {x}\<partial>count_space UNIV = \<integral>\<^sup>+ x. emeasure M {x} \<partial>count_space (A \<inter> {x. prob {x} \<noteq> 0})
[PROOF STEP]
by (subst nn_integral_restrict_space[symmetric]) (auto simp: restrict_count_space)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>A \<inter> {x. prob {x} \<noteq> 0}. emeasure M {x}\<partial>count_space UNIV = \<integral>\<^sup>+ x. emeasure M {x} \<partial>count_space (A \<inter> {x. prob {x} \<noteq> 0})

goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>A \<inter> {x. prob {x} \<noteq> 0}. emeasure M {x}\<partial>count_space UNIV = \<integral>\<^sup>+ x. emeasure M {x} \<partial>count_space (A \<inter> {x. prob {x} \<noteq> 0})

goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
have "\<dots> = emeasure M (\<Union>x\<in>(A \<inter> {x. measure M {x} \<noteq> 0}). {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. emeasure M {x} \<partial>count_space (A \<inter> {x. prob {x} \<noteq> 0}) = emeasure M (\<Union>x\<in>A \<inter> {x. prob {x} \<noteq> 0}. {x})
[PROOF STEP]
by (intro emeasure_UN_countable[symmetric] countable_Int2 countable_support)
         (auto simp: disjoint_family_on_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. emeasure M {x} \<partial>count_space (A \<inter> {x. prob {x} \<noteq> 0}) = emeasure M (\<Union>x\<in>A \<inter> {x. prob {x} \<noteq> 0}. {x})

goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. emeasure M {x} \<partial>count_space (A \<inter> {x. prob {x} \<noteq> 0}) = emeasure M (\<Union>x\<in>A \<inter> {x. prob {x} \<noteq> 0}. {x})

goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
have "\<dots> = emeasure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (\<Union>x\<in>A \<inter> {x. prob {x} \<noteq> 0}. {x}) = emeasure M A
[PROOF STEP]
using ae
[PROOF STATE]
proof (prove)
using this:
AE x in M. prob {x} \<noteq> 0

goal (1 subgoal):
 1. emeasure M (\<Union>x\<in>A \<inter> {x. prob {x} \<noteq> 0}. {x}) = emeasure M A
[PROOF STEP]
by (intro emeasure_eq_AE) auto
[PROOF STATE]
proof (state)
this:
emeasure M (\<Union>x\<in>A \<inter> {x. prob {x} \<noteq> 0}. {x}) = emeasure M A

goal (2 subgoals):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+x\<in>A. ennreal (prob {x})\<partial>count_space UNIV = emeasure M A
[PROOF STEP]
show " emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (measure M {x}))) A"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>A. ennreal (prob {x})\<partial>count_space UNIV = emeasure M A

goal (1 subgoal):
 1. emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
using emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>A. ennreal (prob {x})\<partial>count_space UNIV = emeasure M A
emeasure M (space M) = 1

goal (1 subgoal):
 1. emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A
[PROOF STEP]
by (simp add: emeasure_density)
[PROOF STATE]
proof (state)
this:
emeasure M A = emeasure (density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))) A

goal (1 subgoal):
 1. events = sets (density (count_space UNIV) (\<lambda>x. ennreal (prob {x})))
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
M = density (count_space UNIV) (\<lambda>x. ennreal (prob {x}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cosh_ln_complex: "x \<noteq> 0 \<Longrightarrow> cosh (ln x :: complex) = (x + inverse x) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> cosh (Ln x) = (x + inverse x) / 2
[PROOF STEP]
by (simp add: cosh_def exp_minus scaleR_conv_of_real)


[STATEMENT]
lemma smooth_compat_D2:
  "k-smooth_on (c2 ` (domain c1 \<inter> domain c2)) (c1 \<circ> inv_chart c2)"
  if "k-smooth_compat c1 c2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
have "open (c2 ` (domain c1 \<inter> domain c2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (apply_chart c2 ` (domain c1 \<inter> domain c2))
[PROOF STEP]
by (rule open_chart_image) auto
[PROOF STATE]
proof (state)
this:
open (apply_chart c2 ` (domain c1 \<inter> domain c2))

goal (1 subgoal):
 1. k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
open (apply_chart c2 ` (domain c1 \<inter> domain c2))

goal (1 subgoal):
 1. k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
have "k-smooth_on (c2 ` (domain c1 \<inter> domain c2)) (c1 \<circ> inv_chart c2) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
using that(1)
[PROOF STATE]
proof (prove)
using this:
k-smooth_compat c1 c2

goal (1 subgoal):
 1. k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
by (auto simp: smooth_compat_def)
[PROOF STATE]
proof (state)
this:
k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)

goal (1 subgoal):
 1. k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
open (apply_chart c2 ` (domain c1 \<inter> domain c2))
k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
open (apply_chart c2 ` (domain c1 \<inter> domain c2))
k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)

goal (1 subgoal):
 1. k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k-smooth_on (apply_chart c2 ` (domain c1 \<inter> domain c2)) (apply_chart c1 \<circ> inv_chart c2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in field) associated_polynomials_imp_same_roots:
  assumes "p \<in> carrier (poly_ring R)" "p \<noteq> []" and "q \<in> carrier (poly_ring R)" "q \<noteq> []"
  shows "roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
interpret UP: domain "poly_ring R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain (poly_ring R)
[PROOF STEP]
using univ_poly_is_domain[OF carrier_is_subring]
[PROOF STATE]
proof (prove)
using this:
domain (poly_ring R)

goal (1 subgoal):
 1. domain (poly_ring R)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p \<in> carrier (poly_ring R)
p \<noteq> []
q \<in> carrier (poly_ring R)
q \<noteq> []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (poly_ring R)
p \<noteq> []
q \<in> carrier (poly_ring R)
q \<noteq> []

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
proof (induction "degree p" arbitrary: p rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<in> carrier (poly_ring R); pa \<noteq> []; q \<in> carrier (poly_ring R); q \<noteq> []\<rbrakk> \<Longrightarrow> roots (pa \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots pa + roots q; p \<in> carrier (poly_ring R); p \<noteq> []; q \<in> carrier (poly_ring R); q \<noteq> []\<rbrakk> \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
\<lbrakk>degree ?p < degree p; ?p \<in> carrier (poly_ring R); ?p \<noteq> []; q \<in> carrier (poly_ring R); q \<noteq> []\<rbrakk> \<Longrightarrow> roots (?p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots ?p + roots q
p \<in> carrier (poly_ring R)
p \<noteq> []
q \<in> carrier (poly_ring R)
q \<noteq> []

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<in> carrier (poly_ring R); pa \<noteq> []; q \<in> carrier (poly_ring R); q \<noteq> []\<rbrakk> \<Longrightarrow> roots (pa \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots pa + roots q; p \<in> carrier (poly_ring R); p \<noteq> []; q \<in> carrier (poly_ring R); q \<noteq> []\<rbrakk> \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
proof (cases "roots p = {#}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. roots p = {#} \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
 2. roots p \<noteq> {#} \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
roots p = {#}

goal (2 subgoals):
 1. roots p = {#} \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
 2. roots p \<noteq> {#} \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
roots p = {#}

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
using no_roots_imp_same_roots[of p q] less
[PROOF STATE]
proof (prove)
using this:
roots p = {#}
\<lbrakk>p \<in> carrier (poly_ring R); p \<noteq> []; q \<in> carrier (poly_ring R); roots p = {#}\<rbrakk> \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots q
\<lbrakk>degree ?p < degree p; ?p \<in> carrier (poly_ring R); ?p \<noteq> []; q \<in> carrier (poly_ring R); q \<noteq> []\<rbrakk> \<Longrightarrow> roots (?p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots ?p + roots q
p \<in> carrier (poly_ring R)
p \<noteq> []
q \<in> carrier (poly_ring R)
q \<noteq> []

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q

goal (1 subgoal):
 1. roots p \<noteq> {#} \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. roots p \<noteq> {#} \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
roots p \<noteq> {#}

goal (1 subgoal):
 1. roots p \<noteq> {#} \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
with \<open>p \<in> carrier (poly_ring R)\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<in> carrier (poly_ring R)
roots p \<noteq> {#}
[PROOF STEP]
obtain a where a: "a \<in> carrier R" and "a \<in># roots p" and pdiv: "[ \<one>, \<ominus> a ] pdivides p"
          and in_carrier: "[ \<one>, \<ominus> a ] \<in> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (poly_ring R)
roots p \<noteq> {#}

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> carrier R; a \<in># roots p; [\<one>, \<ominus> a] pdivides p; [\<one>, \<ominus> a] \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> carrier R
a \<in># roots p
[\<one>, \<ominus> a] pdivides p
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. roots p \<noteq> {#} \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
proof (cases "degree p = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree p = 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
 2. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
degree p = 1

goal (2 subgoals):
 1. degree p = 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
 2. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
with \<open>p \<in> carrier (poly_ring R)\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<in> carrier (poly_ring R)
degree p = 1
[PROOF STEP]
obtain b c where p: "p = [ b, c ]" and b: "b \<in> carrier R" "b \<noteq> \<zero>" and c: "c \<in> carrier R"
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (poly_ring R)
degree p = 1

goal (1 subgoal):
 1. (\<And>b c. \<lbrakk>p = [b, c]; b \<in> carrier R; b \<noteq> \<zero>; c \<in> carrier R\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = [b, c]
b \<in> carrier R
b \<noteq> \<zero>
c \<in> carrier R

goal (2 subgoals):
 1. degree p = 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
 2. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
with \<open>a \<in># roots p\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<in># roots p
p = [b, c]
b \<in> carrier R
b \<noteq> \<zero>
c \<in> carrier R
[PROOF STEP]
have roots: "roots p = {# a #}" and a: "\<ominus> a = inv b \<otimes> c" "a \<in> carrier R"
          and lead: "lead_coeff p = b" and const: "const_term p = c"
[PROOF STATE]
proof (prove)
using this:
a \<in># roots p
p = [b, c]
b \<in> carrier R
b \<noteq> \<zero>
c \<in> carrier R

goal (1 subgoal):
 1. (roots p = {#a#} &&& \<ominus> a = inv b \<otimes> c &&& a \<in> carrier R) &&& lead_coeff p = b &&& const_term p = c
[PROOF STEP]
using degree_one_imp_singleton_roots[of p] less(2) field_Units
[PROOF STATE]
proof (prove)
using this:
a \<in># roots p
p = [b, c]
b \<in> carrier R
b \<noteq> \<zero>
c \<in> carrier R
\<lbrakk>p \<in> carrier (poly_ring R); degree p = 1\<rbrakk> \<Longrightarrow> roots p = {#\<ominus> (inv lead_coeff p \<otimes> const_term p)#}
p \<in> carrier (poly_ring R)
Units R = carrier R - {\<zero>}

goal (1 subgoal):
 1. (roots p = {#a#} &&& \<ominus> a = inv b \<otimes> c &&& a \<in> carrier R) &&& lead_coeff p = b &&& const_term p = c
[PROOF STEP]
unfolding const_term_def
[PROOF STATE]
proof (prove)
using this:
a \<in># roots p
p = [b, c]
b \<in> carrier R
b \<noteq> \<zero>
c \<in> carrier R
\<lbrakk>p \<in> carrier (poly_ring R); degree p = 1\<rbrakk> \<Longrightarrow> roots p = {#\<ominus> (inv lead_coeff p \<otimes> local.eval p \<zero>)#}
p \<in> carrier (poly_ring R)
Units R = carrier R - {\<zero>}

goal (1 subgoal):
 1. (roots p = {#a#} &&& \<ominus> a = inv b \<otimes> c &&& a \<in> carrier R) &&& lead_coeff p = b &&& local.eval p \<zero> = c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
roots p = {#a#}
\<ominus> a = inv b \<otimes> c
a \<in> carrier R
lead_coeff p = b
const_term p = c

goal (2 subgoals):
 1. degree p = 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
 2. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
hence "(p \<otimes>\<^bsub>poly_ring R\<^esub> q) \<sim>\<^bsub>poly_ring R\<^esub> ([ \<one>, \<ominus> a ] \<otimes>\<^bsub>poly_ring R\<^esub> q)"
[PROOF STATE]
proof (prove)
using this:
roots p = {#a#}
\<ominus> a = inv b \<otimes> c
a \<in> carrier R
lead_coeff p = b
const_term p = c

goal (1 subgoal):
 1. p \<otimes>\<^bsub>poly_ring R\<^esub> q \<sim>\<^bsub>poly_ring R\<^esub> [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q
[PROOF STEP]
using UP.mult_cong_l[OF degree_one_associatedI[OF carrier_is_subfield _ True]] less(2,4)
[PROOF STATE]
proof (prove)
using this:
roots p = {#a#}
\<ominus> a = inv b \<otimes> c
a \<in> carrier R
lead_coeff p = b
const_term p = c
\<lbrakk>p \<in> carrier (poly_ring R); p \<in> carrier (poly_ring R); [\<one>, inv lead_coeff p \<otimes> const_term p] \<in> carrier (poly_ring R); ?b \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> p \<otimes>\<^bsub>poly_ring R\<^esub> ?b \<sim>\<^bsub>poly_ring R\<^esub> [\<one>, inv lead_coeff p \<otimes> const_term p] \<otimes>\<^bsub>poly_ring R\<^esub> ?b
p \<in> carrier (poly_ring R)
q \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. p \<otimes>\<^bsub>poly_ring R\<^esub> q \<sim>\<^bsub>poly_ring R\<^esub> [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q
[PROOF STEP]
by (auto simp add: a lead const)
[PROOF STATE]
proof (state)
this:
p \<otimes>\<^bsub>poly_ring R\<^esub> q \<sim>\<^bsub>poly_ring R\<^esub> [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q

goal (2 subgoals):
 1. degree p = 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
 2. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
hence "roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots ([ \<one>, \<ominus> a ] \<otimes>\<^bsub>poly_ring R\<^esub> q)"
[PROOF STATE]
proof (prove)
using this:
p \<otimes>\<^bsub>poly_ring R\<^esub> q \<sim>\<^bsub>poly_ring R\<^esub> [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q)
[PROOF STEP]
using associated_polynomials_imp_same_roots in_carrier less(2,4)
[PROOF STATE]
proof (prove)
using this:
p \<otimes>\<^bsub>poly_ring R\<^esub> q \<sim>\<^bsub>poly_ring R\<^esub> [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q
\<lbrakk>?p \<in> carrier (poly_ring R); ?q \<in> carrier (poly_ring R); ?p \<sim>\<^bsub>poly_ring R\<^esub> ?q\<rbrakk> \<Longrightarrow> roots ?p = roots ?q
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)
p \<in> carrier (poly_ring R)
q \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q)
[PROOF STEP]
unfolding a
[PROOF STATE]
proof (prove)
using this:
p \<otimes>\<^bsub>poly_ring R\<^esub> q \<sim>\<^bsub>poly_ring R\<^esub> [\<one>, inv b \<otimes> c] \<otimes>\<^bsub>poly_ring R\<^esub> q
\<lbrakk>?p \<in> carrier (poly_ring R); ?q \<in> carrier (poly_ring R); ?p \<sim>\<^bsub>poly_ring R\<^esub> ?q\<rbrakk> \<Longrightarrow> roots ?p = roots ?q
[\<one>, inv b \<otimes> c] \<in> carrier (poly_ring R)
p \<in> carrier (poly_ring R)
q \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots ([\<one>, inv b \<otimes> c] \<otimes>\<^bsub>poly_ring R\<^esub> q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q)

goal (2 subgoals):
 1. degree p = 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
 2. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q)

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
unfolding poly_mult_degree_one_monic_imp_same_roots[OF a(2) less(4,5)] roots
[PROOF STATE]
proof (prove)
using this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = add_mset a (roots q)

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = {#a#} + roots q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
degree p \<noteq> 1

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
from \<open>[ \<one>, \<ominus> a ] pdivides p\<close>
[PROOF STATE]
proof (chain)
picking this:
[\<one>, \<ominus> a] pdivides p
[PROOF STEP]
obtain r where p: "p = [ \<one>, \<ominus> a ] \<otimes>\<^bsub>poly_ring R\<^esub> r" and r: "r \<in> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
using this:
[\<one>, \<ominus> a] pdivides p

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r; r \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding pdivides_def
[PROOF STATE]
proof (prove)
using this:
[\<one>, \<ominus> a] divides\<^bsub>poly_ring R\<^esub> p

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r; r \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r
r \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
with \<open>p \<noteq> []\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> []
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r
r \<in> carrier (poly_ring R)
[PROOF STEP]
have not_zero: "r \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> []
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r
r \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. r \<noteq> []
[PROOF STEP]
using in_carrier univ_poly_zero[of R "carrier R"] UP.integral_iff
[PROOF STATE]
proof (prove)
using this:
p \<noteq> []
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r
r \<in> carrier (poly_ring R)
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)
\<zero>\<^bsub>poly_ring R\<^esub> = []
\<lbrakk>?a \<in> carrier (poly_ring R); ?b \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> (?a \<otimes>\<^bsub>poly_ring R\<^esub> ?b = \<zero>\<^bsub>poly_ring R\<^esub>) = (?a = \<zero>\<^bsub>poly_ring R\<^esub> \<or> ?b = \<zero>\<^bsub>poly_ring R\<^esub>)

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

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
with \<open>p = [ \<one>, \<ominus> a ] \<otimes>\<^bsub>poly_ring R\<^esub> r\<close>
[PROOF STATE]
proof (chain)
picking this:
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r
r \<noteq> []
[PROOF STEP]
have deg: "degree p = Suc (degree r)"
[PROOF STATE]
proof (prove)
using this:
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r
r \<noteq> []

goal (1 subgoal):
 1. degree p = Suc (degree r)
[PROOF STEP]
using poly_mult_degree_eq[OF carrier_is_subring, of _ r] in_carrier r
[PROOF STATE]
proof (prove)
using this:
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r
r \<noteq> []
\<lbrakk>polynomial (carrier R) ?p1.0; polynomial (carrier R) r\<rbrakk> \<Longrightarrow> degree (poly_mult ?p1.0 r) = (if ?p1.0 = [] \<or> r = [] then 0 else degree ?p1.0 + degree r)
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)
r \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. degree p = Suc (degree r)
[PROOF STEP]
unfolding univ_poly_carrier sym[OF univ_poly_mult[of R "carrier R"]]
[PROOF STATE]
proof (prove)
using this:
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r
r \<noteq> []
\<lbrakk>?p1.0 \<in> carrier (poly_ring R); r \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> degree (?p1.0 \<otimes>\<^bsub>poly_ring R\<^esub> r) = (if ?p1.0 = [] \<or> r = [] then 0 else degree ?p1.0 + degree r)
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)
r \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. degree p = Suc (degree r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree p = Suc (degree r)

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
with \<open>r \<noteq> []\<close> and \<open>q \<noteq> []\<close>
[PROOF STATE]
proof (chain)
picking this:
r \<noteq> []
q \<noteq> []
degree p = Suc (degree r)
[PROOF STEP]
have "r \<otimes>\<^bsub>poly_ring R\<^esub> q \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
r \<noteq> []
q \<noteq> []
degree p = Suc (degree r)

goal (1 subgoal):
 1. r \<otimes>\<^bsub>poly_ring R\<^esub> q \<noteq> []
[PROOF STEP]
using in_carrier univ_poly_zero[of R "carrier R"] UP.integral less(4) r
[PROOF STATE]
proof (prove)
using this:
r \<noteq> []
q \<noteq> []
degree p = Suc (degree r)
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)
\<zero>\<^bsub>poly_ring R\<^esub> = []
\<lbrakk>?a \<otimes>\<^bsub>poly_ring R\<^esub> ?b = \<zero>\<^bsub>poly_ring R\<^esub>; ?a \<in> carrier (poly_ring R); ?b \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> ?a = \<zero>\<^bsub>poly_ring R\<^esub> \<or> ?b = \<zero>\<^bsub>poly_ring R\<^esub>
q \<in> carrier (poly_ring R)
r \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. r \<otimes>\<^bsub>poly_ring R\<^esub> q \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r \<otimes>\<^bsub>poly_ring R\<^esub> q \<noteq> []

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
hence "roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q))"
[PROOF STATE]
proof (prove)
using this:
r \<otimes>\<^bsub>poly_ring R\<^esub> q \<noteq> []

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q))
[PROOF STEP]
using poly_mult_degree_one_monic_imp_same_roots[OF a UP.m_closed[OF r less(4)]]
                UP.m_assoc[OF in_carrier r less(4)] p
[PROOF STATE]
proof (prove)
using this:
r \<otimes>\<^bsub>poly_ring R\<^esub> q \<noteq> []
r \<otimes>\<^bsub>poly_ring R\<^esub> q \<noteq> [] \<Longrightarrow> roots ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> (r \<otimes>\<^bsub>poly_ring R\<^esub> q)) = add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q))
[\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r \<otimes>\<^bsub>poly_ring R\<^esub> q = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> (r \<otimes>\<^bsub>poly_ring R\<^esub> q)
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q))

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q))

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
have " ... = add_mset a (roots r + roots q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q)) = add_mset a (roots r + roots q)
[PROOF STEP]
using less(1)[OF _ r not_zero less(4-5)] deg
[PROOF STATE]
proof (prove)
using this:
degree r < degree p \<Longrightarrow> roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots r + roots q
degree p = Suc (degree r)

goal (1 subgoal):
 1. add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q)) = add_mset a (roots r + roots q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q)) = add_mset a (roots r + roots q)

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
add_mset a (roots (r \<otimes>\<^bsub>poly_ring R\<^esub> q)) = add_mset a (roots r + roots q)

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
have " ... = (add_mset a (roots r)) + roots q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_mset a (roots r + roots q) = add_mset a (roots r) + roots q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
add_mset a (roots r + roots q) = add_mset a (roots r) + roots q

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
add_mset a (roots r + roots q) = add_mset a (roots r) + roots q

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
have " ... = roots p + roots q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_mset a (roots r) + roots q = roots p + roots q
[PROOF STEP]
using poly_mult_degree_one_monic_imp_same_roots[OF a r not_zero] p
[PROOF STATE]
proof (prove)
using this:
roots ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r) = add_mset a (roots r)
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> r

goal (1 subgoal):
 1. add_mset a (roots r) + roots q = roots p + roots q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
add_mset a (roots r) + roots q = roots p + roots q

goal (1 subgoal):
 1. degree p \<noteq> 1 \<Longrightarrow> roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q

goal (1 subgoal):
 1. roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
roots (p \<otimes>\<^bsub>poly_ring R\<^esub> q) = roots p + roots q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_gt_0_iff_gt_ennreal: "0 < a - b \<longleftrightarrow> (a = top \<and> b = top \<or> b < (a::ennreal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < a - b) = (a = top \<and> b = top \<or> b < a)
[PROOF STEP]
by (cases a; cases b) (auto simp: ennreal_minus_if ennreal_less_iff)


[STATEMENT]
lemma diff_divide_cancel:
  fixes z::real shows  "z \<noteq> 0  \<Longrightarrow> (a * z - a * (b * z)) / z = (a - a * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> (a * z - a * (b * z)) / z = a - a * b
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
lemma intpow_one [simp]: "x ^\<^sub>Z 1 = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^\<^sub>Z 1 = x
[PROOF STEP]
by (simp add: intpow_def)


[STATEMENT]
lemma the_cat_parallel_2_Cod_vdomain[cat_parallel_cs_simps]:
  "\<D>\<^sub>\<circ> (\<up>\<up>\<^sub>C \<aa> \<bb> \<gg> \<ff>\<lparr>Cod\<rparr>) = set {\<aa>, \<bb>, \<gg>, \<ff>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<up>\<up>\<^sub>C \<aa> \<bb> \<gg> \<ff>\<lparr>Cod\<rparr>) = ZFC_in_HOL.set {\<aa>, \<bb>, \<gg>, \<ff>}
[PROOF STEP]
unfolding the_cat_parallel_2_def the_cat_parallel_Cod_vdomain
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.set {\<aa>, \<bb>} \<union>\<^sub>\<circ> ZFC_in_HOL.set {\<gg>, \<ff>} = ZFC_in_HOL.set {\<aa>, \<bb>, \<gg>, \<ff>}
[PROOF STEP]
by auto


[STATEMENT]
lemma sp_Cons :
  shows   "subpath g v1 (e # es) v2 subs \<longleftrightarrow> sub_rel_of g subs
                                           \<and> (v1 = src e  \<or> (v1,src e) \<in> subs\<^sup>+)
                                           \<and> e \<in> edges g
                                           \<and> subpath g (tgt e) es v2 subs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SubRel.subpath g v1 (e # es) v2 subs = (sub_rel_of g subs \<and> (v1 = src e \<or> (v1, src e) \<in> subs\<^sup>+) \<and> e \<in> edges g \<and> SubRel.subpath g (tgt e) es v2 subs)
[PROOF STEP]
using sub_rel_of.trancl_sub_rel_of[of g subs]
[PROOF STATE]
proof (prove)
using this:
sub_rel_of g subs \<Longrightarrow> sub_rel_of g (subs\<^sup>+)

goal (1 subgoal):
 1. SubRel.subpath g v1 (e # es) v2 subs = (sub_rel_of g subs \<and> (v1 = src e \<or> (v1, src e) \<in> subs\<^sup>+) \<and> e \<in> edges g \<and> SubRel.subpath g (tgt e) es v2 subs)
[PROOF STEP]
by (intro iffI, auto simp add : subpath_def vertices_def sub_rel_of_def)


[STATEMENT]
lemma (in is_functor) op_cf_obj_comma_is_functor:
  assumes "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>"
  shows "op_cf_obj_comma \<FF> b : op_cat (\<FF> \<^sub>C\<^sub>F\<down> b) \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> b \<down>\<^sub>C\<^sub>F (op_cf \<FF>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf_obj_comma \<FF> b : op_cat (\<FF> \<^sub>C\<^sub>F\<down> b) \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> b \<down>\<^sub>C\<^sub>F (op_cf \<FF>)
[PROOF STEP]
by (rule is_iso_functorD(1)[OF op_cf_obj_comma_is_iso_functor[OF assms]])


[STATEMENT]
lemma convergent_limsup_cl:
  fixes X :: "nat \<Rightarrow> 'a::{complete_linorder,linorder_topology}"
  shows "convergent X \<Longrightarrow> limsup X = lim X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent X \<Longrightarrow> limsup X = lim X
[PROOF STEP]
by (auto simp: convergent_def limI lim_imp_Limsup)


[STATEMENT]
lemma (in Module) sc_r_distr:"\<lbrakk>a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow>
                 a \<cdot>\<^sub>s (m \<plusminus> n) = a \<cdot>\<^sub>s m \<plusminus>  a \<cdot>\<^sub>s n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; m \<in> carrier M; n \<in> carrier M\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>s (m \<plusminus> n) = a \<cdot>\<^sub>s m \<plusminus> a \<cdot>\<^sub>s n
[PROOF STEP]
apply (simp add:sprod_r_distr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma c_IKKBZ_eq_c_list_cout_hlist:
  fixes f cf t
  defines "h \<equiv> (\<lambda>xs x. (list_sel_aux' f xs x) * cf x)"
  defines "xs \<equiv> revorder t"
  assumes "distinct_relations t"
      and "reasonable_cards cf f t"
      and "left_deep t"
  shows "c_IKKBZ (\<lambda>a b. ldeep_s f xs a * b) cf f t
        = c_list (ldeep_s f xs) cf (create_h_list h xs) (first_node t) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_IKKBZ (\<lambda>a. (*) (ldeep_s f xs a)) cf f t = c_list (ldeep_s f xs) cf (create_h_list h xs) (first_node t) xs
[PROOF STEP]
using assms c_IKKBZ_eq_c_list ldeep_s_h_eq_create_h_list'''[OF assms(3)]
[PROOF STATE]
proof (prove)
using this:
h \<equiv> \<lambda>xs x. list_sel_aux' f xs x * cf x
xs \<equiv> revorder t
distinct_relations t
reasonable_cards cf f t
left_deep t
\<lbrakk>distinct_relations ?t; reasonable_cards ?cf ?f ?t; left_deep ?t; \<forall>x\<in>relations ?t. ?h1.0 x (?cf x) = ?h2.0 x\<rbrakk> \<Longrightarrow> c_IKKBZ ?h1.0 ?cf ?f ?t = c_list (ldeep_s ?f (revorder ?t)) ?cf ?h2.0 (first_node ?t) (revorder ?t)
?x \<in> relations t \<Longrightarrow> ldeep_s ?f (revorder t) ?x * ?cf ?x = create_h_list (\<lambda>xs x. list_sel_aux' ?f xs x * ?cf x) (revorder t) ?x

goal (1 subgoal):
 1. c_IKKBZ (\<lambda>a. (*) (ldeep_s f xs a)) cf f t = c_list (ldeep_s f xs) cf (create_h_list h xs) (first_node t) xs
[PROOF STEP]
by fastforce


[STATEMENT]
lemma invimage_vunion_right: "r -`\<^sub>\<circ> (A \<union>\<^sub>\<circ> B) = r -`\<^sub>\<circ> A \<union>\<^sub>\<circ> r -`\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r -`\<^sub>\<circ> (A \<union>\<^sub>\<circ> B) = r -`\<^sub>\<circ> A \<union>\<^sub>\<circ> r -`\<^sub>\<circ> B
[PROOF STEP]
by (auto intro!: vsubset_antisym)


[STATEMENT]
lemma Zfun_norm_iff: "Zfun (\<lambda>x. norm (f x)) F = Zfun (\<lambda>x. f x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Zfun (\<lambda>x. norm (f x)) F = Zfun f F
[PROOF STEP]
unfolding Zfun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>r>0. \<forall>\<^sub>F x in F. norm (norm (f x)) < r) = (\<forall>r>0. \<forall>\<^sub>F x in F. norm (f x) < r)
[PROOF STEP]
by simp


[STATEMENT]
lemma divmod_integer_code [code]: \<^marker>\<open>contributor \<open>Ren? Thiemann\<close>\<close> \<^marker>\<open>contributor \<open>Akihisa Yamada\<close>\<close>
  "divmod_integer k l =
   (if k = 0 then (0, 0)
    else if l > 0 then
            (if k > 0 then Code_Numeral.divmod_abs k l
             else case Code_Numeral.divmod_abs k l of (r, s) \<Rightarrow>
                  if s = 0 then (- r, 0) else (- r - 1, l - s))
    else if l = 0 then (0, k)
    else apsnd uminus
            (if k < 0 then Code_Numeral.divmod_abs k l
             else case Code_Numeral.divmod_abs k l of (r, s) \<Rightarrow>
                  if s = 0 then (- r, 0) else (- r - 1, - l - s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if 0 < l then if 0 < k then divmod_abs k l else case divmod_abs k l of (r, s) \<Rightarrow> if s = 0 then (- r, 0) else (- r - 1, l - s) else if l = 0 then (0, k) else apsnd uminus (if k < 0 then divmod_abs k l else case divmod_abs k l of (r, s) \<Rightarrow> if s = 0 then (- r, 0) else (- r - 1, - l - s)))
[PROOF STEP]
by (cases l "0 :: integer" rule: linorder_cases)
    (auto split: prod.splits simp add: divmod_integer_eq_cases)


[STATEMENT]
lemma open_einterval[simp]: "open (einterval a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (einterval a b)
[PROOF STEP]
by (cases a b rule: ereal2_cases)
     (auto simp: einterval_def intro!: open_Collect_conj open_Collect_less continuous_intros)


[STATEMENT]
lemma vector_space_on_alt_def: "vector_space_on U\<^sub>V\<^sub>S = module_on U\<^sub>V\<^sub>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_space_on U\<^sub>V\<^sub>S = module_on U\<^sub>V\<^sub>S
[PROOF STEP]
unfolding vector_space_on_def module_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>scale. ((\<forall>x y a. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> y \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale a (x + y) = scale a x + scale a y) \<and> (\<forall>x a b. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale (a + b) x = scale a x + scale b x) \<and> (\<forall>x a b. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale a (scale b x) = scale (a * b) x)) \<and> ((\<forall>x. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale (1::'a) x = x) \<and> (\<forall>x y. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> y \<in> U\<^sub>V\<^sub>S \<longrightarrow> x + y \<in> U\<^sub>V\<^sub>S)) \<and> (0::'b) \<in> U\<^sub>V\<^sub>S \<and> (\<forall>x a. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale a x \<in> U\<^sub>V\<^sub>S)) = (\<lambda>scale. ((\<forall>x y a. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> y \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale a (x + y) = scale a x + scale a y) \<and> (\<forall>x a b. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale (a + b) x = scale a x + scale b x) \<and> (\<forall>x a b. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale a (scale b x) = scale (a * b) x)) \<and> ((\<forall>x. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale (1::'a) x = x) \<and> (\<forall>x y. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> y \<in> U\<^sub>V\<^sub>S \<longrightarrow> x + y \<in> U\<^sub>V\<^sub>S)) \<and> (0::'b) \<in> U\<^sub>V\<^sub>S \<and> (\<forall>x a. x \<in> U\<^sub>V\<^sub>S \<longrightarrow> scale a x \<in> U\<^sub>V\<^sub>S))
[PROOF STEP]
by auto


[STATEMENT]
lemma lower_plus: "lower (p + q) v = lower p v + lower q v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower (p + q) v = lower p v + lower q v
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_add lookup_lower)


[STATEMENT]
lemma cong_mid2__cong:
  assumes "M Midpoint A B" and
    "M' Midpoint A' B'" and
    "Cong A M A' M'"
  shows "Cong A B A' B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong A B A' B'
[PROOF STEP]
by (meson assms(1) assms(2) assms(3) cong_inner_transitivity l2_11_b midpoint_bet midpoint_cong)


[STATEMENT]
lemma fmlookup_image_iff: "y |\<in>| fmimage m A \<longleftrightarrow> (\<exists>x. fmlookup m x = Some y \<and> x |\<in>| A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y |\<in>| fmimage m A) = (\<exists>x. fmlookup m x = Some y \<and> x |\<in>| A)
[PROOF STEP]
by transfer' (auto simp: ran_def)


[STATEMENT]
lemma insertl_replicate: "m \<le> n \<Longrightarrow>
  insertl m x (replicate n x) = x # replicate n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> insertl m x (replicate n x) = x # replicate n x
[PROOF STEP]
apply (induct n arbitrary: m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. m \<le> 0 \<Longrightarrow> insertl m x (replicate 0 x) = x # replicate 0 x
 2. \<And>n m. \<lbrakk>\<And>m. m \<le> n \<Longrightarrow> insertl m x (replicate n x) = x # replicate n x; m \<le> Suc n\<rbrakk> \<Longrightarrow> insertl m x (replicate (Suc n) x) = x # replicate (Suc n) x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n m. \<lbrakk>\<And>m. m \<le> n \<Longrightarrow> insertl m x (replicate n x) = x # replicate n x; m \<le> Suc n\<rbrakk> \<Longrightarrow> insertl m x (replicate (Suc n) x) = x # replicate (Suc n) x
[PROOF STEP]
apply (case_tac m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n m. \<lbrakk>\<And>m. m \<le> n \<Longrightarrow> insertl m x (replicate n x) = x # replicate n x; m \<le> Suc n; m = 0\<rbrakk> \<Longrightarrow> insertl m x (replicate (Suc n) x) = x # replicate (Suc n) x
 2. \<And>n m nat. \<lbrakk>\<And>m. m \<le> n \<Longrightarrow> insertl m x (replicate n x) = x # replicate n x; m \<le> Suc n; m = Suc nat\<rbrakk> \<Longrightarrow> insertl m x (replicate (Suc n) x) = x # replicate (Suc n) x
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma utility_less_iff:
  "x \<in> carrier \<Longrightarrow> y \<in> carrier \<Longrightarrow> u x < u y \<longleftrightarrow> x \<prec>[le] y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> (u x < u y) = x \<prec>[le] y
[PROOF STEP]
using utility_le_iff[of x y] utility_le_iff[of y x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> (u x \<le> u y) = le x y
\<lbrakk>y \<in> carrier; x \<in> carrier\<rbrakk> \<Longrightarrow> (u y \<le> u x) = le y x

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier; y \<in> carrier\<rbrakk> \<Longrightarrow> (u x < u y) = x \<prec>[le] y
[PROOF STEP]
by (auto simp: strongly_preferred_def)


[STATEMENT]
lemma degree_qr_poly:
  "degree (qr_poly :: 'a :: qr_spec mod_ring poly) = deg_qr (TYPE('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree qr_poly = deg_qr TYPE('a)
[PROOF STEP]
unfolding qr_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (of_int_poly (qr_poly' TYPE('a))) = deg_qr TYPE('a)
[PROOF STEP]
using not_dvd_lead_coeff_qr_poly'[where ?'a = 'a]
[PROOF STATE]
proof (prove)
using this:
\<not> int CARD('a) dvd lead_coeff (qr_poly' TYPE('a))

goal (1 subgoal):
 1. degree (of_int_poly (qr_poly' TYPE('a))) = deg_qr TYPE('a)
[PROOF STEP]
by (subst degree_of_int_poly')
     (auto simp: of_int_mod_ring_eq_0_iff degree_qr_poly')


[STATEMENT]
lemma (in Group) i_m_closed:"\<lbrakk>a \<in> carrier G ; b \<in> carrier G\<rbrakk> \<Longrightarrow>
              (\<rho> a) \<cdot> b \<in> carrier G "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier G; b \<in> carrier G\<rbrakk> \<Longrightarrow> \<rho> a \<cdot> b \<in> carrier G
[PROOF STEP]
by (rule mult_closed,
       simp add:i_closed, assumption)


[STATEMENT]
lemma uMult_commute: "x *\<^sub># y = y *\<^sub># x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub># y = y *\<^sub># x
[PROOF STEP]
unfolding uMult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>x\<cdot>y = (\<Lambda> x y. Discr (undiscr x * undiscr y))\<cdot>y\<cdot>x
[PROOF STEP]
by simp


[STATEMENT]
lemma vint_vsubset_vreal: "\<int>\<^sub>\<circ> \<subseteq>\<^sub>\<circ> \<real>\<^sub>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<int>\<^sub>\<circ> \<subseteq>\<^sub>\<circ> \<real>\<^sub>\<circ>
[PROOF STEP]
unfolding vint_def vint_of_int_def vreal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.set (range (\<lambda>x. (real_of_int x)\<^sub>\<real>)) \<subseteq>\<^sub>\<circ> ZFC_in_HOL.set (range vreal_of_real)
[PROOF STEP]
using image_cong
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?M = ?N; \<And>x. x \<in> ?N \<Longrightarrow> ?f x = ?g x\<rbrakk> \<Longrightarrow> ?f ` ?M = ?g ` ?N

goal (1 subgoal):
 1. ZFC_in_HOL.set (range (\<lambda>x. (real_of_int x)\<^sub>\<real>)) \<subseteq>\<^sub>\<circ> ZFC_in_HOL.set (range vreal_of_real)
[PROOF STEP]
by auto


[STATEMENT]
lemma Ord_is_Transset: "Ord i \<Longrightarrow> Transset i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord i \<Longrightarrow> Transset i
[PROOF STEP]
by (simp add: Ord_def)


[STATEMENT]
lemma JN_Join_miniscope:
     "i \<in> I ==> (\<Squnion>i \<in> I. F i\<squnion>G) = ((\<Squnion>i \<in> I. F i)\<squnion>G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> I \<Longrightarrow> (\<Squnion>i\<in>I. F i \<squnion> G) = JOIN I F \<squnion> G
[PROOF STEP]
by (auto simp add: JN_Join_distrib JN_constant)


[STATEMENT]
theorem wls_vsubstEnv_compose1:
assumes "wlsEnv rho"
shows "((rho &[y1 // y]_ys) &[y2 // y]_ys) = (rho &[(y1 @ys[y2 / y]_ys) // y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rho &[y1 // y]_ys &[y2 // y]_ys = rho &[y1 @ys[y2 / y]_ys // y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho

goal (1 subgoal):
 1. rho &[y1 // y]_ys &[y2 // y]_ys = rho &[y1 @ys[y2 / y]_ys // y]_ys
[PROOF STEP]
by(simp add: vsubstEnv_compose1)


[STATEMENT]
lemma hm_exch_op_\<alpha>_correct: "hm_exch_op hm i j \<le>\<^sub>n SPEC (\<lambda>hm'.
      hm_valid hm i \<and> hm_valid hm j \<and> hm'=hm_exch hm i j
      )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hm_exch_op hm i j \<le>\<^sub>n SPEC (\<lambda>hm'. hm_valid hm i \<and> hm_valid hm j \<and> hm' = hm_exch hm i j)
[PROOF STEP]
unfolding hm_exch_op_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case hm of (pq, m) \<Rightarrow> \<lambda>i j. ASSERT (hm_valid (pq, m) i) \<bind> (\<lambda>_. ASSERT (hm_valid (pq, m) j) \<bind> (\<lambda>_. ASSERT (hmr_invar (pq, m)) \<bind> (\<lambda>_. mop_list_swap pq (i - 1) (j - 1) \<bind> (\<lambda>pq. RETURN (pq, m)))))) i j \<le>\<^sub>n SPEC (\<lambda>hm'. hm_valid hm i \<and> hm_valid hm j \<and> hm' = hm_exch hm i j)
[PROOF STEP]
apply refine_vcg
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x1 x2. \<lbrakk>hm = (x1, x2); hm_valid (x1, x2) i; hm_valid (x1, x2) j; hmr_invar (x1, x2); i - 1 < length x1 \<and> j - 1 < length x1\<rbrakk> \<Longrightarrow> hm_valid hm i
 2. \<And>x1 x2. \<lbrakk>hm = (x1, x2); hm_valid (x1, x2) i; hm_valid (x1, x2) j; hmr_invar (x1, x2); i - 1 < length x1 \<and> j - 1 < length x1\<rbrakk> \<Longrightarrow> hm_valid hm j
 3. \<And>x1 x2. \<lbrakk>hm = (x1, x2); hm_valid (x1, x2) i; hm_valid (x1, x2) j; hmr_invar (x1, x2); i - 1 < length x1 \<and> j - 1 < length x1\<rbrakk> \<Longrightarrow> (swap x1 (i - 1) (j - 1), x2) = hm_exch hm i j
[PROOF STEP]
apply (vc_solve simp: hm_valid_def hm_length_def heapmap_\<alpha>_def solve: asm_rl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>hm = (x1, x2); hmr_invar (x1, x2); 0 < i; i \<le> length x1; 0 < j; j \<le> length x1; i - Suc 0 < length x1; j - Suc 0 < length x1\<rbrakk> \<Longrightarrow> (swap x1 (i - Suc 0) (j - Suc 0), x2) = hm_exch (x1, x2) i j
[PROOF STEP]
apply (auto simp add: hm_key_of_def hm_exch_def swap_def) []
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma emeasure_cond_spmf:
  "emeasure (measure_spmf (cond_spmf p A)) B = emeasure (measure_spmf p) (A \<inter> B) / emeasure (measure_spmf p) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_spmf (cond_spmf p A)) B = emeasure (measure_spmf p) (A \<inter> B) / emeasure (measure_spmf p) A
[PROOF STEP]
apply(clarsimp simp add: cond_spmf_def emeasure_measure_spmf_conv_measure_pmf emeasure_measure_pmf_zero_iff set_pmf_Int_Some split!: if_split)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. set_spmf p \<inter> A = {} \<Longrightarrow> set_spmf p \<inter> (A \<inter> B) = {}
 2. \<And>x. \<lbrakk>emeasure (measure_pmf (cond_pmf p (Some ` A))) (Some ` B) \<noteq> emeasure (measure_pmf p) (Some ` (A \<inter> B)) / emeasure (measure_pmf p) (Some ` A); x \<in> set_spmf p; x \<in> A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>emeasure (measure_pmf (cond_pmf p (Some ` A))) (Some ` B) \<noteq> emeasure (measure_pmf p) (Some ` (A \<inter> B)) / emeasure (measure_pmf p) (Some ` A); x \<in> set_spmf p; x \<in> A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(subst (asm) emeasure_cond_pmf)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> set_spmf p; x \<in> A\<rbrakk> \<Longrightarrow> set_pmf p \<inter> Some ` A \<noteq> {}
 2. \<And>x. \<lbrakk>emeasure (measure_pmf p) (Some ` A \<inter> Some ` B) / emeasure (measure_pmf p) (Some ` A) \<noteq> emeasure (measure_pmf p) (Some ` (A \<inter> B)) / emeasure (measure_pmf p) (Some ` A); x \<in> set_spmf p; x \<in> A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by(auto simp add: set_pmf_Int_Some image_Int)


[STATEMENT]
lemma fixed_degree_in_varI:
  assumes "m \<in> monomials_of R P"
  assumes "count m i = n"
  shows "m \<in> fixed_degree_in_var R P i n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<in> fixed_degree_in_var R P i n
[PROOF STEP]
unfolding fixed_degree_in_var_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<in> {m \<in> monomials_of R P. count m i = n}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<in> monomials_of R P
count m i = n

goal (1 subgoal):
 1. m \<in> {m \<in> monomials_of R P. count m i = n}
[PROOF STEP]
by blast


[STATEMENT]
lemma mult_vars_rep:
  assumes "as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "i < n"
  assumes "j < n"
  shows "mult_vars i j as = Qp_ev ((pvar Q\<^sub>p i) \<otimes>\<^bsub>Q\<^sub>p[\<X>\<^bsub>n\<^esub>]\<^esub> (pvar Q\<^sub>p j)) as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_vars i j as = eval_at_point Q\<^sub>p as (pvar Q\<^sub>p i \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>n\<^esub>]\<^esub> pvar Q\<^sub>p j)
[PROOF STEP]
unfolding mult_vars_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. as ! i \<otimes> as ! j = eval_at_point Q\<^sub>p as (pvar Q\<^sub>p i \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>n\<^esub>]\<^esub> pvar Q\<^sub>p j)
[PROOF STEP]
using assms eval_at_point_mult[of as n "pvar Q\<^sub>p i" "pvar Q\<^sub>p j"]
        eval_pvar[of i n as] eval_pvar[of j n as ]
[PROOF STATE]
proof (prove)
using this:
as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
i < n
j < n
\<lbrakk>as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>); pvar Q\<^sub>p i \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>]); pvar Q\<^sub>p j \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])\<rbrakk> \<Longrightarrow> eval_at_point Q\<^sub>p as (pvar Q\<^sub>p i \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>n\<^esub>]\<^esub> pvar Q\<^sub>p j) = eval_at_point Q\<^sub>p as (pvar Q\<^sub>p i) \<otimes> eval_at_point Q\<^sub>p as (pvar Q\<^sub>p j)
\<lbrakk>i < n; as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> eval_at_point Q\<^sub>p as (pvar Q\<^sub>p i) = as ! i
\<lbrakk>j < n; as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> eval_at_point Q\<^sub>p as (pvar Q\<^sub>p j) = as ! j

goal (1 subgoal):
 1. as ! i \<otimes> as ! j = eval_at_point Q\<^sub>p as (pvar Q\<^sub>p i \<otimes>\<^bsub>Q\<^sub>p [\<X>\<^bsub>n\<^esub>]\<^esub> pvar Q\<^sub>p j)
[PROOF STEP]
by (metis pvar_closed)


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


[STATEMENT]
lemma sup_le_union [simp]: "a \<le> b \<Longrightarrow> supremum (A \<union> {a, b}) = supremum (A \<union> {b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> supremum (A \<union> {a, b}) = supremum (A \<union> {b})
[PROOF STEP]
apply (simp add: supremum_def upper_bound_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> {aa. a \<le> aa \<and> b \<le> aa \<and> (\<forall>x\<in>A. x \<le> aa) \<and> (\<forall>x. a \<le> x \<and> b \<le> x \<and> (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> aa \<le> x)} = {a. b \<le> a \<and> (\<forall>x\<in>A. x \<le> a) \<and> (\<forall>x. b \<le> x \<and> (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> a \<le> x)}
[PROOF STEP]
by auto