[STATEMENT]
lemma continuous_sqrt_imp_simply_connected:
  assumes "connected S"
    and prev: "\<And>f::complex\<Rightarrow>complex. \<lbrakk>continuous_on S f; \<forall>z \<in> S. f z \<noteq> 0\<rbrakk>
                \<Longrightarrow> \<exists>g. continuous_on S g \<and> (\<forall>z \<in> S. f z = (g z)\<^sup>2)"
  shows "simply_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S
[PROOF STEP]
proof (clarsimp simp add: simply_connected_eq_holomorphic_sqrt [OF openS] \<open>connected S\<close>)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f holomorphic_on S; \<forall>z\<in>S. f z \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f holomorphic_on S; \<forall>z\<in>S. f z \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
assume "f holomorphic_on S" and nz: "\<forall>z\<in>S. f z \<noteq> 0"
[PROOF STATE]
proof (state)
this:
f holomorphic_on S
\<forall>z\<in>S. f z \<noteq> 0

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f holomorphic_on S; \<forall>z\<in>S. f z \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f holomorphic_on S
\<forall>z\<in>S. f z \<noteq> 0
[PROOF STEP]
obtain g where contg: "continuous_on S g" and geq: "\<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on S
\<forall>z\<in>S. f z \<noteq> 0

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis holomorphic_on_imp_continuous_on prev)
[PROOF STATE]
proof (state)
this:
continuous_on S g
?z \<in> S \<Longrightarrow> f ?z = (g ?z)\<^sup>2

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f holomorphic_on S; \<forall>z\<in>S. f z \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
show "\<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
proof (intro exI ballI conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?g holomorphic_on S
 2. \<And>z. z \<in> S \<Longrightarrow> f z = (?g z)\<^sup>2
[PROOF STEP]
show "g holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g holomorphic_on S
[PROOF STEP]
proof (clarsimp simp add: holomorphic_on_open [OF openS])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
assume "z \<in> S"
[PROOF STATE]
proof (state)
this:
z \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
with nz geq
[PROOF STATE]
proof (chain)
picking this:
\<forall>z\<in>S. f z \<noteq> 0
?z \<in> S \<Longrightarrow> f ?z = (g ?z)\<^sup>2
z \<in> S
[PROOF STEP]
have "g z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>S. f z \<noteq> 0
?z \<in> S \<Longrightarrow> f ?z = (g ?z)\<^sup>2
z \<in> S

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

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
obtain \<delta> where "0 < \<delta>" "\<And>w. \<lbrakk>w \<in> S; dist w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g w) (g z) < cmod (g z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>w. \<lbrakk>w \<in> S; dist w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g w) (g z) < cmod (g z)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using contg [unfolded continuous_on_iff]
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<forall>e>0. \<exists>d>0. \<forall>x'\<in>S. dist x' x < d \<longrightarrow> dist (g x') (g x) < e

goal (1 subgoal):
 1. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>w. \<lbrakk>w \<in> S; dist w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g w) (g z) < cmod (g z)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>g z \<noteq> 0\<close> \<open>z \<in> S\<close> zero_less_norm_iff)
[PROOF STATE]
proof (state)
this:
0 < \<delta>
\<lbrakk>?w \<in> S; dist ?w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g ?w) (g z) < cmod (g z)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < \<delta>
\<lbrakk>?w \<in> S; dist ?w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g ?w) (g z) < cmod (g z)
[PROOF STEP]
have \<delta>: "\<And>w. \<lbrakk>w \<in> S; w \<in> ball z \<delta>\<rbrakk> \<Longrightarrow> g w + g z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < \<delta>
\<lbrakk>?w \<in> S; dist ?w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g ?w) (g z) < cmod (g z)

goal (1 subgoal):
 1. \<And>w. \<lbrakk>w \<in> S; w \<in> ball z \<delta>\<rbrakk> \<Longrightarrow> g w + g z \<noteq> 0
[PROOF STEP]
apply (clarsimp simp: dist_norm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. \<lbrakk>w \<in> S; cmod (z - w) < \<delta>; 0 < \<delta>; \<And>w. \<lbrakk>w \<in> S; cmod (w - z) < \<delta>\<rbrakk> \<Longrightarrow> cmod (g w - g z) < cmod (g z); g w + g z = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis \<open>g z \<noteq> 0\<close> add_diff_cancel_left' diff_0_right norm_eq_zero norm_increases_online norm_minus_commute norm_not_less_zero not_less_iff_gr_or_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?w \<in> S; ?w \<in> ball z \<delta>\<rbrakk> \<Longrightarrow> g ?w + g z \<noteq> 0

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
have *: "(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>x. (f x - f z) / (x - z)) \<midarrow>z\<rightarrow> deriv f z
 2. g \<midarrow>z\<rightarrow> g z
 3. g z + g z \<noteq> 0
[PROOF STEP]
using SC_Chain.openS SC_Chain_axioms \<open>f holomorphic_on S\<close> \<open>z \<in> S\<close> has_field_derivativeD holomorphic_derivI
[PROOF STATE]
proof (prove)
using this:
SC_Chain ?S \<Longrightarrow> open ?S
SC_Chain S
f holomorphic_on S
z \<in> S
(?f has_field_derivative ?D) (at ?x within ?S) \<Longrightarrow> ((\<lambda>y. (?f y - ?f ?x) / (y - ?x)) \<longlongrightarrow> ?D) (at ?x within ?S)
\<lbrakk>?f holomorphic_on ?S; open ?S; ?x \<in> ?S\<rbrakk> \<Longrightarrow> (?f has_field_derivative deriv ?f ?x) (at ?x within ?T)

goal (3 subgoals):
 1. (\<lambda>x. (f x - f z) / (x - z)) \<midarrow>z\<rightarrow> deriv f z
 2. g \<midarrow>z\<rightarrow> g z
 3. g z + g z \<noteq> 0
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. g \<midarrow>z\<rightarrow> g z
 2. g z + g z \<noteq> 0
[PROOF STEP]
using \<open>z \<in> S\<close> contg continuous_on_eq_continuous_at isCont_def openS
[PROOF STATE]
proof (prove)
using this:
z \<in> S
continuous_on S g
open ?s \<Longrightarrow> continuous_on ?s ?f = (\<forall>x\<in>?s. isCont ?f x)
isCont ?f ?a = ?f \<midarrow>?a\<rightarrow> ?f ?a
open S

goal (2 subgoals):
 1. g \<midarrow>z\<rightarrow> g z
 2. g z + g z \<noteq> 0
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g z + g z \<noteq> 0
[PROOF STEP]
by (simp add: \<open>g z \<noteq> 0\<close>)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)
[PROOF STEP]
have "(g has_field_derivative deriv f z / (g z + g z)) (at z)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)

goal (1 subgoal):
 1. (g has_field_derivative deriv f z / (g z + g z)) (at z)
[PROOF STEP]
unfolding has_field_derivative_iff
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)

goal (1 subgoal):
 1. (\<lambda>y. (g y - g z) / (y - z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)
[PROOF STEP]
proof (rule Lim_transform_within_open)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open ?s
 2. z \<in> ?s
 3. \<And>x. \<lbrakk>x \<in> ?s; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
show "open (ball z \<delta> \<inter> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (ball z \<delta> \<inter> S)
[PROOF STEP]
by (simp add: openS open_Int)
[PROOF STATE]
proof (state)
this:
open (ball z \<delta> \<inter> S)

goal (2 subgoals):
 1. z \<in> ball z \<delta> \<inter> S
 2. \<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
show "z \<in> ball z \<delta> \<inter> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> ball z \<delta> \<inter> S
[PROOF STEP]
using \<open>z \<in> S\<close> \<open>0 < \<delta>\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> S
0 < \<delta>

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
show "\<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk>
                  \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
using \<delta>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> S; ?w \<in> ball z \<delta>\<rbrakk> \<Longrightarrow> g ?w + g z \<noteq> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
apply (simp add: geq \<open>z \<in> S\<close> divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>dist z x < \<delta> \<and> x \<in> S; x \<noteq> z; \<And>w. \<lbrakk>w \<in> S; dist z w < \<delta>\<rbrakk> \<Longrightarrow> g w + g z \<noteq> 0\<rbrakk> \<Longrightarrow> (g x)\<^sup>2 - (g z)\<^sup>2 = (g x - g z) * (g x + g z)
[PROOF STEP]
apply (auto simp: algebra_simps power2_eq_square)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> ball z \<delta> \<inter> S; ?x \<noteq> z\<rbrakk> \<Longrightarrow> (f ?x - f z) / (?x - z) / (g ?x + g z) = (g ?x - g z) / (?x - z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(g has_field_derivative deriv f z / (g z + g z)) (at z)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g has_field_derivative deriv f z / (g z + g z)) (at z)
[PROOF STEP]
show "\<exists>f'. (g has_field_derivative f') (at z)"
[PROOF STATE]
proof (prove)
using this:
(g has_field_derivative deriv f z / (g z + g z)) (at z)

goal (1 subgoal):
 1. \<exists>f'. (g has_field_derivative f') (at z)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>f'. (g has_field_derivative f') (at z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g holomorphic_on S

goal (1 subgoal):
 1. \<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2
[PROOF STEP]
qed (use geq in auto)
[PROOF STATE]
proof (state)
this:
\<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lcm_empty [simp]: "Lcm {} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lcm {} = (1::'a)
[PROOF STEP]
by (auto intro: associated_eqI Lcm_least)


[STATEMENT]
lemma mono_Mu:
  assumes A : "mono P"
  and     B : "\<And> X. mono (P X)"
  shows  "mono (lfp P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (lfp P)
[PROOF STEP]
apply (subst lfp_unfold)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mono P
 2. mono (P (lfp P))
[PROOF STEP]
apply (auto simp: A B)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma winding_number_negatepath:
  assumes \<gamma>: "valid_path \<gamma>" and 0: "0 \<notin> path_image \<gamma>"
  shows "winding_number(uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
have "(/) 1 contour_integrable_on \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (/) 1 contour_integrable_on \<gamma>
[PROOF STEP]
using "0" \<gamma> contour_integrable_inversediff
[PROOF STATE]
proof (prove)
using this:
0 \<notin> path_image \<gamma>
valid_path \<gamma>
\<lbrakk>valid_path ?g; ?z \<notin> path_image ?g\<rbrakk> \<Longrightarrow> (\<lambda>w. 1 / (w - ?z)) contour_integrable_on ?g

goal (1 subgoal):
 1. (/) 1 contour_integrable_on \<gamma>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(/) 1 contour_integrable_on \<gamma>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(/) 1 contour_integrable_on \<gamma>
[PROOF STEP]
have "((\<lambda>z. 1/z) has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
(/) 1 contour_integrable_on \<gamma>

goal (1 subgoal):
 1. ((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
by (rule has_contour_integral_integral)
[PROOF STATE]
proof (state)
this:
((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
have "((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
using has_contour_integral_neg
[PROOF STATE]
proof (prove)
using this:
((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>
(?f has_contour_integral ?i) ?g \<Longrightarrow> ((\<lambda>x. - ?f x) has_contour_integral - ?i) ?g

goal (1 subgoal):
 1. ((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
have "contour_integral (uminus \<circ> \<gamma>) ((/) 1) =
        contour_integral \<gamma> ((/) 1)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>

goal (1 subgoal):
 1. contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)
[PROOF STEP]
using \<gamma>
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>
valid_path \<gamma>

goal (1 subgoal):
 1. contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)
[PROOF STEP]
by (simp add: contour_integral_unique has_contour_integral_negatepath)
[PROOF STATE]
proof (state)
this:
contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)
valid_path \<gamma>
0 \<notin> path_image \<gamma>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
by (simp add: winding_number_valid_path valid_path_negatepath image_def path_defs)
[PROOF STATE]
proof (state)
this:
winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isolate_variable_spase_zero : "lookup m x = 0 \<Longrightarrow>
    insertion (nth L) ((MPoly_Type.monom m a)::real mpoly) = 0 \<Longrightarrow>
    a \<noteq> 0 \<Longrightarrow> insertion (nth L) (isolate_variable_sparse (MPoly_Type.monom m a) x 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lookup m x = 0; insertion ((!) L) (MPoly_Type.monom m a) = 0; a \<noteq> 0\<rbrakk> \<Longrightarrow> insertion ((!) L) (isolate_variable_sparse (MPoly_Type.monom m a) x 0) = 0
[PROOF STEP]
by (simp add: isovarspase_monom lookup_eq_zero_in_keys_contradict notInKeys_notInVars)


[STATEMENT]
lemma filter_inf_right_dist_sup:
  assumes "filter F"
      and "filter G"
      and "filter H"
    shows "filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
have "filter_sup (F \<inter> H) (G \<inter> H) = filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup (F \<inter> H) (G \<inter> H) = filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H
[PROOF STEP]
by (simp add: assms filter_sup_left_dist_inf filter_inf)
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) (G \<inter> H) = filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) (G \<inter> H) = filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
have "... = filter_sup (F \<inter> H) G \<inter> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H = filter_sup (F \<inter> H) G \<inter> H
[PROOF STEP]
using assms(1,3) filter_sup_absorb_inf
[PROOF STATE]
proof (prove)
using this:
ord_class.filter F
ord_class.filter H
\<lbrakk>ord_class.filter ?F; ord_class.filter ?G\<rbrakk> \<Longrightarrow> filter_sup (?F \<inter> ?G) ?G = ?G

goal (1 subgoal):
 1. filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H = filter_sup (F \<inter> H) G \<inter> H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H = filter_sup (F \<inter> H) G \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H = filter_sup (F \<inter> H) G \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
have "... = filter_sup F G \<inter> filter_sup G H \<inter> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup (F \<inter> H) G \<inter> H = filter_sup F G \<inter> filter_sup G H \<inter> H
[PROOF STEP]
using assms filter_sup_left_dist_inf filter_sup_symmetric
[PROOF STATE]
proof (prove)
using this:
ord_class.filter F
ord_class.filter G
ord_class.filter H
\<lbrakk>ord_class.filter ?F; ord_class.filter ?G; ord_class.filter ?H\<rbrakk> \<Longrightarrow> filter_sup ?F (?G \<inter> ?H) = filter_sup ?F ?G \<inter> filter_sup ?F ?H
filter_sup ?F ?G = filter_sup ?G ?F

goal (1 subgoal):
 1. filter_sup (F \<inter> H) G \<inter> H = filter_sup F G \<inter> filter_sup G H \<inter> H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) G \<inter> H = filter_sup F G \<inter> filter_sup G H \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) G \<inter> H = filter_sup F G \<inter> filter_sup G H \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
have "... = filter_sup F G \<inter> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup F G \<inter> filter_sup G H \<inter> H = filter_sup F G \<inter> H
[PROOF STEP]
by (simp add: assms(2-3) filter_inf_absorb_sup semilattice_inf_class.inf_assoc)
[PROOF STATE]
proof (state)
this:
filter_sup F G \<inter> filter_sup G H \<inter> H = filter_sup F G \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
filter_sup (F \<inter> H) (G \<inter> H) = filter_sup F G \<inter> H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filter_sup (F \<inter> H) (G \<inter> H) = filter_sup F G \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_categoryI'':
  assumes "tiny_category \<alpha> \<CC>" and "vfinite (\<CC>\<lparr>Obj\<rparr>)" and "vfinite (\<CC>\<lparr>Arr\<rparr>)"
  shows "finite_category \<alpha> \<CC>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_category \<alpha> \<CC>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
tiny_category \<alpha> \<CC>
vfinite (\<CC>\<lparr>Obj\<rparr>)
vfinite (\<CC>\<lparr>Arr\<rparr>)

goal (1 subgoal):
 1. finite_category \<alpha> \<CC>
[PROOF STEP]
by (intro finite_categoryI') (auto intro: cat_small_cs_intros)


[STATEMENT]
lemma totalize_Join: "totalize F\<squnion>totalize G = totalize (F\<squnion>G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totalize F \<squnion> totalize G = totalize (F \<squnion> G)
[PROOF STEP]
by (simp add: program_equalityI totalize_def Join_def image_Un)


[STATEMENT]
lemma (in product_sigma_finite) product_nn_integral_prod:
  assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)"
  shows "(\<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M) = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
proof (induction I)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
case (insert i I)
[PROOF STATE]
proof (state)
this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
note insert.prems[measurable]
[PROOF STATE]
proof (state)
this:
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
note \<open>finite I\<close>[intro, simp]
[PROOF STATE]
proof (state)
this:
finite I

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
interpret I: finite_product_sigma_finite M I
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_product_sigma_finite M I
[PROOF STEP]
by standard auto
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
have *: "\<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (1 subgoal):
 1. \<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))
[PROOF STEP]
by (auto intro!: prod.cong)
[PROOF STATE]
proof (state)
this:
(\<Prod>j\<in>I. f j (if j = i then ?y else ?x j)) = (\<Prod>j\<in>I. f j (?x j))

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
have prod: "\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. (\<Prod>i\<in>J. f i (x i))) \<in> borel_measurable (Pi\<^sub>M J M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)
[PROOF STEP]
using sets.sets_into_space insert
[PROOF STATE]
proof (prove)
using this:
?x \<in> sets ?M \<Longrightarrow> ?x \<subseteq> space ?M
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (1 subgoal):
 1. \<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)
[PROOF STEP]
by (intro borel_measurable_prod_ennreal
              measurable_comp[OF measurable_component_singleton, unfolded comp_def])
       auto
[PROOF STATE]
proof (state)
this:
?J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>?J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M ?J M)

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>?J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M ?J M)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>?J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M ?J M)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Prod>i\<in>insert i I. f i (x i)) \<partial>Pi\<^sub>M (insert i I) M = (\<Prod>i\<in>insert i I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
apply (simp add: product_nn_integral_insert[OF insert(1,2)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)) \<Longrightarrow> \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. (\<Prod>ia\<in>insert i I. f ia (if ia = i then y else x ia)) \<partial>M i \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>insert i I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
apply (simp add: insert(2-) * nn_integral_multc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)) \<Longrightarrow> \<integral>\<^sup>+ x. integral\<^sup>N (M i) (f i) * (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = integral\<^sup>N (M i) (f i) * (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
apply (subst nn_integral_cmult)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)) \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>I. f i (x i)) \<in> borel_measurable (Pi\<^sub>M I M)
 2. (\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)) \<Longrightarrow> integral\<^sup>N (M i) (f i) * \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = integral\<^sup>N (M i) (f i) * (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
apply (auto simp add: insert(2-))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<Prod>i\<in>insert i I. f i (x i)) \<partial>Pi\<^sub>M (insert i I) M = (\<Prod>i\<in>insert i I. integral\<^sup>N (M i) (f i))

goal (1 subgoal):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
[PROOF STEP]
qed (simp add: space_PiM)


[STATEMENT]
lemma TOP001_2:
 "(\<forall>Vf U. element_of_set(U::'a,union_of_members(Vf)) --> element_of_set(U::'a,f1(Vf::'a,U))) &
  (\<forall>U Vf. element_of_set(U::'a,union_of_members(Vf)) --> element_of_collection(f1(Vf::'a,U),Vf)) &
  (\<forall>U Uu1 Vf. element_of_set(U::'a,Uu1) & element_of_collection(Uu1::'a,Vf) --> element_of_set(U::'a,union_of_members(Vf))) &
  (\<forall>Vf X. basis(X::'a,Vf) --> equal_sets(union_of_members(Vf),X)) &
  (\<forall>Vf U X. element_of_collection(U::'a,top_of_basis(Vf)) & element_of_set(X::'a,U) --> element_of_set(X::'a,f10(Vf::'a,U,X))) &
  (\<forall>U X Vf. element_of_collection(U::'a,top_of_basis(Vf)) & element_of_set(X::'a,U) --> element_of_collection(f10(Vf::'a,U,X),Vf)) &
  (\<forall>X. subset_sets(X::'a,X)) &
  (\<forall>X U Y. subset_sets(X::'a,Y) & element_of_set(U::'a,X) --> element_of_set(U::'a,Y)) &
  (\<forall>X Y. equal_sets(X::'a,Y) --> subset_sets(X::'a,Y)) &
  (\<forall>Y X. subset_sets(X::'a,Y) | element_of_set(in_1st_set(X::'a,Y),X)) &
  (\<forall>X Y. element_of_set(in_1st_set(X::'a,Y),Y) --> subset_sets(X::'a,Y)) &
  (basis(cx::'a,f)) &
  (~subset_sets(union_of_members(top_of_basis(f)),cx)) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>Vf U. element_of_set (U, union_of_members Vf) \<longrightarrow> element_of_set (U, f1 (Vf, U))) \<and> (\<forall>U Vf. element_of_set (U, union_of_members Vf) \<longrightarrow> element_of_collection (f1 (Vf, U), Vf)) \<and> (\<forall>U Uu1 Vf. element_of_set (U, Uu1) \<and> element_of_collection (Uu1, Vf) \<longrightarrow> element_of_set (U, union_of_members Vf)) \<and> (\<forall>Vf X. basis (X, Vf) \<longrightarrow> equal_sets (union_of_members Vf, X)) \<and> (\<forall>Vf U X. element_of_collection (U, top_of_basis Vf) \<and> element_of_set (X, U) \<longrightarrow> element_of_set (X, f10 (Vf, U, X))) \<and> (\<forall>U X Vf. element_of_collection (U, top_of_basis Vf) \<and> element_of_set (X, U) \<longrightarrow> element_of_collection (f10 (Vf, U, X), Vf)) \<and> (\<forall>X. subset_sets (X, X)) \<and> (\<forall>X U Y. subset_sets (X, Y) \<and> element_of_set (U, X) \<longrightarrow> element_of_set (U, Y)) \<and> (\<forall>X Y. equal_sets (X, Y) \<longrightarrow> subset_sets (X, Y)) \<and> (\<forall>Y X. subset_sets (X, Y) \<or> element_of_set (in_1st_set (X, Y), X)) \<and> (\<forall>X Y. element_of_set (in_1st_set (X, Y), Y) \<longrightarrow> subset_sets (X, Y)) \<and> basis (cx, f) \<and> \<not> subset_sets (union_of_members (top_of_basis f), cx) \<longrightarrow> False
[PROOF STEP]
by meson


[STATEMENT]
lemma funcset_vimage_diff:
  "f : A \<rightarrow> B \<Longrightarrow> A - f-`(B - C) = A \<inter> f-`C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> A \<rightarrow> B \<Longrightarrow> A - f -` (B - C) = A \<inter> f -` C
[PROOF STEP]
by (auto intro: funcset_mem)


[STATEMENT]
lemma reduced_labelling_unique:
  "r \<le> n \<Longrightarrow> \<forall>i<r. x i = 0 \<Longrightarrow> r = n \<or> x r \<noteq> 0 \<Longrightarrow> reduced n x = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> n; \<forall>i<r. x i = 0; r = n \<or> x r \<noteq> 0\<rbrakk> \<Longrightarrow> reduced n x = r
[PROOF STEP]
unfolding reduced_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> n; \<forall>i<r. x i = 0; r = n \<or> x r \<noteq> 0\<rbrakk> \<Longrightarrow> (LEAST k. k = n \<or> x k \<noteq> 0) = r
[PROOF STEP]
by (rule LeastI2_wellorder[where a=n]) (metis le_less not_le)+


[STATEMENT]
lemma hcomplex_of_hypreal_mult_HComplex:
  "\<And>r x y. hcomplex_of_hypreal r * HComplex x y = HComplex (r * x) (r * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r x y. hcomplex_of_hypreal r * HComplex x y = HComplex (r * x) (r * y)
[PROOF STEP]
by transfer (rule complex_of_real_mult_Complex)


[STATEMENT]
lemma ordinal_plus_left_cancel [simp]:
"(w + x = w + y) = (x = (y::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w + x = w + y) = (x = y)
[PROOF STEP]
by (rule normal.cancel_eq[OF normal_plus])


[STATEMENT]
lemma upto_join: "\<lbrakk> i \<le> j; j \<le> k \<rbrakk> \<Longrightarrow> [i..j-1] @ j # [j+1..k] = [i..k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> [i..j - 1] @ j # [j + 1..k] = [i..k]
[PROOF STEP]
using upto_rec1 upto_split1
[PROOF STATE]
proof (prove)
using this:
?i \<le> ?j \<Longrightarrow> [?i..?j] = ?i # [?i + 1..?j]
\<lbrakk>?i \<le> ?j; ?j \<le> ?k\<rbrakk> \<Longrightarrow> [?i..?k] = [?i..?j - 1] @ [?j..?k]

goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> [i..j - 1] @ j # [j + 1..k] = [i..k]
[PROOF STEP]
by auto


[STATEMENT]
lemma Inf_par_distrib: "D \<noteq> {} \<Longrightarrow> (\<Sqinter> D) \<parallel> c = (\<Sqinter>d\<in>D. d \<parallel> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> \<Sqinter> D \<parallel> c = (\<Sqinter>d::'a\<in>D. d \<parallel> c)
variables:
c :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
D :: 'a set
type variables:
'a :: refinement_lattice
[PROOF STEP]
using par_Inf_distrib par_commute
[PROOF STATE]
proof (prove)
using this:
(?D::'a::refinement_lattice set) \<noteq> {} \<Longrightarrow> (?c::'a::refinement_lattice) \<parallel> \<Sqinter> ?D = \<Sqinter> ((\<parallel>) ?c ` ?D)
(?a::'a::refinement_lattice) \<parallel> (?b::'a::refinement_lattice) = ?b \<parallel> ?a

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> \<Sqinter> D \<parallel> c = (\<Sqinter>d::'a\<in>D. d \<parallel> c)
variables:
c :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
D :: 'a set
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp


[STATEMENT]
lemma comm_monoid: "comm_monoid R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.comm_monoid R
[PROOF STEP]
unfolding R_m_def residue_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.comm_monoid \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
[PROOF STEP]
apply (rule comm_monoidI)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
 2. \<one>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
 3. \<And>x y z. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; z \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> z = x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> (y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> z)
 4. \<And>x. x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr> \<Longrightarrow> \<one>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> x = x
 5. \<And>x y. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y = y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> x
[PROOF STEP]
using m_gt_one
[PROOF STATE]
proof (prove)
using this:
1 < m

goal (5 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
 2. \<one>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>
 3. \<And>x y z. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; z \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> z = x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> (y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> z)
 4. \<And>x. x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr> \<Longrightarrow> \<one>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> x = x
 5. \<And>x y. \<lbrakk>x \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>; y \<in> carrier \<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> y = y \<otimes>\<^bsub>\<lparr>carrier = {0..m - 1}, monoid.mult = \<lambda>x y. x * y mod m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod m\<rparr>\<^esub> x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>1 < m; 0 \<le> x; x < m; 0 \<le> y; y < m; 0 \<le> z; z < m\<rbrakk> \<Longrightarrow> x * y mod m * z mod m = x * (y * z mod m) mod m
 2. \<And>x y. \<lbrakk>1 < m; 0 \<le> x; x < m; 0 \<le> y; y < m\<rbrakk> \<Longrightarrow> x * y mod m = y * x mod m
[PROOF STEP]
apply (metis mod_mult_right_eq mult.assoc mult.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>1 < m; 0 \<le> x; x < m; 0 \<le> y; y < m\<rbrakk> \<Longrightarrow> x * y mod m = y * x mod m
[PROOF STEP]
apply (metis mult.commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vangle_commute: "vangle u v = vangle v u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle u v = vangle v u
[PROOF STEP]
by (simp add: vangle_def inner_commute mult.commute)


[STATEMENT]
lemma union_le_diff_plus: "P \<subseteq># M \<Longrightarrow> N < P \<Longrightarrow> M - P + N < M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<subseteq># M; N < P\<rbrakk> \<Longrightarrow> M - P + N < M
[PROOF STEP]
by (drule subset_mset.diff_add[symmetric]) (metis union_le_mono2)


[STATEMENT]
lemma push_bit_numeral [simp]:
  \<open>push_bit (numeral l) (numeral k) = push_bit (pred_numeral l) (numeral (Num.Bit0 k))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit (numeral l) (numeral k) = push_bit (pred_numeral l) (numeral (num.Bit0 k))
[PROOF STEP]
by (simp add: numeral_eq_Suc mult_2_right) (simp add: numeral_Bit0)


[STATEMENT]
lemma section_closed[intro, simp]: "section s Ds S \<Longrightarrow> closed {x \<in> S. s x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. section s Ds S \<Longrightarrow> closed {x \<in> S. s x = 0}
[PROOF STEP]
by (auto intro!: closed_levelset_within simp: section_def
      intro!: has_derivative_continuous_on has_derivative_at_withinI[where s=S])


[STATEMENT]
lemma aug_commute:"\<lbrakk>commute_bpp f (aug_pm_set z i A);
     x \<in> addition_set f (aug_pm_set z i A);
     y \<in> addition_set f (aug_pm_set z i A)\<rbrakk> \<Longrightarrow> x \<^sub>f+ y = y \<^sub>f+ x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>commute_bpp f (aug_pm_set z i A); x \<in> addition_set f (aug_pm_set z i A); y \<in> addition_set f (aug_pm_set z i A)\<rbrakk> \<Longrightarrow> x \<^sub>f+ y = y \<^sub>f+ x
[PROOF STEP]
apply (simp add: commute_bpp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in residues) res_of_natural_eq: "\<guillemotleft>n\<guillemotright>\<^sub>\<nat> = int n mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>n\<guillemotright>\<^sub>\<nat> = int n mod m
[PROOF STEP]
by (induct n)
    (simp_all add: of_natural_def res_zero_eq res_one_eq res_add_eq mod_add_right_eq)


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


[STATEMENT]
lemma  det_rows_mul:
  "det((\<chi> i. c i *s a i)::'a::comm_ring_1^'n^'n) =
    prod (\<lambda>i. c i) (UNIV:: 'n set) * det((\<chi> i. a i)::'a^'n^'n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (\<chi>i. c i *s a i) = prod c UNIV * det (\<chi>i. a i)
[PROOF STEP]
proof (simp add: det_def sum_distrib_left cong add: prod.cong, rule sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
let ?U = "UNIV :: 'n set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
let ?PU = "{p. p permutes ?U}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
assume pU: "p \<in> ?PU"
[PROOF STATE]
proof (state)
this:
p \<in> {p. p permutes UNIV}

goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
let ?s = "of_int (sign p)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
from pU
[PROOF STATE]
proof (chain)
picking this:
p \<in> {p. p permutes UNIV}
[PROOF STEP]
have p: "p permutes ?U"
[PROOF STATE]
proof (prove)
using this:
p \<in> {p. p permutes UNIV}

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

goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
have "prod (\<lambda>i. c i * a i $ p i) ?U = prod c ?U * prod (\<lambda>i. a i $ p i) ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>UNIV. c i * a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)
[PROOF STEP]
unfolding prod.distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>UNIV. c i * a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)

goal (2 subgoals):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
 2. \<And>x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. c xa * a xa $ x xa) = prod c UNIV * (of_int (sign x) * (\<Prod>xa\<in>UNIV. a xa $ x xa))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i\<in>UNIV. c i * a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)
[PROOF STEP]
show "?s * (\<Prod>xa\<in>?U. c xa * a xa $ p xa) =
    prod c ?U * (?s* (\<Prod>xa\<in>?U. a xa $ p xa))"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i\<in>UNIV. c i * a i $ p i) = prod c UNIV * (\<Prod>i\<in>UNIV. a i $ p i)

goal (1 subgoal):
 1. of_int (sign p) * (\<Prod>xa\<in>UNIV. c xa * a xa $ p xa) = prod c UNIV * (of_int (sign p) * (\<Prod>xa\<in>UNIV. a xa $ p xa))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
of_int (sign p) * (\<Prod>xa\<in>UNIV. c xa * a xa $ p xa) = prod c UNIV * (of_int (sign p) * (\<Prod>xa\<in>UNIV. a xa $ p xa))

goal (1 subgoal):
 1. {p. p permutes UNIV} = {p. p permutes UNIV}
[PROOF STEP]
qed rule


[STATEMENT]
lemma subarray_append: "\<lbrakk> i \<le> j; j \<le> k \<rbrakk> \<Longrightarrow> subarray i j a h @ subarray j k a h = subarray i k a h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> subarray i j a h @ subarray j k a h = subarray i k a h
[PROOF STEP]
unfolding subarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> nths' i j (Array.get h a) @ nths' j k (Array.get h a) = nths' i k (Array.get h a)
[PROOF STEP]
by (simp add: nths'_append)


[STATEMENT]
lemma iarray_to_matrix_matrix_to_iarray:
  fixes A::"'a^'columns::{mod_type}^'rows::{mod_type}"
  shows "iarray_to_matrix (matrix_to_iarray A)=A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iarray_to_matrix (matrix_to_iarray A) = A
[PROOF STEP]
unfolding matrix_to_iarray_def iarray_to_matrix_def o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. IArray (map (\<lambda>x. vec_to_iarray (A $ mod_type_class.from_nat x)) [0..<CARD('rows)]) !! mod_type_class.to_nat i !! mod_type_class.to_nat j) = A
[PROOF STEP]
by (vector, auto, metis IArray.sub_def vec_to_iarray_nth')


[STATEMENT]
lemma univ_second_countable:
  obtains \<B> :: "'a::second_countable_topology set set"
  where "countable \<B>" "\<And>C. C \<in> \<B> \<Longrightarrow> open C"
       "\<And>S. open S \<Longrightarrow> \<exists>U. U \<subseteq> \<B> \<and> S = \<Union>U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<B>. \<lbrakk>countable \<B>; \<And>C. C \<in> \<B> \<Longrightarrow> open C; \<And>S. open S \<Longrightarrow> \<exists>U\<subseteq>\<B>. S = \<Union> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis ex_countable_basis topological_basis_def)


[STATEMENT]
lemma path_connectedin_euclidean [simp]:
   "path_connectedin euclidean S \<longleftrightarrow> path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin euclidean S = path_connected S
[PROOF STEP]
by (auto simp: path_connectedin_def path_connected_space_iff_path_component path_connected_component)


[STATEMENT]
lemma tlookup_none:
     "sortedTree h t & (tlookup h k t = None) --> (\<forall>x\<in>setOf t. h x ~= k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sortedTree h t \<and> tlookup h k t = None \<longrightarrow> (\<forall>x\<in>setOf t. h x \<noteq> k)
[PROOF STEP]
by (induct t, auto)


[STATEMENT]
lemma sup_distr: "(x \<squnion> y) \<cdot> z = (x \<cdot> z) \<squnion> (y \<cdot> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> y) \<cdot> z = x \<cdot> z \<squnion> y \<cdot> z
[PROOF STEP]
by (smt SUP_empty SUP_insert Sup_distr sup_Sup sup_bot.right_neutral)


[STATEMENT]
lemma mult_imp_less_div_pos: "0 < y \<Longrightarrow> z * y < x \<Longrightarrow> z < x / y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) < y; z * y < x\<rbrakk> \<Longrightarrow> z < x / y
[PROOF STEP]
by(simp add:field_simps)


[STATEMENT]
lemma homeomorphic_space_refl: "X homeomorphic_space X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X homeomorphic_space X
[PROOF STEP]
by (meson homeomorphic_maps_id homeomorphic_space_def)


[STATEMENT]
lemma dim_col_transfer_rule:
  "HMA_M A (A' :: 'a ^ 'nc ^ 'nr) \<Longrightarrow> (=) (dim_col A) (CARD('nc))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMA_M A A' \<Longrightarrow> dim_col A = CARD('nc)
[PROOF STEP]
unfolding HMA_M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = from_hma\<^sub>m A' \<Longrightarrow> dim_col A = CARD('nc)
[PROOF STEP]
by auto


[STATEMENT]
lemma fMin_finsert[simp]: "fMin (finsert x A) = (if A = {||} then x else min x (fMin A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fMin (finsert x A) = (if A = {||} then x else min x (fMin A))
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma lsu_one: "\<nu>\<^sup>\<natural> 1 \<le> (1::'a::unital_quantale)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu>\<^sup>\<natural> (1::'a) \<le> (1::'a)
[PROOF STEP]
unfolding lsu_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<top> \<rightarrow> (1::'a) \<le> (1::'a)
[PROOF STEP]
using bres_canc1 dual_order.trans le_top
[PROOF STATE]
proof (prove)
using this:
?x \<cdot> (?x \<rightarrow> ?y) \<le> ?y
\<lbrakk>?b \<le> ?a; ?c \<le> ?b\<rbrakk> \<Longrightarrow> ?c \<le> ?a
?x \<le> \<top> \<cdot> ?x

goal (1 subgoal):
 1. \<top> \<rightarrow> (1::'a) \<le> (1::'a)
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_subint1: "finite (subint1 G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subint1 G)
[PROOF STEP]
apply (subst subint1_def2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (SIGMA I:{I. is_iface G I}. set (isuperIfs (the (iface G I))))
[PROOF STEP]
apply (rule finite_SigmaI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {I. is_iface G I}
 2. \<And>I. I \<in> {I. is_iface G I} \<Longrightarrow> finite (set (isuperIfs (the (iface G I))))
[PROOF STEP]
apply (rule finite_is_iface)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I. I \<in> {I. is_iface G I} \<Longrightarrow> finite (set (isuperIfs (the (iface G I))))
[PROOF STEP]
apply (simp (no_asm))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem nn_integral_limsup:
  fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> ennreal"
  assumes [measurable]: "\<And>i. u i \<in> borel_measurable M" "w \<in> borel_measurable M"
  assumes bounds: "\<And>i. AE x in M. u i x \<le> w x" and w: "(\<integral>\<^sup>+x. w x \<partial>M) < \<infinity>"
  shows "limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> (\<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
have bnd: "AE x in M. \<forall>i. u i x \<le> w x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. \<forall>i. u i x \<le> w x
[PROOF STEP]
using bounds
[PROOF STATE]
proof (prove)
using this:
AE x in M. u ?i x \<le> w x

goal (1 subgoal):
 1. AE x in M. \<forall>i. u i x \<le> w x
[PROOF STEP]
by (auto simp: AE_all_countable)
[PROOF STATE]
proof (state)
this:
AE x in M. \<forall>i. u i x \<le> w x

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. \<forall>i. u i x \<le> w x
[PROOF STEP]
have "(\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M) \<le> (\<integral>\<^sup>+ x. w x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
AE x in M. \<forall>i. u i x \<le> w x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w
[PROOF STEP]
by (auto intro!: nn_integral_mono_AE elim: eventually_mono intro: SUP_least)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w
[PROOF STEP]
have "(\<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M) = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)
[PROOF STEP]
unfolding limsup_INF_SUP
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF n. SUP n\<in>{n..}. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)
[PROOF STEP]
using bnd w
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. (SUP n. u n x) \<partial>M \<le> integral\<^sup>N M w
AE x in M. \<forall>i. u i x \<le> w x
integral\<^sup>N M w < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (INF n. SUP n\<in>{n..}. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)
[PROOF STEP]
by (intro nn_integral_monotone_convergence_INF_AE')
       (auto intro!: AE_I2 intro: SUP_least SUP_subset_mono)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M = (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
have "\<dots> \<ge> limsup (\<lambda>n. integral\<^sup>N M (u n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)
[PROOF STEP]
by (auto simp: limsup_INF_SUP intro!: INF_mono SUP_least exI nn_integral_mono SUP_upper)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> (INF n. \<integral>\<^sup>+ x. (SUP i\<in>{n..}. u i x) \<partial>M)

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
finally (xtrans)
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M

goal (1 subgoal):
 1. limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. integral\<^sup>N M (u n)) \<le> \<integral>\<^sup>+ x. limsup (\<lambda>n. u n x) \<partial>M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vector_one: "(x::'a ^1) = (\<chi> i. (x$1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = (\<chi>i. x $ 1)
[PROOF STEP]
by (simp add: vec_eq_iff)


[STATEMENT]
lemma higher_differentiable_on_compose':
  "higher_differentiable_on S (\<lambda>x. f (g x)) n"
  if "higher_differentiable_on T f n" "higher_differentiable_on S g n"  "g ` S \<subseteq> T" "open S" "open T"
  for g::"_\<Rightarrow>_::euclidean_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. f (g x)) n
[PROOF STEP]
using higher_differentiable_on_compose[of T f n S g] comp_def that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>higher_differentiable_on T f n; higher_differentiable_on S g n; g ` S \<subseteq> T; open S; open T\<rbrakk> \<Longrightarrow> higher_differentiable_on S (f \<circ> g) n
?f \<circ> ?g = (\<lambda>x. ?f (?g x))
higher_differentiable_on T f n
higher_differentiable_on S g n
g ` S \<subseteq> T
open S
open T

goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. f (g x)) n
[PROOF STEP]
by (metis (no_types, lifting) higher_differentiable_on_cong)


[STATEMENT]
lemma floor_less_numeral [simp]: "\<lfloor>x\<rfloor> < numeral v \<longleftrightarrow> x < numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> < numeral v) = (x < numeral v)
[PROOF STEP]
by (simp add: floor_less_iff)


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural 0 = 0
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma OT_14_P1_sec: "OT_14.adv_P1 (R1_12_0T n) n m1 m2 D \<le> 3 * (adv_OT12 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OT_14.adv_P1 (R1_12_0T n) n m1 m2 D \<le> 3 * adv_OT12 n
[PROOF STEP]
unfolding OT_14.adv_P1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>spmf (R1_14 (R1_12_0T n) n m1 m2 \<bind> D) True - spmf (funct_OT_14 m1 m2 \<bind> (\<lambda>(o1, o2). S1_14 n m1 o1 \<bind> D)) True\<bar> \<le> 3 * adv_OT12 n
[PROOF STEP]
using reduction_P1 surj_pair
[PROOF STATE]
proof (prove)
using this:
\<bar>spmf (R1_14 ?R1_12_0T ?n ?M (?c0.0, ?c1.0) \<bind> ?D) True - spmf (funct_OT_14 ?M (?c0.0, ?c1.0) \<bind> (\<lambda>(out1, out2). S1_14 ?n ?M out1 \<bind> ?D)) True\<bar> \<le> 3 * adv_OT12 ?n
\<exists>x y. ?p = (x, y)

goal (1 subgoal):
 1. \<bar>spmf (R1_14 (R1_12_0T n) n m1 m2 \<bind> D) True - spmf (funct_OT_14 m1 m2 \<bind> (\<lambda>(o1, o2). S1_14 n m1 o1 \<bind> D)) True\<bar> \<le> 3 * adv_OT12 n
[PROOF STEP]
by metis


[STATEMENT]
lemma dom_S':
 "dom (\<lambda>n. if n : free_tv A Un free_tv t then S n else TVar n) \<subseteq>
  free_tv A Un free_tv t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Type.dom (\<lambda>n. if n \<in> free_tv A \<union> free_tv t then S n else TVar n) \<subseteq> free_tv A \<union> free_tv t
[PROOF STEP]
apply (unfold free_tv_subst dom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. (if n \<in> free_tv A \<union> free_tv t then S n else TVar n) \<noteq> TVar n} \<subseteq> free_tv A \<union> free_tv t
[PROOF STEP]
apply (simp (no_asm))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. (n \<in> free_tv A \<longrightarrow> S n \<noteq> TVar n) \<and> (n \<in> free_tv t \<longrightarrow> S n \<noteq> TVar n) \<and> (n \<in> free_tv A \<or> n \<in> free_tv t)} \<subseteq> free_tv A \<union> free_tv t
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mset_ecl_and_mset_lit:
  assumes "L \<in> (cl_ecl C)"
  assumes "finite (cl_ecl C)"
  shows "(mset_lit (subst_lit L \<sigma>)) \<in># (mset_ecl (C,\<sigma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
from assms(1) assms(2)
[PROOF STATE]
proof (chain)
picking this:
L \<in> cl_ecl C
finite (cl_ecl C)
[PROOF STEP]
have "L \<in># (mset_set (cl_ecl C))"
[PROOF STATE]
proof (prove)
using this:
L \<in> cl_ecl C
finite (cl_ecl C)

goal (1 subgoal):
 1. L \<in># mset_set (cl_ecl C)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
L \<in># mset_set (cl_ecl C)

goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
L \<in># mset_set (cl_ecl C)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
L \<in># mset_set (cl_ecl C)

goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. L \<in># mset_set (cl_ecl C) \<Longrightarrow> mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
have f1: "mset_set (cl_ecl C) - {#L#} + {#L#} = mset_set (cl_ecl C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set (cl_ecl C) - {#L#} + {#L#} = mset_set (cl_ecl C)
[PROOF STEP]
by (meson \<open>L \<in># mset_set (cl_ecl C)\<close> insert_DiffM2)
[PROOF STATE]
proof (state)
this:
mset_set (cl_ecl C) - {#L#} + {#L#} = mset_set (cl_ecl C)

goal (1 subgoal):
 1. L \<in># mset_set (cl_ecl C) \<Longrightarrow> mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
have "count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1

goal (1 subgoal):
 1. L \<in># mset_set (cl_ecl C) \<Longrightarrow> mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
count {#mset_lit (subst_lit L \<sigma>)#} (mset_lit (subst_lit L \<sigma>)) = 1

goal (1 subgoal):
 1. mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)
[PROOF STEP]
by (metis (no_types, lifting) f1 image_mset_add_mset insert_iff mset_ecl.simps set_mset_add_mset_insert union_mset_add_mset_right)
[PROOF STATE]
proof (state)
this:
mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mset_lit (subst_lit L \<sigma>) \<in># mset_ecl (C, \<sigma>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_divisor_exists_strong:
  fixes m :: int
  assumes "m > 1" "\<not>prime m"
  shows   "\<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
\<not> prime m
[PROOF STEP]
obtain n k where nk: "n * k > 1" "n \<ge> 0" "m = n * k" "n \<noteq> 1" "n \<noteq> 0" "k \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m

goal (1 subgoal):
 1. (\<And>n k. \<lbrakk>1 < n * k; 0 \<le> n; m = n * k; n \<noteq> 1; n \<noteq> 0; k \<noteq> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> prime m
1 < m
\<not> prime m

goal (1 subgoal):
 1. (\<And>n k. \<lbrakk>1 < n * k; 0 \<le> n; m = n * k; n \<noteq> 1; n \<noteq> 0; k \<noteq> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding prime_int_iff dvd_def
[PROOF STATE]
proof (prove)
using this:
1 < m
\<not> (1 < m \<and> (\<forall>ma. 0 \<le> ma \<and> (\<exists>k. m = ma * k) \<longrightarrow> ma = 1 \<or> ma = m))
1 < m
\<not> (1 < m \<and> (\<forall>ma. 0 \<le> ma \<and> (\<exists>k. m = ma * k) \<longrightarrow> ma = 1 \<or> ma = m))

goal (1 subgoal):
 1. (\<And>n k. \<lbrakk>1 < n * k; 0 \<le> n; m = n * k; n \<noteq> 1; n \<noteq> 0; k \<noteq> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from nk
[PROOF STATE]
proof (chain)
picking this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
[PROOF STEP]
have "n > 1"
[PROOF STATE]
proof (prove)
using this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1

goal (1 subgoal):
 1. 1 < n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
1 < n

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from nk assms
[PROOF STATE]
proof (chain)
picking this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
1 < m
\<not> prime m
[PROOF STEP]
have "n * k > 0"
[PROOF STATE]
proof (prove)
using this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
1 < m
\<not> prime m

goal (1 subgoal):
 1. 0 < n * k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < n * k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with \<open>n \<ge> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> n
0 < n * k
[PROOF STEP]
have "k > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> n
0 < n * k

goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
using zero_less_mult_pos
[PROOF STATE]
proof (prove)
using this:
0 \<le> n
0 < n * k
\<lbrakk>(0::?'a) < ?a * ?b; (0::?'a) < ?a\<rbrakk> \<Longrightarrow> (0::?'a) < ?b

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

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with \<open>k \<noteq> 1\<close>
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 1
0 < k
[PROOF STEP]
have "k > 1"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 1
0 < k

goal (1 subgoal):
 1. 1 < k
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
1 < k

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from nk
[PROOF STATE]
proof (chain)
picking this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
[PROOF STEP]
have "n > 1"
[PROOF STATE]
proof (prove)
using this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1

goal (1 subgoal):
 1. 1 < n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
1 < n

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
from \<open>k > 1\<close> nk
[PROOF STATE]
proof (chain)
picking this:
1 < k
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
[PROOF STEP]
have "n < m" "k < m"
[PROOF STATE]
proof (prove)
using this:
1 < k
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1

goal (1 subgoal):
 1. n < m &&& k < m
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
with nk \<open>k > 1\<close> \<open>n > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
1 < k
1 < n
n < m
k < m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < n * k
0 \<le> n
m = n * k
n \<noteq> 1
n \<noteq> 0
k \<noteq> 1
1 < k
1 < n
n < m
k < m

goal (1 subgoal):
 1. \<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n k. m = n * k \<and> 1 < n \<and> n < m \<and> 1 < k \<and> k < m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comm_monoid_add_ow[simp]:
  "comm_monoid_add_ow UNIV (+) (0::'a::comm_monoid_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_monoid_add_ow UNIV (+) (0::'a)
[PROOF STEP]
by
    (
      auto simp:
        comm_monoid_add_ow_Ball_def
        ab_semigroup_add_ow_Ball_def
        semigroup_add_ow_Ball_def
        ac_simps
    )


[STATEMENT]
lemma east_west_on_equator:
  shows "proj2_incident east equator" and "proj2_incident west equator"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident east equator &&& proj2_incident west equator
[PROOF STEP]
unfolding east_def and west_def and equator_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident (proj2_abs (vector [1, 0, 1])) (proj2_line_abs (vector [0, 1, 0])) &&& proj2_incident (proj2_abs (vector [- 1, 0, 1])) (proj2_line_abs (vector [0, 1, 0]))
[PROOF STEP]
using compass_non_zero
[PROOF STATE]
proof (prove)
using this:
vector [1, 0, 1] \<noteq> 0
vector [- 1, 0, 1] \<noteq> 0
vector [0, 1, 1] \<noteq> 0
vector [0, - 1, 1] \<noteq> 0
vector [0, 1, 0] \<noteq> 0
vector [1, 0, 0] \<noteq> 0

goal (1 subgoal):
 1. proj2_incident (proj2_abs (vector [1, 0, 1])) (proj2_line_abs (vector [0, 1, 0])) &&& proj2_incident (proj2_abs (vector [- 1, 0, 1])) (proj2_line_abs (vector [0, 1, 0]))
[PROOF STEP]
by (simp_all add: proj2_incident_abs inner_vec_def vector_def sum_3)


[STATEMENT]
lemma case_sum_rule:
  "\<lbrakk> \<And>x. v=Inl x \<Longrightarrow> <P> fl x <Q>;
     \<And>x. v=Inr x \<Longrightarrow> <P> fr x <Q> \<rbrakk>
  \<Longrightarrow> <P> case_sum fl fr v <Q>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. v = Inl x \<Longrightarrow> <P> fl x <Q>; \<And>x. v = Inr x \<Longrightarrow> <P> fr x <Q>\<rbrakk> \<Longrightarrow> <P> case v of Inl x \<Rightarrow> fl x | Inr x \<Rightarrow> fr x <Q>
[PROOF STEP]
by (auto split: sum.split)


[STATEMENT]
lemma vimage_eq_imp_vcomp:
  assumes "r `\<^sub>\<circ> A = s `\<^sub>\<circ> B"
  shows "(t \<circ>\<^sub>\<circ> r) `\<^sub>\<circ> A = (t \<circ>\<^sub>\<circ> s) `\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<circ>\<^sub>\<circ> r) `\<^sub>\<circ> A = (t \<circ>\<^sub>\<circ> s) `\<^sub>\<circ> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r `\<^sub>\<circ> A = s `\<^sub>\<circ> B

goal (1 subgoal):
 1. (t \<circ>\<^sub>\<circ> r) `\<^sub>\<circ> A = (t \<circ>\<^sub>\<circ> s) `\<^sub>\<circ> B
[PROOF STEP]
by (metis vcomp_vimage)


[STATEMENT]
lemma emeasure_cond_pmf:
  fixes p A
  defines "q \<equiv> cond_pmf p A"
  assumes "set_pmf p \<inter> A \<noteq> {}"
  shows "emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
note [transfer_rule] = cond_pmf.transfer[OF assms(2), folded q_def]
[PROOF STATE]
proof (state)
this:
pmf_as_measure.cr_pmf (uniform_measure (measure_pmf p) A) q

goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
interpret pmf_as_measure
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
[PROOF STEP]
by transfer simp
[PROOF STATE]
proof (state)
this:
emeasure (measure_pmf q) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nn_integral_measurable_subprob_algebra2:
  assumes f[measurable]: "(\<lambda>(x, y). f x y) \<in> borel_measurable (M \<Otimes>\<^sub>M N)"
  assumes N[measurable]: "L \<in> measurable M (subprob_algebra N)"
  shows "(\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
note nn_integral_measurable_subprob_algebra[measurable]
[PROOF STATE]
proof (state)
this:
?f \<in> borel_measurable ?N \<Longrightarrow> (\<lambda>M. integral\<^sup>N M ?f) \<in> borel_measurable (subprob_algebra ?N)

goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
note measurable_distr2[measurable]
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<lambda>(x, y). ?f x y) \<in> ?L \<Otimes>\<^sub>M ?M \<rightarrow>\<^sub>M ?N; ?g \<in> ?L \<rightarrow>\<^sub>M subprob_algebra ?M\<rbrakk> \<Longrightarrow> (\<lambda>x. distr (?g x) ?N (?f x)) \<in> ?L \<rightarrow>\<^sub>M subprob_algebra ?N

goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
have "(\<lambda>x. integral\<^sup>N (distr (L x) (M \<Otimes>\<^sub>M N) (\<lambda>y. (x, y))) (\<lambda>(x, y). f x y)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<integral>\<^sup>+ (x, y). f x y \<partial>distr (L x) (M \<Otimes>\<^sub>M N) (Pair x)) \<in> borel_measurable M
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<integral>\<^sup>+ (x, y). f x y \<partial>distr (L x) (M \<Otimes>\<^sub>M N) (Pair x)) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. \<integral>\<^sup>+ (x, y). f x y \<partial>distr (L x) (M \<Otimes>\<^sub>M N) (Pair x)) \<in> borel_measurable M
[PROOF STEP]
show "(\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<integral>\<^sup>+ (x, y). f x y \<partial>distr (L x) (M \<Otimes>\<^sub>M N) (Pair x)) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M
[PROOF STEP]
by (rule measurable_cong[THEN iffD1, rotated])
       (simp add: nn_integral_distr)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. integral\<^sup>N (L x) (f x)) \<in> borel_measurable M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wn_triangle3:
  assumes z: "z \<in> interior(convex hull {a,b,c})"
      and "0 < Im((b-a) * cnj (b-z))"
          "0 < Im((c-b) * cnj (c-z))"
          "0 < Im((a-c) * cnj (a-z))"
    shows "winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
have znot[simp]: "z \<notin> closed_segment a b" "z \<notin> closed_segment b c" "z \<notin> closed_segment c a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> closed_segment a b &&& z \<notin> closed_segment b c &&& z \<notin> closed_segment c a
[PROOF STEP]
using z interior_of_triangle [of a b c]
[PROOF STATE]
proof (prove)
using this:
z \<in> interior (convex hull {a, b, c})
DIM(complex) = 2 \<Longrightarrow> interior (convex hull {a, b, c}) = convex hull {a, b, c} - (closed_segment a b \<union> closed_segment b c \<union> closed_segment c a)

goal (1 subgoal):
 1. z \<notin> closed_segment a b &&& z \<notin> closed_segment b c &&& z \<notin> closed_segment c a
[PROOF STEP]
by (auto simp: closed_segment_def)
[PROOF STATE]
proof (state)
this:
z \<notin> closed_segment a b
z \<notin> closed_segment b c
z \<notin> closed_segment c a

goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
have gt0: "0 < Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<in> interior (convex hull {a, b, c})
0 < Im ((b - a) * cnj (b - z))
0 < Im ((c - b) * cnj (c - z))
0 < Im ((a - c) * cnj (a - z))

goal (1 subgoal):
 1. 0 < Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z)
[PROOF STEP]
by (simp add: winding_number_linepath_pos_lt path_image_join winding_number_join_pos_combined)
[PROOF STATE]
proof (state)
this:
0 < Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z)

goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
have lt2: "Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2
[PROOF STEP]
using winding_number_lt_half_linepath [of _ a b]
[PROOF STATE]
proof (prove)
using this:
?z \<notin> closed_segment a b \<Longrightarrow> \<bar>Re (winding_number (linepath a b) ?z)\<bar> < 1 / 2

goal (1 subgoal):
 1. Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2
[PROOF STEP]
using winding_number_lt_half_linepath [of _ b c]
[PROOF STATE]
proof (prove)
using this:
?z \<notin> closed_segment a b \<Longrightarrow> \<bar>Re (winding_number (linepath a b) ?z)\<bar> < 1 / 2
?z \<notin> closed_segment b c \<Longrightarrow> \<bar>Re (winding_number (linepath b c) ?z)\<bar> < 1 / 2

goal (1 subgoal):
 1. Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2
[PROOF STEP]
using winding_number_lt_half_linepath [of _ c a] znot
[PROOF STATE]
proof (prove)
using this:
?z \<notin> closed_segment a b \<Longrightarrow> \<bar>Re (winding_number (linepath a b) ?z)\<bar> < 1 / 2
?z \<notin> closed_segment b c \<Longrightarrow> \<bar>Re (winding_number (linepath b c) ?z)\<bar> < 1 / 2
?z \<notin> closed_segment c a \<Longrightarrow> \<bar>Re (winding_number (linepath c a) ?z)\<bar> < 1 / 2
z \<notin> closed_segment a b
z \<notin> closed_segment b c
z \<notin> closed_segment c a

goal (1 subgoal):
 1. Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2
[PROOF STEP]
by (fastforce simp add: winding_number_join path_image_join)
[PROOF STATE]
proof (state)
this:
Re (winding_number (linepath a b +++ linepath b c +++ linepath c a) z) < 2

goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1
[PROOF STEP]
by (rule winding_number_eq_1) (simp_all add: path_image_join gt0 lt2)
[PROOF STATE]
proof (state)
this:
winding_number (linepath a b +++ linepath b c +++ linepath c a) z = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma union_le_diff_plus: "P \<subseteq># M \<Longrightarrow> N < P \<Longrightarrow> M - P + N < M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<subseteq># M; N < P\<rbrakk> \<Longrightarrow> M - P + N < M
[PROOF STEP]
by (drule subset_mset.diff_add[symmetric]) (metis union_le_mono2)


[STATEMENT]
lemma pmf_prob_code_alt_finite:
  "finite A \<Longrightarrow> pmf_prob p A = (\<Sum>x\<in>A. pmf p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> pmf_prob p A = sum (pmf p) A
[PROOF STEP]
by (simp add: pmf_prob_pmf_set_integral pmf_set_integral_code_alt_finite)


[STATEMENT]
lemma (in complete_boolean_algebra) meet_shunt: "x \<sqinter> y = \<bottom> \<longleftrightarrow> x \<le> -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqinter> y = \<bottom>) = (x \<le> - y)
[PROOF STEP]
by (metis bot_least inf_absorb2 inf_compl_bot_left2 shunt1 sup_absorb1)


[STATEMENT]
lemma "\<And>a r x y. dist x a + dist a y = r \<Longrightarrow> \<forall>z. r \<le> dist x z + dist z y \<Longrightarrow> dist x y = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a r x y. \<lbrakk>dist x a + dist a y = r; \<forall>z. r \<le> dist x z + dist z y\<rbrakk> \<Longrightarrow> dist x y = r
[PROOF STEP]
by metric_eisbach


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


[STATEMENT]
lemma UNION_subsetD: "\<lbrakk> (\<Union>x\<in>A. f x) \<subseteq> B; a \<in> A \<rbrakk> \<Longrightarrow> f a \<subseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Union> (f ` A) \<subseteq> B; a \<in> A\<rbrakk> \<Longrightarrow> f a \<subseteq> B
[PROOF STEP]
by blast


[STATEMENT]
lemma diamond_associative:
  "|x * y>z = |x>(y * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. | x * y > z = | x > (y * z)
[PROOF STEP]
by (simp add: ndiamond_def mult_assoc)


[STATEMENT]
lemma p_star_elim: "x \<in> p_star X \<longleftrightarrow> (\<exists>n. x \<in> path_dioid.power X n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> p_star X) = (\<exists>n. x \<in> path_dioid.power X n)
[PROOF STEP]
by (simp add: p_star_def)


[STATEMENT]
lemma graph_lm_4: "graph (f o g) = (graph g) O (graph f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph (f \<circ> g) = graph g O graph f
[PROOF STEP]
by (unfold graph_def, auto)


[STATEMENT]
lemma split_zip_all[no_atp]: "(\<forall> x. P x) \<longleftrightarrow> (\<forall> y z. length y = length z \<longrightarrow> P (y || z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x) = (\<forall>y z. length y = length z \<longrightarrow> P (y || z))
[PROOF STEP]
by (fastforce iff: split_zip)


[STATEMENT]
lemma [rel2p]: "rel2p (\<langle>A\<rangle>set_rel) = rel_set (rel2p A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel2p (\<langle>A\<rangle>set_rel) = rel_set (rel2p A)
[PROOF STEP]
unfolding set_rel_def rel_set_def rel2p_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. (x, y) \<in> {(Aa, B). (\<forall>x\<in>Aa. \<exists>y\<in>B. (x, y) \<in> A) \<and> (\<forall>y\<in>B. \<exists>x\<in>Aa. (x, y) \<in> A)}) = (\<lambda>Aa B. (\<forall>x\<in>Aa. \<exists>y\<in>B. (x, y) \<in> A) \<and> (\<forall>y\<in>B. \<exists>x\<in>Aa. (x, y) \<in> A))
[PROOF STEP]
by blast


[STATEMENT]
lemma smcf_const_is_semifunctor'[smc_cs_intros]:
  assumes "semicategory \<alpha> \<CC>"
    and "semicategory \<alpha> \
"
    and "f : a \<mapsto>\<^bsub>\
\<^esub> a"
    and "f \<circ>\<^sub>A\<^bsub>\
\<^esub> f = f"
    and "\<AA> = \<CC>"
    and "\<BB> = \
"
  shows "smcf_const \<CC> \
 a f : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dghm_const \<CC> \
 a f : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
using assms(1-4)
[PROOF STATE]
proof (prove)
using this:
semicategory \<alpha> \<CC>
semicategory \<alpha> \

f : a \<mapsto>\<^bsub>\
\<^esub> a
f \<circ>\<^sub>A\<^bsub>\
\<^esub> f = f

goal (1 subgoal):
 1. dghm_const \<CC> \
 a f : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
unfolding assms(5,6)
[PROOF STATE]
proof (prove)
using this:
semicategory \<alpha> \<CC>
semicategory \<alpha> \

f : a \<mapsto>\<^bsub>\
\<^esub> a
f \<circ>\<^sub>A\<^bsub>\
\<^esub> f = f

goal (1 subgoal):
 1. dghm_const \<CC> \
 a f : \<CC> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \

[PROOF STEP]
by (rule smcf_const_is_semifunctor)


[STATEMENT]
lemma divisor_set_1 [simp]: "divisor_set (Suc 0) = {Suc 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_set (Suc 0) = {Suc 0}
[PROOF STEP]
by (simp add: divisor_set divisor_def cong: conj_cong)


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural 0 = 0
[PROOF STEP]
by transfer simp