[STATEMENT]
lemma bfun_tendsto_apply_bfun:
  assumes h: "(F :: (nat \<Rightarrow> 'a \<Rightarrow>\<^sub>b real)) \<longlonglongrightarrow> (y :: 'a \<Rightarrow>\<^sub>b real)"
  shows "(\<lambda>n. F n x) \<longlonglongrightarrow> y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x
[PROOF STEP]
have aux: "(\<lambda>n. dist (F n) y) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. dist (F n) y) \<longlonglongrightarrow> 0
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
F \<longlonglongrightarrow> y

goal (1 subgoal):
 1. (\<lambda>n. dist (F n) y) \<longlonglongrightarrow> 0
[PROOF STEP]
using tendsto_dist_iff
[PROOF STATE]
proof (prove)
using this:
F \<longlonglongrightarrow> y
(?f \<longlongrightarrow> ?l) ?F = ((\<lambda>x. dist (?f x) ?l) \<longlongrightarrow> 0) ?F

goal (1 subgoal):
 1. (\<lambda>n. dist (F n) y) \<longlonglongrightarrow> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. dist (F n) y) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x
[PROOF STEP]
have "\<And>n. dist (F n x) (y x) \<le> dist (F n) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. dist (apply_bfun (F n) x) (apply_bfun y x) \<le> dist (F n) y
[PROOF STEP]
unfolding dist_bfun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. dist (apply_bfun (F n) x) (apply_bfun y x) \<le> map_fun apply_bfun (map_fun apply_bfun id) (\<lambda>f g. \<Squnion>x. dist (f x) (g x)) (F n) y
[PROOF STEP]
using Bounded_Continuous_Function.bounded_dist_le_SUP_dist
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bounded (range ?f); bounded (range ?g)\<rbrakk> \<Longrightarrow> dist (?f ?x) (?g ?x) \<le> (\<Squnion>x. dist (?f x) (?g x))

goal (1 subgoal):
 1. \<And>n. dist (apply_bfun (F n) x) (apply_bfun y x) \<le> map_fun apply_bfun (map_fun apply_bfun id) (\<lambda>f g. \<Squnion>x. dist (f x) (g x)) (F n) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
dist (apply_bfun (F ?n) x) (apply_bfun y x) \<le> dist (F ?n) y

goal (1 subgoal):
 1. (\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x
[PROOF STEP]
hence "\<And>n. norm (dist (F n x) (y x)) \<le> norm(dist (F n) y)"
[PROOF STATE]
proof (prove)
using this:
dist (apply_bfun (F ?n) x) (apply_bfun y x) \<le> dist (F ?n) y

goal (1 subgoal):
 1. \<And>n. norm (dist (apply_bfun (F n) x) (apply_bfun y x)) \<le> norm (dist (F n) y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm (dist (apply_bfun (F ?n) x) (apply_bfun y x)) \<le> norm (dist (F ?n) y)

goal (1 subgoal):
 1. (\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x
[PROOF STEP]
hence "(\<lambda>n. dist (F n x) (y x)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
norm (dist (apply_bfun (F ?n) x) (apply_bfun y x)) \<le> norm (dist (F ?n) y)

goal (1 subgoal):
 1. (\<lambda>n. dist (apply_bfun (F n) x) (apply_bfun y x)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (subst Lim_transform_bound[OF _ aux]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. dist (apply_bfun (F n) x) (apply_bfun y x)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. dist (apply_bfun (F n) x) (apply_bfun y x)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x
[PROOF STEP]
using tendsto_dist_iff
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. dist (apply_bfun (F n) x) (apply_bfun y x)) \<longlonglongrightarrow> 0
(?f \<longlongrightarrow> ?l) ?F = ((\<lambda>x. dist (?f x) ?l) \<longlongrightarrow> 0) ?F

goal (1 subgoal):
 1. (\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. apply_bfun (F n) x) \<longlonglongrightarrow> apply_bfun y x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cong_modulus_mult:
  "[x = y] (mod m)" if "[x = y] (mod m * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [x = y] (mod m)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
[x = y] (mod m * n)

goal (1 subgoal):
 1. [x = y] (mod m)
[PROOF STEP]
by (simp add: cong_iff_dvd_diff) (rule dvd_mult_left)


[STATEMENT]
lemma mat_hom_add: assumes A: "A \<in> carrier_mat nr nc" and B: "B \<in> carrier_mat nr nc"
  shows "mat\<^sub>h (A + B) = mat\<^sub>h A + mat\<^sub>h B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat\<^sub>h (A + B) = mat\<^sub>h A + mat\<^sub>h B
[PROOF STEP]
by (intro eq_matI, insert A B, auto simp: hom_add)


[STATEMENT]
lemma map_nth_upt_drop_take_conv: "N \<le> length l \<Longrightarrow> map (nth l) [M..<N] = drop M (take N l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<le> length l \<Longrightarrow> map ((!) l) [M..<N] = drop M (take N l)
[PROOF STEP]
by (induction N) (auto simp: take_Suc_conv_app_nth)


[STATEMENT]
lemma FGModuleHomSetD_Im :
  "T \<in> FGModuleHomSet G fgsmult V fgsmult' W \<Longrightarrow> T ` V \<subseteq> W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<in> FGModuleHomSet G fgsmult V fgsmult' W \<Longrightarrow> T ` V \<subseteq> W
[PROOF STEP]
unfolding FGModuleHomSet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<in> {T. FGModuleHom G fgsmult V fgsmult' T} \<inter> {T. T ` V \<subseteq> W} \<Longrightarrow> T ` V \<subseteq> W
[PROOF STEP]
by fast


[STATEMENT]
lemma surj_list_encode: "surj list_encode"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj list_encode
[PROOF STEP]
by (rule surjI) (rule list_decode_inverse)


[STATEMENT]
lemma (in domain) finite_number_of_roots:
  assumes "p \<in> carrier (poly_ring R)" shows "finite { x. is_root p x }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. is_root p x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. finite {x. is_root p x}
[PROOF STEP]
proof (induction "degree p" arbitrary: p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>0 = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p))
 2. \<And>x p. \<lbrakk>\<And>p. \<lbrakk>x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p)); Suc x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 = degree p
p \<in> carrier (poly_ring R)

goal (2 subgoals):
 1. \<And>p. \<lbrakk>0 = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p))
 2. \<And>x p. \<lbrakk>\<And>p. \<lbrakk>x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p)); Suc x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 = degree p
p \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. finite {a. is_root p a}
[PROOF STEP]
by (simp add: degree_zero_imp_not_is_root)
[PROOF STATE]
proof (state)
this:
finite {a. is_root p a}

goal (1 subgoal):
 1. \<And>x p. \<lbrakk>\<And>p. \<lbrakk>x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p)); Suc x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x p. \<lbrakk>\<And>p. \<lbrakk>x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p)); Suc x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = degree ?p; ?p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root ?p))
Suc n = degree p
p \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. \<And>x p. \<lbrakk>\<And>p. \<lbrakk>x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p)); Suc x = degree p; p \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Collect (is_root p))
[PROOF STEP]
proof (cases "{ x. is_root p x } = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {x. is_root p x} = {} \<Longrightarrow> finite (Collect (is_root p))
 2. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
{x. is_root p x} = {}

goal (2 subgoals):
 1. {x. is_root p x} = {} \<Longrightarrow> finite (Collect (is_root p))
 2. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{x. is_root p x} = {}

goal (1 subgoal):
 1. finite (Collect (is_root p))
[PROOF STEP]
by (simp add: True)
[PROOF STATE]
proof (state)
this:
finite (Collect (is_root p))

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
interpret UP: domain "poly_ring R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain (poly_ring R)
[PROOF STEP]
using univ_poly_is_domain[OF carrier_is_subring]
[PROOF STATE]
proof (prove)
using this:
domain (poly_ring R)

goal (1 subgoal):
 1. domain (poly_ring R)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
{x. is_root p x} \<noteq> {}

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x. is_root p x} \<noteq> {}
[PROOF STEP]
obtain a where is_root: "is_root p a"
[PROOF STATE]
proof (prove)
using this:
{x. is_root p x} \<noteq> {}

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

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
hence a: "a \<in> carrier R" and eval: "eval p a = \<zero>" and p_not_zero: "p \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
is_root p a

goal (1 subgoal):
 1. a \<in> carrier R &&& local.eval p a = \<zero> &&& p \<noteq> []
[PROOF STEP]
unfolding is_root_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R \<and> local.eval p a = \<zero> \<and> p \<noteq> []

goal (1 subgoal):
 1. a \<in> carrier R &&& local.eval p a = \<zero> &&& p \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> carrier R
local.eval p a = \<zero>
p \<noteq> []

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
hence in_carrier: "[ \<one>, \<ominus> a ] \<in> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
local.eval p a = \<zero>
p \<noteq> []

goal (1 subgoal):
 1. [\<one>, \<ominus> a] \<in> carrier (poly_ring R)
[PROOF STEP]
unfolding sym[OF univ_poly_carrier] polynomial_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
local.eval p a = \<zero>
p \<noteq> []

goal (1 subgoal):
 1. [\<one>, \<ominus> a] = [] \<or> set [\<one>, \<ominus> a] \<subseteq> carrier R \<and> lead_coeff [\<one>, \<ominus> a] \<noteq> \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
obtain q where q: "q \<in> carrier (poly_ring R)" and p: "p = [ \<one>, \<ominus> a ] \<otimes>\<^bsub>poly_ring R\<^esub> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q. \<lbrakk>q \<in> carrier (poly_ring R); p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using is_root_imp_pdivides[OF Suc(3) is_root]
[PROOF STATE]
proof (prove)
using this:
[\<one>, \<ominus> a] pdivides p

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>q \<in> carrier (poly_ring R); p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding pdivides_def
[PROOF STATE]
proof (prove)
using this:
[\<one>, \<ominus> a] divides\<^bsub>poly_ring R\<^esub> p

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>q \<in> carrier (poly_ring R); p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q \<in> carrier (poly_ring R)
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
with \<open>p \<noteq> []\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> []
q \<in> carrier (poly_ring R)
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q
[PROOF STEP]
have q_not_zero: "q \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> []
q \<in> carrier (poly_ring R)
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q

goal (1 subgoal):
 1. q \<noteq> []
[PROOF STEP]
using UP.r_null UP.integral in_carrier
[PROOF STATE]
proof (prove)
using this:
p \<noteq> []
q \<in> carrier (poly_ring R)
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q
?x \<in> carrier (poly_ring R) \<Longrightarrow> ?x \<otimes>\<^bsub>poly_ring R\<^esub> \<zero>\<^bsub>poly_ring R\<^esub> = \<zero>\<^bsub>poly_ring R\<^esub>
\<lbrakk>?a \<otimes>\<^bsub>poly_ring R\<^esub> ?b = \<zero>\<^bsub>poly_ring R\<^esub>; ?a \<in> carrier (poly_ring R); ?b \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> ?a = \<zero>\<^bsub>poly_ring R\<^esub> \<or> ?b = \<zero>\<^bsub>poly_ring R\<^esub>
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. q \<noteq> []
[PROOF STEP]
unfolding sym[OF univ_poly_zero[of R "carrier R"]]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> \<zero>\<^bsub>poly_ring R\<^esub>
q \<in> carrier (poly_ring R)
p = (\<one> # \<ominus> a # \<zero>\<^bsub>poly_ring R\<^esub>) \<otimes>\<^bsub>poly_ring R\<^esub> q
?x \<in> carrier (poly_ring R) \<Longrightarrow> ?x \<otimes>\<^bsub>poly_ring R\<^esub> \<zero>\<^bsub>poly_ring R\<^esub> = \<zero>\<^bsub>poly_ring R\<^esub>
\<lbrakk>?a \<otimes>\<^bsub>poly_ring R\<^esub> ?b = \<zero>\<^bsub>poly_ring R\<^esub>; ?a \<in> carrier (poly_ring R); ?b \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> ?a = \<zero>\<^bsub>poly_ring R\<^esub> \<or> ?b = \<zero>\<^bsub>poly_ring R\<^esub>
\<one> # \<ominus> a # \<zero>\<^bsub>poly_ring R\<^esub> \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. q \<noteq> \<zero>\<^bsub>poly_ring R\<^esub>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
q \<noteq> []

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
hence "degree q = n"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []

goal (1 subgoal):
 1. degree q = n
[PROOF STEP]
using poly_mult_degree_eq[OF carrier_is_subring, of "[ \<one>, \<ominus> a ]" q]
            in_carrier q p_not_zero p Suc(2)
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []
\<lbrakk>polynomial (carrier R) [\<one>, \<ominus> a]; polynomial (carrier R) q\<rbrakk> \<Longrightarrow> degree (poly_mult [\<one>, \<ominus> a] q) = (if [\<one>, \<ominus> a] = [] \<or> q = [] then 0 else degree [\<one>, \<ominus> a] + degree q)
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)
q \<in> carrier (poly_ring R)
p \<noteq> []
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q
Suc n = degree p

goal (1 subgoal):
 1. degree q = n
[PROOF STEP]
unfolding univ_poly_carrier
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []
\<lbrakk>[\<one>, \<ominus> a] \<in> carrier (poly_ring R); q \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> degree (poly_mult [\<one>, \<ominus> a] q) = (if [\<one>, \<ominus> a] = [] \<or> q = [] then 0 else degree [\<one>, \<ominus> a] + degree q)
[\<one>, \<ominus> a] \<in> carrier (poly_ring R)
q \<in> carrier (poly_ring R)
p \<noteq> []
p = [\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q
Suc n = degree p

goal (1 subgoal):
 1. degree q = n
[PROOF STEP]
by (metis One_nat_def Suc_eq_plus1 diff_Suc_1 list.distinct(1)
                list.size(3-4) plus_1_eq_Suc univ_poly_mult)
[PROOF STATE]
proof (state)
this:
degree q = n

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
hence "finite { x. is_root q x }"
[PROOF STATE]
proof (prove)
using this:
degree q = n

goal (1 subgoal):
 1. finite {x. is_root q x}
[PROOF STEP]
using Suc(1)[OF _ q]
[PROOF STATE]
proof (prove)
using this:
degree q = n
n = degree q \<Longrightarrow> finite (Collect (is_root q))

goal (1 subgoal):
 1. finite {x. is_root q x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {x. is_root q x}

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {x. is_root q x}

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
have "{ x. is_root p x } \<subseteq> insert a { x. is_root q x }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. is_root p x} \<subseteq> insert a {x. is_root q x}
[PROOF STEP]
using is_root_poly_mult_imp_is_root[OF in_carrier q]
            monic_degree_one_root_condition[OF a]
[PROOF STATE]
proof (prove)
using this:
is_root ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q) ?x \<Longrightarrow> is_root [\<one>, \<ominus> a] ?x \<or> is_root q ?x
is_root [\<one>, \<ominus> a] ?b = (a = ?b)

goal (1 subgoal):
 1. {x. is_root p x} \<subseteq> insert a {x. is_root q x}
[PROOF STEP]
unfolding p
[PROOF STATE]
proof (prove)
using this:
is_root ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q) ?x \<Longrightarrow> is_root [\<one>, \<ominus> a] ?x \<or> is_root q ?x
is_root [\<one>, \<ominus> a] ?b = (a = ?b)

goal (1 subgoal):
 1. {x. is_root ([\<one>, \<ominus> a] \<otimes>\<^bsub>poly_ring R\<^esub> q) x} \<subseteq> insert a {x. is_root q x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. is_root p x} \<subseteq> insert a {x. is_root q x}

goal (1 subgoal):
 1. {x. is_root p x} \<noteq> {} \<Longrightarrow> finite (Collect (is_root p))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {x. is_root q x}
{x. is_root p x} \<subseteq> insert a {x. is_root q x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {x. is_root q x}
{x. is_root p x} \<subseteq> insert a {x. is_root q x}

goal (1 subgoal):
 1. finite (Collect (is_root p))
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
finite {x. is_root q x}
{x. is_root p x} \<subseteq> insert a {x. is_root q x}
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (Collect (is_root p))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (Collect (is_root p))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite (Collect (is_root p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_circle_fix_moebius_uminus [simp]:
  assumes "unit_circle_fix M"
  shows "unit_circle_fix (-M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_circle_fix (- M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M

goal (1 subgoal):
 1. unit_circle_fix (- M)
[PROOF STEP]
unfolding unit_circle_fix_iff
[PROOF STATE]
proof (prove)
using this:
moebius_circline M unit_circle = unit_circle

goal (1 subgoal):
 1. moebius_circline (- M) unit_circle = unit_circle
[PROOF STEP]
by (metis moebius_circline_comp_inv_left uminus_moebius_def)


[STATEMENT]
lemma conv_star_commute:
  "x\<^sup>\<star>\<^sup>T = x\<^sup>T\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star>\<^sup>T = x\<^sup>T\<^sup>\<star>
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x\<^sup>\<star>\<^sup>T \<le> x\<^sup>T\<^sup>\<star>
 2. x\<^sup>T\<^sup>\<star> \<le> x\<^sup>\<star>\<^sup>T
[PROOF STEP]
show "x\<^sup>\<star>\<^sup>T \<le> x\<^sup>T\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star>\<^sup>T \<le> x\<^sup>T\<^sup>\<star>
[PROOF STEP]
using conv_star_conv conv_isotone
[PROOF STATE]
proof (prove)
using this:
?x\<^sup>\<star> \<le> ?x\<^sup>T\<^sup>\<star>\<^sup>T
?x \<le> ?y \<Longrightarrow> ?x\<^sup>T \<le> ?y\<^sup>T

goal (1 subgoal):
 1. x\<^sup>\<star>\<^sup>T \<le> x\<^sup>T\<^sup>\<star>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star>\<^sup>T \<le> x\<^sup>T\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>T\<^sup>\<star> \<le> x\<^sup>\<star>\<^sup>T
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x\<^sup>T\<^sup>\<star> \<le> x\<^sup>\<star>\<^sup>T
[PROOF STEP]
show "x\<^sup>T\<^sup>\<star> \<le> x\<^sup>\<star>\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>T\<^sup>\<star> \<le> x\<^sup>\<star>\<^sup>T
[PROOF STEP]
by (metis conv_star_conv conv_involutive)
[PROOF STATE]
proof (state)
this:
x\<^sup>T\<^sup>\<star> \<le> x\<^sup>\<star>\<^sup>T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_sel_eq_set_sel:
  "\<lbrakk>distinct xs; distinct ys\<rbrakk> \<Longrightarrow> list_sel f xs ys = set_sel f (set xs) (set ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; distinct ys\<rbrakk> \<Longrightarrow> list_sel f xs ys = set_sel f (set xs) (set ys)
[PROOF STEP]
by(induction xs) (auto simp: set_sel_def list_sel_aux_eq_set_sel_aux list_sel_empty)


[STATEMENT]
lemma Prefix_Suffix: "Prefix L = rev ` Suffix (rev ` L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Prefix L = rev ` Suffix (rev ` L)
[PROOF STEP]
unfolding Prefix_def Suffix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {w. \<exists>u. w @ u \<in> L} = rev ` {w. \<exists>u. u @ w \<in> rev ` L}
[PROOF STEP]
by (auto simp: rev_append_invert
  intro: image_eqI[of _ rev, OF rev_rev_ident[symmetric]]
         image_eqI[of _ rev, OF rev_append[symmetric]])


[STATEMENT]
lemma gauss_cnj_dvd_left_iff: "gauss_cnj a dvd b \<longleftrightarrow> a dvd gauss_cnj b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (gauss_cnj a dvd b) = (a dvd gauss_cnj b)
[PROOF STEP]
by (subst gauss_cnj_dvd_iff [symmetric]) auto


[STATEMENT]
lemma swap_set_both_in:
  assumes a: "a \<in> S" "b \<in> S"
  shows "(a \<rightleftharpoons> b) \<bullet> S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<rightleftharpoons> b) \<bullet> S = S
[PROOF STEP]
unfolding permute_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a \<rightleftharpoons> b) \<bullet> x |x. x \<in> S} = S
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<in> S
b \<in> S

goal (1 subgoal):
 1. {(a \<rightleftharpoons> b) \<bullet> x |x. x \<in> S} = S
[PROOF STEP]
by (auto simp: swap_atom)


[STATEMENT]
lemma tendsto_ine_in:
  assumes "\<And>n. u n \<in> space\<^sub>N N" "x \<in> space\<^sub>N N"
  shows "tendsto_ine\<^sub>N N u x \<longleftrightarrow> tendsto_in\<^sub>N N u x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tendsto_ine\<^sub>N N u x = tendsto_in\<^sub>N N u x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tendsto_ine\<^sub>N N u x = tendsto_in\<^sub>N N u x
[PROOF STEP]
have *: "eNorm N (u n - x) = Norm N (u n - x)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm N (u n - x) = ennreal (Norm N (u n - x))
[PROOF STEP]
using assms eNorm_Norm spaceN_diff
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> space\<^sub>N N
x \<in> space\<^sub>N N
?x \<in> space\<^sub>N ?N \<Longrightarrow> eNorm ?N ?x = ennreal (Norm ?N ?x)
\<lbrakk>?x \<in> space\<^sub>N ?N; ?y \<in> space\<^sub>N ?N\<rbrakk> \<Longrightarrow> ?x - ?y \<in> space\<^sub>N ?N

goal (1 subgoal):
 1. eNorm N (u n - x) = ennreal (Norm N (u n - x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
eNorm N (u ?n - x) = ennreal (Norm N (u ?n - x))

goal (1 subgoal):
 1. tendsto_ine\<^sub>N N u x = tendsto_in\<^sub>N N u x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tendsto_ine\<^sub>N N u x = tendsto_in\<^sub>N N u x
[PROOF STEP]
unfolding tendsto_in\<^sub>N_def tendsto_ine\<^sub>N_def *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ennreal (Norm N (u n - x))) \<longlonglongrightarrow> 0 = (\<lambda>n. Norm N (u n - x)) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>n. ennreal (Norm N (u n - x))) \<longlonglongrightarrow> 0 \<Longrightarrow> (\<lambda>n. Norm N (u n - x)) \<longlonglongrightarrow> 0
 2. (\<lambda>n. Norm N (u n - x)) \<longlonglongrightarrow> 0 \<Longrightarrow> (\<lambda>n. ennreal (Norm N (u n - x))) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (metis (full_types) Norm_nonneg ennreal_0 eventually_sequentiallyI order_refl tendsto_ennreal_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. Norm N (u n - x)) \<longlonglongrightarrow> 0 \<Longrightarrow> (\<lambda>n. ennreal (Norm N (u n - x))) \<longlonglongrightarrow> 0
[PROOF STEP]
using tendsto_ennrealI
[PROOF STATE]
proof (prove)
using this:
(?f \<longlongrightarrow> ?x) ?F \<Longrightarrow> ((\<lambda>x. ennreal (?f x)) \<longlongrightarrow> ennreal ?x) ?F

goal (1 subgoal):
 1. (\<lambda>n. Norm N (u n - x)) \<longlonglongrightarrow> 0 \<Longrightarrow> (\<lambda>n. ennreal (Norm N (u n - x))) \<longlonglongrightarrow> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
tendsto_ine\<^sub>N N u x = tendsto_in\<^sub>N N u x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem discr0_BisT[simp]:
assumes "discr0 c1" and "discr0 c2"
shows "c1 \<approx>T c2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 \<approx>T c2
[PROOF STEP]
using assms thetaFDW0_BisT
[PROOF STATE]
proof (prove)
using this:
discr0 c1
discr0 c2
thetaFDW0 \<subseteq> BisT

goal (1 subgoal):
 1. c1 \<approx>T c2
[PROOF STEP]
unfolding thetaFDW0_def
[PROOF STATE]
proof (prove)
using this:
discr0 c1
discr0 c2
{(c1, c2). discr0 c1 \<and> discr0 c2} \<subseteq> BisT

goal (1 subgoal):
 1. c1 \<approx>T c2
[PROOF STEP]
by blast


[STATEMENT]
lemma real_polynomial_function_divide [intro]:
  assumes "real_polynomial_function p" shows "real_polynomial_function (\<lambda>x. p x / c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_polynomial_function (\<lambda>x. p x / c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_polynomial_function (\<lambda>x. p x / c)
[PROOF STEP]
have "real_polynomial_function (\<lambda>x. p x * Fields.inverse c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_polynomial_function (\<lambda>x. p x * inverse c)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function p

goal (1 subgoal):
 1. real_polynomial_function (\<lambda>x. p x * inverse c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_polynomial_function (\<lambda>x. p x * inverse c)

goal (1 subgoal):
 1. real_polynomial_function (\<lambda>x. p x / c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function (\<lambda>x. p x * inverse c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function (\<lambda>x. p x * inverse c)

goal (1 subgoal):
 1. real_polynomial_function (\<lambda>x. p x / c)
[PROOF STEP]
by (simp add: divide_inverse)
[PROOF STATE]
proof (state)
this:
real_polynomial_function (\<lambda>x. p x / c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  kauff_mat_non_empty:
 fixes ws
 assumes "is_tangle_diagram ws"
 shows "kauff_mat ws \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat ws \<noteq> []
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. kauff_mat ws \<noteq> []
[PROOF STEP]
have "(length (kauff_mat ws) =  2^(nat (codomain_wall ws)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (kauff_mat ws) = 2 ^ nat (codomain_wall ws)
[PROOF STEP]
using effective_matrix_kauff_mat assms
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws)
is_tangle_diagram ?ws \<Longrightarrow> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)
is_tangle_diagram ws

goal (1 subgoal):
 1. length (kauff_mat ws) = 2 ^ nat (codomain_wall ws)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (kauff_mat ws) = 2 ^ nat (codomain_wall ws)

goal (1 subgoal):
 1. kauff_mat ws \<noteq> []
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length (kauff_mat ws) = 2 ^ nat (codomain_wall ws)
[PROOF STEP]
have "(length (kauff_mat ws)) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
length (kauff_mat ws) = 2 ^ nat (codomain_wall ws)

goal (1 subgoal):
 1. 1 \<le> length (kauff_mat ws)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> length (kauff_mat ws)

goal (1 subgoal):
 1. kauff_mat ws \<noteq> []
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> length (kauff_mat ws)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> length (kauff_mat ws)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniform_discrete_insert:
  fixes S :: "'a::euclidean_space set"
  shows "uniform_discrete (insert a S) \<longleftrightarrow> uniform_discrete S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_discrete (insert a S) = uniform_discrete S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
 2. uniform_discrete S \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
assume asm:"uniform_discrete S"
[PROOF STATE]
proof (state)
this:
uniform_discrete S

goal (2 subgoals):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
 2. uniform_discrete S \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
let ?thesis = "uniform_discrete (insert a S)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
 2. uniform_discrete S \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
have ?thesis when "a\<in>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
using that asm
[PROOF STATE]
proof (prove)
using this:
a \<in> S
uniform_discrete S

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
by (simp add: insert_absorb)
[PROOF STATE]
proof (state)
this:
a \<in> S \<Longrightarrow> uniform_discrete (insert a S)

goal (2 subgoals):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
 2. uniform_discrete S \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<in> S \<Longrightarrow> uniform_discrete (insert a S)

goal (2 subgoals):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
 2. uniform_discrete S \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
have ?thesis when "S={}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
using that asm
[PROOF STATE]
proof (prove)
using this:
S = {}
uniform_discrete S

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
by (simp add: uniform_discrete_def)
[PROOF STATE]
proof (state)
this:
S = {} \<Longrightarrow> uniform_discrete (insert a S)

goal (2 subgoals):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
 2. uniform_discrete S \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S = {} \<Longrightarrow> uniform_discrete (insert a S)

goal (2 subgoals):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
 2. uniform_discrete S \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
have ?thesis when "a\<notin>S" "S\<noteq>{}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
obtain e1 where "e1>0" and e1_dist:"\<forall>x\<in>S. \<forall>y\<in>S. dist y x < e1 \<longrightarrow> y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e1. \<lbrakk>0 < e1; \<forall>x\<in>S. \<forall>y\<in>S. dist y x < e1 \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using asm
[PROOF STATE]
proof (prove)
using this:
uniform_discrete S

goal (1 subgoal):
 1. (\<And>e1. \<lbrakk>0 < e1; \<forall>x\<in>S. \<forall>y\<in>S. dist y x < e1 \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding uniform_discrete_def
[PROOF STATE]
proof (prove)
using this:
\<exists>e>0. \<forall>x\<in>S. \<forall>y\<in>S. dist x y < e \<longrightarrow> x = y

goal (1 subgoal):
 1. (\<And>e1. \<lbrakk>0 < e1; \<forall>x\<in>S. \<forall>y\<in>S. dist y x < e1 \<longrightarrow> y = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e1
\<forall>x\<in>S. \<forall>y\<in>S. dist y x < e1 \<longrightarrow> y = x

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
define e2 where "e2 \<equiv> min (setdist {a} S) e1"
[PROOF STATE]
proof (state)
this:
e2 \<equiv> min (setdist {a} S) e1

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
have "closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S
[PROOF STEP]
using asm uniform_discrete_imp_closed
[PROOF STATE]
proof (prove)
using this:
uniform_discrete S
uniform_discrete ?S \<Longrightarrow> closed ?S

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

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed S
[PROOF STEP]
have "e2>0"
[PROOF STATE]
proof (prove)
using this:
closed S

goal (1 subgoal):
 1. 0 < e2
[PROOF STEP]
by (simp add: \<open>0 < e1\<close> e2_def setdist_gt_0_compact_closed that(1) that(2))
[PROOF STATE]
proof (state)
this:
0 < e2

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < e2

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
have "x = y" when "x\<in>insert a S" "y\<in>insert a S" "dist x y < e2 " for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
have ?thesis when "x=a" "y=a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x = a
y = a

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>x = a; y = a\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>x = a; y = a\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
have ?thesis when "x=a" "y\<in>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
using that setdist_le_dist[of x "{a}" y S] \<open>dist x y < e2\<close>
[PROOF STATE]
proof (prove)
using this:
x = a
y \<in> S
\<lbrakk>x \<in> {a}; y \<in> S\<rbrakk> \<Longrightarrow> setdist {a} S \<le> dist x y
dist x y < e2

goal (1 subgoal):
 1. x = y
[PROOF STEP]
unfolding e2_def
[PROOF STATE]
proof (prove)
using this:
x = a
y \<in> S
\<lbrakk>x \<in> {a}; y \<in> S\<rbrakk> \<Longrightarrow> setdist {a} S \<le> dist x y
dist x y < min (setdist {a} S) e1

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>x = a; y \<in> S\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>x = a; y \<in> S\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
have ?thesis when "y=a" "x\<in>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
using that setdist_le_dist[of y "{a}" x S] \<open>dist x y < e2\<close>
[PROOF STATE]
proof (prove)
using this:
y = a
x \<in> S
\<lbrakk>y \<in> {a}; x \<in> S\<rbrakk> \<Longrightarrow> setdist {a} S \<le> dist y x
dist x y < e2

goal (1 subgoal):
 1. x = y
[PROOF STEP]
unfolding e2_def
[PROOF STATE]
proof (prove)
using this:
y = a
x \<in> S
\<lbrakk>y \<in> {a}; x \<in> S\<rbrakk> \<Longrightarrow> setdist {a} S \<le> dist y x
dist x y < min (setdist {a} S) e1

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (simp add: dist_commute)
[PROOF STATE]
proof (state)
this:
\<lbrakk>y = a; x \<in> S\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>y = a; x \<in> S\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
have ?thesis when "x\<in>S" "y\<in>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
using e1_dist[rule_format, OF that] \<open>dist x y < e2\<close>
[PROOF STATE]
proof (prove)
using this:
dist y x < e1 \<Longrightarrow> y = x
dist x y < e2

goal (1 subgoal):
 1. x = y
[PROOF STEP]
unfolding e2_def
[PROOF STATE]
proof (prove)
using this:
dist y x < e1 \<Longrightarrow> y = x
dist x y < min (setdist {a} S) e1

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (simp add: dist_commute)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x = a; y = a\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>x = a; y \<in> S\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>y = a; x \<in> S\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = a; y = a\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>x = a; y \<in> S\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>y = a; x \<in> S\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x = y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = a; y = a\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>x = a; y \<in> S\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>y = a; x \<in> S\<rbrakk> \<Longrightarrow> x = y
\<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x = y
x \<in> insert a S
y \<in> insert a S
dist x y < e2

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> insert a S; ?y \<in> insert a S; dist ?x ?y < e2\<rbrakk> \<Longrightarrow> ?x = ?y

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < e2
\<lbrakk>?x \<in> insert a S; ?y \<in> insert a S; dist ?x ?y < e2\<rbrakk> \<Longrightarrow> ?x = ?y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < e2
\<lbrakk>?x \<in> insert a S; ?y \<in> insert a S; dist ?x ?y < e2\<rbrakk> \<Longrightarrow> ?x = ?y

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
unfolding uniform_discrete_def
[PROOF STATE]
proof (prove)
using this:
0 < e2
\<lbrakk>?x \<in> insert a S; ?y \<in> insert a S; dist ?x ?y < e2\<rbrakk> \<Longrightarrow> ?x = ?y

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x\<in>insert a S. \<forall>y\<in>insert a S. dist x y < e \<longrightarrow> x = y
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
uniform_discrete (insert a S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<notin> S; S \<noteq> {}\<rbrakk> \<Longrightarrow> uniform_discrete (insert a S)

goal (2 subgoals):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
 2. uniform_discrete S \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a \<in> S \<Longrightarrow> uniform_discrete (insert a S)
S = {} \<Longrightarrow> uniform_discrete (insert a S)
\<lbrakk>a \<notin> S; S \<noteq> {}\<rbrakk> \<Longrightarrow> uniform_discrete (insert a S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> S \<Longrightarrow> uniform_discrete (insert a S)
S = {} \<Longrightarrow> uniform_discrete (insert a S)
\<lbrakk>a \<notin> S; S \<noteq> {}\<rbrakk> \<Longrightarrow> uniform_discrete (insert a S)

goal (1 subgoal):
 1. uniform_discrete (insert a S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
uniform_discrete (insert a S)

goal (1 subgoal):
 1. uniform_discrete (insert a S) \<Longrightarrow> uniform_discrete S
[PROOF STEP]
qed (simp add: subset_insertI uniform_discrete_subset)


[STATEMENT]
lemma enum_ind_less_CARD [simp]: "enum_ind (x :: 'a::enum) < CARD('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enum_ind x < CARD('a)
[PROOF STEP]
using first_ind_length[of x, OF in_enum, of 0]
[PROOF STATE]
proof (prove)
using this:
first_ind enum_class.enum x 0 < length enum_class.enum + 0

goal (1 subgoal):
 1. enum_ind x < CARD('a)
[PROOF STEP]
by (simp add: enum_ind_def CARD_length_enum)


[STATEMENT]
lemma lambda_interpret_1:
  assumes "[a \<^bold>= b in v]"
  shows "(\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,a\<rparr>) = (\<^bold>\<lambda>x . \<lparr>R,x\<^sup>P, b\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,a\<rparr>) = (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,b\<rparr>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,a\<rparr>) = (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,b\<rparr>)
[PROOF STEP]
have "a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
using MetaSolver.Eq\<kappa>S Semantics.d\<^sub>\<kappa>_inject assms
            identity_\<kappa>_def
[PROOF STATE]
proof (prove)
using this:
[?x \<^bold>=\<^sub>\<kappa> ?y in ?v] = (\<exists>o\<^sub>1 o\<^sub>2. Some o\<^sub>1 = d\<^sub>\<kappa> ?x \<and> Some o\<^sub>2 = d\<^sub>\<kappa> ?y \<and> o\<^sub>1 = o\<^sub>2)
Some ?o\<^sub>1 = d\<^sub>\<kappa> ?x \<and> Some ?o\<^sub>1 = d\<^sub>\<kappa> ?y \<Longrightarrow> ?x = ?y
[a \<^bold>= b in v]
(\<^bold>=) \<equiv> (\<^bold>=\<^sub>\<kappa>)

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

goal (1 subgoal):
 1. (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,a\<rparr>) = (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,b\<rparr>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,a\<rparr>) = (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,b\<rparr>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,a\<rparr>) = (\<^bold>\<lambda>x. \<lparr>R,x\<^sup>P,b\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma height_node32:
  "height r > 0 \<Longrightarrow> height(node32 l a m b r) =
   max (height l) (max (height m) (height r)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height r \<Longrightarrow> height (node32 l a m b r) = max (height l) (max (height m) (height r)) + 1
[PROOF STEP]
by(induct l a m b r rule: node32.induct)(simp_all add: max_def)


[STATEMENT]
lemma connected_equivalence_relation:
  assumes "connected S"
      and etc: "a \<in> S" "b \<in> S"
      and sym: "\<And>x y. \<lbrakk>R x y; x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> R y x"
      and trans: "\<And>x y z. \<lbrakk>R x y; R y z; x \<in> S; y \<in> S; z \<in> S\<rbrakk> \<Longrightarrow> R x z"
      and opI: "\<And>a. a \<in> S \<Longrightarrow> \<exists>T. openin (top_of_set S) T \<and> a \<in> T \<and> (\<forall>x \<in> T. R a x)"
    shows "R a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. R a b
[PROOF STEP]
have "\<And>a b c. \<lbrakk>a \<in> S; b \<in> S; c \<in> S; R a b\<rbrakk> \<Longrightarrow> R a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>a \<in> S; b \<in> S; c \<in> S; R a b\<rbrakk> \<Longrightarrow> R a c
[PROOF STEP]
apply (rule connected_induction_simple [OF \<open>connected S\<close>], simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c aa. \<lbrakk>a \<in> S; b \<in> S; c \<in> S; R a b; aa \<in> S\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set S) T \<and> aa \<in> T \<and> ((\<exists>x\<in>T. R a x) \<longrightarrow> (\<forall>x\<in>T. R a x))
[PROOF STEP]
by (meson local.sym local.trans opI openin_imp_subset subsetCE)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> S; ?b \<in> S; ?c \<in> S; R ?a ?b\<rbrakk> \<Longrightarrow> R ?a ?c

goal (1 subgoal):
 1. R a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?a \<in> S; ?b \<in> S; ?c \<in> S; R ?a ?b\<rbrakk> \<Longrightarrow> R ?a ?c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> S; ?b \<in> S; ?c \<in> S; R ?a ?b\<rbrakk> \<Longrightarrow> R ?a ?c

goal (1 subgoal):
 1. R a b
[PROOF STEP]
by (metis etc opI)
[PROOF STATE]
proof (state)
this:
R a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lex_ord_EqD:
  "lex_ord ko f xs ys = Some Eq \<Longrightarrow>
   k \<in> fst ` set (fst (list_of_oalistx xs)) \<union> fst ` set (fst (list_of_oalisty ys)) \<Longrightarrow>
   f k (lookup xs k) (oay.lookup ys k) = Some Eq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lex_ord ko f xs ys = Some Eq; k \<in> fst ` set (fst (list_of_oalistx xs)) \<union> fst ` set (fst (list_of_oalisty ys))\<rbrakk> \<Longrightarrow> f k (lookup xs k) (oay.lookup ys k) = Some Eq
[PROOF STEP]
by (simp add: lex_ord_def lookup_def oay.lookup_def, rule lex_ord_raw_EqD[where f=f],
      rule oalist_inv_list_of_oalist, rule oay.oalist_inv_list_of_oalist, assumption, simp)


[STATEMENT]
lemma closed_simplex: "n simplex S \<Longrightarrow> closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n simplex S \<Longrightarrow> closed S
[PROOF STEP]
by (simp add: compact_imp_closed compact_simplex)


[STATEMENT]
theorem "\<forall>(x::nat). \<exists>(y::nat). (0::nat) \<le> 5 \<longrightarrow> y = 5 + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<exists>y. 0 \<le> 5 \<longrightarrow> y = 5 + x
[PROOF STEP]
by cooper


[STATEMENT]
lemma "D (\<lambda>t. v * t - a * t\<^sup>2 / 2 + x) = (\<lambda>x. v - a * x) on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1.  D (\<lambda>t. v * t - a * t\<^sup>2 / 2 + x) = (\<lambda>x. v - a * x) on T
[PROOF STEP]
by(auto intro!: poly_derivatives)


[STATEMENT]
lemma Lim_within:
  shows "(f \<longlongrightarrow> l) (at a within S) \<longleftrightarrow>
    (\<forall>e >0. \<exists>d>0. \<forall>x \<in> S. 0 < dist_class.dist x a \<and> dist_class.dist x a  < d \<longrightarrow> dist_class.dist (f x) l < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) (at a within S) = (\<forall>e>0. \<exists>d>0. \<forall>x\<in>S. 0 < dist x a \<and> dist x a < d \<longrightarrow> dist (f x) l < e)
[PROOF STEP]
by (auto simp: tendsto_iff eventually_at)


[STATEMENT]
lemma part_witness_interior_simps:
  shows
    "interior {a} = {a}"
    "interior {b} = {}"
    "interior {c} = {}"
    "interior {a, b} = {a}"
    "interior {a, c} = {a}"
    "interior {b, c} = {b, c}"
    "interior {a, b, c} = {a, b, c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (interior {a} = {a} &&& interior {b} = {} &&& interior {c} = {}) &&& (interior {a, b} = {a} &&& interior {a, c} = {a}) &&& interior {b, c} = {b, c} &&& interior {a, b, c} = {a, b, c}
[PROOF STEP]
unfolding interior_def open_part_witness_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union> {T \<in> {{}, {a}, {b, c}, {a, b, c}}. T \<subseteq> {a}} = {a} &&& \<Union> {T \<in> {{}, {a}, {b, c}, {a, b, c}}. T \<subseteq> {b}} = {} &&& \<Union> {T \<in> {{}, {a}, {b, c}, {a, b, c}}. T \<subseteq> {c}} = {}) &&& (\<Union> {T \<in> {{}, {a}, {b, c}, {a, b, c}}. T \<subseteq> {a, b}} = {a} &&& \<Union> {T \<in> {{}, {a}, {b, c}, {a, b, c}}. T \<subseteq> {a, c}} = {a}) &&& \<Union> {T \<in> {{}, {a}, {b, c}, {a, b, c}}. T \<subseteq> {b, c}} = {b, c} &&& \<Union> {T \<in> {{}, {a}, {b, c}, {a, b, c}}. T \<subseteq> {a, b, c}} = {a, b, c}
[PROOF STEP]
by auto


[STATEMENT]
lemma ker_orthogonal_comp_adjoint:
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  assumes "linear f"
  shows "f -` {0} = (range (adjoint f))\<^sup>\<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` {0::'n} = range (adjoint f)\<^sup>\<bottom>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f -` {0::'n} = range (adjoint f)\<^sup>\<bottom>
[PROOF STEP]
have "\<And>x. \<lbrakk>\<forall>y. y \<bullet> f x = 0\<rbrakk> \<Longrightarrow> f x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<forall>y. y \<bullet> f x = 0 \<Longrightarrow> f x = (0::'n)
[PROOF STEP]
using assms inner_commute all_zero_iff
[PROOF STATE]
proof (prove)
using this:
linear f
?x \<bullet> ?y = ?y \<bullet> ?x
(\<forall>u. ?x \<bullet> u = 0) = (?x = (0::?'a))

goal (1 subgoal):
 1. \<And>x. \<forall>y. y \<bullet> f x = 0 \<Longrightarrow> f x = (0::'n)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>y. y \<bullet> f ?x = 0 \<Longrightarrow> f ?x = (0::'n)

goal (1 subgoal):
 1. f -` {0::'n} = range (adjoint f)\<^sup>\<bottom>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. y \<bullet> f ?x = 0 \<Longrightarrow> f ?x = (0::'n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>y. y \<bullet> f ?x = 0 \<Longrightarrow> f ?x = (0::'n)

goal (1 subgoal):
 1. f -` {0::'n} = range (adjoint f)\<^sup>\<bottom>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>y. y \<bullet> f ?x = 0 \<Longrightarrow> f ?x = (0::'n)
linear f

goal (1 subgoal):
 1. f -` {0::'n} = range (adjoint f)\<^sup>\<bottom>
[PROOF STEP]
by (auto simp: orthogonal_comp_def orthogonal_def adjoint_works inner_commute)
[PROOF STATE]
proof (state)
this:
f -` {0::'n} = range (adjoint f)\<^sup>\<bottom>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm081:
  assumes "f \<in> injectionsUniverse"
  shows   "Range(f outside A) = Range f - f``A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Range (Outside' A f) = Range f - f `` A
[PROOF STEP]
using assms mem_Collect_eq rangeOutside
[PROOF STATE]
proof (prove)
using this:
f \<in> injectionsUniverse
(?a \<in> Collect ?P) = ?P ?a
\<lbrakk>runiq ?f; runiq (?f\<inverse>)\<rbrakk> \<Longrightarrow> Range (Outside' ?X ?f) = Range ?f - ?f `` ?X

goal (1 subgoal):
 1. Range (Outside' A f) = Range f - f `` A
[PROOF STEP]
by (metis)


[STATEMENT]
lemma gcd_mult_distrib': "normalize c * gcd a b = gcd (c * a) (c * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize c * gcd a b = gcd (c * a) (c * b)
[PROOF STEP]
by (subst gcd_mult_left) (simp_all add: normalize_mult)


[STATEMENT]
lemma bintrunc_numeral_simps [simp]:
  "(take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (numeral k) (numeral (Num.Bit0 w)) =
    2 * (take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (pred_numeral k) (numeral w)"
  "(take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (numeral k) (numeral (Num.Bit1 w)) =
    1 + 2 * (take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (pred_numeral k) (numeral w)"
  "(take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (numeral k) (- numeral (Num.Bit0 w)) =
    2 * (take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (pred_numeral k) (- numeral w)"
  "(take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (numeral k) (- numeral (Num.Bit1 w)) =
    1 + 2 * (take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (pred_numeral k) (- numeral (w + Num.One))"
  "(take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (numeral k) 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take_bit (numeral k) (numeral (num.Bit0 w)) = 2 * take_bit (pred_numeral k) (numeral w) &&& take_bit (numeral k) (numeral (num.Bit1 w)) = 1 + 2 * take_bit (pred_numeral k) (numeral w)) &&& take_bit (numeral k) (- numeral (num.Bit0 w)) = 2 * take_bit (pred_numeral k) (- numeral w) &&& take_bit (numeral k) (- numeral (num.Bit1 w)) = 1 + 2 * take_bit (pred_numeral k) (- numeral (w + num.One)) &&& take_bit (numeral k) 1 = 1
[PROOF STEP]
by (simp_all add: bintrunc_numeral)


[STATEMENT]
lemma plus_adds_pp: "(s + t) adds\<^sub>p v \<longleftrightarrow> (t adds\<^sub>p v \<and> s adds\<^sub>p (v \<ominus> t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s + t adds\<^sub>p v) = (t adds\<^sub>p v \<and> s adds\<^sub>p v \<ominus> t)
[PROOF STEP]
by (simp add: adds_pp_def plus_adds term_simps)


[STATEMENT]
lemma and_mask_0_iff_le_mask:
  fixes w :: "'a::len word"
  shows "(w AND NOT(mask n) = 0) = (w \<le> mask n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w AND NOT (mask n) = 0) = (w \<le> mask n)
[PROOF STEP]
by (simp add: mask_eq_0_eq_x le_mask_imp_and_mask and_mask_eq_iff_le_mask)


[STATEMENT]
lemma Inf_pres_Sup_pres:
  fixes f :: "'a::complete_boolean_algebra_alt_with_dual \<Rightarrow> 'b::complete_boolean_algebra_alt_with_dual"
  shows "(Inf_pres f) = (Sup_pres (\<partial>\<^sub>F f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_pres f = Sup_pres (\<partial>\<^sub>F f)
[PROOF STEP]
by (simp add: Inf_pres_map_dual_var)


[STATEMENT]
lemma add_divide_distrib_ennreal: "(a + b) / c = a / c + b / (c :: ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) / c = a / c + b / c
[PROOF STEP]
by (simp add: divide_ennreal_def ring_distribs)


[STATEMENT]
lemma right_total_rel_gpv':
  "\<lbrakk> right_total A; right_total C; right_unique R; left_total R \<rbrakk> \<Longrightarrow> right_total (rel_gpv'' A C R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>right_total A; right_total C; right_unique R; left_total R\<rbrakk> \<Longrightarrow> right_total (rel_gpv'' A C R)
[PROOF STEP]
unfolding right_unique_alt_def right_total_alt_def rel_gpv''_conversep[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(=) \<le> A\<inverse>\<inverse> OO A; (=) \<le> C\<inverse>\<inverse> OO C; R\<inverse>\<inverse> OO R \<le> (=); left_total R\<rbrakk> \<Longrightarrow> (=) \<le> rel_gpv'' A\<inverse>\<inverse> C\<inverse>\<inverse> R\<inverse>\<inverse> OO rel_gpv'' A C R
[PROOF STEP]
apply(subst rel_gpv''_eq[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(=) \<le> A\<inverse>\<inverse> OO A; (=) \<le> C\<inverse>\<inverse> OO C; R\<inverse>\<inverse> OO R \<le> (=); left_total R\<rbrakk> \<Longrightarrow> rel_gpv'' (=) (=) (=) \<le> rel_gpv'' A\<inverse>\<inverse> C\<inverse>\<inverse> R\<inverse>\<inverse> OO rel_gpv'' A C R
[PROOF STEP]
apply(rule order_trans[rotated])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(=) \<le> A\<inverse>\<inverse> OO A; (=) \<le> C\<inverse>\<inverse> OO C; R\<inverse>\<inverse> OO R \<le> (=); left_total R\<rbrakk> \<Longrightarrow> ?y \<le> rel_gpv'' A\<inverse>\<inverse> C\<inverse>\<inverse> R\<inverse>\<inverse> OO rel_gpv'' A C R
 2. \<lbrakk>(=) \<le> A\<inverse>\<inverse> OO A; (=) \<le> C\<inverse>\<inverse> OO C; R\<inverse>\<inverse> OO R \<le> (=); left_total R\<rbrakk> \<Longrightarrow> rel_gpv'' (=) (=) (=) \<le> ?y
[PROOF STEP]
apply(rule rel_gpv''_neg_distr; simp add: right_unique_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(=) \<le> A\<inverse>\<inverse> OO A; (=) \<le> C\<inverse>\<inverse> OO C; R\<inverse>\<inverse> OO R \<le> (=); left_total R\<rbrakk> \<Longrightarrow> rel_gpv'' (=) (=) (=) \<le> rel_gpv'' (A\<inverse>\<inverse> OO A) (C\<inverse>\<inverse> OO C) (R\<inverse>\<inverse> OO R)
[PROOF STEP]
apply(rule rel_gpv''_mono; assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "t \<in> \<Theta>(\<lambda>n. real n) \<Longrightarrow> (\<And>n. t n \<ge> 0) \<Longrightarrow> merge_sort_cost t \<in> \<Theta>(\<lambda>n. real n * ln (real n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> \<Theta>(real); \<And>n. 0 \<le> t n\<rbrakk> \<Longrightarrow> merge_sort_cost t \<in> \<Theta>(\<lambda>n. real n * ln (real n))
[PROOF STEP]
by (master_theorem 2.3) simp_all


[STATEMENT]
lemma compactin_euclidean_iff [simp]: "compactin euclidean S \<longleftrightarrow> compact S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compactin euclidean S = compact S
[PROOF STEP]
by (simp add: compact_eq_Heine_Borel compactin_def) meson


[STATEMENT]
lemma vint_mult_closed:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "x *\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x *\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
have "(x'::int) * y' \<in> UNIV" for x' y'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' * y' \<in> UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' * ?y' \<in> UNIV

goal (1 subgoal):
 1. x *\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>

goal (1 subgoal):
 1. x *\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x *\<^sub>\<int> y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [vcg]: "`\<lbrace>p \<cdot> t\<rbrace> c \<lbrace>p\<rbrace>` \<Longrightarrow> `!t \<cdot> p \<le> q` \<Longrightarrow> `\<lbrace>p\<rbrace> While t Do c End \<lbrace>q\<rbrace>`"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrace>\<iota> p \<cdot> \<iota> t\<rbrace> c \<lbrace>\<iota> p\<rbrace>; ! (\<iota> t) \<cdot> \<iota> p \<le> \<iota> q\<rbrakk> \<Longrightarrow> \<lbrace>\<iota> p\<rbrace> While \<iota> t Do c End \<lbrace>\<iota> q\<rbrace>
[PROOF STEP]
by (metis hoare_weakening hoare_while order_refl test_inf test_iso_eq test_not)


[STATEMENT]
lemma RSubmodule_set_plus :
  assumes "RSubmodule L" "RSubmodule N"
  shows   "RSubmodule (L + N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RSubmodule (L + N)
[PROOF STEP]
proof (rule RSubmoduleI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. VecGroup.Subgroup (L + N)
 2. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
RSubmodule L
RSubmodule N
[PROOF STEP]
have "Group (L + N)"
[PROOF STATE]
proof (prove)
using this:
RSubmodule L
RSubmodule N

goal (1 subgoal):
 1. Group (L + N)
[PROOF STEP]
using RModule.AbGroup AbGroup_set_plus[of L N] AbGroup.axioms
[PROOF STATE]
proof (prove)
using this:
RSubmodule L
RSubmodule N
RModule ?R ?smult ?M \<Longrightarrow> AbGroup ?M
\<lbrakk>AbGroup L; AbGroup N\<rbrakk> \<Longrightarrow> AbGroup (L + N)
AbGroup ?G \<Longrightarrow> Group ?G

goal (1 subgoal):
 1. Group (L + N)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Group (L + N)

goal (2 subgoals):
 1. VecGroup.Subgroup (L + N)
 2. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Group (L + N)

goal (2 subgoals):
 1. VecGroup.Subgroup (L + N)
 2. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
RSubmodule L
RSubmodule N
[PROOF STEP]
have "L + N \<subseteq> M"
[PROOF STATE]
proof (prove)
using this:
RSubmodule L
RSubmodule N

goal (1 subgoal):
 1. L + N \<subseteq> M
[PROOF STEP]
using Group Group.set_plus_closed
[PROOF STATE]
proof (prove)
using this:
RSubmodule L
RSubmodule N
Group M
\<lbrakk>Group ?G; ?A \<subseteq> ?G; ?B \<subseteq> ?G\<rbrakk> \<Longrightarrow> ?A + ?B \<subseteq> ?G

goal (1 subgoal):
 1. L + N \<subseteq> M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L + N \<subseteq> M

goal (2 subgoals):
 1. VecGroup.Subgroup (L + N)
 2. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Group (L + N)
L + N \<subseteq> M
[PROOF STEP]
show "Subgroup (L + N)"
[PROOF STATE]
proof (prove)
using this:
Group (L + N)
L + N \<subseteq> M

goal (1 subgoal):
 1. VecGroup.Subgroup (L + N)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
VecGroup.Subgroup (L + N)

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
fix r x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
assume rx: "r \<in> R" "x \<in> L + N"
[PROOF STATE]
proof (state)
this:
r \<in> R
x \<in> L + N

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
from rx(2)
[PROOF STATE]
proof (chain)
picking this:
x \<in> L + N
[PROOF STEP]
obtain m n where mn: "m \<in> L" "n \<in> N" "x = m + n"
[PROOF STATE]
proof (prove)
using this:
x \<in> L + N

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>m \<in> L; n \<in> N; x = m + n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using set_plus_def[of L N]
[PROOF STATE]
proof (prove)
using this:
x \<in> L + N
L + N = {c. \<exists>a\<in>L. \<exists>b\<in>N. c = a + b}

goal (1 subgoal):
 1. (\<And>m n. \<lbrakk>m \<in> L; n \<in> N; x = m + n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
m \<in> L
n \<in> N
x = m + n

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> L + N\<rbrakk> \<Longrightarrow> r \<cdot> n \<in> L + N
[PROOF STEP]
with assms rx(1)
[PROOF STATE]
proof (chain)
picking this:
RSubmodule L
RSubmodule N
r \<in> R
m \<in> L
n \<in> N
x = m + n
[PROOF STEP]
show "r \<cdot> x \<in> L + N"
[PROOF STATE]
proof (prove)
using this:
RSubmodule L
RSubmodule N
r \<in> R
m \<in> L
n \<in> N
x = m + n

goal (1 subgoal):
 1. r \<cdot> x \<in> L + N
[PROOF STEP]
using RModule.smult_closed[of R smult L] RModule.smult_closed[of R smult N]
          smult_distrib_left set_plus_def
[PROOF STATE]
proof (prove)
using this:
RSubmodule L
RSubmodule N
r \<in> R
m \<in> L
n \<in> N
x = m + n
\<lbrakk>RModule R (\<cdot>) L; ?r \<in> R; ?m \<in> L\<rbrakk> \<Longrightarrow> ?r \<cdot> ?m \<in> L
\<lbrakk>RModule R (\<cdot>) N; ?r \<in> R; ?m \<in> N\<rbrakk> \<Longrightarrow> ?r \<cdot> ?m \<in> N
\<lbrakk>?r \<in> R; ?m \<in> M; ?n \<in> M\<rbrakk> \<Longrightarrow> ?r \<cdot> (?m + ?n) = ?r \<cdot> ?m + ?r \<cdot> ?n
?A + ?B = {c. \<exists>a\<in>?A. \<exists>b\<in>?B. c = a + b}

goal (1 subgoal):
 1. r \<cdot> x \<in> L + N
[PROOF STEP]
by    fast
[PROOF STATE]
proof (state)
this:
r \<cdot> x \<in> L + N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma on_triple[simp]:
  "((l1,v1,v2),(l2,v3,v4)) \<in> on_triple R \<longleftrightarrow> (v1,v3)\<in> R \<and> (v2,v4) \<in> R \<and> l1 = l2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((l1, v1, v2), l2, v3, v4) \<in> on_triple R) = ((v1, v3) \<in> R \<and> (v2, v4) \<in> R \<and> l1 = l2)
[PROOF STEP]
unfolding on_triple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((l1, v1, v2), l2, v3, v4) \<in> {((l, s, t), l', s', t'). l = l' \<and> (s, s') \<in> R \<and> (t, t') \<in> R}) = ((v1, v3) \<in> R \<and> (v2, v4) \<in> R \<and> l1 = l2)
[PROOF STEP]
by auto


[STATEMENT]
lemma replicate_True_not_False: "count_list ys True = 0 \<longleftrightarrow> ys = replicate (length ys) False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (count_list ys True = 0) = (ys = replicate (length ys) False)
[PROOF STEP]
using count_list_zero_not_elem count_list_full_elem count_list_length_replicate
[PROOF STATE]
proof (prove)
using this:
(count_list ?xs ?x = 0) = (?x \<notin> set ?xs)
(count_list ?xs ?y = length ?xs) = (\<forall>x\<in>set ?xs. x = ?y)
(count_list ?xs ?y = length ?xs) = (?xs = replicate (length ?xs) ?y)

goal (1 subgoal):
 1. (count_list ys True = 0) = (ys = replicate (length ys) False)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma divmod_integer_eq_cases:
  "divmod_integer k l =
    (if k = 0 then (0, 0) else if l = 0 then (0, k) else
    (apsnd \<circ> times \<circ> sgn) l (if sgn k = sgn l
      then divmod_abs k l
      else (let (r, s) = divmod_abs k l in
        if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
have *: "sgn k = sgn l \<longleftrightarrow> k = 0 \<and> l = 0 \<or> 0 < l \<and> 0 < k \<or> l < 0 \<and> k < 0" for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sgn k = sgn l) = (k = 0 \<and> l = 0 \<or> 0 < l \<and> 0 < k \<or> l < 0 \<and> k < 0)
[PROOF STEP]
by (auto simp add: sgn_if)
[PROOF STATE]
proof (state)
this:
(sgn ?k = sgn ?l) = (?k = 0 \<and> ?l = 0 \<or> 0 < ?l \<and> 0 < ?k \<or> ?l < 0 \<and> ?k < 0)

goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
have **: "- k = l * q \<longleftrightarrow> k = - (l * q)" for k l q :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- k = l * q) = (k = - (l * q))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- ?k = ?l * ?q) = (?k = - (?l * ?q))

goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))
[PROOF STEP]
by (simp add: divmod_integer_def divmod_abs_def)
      (transfer, auto simp add: * ** not_less zdiv_zminus1_eq_if zmod_zminus1_eq_if div_minus_right mod_minus_right)
[PROOF STATE]
proof (state)
this:
divmod_integer k l = (if k = 0 then (0, 0) else if l = 0 then (0, k) else (apsnd \<circ> (*) \<circ> sgn) l (if sgn k = sgn l then divmod_abs k l else let (r, s) = divmod_abs k l in if s = 0 then (- r, 0) else (- r - 1, \<bar>l\<bar> - s)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_loop_least_fixpoint:
  "y * x \<squnion> z = x \<Longrightarrow> y\<^sup>\<star> * z \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * x \<squnion> z = x \<Longrightarrow> y\<^sup>\<star> * z \<le> x
[PROOF STEP]
by (simp add: sup_commute star_left_induct_equal)


[STATEMENT]
lemma (in topology) closure_Un [simp]:
  "closure (a \<union> b) = closure a \<union> closure b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (a \<union> b) = closure a \<union> closure b
[PROOF STEP]
by (rule, blast) (auto simp: clsr_def)


[STATEMENT]
lemma Succ_Shift: "Succ (Shift Kl k) kl = Succ Kl (k # kl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Succ (Shift Kl k) kl = Succ Kl (k # kl)
[PROOF STEP]
unfolding Succ_def Shift_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {ka. kl @ [ka] \<in> {kl. k # kl \<in> Kl}} = {ka. (k # kl) @ [ka] \<in> Kl}
[PROOF STEP]
by auto


[STATEMENT]
lemma aff_dim_negative_iff [simp]:
  fixes S :: "'n::euclidean_space set"
  shows "aff_dim S < 0 \<longleftrightarrow>S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (aff_dim S < 0) = (S = {})
[PROOF STEP]
by (metis aff_dim_empty aff_dim_geq diff_0 eq_iff zle_diff1_eq)


[STATEMENT]
lemma integrable_Un':
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b :: banach"
  assumes "f integrable_on A" "f integrable_on B" "negligible (A \<inter> B)" "C = A \<union> B"
  shows   "f integrable_on C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on C
[PROOF STEP]
using integrable_Un[of A B f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>negligible (A \<inter> B); f integrable_on A; f integrable_on B\<rbrakk> \<Longrightarrow> f integrable_on A \<union> B
f integrable_on A
f integrable_on B
negligible (A \<inter> B)
C = A \<union> B

goal (1 subgoal):
 1. f integrable_on C
[PROOF STEP]
by simp


[STATEMENT]
lemma less_real_qbs_morphism:
 "(<) \<in> \<real>\<^sub>Q \<rightarrow>\<^sub>Q exp_qbs \<real>\<^sub>Q \<bool>\<^sub>Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (<) \<in> \<real>\<^sub>Q \<rightarrow>\<^sub>Q \<real>\<^sub>Q \<Rightarrow>\<^sub>Q \<bool>\<^sub>Q
[PROOF STEP]
proof(rule curry_preserves_morphisms[where f="(\<lambda>(z :: real \<times> real). fst z < snd z)",simplified curry_def,simplified])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>z. fst z < snd z) \<in> \<real>\<^sub>Q \<Otimes>\<^sub>Q \<real>\<^sub>Q \<rightarrow>\<^sub>Q \<bool>\<^sub>Q
[PROOF STEP]
have "(\<lambda>z. fst z < snd z) \<in> real_borel \<Otimes>\<^sub>M real_borel \<rightarrow>\<^sub>M bool_borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. fst z < snd z) \<in> borel_measurable (real_borel \<Otimes>\<^sub>M real_borel)
[PROOF STEP]
using borel_measurable_pred_less[OF measurable_fst measurable_snd,simplified measurable_cong_sets[OF refl sets_borel_eq_count_space[symmetric],of "borel \<Otimes>\<^sub>M borel"]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. fst w < snd w) \<in> borel_measurable (borel \<Otimes>\<^sub>M borel)

goal (1 subgoal):
 1. (\<lambda>z. fst z < snd z) \<in> borel_measurable (real_borel \<Otimes>\<^sub>M real_borel)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>z. fst z < snd z) \<in> borel_measurable (real_borel \<Otimes>\<^sub>M real_borel)

goal (1 subgoal):
 1. (\<lambda>z. fst z < snd z) \<in> \<real>\<^sub>Q \<Otimes>\<^sub>Q \<real>\<^sub>Q \<rightarrow>\<^sub>Q \<bool>\<^sub>Q
[PROOF STEP]
thus "(\<lambda>z. fst z < snd z) \<in> \<real>\<^sub>Q \<Otimes>\<^sub>Q \<real>\<^sub>Q \<rightarrow>\<^sub>Q \<bool>\<^sub>Q"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>z. fst z < snd z) \<in> borel_measurable (real_borel \<Otimes>\<^sub>M real_borel)

goal (1 subgoal):
 1. (\<lambda>z. fst z < snd z) \<in> \<real>\<^sub>Q \<Otimes>\<^sub>Q \<real>\<^sub>Q \<rightarrow>\<^sub>Q \<bool>\<^sub>Q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>z. fst z < snd z) \<in> \<real>\<^sub>Q \<Otimes>\<^sub>Q \<real>\<^sub>Q \<rightarrow>\<^sub>Q \<bool>\<^sub>Q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma derived_set_subset_gen:
   "X derived_set_of S \<subseteq> S \<longleftrightarrow> closedin X (topspace X \<inter> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X derived_set_of S \<subseteq> S) = closedin X (topspace X \<inter> S)
[PROOF STEP]
by (simp add: closedin_contains_derived_set derived_set_of_restrict derived_set_of_subset_topspace)


[STATEMENT]
lemma translation_apply:
  "\<lbrakk> a \<in> M; b \<in> M \<rbrakk> \<Longrightarrow> (a)\<^sub>L b = a \<cdot> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> M; b \<in> M\<rbrakk> \<Longrightarrow> (a)\<^sub>L b = a \<cdot> b
[PROOF STEP]
unfolding translation_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> M; b \<in> M\<rbrakk> \<Longrightarrow> (\<lambda>a\<in>M. restrict ((\<cdot>) a) M) a b = a \<cdot> b
[PROOF STEP]
by auto


[STATEMENT]
lemma lemma_2_5_18: "(a l\<rightarrow> b) \<le>  a * c l\<rightarrow> b * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a l\<rightarrow> b \<le> a * c l\<rightarrow> b * c
[PROOF STEP]
apply (simp add: left_residual  [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a l\<rightarrow> b) * (a * c) \<le> b * c
[PROOF STEP]
apply (subst mult.assoc  [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a l\<rightarrow> b) * a * c \<le> b * c
[PROOF STEP]
apply (rule mult_right_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a l\<rightarrow> b) * a \<le> b
[PROOF STEP]
apply (subst left_impl_times)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b l\<rightarrow> a) * b \<le> b
[PROOF STEP]
by (rule H)


[STATEMENT]
lemma (in pair_prob_space) pair_measure_eq_bind:
  "(M1 \<Otimes>\<^sub>M M2) = (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M1 \<Otimes>\<^sub>M M2 = M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))
[PROOF STEP]
proof (rule measure_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. events = sets (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y))))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A
[PROOF STEP]
have ps_M2: "prob_space M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space M2
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
this:
prob_space M2

goal (2 subgoals):
 1. events = sets (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y))))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A
[PROOF STEP]
note return_measurable[measurable]
[PROOF STATE]
proof (state)
this:
return ?N \<in> ?N \<rightarrow>\<^sub>M subprob_algebra ?N

goal (2 subgoals):
 1. events = sets (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y))))
 2. \<And>A. A \<in> events \<Longrightarrow> emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A
[PROOF STEP]
show "sets (M1 \<Otimes>\<^sub>M M2) = sets (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. events = sets (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y))))
[PROOF STEP]
by (simp_all add: M1.not_empty M2.not_empty)
[PROOF STATE]
proof (state)
this:
events = sets (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y))))

goal (1 subgoal):
 1. \<And>A. A \<in> events \<Longrightarrow> emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. A \<in> events \<Longrightarrow> emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A
[PROOF STEP]
assume [measurable]: "A \<in> sets (M1 \<Otimes>\<^sub>M M2)"
[PROOF STATE]
proof (state)
this:
A \<in> events

goal (1 subgoal):
 1. \<And>A. A \<in> events \<Longrightarrow> emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A
[PROOF STEP]
show "emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A
[PROOF STEP]
by (auto simp: M2.emeasure_pair_measure M1.not_empty M2.not_empty emeasure_bind[where N="M1 \<Otimes>\<^sub>M M2"]
             intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
emeasure (M1 \<Otimes>\<^sub>M M2) A = emeasure (M1 \<bind> (\<lambda>x. M2 \<bind> (\<lambda>y. return (M1 \<Otimes>\<^sub>M M2) (x, y)))) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hyperdual_linear_comb:
  fixes x :: "('a :: ring_1) hyperdual"
  obtains a b c d :: 'a where "x = a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b c d. x = a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using hyperdual.exhaust Hyperdual_eq
[PROOF STATE]
proof (prove)
using this:
(\<And>x1 x2 x3 x4. ?y = Hyperdual x1 x2 x3 x4 \<Longrightarrow> ?P) \<Longrightarrow> ?P
Hyperdual ?a ?b ?c ?d = ?a *\<^sub>H ba + ?b *\<^sub>H e1 + ?c *\<^sub>H e2 + ?d *\<^sub>H e12

goal (1 subgoal):
 1. (\<And>a b c d. x = a *\<^sub>H ba + b *\<^sub>H e1 + c *\<^sub>H e2 + d *\<^sub>H e12 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis


[STATEMENT]
lemma suntil_inv:
  assumes stl: "\<And>s. f (stl s) = stl (f s)"
  shows "(P suntil Q) (f s) \<longleftrightarrow> ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P suntil Q) (f s) = ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (P suntil Q) (f s) \<Longrightarrow> ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s
 2. ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s \<Longrightarrow> (P suntil Q) (f s)
[PROOF STEP]
assume "(P suntil Q) (f s)"
[PROOF STATE]
proof (state)
this:
(P suntil Q) (f s)

goal (2 subgoals):
 1. (P suntil Q) (f s) \<Longrightarrow> ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s
 2. ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s \<Longrightarrow> (P suntil Q) (f s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(P suntil Q) (f s)
[PROOF STEP]
show "((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s"
[PROOF STATE]
proof (prove)
using this:
(P suntil Q) (f s)

goal (1 subgoal):
 1. ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s
[PROOF STEP]
by (induction "f s" arbitrary: s) (auto simp: stl intro: suntil.intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s

goal (1 subgoal):
 1. ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s \<Longrightarrow> (P suntil Q) (f s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s \<Longrightarrow> (P suntil Q) (f s)
[PROOF STEP]
assume "((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s"
[PROOF STATE]
proof (state)
this:
((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s

goal (1 subgoal):
 1. ((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s \<Longrightarrow> (P suntil Q) (f s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s
[PROOF STEP]
show "(P suntil Q) (f s)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. P (f x)) suntil (\<lambda>x. Q (f x))) s

goal (1 subgoal):
 1. (P suntil Q) (f s)
[PROOF STEP]
by induction (auto simp flip: stl intro: suntil.intros)
[PROOF STATE]
proof (state)
this:
(P suntil Q) (f s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma starprime: "starprime = {p. 1 < p \<and> (\<forall>m. m dvd p \<longrightarrow> m = 1 \<or> m = p)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. starprime = {p. 1 < p \<and> (\<forall>m. m dvd p \<longrightarrow> m = 1 \<or> m = p)}
[PROOF STEP]
by transfer (auto simp add: prime_nat_iff)


[STATEMENT]
lemma open_glb:
  "\<lbrakk>chain C; C \<noteq> {}; open Q; \<forall>x\<in>C. \<not> Q x; x \<in> A; glb (\<sqsubset>) C x\<rbrakk> \<Longrightarrow> \<not> Q x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>chain_on (\<sqsubset>) C A; C \<noteq> {}; open Q; \<forall>x\<in>C. \<not> Q x; x \<in> A; glb (\<sqsubset>) C x\<rbrakk> \<Longrightarrow> \<not> Q x
[PROOF STEP]
by (auto simp: open_def)


[STATEMENT]
theorem Seq_siso_Sbis[simp]:
assumes "siso e" and "c2 \<approx>s d2"
shows "e ;; c2 \<approx>s e ;; d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e ;; c2 \<approx>s e ;; d2
[PROOF STEP]
using assms thetaSSeqI_Sbis
[PROOF STATE]
proof (prove)
using this:
siso e
c2 \<approx>s d2
thetaSSeqI \<subseteq> Sbis

goal (1 subgoal):
 1. e ;; c2 \<approx>s e ;; d2
[PROOF STEP]
unfolding thetaSSeqI_def
[PROOF STATE]
proof (prove)
using this:
siso e
c2 \<approx>s d2
{(e ;; c, e ;; d) |e c d. siso e \<and> c \<approx>s d} \<subseteq> Sbis

goal (1 subgoal):
 1. e ;; c2 \<approx>s e ;; d2
[PROOF STEP]
by auto


[STATEMENT]
lemma (in subgroup_of_group) prime_order_simple:
  assumes "prime (card G)"
  shows "H = {\<one>} \<or> H = G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H = {\<one>} \<or> H = G
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H = {\<one>} \<or> H = G
[PROOF STEP]
have "card H dvd card G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H dvd card G
[PROOF STEP]
using lagrange assms card.infinite dvdI not_prime_0
[PROOF STATE]
proof (prove)
using this:
finite G \<Longrightarrow> card G = card H * index
prime (card G)
infinite ?A \<Longrightarrow> card ?A = 0
?a = ?b * ?k \<Longrightarrow> ?b dvd ?a
\<not> prime (0::?'a)

goal (1 subgoal):
 1. card H dvd card G
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card H dvd card G

goal (1 subgoal):
 1. H = {\<one>} \<or> H = G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card H dvd card G
[PROOF STEP]
have "card H = 1 \<or> card H = card G"
[PROOF STATE]
proof (prove)
using this:
card H dvd card G

goal (1 subgoal):
 1. card H = 1 \<or> card H = card G
[PROOF STEP]
using assms prime_nat_iff
[PROOF STATE]
proof (prove)
using this:
card H dvd card G
prime (card G)
prime ?n = (1 < ?n \<and> (\<forall>m. m dvd ?n \<longrightarrow> m = 1 \<or> m = ?n))

goal (1 subgoal):
 1. card H = 1 \<or> card H = card G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card H = 1 \<or> card H = card G

goal (1 subgoal):
 1. H = {\<one>} \<or> H = G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card H = 1 \<or> card H = card G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card H = 1 \<or> card H = card G

goal (1 subgoal):
 1. H = {\<one>} \<or> H = G
[PROOF STEP]
using card_1_singletonE sub_unit_closed card.infinite card_subset_eq sub
    assms not_prime_0 subsetI insertE empty_iff
[PROOF STATE]
proof (prove)
using this:
card H = 1 \<or> card H = card G
\<lbrakk>card ?A = 1; \<And>x. ?A = {x} \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
\<one> \<in> H
infinite ?A \<Longrightarrow> card ?A = 0
\<lbrakk>finite ?B; ?A \<subseteq> ?B; card ?A = card ?B\<rbrakk> \<Longrightarrow> ?A = ?B
?a \<in> H \<Longrightarrow> ?a \<in> G
prime (card G)
\<not> prime (0::?'a)
(\<And>x. x \<in> ?A \<Longrightarrow> x \<in> ?B) \<Longrightarrow> ?A \<subseteq> ?B
\<lbrakk>?a \<in> insert ?b ?A; ?a = ?b \<Longrightarrow> ?P; ?a \<in> ?A \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
(?c \<in> {}) = False

goal (1 subgoal):
 1. H = {\<one>} \<or> H = G
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
H = {\<one>} \<or> H = G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma constant_a_trans:
  assumes "a \<in>carrier R"
  shows "m_translate a  = \<cc>\<^bsub>a\<^esub> \<otimes>\<^bsub>Fun R\<^esub> ring_id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m_translate a = constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id
[PROOF STEP]
proof(rule function_ring_car_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. m_translate a \<in> carrier (function_ring (carrier R) R)
 2. constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id \<in> carrier (function_ring (carrier R) R)
 3. \<And>aa. aa \<in> carrier R \<Longrightarrow> m_translate a aa = (constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id) aa
[PROOF STEP]
show "m_translate a \<in> carrier (Fun R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m_translate a \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R

goal (1 subgoal):
 1. m_translate a \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
using m_translate_functions
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
?c \<in> carrier R \<Longrightarrow> m_translate ?c \<in> carrier (function_ring (carrier R) R)

goal (1 subgoal):
 1. m_translate a \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m_translate a \<in> carrier (function_ring (carrier R) R)

goal (2 subgoals):
 1. constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id \<in> carrier (function_ring (carrier R) R)
 2. \<And>aa. aa \<in> carrier R \<Longrightarrow> m_translate a aa = (constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id) aa
[PROOF STEP]
show "\<cc>\<^bsub>a\<^esub> \<otimes>\<^bsub>Fun R\<^esub> ring_id \<in> carrier (Fun R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
unfolding ring_id_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> (\<lambda>x\<in>carrier R. x) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
using assms ring_id_closed ring_id_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
ring_id \<in> carrier (function_ring (carrier R) R)
ring_id \<equiv> \<lambda>x\<in>carrier R. x

goal (1 subgoal):
 1. constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> (\<lambda>x\<in>carrier R. x) \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
by (simp add: constant_function_closed fun_mult_closed)
[PROOF STATE]
proof (state)
this:
constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id \<in> carrier (function_ring (carrier R) R)

goal (1 subgoal):
 1. \<And>aa. aa \<in> carrier R \<Longrightarrow> m_translate a aa = (constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id) aa
[PROOF STEP]
show "\<And>x. x \<in> carrier R \<Longrightarrow> m_translate a x = (\<cc>\<^bsub>a\<^esub> \<otimes>\<^bsub>Fun R\<^esub> ring_id) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> m_translate a x = (constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id) x
[PROOF STEP]
by (simp add: constant_function_closed assms constant_function_eq function_mult_eval_car m_translate_eq ring_id_eval)
[PROOF STATE]
proof (state)
this:
?x2 \<in> carrier R \<Longrightarrow> m_translate a ?x2 = (constant_function (carrier R) a \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> ring_id) ?x2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma preprocess'_atoms_to_constraints': assumes "preprocess' cs start = S"
  shows "set (Atoms S) \<subseteq> {(i,qdelta_constraint_to_atom c v) | i c v. (i,c) \<in> set cs \<and>
     (\<not> is_monom (poly c) \<longrightarrow> Poly_Mapping S (poly c) = Some v)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (Atoms S) \<subseteq> {(i, qdelta_constraint_to_atom c v) |i c v. (i, c) \<in> set cs \<and> (\<not> is_monom (poly c) \<longrightarrow> Poly_Mapping S (poly c) = Some v)}
[PROOF STEP]
unfolding assms(1)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (Atoms (preprocess' cs start)) \<subseteq> {(i, qdelta_constraint_to_atom c v) |i c v. (i, c) \<in> set cs \<and> (\<not> is_monom (poly c) \<longrightarrow> Poly_Mapping (preprocess' cs start) (poly c) = Some v)}
[PROOF STEP]
by (induct cs start rule: preprocess'.induct, auto simp: Let_def split: option.splits, force+)


[STATEMENT]
lemma vimage_vunion_right: "r `\<^sub>\<circ> (A \<union>\<^sub>\<circ> B) = r `\<^sub>\<circ> A \<union>\<^sub>\<circ> r `\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r `\<^sub>\<circ> (A \<union>\<^sub>\<circ> B) = r `\<^sub>\<circ> A \<union>\<^sub>\<circ> r `\<^sub>\<circ> B
[PROOF STEP]
by (auto intro!: vsubset_antisym)


[STATEMENT]
lemma l20:
  "x \<le> y \<longleftrightarrow> x \<le> y \<squnion> L \<and> x \<le> y \<squnion> d(y * bot) * top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (x \<le> y \<squnion> L \<and> x \<le> y \<squnion> d (y * bot) * top)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<le> y \<Longrightarrow> x \<le> y \<squnion> L \<and> x \<le> y \<squnion> d (y * bot) * top
 2. x \<le> y \<squnion> L \<and> x \<le> y \<squnion> d (y * bot) * top \<Longrightarrow> x \<le> y
[PROOF STEP]
apply (simp add: le_supI1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<squnion> L \<and> x \<le> y \<squnion> d (y * bot) * top \<Longrightarrow> x \<le> y
[PROOF STEP]
by (smt sup_commute sup_inf_distrib1 l13 le_iff_sup meet_domain_top)


[STATEMENT]
lemma Int_expand:
  "{(S,S'). P S S' \<and>  Q S S'} = ({(S,S'). P S S'} \<inter> {(S,S'). Q S S'})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(S, S'). P S S' \<and> Q S S'} = {(S, S'). P S S'} \<inter> {(S, S'). Q S S'}
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_y_eq_list_sel_eq: "mset y = mset y' \<Longrightarrow> list_sel f x y = list_sel f x y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset y = mset y' \<Longrightarrow> list_sel f x y = list_sel f x y'
[PROOF STEP]
apply(induction x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mset y = mset y' \<Longrightarrow> list_sel f [] y = list_sel f [] y'
 2. \<And>a x. \<lbrakk>mset y = mset y' \<Longrightarrow> list_sel f x y = list_sel f x y'; mset y = mset y'\<rbrakk> \<Longrightarrow> list_sel f (a # x) y = list_sel f (a # x) y'
[PROOF STEP]
apply(auto)[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x. \<lbrakk>list_sel f x y = list_sel f x y'; mset y = mset y'; list_sel_aux f a y \<noteq> list_sel_aux f a y'\<rbrakk> \<Longrightarrow> list_sel f x y' = 0
[PROOF STEP]
using mset_y_eq_list_sel_aux_eq
[PROOF STATE]
proof (prove)
using this:
mset ?y = mset ?z \<Longrightarrow> list_sel_aux ?f ?x ?y = list_sel_aux ?f ?x ?z

goal (1 subgoal):
 1. \<And>a x. \<lbrakk>list_sel f x y = list_sel f x y'; mset y = mset y'; list_sel_aux f a y \<noteq> list_sel_aux f a y'\<rbrakk> \<Longrightarrow> list_sel f x y' = 0
[PROOF STEP]
by fast


[STATEMENT]
lemma finite_V: "finite V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite V
[PROOF STEP]
using finite_edges and finite_E
[PROOF STATE]
proof (prove)
using this:
?e \<in> E \<Longrightarrow> finite ?e
finite E

goal (1 subgoal):
 1. finite V
[PROOF STEP]
by auto


[STATEMENT]
lemma lo_lemma': "\<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow>
  rec_exec rec_lo [x, y] = lo x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < x; Suc 0 < y\<rbrakk> \<Longrightarrow> rec_exec rec_lo [x, y] = lo x y
[PROOF STEP]
by(simp add: Maxr_lo  rec_lo_Maxr_lor)


[STATEMENT]
lemma rev_swap: "(rev xs = ys) = (xs = rev ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rev xs = ys) = (xs = rev ys)
[PROOF STEP]
by auto


[STATEMENT]
lemma final_NF: "(is_final a) = (a \<in> NF relset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_final a = (a \<in> NF {(x, y). x \<rightarrow> y})
[PROOF STEP]
unfolding is_final_def NF_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>b. a \<rightarrow> b) = (a \<in> {a. {(x, y). x \<rightarrow> y} `` {a} = {}})
[PROOF STEP]
by simp


[STATEMENT]
lemma check_trss:
  "check_trss \<R> \<F> \<longleftrightarrow> (\<forall> R \<in> set \<R>. lv_trs (fset R) \<and> ffunas_trs R |\<subseteq>| \<F>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. check_trss \<R> \<F> = (\<forall>R\<in>set \<R>. lv_trs (fset R) \<and> ffunas_trs R |\<subseteq>| \<F>)
[PROOF STEP]
unfolding check_trss_def list_all_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>R\<in>set \<R>. lv_trs (fset R) \<and> funas_trs (fset R) \<subseteq> fset \<F>) = (\<forall>R\<in>set \<R>. lv_trs (fset R) \<and> ffunas_trs R |\<subseteq>| \<F>)
[PROOF STEP]
by (auto simp: fmember.rep_eq ffunas_trs.rep_eq less_eq_fset.rep_eq)