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

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

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

goal (1 subgoal):
 1. \<And>c. 0 < c \<Longrightarrow> \<forall>\<^sub>F x in F. c * norm (g x) \<le> norm (f x)
[PROOF STEP]
thus "eventually (\<lambda>x. (norm (f x)) \<ge> c * (norm (g x))) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. c \<le> norm (f x / g x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. c * norm (g x) \<le> norm (f x)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. c \<le> norm (f x / g x) \<Longrightarrow> c * norm (g x) \<le> norm (f x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. c \<le> norm (f x / g x) \<Longrightarrow> c * norm (g x) \<le> norm (f x)
[PROOF STEP]
assume A: "norm (f x / g x) \<ge> c"
[PROOF STATE]
proof (state)
this:
c \<le> norm (f x / g x)

goal (1 subgoal):
 1. \<And>x. c \<le> norm (f x / g x) \<Longrightarrow> c * norm (g x) \<le> norm (f x)
[PROOF STEP]
from A c_pos
[PROOF STATE]
proof (chain)
picking this:
c \<le> norm (f x / g x)
0 < c
[PROOF STEP]
have "g x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
c \<le> norm (f x / g x)
0 < c

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

goal (1 subgoal):
 1. \<And>x. c \<le> norm (f x / g x) \<Longrightarrow> c * norm (g x) \<le> norm (f x)
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
c \<le> norm (f x / g x)
g x \<noteq> (0::'b)
[PROOF STEP]
show "(norm (f x)) \<ge> c * (norm (g x))"
[PROOF STATE]
proof (prove)
using this:
c \<le> norm (f x / g x)
g x \<noteq> (0::'b)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. c * norm (g x) \<le> norm (f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) triv_normal_subgroup:
  shows "{\<one>} \<lhd> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<one>} \<lhd> G
[PROOF STEP]
unfolding normal_def normal_axioms_def l_coset_def r_coset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup {\<one>} G \<and> Group.group G \<and> (\<forall>x\<in>carrier G. (\<Union>h\<in>{\<one>}. {h \<otimes> x}) = (\<Union>h\<in>{\<one>}. {x \<otimes> h}))
[PROOF STEP]
using is_group triv_subgroup
[PROOF STATE]
proof (prove)
using this:
Group.group G
subgroup {\<one>} G

goal (1 subgoal):
 1. subgroup {\<one>} G \<and> Group.group G \<and> (\<forall>x\<in>carrier G. (\<Union>h\<in>{\<one>}. {h \<otimes> x}) = (\<Union>h\<in>{\<one>}. {x \<otimes> h}))
[PROOF STEP]
by auto


[STATEMENT]
lemma c_pair_inj: "c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
assume A1: "c_pair x1 y1 = c_pair x2 y2"
[PROOF STATE]
proof (state)
this:
c_pair x1 y1 = c_pair x2 y2

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
c_pair x1 y1 = c_pair x2 y2
[PROOF STEP]
have S1: "x1 + y1 = x2 + y2"
[PROOF STATE]
proof (prove)
using this:
c_pair x1 y1 = c_pair x2 y2

goal (1 subgoal):
 1. x1 + y1 = x2 + y2
[PROOF STEP]
by (rule c_pair_sum_inj)
[PROOF STATE]
proof (state)
this:
x1 + y1 = x2 + y2

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
c_pair x1 y1 = c_pair x2 y2
[PROOF STEP]
have S2: "sf (x1+y1) + x1 = sf (x2+y2) + x2"
[PROOF STATE]
proof (prove)
using this:
c_pair x1 y1 = c_pair x2 y2

goal (1 subgoal):
 1. sf (x1 + y1) + x1 = sf (x2 + y2) + x2
[PROOF STEP]
by (unfold c_pair_def)
[PROOF STATE]
proof (state)
this:
sf (x1 + y1) + x1 = sf (x2 + y2) + x2

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
x1 + y1 = x2 + y2
sf (x1 + y1) + x1 = sf (x2 + y2) + x2
[PROOF STEP]
have S3: "x1 = x2"
[PROOF STATE]
proof (prove)
using this:
x1 + y1 = x2 + y2
sf (x1 + y1) + x1 = sf (x2 + y2) + x2

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

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
from S1 S3
[PROOF STATE]
proof (chain)
picking this:
x1 + y1 = x2 + y2
x1 = x2
[PROOF STEP]
have S4: "y1 = y2"
[PROOF STATE]
proof (prove)
using this:
x1 + y1 = x2 + y2
x1 = x2

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

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
from S3 S4
[PROOF STATE]
proof (chain)
picking this:
x1 = x2
y1 = y2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x1 = x2
y1 = y2

goal (1 subgoal):
 1. x1 = x2 \<and> y1 = y2
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
x1 = x2 \<and> y1 = y2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_of_c_pair_n_main: "nat_to_pr (index_of_c_pair_n n) = (\<lambda> x. c_pair n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = c_pair n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = c_pair n
[PROOF STEP]
have "nat_to_pr (index_of_c_pair_n n) = nat_to_pr (pair_by_index (index_of_const n) index_of_id)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = nat_to_pr (pair_by_index (index_of_const n) index_of_id)
[PROOF STEP]
by (simp add: index_of_c_pair_n_def)
[PROOF STATE]
proof (state)
this:
nat_to_pr (index_of_c_pair_n n) = nat_to_pr (pair_by_index (index_of_const n) index_of_id)

goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = c_pair n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nat_to_pr (index_of_c_pair_n n) = nat_to_pr (pair_by_index (index_of_const n) index_of_id)

goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = c_pair n
[PROOF STEP]
have "\<dots> = c_f_pair (nat_to_pr (index_of_const n)) (nat_to_pr index_of_id)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr (pair_by_index (index_of_const n) index_of_id) = c_f_pair (nat_to_pr (index_of_const n)) (nat_to_pr index_of_id)
[PROOF STEP]
by (simp add: pair_by_index_main)
[PROOF STATE]
proof (state)
this:
nat_to_pr (pair_by_index (index_of_const n) index_of_id) = c_f_pair (nat_to_pr (index_of_const n)) (nat_to_pr index_of_id)

goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = c_pair n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nat_to_pr (pair_by_index (index_of_const n) index_of_id) = c_f_pair (nat_to_pr (index_of_const n)) (nat_to_pr index_of_id)

goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = c_pair n
[PROOF STEP]
have "\<dots> = c_f_pair (\<lambda> x. n) (\<lambda> x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_f_pair (nat_to_pr (index_of_const n)) (nat_to_pr index_of_id) = c_f_pair (\<lambda>x. n) (\<lambda>x. x)
[PROOF STEP]
by (simp add: index_of_const_main index_of_id_main)
[PROOF STATE]
proof (state)
this:
c_f_pair (nat_to_pr (index_of_const n)) (nat_to_pr index_of_id) = c_f_pair (\<lambda>x. n) (\<lambda>x. x)

goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = c_pair n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nat_to_pr (index_of_c_pair_n n) = c_f_pair (\<lambda>x. n) (\<lambda>x. x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nat_to_pr (index_of_c_pair_n n) = c_f_pair (\<lambda>x. n) (\<lambda>x. x)

goal (1 subgoal):
 1. nat_to_pr (index_of_c_pair_n n) = c_pair n
[PROOF STEP]
by (simp add: c_f_pair_def)
[PROOF STATE]
proof (state)
this:
nat_to_pr (index_of_c_pair_n n) = c_pair n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_eq_imp_diff_mod_eq2: "
  \<lbrakk> x mod m = y mod m; (t::nat) \<le> x; t \<le> y \<rbrakk> \<Longrightarrow>
  (x - t) mod m = (y - t) mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod m = y mod m; t \<le> x; t \<le> y\<rbrakk> \<Longrightarrow> (x - t) mod m = (y - t) mod m
[PROOF STEP]
apply (case_tac "m = 0", simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod m = y mod m; t \<le> x; t \<le> y; 0 < m\<rbrakk> \<Longrightarrow> (x - t) mod m = (y - t) mod m
[PROOF STEP]
apply (subst mod_mult_self2[of "x - t" m t, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod m = y mod m; t \<le> x; t \<le> y; 0 < m\<rbrakk> \<Longrightarrow> (x - t + m * t) mod m = (y - t) mod m
[PROOF STEP]
apply (subst mod_mult_self2[of "y - t" m t, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod m = y mod m; t \<le> x; t \<le> y; 0 < m\<rbrakk> \<Longrightarrow> (x - t + m * t) mod m = (y - t + m * t) mod m
[PROOF STEP]
apply (simp only: add_diff_assoc2 diff_add_assoc gr0_imp_self_le_mult2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod m = y mod m; t \<le> x; t \<le> y; 0 < m\<rbrakk> \<Longrightarrow> (x + (m * t - t)) mod m = (y + (m * t - t)) mod m
[PROOF STEP]
apply (simp only: mod_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma substs_preserve_occurs_in:
  assumes "occurs_in s t"
  shows "occurs_in (subst s \<sigma>) (subst t \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. occurs_in (s \<lhd> \<sigma>) (t \<lhd> \<sigma>)
[PROOF STEP]
using substs_preserve_subterms
[PROOF STATE]
proof (prove)
using this:
subterm ?t ?p ?s \<Longrightarrow> subterm (?t \<lhd> ?\<sigma>) ?p (?s \<lhd> ?\<sigma>)

goal (1 subgoal):
 1. occurs_in (s \<lhd> \<sigma>) (t \<lhd> \<sigma>)
[PROOF STEP]
using assms occurs_in_def
[PROOF STATE]
proof (prove)
using this:
subterm ?t ?p ?s \<Longrightarrow> subterm (?t \<lhd> ?\<sigma>) ?p (?s \<lhd> ?\<sigma>)
occurs_in s t
occurs_in ?t ?s = (\<exists>p. subterm ?s p ?t)

goal (1 subgoal):
 1. occurs_in (s \<lhd> \<sigma>) (t \<lhd> \<sigma>)
[PROOF STEP]
by blast


[STATEMENT]
lemma incseq_sumI:
  fixes f :: "nat \<Rightarrow> 'a::ordered_comm_monoid_add"
  assumes "\<And>i. 0 \<le> f i"
  shows "incseq (\<lambda>i. sum f {..< i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>i. sum f {..<i})
[PROOF STEP]
proof (intro incseq_SucI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. sum f {..<n} \<le> sum f {..<Suc n}
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. sum f {..<n} \<le> sum f {..<Suc n}
[PROOF STEP]
have "sum f {..< n} + 0 \<le> sum f {..<n} + f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<n} + (0::'a) \<le> sum f {..<n} + f n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> f ?i

goal (1 subgoal):
 1. sum f {..<n} + (0::'a) \<le> sum f {..<n} + f n
[PROOF STEP]
by (rule add_left_mono)
[PROOF STATE]
proof (state)
this:
sum f {..<n} + (0::'a) \<le> sum f {..<n} + f n

goal (1 subgoal):
 1. \<And>n. sum f {..<n} \<le> sum f {..<Suc n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum f {..<n} + (0::'a) \<le> sum f {..<n} + f n
[PROOF STEP]
show "sum f {..< n} \<le> sum f {..< Suc n}"
[PROOF STATE]
proof (prove)
using this:
sum f {..<n} + (0::'a) \<le> sum f {..<n} + f n

goal (1 subgoal):
 1. sum f {..<n} \<le> sum f {..<Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f {..<n} \<le> sum f {..<Suc n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_real_interval:
  assumes S: "is_interval S"
  shows "\<exists>a b::real. S = {} \<or> S = UNIV \<or> S = {..<b} \<or> S = {..b} \<or> S = {a<..} \<or> S = {a..} \<or>
    S = {a<..<b} \<or> S = {a<..b} \<or> S = {a..<b} \<or> S = {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. S = {} \<or> S = UNIV \<or> S = {..<b} \<or> S = {..b} \<or> S = {a<..} \<or> S = {a..} \<or> S = {a<..<b} \<or> S = {a<..b} \<or> S = {a..<b} \<or> S = {a..b}
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
is_interval S

goal (1 subgoal):
 1. \<exists>a b. S = {} \<or> S = UNIV \<or> S = {..<b} \<or> S = {..b} \<or> S = {a<..} \<or> S = {a..} \<or> S = {a<..<b} \<or> S = {a<..b} \<or> S = {a..<b} \<or> S = {a..b}
[PROOF STEP]
unfolding is_interval_1
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>S. \<forall>b\<in>S. \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> S

goal (1 subgoal):
 1. \<exists>a b. S = {} \<or> S = UNIV \<or> S = {..<b} \<or> S = {..b} \<or> S = {a<..} \<or> S = {a..} \<or> S = {a<..<b} \<or> S = {a<..b} \<or> S = {a..<b} \<or> S = {a..b}
[PROOF STEP]
by (blast intro: interval_cases)


[STATEMENT]
lemma hcis_mult: "\<And>a b. hcis a * hcis b = hcis (a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. hcis a * hcis b = hcis (a + b)
[PROOF STEP]
by transfer (rule cis_mult)


[STATEMENT]
lemma nth_prime_exists1: "\<exists>!p::nat. prime p \<and> card {q. prime q \<and> q < p} = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!p. prime p \<and> card {q. prime q \<and> q < p} = n
[PROOF STEP]
by (intro ex_ex1I nth_prime_exists) (blast intro: nth_prime_unique_aux)


[STATEMENT]
lemma real_arch_inverse: "0 < e \<longleftrightarrow> (\<exists>n::nat. n \<noteq> 0 \<and> 0 < inverse (real n) \<and> inverse (real n) < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < e) = (\<exists>n. n \<noteq> 0 \<and> 0 < inverse (real n) \<and> inverse (real n) < e)
[PROOF STEP]
using reals_Archimedean[of e] less_trans[of 0 "1 / real n" e for n::nat]
[PROOF STATE]
proof (prove)
using this:
0 < e \<Longrightarrow> \<exists>n. inverse (real (Suc n)) < e
\<lbrakk>0 < 1 / real ?n2; 1 / real ?n2 < e\<rbrakk> \<Longrightarrow> 0 < e

goal (1 subgoal):
 1. (0 < e) = (\<exists>n. n \<noteq> 0 \<and> 0 < inverse (real n) \<and> inverse (real n) < e)
[PROOF STEP]
by (auto simp add: field_simps cong: conj_cong simp del: of_nat_Suc)


[STATEMENT]
lemma right_unique_rel_converter:
  "\<lbrakk> right_total A; right_unique B; right_unique C; right_total R \<rbrakk> \<Longrightarrow> right_unique (rel_converter A B C R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>right_total A; right_unique B; right_unique C; right_total R\<rbrakk> \<Longrightarrow> right_unique (rel_converter A B C R)
[PROOF STEP]
unfolding right_unique_alt_def right_total_alt_def rel_converter_conversep[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(=) \<le> A\<inverse>\<inverse> OO A; B\<inverse>\<inverse> OO B \<le> (=); C\<inverse>\<inverse> OO C \<le> (=); (=) \<le> R\<inverse>\<inverse> OO R\<rbrakk> \<Longrightarrow> rel_converter A\<inverse>\<inverse> B\<inverse>\<inverse> C\<inverse>\<inverse> R\<inverse>\<inverse> OO rel_converter A B C R \<le> (=)
[PROOF STEP]
by(subst rel_converter_eq[symmetric], rule order_trans[OF rel_converter_pos_distr], erule (3) rel_converter_mono)


[STATEMENT]
lemma three_mod_two [simp]:
  shows "3 mod Suc (Suc 0) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 mod Suc (Suc 0) = 1
[PROOF STEP]
by (simp add: mod_Suc numeral_3_eq_3)


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural (m mod n) = integer_of_natural m mod integer_of_natural n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural (m mod n) = integer_of_natural m mod integer_of_natural n
[PROOF STEP]
by transfer (simp add: zmod_int)


[STATEMENT]
lemma add_mono_ennreal: "x < ennreal y \<Longrightarrow> x' < ennreal y' \<Longrightarrow> x + x' < ennreal (y + y')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < ennreal y; x' < ennreal y'\<rbrakk> \<Longrightarrow> x + x' < ennreal (y + y')
[PROOF STEP]
by (metis (full_types) add_strict_mono ennreal_less_zero_iff ennreal_plus less_le not_less zero_le)


[STATEMENT]
lemma (in Module) mem_fgs_l_comb:"\<lbrakk>K \<noteq> {}; K \<subseteq> carrier M; x \<in> fgs R M K\<rbrakk> \<Longrightarrow>
        \<exists>(n::nat).
        \<exists>f \<in> {j. j \<le> (n::nat)} \<rightarrow> K. \<exists>s \<in> {j. j \<le> n} \<rightarrow> carrier R.
                    x = l_comb R M n s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>K \<noteq> {}; K \<subseteq> carrier M; x \<in> fgs R M K\<rbrakk> \<Longrightarrow> \<exists>n. \<exists>f\<in>{j. j \<le> n} \<rightarrow> K. \<exists>s\<in>{j. j \<le> n} \<rightarrow> carrier R. x = l_comb R M n s f
[PROOF STEP]
apply (simp add:fgs_def linear_span_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma integrable_bound:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
    and g :: "'a \<Rightarrow> 'c::{banach, second_countable_topology}"
  shows "integrable M f \<Longrightarrow> g \<in> borel_measurable M \<Longrightarrow> (AE x in M. norm (g x) \<le> norm (f x)) \<Longrightarrow>
    integrable M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>integrable M f; g \<in> borel_measurable M; AE x in M. norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> integrable M g
[PROOF STEP]
unfolding integrable_iff_bounded
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M \<and> \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M < \<infinity>; g \<in> borel_measurable M; AE x in M. norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> g \<in> borel_measurable M \<and> \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>g \<in> borel_measurable M; AE x in M. norm (g x) \<le> norm (f x); f \<in> borel_measurable M; \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M < \<infinity>\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
assume "f \<in> borel_measurable M" "g \<in> borel_measurable M"
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. \<lbrakk>g \<in> borel_measurable M; AE x in M. norm (g x) \<le> norm (f x); f \<in> borel_measurable M; \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M < \<infinity>\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
assume "AE x in M. norm (g x) \<le> norm (f x)"
[PROOF STATE]
proof (state)
this:
AE x in M. norm (g x) \<le> norm (f x)

goal (1 subgoal):
 1. \<lbrakk>g \<in> borel_measurable M; AE x in M. norm (g x) \<le> norm (f x); f \<in> borel_measurable M; \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M < \<infinity>\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. norm (g x) \<le> norm (f x)
[PROOF STEP]
have "(\<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M) \<le> (\<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
AE x in M. norm (g x) \<le> norm (f x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M
[PROOF STEP]
by  (intro nn_integral_mono_AE) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M

goal (1 subgoal):
 1. \<lbrakk>g \<in> borel_measurable M; AE x in M. norm (g x) \<le> norm (f x); f \<in> borel_measurable M; \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M < \<infinity>\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M \<le> \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M

goal (1 subgoal):
 1. \<lbrakk>g \<in> borel_measurable M; AE x in M. norm (g x) \<le> norm (f x); f \<in> borel_measurable M; \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M < \<infinity>\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
assume "(\<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M) < \<infinity>"
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M < \<infinity>

goal (1 subgoal):
 1. \<lbrakk>g \<in> borel_measurable M; AE x in M. norm (g x) \<le> norm (f x); f \<in> borel_measurable M; \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M < \<infinity>\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
show "(\<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M) < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (g x)) \<partial>M < \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iMin_atMost: "iMin {..(n::nat)} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iMin {..n} = 0
[PROOF STEP]
by (rule iMin_equality, simp_all)


[STATEMENT]
lemma finite_subset_Union:
  fixes A::"'a set" and f::"'a \<Rightarrow> 'b set"
  assumes "finite (\<Union>a \<in> A. f a)"
  shows "\<exists>B. finite B \<and> B \<subseteq> A \<and> (\<Union>b \<in> B. f b) = (\<Union>a \<in> A. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B. finite B \<and> B \<subseteq> A \<and> \<Union> (f ` B) = \<Union> (f ` A)
[PROOF STEP]
by (metis assms eq_iff finite_subset_image finite_UnionD)


[STATEMENT]
lemma step_4_pop_small_size_ok_4_aux: "\<lbrakk>
  0 < size small;
  4 \<le> remaining_steps (States dir big small);
  size_new big + remaining_steps (States dir big small) + 2 \<le> 3 * size_new small
\<rbrakk> \<Longrightarrow> size_new big + (remaining_steps (States dir big small) - 4) + 2 \<le> 3 * (size_new small - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < size small; 4 \<le> remaining_steps (States dir big small); size_new big + remaining_steps (States dir big small) + 2 \<le> 3 * size_new small\<rbrakk> \<Longrightarrow> size_new big + (remaining_steps (States dir big small) - 4) + 2 \<le> 3 * (size_new small - 1)
[PROOF STEP]
by linarith


[STATEMENT]
lemma has_absolute_integral_change_of_variables_1':
  fixes f :: "real \<Rightarrow> real" and g :: "real \<Rightarrow> real"
  assumes S: "S \<in> sets lebesgue"
    and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative g' x) (at x within S)"
    and inj: "inj_on g S"
  shows "(\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and>
           integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f(g x)) = b
     \<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have "(\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f(g x)) :: real ^ 1) absolutely_integrable_on S \<and>
           integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f(g x))) = (vec b :: real ^ 1)
         \<longleftrightarrow> (\<lambda>x. vec (f x) :: real ^ 1) absolutely_integrable_on (g ` S) \<and>
           integral (g ` S) (\<lambda>x. vec (f x)) = (vec b :: real ^ 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) = vec b) = ((\<lambda>x. vec (f x)) absolutely_integrable_on g ` S \<and> integral (g ` S) (\<lambda>x. vec (f x)) = vec b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<in> sets lebesgue
?x \<in> S \<Longrightarrow> (g has_real_derivative g' ?x) (at ?x within S)
inj_on g S

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) = vec b) = ((\<lambda>x. vec (f x)) absolutely_integrable_on g ` S \<and> integral (g ` S) (\<lambda>x. vec (f x)) = vec b)
[PROOF STEP]
unfolding has_real_derivative_iff_has_vector_derivative
[PROOF STATE]
proof (prove)
using this:
S \<in> sets lebesgue
?x \<in> S \<Longrightarrow> (g has_vector_derivative g' ?x) (at ?x within S)
inj_on g S

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) = vec b) = ((\<lambda>x. vec (f x)) absolutely_integrable_on g ` S \<and> integral (g ` S) (\<lambda>x. vec (f x)) = vec b)
[PROOF STEP]
by (intro has_absolute_integral_change_of_variables_1 assms) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) = vec b) = ((\<lambda>x. vec (f x)) absolutely_integrable_on g ` S \<and> integral (g ` S) (\<lambda>x. vec (f x)) = vec b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R vec (f (g x))) = vec b) = ((\<lambda>x. vec (f x)) absolutely_integrable_on g ` S \<and> integral (g ` S) (\<lambda>x. vec (f x)) = vec b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
by (simp add: absolutely_integrable_on_1_iff integral_on_1_eq)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>g' x\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dims_output_witness:
assumes "length rs \<ge> 2"
and "\<And>r. r\<in>set rs \<Longrightarrow> r > 0"
and "j < rs!0"
shows "Tensor.dims (tensors_from_net (witness_l rs) $ j) = replicate (2^(length rs - 2)) (last rs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dims (tensors_from_net (witness_l rs) $ j) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
using dims_output_deep_model witness_is_deep_model assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 \<le> length ?rs; \<And>r. r \<in> set ?rs \<Longrightarrow> 0 < r; ?j < ?rs ! 0; remove_weights ?m = deep_model_l ?rs\<rbrakk> \<Longrightarrow> dims (tensors_from_net ?m $ ?j) = replicate (2 ^ (length ?rs - 2)) (last ?rs)
remove_weights (witness ?Y ?r ?rs) = deep_model ?Y ?r ?rs
2 \<le> length rs
?r \<in> set rs \<Longrightarrow> 0 < ?r
j < rs ! 0

goal (1 subgoal):
 1. dims (tensors_from_net (witness_l rs) $ j) = replicate (2 ^ (length rs - 2)) (last rs)
[PROOF STEP]
by blast


[STATEMENT]
lemma Qp_poly_mapE'':
  assumes "is_poly_tuple n fs"
  assumes "length fs = m"
  assumes "n \<noteq> 0"
  assumes "as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "j < m"
  shows "(poly_map n fs as)!j = (Qp_ev (fs!j) as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map n fs as ! j = eval_at_point Q\<^sub>p as (fs ! j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = m
n \<noteq> 0
as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
j < m

goal (1 subgoal):
 1. poly_map n fs as ! j = eval_at_point Q\<^sub>p as (fs ! j)
[PROOF STEP]
unfolding poly_map_def poly_tuple_eval_def
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = m
n \<noteq> 0
as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
j < m

goal (1 subgoal):
 1. (\<lambda>as\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). map (eval_at_point Q\<^sub>p as) fs) as ! j = eval_at_point Q\<^sub>p as (fs ! j)
[PROOF STEP]
by (metis (no_types, lifting) nth_map restrict_apply')


[STATEMENT]
lemma binomial_eq_0: "n < k \<Longrightarrow> n choose k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < k \<Longrightarrow> n choose k = 0
[PROOF STEP]
by (auto simp add: binomial_def dest: subset_eq_atLeast0_lessThan_card)


[STATEMENT]
lemma hsize_apps: "hsize (apps t ts) = hsize t + sum_list (map hsize ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hsize (apps t ts) = hsize t + sum_list (map hsize ts)
[PROOF STEP]
by (induct ts arbitrary:t; simp)


[STATEMENT]
lemma in_on_out_univ:
  shows "disc H \<union> disc_compl H \<union> ocircline_set H = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disc H \<union> disc_compl H \<union> ocircline_set H = UNIV
[PROOF STEP]
unfolding disc_def disc_compl_def ocircline_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Collect (in_ocircline H) \<union> Collect (out_ocircline H) \<union> Collect (on_ocircline H) = UNIV
[PROOF STEP]
using in_on_out[of H]
[PROOF STATE]
proof (prove)
using this:
in_ocircline H ?z \<or> on_ocircline H ?z \<or> out_ocircline H ?z

goal (1 subgoal):
 1. Collect (in_ocircline H) \<union> Collect (out_ocircline H) \<union> Collect (on_ocircline H) = UNIV
[PROOF STEP]
by auto


[STATEMENT]
lemma single_valued_has_lubs [rule_format]:
  "\<lbrakk>single_valued r; (x,u) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> (\<forall>y. (y,u) \<in> r\<^sup>* \<longrightarrow>
  (\<exists>z. is_lub (r\<^sup>*) x y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued r; (x, u) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> \<forall>y. (y, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>z. is_lub (r\<^sup>*) x y z)
[PROOF STEP]
apply (erule converse_rtrancl_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. single_valued r \<Longrightarrow> \<forall>y. (y, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>z. is_lub (r\<^sup>*) u y z)
 2. \<And>y z. \<lbrakk>single_valued r; (y, z) \<in> r; (z, u) \<in> r\<^sup>*; \<forall>y. (y, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>za. is_lub (r\<^sup>*) z y za)\<rbrakk> \<Longrightarrow> \<forall>ya. (ya, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>z. is_lub (r\<^sup>*) y ya z)
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y. \<lbrakk>single_valued r; (y, u) \<in> r\<^sup>*\<rbrakk> \<Longrightarrow> \<exists>z. is_lub (r\<^sup>*) u y z
 2. \<And>y z. \<lbrakk>single_valued r; (y, z) \<in> r; (z, u) \<in> r\<^sup>*; \<forall>y. (y, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>za. is_lub (r\<^sup>*) z y za)\<rbrakk> \<Longrightarrow> \<forall>ya. (ya, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>z. is_lub (r\<^sup>*) y ya z)
[PROOF STEP]
apply (erule converse_rtrancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>y. single_valued r \<Longrightarrow> \<exists>z. is_lub (r\<^sup>*) u u z
 2. \<And>y ya z. \<lbrakk>single_valued r; (ya, z) \<in> r; (z, u) \<in> r\<^sup>*; \<exists>za. is_lub (r\<^sup>*) u z za\<rbrakk> \<Longrightarrow> \<exists>z. is_lub (r\<^sup>*) u ya z
 3. \<And>y z. \<lbrakk>single_valued r; (y, z) \<in> r; (z, u) \<in> r\<^sup>*; \<forall>y. (y, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>za. is_lub (r\<^sup>*) z y za)\<rbrakk> \<Longrightarrow> \<forall>ya. (ya, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>z. is_lub (r\<^sup>*) y ya z)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y ya z. \<lbrakk>single_valued r; (ya, z) \<in> r; (z, u) \<in> r\<^sup>*; \<exists>za. is_lub (r\<^sup>*) u z za\<rbrakk> \<Longrightarrow> \<exists>z. is_lub (r\<^sup>*) u ya z
 2. \<And>y z. \<lbrakk>single_valued r; (y, z) \<in> r; (z, u) \<in> r\<^sup>*; \<forall>y. (y, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>za. is_lub (r\<^sup>*) z y za)\<rbrakk> \<Longrightarrow> \<forall>ya. (ya, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>z. is_lub (r\<^sup>*) y ya z)
[PROOF STEP]
apply (blast intro: converse_rtrancl_into_rtrancl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>single_valued r; (y, z) \<in> r; (z, u) \<in> r\<^sup>*; \<forall>y. (y, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>za. is_lub (r\<^sup>*) z y za)\<rbrakk> \<Longrightarrow> \<forall>ya. (ya, u) \<in> r\<^sup>* \<longrightarrow> (\<exists>z. is_lub (r\<^sup>*) y ya z)
[PROOF STEP]
apply (blast intro: extend_lub)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma make_first_column_positive_works:
  assumes "A\<in>carrier_mat m n" and i: "i<m" and "0<n"
  shows "make_first_column_positive A $$ (i,0) \<ge> 0"
  and "j<n \<Longrightarrow> A $$ (i,0) < 0 \<Longrightarrow> (make_first_column_positive A) $$ (i,j) = - A $$ (i,j)"
  and "j<n \<Longrightarrow> A $$ (i,0) \<ge> 0 \<Longrightarrow> (make_first_column_positive A) $$ (i,j) = A $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> make_first_column_positive A $$ (i, 0) &&& (\<lbrakk>j < n; A $$ (i, 0) < 0\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = - A $$ (i, j)) &&& (\<lbrakk>j < n; 0 \<le> A $$ (i, 0)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = A $$ (i, j))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat m n
i < m
0 < n

goal (1 subgoal):
 1. 0 \<le> make_first_column_positive A $$ (i, 0) &&& (\<lbrakk>j < n; A $$ (i, 0) < 0\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = - A $$ (i, j)) &&& (\<lbrakk>j < n; 0 \<le> A $$ (i, 0)\<rbrakk> \<Longrightarrow> make_first_column_positive A $$ (i, j) = A $$ (i, j))
[PROOF STEP]
by auto


[STATEMENT]
lemma binomial_asymptotic':
  "(\<lambda>n. of_nat ((k + n) choose n) / (of_nat (n ^ k) / fact k) :: 'a :: Gamma) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. of_nat (k + n choose n) / (of_nat (n ^ k) / fact k)) \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
using tendsto_mult[OF fact_binomial_limit[of k] tendsto_const[of "fact k :: 'a"]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. of_nat (k + x choose x) / of_nat (x ^ k) * fact k) \<longlonglongrightarrow> (1::'a) / fact k * fact k

goal (1 subgoal):
 1. (\<lambda>n. of_nat (k + n choose n) / (of_nat (n ^ k) / fact k)) \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma real_add:
     "Abs_Real (realrel``{(x,y)}) + Abs_Real (realrel``{(u,v)}) =
      Abs_Real (realrel``{(x+u, y+v)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_Real (Dedekind_Real.realrel `` {(x, y)}) + Abs_Real (Dedekind_Real.realrel `` {(u, v)}) = Abs_Real (Dedekind_Real.realrel `` {(x + u, y + v)})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Abs_Real (Dedekind_Real.realrel `` {(x, y)}) + Abs_Real (Dedekind_Real.realrel `` {(u, v)}) = Abs_Real (Dedekind_Real.realrel `` {(x + u, y + v)})
[PROOF STEP]
have "(\<lambda>z w. (\<lambda>(x,y). (\<lambda>(u,v). {Abs_Real (realrel `` {(x+u, y+v)})}) w) z)
        respects2 realrel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z w. case z of (x, y) \<Rightarrow> case w of (u, v) \<Rightarrow> {Abs_Real (Dedekind_Real.realrel `` {(x + u, y + v)})}) respects2 Dedekind_Real.realrel
[PROOF STEP]
by (clarsimp simp: congruent2_def) (metis add.left_commute preal_add_assoc)
[PROOF STATE]
proof (state)
this:
(\<lambda>z w. case z of (x, y) \<Rightarrow> case w of (u, v) \<Rightarrow> {Abs_Real (Dedekind_Real.realrel `` {(x + u, y + v)})}) respects2 Dedekind_Real.realrel

goal (1 subgoal):
 1. Abs_Real (Dedekind_Real.realrel `` {(x, y)}) + Abs_Real (Dedekind_Real.realrel `` {(u, v)}) = Abs_Real (Dedekind_Real.realrel `` {(x + u, y + v)})
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>z w. case z of (x, y) \<Rightarrow> case w of (u, v) \<Rightarrow> {Abs_Real (Dedekind_Real.realrel `` {(x + u, y + v)})}) respects2 Dedekind_Real.realrel

goal (1 subgoal):
 1. Abs_Real (Dedekind_Real.realrel `` {(x, y)}) + Abs_Real (Dedekind_Real.realrel `` {(u, v)}) = Abs_Real (Dedekind_Real.realrel `` {(x + u, y + v)})
[PROOF STEP]
by (simp add: real_add_def UN_UN_split_split_eq UN_equiv_class2 [OF equiv_realrel equiv_realrel])
[PROOF STATE]
proof (state)
this:
Abs_Real (Dedekind_Real.realrel `` {(x, y)}) + Abs_Real (Dedekind_Real.realrel `` {(u, v)}) = Abs_Real (Dedekind_Real.realrel `` {(x + u, y + v)})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma extract_matrix_flatten_matrix:
"extract_matrix (flatten_matrix A) (dim_row A) (dim_col A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_matrix (flatten_matrix A) (dim_row A) (dim_col A) = A
[PROOF STEP]
unfolding extract_matrix_def flatten_matrix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (dim_row A) (dim_col A) (\<lambda>(i, j). A $$ ((i * dim_col A + j) div dim_col A, (i * dim_col A + j) mod dim_col A)) = A
[PROOF STEP]
by auto


[STATEMENT]
lemma "(-x \<le> x) = ((0::real) \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<le> x) = (0 \<le> x)
[PROOF STEP]
by arith


[STATEMENT]
lemma word_less_1 [simp]: "x < 1 \<longleftrightarrow> x = 0"
  for x :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x < 1) = (x = 0)
[PROOF STEP]
by (simp add: word_less_nat_alt unat_0_iff)


[STATEMENT]
lemma all_bool_lists2_correct: "set (all_bool_lists n) = set (all_bool_lists2 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (all_bool_lists n) = set (all_bool_lists2 n)
[PROOF STEP]
by (auto simp: all_bool_lists_correct n_sequence_enum_correct n_sequences_def)


[STATEMENT]
lemma sorted_list_of_set_imp_less_sets:
  assumes "xs < ys" "sorted xs" "sorted ys"
  shows "list.set xs \<lless> list.set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list.set xs \<lless> list.set ys
[PROOF STEP]
using assms sorted_hd_le sorted_le_last
[PROOF STATE]
proof (prove)
using this:
xs < ys
sorted xs
sorted ys
\<lbrakk>sorted ?xs; ?x \<in> list.set ?xs\<rbrakk> \<Longrightarrow> hd ?xs \<le> ?x
\<lbrakk>sorted ?xs; ?x \<in> list.set ?xs\<rbrakk> \<Longrightarrow> ?x \<le> last ?xs

goal (1 subgoal):
 1. list.set xs \<lless> list.set ys
[PROOF STEP]
by (force simp: less_list_def less_sets_def intro: order.trans)


[STATEMENT]
lemma connected_components_of_eq_singleton:
   "connected_components_of X = {S}
\<longleftrightarrow> connected_space X \<and> topspace X \<noteq> {} \<and> S = topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (connected_components_of X = {S}) = (connected_space X \<and> topspace X \<noteq> {} \<and> S = topspace X)
[PROOF STEP]
by (metis ccpo_Sup_singleton connected_components_of_subset_sing insert_not_empty subset_singleton_iff)


[STATEMENT]
lemma sym_congruent_rel: "sym (congruent_rel b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym (congruent_rel b)
[PROOF STEP]
unfolding sym_def congruent_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(a, c). cong a c b} \<longrightarrow> (y, x) \<in> {(a, c). cong a c b}
[PROOF STEP]
unfolding cong_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(a, c). \<exists>k. a - c = b * k} \<longrightarrow> (y, x) \<in> {(a, c). \<exists>k. a - c = b * k}
[PROOF STEP]
by (auto, metis add_commute add_minus_cancel diff_conv_add_uminus
    minus_mult_commute mult.left_commute mult_1_left)


[STATEMENT]
lemma map_replicate_True:
  "n = length xs \<Longrightarrow>
    map (\<lambda>(x,y). x \<and> y) (zip xs (replicate n True)) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = length xs \<Longrightarrow> map2 (\<and>) xs (replicate n True) = xs
[PROOF STEP]
by (induct xs arbitrary: n) auto


[STATEMENT]
lemma same_size:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "nat list list"
  fixes signs :: "rat list list"
  assumes invertible_mat: "invertible_mat (matrix_A signs subsets)"
  shows "length subsets = length signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length subsets = length signs
[PROOF STEP]
using invertible_mat
[PROOF STATE]
proof (prove)
using this:
invertible_mat (M_mat signs subsets)

goal (1 subgoal):
 1. length subsets = length signs
[PROOF STEP]
unfolding invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
square_mat (M_mat signs subsets) \<and> (\<exists>B. inverts_mat (M_mat signs subsets) B \<and> inverts_mat B (M_mat signs subsets))

goal (1 subgoal):
 1. length subsets = length signs
[PROOF STEP]
using size_of_mat[of signs subsets] size_of_lhs[of p qs signs] size_of_rhs[of p qs subsets]
[PROOF STATE]
proof (prove)
using this:
square_mat (M_mat signs subsets) \<and> (\<exists>B. inverts_mat (M_mat signs subsets) B \<and> inverts_mat B (M_mat signs subsets))
M_mat signs subsets \<in> carrier_mat (length subsets) (length signs)
dim_vec (w_vec p qs signs) = length signs
dim_vec (v_vec p qs subsets) = length subsets

goal (1 subgoal):
 1. length subsets = length signs
[PROOF STEP]
by simp


[STATEMENT]
lemma measure_eq_prod: (* Remark 10.2 *)
  "mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
[PROOF STEP]
consider "f = 0" | "g = 0" | (both) "f \<noteq> 0" "g \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f = 0 \<Longrightarrow> thesis; g = 0 \<Longrightarrow> thesis; \<lbrakk>f \<noteq> 0; g \<noteq> 0\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>f = 0 \<Longrightarrow> ?thesis; g = 0 \<Longrightarrow> ?thesis; \<lbrakk>f \<noteq> 0; g \<noteq> 0\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f = 0 \<Longrightarrow> ?thesis; g = 0 \<Longrightarrow> ?thesis; \<lbrakk>f \<noteq> 0; g \<noteq> 0\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
[PROOF STEP]
proof(cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f = 0 \<Longrightarrow> mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
 2. g = 0 \<Longrightarrow> mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
 3. \<lbrakk>f \<noteq> 0; g \<noteq> 0\<rbrakk> \<Longrightarrow> mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
[PROOF STEP]
case both
[PROOF STATE]
proof (state)
this:
f \<noteq> 0
g \<noteq> 0

goal (3 subgoals):
 1. f = 0 \<Longrightarrow> mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
 2. g = 0 \<Longrightarrow> mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
 3. \<lbrakk>f \<noteq> 0; g \<noteq> 0\<rbrakk> \<Longrightarrow> mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
[PROOF STEP]
unfolding mahler_measure_poly_via_monic norm_mult lead_coeff_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (lead_coeff f) * cmod (lead_coeff g) * mahler_measure_monic (f * g) = cmod (lead_coeff f) * mahler_measure_monic f * (cmod (lead_coeff g) * mahler_measure_monic g)
[PROOF STEP]
by (auto simp: measure_mono_eq_prod[OF both])
[PROOF STATE]
proof (state)
this:
mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
 2. g = 0 \<Longrightarrow> mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g
[PROOF STEP]
qed (simp_all)
[PROOF STATE]
proof (state)
this:
mahler_measure_poly (f * g) = mahler_measure_poly f * mahler_measure_poly g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_complex_iff:
  "(f \<longlongrightarrow> x) F \<longleftrightarrow> (((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F \<and> ((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> x) F = (((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F \<and> ((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F
 2. (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F
 3. \<lbrakk>((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F; ((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F\<rbrakk> \<Longrightarrow> (f \<longlongrightarrow> x) F
[PROOF STEP]
assume "((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F" "((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F"
[PROOF STATE]
proof (state)
this:
((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F
((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F

goal (3 subgoals):
 1. (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F
 2. (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F
 3. \<lbrakk>((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F; ((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F\<rbrakk> \<Longrightarrow> (f \<longlongrightarrow> x) F
[PROOF STEP]
from tendsto_Complex[OF this]
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. Complex (Re (f x)) (Im (f x))) \<longlongrightarrow> Complex (Re x) (Im x)) F
[PROOF STEP]
show "(f \<longlongrightarrow> x) F"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. Complex (Re (f x)) (Im (f x))) \<longlongrightarrow> Complex (Re x) (Im x)) F

goal (1 subgoal):
 1. (f \<longlongrightarrow> x) F
[PROOF STEP]
unfolding complex.collapse
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> x) F

goal (1 subgoal):
 1. (f \<longlongrightarrow> x) F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> x) F

goal (2 subgoals):
 1. (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. Re (f x)) \<longlongrightarrow> Re x) F
 2. (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. Im (f x)) \<longlongrightarrow> Im x) F
[PROOF STEP]
qed (auto intro: tendsto_intros)


[STATEMENT]
lemma "gcd x y dvd (x::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd x y dvd x
[PROOF STEP]
apply (rule nat_dvd.meet_left)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma f_rephrased:
  "f x y = x + (2 * x + 2 * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x y = x + (2 * x + 2 * y)
[PROOF STEP]
by (auto simp: f_def)


[STATEMENT]
lemma choose_one: "n choose 1 = n" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose 1 = n
[PROOF STEP]
by simp


[STATEMENT]
lemma "(n::real) \<in> {32 .. 62} \<Longrightarrow> \<lceil>log 2 (2 * (\<lfloor>n\<rfloor> div 2) + 1)\<rceil> = \<lceil>log 2 (\<lfloor>n\<rfloor> + 1)\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> {32..62} \<Longrightarrow> \<lceil>log 2 (real_of_int (2 * (\<lfloor>n\<rfloor> div 2) + 1))\<rceil> = \<lceil>log 2 (real_of_int (\<lfloor>n\<rfloor> + 1))\<rceil>
[PROOF STEP]
unfolding eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> {32..62} \<Longrightarrow> \<lceil>log 2 (real_of_int (2 * (\<lfloor>n\<rfloor> div 2) + 1))\<rceil> \<le> \<lceil>log 2 (real_of_int (\<lfloor>n\<rfloor> + 1))\<rceil> \<and> \<lceil>log 2 (real_of_int (\<lfloor>n\<rfloor> + 1))\<rceil> \<le> \<lceil>log 2 (real_of_int (2 * (\<lfloor>n\<rfloor> div 2) + 1))\<rceil>
[PROOF STEP]
by (approximation 20)


[STATEMENT]
lemma poly_map_append':
  assumes "is_poly_tuple n fs"
  assumes "is_poly_tuple n gs"
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  shows "poly_map n (fs@gs) a = poly_map n fs a @ poly_map n gs a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a
[PROOF STEP]
using assms(3) poly_map_append
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> poly_map ?n (?fs @ ?gs) ?a = poly_map ?n ?fs ?a @ poly_map ?n ?gs ?a

goal (1 subgoal):
 1. poly_map n (fs @ gs) a = poly_map n fs a @ poly_map n gs a
[PROOF STEP]
by blast


[STATEMENT]
lemma snd_Gauss_Jordan_det_P_is_Gauss_Jordan:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
shows "snd (Gauss_Jordan_det_P A) = (Gauss_Jordan A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Gauss_Jordan_det_P A) = Gauss_Jordan A
[PROOF STEP]
unfolding Gauss_Jordan_det_P_def Gauss_Jordan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Gauss_Jordan_upt_k_det_P A (ncols A - 1)) = Gauss_Jordan_upt_k A (ncols A - 1)
[PROOF STEP]
unfolding snd_Gauss_Jordan_upt_k_det_P_is_snd_Gauss_Jordan_upt_k_PA
snd_Gauss_Jordan_upt_k_PA
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_upt_k A (ncols A - 1) = Gauss_Jordan_upt_k A (ncols A - 1)
[PROOF STEP]
..


[STATEMENT]
lemma card_Int_if_either_in:
  assumes "\<forall>x \<in> S. \<forall>y \<in> S. x = y \<or> x \<notin> T \<or> y \<notin> T"
  shows "card (S \<inter> T) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (S \<inter> T) \<le> 1
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> card (S \<inter> T) \<le> 1 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (card (S \<inter> T) \<le> 1)"
[PROOF STATE]
proof (state)
this:
\<not> card (S \<inter> T) \<le> 1

goal (1 subgoal):
 1. \<not> card (S \<inter> T) \<le> 1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> card (S \<inter> T) \<le> 1
[PROOF STEP]
obtain x y where *: "x \<in> S \<inter> T \<and> y \<in> S \<inter> T \<and> x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
\<not> card (S \<inter> T) \<le> 1

goal (1 subgoal):
 1. (\<And>x y. x \<in> S \<inter> T \<and> y \<in> S \<inter> T \<and> x \<noteq> y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson card_le_1_if_pairwise_eq)
[PROOF STATE]
proof (state)
this:
x \<in> S \<inter> T \<and> y \<in> S \<inter> T \<and> x \<noteq> y

goal (1 subgoal):
 1. \<not> card (S \<inter> T) \<le> 1 \<Longrightarrow> False
[PROOF STEP]
hence "x \<in> T" "y \<in> T"
[PROOF STATE]
proof (prove)
using this:
x \<in> S \<inter> T \<and> y \<in> S \<inter> T \<and> x \<noteq> y

goal (1 subgoal):
 1. x \<in> T &&& y \<in> T
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
x \<in> T
y \<in> T

goal (1 subgoal):
 1. \<not> card (S \<inter> T) \<le> 1 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<in> T
y \<in> T

goal (1 subgoal):
 1. \<not> card (S \<inter> T) \<le> 1 \<Longrightarrow> False
[PROOF STEP]
have "x \<notin> T \<or> y \<notin> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> T \<or> y \<notin> T
[PROOF STEP]
using assms *
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<forall>y\<in>S. x = y \<or> x \<notin> T \<or> y \<notin> T
x \<in> S \<inter> T \<and> y \<in> S \<inter> T \<and> x \<noteq> y

goal (1 subgoal):
 1. x \<notin> T \<or> y \<notin> T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<notin> T \<or> y \<notin> T

goal (1 subgoal):
 1. \<not> card (S \<inter> T) \<le> 1 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<in> T
y \<in> T
x \<notin> T \<or> y \<notin> T
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x \<in> T
y \<in> T
x \<notin> T \<or> y \<notin> T

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_1_exists: "card s = 1 \<longleftrightarrow> (\<exists>!x. x \<in> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card s = 1) = (\<exists>!x. x \<in> s)
[PROOF STEP]
unfolding One_nat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card s = Suc 0) = (\<exists>!x. x \<in> s)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. card s = Suc 0 \<Longrightarrow> \<exists>!x. x \<in> s
 2. \<exists>!x. x \<in> s \<Longrightarrow> card s = Suc 0
[PROOF STEP]
apply(drule card_eq_SucD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>b B. s = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}) \<Longrightarrow> \<exists>!x. x \<in> s
 2. \<exists>!x. x \<in> s \<Longrightarrow> card s = Suc 0
[PROOF STEP]
defer
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>!x. x \<in> s \<Longrightarrow> card s = Suc 0
 2. \<exists>b B. s = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}) \<Longrightarrow> \<exists>!x. x \<in> s
[PROOF STEP]
apply(erule ex1E)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> s; \<forall>y. y \<in> s \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> card s = Suc 0
 2. \<exists>b B. s = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}) \<Longrightarrow> \<exists>!x. x \<in> s
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> s; \<forall>y. y \<in> s \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> card s = Suc 0
 2. \<exists>b B. s = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}) \<Longrightarrow> \<exists>!x. x \<in> s
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> s; \<forall>y. y \<in> s \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> card s = Suc 0
 2. \<exists>b B. s = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}) \<Longrightarrow> \<exists>!x. x \<in> s
[PROOF STEP]
assume as:"x \<in> s" "\<forall>y. y \<in> s \<longrightarrow> y = x"
[PROOF STATE]
proof (state)
this:
x \<in> s
\<forall>y. y \<in> s \<longrightarrow> y = x

goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> s; \<forall>y. y \<in> s \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> card s = Suc 0
 2. \<exists>b B. s = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}) \<Longrightarrow> \<exists>!x. x \<in> s
[PROOF STEP]
have *:"s = insert x {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s = {x}
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s = {x}
[PROOF STEP]
apply(rule,rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. xa \<in> s \<Longrightarrow> xa \<in> {x}
 2. {x} \<subseteq> s
[PROOF STEP]
unfolding singleton_iff
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. xa \<in> s \<Longrightarrow> xa = x
 2. {x} \<subseteq> s
[PROOF STEP]
apply(rule as(2)[rule_format])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> s \<Longrightarrow> x \<in> s
 2. {x} \<subseteq> s
[PROOF STEP]
using as(1)
[PROOF STATE]
proof (prove)
using this:
x \<in> s

goal (2 subgoals):
 1. \<And>x. x \<in> s \<Longrightarrow> x \<in> s
 2. {x} \<subseteq> s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s = {x}

goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> s; \<forall>y. y \<in> s \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> card s = Suc 0
 2. \<exists>b B. s = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}) \<Longrightarrow> \<exists>!x. x \<in> s
[PROOF STEP]
show "card s = Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card s = Suc 0
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x} = Suc 0
[PROOF STEP]
using card.insert_remove
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> card (insert ?x ?A) = Suc (card (?A - {?x}))

goal (1 subgoal):
 1. card {x} = Suc 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card s = Suc 0

goal (1 subgoal):
 1. \<exists>b B. s = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}) \<Longrightarrow> \<exists>!x. x \<in> s
[PROOF STEP]
qed auto


[STATEMENT]
lemma oLimit_make_mono_eq:
"\<forall>n. f n < oLimit f \<Longrightarrow> oLimit (\<lambda>n. f (make_mono f n)) = oLimit f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. f n < oLimit f \<Longrightarrow> oLimit (\<lambda>n. f (make_mono f n)) = oLimit f
[PROOF STEP]
apply (rule oLimit_eqI, force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>n. f n < oLimit f \<Longrightarrow> \<exists>m. f n \<le> f (make_mono f m)
[PROOF STEP]
apply (rule_tac x=n in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>n. f n < oLimit f \<Longrightarrow> f n \<le> f (make_mono f n)
[PROOF STEP]
apply (rule le_f_make_mono, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>n. f n < oLimit f \<Longrightarrow> n \<le> make_mono f n
[PROOF STEP]
apply (induct_tac n, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n na. \<lbrakk>\<forall>n. f n < oLimit f; na \<le> make_mono f na\<rbrakk> \<Longrightarrow> Suc na \<le> make_mono f (Suc na)
[PROOF STEP]
apply (rule Suc_leI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n na. \<lbrakk>\<forall>n. f n < oLimit f; na \<le> make_mono f na\<rbrakk> \<Longrightarrow> na < make_mono f (Suc na)
[PROOF STEP]
apply (erule order_le_less_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n na. \<forall>n. f n < oLimit f \<Longrightarrow> make_mono f na < make_mono f (Suc na)
[PROOF STEP]
apply (erule make_mono_less)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eval_fps_sin [simp]:
  fixes z :: "'a :: {banach, real_normed_field, field_char_0}"
  shows "eval_fps (fps_sin c) z = sin (c * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fps (fps_sin c) z = sin (c * z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval_fps (fps_sin c) z = sin (c * z)
[PROOF STEP]
have "(\<lambda>n. sin_coeff n *\<^sub>R (c * z) ^ n) sums sin (c * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sin_coeff n *\<^sub>R (c * z) ^ n) sums sin (c * z)
[PROOF STEP]
by (rule sin_converges)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. sin_coeff n *\<^sub>R (c * z) ^ n) sums sin (c * z)

goal (1 subgoal):
 1. eval_fps (fps_sin c) z = sin (c * z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. sin_coeff n *\<^sub>R (c * z) ^ n) sums sin (c * z)

goal (1 subgoal):
 1. eval_fps (fps_sin c) z = sin (c * z)
[PROOF STEP]
have "(\<lambda>n. sin_coeff n *\<^sub>R (c * z) ^ n) = (\<lambda>n. fps_nth (fps_sin c) n * z ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sin_coeff n *\<^sub>R (c * z) ^ n) = (\<lambda>n. fps_nth (fps_sin c) n * z ^ n)
[PROOF STEP]
by (rule ext) (auto simp: sin_coeff_def fps_sin_def power_mult_distrib scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. sin_coeff n *\<^sub>R (c * z) ^ n) = (\<lambda>n. fps_nth (fps_sin c) n * z ^ n)

goal (1 subgoal):
 1. eval_fps (fps_sin c) z = sin (c * z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. fps_nth (fps_sin c) n * z ^ n) sums sin (c * z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. fps_nth (fps_sin c) n * z ^ n) sums sin (c * z)

goal (1 subgoal):
 1. eval_fps (fps_sin c) z = sin (c * z)
[PROOF STEP]
by (simp add: sums_iff eval_fps_def)
[PROOF STATE]
proof (state)
this:
eval_fps (fps_sin c) z = sin (c * z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphism_moving_point_1:
  fixes a :: "'a::euclidean_space"
  assumes "affine T" "a \<in> T" and u: "u \<in> ball a r \<inter> T"
  obtains f g where "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
                    "f a = u" "\<And>x. x \<in> sphere a r \<Longrightarrow> f x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have nou: "norm (u - a) < r" and "u \<in> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (u - a) < r &&& u \<in> T
[PROOF STEP]
using u
[PROOF STATE]
proof (prove)
using this:
u \<in> ball a r \<inter> T

goal (1 subgoal):
 1. norm (u - a) < r &&& u \<in> T
[PROOF STEP]
by (auto simp: dist_norm norm_minus_commute)
[PROOF STATE]
proof (state)
this:
norm (u - a) < r
u \<in> T

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (u - a) < r
u \<in> T
[PROOF STEP]
have "0 < r"
[PROOF STATE]
proof (prove)
using this:
norm (u - a) < r
u \<in> T

goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
by (metis DiffD1 Diff_Diff_Int ball_eq_empty centre_in_ball not_le u)
[PROOF STATE]
proof (state)
this:
0 < r

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define f where "f \<equiv> \<lambda>x. (1 - norm(x - a) / r) *\<^sub>R (u - a) + x"
[PROOF STATE]
proof (state)
this:
f \<equiv> \<lambda>x. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have *: "False" if eq: "x + (norm y / r) *\<^sub>R u = y + (norm x / r) *\<^sub>R u"
                  and nou: "norm u < r" and yx: "norm y < norm x" for x y and u::'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have "x = y + (norm x / r - (norm y / r)) *\<^sub>R u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y + (norm x / r - norm y / r) *\<^sub>R u
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
x + (norm y / r) *\<^sub>R u = y + (norm x / r) *\<^sub>R u

goal (1 subgoal):
 1. x = y + (norm x / r - norm y / r) *\<^sub>R u
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
x = y + (norm x / r - norm y / r) *\<^sub>R u

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = y + (norm x / r - norm y / r) *\<^sub>R u
[PROOF STEP]
have "norm x = norm (y + ((norm x - norm y) / r) *\<^sub>R u)"
[PROOF STATE]
proof (prove)
using this:
x = y + (norm x / r - norm y / r) *\<^sub>R u

goal (1 subgoal):
 1. norm x = norm (y + ((norm x - norm y) / r) *\<^sub>R u)
[PROOF STEP]
by (metis diff_divide_distrib)
[PROOF STATE]
proof (state)
this:
norm x = norm (y + ((norm x - norm y) / r) *\<^sub>R u)

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm x = norm (y + ((norm x - norm y) / r) *\<^sub>R u)

goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<dots> \<le> norm y + norm(((norm x - norm y) / r) *\<^sub>R u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (y + ((norm x - norm y) / r) *\<^sub>R u) \<le> norm y + norm (((norm x - norm y) / r) *\<^sub>R u)
[PROOF STEP]
using norm_triangle_ineq
[PROOF STATE]
proof (prove)
using this:
norm (?x + ?y) \<le> norm ?x + norm ?y

goal (1 subgoal):
 1. norm (y + ((norm x - norm y) / r) *\<^sub>R u) \<le> norm y + norm (((norm x - norm y) / r) *\<^sub>R u)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm (y + ((norm x - norm y) / r) *\<^sub>R u) \<le> norm y + norm (((norm x - norm y) / r) *\<^sub>R u)

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (y + ((norm x - norm y) / r) *\<^sub>R u) \<le> norm y + norm (((norm x - norm y) / r) *\<^sub>R u)

goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<dots> = norm y + (norm x - norm y) * (norm u / r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm y + norm (((norm x - norm y) / r) *\<^sub>R u) = norm y + (norm x - norm y) * (norm u / r)
[PROOF STEP]
using yx \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
norm y < norm x
0 < r

goal (1 subgoal):
 1. norm y + norm (((norm x - norm y) / r) *\<^sub>R u) = norm y + (norm x - norm y) * (norm u / r)
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
norm y + norm (((norm x - norm y) / r) *\<^sub>R u) = norm y + (norm x - norm y) * (norm u / r)

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm y + norm (((norm x - norm y) / r) *\<^sub>R u) = norm y + (norm x - norm y) * (norm u / r)

goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<dots> < norm y + (norm x - norm y) * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm y + (norm x - norm y) * (norm u / r) < norm y + (norm x - norm y) * 1
[PROOF STEP]
proof (subst add_less_cancel_left)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (norm x - norm y) * (norm u / r) < (norm x - norm y) * 1
[PROOF STEP]
show "(norm x - norm y) * (norm u / r) < (norm x - norm y) * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm x - norm y) * (norm u / r) < (norm x - norm y) * 1
[PROOF STEP]
proof (rule mult_strict_left_mono)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. norm u / r < 1
 2. 0 < norm x - norm y
[PROOF STEP]
show "norm u / r < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm u / r < 1
[PROOF STEP]
using \<open>0 < r\<close> divide_less_eq_1_pos nou
[PROOF STATE]
proof (prove)
using this:
0 < r
(0::?'a) < ?a \<Longrightarrow> (?b / ?a < (1::?'a)) = (?b < ?a)
norm u < r

goal (1 subgoal):
 1. norm u / r < 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm u / r < 1

goal (1 subgoal):
 1. 0 < norm x - norm y
[PROOF STEP]
qed (simp add: yx)
[PROOF STATE]
proof (state)
this:
(norm x - norm y) * (norm u / r) < (norm x - norm y) * 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm y + (norm x - norm y) * (norm u / r) < norm y + (norm x - norm y) * 1

goal (1 subgoal):
 1. False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm y + (norm x - norm y) * (norm u / r) < norm y + (norm x - norm y) * 1

goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<dots> = norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm y + (norm x - norm y) * 1 = norm x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm y + (norm x - norm y) * 1 = norm x

goal (1 subgoal):
 1. False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm x < norm x
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
norm x < norm x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x + (norm ?y / r) *\<^sub>R ?u = ?y + (norm ?x / r) *\<^sub>R ?u; norm ?u < r; norm ?y < norm ?x\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "inj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>x. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x)
[PROOF STEP]
proof (clarsimp simp: inj_on_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x = (1 - norm (y - a) / r) *\<^sub>R (u - a) + y \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x = (1 - norm (y - a) / r) *\<^sub>R (u - a) + y \<Longrightarrow> x = y
[PROOF STEP]
assume "(1 - norm (x - a) / r) *\<^sub>R (u - a) + x =
            (1 - norm (y - a) / r) *\<^sub>R (u - a) + y"
[PROOF STATE]
proof (state)
this:
(1 - norm (x - a) / r) *\<^sub>R (u - a) + x = (1 - norm (y - a) / r) *\<^sub>R (u - a) + y

goal (1 subgoal):
 1. \<And>x y. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x = (1 - norm (y - a) / r) *\<^sub>R (u - a) + y \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - norm (x - a) / r) *\<^sub>R (u - a) + x = (1 - norm (y - a) / r) *\<^sub>R (u - a) + y
[PROOF STEP]
have eq: "(x - a) + (norm (y - a) / r) *\<^sub>R (u - a) = (y - a) + (norm (x - a) / r) *\<^sub>R (u - a)"
[PROOF STATE]
proof (prove)
using this:
(1 - norm (x - a) / r) *\<^sub>R (u - a) + x = (1 - norm (y - a) / r) *\<^sub>R (u - a) + y

goal (1 subgoal):
 1. x - a + (norm (y - a) / r) *\<^sub>R (u - a) = y - a + (norm (x - a) / r) *\<^sub>R (u - a)
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
x - a + (norm (y - a) / r) *\<^sub>R (u - a) = y - a + (norm (x - a) / r) *\<^sub>R (u - a)

goal (1 subgoal):
 1. \<And>x y. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x = (1 - norm (y - a) / r) *\<^sub>R (u - a) + y \<Longrightarrow> x = y
[PROOF STEP]
show "x=y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
proof (cases "norm (x - a) = norm (y - a)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. norm (x - a) = norm (y - a) \<Longrightarrow> x = y
 2. norm (x - a) \<noteq> norm (y - a) \<Longrightarrow> x = y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
norm (x - a) = norm (y - a)

goal (2 subgoals):
 1. norm (x - a) = norm (y - a) \<Longrightarrow> x = y
 2. norm (x - a) \<noteq> norm (y - a) \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (x - a) = norm (y - a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (x - a) = norm (y - a)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
norm (x - a) = norm (y - a)
x - a + (norm (y - a) / r) *\<^sub>R (u - a) = y - a + (norm (x - a) / r) *\<^sub>R (u - a)

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

goal (1 subgoal):
 1. norm (x - a) \<noteq> norm (y - a) \<Longrightarrow> x = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (x - a) \<noteq> norm (y - a) \<Longrightarrow> x = y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
norm (x - a) \<noteq> norm (y - a)

goal (1 subgoal):
 1. norm (x - a) \<noteq> norm (y - a) \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (x - a) \<noteq> norm (y - a)
[PROOF STEP]
consider "norm (x - a) < norm (y - a)" | "norm (x - a) > norm (y - a)"
[PROOF STATE]
proof (prove)
using this:
norm (x - a) \<noteq> norm (y - a)

goal (1 subgoal):
 1. \<lbrakk>norm (x - a) < norm (y - a) \<Longrightarrow> thesis; norm (y - a) < norm (x - a) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lbrakk>norm (x - a) < norm (y - a) \<Longrightarrow> ?thesis; norm (y - a) < norm (x - a) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. norm (x - a) \<noteq> norm (y - a) \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>norm (x - a) < norm (y - a) \<Longrightarrow> ?thesis; norm (y - a) < norm (x - a) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
have "False"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>norm (x - a) < norm (y - a) \<Longrightarrow> ?thesis; norm (y - a) < norm (x - a) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. False
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. norm (x - a) < norm (y - a) \<Longrightarrow> False
 2. norm (y - a) < norm (x - a) \<Longrightarrow> False
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
norm (x - a) < norm (y - a)

goal (2 subgoals):
 1. norm (x - a) < norm (y - a) \<Longrightarrow> False
 2. norm (y - a) < norm (x - a) \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using * [OF _ nou 1] eq
[PROOF STATE]
proof (prove)
using this:
y - a + (norm (x - a) / r) *\<^sub>R (u - a) = x - a + (norm (y - a) / r) *\<^sub>R (u - a) \<Longrightarrow> False
x - a + (norm (y - a) / r) *\<^sub>R (u - a) = y - a + (norm (x - a) / r) *\<^sub>R (u - a)

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

goal (1 subgoal):
 1. norm (y - a) < norm (x - a) \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (y - a) < norm (x - a) \<Longrightarrow> False
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
norm (y - a) < norm (x - a)

goal (1 subgoal):
 1. norm (y - a) < norm (x - a) \<Longrightarrow> False
[PROOF STEP]
with * [OF eq nou]
[PROOF STATE]
proof (chain)
picking this:
norm (y - a) < norm (x - a) \<Longrightarrow> False
norm (y - a) < norm (x - a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
norm (y - a) < norm (x - a) \<Longrightarrow> False
norm (y - a) < norm (x - a)

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

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

goal (1 subgoal):
 1. norm (x - a) \<noteq> norm (y - a) \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show "x=y"
[PROOF STATE]
proof (prove)
using this:
False

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

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

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

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj f
[PROOF STEP]
have inj_onf: "inj_on f (cball a r \<inter> T)"
[PROOF STATE]
proof (prove)
using this:
inj f

goal (1 subgoal):
 1. inj_on f (cball a r \<inter> T)
[PROOF STEP]
using inj_on_Int
[PROOF STATE]
proof (prove)
using this:
inj f
inj_on ?f ?A \<or> inj_on ?f ?B \<Longrightarrow> inj_on ?f (?A \<inter> ?B)

goal (1 subgoal):
 1. inj_on f (cball a r \<inter> T)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
inj_on f (cball a r \<inter> T)

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have contf: "continuous_on (cball a r \<inter> T) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cball a r \<inter> T) f
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cball a r \<inter> T) (\<lambda>x. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x)
[PROOF STEP]
using \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. continuous_on (cball a r \<inter> T) (\<lambda>x. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x)
[PROOF STEP]
by (intro continuous_intros) blast
[PROOF STATE]
proof (state)
this:
continuous_on (cball a r \<inter> T) f

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have fim: "f ` (cball a r \<inter> T) = cball a r \<inter> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (cball a r \<inter> T) = cball a r \<inter> T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T
 2. cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)
[PROOF STEP]
have *: "norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r" if "norm y \<le> r" "norm u < r" for y u::'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
have "norm (y + (1 - norm y / r) *\<^sub>R u) \<le> norm y + norm((1 - norm y / r) *\<^sub>R u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> norm y + norm ((1 - norm y / r) *\<^sub>R u)
[PROOF STEP]
using norm_triangle_ineq
[PROOF STATE]
proof (prove)
using this:
norm (?x + ?y) \<le> norm ?x + norm ?y

goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> norm y + norm ((1 - norm y / r) *\<^sub>R u)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm (y + (1 - norm y / r) *\<^sub>R u) \<le> norm y + norm ((1 - norm y / r) *\<^sub>R u)

goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (y + (1 - norm y / r) *\<^sub>R u) \<le> norm y + norm ((1 - norm y / r) *\<^sub>R u)

goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
have "\<dots> = norm y + abs(1 - norm y / r) * norm u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm y + norm ((1 - norm y / r) *\<^sub>R u) = norm y + \<bar>1 - norm y / r\<bar> * norm u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm y + norm ((1 - norm y / r) *\<^sub>R u) = norm y + \<bar>1 - norm y / r\<bar> * norm u

goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm y + norm ((1 - norm y / r) *\<^sub>R u) = norm y + \<bar>1 - norm y / r\<bar> * norm u

goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
have "\<dots> \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm y + \<bar>1 - norm y / r\<bar> * norm u \<le> r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm y + \<bar>1 - norm y / r\<bar> * norm u \<le> r
[PROOF STEP]
have "(r - norm u) * (r - norm y) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (r - norm u) * (r - norm y)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
norm y \<le> r
norm u < r

goal (1 subgoal):
 1. 0 \<le> (r - norm u) * (r - norm y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> (r - norm u) * (r - norm y)

goal (1 subgoal):
 1. norm y + \<bar>1 - norm y / r\<bar> * norm u \<le> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> (r - norm u) * (r - norm y)
[PROOF STEP]
have "r * norm u + r * norm y \<le> r * r + norm u * norm y"
[PROOF STATE]
proof (prove)
using this:
0 \<le> (r - norm u) * (r - norm y)

goal (1 subgoal):
 1. r * norm u + r * norm y \<le> r * r + norm u * norm y
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
r * norm u + r * norm y \<le> r * r + norm u * norm y

goal (1 subgoal):
 1. norm y + \<bar>1 - norm y / r\<bar> * norm u \<le> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r * norm u + r * norm y \<le> r * r + norm u * norm y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r * norm u + r * norm y \<le> r * r + norm u * norm y

goal (1 subgoal):
 1. norm y + \<bar>1 - norm y / r\<bar> * norm u \<le> r
[PROOF STEP]
using that \<open>0 < r\<close>
[PROOF STATE]
proof (prove)
using this:
r * norm u + r * norm y \<le> r * r + norm u * norm y
norm y \<le> r
norm u < r
0 < r

goal (1 subgoal):
 1. norm y + \<bar>1 - norm y / r\<bar> * norm u \<le> r
[PROOF STEP]
by (simp add: abs_if field_simps)
[PROOF STATE]
proof (state)
this:
norm y + \<bar>1 - norm y / r\<bar> * norm u \<le> r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm y + \<bar>1 - norm y / r\<bar> * norm u \<le> r

goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r

goal (1 subgoal):
 1. norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>norm ?y \<le> r; norm ?u < r\<rbrakk> \<Longrightarrow> norm (?y + (1 - norm ?y / r) *\<^sub>R ?u) \<le> r

goal (2 subgoals):
 1. f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T
 2. cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)
[PROOF STEP]
have "f ` (cball a r) \<subseteq> cball a r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` cball a r \<subseteq> cball a r
[PROOF STEP]
using * nou
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>norm ?y \<le> r; norm ?u < r\<rbrakk> \<Longrightarrow> norm (?y + (1 - norm ?y / r) *\<^sub>R ?u) \<le> r
norm (u - a) < r

goal (1 subgoal):
 1. f ` cball a r \<subseteq> cball a r
[PROOF STEP]
apply (clarsimp simp: dist_norm norm_minus_commute f_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>\<And>y u. \<lbrakk>norm y \<le> r; norm u < r\<rbrakk> \<Longrightarrow> norm (y + (1 - norm y / r) *\<^sub>R u) \<le> r; norm (a - u) < r; norm (xa - a) \<le> r\<rbrakk> \<Longrightarrow> norm (a - ((1 - norm (xa - a) / r) *\<^sub>R (u - a) + xa)) \<le> r
[PROOF STEP]
by (metis diff_add_eq diff_diff_add diff_diff_eq2 norm_minus_commute)
[PROOF STATE]
proof (state)
this:
f ` cball a r \<subseteq> cball a r

goal (2 subgoals):
 1. f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T
 2. cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f ` cball a r \<subseteq> cball a r

goal (2 subgoals):
 1. f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T
 2. cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)
[PROOF STEP]
have "f ` T \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` T \<subseteq> T
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x) ` T \<subseteq> T
[PROOF STEP]
using \<open>affine T\<close> \<open>a \<in> T\<close> \<open>u \<in> T\<close>
[PROOF STATE]
proof (prove)
using this:
affine T
a \<in> T
u \<in> T

goal (1 subgoal):
 1. (\<lambda>x. (1 - norm (x - a) / r) *\<^sub>R (u - a) + x) ` T \<subseteq> T
[PROOF STEP]
by (force simp: add.commute mem_affine_3_minus)
[PROOF STATE]
proof (state)
this:
f ` T \<subseteq> T

goal (2 subgoals):
 1. f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T
 2. cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f ` cball a r \<subseteq> cball a r
f ` T \<subseteq> T
[PROOF STEP]
show "f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T"
[PROOF STATE]
proof (prove)
using this:
f ` cball a r \<subseteq> cball a r
f ` T \<subseteq> T

goal (1 subgoal):
 1. f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f ` (cball a r \<inter> T) \<subseteq> cball a r \<inter> T

goal (1 subgoal):
 1. cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)
[PROOF STEP]
show "cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)
[PROOF STEP]
proof (clarsimp simp add: dist_norm norm_minus_commute)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (x - a) \<le> r; x \<in> T\<rbrakk> \<Longrightarrow> x \<in> f ` (cball a r \<inter> T)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (x - a) \<le> r; x \<in> T\<rbrakk> \<Longrightarrow> x \<in> f ` (cball a r \<inter> T)
[PROOF STEP]
assume x: "norm (x - a) \<le> r" and "x \<in> T"
[PROOF STATE]
proof (state)
this:
norm (x - a) \<le> r
x \<in> T

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (x - a) \<le> r; x \<in> T\<rbrakk> \<Longrightarrow> x \<in> f ` (cball a r \<inter> T)
[PROOF STEP]
have "\<exists>v \<in> {0..1}. ((1 - v) * r - norm ((x - a) - v *\<^sub>R (u - a))) \<bullet> 1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v\<in>{0..1}. ((1 - v) * r - norm (x - a - v *\<^sub>R (u - a))) \<bullet> 1 = 0
[PROOF STEP]
by (rule ivt_decreasing_component_on_1) (auto simp: x continuous_intros)
[PROOF STATE]
proof (state)
this:
\<exists>v\<in>{0..1}. ((1 - v) * r - norm (x - a - v *\<^sub>R (u - a))) \<bullet> 1 = 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (x - a) \<le> r; x \<in> T\<rbrakk> \<Longrightarrow> x \<in> f ` (cball a r \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>v\<in>{0..1}. ((1 - v) * r - norm (x - a - v *\<^sub>R (u - a))) \<bullet> 1 = 0
[PROOF STEP]
obtain v where "0 \<le> v" "v \<le> 1"
        and v: "(1 - v) * r = norm ((x - a) - v *\<^sub>R (u - a))"
[PROOF STATE]
proof (prove)
using this:
\<exists>v\<in>{0..1}. ((1 - v) * r - norm (x - a - v *\<^sub>R (u - a))) \<bullet> 1 = 0

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>0 \<le> v; v \<le> 1; (1 - v) * r = norm (x - a - v *\<^sub>R (u - a))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> v
v \<le> 1
(1 - v) * r = norm (x - a - v *\<^sub>R (u - a))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (x - a) \<le> r; x \<in> T\<rbrakk> \<Longrightarrow> x \<in> f ` (cball a r \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> v
v \<le> 1
(1 - v) * r = norm (x - a - v *\<^sub>R (u - a))
[PROOF STEP]
have n: "norm (a - (x - v *\<^sub>R (u - a))) = r - r * v"
[PROOF STATE]
proof (prove)
using this:
0 \<le> v
v \<le> 1
(1 - v) * r = norm (x - a - v *\<^sub>R (u - a))

goal (1 subgoal):
 1. norm (a - (x - v *\<^sub>R (u - a))) = r - r * v
[PROOF STEP]
by (simp add: field_simps norm_minus_commute)
[PROOF STATE]
proof (state)
this:
norm (a - (x - v *\<^sub>R (u - a))) = r - r * v

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (x - a) \<le> r; x \<in> T\<rbrakk> \<Longrightarrow> x \<in> f ` (cball a r \<inter> T)
[PROOF STEP]
show "x \<in> f ` (cball a r \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> f ` (cball a r \<inter> T)
[PROOF STEP]
proof (rule image_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = f ?x
 2. ?x \<in> cball a r \<inter> T
[PROOF STEP]
show "x = f (x - v *\<^sub>R (u - a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = f (x - v *\<^sub>R (u - a))
[PROOF STEP]
using \<open>r > 0\<close> v
[PROOF STATE]
proof (prove)
using this:
0 < r
(1 - v) * r = norm (x - a - v *\<^sub>R (u - a))

goal (1 subgoal):
 1. x = f (x - v *\<^sub>R (u - a))
[PROOF STEP]
by (simp add: f_def) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x = f (x - v *\<^sub>R (u - a))

goal (1 subgoal):
 1. x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T
[PROOF STEP]
have "x - v *\<^sub>R (u - a) \<in> cball a r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - v *\<^sub>R (u - a) \<in> cball a r
[PROOF STEP]
using \<open>r > 0\<close>\<open>0 \<le> v\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r
0 \<le> v

goal (1 subgoal):
 1. x - v *\<^sub>R (u - a) \<in> cball a r
[PROOF STEP]
by (simp add: dist_norm n)
[PROOF STATE]
proof (state)
this:
x - v *\<^sub>R (u - a) \<in> cball a r

goal (1 subgoal):
 1. x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x - v *\<^sub>R (u - a) \<in> cball a r

goal (1 subgoal):
 1. x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T
[PROOF STEP]
have "x - v *\<^sub>R (u - a) \<in> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - v *\<^sub>R (u - a) \<in> T
[PROOF STEP]
by (simp add: f_def \<open>u \<in> T\<close> \<open>x \<in> T\<close> assms mem_affine_3_minus2)
[PROOF STATE]
proof (state)
this:
x - v *\<^sub>R (u - a) \<in> T

goal (1 subgoal):
 1. x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x - v *\<^sub>R (u - a) \<in> cball a r
x - v *\<^sub>R (u - a) \<in> T
[PROOF STEP]
show "x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T"
[PROOF STATE]
proof (prove)
using this:
x - v *\<^sub>R (u - a) \<in> cball a r
x - v *\<^sub>R (u - a) \<in> T

goal (1 subgoal):
 1. x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x - v *\<^sub>R (u - a) \<in> cball a r \<inter> T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> f ` (cball a r \<inter> T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cball a r \<inter> T \<subseteq> f ` (cball a r \<inter> T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ` (cball a r \<inter> T) = cball a r \<inter> T

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "compact (cball a r \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (cball a r \<inter> T)
[PROOF STEP]
by (simp add: affine_closed compact_Int_closed \<open>affine T\<close>)
[PROOF STATE]
proof (state)
this:
compact (cball a r \<inter> T)

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compact (cball a r \<inter> T)
[PROOF STEP]
obtain g where "homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g"
[PROOF STATE]
proof (prove)
using this:
compact (cball a r \<inter> T)

goal (1 subgoal):
 1. (\<And>g. homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis homeomorphism_compact [OF _ contf fim inj_onf])
[PROOF STATE]
proof (state)
this:
homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; f a = u; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g

goal (1 subgoal):
 1. thesis
[PROOF STEP]
apply (rule_tac f=f in that)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g \<Longrightarrow> homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f ?g1
 2. homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g \<Longrightarrow> f a = u
 3. \<And>x. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; x \<in> sphere a r\<rbrakk> \<Longrightarrow> f x = x
[PROOF STEP]
using \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (3 subgoals):
 1. homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g \<Longrightarrow> homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f ?g1
 2. homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g \<Longrightarrow> f a = u
 3. \<And>x. \<lbrakk>homeomorphism (cball a r \<inter> T) (cball a r \<inter> T) f g; x \<in> sphere a r\<rbrakk> \<Longrightarrow> f x = x
[PROOF STEP]
by (simp_all add: f_def dist_norm norm_minus_commute)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma const_is_pr_3: "(\<lambda> x y z. (n::nat)) \<in> PrimRec3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y z. n) \<in> PrimRec3
[PROOF STEP]
proof (rule pr_comp1_3 [where ?f="%x.(n::nat)" and ?g="%x y z. x"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. n) \<in> PrimRec1
 2. (\<lambda>x y z. x) \<in> PrimRec3
[PROOF STEP]
show "(\<lambda> x. n) \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. n) \<in> PrimRec1
[PROOF STEP]
by (rule const_is_pr)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. n) \<in> PrimRec1

goal (1 subgoal):
 1. (\<lambda>x y z. x) \<in> PrimRec3
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x y z. x) \<in> PrimRec3
[PROOF STEP]
show "(\<lambda> x y z. x) \<in> PrimRec3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y z. x) \<in> PrimRec3
[PROOF STEP]
by (rule pr_id3_1)
[PROOF STATE]
proof (state)
this:
(\<lambda>x y z. x) \<in> PrimRec3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_fst [tendsto_intros]:
  assumes "(f \<longlongrightarrow> a) F"
  shows "((\<lambda>x. fst (f x)) \<longlongrightarrow> fst a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. fst (f x)) \<longlongrightarrow> fst a) F
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
assume "open S" and "fst a \<in> S"
[PROOF STATE]
proof (state)
this:
open S
fst a \<in> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open S
fst a \<in> S
[PROOF STEP]
have "open (fst -` S)" and "a \<in> fst -` S"
[PROOF STATE]
proof (prove)
using this:
open S
fst a \<in> S

goal (1 subgoal):
 1. open (fst -` S) &&& a \<in> fst -` S
[PROOF STEP]
by (simp_all add: open_vimage_fst)
[PROOF STATE]
proof (state)
this:
open (fst -` S)
a \<in> fst -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> a) F
open (fst -` S)
a \<in> fst -` S
[PROOF STEP]
have "eventually (\<lambda>x. f x \<in> fst -` S) F"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> a) F
open (fst -` S)
a \<in> fst -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<in> fst -` S
[PROOF STEP]
by (rule topological_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S
[PROOF STEP]
show "eventually (\<lambda>x. fst (f x) \<in> S) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. fst (f x) \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_map_poly: (* An exact variant *)
  assumes "f (lead_coeff p) = 0 \<longleftrightarrow> p = 0"
  shows   "degree (map_poly f p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly f p) = degree p
[PROOF STEP]
unfolding degree_eq_length_coeffs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (coeffs (map_poly f p)) - 1 = length (coeffs p) - 1
[PROOF STEP]
unfolding coeffs_map_poly[of f, OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map f (coeffs p)) - 1 = length (coeffs p) - 1
[PROOF STEP]
by simp