[STATEMENT]
lemma omega_one [simp]: "1 ^ \<omega> = \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) ^ \<omega> = \<bottom>
[PROOF STEP]
apply (rule order.antisym, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) ^ \<omega> \<le> \<bottom>
[PROOF STEP]
by (cut_tac x = "1::'a" and y = 1 and z = \<bottom> in omega_least, simp_all)


[STATEMENT]
lemma proj_poly_syz_plus: "proj_poly_syz n (p + q) = proj_poly_syz n p + proj_poly_syz n q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly_syz n (p + q) = proj_poly_syz n p + proj_poly_syz n q
[PROOF STEP]
by (simp add: proj_poly_syz_def map_key_plus[OF inj_map_component_plus])


[STATEMENT]
lemma integrable_combine_division:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::banach"
  assumes \<D>: "\<D> division_of S"
    and f: "\<And>i. i \<in> \<D> \<Longrightarrow> f integrable_on i"
  shows "f integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on S
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
?i \<in> \<D> \<Longrightarrow> f integrable_on ?i

goal (1 subgoal):
 1. f integrable_on S
[PROOF STEP]
unfolding integrable_on_def
[PROOF STATE]
proof (prove)
using this:
?i \<in> \<D> \<Longrightarrow> \<exists>y. (f has_integral y) ?i

goal (1 subgoal):
 1. \<exists>y. (f has_integral y) S
[PROOF STEP]
by (metis has_integral_combine_division[OF \<D>])


[STATEMENT]
lemma Rep_numeral:
  "Rep (numeral w) = numeral w mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep (numeral w) = numeral w mod n
[PROOF STEP]
using of_int_eq [of "numeral w"]
[PROOF STATE]
proof (prove)
using this:
of_int (numeral w) = Abs (numeral w mod n)

goal (1 subgoal):
 1. Rep (numeral w) = numeral w mod n
[PROOF STEP]
by (simp add: Rep_inject_sym Rep_Abs_mod)


[STATEMENT]
lemma continuous_frac:
  fixes x::real
  assumes "x \<notin> \<int>"
  shows "continuous (at x) frac"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
have "isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x
[PROOF STEP]
using continuous_floor [OF assms]
[PROOF STATE]
proof (prove)
using this:
isCont (real_of_int \<circ> floor) x

goal (1 subgoal):
 1. isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x
[PROOF STEP]
have *: "continuous (at x) (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>)"
[PROOF STATE]
proof (prove)
using this:
isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x

goal (1 subgoal):
 1. isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
have "\<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>
[PROOF STEP]
by (simp add: frac_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x
\<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x
\<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
by (simp add: LIM_imp_LIM frac_def isCont_def)
[PROOF STATE]
proof (state)
this:
isCont frac x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equivalent_objects_symmetric:
    assumes "equivalent_objects a b"
    shows "equivalent_objects b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalent_objects b a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
equivalent_objects a b

goal (1 subgoal):
 1. equivalent_objects b a
[PROOF STEP]
by (metis equivalent_objects_def in_hhomE quasi_inverse_in_hom(1) quasi_inverse_simps(1))


[STATEMENT]
lemma independent_sets_mono:
  "vs \<in> independent_sets  \<Longrightarrow> us \<subseteq> vs \<Longrightarrow> us \<in> independent_sets "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>vs \<in> independent_sets; us \<subseteq> vs\<rbrakk> \<Longrightarrow> us \<in> independent_sets
[PROOF STEP]
using Int_mono[OF all_edges_mono, of us vs "E" "E"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>us \<subseteq> vs; E \<subseteq> E\<rbrakk> \<Longrightarrow> all_edges us \<inter> E \<subseteq> all_edges vs \<inter> E

goal (1 subgoal):
 1. \<lbrakk>vs \<in> independent_sets; us \<subseteq> vs\<rbrakk> \<Longrightarrow> us \<in> independent_sets
[PROOF STEP]
unfolding independent_sets_def is_independent_set_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>us \<subseteq> vs; E \<subseteq> E\<rbrakk> \<Longrightarrow> all_edges us \<inter> E \<subseteq> all_edges vs \<inter> E

goal (1 subgoal):
 1. \<lbrakk>vs \<in> {vs. vs \<subseteq> V \<and> all_edges vs \<inter> E = {}}; us \<subseteq> vs\<rbrakk> \<Longrightarrow> us \<in> {vs. vs \<subseteq> V \<and> all_edges vs \<inter> E = {}}
[PROOF STEP]
by auto


[STATEMENT]
lemma conj_distrib4: "c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "c\<^sup>\<star> \<iinter> d\<^sup>\<star> = (nil \<sqinter> (c;c\<^sup>\<star>)) \<iinter> d\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> = (nil \<sqinter> c ; c\<^sup>\<star>) \<iinter> d\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis fiter_unfold)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> = (nil \<sqinter> c ; c\<^sup>\<star>) \<iinter> d\<^sup>\<star>

goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> = (nil \<sqinter> c ; c\<^sup>\<star>) \<iinter> d\<^sup>\<star>
[PROOF STEP]
have "c\<^sup>\<star> \<iinter> d\<^sup>\<star> = (nil \<iinter> d\<^sup>\<star>) \<sqinter> ((c;c\<^sup>\<star>) \<iinter> d\<^sup>\<star>)"
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> = (nil \<sqinter> c ; c\<^sup>\<star>) \<iinter> d\<^sup>\<star>

goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> = nil \<iinter> d\<^sup>\<star> \<sqinter> c ; c\<^sup>\<star> \<iinter> d\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: inf_conj_distrib)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> = nil \<iinter> d\<^sup>\<star> \<sqinter> c ; c\<^sup>\<star> \<iinter> d\<^sup>\<star>

goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> = nil \<iinter> d\<^sup>\<star> \<sqinter> c ; c\<^sup>\<star> \<iinter> d\<^sup>\<star>
[PROOF STEP]
have "c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> nil \<sqinter> ((c;c\<^sup>\<star>) \<iinter> (d;d\<^sup>\<star>))"
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> = nil \<iinter> d\<^sup>\<star> \<sqinter> c ; c\<^sup>\<star> \<iinter> d\<^sup>\<star>

goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> nil \<sqinter> c ; c\<^sup>\<star> \<iinter> d ; d\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis conj_idem fiter0 fiter_unfold inf.bounded_iff inf_le2 local.conj_mono)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> nil \<sqinter> c ; c\<^sup>\<star> \<iinter> d ; d\<^sup>\<star>

goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> nil \<sqinter> c ; c\<^sup>\<star> \<iinter> d ; d\<^sup>\<star>
[PROOF STEP]
have "c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> nil \<sqinter> ((c \<iinter> d);(c\<^sup>\<star> \<iinter> d\<^sup>\<star>))"
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> nil \<sqinter> c ; c\<^sup>\<star> \<iinter> d ; d\<^sup>\<star>

goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> nil \<sqinter> (c \<iinter> d) ; (c\<^sup>\<star> \<iinter> d\<^sup>\<star>)
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (meson inf_mono_right order.trans sequential_interchange)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> nil \<sqinter> (c \<iinter> d) ; (c\<^sup>\<star> \<iinter> d\<^sup>\<star>)

goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> nil \<sqinter> (c \<iinter> d) ; (c\<^sup>\<star> \<iinter> d\<^sup>\<star>)

goal (1 subgoal):
 1. c\<^sup>\<star> \<iinter> d\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis seq_nil_right fiter_induct)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> \<iinter> (d::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> (c \<iinter> d)\<^sup>\<star>

goal:
No subgoals!
variables:
c, d, nil :: 'a
(\<iinter>), (;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma nn_integral_diff:
  assumes f: "f \<in> borel_measurable M"
  and g: "g \<in> borel_measurable M"
  and fin: "integral\<^sup>N M g \<noteq> \<infinity>"
  and mono: "AE x in M. g x \<le> f x"
  shows "(\<integral>\<^sup>+ x. f x - g x \<partial>M) = integral\<^sup>N M f - integral\<^sup>N M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x - g x \<partial>M = integral\<^sup>N M f - integral\<^sup>N M g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x - g x \<partial>M = integral\<^sup>N M f - integral\<^sup>N M g
[PROOF STEP]
have diff: "(\<lambda>x. f x - g x) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x - g x) \<in> borel_measurable M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
g \<in> borel_measurable M
integral\<^sup>N M g \<noteq> \<infinity>
AE x in M. g x \<le> f x

goal (1 subgoal):
 1. (\<lambda>x. f x - g x) \<in> borel_measurable M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x - g x) \<in> borel_measurable M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x - g x \<partial>M = integral\<^sup>N M f - integral\<^sup>N M g
[PROOF STEP]
have "AE x in M. f x = f x - g x + g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. f x = f x - g x + g x
[PROOF STEP]
using diff_add_cancel_ennreal mono nn_integral_noteq_infinite[OF g fin] assms
[PROOF STATE]
proof (prove)
using this:
?a \<le> ?b \<Longrightarrow> ?b - ?a + ?a = ?b
AE x in M. g x \<le> f x
AE x in M. g x \<noteq> \<infinity>
f \<in> borel_measurable M
g \<in> borel_measurable M
integral\<^sup>N M g \<noteq> \<infinity>
AE x in M. g x \<le> f x

goal (1 subgoal):
 1. AE x in M. f x = f x - g x + g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. f x = f x - g x + g x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x - g x \<partial>M = integral\<^sup>N M f - integral\<^sup>N M g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. f x = f x - g x + g x
[PROOF STEP]
have **: "integral\<^sup>N M f = (\<integral>\<^sup>+x. f x - g x \<partial>M) + integral\<^sup>N M g"
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x = f x - g x + g x

goal (1 subgoal):
 1. integral\<^sup>N M f = \<integral>\<^sup>+ x. f x - g x \<partial>M + integral\<^sup>N M g
[PROOF STEP]
unfolding nn_integral_add[OF diff g, symmetric]
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x = f x - g x + g x

goal (1 subgoal):
 1. integral\<^sup>N M f = \<integral>\<^sup>+ x. f x - g x + g x \<partial>M
[PROOF STEP]
by (rule nn_integral_cong_AE)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M f = \<integral>\<^sup>+ x. f x - g x \<partial>M + integral\<^sup>N M g

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x - g x \<partial>M = integral\<^sup>N M f - integral\<^sup>N M g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x - g x \<partial>M = integral\<^sup>N M f - integral\<^sup>N M g
[PROOF STEP]
unfolding **
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x - g x \<partial>M = \<integral>\<^sup>+ x. f x - g x \<partial>M + integral\<^sup>N M g - integral\<^sup>N M g
[PROOF STEP]
using fin
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M g \<noteq> \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x - g x \<partial>M = \<integral>\<^sup>+ x. f x - g x \<partial>M + integral\<^sup>N M g - integral\<^sup>N M g
[PROOF STEP]
by (cases rule: ennreal2_cases[of "\<integral>\<^sup>+ x. f x - g x \<partial>M" "integral\<^sup>N M g"]) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f x - g x \<partial>M = integral\<^sup>N M f - integral\<^sup>N M g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_fst_zip: "length xs = length ys \<Longrightarrow> map fst (zip xs ys) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> map fst (zip xs ys) = xs
[PROOF STEP]
apply (induct xs ys rule:list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map fst (zip [] []) = []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; map fst (zip xs ys) = xs\<rbrakk> \<Longrightarrow> map fst (zip (x # xs) (y # ys)) = x # xs
[PROOF STEP]
by auto


[STATEMENT]
lemma bdd_all_bdd_map:
  assumes "bdd_all P bdd"
  and "\<And>a. P a \<Longrightarrow> Q (f a)"
  shows "bdd_all Q (bdd_map f bdd)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_all Q (bdd_map f bdd)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bdd_all P bdd
P ?a \<Longrightarrow> Q (f ?a)

goal (1 subgoal):
 1. bdd_all Q (bdd_map f bdd)
[PROOF STEP]
by (induct bdd) simp+


[STATEMENT]
lemma excess_non_negative: "\<forall>v\<in>V-{s,t}. excess f v \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>v\<in>V - {s, t}. (0::'capacity) \<le> excess f v
[PROOF STEP]
unfolding excess_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>v\<in>V - {s, t}. (0::'capacity) \<le> sum f (incoming v) - sum f (outgoing v)
[PROOF STEP]
using no_deficient_nodes
[PROOF STATE]
proof (prove)
using this:
\<forall>v\<in>V - {s, t}. sum f (outgoing v) \<le> sum f (incoming v)

goal (1 subgoal):
 1. \<forall>v\<in>V - {s, t}. (0::'capacity) \<le> sum f (incoming v) - sum f (outgoing v)
[PROOF STEP]
by auto


[STATEMENT]
lemma smember_code[code, simp]: "smember x (y ## s) = (if x = y then True else smember x s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smember x (y ## s) = (if x = y then True else smember x s)
[PROOF STEP]
unfolding smember_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> sset (y ## s)) = (if x = y then True else x \<in> sset s)
[PROOF STEP]
by auto


[STATEMENT]
lemma summable_If_finite_set[simp, intro]: "finite A \<Longrightarrow> summable (\<lambda>r. if r \<in> A then f r else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> summable (\<lambda>r. if r \<in> A then f r else (0::'a))
[PROOF STEP]
by (rule sums_summable) (rule sums_If_finite_set)


[STATEMENT]
lemma restrict_PiE_iff: "restrict f I \<in> Pi\<^sub>E I X \<longleftrightarrow> (\<forall>i \<in> I. f i \<in> X i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (restrict f I \<in> Pi\<^sub>E I X) = (\<forall>i\<in>I. f i \<in> X i)
[PROOF STEP]
by (simp add: PiE_iff)


[STATEMENT]
lemma fieldE :
  fixes R (structure)
  assumes "field R"
  shows "cring R"
    and one_not_zero : "\<one> \<noteq> \<zero>"
    and integral: "\<And>a b. \<lbrakk> a \<otimes> b = \<zero>; a \<in> carrier R; b \<in> carrier R \<rbrakk> \<Longrightarrow> a = \<zero> \<or> b = \<zero>"
  and field_Units: "Units R = carrier R - {\<zero>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cring R &&& \<one> \<noteq> \<zero>) &&& (\<And>a b. \<lbrakk>a \<otimes> b = \<zero>; a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> a = \<zero> \<or> b = \<zero>) &&& Units R = carrier R - {\<zero>}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
field R

goal (1 subgoal):
 1. (cring R &&& \<one> \<noteq> \<zero>) &&& (\<And>a b. \<lbrakk>a \<otimes> b = \<zero>; a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> a = \<zero> \<or> b = \<zero>) &&& Units R = carrier R - {\<zero>}
[PROOF STEP]
unfolding field_def field_axioms_def domain_def domain_axioms_def
[PROOF STATE]
proof (prove)
using this:
(cring R \<and> \<one> \<noteq> \<zero> \<and> (\<forall>a b. a \<otimes> b = \<zero> \<longrightarrow> a \<in> carrier R \<longrightarrow> b \<in> carrier R \<longrightarrow> a = \<zero> \<or> b = \<zero>)) \<and> Units R = carrier R - {\<zero>}

goal (1 subgoal):
 1. (cring R &&& \<one> \<noteq> \<zero>) &&& (\<And>a b. \<lbrakk>a \<otimes> b = \<zero>; a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> a = \<zero> \<or> b = \<zero>) &&& Units R = carrier R - {\<zero>}
[PROOF STEP]
by simp_all


[STATEMENT]
lemma eq_solution_ivl:
  assumes xivp: "D X = (\<lambda>t. f (X t)) on {0--t}" "X 0 = s" "X \<in> {0--t} \<rightarrow> S"
    and indom: "t \<in> T" "s \<in> S"
  shows "X t = \<phi> t s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X t = \<phi> t s
[PROOF STEP]
apply(rule unique_solution_closed_ivl[OF xivp \<open>t \<in> T\<close>])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1.  D (\<lambda>a. \<phi> a s) = (\<lambda>t. f (\<phi> t s)) on {0--t}
 2. \<phi> 0 s = s
 3. (\<lambda>a. \<phi> a s) \<in> {0--t} \<rightarrow> S
 4. s \<in> S
[PROOF STEP]
using \<open>s \<in> S\<close> ivp indom
[PROOF STATE]
proof (prove)
using this:
s \<in> S
\<lbrakk>?t \<in> T; ?s \<in> S\<rbrakk> \<Longrightarrow>  D (\<lambda>t. \<phi> t ?s) = (\<lambda>t. f (\<phi> t ?s)) on {0--?t}
?s \<in> S \<Longrightarrow> \<phi> 0 ?s = ?s
\<lbrakk>?t \<in> T; ?s \<in> S\<rbrakk> \<Longrightarrow> (\<lambda>t. \<phi> t ?s) \<in> {0--?t} \<rightarrow> S
t \<in> T
s \<in> S

goal (4 subgoals):
 1.  D (\<lambda>a. \<phi> a s) = (\<lambda>t. f (\<phi> t s)) on {0--t}
 2. \<phi> 0 s = s
 3. (\<lambda>a. \<phi> a s) \<in> {0--t} \<rightarrow> S
 4. s \<in> S
[PROOF STEP]
by auto


[STATEMENT]
lemma winding_number_homotopic_paths_null_explicit_eq:
  assumes "path p" and \<zeta>: "\<zeta> \<notin> path_image p"
  shows "winding_number p \<zeta> = 0 \<longleftrightarrow> homotopic_paths (-{\<zeta>}) p (linepath (pathstart p) (pathstart p))"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (winding_number p \<zeta> = 0) = homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. winding_number p \<zeta> = 0 \<Longrightarrow> homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))
 2. homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p)) \<Longrightarrow> winding_number p \<zeta> = 0
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
winding_number p \<zeta> = 0

goal (2 subgoals):
 1. winding_number p \<zeta> = 0 \<Longrightarrow> homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))
 2. homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p)) \<Longrightarrow> winding_number p \<zeta> = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
winding_number p \<zeta> = 0
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
winding_number p \<zeta> = 0

goal (1 subgoal):
 1. homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))
[PROOF STEP]
apply (auto simp: winding_number_homotopic_loops_null_eq [OF assms])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. homotopic_loops (- {\<zeta>}) p (\<lambda>t. a) \<Longrightarrow> homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))
[PROOF STEP]
apply (rule homotopic_loops_imp_homotopic_paths_null)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. homotopic_loops (- {\<zeta>}) p (\<lambda>t. a) \<Longrightarrow> homotopic_loops (- {\<zeta>}) p (linepath (?a3 a) (?a3 a))
[PROOF STEP]
apply (simp add: linepath_refl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))

goal (1 subgoal):
 1. homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p)) \<Longrightarrow> winding_number p \<zeta> = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p)) \<Longrightarrow> winding_number p \<zeta> = 0
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))

goal (1 subgoal):
 1. homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p)) \<Longrightarrow> winding_number p \<zeta> = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
homotopic_paths (- {\<zeta>}) p (linepath (pathstart p) (pathstart p))

goal (1 subgoal):
 1. winding_number p \<zeta> = 0
[PROOF STEP]
by (metis \<zeta> pathstart_in_path_image winding_number_homotopic_paths winding_number_trivial)
[PROOF STATE]
proof (state)
this:
winding_number p \<zeta> = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma MaxI2_order: "\<lbrakk> k \<in> A; finite A; \<And>y. y \<in> A \<Longrightarrow> y \<le> k;
  \<And>x. \<lbrakk> x \<in> A; \<forall>y\<in>A. y \<le> x \<rbrakk> \<Longrightarrow> P x \<rbrakk>
  \<Longrightarrow> P (Max A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k \<in> A; finite A; \<And>y. y \<in> A \<Longrightarrow> y \<le> k; \<And>x. \<lbrakk>x \<in> A; \<forall>y\<in>A. y \<le> x\<rbrakk> \<Longrightarrow> P x\<rbrakk> \<Longrightarrow> P (Max A)
[PROOF STEP]
by (simp add: Max_equality)


[STATEMENT]
lemma const_eq_if_conv: "w = (if x then y else z) \<longleftrightarrow> x \<and> w = y \<or> \<not> x \<and> w = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w = (if x then y else z)) = (x \<and> w = y \<or> \<not> x \<and> w = z)
[PROOF STEP]
by auto


[STATEMENT]
lemma upper_asymptotic_density_0_diff:
  assumes "A \<subseteq> B" "upper_asymptotic_density (B-A) = 0"
  shows "upper_asymptotic_density A = upper_asymptotic_density B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_asymptotic_density A = upper_asymptotic_density B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. upper_asymptotic_density A = upper_asymptotic_density B
[PROOF STEP]
have "upper_asymptotic_density B \<le> upper_asymptotic_density A + upper_asymptotic_density (B-A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_asymptotic_density B \<le> upper_asymptotic_density A + upper_asymptotic_density (B - A)
[PROOF STEP]
using upper_asymptotic_density_union[of A "B-A"]
[PROOF STATE]
proof (prove)
using this:
upper_asymptotic_density (A \<union> (B - A)) \<le> upper_asymptotic_density A + upper_asymptotic_density (B - A)

goal (1 subgoal):
 1. upper_asymptotic_density B \<le> upper_asymptotic_density A + upper_asymptotic_density (B - A)
[PROOF STEP]
by (simp add: assms(1) sup.absorb2)
[PROOF STATE]
proof (state)
this:
upper_asymptotic_density B \<le> upper_asymptotic_density A + upper_asymptotic_density (B - A)

goal (1 subgoal):
 1. upper_asymptotic_density A = upper_asymptotic_density B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
upper_asymptotic_density B \<le> upper_asymptotic_density A + upper_asymptotic_density (B - A)
[PROOF STEP]
have "upper_asymptotic_density B \<le> upper_asymptotic_density A"
[PROOF STATE]
proof (prove)
using this:
upper_asymptotic_density B \<le> upper_asymptotic_density A + upper_asymptotic_density (B - A)

goal (1 subgoal):
 1. upper_asymptotic_density B \<le> upper_asymptotic_density A
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
upper_asymptotic_density B \<le> upper_asymptotic_density A + upper_asymptotic_density (B - A)
upper_asymptotic_density (B - A) = 0

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

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

goal (1 subgoal):
 1. upper_asymptotic_density A = upper_asymptotic_density B
[PROOF STEP]
using upper_asymptotic_density_subset[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
upper_asymptotic_density B \<le> upper_asymptotic_density A
upper_asymptotic_density A \<le> upper_asymptotic_density B

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cpx_sq_mat) sum_mat_distrib_left:
  shows "finite I \<Longrightarrow> R\<in> fc_mats \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> (A i)\<in> fc_mats) \<Longrightarrow>
    sum_mat (\<lambda>i. R * (A i)) I = R * (sum_mat A I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; R \<in> fc_mats; \<And>i. i \<in> I \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) I = R * local.sum_mat A I
[PROOF STEP]
proof (induct rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) {} = R * local.sum_mat A {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
R \<in> fc_mats
?i1 \<in> {} \<Longrightarrow> A ?i1 \<in> fc_mats

goal (2 subgoals):
 1. \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) {} = R * local.sum_mat A {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
hence a: "sum_mat (\<lambda>i. R * (A i)) {} = 0\<^sub>m dimR dimC"
[PROOF STATE]
proof (prove)
using this:
R \<in> fc_mats
?i1 \<in> {} \<Longrightarrow> A ?i1 \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. R * A i) {} = 0\<^sub>m dimR dimC
[PROOF STEP]
unfolding sum_mat_def
[PROOF STATE]
proof (prove)
using this:
R \<in> fc_mats
?i1 \<in> {} \<Longrightarrow> A ?i1 \<in> fc_mats

goal (1 subgoal):
 1. sum_with (+) (0\<^sub>m dimR dimC) (\<lambda>i. R * A i) {} = 0\<^sub>m dimR dimC
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. R * A i) {} = 0\<^sub>m dimR dimC

goal (2 subgoals):
 1. \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) {} = R * local.sum_mat A {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
have "sum_mat A {} = 0\<^sub>m dimR dimC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat A {} = 0\<^sub>m dimR dimC
[PROOF STEP]
unfolding sum_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_with (+) (0\<^sub>m dimR dimC) A {} = 0\<^sub>m dimR dimC
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.sum_mat A {} = 0\<^sub>m dimR dimC

goal (2 subgoals):
 1. \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) {} = R * local.sum_mat A {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
hence "R * (sum_mat A {}) = 0\<^sub>m dimR dimC"
[PROOF STATE]
proof (prove)
using this:
local.sum_mat A {} = 0\<^sub>m dimR dimC

goal (1 subgoal):
 1. R * local.sum_mat A {} = 0\<^sub>m dimR dimC
[PROOF STEP]
using  fc_mats_carrier
      right_mult_zero_mat[of R dimR dimC dimC] empty dim_eq
[PROOF STATE]
proof (prove)
using this:
local.sum_mat A {} = 0\<^sub>m dimR dimC
fc_mats = carrier_mat dimR dimC
R \<in> carrier_mat dimR dimC \<Longrightarrow> R * 0\<^sub>m dimC dimC = 0\<^sub>m dimR dimC
R \<in> fc_mats
?i1 \<in> {} \<Longrightarrow> A ?i1 \<in> fc_mats
dimR = dimC

goal (1 subgoal):
 1. R * local.sum_mat A {} = 0\<^sub>m dimR dimC
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R * local.sum_mat A {} = 0\<^sub>m dimR dimC

goal (2 subgoals):
 1. \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) {} = R * local.sum_mat A {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
R * local.sum_mat A {} = 0\<^sub>m dimR dimC

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. R * A i) {} = R * local.sum_mat A {}
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
R * local.sum_mat A {} = 0\<^sub>m dimR dimC
local.sum_mat (\<lambda>i. R * A i) {} = 0\<^sub>m dimR dimC

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. R * A i) {} = R * local.sum_mat A {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. R * A i) {} = R * local.sum_mat A {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F
R \<in> fc_mats
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
hence "sum_mat (\<lambda>i. R * A i) (insert x F) = R * (A x) + sum_mat (\<lambda>i. R * A i) F"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F
R \<in> fc_mats
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * A x + local.sum_mat (\<lambda>i. R * A i) F
[PROOF STEP]
using sum_mat_insert[of "\<lambda>i. R * A i" x F]
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F
R \<in> fc_mats
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats
\<lbrakk>R * A x \<in> fc_mats; (\<lambda>i. R * A i) ` F \<subseteq> fc_mats; finite F; x \<notin> F\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * A x + local.sum_mat (\<lambda>i. R * A i) F

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * A x + local.sum_mat (\<lambda>i. R * A i) F
[PROOF STEP]
by (simp add: image_subsetI fc_mats_carrier dim_eq)
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * A x + local.sum_mat (\<lambda>i. R * A i) F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * A x + local.sum_mat (\<lambda>i. R * A i) F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
have "... = R * (A x) + R * (sum_mat A F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R * A x + local.sum_mat (\<lambda>i. R * A i) F = R * A x + R * local.sum_mat A F
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F
R \<in> fc_mats
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats

goal (1 subgoal):
 1. R * A x + local.sum_mat (\<lambda>i. R * A i) F = R * A x + R * local.sum_mat A F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R * A x + local.sum_mat (\<lambda>i. R * A i) F = R * A x + R * local.sum_mat A F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R * A x + local.sum_mat (\<lambda>i. R * A i) F = R * A x + R * local.sum_mat A F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
have "... = R * (A x + (sum_mat A F))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R * A x + R * local.sum_mat A F = R * (A x + local.sum_mat A F)
[PROOF STEP]
by (metis dim_eq fc_mats_carrier insert.prems(1) insert.prems(2) insertCI mult_add_distrib_mat
        sum_mat_carrier)
[PROOF STATE]
proof (state)
this:
R * A x + R * local.sum_mat A F = R * (A x + local.sum_mat A F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R * A x + R * local.sum_mat A F = R * (A x + local.sum_mat A F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
have "... = R * sum_mat A (insert x F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R * (A x + local.sum_mat A F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. R * (A x + local.sum_mat A F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
have "A x + (sum_mat A F) = sum_mat A (insert x F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A x + local.sum_mat A F = local.sum_mat A (insert x F)
[PROOF STEP]
by (rule sum_mat_insert[symmetric], (auto simp add: insert))
[PROOF STATE]
proof (state)
this:
A x + local.sum_mat A F = local.sum_mat A (insert x F)

goal (1 subgoal):
 1. R * (A x + local.sum_mat A F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A x + local.sum_mat A F = local.sum_mat A (insert x F)

goal (1 subgoal):
 1. R * (A x + local.sum_mat A F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R * (A x + local.sum_mat A F) = R * local.sum_mat A (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
R * (A x + local.sum_mat A F) = R * local.sum_mat A (insert x F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>R \<in> fc_mats; \<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) F = R * local.sum_mat A F; R \<in> fc_mats; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. R * A i) (insert x F) = R * local.sum_mat A (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_lists_length_eq':
  assumes "\<And>x. x \<in> set xs \<Longrightarrow> finite {y. P x y}"
  shows "finite {ys. length xs = length ys \<and> (\<forall>y \<in> set ys. \<exists>x \<in> set xs. P x y)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
define Q where "Q \<equiv> \<lambda>ys. \<forall>y \<in> set ys. \<exists>x \<in> set xs. P x y"
[PROOF STATE]
proof (state)
this:
Q \<equiv> \<lambda>ys. \<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y

goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
define M where "M \<equiv> {y. \<exists>x \<in> set xs. P x y}"
[PROOF STATE]
proof (state)
this:
M \<equiv> {y. \<exists>x\<in>set xs. P x y}

goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
have 0: "finite M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> set xs \<Longrightarrow> finite {y. P ?x y}

goal (1 subgoal):
 1. finite M
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> set xs \<Longrightarrow> finite {y. P ?x y}

goal (1 subgoal):
 1. finite {y. \<exists>x\<in>set xs. P x y}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
finite M

goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
have "Q ys \<longleftrightarrow> set ys \<subseteq> M"
       "(Q ys \<and> length ys = length xs) \<longleftrightarrow> (length xs = length ys \<and> Q ys)"
    for ys
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q ys = (set ys \<subseteq> M) &&& (Q ys \<and> length ys = length xs) = (length xs = length ys \<and> Q ys)
[PROOF STEP]
unfolding Q_def M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y) = (set ys \<subseteq> {y. \<exists>x\<in>set xs. P x y}) &&& ((\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y) \<and> length ys = length xs) = (length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Q ?ys = (set ?ys \<subseteq> M)
(Q ?ys \<and> length ?ys = length xs) = (length xs = length ?ys \<and> Q ?ys)

goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Q ?ys = (set ?ys \<subseteq> M)
(Q ?ys \<and> length ?ys = length xs) = (length xs = length ?ys \<and> Q ?ys)

goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
using finite_lists_length_eq[OF 0, of "length xs"]
[PROOF STATE]
proof (prove)
using this:
Q ?ys = (set ?ys \<subseteq> M)
(Q ?ys \<and> length ?ys = length xs) = (length xs = length ?ys \<and> Q ?ys)
finite {xsa. set xsa \<subseteq> M \<and> length xsa = length xs}

goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
unfolding Q_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>y\<in>set ?ys. \<exists>x\<in>set xs. P x y) = (set ?ys \<subseteq> M)
((\<forall>y\<in>set ?ys. \<exists>x\<in>set xs. P x y) \<and> length ?ys = length xs) = (length xs = length ?ys \<and> (\<forall>y\<in>set ?ys. \<exists>x\<in>set xs. P x y))
finite {xsa. set xsa \<subseteq> M \<and> length xsa = length xs}

goal (1 subgoal):
 1. finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
finite {ys. length xs = length ys \<and> (\<forall>y\<in>set ys. \<exists>x\<in>set xs. P x y)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in finite_distrib_lattice) join_irreducibles_join_homomorphism:
  "\<lbrace> x \<squnion> y \<rbrace> = \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace> x \<squnion> y \<rbrace> = \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrace> x \<squnion> y \<rbrace> \<subseteq> \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace>
 2. \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace> \<subseteq> \<lbrace> x \<squnion> y \<rbrace>
[PROOF STEP]
show "\<lbrace> x \<squnion> y \<rbrace> \<subseteq> \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace> x \<squnion> y \<rbrace> \<subseteq> \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace>
[PROOF STEP]
unfolding
      join_irreducibles_embedding_def
      join_irreducible_elements_def
      join_irreducible_is_join_prime
      join_prime_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> x \<squnion> y} \<subseteq> {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> x} \<union> {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> y}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrace> x \<squnion> y \<rbrace> \<subseteq> \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace>

goal (1 subgoal):
 1. \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace> \<subseteq> \<lbrace> x \<squnion> y \<rbrace>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace> \<subseteq> \<lbrace> x \<squnion> y \<rbrace>
[PROOF STEP]
show "\<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace> \<subseteq> \<lbrace> x \<squnion> y \<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace> \<subseteq> \<lbrace> x \<squnion> y \<rbrace>
[PROOF STEP]
unfolding
      join_irreducibles_embedding_def
      join_irreducible_elements_def
      join_irreducible_is_join_prime
      join_prime_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> x} \<union> {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> y} \<subseteq> {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> x \<squnion> y}
[PROOF STEP]
using
      le_supI1
      sup.absorb_iff1
      sup.assoc
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?a \<Longrightarrow> ?x \<le> ?a \<squnion> ?b
(?b \<le> ?a) = (?a \<squnion> ?b = ?a)
?a \<squnion> ?b \<squnion> ?c = ?a \<squnion> (?b \<squnion> ?c)

goal (1 subgoal):
 1. {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> x} \<union> {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> y} \<subseteq> {a \<in> {a. a \<noteq> \<bottom> \<and> (\<forall>y z. a \<le> y \<squnion> z \<longrightarrow> a \<le> y \<or> a \<le> z)}. a \<le> x \<squnion> y}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<lbrace> x \<rbrace> \<union> \<lbrace> y \<rbrace> \<subseteq> \<lbrace> x \<squnion> y \<rbrace>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zip_append_0_upt:
  "zip (xs @ ys) [0..<length xs + length ys] =
   zip xs [0..<length xs] @ zip ys [length xs..<length xs + length ys]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip (xs @ ys) [0..<length xs + length ys] = zip xs [0..<length xs] @ zip ys [length xs..<length xs + length ys]
[PROOF STEP]
proof (induct ys arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. zip (xs @ []) [0..<length xs + length []] = zip xs [0..<length xs] @ zip [] [length xs..<length xs + length []]
 2. \<And>a ys xs. (\<And>xs. zip (xs @ ys) [0..<length xs + length ys] = zip xs [0..<length xs] @ zip ys [length xs..<length xs + length ys]) \<Longrightarrow> zip (xs @ a # ys) [0..<length xs + length (a # ys)] = zip xs [0..<length xs] @ zip (a # ys) [length xs..<length xs + length (a # ys)]
[PROOF STEP]
case (Cons y ys)
[PROOF STATE]
proof (state)
this:
zip (?xs @ ys) [0..<length ?xs + length ys] = zip ?xs [0..<length ?xs] @ zip ys [length ?xs..<length ?xs + length ys]

goal (2 subgoals):
 1. \<And>xs. zip (xs @ []) [0..<length xs + length []] = zip xs [0..<length xs] @ zip [] [length xs..<length xs + length []]
 2. \<And>a ys xs. (\<And>xs. zip (xs @ ys) [0..<length xs + length ys] = zip xs [0..<length xs] @ zip ys [length xs..<length xs + length ys]) \<Longrightarrow> zip (xs @ a # ys) [0..<length xs + length (a # ys)] = zip xs [0..<length xs] @ zip (a # ys) [length xs..<length xs + length (a # ys)]
[PROOF STEP]
note ih = this
[PROOF STATE]
proof (state)
this:
zip (?xs @ ys) [0..<length ?xs + length ys] = zip ?xs [0..<length ?xs] @ zip ys [length ?xs..<length ?xs + length ys]

goal (2 subgoals):
 1. \<And>xs. zip (xs @ []) [0..<length xs + length []] = zip xs [0..<length xs] @ zip [] [length xs..<length xs + length []]
 2. \<And>a ys xs. (\<And>xs. zip (xs @ ys) [0..<length xs + length ys] = zip xs [0..<length xs] @ zip ys [length xs..<length xs + length ys]) \<Longrightarrow> zip (xs @ a # ys) [0..<length xs + length (a # ys)] = zip xs [0..<length xs] @ zip (a # ys) [length xs..<length xs + length (a # ys)]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip (xs @ y # ys) [0..<length xs + length (y # ys)] = zip xs [0..<length xs] @ zip (y # ys) [length xs..<length xs + length (y # ys)]
[PROOF STEP]
using ih[of "xs @ [y]"]
[PROOF STATE]
proof (prove)
using this:
zip ((xs @ [y]) @ ys) [0..<length (xs @ [y]) + length ys] = zip (xs @ [y]) [0..<length (xs @ [y])] @ zip ys [length (xs @ [y])..<length (xs @ [y]) + length ys]

goal (1 subgoal):
 1. zip (xs @ y # ys) [0..<length xs + length (y # ys)] = zip xs [0..<length xs] @ zip (y # ys) [length xs..<length xs + length (y # ys)]
[PROOF STEP]
by (simp, cases ys, simp, simp add: upt_rec)
[PROOF STATE]
proof (state)
this:
zip (xs @ y # ys) [0..<length xs + length (y # ys)] = zip xs [0..<length xs] @ zip (y # ys) [length xs..<length xs + length (y # ys)]

goal (1 subgoal):
 1. \<And>xs. zip (xs @ []) [0..<length xs + length []] = zip xs [0..<length xs] @ zip [] [length xs..<length xs + length []]
[PROOF STEP]
qed auto


[STATEMENT]
lemma nonpos_Ints_altdef: "\<int>\<^sub>\<le>\<^sub>0 = {n \<in> \<int>. (n :: 'a :: linordered_idom) \<le> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<int>\<^sub>\<le>\<^sub>0 = {n \<in> \<int>. n \<le> (0::'a)}
[PROOF STEP]
by (auto intro!: nonpos_IntsI elim!: nonpos_Ints_cases)


[STATEMENT]
lemma mintree_exists: "(bq \<noteq> []) = (getMinTree bq \<in> set bq)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bq \<noteq> []) = (getMinTree bq \<in> set bq)
[PROOF STEP]
proof (induct bq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ([] \<noteq> []) = (getMinTree [] \<in> set [])
 2. \<And>a bq. (bq \<noteq> []) = (getMinTree bq \<in> set bq) \<Longrightarrow> (a # bq \<noteq> []) = (getMinTree (a # bq) \<in> set (a # bq))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. ([] \<noteq> []) = (getMinTree [] \<in> set [])
 2. \<And>a bq. (bq \<noteq> []) = (getMinTree bq \<in> set bq) \<Longrightarrow> (a # bq \<noteq> []) = (getMinTree (a # bq) \<in> set (a # bq))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([] \<noteq> []) = (getMinTree [] \<in> set [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
([] \<noteq> []) = (getMinTree [] \<in> set [])

goal (1 subgoal):
 1. \<And>a bq. (bq \<noteq> []) = (getMinTree bq \<in> set bq) \<Longrightarrow> (a # bq \<noteq> []) = (getMinTree (a # bq) \<in> set (a # bq))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a bq. (bq \<noteq> []) = (getMinTree bq \<in> set bq) \<Longrightarrow> (a # bq \<noteq> []) = (getMinTree (a # bq) \<in> set (a # bq))
[PROOF STEP]
case (Cons _ bq)
[PROOF STATE]
proof (state)
this:
(bq \<noteq> []) = (getMinTree bq \<in> set bq)

goal (1 subgoal):
 1. \<And>a bq. (bq \<noteq> []) = (getMinTree bq \<in> set bq) \<Longrightarrow> (a # bq \<noteq> []) = (getMinTree (a # bq) \<in> set (a # bq))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(bq \<noteq> []) = (getMinTree bq \<in> set bq)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(bq \<noteq> []) = (getMinTree bq \<in> set bq)

goal (1 subgoal):
 1. (a_ # bq \<noteq> []) = (getMinTree (a_ # bq) \<in> set (a_ # bq))
[PROOF STEP]
by (cases bq) simp_all
[PROOF STATE]
proof (state)
this:
(a_ # bq \<noteq> []) = (getMinTree (a_ # bq) \<in> set (a_ # bq))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_real_sqrt [tendsto_intros]:
  "(f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. sqrt (f x)) \<longlongrightarrow> sqrt x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. sqrt (f x)) \<longlongrightarrow> sqrt x) F
[PROOF STEP]
unfolding sqrt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> x) F \<Longrightarrow> ((\<lambda>x. root 2 (f x)) \<longlongrightarrow> root 2 x) F
[PROOF STEP]
by (rule tendsto_real_root)


[STATEMENT]
lemma collinear_3_affine_hull:
  assumes "a \<noteq> b"
  shows "collinear {a,b,c} \<longleftrightarrow> c \<in> affine hull {a,b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. collinear {a, b, c} = (c \<in> affine hull {a, b})
[PROOF STEP]
using affine_hull_3_imp_collinear assms collinear_3_imp_in_affine_hull
[PROOF STATE]
proof (prove)
using this:
?c \<in> affine hull {?a, ?b} \<Longrightarrow> collinear {?a, ?b, ?c}
a \<noteq> b
\<lbrakk>collinear {?a, ?b, ?c}; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> ?c \<in> affine hull {?a, ?b}

goal (1 subgoal):
 1. collinear {a, b, c} = (c \<in> affine hull {a, b})
[PROOF STEP]
by blast


[STATEMENT]
lemma Pring_smult_one:
      "!!x. x \<in> carrier (Pring R I) ==> (one R) \<odot>\<^bsub>Pring R I\<^esub> x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (Pring R I) \<Longrightarrow> \<one> \<odot>\<^bsub>Pring R I\<^esub> x = x
[PROOF STEP]
by (simp add: Pring_car Pring_smult poly_scalar_mult_one)


[STATEMENT]
lemma Bseq_mono_convergent: "Bseq X \<Longrightarrow> (\<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n) \<Longrightarrow> convergent X"
  for X :: "nat \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Bseq X; \<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n\<rbrakk> \<Longrightarrow> convergent X
[PROOF STEP]
by (auto intro!: Bseq_monoseq_convergent incseq_imp_monoseq simp: incseq_def)


[STATEMENT]
lemma f_expand_nth_0_upto_k_minus_1_if: "
  \<lbrakk> t < length xs; n = t * k + i; i < k \<rbrakk> \<Longrightarrow>
  (xs \<odot>\<^sub>f k) ! n = (if i = 0 then xs ! t else \<NoMsg>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t < length xs; n = t * k + i; i < k\<rbrakk> \<Longrightarrow> xs \<odot> k ! n = (if i = 0 then xs ! t else NoMsg)
[PROOF STEP]
apply (subst f_expand_nth_if)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>t < length xs; n = t * k + i; i < k\<rbrakk> \<Longrightarrow> n < length xs * k
 2. \<lbrakk>t < length xs; n = t * k + i; i < k\<rbrakk> \<Longrightarrow> (if n mod k = 0 then xs ! (n div k) else NoMsg) = (if i = 0 then xs ! t else NoMsg)
[PROOF STEP]
apply (drule Suc_leI[of t])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>n = t * k + i; i < k; Suc t \<le> length xs\<rbrakk> \<Longrightarrow> n < length xs * k
 2. \<lbrakk>t < length xs; n = t * k + i; i < k\<rbrakk> \<Longrightarrow> (if n mod k = 0 then xs ! (n div k) else NoMsg) = (if i = 0 then xs ! t else NoMsg)
[PROOF STEP]
apply (drule mult_le_mono1[of _ _ k])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>n = t * k + i; i < k; Suc t * k \<le> length xs * k\<rbrakk> \<Longrightarrow> n < length xs * k
 2. \<lbrakk>t < length xs; n = t * k + i; i < k\<rbrakk> \<Longrightarrow> (if n mod k = 0 then xs ! (n div k) else NoMsg) = (if i = 0 then xs ! t else NoMsg)
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma LIMSEQ_imp_Suc: "(\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l \<Longrightarrow> f \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l \<Longrightarrow> f \<longlonglongrightarrow> l
[PROOF STEP]
by (rule LIMSEQ_offset [where k="Suc 0"]) simp


[STATEMENT]
lemma distinct_map_fst_snd_eqD:
  "distinct (map fst xs) \<Longrightarrow> (i, a) \<in> set xs \<Longrightarrow> (i, b) \<in> set xs \<Longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct (map fst xs); (i, a) \<in> set xs; (i, b) \<in> set xs\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
by (metis (lifting) map_of_is_SomeI option.inject)


[STATEMENT]
lemma N_alt_def_dim: "N = mat \<v> \<b> (\<lambda> (i,j) . if (incident (\<V>s ! i) (\<B>s ! j)) then 1 else 0) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N = mat \<v> \<b> (\<lambda>(i, j). if incident (\<V>s ! i) (\<B>s ! j) then 1 else 0)
[PROOF STEP]
using incidence_cond_indexed inc_mat_of_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < \<v>; ?j < \<b>\<rbrakk> \<Longrightarrow> incident (\<V>s ! ?i) (\<B>s ! ?j) = (\<V>s ! ?i \<in> \<B>s ! ?j)
inc_mat_of ?Vs ?Bs \<equiv> mat (length ?Vs) (length ?Bs) (\<lambda>(i, j). if ?Vs ! i \<in> ?Bs ! j then 1::?'b else (0::?'b))

goal (1 subgoal):
 1. N = mat \<v> \<b> (\<lambda>(i, j). if incident (\<V>s ! i) (\<B>s ! j) then 1 else 0)
[PROOF STEP]
by (intro eq_matI) (simp_all add: inc_mat_dim_row inc_mat_dim_col inc_matrix_point_in_block_one
      inc_matrix_point_not_in_block_zero points_list_length)


[STATEMENT]
lemma cong_diff_nat:
  "[a - c = b - d] (mod m)" if "[a = b] (mod m)" "[c = d] (mod m)"
    and "a \<ge> c" "b \<ge> d" for a b c d m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a - c = b - d] (mod m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [a - c = b - d] (mod m)
[PROOF STEP]
have "[c + (a - c) = d + (b - d)] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [c + (a - c) = d + (b - d)] (mod m)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
[a = b] (mod m)
[c = d] (mod m)
c \<le> a
d \<le> b

goal (1 subgoal):
 1. [c + (a - c) = d + (b - d)] (mod m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[c + (a - c) = d + (b - d)] (mod m)

goal (1 subgoal):
 1. [a - c = b - d] (mod m)
[PROOF STEP]
with \<open>[c = d] (mod m)\<close>
[PROOF STATE]
proof (chain)
picking this:
[c = d] (mod m)
[c + (a - c) = d + (b - d)] (mod m)
[PROOF STEP]
have "[c + (a - c) = c + (b - d)] (mod m)"
[PROOF STATE]
proof (prove)
using this:
[c = d] (mod m)
[c + (a - c) = d + (b - d)] (mod m)

goal (1 subgoal):
 1. [c + (a - c) = c + (b - d)] (mod m)
[PROOF STEP]
using mod_add_cong
[PROOF STATE]
proof (prove)
using this:
[c = d] (mod m)
[c + (a - c) = d + (b - d)] (mod m)
\<lbrakk>?a mod ?c = ?a' mod ?c; ?b mod ?c = ?b' mod ?c\<rbrakk> \<Longrightarrow> (?a + ?b) mod ?c = (?a' + ?b') mod ?c

goal (1 subgoal):
 1. [c + (a - c) = c + (b - d)] (mod m)
[PROOF STEP]
by (auto simp add: cong_def) fastforce
[PROOF STATE]
proof (state)
this:
[c + (a - c) = c + (b - d)] (mod m)

goal (1 subgoal):
 1. [a - c = b - d] (mod m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[c + (a - c) = c + (b - d)] (mod m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[c + (a - c) = c + (b - d)] (mod m)

goal (1 subgoal):
 1. [a - c = b - d] (mod m)
[PROOF STEP]
by (simp add: cong_def nat_mod_eq_iff)
[PROOF STATE]
proof (state)
this:
[a - c = b - d] (mod m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nths'_back: "\<lbrakk> i < j; j \<le> length xs \<rbrakk> \<Longrightarrow> nths' i j xs = nths' i (j - 1) xs @ [xs ! (j - 1)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < j; j \<le> length xs\<rbrakk> \<Longrightarrow> nths' i j xs = nths' i (j - 1) xs @ [xs ! (j - 1)]
[PROOF STEP]
apply (induct xs arbitrary: i j)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < j; j \<le> length []\<rbrakk> \<Longrightarrow> nths' i j [] = nths' i (j - 1) [] @ [[] ! (j - 1)]
 2. \<And>a xs i j. \<lbrakk>\<And>i j. \<lbrakk>i < j; j \<le> length xs\<rbrakk> \<Longrightarrow> nths' i j xs = nths' i (j - 1) xs @ [xs ! (j - 1)]; i < j; j \<le> length (a # xs)\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = nths' i (j - 1) (a # xs) @ [(a # xs) ! (j - 1)]
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i j. \<lbrakk>\<And>i j. \<lbrakk>i < j; j \<le> length xs\<rbrakk> \<Longrightarrow> nths' i j xs = nths' i (j - 1) xs @ [xs ! (j - 1)]; i < j; j \<le> length (a # xs)\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = nths' i (j - 1) (a # xs) @ [(a # xs) ! (j - 1)]
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_frac:
  fixes x::real
  assumes "x \<notin> \<int>"
  shows "continuous (at x) frac"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
have "isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x
[PROOF STEP]
using continuous_floor [OF assms]
[PROOF STATE]
proof (prove)
using this:
isCont (real_of_int \<circ> floor) x

goal (1 subgoal):
 1. isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x
[PROOF STEP]
have *: "continuous (at x) (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>)"
[PROOF STATE]
proof (prove)
using this:
isCont (\<lambda>x. real_of_int \<lfloor>x\<rfloor>) x

goal (1 subgoal):
 1. isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
have "\<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>
[PROOF STEP]
by (simp add: frac_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x
\<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isCont (\<lambda>x. x - real_of_int \<lfloor>x\<rfloor>) x
\<forall>\<^sub>F x in nhds x. frac x = x - real_of_int \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. isCont frac x
[PROOF STEP]
by (simp add: LIM_imp_LIM frac_def isCont_def)
[PROOF STATE]
proof (state)
this:
isCont frac x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalize_summation :
  assumes nonzero : "(B::real)\<noteq>0"
  shows "(\<Sum>i = 0..<n+1. f i * B ^ (n - i))= 0
          \<longleftrightarrow>
  (\<Sum>i = 0..<(n::nat)+1. (f i::real) / (B ^ i)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)
[PROOF STEP]
have pow_zero : "\<forall>i. B^(i :: nat)\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. B ^ i \<noteq> 0
[PROOF STEP]
using nonzero
[PROOF STATE]
proof (prove)
using this:
B \<noteq> 0

goal (1 subgoal):
 1. \<forall>i. B ^ i \<noteq> 0
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
\<forall>i. B ^ i \<noteq> 0

goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)
[PROOF STEP]
have single_division_zero : "\<forall>X. B*(X::real)=0 \<longleftrightarrow> X=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>X. (B * X = 0) = (X = 0)
[PROOF STEP]
using nonzero
[PROOF STATE]
proof (prove)
using this:
B \<noteq> 0

goal (1 subgoal):
 1. \<forall>X. (B * X = 0) = (X = 0)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
\<forall>X. (B * X = 0) = (X = 0)

goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)
[PROOF STEP]
have h1: "(\<Sum>i = 0..<n+1. (f i) / (B ^ i)) = 0 \<longleftrightarrow> ((\<Sum>i = 0..<n+1. (f i) / (B ^ i)))*B^n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) * B ^ n = 0)
[PROOF STEP]
using nonzero single_division_zero
[PROOF STATE]
proof (prove)
using this:
B \<noteq> 0
\<forall>X. (B * X = 0) = (X = 0)

goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) * B ^ n = 0)
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) * B ^ n = 0)

goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)
[PROOF STEP]
have h2: "((\<Sum>i = 0..<n+1. (f i) / (B ^ i))*(B^n)) = ((\<Sum>i = 0..<n+1. (f i) * (B ^ (n- i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n + 1. f i / B ^ i) * B ^ n = (\<Sum>i = 0..<n + 1. f i * B ^ (n - i))
[PROOF STEP]
using summation_normalized nonzero
[PROOF STATE]
proof (prove)
using this:
?B \<noteq> 0 \<Longrightarrow> (\<Sum>i = 0..<?n + 1. ?f i * ?B ^ (?n - i)) = (\<Sum>i = 0..<?n + 1. ?f i / ?B ^ i) * ?B ^ ?n
B \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>i = 0..<n + 1. f i / B ^ i) * B ^ n = (\<Sum>i = 0..<n + 1. f i * B ^ (n - i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n + 1. f i / B ^ i) * B ^ n = (\<Sum>i = 0..<n + 1. f i * B ^ (n - i))

goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)
[PROOF STEP]
using h1 h2
[PROOF STATE]
proof (prove)
using this:
((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) * B ^ n = 0)
(\<Sum>i = 0..<n + 1. f i / B ^ i) * B ^ n = (\<Sum>i = 0..<n + 1. f i * B ^ (n - i))

goal (1 subgoal):
 1. ((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<Sum>i = 0..<n + 1. f i * B ^ (n - i)) = 0) = ((\<Sum>i = 0..<n + 1. f i / B ^ i) = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_del:
 "sorted(inorder t) \<Longrightarrow>  inorder(del x t) = del_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (RBT_Set2.del x t) = del_list x (Tree2.inorder t)
[PROOF STEP]
by(induction x t rule: del.induct)
  (auto simp: del_list_simps inorder_baldL inorder_baldR split_minD split: prod.splits)


[STATEMENT]
lemma count_prime_factorization:
  "count (prime_factorization x) p = (if prime p then multiplicity p x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (prime_factorization x) p = (if prime p then multiplicity p x else 0)
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma subst_pp_by_monomials:
  assumes "\<And>y. y \<in> keys t \<Longrightarrow> f y = monomial (c y) (s y)"
  shows "subst_pp f t = monomial (\<Prod>y\<in>keys t. (c y) ^ lookup t y) (\<Sum>y\<in>keys t. lookup t y \<cdot> s y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_pp f t = monomial (\<Prod>y\<in>keys t. c y ^ lookup t y) (\<Sum>y\<in>keys t. lookup t y \<cdot> s y)
[PROOF STEP]
by (simp add: subst_pp_def assms monomial_power_map_scale punit.monomial_prod_sum)


[STATEMENT]
lemma map_sq_matrix_compose[simp]: "map_sq_matrix f (map_sq_matrix g M) = map_sq_matrix (\<lambda>x. f (g x)) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_sq_matrix f (map_sq_matrix g M) = map_sq_matrix (\<lambda>x. f (g x)) M
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma ereal_0_le_uminus_iff[simp]:
  fixes a :: ereal
  shows "0 \<le> - a \<longleftrightarrow> a \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> - a) = (a \<le> 0)
[PROOF STEP]
by (cases rule: ereal2_cases[of a]) auto


[STATEMENT]
lemma lfp_upperbound: "(\<And>y. x \<le> f y) \<Longrightarrow> x \<le> lfp f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. x \<le> f y) \<Longrightarrow> x \<le> lfp f
[PROOF STEP]
unfolding lfp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. x \<le> f y) \<Longrightarrow> x \<le> \<Sqinter> {u. f u \<le> u}
[PROOF STEP]
by (intro Inf_greatest) (auto intro: order_trans)


[STATEMENT]
theorem set_of_insert:
  "avl t \<Longrightarrow> set_of(insert x t) = Set.insert x (set_of t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. avl t \<Longrightarrow> set_of (AVL.insert x t) = Set.insert x (set_of t)
[PROOF STEP]
by (induct t)
   (auto simp: avl_insert set_of_mkt_bal_l set_of_mkt_bal_r simp del:mkt_bal_l.simps mkt_bal_r.simps)


[STATEMENT]
lemma finite_wf_eq_wf_converse: "finite R \<Longrightarrow> wf (R\<inverse>) \<longleftrightarrow> wf R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite R \<Longrightarrow> wf (R\<inverse>) = wf R
[PROOF STEP]
by (metis acyclic_converse finite_acyclic_wf finite_acyclic_wf_converse wf_acyclic)


[STATEMENT]
lemma algebraic_sum_mset [intro]:
  "(\<And>x. x \<in># A \<Longrightarrow> algebraic x) \<Longrightarrow> algebraic (sum_mset A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in># A \<Longrightarrow> algebraic x) \<Longrightarrow> algebraic (\<Sum>\<^sub># A)
[PROOF STEP]
by (induction A) (auto intro!: algebraic_plus)


[STATEMENT]
lemma funcset_compose: "f \<in> A \<rightarrow> B \<Longrightarrow> g \<in> B \<rightarrow> C \<Longrightarrow> compose A g f \<in> A \<rightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; g \<in> B \<rightarrow> C\<rbrakk> \<Longrightarrow> compose A g f \<in> A \<rightarrow> C
[PROOF STEP]
by (simp add: Pi_def compose_def restrict_def)


[STATEMENT]
lemma  X_I_carrier:
  shows "X_I \<in> carrier_mat 4 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X_I \<in> carrier_mat 4 4
[PROOF STEP]
using tensor_mat_carrier X_carrier
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
X \<in> carrier_mat 2 2

goal (1 subgoal):
 1. X_I \<in> carrier_mat 4 4
[PROOF STEP]
unfolding X_I_def
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
X \<in> carrier_mat 2 2

goal (1 subgoal):
 1. X \<Otimes> 1\<^sub>m 2 \<in> carrier_mat 4 4
[PROOF STEP]
by auto


[STATEMENT]
lemma insertion_powsum_mpoly [simp]: "insertion f (powsum_mpoly X k) = (\<Sum>i\<in>X. f i ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (powsum_mpoly X k) = (\<Sum>i\<in>X. f i ^ k)
[PROOF STEP]
unfolding powsum_mpoly_altdef insertion_sum insertion_single
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. (1::'a) * f x ^ k) = (\<Sum>i\<in>X. f i ^ k)
[PROOF STEP]
by simp


[STATEMENT]
theorem delete_list_set:
  assumes "sorted_less xs"
  shows "delete_list x xs = del_list x xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. delete_list x xs = del_list x xs
[PROOF STEP]
using assms split_list_conc[of xs x]
[PROOF STATE]
proof (prove)
using this:
sorted_less xs
split_list xs x = (?kls, ?krs) \<Longrightarrow> xs = ?kls @ ?krs

goal (1 subgoal):
 1. delete_list x xs = del_list x xs
[PROOF STEP]
using delete_sorted_split_list[of xs x]
[PROOF STATE]
proof (prove)
using this:
sorted_less xs
split_list xs x = (?kls, ?krs) \<Longrightarrow> xs = ?kls @ ?krs
\<lbrakk>sorted_less xs; split_list xs x = (?ls, ?rs)\<rbrakk> \<Longrightarrow> del_list x xs = ?ls @ del_list x ?rs

goal (1 subgoal):
 1. delete_list x xs = del_list x xs
[PROOF STEP]
using delete_sorted_split_list_right[of xs x]
[PROOF STATE]
proof (prove)
using this:
sorted_less xs
split_list xs x = (?kls, ?krs) \<Longrightarrow> xs = ?kls @ ?krs
\<lbrakk>sorted_less xs; split_list xs x = (?ls, ?rs)\<rbrakk> \<Longrightarrow> del_list x xs = ?ls @ del_list x ?rs
\<lbrakk>split_list xs x = (?ls, ?sep # ?rs); sorted_less xs; x \<noteq> ?sep\<rbrakk> \<Longrightarrow> del_list x (?sep # ?rs) = ?sep # ?rs

goal (1 subgoal):
 1. delete_list x xs = del_list x xs
[PROOF STEP]
by (auto split!: list.splits prod.splits)


[STATEMENT]
lemma distribute_rely_choice:
  assumes nonabort_i: "chaos \<sqsubseteq>  i"
  shows "(c \<sqinter> d) // i  \<sqsubseteq>  (c // i) \<sqinter> (d // i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<sqinter> d) // i \<sqsubseteq> c // i \<sqinter> d // i
variables:
c, d, i :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (c \<sqinter> d) // i \<sqsubseteq> c // i \<sqinter> d // i
variables:
c, d, i :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "c \<sqinter> d \<sqsubseteq> ((c // i) \<parallel> i) \<sqinter> ((d // i) \<parallel> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<sqinter> d \<sqsubseteq> c // i \<parallel> i \<sqinter> d // i \<parallel> i
variables:
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, i :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis nonabort_i inf_mono rely_quotient)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice) \<sqinter> (d::'a::refinement_lattice) \<sqsubseteq> c // (i::'a::refinement_lattice) \<parallel> i \<sqinter> d // i \<parallel> i

goal (1 subgoal):
 1. (c \<sqinter> d) // i \<sqsubseteq> c // i \<sqinter> d // i
variables:
c, d, i :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(c::'a::refinement_lattice) \<sqinter> (d::'a::refinement_lattice) \<sqsubseteq> c // (i::'a::refinement_lattice) \<parallel> i \<sqinter> d // i \<parallel> i
[PROOF STEP]
have "c \<sqinter> d \<sqsubseteq> ((c // i) \<sqinter> (d // i)) \<parallel> i"
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice) \<sqinter> (d::'a::refinement_lattice) \<sqsubseteq> c // (i::'a::refinement_lattice) \<parallel> i \<sqinter> d // i \<parallel> i

goal (1 subgoal):
 1. c \<sqinter> d \<sqsubseteq> (c // i \<sqinter> d // i) \<parallel> i
variables:
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, i :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis inf_par_distrib)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice) \<sqinter> (d::'a::refinement_lattice) \<sqsubseteq> (c // (i::'a::refinement_lattice) \<sqinter> d // i) \<parallel> i

goal (1 subgoal):
 1. (c \<sqinter> d) // i \<sqsubseteq> c // i \<sqinter> d // i
variables:
c, d, i :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice) \<sqinter> (d::'a::refinement_lattice) \<sqsubseteq> (c // (i::'a::refinement_lattice) \<sqinter> d // i) \<parallel> i

goal (1 subgoal):
 1. (c \<sqinter> d) // i \<sqsubseteq> c // i \<sqinter> d // i
variables:
c, d, i :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis nonabort_i rely_refinement)
[PROOF STATE]
proof (state)
this:
((c::'a::refinement_lattice) \<sqinter> (d::'a::refinement_lattice)) // (i::'a::refinement_lattice) \<sqsubseteq> c // i \<sqinter> d // i

goal:
No subgoals!
variables:
c, d, i :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma plus_mat0[simp]: assumes wf: "mat nr nc m" shows "mat_plus m (mat0 nr nc) = m" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_plus m (mat0 nr nc) = m
[PROOF STEP]
proof (rule mat_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus m (mat0 nr nc))
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus m (mat0 nr nc) ! i ! j = m ! i ! j
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus m (mat0 nr nc))
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus m (mat0 nr nc) ! i ! j = m ! i ! j
[PROOF STEP]
assume "i < nc" "j < nr"
[PROOF STATE]
proof (state)
this:
i < nc
j < nr

goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus m (mat0 nr nc))
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus m (mat0 nr nc) ! i ! j = m ! i ! j
[PROOF STEP]
note [simp] = mat_plus_index[OF _ _ this] mat0_index[OF this]
[PROOF STATE]
proof (state)
this:
\<lbrakk>mat nr nc ?m1.0; mat nr nc ?m2.0\<rbrakk> \<Longrightarrow> mat_plusI ?pl ?m1.0 ?m2.0 ! i ! j = ?pl (?m1.0 ! i ! j) (?m2.0 ! i ! j)
mat0I ?ze nr nc ! i ! j = ?ze

goal (3 subgoals):
 1. mat ?nr ?nc (mat_plus m (mat0 nr nc))
 2. mat ?nr ?nc m
 3. \<And>i j. \<lbrakk>i < ?nc; j < ?nr\<rbrakk> \<Longrightarrow> mat_plus m (mat0 nr nc) ! i ! j = m ! i ! j
[PROOF STEP]
show "?l ! i ! j = ?r ! i ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_plus m (mat0 nr nc) ! i ! j = m ! i ! j
[PROOF STEP]
using wf
[PROOF STATE]
proof (prove)
using this:
mat nr nc m

goal (1 subgoal):
 1. mat_plus m (mat0 nr nc) ! i ! j = m ! i ! j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_plus m (mat0 nr nc) ! i ! j = m ! i ! j

goal (2 subgoals):
 1. mat nr nc (mat_plus m (mat0 nr nc))
 2. mat nr nc m
[PROOF STEP]
qed (insert wf, auto)


[STATEMENT]
lemma rref_suc_if_all_rows_not_zero:
  fixes A::"'a::{one, zero}^'n::{mod_type}^'m::{finite,one,plus,linorder}"
  assumes r: "reduced_row_echelon_form_upt_k A k"
  and all_not_zero: "\<forall>n. \<not> is_zero_row_upt_k n k A"
  shows "reduced_row_echelon_form_upt_k A (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduced_row_echelon_form_upt_k A (Suc k)
[PROOF STEP]
proof (rule rref_suc_if_zero_below_greatest)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. reduced_row_echelon_form_upt_k A k
 2. \<not> (\<forall>a. is_zero_row_upt_k a k A)
 3. \<forall>a>GREATEST m. \<not> is_zero_row_upt_k m k A. is_zero_row_upt_k a (Suc k) A
[PROOF STEP]
show "reduced_row_echelon_form_upt_k A k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduced_row_echelon_form_upt_k A k
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
reduced_row_echelon_form_upt_k A k

goal (1 subgoal):
 1. reduced_row_echelon_form_upt_k A k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
reduced_row_echelon_form_upt_k A k

goal (2 subgoals):
 1. \<not> (\<forall>a. is_zero_row_upt_k a k A)
 2. \<forall>a>GREATEST m. \<not> is_zero_row_upt_k m k A. is_zero_row_upt_k a (Suc k) A
[PROOF STEP]
show "\<not> (\<forall>a. is_zero_row_upt_k a k A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<forall>a. is_zero_row_upt_k a k A)
[PROOF STEP]
using all_not_zero
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<not> is_zero_row_upt_k n k A

goal (1 subgoal):
 1. \<not> (\<forall>a. is_zero_row_upt_k a k A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>a. is_zero_row_upt_k a k A)

goal (1 subgoal):
 1. \<forall>a>GREATEST m. \<not> is_zero_row_upt_k m k A. is_zero_row_upt_k a (Suc k) A
[PROOF STEP]
show "\<forall>a>GREATEST m. \<not> is_zero_row_upt_k m k A. is_zero_row_upt_k a (Suc k) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a>GREATEST m. \<not> is_zero_row_upt_k m k A. is_zero_row_upt_k a (Suc k) A
[PROOF STEP]
using all_not_zero not_greater_Greatest
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<not> is_zero_row_upt_k n k A
(GREATEST x. ?P x) < ?k \<Longrightarrow> \<not> ?P ?k

goal (1 subgoal):
 1. \<forall>a>GREATEST m. \<not> is_zero_row_upt_k m k A. is_zero_row_upt_k a (Suc k) A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>a>GREATEST m. \<not> is_zero_row_upt_k m k A. is_zero_row_upt_k a (Suc k) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "rec_Y a b c d e f (E y) = e y (rec_Y a b c d e f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_Y a b c d e f (Y.E y) = e y (rec_Y a b c d e f y)
[PROOF STEP]
nitpick [card = 1-5, expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_Y a b c d e f (Y.E y) = e y (rec_Y a b c d e f y)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pairwise_orthogonal_insert:
  assumes "pairwise orthogonal S"
    and "\<And>y. y \<in> S \<Longrightarrow> orthogonal x y"
  shows "pairwise orthogonal (insert x S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise orthogonal (insert x S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pairwise orthogonal S
?y \<in> S \<Longrightarrow> orthogonal x ?y

goal (1 subgoal):
 1. pairwise orthogonal (insert x S)
[PROOF STEP]
unfolding pairwise_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<forall>y\<in>S. x \<noteq> y \<longrightarrow> orthogonal x y
?y \<in> S \<Longrightarrow> orthogonal x ?y

goal (1 subgoal):
 1. \<forall>xa\<in>insert x S. \<forall>y\<in>insert x S. xa \<noteq> y \<longrightarrow> orthogonal xa y
[PROOF STEP]
by (auto simp add: orthogonal_commute)


[STATEMENT]
lemma bounded_induct:
     "[| wf r;
         \<forall>m \<in> I. F \<in> (A \<inter> f-`{m}) leadsTo
                      ((A \<inter> f-`(r\<inverse> `` {m})) \<union> B) |]
      ==> F \<in> A leadsTo ((A - (f-`I)) \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf r; \<forall>m\<in>I. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` r\<inverse> `` {m} \<union> B\<rbrakk> \<Longrightarrow> F \<in> A \<longmapsto> A - f -` I \<union> B
[PROOF STEP]
apply (erule leadsTo_wf_induct, safe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<forall>m\<in>I. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` r\<inverse> `` {m} \<union> B \<Longrightarrow> F \<in> A \<inter> ?f -` {m} \<longmapsto> A \<inter> ?f -` r\<inverse> `` {m} \<union> (A - f -` I \<union> B)
[PROOF STEP]
apply (case_tac "m \<in> I")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. \<lbrakk>\<forall>m\<in>I. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` r\<inverse> `` {m} \<union> B; m \<in> I\<rbrakk> \<Longrightarrow> F \<in> A \<inter> ?f -` {m} \<longmapsto> A \<inter> ?f -` r\<inverse> `` {m} \<union> (A - f -` I \<union> B)
 2. \<And>m. \<lbrakk>\<forall>m\<in>I. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` r\<inverse> `` {m} \<union> B; m \<notin> I\<rbrakk> \<Longrightarrow> F \<in> A \<inter> ?f -` {m} \<longmapsto> A \<inter> ?f -` r\<inverse> `` {m} \<union> (A - f -` I \<union> B)
[PROOF STEP]
apply (blast intro: leadsTo_weaken)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<forall>m\<in>I. F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` r\<inverse> `` {m} \<union> B; m \<notin> I\<rbrakk> \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto> A \<inter> f -` r\<inverse> `` {m} \<union> (A - f -` I \<union> B)
[PROOF STEP]
apply (blast intro: subset_imp_leadsTo)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma InternalSets_Un: "X \<in> InternalSets \<Longrightarrow> Y \<in> InternalSets \<Longrightarrow> X \<union> Y \<in> InternalSets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> InternalSets; Y \<in> InternalSets\<rbrakk> \<Longrightarrow> X \<union> Y \<in> InternalSets
[PROOF STEP]
by (auto simp add: InternalSets_def starset_n_Un [symmetric])


[STATEMENT]
lemma list_all2_flip [flip_simps]: "list_all2 (flip P) xs ys = list_all2 P ys xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (flip P) xs ys = list_all2 P ys xs
[PROOF STEP]
unfolding flip_def list_all2_conv_all_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = length ys \<and> (\<forall>i<length xs. P (ys ! i) (xs ! i))) = (length ys = length xs \<and> (\<forall>i<length ys. P (ys ! i) (xs ! i)))
[PROOF STEP]
by auto


[STATEMENT]
lemma cblinfun_eq_on_UNIV_span:
  fixes basis::"'a::complex_normed_vector set" and \<phi>::"'a \<Rightarrow> 'b::complex_normed_vector"
  assumes "cspan basis = UNIV"
    and "\<And>s. s\<in>basis \<Longrightarrow> F *\<^sub>V s = G *\<^sub>V s"
  shows \<open>F = G\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = G
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F = G
[PROOF STEP]
have "F - G = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F - G = 0
[PROOF STEP]
apply (rule cblinfun_eq_0_on_UNIV_span[where basis=basis])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. cspan basis = UNIV
 2. \<And>s. s \<in> basis \<Longrightarrow> (F - G) *\<^sub>V s = (0::'c)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cspan basis = UNIV
?s \<in> basis \<Longrightarrow> F *\<^sub>V ?s = G *\<^sub>V ?s

goal (2 subgoals):
 1. cspan basis = UNIV
 2. \<And>s. s \<in> basis \<Longrightarrow> (F - G) *\<^sub>V s = (0::'c)
[PROOF STEP]
by (auto simp add: cblinfun.diff_left)
[PROOF STATE]
proof (state)
this:
F - G = 0

goal (1 subgoal):
 1. F = G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
F - G = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lessThan_insert: "insert (n::'a::order) {..<n} = {..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert n {..<n} = {..n}
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (x \<in> insert n {..<n}) = (x \<in> {..n})
[PROOF STEP]
apply (clarsimp simp add: order_le_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (x = n \<or> x < n) = (x < n \<or> x = n)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma complex_mat_char_poly_factorizable:
  fixes A :: "complex mat"
  assumes "A \<in> carrier_mat n n"
  shows "\<exists>as. char_poly A =  (\<Prod> a \<leftarrow> as. [:- a, 1:]) \<and> length as = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
let ?ca = "char_poly A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
have ex0: "\<exists>bs. Polynomial.smult (lead_coeff ?ca) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = ?ca \<and>
     length bs = degree ?ca"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>bs. Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A)
[PROOF STEP]
by (simp add: fundamental_theorem_algebra_factorized)
[PROOF STATE]
proof (state)
this:
\<exists>bs. Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A)

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>bs. Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A)
[PROOF STEP]
obtain bs where " Polynomial.smult (lead_coeff ?ca) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = ?ca \<and>
     length bs = degree ?ca"
[PROOF STATE]
proof (prove)
using this:
\<exists>bs. Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A)

goal (1 subgoal):
 1. (\<And>bs. Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A)

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A)

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
have "lead_coeff ?ca = (1::complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (char_poly A)
[PROOF STEP]
using assms degree_monic_char_poly
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
?A \<in> carrier_mat ?n ?n \<Longrightarrow> degree (char_poly ?A) = ?n \<and> coeff (char_poly ?A) ?n = (1::?'a)

goal (1 subgoal):
 1. monic (char_poly A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
monic (char_poly A)

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A)
monic (char_poly A)
[PROOF STEP]
have ex1: "?ca = (\<Prod>b\<leftarrow>bs. [:- b, 1:]) \<and> length bs = degree ?ca"
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>b\<leftarrow>bs. [:- b, 1:]) = char_poly A \<and> length bs = degree (char_poly A)
monic (char_poly A)

goal (1 subgoal):
 1. char_poly A = (\<Prod>b\<leftarrow>bs. [:- b, 1:]) \<and> length bs = degree (char_poly A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
char_poly A = (\<Prod>b\<leftarrow>bs. [:- b, 1:]) \<and> length bs = degree (char_poly A)

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
char_poly A = (\<Prod>b\<leftarrow>bs. [:- b, 1:]) \<and> length bs = degree (char_poly A)

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
have "degree ?ca = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (char_poly A) = n
[PROOF STEP]
by (simp add: assms degree_monic_char_poly)
[PROOF STATE]
proof (state)
this:
degree (char_poly A) = n

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
char_poly A = (\<Prod>b\<leftarrow>bs. [:- b, 1:]) \<and> length bs = degree (char_poly A)
degree (char_poly A) = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
char_poly A = (\<Prod>b\<leftarrow>bs. [:- b, 1:]) \<and> length bs = degree (char_poly A)
degree (char_poly A) = n

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma log_less_one_cancel_iff[simp]: "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> log a x < 1 \<longleftrightarrow> x < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (log a x < 1) = (x < a)
[PROOF STEP]
using log_less_cancel_iff[of a x a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < x; 0 < a\<rbrakk> \<Longrightarrow> (log a x < log a a) = (x < a)

goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (log a x < 1) = (x < a)
[PROOF STEP]
by simp


[STATEMENT]
lemma elems_mat_setv_row_0m: "i < dim_row M \<Longrightarrow> elements_mat M \<subseteq> {0..<m} \<Longrightarrow> set\<^sub>v (row M i) \<subseteq> {0..<m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < dim_row M; elements_mat M \<subseteq> {0..<m}\<rbrakk> \<Longrightarrow> set\<^sub>v (row M i) \<subseteq> {0..<m}
[PROOF STEP]
by (metis row_elems_subset_mat subset_trans)


[STATEMENT]
lemma kernel_coreflexive_idempotent_up_closed:
  "kernel x \<longleftrightarrow> coreflexive x \<and> idempotent x \<and> up_closed x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kernel x = (coreflexive x \<and> idempotent x \<and> up_closed x)
[PROOF STEP]
by (metis kernel_coreflexive kernel_def kernel_idempotent inf.absorb1 up_closed_def)


[STATEMENT]
lemma Sum_any_zeroI': "(\<And>x. P x \<Longrightarrow> f x = 0) \<Longrightarrow> Sum_any (\<lambda>x. f x when P x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. P x \<Longrightarrow> f x = (0::'b)) \<Longrightarrow> (\<Sum>x. f x when P x) = (0::'b)
[PROOF STEP]
by (auto simp: Sum_any.expand_set)