[STATEMENT]
lemma quat_inner_i_left [simp]: "inner \<i> x = Im1 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i> \<bullet> x = Im1 x
[PROOF STEP]
unfolding inner_quat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat.Re \<i> * quat.Re x + Im1 \<i> * Im1 x + Im2 \<i> * Im2 x + Im3 \<i> * Im3 x = Im1 x
[PROOF STEP]
by simp


[STATEMENT]
lemma poly_eval_map_indets: "poly_eval a (map_indets g p) = poly_eval (a \<circ> g) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_eval a (map_indets g p) = poly_eval (a \<circ> g) p
[PROOF STEP]
by (simp add: poly_eval_def poly_subst_map_indets comp_def)
      (simp add: poly_subst_def lookup_sum lookup_times_zero subst_pp_def lookup_prod_zero
          lookup_power_zero flip: times_monomial_left)


[STATEMENT]
lemma chain_union_closed':
  assumes \<open>is_chain f\<close> and \<open>(\<forall>n. f n \<in> C)\<close> and \<open>\<forall>S' \<in> C. \<forall>S \<subseteq> S'. S \<in> C\<close>
    and \<open>finite S'\<close> and \<open>S' \<subseteq> (\<Union>n. f n)\<close>
  shows \<open>S' \<in> C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
note \<open>finite S'\<close> and \<open>S' \<subseteq> (\<Union>n. f n)\<close>
[PROOF STATE]
proof (state)
this:
finite S'
S' \<subseteq> \<Union> (range f)

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite S'
S' \<subseteq> \<Union> (range f)
[PROOF STEP]
obtain n where \<open>S' \<subseteq> f n\<close>
[PROOF STATE]
proof (prove)
using this:
finite S'
S' \<subseteq> \<Union> (range f)

goal (1 subgoal):
 1. (\<And>n. S' \<subseteq> f n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using chain_index \<open>is_chain f\<close>
[PROOF STATE]
proof (prove)
using this:
finite S'
S' \<subseteq> \<Union> (range f)
\<lbrakk>is_chain ?f; finite ?F; ?F \<subseteq> \<Union> (range ?f)\<rbrakk> \<Longrightarrow> \<exists>n. ?F \<subseteq> ?f n
is_chain f

goal (1 subgoal):
 1. (\<And>n. S' \<subseteq> f n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S' \<subseteq> f n

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S' \<subseteq> f n

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
have \<open>f n \<in> C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n \<in> C
[PROOF STEP]
using \<open>\<forall>n. f n \<in> C\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f n \<in> C

goal (1 subgoal):
 1. f n \<in> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f n \<in> C

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S' \<subseteq> f n
f n \<in> C
[PROOF STEP]
show \<open>S' \<in> C\<close>
[PROOF STATE]
proof (prove)
using this:
S' \<subseteq> f n
f n \<in> C

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
using \<open>\<forall>S' \<in> C. \<forall>S \<subseteq> S'. S \<in> C\<close>
[PROOF STATE]
proof (prove)
using this:
S' \<subseteq> f n
f n \<in> C
\<forall>S'\<in>C. \<forall>S\<subseteq>S'. S \<in> C

goal (1 subgoal):
 1. S' \<in> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S' \<in> C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_list_filter_list_of_pdevs_of_list:
  fixes xs::"'a::comm_monoid_add list"
  assumes "\<And>x. x \<in> set xs \<Longrightarrow> x \<noteq> 0"
  shows "sum_list (filter p (map snd (list_of_pdevs (pdevs_of_list xs)))) = sum_list (filter p xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (filter p (map snd (list_of_pdevs (pdevs_of_list xs)))) = sum_list (filter p xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> set xs \<Longrightarrow> ?x \<noteq> (0::'a)

goal (1 subgoal):
 1. sum_list (filter p (map snd (list_of_pdevs (pdevs_of_list xs)))) = sum_list (filter p xs)
[PROOF STEP]
by (auto simp: list_of_pdevs_pdevs_of_list_eq rev_filter[symmetric])


[STATEMENT]
lemma isCont_cot: "sin x \<noteq> 0 \<Longrightarrow> isCont cot x"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin x \<noteq> (0::'a) \<Longrightarrow> isCont cot x
[PROOF STEP]
by (rule DERIV_cot [THEN DERIV_isCont])


[STATEMENT]
lemma i_expand_nth_0_upto_k_minus_1_if: "
  \<lbrakk> n = t * k + i; i < k \<rbrakk> \<Longrightarrow>
  (f \<odot>\<^sub>i k) n = (if i = 0 then f t else \<NoMsg>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n = t * k + i; i < k\<rbrakk> \<Longrightarrow> (f \<odot> k) n = (if i = 0 then f t else NoMsg)
[PROOF STEP]
by (simp add: i_expand_nth_if)


[STATEMENT]
lemma vars_in_right_only:
  "x \<in> vars q \<Longrightarrow> x \<notin> vars p \<Longrightarrow> x \<in> vars (p+q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> vars q; x \<notin> vars p\<rbrakk> \<Longrightarrow> x \<in> vars (p + q)
[PROOF STEP]
unfolding  vars_def keys_def plus_mpoly.rep_eq lookup_plus_fun
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of q)); x \<notin> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p))\<rbrakk> \<Longrightarrow> x \<in> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p + mapping_of q))
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>x \<notin> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p)); xa \<in> map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of q); x \<in> map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) xa\<rbrakk> \<Longrightarrow> x \<in> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p + mapping_of q))
[PROOF STEP]
subgoal for xa
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p)); xa \<in> map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of q); x \<in> map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) xa\<rbrakk> \<Longrightarrow> x \<in> \<Union> (map_fun lookup id (\<lambda>f. {k. f k \<noteq> 0}) ` map_fun lookup id (\<lambda>f. {k. f k \<noteq> (0::'a)}) (mapping_of p + mapping_of q))
[PROOF STEP]
by (auto simp: vars_def keys_def plus_mpoly.rep_eq
      lookup_plus_fun intro!: exI[of _ xa] dest!: spec[of _ xa])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma circline_type_zero_card_eq1:
  assumes "circline_type H = 0"
  shows "\<exists> z. circline_set H = {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
have "\<exists> z. on_circline H z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. on_circline H z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
circline_type H = 0

goal (1 subgoal):
 1. \<exists>z. on_circline H z
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
fix H
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
assume hh: "hermitean H \<and> H \<noteq> mat_zero"
[PROOF STATE]
proof (state)
this:
hermitean H \<and> H \<noteq> mat_zero

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
obtain A B C D where HH: "H = (A, B, C, D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A B C D. H = (A, B, C, D) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases H) auto
[PROOF STATE]
proof (state)
this:
H = (A, B, C, D)

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
hence "C = cnj B" "is_real A" "is_real D"
[PROOF STATE]
proof (prove)
using this:
H = (A, B, C, D)

goal (1 subgoal):
 1. C = cnj B &&& is_real A &&& is_real D
[PROOF STEP]
using hh hermitean_elems[of A B C D]
[PROOF STATE]
proof (prove)
using this:
H = (A, B, C, D)
hermitean H \<and> H \<noteq> mat_zero
hermitean (A, B, C, D) \<Longrightarrow> is_real A
hermitean (A, B, C, D) \<Longrightarrow> is_real D
hermitean (A, B, C, D) \<Longrightarrow> B = cnj C
hermitean (A, B, C, D) \<Longrightarrow> cnj B = C

goal (1 subgoal):
 1. C = cnj B &&& is_real A &&& is_real D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C = cnj B
is_real A
is_real D

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
assume "circline_type_cmat H = 0"
[PROOF STATE]
proof (state)
this:
circline_type_cmat H = 0

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
hence "mat_det H = 0"
[PROOF STATE]
proof (prove)
using this:
circline_type_cmat H = 0

goal (1 subgoal):
 1. mat_det H = 0
[PROOF STEP]
by (simp add: complex_eq_if_Re_eq hh mat_det_hermitean_real sgn_eq_0_iff)
[PROOF STATE]
proof (state)
this:
mat_det H = 0

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
hence "A*D = B*C"
[PROOF STATE]
proof (prove)
using this:
mat_det H = 0

goal (1 subgoal):
 1. A * D = B * C
[PROOF STEP]
using HH
[PROOF STATE]
proof (prove)
using this:
mat_det H = 0
H = (A, B, C, D)

goal (1 subgoal):
 1. A * D = B * C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A * D = B * C

goal (1 subgoal):
 1. \<And>H Ha. \<lbrakk>hermitean H \<and> H \<noteq> mat_zero; circline_type_cmat H = 0; circline_type_clmat Ha = 0\<rbrakk> \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
show "Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
proof (cases "A \<noteq> 0 \<or> B \<noteq> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<noteq> 0 \<or> B \<noteq> 0 \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
 2. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A \<noteq> 0 \<or> B \<noteq> 0

goal (2 subgoals):
 1. A \<noteq> 0 \<or> B \<noteq> 0 \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
 2. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0 \<or> B \<noteq> 0

goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
using HH \<open>A*D = B*C\<close>
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0 \<or> B \<noteq> 0
H = (A, B, C, D)
A * D = B * C

goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
by (rule_tac x="(-B, A)" in bexI) (auto simp add: Let_def vec_cnj_def field_simps)
[PROOF STATE]
proof (state)
this:
Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)

goal (1 subgoal):
 1. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (A \<noteq> 0 \<or> B \<noteq> 0)

goal (1 subgoal):
 1. \<not> (A \<noteq> 0 \<or> B \<noteq> 0) \<Longrightarrow> Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (A \<noteq> 0 \<or> B \<noteq> 0)

goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
using HH \<open>C = cnj B\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (A \<noteq> 0 \<or> B \<noteq> 0)
H = (A, B, C, D)
C = cnj B

goal (1 subgoal):
 1. Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)
[PROOF STEP]
by (rule_tac x="(1, 0)" in bexI) (simp_all add: Let_def vec_cnj_def)
[PROOF STATE]
proof (state)
this:
Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Bex {v. v \<noteq> vec_zero} (on_circline_cmat_cvec H)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>z. on_circline H z

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. on_circline H z
[PROOF STEP]
obtain z where "on_circline H z"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. on_circline H z

goal (1 subgoal):
 1. (\<And>z. on_circline H z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
on_circline H z

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
obtain M where "moebius_pt M z = 0\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M. moebius_pt M z = 0\<^sub>h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_moebius_1[of z]
[PROOF STATE]
proof (prove)
using this:
\<exists>M. moebius_pt M z = ?w1.0

goal (1 subgoal):
 1. (\<And>M. moebius_pt M z = 0\<^sub>h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt M z = 0\<^sub>h

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
hence "0\<^sub>h \<in> circline_set (moebius_circline M H)"
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z = 0\<^sub>h

goal (1 subgoal):
 1. 0\<^sub>h \<in> circline_set (moebius_circline M H)
[PROOF STEP]
using on_circline_moebius_circline_I[OF \<open>on_circline H z\<close>, of M]
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z = 0\<^sub>h
on_circline (moebius_circline M H) (moebius_pt M z)

goal (1 subgoal):
 1. 0\<^sub>h \<in> circline_set (moebius_circline M H)
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
moebius_pt M z = 0\<^sub>h
on_circline (moebius_circline M H) (moebius_pt M z)

goal (1 subgoal):
 1. 0\<^sub>h \<in> Collect (on_circline (moebius_circline M H))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0\<^sub>h \<in> circline_set (moebius_circline M H)

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
hence "circline_set (moebius_circline M H) = {0\<^sub>h}"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> circline_set (moebius_circline M H)

goal (1 subgoal):
 1. circline_set (moebius_circline M H) = {0\<^sub>h}
[PROOF STEP]
using circline_type_zero_card_eq1_0[of "moebius_circline M H"] \<open>circline_type H = 0\<close>
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> circline_set (moebius_circline M H)
\<lbrakk>circline_type (moebius_circline M H) = 0; 0\<^sub>h \<in> circline_set (moebius_circline M H)\<rbrakk> \<Longrightarrow> circline_set (moebius_circline M H) = {0\<^sub>h}
circline_type H = 0

goal (1 subgoal):
 1. circline_set (moebius_circline M H) = {0\<^sub>h}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
circline_set (moebius_circline M H) = {0\<^sub>h}

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
hence "circline_set H = {z}"
[PROOF STATE]
proof (prove)
using this:
circline_set (moebius_circline M H) = {0\<^sub>h}

goal (1 subgoal):
 1. circline_set H = {z}
[PROOF STEP]
using \<open>moebius_pt M z = 0\<^sub>h\<close>
[PROOF STATE]
proof (prove)
using this:
circline_set (moebius_circline M H) = {0\<^sub>h}
moebius_pt M z = 0\<^sub>h

goal (1 subgoal):
 1. circline_set H = {z}
[PROOF STEP]
using bij_moebius_pt[of M] bij_image_singleton[of "moebius_pt M" "circline_set H" _ z]
[PROOF STATE]
proof (prove)
using this:
circline_set (moebius_circline M H) = {0\<^sub>h}
moebius_pt M z = 0\<^sub>h
bij (moebius_pt M)
\<lbrakk>moebius_pt M ` circline_set H = {?b}; moebius_pt M z = ?b; bij (moebius_pt M)\<rbrakk> \<Longrightarrow> circline_set H = {z}

goal (1 subgoal):
 1. circline_set H = {z}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
circline_set H = {z}

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
circline_set H = {z}

goal (1 subgoal):
 1. \<exists>z. circline_set H = {z}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z. circline_set H = {z}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_boolean_algebra_generator_subset:
  assumes "A \<in> gen_boolean_algebra S As"
  assumes "As \<subseteq> Bs"
  shows "A \<in> gen_boolean_algebra S Bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply(rule gen_boolean_algebra.induct[of A S As])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. A \<in> gen_boolean_algebra S As
 2. S \<in> gen_boolean_algebra S Bs
 3. \<And>A. A \<in> As \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S Bs
 4. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 5. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
A \<in> gen_boolean_algebra S As

goal (5 subgoals):
 1. A \<in> gen_boolean_algebra S As
 2. S \<in> gen_boolean_algebra S Bs
 3. \<And>A. A \<in> As \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S Bs
 4. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 5. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. S \<in> gen_boolean_algebra S Bs
 2. \<And>A. A \<in> As \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S Bs
 3. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 4. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply (simp add: gen_boolean_algebra.intros(1); fail)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A. A \<in> As \<Longrightarrow> A \<inter> S \<in> gen_boolean_algebra S Bs
 2. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 3. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply (meson Set.basic_monos(7) assms(2) gen_boolean_algebra.intros(2))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 2. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
using gen_boolean_algebra.intros(3)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> gen_boolean_algebra ?S ?B; ?C \<in> gen_boolean_algebra ?S ?B\<rbrakk> \<Longrightarrow> ?A \<union> ?C \<in> gen_boolean_algebra ?S ?B

goal (2 subgoals):
 1. \<And>A C. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs; C \<in> gen_boolean_algebra S As; C \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> A \<union> C \<in> gen_boolean_algebra S Bs
 2. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
using gen_boolean_algebra.intros(4)
[PROOF STATE]
proof (prove)
using this:
?A \<in> gen_boolean_algebra ?S ?B \<Longrightarrow> ?S - ?A \<in> gen_boolean_algebra ?S ?B

goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<in> gen_boolean_algebra S As; A \<in> gen_boolean_algebra S Bs\<rbrakk> \<Longrightarrow> S - A \<in> gen_boolean_algebra S Bs
[PROOF STEP]
by blast


[STATEMENT]
lemma limpt_sequential_inj:
  fixes x :: "'a::metric_space"
  shows "x islimpt S \<longleftrightarrow>
         (\<exists>f. (\<forall>n::nat. f n \<in> S - {x}) \<and> inj f \<and> (f \<longlongrightarrow> x) sequentially)"
         (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt S = (\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
x islimpt S

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x islimpt S
[PROOF STEP]
have "\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e"
[PROOF STATE]
proof (prove)
using this:
x islimpt S

goal (1 subgoal):
 1. \<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e
[PROOF STEP]
by (force simp: islimpt_approachable)
[PROOF STATE]
proof (state)
this:
\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e
[PROOF STEP]
obtain y where y: "\<And>e. e>0 \<Longrightarrow> y e \<in> S \<and> y e \<noteq> x \<and> dist (y e) x < e"
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e

goal (1 subgoal):
 1. (\<And>y. (\<And>e. 0 < e \<Longrightarrow> y e \<in> S \<and> y e \<noteq> x \<and> dist (y e) x < e) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> y ?e \<in> S \<and> y ?e \<noteq> x \<and> dist (y ?e) x < ?e

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
define f where "f \<equiv> rec_nat (y 1) (\<lambda>n fn. y (min (inverse(2 ^ (Suc n))) (dist fn x)))"
[PROOF STATE]
proof (state)
this:
f \<equiv> rec_nat (y 1) (\<lambda>n fn. y (min (inverse (2 ^ Suc n)) (dist fn x)))

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
have [simp]: "f 0 = y 1"
               "f(Suc n) = y (min (inverse(2 ^ (Suc n))) (dist (f n) x))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f 0 = y 1 &&& f (Suc n) = y (min (inverse (2 ^ Suc n)) (dist (f n) x))
[PROOF STEP]
by (simp_all add: f_def)
[PROOF STATE]
proof (state)
this:
f 0 = y 1
f (Suc ?n) = y (min (inverse (2 ^ Suc ?n)) (dist (f ?n) x))

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
have f: "f n \<in> S \<and> (f n \<noteq> x) \<and> dist (f n) x < inverse(2 ^ n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n)
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f 0 \<in> S \<and> f 0 \<noteq> x \<and> dist (f 0) x < inverse (2 ^ 0)
 2. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. f 0 \<in> S \<and> f 0 \<noteq> x \<and> dist (f 0) x < inverse (2 ^ 0)
 2. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f 0 \<in> S \<and> f 0 \<noteq> x \<and> dist (f 0) x < inverse (2 ^ 0)
[PROOF STEP]
by (simp add: y)
[PROOF STATE]
proof (state)
this:
f 0 \<in> S \<and> f 0 \<noteq> x \<and> dist (f 0) x < inverse (2 ^ 0)

goal (1 subgoal):
 1. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n)

goal (1 subgoal):
 1. \<And>n. f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n) \<Longrightarrow> f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f n \<in> S \<and> f n \<noteq> x \<and> dist (f n) x < inverse (2 ^ n)

goal (1 subgoal):
 1. f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)
[PROOF STEP]
apply (auto simp: y)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f n \<in> S; f n \<noteq> x; dist (f n) x < inverse (2 ^ n)\<rbrakk> \<Longrightarrow> dist (y (min (inverse (2 ^ n) / 2) (dist (f n) x))) x * 2 < inverse (2 ^ n)
[PROOF STEP]
by (metis half_gt_zero_iff inverse_positive_iff_positive less_divide_eq_numeral1(1) min_less_iff_conj y zero_less_dist_iff zero_less_numeral zero_less_power)
[PROOF STATE]
proof (state)
this:
f (Suc n) \<in> S \<and> f (Suc n) \<noteq> x \<and> dist (f (Suc n)) x < inverse (2 ^ Suc n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ?n \<in> S \<and> f ?n \<noteq> x \<and> dist (f ?n) x < inverse (2 ^ ?n)

goal (2 subgoals):
 1. x islimpt S \<Longrightarrow> \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
 2. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
proof (rule_tac x=f in exI, intro conjI allI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. f n \<in> S - {x}
 2. inj f
 3. f \<longlonglongrightarrow> x
[PROOF STEP]
show "\<And>n. f n \<in> S - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. f n \<in> S - {x}
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f ?n \<in> S \<and> f ?n \<noteq> x \<and> dist (f ?n) x < inverse (2 ^ ?n)

goal (1 subgoal):
 1. \<And>n. f n \<in> S - {x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f ?n \<in> S - {x}

goal (2 subgoals):
 1. inj f
 2. f \<longlonglongrightarrow> x
[PROOF STEP]
have "dist (f n) x < dist (f m) x" if "m < n" for m n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f n) x < dist (f m) x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m < n

goal (1 subgoal):
 1. dist (f n) x < dist (f m) x
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m < 0 \<Longrightarrow> dist (f 0) x < dist (f m) x
 2. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
m < 0

goal (2 subgoals):
 1. m < 0 \<Longrightarrow> dist (f 0) x < dist (f m) x
 2. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m < 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
m < 0

goal (1 subgoal):
 1. dist (f 0) x < dist (f m) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (f 0) x < dist (f m) x

goal (1 subgoal):
 1. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < Suc n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < Suc n
[PROOF STEP]
consider "m < n" | "m = n"
[PROOF STATE]
proof (prove)
using this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < Suc n

goal (1 subgoal):
 1. \<lbrakk>m < n \<Longrightarrow> thesis; m = n \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < Suc n
(?m < Suc ?n) = (?m < ?n \<or> ?m = ?n)

goal (1 subgoal):
 1. \<lbrakk>m < n \<Longrightarrow> thesis; m = n \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>m < n \<Longrightarrow> ?thesis; m = n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>n. \<lbrakk>m < n \<Longrightarrow> dist (f n) x < dist (f m) x; m < Suc n\<rbrakk> \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>m < n \<Longrightarrow> ?thesis; m = n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>m < n \<Longrightarrow> ?thesis; m = n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
assume "m < n"
[PROOF STATE]
proof (state)
this:
m < n

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
have "dist (f(Suc n)) x = dist (y (min (inverse(2 ^ (Suc n))) (dist (f n) x))) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f (Suc n)) x = dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x = dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x = dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
have "\<dots> < dist (f n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x < dist (f n) x
[PROOF STEP]
by (metis dist_pos_lt f min.strict_order_iff min_less_iff_conj y)
[PROOF STATE]
proof (state)
this:
dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x < dist (f n) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (y (min (inverse (2 ^ Suc n)) (dist (f n) x))) x < dist (f n) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
have "\<dots> < dist (f m) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f n) x < dist (f m) x
[PROOF STEP]
using Suc.IH \<open>m < n\<close>
[PROOF STATE]
proof (prove)
using this:
m < n \<Longrightarrow> dist (f n) x < dist (f m) x
m < n

goal (1 subgoal):
 1. dist (f n) x < dist (f m) x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dist (f n) x < dist (f m) x

goal (2 subgoals):
 1. m < n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
 2. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dist (f (Suc n)) x < dist (f m) x

goal (1 subgoal):
 1. dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x < dist (f m) x

goal (1 subgoal):
 1. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
assume "m = n"
[PROOF STATE]
proof (state)
this:
m = n

goal (1 subgoal):
 1. m = n \<Longrightarrow> dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m = n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
m = n

goal (1 subgoal):
 1. dist (f (Suc n)) x < dist (f m) x
[PROOF STEP]
by simp (metis dist_pos_lt f half_gt_zero_iff inverse_positive_iff_positive min_less_iff_conj y zero_less_numeral zero_less_power)
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x < dist (f m) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dist (f (Suc n)) x < dist (f m) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?m < ?n \<Longrightarrow> dist (f ?n) x < dist (f ?m) x

goal (2 subgoals):
 1. inj f
 2. f \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?m < ?n \<Longrightarrow> dist (f ?n) x < dist (f ?m) x
[PROOF STEP]
show "inj f"
[PROOF STATE]
proof (prove)
using this:
?m < ?n \<Longrightarrow> dist (f ?n) x < dist (f ?m) x

goal (1 subgoal):
 1. inj f
[PROOF STEP]
by (metis less_irrefl linorder_injI)
[PROOF STATE]
proof (state)
this:
inj f

goal (1 subgoal):
 1. f \<longlonglongrightarrow> x
[PROOF STEP]
show "f \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> x
[PROOF STEP]
apply (rule tendstoI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F xa in sequentially. dist (f xa) x < e
[PROOF STEP]
apply (rule_tac c="nat (ceiling(1/e))" in eventually_sequentiallyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e xa. \<lbrakk>0 < e; nat \<lceil>1 / e\<rceil> \<le> xa\<rbrakk> \<Longrightarrow> dist (f xa) x < e
[PROOF STEP]
apply (rule less_trans [OF f [THEN conjunct2, THEN conjunct2]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e x. \<lbrakk>0 < e; nat \<lceil>1 / e\<rceil> \<le> x\<rbrakk> \<Longrightarrow> inverse (2 ^ x) < e
[PROOF STEP]
apply (simp add: field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e x. \<lbrakk>0 < e; 1 \<le> e * real x\<rbrakk> \<Longrightarrow> 1 < e * 2 ^ x
[PROOF STEP]
by (meson le_less_trans mult_less_cancel_left not_le of_nat_less_two_power)
[PROOF STATE]
proof (state)
this:
f \<longlonglongrightarrow> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x \<Longrightarrow> x islimpt S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<exists>f. (\<forall>n. f n \<in> S - {x}) \<and> inj f \<and> f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. x islimpt S
[PROOF STEP]
by (fastforce simp add: islimpt_approachable lim_sequentially)
[PROOF STATE]
proof (state)
this:
x islimpt S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_lub_simps[simp]:
    "fun_lub lub {} = (\<lambda>x. lub {})"
    "fun_lub lub {f} = (\<lambda>x. lub {f x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fun_lub lub {} = (\<lambda>x. lub {}) &&& fun_lub lub {f} = (\<lambda>x. lub {f x})
[PROOF STEP]
unfolding fun_lub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. lub {y. \<exists>f\<in>{}. y = f x}) = (\<lambda>x. lub {}) &&& (\<lambda>x. lub {y. \<exists>f\<in>{f}. y = f x}) = (\<lambda>x. lub {f x})
[PROOF STEP]
by auto


[STATEMENT]
theorem turing_reducible_AB_and_decB_imp_decA:
  "\<lbrakk> turing_reducible A B; turing_decidable B \<rbrakk> \<Longrightarrow> turing_decidable A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
assume "turing_reducible A B"
    and  "turing_decidable B"
[PROOF STATE]
proof (state)
this:
turing_reducible A B
turing_decidable B

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
(* first, obtain a composable reducer machine Red *)
[PROOF STATE]
proof (state)
this:
turing_reducible A B
turing_decidable B

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
from \<open>turing_reducible A B\<close>
[PROOF STATE]
proof (chain)
picking this:
turing_reducible A B
[PROOF STEP]
have "\<exists>Red. composable_tm0 Red \<and>
               (\<forall>nl::nat list. \<exists>ml::nat list. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A \<longleftrightarrow> ml \<in> B))"
[PROOF STATE]
proof (prove)
using this:
turing_reducible A B

goal (1 subgoal):
 1. \<exists>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))
[PROOF STEP]
by (rule turing_reducible_A_B_imp_composable_reducer_ex)
[PROOF STATE]
proof (state)
this:
\<exists>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))
[PROOF STEP]
obtain Red where
    w_RedTM: "composable_tm0 Red \<and>
               (\<forall>nl::nat list. \<exists>ml::nat list. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A \<longleftrightarrow> ml \<in> B))"
[PROOF STATE]
proof (prove)
using this:
\<exists>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. (\<And>Red. composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
(* second, obtain a decider DB for problem B *)
[PROOF STATE]
proof (state)
this:
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
from \<open>turing_decidable B\<close>
[PROOF STATE]
proof (chain)
picking this:
turing_decidable B
[PROOF STEP]
have "(\<exists>D. (\<forall>nl::nat list.
           (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl (1::nat))
         \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl (0::nat))
       ))"
[PROOF STATE]
proof (prove)
using this:
turing_decidable B

goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
unfolding turing_decidable_unfolded_into_TMC_yields_conditions
[PROOF STATE]
proof (prove)
using this:
\<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)

goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
obtain DB where
    w_DB: "(\<forall>nl.
           (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl (1::nat))
         \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl (0::nat))
       )"
[PROOF STATE]
proof (prove)
using this:
\<exists>D. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res D nl 0)

goal (1 subgoal):
 1. (\<And>DB. \<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
(* third, define the composed machine DA = Red |+| DB that is able to decide A *)
[PROOF STATE]
proof (state)
this:
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
define DA where "DA = Red |+| DB"
[PROOF STATE]
proof (state)
this:
DA = Red |+| DB

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
(* now, go for the main part of the proof *)
[PROOF STATE]
proof (state)
this:
DA = Red |+| DB

goal (1 subgoal):
 1. \<lbrakk>turing_reducible A B; turing_decidable B\<rbrakk> \<Longrightarrow> turing_decidable A
[PROOF STEP]
show "turing_decidable A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. turing_decidable A
[PROOF STEP]
unfolding turing_decidable_unfolded_into_TMC_yields_conditions
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
have "\<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl (1::nat)) \<and>
                 (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl (0::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
proof (rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
fix nl
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
show "(nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl (1::nat)) \<and>
              (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl (0::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1
 2. nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
show "nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl (1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nl \<in> A \<Longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
assume "nl \<in> A"
[PROOF STATE]
proof (state)
this:
nl \<in> A

goal (1 subgoal):
 1. nl \<in> A \<Longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
from \<open>nl \<in> A\<close> and w_RedTM
[PROOF STATE]
proof (chain)
picking this:
nl \<in> A
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))
[PROOF STEP]
obtain ml where w_ml: "composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A \<longleftrightarrow> ml \<in> B)"
[PROOF STATE]
proof (prove)
using this:
nl \<in> A
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. (\<And>ml. composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)

goal (1 subgoal):
 1. nl \<in> A \<Longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
with \<open>nl \<in> A\<close> w_DB
[PROOF STATE]
proof (chain)
picking this:
nl \<in> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)
[PROOF STEP]
have "TMC_yields_num_res (Red |+| DB) nl  (1::nat)"
[PROOF STATE]
proof (prove)
using this:
nl \<in> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)

goal (1 subgoal):
 1. TMC_yields_num_res (Red |+| DB) nl 1
[PROOF STEP]
using TMC_yields_num_res_Hoare_plus_halt
[PROOF STATE]
proof (prove)
using this:
nl \<in> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)
\<lbrakk>TMC_yields_num_list_res ?tm1.0 ?nl ?r1.0; TMC_yields_num_res ?tm2.0 ?r1.0 ?r2.0; composable_tm0 ?tm1.0\<rbrakk> \<Longrightarrow> TMC_yields_num_res (?tm1.0 |+| ?tm2.0) ?nl ?r2.0

goal (1 subgoal):
 1. TMC_yields_num_res (Red |+| DB) nl 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
TMC_yields_num_res (Red |+| DB) nl 1

goal (1 subgoal):
 1. nl \<in> A \<Longrightarrow> TMC_yields_num_res DA nl 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
TMC_yields_num_res (Red |+| DB) nl 1
[PROOF STEP]
show "TMC_yields_num_res DA nl 1"
[PROOF STATE]
proof (prove)
using this:
TMC_yields_num_res (Red |+| DB) nl 1

goal (1 subgoal):
 1. TMC_yields_num_res DA nl 1
[PROOF STEP]
using DA_def
[PROOF STATE]
proof (prove)
using this:
TMC_yields_num_res (Red |+| DB) nl 1
DA = Red |+| DB

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1

goal (1 subgoal):
 1. nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
show "nl \<notin> A \<longrightarrow>  TMC_yields_num_res DA nl 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nl \<notin> A \<Longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
assume "nl \<notin> A"
[PROOF STATE]
proof (state)
this:
nl \<notin> A

goal (1 subgoal):
 1. nl \<notin> A \<Longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
from \<open>nl \<notin> A\<close> and w_RedTM
[PROOF STATE]
proof (chain)
picking this:
nl \<notin> A
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))
[PROOF STEP]
obtain ml where w_ml: "composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A \<longleftrightarrow> ml \<in> B)"
[PROOF STATE]
proof (prove)
using this:
nl \<notin> A
composable_tm0 Red \<and> (\<forall>nl. \<exists>ml. TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B))

goal (1 subgoal):
 1. (\<And>ml. composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)

goal (1 subgoal):
 1. nl \<notin> A \<Longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
with \<open>nl \<notin> A\<close> w_DB
[PROOF STATE]
proof (chain)
picking this:
nl \<notin> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)
[PROOF STEP]
have "TMC_yields_num_res (Red |+| DB) nl  (0::nat)"
[PROOF STATE]
proof (prove)
using this:
nl \<notin> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)

goal (1 subgoal):
 1. TMC_yields_num_res (Red |+| DB) nl 0
[PROOF STEP]
using TMC_yields_num_res_Hoare_plus_halt
[PROOF STATE]
proof (prove)
using this:
nl \<notin> A
\<forall>nl. (nl \<in> B \<longrightarrow> TMC_yields_num_res DB nl 1) \<and> (nl \<notin> B \<longrightarrow> TMC_yields_num_res DB nl 0)
composable_tm0 Red \<and> TMC_yields_num_list_res Red nl ml \<and> (nl \<in> A) = (ml \<in> B)
\<lbrakk>TMC_yields_num_list_res ?tm1.0 ?nl ?r1.0; TMC_yields_num_res ?tm2.0 ?r1.0 ?r2.0; composable_tm0 ?tm1.0\<rbrakk> \<Longrightarrow> TMC_yields_num_res (?tm1.0 |+| ?tm2.0) ?nl ?r2.0

goal (1 subgoal):
 1. TMC_yields_num_res (Red |+| DB) nl 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
TMC_yields_num_res (Red |+| DB) nl 0

goal (1 subgoal):
 1. nl \<notin> A \<Longrightarrow> TMC_yields_num_res DA nl 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
TMC_yields_num_res (Red |+| DB) nl 0
[PROOF STEP]
show "TMC_yields_num_res DA nl 0"
[PROOF STATE]
proof (prove)
using this:
TMC_yields_num_res (Red |+| DB) nl 0

goal (1 subgoal):
 1. TMC_yields_num_res DA nl 0
[PROOF STEP]
using DA_def
[PROOF STATE]
proof (prove)
using this:
TMC_yields_num_res (Red |+| DB) nl 0
DA = Red |+| DB

goal (1 subgoal):
 1. TMC_yields_num_res DA nl 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
TMC_yields_num_res DA nl 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)

goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)
[PROOF STEP]
show "\<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res DA nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res DA nl 0)

goal (1 subgoal):
 1. \<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>D. \<forall>nl. (nl \<in> A \<longrightarrow> TMC_yields_num_res D nl 1) \<and> (nl \<notin> A \<longrightarrow> TMC_yields_num_res D nl 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
turing_decidable A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma locally_connected_sphere:
  fixes a :: "'a::euclidean_space"
  shows "locally connected(sphere a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally connected (sphere a r)
[PROOF STEP]
using ANR_imp_locally_connected ANR_sphere
[PROOF STATE]
proof (prove)
using this:
ANR ?S \<Longrightarrow> locally connected ?S
ANR (sphere ?a ?r)

goal (1 subgoal):
 1. locally connected (sphere a r)
[PROOF STEP]
by blast


[STATEMENT]
lemma set_of_mkt_bal_l:
  "\<lbrakk> avl l; avl r \<rbrakk> \<Longrightarrow>
  set_of (mkt_bal_l n l r) = Set.insert n (set_of l \<union> set_of r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>avl l; avl r\<rbrakk> \<Longrightarrow> set_of (mkt_bal_l n l r) = Set.insert n (set_of l \<union> set_of r)
[PROOF STEP]
by (auto simp: mkt_def split:tree.splits)


[STATEMENT]
lemma Rep_combine_matrix[simp]: "f 0 0 = 0 \<Longrightarrow> Rep_matrix (combine_matrix f A B) j i = f (Rep_matrix A j i) (Rep_matrix B j i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (0::'b) (0::'c) = (0::'a) \<Longrightarrow> Rep_matrix (combine_matrix f A B) j i = f (Rep_matrix A j i) (Rep_matrix B j i)
[PROOF STEP]
by(simp add: combine_matrix_def)


[STATEMENT]
lemma degree_sum_le_Max:
  "finite F \<Longrightarrow> degree (sum f F) \<le> Max ((\<lambda>x. degree (f x))`F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite F \<Longrightarrow> degree (sum f F) \<le> (MAX x\<in>F. degree (f x))
[PROOF STEP]
by (intro degree_sum_le) (auto intro!: Max.coboundedI)


[STATEMENT]
lemma rot_diamond_cube_boundary_valid:
  assumes "(k,\<gamma>)\<in>boundary (rot_diamond_cube)"
  shows "valid_path \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
using d_gt_0 swap_valid_boundaries diamond_cube_boundary_valid
[PROOF STATE]
proof (prove)
using this:
0 < d
\<lbrakk>\<forall>(k, \<gamma>)\<in>boundary ?C. valid_path \<gamma>; (?k, ?\<gamma>) \<in> boundary (prod.swap \<circ> ?C \<circ> prod.swap)\<rbrakk> \<Longrightarrow> valid_path ?\<gamma>
(?k, ?\<gamma>) \<in> boundary diamond_cube \<Longrightarrow> valid_path ?\<gamma>

goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
using assms diamond_cube_is_type_I rot_diamond_cube_def
[PROOF STATE]
proof (prove)
using this:
0 < d
\<lbrakk>\<forall>(k, \<gamma>)\<in>boundary ?C. valid_path \<gamma>; (?k, ?\<gamma>) \<in> boundary (prod.swap \<circ> ?C \<circ> prod.swap)\<rbrakk> \<Longrightarrow> valid_path ?\<gamma>
(?k, ?\<gamma>) \<in> boundary diamond_cube \<Longrightarrow> valid_path ?\<gamma>
(k, \<gamma>) \<in> boundary rot_diamond_cube
typeI_twoCube diamond_cube
rot_diamond_cube = prod.swap \<circ> diamond_cube \<circ> prod.swap

goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Mignotte_bound:
  shows "of_int \<bar>coeff g k\<bar> \<le> (degree g choose k) * mahler_measure g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
proof (cases "k \<le> degree g \<and> g \<noteq> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
 2. \<not> (k \<le> degree g \<and> g \<noteq> 0) \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (k \<le> degree g \<and> g \<noteq> 0)

goal (2 subgoals):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
 2. \<not> (k \<le> degree g \<and> g \<noteq> 0) \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
hence "coeff g k = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (k \<le> degree g \<and> g \<noteq> 0)

goal (1 subgoal):
 1. poly.coeff g k = 0
[PROOF STEP]
using le_degree
[PROOF STATE]
proof (prove)
using this:
\<not> (k \<le> degree g \<and> g \<noteq> 0)
poly.coeff ?p ?n \<noteq> (0::?'a) \<Longrightarrow> ?n \<le> degree ?p

goal (1 subgoal):
 1. poly.coeff g k = 0
[PROOF STEP]
by (cases "g = 0", auto)
[PROOF STATE]
proof (state)
this:
poly.coeff g k = 0

goal (2 subgoals):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
 2. \<not> (k \<le> degree g \<and> g \<noteq> 0) \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
poly.coeff g k = 0

goal (1 subgoal):
 1. real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
using mahler_measure_ge_0[of g]
[PROOF STATE]
proof (prove)
using this:
poly.coeff g k = 0
0 \<le> mahler_measure g

goal (1 subgoal):
 1. real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
case kg: True
[PROOF STATE]
proof (state)
this:
k \<le> degree g \<and> g \<noteq> 0

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
hence g: "g \<noteq> 0" "g dvd g"
[PROOF STATE]
proof (prove)
using this:
k \<le> degree g \<and> g \<noteq> 0

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

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
from mignotte_bound_main[OF g le_refl, of k]
[PROOF STATE]
proof (chain)
picking this:
\<bar>poly.coeff g k\<bar> \<le> \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> + int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>
[PROOF STEP]
have "real_of_int \<bar>coeff g k\<bar>
    \<le> of_int \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> +
      of_int (int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>)"
[PROOF STATE]
proof (prove)
using this:
\<bar>poly.coeff g k\<bar> \<le> \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> + int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>

goal (1 subgoal):
 1. real_of_int \<bar>poly.coeff g k\<bar> \<le> real_of_int \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> + real_of_int (int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real_of_int \<bar>poly.coeff g k\<bar> \<le> real_of_int \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> + real_of_int (int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>)

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int \<bar>poly.coeff g k\<bar> \<le> real_of_int \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> + real_of_int (int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>)

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
have "\<dots> \<le> real (degree g - 1 choose k) * mahler_measure g
     + real (min k 1 * (degree g - 1 choose (k - 1))) * (of_int \<bar>lead_coeff g\<bar> * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> + real_of_int (int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>) \<le> real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * (real_of_int \<bar>lead_coeff g\<bar> * 1)
[PROOF STEP]
by (rule add_mono, force, auto)
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> + real_of_int (int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>) \<le> real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * (real_of_int \<bar>lead_coeff g\<bar> * 1)

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>real (degree g - 1 choose k) * mahler_measure g\<rfloor> + real_of_int (int (min k 1 * (degree g - 1 choose (k - 1))) * \<bar>lead_coeff g\<bar>) \<le> real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * (real_of_int \<bar>lead_coeff g\<bar> * 1)

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
have "\<dots> \<le> real (degree g - 1 choose k) * mahler_measure g
     + real (min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * (real_of_int \<bar>lead_coeff g\<bar> * 1) \<le> real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g
[PROOF STEP]
by (rule add_left_mono[OF mult_left_mono],
    unfold mahler_measure_def mahler_measure_poly_def,
    rule mult_mono, auto intro!: prod_list_ge1)
[PROOF STATE]
proof (state)
this:
real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * (real_of_int \<bar>lead_coeff g\<bar> * 1) \<le> real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * (real_of_int \<bar>lead_coeff g\<bar> * 1) \<le> real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
have "\<dots> =
    (real ((degree g - 1 choose k) + (min k 1 * (degree g - 1 choose (k - 1))))) * mahler_measure g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g = real (degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g = real (degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (degree g - 1 choose k) * mahler_measure g + real (min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g = real (degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1))) * mahler_measure g

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
have "(degree g - 1 choose k) + (min k 1 * (degree g - 1 choose (k - 1))) = degree g choose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
[PROOF STEP]
proof (cases "k = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
 2. k \<noteq> 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
 2. k \<noteq> 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
[PROOF STEP]
obtain kk where k: "k = Suc kk"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0

goal (1 subgoal):
 1. (\<And>kk. k = Suc kk \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases k, auto)
[PROOF STATE]
proof (state)
this:
k = Suc kk

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
 2. k \<noteq> 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
[PROOF STEP]
with kg
[PROOF STATE]
proof (chain)
picking this:
k \<le> degree g \<and> g \<noteq> 0
k = Suc kk
[PROOF STEP]
obtain gg where g: "degree g = Suc gg"
[PROOF STATE]
proof (prove)
using this:
k \<le> degree g \<and> g \<noteq> 0
k = Suc kk

goal (1 subgoal):
 1. (\<And>gg. degree g = Suc gg \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "degree g", auto)
[PROOF STATE]
proof (state)
this:
degree g = Suc gg

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
 2. k \<noteq> 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
[PROOF STEP]
unfolding k g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc gg - 1 choose Suc kk + min (Suc kk) 1 * (Suc gg - 1 choose (Suc kk - 1)) = Suc gg choose Suc kk
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k

goal (1 subgoal):
 1. k = 0 \<Longrightarrow> degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
degree g - 1 choose k + min k 1 * (degree g - 1 choose (k - 1)) = degree g choose k

goal (1 subgoal):
 1. k \<le> degree g \<and> g \<noteq> 0 \<Longrightarrow> real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g

goal (1 subgoal):
 1. real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of_int \<bar>poly.coeff g k\<bar> \<le> real (degree g choose k) * mahler_measure g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_abs_converges_imp_converges [dest, intro]:
  "fds_abs_converges f s \<Longrightarrow> fds_converges f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges f s \<Longrightarrow> fds_converges f s
[PROOF STEP]
unfolding fds_abs_converges_def fds_converges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (fds_nth f n / nat_power n s)) \<Longrightarrow> summable (\<lambda>n. fds_nth f n / nat_power n s)
[PROOF STEP]
by (rule summable_norm_cancel)


[STATEMENT]
lemma iMin_equality: "
  \<lbrakk> k \<in> I; \<And>x. x \<in> I \<Longrightarrow> k \<le> x \<rbrakk> \<Longrightarrow> iMin I = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k \<in> I; \<And>x. x \<in> I \<Longrightarrow> k \<le> x\<rbrakk> \<Longrightarrow> iMin I = k
[PROOF STEP]
unfolding iMin_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k \<in> I; \<And>x. x \<in> I \<Longrightarrow> k \<le> x\<rbrakk> \<Longrightarrow> (LEAST x. x \<in> I) = k
[PROOF STEP]
by (blast intro: Least_equality)


[STATEMENT]
lemma takefill_bintrunc: "takefill False n bl = rev (bin_to_bl n (bl_to_bin (rev bl)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. takefill False n bl = rev (bin_to_bl n (bl_to_bin (rev bl)))
[PROOF STEP]
apply (rule nth_equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (takefill False n bl) = length (rev (bin_to_bl n (bl_to_bin (rev bl))))
 2. \<And>i. i < length (takefill False n bl) \<Longrightarrow> takefill False n bl ! i = rev (bin_to_bl n (bl_to_bin (rev bl))) ! i
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < length (takefill False n bl) \<Longrightarrow> takefill False n bl ! i = rev (bin_to_bl n (bl_to_bin (rev bl))) ! i
[PROOF STEP]
apply (clarsimp simp: nth_takefill rev_nth nth_bin_to_bl bin_nth_of_bl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Pbij_inverse_Dom: "Pbij_Dom \<beta> = Pbij_Rng (Pbij_inverse \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pbij_Dom \<beta> = Pbij_Rng (Pbij_inverse \<beta>)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pbij_Dom \<beta> = Pbij_Rng (Pbij_inverse \<beta>)
[PROOF STEP]
by (simp add: Pbij_inverse_def Pbij_Dom_def Pbij_Rng_def)


[STATEMENT]
lemma closed_Collect_eq:
  fixes f g :: "'a::topological_space \<Rightarrow> 'b::t2_space"
  assumes f: "continuous_on UNIV f" and g: "continuous_on UNIV g"
  shows "closed {x. f x = g x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. f x = g x}
[PROOF STEP]
using open_Collect_neq[OF f g]
[PROOF STATE]
proof (prove)
using this:
open {x. f x \<noteq> g x}

goal (1 subgoal):
 1. closed {x. f x = g x}
[PROOF STEP]
by (simp add: closed_def Collect_neg_eq)


[STATEMENT]
lemma cong_3_swap:
  assumes "A B C Cong3 A' B' C'"
  shows "B A C Cong3 B' A' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B A C Cong3 B' A' C'
[PROOF STEP]
using assms Cong3_def cong_commutativity
[PROOF STATE]
proof (prove)
using this:
A B C Cong3 A' B' C'
?A ?B ?C Cong3 ?A' ?B' ?C' \<equiv> Cong ?A ?B ?A' ?B' \<and> Cong ?A ?C ?A' ?C' \<and> Cong ?B ?C ?B' ?C'
Cong ?A ?B ?C ?D \<Longrightarrow> Cong ?B ?A ?D ?C

goal (1 subgoal):
 1. B A C Cong3 B' A' C'
[PROOF STEP]
by blast


[STATEMENT]
lemma components_eq_sing_exists: "(\<exists>a. components s = {a}) \<longleftrightarrow> connected s \<and> s \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>a. components s = {a}) = (connected s \<and> s \<noteq> {})
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>a. components s = {a} \<Longrightarrow> connected s \<and> s \<noteq> {}
 2. connected s \<and> s \<noteq> {} \<Longrightarrow> \<exists>a. components s = {a}
[PROOF STEP]
using connected_eq_connected_components_eq
[PROOF STATE]
proof (prove)
using this:
connected ?s = (\<forall>c\<in>components ?s. \<forall>c'\<in>components ?s. c = c')

goal (2 subgoals):
 1. \<exists>a. components s = {a} \<Longrightarrow> connected s \<and> s \<noteq> {}
 2. connected s \<and> s \<noteq> {} \<Longrightarrow> \<exists>a. components s = {a}
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected s \<and> s \<noteq> {} \<Longrightarrow> \<exists>a. components s = {a}
[PROOF STEP]
apply (metis components_eq_sing_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma efficient_power_correct:
  assumes "\<And>x z. f x (f x z) = f (f x x) z"
  shows   "efficient_power y x n = (f x ^^ n) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.efficient_power y x n = (f x ^^ n) y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.efficient_power y x n = (f x ^^ n) y
[PROOF STEP]
have [simp]: "f ^^ 2 = (\<lambda>x. f (f x))" for f :: "'a \<Rightarrow> 'a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ^^ 2 = (\<lambda>x. f (f x))
[PROOF STEP]
by (simp add: eval_nat_numeral o_def)
[PROOF STATE]
proof (state)
this:
?f ^^ 2 = (\<lambda>x. ?f (?f x))

goal (1 subgoal):
 1. local.efficient_power y x n = (f x ^^ n) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.efficient_power y x n = (f x ^^ n) y
[PROOF STEP]
by (induction y x n rule: efficient_power.induct)
       (auto elim!: evenE oddE simp: funpow_mult [symmetric] funpow_Suc_right assms
             simp del: funpow.simps(2))
[PROOF STATE]
proof (state)
this:
local.efficient_power y x n = (f x ^^ n) y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trace_concat[simp]:
 "(\<forall>xs \<in> set xss. deltas d xs i = i) \<Longrightarrow>
  trace d i (concat xss) = concat (map (trace d i) xss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs\<in>set xss. deltas d xs i = i \<Longrightarrow> trace d i (concat xss) = concat (map (trace d i) xss)
[PROOF STEP]
by (induct "xss") simp_all


[STATEMENT]
lemma tagged_division_of_union_self:
  assumes "p tagged_division_of s"
  shows "p tagged_division_of (\<Union>(snd ` p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p tagged_division_of \<Union> (snd ` p)
[PROOF STEP]
apply (rule tagged_division_ofI)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. finite p
 2. \<And>x K. (x, K) \<in> p \<Longrightarrow> x \<in> K
 3. \<And>x K. (x, K) \<in> p \<Longrightarrow> K \<subseteq> \<Union> (snd ` p)
 4. \<And>x K. (x, K) \<in> p \<Longrightarrow> \<exists>a b. K = cbox a b
 5. \<And>x1 K1 x2 K2. \<lbrakk>(x1, K1) \<in> p; (x2, K2) \<in> p; (x1, K1) \<noteq> (x2, K2)\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
 6. \<Union> {K. \<exists>x. (x, K) \<in> p} = \<Union> (snd ` p)
[PROOF STEP]
using tagged_division_ofD[OF assms]
[PROOF STATE]
proof (prove)
using this:
finite p
(?x, ?K) \<in> p \<Longrightarrow> ?x \<in> ?K
(?x, ?K) \<in> p \<Longrightarrow> ?K \<subseteq> s
(?x, ?K) \<in> p \<Longrightarrow> \<exists>a b. ?K = cbox a b
\<lbrakk>(?x1.0, ?K1.0) \<in> p; (?x2.0, ?K2.0) \<in> p; (?x1.0, ?K1.0) \<noteq> (?x2.0, ?K2.0)\<rbrakk> \<Longrightarrow> interior ?K1.0 \<inter> interior ?K2.0 = {}
\<Union> {K. \<exists>x. (x, K) \<in> p} = s

goal (6 subgoals):
 1. finite p
 2. \<And>x K. (x, K) \<in> p \<Longrightarrow> x \<in> K
 3. \<And>x K. (x, K) \<in> p \<Longrightarrow> K \<subseteq> \<Union> (snd ` p)
 4. \<And>x K. (x, K) \<in> p \<Longrightarrow> \<exists>a b. K = cbox a b
 5. \<And>x1 K1 x2 K2. \<lbrakk>(x1, K1) \<in> p; (x2, K2) \<in> p; (x1, K1) \<noteq> (x2, K2)\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
 6. \<Union> {K. \<exists>x. (x, K) \<in> p} = \<Union> (snd ` p)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vcpower_index_vempty[simp]: "A ^\<^sub>\<times> 0 = set {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ^\<^sub>\<times> 0 = set {0}
[PROOF STEP]
unfolding vcpower_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>0. A) = set {0}
[PROOF STEP]
by (rule vproduct_index_vempty)


[STATEMENT]
lemma prod_ereal: "(\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
 2. infinite A \<Longrightarrow> (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
 2. infinite A \<Longrightarrow> (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
[PROOF STEP]
by induct (auto simp: one_ereal_def)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)

goal (1 subgoal):
 1. infinite A \<Longrightarrow> (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite A \<Longrightarrow> (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite A

goal (1 subgoal):
 1. infinite A \<Longrightarrow> (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite A

goal (1 subgoal):
 1. (\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)
[PROOF STEP]
by (simp add: one_ereal_def)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma div_poly_eq_0_iff:
  \<open>x div y = 0 \<longleftrightarrow> x = 0 \<or> y = 0 \<or> degree x < degree y\<close> for x y :: \<open>'a::field poly\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x div y = 0) = (x = 0 \<or> y = 0 \<or> degree x < degree y)
[PROOF STEP]
by (simp add: unique_euclidean_semiring_class.div_eq_0_iff euclidean_size_poly_def)


[STATEMENT]
lemma \<alpha>_limit_set_closed:
  shows "closed (\<alpha>_limit_set x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (\<alpha>_limit_set x)
[PROOF STEP]
unfolding \<alpha>_limit_set_eq_rev
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (rev.\<omega>_limit_set x)
[PROOF STEP]
by (rule rev.\<omega>_limit_set_closed)


[STATEMENT]
lemma (in vectorspace) sum_is_subspace:
  fixes W1 W2
  assumes h1: "subspace K W1 V" and h2: "subspace K W2 V"
  shows "subspace K (subspace_sum W1 W2) V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace K (subspace_sum W1 W2) V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subspace K (subspace_sum W1 W2) V
[PROOF STEP]
from h1 h2
[PROOF STATE]
proof (chain)
picking this:
subspace K W1 V
subspace K W2 V
[PROOF STEP]
have mod: "submodule K (submodule_sum W1 W2) V"
[PROOF STATE]
proof (prove)
using this:
subspace K W1 V
subspace K W2 V

goal (1 subgoal):
 1. LinearCombinations.submodule K (subspace_sum W1 W2) V
[PROOF STEP]
by ( intro sum_is_submodule, unfold subspace_def, auto)
[PROOF STATE]
proof (state)
this:
LinearCombinations.submodule K (subspace_sum W1 W2) V

goal (1 subgoal):
 1. subspace K (subspace_sum W1 W2) V
[PROOF STEP]
from mod h1 h2
[PROOF STATE]
proof (chain)
picking this:
LinearCombinations.submodule K (subspace_sum W1 W2) V
subspace K W1 V
subspace K W2 V
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LinearCombinations.submodule K (subspace_sum W1 W2) V
subspace K W1 V
subspace K W2 V

goal (1 subgoal):
 1. subspace K (subspace_sum W1 W2) V
[PROOF STEP]
by (unfold subspace_def, auto)
[PROOF STATE]
proof (state)
this:
subspace K (subspace_sum W1 W2) V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma UNION_bij_betw_ofilter:
assumes WELL: "Well_order r" and
        OF: "\<And> i. i \<in> I \<Longrightarrow> ofilter r (A i)" and
       BIJ: "\<And> i. i \<in> I \<Longrightarrow> bij_betw f (A i) (A' i)"
shows "bij_betw f (\<Union>i \<in> I. A i) (\<Union>i \<in> I. A' i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f (\<Union> (A ` I)) (\<Union> (A' ` I))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw f (\<Union> (A ` I)) (\<Union> (A' ` I))
[PROOF STEP]
have "wo_rel r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wo_rel r
[PROOF STEP]
using WELL
[PROOF STATE]
proof (prove)
using this:
Well_order r

goal (1 subgoal):
 1. wo_rel r
[PROOF STEP]
by (simp add: wo_rel_def)
[PROOF STATE]
proof (state)
this:
wo_rel r

goal (1 subgoal):
 1. bij_betw f (\<Union> (A ` I)) (\<Union> (A' ` I))
[PROOF STEP]
hence "\<And> i j. \<lbrakk>i \<in> I; j \<in> I\<rbrakk> \<Longrightarrow> A i \<le> A j \<or> A j \<le> A i"
[PROOF STATE]
proof (prove)
using this:
wo_rel r

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i \<in> I; j \<in> I\<rbrakk> \<Longrightarrow> A i \<subseteq> A j \<or> A j \<subseteq> A i
[PROOF STEP]
using wo_rel.ofilter_linord[of r] OF
[PROOF STATE]
proof (prove)
using this:
wo_rel r
\<lbrakk>wo_rel r; ofilter r ?A; ofilter r ?B\<rbrakk> \<Longrightarrow> ?A \<subseteq> ?B \<or> ?B \<subseteq> ?A
?i \<in> I \<Longrightarrow> ofilter r (A ?i)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i \<in> I; j \<in> I\<rbrakk> \<Longrightarrow> A i \<subseteq> A j \<or> A j \<subseteq> A i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i \<in> I; ?j \<in> I\<rbrakk> \<Longrightarrow> A ?i \<subseteq> A ?j \<or> A ?j \<subseteq> A ?i

goal (1 subgoal):
 1. bij_betw f (\<Union> (A ` I)) (\<Union> (A' ` I))
[PROOF STEP]
with WELL BIJ
[PROOF STATE]
proof (chain)
picking this:
Well_order r
?i \<in> I \<Longrightarrow> bij_betw f (A ?i) (A' ?i)
\<lbrakk>?i \<in> I; ?j \<in> I\<rbrakk> \<Longrightarrow> A ?i \<subseteq> A ?j \<or> A ?j \<subseteq> A ?i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Well_order r
?i \<in> I \<Longrightarrow> bij_betw f (A ?i) (A' ?i)
\<lbrakk>?i \<in> I; ?j \<in> I\<rbrakk> \<Longrightarrow> A ?i \<subseteq> A ?j \<or> A ?j \<subseteq> A ?i

goal (1 subgoal):
 1. bij_betw f (\<Union> (A ` I)) (\<Union> (A' ` I))
[PROOF STEP]
by (auto simp add: bij_betw_UNION_chain)
[PROOF STATE]
proof (state)
this:
bij_betw f (\<Union> (A ` I)) (\<Union> (A' ` I))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arctan_inverse:
  assumes "x \<noteq> 0"
  shows "arctan (1 / x) = sgn x * pi/2 - arctan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (1 / x) = sgn x * pi / 2 - arctan x
[PROOF STEP]
proof (rule arctan_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. - (pi / 2) < sgn x * pi / 2 - arctan x
 2. sgn x * pi / 2 - arctan x < pi / 2
 3. tan (sgn x * pi / 2 - arctan x) = 1 / x
[PROOF STEP]
have \<section>: "x > 0 \<Longrightarrow> arctan x < pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> arctan x < pi
[PROOF STEP]
using arctan_bounded [of x]
[PROOF STATE]
proof (prove)
using this:
- (pi / 2) < arctan x \<and> arctan x < pi / 2

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> arctan x < pi
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < x \<Longrightarrow> arctan x < pi

goal (3 subgoals):
 1. - (pi / 2) < sgn x * pi / 2 - arctan x
 2. sgn x * pi / 2 - arctan x < pi / 2
 3. tan (sgn x * pi / 2 - arctan x) = 1 / x
[PROOF STEP]
show "- (pi/2) < sgn x * pi/2 - arctan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (pi / 2) < sgn x * pi / 2 - arctan x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. - (pi / 2) < sgn x * pi / 2 - arctan x
[PROOF STEP]
by (auto simp: sgn_real_def arctan algebra_simps \<section>)
[PROOF STATE]
proof (state)
this:
- (pi / 2) < sgn x * pi / 2 - arctan x

goal (2 subgoals):
 1. sgn x * pi / 2 - arctan x < pi / 2
 2. tan (sgn x * pi / 2 - arctan x) = 1 / x
[PROOF STEP]
show "sgn x * pi/2 - arctan x < pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn x * pi / 2 - arctan x < pi / 2
[PROOF STEP]
using arctan_bounded [of "- x"] assms
[PROOF STATE]
proof (prove)
using this:
- (pi / 2) < arctan (- x) \<and> arctan (- x) < pi / 2
x \<noteq> 0

goal (1 subgoal):
 1. sgn x * pi / 2 - arctan x < pi / 2
[PROOF STEP]
by (auto simp: algebra_simps sgn_real_def arctan_minus)
[PROOF STATE]
proof (state)
this:
sgn x * pi / 2 - arctan x < pi / 2

goal (1 subgoal):
 1. tan (sgn x * pi / 2 - arctan x) = 1 / x
[PROOF STEP]
show "tan (sgn x * pi/2 - arctan x) = 1 / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (sgn x * pi / 2 - arctan x) = 1 / x
[PROOF STEP]
unfolding tan_inverse [of "arctan x", unfolded tan_arctan] sgn_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan ((if x = 0 then 0 else if 0 < x then 1 else - 1) * pi / 2 - arctan x) = tan (pi / 2 - arctan x)
[PROOF STEP]
by (simp add: tan_def cos_arctan sin_arctan sin_diff cos_diff)
[PROOF STATE]
proof (state)
this:
tan (sgn x * pi / 2 - arctan x) = 1 / x

goal:
No subgoals!
[PROOF STEP]
qed