[STATEMENT]
lemma cos_monotone_0_pi:
  assumes "0 \<le> y" and "y < x" and "x \<le> pi"
  shows "cos x < cos y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos x < cos y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cos x < cos y
[PROOF STEP]
have "- (x - y) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x - y) < 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> y
y < x
x \<le> pi

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

goal (1 subgoal):
 1. cos x < cos y
[PROOF STEP]
from MVT2[OF \<open>y < x\<close> DERIV_cos]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z>y. z < x \<and> cos x - cos y = (x - y) * - sin z
[PROOF STEP]
obtain z where "y < z" and "z < x" and cos_diff: "cos x - cos y = (x - y) * - sin z"
[PROOF STATE]
proof (prove)
using this:
\<exists>z>y. z < x \<and> cos x - cos y = (x - y) * - sin z

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>y < z; z < x; cos x - cos y = (x - y) * - sin z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y < z
z < x
cos x - cos y = (x - y) * - sin z

goal (1 subgoal):
 1. cos x < cos y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y < z
z < x
cos x - cos y = (x - y) * - sin z
[PROOF STEP]
have "0 < z" and "z < pi"
[PROOF STATE]
proof (prove)
using this:
y < z
z < x
cos x - cos y = (x - y) * - sin z

goal (1 subgoal):
 1. 0 < z &&& z < pi
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y < z
z < x
cos x - cos y = (x - y) * - sin z
0 \<le> y
y < x
x \<le> pi

goal (1 subgoal):
 1. 0 < z &&& z < pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < z
z < pi

goal (1 subgoal):
 1. cos x < cos y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < z
z < pi
[PROOF STEP]
have "0 < sin z"
[PROOF STATE]
proof (prove)
using this:
0 < z
z < pi

goal (1 subgoal):
 1. 0 < sin z
[PROOF STEP]
using sin_gt_zero
[PROOF STATE]
proof (prove)
using this:
0 < z
z < pi
\<lbrakk>0 < ?x; ?x < pi\<rbrakk> \<Longrightarrow> 0 < sin ?x

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

goal (1 subgoal):
 1. cos x < cos y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < sin z
[PROOF STEP]
have "cos x - cos y < 0"
[PROOF STATE]
proof (prove)
using this:
0 < sin z

goal (1 subgoal):
 1. cos x - cos y < 0
[PROOF STEP]
unfolding cos_diff minus_mult_commute[symmetric]
[PROOF STATE]
proof (prove)
using this:
0 < sin z

goal (1 subgoal):
 1. - (x - y) * sin z < 0
[PROOF STEP]
using \<open>- (x - y) < 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < sin z
- (x - y) < 0

goal (1 subgoal):
 1. - (x - y) * sin z < 0
[PROOF STEP]
by (rule mult_pos_neg2)
[PROOF STATE]
proof (state)
this:
cos x - cos y < 0

goal (1 subgoal):
 1. cos x < cos y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cos x - cos y < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cos x - cos y < 0

goal (1 subgoal):
 1. cos x < cos y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cos x < cos y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem equiv_exprel: "equiv UNIV exprel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv UNIV exprel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. equiv UNIV exprel
[PROOF STEP]
have "refl exprel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl exprel
[PROOF STEP]
by (simp add: refl_on_def exprel_refl)
[PROOF STATE]
proof (state)
this:
refl exprel

goal (1 subgoal):
 1. equiv UNIV exprel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
refl exprel

goal (1 subgoal):
 1. equiv UNIV exprel
[PROOF STEP]
have "sym exprel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym exprel
[PROOF STEP]
by (simp add: sym_def, blast intro: exprel.SYM)
[PROOF STATE]
proof (state)
this:
sym exprel

goal (1 subgoal):
 1. equiv UNIV exprel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sym exprel

goal (1 subgoal):
 1. equiv UNIV exprel
[PROOF STEP]
have "trans exprel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans exprel
[PROOF STEP]
by (simp add: trans_def, blast intro: exprel.TRANS)
[PROOF STATE]
proof (state)
this:
trans exprel

goal (1 subgoal):
 1. equiv UNIV exprel
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
refl exprel
sym exprel
trans exprel
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
refl exprel
sym exprel
trans exprel

goal (1 subgoal):
 1. equiv UNIV exprel
[PROOF STEP]
by (simp add: equiv_def)
[PROOF STATE]
proof (state)
this:
equiv UNIV exprel

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_fps_binomial:
  fixes c :: complex
  assumes "norm z < 1"
  shows   "eval_fps (fps_binomial c) z = (1 + z) powr c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fps (fps_binomial c) z = (1 + z) powr c
[PROOF STEP]
using gen_binomial_complex[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (?a gchoose n) * z ^ n) sums (1 + z) powr ?a

goal (1 subgoal):
 1. eval_fps (fps_binomial c) z = (1 + z) powr c
[PROOF STEP]
by (simp add: sums_iff eval_fps_def)


[STATEMENT]
lemma tendsto_at_within_vector_1:
  fixes S :: "'a :: metric_space set"
  assumes "(f \<longlongrightarrow> fx) (at x within S)"
  shows "((\<lambda>y::'a^1. \<chi> i. f (y $ 1)) \<longlongrightarrow> (vec fx::'a^1)) (at (vec x) within vec ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. \<chi>i. f (y $ 1)) \<longlongrightarrow> vec fx) (at (vec x) within vec ` S)
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Sa. \<lbrakk>open Sa; vec fx \<in> Sa\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at (vec x) within vec ` S. (\<chi>i. f (x $ 1)) \<in> Sa
[PROOF STEP]
fix T :: "('a^1) set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Sa. \<lbrakk>open Sa; vec fx \<in> Sa\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at (vec x) within vec ` S. (\<chi>i. f (x $ 1)) \<in> Sa
[PROOF STEP]
assume "open T" "vec fx \<in> T"
[PROOF STATE]
proof (state)
this:
open T
vec fx \<in> T

goal (1 subgoal):
 1. \<And>Sa. \<lbrakk>open Sa; vec fx \<in> Sa\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at (vec x) within vec ` S. (\<chi>i. f (x $ 1)) \<in> Sa
[PROOF STEP]
have "\<forall>\<^sub>F x in at x within S. f x \<in> (\<lambda>x. x $ 1) ` T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at x within S. f x \<in> (\<lambda>x. x $ 1) ` T
[PROOF STEP]
using \<open>open T\<close> \<open>vec fx \<in> T\<close> assms open_image_vec_nth tendsto_def
[PROOF STATE]
proof (prove)
using this:
open T
vec fx \<in> T
(f \<longlongrightarrow> fx) (at x within S)
open ?S \<Longrightarrow> open ((\<lambda>x. x $ ?i) ` ?S)
(?f \<longlongrightarrow> ?l) ?F = (\<forall>S. open S \<longrightarrow> ?l \<in> S \<longrightarrow> (\<forall>\<^sub>F x in ?F. ?f x \<in> S))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at x within S. f x \<in> (\<lambda>x. x $ 1) ` T
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at x within S. f x \<in> (\<lambda>x. x $ 1) ` T

goal (1 subgoal):
 1. \<And>Sa. \<lbrakk>open Sa; vec fx \<in> Sa\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at (vec x) within vec ` S. (\<chi>i. f (x $ 1)) \<in> Sa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at x within S. f x \<in> (\<lambda>x. x $ 1) ` T
[PROOF STEP]
show "\<forall>\<^sub>F x::'a^1 in at (vec x) within vec ` S. (\<chi> i. f (x $ 1)) \<in> T"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at x within S. f x \<in> (\<lambda>x. x $ 1) ` T

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at (vec x) within vec ` S. (\<chi>i. f (x $ 1)) \<in> T
[PROOF STEP]
unfolding eventually_at dist_norm [symmetric]
[PROOF STATE]
proof (prove)
using this:
\<exists>d>0. \<forall>xa\<in>S. xa \<noteq> x \<and> dist xa x < d \<longrightarrow> f xa \<in> (\<lambda>x. x $ 1) ` T

goal (1 subgoal):
 1. \<exists>d>0. \<forall>xa\<in>vec ` S. xa \<noteq> vec x \<and> dist xa (vec x) < d \<longrightarrow> (\<chi>i. f (xa $ 1)) \<in> T
[PROOF STEP]
by (rule ex_forward)
       (use \<open>open T\<close> in
         \<open>fastforce simp: dist_norm dist_vec_def L2_set_def image_iff vector_one open_vec_def\<close>)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at (vec x) within vec ` S. (\<chi>i. f (x $ 1)) \<in> T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_field_derivative_stirling_sum_real [derivative_intros]:
  "x > (0::real) \<Longrightarrow> (stirling_sum j m has_field_derivative stirling_sum (Suc j) m x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (stirling_sum j m has_real_derivative stirling_sum (Suc j) m x) (at x)
[PROOF STEP]
unfolding stirling_sum_def [abs_def] sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ((\<lambda>x. \<Sum>n = 1..<m. (- 1) ^ j * (of_real (bernoulli (Suc n)) * pochhammer (real n) j / (real n * real (Suc n)) * inverse x ^ (n + j))) has_real_derivative (\<Sum>n = 1..<m. (- 1) ^ Suc j * (of_real (bernoulli (Suc n)) * pochhammer (real n) (Suc j) / (real n * real (Suc n)) * inverse x ^ (n + Suc j)))) (at x)
[PROOF STEP]
by (rule DERIV_sum) (auto intro!: derivative_eq_intros simp del: of_nat_Suc
                              simp: pochhammer_Suc power_diff)


[STATEMENT]
lemma singleton_set_holds:
  assumes "\<forall>x \<in> M. \<forall>y \<in> M. f x = f y" "m \<in> M"
  shows "f m = the_elem (f ` M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f m = the_elem (f ` M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f m = the_elem (f ` M)
[PROOF STEP]
let ?n = "the_elem (f ` M)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f m = the_elem (f ` M)
[PROOF STEP]
have "f ` M = {f m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` M = {f m}
[PROOF STEP]
using assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>M. \<forall>y\<in>M. f x = f y
m \<in> M

goal (1 subgoal):
 1. f ` M = {f m}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f ` M = {f m}

goal (1 subgoal):
 1. f m = the_elem (f ` M)
[PROOF STEP]
hence "?n = (THE n. {f m} = {n})"
[PROOF STATE]
proof (prove)
using this:
f ` M = {f m}

goal (1 subgoal):
 1. the_elem (f ` M) = (THE n. {f m} = {n})
[PROOF STEP]
unfolding the_elem_def
[PROOF STATE]
proof (prove)
using this:
f ` M = {f m}

goal (1 subgoal):
 1. (THE x. f ` M = {x}) = (THE n. {f m} = {n})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
the_elem (f ` M) = (THE n. {f m} = {n})

goal (1 subgoal):
 1. f m = the_elem (f ` M)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
the_elem (f ` M) = (THE n. {f m} = {n})

goal (1 subgoal):
 1. f m = the_elem (f ` M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f m = the_elem (f ` M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lambert_W_times_ln_self:
  assumes "x \<ge> exp (-1)"
  shows   "Lambert_W (x * ln x) = ln x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
have "0 < exp (-1 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < exp (- 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < exp (- 1)

goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < exp (- 1)

goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
note \<open>\<dots> \<le> x\<close>
[PROOF STATE]
proof (state)
this:
exp (- 1) \<le> x

goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < x
[PROOF STEP]
have "x > 0"
[PROOF STATE]
proof (prove)
using this:
0 < x

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

goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
exp (- 1) \<le> x
[PROOF STEP]
have "ln (exp (-1)) \<le> ln x"
[PROOF STATE]
proof (prove)
using this:
exp (- 1) \<le> x

goal (1 subgoal):
 1. ln (exp (- 1)) \<le> ln x
[PROOF STEP]
using \<open>x > 0\<close>
[PROOF STATE]
proof (prove)
using this:
exp (- 1) \<le> x
0 < x

goal (1 subgoal):
 1. ln (exp (- 1)) \<le> ln x
[PROOF STEP]
by (subst ln_le_cancel_iff) auto
[PROOF STATE]
proof (state)
this:
ln (exp (- 1)) \<le> ln x

goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
hence "Lambert_W (exp (ln x) * ln x) = ln x"
[PROOF STATE]
proof (prove)
using this:
ln (exp (- 1)) \<le> ln x

goal (1 subgoal):
 1. Lambert_W (exp (ln x) * ln x) = ln x
[PROOF STEP]
by (subst Lambert_W_exp_times_self') auto
[PROOF STATE]
proof (state)
this:
Lambert_W (exp (ln x) * ln x) = ln x

goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Lambert_W (exp (ln x) * ln x) = ln x

goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
using \<open>x > 0\<close>
[PROOF STATE]
proof (prove)
using this:
Lambert_W (exp (ln x) * ln x) = ln x
0 < x

goal (1 subgoal):
 1. Lambert_W (x * ln x) = ln x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Lambert_W (x * ln x) = ln x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm103:
  assumes "card N > 0" "distinct G"
  shows "{injections P N| P. P \<in> all_partitions (set G)} =
         set [set (injections_alg l N) . l \<leftarrow> all_partitions_list G]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
let ?g1 = all_partitions_list
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
let ?f2 = injections
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
let ?g2 = injections_alg
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
have "\<forall>l \<in> set (?g1 G). set (?g2 l N) = ?f2 (set l) N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>l\<in>set (all_partitions_list G). set (injections_alg l N) = injections (set l) N
[PROOF STEP]
using assms bridgingInjection
[PROOF STATE]
proof (prove)
using this:
0 < card N
distinct G
\<lbrakk>0 < card ?N; distinct ?G\<rbrakk> \<Longrightarrow> \<forall>l\<in>set (all_partitions_list ?G). set (injections_alg l ?N) = injections (set l) ?N

goal (1 subgoal):
 1. \<forall>l\<in>set (all_partitions_list G). set (injections_alg l N) = injections (set l) N
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>l\<in>set (all_partitions_list G). set (injections_alg l N) = injections (set l) N

goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>l\<in>set (all_partitions_list G). set (injections_alg l N) = injections (set l) N
[PROOF STEP]
have "set [set (?g2 l N). l <- ?g1 G] = {?f2 P N| P. P \<in> set (map set (?g1 G))}"
[PROOF STATE]
proof (prove)
using this:
\<forall>l\<in>set (all_partitions_list G). set (injections_alg l N) = injections (set l) N

goal (1 subgoal):
 1. set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)) = {injections P N |P. P \<in> set (map set (all_partitions_list G))}
[PROOF STEP]
apply (rule setVsList)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)) = {injections P N |P. P \<in> set (map set (all_partitions_list G))}

goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)) = {injections P N |P. P \<in> set (map set (all_partitions_list G))}

goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
have "... = {?f2 P N| P. P \<in> all_partitions (set G)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {injections P N |P. P \<in> set (map set (all_partitions_list G))} = {injections P N |P. P \<in> all_partitions (set G)}
[PROOF STEP]
using all_partitions_paper_equiv_alg assms
[PROOF STATE]
proof (prove)
using this:
distinct ?xs \<Longrightarrow> set (map set (all_partitions_list ?xs)) = all_partitions (set ?xs)
0 < card N
distinct G

goal (1 subgoal):
 1. {injections P N |P. P \<in> set (map set (all_partitions_list G))} = {injections P N |P. P \<in> all_partitions (set G)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{injections P N |P. P \<in> set (map set (all_partitions_list G))} = {injections P N |P. P \<in> all_partitions (set G)}

goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)) = {injections P N |P. P \<in> set (map set (all_partitions_list G))}
{injections P N |P. P \<in> set (map set (all_partitions_list G))} = {injections P N |P. P \<in> all_partitions (set G)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G)) = {injections P N |P. P \<in> set (map set (all_partitions_list G))}
{injections P N |P. P \<in> set (map set (all_partitions_list G))} = {injections P N |P. P \<in> all_partitions (set G)}

goal (1 subgoal):
 1. {injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
{injections P N |P. P \<in> all_partitions (set G)} = set (map (\<lambda>l. set (injections_alg l N)) (all_partitions_list G))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_filter_less2:
    assumes "x \<in> set xs" "\<not>P x" "Q x" "\<And>x. P x \<Longrightarrow> Q x"
    shows "length (filter P xs) < length (filter Q xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter P xs) < length (filter Q xs)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (filter P xs) < length (filter Q xs)
[PROOF STEP]
have "\<And>x. (Q x \<and> P x) = P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (Q x \<and> P x) = P x
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
P ?x1 \<Longrightarrow> Q ?x1

goal (1 subgoal):
 1. \<And>x. (Q x \<and> P x) = P x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Q ?x1 \<and> P ?x1) = P ?x1

goal (1 subgoal):
 1. length (filter P xs) < length (filter Q xs)
[PROOF STEP]
hence "filter P xs = filter P (filter Q xs)"
[PROOF STATE]
proof (prove)
using this:
(Q ?x1 \<and> P ?x1) = P ?x1

goal (1 subgoal):
 1. filter P xs = filter P (filter Q xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filter P xs = filter P (filter Q xs)

goal (1 subgoal):
 1. length (filter P xs) < length (filter Q xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter P xs = filter P (filter Q xs)

goal (1 subgoal):
 1. length (filter P xs) < length (filter Q xs)
[PROOF STEP]
have "length (...) < length (filter Q xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter P (filter Q xs)) < length (filter Q xs)
[PROOF STEP]
using assms(1-3)
[PROOF STATE]
proof (prove)
using this:
x \<in> set xs
\<not> P x
Q x

goal (1 subgoal):
 1. length (filter P (filter Q xs)) < length (filter Q xs)
[PROOF STEP]
by - (rule length_filter_less, auto)
[PROOF STATE]
proof (state)
this:
length (filter P (filter Q xs)) < length (filter Q xs)

goal (1 subgoal):
 1. length (filter P xs) < length (filter Q xs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length (filter P xs) < length (filter Q xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length (filter P xs) < length (filter Q xs)

goal (1 subgoal):
 1. length (filter P xs) < length (filter Q xs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
length (filter P xs) < length (filter Q xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_diff_therm_dyn: "0 < a \<Longrightarrow> \<parallel>f a L s\<^sub>1 - f a L s\<^sub>2\<parallel> = \<bar>a\<bar> * \<bar>s\<^sub>1$1 - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<parallel>f a L s\<^sub>1 - f a L s\<^sub>2\<parallel> = \<bar>a\<bar> \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
proof(simp add: norm_vec_def L2_set_def, unfold UNIV_4, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
assume a1: "0 < a"
[PROOF STATE]
proof (state)
this:
0 < a

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
have f2: "\<And>r ra. \<bar>(r::real) + - ra\<bar> = \<bar>ra + - r\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r ra. \<bar>r + - ra\<bar> = \<bar>ra + - r\<bar>
[PROOF STEP]
by (metis abs_minus_commute minus_real_def)
[PROOF STATE]
proof (state)
this:
\<bar>?r + - ?ra\<bar> = \<bar>?ra + - ?r\<bar>

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
have "\<And>r ra rb. (r::real) * ra + - (r * rb) = r * (ra + - rb)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r ra rb. r \<cdot> ra + - (r \<cdot> rb) = r \<cdot> (ra + - rb)
[PROOF STEP]
by (metis minus_real_def right_diff_distrib)
[PROOF STATE]
proof (state)
this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
hence "\<bar>a * (s\<^sub>1$1 + - L) + - (a * (s\<^sub>2$1 + - L))\<bar> = a * \<bar>s\<^sub>1$1 + - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
using this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
?r \<cdot> ?ra + - (?r \<cdot> ?rb) = ?r \<cdot> (?ra + - ?rb)
0 < a

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
by (simp add: abs_mult)
[PROOF STATE]
proof (state)
this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
thus "\<bar>a * (s\<^sub>2$1 - L) - a * (s\<^sub>1$1 - L)\<bar> = a * \<bar>s\<^sub>1$1 - s\<^sub>2$1\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
using f2 minus_real_def
[PROOF STATE]
proof (prove)
using this:
\<bar>a \<cdot> (s\<^sub>1 $ 1 + - L) + - (a \<cdot> (s\<^sub>2 $ 1 + - L))\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 + - s\<^sub>2 $ 1\<bar>
\<bar>?r + - ?ra\<bar> = \<bar>?ra + - ?r\<bar>
?x - ?y = ?x + - ?y

goal (1 subgoal):
 1. \<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<bar>a \<cdot> (s\<^sub>2 $ 1 - L) - a \<cdot> (s\<^sub>1 $ 1 - L)\<bar> = a \<cdot> \<bar>s\<^sub>1 $ 1 - s\<^sub>2 $ 1\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma semiconfluentp_imp_confluentp: "confluentp r" if r: "semiconfluentp r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. confluentp r
[PROOF STEP]
proof(rule confluentpI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>r\<^sup>*\<^sup>* x y; r\<^sup>*\<^sup>* x z\<rbrakk> \<Longrightarrow> \<exists>u. r\<^sup>*\<^sup>* y u \<and> r\<^sup>*\<^sup>* z u
[PROOF STEP]
show "\<exists>u. r\<^sup>*\<^sup>* y u \<and> r\<^sup>*\<^sup>* z u" if "r\<^sup>*\<^sup>* x y" "r\<^sup>*\<^sup>* x z" for x y z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. r\<^sup>*\<^sup>* y u \<and> r\<^sup>*\<^sup>* z u
[PROOF STEP]
using that(2,1)
[PROOF STATE]
proof (prove)
using this:
r\<^sup>*\<^sup>* x z
r\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. \<exists>u. r\<^sup>*\<^sup>* y u \<and> r\<^sup>*\<^sup>* z u
[PROOF STEP]
by(induction arbitrary: y rule: converse_rtranclp_induct)
      (blast intro: rtranclp_trans dest:  r[THEN semiconfluentpD])+
[PROOF STATE]
proof (state)
this:
\<lbrakk>r\<^sup>*\<^sup>* ?x ?y; r\<^sup>*\<^sup>* ?x ?z\<rbrakk> \<Longrightarrow> \<exists>u. r\<^sup>*\<^sup>* ?y u \<and> r\<^sup>*\<^sup>* ?z u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_lists_distinct_length_eq [intro]:
  assumes "finite A"
  shows "finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}" (is "finite ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}
[PROOF STEP]
have "finite {xs. set xs \<subseteq> A \<and> length xs = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> A \<and> length xs = n}
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> A \<and> length xs = n}
[PROOF STEP]
by (rule finite_lists_length_eq)
[PROOF STATE]
proof (state)
this:
finite {xs. set xs \<subseteq> A \<and> length xs = n}

goal (1 subgoal):
 1. finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {xs. set xs \<subseteq> A \<and> length xs = n}

goal (1 subgoal):
 1. finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}
[PROOF STEP]
have "?S \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A} \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A} \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = n}

goal (1 subgoal):
 1. finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {xs. set xs \<subseteq> A \<and> length xs = n}
{xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A} \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {xs. set xs \<subseteq> A \<and> length xs = n}
{xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A} \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = n}

goal (1 subgoal):
 1. finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
finite {xs. set xs \<subseteq> A \<and> length xs = n}
{xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A} \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = n}
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {xs. length xs = n \<and> distinct xs \<and> set xs \<subseteq> A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_inv:
  assumes "invertible M"
  shows "matrix_inv M ** M = mat 1"
  and "M ** matrix_inv M = mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_inv M ** M = mat (1::'a) &&& M ** matrix_inv M = mat (1::'a)
[PROOF STEP]
using \<open>invertible M\<close> and someI_ex [of "\<lambda> N. M ** N = mat 1 \<and> N ** M = mat 1"]
[PROOF STATE]
proof (prove)
using this:
invertible M
\<exists>x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a) \<Longrightarrow> M ** (SOME x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a)) = mat (1::'a) \<and> (SOME x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a)) ** M = mat (1::'a)

goal (1 subgoal):
 1. matrix_inv M ** M = mat (1::'a) &&& M ** matrix_inv M = mat (1::'a)
[PROOF STEP]
unfolding invertible_def and matrix_inv_def
[PROOF STATE]
proof (prove)
using this:
\<exists>A'. M ** A' = mat (1::'a) \<and> A' ** M = mat (1::'a)
\<exists>x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a) \<Longrightarrow> M ** (SOME x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a)) = mat (1::'a) \<and> (SOME x. M ** x = mat (1::'a) \<and> x ** M = mat (1::'a)) ** M = mat (1::'a)

goal (1 subgoal):
 1. (SOME A'. M ** A' = mat (1::'a) \<and> A' ** M = mat (1::'a)) ** M = mat (1::'a) &&& M ** (SOME A'. M ** A' = mat (1::'a) \<and> A' ** M = mat (1::'a)) = mat (1::'a)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma contractible_eq_homotopy_equivalent_singleton_subtopology:
   "contractible_space X \<longleftrightarrow>
        topspace X = {} \<or> (\<exists>a \<in> topspace X. X homotopy_equivalent_space (subtopology X {a}))"(is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contractible_space X = (topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}))
[PROOF STEP]
proof (cases "topspace X = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. topspace X = {} \<Longrightarrow> contractible_space X = (topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}))
 2. topspace X \<noteq> {} \<Longrightarrow> contractible_space X = (topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
topspace X \<noteq> {}

goal (2 subgoals):
 1. topspace X = {} \<Longrightarrow> contractible_space X = (topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}))
 2. topspace X \<noteq> {} \<Longrightarrow> contractible_space X = (topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contractible_space X = (topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. contractible_space X \<Longrightarrow> topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})
 2. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
contractible_space X

goal (2 subgoals):
 1. contractible_space X \<Longrightarrow> topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})
 2. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
contractible_space X
[PROOF STEP]
obtain a where a: "homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)"
[PROOF STATE]
proof (prove)
using this:
contractible_space X

goal (1 subgoal):
 1. (\<And>a. homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: contractible_space_def)
[PROOF STATE]
proof (state)
this:
homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)

goal (2 subgoals):
 1. contractible_space X \<Longrightarrow> topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})
 2. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)
[PROOF STEP]
have "a \<in> topspace X"
[PROOF STATE]
proof (prove)
using this:
homotopic_with (\<lambda>x. True) X X id (\<lambda>x. a)

goal (1 subgoal):
 1. a \<in> topspace X
[PROOF STEP]
by (metis False continuous_map_const homotopic_with_imp_continuous_maps)
[PROOF STATE]
proof (state)
this:
a \<in> topspace X

goal (2 subgoals):
 1. contractible_space X \<Longrightarrow> topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})
 2. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> topspace X
[PROOF STEP]
have "homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) id (\<lambda>x. a)"
[PROOF STATE]
proof (prove)
using this:
a \<in> topspace X

goal (1 subgoal):
 1. homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) id (\<lambda>x. a)
[PROOF STEP]
using connectedin_absolute connectedin_sing contractible_space_alt contractible_space_subtopology_singleton
[PROOF STATE]
proof (prove)
using this:
a \<in> topspace X
connectedin (subtopology ?X ?S) ?S = connectedin ?X ?S
connectedin ?X {?a} = (?a \<in> topspace ?X)
contractible_space ?X = (\<forall>a\<in>topspace ?X. homotopic_with (\<lambda>x. True) ?X ?X id (\<lambda>x. a))
contractible_space (subtopology ?X {?a})

goal (1 subgoal):
 1. homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) id (\<lambda>x. a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) id (\<lambda>x. a)

goal (2 subgoals):
 1. contractible_space X \<Longrightarrow> topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})
 2. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) id (\<lambda>x. a)
[PROOF STEP]
have "X homotopy_equivalent_space subtopology X {a}"
[PROOF STATE]
proof (prove)
using this:
homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) id (\<lambda>x. a)

goal (1 subgoal):
 1. X homotopy_equivalent_space subtopology X {a}
[PROOF STEP]
unfolding homotopy_equivalent_space_def
[PROOF STATE]
proof (prove)
using this:
homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) id (\<lambda>x. a)

goal (1 subgoal):
 1. \<exists>f g. continuous_map X (subtopology X {a}) f \<and> continuous_map (subtopology X {a}) X g \<and> homotopic_with (\<lambda>x. True) X X (g \<circ> f) id \<and> homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) (f \<circ> g) id
[PROOF STEP]
using \<open>a \<in> topspace X\<close>
[PROOF STATE]
proof (prove)
using this:
homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) id (\<lambda>x. a)
a \<in> topspace X

goal (1 subgoal):
 1. \<exists>f g. continuous_map X (subtopology X {a}) f \<and> continuous_map (subtopology X {a}) X g \<and> homotopic_with (\<lambda>x. True) X X (g \<circ> f) id \<and> homotopic_with (\<lambda>x. True) (subtopology X {a}) (subtopology X {a}) (f \<circ> g) id
[PROOF STEP]
by (metis (full_types) a comp_id continuous_map_const continuous_map_id_subt empty_subsetI homotopic_with_symD
           id_comp insertI1 insert_subset topspace_subtopology_subset)
[PROOF STATE]
proof (state)
this:
X homotopy_equivalent_space subtopology X {a}

goal (2 subgoals):
 1. contractible_space X \<Longrightarrow> topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})
 2. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
with \<open>a \<in> topspace X\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<in> topspace X
X homotopy_equivalent_space subtopology X {a}
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
a \<in> topspace X
X homotopy_equivalent_space subtopology X {a}

goal (1 subgoal):
 1. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})

goal (1 subgoal):
 1. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})

goal (1 subgoal):
 1. topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}) \<Longrightarrow> contractible_space X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a})

goal (1 subgoal):
 1. contractible_space X
[PROOF STEP]
by (meson False contractible_space_subtopology_singleton homotopy_equivalent_space_contractibility)
[PROOF STATE]
proof (state)
this:
contractible_space X

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
contractible_space X = (topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}))

goal (1 subgoal):
 1. topspace X = {} \<Longrightarrow> contractible_space X = (topspace X = {} \<or> (\<exists>a\<in>topspace X. X homotopy_equivalent_space subtopology X {a}))
[PROOF STEP]
qed (simp add: contractible_space_empty)


[STATEMENT]
lemma pick_first_id: assumes i: "i<n" shows "pick {0..<n} i = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick {0..<n} i = i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pick {0..<n} i = i
[PROOF STEP]
have "i = (card {a \<in> {0..<n}. a < i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = card {a \<in> {0..<n}. a < i}
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. i = card {a \<in> {0..<n}. a < i}
[PROOF STEP]
by (auto, smt Collect_cong card_Collect_less_nat nat_SN.gt_trans)
[PROOF STATE]
proof (state)
this:
i = card {a \<in> {0..<n}. a < i}

goal (1 subgoal):
 1. pick {0..<n} i = i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i = card {a \<in> {0..<n}. a < i}

goal (1 subgoal):
 1. pick {0..<n} i = i
[PROOF STEP]
using pick_card_in_set i
[PROOF STATE]
proof (prove)
using this:
i = card {a \<in> {0..<n}. a < i}
?i \<in> ?I \<Longrightarrow> pick ?I (card {a \<in> ?I. a < ?i}) = ?i
i < n

goal (1 subgoal):
 1. pick {0..<n} i = i
[PROOF STEP]
by (metis atLeastLessThan_iff zero_order(1))
[PROOF STATE]
proof (state)
this:
pick {0..<n} i = i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unique_default_example: "succ_tran \<lparr>nodes = {vertex_1, vertex_2}, edges = {(vertex_1, vertex_2)}\<rparr> vertex_2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. succ_tran \<lparr>nodes = {vertex_1, vertex_2}, edges = {(vertex_1, vertex_2)}\<rparr> vertex_2 = {}
[PROOF STEP]
apply (simp add: succ_tran_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (vertex_2, x) \<notin> {(vertex_1, vertex_2)}\<^sup>+
[PROOF STEP]
by (metis Domain.DomainI Domain_empty Domain_insert distinct_vertices12 singleton_iff trancl_domain)


[STATEMENT]
lemma map_prod_fun_zip: "map (\<lambda>(x, y). (f x, g y)) (zip xs ys) = zip (map f xs) (map g ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<lambda>x y. (f x, g y)) xs ys = zip (map f xs) (map g ys)
[PROOF STEP]
proof(induct xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. map2 (\<lambda>x y. (f x, g y)) [] ys = zip (map f []) (map g ys)
 2. \<And>a xs ys. (\<And>ys. map2 (\<lambda>x y. (f x, g y)) xs ys = zip (map f xs) (map g ys)) \<Longrightarrow> map2 (\<lambda>x y. (f x, g y)) (a # xs) ys = zip (map f (a # xs)) (map g ys)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>ys. map2 (\<lambda>x y. (f x, g y)) [] ys = zip (map f []) (map g ys)
 2. \<And>a xs ys. (\<And>ys. map2 (\<lambda>x y. (f x, g y)) xs ys = zip (map f xs) (map g ys)) \<Longrightarrow> map2 (\<lambda>x y. (f x, g y)) (a # xs) ys = zip (map f (a # xs)) (map g ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<lambda>x y. (f x, g y)) [] ys = zip (map f []) (map g ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map2 (\<lambda>x y. (f x, g y)) [] ys = zip (map f []) (map g ys)

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. map2 (\<lambda>x y. (f x, g y)) xs ys = zip (map f xs) (map g ys)) \<Longrightarrow> map2 (\<lambda>x y. (f x, g y)) (a # xs) ys = zip (map f (a # xs)) (map g ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. map2 (\<lambda>x y. (f x, g y)) xs ys = zip (map f xs) (map g ys)) \<Longrightarrow> map2 (\<lambda>x y. (f x, g y)) (a # xs) ys = zip (map f (a # xs)) (map g ys)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
map2 (\<lambda>x y. (f x, g y)) xs ?ys = zip (map f xs) (map g ?ys)

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. map2 (\<lambda>x y. (f x, g y)) xs ys = zip (map f xs) (map g ys)) \<Longrightarrow> map2 (\<lambda>x y. (f x, g y)) (a # xs) ys = zip (map f (a # xs)) (map g ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
map2 (\<lambda>x y. (f x, g y)) xs ?ys = zip (map f xs) (map g ?ys)

goal (1 subgoal):
 1. map2 (\<lambda>x y. (f x, g y)) (x # xs) ys = zip (map f (x # xs)) (map g ys)
[PROOF STEP]
by(cases ys) simp_all
[PROOF STATE]
proof (state)
this:
map2 (\<lambda>x y. (f x, g y)) (x # xs) ys = zip (map f (x # xs)) (map g ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poincare_between_poincare_collinear [simp]:
  assumes in_disc: "u \<in> unit_disc"  "v \<in> unit_disc"  "w \<in> unit_disc"
  assumes betw: "poincare_between u v w"
  shows "poincare_collinear {u, v, w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_collinear {u, v, w}
[PROOF STEP]
proof (cases "u = v \<or> v = w")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u = v \<or> v = w \<Longrightarrow> poincare_collinear {u, v, w}
 2. \<not> (u = v \<or> v = w) \<Longrightarrow> poincare_collinear {u, v, w}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
u = v \<or> v = w

goal (2 subgoals):
 1. u = v \<or> v = w \<Longrightarrow> poincare_collinear {u, v, w}
 2. \<not> (u = v \<or> v = w) \<Longrightarrow> poincare_collinear {u, v, w}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
u = v \<or> v = w

goal (1 subgoal):
 1. poincare_collinear {u, v, w}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u = v \<or> v = w
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
poincare_between u v w

goal (1 subgoal):
 1. poincare_collinear {u, v, w}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poincare_collinear {u, v, w}

goal (1 subgoal):
 1. \<not> (u = v \<or> v = w) \<Longrightarrow> poincare_collinear {u, v, w}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (u = v \<or> v = w) \<Longrightarrow> poincare_collinear {u, v, w}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (u = v \<or> v = w)

goal (1 subgoal):
 1. \<not> (u = v \<or> v = w) \<Longrightarrow> poincare_collinear {u, v, w}
[PROOF STEP]
hence distinct: "distinct [u, v, w, inversion v]"
[PROOF STATE]
proof (prove)
using this:
\<not> (u = v \<or> v = w)

goal (1 subgoal):
 1. distinct [u, v, w, inversion v]
[PROOF STEP]
using in_disc inversion_noteq_unit_disc[of v v] inversion_noteq_unit_disc[of v u] inversion_noteq_unit_disc[of v w]
[PROOF STATE]
proof (prove)
using this:
\<not> (u = v \<or> v = w)
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
\<lbrakk>v \<in> unit_disc; v \<in> unit_disc\<rbrakk> \<Longrightarrow> inversion v \<noteq> v
\<lbrakk>v \<in> unit_disc; u \<in> unit_disc\<rbrakk> \<Longrightarrow> inversion v \<noteq> u
\<lbrakk>v \<in> unit_disc; w \<in> unit_disc\<rbrakk> \<Longrightarrow> inversion v \<noteq> w

goal (1 subgoal):
 1. distinct [u, v, w, inversion v]
[PROOF STEP]
using betw poincare_between_sandwich[of w v]
[PROOF STATE]
proof (prove)
using this:
\<not> (u = v \<or> v = w)
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
\<lbrakk>v \<in> unit_disc; v \<in> unit_disc\<rbrakk> \<Longrightarrow> inversion v \<noteq> v
\<lbrakk>v \<in> unit_disc; u \<in> unit_disc\<rbrakk> \<Longrightarrow> inversion v \<noteq> u
\<lbrakk>v \<in> unit_disc; w \<in> unit_disc\<rbrakk> \<Longrightarrow> inversion v \<noteq> w
poincare_between u v w
\<lbrakk>w \<in> unit_disc; v \<in> unit_disc; poincare_between w v w\<rbrakk> \<Longrightarrow> w = v

goal (1 subgoal):
 1. distinct [u, v, w, inversion v]
[PROOF STEP]
by (auto simp add: poincare_between_def Let_def)
[PROOF STATE]
proof (state)
this:
distinct [u, v, w, inversion v]

goal (1 subgoal):
 1. \<not> (u = v \<or> v = w) \<Longrightarrow> poincare_collinear {u, v, w}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct [u, v, w, inversion v]
[PROOF STEP]
obtain H where *: "{u, v, w, inversion v} \<subseteq> circline_set H"
[PROOF STATE]
proof (prove)
using this:
distinct [u, v, w, inversion v]

goal (1 subgoal):
 1. (\<And>H. {u, v, w, inversion v} \<subseteq> circline_set H \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct [u, v, w, inversion v]
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
poincare_between u v w

goal (1 subgoal):
 1. (\<And>H. {u, v, w, inversion v} \<subseteq> circline_set H \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding poincare_between_def
[PROOF STATE]
proof (prove)
using this:
distinct [u, v, w, inversion v]
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
u = v \<or> v = w \<or> (let cr = cross_ratio u v w (inversion v) in is_real (to_complex cr) \<and> Re (to_complex cr) < 0)

goal (1 subgoal):
 1. (\<And>H. {u, v, w, inversion v} \<subseteq> circline_set H \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using four_points_on_circline_iff_cross_ratio_real[of u v w "inversion v"]
[PROOF STATE]
proof (prove)
using this:
distinct [u, v, w, inversion v]
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
u = v \<or> v = w \<or> (let cr = cross_ratio u v w (inversion v) in is_real (to_complex cr) \<and> Re (to_complex cr) < 0)
distinct [u, v, w, inversion v] \<Longrightarrow> is_real (to_complex (cross_ratio u v w (inversion v))) = (\<exists>H. {u, v, w, inversion v} \<subseteq> circline_set H)

goal (1 subgoal):
 1. (\<And>H. {u, v, w, inversion v} \<subseteq> circline_set H \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{u, v, w, inversion v} \<subseteq> circline_set H

goal (1 subgoal):
 1. \<not> (u = v \<or> v = w) \<Longrightarrow> poincare_collinear {u, v, w}
[PROOF STEP]
hence "H = poincare_line u v"
[PROOF STATE]
proof (prove)
using this:
{u, v, w, inversion v} \<subseteq> circline_set H

goal (1 subgoal):
 1. H = poincare_line u v
[PROOF STEP]
using assms distinct
[PROOF STATE]
proof (prove)
using this:
{u, v, w, inversion v} \<subseteq> circline_set H
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
poincare_between u v w
distinct [u, v, w, inversion v]

goal (1 subgoal):
 1. H = poincare_line u v
[PROOF STEP]
using unique_circline_set[of u v "inversion v"]
[PROOF STATE]
proof (prove)
using this:
{u, v, w, inversion v} \<subseteq> circline_set H
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
poincare_between u v w
distinct [u, v, w, inversion v]
\<lbrakk>u \<noteq> v; u \<noteq> inversion v; v \<noteq> inversion v\<rbrakk> \<Longrightarrow> \<exists>!H. u \<in> circline_set H \<and> v \<in> circline_set H \<and> inversion v \<in> circline_set H

goal (1 subgoal):
 1. H = poincare_line u v
[PROOF STEP]
using poincare_line[of u v] poincare_line_inversion[of u v]
[PROOF STATE]
proof (prove)
using this:
{u, v, w, inversion v} \<subseteq> circline_set H
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
poincare_between u v w
distinct [u, v, w, inversion v]
\<lbrakk>u \<noteq> v; u \<noteq> inversion v; v \<noteq> inversion v\<rbrakk> \<Longrightarrow> \<exists>!H. u \<in> circline_set H \<and> v \<in> circline_set H \<and> inversion v \<in> circline_set H
u \<noteq> v \<Longrightarrow> on_circline (poincare_line u v) u
u \<noteq> v \<Longrightarrow> on_circline (poincare_line u v) v
u \<noteq> v \<Longrightarrow> on_circline (poincare_line u v) (inversion u)
u \<noteq> v \<Longrightarrow> on_circline (poincare_line u v) (inversion v)

goal (1 subgoal):
 1. H = poincare_line u v
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
{u, v, w, inversion v} \<subseteq> Collect (on_circline H)
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
poincare_between u v w
distinct [u, v, w, inversion v]
\<lbrakk>u \<noteq> v; u \<noteq> inversion v; v \<noteq> inversion v\<rbrakk> \<Longrightarrow> \<exists>!H. u \<in> Collect (on_circline H) \<and> v \<in> Collect (on_circline H) \<and> inversion v \<in> Collect (on_circline H)
u \<noteq> v \<Longrightarrow> on_circline (poincare_line u v) u
u \<noteq> v \<Longrightarrow> on_circline (poincare_line u v) v
u \<noteq> v \<Longrightarrow> on_circline (poincare_line u v) (inversion u)
u \<noteq> v \<Longrightarrow> on_circline (poincare_line u v) (inversion v)

goal (1 subgoal):
 1. H = poincare_line u v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H = poincare_line u v

goal (1 subgoal):
 1. \<not> (u = v \<or> v = w) \<Longrightarrow> poincare_collinear {u, v, w}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
H = poincare_line u v

goal (1 subgoal):
 1. poincare_collinear {u, v, w}
[PROOF STEP]
using * assms False
[PROOF STATE]
proof (prove)
using this:
H = poincare_line u v
{u, v, w, inversion v} \<subseteq> circline_set H
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
poincare_between u v w
\<not> (u = v \<or> v = w)

goal (1 subgoal):
 1. poincare_collinear {u, v, w}
[PROOF STEP]
unfolding poincare_collinear_def
[PROOF STATE]
proof (prove)
using this:
H = poincare_line u v
{u, v, w, inversion v} \<subseteq> circline_set H
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
poincare_between u v w
\<not> (u = v \<or> v = w)

goal (1 subgoal):
 1. \<exists>p. is_poincare_line p \<and> {u, v, w} \<subseteq> circline_set p
[PROOF STEP]
by (rule_tac x="poincare_line u v" in exI) simp
[PROOF STATE]
proof (state)
this:
poincare_collinear {u, v, w}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_bij_affine:
  "interval_bij (a,b) (u,v) = (\<lambda>x. (\<Sum>i\<in>Basis. ((v\<bullet>i - u\<bullet>i) / (b\<bullet>i - a\<bullet>i) * (x\<bullet>i)) *\<^sub>R i) +
    (\<Sum>i\<in>Basis. (u\<bullet>i - (v\<bullet>i - u\<bullet>i) / (b\<bullet>i - a\<bullet>i) * (a\<bullet>i)) *\<^sub>R i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_bij (a, b) (u, v) = (\<lambda>x. (\<Sum>i\<in>Basis. ((v \<bullet> i - u \<bullet> i) / (b \<bullet> i - a \<bullet> i) * (x \<bullet> i)) *\<^sub>R i) + (\<Sum>i\<in>Basis. (u \<bullet> i - (v \<bullet> i - u \<bullet> i) / (b \<bullet> i - a \<bullet> i) * (a \<bullet> i)) *\<^sub>R i))
[PROOF STEP]
by (auto simp add: interval_bij_def sum.distrib [symmetric] scaleR_add_left [symmetric]
    fun_eq_iff intro!: sum.cong)
    (simp add: algebra_simps diff_divide_distrib [symmetric])


[STATEMENT]
theorem SC_ZObis_Seq: "SC_ZObis (Seq c1 c2) \<longleftrightarrow> (SC_siso c1 \<and> SC_ZObis c2) \<or>
                              (SC_ZObis c1 \<and> SC_discr c2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SC_ZObis (c1 ;; c2) = (SC_siso c1 \<and> SC_ZObis c2 \<or> SC_ZObis c1 \<and> SC_discr c2)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in topological_space) at_within_eq:
  "at x within s = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within s = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))
[PROOF STEP]
unfolding nhds_def at_within_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf (Inf (principal ` {S. open S \<and> x \<in> S})) (principal (s - {x})) = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))
[PROOF STEP]
by (subst INF_inf_const2[symmetric]) (auto simp: Diff_Int_distrib)


[STATEMENT]
lemma SA_one:
"(\<one>\<^bsub>SA n\<^esub>) = (\<one>\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>SA n\<^esub> = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>
[PROOF STEP]
unfolding SA_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<lparr>carrier := semialg_functions n\<rparr>\<^esub> = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>
[PROOF STEP]
by simp


[STATEMENT]
theorem link_diagram_matrix:
 assumes "is_link_diagram ws"
 shows "mat 1 1 (kauff_mat ws) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat 1 1 (kauff_mat ws)
[PROOF STEP]
using assms effective_matrix_kauff_mat
[PROOF STATE]
proof (prove)
using this:
is_link_diagram ws
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)

goal (1 subgoal):
 1. mat 1 1 (kauff_mat ws)
[PROOF STEP]
unfolding is_link_diagram_def
[PROOF STATE]
proof (prove)
using this:
if is_tangle_diagram ws then Preliminaries.abs (domain_wall ws) + Preliminaries.abs (codomain_wall ws) = 0 else False
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)

goal (1 subgoal):
 1. mat 1 1 (kauff_mat ws)
[PROOF STEP]
by (metis Preliminaries.abs_zero abs_non_negative_sum(1) comm_monoid_add_class.add_0 nat_0 power_0)


[STATEMENT]
lemma nn_integral_convolution:
  assumes "finite_measure M" "finite_measure N"
  assumes [measurable_cong]: "sets N = sets borel" "sets M = sets borel"
  assumes [measurable]: "f \<in> borel_measurable borel"
  shows "(\<integral>\<^sup>+x. f x \<partial>convolution M N) = (\<integral>\<^sup>+x. \<integral>\<^sup>+y. f (x + y) \<partial>N \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (M \<star> N) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x + y) \<partial>N \<partial>M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (M \<star> N) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x + y) \<partial>N \<partial>M
[PROOF STEP]
interpret M: finite_measure M
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_measure M
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (M \<star> N) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x + y) \<partial>N \<partial>M
[PROOF STEP]
interpret N: finite_measure N
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_measure N
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (M \<star> N) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x + y) \<partial>N \<partial>M
[PROOF STEP]
interpret pair_sigma_finite M N
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pair_sigma_finite M N
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (M \<star> N) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x + y) \<partial>N \<partial>M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (M \<star> N) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x + y) \<partial>N \<partial>M
[PROOF STEP]
unfolding convolution_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (distr (M \<Otimes>\<^sub>M N) borel (\<lambda>(x, y). x + y)) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x + y) \<partial>N \<partial>M
[PROOF STEP]
by (simp add: nn_integral_distr N.nn_integral_fst[symmetric])
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (M \<star> N) f = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. f (x + y) \<partial>N \<partial>M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma full_btrees_sharp: "nodes (full_node k a h) * (2*k) = bound (2*k) h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (full_node k a h) * (2 * k) = bound (2 * k) h
[PROOF STEP]
apply(induction k a h rule: full_node.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k c. nodes (full_node k c 0) * (2 * k) = bound (2 * k) 0
 2. \<And>k c n. \<lbrakk>nodes (full_node k c n) * (2 * k) = bound (2 * k) n; nodes (full_node k c n) * (2 * k) = bound (2 * k) n\<rbrakk> \<Longrightarrow> nodes (full_node k c (Suc n)) * (2 * k) = bound (2 * k) (Suc n)
[PROOF STEP]
apply (auto simp add: height_full_node algebra_simps sum_list_replicate)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma quotient_hom:
  assumes "Subgroup H" "normal H" "H \<subseteq> Ker"
  shows   "GroupHom (quotient_group H) (quotient_hom H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GroupHom (quotient_group H) (restrict0 (quotientfun T \<circ> the_inv_into (G // LCoset_rel H) (BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+))) (BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+) ` G // LCoset_rel H))
[PROOF STEP]
unfolding quotient_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GroupHom (BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+) ` G // LCoset_rel H) (restrict0 (quotientfun T \<circ> the_inv_into (G // LCoset_rel H) (BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+))) (BinOpSetGroup.Abs_G_perm (G // LCoset_rel H) (+) ` G // LCoset_rel H))
[PROOF STEP]
proof (
  rule BinOpSetGroup.lift_hom, rule BinOpSetGroup_normal_quotient, rule assms(1),
  rule assms(2)
)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>g\<in>G // LCoset_rel H. \<forall>h\<in>G // LCoset_rel H. quotientfun T (g + h) = quotientfun T g + quotientfun T h
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Subgroup H
normal H
H \<subseteq> Ker
[PROOF STEP]
show  "\<forall>x \<in> quotient_set H. \<forall>y \<in> quotient_set H.
            quotientfun T (x + y) = quotientfun T x + quotientfun T y"
[PROOF STATE]
proof (prove)
using this:
Subgroup H
normal H
H \<subseteq> Ker

goal (1 subgoal):
 1. \<forall>x\<in>G // LCoset_rel H. \<forall>y\<in>G // LCoset_rel H. quotientfun T (x + y) = quotientfun T x + quotientfun T y
[PROOF STEP]
using normal_quotient_add_well_defined normal_subgroup_quotientfun_classrep_equality
          add_closed hom
[PROOF STATE]
proof (prove)
using this:
Subgroup H
normal H
H \<subseteq> Ker
\<lbrakk>Subgroup ?H; normal ?H; ?g \<in> G; ?g' \<in> G\<rbrakk> \<Longrightarrow> LCoset_rel ?H `` {?g} + LCoset_rel ?H `` {?g'} = LCoset_rel ?H `` {?g + ?g'}
\<lbrakk>Subgroup ?H; ?H \<subseteq> Ker; ?a \<in> G\<rbrakk> \<Longrightarrow> quotientfun T (LCoset_rel ?H `` {?a}) = T ?a
\<lbrakk>?g \<in> G; ?h \<in> G\<rbrakk> \<Longrightarrow> ?g + ?h \<in> G
\<lbrakk>?g \<in> G; ?g' \<in> G\<rbrakk> \<Longrightarrow> T (?g + ?g') = T ?g + T ?g'

goal (1 subgoal):
 1. \<forall>x\<in>G // LCoset_rel H. \<forall>y\<in>G // LCoset_rel H. quotientfun T (x + y) = quotientfun T x + quotientfun T y
[PROOF STEP]
by    (fastforce elim: LCoset_rel_quotientE)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>G // LCoset_rel H. \<forall>y\<in>G // LCoset_rel H. quotientfun T (x + y) = quotientfun T x + quotientfun T y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pure_forall_M_I: "(\<And>x. x \<in> set xs \<Longrightarrow> pure (P x) h) \<Longrightarrow> pure (forall_M P xs) h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> pure (P x) h) \<Longrightarrow> pure (forall_M P xs) h
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> pure (P x) h) \<Longrightarrow> pure (forall_M P []) h
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> pure (P x) h) \<Longrightarrow> pure (forall_M P xs) h; \<And>x. x \<in> set (a # xs) \<Longrightarrow> pure (P x) h\<rbrakk> \<Longrightarrow> pure (forall_M P (a # xs)) h
[PROOF STEP]
by(auto intro!: bind_pure_I)


[STATEMENT]
lemma suminf_ennreal_eq:
  "(\<And>i. 0 \<le> f i) \<Longrightarrow> f sums x \<Longrightarrow> (\<Sum>i. ennreal (f i)) = ennreal x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. 0 \<le> f i; f sums x\<rbrakk> \<Longrightarrow> (\<Sum>i. ennreal (f i)) = ennreal x
[PROOF STEP]
using suminf_nonneg[of f] sums_unique[of f x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>summable f; \<And>n. 0 \<le> f n\<rbrakk> \<Longrightarrow> 0 \<le> suminf f
f sums x \<Longrightarrow> x = suminf f

goal (1 subgoal):
 1. \<lbrakk>\<And>i. 0 \<le> f i; f sums x\<rbrakk> \<Longrightarrow> (\<Sum>i. ennreal (f i)) = ennreal x
[PROOF STEP]
by (intro sums_unique[symmetric]) (auto simp: summable_sums_iff)


[STATEMENT]
lemma dim_eq_hyperplane:
  fixes S :: "'n::euclidean_space set"
  shows "dim S = DIM('n) - 1 \<longleftrightarrow> (\<exists>a. a \<noteq> 0 \<and> span S = {x. a \<bullet> x = 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dim S = DIM('n) - 1) = (\<exists>a. a \<noteq> (0::'n) \<and> span S = {x. a \<bullet> x = 0})
[PROOF STEP]
by (metis One_nat_def dim_hyperplane dim_span lowdim_eq_hyperplane)


[STATEMENT]
lemma "a > 0 \<Longrightarrow> b > 0 \<Longrightarrow> c > 0 \<Longrightarrow>
  filterlim (\<lambda>x::real. ((a powr x + b powr x + c powr x) / 3) powr (3 / x))
    (nhds (a * b * c)) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; 0 < b; 0 < c\<rbrakk> \<Longrightarrow> (\<lambda>x. ((a powr x + b powr x + c powr x) / 3) powr (3 / x)) \<midarrow>0\<rightarrow> a * b * c
[PROOF STEP]
by (real_asymp simp: exp_add add_divide_distrib exp_minus algebra_simps)


[STATEMENT]
theorem arden_regexp_l:
  assumes "ro(y) = 0\<^sub>r" "x \<sim> y \<cdot>\<^sub>r x +\<^sub>r z"
  shows "x \<sim> y\<^sup>\<star>\<^sub>r \<cdot>\<^sub>r z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sim> y\<^sup>\<star>\<^sub>r \<cdot>\<^sub>r z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ro y = 0\<^sub>r
x \<sim> y \<cdot>\<^sub>r x +\<^sub>r z

goal (1 subgoal):
 1. x \<sim> y\<^sup>\<star>\<^sub>r \<cdot>\<^sub>r z
[PROOF STEP]
by (transfer, metis arden_l lang.simps(4) lang.simps(5) lang.simps(6) rexp.distinct(1) rexp_ewp_l_ewp)


[STATEMENT]
lemma expands_to_sin_MSLNil:
  "(f expands_to MS (MSLNil:: ('a \<times> real) msllist) g) basis \<Longrightarrow> basis_wf basis \<Longrightarrow>
     ((\<lambda>x. sin (f x)) expands_to MS (MSLNil :: ('a :: multiseries \<times> real) msllist) (\<lambda>x. 0)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f expands_to MS MSLNil g) basis; basis_wf basis\<rbrakk> \<Longrightarrow> ((\<lambda>x. sin (f x)) expands_to MS MSLNil (\<lambda>x. 0)) basis
[PROOF STEP]
by (auto simp: expands_to.simps dominant_term_ms_aux_def intro!: is_expansion_aux.intros
           elim: eventually_elim2 is_expansion_aux.cases)


[STATEMENT]
lemma dim_special_hyperplane:
  fixes k :: "'n::euclidean_space"
  shows "k \<in> Basis \<Longrightarrow> dim {x. k \<bullet> x = 0} = DIM('n) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> Basis \<Longrightarrow> dim {x. k \<bullet> x = 0} = DIM('n) - 1
[PROOF STEP]
apply (simp add: special_hyperplane_span)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> Basis \<Longrightarrow> dim (Basis - {k}) = DIM('n) - Suc 0
[PROOF STEP]
apply (rule dim_unique [OF subset_refl])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. k \<in> Basis \<Longrightarrow> Basis - {k} \<subseteq> span (Basis - {k})
 2. k \<in> Basis \<Longrightarrow> independent (Basis - {k})
 3. k \<in> Basis \<Longrightarrow> card (Basis - {k}) = DIM('n) - Suc 0
[PROOF STEP]
apply (auto simp: independent_substdbasis)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>k \<in> Basis; x \<in> Basis; x \<notin> span (Basis - {k})\<rbrakk> \<Longrightarrow> x = k
[PROOF STEP]
apply (metis member_remove remove_def span_base)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_vm_cancel_r:
  assumes "mat_det A \<noteq> 0" and "v *\<^sub>v\<^sub>m A = v' *\<^sub>v\<^sub>m A"
  shows "v = v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = v'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det A \<noteq> 0
v *\<^sub>v\<^sub>m A = v' *\<^sub>v\<^sub>m A

goal (1 subgoal):
 1. v = v'
[PROOF STEP]
using mult_vm_inv
[PROOF STATE]
proof (prove)
using this:
mat_det A \<noteq> 0
v *\<^sub>v\<^sub>m A = v' *\<^sub>v\<^sub>m A
\<lbrakk>?x = ?y *\<^sub>v\<^sub>m ?A; mat_det ?A \<noteq> 0\<rbrakk> \<Longrightarrow> ?y = ?x *\<^sub>v\<^sub>m mat_inv ?A

goal (1 subgoal):
 1. v = v'
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_enum_subset:
  assumes "\<And>i. i < card X \<Longrightarrow> enumerate X i = enumerate Y i" and "finite X" "finite Y" "card X \<le> card Y"
  shows "X \<subseteq> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<subseteq> Y
[PROOF STEP]
by (metis assms finite_enumerate_Ex finite_enumerate_in_set less_le_trans subsetI)


[STATEMENT]
lemma suminf_SUP_eq_directed:
  fixes f :: "_ \<Rightarrow> nat \<Rightarrow> ereal"
  assumes "I \<noteq> {}"
  assumes directed: "\<And>N i j. i \<in> I \<Longrightarrow> j \<in> I \<Longrightarrow> finite N \<Longrightarrow> \<exists>k\<in>I. \<forall>n\<in>N. f i n \<le> f k n \<and> f j n \<le> f k n"
  assumes nonneg: "\<And>n i. 0 \<le> f n i"
  shows "(\<Sum>i. SUP n\<in>I. f n i) = (SUP n\<in>I. \<Sum>i. f n i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. SUP n\<in>I. f n i) = (SUP n\<in>I. \<Sum>i. f n i)
[PROOF STEP]
proof (subst (1 2) suminf_ereal_eq_SUP)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n i. 0 \<le> f n i
 2. \<And>i. 0 \<le> (SUP n\<in>I. f n i)
 3. (SUP n. \<Sum>i<n. SUP n\<in>I. f n i) = (SUP n\<in>I. SUP na. sum (f n) {..<na})
[PROOF STEP]
show "\<And>n i. 0 \<le> f n i" "\<And>i. 0 \<le> (SUP n\<in>I. f n i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n i. 0 \<le> f n i) &&& (\<And>i. 0 \<le> (SUP n\<in>I. f n i))
[PROOF STEP]
using \<open>I \<noteq> {}\<close> nonneg
[PROOF STATE]
proof (prove)
using this:
I \<noteq> {}
0 \<le> f ?n ?i

goal (1 subgoal):
 1. (\<And>n i. 0 \<le> f n i) &&& (\<And>i. 0 \<le> (SUP n\<in>I. f n i))
[PROOF STEP]
by (auto intro: SUP_upper2)
[PROOF STATE]
proof (state)
this:
0 \<le> f ?n ?i
0 \<le> (SUP n\<in>I. f n ?i)

goal (1 subgoal):
 1. (SUP n. \<Sum>i<n. SUP n\<in>I. f n i) = (SUP n\<in>I. SUP na. sum (f n) {..<na})
[PROOF STEP]
show "(SUP n. \<Sum>i<n. SUP n\<in>I. f n i) = (SUP n\<in>I. SUP j. \<Sum>i<j. f n i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP n. \<Sum>i<n. SUP n\<in>I. f n i) = (SUP n\<in>I. SUP j. sum (f n) {..<j})
[PROOF STEP]
by (auto simp: finite_subset SUP_commute SUP_ereal_sum_directed assms)
[PROOF STATE]
proof (state)
this:
(SUP n. \<Sum>i<n. SUP n\<in>I. f n i) = (SUP n\<in>I. SUP j. sum (f n) {..<j})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reflexive_cong:
  "(\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> r a b \<longleftrightarrow> r' a b) \<Longrightarrow> reflexive A r \<longleftrightarrow> reflexive A r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> A; b \<in> A\<rbrakk> \<Longrightarrow> r a b = r' a b) \<Longrightarrow> reflexive A r = reflexive A r'
[PROOF STEP]
by (simp add: reflexive_def)


[STATEMENT]
lemma insert_dom_inj_on:
  assumes inj: "inj_on f {0..<n}"
      and i: "i < Suc n" and j: "j < Suc n"
      and img: "f ` {0..<n} = {0..<Suc n} - {j}" (is "_ = ?N - _")
  shows "inj_on (insert_dom f i j) ?N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (insert_dom f i j) {0..<Suc n}
[PROOF STEP]
apply(rule eq_card_imp_inj_on)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {0..<Suc n}
 2. card (insert_dom f i j ` {0..<Suc n}) = card {0..<Suc n}
[PROOF STEP]
unfolding insert_dom_image[OF i j img]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {0..<Suc n}
 2. card {0..<Suc n} = card {0..<Suc n}
[PROOF STEP]
by simp+


[STATEMENT]
lemma [code]:
  "zip [] ys = []"
  "zip xs [] = []"
  "zip (x # xs) (y # ys) = (x, y) # zip xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip [] ys = [] &&& zip xs [] = [] &&& zip (x # xs) (y # ys) = (x, y) # zip xs ys
[PROOF STEP]
by (fact zip_Nil zip.simps(1) zip_Cons_Cons)+


[STATEMENT]
lemma sum_roots_unity:
  assumes "n > 1"
  shows   "\<Sum>{z::complex. z ^ n = 1} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
define \<omega> where "\<omega> = cis (2 * pi / real n)"
[PROOF STATE]
proof (state)
this:
\<omega> = cis (2 * pi / real n)

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
have [simp]: "\<omega> \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega> \<noteq> 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
assume "\<omega> = 1"
[PROOF STATE]
proof (state)
this:
\<omega> = 1

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
\<omega> = 1
[PROOF STEP]
obtain k :: int where "2 * pi / real n = 2 * pi * of_int k"
[PROOF STATE]
proof (prove)
using this:
1 < n
\<omega> = 1

goal (1 subgoal):
 1. (\<And>k. 2 * pi / real n = 2 * pi * real_of_int k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: \<omega>_def complex_eq_iff cos_one_2pi_int)
[PROOF STATE]
proof (state)
this:
2 * pi / real n = 2 * pi * real_of_int k

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
2 * pi / real n = 2 * pi * real_of_int k
[PROOF STEP]
have "real n * of_int k = 1"
[PROOF STATE]
proof (prove)
using this:
1 < n
2 * pi / real n = 2 * pi * real_of_int k

goal (1 subgoal):
 1. real n * real_of_int k = 1
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
real n * real_of_int k = 1

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n * real_of_int k = 1

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
have "real n * of_int k = of_int (int n * k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n * real_of_int k = real_of_int (int n * k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real n * real_of_int k = real_of_int (int n * k)

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n * real_of_int k = real_of_int (int n * k)

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
have "1 = (of_int 1 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = real_of_int 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 = real_of_int 1

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = real_of_int 1

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
note of_int_eq_iff
[PROOF STATE]
proof (state)
this:
(of_int ?w = of_int ?z) = (?w = ?z)

goal (1 subgoal):
 1. \<omega> = 1 \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
int n * k = 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
int n * k = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
int n * k = 1
1 < n

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<omega> \<noteq> 1

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
have "(\<Sum>z | z ^ n = 1. z :: complex) = (\<Sum>k<n. cis (2 * pi * real k / real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = (\<Sum>k<n. cis (2 * pi * real k / real n))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = (\<Sum>k<n. cis (2 * pi * real k / real n))
[PROOF STEP]
by (intro sum.reindex_bij_betw [symmetric] bij_betw_roots_unity) auto
[PROOF STATE]
proof (state)
this:
\<Sum> {z. z ^ n = 1} = (\<Sum>k<n. cis (2 * pi * real k / real n))

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum> {z. z ^ n = 1} = (\<Sum>k<n. cis (2 * pi * real k / real n))

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
have "\<dots> = (\<Sum>k<n. \<omega> ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n. cis (2 * pi * real k / real n)) = sum ((^) \<omega>) {..<n}
[PROOF STEP]
by (intro sum.cong refl) (auto simp: \<omega>_def DeMoivre mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. cis (2 * pi * real k / real n)) = sum ((^) \<omega>) {..<n}

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. cis (2 * pi * real k / real n)) = sum ((^) \<omega>) {..<n}

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
have "\<dots> = (\<omega> ^ n - 1) / (\<omega> - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) \<omega>) {..<n} = (\<omega> ^ n - 1) / (\<omega> - 1)
[PROOF STEP]
by (subst geometric_sum) auto
[PROOF STATE]
proof (state)
this:
sum ((^) \<omega>) {..<n} = (\<omega> ^ n - 1) / (\<omega> - 1)

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((^) \<omega>) {..<n} = (\<omega> ^ n - 1) / (\<omega> - 1)

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
have "\<omega> ^ n - 1 = cis (2 * pi) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega> ^ n - 1 = cis (2 * pi) - 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. \<omega> ^ n - 1 = cis (2 * pi) - 1
[PROOF STEP]
by (auto simp: \<omega>_def DeMoivre)
[PROOF STATE]
proof (state)
this:
\<omega> ^ n - 1 = cis (2 * pi) - 1

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<omega> ^ n - 1 = cis (2 * pi) - 1

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (2 * pi) - 1 = 0
[PROOF STEP]
by (simp add: complex_eq_iff)
[PROOF STATE]
proof (state)
this:
cis (2 * pi) - 1 = 0

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Sum> {z. z ^ n = 1} = 0 / (\<omega> - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Sum> {z. z ^ n = 1} = 0 / (\<omega> - 1)

goal (1 subgoal):
 1. \<Sum> {z. z ^ n = 1} = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Sum> {z. z ^ n = 1} = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_div_eq [simp]:
  fixes i::nat
  shows "i\<in>{a*b..<(a+1)*b} \<Longrightarrow> i div b = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> {a * b..<(a + 1) * b} \<Longrightarrow> i div b = a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<in> {a * b..<(a + 1) * b} \<Longrightarrow> i div b = a
[PROOF STEP]
fix i::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<in> {a * b..<(a + 1) * b} \<Longrightarrow> i div b = a
[PROOF STEP]
assume a:"i\<in>{a*b..<(a+1)*b}"
[PROOF STATE]
proof (state)
this:
i \<in> {a * b..<(a + 1) * b}

goal (1 subgoal):
 1. i \<in> {a * b..<(a + 1) * b} \<Longrightarrow> i div b = a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> {a * b..<(a + 1) * b}
[PROOF STEP]
have "i div b \<ge> a"
[PROOF STATE]
proof (prove)
using this:
i \<in> {a * b..<(a + 1) * b}

goal (1 subgoal):
 1. a \<le> i div b
[PROOF STEP]
by (metis Suc_eq_plus1 atLeastLessThan_iff le_refl semiring_normalization_rules(7) split_div')
[PROOF STATE]
proof (state)
this:
a \<le> i div b

goal (1 subgoal):
 1. i \<in> {a * b..<(a + 1) * b} \<Longrightarrow> i div b = a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<le> i div b

goal (1 subgoal):
 1. i \<in> {a * b..<(a + 1) * b} \<Longrightarrow> i div b = a
[PROOF STEP]
have "i div b < a+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i div b < a + 1
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
i \<in> {a * b..<(a + 1) * b}

goal (1 subgoal):
 1. i div b < a + 1
[PROOF STEP]
by (simp add: less_mult_imp_div_less)
[PROOF STATE]
proof (state)
this:
i div b < a + 1

goal (1 subgoal):
 1. i \<in> {a * b..<(a + 1) * b} \<Longrightarrow> i div b = a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a \<le> i div b
i div b < a + 1
[PROOF STEP]
show "i div b = a"
[PROOF STATE]
proof (prove)
using this:
a \<le> i div b
i div b < a + 1

goal (1 subgoal):
 1. i div b = a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i div b = a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma row_append_rows1:
  assumes A: "A \<in> carrier_mat m n"
  and B: "B \<in> carrier_mat p n"
  assumes i: "i < dim_row A"
  shows "Matrix.row (A @\<^sub>r B) i = Matrix.row A i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (A @\<^sub>r B) i = row A i
[PROOF STEP]
proof (rule eq_vecI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
 2. dim_vec (row (A @\<^sub>r B) i) = dim_vec (row A i)
[PROOF STEP]
have AB_carrier[simp]: "(A @\<^sub>r B) \<in> carrier_mat (m+p) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A @\<^sub>r B \<in> carrier_mat (m + p) n
[PROOF STEP]
by (rule carrier_append_rows[OF A B])
[PROOF STATE]
proof (state)
this:
A @\<^sub>r B \<in> carrier_mat (m + p) n

goal (2 subgoals):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
 2. dim_vec (row (A @\<^sub>r B) i) = dim_vec (row A i)
[PROOF STEP]
thus "dim_vec (Matrix.row (A @\<^sub>r B) i) = dim_vec (Matrix.row A i)"
[PROOF STATE]
proof (prove)
using this:
A @\<^sub>r B \<in> carrier_mat (m + p) n

goal (1 subgoal):
 1. dim_vec (row (A @\<^sub>r B) i) = dim_vec (row A i)
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A @\<^sub>r B \<in> carrier_mat (m + p) n
A \<in> carrier_mat m n
B \<in> carrier_mat p n

goal (1 subgoal):
 1. dim_vec (row (A @\<^sub>r B) i) = dim_vec (row A i)
[PROOF STEP]
by (auto, insert carrier_matD(2), blast)
[PROOF STATE]
proof (state)
this:
dim_vec (row (A @\<^sub>r B) i) = dim_vec (row A i)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
[PROOF STEP]
assume j: "j < dim_vec (Matrix.row A i)"
[PROOF STATE]
proof (state)
this:
j < dim_vec (row A i)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
[PROOF STEP]
have "Matrix.row (A @\<^sub>r B) i $v j = (A @\<^sub>r B) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (A @\<^sub>r B) i $v j = (A @\<^sub>r B) $$ (i, j)
[PROOF STEP]
by (metis AB_carrier Matrix.row_def j A carrier_matD(2) index_row(2) index_vec)
[PROOF STATE]
proof (state)
this:
row (A @\<^sub>r B) i $v j = (A @\<^sub>r B) $$ (i, j)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row (A @\<^sub>r B) i $v j = (A @\<^sub>r B) $$ (i, j)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
[PROOF STEP]
have "... = (if i < dim_row A then A $$ (i, j) else B $$ (i - m, j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>r B) $$ (i, j) = (if i < dim_row A then A $$ (i, j) else B $$ (i - m, j))
[PROOF STEP]
by (rule append_rows_nth, insert assms j, auto)
[PROOF STATE]
proof (state)
this:
(A @\<^sub>r B) $$ (i, j) = (if i < dim_row A then A $$ (i, j) else B $$ (i - m, j))

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A @\<^sub>r B) $$ (i, j) = (if i < dim_row A then A $$ (i, j) else B $$ (i - m, j))

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
[PROOF STEP]
have "... = A$$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dim_row A then A $$ (i, j) else B $$ (i - m, j)) = A $$ (i, j)
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < dim_row A

goal (1 subgoal):
 1. (if i < dim_row A then A $$ (i, j) else B $$ (i - m, j)) = A $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if i < dim_row A then A $$ (i, j) else B $$ (i - m, j)) = A $$ (i, j)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row A i) \<Longrightarrow> row (A @\<^sub>r B) i $v ia = row A i $v ia
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
row (A @\<^sub>r B) i $v j = A $$ (i, j)
[PROOF STEP]
show "Matrix.row (A @\<^sub>r B) i $v j = Matrix.row A i $v j"
[PROOF STATE]
proof (prove)
using this:
row (A @\<^sub>r B) i $v j = A $$ (i, j)

goal (1 subgoal):
 1. row (A @\<^sub>r B) i $v j = row A i $v j
[PROOF STEP]
using i j
[PROOF STATE]
proof (prove)
using this:
row (A @\<^sub>r B) i $v j = A $$ (i, j)
i < dim_row A
j < dim_vec (row A i)

goal (1 subgoal):
 1. row (A @\<^sub>r B) i $v j = row A i $v j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row (A @\<^sub>r B) i $v j = row A i $v j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vcard_neq_vempty: "vcard A \<noteq> 0\<^sub>\<nat> \<longleftrightarrow> A \<noteq> 0\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vcard A \<noteq> 0\<^sub>\<nat>) = (A \<noteq> 0\<^sub>\<nat>)
[PROOF STEP]
using vcard_vempty
[PROOF STATE]
proof (prove)
using this:
(vcard ?A = 0) = (?A = 0)

goal (1 subgoal):
 1. (vcard A \<noteq> 0\<^sub>\<nat>) = (A \<noteq> 0\<^sub>\<nat>)
[PROOF STEP]
by auto


[STATEMENT]
lemma functions_of_is_surj_on:
  assumes "finite A" "finite B"
  assumes "partition_on A P" "card P = card B"
  shows "univ (\<lambda>f. f ` A = B) (functions_of P A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
have "functions_of P A B \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. functions_of P A B \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
using functions_of \<open>finite A\<close> \<open>finite B\<close> \<open>partition_on A P\<close> \<open>card P = card B\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; finite ?B; partition_on ?A ?P; card ?P \<le> card ?B\<rbrakk> \<Longrightarrow> functions_of ?P ?A ?B \<in> (?A \<rightarrow>\<^sub>E ?B) // range_permutation ?A ?B
finite A
finite B
partition_on A P
card P = card B

goal (1 subgoal):
 1. functions_of P A B \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
functions_of P A B \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
functions_of P A B \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
obtain f where eq_f: "functions_of P A B = range_permutation A B `` {f}" and "f \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (prove)
using this:
functions_of P A B \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>functions_of P A B = range_permutation A B `` {f}; f \<in> A \<rightarrow>\<^sub>E B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using quotientE
[PROOF STATE]
proof (prove)
using this:
functions_of P A B \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B
\<lbrakk>?X \<in> ?A // ?r; \<And>x. \<lbrakk>?X = ?r `` {x}; x \<in> ?A\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>functions_of P A B = range_permutation A B `` {f}; f \<in> A \<rightarrow>\<^sub>E B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
functions_of P A B = range_permutation A B `` {f}
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
from eq_f
[PROOF STATE]
proof (chain)
picking this:
functions_of P A B = range_permutation A B `` {f}
[PROOF STEP]
have "f \<in> functions_of P A B"
[PROOF STATE]
proof (prove)
using this:
functions_of P A B = range_permutation A B `` {f}

goal (1 subgoal):
 1. f \<in> functions_of P A B
[PROOF STEP]
using \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> equiv_range_permutation equiv_class_self
[PROOF STATE]
proof (prove)
using this:
functions_of P A B = range_permutation A B `` {f}
f \<in> A \<rightarrow>\<^sub>E B
equiv (?A \<rightarrow>\<^sub>E ?B) (range_permutation ?A ?B)
\<lbrakk>equiv ?A ?r; ?a \<in> ?A\<rbrakk> \<Longrightarrow> ?a \<in> ?r `` {?a}

goal (1 subgoal):
 1. f \<in> functions_of P A B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f \<in> functions_of P A B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
from \<open>f \<in> functions_of P A B\<close>
[PROOF STATE]
proof (chain)
picking this:
f \<in> functions_of P A B
[PROOF STEP]
have eq: "(\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P"
[PROOF STATE]
proof (prove)
using this:
f \<in> functions_of P A B

goal (1 subgoal):
 1. (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P
[PROOF STEP]
unfolding functions_of_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {f \<in> A \<rightarrow>\<^sub>E B. (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P}

goal (1 subgoal):
 1. (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P
[PROOF STEP]
have "card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
using \<open>card P = card B\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P
card P = card B

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
from \<open>finite B\<close> \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> this
[PROOF STATE]
proof (chain)
picking this:
finite B
f \<in> A \<rightarrow>\<^sub>E B
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
have "f ` A = B"
[PROOF STATE]
proof (prove)
using this:
finite B
f \<in> A \<rightarrow>\<^sub>E B
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B

goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
using card_eq_implies_surjective_on
[PROOF STATE]
proof (prove)
using this:
finite B
f \<in> A \<rightarrow>\<^sub>E B
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
\<lbrakk>finite ?B; ?f \<in> ?A \<rightarrow>\<^sub>E ?B; card ((\<lambda>b. {x \<in> ?A. ?f x = b}) ` ?B - {{}}) = card ?B\<rbrakk> \<Longrightarrow> ?f ` ?A = ?B

goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
f ` A = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (functions_of P A B)
[PROOF STEP]
unfolding eq_f
[PROOF STATE]
proof (prove)
using this:
f ` A = B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (range_permutation A B `` {f})
[PROOF STEP]
using equiv_range_permutation surj_on_respects_range_permutation \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (prove)
using this:
f ` A = B
equiv (?A \<rightarrow>\<^sub>E ?B) (range_permutation ?A ?B)
(\<lambda>f. f ` ?A = ?B) respects range_permutation ?A ?B
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. univ (\<lambda>f. f ` A = B) (range_permutation A B `` {f})
[PROOF STEP]
by (subst univ_commute') assumption+
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. f ` A = B) (functions_of P A B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_filter_map: "List.map_filter f (map g l) = List.map_filter (f o g) l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.map_filter f (map g l) = List.map_filter (f \<circ> g) l
[PROOF STEP]
proof (induction l)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. List.map_filter f (map g []) = List.map_filter (f \<circ> g) []
 2. \<And>a l. List.map_filter f (map g l) = List.map_filter (f \<circ> g) l \<Longrightarrow> List.map_filter f (map g (a # l)) = List.map_filter (f \<circ> g) (a # l)
[PROOF STEP]
show "List.map_filter f (map g []) = List.map_filter (f \<circ> g) []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.map_filter f (map g []) = List.map_filter (f \<circ> g) []
[PROOF STEP]
by (simp add: map_filter_simps)
[PROOF STATE]
proof (state)
this:
List.map_filter f (map g []) = List.map_filter (f \<circ> g) []

goal (1 subgoal):
 1. \<And>a l. List.map_filter f (map g l) = List.map_filter (f \<circ> g) l \<Longrightarrow> List.map_filter f (map g (a # l)) = List.map_filter (f \<circ> g) (a # l)
[PROOF STEP]
show "List.map_filter f (map g (a # l)) = List.map_filter (f \<circ> g) (a # l)"
    if "List.map_filter f (map g l) = List.map_filter (f \<circ> g) l"
    for a :: 'c
      and l :: "'c list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. List.map_filter f (map g (a # l)) = List.map_filter (f \<circ> g) (a # l)
[PROOF STEP]
using that  map_filter_simps(1)
[PROOF STATE]
proof (prove)
using this:
List.map_filter f (map g l) = List.map_filter (f \<circ> g) l
List.map_filter ?f (?x # ?xs) = (case ?f ?x of None \<Rightarrow> List.map_filter ?f ?xs | Some y \<Rightarrow> y # List.map_filter ?f ?xs)

goal (1 subgoal):
 1. List.map_filter f (map g (a # l)) = List.map_filter (f \<circ> g) (a # l)
[PROOF STEP]
by (metis comp_eq_dest_lhs list.simps(9))
[PROOF STATE]
proof (state)
this:
List.map_filter f (map g ?l) = List.map_filter (f \<circ> g) ?l \<Longrightarrow> List.map_filter f (map g (?a # ?l)) = List.map_filter (f \<circ> g) (?a # ?l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma projection_fixes_image:
  fixes M :: \<open>('a::chilbert_space) set\<close>
  assumes "closed_csubspace M" and "x \<in> M"
  shows "projection M x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projection M x = x
[PROOF STEP]
using is_projection_on_fixes_image
    \<comment> \<open>Theorem 2.7 in @{cite conway2013course}\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_projection_on ?\<pi> ?M; ?x \<in> ?M\<rbrakk> \<Longrightarrow> ?\<pi> ?x = ?x

goal (1 subgoal):
 1. projection M x = x
[PROOF STEP]
by (simp add: assms complex_vector.subspace_0 projection_eqI)


[STATEMENT]
lemma homeomorphic_subspaces_eq:
  fixes S T:: "'a::euclidean_space set"
  assumes "subspace S" "subspace T"
  shows "S homeomorphic T \<longleftrightarrow> dim S = dim T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S homeomorphic T = (dim S = dim T)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S homeomorphic T \<Longrightarrow> dim S = dim T
 2. dim S = dim T \<Longrightarrow> S homeomorphic T
[PROOF STEP]
show "dim S = dim T"
    if "S homeomorphic T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
have "Euclidean_space (dim S) homeomorphic_space top_of_set S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Euclidean_space (dim S) homeomorphic_space top_of_set S
[PROOF STEP]
using \<open>subspace S\<close> homeomorphic_space_sym homeomorphic_subspace_Euclidean_space_dim
[PROOF STATE]
proof (prove)
using this:
subspace S
(?X homeomorphic_space ?Y) = (?Y homeomorphic_space ?X)
subspace ?S \<Longrightarrow> top_of_set ?S homeomorphic_space Euclidean_space (dim ?S)

goal (1 subgoal):
 1. Euclidean_space (dim S) homeomorphic_space top_of_set S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Euclidean_space (dim S) homeomorphic_space top_of_set S

goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Euclidean_space (dim S) homeomorphic_space top_of_set S

goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
have "\<dots> homeomorphic_space top_of_set T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top_of_set S homeomorphic_space top_of_set T
[PROOF STEP]
by (simp add: that)
[PROOF STATE]
proof (state)
this:
top_of_set S homeomorphic_space top_of_set T

goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
top_of_set S homeomorphic_space top_of_set T

goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
have "\<dots> homeomorphic_space Euclidean_space (dim T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top_of_set T homeomorphic_space Euclidean_space (dim T)
[PROOF STEP]
by (simp add: homeomorphic_subspace_Euclidean_space assms)
[PROOF STATE]
proof (state)
this:
top_of_set T homeomorphic_space Euclidean_space (dim T)

goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Euclidean_space (dim S) homeomorphic_space Euclidean_space (dim T)
[PROOF STEP]
have "Euclidean_space (dim S) homeomorphic_space Euclidean_space (dim T)"
[PROOF STATE]
proof (prove)
using this:
Euclidean_space (dim S) homeomorphic_space Euclidean_space (dim T)

goal (1 subgoal):
 1. Euclidean_space (dim S) homeomorphic_space Euclidean_space (dim T)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Euclidean_space (dim S) homeomorphic_space Euclidean_space (dim T)

goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Euclidean_space (dim S) homeomorphic_space Euclidean_space (dim T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Euclidean_space (dim S) homeomorphic_space Euclidean_space (dim T)

goal (1 subgoal):
 1. dim S = dim T
[PROOF STEP]
by (simp add: invariance_of_dimension_Euclidean_space)
[PROOF STATE]
proof (state)
this:
dim S = dim T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
S homeomorphic T \<Longrightarrow> dim S = dim T

goal (1 subgoal):
 1. dim S = dim T \<Longrightarrow> S homeomorphic T
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim S = dim T \<Longrightarrow> S homeomorphic T
[PROOF STEP]
show "S homeomorphic T"
    if "dim S = dim T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S homeomorphic T
[PROOF STEP]
by (metis that assms homeomorphic_subspaces)
[PROOF STATE]
proof (state)
this:
dim S = dim T \<Longrightarrow> S homeomorphic T

goal:
No subgoals!
[PROOF STEP]
qed