[STATEMENT]
lemma winding_number_unique:
  assumes \<gamma>: "path \<gamma>" "z \<notin> path_image \<gamma>"
      and pi: "\<And>e. e>0 \<Longrightarrow> \<exists>p. winding_number_prop \<gamma> z e p n"
   shows "winding_number \<gamma> z = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
have "path_image \<gamma> \<subseteq> UNIV - {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> UNIV - {z}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path \<gamma>
z \<notin> path_image \<gamma>
0 < ?e \<Longrightarrow> \<exists>p. winding_number_prop \<gamma> z ?e p n

goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> UNIV - {z}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
path_image \<gamma> \<subseteq> UNIV - {z}

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path_image \<gamma> \<subseteq> UNIV - {z}
[PROOF STEP]
obtain e
    where e: "e>0"
      and pi_eq: "\<And>h1 h2 f. \<lbrakk>valid_path h1; valid_path h2;
                    (\<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < e \<and> cmod (h2 t - \<gamma> t) < e);
                    pathstart h2 = pathstart h1; pathfinish h2 = pathfinish h1; f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow>
                    contour_integral h2 f = contour_integral h1 f"
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> UNIV - {z}

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; \<And>h1 h2 f. \<lbrakk>valid_path h1; valid_path h2; \<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < e \<and> cmod (h2 t - \<gamma> t) < e; pathstart h2 = pathstart h1; pathfinish h2 = pathfinish h1; f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow> contour_integral h2 f = contour_integral h1 f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using contour_integral_nearby_ends [of "UNIV - {z}" \<gamma>] assms
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> UNIV - {z}
\<lbrakk>open (UNIV - {z}); path \<gamma>; path_image \<gamma> \<subseteq> UNIV - {z}\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>g h. valid_path g \<and> valid_path h \<and> (\<forall>t\<in>{0..1}. cmod (g t - \<gamma> t) < d \<and> cmod (h t - \<gamma> t) < d) \<and> pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<longrightarrow> path_image g \<subseteq> UNIV - {z} \<and> path_image h \<subseteq> UNIV - {z} \<and> (\<forall>f. f holomorphic_on UNIV - {z} \<longrightarrow> contour_integral h f = contour_integral g f)
path \<gamma>
z \<notin> path_image \<gamma>
0 < ?e \<Longrightarrow> \<exists>p. winding_number_prop \<gamma> z ?e p n

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; \<And>h1 h2 f. \<lbrakk>valid_path h1; valid_path h2; \<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < e \<and> cmod (h2 t - \<gamma> t) < e; pathstart h2 = pathstart h1; pathfinish h2 = pathfinish h1; f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow> contour_integral h2 f = contour_integral h1 f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: open_delete)
[PROOF STATE]
proof (state)
this:
0 < e
\<lbrakk>valid_path ?h1.0; valid_path ?h2.0; \<forall>t\<in>{0..1}. cmod (?h1.0 t - \<gamma> t) < e \<and> cmod (?h2.0 t - \<gamma> t) < e; pathstart ?h2.0 = pathstart ?h1.0; pathfinish ?h2.0 = pathfinish ?h1.0; ?f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow> contour_integral ?h2.0 ?f = contour_integral ?h1.0 ?f

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
obtain p where p: "winding_number_prop \<gamma> z e p n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. winding_number_prop \<gamma> z e p n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using pi [OF e]
[PROOF STATE]
proof (prove)
using this:
\<exists>p. winding_number_prop \<gamma> z e p n

goal (1 subgoal):
 1. (\<And>p. winding_number_prop \<gamma> z e p n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
winding_number_prop \<gamma> z e p n

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
obtain q where q: "winding_number_prop \<gamma> z e q (winding_number \<gamma> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q. winding_number_prop \<gamma> z e q (winding_number \<gamma> z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using winding_number [OF \<gamma> e]
[PROOF STATE]
proof (prove)
using this:
\<exists>p. winding_number_prop \<gamma> z e p (winding_number \<gamma> z)

goal (1 subgoal):
 1. (\<And>q. winding_number_prop \<gamma> z e q (winding_number \<gamma> z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
winding_number_prop \<gamma> z e q (winding_number \<gamma> z)

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
have "2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
winding_number_prop \<gamma> z e p n

goal (1 subgoal):
 1. 2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))
[PROOF STEP]
by (auto simp: winding_number_prop_def)
[PROOF STATE]
proof (state)
this:
2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
have "\<dots> = contour_integral q (\<lambda>w. 1 / (w - z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral p (\<lambda>w. 1 / (w - z)) = contour_integral q (\<lambda>w. 1 / (w - z))
[PROOF STEP]
proof (rule pi_eq)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. valid_path q
 2. valid_path p
 3. \<forall>t\<in>{0..1}. cmod (q t - \<gamma> t) < e \<and> cmod (p t - \<gamma> t) < e
 4. pathstart p = pathstart q
 5. pathfinish p = pathfinish q
 6. (\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}
[PROOF STEP]
show "(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}
[PROOF STEP]
by (auto intro!: holomorphic_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}

goal (5 subgoals):
 1. valid_path q
 2. valid_path p
 3. \<forall>t\<in>{0..1}. cmod (q t - \<gamma> t) < e \<and> cmod (p t - \<gamma> t) < e
 4. pathstart p = pathstart q
 5. pathfinish p = pathfinish q
[PROOF STEP]
qed (use p q in \<open>auto simp: winding_number_prop_def norm_minus_commute\<close>)
[PROOF STATE]
proof (state)
this:
contour_integral p (\<lambda>w. 1 / (w - z)) = contour_integral q (\<lambda>w. 1 / (w - z))

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral p (\<lambda>w. 1 / (w - z)) = contour_integral q (\<lambda>w. 1 / (w - z))

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
have "\<dots> = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral q (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
using q
[PROOF STATE]
proof (prove)
using this:
winding_number_prop \<gamma> z e q (winding_number \<gamma> z)

goal (1 subgoal):
 1. contour_integral q (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
by (auto simp: winding_number_prop_def)
[PROOF STATE]
proof (state)
this:
contour_integral q (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
have "2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z"
[PROOF STATE]
proof (prove)
using this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. 2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z = n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Diff1_foldSetD:
  "\<lbrakk>(A - {x}, y) \<in> foldSetD D f e; x \<in> A; f x y \<in> D\<rbrakk> \<Longrightarrow>
   (A, f x y) \<in> foldSetD D f e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(A - {x}, y) \<in> foldSetD D f e; x \<in> A; f x y \<in> D\<rbrakk> \<Longrightarrow> (A, f x y) \<in> foldSetD D f e
[PROOF STEP]
by (metis Diff_insert_absorb foldSetD.insertI mk_disjoint_insert)


[STATEMENT]
lemma DERIV_neg_imp_decreasing_open:
  fixes a b :: real
    and f :: "real \<Rightarrow> real"
  assumes "a < b"
    and "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> \<exists>y. DERIV f x :> y \<and> y < 0"
    and con: "continuous_on {a..b} f"
  shows "f a > f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f b < f a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f b < f a
[PROOF STEP]
have "(\<lambda>x. -f x) a < (\<lambda>x. -f x) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - f a < - f b
[PROOF STEP]
proof (rule DERIV_pos_imp_increasing_open [of a b])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. a < b
 2. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>a. - f a) has_real_derivative y) (at x) \<and> 0 < y
 3. continuous_on {a..b} (\<lambda>a. - f a)
[PROOF STEP]
show "\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at x) \<and> 0 < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at x) \<and> 0 < y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < b
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> \<exists>y. (f has_real_derivative y) (at ?x) \<and> y < 0
continuous_on {a..b} f

goal (1 subgoal):
 1. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at x) \<and> 0 < y
[PROOF STEP]
by simp (metis field_differentiable_minus neg_0_less_iff_less)
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at ?x) \<and> 0 < y

goal (2 subgoals):
 1. a < b
 2. continuous_on {a..b} (\<lambda>a. - f a)
[PROOF STEP]
show "continuous_on {a..b} (\<lambda>x. - f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. - f x)
[PROOF STEP]
using con continuous_on_minus
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} f
continuous_on ?s ?f \<Longrightarrow> continuous_on ?s (\<lambda>x. - ?f x)

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. - f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. - f x)

goal (1 subgoal):
 1. a < b
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
- f a < - f b

goal (1 subgoal):
 1. f b < f a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- f a < - f b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- f a < - f b

goal (1 subgoal):
 1. f b < f a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f b < f a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_mon [intro]: "x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y\<^sup>\<star>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y\<^sup>\<star>
[PROOF STEP]
assume "x \<le> y"
[PROOF STATE]
proof (state)
this:
x \<le> y

goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y\<^sup>\<star>
[PROOF STEP]
hence "x \<le> y\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
x \<le> y

goal (1 subgoal):
 1. x \<le> y\<^sup>\<star>
[PROOF STEP]
by (meson local.dual_order.trans local.join.le_supE local.star_rtc1)
[PROOF STATE]
proof (state)
this:
x \<le> y\<^sup>\<star>

goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y\<^sup>\<star>
[PROOF STEP]
hence "1 + x + y\<^sup>\<star> \<cdot> y\<^sup>\<star> \<le> y\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
x \<le> y\<^sup>\<star>

goal (1 subgoal):
 1. (1::'a) + x + y\<^sup>\<star> \<cdot> y\<^sup>\<star> \<le> y\<^sup>\<star>
[PROOF STEP]
using local.star_rtc1
[PROOF STATE]
proof (prove)
using this:
x \<le> y\<^sup>\<star>
(1::'a) + ?x\<^sup>\<star> \<cdot> ?x\<^sup>\<star> + ?x \<le> ?x\<^sup>\<star>

goal (1 subgoal):
 1. (1::'a) + x + y\<^sup>\<star> \<cdot> y\<^sup>\<star> \<le> y\<^sup>\<star>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1::'a) + x + y\<^sup>\<star> \<cdot> y\<^sup>\<star> \<le> y\<^sup>\<star>

goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y\<^sup>\<star>
[PROOF STEP]
thus "x\<^sup>\<star> \<le> y\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
(1::'a) + x + y\<^sup>\<star> \<cdot> y\<^sup>\<star> \<le> y\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> y\<^sup>\<star>
[PROOF STEP]
by (simp add: local.star_rtc2)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> y\<^sup>\<star>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma psi_odd_mono: "m \<le> n \<Longrightarrow> psi_odd m \<le> psi_odd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> psi_odd m \<le> psi_odd n
[PROOF STEP]
using mangoldt_odd_pos sum_mono2[of "{1..n}" "{1..m}" "mangoldt_odd"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> mangoldt_odd ?d
\<lbrakk>finite {1..n}; {1..m} \<subseteq> {1..n}; \<And>b. b \<in> {1..n} - {1..m} \<Longrightarrow> 0 \<le> mangoldt_odd b\<rbrakk> \<Longrightarrow> sum mangoldt_odd {1..m} \<le> sum mangoldt_odd {1..n}

goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> psi_odd m \<le> psi_odd n
[PROOF STEP]
by (simp add: psi_odd_def)


[STATEMENT]
lemma incratseq_0_less [simp]: "of_rat(incratseq x 0) < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_rat (incratseq x 0) < x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_rat (incratseq x 0) < x
[PROOF STEP]
have "x - 1 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - 1 < x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - 1 < x

goal (1 subgoal):
 1. real_of_rat (incratseq x 0) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - 1 < x
[PROOF STEP]
have "\<exists>q. x - 1 < real_of_rat q \<and> real_of_rat q < x"
[PROOF STATE]
proof (prove)
using this:
x - 1 < x

goal (1 subgoal):
 1. \<exists>q. x - 1 < real_of_rat q \<and> real_of_rat q < x
[PROOF STEP]
using of_rat_dense
[PROOF STATE]
proof (prove)
using this:
x - 1 < x
?x < ?y \<Longrightarrow> \<exists>q. ?x < real_of_rat q \<and> real_of_rat q < ?y

goal (1 subgoal):
 1. \<exists>q. x - 1 < real_of_rat q \<and> real_of_rat q < x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>q. x - 1 < real_of_rat q \<and> real_of_rat q < x

goal (1 subgoal):
 1. real_of_rat (incratseq x 0) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>q. x - 1 < real_of_rat q \<and> real_of_rat q < x
[PROOF STEP]
obtain q where " x - 1 < real_of_rat q \<and> real_of_rat q < x"
[PROOF STATE]
proof (prove)
using this:
\<exists>q. x - 1 < real_of_rat q \<and> real_of_rat q < x

goal (1 subgoal):
 1. (\<And>q. x - 1 < real_of_rat q \<and> real_of_rat q < x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x - 1 < real_of_rat q \<and> real_of_rat q < x

goal (1 subgoal):
 1. real_of_rat (incratseq x 0) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - 1 < real_of_rat q \<and> real_of_rat q < x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x - 1 < real_of_rat q \<and> real_of_rat q < x

goal (1 subgoal):
 1. real_of_rat (incratseq x 0) < x
[PROOF STEP]
by (auto intro: someI2)
[PROOF STATE]
proof (state)
this:
real_of_rat (incratseq x 0) < x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tau_om_nu:
assumes  "\<And>x y z. x \<cdot> (d y \<cdot> z) = (x \<cdot> d y ) \<cdot> z"
shows "\<tau> ((\<nu> x)\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
have "\<tau> ((\<nu> x)\<^sup>\<omega>) = \<tau> (\<nabla> (\<nu> x) \<cdot> U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> (\<nu> x\<^sup>\<omega>) = \<tau> (\<nabla> (\<nu> x) \<cdot> U)
[PROOF STEP]
by (metis assms nabla_omega_U)
[PROOF STATE]
proof (state)
this:
\<tau> (\<nu> x\<^sup>\<omega>) = \<tau> (\<nabla> (\<nu> x) \<cdot> U)

goal (1 subgoal):
 1. \<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<tau> (\<nu> x\<^sup>\<omega>) = \<tau> (\<nabla> (\<nu> x) \<cdot> U)

goal (1 subgoal):
 1. \<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
have "... = \<nabla> (\<nu> x) \<cdot> \<tau> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> (\<nabla> (\<nu> x) \<cdot> U) = \<nabla> (\<nu> x) \<cdot> \<tau> U
[PROOF STEP]
using local.tau_s_prod
[PROOF STATE]
proof (prove)
using this:
\<tau> (?x \<cdot> ?y) = ?x \<cdot> \<tau> ?y

goal (1 subgoal):
 1. \<tau> (\<nabla> (\<nu> x) \<cdot> U) = \<nabla> (\<nu> x) \<cdot> \<tau> U
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<tau> (\<nabla> (\<nu> x) \<cdot> U) = \<nabla> (\<nu> x) \<cdot> \<tau> U

goal (1 subgoal):
 1. \<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> \<tau> U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> \<tau> U

goal (1 subgoal):
 1. \<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
using local.tau_U
[PROOF STATE]
proof (prove)
using this:
\<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> \<tau> U
\<tau> U = 1\<^sub>\<pi>

goal (1 subgoal):
 1. \<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<tau> (\<nu> x\<^sup>\<omega>) = \<nabla> (\<nu> x) \<cdot> 1\<^sub>\<pi>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subspace_sum: "subspace A \<Longrightarrow> (\<And>x. x \<in> B \<Longrightarrow> f x \<in> A) \<Longrightarrow> sum f B \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subspace A; \<And>x. x \<in> B \<Longrightarrow> f x \<in> A\<rbrakk> \<Longrightarrow> sum f B \<in> A
[PROOF STEP]
by (induct B rule: infinite_finite_induct) (auto simp add: subspace_add subspace_0)


[STATEMENT]
lemma suminf_ereal:
  assumes "\<And>i. 0 \<le> f i"
    and "(\<Sum>i. ereal (f i)) \<noteq> \<infinity>"
  shows "(\<Sum>i. ereal (f i)) = ereal (suminf f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. ereal (f i)) = ereal (suminf f)
[PROOF STEP]
proof (rule sums_unique[symmetric])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>i. ereal (f i)) sums ereal (suminf f)
[PROOF STEP]
from summable_ereal[OF assms]
[PROOF STATE]
proof (chain)
picking this:
summable f
[PROOF STEP]
show "(\<lambda>x. ereal (f x)) sums (ereal (suminf f))"
[PROOF STATE]
proof (prove)
using this:
summable f

goal (1 subgoal):
 1. (\<lambda>x. ereal (f x)) sums ereal (suminf f)
[PROOF STEP]
unfolding sums_ereal
[PROOF STATE]
proof (prove)
using this:
summable f

goal (1 subgoal):
 1. f sums suminf f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
summable f
0 \<le> f ?i
(\<Sum>i. ereal (f i)) \<noteq> \<infinity>

goal (1 subgoal):
 1. f sums suminf f
[PROOF STEP]
by (intro summable_sums summable_ereal)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (f x)) sums ereal (suminf f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma limited_family_union: "finite B \<Longrightarrow> \<forall>P\<in>B. card P \<le> k \<Longrightarrow> card (\<Union>B) \<le> card B * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite B; \<forall>P\<in>B. card P \<le> k\<rbrakk> \<Longrightarrow> card (\<Union> B) \<le> card B * k
[PROOF STEP]
proof (induction B rule:finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>P\<in>{}. card P \<le> k \<Longrightarrow> card (\<Union> {}) \<le> card {} * k
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>P\<in>F. card P \<le> k \<Longrightarrow> card (\<Union> F) \<le> card F * k; \<forall>P\<in>insert x F. card P \<le> k\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> card (insert x F) * k
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<forall>P\<in>{}. card P \<le> k

goal (2 subgoals):
 1. \<forall>P\<in>{}. card P \<le> k \<Longrightarrow> card (\<Union> {}) \<le> card {} * k
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>P\<in>F. card P \<le> k \<Longrightarrow> card (\<Union> F) \<le> card F * k; \<forall>P\<in>insert x F. card P \<le> k\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> card (insert x F) * k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>P\<in>{}. card P \<le> k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>P\<in>{}. card P \<le> k

goal (1 subgoal):
 1. card (\<Union> {}) \<le> card {} * k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (\<Union> {}) \<le> card {} * k

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>P\<in>F. card P \<le> k \<Longrightarrow> card (\<Union> F) \<le> card F * k; \<forall>P\<in>insert x F. card P \<le> k\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> card (insert x F) * k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>P\<in>F. card P \<le> k \<Longrightarrow> card (\<Union> F) \<le> card F * k; \<forall>P\<in>insert x F. card P \<le> k\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> card (insert x F) * k
[PROOF STEP]
case (insert P B)
[PROOF STATE]
proof (state)
this:
finite B
P \<notin> B
\<forall>P\<in>B. card P \<le> k \<Longrightarrow> card (\<Union> B) \<le> card B * k
\<forall>P\<in>insert P B. card P \<le> k

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>P\<in>F. card P \<le> k \<Longrightarrow> card (\<Union> F) \<le> card F * k; \<forall>P\<in>insert x F. card P \<le> k\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> card (insert x F) * k
[PROOF STEP]
have "card (\<Union>(insert P B)) \<le> card P + card (\<Union>B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> (insert P B)) \<le> card P + card (\<Union> B)
[PROOF STEP]
by (simp add: card_Un_le)
[PROOF STATE]
proof (state)
this:
card (\<Union> (insert P B)) \<le> card P + card (\<Union> B)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>P\<in>F. card P \<le> k \<Longrightarrow> card (\<Union> F) \<le> card F * k; \<forall>P\<in>insert x F. card P \<le> k\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> card (insert x F) * k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (\<Union> (insert P B)) \<le> card P + card (\<Union> B)
[PROOF STEP]
have "card (\<Union>(insert P B)) \<le> card P + card B * k"
[PROOF STATE]
proof (prove)
using this:
card (\<Union> (insert P B)) \<le> card P + card (\<Union> B)

goal (1 subgoal):
 1. card (\<Union> (insert P B)) \<le> card P + card B * k
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
card (\<Union> (insert P B)) \<le> card P + card (\<Union> B)
finite B
P \<notin> B
\<forall>P\<in>B. card P \<le> k \<Longrightarrow> card (\<Union> B) \<le> card B * k
\<forall>P\<in>insert P B. card P \<le> k

goal (1 subgoal):
 1. card (\<Union> (insert P B)) \<le> card P + card B * k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (\<Union> (insert P B)) \<le> card P + card B * k

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>P\<in>F. card P \<le> k \<Longrightarrow> card (\<Union> F) \<le> card F * k; \<forall>P\<in>insert x F. card P \<le> k\<rbrakk> \<Longrightarrow> card (\<Union> (insert x F)) \<le> card (insert x F) * k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (\<Union> (insert P B)) \<le> card P + card B * k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card (\<Union> (insert P B)) \<le> card P + card B * k

goal (1 subgoal):
 1. card (\<Union> (insert P B)) \<le> card (insert P B) * k
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
card (\<Union> (insert P B)) \<le> card P + card B * k
finite B
P \<notin> B
\<forall>P\<in>B. card P \<le> k \<Longrightarrow> card (\<Union> B) \<le> card B * k
\<forall>P\<in>insert P B. card P \<le> k

goal (1 subgoal):
 1. card (\<Union> (insert P B)) \<le> card (insert P B) * k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (\<Union> (insert P B)) \<le> card (insert P B) * k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_mult_eq_left_unit:
  fixes p q :: "'a :: comm_semiring_1 poly"
  assumes unit: "lead_coeff p dvd 1" and q0: "q \<noteq> 0"
  shows "degree (p * q) = degree p + degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (p * q) = degree p + degree q
[PROOF STEP]
proof(intro degree_mult_eq2 notI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
from unit
[PROOF STATE]
proof (chain)
picking this:
lead_coeff p dvd (1::'a)
[PROOF STEP]
obtain c where "lead_coeff p * c = 1"
[PROOF STATE]
proof (prove)
using this:
lead_coeff p dvd (1::'a)

goal (1 subgoal):
 1. (\<And>c. lead_coeff p * c = (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim dvdE,auto)
[PROOF STATE]
proof (state)
this:
lead_coeff p * c = (1::'a)

goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lead_coeff p * c = (1::'a)
[PROOF STEP]
have "c * lead_coeff p = 1"
[PROOF STATE]
proof (prove)
using this:
lead_coeff p * c = (1::'a)

goal (1 subgoal):
 1. c * lead_coeff p = (1::'a)
[PROOF STEP]
by (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
c * lead_coeff p = (1::'a)

goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c * lead_coeff p = (1::'a)

goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
assume "lead_coeff p * lead_coeff q = 0"
[PROOF STATE]
proof (state)
this:
lead_coeff p * lead_coeff q = (0::'a)

goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lead_coeff p * lead_coeff q = (0::'a)
[PROOF STEP]
have "c * lead_coeff p * lead_coeff q = 0"
[PROOF STATE]
proof (prove)
using this:
lead_coeff p * lead_coeff q = (0::'a)

goal (1 subgoal):
 1. c * lead_coeff p * lead_coeff q = (0::'a)
[PROOF STEP]
by (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
c * lead_coeff p * lead_coeff q = (0::'a)

goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c * lead_coeff p = (1::'a)
c * lead_coeff p * lead_coeff q = (0::'a)
[PROOF STEP]
have "lead_coeff q = 0"
[PROOF STATE]
proof (prove)
using this:
c * lead_coeff p = (1::'a)
c * lead_coeff p * lead_coeff q = (0::'a)

goal (1 subgoal):
 1. lead_coeff q = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lead_coeff q = (0::'a)

goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (0::'a) \<Longrightarrow> False
[PROOF STEP]
with q0
[PROOF STATE]
proof (chain)
picking this:
q \<noteq> 0
lead_coeff q = (0::'a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0
lead_coeff q = (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mangoldt_sum:
  assumes "n \<noteq> 0"
  shows   "(\<Sum>d | d dvd n. mangoldt d :: 'a :: real_algebra_1) = of_real (ln (real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "(\<Sum>d | d dvd n. mangoldt d :: 'a) = of_real (\<Sum>d | d dvd n. mangoldt d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (\<Sum>d | d dvd n. mangoldt d)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. mangoldt d) = of_real (\<Sum>d | d dvd n. mangoldt d)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. mangoldt d) = of_real (\<Sum>d | d dvd n. mangoldt d)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "(\<Sum>d | d dvd n. mangoldt d) = (\<Sum>d \<in> primepow_factors n. ln (real (aprimedivisor d)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d)))
[PROOF STEP]
by (intro sum.mono_neutral_cong_right) (auto simp: primepow_factors_def mangoldt_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. mangoldt d) = (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. mangoldt d) = (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d)))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "\<dots> = ln (real (\<Prod>d \<in> primepow_factors n. aprimedivisor d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = ln (real (prod aprimedivisor (primepow_factors n)))
[PROOF STEP]
using assms finite_primepow_factors[of n]
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
n \<noteq> 0 \<Longrightarrow> finite (primepow_factors n)

goal (1 subgoal):
 1. (\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = ln (real (prod aprimedivisor (primepow_factors n)))
[PROOF STEP]
by (subst ln_prod [symmetric])
       (auto simp: primepow_factors_def intro!: aprimedivisor_pos_nat
             intro: Nat.gr0I primepow_gt_Suc_0)
[PROOF STATE]
proof (state)
this:
(\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = ln (real (prod aprimedivisor (primepow_factors n)))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d\<in>primepow_factors n. ln (real (aprimedivisor d))) = ln (real (prod aprimedivisor (primepow_factors n)))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "primepow_factors n =
               (\<lambda>(p,k). p ^ k) ` (SIGMA p:prime_factors n. {0<..multiplicity p n})"
    (is "_ = _ ` ?A")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primepow_factors n = (\<lambda>(p, k). p ^ k) ` (SIGMA p:prime_factors n. {0<..multiplicity p n})
[PROOF STEP]
by (subst primepow_factors_altdef[OF assms]) fast+
[PROOF STATE]
proof (state)
this:
primepow_factors n = (\<lambda>(p, k). p ^ k) ` (SIGMA p:prime_factors n. {0<..multiplicity p n})

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
primepow_factors n = (\<lambda>(p, k). p ^ k) ` (SIGMA p:prime_factors n. {0<..multiplicity p n})

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "prod aprimedivisor \<dots> = (\<Prod>(p,k)\<in>?A. aprimedivisor (p ^ k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod aprimedivisor ((\<lambda>(p, k). p ^ k) ` (SIGMA p:prime_factors n. {0<..multiplicity p n})) = (\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). aprimedivisor (p ^ k))
[PROOF STEP]
by (subst prod.reindex)
       (auto simp: inj_on_def prime_power_inj'' prime_factors_multiplicity
                   prod.Sigma [symmetric] case_prod_unfold)
[PROOF STATE]
proof (state)
this:
prod aprimedivisor ((\<lambda>(p, k). p ^ k) ` (SIGMA p:prime_factors n. {0<..multiplicity p n})) = (\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). aprimedivisor (p ^ k))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod aprimedivisor ((\<lambda>(p, k). p ^ k) ` (SIGMA p:prime_factors n. {0<..multiplicity p n})) = (\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). aprimedivisor (p ^ k))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "\<dots> = (\<Prod>(p,k)\<in>?A. p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). aprimedivisor (p ^ k)) = (\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). p)
[PROOF STEP]
by (intro prod.cong refl) (auto simp: aprimedivisor_prime_power prime_factors_multiplicity)
[PROOF STATE]
proof (state)
this:
(\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). aprimedivisor (p ^ k)) = (\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). p)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). aprimedivisor (p ^ k)) = (\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). p)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "\<dots> = (\<Prod>x\<in>prime_factors n. \<Prod>k\<in>{0<..multiplicity x n}. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). p) = (\<Prod>x\<in>prime_factors n. \<Prod>k\<in>{0<..multiplicity x n}. x)
[PROOF STEP]
by (rule prod.Sigma [symmetric]) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). p) = (\<Prod>x\<in>prime_factors n. \<Prod>k\<in>{0<..multiplicity x n}. x)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>(p, k)\<in>(SIGMA p:prime_factors n. {0<..multiplicity p n}). p) = (\<Prod>x\<in>prime_factors n. \<Prod>k\<in>{0<..multiplicity x n}. x)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "\<dots> = (\<Prod>x\<in>prime_factors n. x ^ multiplicity x n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>prime_factors n. \<Prod>k\<in>{0<..multiplicity x n}. x) = (\<Prod>x\<in>prime_factors n. x ^ multiplicity x n)
[PROOF STEP]
by (intro prod.cong refl) (simp add: prod_constant)
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>prime_factors n. \<Prod>k\<in>{0<..multiplicity x n}. x) = (\<Prod>x\<in>prime_factors n. x ^ multiplicity x n)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>prime_factors n. \<Prod>k\<in>{0<..multiplicity x n}. x) = (\<Prod>x\<in>prime_factors n. x ^ multiplicity x n)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
have "\<dots> = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>prime_factors n. x ^ multiplicity x n) = n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<Prod>x\<in>prime_factors n. x ^ multiplicity x n) = n
[PROOF STEP]
by (intro prime_factorization_nat [symmetric]) simp
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>prime_factors n. x ^ multiplicity x n) = n

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. mangoldt d) = of_real (ln (real n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma identities: "k = root 4 m" "l = root 8 m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real k = root 4 (real m) &&& real l = root 8 (real m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real k = root 4 (real m)
 2. real l = root 8 (real m)
[PROOF STEP]
let ?r = real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real k = root 4 (real m)
 2. real l = root 8 (real m)
[PROOF STEP]
have "?r k ^ 4 = ?r m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real k ^ 4 = real m
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real k ^ 4 = real (k ^ 4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real k ^ 4 = real m

goal (2 subgoals):
 1. real k = root 4 (real m)
 2. real l = root 8 (real m)
[PROOF STEP]
from arg_cong[OF this, of "root 4"]
[PROOF STATE]
proof (chain)
picking this:
root 4 (real k ^ 4) = root 4 (real m)
[PROOF STEP]
show km_id: "k = root 4 m"
[PROOF STATE]
proof (prove)
using this:
root 4 (real k ^ 4) = root 4 (real m)

goal (1 subgoal):
 1. real k = root 4 (real m)
[PROOF STEP]
by (simp add: real_root_pos2)
[PROOF STATE]
proof (state)
this:
real k = root 4 (real m)

goal (1 subgoal):
 1. real l = root 8 (real m)
[PROOF STEP]
have "?r l ^ 8 = ?r m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real l ^ 8 = real m
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real l ^ 8 = real (k ^ 4)
[PROOF STEP]
using kl2
[PROOF STATE]
proof (prove)
using this:
k = l\<^sup>2

goal (1 subgoal):
 1. real l ^ 8 = real (k ^ 4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real l ^ 8 = real m

goal (1 subgoal):
 1. real l = root 8 (real m)
[PROOF STEP]
from arg_cong[OF this, of "root 8"]
[PROOF STATE]
proof (chain)
picking this:
root 8 (real l ^ 8) = root 8 (real m)
[PROOF STEP]
show lm_id: "l = root 8 m"
[PROOF STATE]
proof (prove)
using this:
root 8 (real l ^ 8) = root 8 (real m)

goal (1 subgoal):
 1. real l = root 8 (real m)
[PROOF STEP]
by (simp add: real_root_pos2)
[PROOF STATE]
proof (state)
this:
real l = root 8 (real m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma elts_vcard_VSigma_eqpoll: "elts (vcard (vtimes i j)) \<approx> elts i \<times> elts j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (vcard (vtimes i j)) \<approx> elts i \<times> elts j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. elts (vcard (vtimes i j)) \<approx> elts i \<times> elts j
[PROOF STEP]
have "elts (vtimes i j) \<approx> elts i \<times> elts j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (vtimes i j) \<approx> elts i \<times> elts j
[PROOF STEP]
by (simp add: elts_VSigma)
[PROOF STATE]
proof (state)
this:
elts (vtimes i j) \<approx> elts i \<times> elts j

goal (1 subgoal):
 1. elts (vcard (vtimes i j)) \<approx> elts i \<times> elts j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
elts (vtimes i j) \<approx> elts i \<times> elts j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
elts (vtimes i j) \<approx> elts i \<times> elts j

goal (1 subgoal):
 1. elts (vcard (vtimes i j)) \<approx> elts i \<times> elts j
[PROOF STEP]
using cardinal_eqpoll eqpoll_trans
[PROOF STATE]
proof (prove)
using this:
elts (vtimes i j) \<approx> elts i \<times> elts j
elts (vcard ?a) \<approx> elts ?a
\<lbrakk>?A \<approx> ?B; ?B \<approx> ?C\<rbrakk> \<Longrightarrow> ?A \<approx> ?C

goal (1 subgoal):
 1. elts (vcard (vtimes i j)) \<approx> elts i \<times> elts j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
elts (vcard (vtimes i j)) \<approx> elts i \<times> elts j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upto_split1:
  "\<lbrakk> i \<le> j;  j \<le> k \<rbrakk> \<Longrightarrow> [i..k] = [i..j-1] @ [j..k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> [i..k] = [i..j - 1] @ [j..k]
[PROOF STEP]
proof (induction j rule: int_ge_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i \<le> k \<Longrightarrow> [i..k] = [i..i - 1] @ [i..k]
 2. \<And>ia. \<lbrakk>i \<le> ia; ia \<le> k \<Longrightarrow> [i..k] = [i..ia - 1] @ [ia..k]; ia + 1 \<le> k\<rbrakk> \<Longrightarrow> [i..k] = [i..ia + 1 - 1] @ [ia + 1..k]
[PROOF STEP]
case base
[PROOF STATE]
proof (state)
this:
i \<le> k

goal (2 subgoals):
 1. i \<le> k \<Longrightarrow> [i..k] = [i..i - 1] @ [i..k]
 2. \<And>ia. \<lbrakk>i \<le> ia; ia \<le> k \<Longrightarrow> [i..k] = [i..ia - 1] @ [ia..k]; ia + 1 \<le> k\<rbrakk> \<Longrightarrow> [i..k] = [i..ia + 1 - 1] @ [ia + 1..k]
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
i \<le> k

goal (1 subgoal):
 1. [i..k] = [i..i - 1] @ [i..k]
[PROOF STEP]
by (simp add: upto_rec1)
[PROOF STATE]
proof (state)
this:
[i..k] = [i..i - 1] @ [i..k]

goal (1 subgoal):
 1. \<And>ia. \<lbrakk>i \<le> ia; ia \<le> k \<Longrightarrow> [i..k] = [i..ia - 1] @ [ia..k]; ia + 1 \<le> k\<rbrakk> \<Longrightarrow> [i..k] = [i..ia + 1 - 1] @ [ia + 1..k]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. \<lbrakk>i \<le> ia; ia \<le> k \<Longrightarrow> [i..k] = [i..ia - 1] @ [ia..k]; ia + 1 \<le> k\<rbrakk> \<Longrightarrow> [i..k] = [i..ia + 1 - 1] @ [ia + 1..k]
[PROOF STEP]
case step
[PROOF STATE]
proof (state)
this:
i \<le> i_
i_ \<le> k \<Longrightarrow> [i..k] = [i..i_ - 1] @ [i_..k]
i_ + 1 \<le> k

goal (1 subgoal):
 1. \<And>ia. \<lbrakk>i \<le> ia; ia \<le> k \<Longrightarrow> [i..k] = [i..ia - 1] @ [ia..k]; ia + 1 \<le> k\<rbrakk> \<Longrightarrow> [i..k] = [i..ia + 1 - 1] @ [ia + 1..k]
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
i \<le> i_
i_ \<le> k \<Longrightarrow> [i..k] = [i..i_ - 1] @ [i_..k]
i_ + 1 \<le> k

goal (1 subgoal):
 1. [i..k] = [i..i_ + 1 - 1] @ [i_ + 1..k]
[PROOF STEP]
using upto_rec1 upto_rec2
[PROOF STATE]
proof (prove)
using this:
i \<le> i_
i_ \<le> k \<Longrightarrow> [i..k] = [i..i_ - 1] @ [i_..k]
i_ + 1 \<le> k
?i \<le> ?j \<Longrightarrow> [?i..?j] = ?i # [?i + 1..?j]
?i \<le> ?j \<Longrightarrow> [?i..?j] = [?i..?j - 1] @ [?j]

goal (1 subgoal):
 1. [i..k] = [i..i_ + 1 - 1] @ [i_ + 1..k]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[i..k] = [i..i_ + 1 - 1] @ [i_ + 1..k]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_add_less_mono1:
  fixes i :: "'a :: len word"
  assumes ij: "i < j"
  and    ujk: "unat j + unat k < 2 ^ len_of TYPE ('a)"
  shows  "i + k < j + k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + k < j + k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i + k < j + k
[PROOF STEP]
from ij ujk
[PROOF STATE]
proof (chain)
picking this:
i < j
unat j + unat k < 2 ^ LENGTH('a)
[PROOF STEP]
have jk: "unat i + unat k < 2 ^ len_of TYPE ('a)"
[PROOF STATE]
proof (prove)
using this:
i < j
unat j + unat k < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. unat i + unat k < 2 ^ LENGTH('a)
[PROOF STEP]
by (auto elim: order_le_less_subst2 simp: word_less_nat_alt elim: add_less_mono1)
[PROOF STATE]
proof (state)
this:
unat i + unat k < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. i + k < j + k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
unat i + unat k < 2 ^ LENGTH('a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
unat i + unat k < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. i + k < j + k
[PROOF STEP]
using ujk ij
[PROOF STATE]
proof (prove)
using this:
unat i + unat k < 2 ^ LENGTH('a)
unat j + unat k < 2 ^ LENGTH('a)
i < j

goal (1 subgoal):
 1. i + k < j + k
[PROOF STEP]
by (auto simp: word_less_nat_alt iffD1 [OF unat_add_lem])
[PROOF STATE]
proof (state)
this:
i + k < j + k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_dim_of_vec_of_list [simp]:
  assumes "length l = n"
  shows "dim_vec (vec_of_list l) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_of_list l) = n
[PROOF STEP]
using assms vec_of_list_def
[PROOF STATE]
proof (prove)
using this:
length l = n
vec_of_list \<equiv> map_fun id Abs_vec (\<lambda>v. (length v, mk_vec (length v) ((!) v)))

goal (1 subgoal):
 1. dim_vec (vec_of_list l) = n
[PROOF STEP]
by simp


[STATEMENT]
lemma cos_periodic_int[simp]:
  fixes i :: int
  shows "cos (x + i * (2 * pi)) = cos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
proof (cases "0 \<le> i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
 2. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> i

goal (2 subgoals):
 1. 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
 2. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
hence i_nat: "real_of_int i = nat i"
[PROOF STATE]
proof (prove)
using this:
0 \<le> i

goal (1 subgoal):
 1. real_of_int i = real (nat i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int i = real (nat i)

goal (2 subgoals):
 1. 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
 2. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
unfolding i_nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + real (nat i) * (2 * pi)) = cos x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cos (x + real_of_int i * (2 * pi)) = cos x

goal (1 subgoal):
 1. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> i

goal (1 subgoal):
 1. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
hence i_nat: "i = - real (nat (-i))"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> i

goal (1 subgoal):
 1. real_of_int i = - real (nat (- i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int i = - real (nat (- i))

goal (1 subgoal):
 1. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
have "cos x = cos (x + i * (2 * pi) - i * (2 * pi))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos x = cos (x + real_of_int i * (2 * pi) - real_of_int i * (2 * pi))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cos x = cos (x + real_of_int i * (2 * pi) - real_of_int i * (2 * pi))

goal (1 subgoal):
 1. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cos x = cos (x + real_of_int i * (2 * pi) - real_of_int i * (2 * pi))

goal (1 subgoal):
 1. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
have "\<dots> = cos (x + i * (2 * pi))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + real_of_int i * (2 * pi) - real_of_int i * (2 * pi)) = cos (x + real_of_int i * (2 * pi))
[PROOF STEP]
unfolding i_nat mult_minus_left diff_minus_eq_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + - (real (nat (- i)) * (2 * pi)) + real (nat (- i)) * (2 * pi)) = cos (x + - (real (nat (- i)) * (2 * pi)))
[PROOF STEP]
by (rule cos_periodic_nat)
[PROOF STATE]
proof (state)
this:
cos (x + real_of_int i * (2 * pi) - real_of_int i * (2 * pi)) = cos (x + real_of_int i * (2 * pi))

goal (1 subgoal):
 1. \<not> 0 \<le> i \<Longrightarrow> cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cos x = cos (x + real_of_int i * (2 * pi))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cos x = cos (x + real_of_int i * (2 * pi))

goal (1 subgoal):
 1. cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cos (x + real_of_int i * (2 * pi)) = cos x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_cycle_alt: "is_cycle xs \<longleftrightarrow> is_walk xs \<and> distinct (tl xs) \<and> walk_length xs \<ge> 1 \<and> hd xs = last xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_cycle xs = (is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs)
[PROOF STEP]
proof (intro iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_cycle xs \<Longrightarrow> is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs
 2. is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs \<Longrightarrow> is_cycle xs
[PROOF STEP]
show "is_cycle xs \<Longrightarrow> is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_cycle xs \<Longrightarrow> is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs
[PROOF STEP]
using is_cycle_alt_gen_path is_cycle_def is_gen_path_def
[PROOF STATE]
proof (prove)
using this:
is_cycle ?xs = (is_gen_path ?xs \<and> 1 \<le> walk_length ?xs \<and> hd ?xs = last ?xs)
is_cycle ?xs \<equiv> is_closed_walk ?xs \<and> 1 \<le> walk_length ?xs \<and> distinct (tl ?xs)
is_gen_path ?p \<equiv> is_walk ?p \<and> (distinct (tl ?p) \<and> hd ?p = last ?p \<or> distinct ?p)

goal (1 subgoal):
 1. is_cycle xs \<Longrightarrow> is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_cycle xs \<Longrightarrow> is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs

goal (1 subgoal):
 1. is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs \<Longrightarrow> is_cycle xs
[PROOF STEP]
show "is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs \<Longrightarrow> is_cycle xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs \<Longrightarrow> is_cycle xs
[PROOF STEP]
by (simp add: is_cycle_alt_gen_path is_gen_path_def)
[PROOF STATE]
proof (state)
this:
is_walk xs \<and> distinct (tl xs) \<and> 1 \<le> walk_length xs \<and> hd xs = last xs \<Longrightarrow> is_cycle xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zor_poly_zero_eq:
  assumes "f holomorphic_on s" "open s" "connected s" "z \<in> s" "\<exists>w\<in>s. f w \<noteq> 0"
  shows "eventually (\<lambda>w. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)) (at z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)
[PROOF STEP]
obtain r where r:"r>0"
       "(\<forall>w\<in>cball z r - {z}. f w = zor_poly f z w * (w - z) ^ nat (zorder f z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>0 < r; \<forall>w\<in>cball z r - {z}. f w = zor_poly f z w * (w - z) ^ nat (zorder f z)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using zorder_exist_zero[OF assms]
[PROOF STATE]
proof (prove)
using this:
(if f z = 0 then 0 < zorder f z else zorder f z = 0) \<and> (\<exists>r>0. cball z r \<subseteq> s \<and> zor_poly f z holomorphic_on cball z r \<and> (\<forall>w\<in>cball z r. f w = zor_poly f z w * (w - z) ^ nat (zorder f z) \<and> zor_poly f z w \<noteq> 0))

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>0 < r; \<forall>w\<in>cball z r - {z}. f w = zor_poly f z w * (w - z) ^ nat (zorder f z)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < r
\<forall>w\<in>cball z r - {z}. f w = zor_poly f z w * (w - z) ^ nat (zorder f z)

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < r
\<forall>w\<in>cball z r - {z}. f w = zor_poly f z w * (w - z) ^ nat (zorder f z)
[PROOF STEP]
have *: "\<forall>w\<in>ball z r - {z}. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)"
[PROOF STATE]
proof (prove)
using this:
0 < r
\<forall>w\<in>cball z r - {z}. f w = zor_poly f z w * (w - z) ^ nat (zorder f z)

goal (1 subgoal):
 1. \<forall>w\<in>ball z r - {z}. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)
[PROOF STEP]
by (auto simp: field_simps powr_minus)
[PROOF STATE]
proof (state)
this:
\<forall>w\<in>ball z r - {z}. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)
[PROOF STEP]
have "eventually (\<lambda>w. w \<in> ball z r - {z}) (at z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. w \<in> ball z r - {z}
[PROOF STEP]
using r eventually_at_ball'[of r z UNIV]
[PROOF STATE]
proof (prove)
using this:
0 < r
\<forall>w\<in>cball z r - {z}. f w = zor_poly f z w * (w - z) ^ nat (zorder f z)
0 < r \<Longrightarrow> \<forall>\<^sub>F t in at z. t \<in> ball z r \<and> t \<noteq> z \<and> t \<in> UNIV

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. w \<in> ball z r - {z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in at z. w \<in> ball z r - {z}

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in at z. w \<in> ball z r - {z}

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at z. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)
[PROOF STEP]
by eventually_elim (insert *, auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in at z. zor_poly f z w = f w / (w - z) ^ nat (zorder f z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma balanced_Node_if_wbal2:
  assumes "balanced l" "balanced r" "abs(int(size_kdt l) - int(size_kdt r)) \<le> 1"
  shows "balanced (Node k v l r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
have "size_kdt l = size_kdt r \<or> (size_kdt l = size_kdt r + 1 \<or> size_kdt r = size_kdt l + 1)" (is "?A \<or> ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. KD_Tree.size_kdt l = KD_Tree.size_kdt r \<or> KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
\<bar>int (KD_Tree.size_kdt l) - int (KD_Tree.size_kdt r)\<bar> \<le> 1

goal (1 subgoal):
 1. KD_Tree.size_kdt l = KD_Tree.size_kdt r \<or> KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r \<or> KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r \<or> KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. KD_Tree.size_kdt l = KD_Tree.size_kdt r \<Longrightarrow> balanced (Node k v l r)
 2. KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1 \<Longrightarrow> balanced (Node k v l r)
[PROOF STEP]
assume "?A"
[PROOF STATE]
proof (state)
this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r

goal (2 subgoals):
 1. KD_Tree.size_kdt l = KD_Tree.size_kdt r \<Longrightarrow> balanced (Node k v l r)
 2. KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1 \<Longrightarrow> balanced (Node k v l r)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r
balanced l
balanced r

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
apply(simp add: balanced_def min_def max_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>KD_Tree.size_kdt l = KD_Tree.size_kdt r; height l - min_height l \<le> Suc 0; height r - min_height r \<le> Suc 0\<rbrakk> \<Longrightarrow> (height l \<le> height r \<longrightarrow> min_height l \<le> min_height r \<longrightarrow> height r - min_height l \<le> Suc 0) \<and> (\<not> height l \<le> height r \<longrightarrow> \<not> min_height l \<le> min_height r \<longrightarrow> height l - min_height r \<le> Suc 0)
[PROOF STEP]
by (metis assms(1,2) balanced_optimal le_antisym le_less)
[PROOF STATE]
proof (state)
this:
balanced (Node k v l r)

goal (1 subgoal):
 1. KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1 \<Longrightarrow> balanced (Node k v l r)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1 \<Longrightarrow> balanced (Node k v l r)
[PROOF STEP]
assume "?B"
[PROOF STATE]
proof (state)
this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1

goal (1 subgoal):
 1. KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1 \<Longrightarrow> balanced (Node k v l r)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
KD_Tree.size_kdt l = KD_Tree.size_kdt r + 1 \<or> KD_Tree.size_kdt r = KD_Tree.size_kdt l + 1

goal (1 subgoal):
 1. balanced (Node k v l r)
[PROOF STEP]
by (meson assms(1,2) balanced_sym balanced_Node_if_wbal1)
[PROOF STATE]
proof (state)
this:
balanced (Node k v l r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
balanced (Node k v l r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem (in fin_digraph) closed_euler2:
  assumes "euler_trail u p u"
  shows "connected G"
    and "\<And>u. u \<in> verts G \<Longrightarrow> in_degree G u = out_degree G u" (is "\<And>u. _ \<Longrightarrow> ?eq_deg u")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digraph_Component.connected G &&& (\<And>u. u \<in> verts G \<Longrightarrow> in_degree G u = out_degree G u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Digraph_Component.connected G
 2. \<And>u. u \<in> verts G \<Longrightarrow> in_degree G u = out_degree G u
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
euler_trail u p u
[PROOF STEP]
show "connected G"
[PROOF STATE]
proof (prove)
using this:
euler_trail u p u

goal (1 subgoal):
 1. Digraph_Component.connected G
[PROOF STEP]
by (rule euler_imp_connected)
[PROOF STATE]
proof (state)
this:
Digraph_Component.connected G

goal (1 subgoal):
 1. \<And>u. u \<in> verts G \<Longrightarrow> in_degree G u = out_degree G u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. u \<in> verts G \<Longrightarrow> in_degree G u = out_degree G u
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. u \<in> verts G \<Longrightarrow> in_degree G u = out_degree G u
[PROOF STEP]
assume A: "v \<in> verts G"
[PROOF STATE]
proof (state)
this:
v \<in> verts G

goal (1 subgoal):
 1. \<And>u. u \<in> verts G \<Longrightarrow> in_degree G u = out_degree G u
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
euler_trail u p u
v \<in> verts G
[PROOF STEP]
show "?eq_deg v"
[PROOF STATE]
proof (prove)
using this:
euler_trail u p u
v \<in> verts G

goal (1 subgoal):
 1. in_degree G v = out_degree G v
[PROOF STEP]
by (rule closed_euler_imp_eq_degree)
[PROOF STATE]
proof (state)
this:
in_degree G v = out_degree G v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_size_1[simp]:
  "size_kdt kdt = 1 \<longleftrightarrow> (\<exists>p. kdt = Leaf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (KD_Tree.size_kdt kdt = 1) = (\<exists>p. kdt = Leaf p)
[PROOF STEP]
apply (induction kdt)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. (KD_Tree.size_kdt (Leaf x) = 1) = (\<exists>p. Leaf x = Leaf p)
 2. \<And>x1a x2 kdt1 kdt2. \<lbrakk>(KD_Tree.size_kdt kdt1 = 1) = (\<exists>p. kdt1 = Leaf p); (KD_Tree.size_kdt kdt2 = 1) = (\<exists>p. kdt2 = Leaf p)\<rbrakk> \<Longrightarrow> (KD_Tree.size_kdt (Node x1a x2 kdt1 kdt2) = 1) = (\<exists>p. Node x1a x2 kdt1 kdt2 = Leaf p)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>kdt2. \<lbrakk>KD_Tree.size_kdt kdt2 = 0; \<forall>p. kdt2 \<noteq> Leaf p\<rbrakk> \<Longrightarrow> False
 2. \<And>kdt1. \<lbrakk>KD_Tree.size_kdt kdt1 = 0; \<forall>p. kdt1 \<noteq> Leaf p\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using size_ge0 nat_less_le
[PROOF STATE]
proof (prove)
using this:
0 < KD_Tree.size_kdt ?kdt
(?m < ?n) = (?m \<le> ?n \<and> ?m \<noteq> ?n)

goal (2 subgoals):
 1. \<And>kdt2. \<lbrakk>KD_Tree.size_kdt kdt2 = 0; \<forall>p. kdt2 \<noteq> Leaf p\<rbrakk> \<Longrightarrow> False
 2. \<And>kdt1. \<lbrakk>KD_Tree.size_kdt kdt1 = 0; \<forall>p. kdt1 \<noteq> Leaf p\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma b_least2_aux1: "b_least2 f x y = y \<or> (b_least2 f x y < y \<and> (f x (b_least2 f x y)) \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b_least2 f x y = y \<or> b_least2 f x y < y \<and> f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b_least2 f x y = y \<or> b_least2 f x y < y \<and> f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
let ?P = "%z. z = y \<or> (z < y \<and> (f x z) \<noteq> 0)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b_least2 f x y = y \<or> b_least2 f x y < y \<and> f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
have "?P y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = y \<or> y < y \<and> f x y \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y = y \<or> y < y \<and> f x y \<noteq> 0

goal (1 subgoal):
 1. b_least2 f x y = y \<or> b_least2 f x y < y \<and> f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = y \<or> y < y \<and> f x y \<noteq> 0
[PROOF STEP]
have "?P (Least ?P)"
[PROOF STATE]
proof (prove)
using this:
y = y \<or> y < y \<and> f x y \<noteq> 0

goal (1 subgoal):
 1. (LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) = y \<or> (LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) < y \<and> f x (LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) \<noteq> 0
[PROOF STEP]
by (rule LeastI)
[PROOF STATE]
proof (state)
this:
(LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) = y \<or> (LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) < y \<and> f x (LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) \<noteq> 0

goal (1 subgoal):
 1. b_least2 f x y = y \<or> b_least2 f x y < y \<and> f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) = y \<or> (LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) < y \<and> f x (LEAST z. z = y \<or> z < y \<and> f x z \<noteq> 0) \<noteq> 0

goal (1 subgoal):
 1. b_least2 f x y = y \<or> b_least2 f x y < y \<and> f x (b_least2 f x y) \<noteq> 0
[PROOF STEP]
by (simp add: b_least2_def)
[PROOF STATE]
proof (state)
this:
b_least2 f x y = y \<or> b_least2 f x y < y \<and> f x (b_least2 f x y) \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma st_proj2_continuous:
  "continuous_on (UNIV - {bot_sphere}) st_proj2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (UNIV - {bot_sphere}) st_proj2
[PROOF STEP]
apply (transfer; auto intro!: continuous_intros simp: add_nonneg_eq_0_iff split_beta' norm_prod_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(norm a)\<^sup>2 + b\<^sup>2 = 1; 1 + b = 0\<rbrakk> \<Longrightarrow> a = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(norm a)\<^sup>2 + b\<^sup>2 = 1; 1 + b = 0\<rbrakk> \<Longrightarrow> a = (0::'a)
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(norm a)\<^sup>2 + b\<^sup>2 = 1; 1 + b = 0\<rbrakk> \<Longrightarrow> a = (0::'a)
[PROOF STEP]
assume 1: "(norm a)^2 + b^2 = 1" and 2: "1 + b = 0"
[PROOF STATE]
proof (state)
this:
(norm a)\<^sup>2 + b\<^sup>2 = 1
1 + b = 0

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(norm a)\<^sup>2 + b\<^sup>2 = 1; 1 + b = 0\<rbrakk> \<Longrightarrow> a = (0::'a)
[PROOF STEP]
have "b = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = - 1
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
1 + b = 0

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

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(norm a)\<^sup>2 + b\<^sup>2 = 1; 1 + b = 0\<rbrakk> \<Longrightarrow> a = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = - 1
[PROOF STEP]
show "a = 0"
[PROOF STATE]
proof (prove)
using this:
b = - 1

goal (1 subgoal):
 1. a = (0::'b)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
b = - 1
(norm a)\<^sup>2 + b\<^sup>2 = 1

goal (1 subgoal):
 1. a = (0::'b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sumset_eq_Union_left:
  assumes "A \<subseteq> G"
  shows "sumset A B = (\<Union> a \<in> A. sumset {a} B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset A B = (\<Union>a\<in>A. sumset {a} B)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sumset A B \<subseteq> (\<Union>a\<in>A. sumset {a} B)
 2. (\<Union>a\<in>A. sumset {a} B) \<subseteq> sumset A B
[PROOF STEP]
show "sumset A B \<subseteq> (\<Union> a \<in> A. sumset {a} B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset A B \<subseteq> (\<Union>a\<in>A. sumset {a} B)
[PROOF STEP]
using assms sumset.cases Int_absorb2 Int_iff UN_iff singletonI sumset.sumsetI
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> G
\<lbrakk>?a \<in> sumset ?A ?B; \<And>a b. \<lbrakk>?a = a \<oplus> b; a \<in> ?A; a \<in> G; b \<in> ?B; b \<in> G\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
?A \<subseteq> ?B \<Longrightarrow> ?A \<inter> ?B = ?A
(?c \<in> ?A \<inter> ?B) = (?c \<in> ?A \<and> ?c \<in> ?B)
(?b \<in> \<Union> (?B ` ?A)) = (\<exists>x\<in>?A. ?b \<in> ?B x)
?a \<in> {?a}
\<lbrakk>?a \<in> ?A; ?a \<in> G; ?b \<in> ?B; ?b \<in> G\<rbrakk> \<Longrightarrow> ?a \<oplus> ?b \<in> sumset ?A ?B

goal (1 subgoal):
 1. sumset A B \<subseteq> (\<Union>a\<in>A. sumset {a} B)
[PROOF STEP]
by (smt (verit, del_insts) subsetI)
[PROOF STATE]
proof (state)
this:
sumset A B \<subseteq> (\<Union>a\<in>A. sumset {a} B)

goal (1 subgoal):
 1. (\<Union>a\<in>A. sumset {a} B) \<subseteq> sumset A B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>a\<in>A. sumset {a} B) \<subseteq> sumset A B
[PROOF STEP]
show "(\<Union> a \<in> A. sumset {a} B) \<subseteq> sumset A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>a\<in>A. sumset {a} B) \<subseteq> sumset A B
[PROOF STEP]
using sumset
[PROOF STATE]
proof (prove)
using this:
sumset ?A ?B = (\<Union>a\<in>?A \<inter> G. \<Union>b\<in>?B \<inter> G. {a \<oplus> b})

goal (1 subgoal):
 1. (\<Union>a\<in>A. sumset {a} B) \<subseteq> sumset A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>a\<in>A. sumset {a} B) \<subseteq> sumset A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma epigraph_lsc_hull:
  fixes f :: "'a::metric_space \<Rightarrow> ereal"
  shows "Epigraph UNIV (lsc_hull f) = closure(Epigraph UNIV f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Epigraph UNIV (lsc_hull f) = closure (Epigraph UNIV f)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Epigraph UNIV (lsc_hull f) = closure (Epigraph UNIV f)
[PROOF STEP]
have "\<exists>g. Epigraph UNIV g = closure (Epigraph UNIV f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. Epigraph UNIV g = closure (Epigraph UNIV f)
[PROOF STEP]
using lsc_hull_exists
[PROOF STATE]
proof (prove)
using this:
\<exists>g. Epigraph UNIV g = closure (Epigraph UNIV ?f)

goal (1 subgoal):
 1. \<exists>g. Epigraph UNIV g = closure (Epigraph UNIV f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>g. Epigraph UNIV g = closure (Epigraph UNIV f)

goal (1 subgoal):
 1. Epigraph UNIV (lsc_hull f) = closure (Epigraph UNIV f)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>g. Epigraph UNIV g = closure (Epigraph UNIV f)

goal (1 subgoal):
 1. Epigraph UNIV (lsc_hull f) = closure (Epigraph UNIV f)
[PROOF STEP]
unfolding lsc_hull_def
[PROOF STATE]
proof (prove)
using this:
\<exists>g. Epigraph UNIV g = closure (Epigraph UNIV f)

goal (1 subgoal):
 1. Epigraph UNIV (SOME g. Epigraph UNIV g = closure (Epigraph UNIV f)) = closure (Epigraph UNIV f)
[PROOF STEP]
using some_eq_ex[of "(\<lambda>g. Epigraph UNIV g = closure(Epigraph UNIV f))"]
[PROOF STATE]
proof (prove)
using this:
\<exists>g. Epigraph UNIV g = closure (Epigraph UNIV f)
(Epigraph UNIV (SOME x. Epigraph UNIV x = closure (Epigraph UNIV f)) = closure (Epigraph UNIV f)) = (\<exists>x. Epigraph UNIV x = closure (Epigraph UNIV f))

goal (1 subgoal):
 1. Epigraph UNIV (SOME g. Epigraph UNIV g = closure (Epigraph UNIV f)) = closure (Epigraph UNIV f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Epigraph UNIV (lsc_hull f) = closure (Epigraph UNIV f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zip_replicate_mapr: "length xs = n \<Longrightarrow> zip xs (replicate n x) = map (\<lambda>y. (y, x)) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = n \<Longrightarrow> zip xs (replicate n x) = map (\<lambda>y. (y, x)) xs
[PROOF STEP]
apply (induct n arbitrary: xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xs. length xs = 0 \<Longrightarrow> zip xs (replicate 0 x) = map (\<lambda>y. (y, x)) xs
 2. \<And>n xs. \<lbrakk>\<And>xs. length xs = n \<Longrightarrow> zip xs (replicate n x) = map (\<lambda>y. (y, x)) xs; length xs = Suc n\<rbrakk> \<Longrightarrow> zip xs (replicate (Suc n) x) = map (\<lambda>y. (y, x)) xs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n xs. \<lbrakk>\<And>xs. length xs = n \<Longrightarrow> zip xs (replicate n x) = map (\<lambda>y. (y, x)) xs; length xs = Suc n\<rbrakk> \<Longrightarrow> zip xs (replicate (Suc n) x) = map (\<lambda>y. (y, x)) xs
[PROOF STEP]
apply (case_tac xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n xs. \<lbrakk>\<And>xs. length xs = n \<Longrightarrow> zip xs (replicate n x) = map (\<lambda>y. (y, x)) xs; length xs = Suc n; xs = []\<rbrakk> \<Longrightarrow> zip xs (replicate (Suc n) x) = map (\<lambda>y. (y, x)) xs
 2. \<And>n xs a list. \<lbrakk>\<And>xs. length xs = n \<Longrightarrow> zip xs (replicate n x) = map (\<lambda>y. (y, x)) xs; length xs = Suc n; xs = a # list\<rbrakk> \<Longrightarrow> zip xs (replicate (Suc n) x) = map (\<lambda>y. (y, x)) xs
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma poly_power_n_odd:
  fixes x a:: real
  assumes "odd n"
  shows "poly ([:-a,1:]^n) x>0 \<longleftrightarrow> (x>a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
odd n

goal (1 subgoal):
 1. (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd n \<Longrightarrow> (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
have "poly ([:-a,1:]^n) x\<ge>0 = (poly [:- a, 1:] x \<ge>0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> poly ([:- a, 1:] ^ n) x) = (0 \<le> poly [:- a, 1:] x)
[PROOF STEP]
unfolding poly_power
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> poly [:- a, 1:] x ^ n) = (0 \<le> poly [:- a, 1:] x)
[PROOF STEP]
using zero_le_odd_power[OF \<open>odd n\<close>]
[PROOF STATE]
proof (prove)
using this:
((0::?'a) \<le> ?a ^ n) = ((0::?'a) \<le> ?a)

goal (1 subgoal):
 1. (0 \<le> poly [:- a, 1:] x ^ n) = (0 \<le> poly [:- a, 1:] x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(0 \<le> poly ([:- a, 1:] ^ n) x) = (0 \<le> poly [:- a, 1:] x)

goal (1 subgoal):
 1. odd n \<Longrightarrow> (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0 \<le> poly ([:- a, 1:] ^ n) x) = (0 \<le> poly [:- a, 1:] x)

goal (1 subgoal):
 1. odd n \<Longrightarrow> (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
have "(poly [:- a, 1:] x \<ge>0) = (x\<ge>a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> poly [:- a, 1:] x) = (a \<le> x)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(0 \<le> poly [:- a, 1:] x) = (a \<le> x)

goal (1 subgoal):
 1. odd n \<Longrightarrow> (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0 \<le> poly ([:- a, 1:] ^ n) x) = (a \<le> x)
[PROOF STEP]
have "poly ([:-a,1:]^n) x\<ge>0 = (x\<ge>a)"
[PROOF STATE]
proof (prove)
using this:
(0 \<le> poly ([:- a, 1:] ^ n) x) = (a \<le> x)

goal (1 subgoal):
 1. (0 \<le> poly ([:- a, 1:] ^ n) x) = (a \<le> x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0 \<le> poly ([:- a, 1:] ^ n) x) = (a \<le> x)

goal (1 subgoal):
 1. odd n \<Longrightarrow> (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(0 \<le> poly ([:- a, 1:] ^ n) x) = (a \<le> x)

goal (1 subgoal):
 1. odd n \<Longrightarrow> (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
have "poly ([:-a,1:]^n) x=0 = (x=a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly ([:- a, 1:] ^ n) x = 0) = (x = a)
[PROOF STEP]
by(rule poly_power_n_eq, metis assms even_zero)
[PROOF STATE]
proof (state)
this:
(poly ([:- a, 1:] ^ n) x = 0) = (x = a)

goal (1 subgoal):
 1. odd n \<Longrightarrow> (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(0 \<le> poly ([:- a, 1:] ^ n) x) = (a \<le> x)
(poly ([:- a, 1:] ^ n) x = 0) = (x = a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0 \<le> poly ([:- a, 1:] ^ n) x) = (a \<le> x)
(poly ([:- a, 1:] ^ n) x = 0) = (x = a)

goal (1 subgoal):
 1. (0 < poly ([:- a, 1:] ^ n) x) = (a < x)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(0 < poly ([:- a, 1:] ^ n) x) = (a < x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DERIV_neg_imp_decreasing_open:
  fixes a b :: real
    and f :: "real \<Rightarrow> real"
  assumes "a < b"
    and "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> \<exists>y. DERIV f x :> y \<and> y < 0"
    and con: "continuous_on {a..b} f"
  shows "f a > f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f b < f a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f b < f a
[PROOF STEP]
have "(\<lambda>x. -f x) a < (\<lambda>x. -f x) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - f a < - f b
[PROOF STEP]
proof (rule DERIV_pos_imp_increasing_open [of a b])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. a < b
 2. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>a. - f a) has_real_derivative y) (at x) \<and> 0 < y
 3. continuous_on {a..b} (\<lambda>a. - f a)
[PROOF STEP]
show "\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at x) \<and> 0 < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at x) \<and> 0 < y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < b
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> \<exists>y. (f has_real_derivative y) (at ?x) \<and> y < 0
continuous_on {a..b} f

goal (1 subgoal):
 1. \<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at x) \<and> 0 < y
[PROOF STEP]
by simp (metis field_differentiable_minus neg_0_less_iff_less)
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x; ?x < b\<rbrakk> \<Longrightarrow> \<exists>y. ((\<lambda>x. - f x) has_real_derivative y) (at ?x) \<and> 0 < y

goal (2 subgoals):
 1. a < b
 2. continuous_on {a..b} (\<lambda>a. - f a)
[PROOF STEP]
show "continuous_on {a..b} (\<lambda>x. - f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. - f x)
[PROOF STEP]
using con continuous_on_minus
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} f
continuous_on ?s ?f \<Longrightarrow> continuous_on ?s (\<lambda>x. - ?f x)

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. - f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. - f x)

goal (1 subgoal):
 1. a < b
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
- f a < - f b

goal (1 subgoal):
 1. f b < f a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- f a < - f b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- f a < - f b

goal (1 subgoal):
 1. f b < f a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f b < f a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma onorm_le_matrix_component_sum:
  fixes A :: "real^'n^'m"
  shows "onorm((*v) A) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm ((*v) A) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>)
[PROOF STEP]
proof (rule onorm_le)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x
[PROOF STEP]
have "norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<bar>(A *v x) $ i\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<bar>(A *v x) $ i\<bar>)
[PROOF STEP]
by (rule norm_le_l1_cart)
[PROOF STATE]
proof (state)
this:
norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<bar>(A *v x) $ i\<bar>)

goal (1 subgoal):
 1. \<And>x. norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<bar>(A *v x) $ i\<bar>)

goal (1 subgoal):
 1. \<And>x. norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x
[PROOF STEP]
have "\<dots> \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. \<bar>(A *v x) $ i\<bar>) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
proof (rule sum_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
have "\<bar>(A *v x) $ i\<bar> \<le> \<bar>\<Sum>j\<in>UNIV. A $ i $ j * x $ j\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>(A *v x) $ i\<bar> \<le> \<bar>\<Sum>j\<in>UNIV. A $ i $ j * x $ j\<bar>
[PROOF STEP]
by (simp add: matrix_vector_mult_def)
[PROOF STATE]
proof (state)
this:
\<bar>(A *v x) $ i\<bar> \<le> \<bar>\<Sum>j\<in>UNIV. A $ i $ j * x $ j\<bar>

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>(A *v x) $ i\<bar> \<le> \<bar>\<Sum>j\<in>UNIV. A $ i $ j * x $ j\<bar>

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
have "\<dots> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j * x $ j\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>\<Sum>j\<in>UNIV. A $ i $ j * x $ j\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j * x $ j\<bar>)
[PROOF STEP]
by (rule sum_abs)
[PROOF STATE]
proof (state)
this:
\<bar>\<Sum>j\<in>UNIV. A $ i $ j * x $ j\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j * x $ j\<bar>)

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>\<Sum>j\<in>UNIV. A $ i $ j * x $ j\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j * x $ j\<bar>)

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
have "\<dots> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>UNIV. \<bar>A $ i $ j * x $ j\<bar>) \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
by (rule sum_mono) (simp add: abs_mult component_le_norm_cart mult_left_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>UNIV. \<bar>A $ i $ j * x $ j\<bar>) \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
show "\<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)"
[PROOF STATE]
proof (prove)
using this:
\<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)

goal (1 subgoal):
 1. \<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>(A *v x) $ i\<bar> \<le> (\<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. \<bar>(A *v x) $ i\<bar>) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)

goal (1 subgoal):
 1. \<And>x. norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)
[PROOF STEP]
show "norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x"
[PROOF STATE]
proof (prove)
using this:
norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar> * norm x)

goal (1 subgoal):
 1. norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x
[PROOF STEP]
by (simp add: sum_distrib_right)
[PROOF STATE]
proof (state)
this:
norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A $ i $ j\<bar>) * norm x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ex_first_occurrence [rule_format]:
  "P (n::nat) \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i. i<m \<longrightarrow> \<not> P i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i))
[PROOF STEP]
apply(rule nat_less_induct)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>m<n. P m \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i)) \<Longrightarrow> P n \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i))
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>m<n. P m \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i)); P n\<rbrakk> \<Longrightarrow> \<exists>m. P m \<and> (\<forall>i<m. \<not> P i)
[PROOF STEP]
apply(case_tac "\<forall>m. m<n \<longrightarrow> \<not> P m")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<forall>m<n. P m \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i)); P n; \<forall>m<n. \<not> P m\<rbrakk> \<Longrightarrow> \<exists>m. P m \<and> (\<forall>i<m. \<not> P i)
 2. \<And>n. \<lbrakk>\<forall>m<n. P m \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i)); P n; \<not> (\<forall>m<n. \<not> P m)\<rbrakk> \<Longrightarrow> \<exists>m. P m \<and> (\<forall>i<m. \<not> P i)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma quasi_isometry_between_change_params:
  assumes "lambda C-quasi_isometry_between X Y f" "mu \<ge> lambda" "D \<ge> C"
  shows "mu D-quasi_isometry_between X Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mu D -quasi_isometry_between X Y f
[PROOF STEP]
proof (rule quasi_isometry_betweenI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mu D -quasi_isometry_on X f
 2. f ` X \<subseteq> Y
 3. \<And>y. y \<in> Y \<Longrightarrow> \<exists>x\<in>X. dist (f x) y \<le> D
[PROOF STEP]
show "mu D-quasi_isometry_on X f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mu D -quasi_isometry_on X f
[PROOF STEP]
by (rule quasi_isometry_on_change_params[OF quasi_isometry_betweenD(1)[OF assms(1)] assms(2) assms(3)])
[PROOF STATE]
proof (state)
this:
mu D -quasi_isometry_on X f

goal (2 subgoals):
 1. f ` X \<subseteq> Y
 2. \<And>y. y \<in> Y \<Longrightarrow> \<exists>x\<in>X. dist (f x) y \<le> D
[PROOF STEP]
show "f`X \<subseteq> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` X \<subseteq> Y
[PROOF STEP]
using quasi_isometry_betweenD[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
lambda C -quasi_isometry_on X f
f ` X \<subseteq> Y
?y \<in> Y \<Longrightarrow> \<exists>x\<in>X. dist (f x) ?y \<le> C
\<lbrakk>?x \<in> X; ?y \<in> X\<rbrakk> \<Longrightarrow> dist (f ?x) (f ?y) \<le> lambda * dist ?x ?y + C
\<lbrakk>?x \<in> X; ?y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist ?x ?y - C \<le> dist (f ?x) (f ?y)
1 \<le> lambda
0 \<le> C

goal (1 subgoal):
 1. f ` X \<subseteq> Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` X \<subseteq> Y

goal (1 subgoal):
 1. \<And>y. y \<in> Y \<Longrightarrow> \<exists>x\<in>X. dist (f x) y \<le> D
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> Y \<Longrightarrow> \<exists>x\<in>X. dist (f x) y \<le> D
[PROOF STEP]
assume "y \<in> Y"
[PROOF STATE]
proof (state)
this:
y \<in> Y

goal (1 subgoal):
 1. \<And>y. y \<in> Y \<Longrightarrow> \<exists>x\<in>X. dist (f x) y \<le> D
[PROOF STEP]
show "\<exists>x\<in>X. dist (f x) y \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>X. dist (f x) y \<le> D
[PROOF STEP]
using quasi_isometry_betweenD(3)[OF assms(1) \<open>y \<in> Y\<close>] \<open>D \<ge> C\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>X. dist (f x) y \<le> C
C \<le> D

goal (1 subgoal):
 1. \<exists>x\<in>X. dist (f x) y \<le> D
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. dist (f x) y \<le> D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma snd_set_zip:
  "length xs = length ys \<Longrightarrow> snd ` (set (zip xs ys)) = set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> snd ` set (zip xs ys) = set ys
[PROOF STEP]
by (induct xs ys rule: list_induct2) auto


[STATEMENT]
lemma pure_precise_iff_sv: "\<lbrakk>is_pure R\<rbrakk>
  \<Longrightarrow> precise R \<longleftrightarrow> single_valued (the_pure R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pure R \<Longrightarrow> precise R = single_valued (the_pure R)
[PROOF STEP]
by (auto simp: is_pure_conv precise_pure_iff_sv)


[STATEMENT]
lemma inversions_between_code:
  "inversions_between xs ys =
     Set.filter (\<lambda>(i,j). less (ys ! j) (xs ! i)) ({..<length xs}\<times>{..<length ys})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inversions_between xs ys = Set.filter (\<lambda>(i, j). ys ! j < xs ! i) ({..<length xs} \<times> {..<length ys})
[PROOF STEP]
by (auto simp: inversions_between_def)


[STATEMENT]
lemma simply_connected_imp_connected:
  fixes S :: "_::real_normed_vector set"
  shows "simply_connected S \<Longrightarrow> connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S \<Longrightarrow> connected S
[PROOF STEP]
by (simp add: path_connected_imp_connected simply_connected_imp_path_connected)


[STATEMENT]
lemma path_connected_Ioc[simp]: "path_connected {a<..b}" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected {a<..b}
[PROOF STEP]
by (simp add: convex_imp_path_connected)


[STATEMENT]
lemma up_filter_antitone:
  "x \<le> y \<longleftrightarrow> up_filter y \<le> up_filter x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (up_filter y \<le> up_filter x)
[PROOF STEP]
by (metis eq_onp_same_args less_eq_filter.abs_eq up_antitone up_filter)


[STATEMENT]
lemma lcm_proj2_iff_int [simp]: "lcm m n = \<bar>n\<bar> \<longleftrightarrow> m dvd n"
  for m n :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lcm m n = \<bar>n\<bar>) = (m dvd n)
[PROOF STEP]
by (metis dvd_abs_iff lcm_proj2_if_dvd_int lcm_unique_int)


[STATEMENT]
lemma id_slg_rel_alt_a: "\<langle>Id\<rangle>slg_rel
    = { (s,E). \<forall>u. distinct (s u) \<and> set (s u) = E``{u} }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>Id\<rangle>slg_rel = {(s, E). \<forall>u. distinct (s u) \<and> set (s u) = E `` {u}}
[PROOF STEP]
by (auto simp add: slg_rel_def br_def list_set_rel_def dest: fun_relD)


[STATEMENT]
lemma compl_le_compl_iff [simp]: "- x \<le> - y \<longleftrightarrow> y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<le> - y) = (y \<le> x)
[PROOF STEP]
by (auto dest: compl_mono)


[STATEMENT]
lemma normal_imp_not_zero: "is_normal f \<Longrightarrow> \<not>is_zero f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_normal f \<Longrightarrow> \<not> is_zero f
[PROOF STEP]
by (simp add: is_normal_def is_zero_def)


[STATEMENT]
lemma integration_by_parts_interior_strong:
  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  assumes bilinear: "bounded_bilinear (prod)"
  assumes s: "finite s" and le: "a \<le> b"
  assumes cont [continuous_intros]: "continuous_on {a..b} f" "continuous_on {a..b} g"
  assumes deriv: "\<And>x. x\<in>{a<..<b} - s \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
                 "\<And>x. x\<in>{a<..<b} - s \<Longrightarrow> (g has_vector_derivative g' x) (at x)"
  assumes int: "((\<lambda>x. prod (f x) (g' x)) has_integral
                  (prod (f b) (g b) - prod (f a) (g a) - y)) {a..b}"
  shows   "((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}
[PROOF STEP]
interpret bounded_bilinear prod
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_bilinear prod
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}
[PROOF STEP]
have "((\<lambda>x. prod (f x) (g' x) + prod (f' x) (g x)) has_integral
          (prod (f b) (g b) - prod (f a) (g a))) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. prod (f x) (g' x) + prod (f' x) (g x)) has_integral prod (f b) (g b) - prod (f a) (g a)) {a..b}
[PROOF STEP]
using deriv
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a<..<b} - s \<Longrightarrow> (f has_vector_derivative f' ?x) (at ?x)
?x \<in> {a<..<b} - s \<Longrightarrow> (g has_vector_derivative g' ?x) (at ?x)

goal (1 subgoal):
 1. ((\<lambda>x. prod (f x) (g' x) + prod (f' x) (g x)) has_integral prod (f b) (g b) - prod (f a) (g a)) {a..b}
[PROOF STEP]
by (intro fundamental_theorem_of_calculus_interior_strong[OF s le])
                   (auto intro!: continuous_intros continuous_on has_vector_derivative)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. prod (f x) (g' x) + prod (f' x) (g x)) has_integral prod (f b) (g b) - prod (f a) (g a)) {a..b}

goal (1 subgoal):
 1. ((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}
[PROOF STEP]
from has_integral_diff[OF this int]
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. prod (f x) (g' x) + prod (f' x) (g x) - prod (f x) (g' x)) has_integral prod (f b) (g b) - prod (f a) (g a) - (prod (f b) (g b) - prod (f a) (g a) - y)) {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. prod (f x) (g' x) + prod (f' x) (g x) - prod (f x) (g' x)) has_integral prod (f b) (g b) - prod (f a) (g a) - (prod (f b) (g b) - prod (f a) (g a) - y)) {a..b}

goal (1 subgoal):
 1. ((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma round_mono: "x \<le> y \<Longrightarrow> round x \<le> round y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> round x \<le> round y
[PROOF STEP]
unfolding round_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> \<lfloor>x + (1::'a) / (2::'a)\<rfloor> \<le> \<lfloor>y + (1::'a) / (2::'a)\<rfloor>
[PROOF STEP]
by (intro floor_mono) simp


[STATEMENT]
lemma map_zip_is_bisum:
  "bisum f l1 = (\<Sum>(x,y)\<leftarrow>zip (0 # l1) (l1 @ [0]). f x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bisum f l1 = sum_list (map2 f ((0::'b) # l1) (l1 @ [0::'b]))
[PROOF STEP]
using bisum_is_map_zip[of "\<lambda>(x,y). f x y"]
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 f ((0::'b) # ?l1.0) (?l1.0 @ [0::'b])) = bisum (\<lambda>x y. case (x, y) of (x, y) \<Rightarrow> f x y) ?l1.0

goal (1 subgoal):
 1. bisum f l1 = sum_list (map2 f ((0::'b) # l1) (l1 @ [0::'b]))
[PROOF STEP]
by auto


[STATEMENT]
lemma ideal_generated_repeated: "ideal_generated {a,a} = ideal_generated {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {a, a} = ideal_generated {a}
[PROOF STEP]
unfolding ideal_generated_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> {I. ideal I \<and> {a, a} \<subseteq> I} = \<Inter> {I. ideal I \<and> {a} \<subseteq> I}
[PROOF STEP]
by auto


[STATEMENT]
lemma fst_pairs_VLambda: "fst ` pairs (VLambda A f) = elts A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` pairs (VLambda A f) = elts A
[PROOF STEP]
by (force simp: VLambda_def pairs_def)


[STATEMENT]
lemma map_of_zip_is_Some:
  assumes "length xs = length ys"
  shows "x \<in> set xs \<longleftrightarrow> (\<exists>y. map_of (zip xs ys) x = Some y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set xs) = (\<exists>y. map_of (zip xs ys) x = Some y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys

goal (1 subgoal):
 1. (x \<in> set xs) = (\<exists>y. map_of (zip xs ys) x = Some y)
[PROOF STEP]
by (induct rule: list_induct2) simp_all


[STATEMENT]
lemma smult_pCons [simp]: "smult a (pCons b p) = pCons (a * b) (smult a p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult a (pCons b p) = pCons (a * b) (smult a p)
[PROOF STEP]
by (rule poly_eqI) (simp add: coeff_pCons split: nat.split)