[STATEMENT]
lemma measure_mono_eq_prod:
  assumes "f \<noteq> 0" "g \<noteq> 0"
  shows "mahler_measure_monic (f * g) = mahler_measure_monic f * mahler_measure_monic g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure_monic (f * g) = mahler_measure_monic f * mahler_measure_monic g
[PROOF STEP]
unfolding mahler_measure_monic_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>a\<leftarrow>complex_roots_complex (f * g). max 1 (cmod a)) = (\<Prod>a\<leftarrow>complex_roots_complex f. max 1 (cmod a)) * (\<Prod>a\<leftarrow>complex_roots_complex g. max 1 (cmod a))
[PROOF STEP]
using mset_mult_add_2[OF complex_roots_complex_prod[OF assms],of "\<lambda> a. max 1 (cmod a)"]
[PROOF STATE]
proof (prove)
using this:
(\<Prod>a\<leftarrow>complex_roots_complex (f * g). max 1 (cmod a)) = (\<Prod>a\<leftarrow>complex_roots_complex f. max 1 (cmod a)) * (\<Prod>a\<leftarrow>complex_roots_complex g. max 1 (cmod a))

goal (1 subgoal):
 1. (\<Prod>a\<leftarrow>complex_roots_complex (f * g). max 1 (cmod a)) = (\<Prod>a\<leftarrow>complex_roots_complex f. max 1 (cmod a)) * (\<Prod>a\<leftarrow>complex_roots_complex g. max 1 (cmod a))
[PROOF STEP]
by simp


[STATEMENT]
lemma continuous_on_dist[continuous_intros]:
  fixes f g :: "_ \<Rightarrow> 'a :: metric_space"
  shows "continuous_on s f \<Longrightarrow> continuous_on s g \<Longrightarrow> continuous_on s (\<lambda>x. dist (f x) (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on s f; continuous_on s g\<rbrakk> \<Longrightarrow> continuous_on s (\<lambda>x. dist (f x) (g x))
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s); \<forall>x\<in>s. (g \<longlongrightarrow> g x) (at x within s)\<rbrakk> \<Longrightarrow> \<forall>x\<in>s. ((\<lambda>x. dist (f x) (g x)) \<longlongrightarrow> dist (f x) (g x)) (at x within s)
[PROOF STEP]
by (auto intro: tendsto_dist)


[STATEMENT]
lemma all_to_meta: "Trueprop (\<forall>a. P a) \<equiv> (\<And>a. P a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. P a \<equiv> (\<And>a. P a)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. \<forall>a. P a \<Longrightarrow> P a
 2. (\<And>a. P a) \<Longrightarrow> \<forall>a. P a
[PROOF STEP]
by auto


[STATEMENT]
lemma fds_left_inverse_unique:
  assumes "f * g = (1 :: 'a :: field fds)"
  shows   "f = inverse g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = inverse g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f = inverse g
[PROOF STEP]
have "fds_nth (f * g) 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (f * g) 1 = (1::'a)
[PROOF STEP]
by (subst assms) simp
[PROOF STATE]
proof (state)
this:
fds_nth (f * g) 1 = (1::'a)

goal (1 subgoal):
 1. f = inverse g
[PROOF STEP]
hence "fds_nth g 1 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
fds_nth (f * g) 1 = (1::'a)

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

goal (1 subgoal):
 1. f = inverse g
[PROOF STEP]
hence "(f - inverse g) * g = 0"
[PROOF STATE]
proof (prove)
using this:
fds_nth g 1 \<noteq> (0::'a)

goal (1 subgoal):
 1. (f - inverse g) * g = 0
[PROOF STEP]
unfolding ring_distribs
[PROOF STATE]
proof (prove)
using this:
fds_nth g 1 \<noteq> (0::'a)

goal (1 subgoal):
 1. f * g - inverse g * g = 0
[PROOF STEP]
by (subst fds_left_inverse) (simp_all add: assms)
[PROOF STATE]
proof (state)
this:
(f - inverse g) * g = 0

goal (1 subgoal):
 1. f = inverse g
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(f - inverse g) * g = 0

goal (1 subgoal):
 1. f = inverse g
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f * g = 1
[PROOF STEP]
have "g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f * g = 1

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

goal (1 subgoal):
 1. f = inverse g
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(f - inverse g) * g = 0
g \<noteq> 0
[PROOF STEP]
show "f = inverse g"
[PROOF STATE]
proof (prove)
using this:
(f - inverse g) * g = 0
g \<noteq> 0

goal (1 subgoal):
 1. f = inverse g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f = inverse g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Inf_pres_map_dual_var:
  "Inf_pres f = Sup_pres (\<partial>\<^sub>F f)"
  for f :: "'a::complete_lattice_with_dual \<Rightarrow> 'b::complete_lattice_with_dual"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
fix x :: "'a set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
assume "\<partial> (f (\<Sqinter> (\<partial> ` x))) = (\<Squnion>y\<in>x. \<partial> (f (\<partial> y)))" for x
[PROOF STATE]
proof (state)
this:
\<partial> (f (\<Sqinter> (\<partial> ` ?x))) = (\<Squnion>y\<in>?x. \<partial> (f (\<partial> y)))

goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<partial> (f (\<Sqinter> (\<partial> ` ?x))) = (\<Squnion>y\<in>?x. \<partial> (f (\<partial> y)))
[PROOF STEP]
have "\<Sqinter> (f ` \<partial> ` A) = f (\<partial> (\<Squnion> A))" for A
[PROOF STATE]
proof (prove)
using this:
\<partial> (f (\<Sqinter> (\<partial> ` ?x))) = (\<Squnion>y\<in>?x. \<partial> (f (\<partial> y)))

goal (1 subgoal):
 1. \<Sqinter> (f ` \<partial> ` A) = f (\<partial> (\<Squnion> A))
[PROOF STEP]
by (metis (no_types) Sup_dual_def_var image_image invol_dual_var subset_dual)
[PROOF STATE]
proof (state)
this:
\<Sqinter> (f ` \<partial> ` ?A) = f (\<partial> (\<Squnion> ?A))

goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Sqinter> (f ` \<partial> ` ?A) = f (\<partial> (\<Squnion> ?A))
[PROOF STEP]
have "\<Sqinter> (f ` x) = f (\<Sqinter> x)"
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> (f ` \<partial> ` ?A) = f (\<partial> (\<Squnion> ?A))

goal (1 subgoal):
 1. \<Sqinter> (f ` x) = f (\<Sqinter> x)
[PROOF STEP]
by (metis Sup_dual_def_var subset_dual)
[PROOF STATE]
proof (state)
this:
\<Sqinter> (f ` x) = f (\<Sqinter> x)

goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<And>x. \<partial> (f (\<Sqinter> (\<partial> ` x))) = (\<Squnion>y\<in>x. \<partial> (f (\<partial> y)))) \<Longrightarrow> \<Sqinter> (f ` ?x2) = f (\<Sqinter> ?x2)

goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. \<partial> (f (\<Sqinter> (\<partial> ` x))) = (\<Squnion>y\<in>x. \<partial> (f (\<partial> y)))) \<Longrightarrow> \<Sqinter> (f ` ?x2) = f (\<Sqinter> ?x2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x. \<partial> (f (\<Sqinter> (\<partial> ` x))) = (\<Squnion>y\<in>x. \<partial> (f (\<partial> y)))) \<Longrightarrow> \<Sqinter> (f ` ?x2) = f (\<Sqinter> ?x2)

goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
by (auto simp add: map_dual_def fun_eq_iff Inf_dual_var Sup_dual_def_var image_comp)
[PROOF STATE]
proof (state)
this:
Inf_pres f = Sup_pres (\<partial>\<^sub>F f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphism_add:
  "homeomorphism UNIV UNIV (\<lambda>x. x + c) (\<lambda>x. x - c)"
  for c::"_::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism UNIV UNIV (\<lambda>x. x + c) (\<lambda>x. x - c)
[PROOF STEP]
unfolding homeomorphism_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>UNIV. x + c - c = x) \<and> surj (\<lambda>x. x + c) \<and> continuous_on UNIV (\<lambda>x. x + c) \<and> (\<forall>y\<in>UNIV. y - c + c = y) \<and> surj (\<lambda>x. x - c) \<and> continuous_on UNIV (\<lambda>x. x - c)
[PROOF STEP]
by (auto simp: algebra_simps continuous_intros intro!: image_eqI[where x="x - c" for x])


[STATEMENT]
lemma bound_intersect_2d_nonempty:
  assumes "bound_intersect_2d prec Xs x = Some (m, M)"
  shows "(\<Union>(p1, p2) \<in> set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
bound_intersect_2d prec Xs x = Some (m, M)
[PROOF STEP]
have "bound_intersect_2d prec Xs x \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
bound_intersect_2d prec Xs x = Some (m, M)

goal (1 subgoal):
 1. bound_intersect_2d prec Xs x \<noteq> None
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bound_intersect_2d prec Xs x \<noteq> None

goal (1 subgoal):
 1. (\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bound_intersect_2d prec Xs x \<noteq> None
[PROOF STEP]
obtain p1 p2 where "(p1, p2) \<in> set Xs" "intersect_segment_xline prec (p1, p2) x \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
bound_intersect_2d prec Xs x \<noteq> None

goal (1 subgoal):
 1. (\<And>p1 p2. \<lbrakk>(p1, p2) \<in> set Xs; intersect_segment_xline prec (p1, p2) x \<noteq> None\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding bound_intersect_2d_eq_None_iff
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>X\<in>set Xs. intersect_segment_xline prec X x = None)

goal (1 subgoal):
 1. (\<And>p1 p2. \<lbrakk>(p1, p2) \<in> set Xs; intersect_segment_xline prec (p1, p2) x \<noteq> None\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(p1, p2) \<in> set Xs
intersect_segment_xline prec (p1, p2) x \<noteq> None

goal (1 subgoal):
 1. (\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}
[PROOF STEP]
hence "closed_segment p1 p2 \<inter> {p. fst p = x} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
(p1, p2) \<in> set Xs
intersect_segment_xline prec (p1, p2) x \<noteq> None

goal (1 subgoal):
 1. closed_segment p1 p2 \<inter> {p. fst p = x} \<noteq> {}
[PROOF STEP]
by (simp add: intersect_segment_xline_None_iff)
[PROOF STATE]
proof (state)
this:
closed_segment p1 p2 \<inter> {p. fst p = x} \<noteq> {}

goal (1 subgoal):
 1. (\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
closed_segment p1 p2 \<inter> {p. fst p = x} \<noteq> {}

goal (1 subgoal):
 1. (\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}
[PROOF STEP]
using \<open>(p1, p2) \<in> set Xs\<close>
[PROOF STATE]
proof (prove)
using this:
closed_segment p1 p2 \<inter> {p. fst p = x} \<noteq> {}
(p1, p2) \<in> set Xs

goal (1 subgoal):
 1. (\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>(p1, p2)\<in>set Xs. closed_segment p1 p2) \<inter> {p. fst p = x} \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_factors_primorial [simp]:
  "prime_factors (primorial x) = {p. prime p \<and> real p \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors (primorial x) = {p. prime p \<and> real p \<le> x}
[PROOF STEP]
unfolding prime_factorization_primorial
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (mset_set {p. prime p \<and> real p \<le> x}) = {p. prime p \<and> real p \<le> x}
[PROOF STEP]
using finite_primes_le[of x]
[PROOF STATE]
proof (prove)
using this:
finite {p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. set_mset (mset_set {p. prime p \<and> real p \<le> x}) = {p. prime p \<and> real p \<le> x}
[PROOF STEP]
by simp


[STATEMENT]
theorem set_plus_rearrange4: "C + (a +o D) = a +o (C + D)"
  for a :: "'a::comm_monoid_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C + a +o D = a +o (C + D)
[PROOF STEP]
by (metis add.commute set_plus_rearrange3)


[STATEMENT]
lemma log_mult_eq:
  "log b (A * B) = (if 0 < A * B then log b \<bar>A\<bar> + log b \<bar>B\<bar> else log b 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log b (A * B) = (if 0 < A * B then log b \<bar>A\<bar> + log b \<bar>B\<bar> else log b 0)
[PROOF STEP]
using log_mult[of b "\<bar>A\<bar>" "\<bar>B\<bar>"] b_gt_1 log_neg_const[of "A * B"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < b; b \<noteq> 1; 0 < \<bar>A\<bar>; 0 < \<bar>B\<bar>\<rbrakk> \<Longrightarrow> log b (\<bar>A\<bar> * \<bar>B\<bar>) = log b \<bar>A\<bar> + log b \<bar>B\<bar>
1 < b
A * B \<le> 0 \<Longrightarrow> log b (A * B) = log b 0

goal (1 subgoal):
 1. log b (A * B) = (if 0 < A * B then log b \<bar>A\<bar> + log b \<bar>B\<bar> else log b 0)
[PROOF STEP]
by (auto simp: zero_less_mult_iff mult_le_0_iff)


[STATEMENT]
lemma lm087:
  assumes "\<forall> x. (P x \<longrightarrow> (f x = g x))"
  shows   "Union {f x|x. P x} = Union {g x | x. P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {f x |x. P x} = \<Union> {g x |x. P x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x. P x \<longrightarrow> f x = g x

goal (1 subgoal):
 1. \<Union> {f x |x. P x} = \<Union> {g x |x. P x}
[PROOF STEP]
by blast


[STATEMENT]
lemma sum_union_disjoint_finite_set:
  fixes C::"nat set" and g::"nat \<Rightarrow> int"
  assumes "finite C"
  shows "\<forall>A B. A \<inter> B = {} \<and> A \<union> B = C \<longrightarrow> (\<Sum>k\<in>C. g k) = (\<Sum>k\<in>A. g k) + (\<Sum>k\<in>B. g k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A B. A \<inter> B = {} \<and> A \<union> B = C \<longrightarrow> sum g C = sum g A + sum g B
[PROOF STEP]
using assms sum.union_disjoint
[PROOF STATE]
proof (prove)
using this:
finite C
\<lbrakk>finite ?A; finite ?B; ?A \<inter> ?B = {}\<rbrakk> \<Longrightarrow> sum ?g (?A \<union> ?B) = sum ?g ?A + sum ?g ?B

goal (1 subgoal):
 1. \<forall>A B. A \<inter> B = {} \<and> A \<union> B = C \<longrightarrow> sum g C = sum g A + sum g B
[PROOF STEP]
by auto


[STATEMENT]
lemma abs_zero_equality: assumes "abs (x - y) = 0" shows "x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
using assms abs_zero  eq_iff_diff_eq_0
[PROOF STATE]
proof (prove)
using this:
Preliminaries.abs (x - y) = 0
Preliminaries.abs ?x = 0 \<Longrightarrow> ?x = 0
(?a = ?b) = (?a - ?b = (0::?'a))

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by blast


[STATEMENT]
lemma Gromov_product_at_diff:
  "\<bar>Gromov_product_at x y z - Gromov_product_at a b c\<bar> \<le> dist x a + dist y b + dist z c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Gromov_product_at x y z - Gromov_product_at a b c\<bar> \<le> dist x a + dist y b + dist z c
[PROOF STEP]
unfolding Gromov_product_at_def abs_le_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dist x y + dist x z - dist y z) / 2 - (dist a b + dist a c - dist b c) / 2 \<le> dist x a + dist y b + dist z c \<and> - ((dist x y + dist x z - dist y z) / 2 - (dist a b + dist a c - dist b c) / 2) \<le> dist x a + dist y b + dist z c
[PROOF STEP]
apply (auto simp add: divide_simps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dist x y * 2 + dist x z * 2 - dist y z * 2 - (dist a b * 2 + dist a c * 2 - dist b c * 2) \<le> dist x a * 4 + dist y b * 4 + dist z c * 4
 2. dist a b * 2 + dist a c * 2 - dist b c * 2 - (dist x y * 2 + dist x z * 2 - dist y z * 2) \<le> dist x a * 4 + dist y b * 4 + dist z c * 4
[PROOF STEP]
by (smt dist_commute dist_triangle4)+


[STATEMENT]
lemma nonneg_power_le:
  assumes "0 \<le> a" and "0 \<le> b" shows "a^n \<le> b^n \<longleftrightarrow> n = 0 \<or> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> a
(0::'a) \<le> b

goal (1 subgoal):
 1. (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
proof (cases rule: nonneg_linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. a < b \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
 2. a = b \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
 3. b < a \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
a < b

goal (3 subgoals):
 1. a < b \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
 2. a = b \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
 3. b < a \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
with power_strict_mono[OF this, of n] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(0::'a) \<le> a; 0 < n\<rbrakk> \<Longrightarrow> a ^ n < b ^ n
(0::'a) \<le> a
(0::'a) \<le> b
a < b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) \<le> a; 0 < n\<rbrakk> \<Longrightarrow> a ^ n < b ^ n
(0::'a) \<le> a
(0::'a) \<le> b
a < b

goal (1 subgoal):
 1. (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
by (cases n, auto)
[PROOF STATE]
proof (state)
this:
(a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)

goal (2 subgoals):
 1. a = b \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
 2. b < a \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = b \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
 2. b < a \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
case eq
[PROOF STATE]
proof (state)
this:
a = b

goal (2 subgoals):
 1. a = b \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
 2. b < a \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)

goal (1 subgoal):
 1. b < a \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b < a \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
case greater
[PROOF STATE]
proof (state)
this:
b < a

goal (1 subgoal):
 1. b < a \<Longrightarrow> (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
with power_strict_mono[OF this, of n] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(0::'a) \<le> b; 0 < n\<rbrakk> \<Longrightarrow> b ^ n < a ^ n
(0::'a) \<le> a
(0::'a) \<le> b
b < a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) \<le> b; 0 < n\<rbrakk> \<Longrightarrow> b ^ n < a ^ n
(0::'a) \<le> a
(0::'a) \<le> b
b < a

goal (1 subgoal):
 1. (a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)
[PROOF STEP]
by (cases n, auto)
[PROOF STATE]
proof (state)
this:
(a ^ n \<le> b ^ n) = (n = 0 \<or> a \<le> b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ninv_inj:"\<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}\<rbrakk> \<Longrightarrow>
                                inj_on  (ninv n f) {i. i \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}\<rbrakk> \<Longrightarrow> inj_on (ninv n f) {i. i \<le> n}
[PROOF STEP]
apply (subst inj_on_def, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}\<rbrakk> \<Longrightarrow> \<forall>x\<le>n. \<forall>y\<le>n. ninv n f x = ninv n f y \<longrightarrow> x = y
[PROOF STEP]
apply ((rule allI, rule impI)+, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}; x \<le> n; y \<le> n; ninv n f x = ninv n f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule ninv_hom[of f n], assumption,
      frule_tac x = x in funcset_mem[of "ninv n f" "{i. i \<le> n}" "{i. i \<le> n}"],      simp,
      frule_tac x = y in funcset_mem[of "ninv n f" "{i. i \<le> n}" "{i. i \<le> n}"],
      simp,
      frule_tac b = x in ninv_r_inv  [of f n], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; inj_on f {i. i \<le> n}; x \<le> n; y \<le> n; ninv n f x = ninv n f y; ninv n f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> n}; ninv n f x \<in> {i. i \<le> n}; ninv n f y \<in> {i. i \<le> n}; f (ninv n f x) = x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (simp add:ninv_r_inv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma smalloI_tendsto:
  assumes lim: "((\<lambda>x. f x / g x) \<longlongrightarrow> 0) F"
  assumes "eventually (\<lambda>x. g x \<noteq> 0) F"
  shows   "f \<in> o[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> o[F](g)
[PROOF STEP]
proof (rule landau_o.smallI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
fix c :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
assume c_pos: "c > 0"
[PROOF STATE]
proof (state)
this:
0 < c

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
from c_pos and lim
[PROOF STATE]
proof (chain)
picking this:
0 < c
((\<lambda>x. f x / g x) \<longlongrightarrow> (0::'b)) F
[PROOF STEP]
have ev: "eventually (\<lambda>x. norm (f x / g x) < c) F"
[PROOF STATE]
proof (prove)
using this:
0 < c
((\<lambda>x. f x / g x) \<longlongrightarrow> (0::'b)) F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x / g x) < c
[PROOF STEP]
by (subst (asm) tendsto_iff) (simp add: dist_real_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x / g x) < c

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. g x \<noteq> (0::'b)
\<forall>\<^sub>F x in F. norm (f x / g x) < c
[PROOF STEP]
show "eventually (\<lambda>x. (norm (f x)) \<le> c * (norm (g x))) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. g x \<noteq> (0::'b)
\<forall>\<^sub>F x in F. norm (f x / g x) < c

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)
[PROOF STEP]
by eventually_elim (simp add: field_simps norm_divide)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_pos:
  "(\<forall>x::real. poly p x > 0) \<longleftrightarrow> poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. 0 < poly p x) = (poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0))
[PROOF STEP]
proof (intro iffI conjI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<forall>x. 0 < poly p x \<Longrightarrow> poly_inf p = 1
 2. \<forall>x. 0 < poly p x \<Longrightarrow> \<forall>x. poly p x \<noteq> 0
 3. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
assume A: "\<forall>x::real. poly p x > 0"
[PROOF STATE]
proof (state)
this:
\<forall>x. 0 < poly p x

goal (3 subgoals):
 1. \<forall>x. 0 < poly p x \<Longrightarrow> poly_inf p = 1
 2. \<forall>x. 0 < poly p x \<Longrightarrow> \<forall>x. poly p x \<noteq> 0
 3. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
have "\<And>x. poly p (x::real) > 0 \<Longrightarrow> poly p x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < poly p x \<Longrightarrow> poly p x \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < poly p ?x \<Longrightarrow> poly p ?x \<noteq> 0

goal (3 subgoals):
 1. \<forall>x. 0 < poly p x \<Longrightarrow> poly_inf p = 1
 2. \<forall>x. 0 < poly p x \<Longrightarrow> \<forall>x. poly p x \<noteq> 0
 3. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. 0 < poly p x
0 < poly p ?x \<Longrightarrow> poly p ?x \<noteq> 0
[PROOF STEP]
show "\<forall>x::real. poly p x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. 0 < poly p x
0 < poly p ?x \<Longrightarrow> poly p ?x \<noteq> 0

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

goal (2 subgoals):
 1. \<forall>x. 0 < poly p x \<Longrightarrow> poly_inf p = 1
 2. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
from poly_lim_inf
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. sgn (poly ?p x) = poly_inf ?p
[PROOF STEP]
obtain x where "sgn (poly p x) = poly_inf p"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. sgn (poly ?p x) = poly_inf ?p

goal (1 subgoal):
 1. (\<And>x. sgn (poly p x) = poly_inf p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_at_top_linorder)
[PROOF STATE]
proof (state)
this:
sgn (poly p x) = poly_inf p

goal (2 subgoals):
 1. \<forall>x. 0 < poly p x \<Longrightarrow> poly_inf p = 1
 2. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. 0 < poly p x
sgn (poly p x) = poly_inf p
[PROOF STEP]
show "poly_inf p = 1"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. 0 < poly p x
sgn (poly p x) = poly_inf p

goal (1 subgoal):
 1. poly_inf p = 1
[PROOF STEP]
by (simp add: sgn_real_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
poly_inf p = 1

goal (1 subgoal):
 1. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
assume "poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0)"
[PROOF STATE]
proof (state)
this:
poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0)

goal (1 subgoal):
 1. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
hence A: "poly_inf p = 1" and B: "(\<forall>x. poly p x \<noteq> 0)"
[PROOF STATE]
proof (prove)
using this:
poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0)

goal (1 subgoal):
 1. poly_inf p = 1 &&& \<forall>x. poly p x \<noteq> 0
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
poly_inf p = 1
\<forall>x. poly p x \<noteq> 0

goal (1 subgoal):
 1. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
from poly_lim_inf
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. sgn (poly ?p x) = poly_inf ?p
[PROOF STEP]
obtain x where C: "sgn (poly p x) = poly_inf p"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. sgn (poly ?p x) = poly_inf ?p

goal (1 subgoal):
 1. (\<And>x. sgn (poly p x) = poly_inf p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_at_top_linorder)
[PROOF STATE]
proof (state)
this:
sgn (poly p x) = poly_inf p

goal (1 subgoal):
 1. poly_inf p = 1 \<and> (\<forall>x. poly p x \<noteq> 0) \<Longrightarrow> \<forall>x. 0 < poly p x
[PROOF STEP]
show "\<forall>x. poly p x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 < poly p x
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>x. 0 < poly p x) \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(\<forall>x. poly p x > 0)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x. 0 < poly p x)

goal (1 subgoal):
 1. \<not> (\<forall>x. 0 < poly p x) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>x. 0 < poly p x)
[PROOF STEP]
obtain x' where "poly p x' \<le> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x. 0 < poly p x)

goal (1 subgoal):
 1. (\<And>x'. poly p x' \<le> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: not_less)
[PROOF STATE]
proof (state)
this:
poly p x' \<le> 0

goal (1 subgoal):
 1. \<not> (\<forall>x. 0 < poly p x) \<Longrightarrow> False
[PROOF STEP]
with A and C
[PROOF STATE]
proof (chain)
picking this:
poly_inf p = 1
sgn (poly p x) = poly_inf p
poly p x' \<le> 0
[PROOF STEP]
have "sgn (poly p x') \<noteq> sgn (poly p x)"
[PROOF STATE]
proof (prove)
using this:
poly_inf p = 1
sgn (poly p x) = poly_inf p
poly p x' \<le> 0

goal (1 subgoal):
 1. sgn (poly p x') \<noteq> sgn (poly p x)
[PROOF STEP]
by (auto simp: sgn_real_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
sgn (poly p x') \<noteq> sgn (poly p x)

goal (1 subgoal):
 1. \<not> (\<forall>x. 0 < poly p x) \<Longrightarrow> False
[PROOF STEP]
from poly_different_sign_imp_root'[OF this] and B
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. poly p x = 0
\<forall>x. poly p x \<noteq> 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<exists>x. poly p x = 0
\<forall>x. poly p x \<noteq> 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x. 0 < poly p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem banach_fix:\<comment> \<open>TODO: rename to \<open>Banach_fix\<close>\<close>
  assumes s: "complete s" "s \<noteq> {}"
    and c: "0 \<le> c" "c < 1"
    and f: "f ` s \<subseteq> s"
    and lipschitz: "\<forall>x\<in>s. \<forall>y\<in>s. dist (f x) (f y) \<le> c * dist x y"
  shows "\<exists>!x\<in>s. f x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
from c
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
[PROOF STEP]
have "1 - c > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1

goal (1 subgoal):
 1. 0 < 1 - c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 - c

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
from s(2)
[PROOF STATE]
proof (chain)
picking this:
s \<noteq> {}
[PROOF STEP]
obtain z0 where z0: "z0 \<in> s"
[PROOF STATE]
proof (prove)
using this:
s \<noteq> {}

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

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
define z where "z n = (f ^^ n) z0" for n
[PROOF STATE]
proof (state)
this:
z ?n = (f ^^ ?n) z0

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
with f z0
[PROOF STATE]
proof (chain)
picking this:
f ` s \<subseteq> s
z0 \<in> s
z ?n = (f ^^ ?n) z0
[PROOF STEP]
have z_in_s: "z n \<in> s" for n :: nat
[PROOF STATE]
proof (prove)
using this:
f ` s \<subseteq> s
z0 \<in> s
z ?n = (f ^^ ?n) z0

goal (1 subgoal):
 1. z n \<in> s
[PROOF STEP]
by (induct n) auto
[PROOF STATE]
proof (state)
this:
z ?n \<in> s

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
define d where "d = dist (z 0) (z 1)"
[PROOF STATE]
proof (state)
this:
d = dist (z 0) (z 1)

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
have fzn: "f (z n) = z (Suc n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (z n) = z (Suc n)
[PROOF STEP]
by (simp add: z_def)
[PROOF STATE]
proof (state)
this:
f (z ?n) = z (Suc ?n)

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
have cf_z: "dist (z n) (z (Suc n)) \<le> (c ^ n) * d" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (z n) (z (Suc n)) \<le> c ^ n * d
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dist (z 0) (z (Suc 0)) \<le> c ^ 0 * d
 2. \<And>n. dist (z n) (z (Suc n)) \<le> c ^ n * d \<Longrightarrow> dist (z (Suc n)) (z (Suc (Suc n))) \<le> c ^ Suc n * d
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. dist (z 0) (z (Suc 0)) \<le> c ^ 0 * d
 2. \<And>n. dist (z n) (z (Suc n)) \<le> c ^ n * d \<Longrightarrow> dist (z (Suc n)) (z (Suc (Suc n))) \<le> c ^ Suc n * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (z 0) (z (Suc 0)) \<le> c ^ 0 * d
[PROOF STEP]
by (simp add: d_def)
[PROOF STATE]
proof (state)
this:
dist (z 0) (z (Suc 0)) \<le> c ^ 0 * d

goal (1 subgoal):
 1. \<And>n. dist (z n) (z (Suc n)) \<le> c ^ n * d \<Longrightarrow> dist (z (Suc n)) (z (Suc (Suc n))) \<le> c ^ Suc n * d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. dist (z n) (z (Suc n)) \<le> c ^ n * d \<Longrightarrow> dist (z (Suc n)) (z (Suc (Suc n))) \<le> c ^ Suc n * d
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
dist (z m) (z (Suc m)) \<le> c ^ m * d

goal (1 subgoal):
 1. \<And>n. dist (z n) (z (Suc n)) \<le> c ^ n * d \<Longrightarrow> dist (z (Suc n)) (z (Suc (Suc n))) \<le> c ^ Suc n * d
[PROOF STEP]
with \<open>0 \<le> c\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
dist (z m) (z (Suc m)) \<le> c ^ m * d
[PROOF STEP]
have "c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
dist (z m) (z (Suc m)) \<le> c ^ m * d

goal (1 subgoal):
 1. c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d
[PROOF STEP]
using mult_left_mono[of "dist (z m) (z (Suc m))" "c ^ m * d" c]
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
dist (z m) (z (Suc m)) \<le> c ^ m * d
\<lbrakk>dist (z m) (z (Suc m)) \<le> c ^ m * d; 0 \<le> c\<rbrakk> \<Longrightarrow> c * dist (z m) (z (Suc m)) \<le> c * (c ^ m * d)

goal (1 subgoal):
 1. c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d

goal (1 subgoal):
 1. \<And>n. dist (z n) (z (Suc n)) \<le> c ^ n * d \<Longrightarrow> dist (z (Suc n)) (z (Suc (Suc n))) \<le> c ^ Suc n * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d

goal (1 subgoal):
 1. dist (z (Suc m)) (z (Suc (Suc m))) \<le> c ^ Suc m * d
[PROOF STEP]
using lipschitz[THEN bspec[where x="z m"], OF z_in_s, THEN bspec[where x="z (Suc m)"], OF z_in_s]
[PROOF STATE]
proof (prove)
using this:
c * dist (z m) (z (Suc m)) \<le> c ^ Suc m * d
dist (f (z m)) (f (z (Suc m))) \<le> c * dist (z m) (z (Suc m))

goal (1 subgoal):
 1. dist (z (Suc m)) (z (Suc (Suc m))) \<le> c ^ Suc m * d
[PROOF STEP]
by (simp add: fzn mult_le_cancel_left)
[PROOF STATE]
proof (state)
this:
dist (z (Suc m)) (z (Suc (Suc m))) \<le> c ^ Suc m * d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dist (z ?n) (z (Suc ?n)) \<le> c ^ ?n * d

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
have cf_z2: "(1 - c) * dist (z m) (z (m + n)) \<le> (c ^ m) * d * (1 - c ^ n)" for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (1 - c) * dist (z m) (z (m + 0)) \<le> c ^ m * d * (1 - c ^ 0)
 2. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (1 - c) * dist (z m) (z (m + 0)) \<le> c ^ m * d * (1 - c ^ 0)
 2. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - c) * dist (z m) (z (m + 0)) \<le> c ^ m * d * (1 - c ^ 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 - c) * dist (z m) (z (m + 0)) \<le> c ^ m * d * (1 - c ^ 0)

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
(1 - c) * dist (z m) (z (m + k)) \<le> c ^ m * d * (1 - c ^ k)

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
from c
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
[PROOF STEP]
have "(1 - c) * dist (z m) (z (m + Suc k)) \<le>
        (1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k))))"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1

goal (1 subgoal):
 1. (1 - c) * dist (z m) (z (m + Suc k)) \<le> (1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k))))
[PROOF STEP]
by (simp add: dist_triangle)
[PROOF STATE]
proof (state)
this:
(1 - c) * dist (z m) (z (m + Suc k)) \<le> (1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k))))

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - c) * dist (z m) (z (m + Suc k)) \<le> (1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k))))

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
from c cf_z[of "m + k"]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
dist (z (m + k)) (z (Suc (m + k))) \<le> c ^ (m + k) * d
[PROOF STEP]
have "\<dots> \<le> (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
dist (z (m + k)) (z (Suc (m + k))) \<le> c ^ (m + k) * d

goal (1 subgoal):
 1. (1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k)))) \<le> (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k)))) \<le> (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d)

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - c) * (dist (z m) (z (m + k)) + dist (z (m + k)) (z (Suc (m + k)))) \<le> (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d)

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
(1 - c) * dist (z m) (z (m + k)) \<le> c ^ m * d * (1 - c ^ k)
[PROOF STEP]
have "\<dots> \<le> c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d"
[PROOF STATE]
proof (prove)
using this:
(1 - c) * dist (z m) (z (m + k)) \<le> c ^ m * d * (1 - c ^ k)

goal (1 subgoal):
 1. (1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d) \<le> c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d) \<le> c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 - c) * (dist (z m) (z (m + k)) + c ^ (m + k) * d) \<le> c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
have "\<dots> = (c ^ m) * (d * (1 - c ^ k) + (1 - c) * c ^ k * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d = c ^ m * (d * (1 - c ^ k) + (1 - c) * c ^ k * d)
[PROOF STEP]
by (simp add: power_add field_simps)
[PROOF STATE]
proof (state)
this:
c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d = c ^ m * (d * (1 - c ^ k) + (1 - c) * c ^ k * d)

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c ^ m * d * (1 - c ^ k) + (1 - c) * c ^ (m + k) * d = c ^ m * (d * (1 - c ^ k) + (1 - c) * c ^ k * d)

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
from c
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
[PROOF STEP]
have "\<dots> \<le> (c ^ m) * d * (1 - c ^ Suc k)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1

goal (1 subgoal):
 1. c ^ m * (d * (1 - c ^ k) + (1 - c) * c ^ k * d) \<le> c ^ m * d * (1 - c ^ Suc k)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
c ^ m * (d * (1 - c ^ k) + (1 - c) * c ^ k * d) \<le> c ^ m * d * (1 - c ^ Suc k)

goal (1 subgoal):
 1. \<And>n. (1 - c) * dist (z m) (z (m + n)) \<le> c ^ m * d * (1 - c ^ n) \<Longrightarrow> (1 - c) * dist (z m) (z (m + Suc n)) \<le> c ^ m * d * (1 - c ^ Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 - c) * dist (z m) (z (m + Suc k)) \<le> c ^ m * d * (1 - c ^ Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(1 - c) * dist (z m) (z (m + Suc k)) \<le> c ^ m * d * (1 - c ^ Suc k)

goal (1 subgoal):
 1. (1 - c) * dist (z m) (z (m + Suc k)) \<le> c ^ m * d * (1 - c ^ Suc k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 - c) * dist (z m) (z (m + Suc k)) \<le> c ^ m * d * (1 - c ^ Suc k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 - c) * dist (z ?m) (z (?m + ?n)) \<le> c ^ ?m * d * (1 - c ^ ?n)

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
have "\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e" if "e > 0" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
proof (cases "d = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d = 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
 2. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
d = 0

goal (2 subgoals):
 1. d = 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
 2. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
from \<open>1 - c > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < 1 - c
[PROOF STEP]
have "(1 - c) * x \<le> 0 \<longleftrightarrow> x \<le> 0" for x
[PROOF STATE]
proof (prove)
using this:
0 < 1 - c

goal (1 subgoal):
 1. ((1 - c) * x \<le> 0) = (x \<le> 0)
[PROOF STEP]
by (simp add: mult_le_0_iff)
[PROOF STATE]
proof (state)
this:
((1 - c) * ?x \<le> 0) = (?x \<le> 0)

goal (2 subgoals):
 1. d = 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
 2. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
with c cf_z2[of 0] True
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
(1 - c) * dist (z 0) (z (0 + ?n)) \<le> c ^ 0 * d * (1 - c ^ ?n)
d = 0
((1 - c) * ?x \<le> 0) = (?x \<le> 0)
[PROOF STEP]
have "z n = z0" for n
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
(1 - c) * dist (z 0) (z (0 + ?n)) \<le> c ^ 0 * d * (1 - c ^ ?n)
d = 0
((1 - c) * ?x \<le> 0) = (?x \<le> 0)

goal (1 subgoal):
 1. z n = z0
[PROOF STEP]
by (simp add: z_def)
[PROOF STATE]
proof (state)
this:
z ?n = z0

goal (2 subgoals):
 1. d = 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
 2. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
with \<open>e > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < e
z ?n = z0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < e
z ?n = z0

goal (1 subgoal):
 1. \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e

goal (1 subgoal):
 1. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
d \<noteq> 0

goal (1 subgoal):
 1. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
with zero_le_dist[of "z 0" "z 1"]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> dist (z 0) (z 1)
d \<noteq> 0
[PROOF STEP]
have "d > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> dist (z 0) (z 1)
d \<noteq> 0

goal (1 subgoal):
 1. 0 < d
[PROOF STEP]
by (metis d_def less_le)
[PROOF STATE]
proof (state)
this:
0 < d

goal (1 subgoal):
 1. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
with \<open>1 - c > 0\<close> \<open>e > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < 1 - c
0 < e
0 < d
[PROOF STEP]
have "0 < e * (1 - c) / d"
[PROOF STATE]
proof (prove)
using this:
0 < 1 - c
0 < e
0 < d

goal (1 subgoal):
 1. 0 < e * (1 - c) / d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < e * (1 - c) / d

goal (1 subgoal):
 1. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
with c
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
0 < e * (1 - c) / d
[PROOF STEP]
obtain N where N: "c ^ N < e * (1 - c) / d"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
0 < e * (1 - c) / d

goal (1 subgoal):
 1. (\<And>N. c ^ N < e * (1 - c) / d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using real_arch_pow_inv[of "e * (1 - c) / d" c]
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
0 < e * (1 - c) / d
\<lbrakk>0 < e * (1 - c) / d; c < 1\<rbrakk> \<Longrightarrow> \<exists>n. c ^ n < e * (1 - c) / d

goal (1 subgoal):
 1. (\<And>N. c ^ N < e * (1 - c) / d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c ^ N < e * (1 - c) / d

goal (1 subgoal):
 1. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
have *: "dist (z m) (z n) < e" if "m > n" and as: "m \<ge> N" "n \<ge> N" for m n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
from c \<open>n \<ge> N\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
N \<le> n
[PROOF STEP]
have *: "c ^ n \<le> c ^ N"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
N \<le> n

goal (1 subgoal):
 1. c ^ n \<le> c ^ N
[PROOF STEP]
using power_decreasing[OF \<open>n\<ge>N\<close>, of c]
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
N \<le> n
\<lbrakk>0 \<le> c; c \<le> 1\<rbrakk> \<Longrightarrow> c ^ n \<le> c ^ N

goal (1 subgoal):
 1. c ^ n \<le> c ^ N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c ^ n \<le> c ^ N

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
from c \<open>m > n\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
n < m
[PROOF STEP]
have "1 - c ^ (m - n) > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
n < m

goal (1 subgoal):
 1. 0 < 1 - c ^ (m - n)
[PROOF STEP]
using power_strict_mono[of c 1 "m - n"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
n < m
\<lbrakk>c < 1; 0 \<le> c; 0 < m - n\<rbrakk> \<Longrightarrow> c ^ (m - n) < 1 ^ (m - n)

goal (1 subgoal):
 1. 0 < 1 - c ^ (m - n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 - c ^ (m - n)

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
with \<open>d > 0\<close> \<open>0 < 1 - c\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < d
0 < 1 - c
0 < 1 - c ^ (m - n)
[PROOF STEP]
have **: "d * (1 - c ^ (m - n)) / (1 - c) > 0"
[PROOF STATE]
proof (prove)
using this:
0 < d
0 < 1 - c
0 < 1 - c ^ (m - n)

goal (1 subgoal):
 1. 0 < d * (1 - c ^ (m - n)) / (1 - c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < d * (1 - c ^ (m - n)) / (1 - c)

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
from cf_z2[of n "m - n"] \<open>m > n\<close>
[PROOF STATE]
proof (chain)
picking this:
(1 - c) * dist (z n) (z (n + (m - n))) \<le> c ^ n * d * (1 - c ^ (m - n))
n < m
[PROOF STEP]
have "dist (z m) (z n) \<le> c ^ n * d * (1 - c ^ (m - n)) / (1 - c)"
[PROOF STATE]
proof (prove)
using this:
(1 - c) * dist (z n) (z (n + (m - n))) \<le> c ^ n * d * (1 - c ^ (m - n))
n < m

goal (1 subgoal):
 1. dist (z m) (z n) \<le> c ^ n * d * (1 - c ^ (m - n)) / (1 - c)
[PROOF STEP]
by (simp add: pos_le_divide_eq[OF \<open>1 - c > 0\<close>] mult.commute dist_commute)
[PROOF STATE]
proof (state)
this:
dist (z m) (z n) \<le> c ^ n * d * (1 - c ^ (m - n)) / (1 - c)

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (z m) (z n) \<le> c ^ n * d * (1 - c ^ (m - n)) / (1 - c)

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
have "\<dots> \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ^ n * d * (1 - c ^ (m - n)) / (1 - c) \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)
[PROOF STEP]
using mult_right_mono[OF * order_less_imp_le[OF **]]
[PROOF STATE]
proof (prove)
using this:
c ^ n * (d * (1 - c ^ (m - n)) / (1 - c)) \<le> c ^ N * (d * (1 - c ^ (m - n)) / (1 - c))

goal (1 subgoal):
 1. c ^ n * d * (1 - c ^ (m - n)) / (1 - c) \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)
[PROOF STEP]
by (simp add: mult.assoc)
[PROOF STATE]
proof (state)
this:
c ^ n * d * (1 - c ^ (m - n)) / (1 - c) \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c ^ n * d * (1 - c ^ (m - n)) / (1 - c) \<le> c ^ N * d * (1 - c ^ (m - n)) / (1 - c)

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
have "\<dots> < (e * (1 - c) / d) * d * (1 - c ^ (m - n)) / (1 - c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c ^ N * d * (1 - c ^ (m - n)) / (1 - c) < e * (1 - c) / d * d * (1 - c ^ (m - n)) / (1 - c)
[PROOF STEP]
using mult_strict_right_mono[OF N **]
[PROOF STATE]
proof (prove)
using this:
c ^ N * (d * (1 - c ^ (m - n)) / (1 - c)) < e * (1 - c) / d * (d * (1 - c ^ (m - n)) / (1 - c))

goal (1 subgoal):
 1. c ^ N * d * (1 - c ^ (m - n)) / (1 - c) < e * (1 - c) / d * d * (1 - c ^ (m - n)) / (1 - c)
[PROOF STEP]
by (auto simp: mult.assoc)
[PROOF STATE]
proof (state)
this:
c ^ N * d * (1 - c ^ (m - n)) / (1 - c) < e * (1 - c) / d * d * (1 - c ^ (m - n)) / (1 - c)

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c ^ N * d * (1 - c ^ (m - n)) / (1 - c) < e * (1 - c) / d * d * (1 - c ^ (m - n)) / (1 - c)

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
from c \<open>d > 0\<close> \<open>1 - c > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
0 < d
0 < 1 - c
[PROOF STEP]
have "\<dots> = e * (1 - c ^ (m - n))"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
0 < d
0 < 1 - c

goal (1 subgoal):
 1. e * (1 - c) / d * d * (1 - c ^ (m - n)) / (1 - c) = e * (1 - c ^ (m - n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
e * (1 - c) / d * d * (1 - c ^ (m - n)) / (1 - c) = e * (1 - c ^ (m - n))

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
e * (1 - c) / d * d * (1 - c ^ (m - n)) / (1 - c) = e * (1 - c ^ (m - n))

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
from c \<open>1 - c ^ (m - n) > 0\<close> \<open>e > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
0 < 1 - c ^ (m - n)
0 < e
[PROOF STEP]
have "\<dots> \<le> e"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
0 < 1 - c ^ (m - n)
0 < e

goal (1 subgoal):
 1. e * (1 - c ^ (m - n)) \<le> e
[PROOF STEP]
using mult_right_le_one_le[of e "1 - c ^ (m - n)"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
0 < 1 - c ^ (m - n)
0 < e
\<lbrakk>0 \<le> e; 0 \<le> 1 - c ^ (m - n); 1 - c ^ (m - n) \<le> 1\<rbrakk> \<Longrightarrow> e * (1 - c ^ (m - n)) \<le> e

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

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (z m) (z n) < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dist (z m) (z n) < e

goal (1 subgoal):
 1. dist (z m) (z n) < e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (z m) (z n) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?n < ?m; N \<le> ?m; N \<le> ?n\<rbrakk> \<Longrightarrow> dist (z ?m) (z ?n) < e

goal (1 subgoal):
 1. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
have "dist (z n) (z m) < e" if "N \<le> m" "N \<le> n" for m n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (z n) (z m) < e
[PROOF STEP]
proof (cases "n = m")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = m \<Longrightarrow> dist (z n) (z m) < e
 2. n \<noteq> m \<Longrightarrow> dist (z n) (z m) < e
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = m

goal (2 subgoals):
 1. n = m \<Longrightarrow> dist (z n) (z m) < e
 2. n \<noteq> m \<Longrightarrow> dist (z n) (z m) < e
[PROOF STEP]
with \<open>e > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < e
n = m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < e
n = m

goal (1 subgoal):
 1. dist (z n) (z m) < e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (z n) (z m) < e

goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> dist (z n) (z m) < e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> dist (z n) (z m) < e
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> m

goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> dist (z n) (z m) < e
[PROOF STEP]
with *[of n m] *[of m n] and that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n < m; N \<le> m; N \<le> n\<rbrakk> \<Longrightarrow> dist (z m) (z n) < e
\<lbrakk>m < n; N \<le> n; N \<le> m\<rbrakk> \<Longrightarrow> dist (z n) (z m) < e
N \<le> m
N \<le> n
n \<noteq> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n < m; N \<le> m; N \<le> n\<rbrakk> \<Longrightarrow> dist (z m) (z n) < e
\<lbrakk>m < n; N \<le> n; N \<le> m\<rbrakk> \<Longrightarrow> dist (z n) (z m) < e
N \<le> m
N \<le> n
n \<noteq> m

goal (1 subgoal):
 1. dist (z n) (z m) < e
[PROOF STEP]
by (auto simp: dist_commute nat_neq_iff)
[PROOF STATE]
proof (state)
this:
dist (z n) (z m) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?m; N \<le> ?n\<rbrakk> \<Longrightarrow> dist (z ?n) (z ?m) < e

goal (1 subgoal):
 1. d \<noteq> 0 \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>N \<le> ?m; N \<le> ?n\<rbrakk> \<Longrightarrow> dist (z ?n) (z ?m) < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>N \<le> ?m; N \<le> ?n\<rbrakk> \<Longrightarrow> dist (z ?n) (z ?m) < e

goal (1 subgoal):
 1. \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < ?e

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?e \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < ?e
[PROOF STEP]
have "Cauchy z"
[PROOF STATE]
proof (prove)
using this:
0 < ?e \<Longrightarrow> \<exists>N. \<forall>m n. N \<le> m \<and> N \<le> n \<longrightarrow> dist (z m) (z n) < ?e

goal (1 subgoal):
 1. Cauchy z
[PROOF STEP]
by (simp add: cauchy_def)
[PROOF STATE]
proof (state)
this:
Cauchy z

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Cauchy z
[PROOF STEP]
obtain x where "x\<in>s" and x:"(z \<longlongrightarrow> x) sequentially"
[PROOF STATE]
proof (prove)
using this:
Cauchy z

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> s; z \<longlonglongrightarrow> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using s(1)[unfolded compact_def complete_def, THEN spec[where x=z]] and z_in_s
[PROOF STATE]
proof (prove)
using this:
Cauchy z
(\<forall>n. z n \<in> s) \<and> Cauchy z \<longrightarrow> (\<exists>l\<in>s. z \<longlonglongrightarrow> l)
z ?n \<in> s

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> s; z \<longlonglongrightarrow> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> s
z \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
define e where "e = dist (f x) x"
[PROOF STATE]
proof (state)
this:
e = dist (f x) x

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
have "e = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "e \<noteq> 0"
[PROOF STATE]
proof (state)
this:
e \<noteq> 0

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e \<noteq> 0
[PROOF STEP]
have "e > 0"
[PROOF STATE]
proof (prove)
using this:
e \<noteq> 0

goal (1 subgoal):
 1. 0 < e
[PROOF STEP]
unfolding e_def
[PROOF STATE]
proof (prove)
using this:
dist (f x) x \<noteq> 0

goal (1 subgoal):
 1. 0 < dist (f x) x
[PROOF STEP]
using zero_le_dist[of "f x" x]
[PROOF STATE]
proof (prove)
using this:
dist (f x) x \<noteq> 0
0 \<le> dist (f x) x

goal (1 subgoal):
 1. 0 < dist (f x) x
[PROOF STEP]
by (metis dist_eq_0_iff dist_nz e_def)
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
obtain N where N:"\<forall>n\<ge>N. dist (z n) x < e/2"
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. dist (z n) x < e / 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using x[unfolded lim_sequentially, THEN spec[where x="e/2"]]
[PROOF STATE]
proof (prove)
using this:
0 < e
0 < e / 2 \<longrightarrow> (\<exists>no. \<forall>n\<ge>no. dist (z n) x < e / 2)

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. dist (z n) x < e / 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>N. dist (z n) x < e / 2

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n\<ge>N. dist (z n) x < e / 2
[PROOF STEP]
have N':"dist (z N) x < e/2"
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>N. dist (z n) x < e / 2

goal (1 subgoal):
 1. dist (z N) x < e / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (z N) x < e / 2

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have *: "c * dist (z N) x \<le> dist (z N) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * dist (z N) x \<le> dist (z N) x
[PROOF STEP]
unfolding mult_le_cancel_right2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < dist (z N) x \<longrightarrow> c \<le> 1) \<and> (dist (z N) x < 0 \<longrightarrow> 1 \<le> c)
[PROOF STEP]
using zero_le_dist[of "z N" x] and c
[PROOF STATE]
proof (prove)
using this:
0 \<le> dist (z N) x
0 \<le> c
c < 1

goal (1 subgoal):
 1. (0 < dist (z N) x \<longrightarrow> c \<le> 1) \<and> (dist (z N) x < 0 \<longrightarrow> 1 \<le> c)
[PROOF STEP]
by (metis dist_eq_0_iff dist_nz order_less_asym less_le)
[PROOF STATE]
proof (state)
this:
c * dist (z N) x \<le> dist (z N) x

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "dist (f (z N)) (f x) \<le> c * dist (z N) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f (z N)) (f x) \<le> c * dist (z N) x
[PROOF STEP]
using lipschitz[THEN bspec[where x="z N"], THEN bspec[where x=x]]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>z N \<in> s; x \<in> s\<rbrakk> \<Longrightarrow> dist (f (z N)) (f x) \<le> c * dist (z N) x

goal (1 subgoal):
 1. dist (f (z N)) (f x) \<le> c * dist (z N) x
[PROOF STEP]
using z_in_s[of N] \<open>x\<in>s\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>z N \<in> s; x \<in> s\<rbrakk> \<Longrightarrow> dist (f (z N)) (f x) \<le> c * dist (z N) x
z N \<in> s
x \<in> s

goal (1 subgoal):
 1. dist (f (z N)) (f x) \<le> c * dist (z N) x
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>z N \<in> s; x \<in> s\<rbrakk> \<Longrightarrow> dist (f (z N)) (f x) \<le> c * dist (z N) x
z N \<in> s
x \<in> s
0 \<le> c
c < 1

goal (1 subgoal):
 1. dist (f (z N)) (f x) \<le> c * dist (z N) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (f (z N)) (f x) \<le> c * dist (z N) x

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (f (z N)) (f x) \<le> c * dist (z N) x

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "\<dots> < e/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * dist (z N) x < e / 2
[PROOF STEP]
using N' and c
[PROOF STATE]
proof (prove)
using this:
dist (z N) x < e / 2
0 \<le> c
c < 1

goal (1 subgoal):
 1. c * dist (z N) x < e / 2
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
dist (z N) x < e / 2
0 \<le> c
c < 1
c * dist (z N) x \<le> dist (z N) x

goal (1 subgoal):
 1. c * dist (z N) x < e / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c * dist (z N) x < e / 2

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (f (z N)) (f x) < e / 2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
dist (f (z N)) (f x) < e / 2

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding fzn
[PROOF STATE]
proof (prove)
using this:
dist (z (Suc N)) (f x) < e / 2

goal (1 subgoal):
 1. False
[PROOF STEP]
using N[THEN spec[where x="Suc N"]] and dist_triangle_half_r[of "z (Suc N)" "f x" e x]
[PROOF STATE]
proof (prove)
using this:
dist (z (Suc N)) (f x) < e / 2
N \<le> Suc N \<longrightarrow> dist (z (Suc N)) x < e / 2
\<lbrakk>dist (z (Suc N)) (f x) < e / 2; dist (z (Suc N)) x < e / 2\<rbrakk> \<Longrightarrow> dist (f x) x < e

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding e_def
[PROOF STATE]
proof (prove)
using this:
dist (z (Suc N)) (f x) < dist (f x) x / 2
N \<le> Suc N \<longrightarrow> dist (z (Suc N)) x < dist (f x) x / 2
\<lbrakk>dist (z (Suc N)) (f x) < dist (f x) x / 2; dist (z (Suc N)) x < dist (f x) x / 2\<rbrakk> \<Longrightarrow> dist (f x) x < dist (f x) x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
e = 0

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e = 0
[PROOF STEP]
have "f x = x"
[PROOF STATE]
proof (prove)
using this:
e = 0

goal (1 subgoal):
 1. f x = x
[PROOF STEP]
by (auto simp: e_def)
[PROOF STATE]
proof (state)
this:
f x = x

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f x = x

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
have "y = x" if "f y = y" "y \<in> s" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = x
[PROOF STEP]
from \<open>x \<in> s\<close> \<open>f x = x\<close> that
[PROOF STATE]
proof (chain)
picking this:
x \<in> s
f x = x
f y = y
y \<in> s
[PROOF STEP]
have "dist x y \<le> c * dist x y"
[PROOF STATE]
proof (prove)
using this:
x \<in> s
f x = x
f y = y
y \<in> s

goal (1 subgoal):
 1. dist x y \<le> c * dist x y
[PROOF STEP]
using lipschitz[THEN bspec[where x=x], THEN bspec[where x=y]]
[PROOF STATE]
proof (prove)
using this:
x \<in> s
f x = x
f y = y
y \<in> s
\<lbrakk>x \<in> s; y \<in> s\<rbrakk> \<Longrightarrow> dist (f x) (f y) \<le> c * dist x y

goal (1 subgoal):
 1. dist x y \<le> c * dist x y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist x y \<le> c * dist x y

goal (1 subgoal):
 1. y = x
[PROOF STEP]
with c and zero_le_dist[of x y]
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
c < 1
0 \<le> dist x y
dist x y \<le> c * dist x y
[PROOF STEP]
have "dist x y = 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
0 \<le> dist x y
dist x y \<le> c * dist x y

goal (1 subgoal):
 1. dist x y = 0
[PROOF STEP]
by (simp add: mult_le_cancel_right1)
[PROOF STATE]
proof (state)
this:
dist x y = 0

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>f ?y = ?y; ?y \<in> s\<rbrakk> \<Longrightarrow> ?y = x

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f x = x
\<lbrakk>f ?y = ?y; ?y \<in> s\<rbrakk> \<Longrightarrow> ?y = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f x = x
\<lbrakk>f ?y = ?y; ?y \<in> s\<rbrakk> \<Longrightarrow> ?y = x

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
using \<open>x\<in>s\<close>
[PROOF STATE]
proof (prove)
using this:
f x = x
\<lbrakk>f ?y = ?y; ?y \<in> s\<rbrakk> \<Longrightarrow> ?y = x
x \<in> s

goal (1 subgoal):
 1. \<exists>!x. x \<in> s \<and> f x = x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>!x. x \<in> s \<and> f x = x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poincare_distance_sym:
  assumes "u \<in> unit_disc" and "v \<in> unit_disc"
  shows "poincare_distance u v = poincare_distance v u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_distance u v = poincare_distance v u
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc

goal (1 subgoal):
 1. poincare_distance u v = poincare_distance v u
[PROOF STEP]
using poincare_distance_formula[OF assms(1) assms(2)]
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
poincare_distance u v = poincare_distance_formula (to_complex u) (to_complex v)

goal (1 subgoal):
 1. poincare_distance u v = poincare_distance v u
[PROOF STEP]
using poincare_distance_formula[OF assms(2) assms(1)]
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
poincare_distance u v = poincare_distance_formula (to_complex u) (to_complex v)
poincare_distance v u = poincare_distance_formula (to_complex v) (to_complex u)

goal (1 subgoal):
 1. poincare_distance u v = poincare_distance v u
[PROOF STEP]
by (simp add: mult.commute norm_minus_commute)


[STATEMENT]
lemma lookup_monic: "lookup (monic p) v = (lookup p v) / lc p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monic p) v = lookup p v / lc p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lookup (monic p) v = lookup p v / lc p
[PROOF STEP]
have "lookup (monic p) (0 \<oplus> v) = (1 / lc p) * (lookup p v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monic p) ((0::'a) \<oplus> v) = (1::'b) / lc p * lookup p v
[PROOF STEP]
unfolding monic_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monom_mult ((1::'b) / lc p) (0::'a) p) ((0::'a) \<oplus> v) = (1::'b) / lc p * lookup p v
[PROOF STEP]
by (rule lookup_monom_mult_plus)
[PROOF STATE]
proof (state)
this:
lookup (monic p) ((0::'a) \<oplus> v) = (1::'b) / lc p * lookup p v

goal (1 subgoal):
 1. lookup (monic p) v = lookup p v / lc p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
lookup (monic p) ((0::'a) \<oplus> v) = (1::'b) / lc p * lookup p v

goal (1 subgoal):
 1. lookup (monic p) v = lookup p v / lc p
[PROOF STEP]
by (simp add: term_simps)
[PROOF STATE]
proof (state)
this:
lookup (monic p) v = lookup p v / lc p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enumeration:"\<lbrakk>f \<in> {i. i \<le> (n::nat)} \<rightarrow> {i. i \<le> m}; inj_on f {i. i \<le> n}\<rbrakk>
                     \<Longrightarrow>  n \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> m}; inj_on f {i. i \<le> n}\<rbrakk> \<Longrightarrow> n \<le> m
[PROOF STEP]
apply (frule image_sub[of f "{i. i \<le> n}" "{i. i \<le> m}" "{i. i \<le> n}"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> m}; inj_on f {i. i \<le> n}\<rbrakk> \<Longrightarrow> {i. i \<le> n} \<subseteq> {i. i \<le> n}
 2. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> m}; inj_on f {i. i \<le> n}; f ` {i. i \<le> n} \<subseteq> {i. i \<le> m}\<rbrakk> \<Longrightarrow> n \<le> m
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> m}; inj_on f {i. i \<le> n}; f ` {i. i \<le> n} \<subseteq> {i. i \<le> m}\<rbrakk> \<Longrightarrow> n \<le> m
[PROOF STEP]
apply (frule card_image[of f "{i. i \<le> n}"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> m}; inj_on f {i. i \<le> n}; f ` {i. i \<le> n} \<subseteq> {i. i \<le> m}; card (f ` {i. i \<le> n}) = card {i. i \<le> n}\<rbrakk> \<Longrightarrow> n \<le> m
[PROOF STEP]
apply(drule card_mono[OF finite_Collect_le_nat])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {i. i \<le> n} \<rightarrow> {i. i \<le> m}; inj_on f {i. i \<le> n}; card (f ` {i. i \<le> n}) = card {i. i \<le> n}; card (f ` {i. i \<le> n}) \<le> card {i. i \<le> m}\<rbrakk> \<Longrightarrow> n \<le> m
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mssnth_sin_series_stream_aux:
  "mssnth (sin_series_stream_aux b (fact m) m) n =
     (if b then -1 else 1) * (-1) ^ n / (fact (2 * n + m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mssnth (sin_series_stream_aux b (fact m) (real m)) n = (if b then - 1 else 1) * (- 1) ^ n / fact (2 * n + m)
[PROOF STEP]
proof (induction n arbitrary: b m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b m. mssnth (sin_series_stream_aux b (fact m) (real m)) 0 = (if b then - 1 else 1) * (- 1) ^ 0 / fact (2 * 0 + m)
 2. \<And>n b m. (\<And>b m. mssnth (sin_series_stream_aux b (fact m) (real m)) n = (if b then - 1 else 1) * (- 1) ^ n / fact (2 * n + m)) \<Longrightarrow> mssnth (sin_series_stream_aux b (fact m) (real m)) (Suc n) = (if b then - 1 else 1) * (- 1) ^ Suc n / fact (2 * Suc n + m)
[PROOF STEP]
case (0 b m)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>b m. mssnth (sin_series_stream_aux b (fact m) (real m)) 0 = (if b then - 1 else 1) * (- 1) ^ 0 / fact (2 * 0 + m)
 2. \<And>n b m. (\<And>b m. mssnth (sin_series_stream_aux b (fact m) (real m)) n = (if b then - 1 else 1) * (- 1) ^ n / fact (2 * n + m)) \<Longrightarrow> mssnth (sin_series_stream_aux b (fact m) (real m)) (Suc n) = (if b then - 1 else 1) * (- 1) ^ Suc n / fact (2 * Suc n + m)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mssnth (sin_series_stream_aux b (fact m) (real m)) 0 = (if b then - 1 else 1) * (- 1) ^ 0 / fact (2 * 0 + m)
[PROOF STEP]
by (subst sin_series_stream_aux.code) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
mssnth (sin_series_stream_aux b (fact m) (real m)) 0 = (if b then - 1 else 1) * (- 1) ^ 0 / fact (2 * 0 + m)

goal (1 subgoal):
 1. \<And>n b m. (\<And>b m. mssnth (sin_series_stream_aux b (fact m) (real m)) n = (if b then - 1 else 1) * (- 1) ^ n / fact (2 * n + m)) \<Longrightarrow> mssnth (sin_series_stream_aux b (fact m) (real m)) (Suc n) = (if b then - 1 else 1) * (- 1) ^ Suc n / fact (2 * Suc n + m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n b m. (\<And>b m. mssnth (sin_series_stream_aux b (fact m) (real m)) n = (if b then - 1 else 1) * (- 1) ^ n / fact (2 * n + m)) \<Longrightarrow> mssnth (sin_series_stream_aux b (fact m) (real m)) (Suc n) = (if b then - 1 else 1) * (- 1) ^ Suc n / fact (2 * Suc n + m)
[PROOF STEP]
case (Suc n b m)
[PROOF STATE]
proof (state)
this:
mssnth (sin_series_stream_aux ?b (fact ?m) (real ?m)) n = (if ?b then - 1 else 1) * (- 1) ^ n / fact (2 * n + ?m)

goal (1 subgoal):
 1. \<And>n b m. (\<And>b m. mssnth (sin_series_stream_aux b (fact m) (real m)) n = (if b then - 1 else 1) * (- 1) ^ n / fact (2 * n + m)) \<Longrightarrow> mssnth (sin_series_stream_aux b (fact m) (real m)) (Suc n) = (if b then - 1 else 1) * (- 1) ^ Suc n / fact (2 * Suc n + m)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mssnth (sin_series_stream_aux b (fact m) (real m)) (Suc n) = (if b then - 1 else 1) * (- 1) ^ Suc n / fact (2 * Suc n + m)
[PROOF STEP]
using Suc.IH[of "\<not>b" "m + 2"]
[PROOF STATE]
proof (prove)
using this:
mssnth (sin_series_stream_aux (\<not> b) (fact (m + 2)) (real (m + 2))) n = (if \<not> b then - 1 else 1) * (- 1) ^ n / fact (2 * n + (m + 2))

goal (1 subgoal):
 1. mssnth (sin_series_stream_aux b (fact m) (real m)) (Suc n) = (if b then - 1 else 1) * (- 1) ^ Suc n / fact (2 * Suc n + m)
[PROOF STEP]
by (subst sin_series_stream_aux.code) (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
mssnth (sin_series_stream_aux b (fact m) (real m)) (Suc n) = (if b then - 1 else 1) * (- 1) ^ Suc n / fact (2 * Suc n + m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aux_comp_with_cmod:
  fixes g:: "nat \<Rightarrow> nat"
  assumes "(\<forall>x<2^n. g x = 0) \<or> (\<forall>x<2^n. g x = 1)"
  shows "(cmod (\<Sum>k<2^n. (-1)^(g k)))\<^sup>2  = 2^(2*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
proof(rule disjE)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?P \<or> ?Q
 2. ?P \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
 3. ?Q \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
show "(\<forall>x<2^n. g x = 0) \<or> (\<forall>x<2^n. g x = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x<2 ^ n. g x = 0) \<or> (\<forall>x<2 ^ n. g x = 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<forall>x<2 ^ n. g x = 0) \<or> (\<forall>x<2 ^ n. g x = 1)

goal (1 subgoal):
 1. (\<forall>x<2 ^ n. g x = 0) \<or> (\<forall>x<2 ^ n. g x = 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<forall>x<2 ^ n. g x = 0) \<or> (\<forall>x<2 ^ n. g x = 1)

goal (2 subgoals):
 1. \<forall>x<2 ^ n. g x = 0 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
 2. \<forall>x<2 ^ n. g x = 1 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>x<2 ^ n. g x = 0 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
 2. \<forall>x<2 ^ n. g x = 1 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
assume "\<forall>x<2^n. g x = 0"
[PROOF STATE]
proof (state)
this:
\<forall>x<2 ^ n. g x = 0

goal (2 subgoals):
 1. \<forall>x<2 ^ n. g x = 0 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
 2. \<forall>x<2 ^ n. g x = 1 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x<2 ^ n. g x = 0
[PROOF STEP]
have "(cmod (\<Sum>k<2^n. (-1)^(g k)))\<^sup>2 = (2^n)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<forall>x<2 ^ n. g x = 0

goal (1 subgoal):
 1. (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = (2 ^ n)\<^sup>2
[PROOF STEP]
by (simp add: norm_power)
[PROOF STATE]
proof (state)
this:
(cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = (2 ^ n)\<^sup>2

goal (2 subgoals):
 1. \<forall>x<2 ^ n. g x = 0 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
 2. \<forall>x<2 ^ n. g x = 1 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = (2 ^ n)\<^sup>2
[PROOF STEP]
show "?thesis"
[PROOF STATE]
proof (prove)
using this:
(cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = (2 ^ n)\<^sup>2

goal (1 subgoal):
 1. (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
by (simp add: power_even_eq)
[PROOF STATE]
proof (state)
this:
(cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)

goal (1 subgoal):
 1. \<forall>x<2 ^ n. g x = 1 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x<2 ^ n. g x = 1 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
assume "\<forall>x<2^n. g x = 1"
[PROOF STATE]
proof (state)
this:
\<forall>x<2 ^ n. g x = 1

goal (1 subgoal):
 1. \<forall>x<2 ^ n. g x = 1 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x<2 ^ n. g x = 1
[PROOF STEP]
have "(cmod (\<Sum>k<2^n. (-1)^(g k)))\<^sup>2 = (2^n)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<forall>x<2 ^ n. g x = 1

goal (1 subgoal):
 1. (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = (2 ^ n)\<^sup>2
[PROOF STEP]
by (simp add: norm_power)
[PROOF STATE]
proof (state)
this:
(cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = (2 ^ n)\<^sup>2

goal (1 subgoal):
 1. \<forall>x<2 ^ n. g x = 1 \<Longrightarrow> (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = (2 ^ n)\<^sup>2
[PROOF STEP]
show "?thesis"
[PROOF STATE]
proof (prove)
using this:
(cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = (2 ^ n)\<^sup>2

goal (1 subgoal):
 1. (cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)
[PROOF STEP]
by (simp add: power_even_eq)
[PROOF STATE]
proof (state)
this:
(cmod (\<Sum>k<2 ^ n. (- 1) ^ g k))\<^sup>2 = 2 ^ (2 * n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_root_mult_exp_cancel:
  "\<lbrakk> 0 < x; 0 < m; 0 < n \<rbrakk>
   \<Longrightarrow> root (m * n) (x ^ (k * n)) = root m (x ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; 0 < m; 0 < n\<rbrakk> \<Longrightarrow> root (m * n) (x ^ (k * n)) = root m (x ^ k)
[PROOF STEP]
by (simp add: power_mult real_root_pos_unique)


[STATEMENT]
lemma ortho_c_scalprod0:
  assumes "z1 \<noteq> 0" and "z2 \<noteq> 0"
  shows "\<angle>c z1 z2 = pi/2 \<longleftrightarrow> scalprod z1 z2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<angle>c z1 z2 = pi / 2) = (scalprod z1 z2 = 0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<angle>c z1 z2 = pi / 2) = (scalprod z1 z2 = 0)
[PROOF STEP]
have "\<angle> z1 z2 = pi / 2 \<or> \<angle> z1 z2 = - pi / 2 \<longleftrightarrow> \<angle>c z1 z2 = pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<angle> z1 z2 = pi / 2 \<or> \<angle> z1 z2 = - pi / 2) = (\<angle>c z1 z2 = pi / 2)
[PROOF STEP]
unfolding ang_vec_c_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<angle> z1 z2 = pi / 2 \<or> \<angle> z1 z2 = - pi / 2) = (\<bar>\<angle> z1 z2\<bar> = pi / 2)
[PROOF STEP]
using arctan
[PROOF STATE]
proof (prove)
using this:
- (pi / 2) < arctan ?y \<and> arctan ?y < pi / 2 \<and> tan (arctan ?y) = ?y

goal (1 subgoal):
 1. (\<angle> z1 z2 = pi / 2 \<or> \<angle> z1 z2 = - pi / 2) = (\<bar>\<angle> z1 z2\<bar> = pi / 2)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<angle> z1 z2 = pi / 2 \<or> \<angle> z1 z2 = - pi / 2) = (\<angle>c z1 z2 = pi / 2)

goal (1 subgoal):
 1. (\<angle>c z1 z2 = pi / 2) = (scalprod z1 z2 = 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<angle> z1 z2 = pi / 2 \<or> \<angle> z1 z2 = - pi / 2) = (\<angle>c z1 z2 = pi / 2)

goal (1 subgoal):
 1. (\<angle>c z1 z2 = pi / 2) = (scalprod z1 z2 = 0)
[PROOF STEP]
using ortho_scalprod0[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<angle> z1 z2 = pi / 2 \<or> \<angle> z1 z2 = - pi / 2) = (\<angle>c z1 z2 = pi / 2)
(\<angle> z1 z2 = pi / 2 \<or> \<angle> z1 z2 = - pi / 2) = (scalprod z1 z2 = 0)

goal (1 subgoal):
 1. (\<angle>c z1 z2 = pi / 2) = (scalprod z1 z2 = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<angle>c z1 z2 = pi / 2) = (scalprod z1 z2 = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma C1_differentiable_on_mult [simp, derivative_intros]:
  fixes f g :: "real \<Rightarrow> 'a :: real_normed_algebra"
  shows "f C1_differentiable_on S \<Longrightarrow> g C1_differentiable_on S \<Longrightarrow> (\<lambda>x. f x * g x) C1_differentiable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f C1_differentiable_on S; g C1_differentiable_on S\<rbrakk> \<Longrightarrow> (\<lambda>x. f x * g x) C1_differentiable_on S
[PROOF STEP]
unfolding C1_differentiable_on_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<forall>x\<in>S. f differentiable at x) \<and> continuous_on S (\<lambda>x. vector_derivative f (at x)); (\<forall>x\<in>S. g differentiable at x) \<and> continuous_on S (\<lambda>x. vector_derivative g (at x))\<rbrakk> \<Longrightarrow> (\<forall>x\<in>S. (\<lambda>x. f x * g x) differentiable at x) \<and> continuous_on S (\<lambda>x. vector_derivative (\<lambda>x. f x * g x) (at x))
[PROOF STEP]
by (auto simp: continuous_on_add continuous_on_mult continuous_at_imp_continuous_on differentiable_imp_continuous_within)


[STATEMENT]
lemma "((\<lambda>x::real. x powr 1.5 * (sqrt (x + 1) + sqrt (x - 1) - 2 * sqrt x)) \<longlongrightarrow> -1/4) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x powr (15 / 10) * (sqrt (x + 1) + sqrt (x - 1) - 2 * sqrt x)) \<longlongrightarrow> - 1 / 4) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma infsum_Im:
  assumes "f summable_on M"
  shows "infsum (\<lambda>x. Im (f x)) M = Im (infsum f M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>M. Im (f x)) = Im (infsum f M)
[PROOF STEP]
apply (rule infsum_comm_additive[where f=Im, unfolded o_def])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. additive Im
 2. isCont Im (infsum f M)
 3. f summable_on M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f summable_on M

goal (3 subgoals):
 1. additive Im
 2. isCont Im (infsum f M)
 3. f summable_on M
[PROOF STEP]
by (auto intro!: additive.intro)


[STATEMENT]
lemma ZFact_one: "carrier (ZFact 1) = {UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (ZFact 1) = {UNIV}
[PROOF STEP]
unfolding ZFact_defs A_RCOSETS_defs r_coset_def ring_record_simps int.genideal_one
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>a. {\<Union>h. {h + a}}) = {UNIV}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Union>a. {\<Union>h. {h + a}}) \<subseteq> {UNIV}
 2. {UNIV} \<subseteq> (\<Union>a. {\<Union>h. {h + a}})
[PROOF STEP]
have "\<And>a b::int. \<exists>x. b = x + a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<exists>x. b = x + a
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<exists>x. ?b = x + ?a

goal (2 subgoals):
 1. (\<Union>a. {\<Union>h. {h + a}}) \<subseteq> {UNIV}
 2. {UNIV} \<subseteq> (\<Union>a. {\<Union>h. {h + a}})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. ?b = x + ?a
[PROOF STEP]
show "(\<Union>a::int. {\<Union>h. {h + a}}) \<subseteq> {UNIV}"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. ?b = x + ?a

goal (1 subgoal):
 1. (\<Union>a. {\<Union>h. {h + a}}) \<subseteq> {UNIV}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<Union>a. {\<Union>h. {h + a}}) \<subseteq> {UNIV}

goal (1 subgoal):
 1. {UNIV} \<subseteq> (\<Union>a. {\<Union>h. {h + a}})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>a. {\<Union>h. {h + a}}) \<subseteq> {UNIV}
[PROOF STEP]
show "{UNIV} \<subseteq> (\<Union>a::int. {\<Union>h. {h + a}})"
[PROOF STATE]
proof (prove)
using this:
(\<Union>a. {\<Union>h. {h + a}}) \<subseteq> {UNIV}

goal (1 subgoal):
 1. {UNIV} \<subseteq> (\<Union>a. {\<Union>h. {h + a}})
[PROOF STEP]
by (metis (no_types, lifting) UNIV_I UN_I singletonD singletonI subset_iff)
[PROOF STATE]
proof (state)
this:
{UNIV} \<subseteq> (\<Union>a. {\<Union>h. {h + a}})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_to_list_length:
  assumes "finite S"
  shows "length (set_to_list S) = card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (sorted_list_of_set S) = card S
[PROOF STEP]
by (metis assms length_remdups_card_conv length_sort set_sorted_list_of_set sorted_list_of_set_sort_remdups)


[STATEMENT]
lemma monomial_Sum_any:
  assumes "finite {c. f c \<noteq> 0}"
  shows "monomial (Sum_any f) a = (\<Sum>c. monomial (f c) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomial (Sum_any f) a = (\<Sum>c. monomial (f c) a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monomial (Sum_any f) a = (\<Sum>c. monomial (f c) a)
[PROOF STEP]
have "{c. monomial (f c) a \<noteq> 0} \<subseteq> {c. f c \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {c. monomial (f c) a \<noteq> 0} \<subseteq> {c. f c \<noteq> (0::'b)}
[PROOF STEP]
by (rule, auto)
[PROOF STATE]
proof (state)
this:
{c. monomial (f c) a \<noteq> 0} \<subseteq> {c. f c \<noteq> (0::'b)}

goal (1 subgoal):
 1. monomial (Sum_any f) a = (\<Sum>c. monomial (f c) a)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite {c. f c \<noteq> (0::'b)}
{c. monomial (f c) a \<noteq> 0} \<subseteq> {c. f c \<noteq> (0::'b)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {c. f c \<noteq> (0::'b)}
{c. monomial (f c) a \<noteq> 0} \<subseteq> {c. f c \<noteq> (0::'b)}

goal (1 subgoal):
 1. monomial (Sum_any f) a = (\<Sum>c. monomial (f c) a)
[PROOF STEP]
by (simp add: Groups_Big_Fun.comm_monoid_add_class.Sum_any.expand_superset monomial_sum)
[PROOF STATE]
proof (state)
this:
monomial (Sum_any f) a = (\<Sum>c. monomial (f c) a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integrable_bij_count_space:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes g: "bij_betw g A B"
  shows "integrable (count_space A) (\<lambda>x. f (g x)) \<longleftrightarrow> integrable (count_space B) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (count_space A) (\<lambda>x. f (g x)) = integrable (count_space B) f
[PROOF STEP]
unfolding integrable_iff_bounded
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) \<in> borel_measurable (count_space A) \<and> \<integral>\<^sup>+ x. ennreal (norm (f (g x))) \<partial>count_space A < \<infinity>) = (f \<in> borel_measurable (count_space B) \<and> \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>count_space B < \<infinity>)
[PROOF STEP]
by (subst nn_integral_bij_count_space[OF g]) auto


[STATEMENT]
lemma exp_lower_taylor_even:
  fixes x::real
  shows "even n \<Longrightarrow> (\<Sum>m<n. (x ^ m) / (fact m)) \<le> exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even n \<Longrightarrow> (\<Sum>m<n. x ^ m / fact m) \<le> exp x
[PROOF STEP]
using Maclaurin_exp_le [of x n]
[PROOF STATE]
proof (prove)
using this:
\<exists>t. \<bar>t\<bar> \<le> \<bar>x\<bar> \<and> exp x = (\<Sum>m<n. x ^ m / fact m) + exp t / fact n * x ^ n

goal (1 subgoal):
 1. even n \<Longrightarrow> (\<Sum>m<n. x ^ m / fact m) \<le> exp x
[PROOF STEP]
by (auto simp add: zero_le_even_power)


[STATEMENT]
lemma ex_by_sq_aux:
  fixes x :: int and n :: nat
  assumes "n mod 2 = 1"
  shows "x * (x * x) ^ (n div 2) = x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * (x * x) ^ (n div 2) = x ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * (x * x) ^ (n div 2) = x ^ n
[PROOF STEP]
have "n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n mod 2 = 1

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

goal (1 subgoal):
 1. x * (x * x) ^ (n div 2) = x ^ n
[PROOF STEP]
have "2 * (n div 2) = n - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (n div 2) = n - 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n mod 2 = 1

goal (1 subgoal):
 1. 2 * (n div 2) = n - 1
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
2 * (n div 2) = n - 1

goal (1 subgoal):
 1. x * (x * x) ^ (n div 2) = x ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * (n div 2) = n - 1
[PROOF STEP]
have "(x * x) ^ (n div 2) = x ^ (n - 1)"
[PROOF STATE]
proof (prove)
using this:
2 * (n div 2) = n - 1

goal (1 subgoal):
 1. (x * x) ^ (n div 2) = x ^ (n - 1)
[PROOF STEP]
by (simp add: semiring_normalization_rules)
[PROOF STATE]
proof (state)
this:
(x * x) ^ (n div 2) = x ^ (n - 1)

goal (1 subgoal):
 1. x * (x * x) ^ (n div 2) = x ^ n
[PROOF STEP]
with \<open>0 < n\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < n
(x * x) ^ (n div 2) = x ^ (n - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < n
(x * x) ^ (n div 2) = x ^ (n - 1)

goal (1 subgoal):
 1. x * (x * x) ^ (n div 2) = x ^ n
[PROOF STEP]
by simp (metis Suc_pred power.simps(2))
[PROOF STATE]
proof (state)
this:
x * (x * x) ^ (n div 2) = x ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_transpose:
  fixes xs :: "'a list list"
  shows "length (transpose xs) = foldr (\<lambda>xs. max (length xs)) xs 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (transpose xs) = foldr (\<lambda>xs. max (length xs)) xs 0
[PROOF STEP]
by (induct rule: transpose.induct)
    (auto simp: transpose_aux_filter_tail foldr_map comp_def transpose_aux_max
                max_Suc_Suc[symmetric] simp del: max_Suc_Suc)