[STATEMENT]
lemma bv_to_nat_dist_append:
  "bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2
[PROOF STEP]
have "\<forall>l2. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>l2. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2
[PROOF STEP]
proof (induct l1, simp_all)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l1. \<forall>l2. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2 \<Longrightarrow> \<forall>l2. bitval a * 2 ^ (length l1 + length l2) + bv_to_nat l1 * 2 ^ length l2 = (bitval a * 2 ^ length l1 + bv_to_nat l1) * 2 ^ length l2
[PROOF STEP]
fix x xs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l1. \<forall>l2. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2 \<Longrightarrow> \<forall>l2. bitval a * 2 ^ (length l1 + length l2) + bv_to_nat l1 * 2 ^ length l2 = (bitval a * 2 ^ length l1 + bv_to_nat l1) * 2 ^ length l2
[PROOF STEP]
assume ind: "\<forall>l2. bv_to_nat (xs @ l2) = bv_to_nat xs * 2 ^ length l2 + bv_to_nat l2"
[PROOF STATE]
proof (state)
this:
\<forall>l2. bv_to_nat (xs @ l2) = bv_to_nat xs * 2 ^ length l2 + bv_to_nat l2

goal (1 subgoal):
 1. \<And>a l1. \<forall>l2. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2 \<Longrightarrow> \<forall>l2. bitval a * 2 ^ (length l1 + length l2) + bv_to_nat l1 * 2 ^ length l2 = (bitval a * 2 ^ length l1 + bv_to_nat l1) * 2 ^ length l2
[PROOF STEP]
show "\<forall>l2::bit list. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>l2. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l2. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
fix l2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l2. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
show "bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
have "(2::nat) ^ (length xs + length l2) = 2 ^ length xs * 2 ^ length l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (length xs + length l2) = 2 ^ length xs * 2 ^ length l2
[PROOF STEP]
by (induct ("length xs")) simp_all
[PROOF STATE]
proof (state)
this:
2 ^ (length xs + length l2) = 2 ^ length xs * 2 ^ length l2

goal (1 subgoal):
 1. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
hence "bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 =
          bitval x * 2 ^ length xs * 2 ^ length l2 + bv_to_nat xs * 2 ^ length l2"
[PROOF STATE]
proof (prove)
using this:
2 ^ (length xs + length l2) = 2 ^ length xs * 2 ^ length l2

goal (1 subgoal):
 1. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = bitval x * 2 ^ length xs * 2 ^ length l2 + bv_to_nat xs * 2 ^ length l2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = bitval x * 2 ^ length xs * 2 ^ length l2 + bv_to_nat xs * 2 ^ length l2

goal (1 subgoal):
 1. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = bitval x * 2 ^ length xs * 2 ^ length l2 + bv_to_nat xs * 2 ^ length l2

goal (1 subgoal):
 1. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
have "... = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitval x * 2 ^ length xs * 2 ^ length l2 + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
by (simp add: ring_distribs)
[PROOF STATE]
proof (state)
this:
bitval x * 2 ^ length xs * 2 ^ length l2 + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2

goal (1 subgoal):
 1. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2

goal (1 subgoal):
 1. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>l2. bitval x * 2 ^ (length xs + length l2) + bv_to_nat xs * 2 ^ length l2 = (bitval x * 2 ^ length xs + bv_to_nat xs) * 2 ^ length l2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>l2. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2

goal (1 subgoal):
 1. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>l2. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2

goal (1 subgoal):
 1. bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
bv_to_nat (l1 @ l2) = bv_to_nat l1 * 2 ^ length l2 + bv_to_nat l2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_median_median [simp,intro]: "is_median (median xs) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_median (median xs) xs
[PROOF STEP]
using size_less_than_median[of xs] size_greater_than_median[of xs]
[PROOF STATE]
proof (prove)
using this:
size {#y \<in># mset xs. y < median xs#} \<le> (length xs - 1) div 2
size (filter_mset ((<) (median xs)) (mset xs)) \<le> length xs div 2

goal (1 subgoal):
 1. is_median (median xs) xs
[PROOF STEP]
unfolding is_median_def size_mset [symmetric] mset_filter
[PROOF STATE]
proof (prove)
using this:
size {#y \<in># mset xs. y < median xs#} \<le> (size (mset xs) - 1) div 2
size (filter_mset ((<) (median xs)) (mset xs)) \<le> size (mset xs) div 2

goal (1 subgoal):
 1. size {#y \<in># mset xs. y < median xs#} \<le> size (mset xs) div 2 \<and> size (filter_mset ((<) (median xs)) (mset xs)) \<le> size (mset xs) div 2
[PROOF STEP]
by linarith+


[STATEMENT]
lemma lsum_mono[simp]:
assumes "al \<le> bl"
shows "lsum f al \<le> lsum f bl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lsum f al \<le> lsum f bl
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lsum f al \<le> lsum f bl
[PROOF STEP]
obtain cl where bl: "bl = al @ cl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>cl. bl = al @ cl \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
al \<le> bl

goal (1 subgoal):
 1. (\<And>cl. bl = al @ cl \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding prefix_def less_eq_list_def
[PROOF STATE]
proof (prove)
using this:
\<exists>zs. bl = al @ zs

goal (1 subgoal):
 1. (\<And>cl. bl = al @ cl \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bl = al @ cl

goal (1 subgoal):
 1. lsum f al \<le> lsum f bl
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bl = al @ cl

goal (1 subgoal):
 1. lsum f al \<le> lsum f bl
[PROOF STEP]
unfolding bl lsum_append
[PROOF STATE]
proof (prove)
using this:
al @ cl = al @ cl

goal (1 subgoal):
 1. lsum f al \<le> lsum f al + lsum f cl
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lsum f al \<le> lsum f bl

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prm_set_distributes_union:
  shows "\<pi> {$} (S \<union> T) = (\<pi> {$} S) \<union> (\<pi> {$} T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> {$} (S \<union> T) = \<pi> {$} S \<union> \<pi> {$} T
[PROOF STEP]
unfolding prm_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) \<pi> ` (S \<union> T) = ($) \<pi> ` S \<union> ($) \<pi> ` T
[PROOF STEP]
by auto


[STATEMENT]
lemma combine_map3: assumes "length ys = length xs" "length ys' = length xs'" "length ys'' = length xs''"
  "distinct xs" "distinct xs'" "distinct xs''" "set xs \<inter> set xs' = {}" "set xs \<inter> set xs'' = {}" "set xs' \<inter> set xs'' = {}"
  shows "\<exists>f. ys = map f xs \<and> ys' = map f xs' \<and> ys'' = map f xs''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. ys = map f xs \<and> ys' = map f xs' \<and> ys'' = map f xs''
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. ys = map f xs \<and> ys' = map f xs' \<and> ys'' = map f xs''
[PROOF STEP]
obtain f g h where fgh_def: "ys = map f xs" "ys' = map g xs'" "ys'' = map h xs''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f g h. \<lbrakk>ys = map f xs; ys' = map g xs'; ys'' = map h xs''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms exists_map
[PROOF STATE]
proof (prove)
using this:
length ys = length xs
length ys' = length xs'
length ys'' = length xs''
distinct xs
distinct xs'
distinct xs''
set xs \<inter> set xs' = {}
set xs \<inter> set xs'' = {}
set xs' \<inter> set xs'' = {}
\<lbrakk>length ?xs = length ?ys; distinct ?xs\<rbrakk> \<Longrightarrow> \<exists>f. ?ys = map f ?xs

goal (1 subgoal):
 1. (\<And>f g h. \<lbrakk>ys = map f xs; ys' = map g xs'; ys'' = map h xs''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
ys = map f xs
ys' = map g xs'
ys'' = map h xs''

goal (1 subgoal):
 1. \<exists>f. ys = map f xs \<and> ys' = map f xs' \<and> ys'' = map f xs''
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. ys = map f xs \<and> ys' = map f xs' \<and> ys'' = map f xs''
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length ys = length xs
length ys' = length xs'
length ys'' = length xs''
distinct xs
distinct xs'
distinct xs''
set xs \<inter> set xs' = {}
set xs \<inter> set xs'' = {}
set xs' \<inter> set xs'' = {}

goal (1 subgoal):
 1. \<exists>f. ys = map f xs \<and> ys' = map f xs' \<and> ys'' = map f xs''
[PROOF STEP]
by (auto simp: fgh_def intro!: exI[of _ "\<lambda>x. if x \<in> set xs then f x else if x \<in> set xs' then g x else h x"])
[PROOF STATE]
proof (state)
this:
\<exists>f. ys = map f xs \<and> ys' = map f xs' \<and> ys'' = map f xs''

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_fresh_gt:
  fixes f :: \<open>'b \<Rightarrow> 'c\<close>
  assumes \<open>\<exists>g :: 'c \<Rightarrow> 'b. surj g\<close> \<open>finite A\<close> \<open>i \<notin> A\<close>
  shows \<open>\<exists>j. j \<notin> f ` A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. j \<notin> f ` A
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>j. j \<notin> f ` A \<Longrightarrow> False
[PROOF STEP]
assume \<open>\<nexists>j. j \<notin> f ` A\<close>
[PROOF STATE]
proof (state)
this:
\<nexists>j. j \<notin> f ` A

goal (1 subgoal):
 1. \<nexists>j. j \<notin> f ` A \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<nexists>j. j \<notin> f ` A

goal (1 subgoal):
 1. \<nexists>j. j \<notin> f ` A \<Longrightarrow> False
[PROOF STEP]
obtain g :: \<open>'c \<Rightarrow> 'b\<close> where \<open>surj g\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. surj g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
\<exists>g. surj g

goal (1 subgoal):
 1. (\<And>g. surj g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
surj g

goal (1 subgoal):
 1. \<nexists>j. j \<notin> f ` A \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<nexists>j. j \<notin> f ` A
surj g
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<nexists>j. j \<notin> f ` A
surj g

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(2-3)
[PROOF STATE]
proof (prove)
using this:
\<nexists>j. j \<notin> f ` A
surj g
finite A
i \<notin> A

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis UNIV_I UNIV_eq_I card_image_le card_seteq finite_imageI image_comp subsetI)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enn2ereal_of_nat[simp]: "enn2ereal (of_nat n) = ereal n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2ereal (of_nat n) = ereal (real n)
[PROOF STEP]
by (induction n) (auto simp: zero_ennreal.rep_eq one_ennreal.rep_eq plus_ennreal.rep_eq)


[STATEMENT]
lemma pderivs_lang_snoc:
  shows "pderivs_lang (PSuf s @@ {[c]}) r = (pderiv_set c (pderivs_lang (PSuf s) r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderivs_lang (PSuf s @@ {[c]}) r = pderiv_set c (pderivs_lang (PSuf s) r)
[PROOF STEP]
unfolding pderivs_lang_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>PSuf s @@ {[c]}. pderivs x r) = pderiv_set c (\<Union>x\<in>PSuf s. pderivs x r)
[PROOF STEP]
by (simp add: PSuf_Union pderivs_snoc)


[STATEMENT]
lemma eventually_nonneg_inverse [eventually_nonzero_simps]:
  "eventually_nonneg F (\<lambda>x. inverse (f x)) \<longleftrightarrow> eventually_nonneg F f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. inverse (f x)) = eventually_nonneg F f
[PROOF STEP]
unfolding eventually_nonneg_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. (0::'b) \<le> inverse (f x)) = (\<forall>\<^sub>F x in F. (0::'b) \<le> f x)
[PROOF STEP]
by (intro eventually_subst) (auto)


[STATEMENT]
lemma finite_equiv_implies_finite_carrier:
  assumes "equiv A R"
  assumes "finite (A // R)"
  assumes "\<forall>X \<in> A // R. finite X"
  shows "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
from \<open>equiv A R\<close>
[PROOF STATE]
proof (chain)
picking this:
equiv A R
[PROOF STEP]
have "A = \<Union>(A // R)"
[PROOF STATE]
proof (prove)
using this:
equiv A R

goal (1 subgoal):
 1. A = \<Union> (A // R)
[PROOF STEP]
by (simp add: Union_quotient)
[PROOF STATE]
proof (state)
this:
A = \<Union> (A // R)

goal (1 subgoal):
 1. finite A
[PROOF STEP]
from this \<open>finite (A // R)\<close> \<open>\<forall>X \<in> A // R. finite X\<close>
[PROOF STATE]
proof (chain)
picking this:
A = \<Union> (A // R)
finite (A // R)
\<forall>X\<in>A // R. finite X
[PROOF STEP]
show "finite A"
[PROOF STATE]
proof (prove)
using this:
A = \<Union> (A // R)
finite (A // R)
\<forall>X\<in>A // R. finite X

goal (1 subgoal):
 1. finite A
[PROOF STEP]
using finite_Union
[PROOF STATE]
proof (prove)
using this:
A = \<Union> (A // R)
finite (A // R)
\<forall>X\<in>A // R. finite X
\<lbrakk>finite ?A; \<And>M. M \<in> ?A \<Longrightarrow> finite M\<rbrakk> \<Longrightarrow> finite (\<Union> ?A)

goal (1 subgoal):
 1. finite A
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
finite A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closedin_Int[intro]: "closedin U S \<Longrightarrow> closedin U T \<Longrightarrow> closedin U (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closedin U S; closedin U T\<rbrakk> \<Longrightarrow> closedin U (S \<inter> T)
[PROOF STEP]
using closedin_Inter[of "{S,T}" U]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{S, T} \<noteq> {}; \<And>Sa. Sa \<in> {S, T} \<Longrightarrow> closedin U Sa\<rbrakk> \<Longrightarrow> closedin U (\<Inter> {S, T})

goal (1 subgoal):
 1. \<lbrakk>closedin U S; closedin U T\<rbrakk> \<Longrightarrow> closedin U (S \<inter> T)
[PROOF STEP]
by auto


[STATEMENT]
lemma map_poly_pCons_hom[hom_distribs]: "map_poly hom (pCons a p) = pCons (hom a) (map_poly hom p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly hom (pCons a p) = pCons (hom a) (map_poly hom p)
[PROOF STEP]
unfolding map_poly_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a = (0::'a) \<and> p = 0 then 0 else pCons (hom a) (map_poly hom p)) = pCons (hom a) (map_poly hom p)
[PROOF STEP]
by auto


[STATEMENT]
lemma graph_homo_inv[intro!]:
  assumes "graph G" "inj_on f (vertices G)"
  shows "graph_homomorphism (map_graph_fn G f) G (converse (on_graph G f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph_homomorphism (map_graph_fn G f) G ((on_graph G f)\<inverse>)
[PROOF STEP]
proof(rule graph_homomorphismI)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. vertices (map_graph_fn G f) = Domain ((on_graph G f)\<inverse>)
 2. (on_graph G f)\<inverse> `` vertices (map_graph_fn G f) \<subseteq> vertices G
 3. univalent ((on_graph G f)\<inverse>)
 4. edge_preserving ((on_graph G f)\<inverse>) (edges (map_graph_fn G f)) (edges G)
 5. graph (map_graph_fn G f)
 6. graph G
[PROOF STEP]
show "univalent ((on_graph G f)\<inverse>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univalent ((on_graph G f)\<inverse>)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
inj_on f (vertices G)

goal (1 subgoal):
 1. univalent ((on_graph G f)\<inverse>)
[PROOF STEP]
unfolding univalent_def BNF_Def.Gr_def inj_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>vertices G. \<forall>y\<in>vertices G. f x = f y \<longrightarrow> x = y

goal (1 subgoal):
 1. \<forall>x y z. (x, y) \<in> {(a, f a) |a. a \<in> vertices G}\<inverse> \<and> (x, z) \<in> {(a, f a) |a. a \<in> vertices G}\<inverse> \<longrightarrow> z = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
univalent ((on_graph G f)\<inverse>)

goal (5 subgoals):
 1. vertices (map_graph_fn G f) = Domain ((on_graph G f)\<inverse>)
 2. (on_graph G f)\<inverse> `` vertices (map_graph_fn G f) \<subseteq> vertices G
 3. edge_preserving ((on_graph G f)\<inverse>) (edges (map_graph_fn G f)) (edges G)
 4. graph (map_graph_fn G f)
 5. graph G
[PROOF STEP]
show "edge_preserving ((on_graph G f)\<inverse>) (edges (map_graph_fn G f)) (edges G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge_preserving ((on_graph G f)\<inverse>) (edges (map_graph_fn G f)) (edges G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
graph G
inj_on f (vertices G)

goal (1 subgoal):
 1. edge_preserving ((on_graph G f)\<inverse>) (edges (map_graph_fn G f)) (edges G)
[PROOF STEP]
unfolding edge_preserving inj_on_def
[PROOF STATE]
proof (prove)
using this:
graph G
\<forall>x\<in>vertices G. \<forall>y\<in>vertices G. f x = f y \<longrightarrow> x = y

goal (1 subgoal):
 1. on_triple ((on_graph G f)\<inverse>) `` edges (map_graph_fn G f) \<subseteq> edges G
[PROOF STEP]
by auto auto
[PROOF STATE]
proof (state)
this:
edge_preserving ((on_graph G f)\<inverse>) (edges (map_graph_fn G f)) (edges G)

goal (4 subgoals):
 1. vertices (map_graph_fn G f) = Domain ((on_graph G f)\<inverse>)
 2. (on_graph G f)\<inverse> `` vertices (map_graph_fn G f) \<subseteq> vertices G
 3. graph (map_graph_fn G f)
 4. graph G
[PROOF STEP]
qed (insert assms(1),auto)


[STATEMENT]
lemma bifunctor_proj_fst_is_functor'[cat_cs_intros]:
  assumes "\<SS> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \
" and "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>" and "\<AA>' = \<AA>"
  shows "\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \
"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
\<SS> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

[PROOF STEP]
unfolding assms(3)
[PROOF STATE]
proof (prove)
using this:
\<SS> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

[PROOF STEP]
by (rule bifunctor_proj_fst_is_functor)


[STATEMENT]
lemma rtrancl_path_Range: "\<lbrakk> rtrancl_path R x xs y; z \<in> set xs \<rbrakk> \<Longrightarrow> Rangep R z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rtrancl_path R x xs y; z \<in> set xs\<rbrakk> \<Longrightarrow> Rangep R z
[PROOF STEP]
by(induction rule: rtrancl_path.induct) auto


[STATEMENT]
lemma prefix_conc_snd[simp]:
  assumes "n \<ge> length u"
  shows "prefix n (u \<frown> v) = u @ prefix (n - length u) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix n (u \<frown> v) = u @ prefix (n - length u) v
[PROOF STEP]
proof (intro nth_equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (prefix n (u \<frown> v)) = length (u @ prefix (n - length u) v)
 2. \<And>i. i < length (prefix n (u \<frown> v)) \<Longrightarrow> prefix n (u \<frown> v) ! i = (u @ prefix (n - length u) v) ! i
[PROOF STEP]
show "length (prefix n (u \<frown> v)) = length (u @ prefix (n - length u) v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (prefix n (u \<frown> v)) = length (u @ prefix (n - length u) v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length u \<le> n

goal (1 subgoal):
 1. length (prefix n (u \<frown> v)) = length (u @ prefix (n - length u) v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (prefix n (u \<frown> v)) = length (u @ prefix (n - length u) v)

goal (1 subgoal):
 1. \<And>i. i < length (prefix n (u \<frown> v)) \<Longrightarrow> prefix n (u \<frown> v) ! i = (u @ prefix (n - length u) v) ! i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (prefix n (u \<frown> v)) \<Longrightarrow> prefix n (u \<frown> v) ! i = (u @ prefix (n - length u) v) ! i
[PROOF STEP]
assume "i < length (prefix n (u \<frown> v))"
[PROOF STATE]
proof (state)
this:
i < length (prefix n (u \<frown> v))

goal (1 subgoal):
 1. \<And>i. i < length (prefix n (u \<frown> v)) \<Longrightarrow> prefix n (u \<frown> v) ! i = (u @ prefix (n - length u) v) ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length (prefix n (u \<frown> v))
[PROOF STEP]
show "prefix n (u \<frown> v) ! i = (u @ prefix (n - length u) v) ! i"
[PROOF STATE]
proof (prove)
using this:
i < length (prefix n (u \<frown> v))

goal (1 subgoal):
 1. prefix n (u \<frown> v) ! i = (u @ prefix (n - length u) v) ! i
[PROOF STEP]
by (cases "i < length u") (auto simp: nth_append)
[PROOF STATE]
proof (state)
this:
prefix n (u \<frown> v) ! i = (u @ prefix (n - length u) v) ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma carry_bounded: "bin_carry a b k \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_carry a b k \<le> 1
[PROOF STEP]
using bin_carry_bounded not_mod_2_eq_1_eq_0[of "bin_carry a b k"]
[PROOF STATE]
proof (prove)
using this:
bin_carry ?a ?b ?k = bin_carry ?a ?b ?k mod 2
(bin_carry a b k mod 2 \<noteq> 1) = (bin_carry a b k mod 2 = 0)

goal (1 subgoal):
 1. bin_carry a b k \<le> 1
[PROOF STEP]
by auto


[STATEMENT]
lemma p_strict_mono: "x < y \<Longrightarrow> y \<le> t_stop \<Longrightarrow> p x < p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < y; y \<le> t_stop\<rbrakk> \<Longrightarrow> p x < p y
[PROOF STEP]
using decel
[PROOF STATE]
proof (prove)
using this:
a < 0

goal (1 subgoal):
 1. \<lbrakk>x < y; y \<le> t_stop\<rbrakk> \<Longrightarrow> p x < p y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x < y; y \<le> t_stop; a < 0\<rbrakk> \<Longrightarrow> p x < p y
[PROOF STEP]
assume "x < y" and "y \<le> t_stop" and "a < 0"
[PROOF STATE]
proof (state)
this:
x < y
y \<le> t_stop
a < 0

goal (1 subgoal):
 1. \<lbrakk>x < y; y \<le> t_stop; a < 0\<rbrakk> \<Longrightarrow> p x < p y
[PROOF STEP]
hence "x + y < - 2 * v / a"
[PROOF STATE]
proof (prove)
using this:
x < y
y \<le> t_stop
a < 0

goal (1 subgoal):
 1. x + y < - 2 * v / a
[PROOF STEP]
unfolding t_stop_def
[PROOF STATE]
proof (prove)
using this:
x < y
y \<le> - v / a
a < 0

goal (1 subgoal):
 1. x + y < - 2 * v / a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x + y < - 2 * v / a

goal (1 subgoal):
 1. \<lbrakk>x < y; y \<le> t_stop; a < 0\<rbrakk> \<Longrightarrow> p x < p y
[PROOF STEP]
hence "-1 / 2 * a * (x + y) < v" (is "?lhs0 < ?rhs0")
[PROOF STATE]
proof (prove)
using this:
x + y < - 2 * v / a

goal (1 subgoal):
 1. - 1 / 2 * a * (x + y) < v
[PROOF STEP]
using \<open>a < 0\<close>
[PROOF STATE]
proof (prove)
using this:
x + y < - 2 * v / a
a < 0

goal (1 subgoal):
 1. - 1 / 2 * a * (x + y) < v
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
- 1 / 2 * a * (x + y) < v

goal (1 subgoal):
 1. \<lbrakk>x < y; y \<le> t_stop; a < 0\<rbrakk> \<Longrightarrow> p x < p y
[PROOF STEP]
hence "?lhs0 * (x- y) > ?rhs0 * (x - y)"
[PROOF STATE]
proof (prove)
using this:
- 1 / 2 * a * (x + y) < v

goal (1 subgoal):
 1. v * (x - y) < - 1 / 2 * a * (x + y) * (x - y)
[PROOF STEP]
using \<open>x < y\<close>
[PROOF STATE]
proof (prove)
using this:
- 1 / 2 * a * (x + y) < v
x < y

goal (1 subgoal):
 1. v * (x - y) < - 1 / 2 * a * (x + y) * (x - y)
[PROOF STEP]
by sos
[PROOF STATE]
proof (state)
this:
v * (x - y) < - 1 / 2 * a * (x + y) * (x - y)

goal (1 subgoal):
 1. \<lbrakk>x < y; y \<le> t_stop; a < 0\<rbrakk> \<Longrightarrow> p x < p y
[PROOF STEP]
hence "v * x + 1 / 2 * a * x\<^sup>2 < v * y + 1 / 2 * a * y\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
v * (x - y) < - 1 / 2 * a * (x + y) * (x - y)

goal (1 subgoal):
 1. v * x + 1 / 2 * a * x\<^sup>2 < v * y + 1 / 2 * a * y\<^sup>2
[PROOF STEP]
by (auto simp add: field_simps power_def)
[PROOF STATE]
proof (state)
this:
v * x + 1 / 2 * a * x\<^sup>2 < v * y + 1 / 2 * a * y\<^sup>2

goal (1 subgoal):
 1. \<lbrakk>x < y; y \<le> t_stop; a < 0\<rbrakk> \<Longrightarrow> p x < p y
[PROOF STEP]
thus " p x < p y"
[PROOF STATE]
proof (prove)
using this:
v * x + 1 / 2 * a * x\<^sup>2 < v * y + 1 / 2 * a * y\<^sup>2

goal (1 subgoal):
 1. p x < p y
[PROOF STEP]
unfolding p_max_def p_def t_stop_def
[PROOF STATE]
proof (prove)
using this:
v * x + 1 / 2 * a * x\<^sup>2 < v * y + 1 / 2 * a * y\<^sup>2

goal (1 subgoal):
 1. s0 + v * x + 1 / 2 * a * x\<^sup>2 < s0 + v * y + 1 / 2 * a * y\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p x < p y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma digit_gen_sum_repr:
  assumes "n < b^c" and "b>1"
  shows "n = (\<Sum>k < c.((nth_digit n k b) * b^k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
have 1: "(c\<le>k \<longrightarrow> n<b^k)" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<le> k \<longrightarrow> n < b ^ k
[PROOF STEP]
using assms less_le_trans
[PROOF STATE]
proof (prove)
using this:
n < b ^ c
1 < b
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. c \<le> k \<longrightarrow> n < b ^ k
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
c \<le> ?k \<longrightarrow> n < b ^ ?k

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
hence nik: "c\<le>k \<longrightarrow> (nth_digit n k b = 0)" for k
[PROOF STATE]
proof (prove)
using this:
c \<le> ?k \<longrightarrow> n < b ^ ?k

goal (1 subgoal):
 1. c \<le> k \<longrightarrow> nth_digit n k b = 0
[PROOF STEP]
by (auto simp add: nth_digit_def)
[PROOF STATE]
proof (state)
this:
c \<le> ?k \<longrightarrow> nth_digit n ?k b = 0

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
have "(\<Sum>r<c.((nth_digit n r b)*b^r))<b^c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c
[PROOF STEP]
apply(induct c, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. (\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c \<Longrightarrow> (\<Sum>r<c. nth_digit n r b * b ^ r) + nth_digit n c b * b ^ c < b * b ^ c
[PROOF STEP]
subgoal for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c \<Longrightarrow> (\<Sum>r<c. nth_digit n r b * b ^ r) + nth_digit n c b * b ^ c < b * b ^ c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c \<Longrightarrow> (\<Sum>r<c. nth_digit n r b * b ^ r) + nth_digit n c b * b ^ c < b * b ^ c
[PROOF STEP]
assume IH: "(\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c"
[PROOF STATE]
proof (state)
this:
(\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c

goal (1 subgoal):
 1. (\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c \<Longrightarrow> (\<Sum>r<c. nth_digit n r b * b ^ r) + nth_digit n c b * b ^ c < b * b ^ c
[PROOF STEP]
have bound: "(nth_digit n c b) * b ^ c \<le> (b-1) * b^c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_digit n c b * b ^ c \<le> (b - 1) * b ^ c
[PROOF STEP]
using nth_digit_bounded \<open>b>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < ?b \<Longrightarrow> nth_digit ?a ?k ?b \<le> ?b - 1
1 < b

goal (1 subgoal):
 1. nth_digit n c b * b ^ c \<le> (b - 1) * b ^ c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nth_digit n c b * b ^ c \<le> (b - 1) * b ^ c

goal (1 subgoal):
 1. (\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c \<Longrightarrow> (\<Sum>r<c. nth_digit n r b * b ^ r) + nth_digit n c b * b ^ c < b * b ^ c
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
nth_digit n c b * b ^ c \<le> (b - 1) * b ^ c

goal (1 subgoal):
 1. (\<Sum>r<c. nth_digit n r b * b ^ r) + nth_digit n c b * b ^ c < b * b ^ c
[PROOF STEP]
using assms IH
[PROOF STATE]
proof (prove)
using this:
nth_digit n c b * b ^ c \<le> (b - 1) * b ^ c
n < b ^ c
1 < b
(\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c

goal (1 subgoal):
 1. (\<Sum>r<c. nth_digit n r b * b ^ r) + nth_digit n c b * b ^ c < b * b ^ c
[PROOF STEP]
by (metis (no_types, lifting) bound add_mono_thms_linordered_field(1)
            add_mono_thms_linordered_field(5) le_less mult_eq_if not_one_le_zero)
[PROOF STATE]
proof (state)
this:
(\<Sum>r<c. nth_digit n r b * b ^ r) + nth_digit n c b * b ^ c < b * b ^ c

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
hence "k\<ge>c \<longrightarrow> nth_digit (\<Sum>r<c.((nth_digit n r b)*b^r)) k b = 0" for k
[PROOF STATE]
proof (prove)
using this:
(\<Sum>r<c. nth_digit n r b * b ^ r) < b ^ c

goal (1 subgoal):
 1. c \<le> k \<longrightarrow> nth_digit (\<Sum>r<c. nth_digit n r b * b ^ r) k b = 0
[PROOF STEP]
apply(auto simp add: nth_digit_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<Sum>r<c. n div b ^ r mod b * b ^ r) < b ^ c; c \<le> k\<rbrakk> \<Longrightarrow> (\<Sum>r<c. n div b ^ r mod b * b ^ r) div b ^ k mod b = 0
[PROOF STEP]
using less_le_trans assms(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z
1 < b

goal (1 subgoal):
 1. \<lbrakk>(\<Sum>r<c. n div b ^ r mod b * b ^ r) < b ^ c; c \<le> k\<rbrakk> \<Longrightarrow> (\<Sum>r<c. n div b ^ r mod b * b ^ r) div b ^ k mod b = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
c \<le> ?k \<longrightarrow> nth_digit (\<Sum>r<c. nth_digit n r b * b ^ r) ?k b = 0

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
hence "\<forall>r\<ge>c.(nth_digit n r b
    = nth_digit (\<Sum>k<c.((nth_digit n k b)*b^k)) r b)"
[PROOF STATE]
proof (prove)
using this:
c \<le> ?k \<longrightarrow> nth_digit (\<Sum>r<c. nth_digit n r b * b ^ r) ?k b = 0

goal (1 subgoal):
 1. \<forall>r\<ge>c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b
[PROOF STEP]
by (simp add: nik)
[PROOF STATE]
proof (state)
this:
\<forall>r\<ge>c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>r\<ge>c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
have "\<forall>r<c.(nth_digit n r b
               = nth_digit (\<Sum>k<c.((nth_digit n k b) * b^k)) r b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r<c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b
[PROOF STEP]
using aux1_digit_gen_sum_repr assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?n < ?b ^ ?c; ?r < ?c; 1 < ?b\<rbrakk> \<Longrightarrow> nth_digit (\<Sum>k<?c. nth_digit ?n k ?b * ?b ^ k) ?r ?b = nth_digit ?n ?r ?b
n < b ^ c
1 < b

goal (1 subgoal):
 1. \<forall>r<c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>r<c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>r\<ge>c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b
\<forall>r<c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b
[PROOF STEP]
have "\<forall>r. nth_digit (\<Sum>k<c.((nth_digit n k b)*b^k)) r b
                    = nth_digit n r b"
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<ge>c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b
\<forall>r<c. nth_digit n r b = nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b

goal (1 subgoal):
 1. \<forall>r. nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b = nth_digit n r b
[PROOF STEP]
by (metis not_less)
[PROOF STATE]
proof (state)
this:
\<forall>r. nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b = nth_digit n r b

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>r. nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b = nth_digit n r b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>r. nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b = nth_digit n r b

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
using digit_wise_gen_equiv[of "b" "(\<Sum>k<c. nth_digit n k b * b ^ k)" "n"] \<open>b>1\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>r. nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) r b = nth_digit n r b
1 < b \<Longrightarrow> ((\<Sum>k<c. nth_digit n k b * b ^ k) = n) = (\<forall>k. nth_digit (\<Sum>k<c. nth_digit n k b * b ^ k) k b = nth_digit n k b)
1 < b

goal (1 subgoal):
 1. n = (\<Sum>k<c. nth_digit n k b * b ^ k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = (\<Sum>k<c. nth_digit n k b * b ^ k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prv_eqv_trans:
assumes "\<phi> \<in> fmla" and "\<chi> \<in> fmla" and "\<psi> \<in> fmla"
shows "prv (eqv \<phi> \<chi>) \<Longrightarrow> prv (eqv \<chi> \<psi>) \<Longrightarrow> prv (eqv \<phi> \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prv (eqv \<phi> \<chi>); prv (eqv \<chi> \<psi>)\<rbrakk> \<Longrightarrow> prv (eqv \<phi> \<psi>)
[PROOF STEP]
using assms prv_cnjI prv_cnj_imp_monoR2 prv_imp_mp prv_imp_trans1 prv_imp_imp_triv eqv_def
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> fmla
\<chi> \<in> fmla
\<psi> \<in> fmla
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla; prv ?\<phi>; prv ?\<chi>\<rbrakk> \<Longrightarrow> prv (cnj ?\<phi> ?\<chi>)
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla; ?\<psi> \<in> fmla; prv (imp ?\<phi> (imp ?\<chi> ?\<psi>))\<rbrakk> \<Longrightarrow> prv (imp (cnj ?\<phi> ?\<chi>) ?\<psi>)
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla; prv (imp ?\<phi> ?\<chi>); prv ?\<phi>\<rbrakk> \<Longrightarrow> prv ?\<chi>
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla; ?\<psi> \<in> fmla\<rbrakk> \<Longrightarrow> prv (imp (imp ?\<chi> ?\<psi>) (imp (imp ?\<phi> ?\<chi>) (imp ?\<phi> ?\<psi>)))
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla\<rbrakk> \<Longrightarrow> prv (imp ?\<phi> (imp ?\<chi> ?\<phi>))
eqv ?\<phi> ?\<chi> = cnj (imp ?\<phi> ?\<chi>) (imp ?\<chi> ?\<phi>)

goal (1 subgoal):
 1. \<lbrakk>prv (eqv \<phi> \<chi>); prv (eqv \<chi> \<psi>)\<rbrakk> \<Longrightarrow> prv (eqv \<phi> \<psi>)
[PROOF STEP]
by (metis prv_prv_imp_trans prv_imp_cnjL prv_imp_cnjR eqv imp)


[STATEMENT]
lemma finite_ran:
  assumes "finite (dom p)"
  shows "finite (ran p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (ran p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (ran p)
[PROOF STEP]
have "ran p = (\<lambda>x. the (p x)) ` dom p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ran p = (\<lambda>x. the (p x)) ` dom p
[PROOF STEP]
unfolding ran_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. \<exists>a. p a = Some b} = (\<lambda>x. the (p x)) ` dom p
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
ran p = (\<lambda>x. the (p x)) ` dom p

goal (1 subgoal):
 1. finite (ran p)
[PROOF STEP]
from this \<open>finite (dom p)\<close>
[PROOF STATE]
proof (chain)
picking this:
ran p = (\<lambda>x. the (p x)) ` dom p
finite (dom p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ran p = (\<lambda>x. the (p x)) ` dom p
finite (dom p)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma renumber:
 "\<forall>i. (a,f i) \<in> r\<^sup>* \<and> (f i,f(Suc i)) \<in> r
 \<Longrightarrow> \<exists>f. f 0 = a \<and> (\<forall>i. (f i, f(Suc i)) \<in> r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. (a, f i) \<in> r\<^sup>* \<and> (f i, f (Suc i)) \<in> r \<Longrightarrow> \<exists>f. f 0 = a \<and> (\<forall>i. (f i, f (Suc i)) \<in> r)
[PROOF STEP]
by(blast dest:renumber')


[STATEMENT]
lemma open_ball [intro, simp]: "open (ball x e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (ball x e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open (ball x e)
[PROOF STEP]
have "open (dist x -` {..<e})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (dist x -` {..<e})
[PROOF STEP]
by (intro open_vimage open_lessThan continuous_intros)
[PROOF STATE]
proof (state)
this:
open (dist x -` {..<e})

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma float_neg_add:
  "is_finite a \<Longrightarrow> is_finite b \<Longrightarrow> is_finite (a - b) \<Longrightarrow> valof a + valof (- b) = valof a - valof b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_finite a; is_finite b; is_finite (a - b)\<rbrakk> \<Longrightarrow> valof a + valof (- b) = valof a - valof b
[PROOF STEP]
by (simp add: valof_uminus)


[STATEMENT]
lemma obtain_function:
  assumes "finite A"
  assumes "size M = card A"
  shows "\<exists>f. image_mset f (mset_set A) = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. image_mset f (mset_set A) = M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
size M = card A

goal (1 subgoal):
 1. \<exists>f. image_mset f (mset_set A) = M
[PROOF STEP]
proof (induct arbitrary: M rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>M. size M = card {} \<Longrightarrow> \<exists>f. image_mset f (mset_set {}) = M
 2. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
size M = card {}

goal (2 subgoals):
 1. \<And>M. size M = card {} \<Longrightarrow> \<exists>f. image_mset f (mset_set {}) = M
 2. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
size M = card {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
size M = card {}

goal (1 subgoal):
 1. \<exists>f. image_mset f (mset_set {}) = M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>f. image_mset f (mset_set {}) = M

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
size ?M = card A \<Longrightarrow> \<exists>f. image_mset f (mset_set A) = ?M
size M = card (insert x A)

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from insert(1,2,4)
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
size M = card (insert x A)
[PROOF STEP]
have "size M > 0"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
size M = card (insert x A)

goal (1 subgoal):
 1. 0 < size M
[PROOF STEP]
by (simp add: card_gt_0_iff)
[PROOF STATE]
proof (state)
this:
0 < size M

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
0 < size M
[PROOF STEP]
obtain y where "y \<in># M"
[PROOF STATE]
proof (prove)
using this:
0 < size M

goal (1 subgoal):
 1. (\<And>y. y \<in># M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using gr0_implies_Suc size_eq_Suc_imp_elem
[PROOF STATE]
proof (prove)
using this:
0 < size M
0 < ?n \<Longrightarrow> \<exists>m. ?n = Suc m
size ?M = Suc ?n \<Longrightarrow> \<exists>a. a \<in># ?M

goal (1 subgoal):
 1. (\<And>y. y \<in># M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in># M

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from insert(1,2,4) this
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
size M = card (insert x A)
y \<in># M
[PROOF STEP]
have "size (M - {#y#}) = card A"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
size M = card (insert x A)
y \<in># M

goal (1 subgoal):
 1. size (M - {#y#}) = card A
[PROOF STEP]
by (simp add: Diff_insert_absorb card_Diff_singleton_if insertI1 size_Diff_submset)
[PROOF STATE]
proof (state)
this:
size (M - {#y#}) = card A

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from insert.hyps this
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
size ?M = card A \<Longrightarrow> \<exists>f. image_mset f (mset_set A) = ?M
size (M - {#y#}) = card A
[PROOF STEP]
obtain f' where "image_mset f' (mset_set A) = M - {#y#}"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
size ?M = card A \<Longrightarrow> \<exists>f. image_mset f (mset_set A) = ?M
size (M - {#y#}) = card A

goal (1 subgoal):
 1. (\<And>f'. image_mset f' (mset_set A) = M - {#y#} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
image_mset f' (mset_set A) = M - {#y#}

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
image_mset f' (mset_set A) = M - {#y#}
[PROOF STEP]
have "image_mset (f'(x := y)) (mset_set (insert x A)) = M"
[PROOF STATE]
proof (prove)
using this:
image_mset f' (mset_set A) = M - {#y#}

goal (1 subgoal):
 1. image_mset (f'(x := y)) (mset_set (insert x A)) = M
[PROOF STEP]
using \<open>finite A\<close> \<open>x \<notin> A\<close> \<open>y \<in># M\<close>
[PROOF STATE]
proof (prove)
using this:
image_mset f' (mset_set A) = M - {#y#}
finite A
x \<notin> A
y \<in># M

goal (1 subgoal):
 1. image_mset (f'(x := y)) (mset_set (insert x A)) = M
[PROOF STEP]
by (simp add: image_mset_fun_upd)
[PROOF STATE]
proof (state)
this:
image_mset (f'(x := y)) (mset_set (insert x A)) = M

goal (1 subgoal):
 1. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. size M = card F \<Longrightarrow> \<exists>f. image_mset f (mset_set F) = M; size M = card (insert x F)\<rbrakk> \<Longrightarrow> \<exists>f. image_mset f (mset_set (insert x F)) = M
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
image_mset (f'(x := y)) (mset_set (insert x A)) = M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
image_mset (f'(x := y)) (mset_set (insert x A)) = M

goal (1 subgoal):
 1. \<exists>f. image_mset f (mset_set (insert x A)) = M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f. image_mset f (mset_set (insert x A)) = M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma io_targets_observable_singleton_ex :
  assumes "observable M"
  and     "io \<in> LS M q1"
shows "\<exists> q2 . io_targets M q1 io = { q2 }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
obtain tr where tr_def : "{ t . path M (io || t) q1 \<and> length io = length t } = { tr }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>tr. {t. path M (io || t) q1 \<and> length io = length t} = {tr} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms observable_path_unique_ex
[PROOF STATE]
proof (prove)
using this:
observable M
io \<in> LS M q1
\<lbrakk>observable ?M; ?io \<in> LS ?M ?q; \<And>tr. {t. path ?M (?io || t) ?q \<and> length ?io = length t} = {tr} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>tr. {t. path M (io || t) q1 \<and> length io = length t} = {tr} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (mono_tags, lifting))
[PROOF STATE]
proof (state)
this:
{t. path M (io || t) q1 \<and> length io = length t} = {tr}

goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{t. path M (io || t) q1 \<and> length io = length t} = {tr}
[PROOF STEP]
have "io_targets M q1 io = { target (io || tr) q1 }"
[PROOF STATE]
proof (prove)
using this:
{t. path M (io || t) q1 \<and> length io = length t} = {tr}

goal (1 subgoal):
 1. io_targets M q1 io = {target (io || tr) q1}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
io_targets M q1 io = {target (io || tr) q1}

goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
io_targets M q1 io = {target (io || tr) q1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
io_targets M q1 io = {target (io || tr) q1}

goal (1 subgoal):
 1. \<exists>q2. io_targets M q1 io = {q2}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>q2. io_targets M q1 io = {q2}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nlt0_iff[simp]:
  assumes nx: "isnormNum x"
  shows "((INum x :: 'a::{field_char_0,linordered_field}) < 0) = 0>\<^sub>N x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
obtain a b where x: "x = (a, b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. x = (a, b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases x)
[PROOF STATE]
proof (state)
this:
x = (a, b)

goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
 2. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
 2. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0

goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
by (simp add: x Nlt0_def INum_def)
[PROOF STATE]
proof (state)
this:
(INum x < (0::'a)) = 0>\<^sub>N x

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
[PROOF STEP]
have b: "(of_int b::'a) > 0"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (0::'a) < of_int b
[PROOF STEP]
using nx
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
isnormNum x

goal (1 subgoal):
 1. (0::'a) < of_int b
[PROOF STEP]
by (simp add: x isnormNum_def)
[PROOF STATE]
proof (state)
this:
(0::'a) < of_int b

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
from pos_divide_less_eq[OF b, where b="of_int a" and a="0::'a"]
[PROOF STATE]
proof (chain)
picking this:
(of_int a / of_int b < (0::'a)) = (of_int a < (0::'a) * of_int b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(of_int a / of_int b < (0::'a)) = (of_int a < (0::'a) * of_int b)

goal (1 subgoal):
 1. (INum x < (0::'a)) = 0>\<^sub>N x
[PROOF STEP]
by (simp add: x Nlt0_def INum_def)
[PROOF STATE]
proof (state)
this:
(INum x < (0::'a)) = 0>\<^sub>N x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(INum x < (0::'a)) = 0>\<^sub>N x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mkArr_restrict_eq:
    assumes "arr (mkArr A B F)"
    shows "mkArr A B (restrict F A) = mkArr A B F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mkArr A B (restrict F A) = mkArr A B F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
arr (mkArr A B F)

goal (1 subgoal):
 1. mkArr A B (restrict F A) = mkArr A B F
[PROOF STEP]
by (intro mkArr_eqI', auto)


[STATEMENT]
lemma (in group) inv_closed [intro, simp]:
  "x \<in> carrier G ==> inv x \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> inv x \<in> carrier G
[PROOF STEP]
using Units_inv_closed
[PROOF STATE]
proof (prove)
using this:
?x \<in> Units G \<Longrightarrow> inv ?x \<in> carrier G

goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> inv x \<in> carrier G
[PROOF STEP]
by simp


[STATEMENT]
lemma interval_lebesgue_integral_by_parts:
  assumes "a \<le> b"
  assumes cont_f[intro]: "continuous_on {a..b} f"
  assumes cont_g[intro]: "continuous_on {a..b} g"
  assumes [intro]: "\<And>x. x \<in> {a..b} \<Longrightarrow> (F has_field_derivative f x) (at x within {a..b})"
  assumes [intro]: "\<And>x. x \<in> {a..b} \<Longrightarrow> (G has_field_derivative g x) (at x within {a..b})"
  shows "(LBINT x=a..b. F x * g x) = F b * G b - F a * G a - (LBINT x=a..b. f x * G x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x=ereal a..ereal b. F x * g x = F b * G b - F a * G a - (LBINT x=ereal a..ereal b. f x * G x)
[PROOF STEP]
using integral_by_parts[of a b f g F G] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> b; continuous_on {a..b} f; continuous_on {a..b} g; \<And>x. x \<in> {a..b} \<Longrightarrow> (F has_real_derivative f x) (at x within {a..b}); \<And>x. x \<in> {a..b} \<Longrightarrow> (G has_real_derivative g x) (at x within {a..b})\<rbrakk> \<Longrightarrow> LBINT x. F x * g x * indicat_real {a..b} x = F b * G b - F a * G a - (LBINT x. f x * G x * indicat_real {a..b} x)
a \<le> b
continuous_on {a..b} f
continuous_on {a..b} g
?x \<in> {a..b} \<Longrightarrow> (F has_real_derivative f ?x) (at ?x within {a..b})
?x \<in> {a..b} \<Longrightarrow> (G has_real_derivative g ?x) (at ?x within {a..b})

goal (1 subgoal):
 1. LBINT x=ereal a..ereal b. F x * g x = F b * G b - F a * G a - (LBINT x=ereal a..ereal b. f x * G x)
[PROOF STEP]
by (simp add: interval_integral_Icc set_lebesgue_integral_def mult_ac)


[STATEMENT]
lemma sum_pos':
  assumes "finite I"
  assumes "\<exists>x\<in>I. f x > (0 :: _ :: linordered_ab_group_add)"
  assumes "\<And>x. x \<in> I \<Longrightarrow> f x \<ge> 0"
  shows   "sum f I > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>I. (0::'b) < f x
[PROOF STEP]
guess x
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>I. (0::'b) < f x

goal (1 subgoal):
 1. thesis
goal instantiation:
PROP ?guess \<leadsto> thesis
[PROOF STEP]
by (elim bexE)
[PROOF STATE]
proof (state)
this:
x \<in> I
(0::'b) < f x

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
note x = this
[PROOF STATE]
proof (state)
this:
x \<in> I
(0::'b) < f x

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> I
(0::'b) < f x
[PROOF STEP]
have "I = insert x I"
[PROOF STATE]
proof (prove)
using this:
x \<in> I
(0::'b) < f x

goal (1 subgoal):
 1. I = insert x I
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
I = insert x I

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
I = insert x I

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
finite I
[PROOF STEP]
have "sum f ... = f x + sum f (I - {x})"
[PROOF STATE]
proof (prove)
using this:
finite I

goal (1 subgoal):
 1. sum f (insert x I) = f x + sum f (I - {x})
[PROOF STEP]
by (rule sum.insert_remove)
[PROOF STATE]
proof (state)
this:
sum f (insert x I) = f x + sum f (I - {x})

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f (insert x I) = f x + sum f (I - {x})

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
from x assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> I
(0::'b) < f x
finite I
\<exists>x\<in>I. (0::'b) < f x
?x \<in> I \<Longrightarrow> (0::'b) \<le> f ?x
[PROOF STEP]
have "... > 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> I
(0::'b) < f x
finite I
\<exists>x\<in>I. (0::'b) < f x
?x \<in> I \<Longrightarrow> (0::'b) \<le> f ?x

goal (1 subgoal):
 1. (0::'b) < f x + sum f (I - {x})
[PROOF STEP]
by (intro add_pos_nonneg sum_nonneg) simp_all
[PROOF STATE]
proof (state)
this:
(0::'b) < f x + sum f (I - {x})

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'b) < sum f I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'b) < sum f I

goal (1 subgoal):
 1. (0::'b) < sum f I
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'b) < sum f I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "eq Even_Zero (Even_Succ (Odd_Succ Even_Zero)) \<longleftrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq Even_Zero (Even_Succ (Odd_Succ Even_Zero)) = False
[PROOF STEP]
by eval


[STATEMENT]
lemma mult_le_cancel2_hmset[simp]: "m * k \<le> n * k \<longleftrightarrow> (0 < k \<longrightarrow> m \<le> n)" for k m n :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m * k \<le> n * k) = (0 < k \<longrightarrow> m \<le> n)
[PROOF STEP]
by (simp add: linorder_not_less[symmetric], auto)


[STATEMENT]
lemma eqs_union[simp]: "eqs x (X \<union> Y) = eqs x X \<union> eqs x Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqs x (X \<union> Y) = eqs x X \<union> eqs x Y
[PROOF STEP]
by (auto simp: eqs_def)


[STATEMENT]
lemma pow_res_classes_semialg:
  assumes "S \<in> pow_res_classes n"
  shows "is_semialgebraic 1 (to_R1` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic 1 ((\<lambda>a. [a]) ` S)
[PROOF STEP]
using pow_res_classes_univ_semialg
    assms(1)  is_univ_semialgebraicE
[PROOF STATE]
proof (prove)
using this:
?S \<in> pow_res_classes ?n \<Longrightarrow> is_univ_semialgebraic ?S
S \<in> pow_res_classes n
is_univ_semialgebraic ?S \<Longrightarrow> is_semialgebraic 1 ((\<lambda>a. [a]) ` ?S)

goal (1 subgoal):
 1. is_semialgebraic 1 ((\<lambda>a. [a]) ` S)
[PROOF STEP]
by blast


[STATEMENT]
lemma points_index_simple_def: "\<B> index ps = card {b \<in> design_support . ps \<subseteq> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B> index ps = card {b \<in> design_support. ps \<subseteq> b}
[PROOF STEP]
using design_support_def points_index_def card_size_filter_eq simple_blocks_eq_sup
[PROOF STATE]
proof (prove)
using this:
design_support \<equiv> set_mset \<B>
?B index ?ps \<equiv> size (filter_mset ((\<subseteq>) ?ps) ?B)
finite ?A \<Longrightarrow> card {a \<in> ?A. ?P a} = size (filter_mset ?P (mset_set ?A))
mset_set design_support = \<B>

goal (1 subgoal):
 1. \<B> index ps = card {b \<in> design_support. ps \<subseteq> b}
[PROOF STEP]
by (metis finite_set_mset)


[STATEMENT]
lemma PiE_mem: "f \<in> Pi\<^sub>E S T \<Longrightarrow> x \<in> S \<Longrightarrow> f x \<in> T x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> Pi\<^sub>E S T; x \<in> S\<rbrakk> \<Longrightarrow> f x \<in> T x
[PROOF STEP]
unfolding PiE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> Pi S T \<inter> extensional S; x \<in> S\<rbrakk> \<Longrightarrow> f x \<in> T x
[PROOF STEP]
by auto


[STATEMENT]
lemma prv_eql_subst_trm_id:
  assumes "y \<in> var" "\<phi> \<in> fmla" and "n \<in> num"
  shows "prv (imp (eql (Var y) n) (imp \<phi> (subst \<phi> n y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (eql (Var y) n) (imp \<phi> (subst \<phi> n y)))
[PROOF STEP]
using assms prv_eql_subst_trm
[PROOF STATE]
proof (prove)
using this:
y \<in> var
\<phi> \<in> fmla
n \<in> num
\<lbrakk>?x \<in> var; ?\<phi> \<in> fmla; ?t1.0 \<in> trm; ?t2.0 \<in> trm\<rbrakk> \<Longrightarrow> prv (imp (eql ?t1.0 ?t2.0) (imp (subst ?\<phi> ?t1.0 ?x) (subst ?\<phi> ?t2.0 ?x)))

goal (1 subgoal):
 1. prv (imp (eql (Var y) n) (imp \<phi> (subst \<phi> n y)))
[PROOF STEP]
by (metis Var in_num subst_same_Var)


[STATEMENT]
lemma lt2[intro]:
"!! k1 k2 j1 j2. k1 < j1 \<Longrightarrow> ((k1,k2),(j1,j2)) \<in> lt2"
"!! k1 k2 j1 j2. \<lbrakk>k1 \<le> j1; k2 < j2\<rbrakk> \<Longrightarrow> ((k1,k2),(j1,j2)) \<in> lt2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k1 k2 j1 j2. k1 < j1 \<Longrightarrow> ((k1, k2), j1, j2) \<in> lt2) &&& (\<And>k1 k2 j1 j2. \<lbrakk>k1 \<le> j1; k2 < j2\<rbrakk> \<Longrightarrow> ((k1, k2), j1, j2) \<in> lt2)
[PROOF STEP]
unfolding lt2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k1 k2 j1 j2. k1 < j1 \<Longrightarrow> ((k1, k2), j1, j2) \<in> less_than <*lex*> less_than) &&& (\<And>k1 k2 j1 j2. \<lbrakk>k1 \<le> j1; k2 < j2\<rbrakk> \<Longrightarrow> ((k1, k2), j1, j2) \<in> less_than <*lex*> less_than)
[PROOF STEP]
by auto


[STATEMENT]
lemma \<gamma>_eq_trans:
  "\<gamma>_eq (x,y) \<Longrightarrow> \<gamma>_eq (y,z) \<Longrightarrow> \<gamma>_eq (x,z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<gamma>_eq (x, y); \<gamma>_eq (y, z)\<rbrakk> \<Longrightarrow> \<gamma>_eq (x, z)
[PROOF STEP]
unfolding \<gamma>_eq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mean (fst (x, y)) = mean (snd (x, y)) \<and> length (fst (x, y)) = length (snd (x, y)); mean (fst (y, z)) = mean (snd (y, z)) \<and> length (fst (y, z)) = length (snd (y, z))\<rbrakk> \<Longrightarrow> mean (fst (x, z)) = mean (snd (x, z)) \<and> length (fst (x, z)) = length (snd (x, z))
[PROOF STEP]
by simp


[STATEMENT]
lemma set_restriction_finite: "
  \<lbrakk> set_restriction f; finite A \<rbrakk> \<Longrightarrow> finite (f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set_restriction f; finite A\<rbrakk> \<Longrightarrow> finite (f A)
[PROOF STEP]
unfolding set_restriction_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>P. \<forall>A. f A = {x \<in> A. P x}; finite A\<rbrakk> \<Longrightarrow> finite (f A)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma mmap_lookup_update':
  "mmap_lookup (mmap_update k v kvs) z = (if k = z then Some v else mmap_lookup kvs z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mmap_lookup (mmap_update k v kvs) z = (if k = z then Some v else mmap_lookup kvs z)
[PROOF STEP]
unfolding mmap_lookup_def mmap_update_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (AList.update k v kvs) z = (if k = z then Some v else map_of kvs z)
[PROOF STEP]
by (auto simp add: update_conv')


[STATEMENT]
lemma homI:
  "\<lbrakk>\<And>x. x \<in> carrier G \<Longrightarrow> h x \<in> carrier H;
    \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y\<rbrakk> \<Longrightarrow> h \<in> hom G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> carrier G \<Longrightarrow> h x \<in> carrier H; \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y\<rbrakk> \<Longrightarrow> h \<in> hom G H
[PROOF STEP]
by (auto simp: hom_def)


[STATEMENT]
lemma ENC_FNot: "ENC n (FOV (FNot \<phi>)) = ENC n (FOV \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ENC n (FOV (FNot \<phi>)) = ENC n (FOV \<phi>)
[PROOF STEP]
unfolding ENC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. INTERSECT (sorted_list_of_set (valid_ENC n ` FOV (FNot \<phi>))) = INTERSECT (sorted_list_of_set (valid_ENC n ` FOV \<phi>))
[PROOF STEP]
by auto


[STATEMENT]
lemma agg_sum_not_bot_1:
  fixes f :: "'a::finite \<Rightarrow> 'b::aggregation_order"
  assumes "f i \<noteq> bot"
    shows "(\<Sum>\<^sub>k f k) \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aggregation.sum_0 f {k. True} \<noteq> bot
[PROOF STEP]
by (metis assms add_bot aggregation.sum_0.remove finite_code mem_Collect_eq)


[STATEMENT]
lemma f_join_nth: "n < length (xs \<Join>\<^sub>f I) \<Longrightarrow> (xs \<Join>\<^sub>f I) ! n = xs ! (I \<rightarrow> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length (xs \<Join>\<^sub> I) \<Longrightarrow> xs \<Join>\<^sub> I ! n = xs ! (I \<rightarrow> n)
[PROOF STEP]
apply (simp add: f_join_length)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < card (I \<down>< length xs) \<Longrightarrow> xs \<Join>\<^sub> I ! n = xs ! (I \<rightarrow> n)
[PROOF STEP]
apply (unfold f_join_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < card (I \<down>< length xs) \<Longrightarrow> f_join_aux xs 0 I ! n = xs ! (I \<rightarrow> n)
[PROOF STEP]
apply (drule back_subst[OF _ cut_less_Int_conv])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < card (I \<inter> {..<length xs}) \<Longrightarrow> f_join_aux xs 0 I ! n = xs ! (I \<rightarrow> n)
[PROOF STEP]
apply (simp add: f_join_aux_nth atLeast0LessThan cut_less_Int_conv[symmetric] inext_nth_cut_less_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma singleton_independent_set: "v \<in> V \<Longrightarrow> is_independent_set {v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> V \<Longrightarrow> is_independent_set {v}
[PROOF STEP]
by (metis empty_subsetI insert_absorb2 insert_subset is_independent_alt
      singletonD singleton_not_edge vert_adj_def)


[STATEMENT]
lemma fin_maintainedI [intro]:
  assumes "\<And> F f. finite_graph F
           \<Longrightarrow> subgraph F (fst R)
           \<Longrightarrow> extensible (F,fst R) G f
           \<Longrightarrow> graph_homomorphism F G f
           \<Longrightarrow> extensible (F,snd R) G f"
  shows "fin_maintained R G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fin_maintained R G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite_graph ?F; subgraph ?F (fst R); extensible (?F, fst R) G ?f; graph_homomorphism ?F G ?f\<rbrakk> \<Longrightarrow> extensible (?F, snd R) G ?f

goal (1 subgoal):
 1. fin_maintained R G
[PROOF STEP]
unfolding fin_maintained_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite_graph ?F; subgraph ?F (fst R); extensible (?F, fst R) G ?f; graph_homomorphism ?F G ?f\<rbrakk> \<Longrightarrow> extensible (?F, snd R) G ?f

goal (1 subgoal):
 1. \<forall>F f. finite_graph F \<longrightarrow> subgraph F (fst R) \<longrightarrow> extensible (F, fst R) G f \<longrightarrow> graph_homomorphism F G f \<longrightarrow> extensible (F, snd R) G f
[PROOF STEP]
by auto


[STATEMENT]
lemma powr_complexnumeral [simp]:
  fixes x::complex shows "x powr (numeral n) = x ^ (numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr numeral n = x ^ numeral n
[PROOF STEP]
by (metis of_nat_numeral power_zero_numeral powr_nat)


[STATEMENT]
lemma count_mset_set_le_one: "count (mset_set A) x \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (mset_set A) x \<le> 1
[PROOF STEP]
by (simp add: count_mset_set_if)


[STATEMENT]
lemma poincare_between_u0v:
  assumes "u \<in> unit_disc" and "v \<in> unit_disc" and "u \<noteq> 0\<^sub>h" and "v \<noteq> 0\<^sub>h"
  shows "poincare_between u 0\<^sub>h v \<longleftrightarrow> (\<exists> k < 0. to_complex u = cor k * to_complex v)" (is "?P u v")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
proof (cases "u = v")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u = v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
 2. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
u = v

goal (2 subgoals):
 1. u = v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
 2. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
u = v

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u = v
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> 0\<^sub>h
v \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using inf_or_of_complex[of v]
[PROOF STATE]
proof (prove)
using this:
u = v
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> 0\<^sub>h
v \<noteq> 0\<^sub>h
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using poincare_between_sandwich[of u "0\<^sub>h"]
[PROOF STATE]
proof (prove)
using this:
u = v
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> 0\<^sub>h
v \<noteq> 0\<^sub>h
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)
\<lbrakk>u \<in> unit_disc; 0\<^sub>h \<in> unit_disc; poincare_between u 0\<^sub>h u\<rbrakk> \<Longrightarrow> u = 0\<^sub>h

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
u \<noteq> v

goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
have "\<forall> u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> ?P u v" (is "?P' v")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
proof (rule wlog_rotation_to_positive_x_axis)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
fix \<phi> v
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
let ?M = "moebius_pt (moebius_rotation \<phi>)"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
assume 1: "v \<in> unit_disc" "v \<noteq> 0\<^sub>h"
[PROOF STATE]
proof (state)
this:
v \<in> unit_disc
v \<noteq> 0\<^sub>h

goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
assume 2: "?P' (?M v)"
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = (\<exists>k<0. to_complex u = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) v))

goal (4 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>\<phi> u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h; \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) u) = (\<exists>k<0. to_complex ua = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) u))\<rbrakk> \<Longrightarrow> \<forall>ua. ua \<in> unit_disc \<and> ua \<noteq> 0\<^sub>h \<longrightarrow> poincare_between ua 0\<^sub>h u = (\<exists>k<0. to_complex ua = cor k * to_complex u)
 4. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
show "?P' v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
proof (rule allI, rule impI, (erule conjE)+)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
assume 3: "u \<in> unit_disc" "u \<noteq> 0\<^sub>h"
[PROOF STATE]
proof (state)
this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
have "poincare_between (?M u) 0\<^sub>h (?M v) \<longleftrightarrow> poincare_between u 0\<^sub>h v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
[PROOF STEP]
using \<open>u \<in> unit_disc\<close> \<open>v \<in> unit_disc\<close>
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc

goal (1 subgoal):
 1. poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
[PROOF STEP]
using unit_disc_fix_moebius_preserve_poincare_between unit_disc_fix_rotation zero_in_unit_disc
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
\<lbrakk>unit_disc_fix ?M; ?u \<in> unit_disc; ?v \<in> unit_disc; ?w \<in> unit_disc\<rbrakk> \<Longrightarrow> poincare_between (moebius_pt ?M ?u) (moebius_pt ?M ?v) (moebius_pt ?M ?w) = poincare_between ?u ?v ?w
unit_disc_fix (moebius_rotation ?\<phi>)
0\<^sub>h \<in> unit_disc

goal (1 subgoal):
 1. poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v

goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
thus "?P u v"
[PROOF STATE]
proof (prove)
using this:
poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using 1 2[rule_format, of "?M u"] 3
[PROOF STATE]
proof (prove)
using this:
poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
v \<in> unit_disc
v \<noteq> 0\<^sub>h
moebius_pt (moebius_rotation \<phi>) u \<in> unit_disc \<and> moebius_pt (moebius_rotation \<phi>) u \<noteq> 0\<^sub>h \<Longrightarrow> poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = (\<exists>k<0. to_complex (moebius_pt (moebius_rotation \<phi>) u) = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) v))
u \<in> unit_disc
u \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using inf_or_of_complex[of u] inf_or_of_complex[of v]
[PROOF STATE]
proof (prove)
using this:
poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = poincare_between u 0\<^sub>h v
v \<in> unit_disc
v \<noteq> 0\<^sub>h
moebius_pt (moebius_rotation \<phi>) u \<in> unit_disc \<and> moebius_pt (moebius_rotation \<phi>) u \<noteq> 0\<^sub>h \<Longrightarrow> poincare_between (moebius_pt (moebius_rotation \<phi>) u) 0\<^sub>h (moebius_pt (moebius_rotation \<phi>) v) = (\<exists>k<0. to_complex (moebius_pt (moebius_rotation \<phi>) u) = cor k * to_complex (moebius_pt (moebius_rotation \<phi>) v))
u \<in> unit_disc
u \<noteq> 0\<^sub>h
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)
v = \<infinity>\<^sub>h \<or> (\<exists>x. v = of_complex x)

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
assume 1: "is_real x" "0 < Re x" "Re x < 1"
[PROOF STATE]
proof (state)
this:
is_real x
0 < Re x
Re x < 1

goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
hence "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1

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

goal (3 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
 3. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
show "?P' (of_complex x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
proof (rule allI, rule impI, (erule conjE)+)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
assume 2: "u \<in> unit_disc" "u \<noteq> 0\<^sub>h"
[PROOF STATE]
proof (state)
this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h
[PROOF STEP]
obtain u' where "u = of_complex u'"
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. (\<And>u'. u = of_complex u' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_or_of_complex[of u]
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
u \<noteq> 0\<^sub>h
u = \<infinity>\<^sub>h \<or> (\<exists>x. u = of_complex x)

goal (1 subgoal):
 1. (\<And>u'. u = of_complex u' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = of_complex u'

goal (1 subgoal):
 1. \<And>u. \<lbrakk>u \<in> unit_disc; u \<noteq> 0\<^sub>h\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
show "?P u (of_complex x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
using 1 2 \<open>x \<noteq> 0\<close> \<open>u = of_complex u'\<close>
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1
u \<in> unit_disc
u \<noteq> 0\<^sub>h
x \<noteq> 0
u = of_complex u'

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
using poincare_between_rev[of u "0\<^sub>h" "of_complex x"]
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1
u \<in> unit_disc
u \<noteq> 0\<^sub>h
x \<noteq> 0
u = of_complex u'
\<lbrakk>u \<in> unit_disc; 0\<^sub>h \<in> unit_disc; of_complex x \<in> unit_disc\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = poincare_between (of_complex x) 0\<^sub>h u

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
using poincare_between_x_axis_u0v[of x u'] \<open>is_real x\<close>
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1
u \<in> unit_disc
u \<noteq> 0\<^sub>h
x \<noteq> 0
u = of_complex u'
\<lbrakk>u \<in> unit_disc; 0\<^sub>h \<in> unit_disc; of_complex x \<in> unit_disc\<rbrakk> \<Longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = poincare_between (of_complex x) 0\<^sub>h u
\<lbrakk>is_real x; x \<noteq> 0; u' \<noteq> 0\<rbrakk> \<Longrightarrow> poincare_between (of_complex x) 0\<^sub>h (of_complex u') = (is_real u' \<and> Re x * Re u' < 0)
is_real x

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))
[PROOF STEP]
apply (auto simp add: cmod_eq_Re)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < Re x; Re x < 1; \<bar>Re u'\<bar> < 1; u' \<noteq> 0; x \<noteq> 0; u = of_complex u'; is_real x; poincare_between (of_complex u') 0\<^sub>h (of_complex x); poincare_between (of_complex x) 0\<^sub>h (of_complex u'); is_real u'; Re x * Re u' < 0\<rbrakk> \<Longrightarrow> \<exists>k<0. u' = cor k * x
 2. \<And>k. \<lbrakk>0 < Re x; Re x < 1; \<bar>k * Re x\<bar> < 1; x \<noteq> 0; u = of_complex (cor k * x); is_real x; \<not> poincare_between (of_complex (cor k * x)) 0\<^sub>h (of_complex x); \<not> poincare_between (of_complex x) 0\<^sub>h (of_complex (cor k * x)); \<not> Re x * (k * Re x) < 0; k < 0; u' = cor k * x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (rule_tac x="Re u' / Re x" in exI, simp add: divide_neg_pos algebra_split_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>0 < Re x; Re x < 1; \<bar>k * Re x\<bar> < 1; x \<noteq> 0; u = of_complex (cor k * x); is_real x; \<not> poincare_between (of_complex (cor k * x)) 0\<^sub>h (of_complex x); \<not> poincare_between (of_complex x) 0\<^sub>h (of_complex (cor k * x)); \<not> Re x * (k * Re x) < 0; k < 0; u' = cor k * x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using mult_neg_pos mult_pos_neg
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a < (0::?'a); (0::?'a) < ?b\<rbrakk> \<Longrightarrow> ?a * ?b < (0::?'a)
\<lbrakk>(0::?'a) < ?a; ?b < (0::?'a)\<rbrakk> \<Longrightarrow> ?a * ?b < (0::?'a)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>0 < Re x; Re x < 1; \<bar>k * Re x\<bar> < 1; x \<noteq> 0; u = of_complex (cor k * x); is_real x; \<not> poincare_between (of_complex (cor k * x)) 0\<^sub>h (of_complex x); \<not> poincare_between (of_complex x) 0\<^sub>h (of_complex (cor k * x)); \<not> Re x * (k * Re x) < 0; k < 0; u' = cor k * x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h (of_complex x) = (\<exists>k<0. to_complex u = cor k * to_complex (of_complex x))

goal (2 subgoals):
 1. v \<in> unit_disc
 2. v \<noteq> 0\<^sub>h
[PROOF STEP]
qed fact+
[PROOF STATE]
proof (state)
this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal (1 subgoal):
 1. u \<noteq> v \<Longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>u. u \<in> unit_disc \<and> u \<noteq> 0\<^sub>h \<longrightarrow> poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> 0\<^sub>h
v \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poincare_between u 0\<^sub>h v = (\<exists>k<0. to_complex u = cor k * to_complex v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in sturm_seq) p_nonzero_imp_sign_changes_const:
  "poly p x\<^sub>0 \<noteq> 0 \<Longrightarrow>
       eventually (\<lambda>x. sign_changes ps x = sign_changes ps x\<^sub>0) (at x\<^sub>0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p x\<^sub>0 \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at x\<^sub>0. sign_changes ps x = sign_changes ps x\<^sub>0
[PROOF STEP]
using hd_nonzero_imp_sign_changes_const
[PROOF STATE]
proof (prove)
using this:
poly (hd ps) ?x\<^sub>0 \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at ?x\<^sub>0. sign_changes ps x = sign_changes ps ?x\<^sub>0

goal (1 subgoal):
 1. poly p x\<^sub>0 \<noteq> 0 \<Longrightarrow> \<forall>\<^sub>F x in at x\<^sub>0. sign_changes ps x = sign_changes ps x\<^sub>0
[PROOF STEP]
by simp


[STATEMENT]
lemma prefix_match_semantics_ipset_from_netmask2:
    assumes "valid_prefix pfx"
    shows "prefix_match_semantics pfx (a :: 'i::len word) \<longleftrightarrow>
            a \<in> ipset_from_cidr (pfxm_prefix pfx) (pfxm_length pfx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix_match_semantics pfx a = (a \<in> ipset_from_cidr (pfxm_prefix pfx) (pfxm_length pfx))
[PROOF STEP]
unfolding prefix_match_semantics_ipset_from_netmask[OF assms] pfxm_mask_def ipset_from_cidr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> ipset_from_netmask (pfxm_prefix pfx) (~~ mask (LENGTH('i) - pfxm_length pfx))) = (a \<in> ipset_from_netmask (pfxm_prefix pfx) (mask (pfxm_length pfx) << LENGTH('i) - pfxm_length pfx))
[PROOF STEP]
by (metis (full_types) NOT_mask_shifted_lenword word_not_not)


[STATEMENT]
lemma ldeep_T_pos: "\<lbrakk>\<forall>x\<in> set ys. cf x > 0; sel_reasonable f\<rbrakk> \<Longrightarrow> ldeep_T (ldeep_s f xs) cf ys > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set ys. 0 < cf x; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_T (ldeep_s f xs) cf ys
[PROOF STEP]
apply(induction ys arbitrary: xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xs. \<lbrakk>\<forall>x\<in>set []. 0 < cf x; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_T (ldeep_s f xs) cf []
 2. \<And>a ys xs. \<lbrakk>\<And>xs. \<lbrakk>\<forall>x\<in>set ys. 0 < cf x; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_T (ldeep_s f xs) cf ys; \<forall>x\<in>set (a # ys). 0 < cf x; sel_reasonable f\<rbrakk> \<Longrightarrow> 0 < ldeep_T (ldeep_s f xs) cf (a # ys)
[PROOF STEP]
apply(auto simp: ldeep_T_def)[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ys xs. \<lbrakk>\<And>xs. 0 < foldl (\<lambda>a b. a * cf b * ldeep_s f xs b) 1 ys; sel_reasonable f; 0 < cf a; \<forall>x\<in>set ys. 0 < cf x\<rbrakk> \<Longrightarrow> 0 < foldl (\<lambda>a b. a * cf b * ldeep_s f xs b) (cf a * ldeep_s f xs a) ys
[PROOF STEP]
by (metis Groups.comm_monoid_mult_class.mult_1 ldeep_T'_eq_foldl ldeep_s_pos zero_less_mult_iff)


[STATEMENT]
lemma filterlim_at_right_to_top:
  "filterlim f F (at_right (0::real)) \<longleftrightarrow> (LIM x at_top. f (inverse x) :> F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f F (at_right 0) = (LIM x at_top. f (inverse x) :> F)
[PROOF STEP]
unfolding filterlim_def at_right_to_top filtermap_filtermap
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (filtermap (\<lambda>x. f (inverse x)) at_top \<le> F) = (filtermap (\<lambda>x. f (inverse x)) at_top \<le> F)
[PROOF STEP]
..


[STATEMENT]
theorem usubst_fml: "Uvariation \<nu> \<omega> U \<Longrightarrow> usubstappf \<sigma> U \<phi> \<noteq> undeff \<Longrightarrow>
    (\<nu> \<in> fml_sem I (the (usubstappf \<sigma> U \<phi>))) = (\<nu> \<in> fml_sem (adjoint \<sigma> I \<omega>) \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Uvariation \<nu> \<omega> U; usubstappf \<sigma> U \<phi> \<noteq> undeff\<rbrakk> \<Longrightarrow> (\<nu> \<in> fml_sem I (the (usubstappf \<sigma> U \<phi>))) = (\<nu> \<in> fml_sem (USubst.adjoint \<sigma> I \<omega>) \<phi>)
[PROOF STEP]
using usubst_fml_game
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Uvariation ?\<nu> ?\<omega> ?U; usubstappf ?\<sigma> ?U ?\<phi> \<noteq> undeff\<rbrakk> \<Longrightarrow> (?\<nu> \<in> fml_sem ?I (the (usubstappf ?\<sigma> ?U ?\<phi>))) = (?\<nu> \<in> fml_sem (USubst.adjoint ?\<sigma> ?I ?\<omega>) ?\<phi>)
\<lbrakk>Uvariation ?\<nu> ?\<omega> ?U; snd (usubstappp ?\<sigma> ?U ?\<alpha>) \<noteq> undefg\<rbrakk> \<Longrightarrow> (?\<nu> \<in> game_sem ?I (the (snd (usubstappp ?\<sigma> ?U ?\<alpha>))) ?X) = (?\<nu> \<in> game_sem (USubst.adjoint ?\<sigma> ?I ?\<omega>) ?\<alpha> ?X)

goal (1 subgoal):
 1. \<lbrakk>Uvariation \<nu> \<omega> U; usubstappf \<sigma> U \<phi> \<noteq> undeff\<rbrakk> \<Longrightarrow> (\<nu> \<in> fml_sem I (the (usubstappf \<sigma> U \<phi>))) = (\<nu> \<in> fml_sem (USubst.adjoint \<sigma> I \<omega>) \<phi>)
[PROOF STEP]
by simp


[STATEMENT]
lemma wide_subcat_antisym:
  assumes "\<AA> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>i\<^sub>d\<^sub>e\<^bsub>\<alpha>\<^esub> \<BB>" and "\<BB> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>i\<^sub>d\<^sub>e\<^bsub>\<alpha>\<^esub> \<AA>"
  shows "\<AA> = \<BB>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
interpret \<AA>\<BB>: wide_subcategory \<alpha> \<AA> \<BB>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>i\<^sub>d\<^sub>e\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
interpret \<BB>\<AA>: wide_subcategory \<alpha> \<BB> \<AA>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<BB> \<subseteq>\<^sub>C\<^sub>.\<^sub>w\<^sub>i\<^sub>d\<^sub>e\<^bsub>\<alpha>\<^esub> \<AA>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<AA> = \<BB>
[PROOF STEP]
by (rule subcat_antisym[OF \<AA>\<BB>.subcategory_axioms \<BB>\<AA>.subcategory_axioms])
[PROOF STATE]
proof (state)
this:
\<AA> = \<BB>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dlts_rel_eq[unfolded vimage2p_def]:
  "BNF_Def.vimage2p un_DLTS un_DLTS (rel_fun (=) (rel_option (=))) = (=)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. BNF_Def.vimage2p un_DLTS un_DLTS (rel_map (=)) = (=)
[PROOF STEP]
by (auto simp add: vimage2p_def pmf.rel_eq option.rel_eq fun.rel_eq fun_eq_iff dlts.expand)


[STATEMENT]
lemma notStep3EqualCoord:
  assumes run: "CHORun LV_M rho HOs coords" and stp:"step r \<noteq> 3"
  shows "coord\<Phi> (rho (Suc r) p) = coord\<Phi> (rho r p)" (is "?P p r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coord\<Phi> (rho (Suc r) p) = coord\<Phi> (rho r p)
[PROOF STEP]
by (rule LV_Suc'[OF run, where P="?P"])
     (auto simp: stp next0_def next1_def next2_def)