[STATEMENT]
lemma mult [simp]: "\<chi> (a * b) = \<chi> a * \<chi> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
proof (cases "coprime a n \<and> coprime b n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. coprime a n \<and> coprime b n \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
 2. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
coprime a n \<and> coprime b n

goal (2 subgoals):
 1. coprime a n \<and> coprime b n \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
 2. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
hence "a mod n \<in> totatives n" "b mod n \<in> totatives n"
[PROOF STATE]
proof (prove)
using this:
coprime a n \<and> coprime b n

goal (1 subgoal):
 1. a mod n \<in> totatives n &&& b mod n \<in> totatives n
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
coprime a n \<and> coprime b n
1 < n

goal (1 subgoal):
 1. a mod n \<in> totatives n &&& b mod n \<in> totatives n
[PROOF STEP]
by (auto simp: totatives_def mod_greater_zero_iff_not_dvd coprime_absorb_right)
[PROOF STATE]
proof (state)
this:
a mod n \<in> totatives n
b mod n \<in> totatives n

goal (2 subgoals):
 1. coprime a n \<and> coprime b n \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
 2. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
hence "\<chi> ((a mod n) * (b mod n)) = \<chi> (a mod n) * \<chi> (b mod n)"
[PROOF STATE]
proof (prove)
using this:
a mod n \<in> totatives n
b mod n \<in> totatives n

goal (1 subgoal):
 1. \<chi> (a mod n * (b mod n)) = \<chi> (a mod n) * \<chi> (b mod n)
[PROOF STEP]
by (rule mult_aux)
[PROOF STATE]
proof (state)
this:
\<chi> (a mod n * (b mod n)) = \<chi> (a mod n) * \<chi> (b mod n)

goal (2 subgoals):
 1. coprime a n \<and> coprime b n \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
 2. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<chi> (a mod n * (b mod n)) = \<chi> (a mod n) * \<chi> (b mod n)

goal (2 subgoals):
 1. coprime a n \<and> coprime b n \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
 2. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
have "\<chi> ((a mod n) * (b mod n)) = \<chi> (a * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<chi> (a mod n * (b mod n)) = \<chi> (a * b)
[PROOF STEP]
by (rule cong) (auto simp: cong_def mod_mult_eq)
[PROOF STATE]
proof (state)
this:
\<chi> (a mod n * (b mod n)) = \<chi> (a * b)

goal (2 subgoals):
 1. coprime a n \<and> coprime b n \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
 2. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<chi> (a * b) = \<chi> (a mod n) * \<chi> (b mod n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<chi> (a * b) = \<chi> (a mod n) * \<chi> (b mod n)

goal (1 subgoal):
 1. \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<chi> (a * b) = \<chi> a * \<chi> b

goal (1 subgoal):
 1. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (coprime a n \<and> coprime b n)

goal (1 subgoal):
 1. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
hence "\<not>coprime (a * b) n"
[PROOF STATE]
proof (prove)
using this:
\<not> (coprime a n \<and> coprime b n)

goal (1 subgoal):
 1. \<not> coprime (a * b) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> coprime (a * b) n

goal (1 subgoal):
 1. \<not> (coprime a n \<and> coprime b n) \<Longrightarrow> \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> (coprime a n \<and> coprime b n)
\<not> coprime (a * b) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (coprime a n \<and> coprime b n)
\<not> coprime (a * b) n

goal (1 subgoal):
 1. \<chi> (a * b) = \<chi> a * \<chi> b
[PROOF STEP]
by (auto simp: eq_zero)
[PROOF STATE]
proof (state)
this:
\<chi> (a * b) = \<chi> a * \<chi> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_substEnv_compose1:
assumes "wlsEnv rho" and "wls (asSort ys) Y1" and "wls (asSort ys) Y2"
shows "((rho &[Y1 / y]_ys) &[Y2 / y]_ys) = (rho &[(Y1 #[Y2 / y]_ys) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rho &[Y1 / y]_ys &[Y2 / y]_ys = rho &[Y1 #[Y2 / y]_ys / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho
wls (asSort ys) Y1
wls (asSort ys) Y2

goal (1 subgoal):
 1. rho &[Y1 / y]_ys &[Y2 / y]_ys = rho &[Y1 #[Y2 / y]_ys / y]_ys
[PROOF STEP]
by(simp add: substEnv_compose1)


[STATEMENT]
lemma (in semicategory) op_smc_Comp[smc_op_simps]:
  assumes "f : b \<mapsto>\<^bsub>\<CC>\<^esub> c" and "g : a \<mapsto>\<^bsub>\<CC>\<^esub> b"
  shows "g \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> f = f \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> f = f \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f : b \<mapsto>\<^bsub>\<CC>\<^esub> c
g : a \<mapsto>\<^bsub>\<CC>\<^esub> b

goal (1 subgoal):
 1. g \<circ>\<^sub>A\<^bsub>op_smc \<CC>\<^esub> f = f \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> g
[PROOF STEP]
unfolding op_smc_components
[PROOF STATE]
proof (prove)
using this:
f : b \<mapsto>\<^bsub>\<CC>\<^esub> c
g : a \<mapsto>\<^bsub>\<CC>\<^esub> b

goal (1 subgoal):
 1. fflip (\<CC>\<lparr>Comp\<rparr>) \<lparr>g, f\<rparr>\<^sub>\<bullet> = f \<circ>\<^sub>A\<^bsub>\<CC>\<^esub> g
[PROOF STEP]
by (auto intro!: fflip_app smc_cs_intros)


[STATEMENT]
lemma less_Suc [simp] : "n \<le> k \<Longrightarrow> (k < Suc n) = (k = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> k \<Longrightarrow> (k < Suc n) = (k = n)
[PROOF STEP]
by arith


[STATEMENT]
lemma U\<^sub>b_conv:
  "\<exists>!v. U\<^sub>b (Suc m) v = v"
  "(\<lambda>n. (U\<^sub>b (Suc m) ^^ n) v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!v. U\<^sub>b (Suc m) v = v &&& (\<lambda>n. (U\<^sub>b (Suc m) ^^ n) v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>!v. U\<^sub>b (Suc m) v = v
 2. (\<lambda>n. (U\<^sub>b (Suc m) ^^ n) v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)
[PROOF STEP]
have *: "is_contraction (U\<^sub>b (Suc m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_contraction (U\<^sub>b (Suc m))
[PROOF STEP]
unfolding is_contraction_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (U\<^sub>b (Suc m) v) (U\<^sub>b (Suc m) u) \<le> l * dist v u)
[PROOF STEP]
using U\<^sub>b_contraction[of "Suc m"] le_neq_trans[OF zero_le_disc]
[PROOF STATE]
proof (prove)
using this:
dist (U\<^sub>b (Suc m) ?v) (U\<^sub>b (Suc m) ?u) \<le> l ^ Suc m * dist ?v ?u
0 \<noteq> l \<Longrightarrow> 0 < l

goal (1 subgoal):
 1. \<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (U\<^sub>b (Suc m) v) (U\<^sub>b (Suc m) u) \<le> l * dist v u)
[PROOF STEP]
by (cases "l = 0")
      (auto intro!: power_Suc_less_one intro: exI[of _ "l^(Suc m)"])
[PROOF STATE]
proof (state)
this:
is_contraction (U\<^sub>b (Suc m))

goal (2 subgoals):
 1. \<exists>!v. U\<^sub>b (Suc m) v = v
 2. (\<lambda>n. (U\<^sub>b (Suc m) ^^ n) v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)
[PROOF STEP]
show "\<exists>!v. U\<^sub>b (Suc m) v = v" "(\<lambda>n. (U\<^sub>b (Suc m) ^^ n) v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!v. U\<^sub>b (Suc m) v = v &&& (\<lambda>n. (U\<^sub>b (Suc m) ^^ n) v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)
[PROOF STEP]
using banach'[OF *]
[PROOF STATE]
proof (prove)
using this:
\<exists>!v. U\<^sub>b (Suc m) v = v
(\<lambda>n. (U\<^sub>b (Suc m) ^^ n) ?v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)

goal (1 subgoal):
 1. \<exists>!v. U\<^sub>b (Suc m) v = v &&& (\<lambda>n. (U\<^sub>b (Suc m) ^^ n) v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>!v. U\<^sub>b (Suc m) v = v
(\<lambda>n. (U\<^sub>b (Suc m) ^^ n) v) \<longlonglongrightarrow> (THE v. U\<^sub>b (Suc m) v = v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma intersect_mult_set_block_subset_iff_2:
  assumes "blv \<in># \<B>" and  "p \<subseteq> blv" and "\<Lambda> \<ge> 2" and "card p = 2"
  shows "p \<in># \<Sum>\<^sub>#{# mset_set {y .y \<subseteq> blv \<inter> b2 \<and> card y = 2} .b2 \<in># (\<B> - {#blv#})#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in># (\<Sum>b2\<in>#remove1_mset blv \<B>. mset_set {y. y \<subseteq> blv \<inter> b2 \<and> card y = 2})
[PROOF STEP]
by (auto simp add: intersect_mult_set_block_with_point_exists assms)


[STATEMENT]
lemma perp_right_comm:
  assumes "A B Perp C D"
  shows "A B Perp D C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B Perp D C
[PROOF STEP]
by (meson Perp_def assms l8_12 perp_left_comm)


[STATEMENT]
lemma one_time_pad':
  assumes inj_on: "inj_on f ({..<q} - {0})"
    and sur: "f ` ({..<q} - {0}) = ({..<q} - {0})"
  shows "map_spmf f (sample_uniform_units q) = (sample_uniform_units q)"
(is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
have rhs: "?rhs = spmf_of_set (({..<q} - {0}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sample_uniform_units q = spmf_of_set ({..<q} - {0})
[PROOF STEP]
by(auto simp add: sample_uniform_units_def)
[PROOF STATE]
proof (state)
this:
sample_uniform_units q = spmf_of_set ({..<q} - {0})

goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sample_uniform_units q = spmf_of_set ({..<q} - {0})

goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
have "map_spmf(\<lambda>s. f s) (spmf_of_set ({..<q} - {0})) = spmf_of_set ((\<lambda>s. f s) ` ({..<q} - {0}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf f (spmf_of_set ({..<q} - {0})) = spmf_of_set (f ` ({..<q} - {0}))
[PROOF STEP]
by(simp add: inj_on)
[PROOF STATE]
proof (state)
this:
map_spmf f (spmf_of_set ({..<q} - {0})) = spmf_of_set (f ` ({..<q} - {0}))

goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map_spmf f (spmf_of_set ({..<q} - {0})) = spmf_of_set (f ` ({..<q} - {0}))

goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
have "f ` ({..<q} - {0}) = ({..<q} - {0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` ({..<q} - {0}) = {..<q} - {0}
[PROOF STEP]
apply(rule endo_inj_surj)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite ({..<q} - {0})
 2. f ` ({..<q} - {0}) \<subseteq> {..<q} - {0}
 3. inj_on f ({..<q} - {0})
[PROOF STEP]
by(simp, simp add: sur, simp add: inj_on)
[PROOF STATE]
proof (state)
this:
f ` ({..<q} - {0}) = {..<q} - {0}

goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
map_spmf f (sample_uniform_units q) = spmf_of_set (f ` ({..<q} - {0}))
f ` ({..<q} - {0}) = {..<q} - {0}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
map_spmf f (sample_uniform_units q) = spmf_of_set (f ` ({..<q} - {0}))
f ` ({..<q} - {0}) = {..<q} - {0}

goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
using rhs
[PROOF STATE]
proof (prove)
using this:
map_spmf f (sample_uniform_units q) = spmf_of_set (f ` ({..<q} - {0}))
f ` ({..<q} - {0}) = {..<q} - {0}
sample_uniform_units q = spmf_of_set ({..<q} - {0})

goal (1 subgoal):
 1. map_spmf f (sample_uniform_units q) = sample_uniform_units q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map_spmf f (sample_uniform_units q) = sample_uniform_units q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma square_integrable_diff [simp]:
   "\<lbrakk>f square_integrable S; g square_integrable S\<rbrakk> \<Longrightarrow> (\<lambda>x. f x - g x) square_integrable S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f square_integrable S; g square_integrable S\<rbrakk> \<Longrightarrow> (\<lambda>x. f x - g x) square_integrable S
[PROOF STEP]
using square_integrable_neg_eq square_integrable_add [of f S "\<lambda>x. - (g x)"]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. - ?f x) square_integrable ?S) = (?f square_integrable ?S)
\<lbrakk>f square_integrable S; (\<lambda>x. - g x) square_integrable S\<rbrakk> \<Longrightarrow> (\<lambda>x. f x + - g x) square_integrable S

goal (1 subgoal):
 1. \<lbrakk>f square_integrable S; g square_integrable S\<rbrakk> \<Longrightarrow> (\<lambda>x. f x - g x) square_integrable S
[PROOF STEP]
by auto


[STATEMENT]
lemma accepts_rexp2nae:
 "\<And>w. accepts (rexp2nae r) w = (w : lang r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. NAe.accepts (rexp2nae r) w = (w \<in> lang r)
[PROOF STEP]
apply (induct "r")
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>w. NAe.accepts (rexp2nae Zero) w = (w \<in> lang Zero)
 2. \<And>w. NAe.accepts (rexp2nae One) w = (w \<in> lang One)
 3. \<And>x w. NAe.accepts (rexp2nae (Atom x)) w = (w \<in> lang (Atom x))
 4. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Plus r1 r2)) w = (w \<in> lang (Plus r1 r2))
 5. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Times r1 r2)) w = (w \<in> lang (Times r1 r2))
 6. \<And>r w. (\<And>w. NAe.accepts (rexp2nae r) w = (w \<in> lang r)) \<Longrightarrow> NAe.accepts (rexp2nae (Star r)) w = (w \<in> lang (Star r))
[PROOF STEP]
apply (simp add: accepts_def)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>w. NAe.accepts (rexp2nae One) w = (w \<in> lang One)
 2. \<And>x w. NAe.accepts (rexp2nae (Atom x)) w = (w \<in> lang (Atom x))
 3. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Plus r1 r2)) w = (w \<in> lang (Plus r1 r2))
 4. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Times r1 r2)) w = (w \<in> lang (Times r1 r2))
 5. \<And>r w. (\<And>w. NAe.accepts (rexp2nae r) w = (w \<in> lang r)) \<Longrightarrow> NAe.accepts (rexp2nae (Star r)) w = (w \<in> lang (Star r))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x w. NAe.accepts (rexp2nae (Atom x)) w = (w \<in> lang (Atom x))
 2. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Plus r1 r2)) w = (w \<in> lang (Plus r1 r2))
 3. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Times r1 r2)) w = (w \<in> lang (Times r1 r2))
 4. \<And>r w. (\<And>w. NAe.accepts (rexp2nae r) w = (w \<in> lang r)) \<Longrightarrow> NAe.accepts (rexp2nae (Star r)) w = (w \<in> lang (Star r))
[PROOF STEP]
apply (simp add: accepts_atom)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Plus r1 r2)) w = (w \<in> lang (Plus r1 r2))
 2. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Times r1 r2)) w = (w \<in> lang (Times r1 r2))
 3. \<And>r w. (\<And>w. NAe.accepts (rexp2nae r) w = (w \<in> lang r)) \<Longrightarrow> NAe.accepts (rexp2nae (Star r)) w = (w \<in> lang (Star r))
[PROOF STEP]
apply (simp add: accepts_or)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>r1 r2 w. \<lbrakk>\<And>w. NAe.accepts (rexp2nae r1) w = (w \<in> lang r1); \<And>w. NAe.accepts (rexp2nae r2) w = (w \<in> lang r2)\<rbrakk> \<Longrightarrow> NAe.accepts (rexp2nae (Times r1 r2)) w = (w \<in> lang (Times r1 r2))
 2. \<And>r w. (\<And>w. NAe.accepts (rexp2nae r) w = (w \<in> lang r)) \<Longrightarrow> NAe.accepts (rexp2nae (Star r)) w = (w \<in> lang (Star r))
[PROOF STEP]
apply (simp add: accepts_conc Regular_Set.conc_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r w. (\<And>w. NAe.accepts (rexp2nae r) w = (w \<in> lang r)) \<Longrightarrow> NAe.accepts (rexp2nae (Star r)) w = (w \<in> lang (Star r))
[PROOF STEP]
apply (simp add: accepts_star in_star_iff_concat subset_iff Ball_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma partial_insertion_monom: "partial_insertion \<alpha> x (MPoly_Type.monom m a) = Polynomial.monom (insertion \<alpha> (MPoly_Type.monom (remove_key x m) a)) (lookup m x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partial_insertion \<alpha> x (MPoly_Type.monom m a) = Polynomial.monom (insertion \<alpha> (MPoly_Type.monom (remove_key x m) a)) (lookup m x)
[PROOF STEP]
unfolding partial_insertion_def mpoly_to_mpoly_poly_monom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly (insertion \<alpha>) (Polynomial.monom (MPoly_Type.monom (remove_key x m) a) (lookup m x)) = Polynomial.monom (insertion \<alpha> (MPoly_Type.monom (remove_key x m) a)) (lookup m x)
[PROOF STEP]
by (subst map_poly_monom, auto)


[STATEMENT]
lemma diff_inv_eq_inv_set:
  "diff_invariant I (\<lambda>t. f) (\<lambda>s. T) S 0 (\<lambda>s. True) = (\<forall>s. I s \<longrightarrow> \<gamma>\<^sup>\<phi> s \<subseteq> {s. I s})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diff_invariant I (\<lambda>t. f) (\<lambda>s. T) S 0 (\<lambda>s. True) = (\<forall>s. I s \<longrightarrow> \<gamma>\<^sup>\<phi> s \<subseteq> {s. I s})
[PROOF STEP]
unfolding diff_inv_eq_inv_set orbit_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s. I s \<longrightarrow> g_orbital (\<lambda>t. f) (\<lambda>s. True) (\<lambda>s. T) S 0 s \<subseteq> Collect I) = (\<forall>s. I s \<longrightarrow> g_orbital (\<lambda>t. f) (\<lambda>s. True) (\<lambda>s. T) S 0 s \<subseteq> {s. I s})
[PROOF STEP]
by auto


[STATEMENT]
lemma F_start:
  shows "F ds (XD_smallest ds X, dual (XH_largest ds X)) = (XD_smallest ds X, dual (XH_largest ds X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F ds (XD_smallest ds X, dual (XH_largest ds X)) = (XD_smallest ds X, dual (XH_largest ds X))
[PROOF STEP]
using %invisible CH_XH_largest[OF \<open>stable_on ds X\<close>] CD_on_XD_smallest[OF \<open>stable_on ds X\<close>] X_subseteq_XH_largest[OF \<open>stable_on ds X\<close>]
[PROOF STATE]
proof (prove)
using this:
CH (XH_largest ds X) = X
CD_on ds (XD_smallest ds X) = X
X \<subseteq> XH_largest ds X

goal (1 subgoal):
 1. F ds (XD_smallest ds X, dual (XH_largest ds X)) = (XD_smallest ds X, dual (XH_largest ds X))
[PROOF STEP]
unfolding F_def F1_def F2_def XD_smallest_def
[PROOF STATE]
proof (prove)
using this:
CH (XH_largest ds X) = X
CD_on ds (- (XH_largest ds X - X)) = X
X \<subseteq> XH_largest ds X

goal (1 subgoal):
 1. (case (- (XH_largest ds X - X), dual (XH_largest ds X)) of (XD, XH) \<Rightarrow> (- Rf CH (undual XH), dual (- Rf (CD_on ds) (- Rf CH (undual XH))))) = (- (XH_largest ds X - X), dual (XH_largest ds X))
[PROOF STEP]
by (auto simp add: dual_eq_iff)


[STATEMENT]
lemma ex2_lemma [simp]:
  "rec_eval (rec_ex2 f) [x, y1, y2] = (if (\<exists>z \<le> x. 0 < rec_eval f [z, y1, y2]) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_ex2 f) [x, y1, y2] = (if \<exists>z\<le>x. 0 < rec_eval f [z, y1, y2] then 1 else 0)
[PROOF STEP]
by (simp add: rec_ex2_def)


[STATEMENT]
lemma L1_indicator':
  assumes [measurable]: "A \<in> sets M"
      and "emeasure M A \<noteq> \<infinity>"
  shows "indicator A \<in> space\<^sub>N (\<LL> 1 M)"
        "Norm (\<LL> 1 M) (indicator A) = measure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicat_real A \<in> space\<^sub>N (\<LL> 1 M) &&& Norm (\<LL> 1 M) (indicat_real A) = Sigma_Algebra.measure M A
[PROOF STEP]
unfolding space\<^sub>N_def Norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicat_real A \<in> {f. eNorm (\<LL> 1 M) f < \<infinity>} &&& enn2real (eNorm (\<LL> 1 M) (indicat_real A)) = Sigma_Algebra.measure M A
[PROOF STEP]
using L1_indicator[OF \<open>A \<in> sets M\<close>] \<open>emeasure M A \<noteq> \<infinity>\<close>
[PROOF STATE]
proof (prove)
using this:
eNorm (\<LL> 1 M) (indicat_real A) = emeasure M A
emeasure M A \<noteq> \<infinity>

goal (1 subgoal):
 1. indicat_real A \<in> {f. eNorm (\<LL> 1 M) f < \<infinity>} &&& enn2real (eNorm (\<LL> 1 M) (indicat_real A)) = Sigma_Algebra.measure M A
[PROOF STEP]
by (auto simp add: top.not_eq_extremum Sigma_Algebra.measure_def)


[STATEMENT]
lemma rexp_ewp_l_ewp: "l_ewp (lang x) = rexp_ewp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l_ewp (lang x) = rexp_ewp x
[PROOF STEP]
proof (induct x)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. l_ewp (lang 0\<^sub>r) = rexp_ewp 0\<^sub>r
 2. l_ewp (lang 1\<^sub>r) = rexp_ewp 1\<^sub>r
 3. \<And>x. l_ewp (lang \<langle>x\<rangle>) = rexp_ewp \<langle>x\<rangle>
 4. \<And>x1 x2. \<lbrakk>l_ewp (lang x1) = rexp_ewp x1; l_ewp (lang x2) = rexp_ewp x2\<rbrakk> \<Longrightarrow> l_ewp (lang (x1 +\<^sub>r x2)) = rexp_ewp (x1 +\<^sub>r x2)
 5. \<And>x1 x2. \<lbrakk>l_ewp (lang x1) = rexp_ewp x1; l_ewp (lang x2) = rexp_ewp x2\<rbrakk> \<Longrightarrow> l_ewp (lang (x1 \<cdot>\<^sub>r x2)) = rexp_ewp (x1 \<cdot>\<^sub>r x2)
 6. \<And>x. l_ewp (lang x) = rexp_ewp x \<Longrightarrow> l_ewp (lang (x\<^sup>\<star>\<^sub>r)) = rexp_ewp (x\<^sup>\<star>\<^sub>r)
[PROOF STEP]
case (Star x)
[PROOF STATE]
proof (state)
this:
l_ewp (lang x) = rexp_ewp x

goal (6 subgoals):
 1. l_ewp (lang 0\<^sub>r) = rexp_ewp 0\<^sub>r
 2. l_ewp (lang 1\<^sub>r) = rexp_ewp 1\<^sub>r
 3. \<And>x. l_ewp (lang \<langle>x\<rangle>) = rexp_ewp \<langle>x\<rangle>
 4. \<And>x1 x2. \<lbrakk>l_ewp (lang x1) = rexp_ewp x1; l_ewp (lang x2) = rexp_ewp x2\<rbrakk> \<Longrightarrow> l_ewp (lang (x1 +\<^sub>r x2)) = rexp_ewp (x1 +\<^sub>r x2)
 5. \<And>x1 x2. \<lbrakk>l_ewp (lang x1) = rexp_ewp x1; l_ewp (lang x2) = rexp_ewp x2\<rbrakk> \<Longrightarrow> l_ewp (lang (x1 \<cdot>\<^sub>r x2)) = rexp_ewp (x1 \<cdot>\<^sub>r x2)
 6. \<And>x. l_ewp (lang x) = rexp_ewp x \<Longrightarrow> l_ewp (lang (x\<^sup>\<star>\<^sub>r)) = rexp_ewp (x\<^sup>\<star>\<^sub>r)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
l_ewp (lang x) = rexp_ewp x

goal (1 subgoal):
 1. l_ewp (lang (x\<^sup>\<star>\<^sub>r)) = rexp_ewp (x\<^sup>\<star>\<^sub>r)
[PROOF STEP]
by (simp, metis lan_salomaa_l.EWP left_near_kleene_algebra_class.star_plus_one)
[PROOF STATE]
proof (state)
this:
l_ewp (lang (x\<^sup>\<star>\<^sub>r)) = rexp_ewp (x\<^sup>\<star>\<^sub>r)

goal (5 subgoals):
 1. l_ewp (lang 0\<^sub>r) = rexp_ewp 0\<^sub>r
 2. l_ewp (lang 1\<^sub>r) = rexp_ewp 1\<^sub>r
 3. \<And>x. l_ewp (lang \<langle>x\<rangle>) = rexp_ewp \<langle>x\<rangle>
 4. \<And>x1 x2. \<lbrakk>l_ewp (lang x1) = rexp_ewp x1; l_ewp (lang x2) = rexp_ewp x2\<rbrakk> \<Longrightarrow> l_ewp (lang (x1 +\<^sub>r x2)) = rexp_ewp (x1 +\<^sub>r x2)
 5. \<And>x1 x2. \<lbrakk>l_ewp (lang x1) = rexp_ewp x1; l_ewp (lang x2) = rexp_ewp x2\<rbrakk> \<Longrightarrow> l_ewp (lang (x1 \<cdot>\<^sub>r x2)) = rexp_ewp (x1 \<cdot>\<^sub>r x2)
[PROOF STEP]
qed (simp_all add:l_ewp_def zero_set_def one_set_def one_list_def plus_set_def c_prod_def times_list_def)


[STATEMENT]
lemma domain_Epigraph:
  "domain f = {x. \<exists>y. (x,y) \<in> Epigraph UNIV f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain f = {x. \<exists>y. (x, y) \<in> Epigraph UNIV f}
[PROOF STEP]
unfolding domain_def Epigraph_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. f x < \<infinity>} = {x. \<exists>y. (x, y) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}}
[PROOF STEP]
using domain_Epigraph_aux
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> \<infinity> \<Longrightarrow> \<exists>r. ?x \<le> ereal r

goal (1 subgoal):
 1. {x. f x < \<infinity>} = {x. \<exists>y. (x, y) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}}
[PROOF STEP]
by auto


[STATEMENT]
lemma zunion: "zin x (zunion a b) = ((zin x a) \<or> (zin x b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zin x (zunion a b) = (zin x a \<or> zin x b)
[PROOF STEP]
by (auto simp add: zin_def Rep_zet_zunion)


[STATEMENT]
lemma lt_word_bits_lt_pow:
  "sz < word_bits \<Longrightarrow> sz < 2 ^ word_bits"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sz < word_bits \<Longrightarrow> sz < 2 ^ word_bits
[PROOF STEP]
by (simp add: word_bits_conv)


[STATEMENT]
lemma qtableI: "table n A X \<Longrightarrow>
  (\<And>x. x \<in> X \<Longrightarrow> wf_tuple n A x \<Longrightarrow> P x \<Longrightarrow> Q x) \<Longrightarrow>
  (\<And>x. wf_tuple n A x \<Longrightarrow> P x \<Longrightarrow> Q x \<Longrightarrow> x \<in> X) \<Longrightarrow>
  qtable n A P Q X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>table n A X; \<And>x. \<lbrakk>x \<in> X; wf_tuple n A x; P x\<rbrakk> \<Longrightarrow> Q x; \<And>x. \<lbrakk>wf_tuple n A x; P x; Q x\<rbrakk> \<Longrightarrow> x \<in> X\<rbrakk> \<Longrightarrow> qtable n A P Q X
[PROOF STEP]
unfolding qtable_def table_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ball X (wf_tuple n A); \<And>x. \<lbrakk>x \<in> X; wf_tuple n A x; P x\<rbrakk> \<Longrightarrow> Q x; \<And>x. \<lbrakk>wf_tuple n A x; P x; Q x\<rbrakk> \<Longrightarrow> x \<in> X\<rbrakk> \<Longrightarrow> Ball X (wf_tuple n A) \<and> (\<forall>x. (x \<in> X \<and> P x \<longrightarrow> Q x) \<and> (wf_tuple n A x \<and> P x \<and> Q x \<longrightarrow> x \<in> X))
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Module) mcompos_inj_inj:"\<lbrakk>R module L; R module N; f \<in> mHom R L M;
       g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g \<rbrakk> \<Longrightarrow> injec\<^bsub>L,N\<^esub> (compos L g f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g\<rbrakk> \<Longrightarrow> injec\<^bsub>L,N\<^esub> compos L g f
[PROOF STEP]
apply (frule Module.module_is_ag [of L],
       frule Module.module_is_ag [of N])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> injec\<^bsub>L,N\<^esub> compos L g f
[PROOF STEP]
apply (simp add:injec_def [of "L" "N"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> compos L g f \<in> aHom L N \<and> ker\<^bsub>L,N\<^esub> compos L g f = {\<zero>\<^bsub>L\<^esub>}
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> compos L g f \<in> aHom L N
 2. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> ker\<^bsub>L,N\<^esub> compos L g f = {\<zero>\<^bsub>L\<^esub>}
[PROOF STEP]
apply (simp add:injec_def, (erule conjE)+,
        rule_tac aHom_compos[of L M N], assumption+,
        rule module_is_ag)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; aGroup L; aGroup N; f \<in> aHom L M; ker\<^bsub>L,M\<^esub> f = {\<zero>\<^bsub>L\<^esub>}; g \<in> aHom M N; ker\<^bsub>M,N\<^esub> g = {\<zero>}\<rbrakk> \<Longrightarrow> aGroup N
 2. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; aGroup L; aGroup N; f \<in> aHom L M; ker\<^bsub>L,M\<^esub> f = {\<zero>\<^bsub>L\<^esub>}; g \<in> aHom M N; ker\<^bsub>M,N\<^esub> g = {\<zero>}\<rbrakk> \<Longrightarrow> f \<in> aHom L M
 3. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; aGroup L; aGroup N; f \<in> aHom L M; ker\<^bsub>L,M\<^esub> f = {\<zero>\<^bsub>L\<^esub>}; g \<in> aHom M N; ker\<^bsub>M,N\<^esub> g = {\<zero>}\<rbrakk> \<Longrightarrow> g \<in> aHom M N
 4. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> ker\<^bsub>L,N\<^esub> compos L g f = {\<zero>\<^bsub>L\<^esub>}
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> ker\<^bsub>L,N\<^esub> compos L g f = {\<zero>\<^bsub>L\<^esub>}
[PROOF STEP]
apply (simp add:compos_def compose_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x)) = {\<zero>\<^bsub>L\<^esub>}
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x)) \<subseteq> {\<zero>\<^bsub>L\<^esub>}
 2. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (rule subsetI, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N; x \<in> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>L\<^esub>
 2. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (simp add:injec_def [of _ _ "g"], erule conjE, simp add:ker_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>L\<^esub>
 2. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (subgoal_tac "f x \<in> {a. a \<in> carrier M \<and> g a = \<zero>\<^bsub>N\<^esub>}")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}; f x \<in> {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>}\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>L\<^esub>
 2. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}\<rbrakk> \<Longrightarrow> f x \<in> {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>}
 3. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}; f x = \<zero>\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>L\<^esub>
 2. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}\<rbrakk> \<Longrightarrow> f x \<in> {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>}
 3. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (simp add:injec_def [of _ _ "f"], erule conjE)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}; f x = \<zero>; f \<in> aHom L M; ker\<^bsub>L,M\<^esub> f = {\<zero>\<^bsub>L\<^esub>}\<rbrakk> \<Longrightarrow> x = \<zero>\<^bsub>L\<^esub>
 2. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}\<rbrakk> \<Longrightarrow> f x \<in> {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>}
 3. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (subgoal_tac "x \<in> ker\<^bsub>L,M\<^esub> f", simp, thin_tac "ker\<^bsub>L,M\<^esub> f = {\<zero>\<^bsub>L\<^esub>}")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}; f x = \<zero>; f \<in> aHom L M\<rbrakk> \<Longrightarrow> x \<in> ker\<^bsub>L,M\<^esub> f
 2. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}\<rbrakk> \<Longrightarrow> f x \<in> {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>}
 3. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (simp add:ker_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N; {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}\<rbrakk> \<Longrightarrow> f x \<in> {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>}
 2. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (thin_tac "{a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>} = {\<zero>}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; x \<in> carrier L \<and> (if x \<in> carrier L then g (f x) else undefined) = \<zero>\<^bsub>N\<^esub>; g \<in> aHom M N\<rbrakk> \<Longrightarrow> f x \<in> {a \<in> carrier M. g a = \<zero>\<^bsub>N\<^esub>}
 2. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (simp, erule conjE, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; aGroup L; aGroup N; g \<in> aHom M N; x \<in> carrier L; g (f x) = \<zero>\<^bsub>N\<^esub>\<rbrakk> \<Longrightarrow> f x \<in> carrier M
 2. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (rule Module.mHom_mem[of L R M f], assumption, rule Module_axioms, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N\<rbrakk> \<Longrightarrow> {\<zero>\<^bsub>L\<^esub>} \<subseteq> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (rule subsetI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N; x = \<zero>\<^bsub>L\<^esub>\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>L\<^esub> \<in> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (frule Module.module_inc_zero [of L R])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N; x = \<zero>\<^bsub>L\<^esub>; \<zero>\<^bsub>L\<^esub> \<in> carrier L\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>L\<^esub> \<in> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (frule Module.mHom_0[of L R M f], rule Module_axioms, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N; x = \<zero>\<^bsub>L\<^esub>; \<zero>\<^bsub>L\<^esub> \<in> carrier L; f \<zero>\<^bsub>L\<^esub> = \<zero>\<rbrakk> \<Longrightarrow> \<zero>\<^bsub>L\<^esub> \<in> ker\<^bsub>L,N\<^esub> (\<lambda>x\<in>carrier L. g (f x))
[PROOF STEP]
apply (simp add:ker_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>R module L; R module N; f \<in> mHom R L M; g \<in> mHom R M N; injec\<^bsub>L,M\<^esub> f; injec\<^bsub>M,N\<^esub> g; aGroup L; aGroup N; x = \<zero>\<^bsub>L\<^esub>; \<zero>\<^bsub>L\<^esub> \<in> carrier L; f \<zero>\<^bsub>L\<^esub> = \<zero>\<rbrakk> \<Longrightarrow> g \<zero> = \<zero>\<^bsub>N\<^esub>
[PROOF STEP]
apply (subst mHom_0[of N], assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma in_lnth_in_Supremum_ldrop:
  assumes "i < llength xs" and "x \<in># (lnth xs i)"
  shows "x \<in> Sup_llist (lmap set_mset (ldrop (enat i) xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> Sup_llist (lmap set_mset (ldrop (enat i) xs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
enat i < llength xs
x \<in># lnth xs i

goal (1 subgoal):
 1. x \<in> Sup_llist (lmap set_mset (ldrop (enat i) xs))
[PROOF STEP]
by (metis (no_types) ldrop_eq_LConsD ldropn_0 llist.simps(13) contra_subsetD
      ldrop_enat ldropn_Suc_conv_ldropn lnth_0 lnth_lmap lnth_subset_Sup_llist)


[STATEMENT]
lemma partition_on_no_partition_outside_carrier:
  assumes "partition_on A P"
  assumes "x \<notin> A"
  shows "{y. \<exists>X\<in>P. x \<in> X \<and> y \<in> X} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>X\<in>P. x \<in> X \<and> y \<in> X} = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
partition_on A P
x \<notin> A

goal (1 subgoal):
 1. {y. \<exists>X\<in>P. x \<in> X \<and> y \<in> X} = {}
[PROOF STEP]
unfolding partition_on_def
[PROOF STATE]
proof (prove)
using this:
\<Union> P = A \<and> disjoint P \<and> {} \<notin> P
x \<notin> A

goal (1 subgoal):
 1. {y. \<exists>X\<in>P. x \<in> X \<and> y \<in> X} = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma adjuster_finsum:
  assumes U: "set us \<subseteq> carrier_vec n"
    and dist: "distinct (us :: 'a vec list)"
  shows "adjuster n w us = finsum V (\<lambda>u. -(w \<bullet>c u)/(u \<bullet>c u) \<cdot>\<^sub>v u) (set us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>u\<in>set us. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n
distinct us

goal (1 subgoal):
 1. adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>u\<in>set us. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
[PROOF STEP]
proof (induct us)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>u\<in>set []. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
 2. \<And>a us. \<lbrakk>\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>u\<in>set us. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u); set (a # us) \<subseteq> carrier_vec n; distinct (a # us)\<rbrakk> \<Longrightarrow> adjuster n w (a # us) = (\<Oplus>\<^bsub>V\<^esub>u\<in>set (a # us). - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
\<lbrakk>set us_ \<subseteq> carrier_vec n; distinct us_\<rbrakk> \<Longrightarrow> adjuster n w us_ = (\<Oplus>\<^bsub>V\<^esub>u\<in>set us_. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
set (a_ # us_) \<subseteq> carrier_vec n
distinct (a_ # us_)

goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>u\<in>set []. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
 2. \<And>a us. \<lbrakk>\<lbrakk>set us \<subseteq> carrier_vec n; distinct us\<rbrakk> \<Longrightarrow> adjuster n w us = (\<Oplus>\<^bsub>V\<^esub>u\<in>set us. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u); set (a # us) \<subseteq> carrier_vec n; distinct (a # us)\<rbrakk> \<Longrightarrow> adjuster n w (a # us) = (\<Oplus>\<^bsub>V\<^esub>u\<in>set (a # us). - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster n w (a_ # us_) = (\<Oplus>\<^bsub>V\<^esub>u\<in>set (a_ # us_). - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
[PROOF STEP]
unfolding set_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster n w (a_ # us_) = (\<Oplus>\<^bsub>V\<^esub>u\<in>insert a_ (set us_). - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
[PROOF STEP]
by (subst finsum_insert[OF finite_set], insert Cons, auto)
[PROOF STATE]
proof (state)
this:
adjuster n w (a_ # us_) = (\<Oplus>\<^bsub>V\<^esub>u\<in>set (a_ # us_). - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)

goal (1 subgoal):
 1. \<lbrakk>set [] \<subseteq> carrier_vec n; distinct []\<rbrakk> \<Longrightarrow> adjuster n w [] = (\<Oplus>\<^bsub>V\<^esub>u\<in>set []. - (w \<bullet>c u) / (u \<bullet>c u) \<cdot>\<^sub>v u)
[PROOF STEP]
qed simp


[STATEMENT]
lemma euler_128:
  "\<bar>exp 1 - 924983374546220337150911035843336795079 / 2 ^ 128\<bar> \<le> inverse (2 ^ 128 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>exp 1 - 924983374546220337150911035843336795079 / 2 ^ 128\<bar> \<le> inverse (2 ^ 128)
[PROOF STEP]
by (rule approx_coarsen[OF euler_60_decimals]) simp_all


[STATEMENT]
lemma less_Liminf_iff:
  fixes X :: "_ \<Rightarrow> _ :: complete_linorder"
  shows "Liminf F X < C \<longleftrightarrow> (\<exists>y<C. frequently (\<lambda>x. y \<ge> X x) F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Liminf F X < C) = (\<exists>y<C. \<exists>\<^sub>F x in F. X x \<le> y)
[PROOF STEP]
by (force simp: not_less not_frequently not_le le_Liminf_iff simp flip: Not_eq_iff)


[STATEMENT]
lemma all_le_start_of: "list_all (\<lambda>(acn, s).
  s \<le> start_of (layout_of ap) (length ap)) (tm_of ap)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>(acn, s). s \<le> start_of (layout_of ap) (length ap)) (tm_of ap)
[PROOF STEP]
apply(simp only: list_all_length)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n<length (tm_of ap). case tm_of ap ! n of (acn, s) \<Rightarrow> s \<le> start_of (layout_of ap) (length ap)
[PROOF STEP]
apply(rule_tac allI, rule_tac impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n < length (tm_of ap) \<Longrightarrow> case tm_of ap ! n of (acn, s) \<Rightarrow> s \<le> start_of (layout_of ap) (length ap)
[PROOF STEP]
apply(drule_tac in_tms, auto elim: tms_any_less)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem wlsFSb_recAll_isSurjAll:
"wlsFSb MOD \<Longrightarrow> gConsIndif MOD \<Longrightarrow> gInduct MOD
 \<Longrightarrow> isSurjAll (rec MOD) (recAbs MOD) MOD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wlsFSb MOD; gConsIndif MOD; gInduct MOD\<rbrakk> \<Longrightarrow> isSurjAll (rec MOD) (recAbs MOD) MOD
[PROOF STEP]
using wlsFSb_recAll_termFSbMorph
[PROOF STATE]
proof (prove)
using this:
wlsFSb ?MOD \<Longrightarrow> termFSbMorph (rec ?MOD) (recAbs ?MOD) ?MOD

goal (1 subgoal):
 1. \<lbrakk>wlsFSb MOD; gConsIndif MOD; gInduct MOD\<rbrakk> \<Longrightarrow> isSurjAll (rec MOD) (recAbs MOD) MOD
[PROOF STEP]
by (auto simp: termFSbMorph_def intro: gInduct_gConsIndif_recAll_isSurjAll)


[STATEMENT]
lemma map_filter_neq_eq_filter_map:
  "map f (filter (\<lambda>y. f x \<noteq> f y) xs) = filter (\<lambda>z. f x \<noteq> z) (map f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (filter (\<lambda>y. f x \<noteq> f y) xs) = filter ((\<noteq>) (f x)) (map f xs)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma [code abstract]: "vec_nth (row i A) =  (($) (A $ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (row i A) = ($) (A $ i)
[PROOF STEP]
unfolding row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (vec_lambda (($) (A $ i))) = ($) (A $ i)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma real_cond_exp_int [intro]:
  assumes "integrable M f"
  shows "integrable M (real_cond_exp M F f)" "(\<integral>x. real_cond_exp M F f x \<partial>M) = (\<integral>x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (real_cond_exp M F f) &&& integral\<^sup>L M (real_cond_exp M F f) = integral\<^sup>L M f
[PROOF STEP]
using real_cond_exp_intg[where ?f = "\<lambda>x. 1" and ?g = f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>integrable M (\<lambda>x. 1 * f x); (\<lambda>x. 1) \<in> borel_measurable F; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. 1 * real_cond_exp M F f x)
\<lbrakk>integrable M (\<lambda>x. 1 * f x); (\<lambda>x. 1) \<in> borel_measurable F; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> LINT x|M. 1 * real_cond_exp M F f x = LINT x|M. 1 * f x
integrable M f

goal (1 subgoal):
 1. integrable M (real_cond_exp M F f) &&& integral\<^sup>L M (real_cond_exp M F f) = integral\<^sup>L M f
[PROOF STEP]
by auto


[STATEMENT]
lemma list_interval2: "list_interval [a, b] [c, d] = {[x, y] | x y. x \<in> {a .. c} \<and> y \<in> {b .. d}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_interval [a, b] [c, d] = {[x, y] |x y. x \<in> {a..c} \<and> y \<in> {b..d}}
[PROOF STEP]
apply (auto simp: list_interval_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>list_all2 (\<le>) [a, b] x; list_all2 (\<le>) x [c, d]\<rbrakk> \<Longrightarrow> \<exists>xa y. x = [xa, y] \<and> a \<le> xa \<and> xa \<le> c \<and> b \<le> y \<and> y \<le> d
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all2 (\<le>) [a, b] x; list_all2 (\<le>) x [c, d]\<rbrakk> \<Longrightarrow> \<exists>xa y. x = [xa, y] \<and> a \<le> xa \<and> xa \<le> c \<and> b \<le> y \<and> y \<le> d
[PROOF STEP]
apply (cases x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>list_all2 (\<le>) [a, b] x; list_all2 (\<le>) x [c, d]; x = []\<rbrakk> \<Longrightarrow> \<exists>xa y. x = [xa, y] \<and> a \<le> xa \<and> xa \<le> c \<and> b \<le> y \<and> y \<le> d
 2. \<And>aa list. \<lbrakk>list_all2 (\<le>) [a, b] x; list_all2 (\<le>) x [c, d]; x = aa # list\<rbrakk> \<Longrightarrow> \<exists>xa y. x = [xa, y] \<and> a \<le> xa \<and> xa \<le> c \<and> b \<le> y \<and> y \<le> d
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa list. \<lbrakk>x = aa # list; a \<le> aa; list_all2 (\<le>) [b] list; aa \<le> c; list_all2 (\<le>) list [d]\<rbrakk> \<Longrightarrow> \<exists>y. list = [y] \<and> b \<le> y \<and> y \<le> d
[PROOF STEP]
subgoal for y zs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x = y # zs; a \<le> y; list_all2 (\<le>) [b] zs; y \<le> c; list_all2 (\<le>) zs [d]\<rbrakk> \<Longrightarrow> \<exists>y. zs = [y] \<and> b \<le> y \<and> y \<le> d
[PROOF STEP]
apply (cases zs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x = y # zs; a \<le> y; list_all2 (\<le>) [b] zs; y \<le> c; list_all2 (\<le>) zs [d]; zs = []\<rbrakk> \<Longrightarrow> \<exists>y. zs = [y] \<and> b \<le> y \<and> y \<le> d
 2. \<And>aa list. \<lbrakk>x = y # zs; a \<le> y; list_all2 (\<le>) [b] zs; y \<le> c; list_all2 (\<le>) zs [d]; zs = aa # list\<rbrakk> \<Longrightarrow> \<exists>y. zs = [y] \<and> b \<le> y \<and> y \<le> d
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inside_Gromov_distance_approx:
  assumes "C < (\<infinity>::ereal)"
  shows "\<exists>e > 0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e
          \<longrightarrow> esqrt(extended_Gromov_distance x y) \<le> 2 * ereal(dist x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
obtain C0 where "C \<le> ereal C0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C0. C \<le> ereal C0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
C < \<infinity>

goal (1 subgoal):
 1. (\<And>C0. C \<le> ereal C0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases C, auto)
[PROOF STATE]
proof (state)
this:
C \<le> ereal C0

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
define e0 where "e0 = exp(-epsilonG(TYPE('a)) * C0)"
[PROOF STATE]
proof (state)
this:
e0 = exp (- epsilonG TYPE('a) * C0)

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have "e0 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e0
[PROOF STEP]
unfolding e0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < exp (- epsilonG TYPE('a) * C0)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
C < \<infinity>

goal (1 subgoal):
 1. 0 < exp (- epsilonG TYPE('a) * C0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e0

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
define e where "e = e0/4"
[PROOF STATE]
proof (state)
this:
e = e0 / 4

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have "e > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e
[PROOF STEP]
unfolding e_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e0 / 4
[PROOF STEP]
using \<open>e0 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e0

goal (1 subgoal):
 1. 0 < e0 / 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have "esqrt(extended_Gromov_distance x y) \<le> 2 * ereal(dist x y)"
    if "extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C0" "dist x y \<le> e" for x y::"'a Gromov_completion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have R: "min a b \<le> c \<Longrightarrow> a \<le> c \<or> b \<le> c" for a b c::ereal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min a b \<le> c \<Longrightarrow> a \<le> c \<or> b \<le> c
[PROOF STEP]
unfolding min_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a \<le> b then a else b) \<le> c \<Longrightarrow> a \<le> c \<or> b \<le> c
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
min ?a ?b \<le> ?c \<Longrightarrow> ?a \<le> ?c \<or> ?b \<le> ?c

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have "2 * ereal (dist x y) \<le> 2 * ereal e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * ereal (dist x y) \<le> 2 * ereal e
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> ereal C0
dist x y \<le> e

goal (1 subgoal):
 1. 2 * ereal (dist x y) \<le> 2 * ereal e
[PROOF STEP]
by (intro mono_intros, auto)
[PROOF STATE]
proof (state)
this:
2 * ereal (dist x y) \<le> 2 * ereal e

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * ereal (dist x y) \<le> 2 * ereal e

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have "... = ereal(e0/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * ereal e = ereal (e0 / 2)
[PROOF STEP]
unfolding e_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * ereal (e0 / 4) = ereal (e0 / 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * ereal e = ereal (e0 / 2)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * ereal e = ereal (e0 / 2)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have "... < ereal e0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (e0 / 2) < ereal e0
[PROOF STEP]
apply (intro mono_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e0 / 2 < e0
[PROOF STEP]
using \<open>e0 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e0

goal (1 subgoal):
 1. e0 / 2 < e0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (e0 / 2) < ereal e0

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (e0 / 2) < ereal e0

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have "... \<le> eexp(-epsilonG(TYPE('a)) * extended_Gromov_distance (to_Gromov_completion basepoint) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal e0 \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_distance (to_Gromov_completion basepoint) x)
[PROOF STEP]
unfolding e0_def eexp_ereal[symmetric] ereal_mult_minus_left mult_minus_left uminus_ereal.simps(1)[symmetric] times_ereal.simps(1)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (- (ereal (epsilonG TYPE('a)) * ereal C0)) \<le> eexp (- (ereal (epsilonG TYPE('a)) * extended_Gromov_distance (to_Gromov_completion basepoint) x))
[PROOF STEP]
by (intro mono_intros that)
[PROOF STATE]
proof (state)
this:
ereal e0 \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_distance (to_Gromov_completion basepoint) x)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal e0 \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_distance (to_Gromov_completion basepoint) x)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
have "... \<le> eexp(-epsilonG(TYPE('a)) * extended_Gromov_product_at basepoint x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_distance (to_Gromov_completion basepoint) x) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)
[PROOF STEP]
unfolding ereal_mult_minus_left mult_minus_left uminus_ereal.simps(1)[symmetric] times_ereal.simps(1)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp (- (ereal (epsilonG TYPE('a)) * extended_Gromov_distance (to_Gromov_completion basepoint) x)) \<le> eexp (- (ereal (epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y))
[PROOF STEP]
by (intro mono_intros)
[PROOF STATE]
proof (state)
this:
eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_distance (to_Gromov_completion basepoint) x) \<le> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * ereal (dist x y) < eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * ereal (dist x y) < eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
using R[OF Gromov_completion_dist_comparison(3)[of x y]]
[PROOF STATE]
proof (prove)
using this:
2 * ereal (dist x y) < eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y)
esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y) \<or> eexp (ereal (- epsilonG TYPE('a)) * extended_Gromov_product_at basepoint x y) \<le> 2 * ereal (dist x y)

goal (1 subgoal):
 1. esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>extended_Gromov_distance (to_Gromov_completion basepoint) ?x \<le> ereal C0; dist ?x ?y \<le> e\<rbrakk> \<Longrightarrow> esqrt (extended_Gromov_distance ?x ?y) \<le> 2 * ereal (dist ?x ?y)

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < e
\<lbrakk>extended_Gromov_distance (to_Gromov_completion basepoint) ?x \<le> ereal C0; dist ?x ?y \<le> e\<rbrakk> \<Longrightarrow> esqrt (extended_Gromov_distance ?x ?y) \<le> 2 * ereal (dist ?x ?y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < e
\<lbrakk>extended_Gromov_distance (to_Gromov_completion basepoint) ?x \<le> ereal C0; dist ?x ?y \<le> e\<rbrakk> \<Longrightarrow> esqrt (extended_Gromov_distance ?x ?y) \<le> 2 * ereal (dist ?x ?y)

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
using order_trans[OF _ \<open>C \<le> ereal C0\<close>]
[PROOF STATE]
proof (prove)
using this:
0 < e
\<lbrakk>extended_Gromov_distance (to_Gromov_completion basepoint) ?x \<le> ereal C0; dist ?x ?y \<le> e\<rbrakk> \<Longrightarrow> esqrt (extended_Gromov_distance ?x ?y) \<le> 2 * ereal (dist ?x ?y)
?x \<le> C \<Longrightarrow> ?x \<le> ereal C0

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>e>0. \<forall>x y. extended_Gromov_distance (to_Gromov_completion basepoint) x \<le> C \<longrightarrow> dist x y \<le> e \<longrightarrow> esqrt (extended_Gromov_distance x y) \<le> 2 * ereal (dist x y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cat_simplicial_is_arrE[elim]:
  assumes "f : a \<mapsto>\<^bsub>cat_simplicial \<alpha> A\<^esub> b"
  obtains m n where "f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n"
    and "m \<in>\<^sub>\<circ> A"
    and "n \<in>\<^sub>\<circ> A"
    and "a = cat_ordinal m"
    and "b = cat_ordinal n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n; m \<in>\<^sub>\<circ> A; n \<in>\<^sub>\<circ> A; a = cat_ordinal m; b = cat_ordinal n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n; m \<in>\<^sub>\<circ> A; n \<in>\<^sub>\<circ> A; a = cat_ordinal m; b = cat_ordinal n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
note f = is_arrD[OF assms(1)]
[PROOF STATE]
proof (state)
this:
f \<in>\<^sub>\<circ> cat_simplicial \<alpha> A\<lparr>Arr\<rparr>
cat_simplicial \<alpha> A\<lparr>Dom\<rparr>\<lparr>f\<rparr> = a
cat_simplicial \<alpha> A\<lparr>Cod\<rparr>\<lparr>f\<rparr> = b

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n; m \<in>\<^sub>\<circ> A; n \<in>\<^sub>\<circ> A; a = cat_ordinal m; b = cat_ordinal n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from f(1)
[PROOF STATE]
proof (chain)
picking this:
f \<in>\<^sub>\<circ> cat_simplicial \<alpha> A\<lparr>Arr\<rparr>
[PROOF STEP]
obtain m n
    where f_is_preorder_functor: "f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n"
      and m: "m \<in>\<^sub>\<circ> A"
      and n: "n \<in>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
using this:
f \<in>\<^sub>\<circ> cat_simplicial \<alpha> A\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n; m \<in>\<^sub>\<circ> A; n \<in>\<^sub>\<circ> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim cat_simplicial_ArrE)
[PROOF STATE]
proof (state)
this:
f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n
m \<in>\<^sub>\<circ> A
n \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n; m \<in>\<^sub>\<circ> A; n \<in>\<^sub>\<circ> A; a = cat_ordinal m; b = cat_ordinal n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n
m \<in>\<^sub>\<circ> A
n \<in>\<^sub>\<circ> A
[PROOF STEP]
have
    "cat_simplicial \<alpha> A\<lparr>Dom\<rparr>\<lparr>f\<rparr> = cat_ordinal m"
    "cat_simplicial \<alpha> A\<lparr>Cod\<rparr>\<lparr>f\<rparr> = cat_ordinal n"
[PROOF STATE]
proof (prove)
using this:
f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n
m \<in>\<^sub>\<circ> A
n \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. cat_simplicial \<alpha> A\<lparr>Dom\<rparr>\<lparr>f\<rparr> = cat_ordinal m &&& cat_simplicial \<alpha> A\<lparr>Cod\<rparr>\<lparr>f\<rparr> = cat_ordinal n
[PROOF STEP]
by (cs_concl cs_shallow cs_simp: cat_simplicial_cs_simps)+
[PROOF STATE]
proof (state)
this:
cat_simplicial \<alpha> A\<lparr>Dom\<rparr>\<lparr>f\<rparr> = cat_ordinal m
cat_simplicial \<alpha> A\<lparr>Cod\<rparr>\<lparr>f\<rparr> = cat_ordinal n

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n; m \<in>\<^sub>\<circ> A; n \<in>\<^sub>\<circ> A; a = cat_ordinal m; b = cat_ordinal n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with f(2,3)
[PROOF STATE]
proof (chain)
picking this:
cat_simplicial \<alpha> A\<lparr>Dom\<rparr>\<lparr>f\<rparr> = a
cat_simplicial \<alpha> A\<lparr>Cod\<rparr>\<lparr>f\<rparr> = b
cat_simplicial \<alpha> A\<lparr>Dom\<rparr>\<lparr>f\<rparr> = cat_ordinal m
cat_simplicial \<alpha> A\<lparr>Cod\<rparr>\<lparr>f\<rparr> = cat_ordinal n
[PROOF STEP]
have "cat_ordinal m = a" "cat_ordinal n = b"
[PROOF STATE]
proof (prove)
using this:
cat_simplicial \<alpha> A\<lparr>Dom\<rparr>\<lparr>f\<rparr> = a
cat_simplicial \<alpha> A\<lparr>Cod\<rparr>\<lparr>f\<rparr> = b
cat_simplicial \<alpha> A\<lparr>Dom\<rparr>\<lparr>f\<rparr> = cat_ordinal m
cat_simplicial \<alpha> A\<lparr>Cod\<rparr>\<lparr>f\<rparr> = cat_ordinal n

goal (1 subgoal):
 1. cat_ordinal m = a &&& cat_ordinal n = b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cat_ordinal m = a
cat_ordinal n = b

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n; m \<in>\<^sub>\<circ> A; n \<in>\<^sub>\<circ> A; a = cat_ordinal m; b = cat_ordinal n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with f_is_preorder_functor m n that
[PROOF STATE]
proof (chain)
picking this:
f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n
m \<in>\<^sub>\<circ> A
n \<in>\<^sub>\<circ> A
\<lbrakk>f : cat_ordinal ?m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal ?n; ?m \<in>\<^sub>\<circ> A; ?n \<in>\<^sub>\<circ> A; a = cat_ordinal ?m; b = cat_ordinal ?n\<rbrakk> \<Longrightarrow> thesis
cat_ordinal m = a
cat_ordinal n = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f : cat_ordinal m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal n
m \<in>\<^sub>\<circ> A
n \<in>\<^sub>\<circ> A
\<lbrakk>f : cat_ordinal ?m \<le>\<^sub>C\<^sub>.\<^sub>P\<^sub>E\<^sub>O\<^bsub>\<alpha>\<^esub> cat_ordinal ?n; ?m \<in>\<^sub>\<circ> A; ?n \<in>\<^sub>\<circ> A; a = cat_ordinal ?m; b = cat_ordinal ?n\<rbrakk> \<Longrightarrow> thesis
cat_ordinal m = a
cat_ordinal n = b

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pi_approx_64:
  "abs (pi - 57952155664616982739 / 2^64 :: real) \<le> inverse (2^64)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - 57952155664616982739 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64)
[PROOF STEP]
by (rule approx_coarsen[OF pi_approx_54_decimals]) simp


[STATEMENT]
lemma lubmap_belowI[intro]:
  "(\<And> k v . m k = Some v \<Longrightarrow> (e k v::'a::Join_cpo) \<sqsubseteq> u) \<Longrightarrow> (\<Squnion> k\<mapsto>v\<in>m. e k v) \<sqsubseteq> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k v. m k = Some v \<Longrightarrow> e k v \<sqsubseteq> u) \<Longrightarrow> lub (mapCollect e m) \<sqsubseteq> u
[PROOF STEP]
unfolding mapCollect_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k v. m k = Some v \<Longrightarrow> e k v \<sqsubseteq> u) \<Longrightarrow> lub {e k v |k v. m k = Some v} \<sqsubseteq> u
[PROOF STEP]
by auto


[STATEMENT]
lemma star_transpose_swap:
  assumes "\<And>x. 1' + x;(rtc x) \<le> rtc x"
      and "\<And>x y z. x+y;z \<le> z \<Longrightarrow> rtc(y);x \<le> z"
    shows "rtc(x\<^sup>T) = (rtc x)\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rtc (x\<^sup>T) = rtc x\<^sup>T
[PROOF STEP]
apply(simp only: order.eq_iff; rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. rtc (x\<^sup>T) \<le> rtc x\<^sup>T
 2. rtc x\<^sup>T \<le> rtc (x\<^sup>T)
[PROOF STEP]
apply (metis assms conv_add conv_contrav conv_e conv_iso mult_1_right
             unfoldl_inductl_implies_unfoldr )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rtc x\<^sup>T \<le> rtc (x\<^sup>T)
[PROOF STEP]
by (metis assms conv_add conv_contrav conv_e conv_invol conv_iso mult_1_right
          unfoldl_inductl_implies_unfoldr)


[STATEMENT]
lemma midpoint_linear_image:
   "linear f \<Longrightarrow> midpoint(f a)(f b) = f(midpoint a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f \<Longrightarrow> midpoint (f a) (f b) = f (midpoint a b)
[PROOF STEP]
by (simp add: linear_iff midpoint_def)


[STATEMENT]
lemma add_four_block_mat: assumes
  c1: "A1 \<in> carrier_mat nr1 nc1" "B1 \<in> carrier_mat nr1 nc2" "C1 \<in> carrier_mat nr2 nc1" "D1 \<in> carrier_mat nr2 nc2" and
  c2: "A2 \<in> carrier_mat nr1 nc1" "B2 \<in> carrier_mat nr1 nc2" "C2 \<in> carrier_mat nr2 nc1" "D2 \<in> carrier_mat nr2 nc2"
  shows "four_block_mat A1 B1 C1 D1 + four_block_mat A2 B2 C2 D2
  = four_block_mat (A1 + A2) (B1 + B2) (C1 + C2) (D1 + D2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A1 B1 C1 D1 + four_block_mat A2 B2 C2 D2 = four_block_mat (A1 + A2) (B1 + B2) (C1 + C2) (D1 + D2)
[PROOF STEP]
by (rule eq_matI, insert assms, auto)


[STATEMENT]
lemma num_reachable_le_nodes: "\<lbrakk> wf_graph G \<rbrakk> \<Longrightarrow> num_reachable G v \<le> card (nodes G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_graph G \<Longrightarrow> num_reachable G v \<le> card (nodes G)
[PROOF STEP]
unfolding num_reachable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_graph G \<Longrightarrow> card (succ_tran G v) \<le> card (nodes G)
[PROOF STEP]
using succ_tran_subseteq_nodes card_seteq nat_le_linear wf_graph.finiteV
[PROOF STATE]
proof (prove)
using this:
wf_graph ?G \<Longrightarrow> succ_tran ?G ?v \<subseteq> nodes ?G
\<lbrakk>finite ?B; ?A \<subseteq> ?B; card ?B \<le> card ?A\<rbrakk> \<Longrightarrow> ?A = ?B
?m \<le> ?n \<or> ?n \<le> ?m
wf_graph ?G \<Longrightarrow> finite (nodes ?G)

goal (1 subgoal):
 1. wf_graph G \<Longrightarrow> card (succ_tran G v) \<le> card (nodes G)
[PROOF STEP]
by metis


[STATEMENT]
lemma lfp_dual_var:
  fixes f :: "'a::complete_lattice_with_dual \<Rightarrow> 'a"
  shows "\<partial> (lfp f) = gfp (map_dual f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<partial> (lfp f) = gfp (\<partial>\<^sub>F f)
[PROOF STEP]
using comp_eq_dest_lhs lfp_dual
[PROOF STATE]
proof (prove)
using this:
?a \<circ> ?b = ?c \<Longrightarrow> ?a (?b ?v) = ?c ?v
\<partial> \<circ> lfp = gfp \<circ> \<partial>\<^sub>F

goal (1 subgoal):
 1. \<partial> (lfp f) = gfp (\<partial>\<^sub>F f)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma euler_128:
  "\<bar>exp 1 - 924983374546220337150911035843336795079 / 2 ^ 128\<bar> \<le> inverse (2 ^ 128 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>exp 1 - 924983374546220337150911035843336795079 / 2 ^ 128\<bar> \<le> inverse (2 ^ 128)
[PROOF STEP]
by (rule approx_coarsen[OF euler_60_decimals]) simp_all


[STATEMENT]
theorem mojmir_accept_iff_rabin_accept:
  "accept \<longleftrightarrow> accept\<^sub>R \<R> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. accept\<^sub>M = accept\<^sub>R (\<delta>\<^sub>\<R>, q\<^sub>\<R>, {(fail\<^sub>R \<union> merge\<^sub>R j, succeed\<^sub>R j) |j. j < max_rank}) w
[PROOF STEP]
unfolding mojmir_accept_iff_token_set_accept mojmir_accept_iff_rabin_accept_rank
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>i<max_rank. accepting_pair\<^sub>R \<delta>\<^sub>\<R> q\<^sub>\<R> (fail\<^sub>R \<union> merge\<^sub>R i, succeed\<^sub>R i) w) = accept\<^sub>R (\<delta>\<^sub>\<R>, q\<^sub>\<R>, {(fail\<^sub>R \<union> merge\<^sub>R j, succeed\<^sub>R j) |j. j < max_rank}) w
[PROOF STEP]
by auto


[STATEMENT]
lemma plus_sup:
  "(x \<squnion> y)\<^sup>+ = (x\<^sup>\<star> * y)\<^sup>\<star> * x\<^sup>+ \<squnion> (x\<^sup>\<star> * y)\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> y)\<^sup>+ = (x\<^sup>\<star> * y)\<^sup>\<star> * x\<^sup>+ \<squnion> (x\<^sup>\<star> * y)\<^sup>+
[PROOF STEP]
by (metis semiring.distrib_left star.circ_sup_9 star_plus mult_assoc)


[STATEMENT]
lemma "w \<le> x \<and> y < z ==> w + y < x + (z::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<le> x \<and> y < z \<Longrightarrow> w + y < x + z
[PROOF STEP]
by arith


[STATEMENT]
lemma SET047_5:
 "(\<forall>X Z Y. set_equal(X::'a,Y) & element(Z::'a,X) --> element(Z::'a,Y)) &
  (\<forall>Y Z X. set_equal(X::'a,Y) & element(Z::'a,Y) --> element(Z::'a,X)) &
  (\<forall>X Y. element(f(X::'a,Y),X) | element(f(X::'a,Y),Y) | set_equal(X::'a,Y)) &
  (\<forall>X Y. element(f(X::'a,Y),Y) & element(f(X::'a,Y),X) --> set_equal(X::'a,Y)) &
  (set_equal(a::'a,b) | set_equal(b::'a,a)) &
  (~(set_equal(b::'a,a) & set_equal(a::'a,b))) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>X Z Y. set_equal (X, Y) \<and> element (Z, X) \<longrightarrow> element (Z, Y)) \<and> (\<forall>Y Z X. set_equal (X, Y) \<and> element (Z, Y) \<longrightarrow> element (Z, X)) \<and> (\<forall>X Y. element (f (X, Y), X) \<or> element (f (X, Y), Y) \<or> set_equal (X, Y)) \<and> (\<forall>X Y. element (f (X, Y), Y) \<and> element (f (X, Y), X) \<longrightarrow> set_equal (X, Y)) \<and> (set_equal (a, b) \<or> set_equal (b, a)) \<and> \<not> (set_equal (b, a) \<and> set_equal (a, b)) \<longrightarrow> False
[PROOF STEP]
by meson


[STATEMENT]
lemma typeI_cube_explicit_spec:
  assumes "typeI_twoCube twoC"
  shows "\<exists>a b g1 g2. a < b \<and> (\<forall>x \<in> {a .. b}. g2 x \<le> g1 x) \<and>
                      cubeImage twoC = {(x,y). x \<in> {a..b} \<and> y \<in> {g2 x .. g1 x}}
                      \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b)))
                      \<and> g1 piecewise_C1_differentiable_on {a .. b} \<and> g2 piecewise_C1_differentiable_on {a .. b}
                      \<and> (\<lambda>x. twoC(x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x)))
                      \<and> (\<lambda>y. twoC(1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b)))
                      \<and> (\<lambda>x. twoC(x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x)))
                      \<and> (\<lambda>y. twoC(0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
let ?bottom_edge = "(\<lambda>x. twoC(x, 0))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
let ?right_edge = "(\<lambda>y. twoC(1, y))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
let ?top_edge = "(\<lambda>x. twoC(x, 1))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
let ?left_edge = "(\<lambda>y. twoC(0, y))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
obtain a b g1 g2 where
    twoCisTypeI: "a < b"
    "(\<forall>x \<in> cbox a b. g2 x \<le> g1 x)"
    "cubeImage twoC = {(x,y). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}"
    "twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b)))"
    "g1 piecewise_C1_differentiable_on {a .. b}"
    "g2 piecewise_C1_differentiable_on {a .. b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b g2 g1. \<lbrakk>a < b; \<forall>x\<in>cbox a b. g2 x \<le> g1 x; cubeImage twoC = {(x, y). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}; twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))); g1 piecewise_C1_differentiable_on {a..b}; g2 piecewise_C1_differentiable_on {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms and typeI_twoCubeImg[of"twoC"]
[PROOF STATE]
proof (prove)
using this:
typeI_twoCube twoC
typeI_twoCube twoC \<Longrightarrow> \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b}

goal (1 subgoal):
 1. (\<And>a b g2 g1. \<lbrakk>a < b; \<forall>x\<in>cbox a b. g2 x \<le> g1 x; cubeImage twoC = {(x, y). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}; twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))); g1 piecewise_C1_differentiable_on {a..b}; g2 piecewise_C1_differentiable_on {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a < b
\<forall>x\<in>cbox a b. g2 x \<le> g1 x
cubeImage twoC = {(x, y). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}
twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b)))
g1 piecewise_C1_differentiable_on {a..b}
g2 piecewise_C1_differentiable_on {a..b}

goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
have bottom_edge_explicit: "?bottom_edge = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x)))
[PROOF STEP]
by (simp add: twoCisTypeI(4) algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x)))

goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
have right_edge_explicit: "?right_edge = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b)))
[PROOF STEP]
by (simp add: twoCisTypeI(4) algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b)))

goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
have top_edge_explicit: "?top_edge = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x)))
[PROOF STEP]
by (simp add: twoCisTypeI(4) algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x)))

goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
have left_edge_explicit: "?left_edge = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
by (simp add: twoCisTypeI(4) algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))

goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
using bottom_edge_explicit right_edge_explicit top_edge_explicit left_edge_explicit twoCisTypeI
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x)))
(\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b)))
(\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x)))
(\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
a < b
\<forall>x\<in>cbox a b. g2 x \<le> g1 x
cubeImage twoC = {(x, y). x \<in> cbox a b \<and> y \<in> cbox (g2 x) (g1 x)}
twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b)))
g1 piecewise_C1_differentiable_on {a..b}
g2 piecewise_C1_differentiable_on {a..b}

goal (1 subgoal):
 1. \<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage twoC = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> twoC = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. twoC (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. twoC (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. twoC (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))

goal:
No subgoals!
[PROOF STEP]
qed