[STATEMENT]
lemma lselect_lnull: "lnull (lselect s w) \<longleftrightarrow> (\<forall> i \<in> s. enat i \<ge> llength w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lnull (lselect s w) = (\<forall>i\<in>s. llength w \<le> enat i)
[PROOF STEP]
unfolding llength_eq_0[symmetric] lselect_llength
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (esize {i \<in> s. enat i < llength w} = 0) = (\<forall>i\<in>s. llength w \<le> enat i)
[PROOF STEP]
by auto


[STATEMENT]
lemma  outer_trace_inner:
  assumes "A \<in> carrier_mat n n"
  and "dim_vec u = n"
and "dim_vec v = n"
  shows "Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
have "Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.trace (A * outer_prod u v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.trace (A * outer_prod u v)
[PROOF STEP]
proof (rule trace_comm)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. outer_prod u v \<in> carrier_mat ?n ?n
 2. A \<in> carrier_mat ?n ?n
[PROOF STEP]
show "A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
dim_vec u = n
dim_vec v = n

goal (1 subgoal):
 1. A \<in> carrier_mat n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. outer_prod u v \<in> carrier_mat n n
[PROOF STEP]
show "outer_prod u v \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod u v \<in> carrier_mat n n
[PROOF STEP]
using  assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
dim_vec u = n
dim_vec v = n

goal (1 subgoal):
 1. outer_prod u v \<in> carrier_mat n n
[PROOF STEP]
by (metis carrier_vec_dim_vec outer_prod_dim)
[PROOF STATE]
proof (state)
this:
outer_prod u v \<in> carrier_mat n n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.trace (A * outer_prod u v)

goal (1 subgoal):
 1. Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.trace (A * outer_prod u v)

goal (1 subgoal):
 1. Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
have "... = Complex_Matrix.inner_prod v (A *\<^sub>v u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.trace (A * outer_prod u v) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
using trace_outer_prod_right[of A n u v]
    assms   carrier_vec_dim_vec
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> carrier_mat n n; u \<in> carrier_vec n; v \<in> carrier_vec n\<rbrakk> \<Longrightarrow> Complex_Matrix.trace (A * outer_prod u v) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
A \<in> carrier_mat n n
dim_vec u = n
dim_vec v = n
?v \<in> carrier_vec (dim_vec ?v)

goal (1 subgoal):
 1. Complex_Matrix.trace (A * outer_prod u v) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (A * outer_prod u v) = Complex_Matrix.inner_prod v (A *\<^sub>v u)

goal (1 subgoal):
 1. Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)

goal (1 subgoal):
 1. Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Complex_Matrix.trace (outer_prod u v * A) = Complex_Matrix.inner_prod v (A *\<^sub>v u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma square_integrable_imp_lspace:
  assumes "f square_integrable S" shows "f \<in> lspace (lebesgue_on S) 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) 2
[PROOF STEP]
have "(\<lambda>x. (f x)\<^sup>2) absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x)\<^sup>2) absolutely_integrable_on S
[PROOF STEP]
by (metis assms integrable_on_lebesgue_on nonnegative_absolutely_integrable_1 square_integrable_def zero_le_power2)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x)\<^sup>2) absolutely_integrable_on S

goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x)\<^sup>2) absolutely_integrable_on S

goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) 2
[PROOF STEP]
have "S \<in> sets lebesgue"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<in> sets lebesgue
[PROOF STEP]
using assms square_integrable_def
[PROOF STATE]
proof (prove)
using this:
f square_integrable S
?f square_integrable ?S \<equiv> ?S \<in> sets lebesgue \<and> ?f \<in> borel_measurable (lebesgue_on ?S) \<and> integrable (lebesgue_on ?S) (\<lambda>x. (?f x)\<^sup>2)

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

goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (f x)\<^sup>2) absolutely_integrable_on S
S \<in> sets lebesgue
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x)\<^sup>2) absolutely_integrable_on S
S \<in> sets lebesgue

goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) 2
[PROOF STEP]
by (simp add: assms Lp_space_numeral integrable_restrict_space set_integrable_def square_integrable_imp_measurable)
[PROOF STATE]
proof (state)
this:
f \<in> lspace (lebesgue_on S) 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cross_ratio_1_equal:
  assumes "cross_ratio_correct p q r s" and "cross_ratio p q r s = 1"
  shows "r = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r = s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r = s
[PROOF STEP]
from \<open>cross_ratio_correct p q r s\<close>
[PROOF STATE]
proof (chain)
picking this:
cross_ratio_correct p q r s
[PROOF STEP]
have "proj2_set_Col {p,q,r,s}" and "p \<noteq> q" and "r \<noteq> p" and "r \<noteq> q"
[PROOF STATE]
proof (prove)
using this:
cross_ratio_correct p q r s

goal (1 subgoal):
 1. (proj2_set_Col {p, q, r, s} &&& p \<noteq> q) &&& r \<noteq> p &&& r \<noteq> q
[PROOF STEP]
by (unfold cross_ratio_correct_def) simp_all
[PROOF STATE]
proof (state)
this:
proj2_set_Col {p, q, r, s}
p \<noteq> q
r \<noteq> p
r \<noteq> q

goal (1 subgoal):
 1. r = s
[PROOF STEP]
from \<open>proj2_set_Col {p,q,r,s}\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_set_Col {p, q, r, s}
[PROOF STEP]
have "proj2_set_Col {p,q,r}"
[PROOF STATE]
proof (prove)
using this:
proj2_set_Col {p, q, r, s}

goal (1 subgoal):
 1. proj2_set_Col {p, q, r}
[PROOF STEP]
by (simp add: proj2_subset_Col [of "{p,q,r}" "{p,q,r,s}"])
[PROOF STATE]
proof (state)
this:
proj2_set_Col {p, q, r}

goal (1 subgoal):
 1. r = s
[PROOF STEP]
with \<open>p \<noteq> q\<close> and \<open>r \<noteq> p\<close> and \<open>r \<noteq> q\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> q
r \<noteq> p
r \<noteq> q
proj2_set_Col {p, q, r}
[PROOF STEP]
have "cross_ratio_correct p q r r"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> q
r \<noteq> p
r \<noteq> q
proj2_set_Col {p, q, r}

goal (1 subgoal):
 1. cross_ratio_correct p q r r
[PROOF STEP]
by (unfold cross_ratio_correct_def) simp
[PROOF STATE]
proof (state)
this:
cross_ratio_correct p q r r

goal (1 subgoal):
 1. r = s
[PROOF STEP]
from \<open>proj2_set_Col {p,q,r}\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_set_Col {p, q, r}
[PROOF STEP]
have "proj2_Col p q r"
[PROOF STATE]
proof (prove)
using this:
proj2_set_Col {p, q, r}

goal (1 subgoal):
 1. proj2_Col p q r
[PROOF STEP]
by (subst proj2_Col_iff_set_Col)
[PROOF STATE]
proof (state)
this:
proj2_Col p q r

goal (1 subgoal):
 1. r = s
[PROOF STEP]
with \<open>p \<noteq> q\<close> and \<open>r \<noteq> p\<close> and \<open>r \<noteq> q\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> q
r \<noteq> p
r \<noteq> q
proj2_Col p q r
[PROOF STEP]
have "cross_ratio p q r r = 1"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> q
r \<noteq> p
r \<noteq> q
proj2_Col p q r

goal (1 subgoal):
 1. cross_ratio p q r r = 1
[PROOF STEP]
by (simp add: cross_ratio_equal_1)
[PROOF STATE]
proof (state)
this:
cross_ratio p q r r = 1

goal (1 subgoal):
 1. r = s
[PROOF STEP]
with \<open>cross_ratio p q r s = 1\<close>
[PROOF STATE]
proof (chain)
picking this:
cross_ratio p q r s = 1
cross_ratio p q r r = 1
[PROOF STEP]
have "cross_ratio p q r r = cross_ratio p q r s"
[PROOF STATE]
proof (prove)
using this:
cross_ratio p q r s = 1
cross_ratio p q r r = 1

goal (1 subgoal):
 1. cross_ratio p q r r = cross_ratio p q r s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cross_ratio p q r r = cross_ratio p q r s

goal (1 subgoal):
 1. r = s
[PROOF STEP]
with \<open>cross_ratio_correct p q r r\<close> and \<open>cross_ratio_correct p q r s\<close>
[PROOF STATE]
proof (chain)
picking this:
cross_ratio_correct p q r r
cross_ratio_correct p q r s
cross_ratio p q r r = cross_ratio p q r s
[PROOF STEP]
show "r = s"
[PROOF STATE]
proof (prove)
using this:
cross_ratio_correct p q r r
cross_ratio_correct p q r s
cross_ratio p q r r = cross_ratio p q r s

goal (1 subgoal):
 1. r = s
[PROOF STEP]
by (rule cross_ratio_unique)
[PROOF STATE]
proof (state)
this:
r = s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_inverse_open:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "open S" "continuous_on S f" "DIM('b) \<le> DIM('a)" and gf: "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x"
    shows "continuous_on (f ` S) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (f ` S) g
[PROOF STEP]
proof (clarsimp simp add: continuous_openin_preimage_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set (f ` S)) (f ` S \<inter> g -` T)
[PROOF STEP]
fix T :: "'a set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set (f ` S)) (f ` S \<inter> g -` T)
[PROOF STEP]
assume "open T"
[PROOF STATE]
proof (state)
this:
open T

goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set (f ` S)) (f ` S \<inter> g -` T)
[PROOF STEP]
have eq: "f ` S \<inter> g -` T = f ` (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` S \<inter> g -` T = f ` (S \<inter> T)
[PROOF STEP]
by (auto simp: gf)
[PROOF STATE]
proof (state)
this:
f ` S \<inter> g -` T = f ` (S \<inter> T)

goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set (f ` S)) (f ` S \<inter> g -` T)
[PROOF STEP]
have "openin (top_of_set (f ` S)) (f ` (S \<inter> T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (f ` S)) (f ` (S \<inter> T))
[PROOF STEP]
proof (rule open_openin_trans [OF invariance_of_domain_gen])
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. open S
 2. continuous_on S f
 3. inj_on f S
 4. DIM('b) \<le> DIM('a)
 5. open (f ` (S \<inter> T))
 6. f ` (S \<inter> T) \<subseteq> f ` S
[PROOF STEP]
show "inj_on f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f S
[PROOF STEP]
using inj_on_inverseI gf
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> ?A \<Longrightarrow> ?g (?f x) = x) \<Longrightarrow> inj_on ?f ?A
?x \<in> S \<Longrightarrow> g (f ?x) = ?x

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

goal (5 subgoals):
 1. open S
 2. continuous_on S f
 3. DIM('b) \<le> DIM('a)
 4. open (f ` (S \<inter> T))
 5. f ` (S \<inter> T) \<subseteq> f ` S
[PROOF STEP]
show "open (f ` (S \<inter> T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` (S \<inter> T))
[PROOF STEP]
by (meson \<open>inj_on f S\<close> \<open>open T\<close> assms(1-3) continuous_on_subset inf_le1 inj_on_subset invariance_of_domain_gen open_Int)
[PROOF STATE]
proof (state)
this:
open (f ` (S \<inter> T))

goal (4 subgoals):
 1. open S
 2. continuous_on S f
 3. DIM('b) \<le> DIM('a)
 4. f ` (S \<inter> T) \<subseteq> f ` S
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
openin (top_of_set (f ` S)) (f ` (S \<inter> T))

goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set (f ` S)) (f ` S \<inter> g -` T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set (f ` S)) (f ` (S \<inter> T))
[PROOF STEP]
show "openin (top_of_set (f ` S)) (f ` S \<inter> g -` T)"
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set (f ` S)) (f ` (S \<inter> T))

goal (1 subgoal):
 1. openin (top_of_set (f ` S)) (f ` S \<inter> g -` T)
[PROOF STEP]
by (simp add: eq)
[PROOF STATE]
proof (state)
this:
openin (top_of_set (f ` S)) (f ` S \<inter> g -` T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filter_ex1: "\<exists>!x \<in> set xs. P x \<Longrightarrow> P x \<Longrightarrow> x \<in> set xs \<Longrightarrow> distinct xs
                  \<Longrightarrow> filter P xs = [x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>!x. x \<in> set xs \<and> P x; P x; x \<in> set xs; distinct xs\<rbrakk> \<Longrightarrow> filter P xs = [x]
[PROOF STEP]
apply(auto)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>P x; x \<in> set xs; distinct xs; \<forall>y y'. y \<in> set xs \<and> P y \<and> y' \<in> set xs \<and> P y' \<longrightarrow> y = y'; xa \<in> set xs; P xa\<rbrakk> \<Longrightarrow> filter P xs = [x]
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>P x; x \<in> set []; distinct []; \<forall>y y'. y \<in> set [] \<and> P y \<and> y' \<in> set [] \<and> P y' \<longrightarrow> y = y'; xa \<in> set []; P xa\<rbrakk> \<Longrightarrow> filter P [] = [x]
 2. \<And>a xs xa. \<lbrakk>\<And>xa. \<lbrakk>P x; x \<in> set xs; distinct xs; \<forall>y y'. y \<in> set xs \<and> P y \<and> y' \<in> set xs \<and> P y' \<longrightarrow> y = y'; xa \<in> set xs; P xa\<rbrakk> \<Longrightarrow> filter P xs = [x]; P x; x \<in> set (a # xs); distinct (a # xs); \<forall>y y'. y \<in> set (a # xs) \<and> P y \<and> y' \<in> set (a # xs) \<and> P y' \<longrightarrow> y = y'; xa \<in> set (a # xs); P xa\<rbrakk> \<Longrightarrow> filter P (a # xs) = [x]
[PROOF STEP]
apply(auto)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs xa. \<lbrakk>\<And>xa. \<lbrakk>P x; x \<in> set xs; distinct xs; \<forall>y y'. y \<in> set xs \<and> P y \<and> y' \<in> set xs \<and> P y' \<longrightarrow> y = y'; xa \<in> set xs; P xa\<rbrakk> \<Longrightarrow> filter P xs = [x]; P x; x \<in> set (a # xs); distinct (a # xs); \<forall>y y'. y \<in> set (a # xs) \<and> P y \<and> y' \<in> set (a # xs) \<and> P y' \<longrightarrow> y = y'; xa \<in> set (a # xs); P xa\<rbrakk> \<Longrightarrow> filter P (a # xs) = [x]
[PROOF STEP]
apply(auto)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<forall>y y'. (y = x \<or> y \<in> set xs) \<and> P y \<and> (y' = x \<or> y' \<in> set xs) \<and> P y' \<longrightarrow> y = y'; x \<notin> set xs; distinct xs; P x\<rbrakk> \<Longrightarrow> filter P xs = []
[PROOF STEP]
using filter_empty_conv
[PROOF STATE]
proof (prove)
using this:
(filter ?P ?xs = []) = (\<forall>x\<in>set ?xs. \<not> ?P x)

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<forall>y y'. (y = x \<or> y \<in> set xs) \<and> P y \<and> (y' = x \<or> y' \<in> set xs) \<and> P y' \<longrightarrow> y = y'; x \<notin> set xs; distinct xs; P x\<rbrakk> \<Longrightarrow> filter P xs = []
[PROOF STEP]
by fastforce


[STATEMENT]
lemma inverse_unique:
  assumes "a \<in> U" and "b \<in> U" and "a +\<^sub>o\<^sub>w b = 0\<^sub>o\<^sub>w"
  shows "-\<^sub>o\<^sub>w a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. -\<^sub>o\<^sub>w a = b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. -\<^sub>o\<^sub>w a = b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> U
b \<in> U
a +\<^sub>o\<^sub>w b = 0\<^sub>o\<^sub>w
[PROOF STEP]
have "(-\<^sub>o\<^sub>w a +\<^sub>o\<^sub>w a) +\<^sub>o\<^sub>w b = -\<^sub>o\<^sub>w a"
[PROOF STATE]
proof (prove)
using this:
a \<in> U
b \<in> U
a +\<^sub>o\<^sub>w b = 0\<^sub>o\<^sub>w

goal (1 subgoal):
 1. -\<^sub>o\<^sub>w a +\<^sub>o\<^sub>w a +\<^sub>o\<^sub>w b = -\<^sub>o\<^sub>w a
[PROOF STEP]
by (metis add.assoc uminus_closed add.right_neutral_mow)
[PROOF STATE]
proof (state)
this:
-\<^sub>o\<^sub>w a +\<^sub>o\<^sub>w a +\<^sub>o\<^sub>w b = -\<^sub>o\<^sub>w a

goal (1 subgoal):
 1. -\<^sub>o\<^sub>w a = b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
-\<^sub>o\<^sub>w a +\<^sub>o\<^sub>w a +\<^sub>o\<^sub>w b = -\<^sub>o\<^sub>w a

goal (1 subgoal):
 1. -\<^sub>o\<^sub>w a = b
[PROOF STEP]
unfolding left_inverse[OF \<open>a \<in> U\<close>] add.left_neutral_mow[OF \<open>b \<in> U\<close>]
[PROOF STATE]
proof (prove)
using this:
b = -\<^sub>o\<^sub>w a

goal (1 subgoal):
 1. -\<^sub>o\<^sub>w a = b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
-\<^sub>o\<^sub>w a = b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_cong [cong]:
  "s = t \<Longrightarrow> (\<And>x. x \<in> t \<Longrightarrow> f x = g x) \<Longrightarrow> continuous_on s f \<longleftrightarrow> continuous_on t g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s = t; \<And>x. x \<in> t \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> continuous_on s f = continuous_on t g
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s = t; \<And>x. x \<in> t \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> (\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s)) = (\<forall>x\<in>t. (g \<longlongrightarrow> g x) (at x within t))
[PROOF STEP]
by (intro ball_cong filterlim_cong) (auto simp: eventually_at_filter)


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


[STATEMENT]
lemma abs_set_union: "(A \<union> B) \<cdot>\<^sub>\<alpha>\<^sub>s\<^sub>e\<^sub>t a = (A \<cdot>\<^sub>\<alpha>\<^sub>s\<^sub>e\<^sub>t a) \<union> (B \<cdot>\<^sub>\<alpha>\<^sub>s\<^sub>e\<^sub>t a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<union> B) \<cdot>\<^sub>\<alpha>\<^sub>s\<^sub>e\<^sub>t a = A \<cdot>\<^sub>\<alpha>\<^sub>s\<^sub>e\<^sub>t a \<union> B \<cdot>\<^sub>\<alpha>\<^sub>s\<^sub>e\<^sub>t a
[PROOF STEP]
unfolding abs_apply_terms_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. t \<cdot>\<^sub>\<alpha> a) ` (A \<union> B) = (\<lambda>t. t \<cdot>\<^sub>\<alpha> a) ` A \<union> (\<lambda>t. t \<cdot>\<^sub>\<alpha> a) ` B
[PROOF STEP]
by auto


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


[STATEMENT]
lemma "(10000::nat) div 16 = 625"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 10000 div 16 = 625
[PROOF STEP]
by simp


[STATEMENT]
theorem access_matrix:
      fixes rs :: "'i::len simple_rule list"
      assumes matrix: "(V,E) = access_matrix c rs"
      shows "(\<exists>s_repr d_repr s_range d_range. (s_repr, d_repr) \<in> set E \<and>
              (map_of V) s_repr = Some s_range \<and> s \<in> wordinterval_to_set s_range \<and>
              (map_of V) d_repr = Some d_range \<and> d \<in> wordinterval_to_set d_range)
             \<longleftrightarrow>
             runFw s d c rs = Decision FinalAllow"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>s_repr d_repr s_range d_range. (s_repr, d_repr) \<in> set E \<and> map_of V s_repr = Some s_range \<and> s \<in> wordinterval_to_set s_range \<and> map_of V d_repr = Some d_range \<and> d \<in> wordinterval_to_set d_range) = (runFw s d c rs = Decision FinalAllow)
[PROOF STEP]
using matrix access_matrix_sound access_matrix_complete
[PROOF STATE]
proof (prove)
using this:
(V, E) = access_matrix c rs
\<lbrakk>(?V, ?E) = access_matrix ?c ?rs; (?s_repr, ?d_repr) \<in> set ?E; map_of ?V ?s_repr = Some ?s_range; ?s \<in> wordinterval_to_set ?s_range; map_of ?V ?d_repr = Some ?d_range; ?d \<in> wordinterval_to_set ?d_range\<rbrakk> \<Longrightarrow> runFw ?s ?d ?c ?rs = Decision FinalAllow
\<lbrakk>(?V, ?E) = access_matrix ?c ?rs; runFw ?s ?d ?c ?rs = Decision FinalAllow\<rbrakk> \<Longrightarrow> \<exists>s_repr d_repr s_range d_range. (s_repr, d_repr) \<in> set ?E \<and> map_of ?V s_repr = Some s_range \<and> ?s \<in> wordinterval_to_set s_range \<and> map_of ?V d_repr = Some d_range \<and> ?d \<in> wordinterval_to_set d_range

goal (1 subgoal):
 1. (\<exists>s_repr d_repr s_range d_range. (s_repr, d_repr) \<in> set E \<and> map_of V s_repr = Some s_range \<and> s \<in> wordinterval_to_set s_range \<and> map_of V d_repr = Some d_range \<and> d \<in> wordinterval_to_set d_range) = (runFw s d c rs = Decision FinalAllow)
[PROOF STEP]
by blast


[STATEMENT]
lemma closed_path_image:
  fixes g :: "real \<Rightarrow> 'a::t2_space"
  shows "path g \<Longrightarrow> closed(path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path g \<Longrightarrow> closed (path_image g)
[PROOF STEP]
by (metis compact_path_image compact_imp_closed)


[STATEMENT]
lemma aff_dim_convex_Int_nonempty_interior:
  fixes S :: "'a::euclidean_space set"
  shows "\<lbrakk>convex S; S \<inter> interior T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim(S \<inter> T) = aff_dim S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>convex S; S \<inter> interior T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim (S \<inter> T) = aff_dim S
[PROOF STEP]
using aff_dim_affine_hull2 affine_hull_convex_Int_nonempty_interior
[PROOF STATE]
proof (prove)
using this:
affine hull ?S = affine hull ?T \<Longrightarrow> aff_dim ?S = aff_dim ?T
\<lbrakk>convex ?S; ?S \<inter> interior ?T \<noteq> {}\<rbrakk> \<Longrightarrow> affine hull (?S \<inter> ?T) = affine hull ?S

goal (1 subgoal):
 1. \<lbrakk>convex S; S \<inter> interior T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim (S \<inter> T) = aff_dim S
[PROOF STEP]
by blast


[STATEMENT]
lemma inner_psi_l:
  "inner_prod (psi_l l) (psi_l l) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have eq0: "inner_prod (psi_l l) (psi_l l)
    = inner_prod ((alpha_l l) \<cdot>\<^sub>v \<alpha>) (psi_l l) + inner_prod ((beta_l l) \<cdot>\<^sub>v \<beta>) (psi_l l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l)
[PROOF STEP]
unfolding psi_l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
apply (subst inner_prod_distrib_left)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec ?n
 2. alpha_l l \<cdot>\<^sub>v \<alpha> \<in> carrier_vec ?n
 3. beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec ?n
 4. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
using \<alpha>_def \<beta>_def
[PROOF STATE]
proof (prove)
using this:
\<alpha> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 0 else 1 / sqrt (real (N - M))))
\<beta> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 1 / sqrt (real M) else 0))

goal (4 subgoals):
 1. alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec ?n
 2. alpha_l l \<cdot>\<^sub>v \<alpha> \<in> carrier_vec ?n
 3. beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec ?n
 4. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (psi_l l) (psi_l l) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l)

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have "inner_prod ((alpha_l l) \<cdot>\<^sub>v \<alpha>) (psi_l l)
    = inner_prod ((alpha_l l) \<cdot>\<^sub>v \<alpha>) ((alpha_l l) \<cdot>\<^sub>v \<alpha>) + inner_prod ((alpha_l l) \<cdot>\<^sub>v \<alpha>) ((beta_l l) \<cdot>\<^sub>v \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
unfolding psi_l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
apply (subst inner_prod_distrib_right)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. alpha_l l \<cdot>\<^sub>v \<alpha> \<in> carrier_vec ?n
 2. beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec ?n
 3. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
using \<alpha>_def \<beta>_def
[PROOF STATE]
proof (prove)
using this:
\<alpha> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 0 else 1 / sqrt (real (N - M))))
\<beta> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 1 / sqrt (real M) else 0))

goal (3 subgoals):
 1. alpha_l l \<cdot>\<^sub>v \<alpha> \<in> carrier_vec ?n
 2. beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec ?n
 3. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>)

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) = inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>)

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have "\<dots> = (conjugate (alpha_l l)) * (alpha_l l) * inner_prod \<alpha> \<alpha>
                + (conjugate (alpha_l l)) * (beta_l l) * inner_prod \<alpha> \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>) = conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta>
[PROOF STEP]
apply (subst (1 2) inner_prod_smult_left_right)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<alpha> \<in> carrier_vec ?n
 2. \<beta> \<in> carrier_vec ?n
 3. \<alpha> \<in> carrier_vec ?n1
 4. conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta> = conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta>
[PROOF STEP]
using \<alpha>_def \<beta>_def
[PROOF STATE]
proof (prove)
using this:
\<alpha> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 0 else 1 / sqrt (real (N - M))))
\<beta> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 1 / sqrt (real M) else 0))

goal (4 subgoals):
 1. \<alpha> \<in> carrier_vec ?n
 2. \<beta> \<in> carrier_vec ?n
 3. \<alpha> \<in> carrier_vec ?n1
 4. conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta> = conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>) = conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta>

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (beta_l l \<cdot>\<^sub>v \<beta>) = conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta>

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have "\<dots> = conjugate (alpha_l l) * (alpha_l l) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta> = conjugate (alpha_l l) * alpha_l l
[PROOF STEP]
by (simp add: alpha_beta_orth \<alpha>_inner)
[PROOF STATE]
proof (state)
this:
conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta> = conjugate (alpha_l l) * alpha_l l

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conjugate (alpha_l l) * alpha_l l * inner_prod \<alpha> \<alpha> + conjugate (alpha_l l) * beta_l l * inner_prod \<alpha> \<beta> = conjugate (alpha_l l) * alpha_l l

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have "\<dots> = (alpha_l l) * (alpha_l l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (alpha_l l) * alpha_l l = alpha_l l * alpha_l l
[PROOF STEP]
using cnj_alpha_l
[PROOF STATE]
proof (prove)
using this:
conjugate (alpha_l ?l) = alpha_l ?l

goal (1 subgoal):
 1. conjugate (alpha_l l) * alpha_l l = alpha_l l * alpha_l l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
conjugate (alpha_l l) * alpha_l l = alpha_l l * alpha_l l

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) = alpha_l l * alpha_l l
[PROOF STEP]
have eq1: "inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) = alpha_l l * alpha_l l"
[PROOF STATE]
proof (prove)
using this:
inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) = alpha_l l * alpha_l l

goal (1 subgoal):
 1. inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) = alpha_l l * alpha_l l
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inner_prod (alpha_l l \<cdot>\<^sub>v \<alpha>) (psi_l l) = alpha_l l * alpha_l l

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have "inner_prod ((beta_l l) \<cdot>\<^sub>v \<beta>) (psi_l l)
    = inner_prod ((beta_l l) \<cdot>\<^sub>v \<beta>) ((alpha_l l) \<cdot>\<^sub>v \<alpha>) + inner_prod ((beta_l l) \<cdot>\<^sub>v \<beta>) ((beta_l l) \<cdot>\<^sub>v \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l) = inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
unfolding psi_l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha> + beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
apply (subst inner_prod_distrib_right)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec ?n
 2. alpha_l l \<cdot>\<^sub>v \<alpha> \<in> carrier_vec ?n
 3. inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
using \<alpha>_def \<beta>_def
[PROOF STATE]
proof (prove)
using this:
\<alpha> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 0 else 1 / sqrt (real (N - M))))
\<beta> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 1 / sqrt (real M) else 0))

goal (3 subgoals):
 1. beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec ?n
 2. alpha_l l \<cdot>\<^sub>v \<alpha> \<in> carrier_vec ?n
 3. inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l) = inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>)

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l) = inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>)

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have "\<dots> = (conjugate (beta_l l)) * (alpha_l l) * inner_prod \<beta> \<alpha>
                + (conjugate (beta_l l)) * (beta_l l) * inner_prod \<beta> \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>) = conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta>
[PROOF STEP]
apply (subst (1 2) inner_prod_smult_left_right)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<beta> \<in> carrier_vec ?n
 2. \<beta> \<in> carrier_vec ?n1
 3. \<alpha> \<in> carrier_vec ?n1
 4. conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta> = conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta>
[PROOF STEP]
using \<alpha>_def \<beta>_def
[PROOF STATE]
proof (prove)
using this:
\<alpha> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 0 else 1 / sqrt (real (N - M))))
\<beta> = Matrix.vec N (\<lambda>x. complex_of_real (if f x then 1 / sqrt (real M) else 0))

goal (4 subgoals):
 1. \<beta> \<in> carrier_vec ?n
 2. \<beta> \<in> carrier_vec ?n1
 3. \<alpha> \<in> carrier_vec ?n1
 4. conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta> = conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>) = conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta>

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (alpha_l l \<cdot>\<^sub>v \<alpha>) + inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (beta_l l \<cdot>\<^sub>v \<beta>) = conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta>

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have "\<dots> = (conjugate (beta_l l)) * (beta_l l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta> = conjugate (beta_l l) * beta_l l
[PROOF STEP]
using \<beta>_inner beta_alpha_orth
[PROOF STATE]
proof (prove)
using this:
inner_prod \<beta> \<beta> = 1
inner_prod \<beta> \<alpha> = 0

goal (1 subgoal):
 1. conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta> = conjugate (beta_l l) * beta_l l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta> = conjugate (beta_l l) * beta_l l

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conjugate (beta_l l) * alpha_l l * inner_prod \<beta> \<alpha> + conjugate (beta_l l) * beta_l l * inner_prod \<beta> \<beta> = conjugate (beta_l l) * beta_l l

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
have "\<dots> = (beta_l l) * (beta_l l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (beta_l l) * beta_l l = beta_l l * beta_l l
[PROOF STEP]
using cnj_beta_l
[PROOF STATE]
proof (prove)
using this:
conjugate (beta_l ?l) = beta_l ?l

goal (1 subgoal):
 1. conjugate (beta_l l) * beta_l l = beta_l l * beta_l l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate (beta_l l) * beta_l l = beta_l l * beta_l l

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l) = beta_l l * beta_l l
[PROOF STEP]
have eq2: "inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l) = beta_l l * beta_l l"
[PROOF STATE]
proof (prove)
using this:
inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l) = beta_l l * beta_l l

goal (1 subgoal):
 1. inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l) = beta_l l * beta_l l
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inner_prod (beta_l l \<cdot>\<^sub>v \<beta>) (psi_l l) = beta_l l * beta_l l

goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (psi_l l) (psi_l l) = 1
[PROOF STEP]
unfolding eq0 eq1 eq2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alpha_l l * alpha_l l + beta_l l * beta_l l = 1
[PROOF STEP]
using alpha_l_beta_l_add_norm
[PROOF STATE]
proof (prove)
using this:
alpha_l ?l * alpha_l ?l + beta_l ?l * beta_l ?l = 1

goal (1 subgoal):
 1. alpha_l l * alpha_l l + beta_l l * beta_l l = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (psi_l l) (psi_l l) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_map_minus_eq [simp]:
  fixes f :: "'a\<Rightarrow>'b::real_normed_vector"
  shows "continuous_map X euclidean (\<lambda>x. - f x) \<longleftrightarrow> continuous_map X euclidean f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map X euclidean (\<lambda>x. - f x) = continuous_map X euclidean f
[PROOF STEP]
using continuous_map_minus add.inverse_inverse continuous_map_eq
[PROOF STATE]
proof (prove)
using this:
continuous_map ?X euclidean ?f \<Longrightarrow> continuous_map ?X euclidean (\<lambda>x. - ?f x)
- (- ?a) = ?a
\<lbrakk>continuous_map ?X ?X' ?f; \<And>x. x \<in> topspace ?X \<Longrightarrow> ?f x = ?g x\<rbrakk> \<Longrightarrow> continuous_map ?X ?X' ?g

goal (1 subgoal):
 1. continuous_map X euclidean (\<lambda>x. - f x) = continuous_map X euclidean f
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sets_trivial_measure: "sets (trivial_measure X) = {{}, X}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (trivial_measure X) = {{}, X}
[PROOF STEP]
by (simp add: trivial_measure_def sigma_algebra_trivial sigma_algebra.sigma_sets_eq)


[STATEMENT]
lemma ordinal_rec_oLimit:
assumes s: "\<forall>p x. x \<le> s p x"
shows "ordinal_rec z s (oLimit f) = oLimit (\<lambda>n. ordinal_rec z s (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordinal_rec z s (oLimit f) = oLimit (\<lambda>n. ordinal_rec z s (f n))
[PROOF STEP]
apply (unfold ordinal_rec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordinal_rec0 z s oLimit (oLimit f) = oLimit (\<lambda>n. ordinal_rec0 z s oLimit (f n))
[PROOF STEP]
apply (rule omega_complete.ordinal_rec0_oLimit)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. omega_complete ?le oLimit
 2. \<forall>p x. ?le x (s p x)
[PROOF STEP]
apply (rule omega_complete_oLimit)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p x. x \<le> s p x
[PROOF STEP]
apply (rule s)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem diff_plus_axiom_valid: "valid diff_plus_axiom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid diff_plus_axiom
[PROOF STEP]
apply(auto simp add: diff_plus_axiom_def valid_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I a b. is_interp I \<Longrightarrow> directional_derivative I (Plus (state_fun fid1) (state_fun fid2)) (a, b) = directional_derivative I (state_fun fid1) (a, b) + directional_derivative I (state_fun fid2) (a, b)
[PROOF STEP]
subgoal for I a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_interp I \<Longrightarrow> directional_derivative I (Plus (state_fun fid1) (state_fun fid2)) (a, b) = directional_derivative I (state_fun fid1) (a, b) + directional_derivative I (state_fun fid2) (a, b)
[PROOF STEP]
using frechet_correctness[of I "(Plus (state_fun fid1) (state_fun fid2))" b]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_interp I; dfree (Plus (state_fun fid1) (state_fun fid2))\<rbrakk> \<Longrightarrow> (sterm_sem I (Plus (state_fun fid1) (state_fun fid2)) has_derivative frechet I (Plus (state_fun fid1) (state_fun fid2)) b) (at b)

goal (1 subgoal):
 1. is_interp I \<Longrightarrow> directional_derivative I (Plus (state_fun fid1) (state_fun fid2)) (a, b) = directional_derivative I (state_fun fid1) (a, b) + directional_derivative I (state_fun fid2) (a, b)
[PROOF STEP]
unfolding state_fun_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_interp I; dfree (Plus ($f fid1 Var) ($f fid2 Var))\<rbrakk> \<Longrightarrow> (sterm_sem I (Plus ($f fid1 Var) ($f fid2 Var)) has_derivative frechet I (Plus ($f fid1 Var) ($f fid2 Var)) b) (at b)

goal (1 subgoal):
 1. is_interp I \<Longrightarrow> directional_derivative I (Plus ($f fid1 Var) ($f fid2 Var)) (a, b) = directional_derivative I ($f fid1 Var) (a, b) + directional_derivative I ($f fid2 Var) (a, b)
[PROOF STEP]
apply (auto intro: dfree.intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_interp I; (sterm_sem I (Plus ($f fid1 Var) ($f fid2 Var)) has_derivative (\<lambda>v'. (THE f'. \<forall>x. (Functions I fid1 has_derivative f' x) (at x)) b (\<chi>i. v' \<bullet> axis i 1) + (THE f'. \<forall>x. (Functions I fid2 has_derivative f' x) (at x)) b (\<chi>i. v' \<bullet> axis i 1))) (at b)\<rbrakk> \<Longrightarrow> directional_derivative I (Plus ($f fid1 Var) ($f fid2 Var)) (a, b) = directional_derivative I ($f fid1 Var) (a, b) + directional_derivative I ($f fid2 Var) (a, b)
[PROOF STEP]
unfolding directional_derivative_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_interp I; (sterm_sem I (Plus ($f fid1 Var) ($f fid2 Var)) has_derivative (\<lambda>v'. (THE f'. \<forall>x. (Functions I fid1 has_derivative f' x) (at x)) b (\<chi>i. v' \<bullet> axis i 1) + (THE f'. \<forall>x. (Functions I fid2 has_derivative f' x) (at x)) b (\<chi>i. v' \<bullet> axis i 1))) (at b)\<rbrakk> \<Longrightarrow> frechet I (Plus ($f fid1 Var) ($f fid2 Var)) (fst (a, b)) (snd (a, b)) = frechet I ($f fid1 Var) (fst (a, b)) (snd (a, b)) + frechet I ($f fid2 Var) (fst (a, b)) (snd (a, b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma add_mult_one_time_pad: assumes coprime: "coprime x q"
  shows "map_spmf (\<lambda> b. (y + x*b) mod q) (sample_uniform q) = (sample_uniform q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (\<lambda>b. (y + x * b) mod q) (sample_uniform q) = sample_uniform q
[PROOF STEP]
using inj_on_add_mult surj_on_add_mult one_time_pad coprime
[PROOF STATE]
proof (prove)
using this:
coprime ?x ?q \<Longrightarrow> inj_on (\<lambda>b. (?y + ?x * b) mod ?q) {..<?q}
\<lbrakk>coprime ?x ?q; inj_on (\<lambda>b. (?y + ?x * b) mod ?q) {..<?q}\<rbrakk> \<Longrightarrow> (\<lambda>b. (?y + ?x * b) mod ?q) ` {..<?q} = {..<?q}
\<lbrakk>inj_on ?f {..<?q}; ?f ` {..<?q} = {..<?q}\<rbrakk> \<Longrightarrow> map_spmf ?f (sample_uniform ?q) = sample_uniform ?q
coprime x q

goal (1 subgoal):
 1. map_spmf (\<lambda>b. (y + x * b) mod q) (sample_uniform q) = sample_uniform q
[PROOF STEP]
by simp


[STATEMENT]
lemma homeomorphic_map_connectedness_eq:
   "homeomorphic_map X Y f
        \<Longrightarrow> connectedin X U \<longleftrightarrow>
             U \<subseteq> topspace X \<and> connectedin Y (f ` U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X Y f \<Longrightarrow> connectedin X U = (U \<subseteq> topspace X \<and> connectedin Y (f ` U))
[PROOF STEP]
using homeomorphic_map_connectedness connectedin_subset_topspace
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>homeomorphic_map ?X ?Y ?f; ?U \<subseteq> topspace ?X\<rbrakk> \<Longrightarrow> connectedin ?Y (?f ` ?U) = connectedin ?X ?U
connectedin ?X ?S \<Longrightarrow> ?S \<subseteq> topspace ?X

goal (1 subgoal):
 1. homeomorphic_map X Y f \<Longrightarrow> connectedin X U = (U \<subseteq> topspace X \<and> connectedin Y (f ` U))
[PROOF STEP]
by metis


[STATEMENT]
lemma k_bound: "k > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
using p_fact prime_nat_iff'' test
[PROOF STATE]
proof (prove)
using this:
p = k * n + 1
prime ?p = (?p \<noteq> 0 \<and> ?p \<noteq> 1 \<and> (\<forall>m. 0 < m \<and> m < ?p \<longrightarrow> coprime ?p m))
prime p

goal (1 subgoal):
 1. 0 < k
[PROOF STEP]
by force


[STATEMENT]
lemma changes_poly_at_smods_smult:
  assumes "m>0"
  shows "changes_poly_at (smods p (smult m q)) x =changes_poly_at (smods p q) x "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes_poly_at (smods p (smult m q)) x = changes_poly_at (smods p q) x
[PROOF STEP]
using smods_smult_sgn_map_eq[OF `m>0`]
[PROOF STATE]
proof (prove)
using this:
map (\<lambda>p. sgn (poly p ?x)) (smods ?p (smult m ?q)) = map (\<lambda>p. sgn (poly p ?x)) (smods ?p ?q)
map sgn_pos_inf (smods ?p (smult m ?q)) = map sgn_pos_inf (smods ?p ?q)
map sgn_neg_inf (smods ?p (smult m ?q)) = map sgn_neg_inf (smods ?p ?q)

goal (1 subgoal):
 1. changes_poly_at (smods p (smult m q)) x = changes_poly_at (smods p q) x
[PROOF STEP]
by (metis changes_poly_at_alternative(2))


[STATEMENT]
lemma concat_bit_Suc:
  \<open>concat_bit (Suc n) k l = k mod 2 + 2 * concat_bit n (k div 2) l\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat_bit (Suc n) k l = k mod 2 + 2 * concat_bit n (k div 2) l
[PROOF STEP]
by (simp add: concat_bit_eq take_bit_Suc push_bit_double)


[STATEMENT]
lemma length_mergesort:
  "length (mergesort f xs) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (mergesort f xs) = length xs
[PROOF STEP]
by (induction f xs rule: mergesort.induct) (auto simp: length_merge split_at_take_drop_conv)


[STATEMENT]
lemma interior_of_complement:
   "X interior_of (topspace X - S) = topspace X - X closure_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X interior_of (topspace X - S) = topspace X - X closure_of S
[PROOF STEP]
by (auto simp: interior_of_def closure_of_def)


[STATEMENT]
theorem backward_sim_soundness:
  fixes A::"('sA,'a)ioa" and B::"('sB,'a)ioa" and f::"'sB \<Rightarrow> 'sA set"
  assumes "is_backward_sim f B A" and "ext A = ext B"
  shows "traces B \<subseteq> traces A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.traces B \<subseteq> local.traces A
[PROOF STEP]
using assms backward_sim_execs exec_inc_imp_trace_inc
[PROOF STATE]
proof (prove)
using this:
is_backward_sim f B A
externals (ioa.asig A) = externals (ioa.asig B)
\<lbrakk>is_backward_sim ?f ?B ?A; is_exec_of ?B ?e_B\<rbrakk> \<Longrightarrow> \<exists>e_A. is_exec_of ?A e_A \<and> trace (ioa.asig ?A) e_A = trace (ioa.asig ?A) ?e_B
\<lbrakk>externals (ioa.asig ?B) = externals (ioa.asig ?A); \<And>e_B. is_exec_of ?B e_B \<Longrightarrow> \<exists>e_A. is_exec_of ?A e_A \<and> trace (ioa.asig ?A) e_A = trace (ioa.asig ?A) e_B\<rbrakk> \<Longrightarrow> local.traces ?B \<subseteq> local.traces ?A

goal (1 subgoal):
 1. local.traces B \<subseteq> local.traces A
[PROOF STEP]
by metis


[STATEMENT]
lemma (in group) restrict_inv_into_hom:
      "\<lbrakk>h \<in> hom G G; h \<in> Bij (carrier G)\<rbrakk>
       \<Longrightarrow> restrict (inv_into (carrier G) h) (carrier G) \<in> hom G G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<in> hom G G; h \<in> Bij (carrier G)\<rbrakk> \<Longrightarrow> restrict (inv_into (carrier G) h) (carrier G) \<in> hom G G
[PROOF STEP]
by (simp add: hom_def Bij_inv_into_mem restrictI mult_funcset
                group.axioms Bij_inv_into_lemma)


[STATEMENT]
lemma floor_le_iff: "\<lfloor>x\<rfloor> \<le> z \<longleftrightarrow> x < of_int z + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lfloor>x\<rfloor> \<le> z) = (x < of_int z + (1::'a))
[PROOF STEP]
by (simp add: not_less [symmetric] less_floor_iff)


[STATEMENT]
lemma omega_properties_ex:
  obtains \<omega> ::"(('a::prime_card) mod_ring)"
  where  "\<omega>^n = 1"
         "\<omega> \<noteq> 1"
         "\<forall> m. \<omega>^m = 1 \<and> m\<noteq>0 \<longrightarrow> m \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain pr::"(('a::prime_card) mod_ring)" where a: "pr^(p-1) = 1 " and b: "pr \<noteq> 1"
              and c: "residue_primroot p (nat( to_int_mod_ring pr))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>pr. \<lbrakk>pr ^ (p - 1) = 1; pr \<noteq> 1; residue_primroot p (nat (to_int_mod_ring pr))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using primroot_ex
[PROOF STATE]
proof (prove)
using this:
(\<And>primroot. \<lbrakk>primroot ^ (p - 1) = 1; primroot \<noteq> 1; residue_primroot p (nat (to_int_mod_ring primroot))\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>pr. \<lbrakk>pr ^ (p - 1) = 1; pr \<noteq> 1; residue_primroot p (nat (to_int_mod_ring pr))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pr ^ (p - 1) = 1
pr \<noteq> 1
residue_primroot p (nat (to_int_mod_ring pr))

goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pr ^ (p - 1) = 1
pr \<noteq> 1
residue_primroot p (nat (to_int_mod_ring pr))

goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
hence "(pr^k)^n =1"
[PROOF STATE]
proof (prove)
using this:
pr ^ (p - 1) = 1
pr \<noteq> 1
residue_primroot p (nat (to_int_mod_ring pr))

goal (1 subgoal):
 1. (pr ^ k) ^ n = 1
[PROOF STEP]
by (simp add: p_fact power_mult)
[PROOF STATE]
proof (state)
this:
(pr ^ k) ^ n = 1

goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(pr ^ k) ^ n = 1

goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "pr^k \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pr ^ k \<noteq> 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
assume " pr ^ k = 1"
[PROOF STATE]
proof (state)
this:
pr ^ k = 1

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
hence "(to_int_mod_ring pr)^k mod p = 1"
[PROOF STATE]
proof (prove)
using this:
pr ^ k = 1

goal (1 subgoal):
 1. to_int_mod_ring pr ^ k mod int p = 1
[PROOF STEP]
by (metis exp_homo of_int_mod_ring.rep_eq of_int_mod_ring_to_int_mod_ring one_mod_ring.rep_eq p_def)
[PROOF STATE]
proof (state)
this:
to_int_mod_ring pr ^ k mod int p = 1

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
hence "ord p (to_int_mod_ring pr) \<le> k"
[PROOF STATE]
proof (prove)
using this:
to_int_mod_ring pr ^ k mod int p = 1

goal (1 subgoal):
 1. ord (int p) (to_int_mod_ring pr) \<le> k
[PROOF STEP]
by (simp add: \<open>pr ^ k = 1\<close> k_bound ord_max)
[PROOF STATE]
proof (state)
this:
ord (int p) (to_int_mod_ring pr) \<le> k

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
hence "ord p (nat (to_int_mod_ring pr)) \<le> k"
[PROOF STATE]
proof (prove)
using this:
ord (int p) (to_int_mod_ring pr) \<le> k

goal (1 subgoal):
 1. ord p (nat (to_int_mod_ring pr)) \<le> k
[PROOF STEP]
by (metis ord_lift)
[PROOF STATE]
proof (state)
this:
ord p (nat (to_int_mod_ring pr)) \<le> k

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ord p (nat (to_int_mod_ring pr)) \<le> k

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
have "ord p (nat (to_int_mod_ring pr)) = p - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord p (nat (to_int_mod_ring pr)) = p - 1
[PROOF STEP]
using c primroot_ord[of "(nat (to_int_mod_ring pr))"]
[PROOF STATE]
proof (prove)
using this:
residue_primroot p (nat (to_int_mod_ring pr))
residue_primroot p (nat (to_int_mod_ring pr)) \<Longrightarrow> ord p (nat (to_int_mod_ring pr)) = p - 1

goal (1 subgoal):
 1. ord p (nat (to_int_mod_ring pr)) = p - 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ord p (nat (to_int_mod_ring pr)) = p - 1

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ord p (nat (to_int_mod_ring pr)) = p - 1

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = k * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p - 1 = k * n
[PROOF STEP]
using p_fact
[PROOF STATE]
proof (prove)
using this:
p = k * n + 1

goal (1 subgoal):
 1. p - 1 = k * n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p - 1 = k * n

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k * n \<le> k
[PROOF STEP]
have "n \<le> 1"
[PROOF STATE]
proof (prove)
using this:
k * n \<le> k

goal (1 subgoal):
 1. n \<le> 1
[PROOF STEP]
using k_bound
[PROOF STATE]
proof (prove)
using this:
k * n \<le> k
0 < k

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

goal (1 subgoal):
 1. pr ^ k = 1 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
n \<le> 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using n_lst2
[PROOF STATE]
proof (prove)
using this:
n \<le> 1
2 \<le> n

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

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

goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pr ^ k \<noteq> 1

goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<forall> m. (pr^k)^m = 1 \<and> m\<noteq>0 \<longrightarrow> m \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m) \<Longrightarrow> False
[PROOF STEP]
assume  "\<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m\<noteq>0 \<longrightarrow> n \<le> m) "
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)

goal (1 subgoal):
 1. \<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)
[PROOF STEP]
obtain m where "(pr^k)^m = 1  \<and> m\<noteq>0 \<and> m < n"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m)

goal (1 subgoal):
 1. (\<And>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<and> m < n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<and> m < n

goal (1 subgoal):
 1. \<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m) \<Longrightarrow> False
[PROOF STEP]
hence "ord p (to_int_mod_ring pr) \<le> k * m"
[PROOF STATE]
proof (prove)
using this:
(pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<and> m < n

goal (1 subgoal):
 1. ord (int p) (to_int_mod_ring pr) \<le> k * m
[PROOF STEP]
using ord_max[of "k*m" pr]
[PROOF STATE]
proof (prove)
using this:
(pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<and> m < n
\<lbrakk>k * m \<noteq> 0; pr ^ (k * m) = 1\<rbrakk> \<Longrightarrow> ord (int p) (to_int_mod_ring pr) \<le> k * m

goal (1 subgoal):
 1. ord (int p) (to_int_mod_ring pr) \<le> k * m
[PROOF STEP]
by (metis calculation(5) mult_is_0 power_mult)
[PROOF STATE]
proof (state)
this:
ord (int p) (to_int_mod_ring pr) \<le> k * m

goal (1 subgoal):
 1. \<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ord (int p) (to_int_mod_ring pr) \<le> k * m

goal (1 subgoal):
 1. \<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m) \<Longrightarrow> False
[PROOF STEP]
have "ord p (nat (to_int_mod_ring pr)) = p-1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord p (nat (to_int_mod_ring pr)) = p - 1
[PROOF STEP]
using c primroot_ord ord_lift
[PROOF STATE]
proof (prove)
using this:
residue_primroot p (nat (to_int_mod_ring pr))
residue_primroot p ?g \<Longrightarrow> ord p ?g = p - 1
ord (int p) (to_int_mod_ring ?pr) = ord p (nat (to_int_mod_ring ?pr))

goal (1 subgoal):
 1. ord p (nat (to_int_mod_ring pr)) = p - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ord p (nat (to_int_mod_ring pr)) = p - 1

goal (1 subgoal):
 1. \<not> (\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ord (int p) (to_int_mod_ring pr) \<le> k * m
ord p (nat (to_int_mod_ring pr)) = p - 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
ord (int p) (to_int_mod_ring pr) \<le> k * m
ord p (nat (to_int_mod_ring pr)) = p - 1

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis \<open>(pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<and> m < n\<close> add_diff_cancel_right' nat_0_less_mult_iff nat_mult_le_cancel_disj not_less ord_lift p_def p_fact prime_card prime_gt_1_nat zero_less_diff)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m

goal (1 subgoal):
 1. (\<And>\<omega>. \<lbrakk>\<omega> ^ n = 1; \<omega> \<noteq> 1; \<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
pr ^ (p - 1) = 1
pr \<noteq> 1
residue_primroot p (nat (to_int_mod_ring pr))
(pr ^ k) ^ n = 1
pr ^ k \<noteq> 1
\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pr ^ (p - 1) = 1
pr \<noteq> 1
residue_primroot p (nat (to_int_mod_ring pr))
(pr ^ k) ^ n = 1
pr ^ k \<noteq> 1
\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
pr ^ (p - 1) = 1
pr \<noteq> 1
residue_primroot p (nat (to_int_mod_ring pr))
(pr ^ k) ^ n = 1
pr ^ k \<noteq> 1
\<forall>m. (pr ^ k) ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m
\<lbrakk>?\<omega> ^ n = 1; ?\<omega> \<noteq> 1; \<forall>m. ?\<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_poly_rat_no_root_ge:
  fixes p :: "real poly" and a b :: int
  assumes "\<And>n. coeff p n \<in> \<int>"
  assumes "b > 0" "poly p (a / b) \<noteq> 0"
  defines "n \<equiv> degree p"
  shows   "abs (poly p (a / b)) \<ge> 1 / of_int b ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
let ?S = "(\<Sum>i\<le>n. coeff p i * of_int a ^ i * (of_int b ^ (n - i)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
from \<open>b > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < b
[PROOF STEP]
have eq: "?S = of_int b ^ n * poly p (a / b)"
[PROOF STATE]
proof (prove)
using this:
0 < b

goal (1 subgoal):
 1. (\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) = real_of_int b ^ n * poly p (real_of_int a / real_of_int b)
[PROOF STEP]
by (simp add: poly_altdef power_divide mult_ac n_def sum_distrib_left power_diff)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) = real_of_int b ^ n * poly p (real_of_int a / real_of_int b)

goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
have "?S \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<in> \<int>
[PROOF STEP]
by (intro Ints_sum Ints_mult assms Ints_power) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<in> \<int>

goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<in> \<int>

goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
coeff p ?n \<in> \<int>
0 < b
poly p (real_of_int a / real_of_int b) \<noteq> 0
n \<equiv> degree p
[PROOF STEP]
have "?S \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
coeff p ?n \<in> \<int>
0 < b
poly p (real_of_int a / real_of_int b) \<noteq> 0
n \<equiv> degree p

goal (1 subgoal):
 1. (\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<noteq> 0
[PROOF STEP]
by (subst eq) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<noteq> 0

goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<in> \<int>
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<noteq> 0
[PROOF STEP]
have "abs ?S \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<in> \<int>
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) \<noteq> 0

goal (1 subgoal):
 1. 1 \<le> \<bar>\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)\<bar>
[PROOF STEP]
by (elim Ints_cases) simp
[PROOF STATE]
proof (state)
this:
1 \<le> \<bar>\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)\<bar>

goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
with eq \<open>b > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) = real_of_int b ^ n * poly p (real_of_int a / real_of_int b)
0 < b
1 \<le> \<bar>\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)) = real_of_int b ^ n * poly p (real_of_int a / real_of_int b)
0 < b
1 \<le> \<bar>\<Sum>i\<le>n. coeff p i * real_of_int a ^ i * real_of_int b ^ (n - i)\<bar>

goal (1 subgoal):
 1. 1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>
[PROOF STEP]
by (simp add: field_simps abs_mult)
[PROOF STATE]
proof (state)
this:
1 / real_of_int b ^ n \<le> \<bar>poly p (real_of_int a / real_of_int b)\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conj_Inf_distrib: "D \<noteq> {} \<Longrightarrow> c \<iinter> (\<Sqinter> D) = (\<Sqinter>d\<in>D. c \<iinter> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> c \<iinter> \<Sqinter> D = \<Sqinter> ((\<iinter>) c ` D)
variables:
c :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
D :: 'a set
type variables:
'a :: refinement_lattice
[PROOF STEP]
using Inf_conj_distrib conj_commute
[PROOF STATE]
proof (prove)
using this:
(?D::'a::refinement_lattice set) \<noteq> {} \<Longrightarrow> \<Sqinter> ?D \<iinter> (?c::'a::refinement_lattice) = (\<Sqinter>d::'a::refinement_lattice\<in>?D. d \<iinter> ?c)
(?a::'a::refinement_lattice) \<iinter> (?b::'a::refinement_lattice) = ?b \<iinter> ?a

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> c \<iinter> \<Sqinter> D = \<Sqinter> ((\<iinter>) c ` D)
variables:
c :: 'a
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
D :: 'a set
type variables:
'a :: refinement_lattice
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_card_of_iff_card:
assumes FIN: "finite A" and FIN': "finite B"
shows "( |A| =o |B| ) = (card A = card B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (|A| =o |B|) = (card A = card B)
[PROOF STEP]
using assms card_of_ordIso[of A B] bij_betw_iff_card[of A B]
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
(\<exists>f. bij_betw f A B) = (|A| =o |B|)
\<lbrakk>finite A; finite B\<rbrakk> \<Longrightarrow> (\<exists>f. bij_betw f A B) = (card A = card B)

goal (1 subgoal):
 1. (|A| =o |B|) = (card A = card B)
[PROOF STEP]
by blast


[STATEMENT]
lemma reversepath_linepath[simp]: "reversepath (linepath a b) = linepath b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reversepath (linepath a b) = linepath b a
[PROOF STEP]
unfolding reversepath_def linepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 - (1 - x)) *\<^sub>R a + (1 - x) *\<^sub>R b) = (\<lambda>x. (1 - x) *\<^sub>R b + x *\<^sub>R a)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in ceuclidean_space) ceuclidean_representation_sum:
  "(\<Sum>i\<in>CBasis. f i *\<^sub>C i) = b \<longleftrightarrow> (\<forall>i\<in>CBasis. f i = cnj (cinner b i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>i\<in>CBasis. f i *\<^sub>C i) = b) = (\<forall>i\<in>CBasis. f i = cnj (b \<bullet>\<^sub>C i))
[PROOF STEP]
apply (subst ceuclidean_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>ba\<in>CBasis. (\<Sum>i\<in>CBasis. f i *\<^sub>C i) \<bullet>\<^sub>C ba = b \<bullet>\<^sub>C ba) = (\<forall>i\<in>CBasis. f i = cnj (b \<bullet>\<^sub>C i))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>ba\<in>CBasis. cnj (f ba) = b \<bullet>\<^sub>C ba) = (\<forall>i\<in>CBasis. f i = cnj (b \<bullet>\<^sub>C i))
[PROOF STEP]
by (metis complex_cnj_cnj cinner_commute)


[STATEMENT]
lemma a''_a: "$a''^{m}_n = (1+i).^(1/m) * $a^{m}_n" if "m \<noteq> 0" for m::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $a''^{m}_n = (1 + i) .^ (1 / real m) * $a^{m}_n
[PROOF STEP]
unfolding ann_def ann_due_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n * m. $v .^ (real k / real m) / real m) = (1 + i) .^ (1 / real m) * (\<Sum>k<n * m. $v .^ (real (k + 1) / real m) / real m)
[PROOF STEP]
apply (subst sum_distrib_left, subst times_divide_eq_right, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n * m. $v .^ (real k / real m) / real m) = (\<Sum>n<n * m. (1 + i) .^ (1 / real m) * $v .^ ((1 + real n) / real m) / real m)
[PROOF STEP]
by (subst i_v, subst powr_powr, subst powr_add[THEN sym], simp, subst add_divide_distrib, simp)


[STATEMENT]
lemma real_affinity_eq: "m \<noteq> 0 \<Longrightarrow> m * x + c = y \<longleftrightarrow> x = inverse m * y + - (c / m)"
  for m :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> (0::'a) \<Longrightarrow> (m * x + c = y) = (x = inverse m * y + - (c / m))
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma product_two_squares_int: "is_sum2sq_int m \<Longrightarrow> is_sum2sq_int n \<Longrightarrow> is_sum2sq_int (m*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_sum2sq_int m; is_sum2sq_int n\<rbrakk> \<Longrightarrow> is_sum2sq_int (m * n)
[PROOF STEP]
by (unfold is_sum2sq_int_def, auto simp only: product_two_squares_aux, blast)


[STATEMENT]
lemma OT_14_P1_sec: "OT_14.adv_P1 m1 m2 D \<le> 3 * adv_OT12"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OT_14.adv_P1 m1 m2 D \<le> 3 * adv_OT12
[PROOF STEP]
unfolding OT_14.adv_P1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>spmf (R1_14 m1 m2 \<bind> D) True - spmf (funct_OT_14 m1 m2 \<bind> (\<lambda>(o1, o2). S1_14 m1 o1 \<bind> D)) True\<bar> \<le> 3 * adv_OT12
[PROOF STEP]
by (metis reduction_P1 surj_pair)


[STATEMENT]
lemma conv_abscissa_diff_leI:
  "conv_abscissa (f :: 'a :: dirichlet_series fds) \<le> d \<Longrightarrow> conv_abscissa g \<le> d \<Longrightarrow>
     conv_abscissa (f - g) \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>conv_abscissa f \<le> d; conv_abscissa g \<le> d\<rbrakk> \<Longrightarrow> conv_abscissa (f - g) \<le> d
[PROOF STEP]
using conv_abscissa_add_le[of f "-g"]
[PROOF STATE]
proof (prove)
using this:
conv_abscissa (f + - g) \<le> max (conv_abscissa f) (conv_abscissa (- g))

goal (1 subgoal):
 1. \<lbrakk>conv_abscissa f \<le> d; conv_abscissa g \<le> d\<rbrakk> \<Longrightarrow> conv_abscissa (f - g) \<le> d
[PROOF STEP]
by (auto simp: le_max_iff_disj)


[STATEMENT]
lemma continuous_cross7: "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. f x \<times>\<^sub>7 g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. f x \<times>\<^sub>7 g x)
[PROOF STEP]
by (subst continuous_componentwise)(auto intro!: continuous_intros simp: cross7_simps)


[STATEMENT]
lemma factor: "factor x y \<longleftrightarrow> (\<exists>z. z \<noteq> 0 \<and> x * z = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_semiring_1_class.factor x y = (\<exists>z. z \<noteq> (0::'a) \<and> x * z = y)
[PROOF STEP]
unfolding factor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>c\<in>carrier mk_monoid. y = x \<otimes>\<^bsub>mk_monoid\<^esub> c) = (\<exists>z. z \<noteq> (0::'a) \<and> x * z = y)
[PROOF STEP]
by auto


[STATEMENT]
lemma MutuallyDistinct_Union:
  "\<lbrakk> MutuallyDistinct A; MutuallyDistinct B;
  (\<Union> C \<in> A. States C) \<inter> (\<Union> C \<in> B. States C) = {} \<rbrakk>
  \<Longrightarrow> MutuallyDistinct (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>MutuallyDistinct A; MutuallyDistinct B; \<Union> (States ` A) \<inter> \<Union> (States ` B) = {}\<rbrakk> \<Longrightarrow> MutuallyDistinct (A \<union> B)
[PROOF STEP]
by (unfold MutuallyDistinct_def, safe, blast+)


[STATEMENT]
lemma ln_mono_strict: "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> x < y \<Longrightarrow> ln (x::real) < ln y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; 0 < y; x < y\<rbrakk> \<Longrightarrow> ln x < ln y
[PROOF STEP]
by (subst ln_less_cancel_iff) simp_all


[STATEMENT]
theorem minimal_imp_isomorphic:
     "\<lbrakk>dfa.language M = dfa.language N; dfa.minimal M; dfa.minimal N; dfa M; dfa N\<rbrakk>
      \<Longrightarrow> \<exists>h. dfa_isomorphism M N h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dfa.language M = dfa.language N; dfa.minimal M; dfa.minimal N; dfa M; dfa N\<rbrakk> \<Longrightarrow> \<exists>h. dfa_isomorphism M N h
[PROOF STEP]
by (metis dfa_isomorphism.sym dfa_isomorphism.trans
            dfa.minimal_imp_isomorphic_to_canonical index_f_cong)


[STATEMENT]
theorem Brouwer_reduction_theorem_gen:
  fixes S :: "'a::euclidean_space set"
  assumes "closed S" "\<phi> S"
      and \<phi>: "\<And>F. \<lbrakk>\<And>n. closed(F n); \<And>n. \<phi>(F n); \<And>n. F(Suc n) \<subseteq> F n\<rbrakk> \<Longrightarrow> \<phi>(\<Inter>(range F))"
  obtains T where "T \<subseteq> S" "closed T" "\<phi> T" "\<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> (U \<subset> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain B :: "nat \<Rightarrow> 'a set"
    where "inj B" "\<And>n. open(B n)" and open_cov: "\<And>S. open S \<Longrightarrow> \<exists>K. S = \<Union>(B ` K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>inj B; \<And>n. open (B n); \<And>S. open S \<Longrightarrow> \<exists>K. S = \<Union> (B ` K)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Setcompr_eq_image that univ_second_countable_sequence)
[PROOF STATE]
proof (state)
this:
inj B
open (B ?n)
open ?S \<Longrightarrow> \<exists>K. ?S = \<Union> (B ` K)

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define A where "A \<equiv> rec_nat S (\<lambda>n a. if \<exists>U. U \<subseteq> a \<and> closed U \<and> \<phi> U \<and> U \<inter> (B n) = {}
                                        then SOME U. U \<subseteq> a \<and> closed U \<and> \<phi> U \<and> U \<inter> (B n) = {}
                                        else a)"
[PROOF STATE]
proof (state)
this:
A \<equiv> rec_nat S (\<lambda>n a. if \<exists>U\<subseteq>a. closed U \<and> \<phi> U \<and> U \<inter> B n = {} then SOME U. U \<subseteq> a \<and> closed U \<and> \<phi> U \<and> U \<inter> B n = {} else a)

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have [simp]: "A 0 = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A 0 = S
[PROOF STEP]
by (simp add: A_def)
[PROOF STATE]
proof (state)
this:
A 0 = S

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have ASuc: "A(Suc n) = (if \<exists>U. U \<subseteq> A n \<and> closed U \<and> \<phi> U \<and> U \<inter> (B n) = {}
                          then SOME U. U \<subseteq> A n \<and> closed U \<and> \<phi> U \<and> U \<inter> (B n) = {}
                          else A n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A (Suc n) = (if \<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {} then SOME U. U \<subseteq> A n \<and> closed U \<and> \<phi> U \<and> U \<inter> B n = {} else A n)
[PROOF STEP]
by (auto simp: A_def)
[PROOF STATE]
proof (state)
this:
A (Suc ?n) = (if \<exists>U\<subseteq>A ?n. closed U \<and> \<phi> U \<and> U \<inter> B ?n = {} then SOME U. U \<subseteq> A ?n \<and> closed U \<and> \<phi> U \<and> U \<inter> B ?n = {} else A ?n)

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have sub: "\<And>n. A(Suc n) \<subseteq> A n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. A (Suc n) \<subseteq> A n
[PROOF STEP]
by (auto simp: ASuc dest!: someI_ex)
[PROOF STATE]
proof (state)
this:
A (Suc ?n) \<subseteq> A ?n

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have subS: "A n \<subseteq> S" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A n \<subseteq> S
[PROOF STEP]
by (induction n) (use sub in auto)
[PROOF STATE]
proof (state)
this:
A ?n \<subseteq> S

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have clo: "closed (A n) \<and> \<phi> (A n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (A n) \<and> \<phi> (A n)
[PROOF STEP]
by (induction n) (auto simp: assms ASuc dest!: someI_ex)
[PROOF STATE]
proof (state)
this:
closed (A ?n) \<and> \<phi> (A ?n)

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> S; closed T; \<phi> T; \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?T \<subseteq> S
 2. closed ?T
 3. \<phi> ?T
 4. \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> ?T
[PROOF STEP]
show "\<Inter>(range A) \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> (range A) \<subseteq> S
[PROOF STEP]
using \<open>\<And>n. A n \<subseteq> S\<close>
[PROOF STATE]
proof (prove)
using this:
A ?n \<subseteq> S

goal (1 subgoal):
 1. \<Inter> (range A) \<subseteq> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Inter> (range A) \<subseteq> S

goal (3 subgoals):
 1. closed (\<Inter> (range A))
 2. \<phi> (\<Inter> (range A))
 3. \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> \<Inter> (range A)
[PROOF STEP]
show "closed (\<Inter>(A ` UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (\<Inter> (range A))
[PROOF STEP]
using clo
[PROOF STATE]
proof (prove)
using this:
closed (A ?n) \<and> \<phi> (A ?n)

goal (1 subgoal):
 1. closed (\<Inter> (range A))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closed (\<Inter> (range A))

goal (2 subgoals):
 1. \<phi> (\<Inter> (range A))
 2. \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> \<Inter> (range A)
[PROOF STEP]
show "\<phi> (\<Inter>(A ` UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> (\<Inter> (range A))
[PROOF STEP]
by (simp add: clo \<phi> sub)
[PROOF STATE]
proof (state)
this:
\<phi> (\<Inter> (range A))

goal (1 subgoal):
 1. \<And>U. \<lbrakk>U \<subseteq> S; closed U; \<phi> U\<rbrakk> \<Longrightarrow> \<not> U \<subset> \<Inter> (range A)
[PROOF STEP]
show "\<not> U \<subset> \<Inter>(A ` UNIV)" if "U \<subseteq> S" "closed U" "\<phi> U" for U
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> U \<subset> \<Inter> (range A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> U \<subset> \<Inter> (range A)
[PROOF STEP]
have "\<exists>y. x \<notin> A y" if "x \<notin> U" and Usub: "U \<subseteq> (\<Inter>x. A x)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
obtain e where "e > 0" and e: "ball x e \<subseteq> -U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> - U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>closed U\<close> \<open>x \<notin> U\<close> openE [of "-U"]
[PROOF STATE]
proof (prove)
using this:
closed U
x \<notin> U
\<lbrakk>open (- U); ?x \<in> - U; \<And>e. \<lbrakk>0 < e; ball ?x e \<subseteq> - U\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> - U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<subseteq> - U

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<subseteq> - U

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
obtain K where K: "ball x e = \<Union>(B ` K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>K. ball x e = \<Union> (B ` K) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using open_cov [of "ball x e"]
[PROOF STATE]
proof (prove)
using this:
open (ball x e) \<Longrightarrow> \<exists>K. ball x e = \<Union> (B ` K)

goal (1 subgoal):
 1. (\<And>K. ball x e = \<Union> (B ` K) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball x e = \<Union> (B ` K)

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < e
ball x e \<subseteq> - U
ball x e = \<Union> (B ` K)
[PROOF STEP]
have "\<Union>(B ` K) \<subseteq> -U"
[PROOF STATE]
proof (prove)
using this:
0 < e
ball x e \<subseteq> - U
ball x e = \<Union> (B ` K)

goal (1 subgoal):
 1. \<Union> (B ` K) \<subseteq> - U
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> (B ` K) \<subseteq> - U

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
have "K \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<noteq> {}
[PROOF STEP]
using \<open>0 < e\<close> \<open>ball x e = \<Union>(B ` K)\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e
ball x e = \<Union> (B ` K)

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

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K \<noteq> {}
[PROOF STEP]
obtain n where "n \<in> K" "x \<in> B n"
[PROOF STATE]
proof (prove)
using this:
K \<noteq> {}

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>n \<in> K; x \<in> B n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis K UN_E \<open>0 < e\<close> centre_in_ball)
[PROOF STATE]
proof (state)
this:
n \<in> K
x \<in> B n

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<in> K
x \<in> B n
[PROOF STEP]
have "U \<inter> B n = {}"
[PROOF STATE]
proof (prove)
using this:
n \<in> K
x \<in> B n

goal (1 subgoal):
 1. U \<inter> B n = {}
[PROOF STEP]
using K e
[PROOF STATE]
proof (prove)
using this:
n \<in> K
x \<in> B n
ball x e = \<Union> (B ` K)
ball x e \<subseteq> - U

goal (1 subgoal):
 1. U \<inter> B n = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U \<inter> B n = {}

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
proof (cases "\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {} \<Longrightarrow> \<exists>y. x \<notin> A y
 2. \<not> (\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}) \<Longrightarrow> \<exists>y. x \<notin> A y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}

goal (2 subgoals):
 1. \<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {} \<Longrightarrow> \<exists>y. x \<notin> A y
 2. \<not> (\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}) \<Longrightarrow> \<exists>y. x \<notin> A y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
apply (rule_tac x="Suc n" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {} \<Longrightarrow> x \<notin> A (Suc n)
[PROOF STEP]
apply (simp add: ASuc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {} \<Longrightarrow> x \<notin> (SOME U. U \<subseteq> A n \<and> closed U \<and> \<phi> U \<and> U \<inter> B n = {})
[PROOF STEP]
apply (erule someI2_ex)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<subseteq> A n \<and> closed xa \<and> \<phi> xa \<and> xa \<inter> B n = {} \<Longrightarrow> x \<notin> xa
[PROOF STEP]
using \<open>x \<in> B n\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> B n

goal (1 subgoal):
 1. \<And>xa. xa \<subseteq> A n \<and> closed xa \<and> \<phi> xa \<and> xa \<inter> B n = {} \<Longrightarrow> x \<notin> xa
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y. x \<notin> A y

goal (1 subgoal):
 1. \<not> (\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}) \<Longrightarrow> \<exists>y. x \<notin> A y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}) \<Longrightarrow> \<exists>y. x \<notin> A y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {})

goal (1 subgoal):
 1. \<not> (\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {}) \<Longrightarrow> \<exists>y. x \<notin> A y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>U\<subseteq>A n. closed U \<and> \<phi> U \<and> U \<inter> B n = {})

goal (1 subgoal):
 1. \<exists>y. x \<notin> A y
[PROOF STEP]
by (meson Inf_lower Usub \<open>U \<inter> B n = {}\<close> \<open>\<phi> U\<close> \<open>closed U\<close> range_eqI subset_trans)
[PROOF STATE]
proof (state)
this:
\<exists>y. x \<notin> A y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y. x \<notin> A y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<notin> U; U \<subseteq> \<Inter> (range A)\<rbrakk> \<Longrightarrow> \<exists>y. ?x \<notin> A y

goal (1 subgoal):
 1. \<not> U \<subset> \<Inter> (range A)
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
U \<subseteq> S
closed U
\<phi> U
\<lbrakk>?x \<notin> U; U \<subseteq> \<Inter> (range A)\<rbrakk> \<Longrightarrow> \<exists>y. ?x \<notin> A y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
U \<subseteq> S
closed U
\<phi> U
\<lbrakk>?x \<notin> U; U \<subseteq> \<Inter> (range A)\<rbrakk> \<Longrightarrow> \<exists>y. ?x \<notin> A y

goal (1 subgoal):
 1. \<not> U \<subset> \<Inter> (range A)
[PROOF STEP]
by (meson Inter_iff psubsetE rangeI subsetI)
[PROOF STATE]
proof (state)
this:
\<not> U \<subset> \<Inter> (range A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?U \<subseteq> S; closed ?U; \<phi> ?U\<rbrakk> \<Longrightarrow> \<not> ?U \<subset> \<Inter> (range A)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma frechet_derivative_nth_derivative_commute:
  "frechet_derivative (\<lambda>x. nth_derivative i f x h) (at x) h =
    nth_derivative i (\<lambda>x. frechet_derivative f (at x) h) x h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative (\<lambda>x. nth_derivative i f x h) (at x) h = nth_derivative i (\<lambda>x. frechet_derivative f (at x) h) x h
[PROOF STEP]
by (induction i arbitrary: f) auto


[STATEMENT]
lemma real_is_int_add_int_of_real: "real_is_int a \<Longrightarrow> real_is_int b \<Longrightarrow> (int_of_real (a+b)) = (int_of_real a) + (int_of_real b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>real_is_int a; real_is_int b\<rbrakk> \<Longrightarrow> int_of_real (a + b) = int_of_real a + int_of_real b
[PROOF STEP]
by (auto simp add: int_of_real_def real_is_int_def)


[STATEMENT]
lemma cong_eq_0_not_coprime: "prime p \<Longrightarrow> [a = 0] (mod p) \<Longrightarrow> \<not>coprime a p" for a p :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; [a = 0] (mod p)\<rbrakk> \<Longrightarrow> \<not> coprime a p
[PROOF STEP]
unfolding cong_iff_dvd_diff prime_int_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < p \<and> (\<forall>m. 0 \<le> m \<and> m dvd p \<longrightarrow> m = 1 \<or> m = p); p dvd a - 0\<rbrakk> \<Longrightarrow> \<not> coprime a p
[PROOF STEP]
by auto


[STATEMENT]
lemma bex_Infinitesimal_iff: "(\<exists>y \<in> Infinitesimal. x - z = y) \<longleftrightarrow> x \<approx> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y\<in>Infinitesimal. x - z = y) = (x \<approx> z)
[PROOF STEP]
by (simp add: approx_def)


[STATEMENT]
lemma prime_dvd_fact_iff:
  assumes "prime p"
  shows "p dvd fact n \<longleftrightarrow> p \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p dvd fact n) = (p \<le> n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. (p dvd fact n) = (p \<le> n)
[PROOF STEP]
by (auto simp add: prime_factorization_subset_iff_dvd [symmetric]
    prime_factorization_prime prime_factors_fact prime_ge_2_nat)


[STATEMENT]
lemma integer_word16_bounded_eq:
   assumes "0 \<le> i"
    and "i \<le> 2 ^ LENGTH(16) - 1"
  shows "integer_of_word16 (word16_of_integer i) = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_word16 (word16_of_integer i) = i
[PROOF STEP]
unfolding word16_of_integer_def integer_of_word16_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_word (word_of_integer i) = i
[PROOF STEP]
using integer_word_bounded_eq assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?i; ?i \<le> 2 ^ LENGTH(?'a) - 1\<rbrakk> \<Longrightarrow> integer_of_word (word_of_integer ?i) = ?i
0 \<le> i
i \<le> 2 ^ LENGTH(16) - 1

goal (1 subgoal):
 1. integer_of_word (word_of_integer i) = i
[PROOF STEP]
by blast


[STATEMENT]
lemma det3_nonneg_scaleR_segment1:
  assumes "det3 x y z \<ge> 0"
  assumes "0 \<le> a" "a < 1"
  shows "det3 ((1 - a) *\<^sub>R x + a *\<^sub>R y) y z \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> det3 ((1 - a) *\<^sub>R x + a *\<^sub>R y) y z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> det3 ((1 - a) *\<^sub>R x + a *\<^sub>R y) y z
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> det3 x y z
0 \<le> a
a < 1
[PROOF STEP]
have "det3 0 ((1 - a) *\<^sub>R (y - x)) (z - x + (- a) *\<^sub>R (y - x)) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> det3 x y z
0 \<le> a
a < 1

goal (1 subgoal):
 1. 0 \<le> det3 0 ((1 - a) *\<^sub>R (y - x)) (z - x + - a *\<^sub>R (y - x))
[PROOF STEP]
by (subst det3_nonneg_scaleR1_eq) (auto simp add: det3_def' algebra_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> det3 0 ((1 - a) *\<^sub>R (y - x)) (z - x + - a *\<^sub>R (y - x))

goal (1 subgoal):
 1. 0 \<le> det3 ((1 - a) *\<^sub>R x + a *\<^sub>R y) y z
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> det3 0 ((1 - a) *\<^sub>R (y - x)) (z - x + - a *\<^sub>R (y - x))

goal (1 subgoal):
 1. 0 \<le> det3 ((1 - a) *\<^sub>R x + a *\<^sub>R y) y z
[PROOF STEP]
by (auto simp: algebra_simps det3_translate_origin)
[PROOF STATE]
proof (state)
this:
0 \<le> det3 ((1 - a) *\<^sub>R x + a *\<^sub>R y) y z

goal:
No subgoals!
[PROOF STEP]
qed