[STATEMENT]
lemma sum_less_suminf2:
  "summable f \<Longrightarrow> (\<And>m. m\<ge>n \<Longrightarrow> 0 \<le> f m) \<Longrightarrow> n \<le> i \<Longrightarrow> 0 < f i \<Longrightarrow> sum f {..<n} < suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) \<le> f m; n \<le> i; (0::'a) < f i\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f
[PROOF STEP]
using sum_le_suminf[of f "{..< Suc i}"]
    and add_strict_increasing[of "f i" "sum f {..<n}" "sum f {..<i}"]
    and sum_mono2[of "{..<i}" "{..<n}" f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>summable f; finite {..<Suc i}; \<And>n. n \<in> - {..<Suc i} \<Longrightarrow> (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> sum f {..<Suc i} \<le> suminf f
\<lbrakk>(0::'a) < f i; sum f {..<n} \<le> sum f {..<i}\<rbrakk> \<Longrightarrow> sum f {..<n} < f i + sum f {..<i}
\<lbrakk>finite {..<i}; {..<n} \<subseteq> {..<i}; \<And>b. b \<in> {..<i} - {..<n} \<Longrightarrow> (0::'a) \<le> f b\<rbrakk> \<Longrightarrow> sum f {..<n} \<le> sum f {..<i}

goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) \<le> f m; n \<le> i; (0::'a) < f i\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f
[PROOF STEP]
by (auto simp: less_imp_le ac_simps)


[STATEMENT]
lemma HInfinite_mult:
  fixes x y :: "'a::real_normed_div_algebra star"
  assumes "x \<in> HInfinite" "y \<in> HInfinite" shows "x * y \<in> HInfinite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y \<in> HInfinite
[PROOF STEP]
proof (rule HInfiniteI, simp only: hnorm_mult)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. r \<in> \<real> \<Longrightarrow> r < hnorm x * hnorm y
[PROOF STEP]
have "x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0
[PROOF STEP]
using Compl_HFinite HFinite_0 assms
[PROOF STATE]
proof (prove)
using this:
- HFinite = HInfinite
0 \<in> HFinite
x \<in> HInfinite
y \<in> HInfinite

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

goal (1 subgoal):
 1. \<And>r. r \<in> \<real> \<Longrightarrow> r < hnorm x * hnorm y
[PROOF STEP]
show "r < hnorm x * hnorm y"
    if "r \<in> \<real>" for r :: "real star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r < hnorm x * hnorm y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r < hnorm x * hnorm y
[PROOF STEP]
have "r = r * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r = r * 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r = r * 1

goal (1 subgoal):
 1. r < hnorm x * hnorm y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
r = r * 1

goal (1 subgoal):
 1. r < hnorm x * hnorm y
[PROOF STEP]
have "\<dots> < hnorm x * hnorm y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * 1 < hnorm x * hnorm y
[PROOF STEP]
by (meson HInfiniteD Reals_1 \<open>x \<noteq> 0\<close> assms le_numeral_extra(1) mult_strict_mono that zero_less_hnorm_iff)
[PROOF STATE]
proof (state)
this:
r * 1 < hnorm x * hnorm y

goal (1 subgoal):
 1. r < hnorm x * hnorm y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
r < hnorm x * hnorm y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r < hnorm x * hnorm y

goal (1 subgoal):
 1. r < hnorm x * hnorm y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
r < hnorm x * hnorm y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?r \<in> \<real> \<Longrightarrow> ?r < hnorm x * hnorm y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring_hom_cring) hom_a_inv [simp]:
  "x \<in> carrier R \<Longrightarrow> h (\<ominus> x) = \<ominus>\<^bsub>S\<^esub> h x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier R \<Longrightarrow> h (\<ominus> x) = \<ominus>\<^bsub>S\<^esub> h x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> carrier R \<Longrightarrow> h (\<ominus> x) = \<ominus>\<^bsub>S\<^esub> h x
[PROOF STEP]
assume R: "x \<in> carrier R"
[PROOF STATE]
proof (state)
this:
x \<in> carrier R

goal (1 subgoal):
 1. x \<in> carrier R \<Longrightarrow> h (\<ominus> x) = \<ominus>\<^bsub>S\<^esub> h x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
[PROOF STEP]
have "h x \<oplus>\<^bsub>S\<^esub> h (\<ominus> x) = h x \<oplus>\<^bsub>S\<^esub> (\<ominus>\<^bsub>S\<^esub> h x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R

goal (1 subgoal):
 1. h x \<oplus>\<^bsub>S\<^esub> h (\<ominus> x) = h x \<oplus>\<^bsub>S\<^esub> \<ominus>\<^bsub>S\<^esub> h x
[PROOF STEP]
by (simp add: hom_add [symmetric] R.r_neg S.r_neg del: hom_add)
[PROOF STATE]
proof (state)
this:
h x \<oplus>\<^bsub>S\<^esub> h (\<ominus> x) = h x \<oplus>\<^bsub>S\<^esub> \<ominus>\<^bsub>S\<^esub> h x

goal (1 subgoal):
 1. x \<in> carrier R \<Longrightarrow> h (\<ominus> x) = \<ominus>\<^bsub>S\<^esub> h x
[PROOF STEP]
with R
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
h x \<oplus>\<^bsub>S\<^esub> h (\<ominus> x) = h x \<oplus>\<^bsub>S\<^esub> \<ominus>\<^bsub>S\<^esub> h x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
h x \<oplus>\<^bsub>S\<^esub> h (\<ominus> x) = h x \<oplus>\<^bsub>S\<^esub> \<ominus>\<^bsub>S\<^esub> h x

goal (1 subgoal):
 1. h (\<ominus> x) = \<ominus>\<^bsub>S\<^esub> h x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h (\<ominus> x) = \<ominus>\<^bsub>S\<^esub> h x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_offset[simp]:
 fixes g :: "_ \<Rightarrow> 'b::topological_group_add"
 shows "path (\<lambda>t. g t - z) \<longleftrightarrow> path g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path (\<lambda>t. g t - z) = path g
[PROOF STEP]
unfolding path_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>t. g t - z) = continuous_on {0..1} g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on {0..1} (\<lambda>t. g t - z) \<Longrightarrow> continuous_on {0..1} g
 2. continuous_on {0..1} g \<Longrightarrow> continuous_on {0..1} (\<lambda>t. g t - z)
[PROOF STEP]
assume "continuous_on {0..1} (\<lambda>t. g t - z)"
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>t. g t - z)

goal (2 subgoals):
 1. continuous_on {0..1} (\<lambda>t. g t - z) \<Longrightarrow> continuous_on {0..1} g
 2. continuous_on {0..1} g \<Longrightarrow> continuous_on {0..1} (\<lambda>t. g t - z)
[PROOF STEP]
hence "continuous_on {0..1} (\<lambda>t. (g t - z) + z)"
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>t. g t - z)

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>t. g t - z + z)
[PROOF STEP]
apply (rule continuous_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. z)
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>t. g t - z + z)

goal (2 subgoals):
 1. continuous_on {0..1} (\<lambda>t. g t - z) \<Longrightarrow> continuous_on {0..1} g
 2. continuous_on {0..1} g \<Longrightarrow> continuous_on {0..1} (\<lambda>t. g t - z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {0..1} (\<lambda>t. g t - z + z)
[PROOF STEP]
show "continuous_on {0..1} g"
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>t. g t - z + z)

goal (1 subgoal):
 1. continuous_on {0..1} g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} g

goal (1 subgoal):
 1. continuous_on {0..1} g \<Longrightarrow> continuous_on {0..1} (\<lambda>t. g t - z)
[PROOF STEP]
qed (auto intro:continuous_intros)


[STATEMENT]
lemma map_graph_preserves_subgraph[intro]:
  assumes "subgraph A B"
  shows "subgraph (map_graph f A) (map_graph f B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgraph (map_graph f A) (map_graph f B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subgraph A B

goal (1 subgoal):
 1. subgraph (map_graph f A) (map_graph f B)
[PROOF STEP]
unfolding subgraph_def
[PROOF STATE]
proof (prove)
using this:
graph A \<and> graph B \<and> graph_union A B = B

goal (1 subgoal):
 1. graph (map_graph f A) \<and> graph (map_graph f B) \<and> graph_union (map_graph f A) (map_graph f B) = map_graph f B
[PROOF STEP]
by (auto simp:graph_union_iff)


[STATEMENT]
lemma full_Suc_Node3_iff [simp]:
  "full (Suc n) (Node3 l p m q r) \<longleftrightarrow> full n l \<and> full n m \<and> full n r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full (Suc n) \<langle>l, p, m, q, r\<rangle> = (full n l \<and> full n m \<and> full n r)
[PROOF STEP]
by (auto elim: full_elims intro: full.intros)


[STATEMENT]
lemma prime_elem_int_minus_iff [simp]:
  fixes p :: int
  shows "prime_elem (- p) \<longleftrightarrow> prime_elem p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_elem (- p) = prime_elem p
[PROOF STEP]
using prime_elem_normalize_iff [of "- p"]
[PROOF STATE]
proof (prove)
using this:
prime_elem (normalize (- p)) = prime_elem (- p)

goal (1 subgoal):
 1. prime_elem (- p) = prime_elem p
[PROOF STEP]
by simp


[STATEMENT]
theorem kleene_fixed_point_theorem:
  fixes k :: nat
  assumes "recfn 2 psi"
  shows "\<exists>n\<ge>k. \<forall>x. eval r_phi [n, x] = eval psi [n, x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n\<ge>k. \<forall>x. eval r_phi [n, x] = eval psi [n, x]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n\<ge>k. \<forall>x. eval r_phi [n, x] = eval psi [n, x]
[PROOF STEP]
from numbering_translation[OF assms]
[PROOF STATE]
proof (chain)
picking this:
(\<And>c. \<lbrakk>recfn 1 c; Partial_Recursive.total c; \<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain c where c:
    "recfn 1 c"
    "total c"
    "\<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]"
[PROOF STATE]
proof (prove)
using this:
(\<And>c. \<lbrakk>recfn 1 c; Partial_Recursive.total c; \<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>recfn 1 c; Partial_Recursive.total c; \<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
recfn 1 c
Partial_Recursive.total c
\<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]

goal (1 subgoal):
 1. \<exists>n\<ge>k. \<forall>x. eval r_phi [n, x] = eval psi [n, x]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
recfn 1 c
Partial_Recursive.total c
\<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]
[PROOF STEP]
obtain n where "n \<ge> k" and "\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval c [n]), x]"
[PROOF STATE]
proof (prove)
using this:
recfn 1 c
Partial_Recursive.total c
\<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>k \<le> n; \<forall>x. eval r_phi [n, x] = eval r_phi [the (eval c [n]), x]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using rogers_fixed_point_theorem
[PROOF STATE]
proof (prove)
using this:
recfn 1 c
Partial_Recursive.total c
\<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]
\<lbrakk>recfn 1 ?f; Partial_Recursive.total ?f\<rbrakk> \<Longrightarrow> \<exists>n\<ge>?k. \<forall>x. eval r_phi [n, x] = eval r_phi [the (eval ?f [n]), x]

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>k \<le> n; \<forall>x. eval r_phi [n, x] = eval r_phi [the (eval c [n]), x]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k \<le> n
\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval c [n]), x]

goal (1 subgoal):
 1. \<exists>n\<ge>k. \<forall>x. eval r_phi [n, x] = eval psi [n, x]
[PROOF STEP]
with c(3)
[PROOF STATE]
proof (chain)
picking this:
\<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]
k \<le> n
\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval c [n]), x]
[PROOF STEP]
have "\<forall>x. eval r_phi [n, x] = eval psi [n, x]"
[PROOF STATE]
proof (prove)
using this:
\<forall>i x. eval psi [i, x] = eval r_phi [the (eval c [i]), x]
k \<le> n
\<forall>x. eval r_phi [n, x] = eval r_phi [the (eval c [n]), x]

goal (1 subgoal):
 1. \<forall>x. eval r_phi [n, x] = eval psi [n, x]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x. eval r_phi [n, x] = eval psi [n, x]

goal (1 subgoal):
 1. \<exists>n\<ge>k. \<forall>x. eval r_phi [n, x] = eval psi [n, x]
[PROOF STEP]
with \<open>n \<ge> k\<close>
[PROOF STATE]
proof (chain)
picking this:
k \<le> n
\<forall>x. eval r_phi [n, x] = eval psi [n, x]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k \<le> n
\<forall>x. eval r_phi [n, x] = eval psi [n, x]

goal (1 subgoal):
 1. \<exists>n\<ge>k. \<forall>x. eval r_phi [n, x] = eval psi [n, x]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>n\<ge>k. \<forall>x. eval r_phi [n, x] = eval psi [n, x]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma laz_swap_ex:
  assumes A: "list_all_zip (\<lambda>a b. \<exists>c. P a b c) A B"
  obtains C where
    "list_all_zip (\<lambda>a c. \<exists>b. P a b c) A C"
    "list_all_zip (\<lambda>b c. \<exists>a. P a b c) B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>list_all_zip (\<lambda>a c. \<exists>b. P a b c) A C; list_all_zip (\<lambda>b c. \<exists>a. P a b c) B C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>list_all_zip (\<lambda>a c. \<exists>b. P a b c) A C; list_all_zip (\<lambda>b c. \<exists>a. P a b c) B C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
list_all_zip (\<lambda>a b. \<exists>c. P a b c) A B
[PROOF STEP]
have
    [simp]: "length A = length B" and
    IC: "\<forall>i<length B. \<exists>ci. P (A!i) (B!i) ci"
[PROOF STATE]
proof (prove)
using this:
list_all_zip (\<lambda>a b. \<exists>c. P a b c) A B

goal (1 subgoal):
 1. length A = length B &&& \<forall>i<length B. \<exists>ci. P (A ! i) (B ! i) ci
[PROOF STEP]
by (auto simp add: list_all_zip_alt)
[PROOF STATE]
proof (state)
this:
length A = length B
\<forall>i<length B. \<exists>ci. P (A ! i) (B ! i) ci

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>list_all_zip (\<lambda>a c. \<exists>b. P a b c) A C; list_all_zip (\<lambda>b c. \<exists>a. P a b c) B C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from obtain_list_from_elements[OF IC]
[PROOF STATE]
proof (chain)
picking this:
(\<And>l. \<lbrakk>length l = length B; \<forall>i<length B. P (A ! i) (B ! i) (l ! i)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain C where
    "length C = length B"
    "\<forall>i<length B. P (A!i) (B!i) (C!i)"
[PROOF STATE]
proof (prove)
using this:
(\<And>l. \<lbrakk>length l = length B; \<forall>i<length B. P (A ! i) (B ! i) (l ! i)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>length C = length B; \<forall>i<length B. P (A ! i) (B ! i) (C ! i)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
length C = length B
\<forall>i<length B. P (A ! i) (B ! i) (C ! i)

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>list_all_zip (\<lambda>a c. \<exists>b. P a b c) A C; list_all_zip (\<lambda>b c. \<exists>a. P a b c) B C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length C = length B
\<forall>i<length B. P (A ! i) (B ! i) (C ! i)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (rule_tac that) (auto simp add: list_all_zip_alt)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma generate_pow_card:
  assumes a: "a \<in> carrier G"
  shows "ord a = card (generate G { a })"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord a = card (generate G {a})
[PROOF STEP]
proof (cases "ord a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ord a = 0 \<Longrightarrow> ord a = card (generate G {a})
 2. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
ord a = 0

goal (2 subgoals):
 1. ord a = 0 \<Longrightarrow> ord a = card (generate G {a})
 2. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord a = 0
[PROOF STEP]
have "infinite (carrier (subgroup_generated G {a}))"
[PROOF STATE]
proof (prove)
using this:
ord a = 0

goal (1 subgoal):
 1. infinite (carrier (subgroup_generated G {a}))
[PROOF STEP]
using infinite_cyclic_subgroup_order[OF a]
[PROOF STATE]
proof (prove)
using this:
ord a = 0
infinite (carrier (subgroup_generated G {a})) = (ord a = 0)

goal (1 subgoal):
 1. infinite (carrier (subgroup_generated G {a}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infinite (carrier (subgroup_generated G {a}))

goal (2 subgoals):
 1. ord a = 0 \<Longrightarrow> ord a = card (generate G {a})
 2. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite (carrier (subgroup_generated G {a}))
[PROOF STEP]
have "infinite (generate G {a})"
[PROOF STATE]
proof (prove)
using this:
infinite (carrier (subgroup_generated G {a}))

goal (1 subgoal):
 1. infinite (generate G {a})
[PROOF STEP]
unfolding subgroup_generated_def
[PROOF STATE]
proof (prove)
using this:
infinite (carrier (G\<lparr>carrier := generate G (carrier G \<inter> {a})\<rparr>))

goal (1 subgoal):
 1. infinite (generate G {a})
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
infinite (carrier (G\<lparr>carrier := generate G (carrier G \<inter> {a})\<rparr>))
a \<in> carrier G

goal (1 subgoal):
 1. infinite (generate G {a})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
infinite (generate G {a})

goal (2 subgoals):
 1. ord a = 0 \<Longrightarrow> ord a = card (generate G {a})
 2. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite (generate G {a})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (generate G {a})

goal (1 subgoal):
 1. ord a = card (generate G {a})
[PROOF STEP]
using \<open>ord a = 0\<close>
[PROOF STATE]
proof (prove)
using this:
infinite (generate G {a})
ord a = 0

goal (1 subgoal):
 1. ord a = card (generate G {a})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ord a = card (generate G {a})

goal (1 subgoal):
 1. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
ord a \<noteq> 0

goal (1 subgoal):
 1. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
note finite_subgroup = this
[PROOF STATE]
proof (state)
this:
ord a \<noteq> 0

goal (1 subgoal):
 1. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord a \<noteq> 0
[PROOF STEP]
have "generate G { a } = (([^]) a) ` {0..ord a - 1}"
[PROOF STATE]
proof (prove)
using this:
ord a \<noteq> 0

goal (1 subgoal):
 1. generate G {a} = ([^]) a ` {0..ord a - 1}
[PROOF STEP]
using generate_pow_nat ord_elems_inf_carrier a
[PROOF STATE]
proof (prove)
using this:
ord a \<noteq> 0
\<lbrakk>?a \<in> carrier G; ord ?a \<noteq> 0\<rbrakk> \<Longrightarrow> generate G {?a} = {?a [^] k |k. k \<in> UNIV}
\<lbrakk>?a \<in> carrier G; ord ?a \<noteq> 0\<rbrakk> \<Longrightarrow> {?a [^] x |x. x \<in> UNIV} = {?a [^] x |x. x \<in> {0..ord ?a - 1}}
a \<in> carrier G

goal (1 subgoal):
 1. generate G {a} = ([^]) a ` {0..ord a - 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
generate G {a} = ([^]) a ` {0..ord a - 1}

goal (1 subgoal):
 1. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
hence "card (generate G {a}) = card {0..ord a - 1}"
[PROOF STATE]
proof (prove)
using this:
generate G {a} = ([^]) a ` {0..ord a - 1}

goal (1 subgoal):
 1. card (generate G {a}) = card {0..ord a - 1}
[PROOF STEP]
using ord_inj[OF a] card_image
[PROOF STATE]
proof (prove)
using this:
generate G {a} = ([^]) a ` {0..ord a - 1}
inj_on (([^]) a) {0..ord a - 1}
inj_on ?f ?A \<Longrightarrow> card (?f ` ?A) = card ?A

goal (1 subgoal):
 1. card (generate G {a}) = card {0..ord a - 1}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
card (generate G {a}) = card {0..ord a - 1}

goal (1 subgoal):
 1. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (generate G {a}) = card {0..ord a - 1}

goal (1 subgoal):
 1. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
have "... = ord a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {0..ord a - 1} = ord a
[PROOF STEP]
using finite_subgroup
[PROOF STATE]
proof (prove)
using this:
ord a \<noteq> 0

goal (1 subgoal):
 1. card {0..ord a - 1} = ord a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {0..ord a - 1} = ord a

goal (1 subgoal):
 1. ord a \<noteq> 0 \<Longrightarrow> ord a = card (generate G {a})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (generate G {a}) = ord a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (generate G {a}) = ord a

goal (1 subgoal):
 1. ord a = card (generate G {a})
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
ord a = card (generate G {a})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma option_rel_range: "Range R = UNIV \<Longrightarrow> Range (\<langle>R\<rangle>option_rel) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Range R = UNIV \<Longrightarrow> Range (\<langle>R\<rangle>option_rel) = UNIV
[PROOF STEP]
apply (auto simp: option_rel_def Range_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Range R = UNIV; \<forall>a a'. x = Some a' \<longrightarrow> (a, a') \<notin> R\<rbrakk> \<Longrightarrow> x = None
[PROOF STEP]
by (metis Range_iff UNIV_I option.exhaust)


[STATEMENT]
lemma vars_example_2 :
  fixes e::"('v,integer) aexp"
  assumes "e = (\<lambda> \<sigma>. \<sigma> x - \<sigma> y)"
  assumes "x = y"
  shows   "vars e = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars e = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
e = (\<lambda>\<sigma>. \<sigma> x - \<sigma> y)
x = y

goal (1 subgoal):
 1. vars e = {}
[PROOF STEP]
by (auto simp add : vars_def)


[STATEMENT]
lemma holomorphic_on_chain:
  "g holomorphic_on t \<Longrightarrow> f holomorphic_on s \<Longrightarrow> f ` s \<subseteq> t \<Longrightarrow>
    (\<lambda>x. g (f x)) holomorphic_on s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g holomorphic_on t; f holomorphic_on s; f ` s \<subseteq> t\<rbrakk> \<Longrightarrow> (\<lambda>x. g (f x)) holomorphic_on s
[PROOF STEP]
using holomorphic_on_compose_gen[of f s g t]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f holomorphic_on s; g holomorphic_on t; f ` s \<subseteq> t\<rbrakk> \<Longrightarrow> g \<circ> f holomorphic_on s

goal (1 subgoal):
 1. \<lbrakk>g holomorphic_on t; f holomorphic_on s; f ` s \<subseteq> t\<rbrakk> \<Longrightarrow> (\<lambda>x. g (f x)) holomorphic_on s
[PROOF STEP]
by (simp add: o_def)


[STATEMENT]
lemma closed_imp_locally_compact:
  fixes S :: "'a :: heine_borel set"
  assumes "closed S"
    shows "locally compact S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally compact S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. locally compact S
[PROOF STEP]
have *: "\<exists>U V. x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> openin (top_of_set S) U \<and> compact V"
          if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U V. x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> openin (top_of_set S) U \<and> compact V
[PROOF STEP]
apply (rule_tac x = "S \<inter> ball x 1" in exI, rule_tac x = "S \<inter> cball x 1" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> S \<inter> ball x 1 \<and> S \<inter> ball x 1 \<subseteq> S \<inter> cball x 1 \<and> S \<inter> cball x 1 \<subseteq> S \<and> openin (top_of_set S) (S \<inter> ball x 1) \<and> compact (S \<inter> cball x 1)
[PROOF STEP]
using \<open>x \<in> S\<close> assms
[PROOF STATE]
proof (prove)
using this:
x \<in> S
closed S

goal (1 subgoal):
 1. x \<in> S \<inter> ball x 1 \<and> S \<inter> ball x 1 \<subseteq> S \<inter> cball x 1 \<and> S \<inter> cball x 1 \<subseteq> S \<and> openin (top_of_set S) (S \<inter> ball x 1) \<and> compact (S \<inter> cball x 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> \<exists>U V. ?x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> openin (top_of_set S) U \<and> compact V

goal (1 subgoal):
 1. locally compact S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally compact S
[PROOF STEP]
unfolding locally_compact
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v
[PROOF STEP]
by (blast intro: *)
[PROOF STATE]
proof (state)
this:
locally compact S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rsquarefree_poly_roots_eq:
  assumes "rsquarefree p"
  shows   "poly_roots p = mset_set {x. poly p x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_roots p = mset_set {x. poly p x = (0::'a)}
[PROOF STEP]
proof (rule multiset_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. count (poly_roots p) x = count (mset_set {x. poly p x = (0::'a)}) x
[PROOF STEP]
fix x :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. count (poly_roots p) x = count (mset_set {x. poly p x = (0::'a)}) x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
rsquarefree p
[PROOF STEP]
show "count (poly_roots p) x = count (mset_set {x. poly p x = 0}) x"
[PROOF STATE]
proof (prove)
using this:
rsquarefree p

goal (1 subgoal):
 1. count (poly_roots p) x = count (mset_set {x. poly p x = (0::'a)}) x
[PROOF STEP]
by (cases "poly p x = 0") (auto simp: poly_roots_finite order_eq_0_iff rsquarefree_def)
[PROOF STATE]
proof (state)
this:
count (poly_roots p) x = count (mset_set {x. poly p x = (0::'a)}) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma agree_on_comm[intro]: "agree_on X f g = agree_on X g f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. agree_on X f g = agree_on X g f
[PROOF STEP]
unfolding agree_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>v\<in>vertices X. f `` {v} = g `` {v}) = (\<forall>v\<in>vertices X. g `` {v} = f `` {v})
[PROOF STEP]
by auto


[STATEMENT]
lemma dim_vec_all_ones[simp]: "dim_vec (u\<^sub>v n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (u\<^sub>v n) = n
[PROOF STEP]
by (simp add: all_ones_vec_def)


[STATEMENT]
lemma dropWhile_append_all_False:
"\<forall>y \<in> set ys. \<not> P y \<Longrightarrow>
  dropWhile P (xs@ys) = dropWhile P xs @ ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>set ys. \<not> P y \<Longrightarrow> dropWhile P (xs @ ys) = dropWhile P xs @ ys
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>y\<in>set ys. \<not> P y \<Longrightarrow> dropWhile P ([] @ ys) = dropWhile P [] @ ys
 2. \<And>a xs. \<lbrakk>\<forall>y\<in>set ys. \<not> P y \<Longrightarrow> dropWhile P (xs @ ys) = dropWhile P xs @ ys; \<forall>y\<in>set ys. \<not> P y\<rbrakk> \<Longrightarrow> dropWhile P ((a # xs) @ ys) = dropWhile P (a # xs) @ ys
[PROOF STEP]
apply (auto simp add: dropWhile_all_False_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem ifex_ite_rel_bf: "
  (fi,i) \<in> bf_ifex_rel \<Longrightarrow>
  (ft,t) \<in> bf_ifex_rel \<Longrightarrow>
  (fe,e) \<in> bf_ifex_rel \<Longrightarrow>
  ((bf_ite fi ft fe), (ifex_ite i t e)) \<in> bf_ifex_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(fi, i) \<in> bf_ifex_rel; (ft, t) \<in> bf_ifex_rel; (fe, e) \<in> bf_ifex_rel\<rbrakk> \<Longrightarrow> (bf_ite fi ft fe, ifex_ite i t e) \<in> bf_ifex_rel
[PROOF STEP]
by (auto simp add:  bf_ifex_rel_def order_ifex_ite_invar minimal_ifex_ite_invar val_ifex_ite
         simp del: ifex_ite.simps)


[STATEMENT]
lemma gcd_factorial_dvd1: "gcd_factorial a b dvd a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd_factorial a b dvd a
[PROOF STEP]
proof (cases "a = 0 \<or> b = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> gcd_factorial a b dvd a
 2. \<not> (a = (0::'a) \<or> b = (0::'a)) \<Longrightarrow> gcd_factorial a b dvd a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (a = (0::'a) \<or> b = (0::'a))

goal (2 subgoals):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> gcd_factorial a b dvd a
 2. \<not> (a = (0::'a) \<or> b = (0::'a)) \<Longrightarrow> gcd_factorial a b dvd a
[PROOF STEP]
hence "gcd_factorial a b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (a = (0::'a) \<or> b = (0::'a))

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

goal (2 subgoals):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> gcd_factorial a b dvd a
 2. \<not> (a = (0::'a) \<or> b = (0::'a)) \<Longrightarrow> gcd_factorial a b dvd a
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> (a = (0::'a) \<or> b = (0::'a))
gcd_factorial a b \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (a = (0::'a) \<or> b = (0::'a))
gcd_factorial a b \<noteq> (0::'a)

goal (1 subgoal):
 1. gcd_factorial a b dvd a
[PROOF STEP]
by (subst prime_factorization_subset_iff_dvd [symmetric])
       (auto simp: prime_factorization_gcd_factorial)
[PROOF STATE]
proof (state)
this:
gcd_factorial a b dvd a

goal (1 subgoal):
 1. a = (0::'a) \<or> b = (0::'a) \<Longrightarrow> gcd_factorial a b dvd a
[PROOF STEP]
qed (auto simp: gcd_factorial_def)


[STATEMENT]
lemma focus_plus: "focus X (p + q) = focus X p + focus X q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. focus X (p + q) = focus X p + focus X q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. focus X (p + q) = focus X p + focus X q
[PROOF STEP]
have "finite (keys p \<union> keys q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (keys p \<union> keys q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (keys p \<union> keys q)

goal (1 subgoal):
 1. focus X (p + q) = focus X p + focus X q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (keys p \<union> keys q)

goal (1 subgoal):
 1. focus X (p + q) = focus X p + focus X q
[PROOF STEP]
have "keys (p + q) \<subseteq> keys p \<union> keys q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (p + q) \<subseteq> keys p \<union> keys q
[PROOF STEP]
by (rule Poly_Mapping.keys_add)
[PROOF STATE]
proof (state)
this:
keys (p + q) \<subseteq> keys p \<union> keys q

goal (1 subgoal):
 1. focus X (p + q) = focus X p + focus X q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (keys p \<union> keys q)
keys (p + q) \<subseteq> keys p \<union> keys q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (keys p \<union> keys q)
keys (p + q) \<subseteq> keys p \<union> keys q

goal (1 subgoal):
 1. focus X (p + q) = focus X p + focus X q
[PROOF STEP]
by (simp add: focus_superset[where A="keys p \<union> keys q"] lookup_add single_add sum.distrib)
[PROOF STATE]
proof (state)
this:
focus X (p + q) = focus X p + focus X q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_less_suminf2:
  "summable f \<Longrightarrow> (\<And>m. m\<ge>n \<Longrightarrow> 0 \<le> f m) \<Longrightarrow> n \<le> i \<Longrightarrow> 0 < f i \<Longrightarrow> sum f {..<n} < suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) \<le> f m; n \<le> i; (0::'a) < f i\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f
[PROOF STEP]
using sum_le_suminf[of f "{..< Suc i}"]
    and add_strict_increasing[of "f i" "sum f {..<n}" "sum f {..<i}"]
    and sum_mono2[of "{..<i}" "{..<n}" f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>summable f; finite {..<Suc i}; \<And>n. n \<in> - {..<Suc i} \<Longrightarrow> (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> sum f {..<Suc i} \<le> suminf f
\<lbrakk>(0::'a) < f i; sum f {..<n} \<le> sum f {..<i}\<rbrakk> \<Longrightarrow> sum f {..<n} < f i + sum f {..<i}
\<lbrakk>finite {..<i}; {..<n} \<subseteq> {..<i}; \<And>b. b \<in> {..<i} - {..<n} \<Longrightarrow> (0::'a) \<le> f b\<rbrakk> \<Longrightarrow> sum f {..<n} \<le> sum f {..<i}

goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) \<le> f m; n \<le> i; (0::'a) < f i\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f
[PROOF STEP]
by (auto simp: less_imp_le ac_simps)


[STATEMENT]
lemma icomp_fcomp: "\<theta> \<circ>\<^sub>s i = fsub_to_isub (isub_to_fsub \<theta> \<cdot> isub_to_fsub i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<theta> \<circ>\<^sub>s i = (\<lambda>x. fterm_to_iterm (((\<lambda>x. iterm_to_fterm (\<theta> x)) \<cdot> (\<lambda>x. iterm_to_fterm (i x))) x))
[PROOF STEP]
unfolding composition_def subst_compose_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<theta> x \<cdot> i) = (\<lambda>x. fterm_to_iterm (iterm_to_fterm (\<theta> x) \<cdot>\<^sub>t (\<lambda>x. iterm_to_fterm (i x))))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<theta> x \<cdot> i = fterm_to_iterm (iterm_to_fterm (\<theta> x) \<cdot>\<^sub>t (\<lambda>x. iterm_to_fterm (i x)))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<theta> x \<cdot> i = fterm_to_iterm (iterm_to_fterm (\<theta> x) \<cdot>\<^sub>t (\<lambda>x. iterm_to_fterm (i x)))
[PROOF STEP]
show "\<theta> x \<cdot> i = fterm_to_iterm (iterm_to_fterm (\<theta> x) \<cdot>\<^sub>t (\<lambda>x. iterm_to_fterm (i x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<theta> x \<cdot> i = fterm_to_iterm (iterm_to_fterm (\<theta> x) \<cdot>\<^sub>t (\<lambda>x. iterm_to_fterm (i x)))
[PROOF STEP]
using iterm_to_fterm_subt
[PROOF STATE]
proof (prove)
using this:
iterm_to_fterm ?t1.0 \<cdot>\<^sub>t ?\<sigma> = iterm_to_fterm (?t1.0 \<cdot> (\<lambda>x. fterm_to_iterm (?\<sigma> x)))

goal (1 subgoal):
 1. \<theta> x \<cdot> i = fterm_to_iterm (iterm_to_fterm (\<theta> x) \<cdot>\<^sub>t (\<lambda>x. iterm_to_fterm (i x)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<theta> x \<cdot> i = fterm_to_iterm (iterm_to_fterm (\<theta> x) \<cdot>\<^sub>t (\<lambda>x. iterm_to_fterm (i x)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma apply_inverse_eq_apply_power_order_minus_one:
  "(inverse f) \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
proof (cases "order f a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. order f a = 0 \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
 2. \<And>nat. order f a = Suc nat \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
order f a = 0

goal (2 subgoals):
 1. order f a = 0 \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
 2. \<And>nat. order f a = Suc nat \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
with order_greater_zero [of f a]
[PROOF STATE]
proof (chain)
picking this:
0 < order f a
order f a = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < order f a
order f a = 0

goal (1 subgoal):
 1. inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a

goal (1 subgoal):
 1. \<And>nat. order f a = Suc nat \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. order f a = Suc nat \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
order f a = Suc n

goal (1 subgoal):
 1. \<And>nat. order f a = Suc nat \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
order f a = Suc n

goal (1 subgoal):
 1. \<And>nat. order f a = Suc nat \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
have "(f ^ order f a) \<langle>$\<rangle> a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^ order f a) \<langle>$\<rangle> a = a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f ^ order f a) \<langle>$\<rangle> a = a

goal (1 subgoal):
 1. \<And>nat. order f a = Suc nat \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f ^ order f a) \<langle>$\<rangle> a = a
[PROOF STEP]
have *: "(inverse f) \<langle>$\<rangle> ((f ^ order f a) \<langle>$\<rangle> a) = (inverse f) \<langle>$\<rangle> a"
[PROOF STATE]
proof (prove)
using this:
(f ^ order f a) \<langle>$\<rangle> a = a

goal (1 subgoal):
 1. inverse f \<langle>$\<rangle> ((f ^ order f a) \<langle>$\<rangle> a) = inverse f \<langle>$\<rangle> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inverse f \<langle>$\<rangle> ((f ^ order f a) \<langle>$\<rangle> a) = inverse f \<langle>$\<rangle> a

goal (1 subgoal):
 1. \<And>nat. order f a = Suc nat \<Longrightarrow> inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
order f a = Suc n
inverse f \<langle>$\<rangle> ((f ^ order f a) \<langle>$\<rangle> a) = inverse f \<langle>$\<rangle> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
order f a = Suc n
inverse f \<langle>$\<rangle> ((f ^ order f a) \<langle>$\<rangle> a) = inverse f \<langle>$\<rangle> a

goal (1 subgoal):
 1. inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a
[PROOF STEP]
by (simp add: apply_sequence mult.assoc [symmetric])
[PROOF STATE]
proof (state)
this:
inverse f \<langle>$\<rangle> a = (f ^ (order f a - 1)) \<langle>$\<rangle> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SourceOfDSource:
  assumes  "Z \<in> Sources i S"
         and  "S \<in> DSources i C"
  shows     "Z \<in> Sources i C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Z \<in> Sources i C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Z \<in> Sources i S
S \<in> DSources i C

goal (1 subgoal):
 1. Z \<in> Sources i C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Z \<in> Sources i S; S \<in> DSources i C\<rbrakk> \<Longrightarrow> Z \<in> Sources i C
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Z \<in> Sources i S
S \<in> DSources i C
[PROOF STEP]
have "Sources i S \<subseteq> Sources i C"
[PROOF STATE]
proof (prove)
using this:
Z \<in> Sources i S
S \<in> DSources i C

goal (1 subgoal):
 1. Sources i S \<subseteq> Sources i C
[PROOF STEP]
by (simp add: DSource_Sources)
[PROOF STATE]
proof (state)
this:
Sources i S \<subseteq> Sources i C

goal (1 subgoal):
 1. \<lbrakk>Z \<in> Sources i S; S \<in> DSources i C\<rbrakk> \<Longrightarrow> Z \<in> Sources i C
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Sources i S \<subseteq> Sources i C

goal (1 subgoal):
 1. Z \<in> Sources i C
[PROOF STEP]
by (metis (full_types) assms(1) rev_subsetD)
[PROOF STATE]
proof (state)
this:
Z \<in> Sources i C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closure_lessThan[simp]:
  fixes b::"'a::{no_bot, linorder_topology, dense_order}"
  shows "closure {..<b} = {..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure {..<b} = {..b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure {..<b} = {..b}
[PROOF STEP]
from lt_ex
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. y < ?x
[PROOF STEP]
obtain a where "a < b"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. y < ?x

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

goal (1 subgoal):
 1. closure {..<b} = {..b}
[PROOF STEP]
hence "{..<b} = {a<..<b} \<union> {..a}"
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. {..<b} = {a<..<b} \<union> {..a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{..<b} = {a<..<b} \<union> {..a}

goal (1 subgoal):
 1. closure {..<b} = {..b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{..<b} = {a<..<b} \<union> {..a}

goal (1 subgoal):
 1. closure {..<b} = {..b}
[PROOF STEP]
have "closure \<dots> = {..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure ({a<..<b} \<union> {..a}) = {..b}
[PROOF STEP]
using \<open>a < b\<close>
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. closure ({a<..<b} \<union> {..a}) = {..b}
[PROOF STEP]
unfolding closure_Un
[PROOF STATE]
proof (prove)
using this:
a < b

goal (1 subgoal):
 1. closure {a<..<b} \<union> closure {..a} = {..b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closure ({a<..<b} \<union> {..a}) = {..b}

goal (1 subgoal):
 1. closure {..<b} = {..b}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closure {..<b} = {..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closure {..<b} = {..b}

goal (1 subgoal):
 1. closure {..<b} = {..b}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
closure {..<b} = {..b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_fseq_eq: "fseq_eq f g \<Longrightarrow> fseq_eq (map_fseq h f) (map_fseq h g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fseq_eq f g \<Longrightarrow> fseq_eq (map_fseq h f) (map_fseq h g)
[PROOF STEP]
unfolding fseq_eq_unfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {n. ap_fseq f n \<noteq> ap_fseq g n} \<Longrightarrow> finite {n. ap_fseq (map_fseq h f) n \<noteq> ap_fseq (map_fseq h g) n}
[PROOF STEP]
by(auto elim!: finite_subset[rotated])


[STATEMENT]
lemma compose_append [simp]:
  "compose (ss @ ts) = compose ss \<circ>\<^sub>s compose ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compose (ss @ ts) = compose ss \<circ>\<^sub>s compose ts
[PROOF STEP]
using foldr_assoc [of "(\<circ>\<^sub>s)" ss Var "foldr (\<circ>\<^sub>s) ts Var"]
[PROOF STATE]
proof (prove)
using this:
(\<And>f g h. f \<circ>\<^sub>s g \<circ>\<^sub>s h = f \<circ>\<^sub>s (g \<circ>\<^sub>s h)) \<Longrightarrow> foldr (\<circ>\<^sub>s) ss (Var \<circ>\<^sub>s foldr (\<circ>\<^sub>s) ts Var) = foldr (\<circ>\<^sub>s) ss Var \<circ>\<^sub>s foldr (\<circ>\<^sub>s) ts Var

goal (1 subgoal):
 1. compose (ss @ ts) = compose ss \<circ>\<^sub>s compose ts
[PROOF STEP]
by (simp add: compose_def ac_simps)


[STATEMENT]
lemma (in group) abelian_subgroup_generated:
  assumes "comm_group G"
  shows "comm_group (subgroup_generated G S)" (is "comm_group ?GS")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group (subgroup_generated G S)
[PROOF STEP]
proof (rule group.group_comm_groupI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Group.group (subgroup_generated G S)
 2. \<And>x y. \<lbrakk>x \<in> carrier (subgroup_generated G S); y \<in> carrier (subgroup_generated G S)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G S\<^esub> y = y \<otimes>\<^bsub>subgroup_generated G S\<^esub> x
[PROOF STEP]
show "Group.group ?GS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (subgroup_generated G S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Group.group (subgroup_generated G S)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (subgroup_generated G S); y \<in> carrier (subgroup_generated G S)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G S\<^esub> y = y \<otimes>\<^bsub>subgroup_generated G S\<^esub> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (subgroup_generated G S); y \<in> carrier (subgroup_generated G S)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G S\<^esub> y = y \<otimes>\<^bsub>subgroup_generated G S\<^esub> x
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (subgroup_generated G S); y \<in> carrier (subgroup_generated G S)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G S\<^esub> y = y \<otimes>\<^bsub>subgroup_generated G S\<^esub> x
[PROOF STEP]
assume "x \<in> carrier ?GS" "y \<in> carrier ?GS"
[PROOF STATE]
proof (state)
this:
x \<in> carrier (subgroup_generated G S)
y \<in> carrier (subgroup_generated G S)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (subgroup_generated G S); y \<in> carrier (subgroup_generated G S)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G S\<^esub> y = y \<otimes>\<^bsub>subgroup_generated G S\<^esub> x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
comm_group G
x \<in> carrier (subgroup_generated G S)
y \<in> carrier (subgroup_generated G S)
[PROOF STEP]
show "x \<otimes>\<^bsub>?GS\<^esub> y = y \<otimes>\<^bsub>?GS\<^esub> x"
[PROOF STATE]
proof (prove)
using this:
comm_group G
x \<in> carrier (subgroup_generated G S)
y \<in> carrier (subgroup_generated G S)

goal (1 subgoal):
 1. x \<otimes>\<^bsub>subgroup_generated G S\<^esub> y = y \<otimes>\<^bsub>subgroup_generated G S\<^esub> x
[PROOF STEP]
apply (simp add: subgroup_generated_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>comm_group G; x \<in> generate G (carrier G \<inter> S); y \<in> generate G (carrier G \<inter> S)\<rbrakk> \<Longrightarrow> x \<otimes> y = y \<otimes> x
[PROOF STEP]
by (meson Int_lower1 comm_groupE(4) generate_in_carrier)
[PROOF STATE]
proof (state)
this:
x \<otimes>\<^bsub>subgroup_generated G S\<^esub> y = y \<otimes>\<^bsub>subgroup_generated G S\<^esub> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma spectral_radius_aux:
  fixes x::"'a::real_normed_algebra_1"
  defines "V \<equiv> {root n (norm(x^n))| n. n>0}"
  shows "\<And>t. t\<in>V \<Longrightarrow> t \<ge> spectral_radius x"
        "\<And>t. t\<in>V \<Longrightarrow> t \<ge> 0"
        "bdd_below V"
        "V \<noteq> {}"
        "Inf V \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<And>t. t \<in> V \<Longrightarrow> spectral_radius x \<le> t) &&& (\<And>t. t \<in> V \<Longrightarrow> 0 \<le> t)) &&& bdd_below V &&& V \<noteq> {} &&& 0 \<le> Inf V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>t. t \<in> V \<Longrightarrow> spectral_radius x \<le> t
 2. \<And>t. t \<in> V \<Longrightarrow> 0 \<le> t
 3. bdd_below V
 4. V \<noteq> {}
 5. 0 \<le> Inf V
[PROOF STEP]
show "V\<noteq>{}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<noteq> {}
[PROOF STEP]
using V_def
[PROOF STATE]
proof (prove)
using this:
V \<equiv> {root n (norm (x ^ n)) |n. 0 < n}

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

goal (4 subgoals):
 1. \<And>t. t \<in> V \<Longrightarrow> spectral_radius x \<le> t
 2. \<And>t. t \<in> V \<Longrightarrow> 0 \<le> t
 3. bdd_below V
 4. 0 \<le> Inf V
[PROOF STEP]
show *: "t \<ge> 0" if "t \<in> V" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> t
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
t \<in> V

goal (1 subgoal):
 1. 0 \<le> t
[PROOF STEP]
unfolding V_def
[PROOF STATE]
proof (prove)
using this:
t \<in> {root n (norm (x ^ n)) |n. 0 < n}

goal (1 subgoal):
 1. 0 \<le> t
[PROOF STEP]
using real_root_pos_pos_le
[PROOF STATE]
proof (prove)
using this:
t \<in> {root n (norm (x ^ n)) |n. 0 < n}
0 \<le> ?x \<Longrightarrow> 0 \<le> root ?n ?x

goal (1 subgoal):
 1. 0 \<le> t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?t \<in> V \<Longrightarrow> 0 \<le> ?t

goal (3 subgoals):
 1. \<And>t. t \<in> V \<Longrightarrow> spectral_radius x \<le> t
 2. bdd_below V
 3. 0 \<le> Inf V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?t \<in> V \<Longrightarrow> 0 \<le> ?t
[PROOF STEP]
show "bdd_below V"
[PROOF STATE]
proof (prove)
using this:
?t \<in> V \<Longrightarrow> 0 \<le> ?t

goal (1 subgoal):
 1. bdd_below V
[PROOF STEP]
by (meson bdd_below_def)
[PROOF STATE]
proof (state)
this:
bdd_below V

goal (2 subgoals):
 1. \<And>t. t \<in> V \<Longrightarrow> spectral_radius x \<le> t
 2. 0 \<le> Inf V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bdd_below V
[PROOF STEP]
show "Inf V \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
bdd_below V

goal (1 subgoal):
 1. 0 \<le> Inf V
[PROOF STEP]
by (simp add: \<open>V \<noteq> {}\<close> * cInf_greatest)
[PROOF STATE]
proof (state)
this:
0 \<le> Inf V

goal (1 subgoal):
 1. \<And>t. t \<in> V \<Longrightarrow> spectral_radius x \<le> t
[PROOF STEP]
show "\<And>t. t\<in>V \<Longrightarrow> t \<ge> spectral_radius x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. t \<in> V \<Longrightarrow> spectral_radius x \<le> t
[PROOF STEP]
by (metis (mono_tags, lifting) \<open>bdd_below V\<close> assms cInf_lower spectral_radius_def)
[PROOF STATE]
proof (state)
this:
?t \<in> V \<Longrightarrow> spectral_radius x \<le> ?t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma m_o_widen: "\<lbrakk> finite X; domo S2 \<subseteq> X; \<not> S2 \<sqsubseteq> S1 \<rbrakk> \<Longrightarrow>
  m_o (m_st m_ivl) (2 * card X) (S1 \<nabla> S2) < m_o (m_st m_ivl) (2 * card X) S1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; domo S2 \<subseteq> X; \<not> S2 \<sqsubseteq> S1\<rbrakk> \<Longrightarrow> m_o (m_st m_ivl) (2 * card X) (S1 \<nabla> S2) < m_o (m_st m_ivl) (2 * card X) S1
[PROOF STEP]
by(auto simp: m_o_def domo_def m_st_height less_Suc_eq_le m_st_widen
        split: option.split)


[STATEMENT]
lemma binomial_addition_formula:
  "0 < n \<Longrightarrow> n choose (Suc k) = ((n - 1) choose (Suc k)) + ((n - 1) choose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> n choose Suc k = n - 1 choose Suc k + (n - 1 choose k)
[PROOF STEP]
by (subst choose_reduce_nat) simp_all


[STATEMENT]
theorem wls_freshAbs_psubstAbs_E1:
assumes "wlsAbs (us,s) A" and "wlsEnv rho"
and "rho ys y = None" and "freshAbs zs z (A $[rho])"
shows "freshAbs ys y A \<or> (ys \<noteq> zs \<or> y \<noteq> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshAbs ys y A \<or> ys \<noteq> zs \<or> y \<noteq> z
[PROOF STEP]
using assms freshAbs_psubstAbs_E1[of A rho ys y zs z]
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wlsEnv rho
rho ys y = None
freshAbs zs z A $[rho]
\<lbrakk>goodAbs A; goodEnv rho; rho ys y = None; freshAbs zs z A $[rho]\<rbrakk> \<Longrightarrow> freshAbs ys y A \<or> ys \<noteq> zs \<or> y \<noteq> z

goal (1 subgoal):
 1. freshAbs ys y A \<or> ys \<noteq> zs \<or> y \<noteq> z
[PROOF STEP]
by simp


[STATEMENT]
lemma spmf_bind: "spmf (p \<bind> f) y = \<integral> x. spmf (f x) y \<partial>measure_spmf p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spmf (p \<bind> f) y = LINT x|measure_spmf p. spmf (f x) y
[PROOF STEP]
unfolding measure_spmf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spmf (p \<bind> f) y = LINT x|distr (restrict_space (measure_pmf p) (range Some)) (count_space UNIV) the. spmf (f x) y
[PROOF STEP]
by(subst integral_distr)(auto simp add: bind_spmf_def pmf_bind integral_restrict_space indicator_eq_0_iff intro!: Bochner_Integration.integral_cong split: option.split)


[STATEMENT]
lemma infsum_mono:
  fixes f :: "'a\<Rightarrow>'b::{ordered_comm_monoid_add,linorder_topology}"
  assumes "f summable_on A" and "g summable_on A"
  assumes \<open>\<And>x. x \<in> A \<Longrightarrow> f x \<le> g x\<close>
  shows "infsum f A \<le> infsum g A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f A \<le> infsum g A
[PROOF STEP]
apply (rule infsum_mono_neutral)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. f summable_on A
 2. g summable_on A
 3. \<And>x. x \<in> A \<inter> A \<Longrightarrow> f x \<le> g x
 4. \<And>x. x \<in> A - A \<Longrightarrow> f x \<le> (0::'b)
 5. \<And>x. x \<in> A - A \<Longrightarrow> (0::'b) \<le> g x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f summable_on A
g summable_on A
?x \<in> A \<Longrightarrow> f ?x \<le> g ?x

goal (5 subgoals):
 1. f summable_on A
 2. g summable_on A
 3. \<And>x. x \<in> A \<inter> A \<Longrightarrow> f x \<le> g x
 4. \<And>x. x \<in> A - A \<Longrightarrow> f x \<le> (0::'b)
 5. \<And>x. x \<in> A - A \<Longrightarrow> (0::'b) \<le> g x
[PROOF STEP]
by auto


[STATEMENT]
lemma trefoil:
"kauff_mat ([cup,cup]*[vert,over,vert]*[vert,over,vert]*[vert,over,vert]
              *(basic [cap,cap]))
          = [[trefoil_polynomial]]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat ([cup, cup] * [vert, over, vert] * [vert, over, vert] * [vert, over, vert] * basic [cap, cap]) = [[trefoil_polynomial]]
[PROOF STEP]
by(simp add: mat_multI_def matT_vec_multI_def rat_poly.row_length_def
   scalar_prod trefoil_polynomial_def)


[STATEMENT]
lemma list_product_fset_of_list[simp]:
  "fset_of_list ` (A \<otimes>\<^sub>l B) = (fset_of_list ` A) \<otimes> (fset_of_list ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fset_of_list ` (A \<otimes>\<^sub>l B) = fset_of_list ` A \<otimes> fset_of_list ` B
[PROOF STEP]
unfolding list_product_def product_def image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<in>{a @ b |a b. a \<in> A \<and> b \<in> B}. y = fset_of_list x} = {a |\<union>| b |a b. a \<in> {y. \<exists>x\<in>A. y = fset_of_list x} \<and> b \<in> {y. \<exists>x\<in>B. y = fset_of_list x}}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma "~ deterministic_init BIT_init"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> deterministic_init BIT_init
[PROOF STEP]
unfolding deterministic_init_def BIT_init_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>init. card (set_pmf (map_pmf (\<lambda>l. (l, init)) (bv (length init)))) = 1)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>init. card ((\<lambda>l. (l, init)) ` set_pmf (bv (length init))) \<noteq> Suc 0
[PROOF STEP]
apply(intro exI[where x="[a]"])
  \<comment> \<open>comment in a proof\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>l. (l, [a])) ` set_pmf (bv (length [a]))) \<noteq> Suc 0
[PROOF STEP]
by(auto simp: UNIV_bool set_pmf_bernoulli)


[STATEMENT]
lemma local_flow_ball: "local_flow (f g) UNIV UNIV (\<phi> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_flow (f g) UNIV UNIV (\<lambda>t s. \<chi>i. if i = 1 then g * t\<^sup>2 / 2 + s $ 2 * t + s $ 1 else g * t + s $ 2)
[PROOF STEP]
apply(unfold_locales, simp_all add: local_lipschitz_def lipschitz_on_def vec_eq_iff, clarsimp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x t. \<exists>u>0. (\<exists>ta. dist t ta \<le> u) \<longrightarrow> (\<exists>L\<ge>0. \<forall>xa\<in>cball x u. \<forall>y\<in>cball x u. dist (f g xa) (f g y) \<le> L * dist xa y)
 2. \<And>t s. \<forall>i.  D (\<lambda>x. if i = 1 then g * x\<^sup>2 / 2 + s $ 2 * x + s $ 1 else g * x + s $ 2) = (\<lambda>x. if i = 1 then (\<chi>i. if i = 1 then g * x\<^sup>2 / 2 + s $ 2 * x + s $ 1 else g * x + s $ 2) $ 2 else g) on {0--t}
 3. \<And>s. \<forall>i. i \<noteq> 1 \<longrightarrow> s $ 2 = s $ i
[PROOF STEP]
apply(rule_tac x="1/2" in exI, clarsimp, rule_tac x=1 in exI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x t ta. dist t ta * 2 \<le> 1 \<Longrightarrow> 0 \<le> 1 \<and> (\<forall>xa\<in>cball x (1 / 2). \<forall>y\<in>cball x (1 / 2). dist (f g xa) (f g y) \<le> 1 * dist xa y)
 2. \<And>t s. \<forall>i.  D (\<lambda>x. if i = 1 then g * x\<^sup>2 / 2 + s $ 2 * x + s $ 1 else g * x + s $ 2) = (\<lambda>x. if i = 1 then (\<chi>i. if i = 1 then g * x\<^sup>2 / 2 + s $ 2 * x + s $ 1 else g * x + s $ 2) $ 2 else g) on {0--t}
 3. \<And>s. \<forall>i. i \<noteq> 1 \<longrightarrow> s $ 2 = s $ i
[PROOF STEP]
apply(simp add: dist_norm norm_vec_def L2_set_def UNIV_2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t s. \<forall>i.  D (\<lambda>x. if i = 1 then g * x\<^sup>2 / 2 + s $ 2 * x + s $ 1 else g * x + s $ 2) = (\<lambda>x. if i = 1 then (\<chi>i. if i = 1 then g * x\<^sup>2 / 2 + s $ 2 * x + s $ 1 else g * x + s $ 2) $ 2 else g) on {0--t}
 2. \<And>s. \<forall>i. i \<noteq> 1 \<longrightarrow> s $ 2 = s $ i
[PROOF STEP]
by (auto simp: forall_2 intro!: poly_derivatives)


[STATEMENT]
lemma rank1_compose_right: \<open>rank1 (a o\<^sub>C\<^sub>L b)\<close> if \<open>rank1 a\<close> and \<open>a o\<^sub>C\<^sub>L b \<noteq> 0\<close>
  for b :: \<open>'a::chilbert_space \<Rightarrow>\<^sub>C\<^sub>L 'b::chilbert_space\<close> and a :: \<open>'b \<Rightarrow>\<^sub>C\<^sub>L 'c::chilbert_space\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank1 (a o\<^sub>C\<^sub>L b)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
rank1 a
a o\<^sub>C\<^sub>L b \<noteq> 0

goal (1 subgoal):
 1. rank1 (a o\<^sub>C\<^sub>L b)
[PROOF STEP]
apply (auto simp: rank1_iff_butterfly butterfly_comp_cblinfun)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<psi> \<phi>. \<lbrakk>butterfly \<psi> (b* *\<^sub>V \<phi>) \<noteq> 0; butterfly \<psi> \<phi> \<noteq> 0; a = butterfly \<psi> \<phi>\<rbrakk> \<Longrightarrow> \<exists>\<psi>' \<phi>'. butterfly \<psi> (b* *\<^sub>V \<phi>) = butterfly \<psi>' \<phi>'
[PROOF STEP]
by blast


[STATEMENT]
lemma sin_ms_aux':
  assumes "ms_exp_gt 0 (ms_aux_hd_exp xs)" "basis_wf basis" "is_expansion_aux xs f basis"
  shows   "is_expansion_aux (sin_ms_aux' xs) (\<lambda>x. sin (f x)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_expansion_aux (sin_ms_aux' xs) (\<lambda>x. sin (f x)) basis
[PROOF STEP]
unfolding sin_ms_aux'_def sin_conv_pre_sin power2_eq_square
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_expansion_aux (times_ms_aux xs (powser_ms_aux (msllist_of_msstream sin_series_stream) (times_ms_aux xs xs))) (\<lambda>x. f x * powser (msllist_of_msstream sin_series_stream) (f x * f x)) basis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ms_exp_gt 0 (ms_aux_hd_exp xs)
basis_wf basis
is_expansion_aux xs f basis

goal (1 subgoal):
 1. is_expansion_aux (times_ms_aux xs (powser_ms_aux (msllist_of_msstream sin_series_stream) (times_ms_aux xs xs))) (\<lambda>x. f x * powser (msllist_of_msstream sin_series_stream) (f x * f x)) basis
[PROOF STEP]
by (intro times_ms_aux powser_ms_aux[unfolded o_def] convergent_powser_sin_series_stream)
     (auto simp: hd_exp_times add_neg_neg split: option.splits)


[STATEMENT]
lemma  vec_hom_inj: "map_vec hom v = map_vec hom w \<Longrightarrow> v = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_vec hom v = map_vec hom w \<Longrightarrow> v = w
[PROOF STEP]
unfolding vec_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (map_vec hom v) = dim_vec (map_vec hom w) \<and> (\<forall>i<dim_vec (map_vec hom w). map_vec hom v $ i = map_vec hom w $ i) \<Longrightarrow> dim_vec v = dim_vec w \<and> (\<forall>i<dim_vec w. v $ i = w $ i)
[PROOF STEP]
by auto


[STATEMENT]
lemma Zfun_diff: "Zfun f F \<Longrightarrow> Zfun g F \<Longrightarrow> Zfun (\<lambda>x. f x - g x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Zfun f F; Zfun g F\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. f x - g x) F
[PROOF STEP]
using Zfun_add [of f F "\<lambda>x. - g x"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Zfun f F; Zfun (\<lambda>x. - g x) F\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. f x + - g x) F

goal (1 subgoal):
 1. \<lbrakk>Zfun f F; Zfun g F\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. f x - g x) F
[PROOF STEP]
by (simp add: Zfun_minus)


[STATEMENT]
lemma eqMaximumI:
  assumes "x \<in> S"
  and "\<And> y. y \<in> S \<Longrightarrow> y \<le> x"
shows "Maximum S = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Maximum S = x
[PROOF STEP]
unfolding Maximum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE x. x \<in> S \<and> (\<forall>y\<in>S. y \<le> x)) = x
[PROOF STEP]
by (standard, insert assms, auto, fastforce)


[STATEMENT]
lemma lucas_lehmer_hom_1 [simp]: "lucas_lehmer_hom m (1, 0) = (1, 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lucas_lehmer_hom m (1, 0) = (1, 0)
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
1 < m

goal (1 subgoal):
 1. lucas_lehmer_hom m (1, 0) = (1, 0)
[PROOF STEP]
by (simp add: lucas_lehmer_hom_def)


[STATEMENT]
lemma (in normal) inv_op_closed1:
  assumes "x \<in> carrier G" and "h \<in> H"
  shows "(inv x) \<otimes> h \<otimes> x \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv x \<otimes> h \<otimes> x \<in> H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv x \<otimes> h \<otimes> x \<in> H
[PROOF STEP]
have "h \<otimes> x \<in> x <# H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<otimes> x \<in> x <# H
[PROOF STEP]
using assms coset_eq assms(1)
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
h \<in> H
\<forall>x\<in>carrier G. H #> x = x <# H
x \<in> carrier G

goal (1 subgoal):
 1. h \<otimes> x \<in> x <# H
[PROOF STEP]
unfolding r_coset_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
h \<in> H
\<forall>x\<in>carrier G. (\<Union>h\<in>H. {h \<otimes> x}) = x <# H
x \<in> carrier G

goal (1 subgoal):
 1. h \<otimes> x \<in> x <# H
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h \<otimes> x \<in> x <# H

goal (1 subgoal):
 1. inv x \<otimes> h \<otimes> x \<in> H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h \<otimes> x \<in> x <# H
[PROOF STEP]
obtain h' where "h' \<in> H" "h \<otimes> x = x \<otimes> h'"
[PROOF STATE]
proof (prove)
using this:
h \<otimes> x \<in> x <# H

goal (1 subgoal):
 1. (\<And>h'. \<lbrakk>h' \<in> H; h \<otimes> x = x \<otimes> h'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding l_coset_def
[PROOF STATE]
proof (prove)
using this:
h \<otimes> x \<in> (\<Union>h\<in>H. {x \<otimes> h})

goal (1 subgoal):
 1. (\<And>h'. \<lbrakk>h' \<in> H; h \<otimes> x = x \<otimes> h'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h' \<in> H
h \<otimes> x = x \<otimes> h'

goal (1 subgoal):
 1. inv x \<otimes> h \<otimes> x \<in> H
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
h' \<in> H
h \<otimes> x = x \<otimes> h'

goal (1 subgoal):
 1. inv x \<otimes> h \<otimes> x \<in> H
[PROOF STEP]
by (metis assms inv_closed l_inv l_one m_assoc mem_carrier)
[PROOF STATE]
proof (state)
this:
inv x \<otimes> h \<otimes> x \<in> H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_finite_geq_on_closure:
  fixes f :: "'a::euclidean_space \<Rightarrow> ereal"
  assumes "convex_on UNIV f"
  assumes "convex S" "finite_on S f"
  assumes "\<forall>x\<in>S. f x \<ge> a"
  shows "\<forall>x\<in>closure S. f x \<ge> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
have "S \<le> domain f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> domain f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Lower_Semicontinuous.convex_on UNIV f
convex S
finite_on S f
\<forall>x\<in>S. a \<le> f x

goal (1 subgoal):
 1. S \<subseteq> domain f
[PROOF STEP]
unfolding finite_on_def domain_def
[PROOF STATE]
proof (prove)
using this:
Lower_Semicontinuous.convex_on UNIV f
convex S
\<forall>x\<in>S. f x \<noteq> \<infinity> \<and> f x \<noteq> - \<infinity>
\<forall>x\<in>S. a \<le> f x

goal (1 subgoal):
 1. S \<subseteq> {x. f x < \<infinity>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<subseteq> domain f

goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
S \<subseteq> domain f

goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
assume "\<not>(\<forall>x\<in>closure S. f x \<ge> a)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x\<in>closure S. a \<le> f x)

goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
hence "\<exists>x\<in>closure S. f x < a"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x\<in>closure S. a \<le> f x)

goal (1 subgoal):
 1. \<exists>x\<in>closure S. f x < a
[PROOF STEP]
by (simp add: not_le)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>closure S. f x < a

goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>closure S. f x < a

goal (1 subgoal):
 1. False
[PROOF STEP]
using convex_less_inS[of f S a] assms \<open>S \<le> domain f\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>closure S. f x < a
\<lbrakk>Lower_Semicontinuous.convex_on UNIV f; convex S; S \<subseteq> domain f; \<exists>x\<in>closure S. f x < a\<rbrakk> \<Longrightarrow> \<exists>x\<in>S. f x < a
Lower_Semicontinuous.convex_on UNIV f
convex S
finite_on S f
\<forall>x\<in>S. a \<le> f x
S \<subseteq> domain f

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

goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x\<in>closure S. a \<le> f x) \<Longrightarrow> False

goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x\<in>closure S. a \<le> f x) \<Longrightarrow> False

goal (1 subgoal):
 1. \<forall>x\<in>closure S. a \<le> f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>closure S. a \<le> f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parabolic_isometryI:
  assumes "isometry f"
          "\<not>bounded {(f^^n) x|n. True}"
          "stable_translation_length f = 0"
  shows "parabolic_isometry f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parabolic_isometry f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isometry f
\<not> bounded {(f ^^ n) x |n. True}
stable_translation_length f = 0

goal (1 subgoal):
 1. parabolic_isometry f
[PROOF STEP]
unfolding parabolic_isometry_def elliptic_isometry_def
[PROOF STATE]
proof (prove)
using this:
isometry f
\<not> bounded {(f ^^ n) x |n. True}
stable_translation_length f = 0

goal (1 subgoal):
 1. isometry f \<and> \<not> (isometry f \<and> (\<forall>x. bounded {(f ^^ n) x |n. True})) \<and> stable_translation_length f = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma binop_wf_dfa:
  assumes A: "wf_dfa A n" and B: "wf_dfa B n"
  shows "wf_dfa (binop_dfa f A B) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_dfa (binop_dfa f A B) n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wf_dfa (binop_dfa f A B) n
[PROOF STEP]
from A B
[PROOF STATE]
proof (chain)
picking this:
wf_dfa A n
wf_dfa B n
[PROOF STEP]
interpret prod_DFS A B n
[PROOF STATE]
proof (prove)
using this:
wf_dfa A n
wf_dfa B n

goal (1 subgoal):
 1. prod_DFS A B n
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wf_dfa (binop_dfa f A B) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_dfa (binop_dfa f A B) n
[PROOF STEP]
by (rule binop_wf_dfa)
[PROOF STATE]
proof (state)
this:
wf_dfa (binop_dfa f A B) n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Min_set_partition_memE:
  assumes "finite As"
  assumes "As \<subseteq> carrier (SA m)"
  assumes "As \<noteq> {}"
  assumes "is_semialgebraic m B"
  assumes "s \<in> Min_set_partition m As B"
  shows "\<exists>f \<in> As. (\<forall>x \<in> s. (\<forall>g \<in> As. val (f x) \<le> val (g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>As. \<forall>x\<in>s. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>As. \<forall>x\<in>s. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
obtain s' where s'_def: "s' \<in> ((\<inter>) B ` Min_set m As ` As) \<and> s \<subseteq>  s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s'. s' \<in> (\<inter>) B ` Min_set m As ` As \<and> s \<subseteq> s' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_imageI assms disjointify_subset[of "((\<inter>) B ` Min_set m As ` As)" s]
[PROOF STATE]
proof (prove)
using this:
finite ?F \<Longrightarrow> finite (?h ` ?F)
finite As
As \<subseteq> carrier (SA m)
As \<noteq> {}
is_semialgebraic m B
s \<in> Min_set_partition m As B
\<lbrakk>finite ((\<inter>) B ` Min_set m As ` As); s \<in> disjointify ((\<inter>) B ` Min_set m As ` As)\<rbrakk> \<Longrightarrow> \<exists>B\<in>(\<inter>) B ` Min_set m As ` As. s \<subseteq> B

goal (1 subgoal):
 1. (\<And>s'. s' \<in> (\<inter>) B ` Min_set m As ` As \<and> s \<subseteq> s' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Min_set_partition_def
[PROOF STATE]
proof (prove)
using this:
finite ?F \<Longrightarrow> finite (?h ` ?F)
finite As
As \<subseteq> carrier (SA m)
As \<noteq> {}
is_semialgebraic m B
s \<in> disjointify ((\<inter>) B ` Min_set m As ` As)
\<lbrakk>finite ((\<inter>) B ` Min_set m As ` As); s \<in> disjointify ((\<inter>) B ` Min_set m As ` As)\<rbrakk> \<Longrightarrow> \<exists>B\<in>(\<inter>) B ` Min_set m As ` As. s \<subseteq> B

goal (1 subgoal):
 1. (\<And>s'. s' \<in> (\<inter>) B ` Min_set m As ` As \<and> s \<subseteq> s' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
s' \<in> (\<inter>) B ` Min_set m As ` As \<and> s \<subseteq> s'

goal (1 subgoal):
 1. \<exists>f\<in>As. \<forall>x\<in>s. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
obtain f where f_def: "f \<in> As \<and> s' = B \<inter> Min_set m As f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. f \<in> As \<and> s' = B \<inter> Min_set m As f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using s'_def
[PROOF STATE]
proof (prove)
using this:
s' \<in> (\<inter>) B ` Min_set m As ` As \<and> s \<subseteq> s'

goal (1 subgoal):
 1. (\<And>f. f \<in> As \<and> s' = B \<inter> Min_set m As f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<in> As \<and> s' = B \<inter> Min_set m As f

goal (1 subgoal):
 1. \<exists>f\<in>As. \<forall>x\<in>s. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
have 0: "(\<forall>x \<in> s'. (\<forall>g \<in> As. val (f x) \<le> val (g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>s'. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
using f_def Min_set_memE[of _ m As f]
[PROOF STATE]
proof (prove)
using this:
f \<in> As \<and> s' = B \<inter> Min_set m As f
\<lbrakk>?x \<in> Min_set m As f; ?f \<in> As\<rbrakk> \<Longrightarrow> val (f ?x) \<le> val (?f ?x)

goal (1 subgoal):
 1. \<forall>x\<in>s'. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>s'. \<forall>g\<in>As. val (f x) \<le> val (g x)

goal (1 subgoal):
 1. \<exists>f\<in>As. \<forall>x\<in>s. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>s'. \<forall>g\<in>As. val (f x) \<le> val (g x)

goal (1 subgoal):
 1. \<exists>f\<in>As. \<forall>x\<in>s. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
using s'_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>s'. \<forall>g\<in>As. val (f x) \<le> val (g x)
s' \<in> (\<inter>) B ` Min_set m As ` As \<and> s \<subseteq> s'

goal (1 subgoal):
 1. \<exists>f\<in>As. \<forall>x\<in>s. \<forall>g\<in>As. val (f x) \<le> val (g x)
[PROOF STEP]
by (meson f_def subset_iff)
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>As. \<forall>x\<in>s. \<forall>g\<in>As. val (f x) \<le> val (g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma extensionalD_empty[simp]: "extensionalD d {} = {\<lambda>x. d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extensionalD d {} = {\<lambda>x. d}
[PROOF STEP]
unfolding extensionalD_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. \<forall>x. x \<notin> {} \<longrightarrow> f x = d} = {\<lambda>x. d}
[PROOF STEP]
by (simp add: set_eq_iff fun_eq_iff)


[STATEMENT]
lemma (in Group) s_top_sub1:"\<lbrakk>H \<subseteq> (carrier G); K \<subseteq> (carrier G)\<rbrakk> \<Longrightarrow>
                               H \<diamondop>\<^bsub>G\<^esub> K \<subseteq> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G\<rbrakk> \<Longrightarrow> H \<diamondop> K \<subseteq> carrier G
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; x \<in> H \<diamondop> K\<rbrakk> \<Longrightarrow> x \<in> carrier G
[PROOF STEP]
apply (simp add:s_top_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; \<exists>xa\<in>H. \<exists>y\<in>K. xa \<cdot> y = x\<rbrakk> \<Longrightarrow> x \<in> carrier G
[PROOF STEP]
apply (erule bexE)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; xa \<in> H; y \<in> K; xa \<cdot> y = x\<rbrakk> \<Longrightarrow> x \<in> carrier G
[PROOF STEP]
apply (frule_tac c = xa in subsetD[of "H" "carrier G"], assumption+,
       frule_tac c = y in subsetD[of "K" "carrier G"], assumption+,
       frule_tac a = xa and b = y in mult_closed, assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_to_list_insert_Min:
  assumes "finite S"
  assumes "\<And>s. s \<in> S \<Longrightarrow> a < s"
  shows "set_to_list (insert a S) = a#set_to_list S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (insert a S) = a # sorted_list_of_set S
[PROOF STEP]
by (metis assms(1) assms(2) insort_is_Cons nat_less_le sorted_list_of_set(1) sorted_list_of_set_insert)


[STATEMENT]
lemma wfP_simulate_simple:
  assumes "wfP r"
  assumes "\<And>x y. r' x y \<Longrightarrow> r (g x) (g y)"
  shows "wfP r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP r'
[PROOF STEP]
apply (rule wf_set_of_implies_wfP)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf (set_of r')
[PROOF STEP]
apply (rule wf_simulate_simple[where g = g])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. wf ?r2
 2. \<And>x y. (x, y) \<in> set_of r' \<Longrightarrow> (g x, g y) \<in> ?r2
[PROOF STEP]
apply (rule wfP_implies_wf_set_of)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. wfP ?P5
 2. \<And>x y. (x, y) \<in> set_of r' \<Longrightarrow> (g x, g y) \<in> set_of ?P5
[PROOF STEP]
apply (fact assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> set_of r' \<Longrightarrow> (g x, g y) \<in> set_of r
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
r' ?x ?y \<Longrightarrow> r (g ?x) (g ?y)

goal (1 subgoal):
 1. \<And>x y. (x, y) \<in> set_of r' \<Longrightarrow> (g x, g y) \<in> set_of r
[PROOF STEP]
by (auto intro: set_ofI dest: set_ofD)


[STATEMENT]
lemma unique_eigenvector_jnf: assumes jnf: "jordan_nf (A :: 'a :: field mat) n_as"
  and ord: "order lam (char_poly A) = 1"
  and ev: "eigenvector A v lam" "eigenvector A w lam"
shows "\<exists> a. v = a \<cdot>\<^sub>v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
let ?cA = "char_matrix A lam"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from similar_matD jnf[unfolded jordan_nf_def]
[PROOF STATE]
proof (chain)
picking this:
similar_mat ?A ?B \<Longrightarrow> \<exists>n P Q. {?A, ?B, P, Q} \<subseteq> carrier_mat n n \<and> P * Q = 1\<^sub>m n \<and> Q * P = 1\<^sub>m n \<and> ?A = P * ?B * Q
0 \<notin> fst ` set n_as \<and> similar_mat A (jordan_matrix n_as)
[PROOF STEP]
obtain n where
    A: "A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
similar_mat ?A ?B \<Longrightarrow> \<exists>n P Q. {?A, ?B, P, Q} \<subseteq> carrier_mat n n \<and> P * Q = 1\<^sub>m n \<and> Q * P = 1\<^sub>m n \<and> ?A = P * ?B * Q
0 \<notin> fst ` set n_as \<and> similar_mat A (jordan_matrix n_as)

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

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from dim_gen_eigenspace_order_char_poly[OF jnf, of lam 1, unfolded ord]
[PROOF STATE]
proof (chain)
picking this:
dim_gen_eigenspace A lam 1 \<le> 1
[PROOF STEP]
have dim: "kernel_dim ?cA \<le> 1"
[PROOF STATE]
proof (prove)
using this:
dim_gen_eigenspace A lam 1 \<le> 1

goal (1 subgoal):
 1. kernel_dim (char_matrix A lam) \<le> 1
[PROOF STEP]
unfolding dim_gen_eigenspace_def
[PROOF STATE]
proof (prove)
using this:
kernel_dim (char_matrix A lam ^\<^sub>m 1) \<le> 1

goal (1 subgoal):
 1. kernel_dim (char_matrix A lam) \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kernel_dim (char_matrix A lam) \<le> 1

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from eigenvector_mat_kernel_char_matrix[OF A ev(1)]
[PROOF STATE]
proof (chain)
picking this:
v \<in> mat_kernel (char_matrix A lam)
[PROOF STEP]
have vk: "v \<in> mat_kernel ?cA"
[PROOF STATE]
proof (prove)
using this:
v \<in> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. v \<in> mat_kernel (char_matrix A lam)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
v \<in> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from eigenvector_mat_kernel_char_matrix[OF A ev(2)]
[PROOF STATE]
proof (chain)
picking this:
w \<in> mat_kernel (char_matrix A lam)
[PROOF STEP]
have wk: "w \<in> mat_kernel ?cA"
[PROOF STATE]
proof (prove)
using this:
w \<in> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. w \<in> mat_kernel (char_matrix A lam)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
w \<in> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from ev[unfolded eigenvector_def] A
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec (dim_row A) \<and> v \<noteq> 0\<^sub>v (dim_row A) \<and> A *\<^sub>v v = lam \<cdot>\<^sub>v v
w \<in> carrier_vec (dim_row A) \<and> w \<noteq> 0\<^sub>v (dim_row A) \<and> A *\<^sub>v w = lam \<cdot>\<^sub>v w
A \<in> carrier_mat n n
[PROOF STEP]
have
    v: "v \<in> carrier_vec n" "v \<noteq> 0\<^sub>v n" and
    w: "w \<in> carrier_vec n" "w \<noteq> 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec (dim_row A) \<and> v \<noteq> 0\<^sub>v (dim_row A) \<and> A *\<^sub>v v = lam \<cdot>\<^sub>v v
w \<in> carrier_vec (dim_row A) \<and> w \<noteq> 0\<^sub>v (dim_row A) \<and> A *\<^sub>v w = lam \<cdot>\<^sub>v w
A \<in> carrier_mat n n

goal (1 subgoal):
 1. (v \<in> carrier_vec n &&& v \<noteq> 0\<^sub>v n) &&& w \<in> carrier_vec n &&& w \<noteq> 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
have cA: "?cA \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_matrix A lam \<in> carrier_mat n n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. char_matrix A lam \<in> carrier_mat n n
[PROOF STEP]
unfolding char_matrix_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. A + - lam \<cdot>\<^sub>m 1\<^sub>m (dim_row A) \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
char_matrix A lam \<in> carrier_mat n n

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
interpret kernel n n ?cA
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Kernel.kernel n n (char_matrix A lam)
[PROOF STEP]
by (unfold_locales, rule cA)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from kernel_basis_exists[OF A]
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. finite B \<and> basis B
[PROOF STEP]
obtain B where B: "finite B" "basis B"
[PROOF STATE]
proof (prove)
using this:
\<exists>B. finite B \<and> basis B

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>finite B; basis B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite B
basis B

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from this[unfolded Ker.basis_def]
[PROOF STATE]
proof (chain)
picking this:
finite B
lin_indpt B \<and> local.span B = mat_kernel (char_matrix A lam) \<and> B \<subseteq> mat_kernel (char_matrix A lam)
[PROOF STEP]
have basis: "mat_kernel ?cA = span B"
[PROOF STATE]
proof (prove)
using this:
finite B
lin_indpt B \<and> local.span B = mat_kernel (char_matrix A lam) \<and> B \<subseteq> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. mat_kernel (char_matrix A lam) = local.span B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_kernel (char_matrix A lam) = local.span B

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
mat_kernel (char_matrix A lam) = local.span B

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
assume "card B = 0"
[PROOF STATE]
proof (state)
this:
card B = 0

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
with B basis
[PROOF STATE]
proof (chain)
picking this:
finite B
basis B
mat_kernel (char_matrix A lam) = local.span B
card B = 0
[PROOF STEP]
have bas: "mat_kernel ?cA = local.span {}"
[PROOF STATE]
proof (prove)
using this:
finite B
basis B
mat_kernel (char_matrix A lam) = local.span B
card B = 0

goal (1 subgoal):
 1. mat_kernel (char_matrix A lam) = local.span {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_kernel (char_matrix A lam) = local.span {}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_kernel (char_matrix A lam) = local.span {}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
have "\<dots> = {0\<^sub>v n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span {} = {0\<^sub>v n}
[PROOF STEP]
unfolding Ker.span_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {lincomb a A |a A. finite A \<and> A \<subseteq> {} \<and> a \<in> A \<rightarrow> UNIV} = {0\<^sub>v n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.span {} = {0\<^sub>v n}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat_kernel (char_matrix A lam) = {0\<^sub>v n}
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
mat_kernel (char_matrix A lam) = {0\<^sub>v n}

goal (1 subgoal):
 1. False
[PROOF STEP]
using v vk
[PROOF STATE]
proof (prove)
using this:
mat_kernel (char_matrix A lam) = {0\<^sub>v n}
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n
v \<in> mat_kernel (char_matrix A lam)

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

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
card B = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
with Ker.dim_basis[OF B] dim
[PROOF STATE]
proof (chain)
picking this:
local.dim = card B
kernel_dim (char_matrix A lam) \<le> 1
card B = 0 \<Longrightarrow> False
[PROOF STEP]
have "card B = Suc 0"
[PROOF STATE]
proof (prove)
using this:
local.dim = card B
kernel_dim (char_matrix A lam) \<le> 1
card B = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. card B = Suc 0
[PROOF STEP]
by (cases "card B", auto)
[PROOF STATE]
proof (state)
this:
card B = Suc 0

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
hence "\<exists> b. B = {b}"
[PROOF STATE]
proof (prove)
using this:
card B = Suc 0

goal (1 subgoal):
 1. \<exists>b. B = {b}
[PROOF STEP]
using card_eq_SucD
[PROOF STATE]
proof (prove)
using this:
card B = Suc 0
card ?A = Suc ?k \<Longrightarrow> \<exists>b B. ?A = insert b B \<and> b \<notin> B \<and> card B = ?k \<and> (?k = 0 \<longrightarrow> B = {})

goal (1 subgoal):
 1. \<exists>b. B = {b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>b. B = {b}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>b. B = {b}
[PROOF STEP]
obtain b where Bb: "B = {b}"
[PROOF STATE]
proof (prove)
using this:
\<exists>b. B = {b}

goal (1 subgoal):
 1. (\<And>b. B = {b} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B = {b}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from B(2)[unfolded Bb Ker.basis_def]
[PROOF STATE]
proof (chain)
picking this:
lin_indpt {b} \<and> local.span {b} = mat_kernel (char_matrix A lam) \<and> {b} \<subseteq> mat_kernel (char_matrix A lam)
[PROOF STEP]
have bk: "b \<in> mat_kernel ?cA"
[PROOF STATE]
proof (prove)
using this:
lin_indpt {b} \<and> local.span {b} = mat_kernel (char_matrix A lam) \<and> {b} \<subseteq> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. b \<in> mat_kernel (char_matrix A lam)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
hence b: "b \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
b \<in> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. b \<in> carrier_vec n
[PROOF STEP]
using cA mat_kernelD(1)
[PROOF STATE]
proof (prove)
using this:
b \<in> mat_kernel (char_matrix A lam)
char_matrix A lam \<in> carrier_mat n n
\<lbrakk>?A \<in> carrier_mat ?nr ?nc; ?v \<in> mat_kernel ?A\<rbrakk> \<Longrightarrow> ?v \<in> carrier_vec ?nc

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

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from Bb basis
[PROOF STATE]
proof (chain)
picking this:
B = {b}
mat_kernel (char_matrix A lam) = local.span B
[PROOF STEP]
have "mat_kernel ?cA = span {b}"
[PROOF STATE]
proof (prove)
using this:
B = {b}
mat_kernel (char_matrix A lam) = local.span B

goal (1 subgoal):
 1. mat_kernel (char_matrix A lam) = local.span {b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_kernel (char_matrix A lam) = local.span {b}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_kernel (char_matrix A lam) = local.span {b}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
have "\<dots> = NC.span {b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span {b} = NC.span {b}
[PROOF STEP]
by (rule span_same, insert bk, auto)
[PROOF STATE]
proof (state)
this:
local.span {b} = NC.span {b}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.span {b} = NC.span {b}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
have "\<dots> \<subseteq> { a \<cdot>\<^sub>v b | a. True}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
assume "x \<in> NC.span {b}"
[PROOF STATE]
proof (state)
this:
x \<in> NC.span {b}

goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
from this[unfolded NC.span_def]
[PROOF STATE]
proof (chain)
picking this:
x \<in> {NC.lincomb a A |a A. finite A \<and> A \<subseteq> {b}}
[PROOF STEP]
obtain a A
        where x: "x = NC.lincomb a A" and A: "A \<subseteq> {b}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {NC.lincomb a A |a A. finite A \<and> A \<subseteq> {b}}

goal (1 subgoal):
 1. (\<And>a A. \<lbrakk>x = NC.lincomb a A; A \<subseteq> {b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = NC.lincomb a A
A \<subseteq> {b}

goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
hence "A = {} \<or> A = {b}"
[PROOF STATE]
proof (prove)
using this:
x = NC.lincomb a A
A \<subseteq> {b}

goal (1 subgoal):
 1. A = {} \<or> A = {b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = {} \<or> A = {b}

goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
hence "\<exists> a. x = a \<cdot>\<^sub>v b"
[PROOF STATE]
proof (prove)
using this:
A = {} \<or> A = {b}

goal (1 subgoal):
 1. \<exists>a. x = a \<cdot>\<^sub>v b
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = {} \<Longrightarrow> \<exists>a. x = a \<cdot>\<^sub>v b
 2. A = {b} \<Longrightarrow> \<exists>a. x = a \<cdot>\<^sub>v b
[PROOF STEP]
assume "A = {}"
[PROOF STATE]
proof (state)
this:
A = {}

goal (2 subgoals):
 1. A = {} \<Longrightarrow> \<exists>a. x = a \<cdot>\<^sub>v b
 2. A = {b} \<Longrightarrow> \<exists>a. x = a \<cdot>\<^sub>v b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A = {}

goal (1 subgoal):
 1. \<exists>a. x = a \<cdot>\<^sub>v b
[PROOF STEP]
unfolding x
[PROOF STATE]
proof (prove)
using this:
A = {}

goal (1 subgoal):
 1. \<exists>aa. NC.lincomb a A = aa \<cdot>\<^sub>v b
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
A = {}
b \<in> carrier_vec n

goal (1 subgoal):
 1. \<exists>aa. NC.lincomb a A = aa \<cdot>\<^sub>v b
[PROOF STEP]
by (intro exI[of _ 0], auto)
[PROOF STATE]
proof (state)
this:
\<exists>a. x = a \<cdot>\<^sub>v b

goal (1 subgoal):
 1. A = {b} \<Longrightarrow> \<exists>a. x = a \<cdot>\<^sub>v b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A = {b} \<Longrightarrow> \<exists>a. x = a \<cdot>\<^sub>v b
[PROOF STEP]
assume "A = {b}"
[PROOF STATE]
proof (state)
this:
A = {b}

goal (1 subgoal):
 1. A = {b} \<Longrightarrow> \<exists>a. x = a \<cdot>\<^sub>v b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A = {b}

goal (1 subgoal):
 1. \<exists>a. x = a \<cdot>\<^sub>v b
[PROOF STEP]
unfolding x
[PROOF STATE]
proof (prove)
using this:
A = {b}

goal (1 subgoal):
 1. \<exists>aa. NC.lincomb a A = aa \<cdot>\<^sub>v b
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
A = {b}
b \<in> carrier_vec n

goal (1 subgoal):
 1. \<exists>aa. NC.lincomb a A = aa \<cdot>\<^sub>v b
[PROOF STEP]
by (intro exI[of _ "a b"], auto simp: NC.lincomb_def)
[PROOF STATE]
proof (state)
this:
\<exists>a. x = a \<cdot>\<^sub>v b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>a. x = a \<cdot>\<^sub>v b

goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x3 \<in> NC.span {b} \<Longrightarrow> \<exists>a. ?x3 = a \<cdot>\<^sub>v b

goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?x3 \<in> NC.span {b} \<Longrightarrow> \<exists>a. ?x3 = a \<cdot>\<^sub>v b

goal (1 subgoal):
 1. NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
NC.span {b} \<subseteq> {a \<cdot>\<^sub>v b |a. True}

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat_kernel (char_matrix A lam) \<subseteq> {a \<cdot>\<^sub>v b |a. True}
[PROOF STEP]
obtain vv ww where vb: "v = vv \<cdot>\<^sub>v b" and wb: "w = ww \<cdot>\<^sub>v b"
[PROOF STATE]
proof (prove)
using this:
mat_kernel (char_matrix A lam) \<subseteq> {a \<cdot>\<^sub>v b |a. True}

goal (1 subgoal):
 1. (\<And>vv ww. \<lbrakk>v = vv \<cdot>\<^sub>v b; w = ww \<cdot>\<^sub>v b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using vk wk
[PROOF STATE]
proof (prove)
using this:
mat_kernel (char_matrix A lam) \<subseteq> {a \<cdot>\<^sub>v b |a. True}
v \<in> mat_kernel (char_matrix A lam)
w \<in> mat_kernel (char_matrix A lam)

goal (1 subgoal):
 1. (\<And>vv ww. \<lbrakk>v = vv \<cdot>\<^sub>v b; w = ww \<cdot>\<^sub>v b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force+
[PROOF STATE]
proof (state)
this:
v = vv \<cdot>\<^sub>v b
w = ww \<cdot>\<^sub>v b

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from wb w b
[PROOF STATE]
proof (chain)
picking this:
w = ww \<cdot>\<^sub>v b
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n
b \<in> carrier_vec n
[PROOF STEP]
have ww: "ww \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
w = ww \<cdot>\<^sub>v b
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n
b \<in> carrier_vec n

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

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from arg_cong[OF wb, of "\<lambda> x. inverse ww \<cdot>\<^sub>v x"] w ww b
[PROOF STATE]
proof (chain)
picking this:
inverse ww \<cdot>\<^sub>v w = inverse ww \<cdot>\<^sub>v (ww \<cdot>\<^sub>v b)
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n
ww \<noteq> (0::'a)
b \<in> carrier_vec n
[PROOF STEP]
have "b = inverse ww \<cdot>\<^sub>v w"
[PROOF STATE]
proof (prove)
using this:
inverse ww \<cdot>\<^sub>v w = inverse ww \<cdot>\<^sub>v (ww \<cdot>\<^sub>v b)
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n
ww \<noteq> (0::'a)
b \<in> carrier_vec n

goal (1 subgoal):
 1. b = inverse ww \<cdot>\<^sub>v w
[PROOF STEP]
by (auto simp: smult_smult_assoc)
[PROOF STATE]
proof (state)
this:
b = inverse ww \<cdot>\<^sub>v w

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
from vb[unfolded this smult_smult_assoc]
[PROOF STATE]
proof (chain)
picking this:
v = vv * inverse ww \<cdot>\<^sub>v w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v = vv * inverse ww \<cdot>\<^sub>v w

goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a. v = a \<cdot>\<^sub>v w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma floor_numeral [simp]: "\<lfloor>numeral v\<rfloor> = numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>numeral v\<rfloor> = numeral v
[PROOF STEP]
using floor_of_int [of "numeral v"]
[PROOF STATE]
proof (prove)
using this:
\<lfloor>of_int (numeral v)\<rfloor> = numeral v

goal (1 subgoal):
 1. \<lfloor>numeral v\<rfloor> = numeral v
[PROOF STEP]
by simp


[STATEMENT]
lemma trm_cases:
  assumes
    "M = Unit \<Longrightarrow> P M"
    "\<And>x. M = Var x \<Longrightarrow> P M"
    "\<And>A B. M = App A B \<Longrightarrow> P M"
    "\<And>x T A. M = Fn x T A \<Longrightarrow> P M"
    "\<And>A B. M = Pair A B \<Longrightarrow> P M"
    "\<And>A. M = Fst A \<Longrightarrow> P M"
    "\<And>A. M = Snd A \<Longrightarrow> P M"
  shows "P M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
M = Unit \<Longrightarrow> P M
M = Var ?x \<Longrightarrow> P M
M = App ?A ?B \<Longrightarrow> P M
M = Fn ?x ?T ?A \<Longrightarrow> P M
M = SimplyTyped.Pair ?A ?B \<Longrightarrow> P M
M = Fst ?A \<Longrightarrow> P M
M = Snd ?A \<Longrightarrow> P M

goal (1 subgoal):
 1. P M
[PROOF STEP]
by(induction rule: trm_induct, auto)


[STATEMENT]
lemma inj_on_word_of_int: \<open>inj_on (word_of_int :: int \<Rightarrow> 'a word) {0..<2 ^ LENGTH('a::len)}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on word_of_int {0..<2 ^ LENGTH('a)}
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{0..<2 ^ LENGTH('a)}. \<forall>y\<in>{0..<2 ^ LENGTH('a)}. word_of_int x = word_of_int y \<longrightarrow> x = y
[PROOF STEP]
by (metis atLeastLessThan_iff word_of_int_inverse)


[STATEMENT]
lemma Upair_inject [simp]: "Upair a b = Upair c d \<longleftrightarrow> a = c \<and> b = d \<or> a = d \<and> b = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Upair a b = Upair c d) = (a = c \<and> b = d \<or> a = d \<and> b = c)
[PROOF STEP]
by transfer auto