[STATEMENT]
lemma wf_called_by_chain: "finite (calls_chain \<Gamma>) \<Longrightarrow> wf (calls_chain \<Gamma>) \<Longrightarrow> wf (called_by_chain \<Gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (calls_chain \<Gamma>); wf (calls_chain \<Gamma>)\<rbrakk> \<Longrightarrow> wf (called_by_chain \<Gamma>)
[PROOF STEP]
apply(frule Wellfounded.wf_acyclic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (calls_chain \<Gamma>); wf (calls_chain \<Gamma>); acyclic (calls_chain \<Gamma>)\<rbrakk> \<Longrightarrow> wf (called_by_chain \<Gamma>)
[PROOF STEP]
apply(drule(1) Wellfounded.finite_acyclic_wf_converse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf (calls_chain \<Gamma>); acyclic (calls_chain \<Gamma>); wf ((calls_chain \<Gamma>)\<inverse>)\<rbrakk> \<Longrightarrow> wf (called_by_chain \<Gamma>)
[PROOF STEP]
apply(simp add: called_by_chain_converse)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Suffixes_conc [simp]: "A \<noteq> {} \<Longrightarrow> Suffixes (A @@ B) = Suffixes B \<union> (Suffixes A @@ B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suffixes (A @@ B) = Suffixes B \<union> Suffixes A @@ B
[PROOF STEP]
unfolding Suffixes_altdef conc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> (\<Union>w\<in>{xs @ ys |xs ys. xs \<in> A \<and> ys \<in> B}. set (suffixes w)) = (\<Union>w\<in>B. set (suffixes w)) \<union> {xs @ ys |xs ys. xs \<in> (\<Union>w\<in>A. set (suffixes w)) \<and> ys \<in> B}
[PROOF STEP]
by (force simp: suffix_append)


[STATEMENT]
lemma has_derivative_transform_within:
  assumes "0 < d"
    and "x \<in> s"
    and "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'"
    and "(f has_derivative f') (at x within s)"
  shows "(g has_derivative f') (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative f') (at x within s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < d
x \<in> s
\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'
(f has_derivative f') (at x within s)

goal (1 subgoal):
 1. (g has_derivative f') (at x within s)
[PROOF STEP]
unfolding has_derivative_within
[PROOF STATE]
proof (prove)
using this:
0 < d
x \<in> s
\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'
bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within s)

goal (1 subgoal):
 1. bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (g y - (g x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within s)
[PROOF STEP]
by (force simp add: intro: Lim_transform_within)


[STATEMENT]
lemma mat0_leastII:
  assumes gt: "mat_gt_arc (0\<^sub>m nr nc) A"
  and A: "A \<in> carrier_mat nr nc"
  shows "A = 0\<^sub>m nr nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = 0\<^sub>m nr nc
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (0\<^sub>m nr nc); j < dim_col (0\<^sub>m nr nc)\<rbrakk> \<Longrightarrow> A $$ (i, j) = 0\<^sub>m nr nc $$ (i, j)
 2. dim_row A = dim_row (0\<^sub>m nr nc)
 3. dim_col A = dim_col (0\<^sub>m nr nc)
[PROOF STEP]
unfolding index_zero_mat
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
 2. dim_row A = nr
 3. dim_col A = nc
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < nr; j < nc\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
 2. dim_row A = nr
 3. dim_col A = nc
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < nr; j < nc; A \<in> carrier_mat nr nc\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
 2. A \<in> carrier_mat nr nc \<Longrightarrow> dim_row A = nr
 3. A \<in> carrier_mat nr nc \<Longrightarrow> dim_col A = nc
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < nr; j < nc; A \<in> carrier_mat nr nc\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
 2. A \<in> carrier_mat nr nc \<Longrightarrow> dim_row A = nr
 3. A \<in> carrier_mat nr nc \<Longrightarrow> dim_col A = nc
[PROOF STEP]
assume i: "i < nr" and j: "j < nc"
[PROOF STATE]
proof (state)
this:
i < nr
j < nc

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < nr; j < nc; A \<in> carrier_mat nr nc\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
 2. A \<in> carrier_mat nr nc \<Longrightarrow> dim_row A = nr
 3. A \<in> carrier_mat nr nc \<Longrightarrow> dim_col A = nc
[PROOF STEP]
show "A $$ (i,j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (i, j) = (0::'a)
[PROOF STEP]
using zero_leastII mat_comp_allE[OF gt _ A] i j
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<succ> ?x \<Longrightarrow> ?x = (0::'a)
\<lbrakk>0\<^sub>m nr nc \<in> carrier_mat nr nc; ?i < nr; ?j < nc\<rbrakk> \<Longrightarrow> 0\<^sub>m nr nc $$ (?i, ?j) \<succ> A $$ (?i, ?j)
i < nr
j < nc

goal (1 subgoal):
 1. A $$ (i, j) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A $$ (i, j) = (0::'a)

goal (2 subgoals):
 1. A \<in> carrier_mat nr nc \<Longrightarrow> dim_row A = nr
 2. A \<in> carrier_mat nr nc \<Longrightarrow> dim_col A = nc
[PROOF STEP]
qed auto


[STATEMENT]
lemma sign_r_pos_mod:
  fixes p q :: "real poly"
  assumes "poly p x=0" "poly q x\<noteq>0"
  shows "sign_r_pos (q mod p) x=sign_r_pos q x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_r_pos (q mod p) x = sign_r_pos q x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sign_r_pos (q mod p) x = sign_r_pos q x
[PROOF STEP]
have "poly (q div p * p) x=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (q div p * p) x = 0
[PROOF STEP]
using \<open>poly p x=0\<close> poly_mult
[PROOF STATE]
proof (prove)
using this:
poly p x = 0
poly (?p * ?q) ?x = poly ?p ?x * poly ?q ?x

goal (1 subgoal):
 1. poly (q div p * p) x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly (q div p * p) x = 0

goal (1 subgoal):
 1. sign_r_pos (q mod p) x = sign_r_pos q x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poly (q div p * p) x = 0

goal (1 subgoal):
 1. sign_r_pos (q mod p) x = sign_r_pos q x
[PROOF STEP]
hence "poly (q mod p) x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
poly (q div p * p) x = 0

goal (1 subgoal):
 1. poly (q mod p) x \<noteq> 0
[PROOF STEP]
using \<open>poly q x\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
poly (q div p * p) x = 0
poly q x \<noteq> 0

goal (1 subgoal):
 1. poly (q mod p) x \<noteq> 0
[PROOF STEP]
by (simp add: assms(1) poly_mod)
[PROOF STATE]
proof (state)
this:
poly (q mod p) x \<noteq> 0

goal (1 subgoal):
 1. sign_r_pos (q mod p) x = sign_r_pos q x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
poly (q div p * p) x = 0
poly (q mod p) x \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly (q div p * p) x = 0
poly (q mod p) x \<noteq> 0

goal (1 subgoal):
 1. sign_r_pos (q mod p) x = sign_r_pos q x
[PROOF STEP]
by (metis div_mult_mod_eq sign_r_pos_add)
[PROOF STATE]
proof (state)
this:
sign_r_pos (q mod p) x = sign_r_pos q x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma step_3_similar: "A \<in> carrier_mat n n \<Longrightarrow> similar_mat (step_3 A) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat n n \<Longrightarrow> similar_mat (step_3 A) A
[PROOF STEP]
unfolding step_3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat n n \<Longrightarrow> similar_mat (step_3_main (dim_row A) 1 A) A
[PROOF STEP]
by (rule step_3_main_similar, auto)


[STATEMENT]
lemma SA_nonzero_set_memE:
  assumes "f \<in> carrier (SA n)"
  assumes "x \<in> SA_nonzero_set n f"
  shows "f x \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<noteq> \<zero>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
x \<in> SA_nonzero_set n f

goal (1 subgoal):
 1. f x \<noteq> \<zero>
[PROOF STEP]
unfolding SA_nonzero_set_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
x \<in> {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<noteq> \<zero>}

goal (1 subgoal):
 1. f x \<noteq> \<zero>
[PROOF STEP]
by blast


[STATEMENT]
lemma norm_bound_Basis_le: "b \<in> Basis \<Longrightarrow> norm x \<le> e \<Longrightarrow> \<bar>inner x b\<bar> \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<in> Basis; norm x \<le> e\<rbrakk> \<Longrightarrow> \<bar>inner x b\<bar> \<le> e
[PROOF STEP]
by (metis Basis_le_norm order_trans)


[STATEMENT]
lemma order_emb_isotone: "order_emb A B f \<Longrightarrow> isotone A B f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order_emb A B f \<Longrightarrow> isotone A B f
[PROOF STEP]
by (auto simp add: isotone_def order_emb_def)


[STATEMENT]
lemma polar_abs:
  assumes "v \<noteq> 0"
  shows "polar (proj2_abs v) = proj2_line_abs (M *v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polar (proj2_abs v) = proj2_line_abs (M *v v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. polar (proj2_abs v) = proj2_line_abs (M *v v)
[PROOF STEP]
from \<open>v \<noteq> 0\<close> and proj2_rep_abs2
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0
?v \<noteq> 0 \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> proj2_rep (proj2_abs ?v) = k *\<^sub>R ?v
[PROOF STEP]
obtain k where "k \<noteq> 0" and "proj2_rep (proj2_abs v) = k *\<^sub>R v"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0
?v \<noteq> 0 \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> proj2_rep (proj2_abs ?v) = k *\<^sub>R ?v

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<noteq> 0; proj2_rep (proj2_abs v) = k *\<^sub>R v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<noteq> 0
proj2_rep (proj2_abs v) = k *\<^sub>R v

goal (1 subgoal):
 1. polar (proj2_abs v) = proj2_line_abs (M *v v)
[PROOF STEP]
from \<open>proj2_rep (proj2_abs v) = k *\<^sub>R v\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_rep (proj2_abs v) = k *\<^sub>R v
[PROOF STEP]
have "polar (proj2_abs v) = proj2_line_abs (k *\<^sub>R (M *v v))"
[PROOF STATE]
proof (prove)
using this:
proj2_rep (proj2_abs v) = k *\<^sub>R v

goal (1 subgoal):
 1. polar (proj2_abs v) = proj2_line_abs (k *\<^sub>R (M *v v))
[PROOF STEP]
unfolding polar_def
[PROOF STATE]
proof (prove)
using this:
proj2_rep (proj2_abs v) = k *\<^sub>R v

goal (1 subgoal):
 1. proj2_line_abs (M *v proj2_rep (proj2_abs v)) = proj2_line_abs (k *\<^sub>R (M *v v))
[PROOF STEP]
by (simp add: matrix_scaleR_vector_ac scaleR_matrix_vector_assoc)
[PROOF STATE]
proof (state)
this:
polar (proj2_abs v) = proj2_line_abs (k *\<^sub>R (M *v v))

goal (1 subgoal):
 1. polar (proj2_abs v) = proj2_line_abs (M *v v)
[PROOF STEP]
with \<open>k \<noteq> 0\<close> and proj2_line_abs_mult
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
?k \<noteq> 0 \<Longrightarrow> proj2_line_abs (?k *\<^sub>R ?v) = proj2_line_abs ?v
polar (proj2_abs v) = proj2_line_abs (k *\<^sub>R (M *v v))
[PROOF STEP]
show "polar (proj2_abs v) = proj2_line_abs (M *v v)"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
?k \<noteq> 0 \<Longrightarrow> proj2_line_abs (?k *\<^sub>R ?v) = proj2_line_abs ?v
polar (proj2_abs v) = proj2_line_abs (k *\<^sub>R (M *v v))

goal (1 subgoal):
 1. polar (proj2_abs v) = proj2_line_abs (M *v v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
polar (proj2_abs v) = proj2_line_abs (M *v v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trms_list\<^sub>s\<^sub>t_is_trms\<^sub>s\<^sub>t: "trms\<^sub>s\<^sub>t S = set (trms_list\<^sub>s\<^sub>t S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trms\<^sub>s\<^sub>t S = set (trms_list\<^sub>s\<^sub>t S)
[PROOF STEP]
unfolding trms\<^sub>s\<^sub>t_def trms_list\<^sub>s\<^sub>t_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set S) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p S)))
[PROOF STEP]
proof (induction S)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set []) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p [])))
 2. \<And>a S. \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set S) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p S))) \<Longrightarrow> \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set (a # S)) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p (a # S))))
[PROOF STEP]
case (Cons x S)
[PROOF STATE]
proof (state)
this:
\<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set S) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p S)))

goal (2 subgoals):
 1. \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set []) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p [])))
 2. \<And>a S. \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set S) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p S))) \<Longrightarrow> \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set (a # S)) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p (a # S))))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set S) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p S)))

goal (1 subgoal):
 1. \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set (x # S)) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p (x # S))))
[PROOF STEP]
by (cases x) auto
[PROOF STATE]
proof (state)
this:
\<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set (x # S)) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p (x # S))))

goal (1 subgoal):
 1. \<Union> (trms\<^sub>s\<^sub>t\<^sub>p ` set []) = set (remdups (concat (map trms_list\<^sub>s\<^sub>t\<^sub>p [])))
[PROOF STEP]
qed simp


[STATEMENT]
lemma weaken_post: "\<lbrakk> \<turnstile>\<^sub>t {P}c{Q}; \<forall>s. Q s \<longrightarrow> Q' s  \<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>t {P}c{Q'}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<turnstile>\<^sub>t {P} c {Q}; \<forall>s. Q s \<longrightarrow> Q' s\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>t {P} c {Q'}
[PROOF STEP]
apply(rule thoare.Conseq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<turnstile>\<^sub>t {P} c {Q}; \<forall>s. Q s \<longrightarrow> Q' s\<rbrakk> \<Longrightarrow> \<forall>s. P s \<longrightarrow> ?P s
 2. \<lbrakk>\<turnstile>\<^sub>t {P} c {Q}; \<forall>s. Q s \<longrightarrow> Q' s\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>t {?P} c {?Q}
 3. \<lbrakk>\<turnstile>\<^sub>t {P} c {Q}; \<forall>s. Q s \<longrightarrow> Q' s\<rbrakk> \<Longrightarrow> \<forall>s. ?Q s \<longrightarrow> Q' s
[PROOF STEP]
apply(fast, assumption, assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma permute_eq_iff [simp]:
  shows "p \<bullet> x = p \<bullet> y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<bullet> x = p \<bullet> y) = (x = y)
[PROOF STEP]
by (rule inj_permute [THEN inj_eq])


[STATEMENT]
lemma (in semigroup_add) foldl_assoc:
shows "foldl (+) (x+y) zs = x + (foldl (+) y zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (+) (x + y) zs = x + foldl (+) y zs
[PROOF STEP]
by (induct zs arbitrary: y) (simp_all add:add.assoc)


[STATEMENT]
lemma ideal_0: "ideal {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal {0::'a}
[PROOF STEP]
unfolding ideal_def left_ideal_def right_ideal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subgroup {0::'a} \<and> (\<forall>x\<in>{0::'a}. \<forall>r. r * x \<in> {0::'a})) \<and> subgroup {0::'a} \<and> (\<forall>x\<in>{0::'a}. \<forall>r. x * r \<in> {0::'a})
[PROOF STEP]
using subgroup_0
[PROOF STATE]
proof (prove)
using this:
subgroup {0::'a}

goal (1 subgoal):
 1. (subgroup {0::'a} \<and> (\<forall>x\<in>{0::'a}. \<forall>r. r * x \<in> {0::'a})) \<and> subgroup {0::'a} \<and> (\<forall>x\<in>{0::'a}. \<forall>r. x * r \<in> {0::'a})
[PROOF STEP]
by auto


[STATEMENT]
lemma affine_alg_set_subset:
  assumes "as \<subseteq> bs"
  shows " affine_alg_set R n bs \<subseteq> affine_alg_set R n as "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine_alg_set R n bs \<subseteq> affine_alg_set R n as
[PROOF STEP]
using assms affine_alg_set_def
[PROOF STATE]
proof (prove)
using this:
as \<subseteq> bs
affine_alg_set ?R ?n ?as = {a \<in> carrier (?R\<^bsup>?n\<^esup>). \<forall>b\<in>?as. a \<in> V\<^bsub>?R\<^esub> ?n b}

goal (1 subgoal):
 1. affine_alg_set R n bs \<subseteq> affine_alg_set R n as
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Ring) LSM_mem:"\<lbrakk>R module M; T \<subseteq> carrier M; t \<in> T\<rbrakk> \<Longrightarrow>
                                                     t \<in> (LSM\<^bsub>R\<^esub> M T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M; T \<subseteq> carrier M; t \<in> T\<rbrakk> \<Longrightarrow> t \<in> LSM\<^bsub>R\<^esub> M T
[PROOF STEP]
apply (simp add:Least_submodule_def, rule allI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>R module M; T \<subseteq> carrier M; t \<in> T; submodule R M x \<and> T \<subseteq> x\<rbrakk> \<Longrightarrow> t \<in> x
[PROOF STEP]
apply (erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>R module M; T \<subseteq> carrier M; t \<in> T; submodule R M x; T \<subseteq> x\<rbrakk> \<Longrightarrow> t \<in> x
[PROOF STEP]
apply (simp add:subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hom_of_snd:
  assumes "group G"
  shows "(f \<circ> snd) \<in> hom (DirProd G H) K \<longleftrightarrow> f \<in> hom H K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> snd \<in> hom (G \<times>\<times> H) K) = (f \<in> hom H K)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<circ> snd \<in> hom (G \<times>\<times> H) K) = (f \<in> hom H K)
[PROOF STEP]
interpret group G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group G
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<circ> snd \<in> hom (G \<times>\<times> H) K) = (f \<in> hom H K)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> snd \<in> hom (G \<times>\<times> H) K) = (f \<in> hom H K)
[PROOF STEP]
using one_closed
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>G\<^esub> \<in> carrier G

goal (1 subgoal):
 1. (f \<circ> snd \<in> hom (G \<times>\<times> H) K) = (f \<in> hom H K)
[PROOF STEP]
by (auto simp: hom_def Pi_def)
[PROOF STATE]
proof (state)
this:
(f \<circ> snd \<in> hom (G \<times>\<times> H) K) = (f \<in> hom H K)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma drop_apply_SA_closed:
  assumes "f \<in> carrier (SA (k-n))"
  assumes "k \<ge> n"
  shows "drop_apply k n f \<in> carrier (SA k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop_apply k n f \<in> carrier (SA k)
[PROOF STEP]
apply(rule SA_car_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. drop_apply k n f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>k\<^esup>)) Q\<^sub>p)
 2. is_semialg_function k (drop_apply k n f)
[PROOF STEP]
using SA_car_memE(2) assms(1) assms(2) drop_apply_closed less_imp_le_nat
[PROOF STATE]
proof (prove)
using this:
?f \<in> carrier (SA ?n) \<Longrightarrow> ?f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p)
f \<in> carrier (SA (k - n))
n \<le> k
\<lbrakk>?f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>?k - ?n\<^esup>)) Q\<^sub>p); ?n \<le> ?k\<rbrakk> \<Longrightarrow> drop_apply ?k ?n ?f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>?k\<^esup>)) Q\<^sub>p)
?m < ?n \<Longrightarrow> ?m \<le> ?n

goal (2 subgoals):
 1. drop_apply k n f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>k\<^esup>)) Q\<^sub>p)
 2. is_semialg_function k (drop_apply k n f)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialg_function k (drop_apply k n f)
[PROOF STEP]
using assms drop_is_semialg_map[of n "k - n" ] semialg_function_comp_closed[of "k - n" f k "drop n"]
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA (k - n))
n \<le> k
is_semialg_map (n + (k - n)) (k - n) (drop n)
\<lbrakk>is_semialg_function (k - n) f; is_semialg_map k (k - n) (drop n)\<rbrakk> \<Longrightarrow> is_semialg_function k (f \<circ> drop n)

goal (1 subgoal):
 1. is_semialg_function k (drop_apply k n f)
[PROOF STEP]
unfolding drop_apply_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA (k - n))
n \<le> k
is_semialg_map (n + (k - n)) (k - n) (drop n)
\<lbrakk>is_semialg_function (k - n) f; is_semialg_map k (k - n) (drop n)\<rbrakk> \<Longrightarrow> is_semialg_function k (f \<circ> drop n)

goal (1 subgoal):
 1. is_semialg_function k (restrict (f \<circ> drop n) (carrier (Q\<^sub>p\<^bsup>k\<^esup>)))
[PROOF STEP]
by (metis (no_types, lifting) SA_imp_semialg le_add_diff_inverse  restrict_is_semialg)


[STATEMENT]
lemma simple_function_borel_measurable:
  fixes f :: "'a \<Rightarrow> 'x::{t2_space}"
  assumes "f \<in> borel_measurable M" and "finite (f ` space M)"
  shows "simple_function M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_function M f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
finite (f ` space M)

goal (1 subgoal):
 1. simple_function M f
[PROOF STEP]
unfolding simple_function_def
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
finite (f ` space M)

goal (1 subgoal):
 1. finite (f ` space M) \<and> (\<forall>x\<in>f ` space M. f -` {x} \<inter> space M \<in> sets M)
[PROOF STEP]
by (auto intro: borel_measurable_vimage)


[STATEMENT]
lemma subspace_diff: "subspace S \<Longrightarrow> x \<in> S \<Longrightarrow> y \<in> S \<Longrightarrow> x - y \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subspace S; x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x - y \<in> S
[PROOF STEP]
by (metis diff_conv_add_uminus subspace_add subspace_neg)


[STATEMENT]
lemma Inf_lim:
  fixes a :: "'a::{complete_linorder,linorder_topology}"
  assumes "\<And>n. b n \<in> s"
    and "b \<longlonglongrightarrow> a"
  shows "Inf s \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf s \<le> a
[PROOF STEP]
by (metis Lim_bounded2 assms complete_lattice_class.Inf_lower)


[STATEMENT]
lemma acc_lengths_plus: "acc_lengths (m+n) as = map ((+)m) (acc_lengths n as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. acc_lengths (m + n) as = map ((+) m) (acc_lengths n as)
[PROOF STEP]
by (induction n as arbitrary: m rule: acc_lengths.induct) (auto simp: add.assoc)


[STATEMENT]
lemma inj_on_mk_edge: "X \<inter> Y = {} \<Longrightarrow> inj_on mk_edge (all_edges_between X Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<inter> Y = {} \<Longrightarrow> inj_on mk_edge (all_edges_between X Y)
[PROOF STEP]
by (auto simp: inj_on_def doubleton_eq_iff all_edges_between_def)


[STATEMENT]
lemma continuous_on_artanh' [continuous_intros]:
  fixes f :: "real \<Rightarrow> real"
  assumes "continuous_on A f" "\<And>x. x \<in> A \<Longrightarrow> f x \<in> {-1<..<1}"
  shows   "continuous_on A (\<lambda>x. artanh (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A (\<lambda>x. artanh (f x))
[PROOF STEP]
by (rule continuous_on_compose2[OF continuous_on_artanh assms(1) order.refl])
     (use assms(2) in auto)


[STATEMENT]
lemma cut_ge_Max_empty: "finite I \<Longrightarrow> Max I < t \<Longrightarrow> I \<down>\<ge> t = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; Max I < t\<rbrakk> \<Longrightarrow> I \<down>\<ge> t = {}
[PROOF STEP]
by (fastforce simp: i_cut_defs)


[STATEMENT]
lemma nodes_connected_ind_sym: "F\<subseteq>E \<Longrightarrow> sym {(x, y) |x y. nodes_connected (ind F) x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<subseteq> E \<Longrightarrow> sym {(x, y) |x y. nodes_connected \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr> x y}
[PROOF STEP]
apply(frule ind_valid_graph)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<subseteq> E; valid_graph \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr>\<rbrakk> \<Longrightarrow> sym {(x, y) |x y. nodes_connected \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr> x y}
[PROOF STEP]
unfolding sym_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<subseteq> E; valid_graph \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr>\<rbrakk> \<Longrightarrow> \<forall>x y. (x, y) \<in> {(x, y) |x y. nodes_connected \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr> x y} \<longrightarrow> (y, x) \<in> {(x, y) |x y. nodes_connected \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr> x y}
[PROOF STEP]
using valid_graph.nodes_connected_sym
[PROOF STATE]
proof (prove)
using this:
valid_graph ?G \<Longrightarrow> nodes_connected ?G ?a ?b = nodes_connected ?G ?b ?a

goal (1 subgoal):
 1. \<lbrakk>F \<subseteq> E; valid_graph \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr>\<rbrakk> \<Longrightarrow> \<forall>x y. (x, y) \<in> {(x, y) |x y. nodes_connected \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr> x y} \<longrightarrow> (y, x) \<in> {(x, y) |x y. nodes_connected \<lparr>nodes = fst ` E \<union> (snd \<circ> snd) ` E, edges = F\<rparr> x y}
[PROOF STEP]
by fast


[STATEMENT]
lemma rHom_compos:"\<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C\<rbrakk> \<Longrightarrow>
                   compos A g f \<in> rHom A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C\<rbrakk> \<Longrightarrow> compos A g f \<in> rHom A C
[PROOF STEP]
apply (subst rHom_def, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C\<rbrakk> \<Longrightarrow> compos A g f \<in> aHom A C \<and> (\<forall>x\<in>carrier A. \<forall>y\<in>carrier A. compos A g f (x \<cdot>\<^sub>r\<^bsub>A\<^esub> y) = compos A g f x \<cdot>\<^sub>r\<^bsub>C\<^esub> compos A g f y) \<and> compos A g f 1\<^sub>r\<^bsub>A\<^esub> = 1\<^sub>r\<^bsub>C\<^esub>
[PROOF STEP]
apply (frule Ring.ring_is_ag[of "A"], frule Ring.ring_is_ag[of "B"],
       frule Ring.ring_is_ag[of "C"],
       frule rHom_aHom[of "f" "A" "B"], frule rHom_aHom[of "g" "B" "C"],
       simp add:aHom_compos)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C; aGroup A; aGroup B; aGroup C; f \<in> aHom A B; g \<in> aHom B C\<rbrakk> \<Longrightarrow> (\<forall>x\<in>carrier A. \<forall>y\<in>carrier A. compos A g f (x \<cdot>\<^sub>r\<^bsub>A\<^esub> y) = compos A g f x \<cdot>\<^sub>r\<^bsub>C\<^esub> compos A g f y) \<and> compos A g f 1\<^sub>r\<^bsub>A\<^esub> = 1\<^sub>r\<^bsub>C\<^esub>
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C; aGroup A; aGroup B; aGroup C; f \<in> aHom A B; g \<in> aHom B C\<rbrakk> \<Longrightarrow> \<forall>x\<in>carrier A. \<forall>y\<in>carrier A. compos A g f (x \<cdot>\<^sub>r\<^bsub>A\<^esub> y) = compos A g f x \<cdot>\<^sub>r\<^bsub>C\<^esub> compos A g f y
 2. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C; aGroup A; aGroup B; aGroup C; f \<in> aHom A B; g \<in> aHom B C\<rbrakk> \<Longrightarrow> compos A g f 1\<^sub>r\<^bsub>A\<^esub> = 1\<^sub>r\<^bsub>C\<^esub>
[PROOF STEP]
apply ((rule ballI)+, simp add:compos_def compose_def,
        frule_tac x = x and y = y in Ring.ring_tOp_closed[of "A"], assumption+,
        simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C; aGroup A; aGroup B; aGroup C; f \<in> aHom A B; g \<in> aHom B C; x \<in> carrier A; y \<in> carrier A; x \<cdot>\<^sub>r\<^bsub>A\<^esub> y \<in> carrier A\<rbrakk> \<Longrightarrow> g (f (x \<cdot>\<^sub>r\<^bsub>A\<^esub> y)) = g (f x) \<cdot>\<^sub>r\<^bsub>C\<^esub> g (f y)
 2. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C; aGroup A; aGroup B; aGroup C; f \<in> aHom A B; g \<in> aHom B C\<rbrakk> \<Longrightarrow> compos A g f 1\<^sub>r\<^bsub>A\<^esub> = 1\<^sub>r\<^bsub>C\<^esub>
[PROOF STEP]
apply (simp add:rHom_tOp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C; aGroup A; aGroup B; aGroup C; f \<in> aHom A B; g \<in> aHom B C; x \<in> carrier A; y \<in> carrier A; x \<cdot>\<^sub>r\<^bsub>A\<^esub> y \<in> carrier A\<rbrakk> \<Longrightarrow> g (f x \<cdot>\<^sub>r\<^bsub>B\<^esub> f y) = g (f x) \<cdot>\<^sub>r\<^bsub>C\<^esub> g (f y)
 2. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C; aGroup A; aGroup B; aGroup C; f \<in> aHom A B; g \<in> aHom B C\<rbrakk> \<Longrightarrow> compos A g f 1\<^sub>r\<^bsub>A\<^esub> = 1\<^sub>r\<^bsub>C\<^esub>
[PROOF STEP]
apply (frule_tac a = x in rHom_mem[of "f" "A" "B"], assumption+,
        frule_tac a = y in rHom_mem[of "f" "A" "B"], assumption+,
         simp add:rHom_tOp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring A; Ring B; Ring C; f \<in> rHom A B; g \<in> rHom B C; aGroup A; aGroup B; aGroup C; f \<in> aHom A B; g \<in> aHom B C\<rbrakk> \<Longrightarrow> compos A g f 1\<^sub>r\<^bsub>A\<^esub> = 1\<^sub>r\<^bsub>C\<^esub>
[PROOF STEP]
apply (frule Ring.ring_one[of "A"], frule Ring.ring_one[of "B"],
        simp add:compos_def compose_def, simp add:rHom_one)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma in_vars_addE:
  \<open>x \<in> vars (p + q) \<Longrightarrow> (x \<in> vars p \<Longrightarrow> thesis) \<Longrightarrow> (x \<in> vars q \<Longrightarrow> thesis) \<Longrightarrow> thesis\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> vars (p + q); x \<in> vars p \<Longrightarrow> thesis; x \<in> vars q \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (meson UnE in_mono vars_add)


[STATEMENT]
lemma llist_all2_LCons1:
  "llist_all2 P (LCons x xs) ys \<longleftrightarrow> (\<exists>y ys'. ys = LCons y ys' \<and> P x y \<and> llist_all2 P xs ys')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llist_all2 P (LCons x xs) ys = (\<exists>y ys'. ys = LCons y ys' \<and> P x y \<and> llist_all2 P xs ys')
[PROOF STEP]
by(cases ys) simp_all


[STATEMENT]
lemma eval_poly_add[simp]: "eval_poly hom (p + q) x = eval_poly hom p x + eval_poly hom q x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly hom (p + q) x = eval_poly hom p x + eval_poly hom q x
[PROOF STEP]
unfolding eval_poly_def hom_distribs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (map_poly hom p) x + poly (map_poly hom q) x = poly (map_poly hom p) x + poly (map_poly hom q) x
[PROOF STEP]
..


[STATEMENT]
lemma HComplex_add_hcomplex_of_hypreal [simp]:
  "\<And>x y r. HComplex x y + hcomplex_of_hypreal r = HComplex (x + r) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y r. HComplex x y + hcomplex_of_hypreal r = HComplex (x + r) y
[PROOF STEP]
by transfer (rule Complex_add_complex_of_real)


[STATEMENT]
lemma bal_full_node: "bal (full_node k a h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bal (full_node k a h)
[PROOF STEP]
apply(induction k a h rule: full_node.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k c. bal (full_node k c 0)
 2. \<And>k c n. \<lbrakk>bal (full_node k c n); bal (full_node k c n)\<rbrakk> \<Longrightarrow> bal (full_node k c (Suc n))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma float_plus_down: "real_of_float (float_plus_down prec x y) \<le> x + y"
  and float_plus_up: "x + y \<le> real_of_float (float_plus_up prec x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (float_plus_down prec x y) \<le> real_of_float x + real_of_float y &&& real_of_float x + real_of_float y \<le> real_of_float (float_plus_up prec x y)
[PROOF STEP]
by (transfer; rule plus_down plus_up)+


[STATEMENT]
lemma spanset_contains_basis :
  "set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> basis_for (Span vs) us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us
[PROOF STEP]
proof (induct vs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set [] \<and> set us \<subseteq> RSpan [] \<and> RSpan [] = RSpan us \<and> R_lin_independent us
 2. \<And>a vs. \<lbrakk>set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us; set (a # vs) \<subseteq> V\<rbrakk> \<Longrightarrow> \<exists>us. set us \<subseteq> set (a # vs) \<and> set us \<subseteq> RSpan (a # vs) \<and> RSpan (a # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> V

goal (2 subgoals):
 1. set [] \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set [] \<and> set us \<subseteq> RSpan [] \<and> RSpan [] = RSpan us \<and> R_lin_independent us
 2. \<And>a vs. \<lbrakk>set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us; set (a # vs) \<subseteq> V\<rbrakk> \<Longrightarrow> \<exists>us. set us \<subseteq> set (a # vs) \<and> set us \<subseteq> RSpan (a # vs) \<and> RSpan (a # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>us. set us \<subseteq> set [] \<and> set us \<subseteq> RSpan [] \<and> RSpan [] = RSpan us \<and> R_lin_independent us
[PROOF STEP]
using lin_independent_Nil
[PROOF STATE]
proof (prove)
using this:
R_lin_independent [] = True

goal (1 subgoal):
 1. \<exists>us. set us \<subseteq> set [] \<and> set us \<subseteq> RSpan [] \<and> RSpan [] = RSpan us \<and> R_lin_independent us
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>us. set us \<subseteq> set [] \<and> set us \<subseteq> RSpan [] \<and> RSpan [] = RSpan us \<and> R_lin_independent us

goal (1 subgoal):
 1. \<And>a vs. \<lbrakk>set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us; set (a # vs) \<subseteq> V\<rbrakk> \<Longrightarrow> \<exists>us. set us \<subseteq> set (a # vs) \<and> set us \<subseteq> RSpan (a # vs) \<and> RSpan (a # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a vs. \<lbrakk>set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us; set (a # vs) \<subseteq> V\<rbrakk> \<Longrightarrow> \<exists>us. set us \<subseteq> set (a # vs) \<and> set us \<subseteq> RSpan (a # vs) \<and> RSpan (a # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
case (Cons v vs)
[PROOF STATE]
proof (state)
this:
set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us
set (v # vs) \<subseteq> V

goal (1 subgoal):
 1. \<And>a vs. \<lbrakk>set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us; set (a # vs) \<subseteq> V\<rbrakk> \<Longrightarrow> \<exists>us. set us \<subseteq> set (a # vs) \<and> set us \<subseteq> RSpan (a # vs) \<and> RSpan (a # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us
set (v # vs) \<subseteq> V
[PROOF STEP]
obtain ws where ws: "set ws \<subseteq> set vs" "basis_for (Span vs) ws"
[PROOF STATE]
proof (prove)
using this:
set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us
set (v # vs) \<subseteq> V

goal (1 subgoal):
 1. (\<And>ws. \<lbrakk>set ws \<subseteq> set vs; set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set ws \<subseteq> set vs
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws

goal (1 subgoal):
 1. \<And>a vs. \<lbrakk>set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set vs \<and> set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us; set (a # vs) \<subseteq> V\<rbrakk> \<Longrightarrow> \<exists>us. set us \<subseteq> set (a # vs) \<and> set us \<subseteq> RSpan (a # vs) \<and> RSpan (a # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
proof (cases "v \<in> Span vs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v \<in> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
 2. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
v \<in> RSpan vs

goal (2 subgoals):
 1. v \<in> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
 2. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
with Cons(2) ws(2)
[PROOF STATE]
proof (chain)
picking this:
set (v # vs) \<subseteq> V
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws
v \<in> RSpan vs
[PROOF STEP]
have "basis_for (Span (v#vs)) ws"
[PROOF STATE]
proof (prove)
using this:
set (v # vs) \<subseteq> V
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws
v \<in> RSpan vs

goal (1 subgoal):
 1. set ws \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan ws \<and> R_lin_independent ws
[PROOF STEP]
using spanset_reduce_Cons
[PROOF STATE]
proof (prove)
using this:
set (v # vs) \<subseteq> V
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws
v \<in> RSpan vs
\<lbrakk>set ?ms \<subseteq> V; ?m \<in> RSpan ?ms\<rbrakk> \<Longrightarrow> RSpan (?m # ?ms) = RSpan ?ms

goal (1 subgoal):
 1. set ws \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan ws \<and> R_lin_independent ws
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
set ws \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan ws \<and> R_lin_independent ws

goal (2 subgoals):
 1. v \<in> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
 2. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
with ws(1)
[PROOF STATE]
proof (chain)
picking this:
set ws \<subseteq> set vs
set ws \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan ws \<and> R_lin_independent ws
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set ws \<subseteq> set vs
set ws \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan ws \<and> R_lin_independent ws

goal (1 subgoal):
 1. \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us

goal (1 subgoal):
 1. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
v \<notin> RSpan vs

goal (1 subgoal):
 1. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
from Cons(2) ws
[PROOF STATE]
proof (chain)
picking this:
set (v # vs) \<subseteq> V
set ws \<subseteq> set vs
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws
[PROOF STEP]
have  "set (v#ws) \<subseteq> set (v#vs)" "set (v#ws) \<subseteq> Span (v#vs)"
            "Span (v#vs) = Span (v#ws)"
[PROOF STATE]
proof (prove)
using this:
set (v # vs) \<subseteq> V
set ws \<subseteq> set vs
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws

goal (1 subgoal):
 1. set (v # ws) \<subseteq> set (v # vs) &&& set (v # ws) \<subseteq> RSpan (v # vs) &&& RSpan (v # vs) = RSpan (v # ws)
[PROOF STEP]
using Span_contains_spanset[of "v#vs"]
            Span_contains_Spans_Cons_right[of v vs] Span_Cons
[PROOF STATE]
proof (prove)
using this:
set (v # vs) \<subseteq> V
set ws \<subseteq> set vs
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws
set (v # vs) \<subseteq> V \<Longrightarrow> set (v # vs) \<subseteq> RSpan (v # vs)
v \<in> V \<Longrightarrow> RSpan vs \<subseteq> RSpan (v # vs)
RSpan (?m # ?ms) = RSpan [?m] + RSpan ?ms

goal (1 subgoal):
 1. set (v # ws) \<subseteq> set (v # vs) &&& set (v # ws) \<subseteq> RSpan (v # vs) &&& RSpan (v # vs) = RSpan (v # ws)
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
set (v # ws) \<subseteq> set (v # vs)
set (v # ws) \<subseteq> RSpan (v # vs)
RSpan (v # vs) = RSpan (v # ws)

goal (1 subgoal):
 1. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set (v # ws) \<subseteq> set (v # vs)
set (v # ws) \<subseteq> RSpan (v # vs)
RSpan (v # vs) = RSpan (v # ws)

goal (1 subgoal):
 1. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
have "lin_independent (v#ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R_lin_independent (v # ws)
[PROOF STEP]
proof (rule lin_independent_Cons_conditions)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. v \<in> V
 2. set ws \<subseteq> V
 3. v \<notin> RSpan ws
 4. R_lin_independent ws
[PROOF STEP]
from Cons(2) ws(1)
[PROOF STATE]
proof (chain)
picking this:
set (v # vs) \<subseteq> V
set ws \<subseteq> set vs
[PROOF STEP]
show "v \<in> V" "set ws \<subseteq> V"
[PROOF STATE]
proof (prove)
using this:
set (v # vs) \<subseteq> V
set ws \<subseteq> set vs

goal (1 subgoal):
 1. v \<in> V &&& set ws \<subseteq> V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> V
set ws \<subseteq> V

goal (2 subgoals):
 1. v \<notin> RSpan ws
 2. R_lin_independent ws
[PROOF STEP]
from ws(2) False
[PROOF STATE]
proof (chain)
picking this:
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws
v \<notin> RSpan vs
[PROOF STEP]
show "v \<notin> Span ws" "lin_independent ws"
[PROOF STATE]
proof (prove)
using this:
set ws \<subseteq> RSpan vs \<and> RSpan vs = RSpan ws \<and> R_lin_independent ws
v \<notin> RSpan vs

goal (1 subgoal):
 1. v \<notin> RSpan ws &&& R_lin_independent ws
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<notin> RSpan ws
R_lin_independent ws

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
R_lin_independent (v # ws)

goal (1 subgoal):
 1. v \<notin> RSpan vs \<Longrightarrow> \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set (v # ws) \<subseteq> set (v # vs)
set (v # ws) \<subseteq> RSpan (v # vs)
RSpan (v # vs) = RSpan (v # ws)
R_lin_independent (v # ws)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set (v # ws) \<subseteq> set (v # vs)
set (v # ws) \<subseteq> RSpan (v # vs)
RSpan (v # vs) = RSpan (v # ws)
R_lin_independent (v # ws)

goal (1 subgoal):
 1. \<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>us. set us \<subseteq> set (v # vs) \<and> set us \<subseteq> RSpan (v # vs) \<and> RSpan (v # vs) = RSpan us \<and> R_lin_independent us

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma maximum:
  assumes asm: "finite C"
  shows "\<exists>n :: nat. \<forall>l \<in> C. f l \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. \<forall>l\<in>C. f l \<le> n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>l\<in>C. f l \<le> ?n
[PROOF STEP]
from asm
[PROOF STATE]
proof (chain)
picking this:
finite C
[PROOF STEP]
show "\<forall>l\<in>C. f l \<le> (Max (f ` C))"
[PROOF STATE]
proof (prove)
using this:
finite C

goal (1 subgoal):
 1. \<forall>l\<in>C. f l \<le> Max (f ` C)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>l\<in>C. f l \<le> Max (f ` C)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma epair_None[simp]: "epair {a,b} = None \<longleftrightarrow> a=b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (epair {a, b} = None) = (a = b)
[PROOF STEP]
unfolding epair_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if card {a, b} = 2 then Some (SOME (u, v). {a, b} = {u, v}) else None) = None) = (a = b)
[PROOF STEP]
by (auto simp: card2_eq)


[STATEMENT]
lemma fps_unit_factor_mult_both_unit_factor:
  fixes f g :: "'a::{comm_monoid_add,mult_zero} fps"
  shows "unit_factor (unit_factor f * unit_factor g) = unit_factor (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (unit_factor f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
using fps_unit_factor_mult_unit_factor(1)[of "unit_factor f" g]
        fps_unit_factor_mult_unit_factor(2)[of f g]
[PROOF STATE]
proof (prove)
using this:
unit_factor (unit_factor f * unit_factor g) = unit_factor (unit_factor f * g)
unit_factor (unit_factor f * g) = unit_factor (f * g)

goal (1 subgoal):
 1. unit_factor (unit_factor f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
by    simp


[STATEMENT]
lemma countableI_bij: "bij_betw f (C::nat set) S \<Longrightarrow> countable S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f C S \<Longrightarrow> countable S
[PROOF STEP]
by (blast intro: countableI bij_betw_inv_into bij_betw_imp_inj_on)


[STATEMENT]
lemma eval_fds_zeroD:
  fixes h :: "'a fds"
  assumes conv: "conv_abscissa h < \<infinity>"
  assumes freq: "frequently (\<lambda>s. eval_fds h s = 0) ((\<lambda>s. s \<bullet> 1) going_to at_top)"
  shows   "h = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h = 0
[PROOF STEP]
have [simp]: "2 \<bullet> (1 :: 'a) = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) \<bullet> (1::'a) = 2
[PROOF STEP]
using of_real_inner_1[of 2]
[PROOF STATE]
proof (prove)
using this:
of_real 2 \<bullet> (1::?'a) = 2

goal (1 subgoal):
 1. (2::'a) \<bullet> (1::'a) = 2
[PROOF STEP]
unfolding of_real_numeral
[PROOF STATE]
proof (prove)
using this:
(2::?'a) \<bullet> (1::?'a) = 2

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

goal (1 subgoal):
 1. h = 0
[PROOF STEP]
from conv
[PROOF STATE]
proof (chain)
picking this:
conv_abscissa h < \<infinity>
[PROOF STEP]
obtain s where "fds_converges h s"
[PROOF STATE]
proof (prove)
using this:
conv_abscissa h < \<infinity>

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

goal (1 subgoal):
 1. h = 0
[PROOF STEP]
hence "fds_abs_converges h (s + 2)"
[PROOF STATE]
proof (prove)
using this:
fds_converges h s

goal (1 subgoal):
 1. fds_abs_converges h (s + (2::'a))
[PROOF STEP]
by (rule fds_converges_imp_abs_converges) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
fds_abs_converges h (s + (2::'a))

goal (1 subgoal):
 1. h = 0
[PROOF STEP]
from this assms(2-)
[PROOF STATE]
proof (chain)
picking this:
fds_abs_converges h (s + (2::'a))
\<exists>\<^sub>F s in (\<lambda>s. s \<bullet> (1::'a)) going_to at_top. eval_fds h s = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_abs_converges h (s + (2::'a))
\<exists>\<^sub>F s in (\<lambda>s. s \<bullet> (1::'a)) going_to at_top. eval_fds h s = (0::'a)

goal (1 subgoal):
 1. h = 0
[PROOF STEP]
by (rule eval_fds_zeroD_aux)
[PROOF STATE]
proof (state)
this:
h = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nats_le_HNatInfinite: "x \<in> Nats \<Longrightarrow> y \<in> HNatInfinite \<Longrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<nat>; y \<in> HNatInfinite\<rbrakk> \<Longrightarrow> x \<le> y
[PROOF STEP]
by (rule Nats_less_HNatInfinite [THEN order_less_imp_le])


[STATEMENT]
lemma deg_sect_insert:
  "deg_sect (insert x X) d = (\<Union>d0\<le>d. (+) (Poly_Mapping.single x (d - d0)) ` deg_sect X d0)"
    (is "?A = ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_sect (insert x X) d = (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
[PROOF STEP]
proof (rule set_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. (xa \<in> deg_sect (insert x X) d) = (xa \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0))
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. (xa \<in> deg_sect (insert x X) d) = (xa \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0))
[PROOF STEP]
show "t \<in> ?A \<longleftrightarrow> t \<in> ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t \<in> deg_sect (insert x X) d) = (t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
assume "t \<in> ?A"
[PROOF STATE]
proof (state)
this:
t \<in> deg_sect (insert x X) d

goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
hence "t \<in> .[insert x X]" and "deg_pm t = d"
[PROOF STATE]
proof (prove)
using this:
t \<in> deg_sect (insert x X) d

goal (1 subgoal):
 1. t \<in> .[insert x X] &&& deg_pm t = d
[PROOF STEP]
by (rule deg_sectD)+
[PROOF STATE]
proof (state)
this:
t \<in> .[insert x X]
deg_pm t = d

goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
from this(1)
[PROOF STATE]
proof (chain)
picking this:
t \<in> .[insert x X]
[PROOF STEP]
obtain e tx where "tx \<in> .[X]" and t: "t = Poly_Mapping.single x e + tx"
[PROOF STATE]
proof (prove)
using this:
t \<in> .[insert x X]

goal (1 subgoal):
 1. (\<And>tx e. \<lbrakk>tx \<in> .[X]; t = monomial e x + tx\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule PPs_insertE)
[PROOF STATE]
proof (state)
this:
tx \<in> .[X]
t = monomial e x + tx

goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
have "e + deg_pm tx = deg_pm t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e + deg_pm tx = deg_pm t
[PROOF STEP]
by (simp add: t deg_pm_plus deg_pm_single)
[PROOF STATE]
proof (state)
this:
e + deg_pm tx = deg_pm t

goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
hence "e + deg_pm tx = d"
[PROOF STATE]
proof (prove)
using this:
e + deg_pm tx = deg_pm t

goal (1 subgoal):
 1. e + deg_pm tx = d
[PROOF STEP]
by (simp only: \<open>deg_pm t = d\<close>)
[PROOF STATE]
proof (state)
this:
e + deg_pm tx = d

goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
hence "deg_pm tx \<in> {..d}" and e: "e = d - deg_pm tx"
[PROOF STATE]
proof (prove)
using this:
e + deg_pm tx = d

goal (1 subgoal):
 1. deg_pm tx \<in> {..d} &&& e = d - deg_pm tx
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
deg_pm tx \<in> {..d}
e = d - deg_pm tx

goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
from \<open>tx \<in> .[X]\<close> refl
[PROOF STATE]
proof (chain)
picking this:
tx \<in> .[X]
?t = ?t
[PROOF STEP]
have "tx \<in> deg_sect X (deg_pm tx)"
[PROOF STATE]
proof (prove)
using this:
tx \<in> .[X]
?t = ?t

goal (1 subgoal):
 1. tx \<in> deg_sect X (deg_pm tx)
[PROOF STEP]
by (rule deg_sectI)
[PROOF STATE]
proof (state)
this:
tx \<in> deg_sect X (deg_pm tx)

goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
hence "t \<in> (+) (Poly_Mapping.single x (d - deg_pm tx)) ` deg_sect X (deg_pm tx)"
[PROOF STATE]
proof (prove)
using this:
tx \<in> deg_sect X (deg_pm tx)

goal (1 subgoal):
 1. t \<in> (+) (monomial (d - deg_pm tx) x) ` deg_sect X (deg_pm tx)
[PROOF STEP]
unfolding t e
[PROOF STATE]
proof (prove)
using this:
tx \<in> deg_sect X (deg_pm tx)

goal (1 subgoal):
 1. monomial (d - deg_pm tx) x + tx \<in> (+) (monomial (d - deg_pm tx) x) ` deg_sect X (deg_pm tx)
[PROOF STEP]
by (rule imageI)
[PROOF STATE]
proof (state)
this:
t \<in> (+) (monomial (d - deg_pm tx) x) ` deg_sect X (deg_pm tx)

goal (2 subgoals):
 1. t \<in> deg_sect (insert x X) d \<Longrightarrow> t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
 2. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
with \<open>deg_pm tx \<in> {..d}\<close>
[PROOF STATE]
proof (chain)
picking this:
deg_pm tx \<in> {..d}
t \<in> (+) (monomial (d - deg_pm tx) x) ` deg_sect X (deg_pm tx)
[PROOF STEP]
show "t \<in> ?B"
[PROOF STATE]
proof (prove)
using this:
deg_pm tx \<in> {..d}
t \<in> (+) (monomial (d - deg_pm tx) x) ` deg_sect X (deg_pm tx)

goal (1 subgoal):
 1. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)

goal (1 subgoal):
 1. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
assume "t \<in> ?B"
[PROOF STATE]
proof (state)
this:
t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)

goal (1 subgoal):
 1. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)
[PROOF STEP]
obtain d0 where "d0 \<in> {..d}" and "t \<in> (+) (Poly_Mapping.single x (d - d0)) ` deg_sect X d0"
[PROOF STATE]
proof (prove)
using this:
t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0)

goal (1 subgoal):
 1. (\<And>d0. \<lbrakk>d0 \<in> {..d}; t \<in> (+) (monomial (d - d0) x) ` deg_sect X d0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
d0 \<in> {..d}
t \<in> (+) (monomial (d - d0) x) ` deg_sect X d0

goal (1 subgoal):
 1. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
from this(2)
[PROOF STATE]
proof (chain)
picking this:
t \<in> (+) (monomial (d - d0) x) ` deg_sect X d0
[PROOF STEP]
obtain s where s: "s \<in> deg_sect X d0"
      and t: "t = Poly_Mapping.single x (d - d0) + s" (is "t = ?s + s")
[PROOF STATE]
proof (prove)
using this:
t \<in> (+) (monomial (d - d0) x) ` deg_sect X d0

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>s \<in> deg_sect X d0; t = monomial (d - d0) x + s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
s \<in> deg_sect X d0
t = monomial (d - d0) x + s

goal (1 subgoal):
 1. t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0) \<Longrightarrow> t \<in> deg_sect (insert x X) d
[PROOF STEP]
show "t \<in> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> deg_sect (insert x X) d
[PROOF STEP]
proof (rule deg_sectI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t \<in> .[insert x X]
 2. deg_pm t = d
[PROOF STEP]
have "?s \<in> .[insert x X]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomial (d - d0) x \<in> .[insert x X]
[PROOF STEP]
by (rule PPs_closed_single, simp)
[PROOF STATE]
proof (state)
this:
monomial (d - d0) x \<in> .[insert x X]

goal (2 subgoals):
 1. t \<in> .[insert x X]
 2. deg_pm t = d
[PROOF STEP]
from s
[PROOF STATE]
proof (chain)
picking this:
s \<in> deg_sect X d0
[PROOF STEP]
have "s \<in> .[X]"
[PROOF STATE]
proof (prove)
using this:
s \<in> deg_sect X d0

goal (1 subgoal):
 1. s \<in> .[X]
[PROOF STEP]
by (rule deg_sectD)
[PROOF STATE]
proof (state)
this:
s \<in> .[X]

goal (2 subgoals):
 1. t \<in> .[insert x X]
 2. deg_pm t = d
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
s \<in> .[X]

goal (2 subgoals):
 1. t \<in> .[insert x X]
 2. deg_pm t = d
[PROOF STEP]
have "... \<subseteq> .[insert x X]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. .[X] \<subseteq> .[insert x X]
[PROOF STEP]
by (rule PPs_mono, blast)
[PROOF STATE]
proof (state)
this:
.[X] \<subseteq> .[insert x X]

goal (2 subgoals):
 1. t \<in> .[insert x X]
 2. deg_pm t = d
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
s \<in> .[insert x X]
[PROOF STEP]
have "s \<in> .[insert x X]"
[PROOF STATE]
proof (prove)
using this:
s \<in> .[insert x X]

goal (1 subgoal):
 1. s \<in> .[insert x X]
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
s \<in> .[insert x X]

goal (2 subgoals):
 1. t \<in> .[insert x X]
 2. deg_pm t = d
[PROOF STEP]
with \<open>?s \<in> .[insert x X]\<close>
[PROOF STATE]
proof (chain)
picking this:
monomial (d - d0) x \<in> .[insert x X]
s \<in> .[insert x X]
[PROOF STEP]
show "t \<in> .[insert x X]"
[PROOF STATE]
proof (prove)
using this:
monomial (d - d0) x \<in> .[insert x X]
s \<in> .[insert x X]

goal (1 subgoal):
 1. t \<in> .[insert x X]
[PROOF STEP]
unfolding t
[PROOF STATE]
proof (prove)
using this:
monomial (d - d0) x \<in> .[insert x X]
s \<in> .[insert x X]

goal (1 subgoal):
 1. monomial (d - d0) x + s \<in> .[insert x X]
[PROOF STEP]
by (rule PPs_closed_plus)
[PROOF STATE]
proof (state)
this:
t \<in> .[insert x X]

goal (1 subgoal):
 1. deg_pm t = d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deg_pm t = d
[PROOF STEP]
from s
[PROOF STATE]
proof (chain)
picking this:
s \<in> deg_sect X d0
[PROOF STEP]
have "deg_pm s = d0"
[PROOF STATE]
proof (prove)
using this:
s \<in> deg_sect X d0

goal (1 subgoal):
 1. deg_pm s = d0
[PROOF STEP]
by (rule deg_sectD)
[PROOF STATE]
proof (state)
this:
deg_pm s = d0

goal (1 subgoal):
 1. deg_pm t = d
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
deg_pm s = d0

goal (1 subgoal):
 1. deg_pm t = d
[PROOF STEP]
from \<open>d0 \<in> {..d}\<close>
[PROOF STATE]
proof (chain)
picking this:
d0 \<in> {..d}
[PROOF STEP]
have "d0 \<le> d"
[PROOF STATE]
proof (prove)
using this:
d0 \<in> {..d}

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

goal (1 subgoal):
 1. deg_pm t = d
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
deg_pm s = d0
d0 \<le> d
[PROOF STEP]
show "deg_pm t = d"
[PROOF STATE]
proof (prove)
using this:
deg_pm s = d0
d0 \<le> d

goal (1 subgoal):
 1. deg_pm t = d
[PROOF STEP]
by (simp add: t deg_pm_single deg_pm_plus)
[PROOF STATE]
proof (state)
this:
deg_pm t = d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
t \<in> deg_sect (insert x X) d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(t \<in> deg_sect (insert x X) d) = (t \<in> (\<Union>d0\<le>d. (+) (monomial (d - d0) x) ` deg_sect X d0))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma preserves_right_adjoint:
    assumes "C.is_right_adjoint g"
    shows "D.is_right_adjoint (F g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D.is_right_adjoint (F g)
[PROOF STEP]
using assms preserves_adjoint_pair
[PROOF STATE]
proof (prove)
using this:
C.is_right_adjoint g
C.adjoint_pair ?f ?g \<Longrightarrow> D.adjoint_pair (F ?f) (F ?g)

goal (1 subgoal):
 1. D.is_right_adjoint (F g)
[PROOF STEP]
by auto


[STATEMENT]
lemma mult_sm_inv_l:
  assumes "k \<noteq> 0" and "k *\<^sub>s\<^sub>m A = B"
  shows "A = (1/k) *\<^sub>s\<^sub>m B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = (1 / k) *\<^sub>s\<^sub>m B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
k *\<^sub>s\<^sub>m A = B

goal (1 subgoal):
 1. A = (1 / k) *\<^sub>s\<^sub>m B
[PROOF STEP]
by auto


[STATEMENT]
lemma split_comp_eq_pair: "(\<lambda>x. fst x = a) = (\<lambda>(x,y). x = a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. fst x = a) = (\<lambda>(x, y). x = a)
[PROOF STEP]
by (rule split_comp_eq)


[STATEMENT]
lemma nat_to_pr_lm_6: "c_fst n mod 7 = 6 \<Longrightarrow> nat_to_pr n x = (UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n)))) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_fst n mod 7 = 6 \<Longrightarrow> nat_to_pr n x = UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n))) x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_fst n mod 7 = 6 \<Longrightarrow> nat_to_pr n x = UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n))) x
[PROOF STEP]
assume A: "c_fst n mod 7 = 6"
[PROOF STATE]
proof (state)
this:
c_fst n mod 7 = 6

goal (1 subgoal):
 1. c_fst n mod 7 = 6 \<Longrightarrow> nat_to_pr n x = UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n))) x
[PROOF STEP]
have S1: "nat_to_pr n x = sch_to_pr (nat_to_sch n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr n x = sch_to_pr (nat_to_sch n) x
[PROOF STEP]
by (simp add: nat_to_pr_def)
[PROOF STATE]
proof (state)
this:
nat_to_pr n x = sch_to_pr (nat_to_sch n) x

goal (1 subgoal):
 1. c_fst n mod 7 = 6 \<Longrightarrow> nat_to_pr n x = UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n))) x
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
c_fst n mod 7 = 6
[PROOF STEP]
have S2: "nat_to_sch n = Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))"
[PROOF STATE]
proof (prove)
using this:
c_fst n mod 7 = 6

goal (1 subgoal):
 1. nat_to_sch n = Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
by (rule nat_to_sch_6)
[PROOF STATE]
proof (state)
this:
nat_to_sch n = Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))

goal (1 subgoal):
 1. c_fst n mod 7 = 6 \<Longrightarrow> nat_to_pr n x = UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n))) x
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
nat_to_pr n x = sch_to_pr (nat_to_sch n) x
nat_to_sch n = Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
have S3: "nat_to_pr n x = sch_to_pr (Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))) x"
[PROOF STATE]
proof (prove)
using this:
nat_to_pr n x = sch_to_pr (nat_to_sch n) x
nat_to_sch n = Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))

goal (1 subgoal):
 1. nat_to_pr n x = sch_to_pr (Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_to_pr n x = sch_to_pr (Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))) x

goal (1 subgoal):
 1. c_fst n mod 7 = 6 \<Longrightarrow> nat_to_pr n x = UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n))) x
[PROOF STEP]
from S3
[PROOF STATE]
proof (chain)
picking this:
nat_to_pr n x = sch_to_pr (Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nat_to_pr n x = sch_to_pr (Rec_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))) x

goal (1 subgoal):
 1. nat_to_pr n x = UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n))) x
[PROOF STEP]
by (simp add: nat_to_pr_def)
[PROOF STATE]
proof (state)
this:
nat_to_pr n x = UnaryRecOp (nat_to_pr (c_fst (c_snd n))) (nat_to_pr (c_snd (c_snd n))) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma signed_real_of_word_plus_numeral_eq_signed_real_of_word_iff:
  \<open>signed_real_of_word v + numeral n = signed_real_of_word w
    \<longleftrightarrow> sint v + numeral n = sint w\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (signed_real_of_word v + numeral n = signed_real_of_word w) = (sint v + numeral n = sint w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (signed_real_of_word v + numeral n = signed_real_of_word w) = (sint v + numeral n = sint w)
[PROOF STEP]
have \<open>?Q \<longleftrightarrow> real_of_int (sint v + numeral n) = real_of_int (sint w)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sint v + numeral n = sint w) = (real_of_int (sint v + numeral n) = real_of_int (sint w))
[PROOF STEP]
by (simp only: of_int_eq_iff)
[PROOF STATE]
proof (state)
this:
(sint v + numeral n = sint w) = (real_of_int (sint v + numeral n) = real_of_int (sint w))

goal (1 subgoal):
 1. (signed_real_of_word v + numeral n = signed_real_of_word w) = (sint v + numeral n = sint w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(sint v + numeral n = sint w) = (real_of_int (sint v + numeral n) = real_of_int (sint w))

goal (1 subgoal):
 1. (signed_real_of_word v + numeral n = signed_real_of_word w) = (sint v + numeral n = sint w)
[PROOF STEP]
have \<open>\<dots> \<longleftrightarrow> ?P\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (sint v + numeral n) = real_of_int (sint w)) = (signed_real_of_word v + numeral n = signed_real_of_word w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(real_of_int (sint v + numeral n) = real_of_int (sint w)) = (signed_real_of_word v + numeral n = signed_real_of_word w)

goal (1 subgoal):
 1. (signed_real_of_word v + numeral n = signed_real_of_word w) = (sint v + numeral n = sint w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(sint v + numeral n = sint w) = (signed_real_of_word v + numeral n = signed_real_of_word w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sint v + numeral n = sint w) = (signed_real_of_word v + numeral n = signed_real_of_word w)

goal (1 subgoal):
 1. (signed_real_of_word v + numeral n = signed_real_of_word w) = (sint v + numeral n = sint w)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(signed_real_of_word v + numeral n = signed_real_of_word w) = (sint v + numeral n = sint w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hfset_hdiff: "hfset (x - y) = hfset x - hfset y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hfset (x - y) = hfset x - hfset y
[PROOF STEP]
proof (induct x arbitrary: y rule: hf_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. hfset (0 - y) = hfset 0 - hfset y
 2. \<And>x y ya. \<lbrakk>\<And>y. hfset (x - y) = hfset x - hfset y; \<And>ya. hfset (y - ya) = hfset y - hfset ya; x \<^bold>\<notin> y\<rbrakk> \<Longrightarrow> hfset ((y \<triangleleft> x) - ya) = hfset (y \<triangleleft> x) - hfset ya
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>y. hfset (0 - y) = hfset 0 - hfset y
 2. \<And>x y ya. \<lbrakk>\<And>y. hfset (x - y) = hfset x - hfset y; \<And>ya. hfset (y - ya) = hfset y - hfset ya; x \<^bold>\<notin> y\<rbrakk> \<Longrightarrow> hfset ((y \<triangleleft> x) - ya) = hfset (y \<triangleleft> x) - hfset ya
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hfset (0 - y) = hfset 0 - hfset y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hfset (0 - y) = hfset 0 - hfset y

goal (1 subgoal):
 1. \<And>x y ya. \<lbrakk>\<And>y. hfset (x - y) = hfset x - hfset y; \<And>ya. hfset (y - ya) = hfset y - hfset ya; x \<^bold>\<notin> y\<rbrakk> \<Longrightarrow> hfset ((y \<triangleleft> x) - ya) = hfset (y \<triangleleft> x) - hfset ya
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y ya. \<lbrakk>\<And>y. hfset (x - y) = hfset x - hfset y; \<And>ya. hfset (y - ya) = hfset y - hfset ya; x \<^bold>\<notin> y\<rbrakk> \<Longrightarrow> hfset ((y \<triangleleft> x) - ya) = hfset (y \<triangleleft> x) - hfset ya
[PROOF STEP]
case (hinsert a b)
[PROOF STATE]
proof (state)
this:
hfset (a - ?y) = hfset a - hfset ?y
hfset (b - ?y) = hfset b - hfset ?y
a \<^bold>\<notin> b

goal (1 subgoal):
 1. \<And>x y ya. \<lbrakk>\<And>y. hfset (x - y) = hfset x - hfset y; \<And>ya. hfset (y - ya) = hfset y - hfset ya; x \<^bold>\<notin> y\<rbrakk> \<Longrightarrow> hfset ((y \<triangleleft> x) - ya) = hfset (y \<triangleleft> x) - hfset ya
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
hfset (a - ?y) = hfset a - hfset ?y
hfset (b - ?y) = hfset b - hfset ?y
a \<^bold>\<notin> b

goal (1 subgoal):
 1. hfset ((b \<triangleleft> a) - y) = hfset (b \<triangleleft> a) - hfset y
[PROOF STEP]
by (simp add: hfset_hinsert Set.insert_Diff_if hinsert_hdiff_if hmem_def)
[PROOF STATE]
proof (state)
this:
hfset ((b \<triangleleft> a) - y) = hfset (b \<triangleleft> a) - hfset y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monomial_is_Zp_continuous:
  assumes "c \<in> carrier Zp"
  shows "is_Zp_continuous (monomial c n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_Zp_continuous (monomial c n)
[PROOF STEP]
using monomial_equation[of c n] nat_pow_is_Zp_continuous
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier Zp \<Longrightarrow> monomial c n = c \<odot>\<^bsub>function_ring (carrier Zp) Zp\<^esub> ring_id [^]\<^bsub>function_ring (carrier Zp) Zp\<^esub> n
is_Zp_continuous ?f \<Longrightarrow> is_Zp_continuous (?f [^]\<^bsub>function_ring (carrier Zp) Zp\<^esub> ?n)

goal (1 subgoal):
 1. is_Zp_continuous (monomial c n)
[PROOF STEP]
by (simp add: assms id_Zp_is_Zp_continuous smult_is_continuous)


[STATEMENT]
lemma not_eSuc_ilei0 [simp]: "\<not> eSuc n \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> eSuc n \<le> 0
[PROOF STEP]
by (simp add: zero_enat_def eSuc_def less_eq_enat_def split: enat.splits)


[STATEMENT]
lemma of_int_poly_smult [simp]: "of_int_poly (smult c p) = smult (of_int c) (of_int_poly p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_poly (Polynomial.smult c p) = Polynomial.smult (of_int c) (of_int_poly p)
[PROOF STEP]
by transfer simp