[STATEMENT]
lemma fin_dim_kernel_berlekamp: "V.fin_dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V.fin_dim
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. V.fin_dim
[PROOF STEP]
have "finite (set (find_base_vectors (berlekamp_resulting_mat u)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set (find_base_vectors (berlekamp_resulting_mat u)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (set (find_base_vectors (berlekamp_resulting_mat u)))

goal (1 subgoal):
 1. V.fin_dim
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (set (find_base_vectors (berlekamp_resulting_mat u)))

goal (1 subgoal):
 1. V.fin_dim
[PROOF STEP]
have "set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V"
  and "V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V &&& V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u)))
[PROOF STEP]
using berlekamp_resulting_mat_basis[of u]
[PROOF STATE]
proof (prove)
using this:
V.basis (set (find_base_vectors (berlekamp_resulting_mat u)))

goal (1 subgoal):
 1. set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V &&& V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u)))
[PROOF STEP]
unfolding V.basis_def
[PROOF STATE]
proof (prove)
using this:
V.lin_indpt (set (find_base_vectors (berlekamp_resulting_mat u))) \<and> V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u))) \<and> set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V

goal (1 subgoal):
 1. set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V &&& V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V
V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u)))

goal (1 subgoal):
 1. V.fin_dim
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (set (find_base_vectors (berlekamp_resulting_mat u)))
set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V
V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (set (find_base_vectors (berlekamp_resulting_mat u)))
set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V
V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u)))

goal (1 subgoal):
 1. V.fin_dim
[PROOF STEP]
unfolding V.fin_dim_def
[PROOF STATE]
proof (prove)
using this:
finite (set (find_base_vectors (berlekamp_resulting_mat u)))
set (find_base_vectors (berlekamp_resulting_mat u)) \<subseteq> carrier V
V.gen_set (set (find_base_vectors (berlekamp_resulting_mat u)))

goal (1 subgoal):
 1. \<exists>A. finite A \<and> A \<subseteq> carrier V \<and> V.gen_set A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V.fin_dim

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filterlim_at_top_add_at_top:
  assumes f: "LIM x F. f x :> at_top"
    and g: "LIM x F. g x :> at_top"
  shows "LIM x F. (f x + g x :: real) :> at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x F. f x + g x :> at_top
[PROOF STEP]
unfolding filterlim_at_top_gt[where c=0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Z>0. \<forall>\<^sub>F x in F. Z \<le> f x + g x
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x + g x
[PROOF STEP]
fix Z :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x + g x
[PROOF STEP]
assume "0 < Z"
[PROOF STATE]
proof (state)
this:
0 < Z

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x + g x
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top F
[PROOF STEP]
have "eventually (\<lambda>x. 0 \<le> f x) F"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 \<le> f x
[PROOF STEP]
unfolding filterlim_at_top
[PROOF STATE]
proof (prove)
using this:
\<forall>Z. \<forall>\<^sub>F x in F. Z \<le> f x

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

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x + g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. 0 \<le> f x

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x + g x
[PROOF STEP]
from g
[PROOF STATE]
proof (chain)
picking this:
filterlim g at_top F
[PROOF STEP]
have "eventually (\<lambda>x. Z \<le> g x) F"
[PROOF STATE]
proof (prove)
using this:
filterlim g at_top F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z \<le> g x
[PROOF STEP]
unfolding filterlim_at_top
[PROOF STATE]
proof (prove)
using this:
\<forall>Z. \<forall>\<^sub>F x in F. Z \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z \<le> g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. Z \<le> g x

goal (1 subgoal):
 1. \<And>Z. 0 < Z \<Longrightarrow> \<forall>\<^sub>F x in F. Z \<le> f x + g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. 0 \<le> f x
\<forall>\<^sub>F x in F. Z \<le> g x
[PROOF STEP]
show "eventually (\<lambda>x. Z \<le> f x + g x) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. 0 \<le> f x
\<forall>\<^sub>F x in F. Z \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. Z \<le> f x + g x
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. Z \<le> f x + g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma round_Re_minimises_norm:
  "norm ((z::complex) - of_int m) \<ge> norm (z - of_int (round (Re z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
let ?n = "round (Re z)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
have "norm (z - of_int ?n) = sqrt ((Re z - of_int ?n)\<^sup>2 + (Im z)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) = sqrt ((Re z - real_of_int (round (Re z)))\<^sup>2 + (Im z)\<^sup>2)
[PROOF STEP]
by (simp add: cmod_def)
[PROOF STATE]
proof (state)
this:
cmod (z - of_int (round (Re z))) = sqrt ((Re z - real_of_int (round (Re z)))\<^sup>2 + (Im z)\<^sup>2)

goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (z - of_int (round (Re z))) = sqrt ((Re z - real_of_int (round (Re z)))\<^sup>2 + (Im z)\<^sup>2)

goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
have "\<bar>Re z - of_int ?n\<bar> \<le> \<bar>Re z - of_int m\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Re z - real_of_int (round (Re z))\<bar> \<le> \<bar>Re z - real_of_int m\<bar>
[PROOF STEP]
by (rule round_diff_minimal)
[PROOF STATE]
proof (state)
this:
\<bar>Re z - real_of_int (round (Re z))\<bar> \<le> \<bar>Re z - real_of_int m\<bar>

goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
hence "sqrt ((Re z - of_int ?n)\<^sup>2 + (Im z)\<^sup>2) \<le> sqrt ((Re z - of_int m)\<^sup>2 + (Im z)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
\<bar>Re z - real_of_int (round (Re z))\<bar> \<le> \<bar>Re z - real_of_int m\<bar>

goal (1 subgoal):
 1. sqrt ((Re z - real_of_int (round (Re z)))\<^sup>2 + (Im z)\<^sup>2) \<le> sqrt ((Re z - real_of_int m)\<^sup>2 + (Im z)\<^sup>2)
[PROOF STEP]
by (intro real_sqrt_le_mono add_mono) (simp_all add: abs_le_square_iff)
[PROOF STATE]
proof (state)
this:
sqrt ((Re z - real_of_int (round (Re z)))\<^sup>2 + (Im z)\<^sup>2) \<le> sqrt ((Re z - real_of_int m)\<^sup>2 + (Im z)\<^sup>2)

goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt ((Re z - real_of_int (round (Re z)))\<^sup>2 + (Im z)\<^sup>2) \<le> sqrt ((Re z - real_of_int m)\<^sup>2 + (Im z)\<^sup>2)

goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
have "\<dots> = norm (z - of_int m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt ((Re z - real_of_int m)\<^sup>2 + (Im z)\<^sup>2) = cmod (z - of_int m)
[PROOF STEP]
by (simp add: cmod_def)
[PROOF STATE]
proof (state)
this:
sqrt ((Re z - real_of_int m)\<^sup>2 + (Im z)\<^sup>2) = cmod (z - of_int m)

goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)

goal (1 subgoal):
 1. cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (z - of_int (round (Re z))) \<le> cmod (z - of_int m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_4: "{..<4::nat} = {0,1,2,3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<4} = {0, 1, 2, 3}
[PROOF STEP]
by auto


[STATEMENT]
lemma size_filter_unsat_elem:
  assumes "x \<in># M" and "\<not> P x"
  shows "size {#x \<in># M. P x#} < size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset P M) < size M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size (filter_mset P M) < size M
[PROOF STEP]
have "size (filter_mset P M) \<noteq> size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset P M) \<noteq> size M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in># M
\<not> P x

goal (1 subgoal):
 1. size (filter_mset P M) \<noteq> size M
[PROOF STEP]
by (metis add.right_neutral add_diff_cancel_left' count_filter_mset mem_Collect_eq
      multiset_partition nonempty_has_size set_mset_def size_union)
[PROOF STATE]
proof (state)
this:
size (filter_mset P M) \<noteq> size M

goal (1 subgoal):
 1. size (filter_mset P M) < size M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
size (filter_mset P M) \<noteq> size M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
size (filter_mset P M) \<noteq> size M

goal (1 subgoal):
 1. size (filter_mset P M) < size M
[PROOF STEP]
by (meson leD nat_neq_iff size_filter_mset_lesseq)
[PROOF STATE]
proof (state)
this:
size (filter_mset P M) < size M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_compose: "g \<midarrow>l\<rightarrow> g l \<Longrightarrow> (f \<longlongrightarrow> l) F \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g \<midarrow>l\<rightarrow> g l; (f \<longlongrightarrow> l) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F
[PROOF STEP]
unfolding tendsto_at_iff_tendsto_nhds
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(g \<longlongrightarrow> g l) (nhds l); (f \<longlongrightarrow> l) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. g (f x)) \<longlongrightarrow> g l) F
[PROOF STEP]
by (rule filterlim_compose[of g])


[STATEMENT]
lemma fls_mult_assoc_subdegree_ge_0:
  fixes   f g h :: "'a::semiring_0 fls"
  assumes "fls_subdegree f \<ge> 0" "fls_subdegree g \<ge> 0" "fls_subdegree h \<ge> 0"
  shows   "f * g * h = f * (g * h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * g * h = f * (g * h)
[PROOF STEP]
using   assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree f
0 \<le> fls_subdegree g
0 \<le> fls_subdegree h

goal (1 subgoal):
 1. f * g * h = f * (g * h)
[PROOF STEP]
by      (simp add: fls_times_conv_fps_times fls_subdegree_fls_to_fps_gt0 mult.assoc)


[STATEMENT]
lemma gbinomial_Suc_rec:
  "(x gchoose (Suc k)) = (x gchoose k) * ((x - of_nat k) / (of_nat k + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x gchoose Suc k = (x gchoose k) * ((x - of_nat k) / (of_nat k + (1::'a)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x gchoose Suc k = (x gchoose k) * ((x - of_nat k) / (of_nat k + (1::'a)))
[PROOF STEP]
have "((x - 1) + 1) gchoose (Suc k) = x * (x - 1 gchoose k) / (1 + of_nat k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - (1::'a) + (1::'a) gchoose Suc k = x * (x - (1::'a) gchoose k) / ((1::'a) + of_nat k)
[PROOF STEP]
by (subst gbinomial_factors) simp
[PROOF STATE]
proof (state)
this:
x - (1::'a) + (1::'a) gchoose Suc k = x * (x - (1::'a) gchoose k) / ((1::'a) + of_nat k)

goal (1 subgoal):
 1. x gchoose Suc k = (x gchoose k) * ((x - of_nat k) / (of_nat k + (1::'a)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x - (1::'a) + (1::'a) gchoose Suc k = x * (x - (1::'a) gchoose k) / ((1::'a) + of_nat k)

goal (1 subgoal):
 1. x gchoose Suc k = (x gchoose k) * ((x - of_nat k) / (of_nat k + (1::'a)))
[PROOF STEP]
have "x * (x - 1 gchoose k) = (x - of_nat k) * (x gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * (x - (1::'a) gchoose k) = (x - of_nat k) * (x gchoose k)
[PROOF STEP]
by (rule gbinomial_absorb_comp [symmetric])
[PROOF STATE]
proof (state)
this:
x * (x - (1::'a) gchoose k) = (x - of_nat k) * (x gchoose k)

goal (1 subgoal):
 1. x gchoose Suc k = (x gchoose k) * ((x - of_nat k) / (of_nat k + (1::'a)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x - (1::'a) + (1::'a) gchoose Suc k = (x - of_nat k) * (x gchoose k) / ((1::'a) + of_nat k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x - (1::'a) + (1::'a) gchoose Suc k = (x - of_nat k) * (x gchoose k) / ((1::'a) + of_nat k)

goal (1 subgoal):
 1. x gchoose Suc k = (x gchoose k) * ((x - of_nat k) / (of_nat k + (1::'a)))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
x gchoose Suc k = (x gchoose k) * ((x - of_nat k) / (of_nat k + (1::'a)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma adj_relation_sym: "sym adj_relation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym adj_relation
[PROOF STEP]
unfolding adj_relation_def sym_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(u, v) |u v. vert_adj u v} \<longrightarrow> (y, x) \<in> {(u, v) |u v. vert_adj u v}
[PROOF STEP]
using vert_adj_sym
[PROOF STATE]
proof (prove)
using this:
vert_adj ?v1.0 ?v2.0 = vert_adj ?v2.0 ?v1.0

goal (1 subgoal):
 1. \<forall>x y. (x, y) \<in> {(u, v) |u v. vert_adj u v} \<longrightarrow> (y, x) \<in> {(u, v) |u v. vert_adj u v}
[PROOF STEP]
by auto


[STATEMENT]
lemma complete_algebra_summable_geometric:
  fixes x :: "'a::{real_normed_algebra_1,banach}"
  assumes "norm x < 1"
  shows "summable (\<lambda>n. x ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable ((^) x)
[PROOF STEP]
proof (rule summable_comparison_test)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>N. \<forall>n\<ge>N. norm (x ^ n) \<le> ?g n
 2. summable ?g
[PROOF STEP]
show "\<exists>N. \<forall>n\<ge>N. norm (x ^ n) \<le> norm x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. norm (x ^ n) \<le> norm x ^ n
[PROOF STEP]
by (simp add: norm_power_ineq)
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. norm (x ^ n) \<le> norm x ^ n

goal (1 subgoal):
 1. summable ((^) (norm x))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
norm x < 1
[PROOF STEP]
show "summable (\<lambda>n. norm x ^ n)"
[PROOF STATE]
proof (prove)
using this:
norm x < 1

goal (1 subgoal):
 1. summable ((^) (norm x))
[PROOF STEP]
by (simp add: summable_geometric)
[PROOF STATE]
proof (state)
this:
summable ((^) (norm x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_subset_eq_mono_add_right_cancel: "(A::'a multiset) + C \<subseteq># B + C \<longleftrightarrow> A \<subseteq># B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A + C \<subseteq># B + C) = (A \<subseteq># B)
[PROOF STEP]
by (fact subset_mset.add_le_cancel_right)


[STATEMENT]
lemma embedding_map_imp_homeomorphic_space:
   "embedding_map X Y f \<Longrightarrow> X homeomorphic_space (subtopology Y (f ` (topspace X)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. embedding_map X Y f \<Longrightarrow> X homeomorphic_space subtopology Y (f ` topspace X)
[PROOF STEP]
unfolding embedding_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X (subtopology Y (f ` topspace X)) f \<Longrightarrow> X homeomorphic_space subtopology Y (f ` topspace X)
[PROOF STEP]
using homeomorphic_space
[PROOF STATE]
proof (prove)
using this:
(?X homeomorphic_space ?Y) = (\<exists>f. homeomorphic_map ?X ?Y f)

goal (1 subgoal):
 1. homeomorphic_map X (subtopology Y (f ` topspace X)) f \<Longrightarrow> X homeomorphic_space subtopology Y (f ` topspace X)
[PROOF STEP]
by blast


[STATEMENT]
lemma ln_mult: "0 < x \<Longrightarrow> 0 < y \<Longrightarrow> ln (x * y) = ln x + ln y"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; 0 < y\<rbrakk> \<Longrightarrow> ln (x * y) = ln x + ln y
[PROOF STEP]
by (rule ln_unique) (simp add: exp_add)


[STATEMENT]
lemma len_lexext_total: "(\<forall>y \<in> B. \<forall>x \<in> A. gt y x \<or> gt x y \<or> y = x) \<Longrightarrow> ys \<in> lists B \<Longrightarrow> xs \<in> lists A \<Longrightarrow>
  len_lexext gt ys xs \<or> len_lexext gt xs ys \<or> ys = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y\<in>B. \<forall>x\<in>A. gt y x \<or> gt x y \<or> y = x; ys \<in> lists B; xs \<in> lists A\<rbrakk> \<Longrightarrow> len_lexext gt ys xs \<or> len_lexext gt xs ys \<or> ys = xs
[PROOF STEP]
by (rule lenext_total[OF lexext_total])


[STATEMENT]
theorem
  assumes C: "cont f"
  shows "lfp (\<lambda>x. sup m (f x)) = (SUP i. (f^^i) m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp (\<lambda>x. sup m (f x)) = (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (subst gen_kleene_chain_conv[OF C])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp (\<lambda>x. sup m (f x)) = (SUP i. ((\<lambda>x. sup m (f x)) ^^ i) bot)
[PROOF STEP]
apply (rule kleene_lfp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cont (\<lambda>x. sup m (f x))
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
cont f

goal (1 subgoal):
 1. cont (\<lambda>x. sup m (f x))
[PROOF STEP]
unfolding cont_def
[PROOF STATE]
proof (prove)
using this:
\<forall>C. C \<noteq> {} \<longrightarrow> f (Sup C) = Sup (f ` C)

goal (1 subgoal):
 1. \<forall>C. C \<noteq> {} \<longrightarrow> sup m (f (Sup C)) = (SUP x\<in>C. sup m (f x))
[PROOF STEP]
apply (simp add: SUP_sup_distrib[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in group_add) uminus_sum_list_alternating_order2:
  "s+s=0 \<Longrightarrow> t+t=0 \<Longrightarrow> - sum_list (alternating_list n s t) =
    sum_list (if even n then alternating_list n t s else alternating_list n s t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s + s = (0::'a); t + t = (0::'a)\<rbrakk> \<Longrightarrow> - sum_list (alternating_list n s t) = sum_list (if even n then alternating_list n t s else alternating_list n s t)
[PROOF STEP]
using uminus_sum_list_order2 set_alternating_list[of n] rev_alternating_list[of n s]
[PROOF STATE]
proof (prove)
using this:
\<forall>s\<in>set ?ss. s + s = (0::'a) \<Longrightarrow> - sum_list ?ss = sum_list (rev ?ss)
set (alternating_list n ?s ?t) \<subseteq> {?s, ?t}
rev (alternating_list n s ?t) = (if even n then alternating_list n ?t s else alternating_list n s ?t)

goal (1 subgoal):
 1. \<lbrakk>s + s = (0::'a); t + t = (0::'a)\<rbrakk> \<Longrightarrow> - sum_list (alternating_list n s t) = sum_list (if even n then alternating_list n t s else alternating_list n s t)
[PROOF STEP]
by    fastforce


[STATEMENT]
lemma pred_0 [simp]: "pred 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pred 0 = 0
[PROOF STEP]
by (simp add: pred_def)


[STATEMENT]
lemma quotient_of_square: assumes "quotient_of x = (a,b)"
  shows "quotient_of (x * x) = (a * a, b * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_of (x * x) = (a * a, b * b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. quotient_of (x * x) = (a * a, b * b)
[PROOF STEP]
have b0: "b > 0" "b \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b &&& b \<noteq> 0
[PROOF STEP]
using quotient_of_denom_pos[OF assms]
[PROOF STATE]
proof (prove)
using this:
0 < b

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

goal (1 subgoal):
 1. quotient_of (x * x) = (a * a, b * b)
[PROOF STEP]
hence b: "(b * b > 0) = True"
[PROOF STATE]
proof (prove)
using this:
0 < b
b \<noteq> 0

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

goal (1 subgoal):
 1. quotient_of (x * x) = (a * a, b * b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_of (x * x) = (a * a, b * b)
[PROOF STEP]
unfolding rat_times_code assms Let_def split Rat.normalize_def fst_conv snd_conv b if_True
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * a div gcd (a * a) (b * b), b * b div gcd (a * a) (b * b)) = (a * a, b * b)
[PROOF STEP]
using quotient_of_coprime[OF assms] b0
[PROOF STATE]
proof (prove)
using this:
algebraic_semidom_class.coprime a b
0 < b
b \<noteq> 0

goal (1 subgoal):
 1. (a * a div gcd (a * a) (b * b), b * b div gcd (a * a) (b * b)) = (a * a, b * b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
quotient_of (x * x) = (a * a, b * b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lowner_le_swap:
  assumes "A \<in> carrier_mat n n" "B \<in> carrier_mat n n"
    and "A \<le>\<^sub>L B"
  shows "-B \<le>\<^sub>L -A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - B \<le>\<^sub>L - A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - B \<le>\<^sub>L - A
[PROOF STEP]
have "positive (B - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positive (B - A)
[PROOF STEP]
using assms lowner_le_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
A \<le>\<^sub>L B
(?A \<le>\<^sub>L ?B) = (dim_row ?A = dim_row ?B \<and> dim_col ?A = dim_col ?B \<and> positive (?B - ?A))

goal (1 subgoal):
 1. positive (B - A)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
positive (B - A)

goal (1 subgoal):
 1. - B \<le>\<^sub>L - A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
positive (B - A)

goal (1 subgoal):
 1. - B \<le>\<^sub>L - A
[PROOF STEP]
have "B - A = (-A) - (-B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B - A = - A - - B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
A \<le>\<^sub>L B

goal (1 subgoal):
 1. B - A = - A - - B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
B - A = - A - - B

goal (1 subgoal):
 1. - B \<le>\<^sub>L - A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
positive (B - A)
B - A = - A - - B
[PROOF STEP]
have "positive ((-A) - (-B))"
[PROOF STATE]
proof (prove)
using this:
positive (B - A)
B - A = - A - - B

goal (1 subgoal):
 1. positive (- A - - B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
positive (- A - - B)

goal (1 subgoal):
 1. - B \<le>\<^sub>L - A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
positive (- A - - B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
positive (- A - - B)

goal (1 subgoal):
 1. - B \<le>\<^sub>L - A
[PROOF STEP]
using lowner_le_def assms
[PROOF STATE]
proof (prove)
using this:
positive (- A - - B)
(?A \<le>\<^sub>L ?B) = (dim_row ?A = dim_row ?B \<and> dim_col ?A = dim_col ?B \<and> positive (?B - ?A))
A \<in> carrier_mat n n
B \<in> carrier_mat n n
A \<le>\<^sub>L B

goal (1 subgoal):
 1. - B \<le>\<^sub>L - A
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
- B \<le>\<^sub>L - A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bdd_lookup_quantify_bdd_set_of_bv:
  assumes "length w = n"
  and "bddh (Suc n) bdd"
  and "bdd_all (nfa_is_node N) bdd"
  and "v \<le> n"
  shows "set_of_bv (bdd_lookup (quantify_bdd v bdd) w) = (\<Union>b. set_of_bv (bdd_lookup bdd (insertl v b w)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of_bv (bdd_lookup (quantify_bdd v bdd) w) = (\<Union>b. set_of_bv (bdd_lookup bdd (insertl v b w)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length w = n
bddh (Suc n) bdd
bdd_all (nfa_is_node N) bdd
v \<le> n

goal (1 subgoal):
 1. set_of_bv (bdd_lookup (quantify_bdd v bdd) w) = (\<Union>b. set_of_bv (bdd_lookup bdd (insertl v b w)))
[PROOF STEP]
proof (induct v bdd arbitrary: n w rule: quantify_bdd.induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
case (2 l r w)
[PROOF STATE]
proof (state)
this:
length w = wa__
bddh (Suc wa__) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
0 \<le> wa__

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
hence N: "nfa_is_node N (bdd_lookup l w)" "nfa_is_node N (bdd_lookup r w)"
[PROOF STATE]
proof (prove)
using this:
length w = wa__
bddh (Suc wa__) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
0 \<le> wa__

goal (1 subgoal):
 1. nfa_is_node N (bdd_lookup l w) &&& nfa_is_node N (bdd_lookup r w)
[PROOF STEP]
by (simp add: bdd_all_bdd_lookup)+
[PROOF STATE]
proof (state)
this:
nfa_is_node N (bdd_lookup l w)
nfa_is_node N (bdd_lookup r w)

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
have "set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = set_of_bv (bdd_lookup (bdd_binop bv_or l r) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = set_of_bv (bdd_lookup (bdd_binop bv_or l r) w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = set_of_bv (bdd_lookup (bdd_binop bv_or l r) w)

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = set_of_bv (bdd_lookup (bdd_binop bv_or l r) w)

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
from 2
[PROOF STATE]
proof (chain)
picking this:
length w = wa__
bddh (Suc wa__) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
0 \<le> wa__
[PROOF STEP]
have "\<dots> = set_of_bv (bv_or (bdd_lookup l w) (bdd_lookup r w))"
[PROOF STATE]
proof (prove)
using this:
length w = wa__
bddh (Suc wa__) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
0 \<le> wa__

goal (1 subgoal):
 1. set_of_bv (bdd_lookup (bdd_binop bv_or l r) w) = set_of_bv (bv_or (bdd_lookup l w) (bdd_lookup r w))
[PROOF STEP]
by (simp add: bdd_lookup_binop)
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup (bdd_binop bv_or l r) w) = set_of_bv (bv_or (bdd_lookup l w) (bdd_lookup r w))

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup (bdd_binop bv_or l r) w) = set_of_bv (bv_or (bdd_lookup l w) (bdd_lookup r w))

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
from N
[PROOF STATE]
proof (chain)
picking this:
nfa_is_node N (bdd_lookup l w)
nfa_is_node N (bdd_lookup r w)
[PROOF STEP]
have "\<dots> = set_of_bv (bdd_lookup l w) \<union> set_of_bv (bdd_lookup r w)"
[PROOF STATE]
proof (prove)
using this:
nfa_is_node N (bdd_lookup l w)
nfa_is_node N (bdd_lookup r w)

goal (1 subgoal):
 1. set_of_bv (bv_or (bdd_lookup l w) (bdd_lookup r w)) = set_of_bv (bdd_lookup l w) \<union> set_of_bv (bdd_lookup r w)
[PROOF STEP]
by (simp add: bv_or_set_of_bv)
[PROOF STATE]
proof (state)
this:
set_of_bv (bv_or (bdd_lookup l w) (bdd_lookup r w)) = set_of_bv (bdd_lookup l w) \<union> set_of_bv (bdd_lookup r w)

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_of_bv (bv_or (bdd_lookup l w) (bdd_lookup r w)) = set_of_bv (bdd_lookup l w) \<union> set_of_bv (bdd_lookup r w)

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
have "\<dots> = set_of_bv (bdd_lookup (Branch l r) (insertl 0 False w)) \<union> set_of_bv (bdd_lookup (Branch l r) (insertl 0 True w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of_bv (bdd_lookup l w) \<union> set_of_bv (bdd_lookup r w) = set_of_bv (bdd_lookup (Branch l r) (insertl 0 False w)) \<union> set_of_bv (bdd_lookup (Branch l r) (insertl 0 True w))
[PROOF STEP]
by (cases w) simp+
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup l w) \<union> set_of_bv (bdd_lookup r w) = set_of_bv (bdd_lookup (Branch l r) (insertl 0 False w)) \<union> set_of_bv (bdd_lookup (Branch l r) (insertl 0 True w))

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup l w) \<union> set_of_bv (bdd_lookup r w) = set_of_bv (bdd_lookup (Branch l r) (insertl 0 False w)) \<union> set_of_bv (bdd_lookup (Branch l r) (insertl 0 True w))

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
have "\<dots> = (\<Union>b \<in> {True, False}. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of_bv (bdd_lookup (Branch l r) (insertl 0 False w)) \<union> set_of_bv (bdd_lookup (Branch l r) (insertl 0 True w)) = (\<Union>b\<in>{True, False}. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup (Branch l r) (insertl 0 False w)) \<union> set_of_bv (bdd_lookup (Branch l r) (insertl 0 True w)) = (\<Union>b\<in>{True, False}. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup (Branch l r) (insertl 0 False w)) \<union> set_of_bv (bdd_lookup (Branch l r) (insertl 0 True w)) = (\<Union>b\<in>{True, False}. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
have "\<dots> = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>b\<in>{True, False}. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w))) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>b\<in>{True, False}. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w))) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))

goal (3 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>l r n w. \<lbrakk>length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); 0 \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
 3. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))

goal (1 subgoal):
 1. set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup (quantify_bdd 0 (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl 0 b w)))

goal (2 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
case (3 n l r k w)
[PROOF STATE]
proof (state)
this:
\<lbrakk>length ?w = ?n; bddh (Suc ?n) l; bdd_all (nfa_is_node N) l; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n l) ?w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl n b ?w)))
\<lbrakk>length ?w = ?n; bddh (Suc ?n) r; bdd_all (nfa_is_node N) r; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n r) ?w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl n b ?w)))
length w = k
bddh (Suc k) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
Suc n \<le> k

goal (2 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length ?w = ?n; bddh (Suc ?n) l; bdd_all (nfa_is_node N) l; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n l) ?w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl n b ?w)))
\<lbrakk>length ?w = ?n; bddh (Suc ?n) r; bdd_all (nfa_is_node N) r; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n r) ?w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl n b ?w)))
length w = k
bddh (Suc k) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
Suc n \<le> k
[PROOF STEP]
obtain j where J: "k = Suc j"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?w = ?n; bddh (Suc ?n) l; bdd_all (nfa_is_node N) l; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n l) ?w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl n b ?w)))
\<lbrakk>length ?w = ?n; bddh (Suc ?n) r; bdd_all (nfa_is_node N) r; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n r) ?w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl n b ?w)))
length w = k
bddh (Suc k) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
Suc n \<le> k

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

goal (2 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
with 3
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length ?w = ?n; bddh (Suc ?n) l; bdd_all (nfa_is_node N) l; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n l) ?w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl n b ?w)))
\<lbrakk>length ?w = ?n; bddh (Suc ?n) r; bdd_all (nfa_is_node N) r; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n r) ?w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl n b ?w)))
length w = k
bddh (Suc k) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
Suc n \<le> k
k = Suc j
[PROOF STEP]
obtain a as where W: "w = a # as"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?w = ?n; bddh (Suc ?n) l; bdd_all (nfa_is_node N) l; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n l) ?w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl n b ?w)))
\<lbrakk>length ?w = ?n; bddh (Suc ?n) r; bdd_all (nfa_is_node N) r; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n r) ?w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl n b ?w)))
length w = k
bddh (Suc k) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
Suc n \<le> k
k = Suc j

goal (1 subgoal):
 1. (\<And>a as. w = a # as \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases w) auto
[PROOF STATE]
proof (state)
this:
w = a # as

goal (2 subgoals):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
 2. \<And>i l r n w. \<lbrakk>\<And>n w. \<lbrakk>length w = n; bddh (Suc n) l; bdd_all (nfa_is_node N) l; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i l) w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl i b w))); \<And>n w. \<lbrakk>length w = n; bddh (Suc n) r; bdd_all (nfa_is_node N) r; i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i r) w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl i b w))); length w = n; bddh (Suc n) (Branch l r); bdd_all (nfa_is_node N) (Branch l r); Suc i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd (Suc i) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc i) b w)))
[PROOF STEP]
with 3 J
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length ?w = ?n; bddh (Suc ?n) l; bdd_all (nfa_is_node N) l; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n l) ?w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl n b ?w)))
\<lbrakk>length ?w = ?n; bddh (Suc ?n) r; bdd_all (nfa_is_node N) r; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n r) ?w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl n b ?w)))
length w = k
bddh (Suc k) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
Suc n \<le> k
k = Suc j
w = a # as
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?w = ?n; bddh (Suc ?n) l; bdd_all (nfa_is_node N) l; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n l) ?w) = (\<Union>b. set_of_bv (bdd_lookup l (insertl n b ?w)))
\<lbrakk>length ?w = ?n; bddh (Suc ?n) r; bdd_all (nfa_is_node N) r; n \<le> ?n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd n r) ?w) = (\<Union>b. set_of_bv (bdd_lookup r (insertl n b ?w)))
length w = k
bddh (Suc k) (Branch l r)
bdd_all (nfa_is_node N) (Branch l r)
Suc n \<le> k
k = Suc j
w = a # as

goal (1 subgoal):
 1. set_of_bv (bdd_lookup (quantify_bdd (Suc n) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc n) b w)))
[PROOF STEP]
by (cases a) simp+
[PROOF STATE]
proof (state)
this:
set_of_bv (bdd_lookup (quantify_bdd (Suc n) (Branch l r)) w) = (\<Union>b. set_of_bv (bdd_lookup (Branch l r) (insertl (Suc n) b w)))

goal (1 subgoal):
 1. \<And>i q n w. \<lbrakk>length w = n; bddh (Suc n) (Leaf q); bdd_all (nfa_is_node N) (Leaf q); i \<le> n\<rbrakk> \<Longrightarrow> set_of_bv (bdd_lookup (quantify_bdd i (Leaf q)) w) = (\<Union>b. set_of_bv (bdd_lookup (Leaf q) (insertl i b w)))
[PROOF STEP]
qed simp


[STATEMENT]
theorem card_partition_on_size1:
  assumes "finite A"
  shows "card {P. partition_on A P \<and> (\<forall>X\<in>P. card X = 1)} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {P. partition_on A P \<and> (\<forall>X\<in>P. card X = 1)} = 1
[PROOF STEP]
using assms partition_on_size1
[PROOF STATE]
proof (prove)
using this:
finite A
finite ?A \<Longrightarrow> {P. partition_on ?A P \<and> (\<forall>X\<in>P. card X = 1)} = {(\<lambda>a. {a}) ` ?A}

goal (1 subgoal):
 1. card {P. partition_on A P \<and> (\<forall>X\<in>P. card X = 1)} = 1
[PROOF STEP]
by fastforce


[STATEMENT]
lemma homeomorphic_eq_everything_map:
   "homeomorphic_map X Y f \<longleftrightarrow>
        continuous_map X Y f \<and> open_map X Y f \<and> closed_map X Y f \<and>
        f ` (topspace X) = topspace Y \<and> inj_on f (topspace X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X Y f = (continuous_map X Y f \<and> open_map X Y f \<and> closed_map X Y f \<and> f ` topspace X = topspace Y \<and> inj_on f (topspace X))
[PROOF STEP]
unfolding homeomorphic_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (quotient_map X Y f \<and> inj_on f (topspace X)) = (continuous_map X Y f \<and> open_map X Y f \<and> closed_map X Y f \<and> f ` topspace X = topspace Y \<and> inj_on f (topspace X))
[PROOF STEP]
by (force simp: injective_quotient_map intro: injective_quotient_map)


[STATEMENT]
lemma fib_Cassini_int: "int (fib (Suc (Suc n)) * fib n) - int((fib (Suc n))\<^sup>2) = - ((-1)^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (fib (Suc (Suc n)) * fib n) - int ((fib (Suc n))\<^sup>2) = - ((- 1) ^ n)
[PROOF STEP]
by (induct n rule: fib.induct) (auto simp add: field_simps power2_eq_square power_add)


[STATEMENT]
lemma "2 ^ 12 = (4096::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ 12 = 4096
[PROOF STEP]
by simp


[STATEMENT]
lemma setprod_one [simp]:
  fixes n::nat
  shows "(\<Prod>i < n. Suc 0) = Suc 0"
    "(\<Prod>i \<le> n. Suc 0) = Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i<n. Suc 0) = Suc 0 &&& (\<Prod>i\<le>n. Suc 0) = Suc 0
[PROOF STEP]
by (induct n) (simp_all)


[STATEMENT]
lemma dim_tangent_space_src_dest_eq: "dim (src.tangent_space p) = dim (dest.tangent_space (f p))"
  if p: "p \<in> src.carrier" and "dim (dest.tangent_space (f p)) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
from dest.tangent_space.dim_pos_finite_dimensional_vector_spaceE[
      unfolded dest.tangent_space_dim_eq[OF order_refl],
      OF that(2)]
[PROOF STATE]
proof (chain)
picking this:
(\<And>basis. \<lbrakk>basis \<subseteq> dest.tangent_space (f p); finite_dimensional_vector_space_on_with (dest.tangent_space (f p)) (+) (-) uminus 0 (*\<^sub>R) basis\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain basis where "basis \<subseteq> dest.tangent_space (f p)"
    "finite_dimensional_vector_space_on_with (dest.tangent_space (f p)) (+) (-) uminus 0 (*\<^sub>R) basis"
[PROOF STATE]
proof (prove)
using this:
(\<And>basis. \<lbrakk>basis \<subseteq> dest.tangent_space (f p); finite_dimensional_vector_space_on_with (dest.tangent_space (f p)) (+) (-) uminus 0 (*\<^sub>R) basis\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>basis. \<lbrakk>basis \<subseteq> dest.tangent_space (f p); finite_dimensional_vector_space_on_with (dest.tangent_space (f p)) (+) (-) uminus 0 (*\<^sub>R) basis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
basis \<subseteq> dest.tangent_space (f p)
finite_dimensional_vector_space_on_with (dest.tangent_space (f p)) (+) (-) uminus 0 (*\<^sub>R) basis

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
basis \<subseteq> dest.tangent_space (f p)
finite_dimensional_vector_space_on_with (dest.tangent_space (f p)) (+) (-) uminus 0 (*\<^sub>R) basis
[PROOF STEP]
interpret finite_dimensional_vector_space_on "(dest.tangent_space (f p))" scaleR basis
[PROOF STATE]
proof (prove)
using this:
basis \<subseteq> dest.tangent_space (f p)
finite_dimensional_vector_space_on_with (dest.tangent_space (f p)) (+) (-) uminus 0 (*\<^sub>R) basis

goal (1 subgoal):
 1. finite_dimensional_vector_space_on (dest.tangent_space (f p)) (*\<^sub>R) basis
[PROOF STEP]
unfolding finite_dimensional_vector_space_on_with_def
[PROOF STATE]
proof (prove)
using this:
basis \<subseteq> dest.tangent_space (f p)
vector_space_on_with (dest.tangent_space (f p)) (+) (-) uminus 0 (*\<^sub>R) \<and> finite basis \<and> \<not> dependent_with (+) 0 (*\<^sub>R) basis \<and> span_with (+) 0 (*\<^sub>R) basis = dest.tangent_space (f p)

goal (1 subgoal):
 1. finite_dimensional_vector_space_on (dest.tangent_space (f p)) (*\<^sub>R) basis
[PROOF STEP]
by unfold_locales
      (auto simp: implicit_ab_group_add dest.tangent_space.dependent_eq_real dest.tangent_space.span_eq_real)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
interpret rev: finite_dimensional_vector_space_pair_1_on
     "dest.tangent_space (f p)" "src.tangent_space p" scaleR scaleR basis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_dimensional_vector_space_pair_1_on (dest.tangent_space (f p)) (src.tangent_space p) (*\<^sub>R) (*\<^sub>R) basis
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
from bij_betw_push_forward[OF p]
[PROOF STATE]
proof (chain)
picking this:
bij_betw push_forward (src.tangent_space p) (dest.tangent_space (f p))
[PROOF STEP]
have "inj_on push_forward (src.tangent_space p)"
    "dest.tangent_space (f p) = push_forward ` src.tangent_space p"
[PROOF STATE]
proof (prove)
using this:
bij_betw push_forward (src.tangent_space p) (dest.tangent_space (f p))

goal (1 subgoal):
 1. inj_on push_forward (src.tangent_space p) &&& dest.tangent_space (f p) = push_forward ` src.tangent_space p
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on push_forward (src.tangent_space p) \<and> push_forward ` src.tangent_space p = dest.tangent_space (f p)

goal (1 subgoal):
 1. inj_on push_forward (src.tangent_space p) &&& dest.tangent_space (f p) = push_forward ` src.tangent_space p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on push_forward (src.tangent_space p)
dest.tangent_space (f p) = push_forward ` src.tangent_space p

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
have "dim (dest.tangent_space (f p)) = src.tangent_space.dim p (inv.push_forward ` dest.tangent_space (f p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (dest.tangent_space (f p)) = src.tangent_space.dim p (inv.push_forward ` dest.tangent_space (f p))
[PROOF STEP]
apply (rule rev.dim_image_eq[OF _ order_refl, of inv.push_forward, symmetric,
        unfolded dest.tangent_space_dim_eq[OF order_refl]])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>x. x \<in> dest.tangent_space (f p) \<longrightarrow> inv.push_forward x \<in> src.tangent_space p
 2. linear_on (dest.tangent_space (f p)) (src.tangent_space p) (*\<^sub>R) (*\<^sub>R) inv.push_forward
 3. inj_on inv.push_forward (module_on.span (*\<^sub>R) (dest.tangent_space (f p)))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<in> dest.tangent_space (f p) \<longrightarrow> inv.push_forward x \<in> src.tangent_space p
[PROOF STEP]
by (metis (no_types) contra_subsetD defined f_inv image_eqI inv.push_forward_in_tangent_space p)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. linear_on (dest.tangent_space (f p)) (src.tangent_space p) (*\<^sub>R) (*\<^sub>R) inv.push_forward
 2. inj_on inv.push_forward (module_on.span (*\<^sub>R) (dest.tangent_space (f p)))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear_on (dest.tangent_space (f p)) (src.tangent_space p) (*\<^sub>R) (*\<^sub>R) inv.push_forward
[PROOF STEP]
apply (rule linear_imp_linear_on)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. linear inv.push_forward
 2. subspace (dest.tangent_space (f p))
 3. subspace (src.tangent_space p)
[PROOF STEP]
apply (rule inv.linear_push_forward)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. subspace (dest.tangent_space (f p))
 2. subspace (src.tangent_space p)
[PROOF STEP]
apply (rule dest.subspace_tangent_space)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace (src.tangent_space p)
[PROOF STEP]
apply (rule src.subspace_tangent_space)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on inv.push_forward (module_on.span (*\<^sub>R) (dest.tangent_space (f p)))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on inv.push_forward (module_on.span (*\<^sub>R) (dest.tangent_space (f p)))
[PROOF STEP]
unfolding inj_on_def dest.tangent_space.span_eq_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>span (dest.tangent_space (f p)). \<forall>y\<in>span (dest.tangent_space (f p)). inv.push_forward x = inv.push_forward y \<longrightarrow> x = y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> span (dest.tangent_space (f p)); y \<in> span (dest.tangent_space (f p)); inv.push_forward x = inv.push_forward y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> span (dest.tangent_space (f p)); y \<in> span (dest.tangent_space (f p)); inv.push_forward x = inv.push_forward y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x :: "('c \<Rightarrow> real) \<Rightarrow> real" and y :: "('c \<Rightarrow> real) \<Rightarrow> real"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> span (dest.tangent_space (f p)); y \<in> span (dest.tangent_space (f p)); inv.push_forward x = inv.push_forward y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume a1: "y \<in> span (dest.tangent_space (f p))"
[PROOF STATE]
proof (state)
this:
y \<in> span (dest.tangent_space (f p))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> span (dest.tangent_space (f p)); y \<in> span (dest.tangent_space (f p)); inv.push_forward x = inv.push_forward y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume a2: "x \<in> span (dest.tangent_space (f p))"
[PROOF STATE]
proof (state)
this:
x \<in> span (dest.tangent_space (f p))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> span (dest.tangent_space (f p)); y \<in> span (dest.tangent_space (f p)); inv.push_forward x = inv.push_forward y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume a3: "inv.push_forward x = inv.push_forward y"
[PROOF STATE]
proof (state)
this:
inv.push_forward x = inv.push_forward y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> span (dest.tangent_space (f p)); y \<in> span (dest.tangent_space (f p)); inv.push_forward x = inv.push_forward y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "f p \<in> dest.carrier"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f p \<in> dest.carrier
[PROOF STEP]
by (meson contra_subsetD defined image_eqI p)
[PROOF STATE]
proof (state)
this:
f p \<in> dest.carrier

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> span (dest.tangent_space (f p)); y \<in> span (dest.tangent_space (f p)); inv.push_forward x = inv.push_forward y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f p \<in> dest.carrier
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
f p \<in> dest.carrier

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using a3 a2 a1
[PROOF STATE]
proof (prove)
using this:
f p \<in> dest.carrier
inv.push_forward x = inv.push_forward y
x \<in> span (dest.tangent_space (f p))
y \<in> span (dest.tangent_space (f p))

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (metis (no_types) c_manifold.subspace_tangent_space c_manifolds_axioms c_manifolds_def inv_push_forward_inverse span_eq_iff)
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
dim (dest.tangent_space (f p)) = src.tangent_space.dim p (inv.push_forward ` dest.tangent_space (f p))

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dim (dest.tangent_space (f p)) = src.tangent_space.dim p (inv.push_forward ` dest.tangent_space (f p))

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
have "f p \<in> dest.carrier"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f p \<in> dest.carrier
[PROOF STEP]
using defined p
[PROOF STATE]
proof (prove)
using this:
f ` src.carrier \<subseteq> dest.carrier
p \<in> src.carrier

goal (1 subgoal):
 1. f p \<in> dest.carrier
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f p \<in> dest.carrier

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f p \<in> dest.carrier
[PROOF STEP]
have "inv.push_forward ` dest.tangent_space (f p) = src.tangent_space p"
[PROOF STATE]
proof (prove)
using this:
f p \<in> dest.carrier

goal (1 subgoal):
 1. inv.push_forward ` dest.tangent_space (f p) = src.tangent_space p
[PROOF STEP]
using inv.push_forward_in_tangent_space[of "f p"] that(1)
[PROOF STATE]
proof (prove)
using this:
f p \<in> dest.carrier
f p \<in> dest.carrier \<Longrightarrow> inv.push_forward ` dest.tangent_space (f p) \<subseteq> src.tangent_space (f' (f p))
p \<in> src.carrier

goal (1 subgoal):
 1. inv.push_forward ` dest.tangent_space (f p) = src.tangent_space p
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f p \<in> dest.carrier; inv.push_forward ` dest.tangent_space (f p) \<subseteq> src.tangent_space p; p \<in> src.carrier; x \<in> src.tangent_space p\<rbrakk> \<Longrightarrow> x \<in> inv.push_forward ` dest.tangent_space (f p)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f p \<in> dest.carrier; inv.push_forward ` dest.tangent_space (f p) \<subseteq> src.tangent_space p; p \<in> src.carrier; x \<in> src.tangent_space p\<rbrakk> \<Longrightarrow> x \<in> inv.push_forward ` dest.tangent_space (f p)
[PROOF STEP]
apply (rule image_eqI[where x="push_forward x"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>f p \<in> dest.carrier; inv.push_forward ` dest.tangent_space (f p) \<subseteq> src.tangent_space p; p \<in> src.carrier; x \<in> src.tangent_space p\<rbrakk> \<Longrightarrow> x = inv.push_forward (push_forward x)
 2. \<lbrakk>f p \<in> dest.carrier; inv.push_forward ` dest.tangent_space (f p) \<subseteq> src.tangent_space p; p \<in> src.carrier; x \<in> src.tangent_space p\<rbrakk> \<Longrightarrow> push_forward x \<in> dest.tangent_space (f p)
[PROOF STEP]
apply (auto simp: push_forward_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f p \<in> dest.carrier; inv.push_forward ` dest.tangent_space (f p) \<subseteq> src.tangent_space p; p \<in> src.carrier; x \<in> src.tangent_space p\<rbrakk> \<Longrightarrow> push_forward x \<in> dest.tangent_space (f p)
[PROOF STEP]
using \<open>dest.tangent_space (f p) = push_forward ` src.tangent_space p\<close>
[PROOF STATE]
proof (prove)
using this:
dest.tangent_space (f p) = push_forward ` src.tangent_space p

goal (1 subgoal):
 1. \<lbrakk>f p \<in> dest.carrier; inv.push_forward ` dest.tangent_space (f p) \<subseteq> src.tangent_space p; p \<in> src.carrier; x \<in> src.tangent_space p\<rbrakk> \<Longrightarrow> push_forward x \<in> dest.tangent_space (f p)
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inv.push_forward ` dest.tangent_space (f p) = src.tangent_space p

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inv.push_forward ` dest.tangent_space (f p) = src.tangent_space p

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
have "src.tangent_space.dim p \<dots> = dim \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. src.tangent_space.dim p (src.tangent_space p) = dim (src.tangent_space p)
[PROOF STEP]
by (rule src.tangent_space_dim_eq) simp
[PROOF STATE]
proof (state)
this:
src.tangent_space.dim p (src.tangent_space p) = dim (src.tangent_space p)

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dim (dest.tangent_space (f p)) = dim (src.tangent_space p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim (dest.tangent_space (f p)) = dim (src.tangent_space p)

goal (1 subgoal):
 1. dim (src.tangent_space p) = dim (dest.tangent_space (f p))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
dim (src.tangent_space p) = dim (dest.tangent_space (f p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_join_eq [simp]:
  fixes g1 :: "real \<Rightarrow> 'a::metric_space"
  assumes "path g1" "path g2"
    shows "path(g1 +++ g2) \<longleftrightarrow> pathfinish g1 = pathstart g2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (g1 +++ g2) = (pathfinish g1 = pathstart g2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path g1
path g2

goal (1 subgoal):
 1. path (g1 +++ g2) = (pathfinish g1 = pathstart g2)
[PROOF STEP]
by (metis path_join_path_ends path_join_imp)


[STATEMENT]
lemma le_succ_iff: "Ord i \<Longrightarrow> Ord j \<Longrightarrow> succ i \<le> succ j \<longleftrightarrow> i \<le> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord i; Ord j\<rbrakk> \<Longrightarrow> (succ i \<le> succ j) = (i \<le> j)
[PROOF STEP]
by (metis Ord_linear_le Ord_succ le_succE order_antisym)


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


[STATEMENT]
lemma nonneg_matrix_mult: "0 \<le> (C :: ('b::{field, ordered_ring})^_^_) \<Longrightarrow> 0 \<le> D \<Longrightarrow> 0 \<le> C ** D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> C; 0 \<le> D\<rbrakk> \<Longrightarrow> 0 \<le> C ** D
[PROOF STEP]
unfolding Finite_Cartesian_Product.less_eq_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i ia. 0 $ i $ ia \<le> C $ i $ ia; \<forall>i ia. 0 $ i $ ia \<le> D $ i $ ia\<rbrakk> \<Longrightarrow> \<forall>i ia. 0 $ i $ ia \<le> (C ** D) $ i $ ia
[PROOF STEP]
by (auto simp: matrix_matrix_mult_def intro!: sum_nonneg)


[STATEMENT]
lemma mset_le_single_right_iff[simp]:
  "M \<le> {#y#} \<longleftrightarrow> M = {#y#} \<or> (\<forall>x \<in># M. x < y)" for y :: "'a::linorder"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M \<le> {#y#}) = (M = {#y#} \<or> (\<forall>x\<in>#M. x < y))
[PROOF STEP]
by (meson less_eq_multiset_def mset_lt_single_right_iff)


[STATEMENT]
lemma integral_cos_Z [simp]:
  assumes "n \<in> \<int>"
  shows "integral\<^sup>L (lebesgue_on {-pi..pi}) (\<lambda>x. cos(x * n)) = (if n = 0 then 2 * pi else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|lebesgue_on {- pi..pi}. cos (x * n) = (if n = 0 then 2 * pi else 0)
[PROOF STEP]
proof (subst lebesgue_integral_eq_integral)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (x * n))
 2. {- pi..pi} \<in> sets lebesgue
 3. integral {- pi..pi} (\<lambda>x. cos (x * n)) = (if n = 0 then 2 * pi else 0)
[PROOF STEP]
show "integrable (lebesgue_on {-pi..pi}) (\<lambda>x. cos (x * n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (x * n))
[PROOF STEP]
by (intro continuous_imp_integrable_real continuous_intros)
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on {- pi..pi}) (\<lambda>x. cos (x * n))

goal (2 subgoals):
 1. {- pi..pi} \<in> sets lebesgue
 2. integral {- pi..pi} (\<lambda>x. cos (x * n)) = (if n = 0 then 2 * pi else 0)
[PROOF STEP]
show "integral {-pi..pi} (\<lambda>x. cos (x * n)) = (if n = 0 then 2 * pi else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {- pi..pi} (\<lambda>x. cos (x * n)) = (if n = 0 then 2 * pi else 0)
[PROOF STEP]
by (metis Ints_cases assms integral_cos_nx of_int_0_eq_iff)
[PROOF STATE]
proof (state)
this:
integral {- pi..pi} (\<lambda>x. cos (x * n)) = (if n = 0 then 2 * pi else 0)

goal (1 subgoal):
 1. {- pi..pi} \<in> sets lebesgue
[PROOF STEP]
qed auto


[STATEMENT]
lemma infdist_Un_min:
  assumes "A \<noteq> {}" "B \<noteq> {}"
  shows "infdist x (A \<union> B) = min (infdist x A) (infdist x B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x (A \<union> B) = min (infdist x A) (infdist x B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
B \<noteq> {}

goal (1 subgoal):
 1. infdist x (A \<union> B) = min (infdist x A) (infdist x B)
[PROOF STEP]
by (simp add: infdist_def cINF_union inf_real_def)


[STATEMENT]
lemma uniformly_continuous_on_norm[continuous_intros]:
  fixes f :: "'a :: metric_space \<Rightarrow> 'b :: real_normed_vector"
  assumes "uniformly_continuous_on s f"
  shows "uniformly_continuous_on s (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_continuous_on s (\<lambda>x. norm (f x))
[PROOF STEP]
unfolding norm_conv_dist
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_continuous_on s (\<lambda>x. dist (f x) (0::'b))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uniformly_continuous_on s f

goal (1 subgoal):
 1. uniformly_continuous_on s (\<lambda>x. dist (f x) (0::'b))
[PROOF STEP]
by (intro uniformly_continuous_on_dist uniformly_continuous_on_const)


[STATEMENT]
lemma ex1_imp_Collect_singleton: "(\<exists>!x. P x) \<and> P x \<longleftrightarrow> Collect P = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<exists>!x. P x) \<and> P x) = (Collect P = {x})
[PROOF STEP]
proof(intro iffI conjI, unfold conj_imp_eq_imp_imp)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>Ex1 P; P x\<rbrakk> \<Longrightarrow> Collect P = {x}
 2. Collect P = {x} \<Longrightarrow> \<exists>!x. P x
 3. Collect P = {x} \<Longrightarrow> P x
[PROOF STEP]
assume "Ex1 P" "P x"
[PROOF STATE]
proof (state)
this:
Ex1 P
P x

goal (3 subgoals):
 1. \<lbrakk>Ex1 P; P x\<rbrakk> \<Longrightarrow> Collect P = {x}
 2. Collect P = {x} \<Longrightarrow> \<exists>!x. P x
 3. Collect P = {x} \<Longrightarrow> P x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Ex1 P
P x
[PROOF STEP]
show "Collect P = {x}"
[PROOF STATE]
proof (prove)
using this:
Ex1 P
P x

goal (1 subgoal):
 1. Collect P = {x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Collect P = {x}

goal (2 subgoals):
 1. Collect P = {x} \<Longrightarrow> \<exists>!x. P x
 2. Collect P = {x} \<Longrightarrow> P x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Collect P = {x} \<Longrightarrow> \<exists>!x. P x
 2. Collect P = {x} \<Longrightarrow> P x
[PROOF STEP]
assume Px: "Collect P = {x}"
[PROOF STATE]
proof (state)
this:
Collect P = {x}

goal (2 subgoals):
 1. Collect P = {x} \<Longrightarrow> \<exists>!x. P x
 2. Collect P = {x} \<Longrightarrow> P x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Collect P = {x}
[PROOF STEP]
have "P y \<longleftrightarrow> x = y" for y
[PROOF STATE]
proof (prove)
using this:
Collect P = {x}

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

goal (2 subgoals):
 1. Collect P = {x} \<Longrightarrow> \<exists>!x. P x
 2. Collect P = {x} \<Longrightarrow> P x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P ?y = (x = ?y)
[PROOF STEP]
show "Ex1 P"
[PROOF STATE]
proof (prove)
using this:
P ?y = (x = ?y)

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

goal (1 subgoal):
 1. Collect P = {x} \<Longrightarrow> P x
[PROOF STEP]
from Px
[PROOF STATE]
proof (chain)
picking this:
Collect P = {x}
[PROOF STEP]
show "P x"
[PROOF STATE]
proof (prove)
using this:
Collect P = {x}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_nat_ge_1_iff: "(of_nat x :: 'a :: linordered_semidom) \<ge> 1 \<longleftrightarrow> x \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'a) \<le> of_nat x) = (1 \<le> x)
[PROOF STEP]
using of_nat_le_iff[of 1 x]
[PROOF STATE]
proof (prove)
using this:
(of_nat 1 \<le> of_nat x) = (1 \<le> x)

goal (1 subgoal):
 1. ((1::'a) \<le> of_nat x) = (1 \<le> x)
[PROOF STEP]
by (subst (asm) of_nat_1)


[STATEMENT]
lemma contractible_Times:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes S: "contractible S" and T: "contractible T"
  shows "contractible (S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contractible (S \<times> T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. contractible (S \<times> T)
[PROOF STEP]
obtain a h where conth: "continuous_on ({0..1} \<times> S) h"
             and hsub: "h ` ({0..1} \<times> S) \<subseteq> S"
             and [simp]: "\<And>x. x \<in> S \<Longrightarrow> h (0, x) = x"
             and [simp]: "\<And>x. x \<in> S \<Longrightarrow>  h (1::real, x) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h a. \<lbrakk>continuous_on ({0..1} \<times> S) h; h ` ({0..1} \<times> S) \<subseteq> S; \<And>x. x \<in> S \<Longrightarrow> h (0, x) = x; \<And>x. x \<in> S \<Longrightarrow> h (1, x) = a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
contractible S

goal (1 subgoal):
 1. (\<And>h a. \<lbrakk>continuous_on ({0..1} \<times> S) h; h ` ({0..1} \<times> S) \<subseteq> S; \<And>x. x \<in> S \<Longrightarrow> h (0, x) = x; \<And>x. x \<in> S \<Longrightarrow> h (1, x) = a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: contractible_def homotopic_with)
[PROOF STATE]
proof (state)
this:
continuous_on ({0..1} \<times> S) h
h ` ({0..1} \<times> S) \<subseteq> S
?x \<in> S \<Longrightarrow> h (0, ?x) = ?x
?x \<in> S \<Longrightarrow> h (1, ?x) = a

goal (1 subgoal):
 1. contractible (S \<times> T)
[PROOF STEP]
obtain b k where contk: "continuous_on ({0..1} \<times> T) k"
             and ksub: "k ` ({0..1} \<times> T) \<subseteq> T"
             and [simp]: "\<And>x. x \<in> T \<Longrightarrow> k (0, x) = x"
             and [simp]: "\<And>x. x \<in> T \<Longrightarrow>  k (1::real, x) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k b. \<lbrakk>continuous_on ({0..1} \<times> T) k; k ` ({0..1} \<times> T) \<subseteq> T; \<And>x. x \<in> T \<Longrightarrow> k (0, x) = x; \<And>x. x \<in> T \<Longrightarrow> k (1, x) = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using T
[PROOF STATE]
proof (prove)
using this:
contractible T

goal (1 subgoal):
 1. (\<And>k b. \<lbrakk>continuous_on ({0..1} \<times> T) k; k ` ({0..1} \<times> T) \<subseteq> T; \<And>x. x \<in> T \<Longrightarrow> k (0, x) = x; \<And>x. x \<in> T \<Longrightarrow> k (1, x) = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: contractible_def homotopic_with)
[PROOF STATE]
proof (state)
this:
continuous_on ({0..1} \<times> T) k
k ` ({0..1} \<times> T) \<subseteq> T
?x \<in> T \<Longrightarrow> k (0, ?x) = ?x
?x \<in> T \<Longrightarrow> k (1, ?x) = b

goal (1 subgoal):
 1. contractible (S \<times> T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contractible (S \<times> T)
[PROOF STEP]
apply (simp add: contractible_def homotopic_with)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b h. continuous_on ({0..1} \<times> S \<times> T) h \<and> h ` ({0..1} \<times> S \<times> T) \<subseteq> S \<times> T \<and> (\<forall>x\<in>S. \<forall>y\<in>T. h (0, x, y) = (x, y)) \<and> (\<forall>x\<in>S. \<forall>y\<in>T. h (1, x, y) = (a, b))
[PROOF STEP]
apply (rule exI [where x=a])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b h. continuous_on ({0..1} \<times> S \<times> T) h \<and> h ` ({0..1} \<times> S \<times> T) \<subseteq> S \<times> T \<and> (\<forall>x\<in>S. \<forall>y\<in>T. h (0, x, y) = (x, y)) \<and> (\<forall>x\<in>S. \<forall>y\<in>T. h (1, x, y) = (a, b))
[PROOF STEP]
apply (rule exI [where x=b])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>h. continuous_on ({0..1} \<times> S \<times> T) h \<and> h ` ({0..1} \<times> S \<times> T) \<subseteq> S \<times> T \<and> (\<forall>x\<in>S. \<forall>y\<in>T. h (0, x, y) = (x, y)) \<and> (\<forall>x\<in>S. \<forall>y\<in>T. h (1, x, y) = (a, b))
[PROOF STEP]
apply (rule exI [where x = "\<lambda>z. (h (fst z, fst(snd z)), k (fst z, snd(snd z)))"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ({0..1} \<times> S \<times> T) (\<lambda>x. (h (fst x, fst (snd x)), k (fst x, snd (snd x)))) \<and> (\<lambda>x. (h (fst x, fst (snd x)), k (fst x, snd (snd x)))) ` ({0..1} \<times> S \<times> T) \<subseteq> S \<times> T \<and> (\<forall>x\<in>S. \<forall>y\<in>T. (h (fst (0, x, y), fst (snd (0, x, y))), k (fst (0, x, y), snd (snd (0, x, y)))) = (x, y)) \<and> (\<forall>x\<in>S. \<forall>y\<in>T. (h (fst (1, x, y), fst (snd (1, x, y))), k (fst (1, x, y), snd (snd (1, x, y)))) = (a, b))
[PROOF STEP]
using hsub ksub
[PROOF STATE]
proof (prove)
using this:
h ` ({0..1} \<times> S) \<subseteq> S
k ` ({0..1} \<times> T) \<subseteq> T

goal (1 subgoal):
 1. continuous_on ({0..1} \<times> S \<times> T) (\<lambda>x. (h (fst x, fst (snd x)), k (fst x, snd (snd x)))) \<and> (\<lambda>x. (h (fst x, fst (snd x)), k (fst x, snd (snd x)))) ` ({0..1} \<times> S \<times> T) \<subseteq> S \<times> T \<and> (\<forall>x\<in>S. \<forall>y\<in>T. (h (fst (0, x, y), fst (snd (0, x, y))), k (fst (0, x, y), snd (snd (0, x, y)))) = (x, y)) \<and> (\<forall>x\<in>S. \<forall>y\<in>T. (h (fst (1, x, y), fst (snd (1, x, y))), k (fst (1, x, y), snd (snd (1, x, y)))) = (a, b))
[PROOF STEP]
apply (fastforce intro!: continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF contk])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
contractible (S \<times> T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ism_calc: "$(Is)^{m}_n = (\<Sum>j<n. (j+1)/m * (\<Sum>k=j*m..<(j+1)*m. (1+i).^(n-(k+1)/m)))"
  if "m \<noteq> 0" for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $(I^{1}s)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. (1 + i) .^ (real n - real (k + 1) / real m)))
[PROOF STEP]
using v_pos that
[PROOF STATE]
proof (prove)
using this:
0 < $v
m \<noteq> 0

goal (1 subgoal):
 1. $(I^{1}s)^{m}_n = (\<Sum>j<n. real (j + 1) / real m * (\<Sum>k = j * m..<(j + 1) * m. (1 + i) .^ (real n - real (k + 1) / real m)))
[PROOF STEP]
apply (subst Ilsm_Ilam; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < $v; 0 < m\<rbrakk> \<Longrightarrow> (1 + i) ^ n * $(I^{Suc 0}a)^{m}_n = (\<Sum>j<n. (1 + real j) * (\<Sum>k = j * m..<m + j * m. (1 + i) .^ (real n - (1 + real k) / real m)) / real m)
[PROOF STEP]
apply (subst Iam_calc[simplified]; simp?)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < $v; 0 < m\<rbrakk> \<Longrightarrow> (1 + i) ^ n * (\<Sum>j<n. (1 + real j) * (\<Sum>k = j * m..<m + j * m. $v .^ ((1 + real k) / real m)) / real m) = (\<Sum>j<n. (1 + real j) * (\<Sum>k = j * m..<m + j * m. (1 + i) .^ (real n - (1 + real k) / real m)) / real m)
[PROOF STEP]
apply ((subst sum_distrib_left, rule sum.cong; simp))+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>0 < $v; x < n; x * m \<le> xa \<and> xa < m + x * m\<rbrakk> \<Longrightarrow> (1 + i) ^ n * $v .^ ((1 + real xa) / real m) = (1 + i) .^ (real n - (1 + real xa) / real m)
[PROOF STEP]
unfolding v_pres_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>0 < 1 / (1 + i); x < n; x * m \<le> xa \<and> xa < m + x * m\<rbrakk> \<Longrightarrow> (1 + i) ^ n * (1 / (1 + i)) .^ ((1 + real xa) / real m) = (1 + i) .^ (real n - (1 + real xa) / real m)
[PROOF STEP]
using v_futr_pos
[PROOF STATE]
proof (prove)
using this:
0 < 1 + i

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>0 < 1 / (1 + i); x < n; x * m \<le> xa \<and> xa < m + x * m\<rbrakk> \<Longrightarrow> (1 + i) ^ n * (1 / (1 + i)) .^ ((1 + real xa) / real m) = (1 + i) .^ (real n - (1 + real xa) / real m)
[PROOF STEP]
apply (subst inverse_powr; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x < n; x * m \<le> xa \<and> xa < m + x * m; 0 < 1 + i\<rbrakk> \<Longrightarrow> (1 + i) ^ n * (1 + i) .^ - ((1 + real xa) / real m) = (1 + i) .^ (real n - (1 + real xa) / real m)
[PROOF STEP]
apply (subst powr_realpow[THEN sym], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x < n; x * m \<le> xa \<and> xa < m + x * m; 0 < 1 + i\<rbrakk> \<Longrightarrow> (1 + i) .^ real n * (1 + i) .^ - ((1 + real xa) / real m) = (1 + i) .^ (real n - (1 + real xa) / real m)
[PROOF STEP]
by (subst powr_add[THEN sym]; simp)


[STATEMENT]
lemma summable_minus_iff: "summable (\<lambda>n. - f n) \<longleftrightarrow> summable f"
  for f :: "nat \<Rightarrow> 'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. - f n) = summable f
[PROOF STEP]
by (auto dest: summable_minus)


[STATEMENT]
lemma one_mod_card_int [simp]: "1 mod int CARD('a::nontriv) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 mod int CARD('a) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 mod int CARD('a) = 1
[PROOF STEP]
from nontriv [where ?'a = 'a]
[PROOF STATE]
proof (chain)
picking this:
1 < CARD('a)
[PROOF STEP]
have "int (1 mod CARD('a::nontriv)) = 1"
[PROOF STATE]
proof (prove)
using this:
1 < CARD('a)

goal (1 subgoal):
 1. int (1 mod CARD('a)) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (1 mod CARD('a)) = 1

goal (1 subgoal):
 1. 1 mod int CARD('a) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (1 mod CARD('a)) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (1 mod CARD('a)) = 1

goal (1 subgoal):
 1. 1 mod int CARD('a) = 1
[PROOF STEP]
using of_nat_mod [of 1 "CARD('a)", where ?'a = int]
[PROOF STATE]
proof (prove)
using this:
int (1 mod CARD('a)) = 1
int (1 mod CARD('a)) = int 1 mod int CARD('a)

goal (1 subgoal):
 1. 1 mod int CARD('a) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 mod int CARD('a) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Prod_any_zero:
  fixes f :: "'b \<Rightarrow> 'a :: comm_semiring_1"
  assumes "finite {a. f a \<noteq> 1}"
  assumes "f a = 0"
  shows "(\<Prod>a. f a) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Prod_any f = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Prod_any f = (0::'a)
[PROOF STEP]
from \<open>f a = 0\<close>
[PROOF STATE]
proof (chain)
picking this:
f a = (0::'a)
[PROOF STEP]
have "f a \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
f a = (0::'a)

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

goal (1 subgoal):
 1. Prod_any f = (0::'a)
[PROOF STEP]
with \<open>f a = 0\<close>
[PROOF STATE]
proof (chain)
picking this:
f a = (0::'a)
f a \<noteq> (1::'a)
[PROOF STEP]
have "\<exists>a. f a \<noteq> 1 \<and> f a = 0"
[PROOF STATE]
proof (prove)
using this:
f a = (0::'a)
f a \<noteq> (1::'a)

goal (1 subgoal):
 1. \<exists>a. f a \<noteq> (1::'a) \<and> f a = (0::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. f a \<noteq> (1::'a) \<and> f a = (0::'a)

goal (1 subgoal):
 1. Prod_any f = (0::'a)
[PROOF STEP]
with \<open>finite {a. f a \<noteq> 1}\<close>
[PROOF STATE]
proof (chain)
picking this:
finite {a. f a \<noteq> (1::'a)}
\<exists>a. f a \<noteq> (1::'a) \<and> f a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {a. f a \<noteq> (1::'a)}
\<exists>a. f a \<noteq> (1::'a) \<and> f a = (0::'a)

goal (1 subgoal):
 1. Prod_any f = (0::'a)
[PROOF STEP]
by (simp add: Prod_any.expand_set prod_zero)
[PROOF STATE]
proof (state)
this:
Prod_any f = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eigenvector_mat_kernel_char_matrix: assumes A: "A \<in> carrier_mat n n"
  and ev: "eigenvector A v lam"
shows "v \<in> mat_kernel (char_matrix A lam)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> mat_kernel (char_matrix A lam)
[PROOF STEP]
using ev[unfolded eigenvector_char_matrix[OF A]] A
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A lam *\<^sub>v v = 0\<^sub>v n
A \<in> carrier_mat n n

goal (1 subgoal):
 1. v \<in> mat_kernel (char_matrix A lam)
[PROOF STEP]
unfolding mat_kernel_def
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A lam *\<^sub>v v = 0\<^sub>v n
A \<in> carrier_mat n n

goal (1 subgoal):
 1. v \<in> {v \<in> carrier_vec (dim_col (char_matrix A lam)). char_matrix A lam *\<^sub>v v = 0\<^sub>v (dim_row (char_matrix A lam))}
[PROOF STEP]
by (auto simp: char_matrix_def)


[STATEMENT]
lemma interior_of_eq: "(X interior_of S = S) \<longleftrightarrow> openin X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X interior_of S = S) = openin X S
[PROOF STEP]
unfolding interior_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x. \<exists>T. openin X T \<and> x \<in> T \<and> T \<subseteq> S} = S) = openin X S
[PROOF STEP]
using openin_subopen
[PROOF STATE]
proof (prove)
using this:
openin ?U ?S = (\<forall>x\<in>?S. \<exists>T. openin ?U T \<and> x \<in> T \<and> T \<subseteq> ?S)

goal (1 subgoal):
 1. ({x. \<exists>T. openin X T \<and> x \<in> T \<and> T \<subseteq> S} = S) = openin X S
[PROOF STEP]
by blast


[STATEMENT]
lemma (in residues) euler_theorem:
  assumes "coprime a m"
  shows "[a ^ totient (nat m) = 1] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a ^ totient (nat m) = 1] (mod m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [a ^ totient (nat m) = 1] (mod m)
[PROOF STEP]
have "a ^ totient (nat m) mod m = 1 mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ totient (nat m) mod m = 1 mod m
[PROOF STEP]
by (metis assms finite_Units m_gt_one mod_in_res_units one_cong totient_eq pow_cong units_power_order_eq_one)
[PROOF STATE]
proof (state)
this:
a ^ totient (nat m) mod m = 1 mod m

goal (1 subgoal):
 1. [a ^ totient (nat m) = 1] (mod m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a ^ totient (nat m) mod m = 1 mod m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a ^ totient (nat m) mod m = 1 mod m

goal (1 subgoal):
 1. [a ^ totient (nat m) = 1] (mod m)
[PROOF STEP]
using res_eq_to_cong
[PROOF STATE]
proof (prove)
using this:
a ^ totient (nat m) mod m = 1 mod m
(?a mod m = ?b mod m) = [?a = ?b] (mod m)

goal (1 subgoal):
 1. [a ^ totient (nat m) = 1] (mod m)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[a ^ totient (nat m) = 1] (mod m)

goal:
No subgoals!
[PROOF STEP]
qed