[STATEMENT]
lemma llength_least_None:
  assumes rA: "r \<in> A\<^sup>\<star>"
  shows "llength r = (LEAST i. r!!i = None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LList2.llength r = (LEAST i. r !! i = None)
[PROOF STEP]
using rA
[PROOF STATE]
proof (prove)
using this:
r \<in> A\<^sup>\<star>

goal (1 subgoal):
 1. LList2.llength r = (LEAST i. r !! i = None)
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>l. l = LNil \<Longrightarrow> LList2.llength l = (LEAST i. l !! i = None)
 2. \<And>a l. \<lbrakk>l \<in> A\<^sup>\<star>; LList2.llength l = (LEAST i. l !! i = None); a \<in> A\<rbrakk> \<Longrightarrow> LList2.llength (a ## l) = (LEAST i. (a ## l) !! i = None)
[PROOF STEP]
case LNil_fin
[PROOF STATE]
proof (state)
this:
l_ = LNil

goal (2 subgoals):
 1. \<And>l. l = LNil \<Longrightarrow> LList2.llength l = (LEAST i. l !! i = None)
 2. \<And>a l. \<lbrakk>l \<in> A\<^sup>\<star>; LList2.llength l = (LEAST i. l !! i = None); a \<in> A\<rbrakk> \<Longrightarrow> LList2.llength (a ## l) = (LEAST i. (a ## l) !! i = None)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
l_ = LNil

goal (1 subgoal):
 1. LList2.llength l_ = (LEAST i. l_ !! i = None)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LList2.llength l_ = (LEAST i. l_ !! i = None)

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>l \<in> A\<^sup>\<star>; LList2.llength l = (LEAST i. l !! i = None); a \<in> A\<rbrakk> \<Longrightarrow> LList2.llength (a ## l) = (LEAST i. (a ## l) !! i = None)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l. \<lbrakk>l \<in> A\<^sup>\<star>; LList2.llength l = (LEAST i. l !! i = None); a \<in> A\<rbrakk> \<Longrightarrow> LList2.llength (a ## l) = (LEAST i. (a ## l) !! i = None)
[PROOF STEP]
case (LCons_fin a l)
[PROOF STATE]
proof (state)
this:
l \<in> A\<^sup>\<star>
LList2.llength l = (LEAST i. l !! i = None)
a \<in> A

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>l \<in> A\<^sup>\<star>; LList2.llength l = (LEAST i. l !! i = None); a \<in> A\<rbrakk> \<Longrightarrow> LList2.llength (a ## l) = (LEAST i. (a ## l) !! i = None)
[PROOF STEP]
hence "(LEAST i. (a ## l) !! i = None) = llength (a ## l)"
[PROOF STATE]
proof (prove)
using this:
l \<in> A\<^sup>\<star>
LList2.llength l = (LEAST i. l !! i = None)
a \<in> A

goal (1 subgoal):
 1. (LEAST i. (a ## l) !! i = None) = LList2.llength (a ## l)
[PROOF STEP]
by (auto intro!: ll2f_llength Least_Suc2)
[PROOF STATE]
proof (state)
this:
(LEAST i. (a ## l) !! i = None) = LList2.llength (a ## l)

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>l \<in> A\<^sup>\<star>; LList2.llength l = (LEAST i. l !! i = None); a \<in> A\<rbrakk> \<Longrightarrow> LList2.llength (a ## l) = (LEAST i. (a ## l) !! i = None)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(LEAST i. (a ## l) !! i = None) = LList2.llength (a ## l)

goal (1 subgoal):
 1. LList2.llength (a ## l) = (LEAST i. (a ## l) !! i = None)
[PROOF STEP]
by rule
[PROOF STATE]
proof (state)
this:
LList2.llength (a ## l) = (LEAST i. (a ## l) !! i = None)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dotprod_pointwise_le:
  assumes "length as = length xs"
    and "i < length as"
  shows "as ! i * xs ! i \<le> as \<bullet> xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. as ! i * xs ! i \<le> as \<bullet> xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. as ! i * xs ! i \<le> as \<bullet> xs
[PROOF STEP]
have "as \<bullet> xs = (\<Sum>i<min (length as) (length xs). as ! i * xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. as \<bullet> xs = (\<Sum>i<min (length as) (length xs). as ! i * xs ! i)
[PROOF STEP]
by (simp add: dotprod_def)
[PROOF STATE]
proof (state)
this:
as \<bullet> xs = (\<Sum>i<min (length as) (length xs). as ! i * xs ! i)

goal (1 subgoal):
 1. as ! i * xs ! i \<le> as \<bullet> xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
as \<bullet> xs = (\<Sum>i<min (length as) (length xs). as ! i * xs ! i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
as \<bullet> xs = (\<Sum>i<min (length as) (length xs). as ! i * xs ! i)

goal (1 subgoal):
 1. as ! i * xs ! i \<le> as \<bullet> xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
as \<bullet> xs = (\<Sum>i<min (length as) (length xs). as ! i * xs ! i)
length as = length xs
i < length as

goal (1 subgoal):
 1. as ! i * xs ! i \<le> as \<bullet> xs
[PROOF STEP]
by (auto intro: member_le_sum)
[PROOF STATE]
proof (state)
this:
as ! i * xs ! i \<le> as \<bullet> xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_sup_exists:
  assumes ex: "\<exists>x. P x"
    and bz: "\<exists>z. \<forall>x. P x \<longrightarrow> x < z"
  shows "\<exists>s::real. \<forall>y. (\<exists>x. P x \<and> y < x) \<longleftrightarrow> y < s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s. \<forall>y. (\<exists>x. P x \<and> y < x) = (y < s)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>y. (\<exists>x. P x \<and> y < x) = (y < ?s)
[PROOF STEP]
from bz
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. \<forall>x. P x \<longrightarrow> x < z
[PROOF STEP]
have "bdd_above (Collect P)"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. \<forall>x. P x \<longrightarrow> x < z

goal (1 subgoal):
 1. bdd_above (Collect P)
[PROOF STEP]
by (force intro: less_imp_le)
[PROOF STATE]
proof (state)
this:
bdd_above (Collect P)

goal (1 subgoal):
 1. \<forall>y. (\<exists>x. P x \<and> y < x) = (y < ?s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bdd_above (Collect P)
[PROOF STEP]
show "\<forall>y. (\<exists>x. P x \<and> y < x) \<longleftrightarrow> y < Sup (Collect P)"
[PROOF STATE]
proof (prove)
using this:
bdd_above (Collect P)

goal (1 subgoal):
 1. \<forall>y. (\<exists>x. P x \<and> y < x) = (y < Sup (Collect P))
[PROOF STEP]
using ex bz
[PROOF STATE]
proof (prove)
using this:
bdd_above (Collect P)
\<exists>x. P x
\<exists>z. \<forall>x. P x \<longrightarrow> x < z

goal (1 subgoal):
 1. \<forall>y. (\<exists>x. P x \<and> y < x) = (y < Sup (Collect P))
[PROOF STEP]
by (subst less_cSup_iff) auto
[PROOF STATE]
proof (state)
this:
\<forall>y. (\<exists>x. P x \<and> y < x) = (y < Sup (Collect P))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Semilat) antisym_r [intro?]: "\<lbrakk> x \<sqsubseteq>\<^sub>r y; y \<sqsubseteq>\<^sub>r x; x \<in> A; y \<in> A \<rbrakk> \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq>\<^bsub>r\<^esub> y; y \<sqsubseteq>\<^bsub>r\<^esub> x; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq>\<^bsub>r\<^esub> y; y \<sqsubseteq>\<^bsub>r\<^esub> x; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (rule order_antisym) auto


[STATEMENT]
lemma convergent_add_const_right_iff:
  "convergent (\<lambda>n. f n + c :: 'a::topological_ab_group_add) \<longleftrightarrow> convergent f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. f n + c) = convergent f
[PROOF STEP]
using convergent_add_const_iff[of c f]
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. c + f n) = convergent f

goal (1 subgoal):
 1. convergent (\<lambda>n. f n + c) = convergent f
[PROOF STEP]
by (simp add: add_ac)


[STATEMENT]
lemma closed_Times: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)
[PROOF STEP]
have "S \<times> T = (fst -` S) \<inter> (snd -` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<times> T = fst -` S \<inter> snd -` T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<times> T = fst -` S \<inter> snd -` T

goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<times> T = fst -` S \<inter> snd -` T
[PROOF STEP]
show "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<times> T)"
[PROOF STATE]
proof (prove)
using this:
S \<times> T = fst -` S \<inter> snd -` T

goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)
[PROOF STEP]
by (simp add: closed_vimage_fst closed_vimage_snd closed_Int)
[PROOF STATE]
proof (state)
this:
\<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_nth_least[simp]:
    assumes "enat n < esize A"
    shows "card {k \<in> A. k < nth_least A n} = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {k \<in> A. k < nth_least A n} = n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
enat n < esize A

goal (1 subgoal):
 1. card {k \<in> A. k < nth_least A n} = n
[PROOF STEP]
proof (induct n arbitrary: A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. enat 0 < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A 0} = 0
 2. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
enat 0 < esize A

goal (2 subgoals):
 1. \<And>A. enat 0 < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A 0} = 0
 2. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have 1: "{k \<in> A. k < least A} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k \<in> A. k < least A} = {}
[PROOF STEP]
using least_not_less
[PROOF STATE]
proof (prove)
using this:
?k < least ?A \<Longrightarrow> ?k \<notin> ?A

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

goal (2 subgoals):
 1. \<And>A. enat 0 < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A 0} = 0
 2. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {k \<in> A. k < nth_least A 0} = 0
[PROOF STEP]
using nth_least.simps(1) card.empty 1
[PROOF STATE]
proof (prove)
using this:
nth_least ?A 0 = least ?A
card {} = 0
{k \<in> A. k < least A} = {}

goal (1 subgoal):
 1. card {k \<in> A. k < nth_least A 0} = 0
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
card {k \<in> A. k < nth_least A 0} = 0

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
enat n < esize ?A \<Longrightarrow> card {k \<in> ?A. k < nth_least ?A n} = n
enat (Suc n) < esize A

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have 1: "A \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {}
[PROOF STEP]
using Suc(2)
[PROOF STATE]
proof (prove)
using this:
enat (Suc n) < esize A

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

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have 2: "enat n < esize (A - {least A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat n < esize (A - {least A})
[PROOF STEP]
using Suc(2) 1
[PROOF STATE]
proof (prove)
using this:
enat (Suc n) < esize A
A \<noteq> {}

goal (1 subgoal):
 1. enat n < esize (A - {least A})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enat n < esize (A - {least A})

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have 3: "nth_least A 0 < nth_least A (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_least A 0 < nth_least A (Suc n)
[PROOF STEP]
using nth_least_strict_mono Suc(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>enat ?l < esize ?A; ?k < ?l\<rbrakk> \<Longrightarrow> nth_least ?A ?k < nth_least ?A ?l
enat (Suc n) < esize A

goal (1 subgoal):
 1. nth_least A 0 < nth_least A (Suc n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
nth_least A 0 < nth_least A (Suc n)

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have 4: "{k \<in> A. k < nth_least A (Suc n)} =
      {least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k \<in> A. k < nth_least A (Suc n)} = {least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}
[PROOF STEP]
using 1 3
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
nth_least A 0 < nth_least A (Suc n)

goal (1 subgoal):
 1. {k \<in> A. k < nth_least A (Suc n)} = {least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{k \<in> A. k < nth_least A (Suc n)} = {least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have 5: "card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = n
[PROOF STEP]
using Suc(1) 2
[PROOF STATE]
proof (prove)
using this:
enat n < esize ?A \<Longrightarrow> card {k \<in> ?A. k < nth_least ?A n} = n
enat n < esize (A - {least A})

goal (1 subgoal):
 1. card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = n
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = n

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have 6: "finite {k \<in> A - {least A}. k < nth_least (A - {least A}) n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {k \<in> A - {least A}. k < nth_least (A - {least A}) n}
[PROOF STEP]
using 5 Collect_empty_eq card.infinite infinite_imp_nonempty least_not_less nth_least.simps(1)
[PROOF STATE]
proof (prove)
using this:
card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = n
(Collect ?P = {}) = (\<forall>x. \<not> ?P x)
infinite ?A \<Longrightarrow> card ?A = 0
infinite ?S \<Longrightarrow> ?S \<noteq> {}
?k < least ?A \<Longrightarrow> ?k \<notin> ?A
nth_least ?A 0 = least ?A

goal (1 subgoal):
 1. finite {k \<in> A - {least A}. k < nth_least (A - {least A}) n}
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
finite {k \<in> A - {least A}. k < nth_least (A - {least A}) n}

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have "card {k \<in> A. k < nth_least A (Suc n)} =
      card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {k \<in> A. k < nth_least A (Suc n)} = card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n})
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
{k \<in> A. k < nth_least A (Suc n)} = {least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}

goal (1 subgoal):
 1. card {k \<in> A. k < nth_least A (Suc n)} = card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {k \<in> A. k < nth_least A (Suc n)} = card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n})

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {k \<in> A. k < nth_least A (Suc n)} = card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n})

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have "\<dots> = card {least A} + card {k \<in> A - {least A}. k < nth_least (A - {least A}) n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}) = card {least A} + card {k \<in> A - {least A}. k < nth_least (A - {least A}) n}
[PROOF STEP]
using 6
[PROOF STATE]
proof (prove)
using this:
finite {k \<in> A - {least A}. k < nth_least (A - {least A}) n}

goal (1 subgoal):
 1. card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}) = card {least A} + card {k \<in> A - {least A}. k < nth_least (A - {least A}) n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}) = card {least A} + card {k \<in> A - {least A}. k < nth_least (A - {least A}) n}

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ({least A} \<union> {k \<in> A - {least A}. k < nth_least (A - {least A}) n}) = card {least A} + card {k \<in> A - {least A}. k < nth_least (A - {least A}) n}

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
have "\<dots> = Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {least A} + card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = Suc n
[PROOF STEP]
using 5
[PROOF STATE]
proof (prove)
using this:
card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = n

goal (1 subgoal):
 1. card {least A} + card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {least A} + card {k \<in> A - {least A}. k < nth_least (A - {least A}) n} = Suc n

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. enat n < esize A \<Longrightarrow> card {k \<in> A. k < nth_least A n} = n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card {k \<in> A. k < nth_least A (Suc n)} = Suc n

goal (1 subgoal):
 1. card {k \<in> A. k < nth_least A (Suc n)} = Suc n
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
card {k \<in> A. k < nth_least A (Suc n)} = Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_subseq_of_trans:
  assumes "s \<in> closed_seqs Zp"
  assumes "is_subseq_of s s'"
  assumes "is_subseq_of s' s''"
  shows "is_subseq_of s s''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_subseq_of s s''
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_subseq_of s s''
[PROOF STEP]
obtain f where f_def: "is_increasing f \<and> s' = take_subseq s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. is_increasing f \<and> s' = take_subseq s f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2) is_subseq_of_def
[PROOF STATE]
proof (prove)
using this:
is_subseq_of s s'
is_subseq_of ?s ?s' = (\<exists>f. is_increasing f \<and> ?s' = take_subseq ?s f)

goal (1 subgoal):
 1. (\<And>f. is_increasing f \<and> s' = take_subseq s f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_increasing f \<and> s' = take_subseq s f

goal (1 subgoal):
 1. is_subseq_of s s''
[PROOF STEP]
obtain g where g_def: "is_increasing g \<and> s'' = take_subseq s' g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. is_increasing g \<and> s'' = take_subseq s' g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(3) is_subseq_of_def
[PROOF STATE]
proof (prove)
using this:
is_subseq_of s' s''
is_subseq_of ?s ?s' = (\<exists>f. is_increasing f \<and> ?s' = take_subseq ?s f)

goal (1 subgoal):
 1. (\<And>g. is_increasing g \<and> s'' = take_subseq s' g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_increasing g \<and> s'' = take_subseq s' g

goal (1 subgoal):
 1. is_subseq_of s s''
[PROOF STEP]
have "s'' = take_subseq s (f \<circ> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s'' = take_subseq s (f \<circ> g)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. s'' x = take_subseq s (f \<circ> g) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. s'' x = take_subseq s (f \<circ> g) x
[PROOF STEP]
show "s'' x = take_subseq s (f \<circ> g) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s'' x = take_subseq s (f \<circ> g) x
[PROOF STEP]
using f_def g_def
[PROOF STATE]
proof (prove)
using this:
is_increasing f \<and> s' = take_subseq s f
is_increasing g \<and> s'' = take_subseq s' g

goal (1 subgoal):
 1. s'' x = take_subseq s (f \<circ> g) x
[PROOF STEP]
unfolding take_subseq_def
[PROOF STATE]
proof (prove)
using this:
is_increasing f \<and> s' = (\<lambda>k. s (f k))
is_increasing g \<and> s'' = (\<lambda>k. s' (g k))

goal (1 subgoal):
 1. s'' x = s ((f \<circ> g) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s'' x = take_subseq s (f \<circ> g) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
s'' = take_subseq s (f \<circ> g)

goal (1 subgoal):
 1. is_subseq_of s s''
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s'' = take_subseq s (f \<circ> g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s'' = take_subseq s (f \<circ> g)

goal (1 subgoal):
 1. is_subseq_of s s''
[PROOF STEP]
using f_def g_def is_increasing_comp is_subseq_of_def
[PROOF STATE]
proof (prove)
using this:
s'' = take_subseq s (f \<circ> g)
is_increasing f \<and> s' = take_subseq s f
is_increasing g \<and> s'' = take_subseq s' g
\<lbrakk>is_increasing ?f; is_increasing ?g\<rbrakk> \<Longrightarrow> is_increasing (?f \<circ> ?g)
is_subseq_of ?s ?s' = (\<exists>f. is_increasing f \<and> ?s' = take_subseq ?s f)

goal (1 subgoal):
 1. is_subseq_of s s''
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_subseq_of s s''

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma behead_isnpolyh:
  assumes "isnpolyh p n"
  shows "isnpolyh (behead p) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isnpolyh (behead p) n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isnpolyh p n

goal (1 subgoal):
 1. isnpolyh (behead p) n
[PROOF STEP]
by (induct p rule: behead.induct) (auto simp add: Let_def isnpolyh_mono)


[STATEMENT]
lemma poly_roots_monom [simp]: "c \<noteq> 0 \<Longrightarrow> poly_roots (Polynomial.monom c n) = replicate_mset n 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> poly_roots (Polynomial.monom c n) = replicate_mset n (0::'a)
[PROOF STEP]
by (intro multiset_eqI) (auto simp: count_poly_roots' order_eq_0_iff poly_monom)


[STATEMENT]
lemma order_mult:
  assumes "p * q \<noteq> 0" shows "order a (p * q) = order a p + order a q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
define i where "i \<equiv> order a p"
[PROOF STATE]
proof (state)
this:
i \<equiv> order a p

goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
define j where "j \<equiv> order a q"
[PROOF STATE]
proof (state)
this:
j \<equiv> order a q

goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
define t where "t \<equiv> [:-a, 1:]"
[PROOF STATE]
proof (state)
this:
t \<equiv> [:- a, 1::'a:]

goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
have t_dvd_iff: "\<And>u. t dvd u \<longleftrightarrow> poly u a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u. (t dvd u) = (poly u a = (0::'a))
[PROOF STEP]
by (simp add: t_def dvd_iff_poly_eq_0)
[PROOF STATE]
proof (state)
this:
(t dvd ?u) = (poly ?u a = (0::'a))

goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
have dvd: "t ^ i dvd p" "t ^ j dvd q" and "\<not> t ^ Suc i dvd p" "\<not> t ^ Suc j dvd q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t ^ i dvd p &&& t ^ j dvd q) &&& \<not> t ^ Suc i dvd p &&& \<not> t ^ Suc j dvd q
[PROOF STEP]
using assms i_def j_def order_1 order_2 t_def
[PROOF STATE]
proof (prove)
using this:
p * q \<noteq> 0
i \<equiv> order a p
j \<equiv> order a q
[:- ?a, 1::?'a:] ^ order ?a ?p dvd ?p
?p \<noteq> 0 \<Longrightarrow> \<not> [:- ?a, 1::?'a:] ^ Suc (order ?a ?p) dvd ?p
t \<equiv> [:- a, 1::'a:]

goal (1 subgoal):
 1. (t ^ i dvd p &&& t ^ j dvd q) &&& \<not> t ^ Suc i dvd p &&& \<not> t ^ Suc j dvd q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t ^ i dvd p
t ^ j dvd q
\<not> t ^ Suc i dvd p
\<not> t ^ Suc j dvd q

goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t ^ i dvd p
t ^ j dvd q
\<not> t ^ Suc i dvd p
\<not> t ^ Suc j dvd q
[PROOF STEP]
have "\<not> t ^ Suc(i + j) dvd p * q"
[PROOF STATE]
proof (prove)
using this:
t ^ i dvd p
t ^ j dvd q
\<not> t ^ Suc i dvd p
\<not> t ^ Suc j dvd q

goal (1 subgoal):
 1. \<not> t ^ Suc (i + j) dvd p * q
[PROOF STEP]
by (elim dvdE) (simp add: power_add t_dvd_iff)
[PROOF STATE]
proof (state)
this:
\<not> t ^ Suc (i + j) dvd p * q

goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> t ^ Suc (i + j) dvd p * q

goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
have "t ^ (i + j) dvd p * q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t ^ (i + j) dvd p * q
[PROOF STEP]
using dvd
[PROOF STATE]
proof (prove)
using this:
t ^ i dvd p
t ^ j dvd q

goal (1 subgoal):
 1. t ^ (i + j) dvd p * q
[PROOF STEP]
by (simp add: mult_dvd_mono power_add)
[PROOF STATE]
proof (state)
this:
t ^ (i + j) dvd p * q

goal (1 subgoal):
 1. order a (p * q) = order a p + order a q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> t ^ Suc (i + j) dvd p * q
t ^ (i + j) dvd p * q
[PROOF STEP]
show "order a (p * q) = i + j"
[PROOF STATE]
proof (prove)
using this:
\<not> t ^ Suc (i + j) dvd p * q
t ^ (i + j) dvd p * q

goal (1 subgoal):
 1. order a (p * q) = i + j
[PROOF STEP]
using order_unique_lemma t_def
[PROOF STATE]
proof (prove)
using this:
\<not> t ^ Suc (i + j) dvd p * q
t ^ (i + j) dvd p * q
\<lbrakk>[:- ?a, 1::?'a:] ^ ?n dvd ?p; \<not> [:- ?a, 1::?'a:] ^ Suc ?n dvd ?p\<rbrakk> \<Longrightarrow> order ?a ?p = ?n
t \<equiv> [:- a, 1::'a:]

goal (1 subgoal):
 1. order a (p * q) = i + j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
order a (p * q) = i + j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma divsor_prime_ex: "\<lbrakk>\<not> Prime x; x > Suc 0\<rbrakk> \<Longrightarrow>
  \<exists> p. Prime p \<and> p dvd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> Prime x; Suc 0 < x\<rbrakk> \<Longrightarrow> \<exists>p. Prime p \<and> p dvd x
[PROOF STEP]
apply(induct x rule: wf_induct[where r = "measure (\<lambda> y. y)"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>y. (y, x) \<in> measure (\<lambda>y. y) \<longrightarrow> \<not> Prime y \<longrightarrow> Suc 0 < y \<longrightarrow> (\<exists>p. Prime p \<and> p dvd y); \<not> Prime x; Suc 0 < x\<rbrakk> \<Longrightarrow> \<exists>p. Prime p \<and> p dvd x
[PROOF STEP]
apply(drule_tac divsor_ex, simp, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u v. \<lbrakk>\<forall>y<u * v. \<not> Prime y \<longrightarrow> Suc 0 < y \<longrightarrow> (\<exists>p. Prime p \<and> p dvd y); Suc 0 < u * v; Suc 0 < u; Suc 0 < v\<rbrakk> \<Longrightarrow> \<exists>p. Prime p \<and> p dvd u * v
[PROOF STEP]
apply(rename_tac u v)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u v. \<lbrakk>\<forall>y<u * v. \<not> Prime y \<longrightarrow> Suc 0 < y \<longrightarrow> (\<exists>p. Prime p \<and> p dvd y); Suc 0 < u * v; Suc 0 < u; Suc 0 < v\<rbrakk> \<Longrightarrow> \<exists>p. Prime p \<and> p dvd u * v
[PROOF STEP]
apply(erule_tac x = u in allE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u v. \<lbrakk>Suc 0 < u * v; Suc 0 < u; Suc 0 < v; \<not> Prime u \<longrightarrow> (\<exists>p. Prime p \<and> p dvd u)\<rbrakk> \<Longrightarrow> \<exists>p. Prime p \<and> p dvd u * v
[PROOF STEP]
apply(case_tac "Prime u", simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>u v. \<lbrakk>Suc 0 < u * v; Suc 0 < u; Suc 0 < v; Prime u\<rbrakk> \<Longrightarrow> \<exists>p. Prime p \<and> p dvd u * v
 2. \<And>u v. \<lbrakk>Suc 0 < u * v; Suc 0 < u; Suc 0 < v; \<not> Prime u \<longrightarrow> (\<exists>p. Prime p \<and> p dvd u); \<not> Prime u\<rbrakk> \<Longrightarrow> \<exists>p. Prime p \<and> p dvd u * v
[PROOF STEP]
apply(rule_tac x = u in exI, simp, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma linear_bounded:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
  assumes lf: "linear f"
  shows "\<exists>B. \<forall>x. norm (f x) \<le> B * norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B. \<forall>x. norm (f x) \<le> B * norm x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x. norm (f x) \<le> ?B * norm x
[PROOF STEP]
interpret linear f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x. norm (f x) \<le> ?B * norm x
[PROOF STEP]
let ?B = "\<Sum>b\<in>Basis. norm (f b)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x. norm (f x) \<le> ?B * norm x
[PROOF STEP]
show "\<forall>x. norm (f x) \<le> ?B * norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
fix x :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
let ?g = "\<lambda>b. (x \<bullet> b) *\<^sub>R f b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
have "norm (f x) = norm (f (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) = norm (f (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b))
[PROOF STEP]
unfolding euclidean_representation
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) = norm (f x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
norm (f x) = norm (f (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b))

goal (1 subgoal):
 1. \<And>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (f x) = norm (f (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b))

goal (1 subgoal):
 1. \<And>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
have "\<dots> = norm (sum ?g Basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b)) = norm (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R f b)
[PROOF STEP]
by (simp add: sum scale)
[PROOF STATE]
proof (state)
this:
norm (f (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R b)) = norm (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R f b)

goal (1 subgoal):
 1. \<And>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (f x) = norm (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R f b)
[PROOF STEP]
have th0: "norm (f x) = norm (sum ?g Basis)"
[PROOF STATE]
proof (prove)
using this:
norm (f x) = norm (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R f b)

goal (1 subgoal):
 1. norm (f x) = norm (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R f b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (f x) = norm (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R f b)

goal (1 subgoal):
 1. \<And>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
have th: "norm (?g i) \<le> norm (f i) * norm x" if "i \<in> Basis" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((x \<bullet> i) *\<^sub>R f i) \<le> norm (f i) * norm x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm ((x \<bullet> i) *\<^sub>R f i) \<le> norm (f i) * norm x
[PROOF STEP]
from Basis_le_norm[OF that, of x]
[PROOF STATE]
proof (chain)
picking this:
\<bar>x \<bullet> i\<bar> \<le> norm x
[PROOF STEP]
show "norm (?g i) \<le> norm (f i) * norm x"
[PROOF STATE]
proof (prove)
using this:
\<bar>x \<bullet> i\<bar> \<le> norm x

goal (1 subgoal):
 1. norm ((x \<bullet> i) *\<^sub>R f i) \<le> norm (f i) * norm x
[PROOF STEP]
unfolding norm_scaleR
[PROOF STATE]
proof (prove)
using this:
\<bar>x \<bullet> i\<bar> \<le> norm x

goal (1 subgoal):
 1. \<bar>x \<bullet> i\<bar> * norm (f i) \<le> norm (f i) * norm x
[PROOF STEP]
by (metis mult.commute mult_left_mono norm_ge_zero)
[PROOF STATE]
proof (state)
this:
norm ((x \<bullet> i) *\<^sub>R f i) \<le> norm (f i) * norm x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i \<in> Basis \<Longrightarrow> norm ((x \<bullet> ?i) *\<^sub>R f ?i) \<le> norm (f ?i) * norm x

goal (1 subgoal):
 1. \<And>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
from sum_norm_le[of _ ?g, OF th]
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> ?S \<Longrightarrow> x \<in> Basis) \<Longrightarrow> norm (\<Sum>b\<in>?S. (x \<bullet> b) *\<^sub>R f b) \<le> (\<Sum>xa\<in>?S. norm (f xa) * norm x)
[PROOF STEP]
show "norm (f x) \<le> ?B * norm x"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> ?S \<Longrightarrow> x \<in> Basis) \<Longrightarrow> norm (\<Sum>b\<in>?S. (x \<bullet> b) *\<^sub>R f b) \<le> (\<Sum>xa\<in>?S. norm (f xa) * norm x)

goal (1 subgoal):
 1. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x
[PROOF STEP]
unfolding th0 sum_distrib_right
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> ?S \<Longrightarrow> x \<in> Basis) \<Longrightarrow> norm (\<Sum>b\<in>?S. (x \<bullet> b) *\<^sub>R f b) \<le> (\<Sum>xa\<in>?S. norm (f xa) * norm x)

goal (1 subgoal):
 1. norm (\<Sum>b\<in>Basis. (x \<bullet> b) *\<^sub>R f b) \<le> (\<Sum>n\<in>Basis. norm (f n) * norm x)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x. norm (f x) \<le> (\<Sum>b\<in>Basis. norm (f b)) * norm x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monoseq_imp_convergent_iff_Bseq: "monoseq f \<Longrightarrow> convergent f \<longleftrightarrow> Bseq f"
  for f :: "nat \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoseq f \<Longrightarrow> convergent f = Bseq f
[PROOF STEP]
using Bseq_monoseq_convergent[of f] convergent_imp_Bseq[of f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Bseq f; monoseq f\<rbrakk> \<Longrightarrow> convergent f
convergent f \<Longrightarrow> Bseq f

goal (1 subgoal):
 1. monoseq f \<Longrightarrow> convergent f = Bseq f
[PROOF STEP]
by blast


[STATEMENT]
lemma bernpoly_1_1: "bernpoly 1 1 = of_real (1/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
have *: "(1 :: 'a) = of_real 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) = of_real 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) = of_real 1

goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
have "bernpoly 1 (1::'a) = 1 - of_real (1 / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernpoly 1 (1::'a) = (1::'a) - of_real (1 / 2)
[PROOF STEP]
by (simp add: bernoulli_unroll_all)
[PROOF STATE]
proof (state)
this:
bernpoly 1 (1::'a) = (1::'a) - of_real (1 / 2)

goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bernpoly 1 (1::'a) = (1::'a) - of_real (1 / 2)

goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
have "\<dots> = of_real (1 - 1 / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) - of_real (1 / 2) = of_real (1 - 1 / 2)
[PROOF STEP]
by (simp only: *  of_real_diff)
[PROOF STATE]
proof (state)
this:
(1::'a) - of_real (1 / 2) = of_real (1 - 1 / 2)

goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) - of_real (1 / 2) = of_real (1 - 1 / 2)

goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
have "1 - 1 / 2 = (1 / 2 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - 1 / 2 = 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 - 1 / 2 = 1 / 2

goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bernpoly 1 (1::'a) = of_real (1 / 2)

goal (1 subgoal):
 1. bernpoly 1 (1::'a) = of_real (1 / 2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
bernpoly 1 (1::'a) = of_real (1 / 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ts_inv_ok_conv_dom_eq:
  "ts_inv_ok ts I \<longleftrightarrow> (dom ts = dom I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
have "ts_inv_ok ts I \<longleftrightarrow> (\<forall>t. ts t = None \<longleftrightarrow> I t = None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ts_inv_ok ts I = (\<forall>t. (ts t = None) = (I t = None))
[PROOF STEP]
unfolding ts_inv_ok_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>t. (ts t = None) = (I t = None)) = (\<forall>t. (ts t = None) = (I t = None))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ts_inv_ok ts I = (\<forall>t. (ts t = None) = (I t = None))

goal (1 subgoal):
 1. ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ts_inv_ok ts I = (\<forall>t. (ts t = None) = (I t = None))

goal (1 subgoal):
 1. ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<forall>t. t \<in> - dom ts \<longleftrightarrow> t \<in> - dom I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>t. (ts t = None) = (I t = None)) = (\<forall>t. (t \<in> - dom ts) = (t \<in> - dom I))
[PROOF STEP]
by(force)
[PROOF STATE]
proof (state)
this:
(\<forall>t. (ts t = None) = (I t = None)) = (\<forall>t. (t \<in> - dom ts) = (t \<in> - dom I))

goal (1 subgoal):
 1. ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<forall>t. (ts t = None) = (I t = None)) = (\<forall>t. (t \<in> - dom ts) = (t \<in> - dom I))

goal (1 subgoal):
 1. ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> dom ts = dom I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>t. (t \<in> - dom ts) = (t \<in> - dom I)) = (dom ts = dom I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<forall>t. (t \<in> - dom ts) = (t \<in> - dom I)) = (dom ts = dom I)

goal (1 subgoal):
 1. ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ts_inv_ok ts I = (dom ts = dom I)

goal (1 subgoal):
 1. ts_inv_ok ts I = (dom ts = dom I)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ts_inv_ok ts I = (dom ts = dom I)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma f_expand_nth_mult: "\<And>n.
  \<lbrakk> n < length xs; 0 < k \<rbrakk> \<Longrightarrow> (xs \<odot>\<^sub>f k) ! (n * k) = xs ! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>n < length xs; 0 < k\<rbrakk> \<Longrightarrow> xs \<odot> k ! (n * k) = xs ! n
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>n < length []; 0 < k\<rbrakk> \<Longrightarrow> [] \<odot> k ! (n * k) = [] ! n
 2. \<And>a xs n. \<lbrakk>\<And>n. \<lbrakk>n < length xs; 0 < k\<rbrakk> \<Longrightarrow> xs \<odot> k ! (n * k) = xs ! n; n < length (a # xs); 0 < k\<rbrakk> \<Longrightarrow> (a # xs) \<odot> k ! (n * k) = (a # xs) ! n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs n. \<lbrakk>\<And>n. \<lbrakk>n < length xs; 0 < k\<rbrakk> \<Longrightarrow> xs \<odot> k ! (n * k) = xs ! n; n < length (a # xs); 0 < k\<rbrakk> \<Longrightarrow> (a # xs) \<odot> k ! (n * k) = (a # xs) ! n
[PROOF STEP]
apply (case_tac n, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs n nat. \<lbrakk>\<And>n. \<lbrakk>n < length xs; 0 < k\<rbrakk> \<Longrightarrow> xs \<odot> k ! (n * k) = xs ! n; n < length (a # xs); 0 < k; n = Suc nat\<rbrakk> \<Longrightarrow> (a # xs) \<odot> k ! (n * k) = (a # xs) ! n
[PROOF STEP]
apply (simp add: nth_append append_Cons[symmetric] del: append_Cons)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma FrameStatImpTrans:
  fixes F :: "'b frame"
  and   G :: "'b frame"
  and   H :: "'b frame"

  assumes "F \<hookrightarrow>\<^sub>F G"
  and     "G \<hookrightarrow>\<^sub>F H"

  shows "F \<hookrightarrow>\<^sub>F H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<hookrightarrow>\<^sub>F H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
F \<hookrightarrow>\<^sub>F G
G \<hookrightarrow>\<^sub>F H

goal (1 subgoal):
 1. F \<hookrightarrow>\<^sub>F H
[PROOF STEP]
by(simp add: FrameStatImp_def)


[STATEMENT]
lemma sorted_wrt_gen:
  "sorted_wrt (<\<^sub>r\<^sub>l\<^sub>e\<^sub>x) (gen B n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (<\<^sub>r\<^sub>l\<^sub>e\<^sub>x) (gen B n)
[PROOF STEP]
by (induction n)
   (auto simp: rlex_Cons sorted_wrt_append sorted_wrt_map rlex_irrefl
    intro!: sorted_wrt_concat_map [where h = id, simplified])


[STATEMENT]
lemma Polygamma_approx_ge_2_real:
  assumes "x > (0::real)" "m > 0"
  shows   "Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x
[PROOF STEP]
proof (induction j arbitrary: x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' (Suc 0) m x
 2. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
case (0 x)
[PROOF STATE]
proof (state)
this:
0 < x

goal (2 subgoals):
 1. \<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' (Suc 0) m x
 2. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < x
0 < m
0 < x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m
0 < x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' (Suc 0) m x
[PROOF STEP]
by (simp add: Polygamma_approx_2_real)
[PROOF STATE]
proof (state)
this:
Polygamma_approx (Suc (Suc 0)) m x = stirling_sum' (Suc 0) m x

goal (1 subgoal):
 1. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
case (Suc j x)
[PROOF STATE]
proof (state)
this:
0 < ?x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m ?x = stirling_sum' (Suc j) m ?x
0 < x

goal (1 subgoal):
 1. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
have "Polygamma_approx (Suc (Suc (Suc j))) m x = deriv (Polygamma_approx (Suc (Suc j)) m) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc (Suc j))) m x = deriv (Polygamma_approx (Suc (Suc j)) m) x
[PROOF STEP]
by (simp add: Polygamma_approx_Suc)
[PROOF STATE]
proof (state)
this:
Polygamma_approx (Suc (Suc (Suc j))) m x = deriv (Polygamma_approx (Suc (Suc j)) m) x

goal (1 subgoal):
 1. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polygamma_approx (Suc (Suc (Suc j))) m x = deriv (Polygamma_approx (Suc (Suc j)) m) x

goal (1 subgoal):
 1. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
have "\<dots> = deriv (stirling_sum' (Suc j) m) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (Polygamma_approx (Suc (Suc j)) m) x = deriv (stirling_sum' (Suc j) m) x
[PROOF STEP]
using eventually_nhds_in_open[of "{0<..}" x] Suc.prems
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open {0<..}; x \<in> {0<..}\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F y in nhds x. y \<in> {0<..}
0 < x

goal (1 subgoal):
 1. deriv (Polygamma_approx (Suc (Suc j)) m) x = deriv (stirling_sum' (Suc j) m) x
[PROOF STEP]
by (intro deriv_cong_ev refl) (auto elim!: eventually_mono simp: Suc.IH)
[PROOF STATE]
proof (state)
this:
deriv (Polygamma_approx (Suc (Suc j)) m) x = deriv (stirling_sum' (Suc j) m) x

goal (1 subgoal):
 1. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deriv (Polygamma_approx (Suc (Suc j)) m) x = deriv (stirling_sum' (Suc j) m) x

goal (1 subgoal):
 1. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
have "\<dots> = stirling_sum' (Suc (Suc j)) m x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (stirling_sum' (Suc j) m) x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. deriv (stirling_sum' (Suc j) m) x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
by (intro DERIV_imp_deriv derivative_intros) simp_all
[PROOF STATE]
proof (state)
this:
deriv (stirling_sum' (Suc j) m) x = stirling_sum' (Suc (Suc j)) m x

goal (1 subgoal):
 1. \<And>j x. \<lbrakk>\<And>x. 0 < x \<Longrightarrow> Polygamma_approx (Suc (Suc j)) m x = stirling_sum' (Suc j) m x; 0 < x\<rbrakk> \<Longrightarrow> Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x

goal (1 subgoal):
 1. Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Polygamma_approx (Suc (Suc (Suc j))) m x = stirling_sum' (Suc (Suc j)) m x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rat_number_expand:
  "0 = Fract 0 1"
  "1 = Fract 1 1"
  "numeral k = Fract (numeral k) 1"
  "- 1 = Fract (- 1) 1"
  "- numeral k = Fract (- numeral k) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 = Fract 0 1 &&& 1 = Fract 1 1) &&& numeral k = Fract (numeral k) 1 &&& - 1 = Fract (- 1) 1 &&& - numeral k = Fract (- numeral k) 1
[PROOF STEP]
by (simp_all add: rat_number_collapse)


[STATEMENT]
lemma basis_indep_card:
  assumes "indep X"
  assumes "basis B"
  shows "card X \<le> card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card X \<le> card B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card X \<le> card B
[PROOF STEP]
obtain B' where "basis B'" "X \<subseteq> B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B'. \<lbrakk>basis B'; X \<subseteq> B'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms indep_imp_subset_basis
[PROOF STATE]
proof (prove)
using this:
indep X
basis B
indep ?X \<Longrightarrow> \<exists>B. basis B \<and> ?X \<subseteq> B

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

goal (1 subgoal):
 1. card X \<le> card B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
basis B'
X \<subseteq> B'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
basis B'
X \<subseteq> B'

goal (1 subgoal):
 1. card X \<le> card B
[PROOF STEP]
using assms basis_finite basis_card[of B B']
[PROOF STATE]
proof (prove)
using this:
basis B'
X \<subseteq> B'
indep X
basis B
basis ?A \<Longrightarrow> finite ?A
\<lbrakk>basis B; basis B'\<rbrakk> \<Longrightarrow> card B = card B'

goal (1 subgoal):
 1. card X \<le> card B
[PROOF STEP]
by (auto intro: card_mono)
[PROOF STATE]
proof (state)
this:
card X \<le> card B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma R_lin_independent_vs_lincomb0 :
  assumes "set (ms@n#ns) \<subseteq> M" "R_lin_independent (ms @ n # ns)"
          "set (rs@s#ss) \<subseteq> R" "length rs = length ms"
          "(rs@s#ss) \<bullet>\<cdot> (ms@n#ns) = 0"
  shows   "s = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s = (0::'r)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s = (0::'r)
[PROOF STEP]
define k where "k = length rs"
[PROOF STATE]
proof (state)
this:
k = length rs

goal (1 subgoal):
 1. s = (0::'r)
[PROOF STEP]
hence "(rs@s#ss)!k = s"
[PROOF STATE]
proof (prove)
using this:
k = length rs

goal (1 subgoal):
 1. (rs @ s # ss) ! k = s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(rs @ s # ss) ! k = s

goal (1 subgoal):
 1. s = (0::'r)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(rs @ s # ss) ! k = s

goal (1 subgoal):
 1. s = (0::'r)
[PROOF STEP]
from k_def assms(4)
[PROOF STATE]
proof (chain)
picking this:
k = length rs
length rs = length ms
[PROOF STEP]
have "k < min (length (rs@s#ss)) (length (ms@n#ns))"
[PROOF STATE]
proof (prove)
using this:
k = length rs
length rs = length ms

goal (1 subgoal):
 1. k < min (length (rs @ s # ss)) (length (ms @ n # ns))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k < min (length (rs @ s # ss)) (length (ms @ n # ns))

goal (1 subgoal):
 1. s = (0::'r)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(rs @ s # ss) ! k = s
k < min (length (rs @ s # ss)) (length (ms @ n # ns))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(rs @ s # ss) ! k = s
k < min (length (rs @ s # ss)) (length (ms @ n # ns))

goal (1 subgoal):
 1. s = (0::'r)
[PROOF STEP]
using assms(1,2,3,5) R_lin_independentD_all_scalars_nth[of "rs@s#ss" "ms@n#ns"]
[PROOF STATE]
proof (prove)
using this:
(rs @ s # ss) ! k = s
k < min (length (rs @ s # ss)) (length (ms @ n # ns))
set (ms @ n # ns) \<subseteq> M
R_lin_independent (ms @ n # ns)
set (rs @ s # ss) \<subseteq> R
(rs @ s # ss) \<bullet>\<cdot> (ms @ n # ns) = (0::'m)
\<lbrakk>set (rs @ s # ss) \<subseteq> R; set (ms @ n # ns) \<subseteq> M; R_lin_independent (ms @ n # ns); (rs @ s # ss) \<bullet>\<cdot> (ms @ n # ns) = (0::'m); ?k < min (length (rs @ s # ss)) (length (ms @ n # ns))\<rbrakk> \<Longrightarrow> (rs @ s # ss) ! ?k = (0::'r)

goal (1 subgoal):
 1. s = (0::'r)
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
s = (0::'r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lsimulation_trans[trans]:
    assumes "lsimulation R1 A B"
    assumes "lsimulation R2 B C"
    shows "lsimulation (R1 O R2) A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lsimulation (R1 O R2) A C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lsimulation (R1 O R2) A C
[PROOF STEP]
interpret s1: lsimulation R1 A B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lsimulation R1 A B
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lsimulation (R1 O R2) A C
[PROOF STEP]
interpret s2: lsimulation R2 B C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lsimulation R2 B C
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lsimulation (R1 O R2) A C
[PROOF STEP]
interpret simulation "R1 O R2" A C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simulation (R1 O R2) A C
[PROOF STEP]
using simulation_trans s1.simulation_this s2.simulation_this
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>simulation ?R1.0 ?A ?B; simulation ?R2.0 ?B ?C\<rbrakk> \<Longrightarrow> simulation (?R1.0 O ?R2.0) ?A ?C
simulation R1 A B
simulation R2 B C

goal (1 subgoal):
 1. simulation (R1 O R2) A C
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lsimulation (R1 O R2) A C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lsimulation (R1 O R2) A C
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> R1 O R2 \<Longrightarrow> s1.a.L a = s2.b.L b
[PROOF STEP]
using s1.labeling_consistent s2.labeling_consistent
[PROOF STATE]
proof (prove)
using this:
(?a, ?b) \<in> R1 \<Longrightarrow> s1.a.L ?a = s1.b.L ?b
(?a, ?b) \<in> R2 \<Longrightarrow> s1.b.L ?a = s2.b.L ?b

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> R1 O R2 \<Longrightarrow> s1.a.L a = s2.b.L b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lsimulation (R1 O R2) A C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm015:
  "possible_allocations_rel' A B  =  possible_allocations_rel A B"
  (is "?A=?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. possible_allocations_rel' A B = possible_allocations_rel A B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. possible_allocations_rel' A B = possible_allocations_rel A B
[PROOF STEP]
have "?B=\<Union> { injections Y B | Y . Y \<in> all_partitions A }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. possible_allocations_rel A B = \<Union> {injections Y B |Y. Y \<in> all_partitions A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
possible_allocations_rel A B = \<Union> {injections Y B |Y. Y \<in> all_partitions A}

goal (1 subgoal):
 1. possible_allocations_rel' A B = possible_allocations_rel A B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
possible_allocations_rel A B = \<Union> {injections Y B |Y. Y \<in> all_partitions A}

goal (1 subgoal):
 1. possible_allocations_rel' A B = possible_allocations_rel A B
[PROOF STEP]
have "... = ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {injections Y B |Y. Y \<in> all_partitions A} = possible_allocations_rel' A B
[PROOF STEP]
using lm014
[PROOF STATE]
proof (prove)
using this:
all_partitions ?X = all_partitions' ?X

goal (1 subgoal):
 1. \<Union> {injections Y B |Y. Y \<in> all_partitions A} = possible_allocations_rel' A B
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<Union> {injections Y B |Y. Y \<in> all_partitions A} = possible_allocations_rel' A B

goal (1 subgoal):
 1. possible_allocations_rel' A B = possible_allocations_rel A B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
possible_allocations_rel A B = \<Union> {injections Y B |Y. Y \<in> all_partitions A}
\<Union> {injections Y B |Y. Y \<in> all_partitions A} = possible_allocations_rel' A B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
possible_allocations_rel A B = \<Union> {injections Y B |Y. Y \<in> all_partitions A}
\<Union> {injections Y B |Y. Y \<in> all_partitions A} = possible_allocations_rel' A B

goal (1 subgoal):
 1. possible_allocations_rel' A B = possible_allocations_rel A B
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
possible_allocations_rel' A B = possible_allocations_rel A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma UN_from_nat_into:
  assumes I: "countable I" "I \<noteq> {}"
  shows "(\<Union>i\<in>I. N i) = (\<Union>i. N (from_nat_into I i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (N ` I) = (\<Union>i. N (from_nat_into I i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (N ` I) = (\<Union>i. N (from_nat_into I i))
[PROOF STEP]
have "(\<Union>i\<in>I. N i) = \<Union>(N ` range (from_nat_into I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (N ` I) = \<Union> (N ` range (from_nat_into I))
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
countable I
I \<noteq> {}

goal (1 subgoal):
 1. \<Union> (N ` I) = \<Union> (N ` range (from_nat_into I))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (N ` I) = \<Union> (N ` range (from_nat_into I))

goal (1 subgoal):
 1. \<Union> (N ` I) = (\<Union>i. N (from_nat_into I i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (N ` I) = \<Union> (N ` range (from_nat_into I))

goal (1 subgoal):
 1. \<Union> (N ` I) = (\<Union>i. N (from_nat_into I i))
[PROOF STEP]
have "\<dots> = (\<Union>i. (N \<circ> from_nat_into I) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (N ` range (from_nat_into I)) = \<Union> (range (N \<circ> from_nat_into I))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (N ` range (from_nat_into I)) = \<Union> (range (N \<circ> from_nat_into I))

goal (1 subgoal):
 1. \<Union> (N ` I) = (\<Union>i. N (from_nat_into I i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Union> (N ` I) = \<Union> (range (N \<circ> from_nat_into I))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Union> (N ` I) = \<Union> (range (N \<circ> from_nat_into I))

goal (1 subgoal):
 1. \<Union> (N ` I) = (\<Union>i. N (from_nat_into I i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (N ` I) = (\<Union>i. N (from_nat_into I i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma consistent_signs_atw:
  assumes "\<And>p. p \<in> set fs \<Longrightarrow> poly p x \<noteq> 0"
  shows "consistent_sign_vec_copr fs x = signs_at fs x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. consistent_sign_vec_copr fs x = signs_at fs x
[PROOF STEP]
unfolding consistent_sign_vec_copr_def signs_at_def squash_def o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>q. if 0 < poly q x then 1 else - 1) fs = map (\<lambda>xa. if 0 < poly xa x then 1 else if poly xa x < 0 then - 1 else 0) fs
[PROOF STEP]
by (simp add: assms)


[STATEMENT]
lemma pointwise_adm:
  fixes P :: "'a::pcpo \<Rightarrow> 'b::pcpo \<Rightarrow> bool"
  assumes "adm (\<lambda> x. P (fst x) (snd x))"
  shows "adm (\<lambda> m. pointwise P (fst m) (snd m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adm (\<lambda>m. pointwise P (fst m) (snd m))
[PROOF STEP]
proof (rule admI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Y. \<lbrakk>chain Y; \<forall>i. pointwise P (fst (Y i)) (snd (Y i))\<rbrakk> \<Longrightarrow> pointwise P (fst (\<Squnion>i. Y i)) (snd (\<Squnion>i. Y i))
[PROOF STEP]
case prems: (1 Y)
[PROOF STATE]
proof (state)
this:
chain Y
\<forall>i. pointwise P (fst (Y i)) (snd (Y i))

goal (1 subgoal):
 1. \<And>Y. \<lbrakk>chain Y; \<forall>i. pointwise P (fst (Y i)) (snd (Y i))\<rbrakk> \<Longrightarrow> pointwise P (fst (\<Squnion>i. Y i)) (snd (\<Squnion>i. Y i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pointwise P (fst (\<Squnion>i. Y i)) (snd (\<Squnion>i. Y i))
[PROOF STEP]
apply (rule pointwiseI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. P (fst (\<Squnion>i. Y i) x) (snd (\<Squnion>i. Y i) x)
[PROOF STEP]
apply (rule admD[OF adm_subst[where t = "\<lambda>p . (fst p x, snd p x)" for x, OF _ assms, simplified] \<open>chain Y\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x i. P (fst (Y i) x) (snd (Y i) x)
[PROOF STEP]
using prems(2)
[PROOF STATE]
proof (prove)
using this:
\<forall>i. pointwise P (fst (Y i)) (snd (Y i))

goal (1 subgoal):
 1. \<And>x i. P (fst (Y i) x) (snd (Y i) x)
[PROOF STEP]
unfolding pointwise_def
[PROOF STATE]
proof (prove)
using this:
\<forall>i x. P (fst (Y i) x) (snd (Y i) x)

goal (1 subgoal):
 1. \<And>x i. P (fst (Y i) x) (snd (Y i) x)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
pointwise P (fst (\<Squnion>i. Y i)) (snd (\<Squnion>i. Y i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fmdrop_comm: "fmdrop a (fmdrop b m) = fmdrop b (fmdrop a m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdrop a (fmdrop b m) = fmdrop b (fmdrop a m)
[PROOF STEP]
unfolding fmfilter_alt_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmfilter (\<lambda>a'. a' \<noteq> a) (fmfilter (\<lambda>a'. a' \<noteq> b) m) = fmfilter (\<lambda>a'. a' \<noteq> b) (fmfilter (\<lambda>a'. a' \<noteq> a) m)
[PROOF STEP]
by (rule fmfilter_comm)


[STATEMENT]
lemma normalize_bezout_gcd:
  assumes b: "(p,q,u,v,d) = bezout a b"
  shows "normalize d = gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize d = gcd a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. normalize d = gcd a b
[PROOF STEP]
let ?gcd = "(\<lambda>a b. case bezout a b of (x, xa,u,v, gcd') \<Rightarrow> gcd')"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. normalize d = gcd a b
[PROOF STEP]
have is_gcd: "is_gcd ?gcd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_gcd (\<lambda>a b. case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd')
[PROOF STEP]
by (simp add: ib is_gcd_is_bezout_ext)
[PROOF STATE]
proof (state)
this:
is_gcd (\<lambda>a b. case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd')

goal (1 subgoal):
 1. normalize d = gcd a b
[PROOF STEP]
have "(?gcd a b) = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = d
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
(p, q, u, v, d) = bezout a b

goal (1 subgoal):
 1. (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = d
[PROOF STEP]
by (metis case_prod_conv)
[PROOF STATE]
proof (state)
this:
(case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = d

goal (1 subgoal):
 1. normalize d = gcd a b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = d

goal (1 subgoal):
 1. normalize d = gcd a b
[PROOF STEP]
have "normalize (?gcd a b) = normalize (gcd a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = normalize (gcd a b)
[PROOF STEP]
proof (rule associatedI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') dvd gcd a b
 2. gcd a b dvd (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd')
[PROOF STEP]
show "(?gcd a b) dvd (gcd a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') dvd gcd a b
[PROOF STEP]
using is_gcd is_gcd_def
[PROOF STATE]
proof (prove)
using this:
is_gcd (\<lambda>a b. case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd')
is_gcd ?gcd' = (\<forall>a b. ?gcd' a b dvd a \<and> ?gcd' a b dvd b \<and> (\<forall>d'. d' dvd a \<and> d' dvd b \<longrightarrow> d' dvd ?gcd' a b))

goal (1 subgoal):
 1. (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') dvd gcd a b
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') dvd gcd a b

goal (1 subgoal):
 1. gcd a b dvd (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd')
[PROOF STEP]
show "(gcd a b) dvd (?gcd a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd a b dvd (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd')
[PROOF STEP]
by (metis (no_types) gcd_dvd1 gcd_dvd2 is_gcd is_gcd_def)
[PROOF STATE]
proof (state)
this:
gcd a b dvd (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
normalize (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = normalize (gcd a b)

goal (1 subgoal):
 1. normalize d = gcd a b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = d
normalize (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = normalize (gcd a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = d
normalize (case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd') = normalize (gcd a b)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det_multrow_div:
  assumes k: "k < n" and A: "A \<in> carrier_mat n n" and a0: "a \<noteq> 0"
  shows "det (multrow k a A :: 'a :: idom_divide mat) div a = det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (multrow k a A) div a = det A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (multrow k a A) div a = det A
[PROOF STEP]
have "det (multrow k a A) div a = a * det A div a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (multrow k a A) div a = a * det A div a
[PROOF STEP]
using k A
[PROOF STATE]
proof (prove)
using this:
k < n
A \<in> carrier_mat n n

goal (1 subgoal):
 1. det (multrow k a A) div a = a * det A div a
[PROOF STEP]
by (simp add: det_multrow)
[PROOF STATE]
proof (state)
this:
det (multrow k a A) div a = a * det A div a

goal (1 subgoal):
 1. det (multrow k a A) div a = det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (multrow k a A) div a = a * det A div a

goal (1 subgoal):
 1. det (multrow k a A) div a = det A
[PROOF STEP]
have "... = det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * det A div a = det A
[PROOF STEP]
using a0
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. a * det A div a = det A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * det A div a = det A

goal (1 subgoal):
 1. det (multrow k a A) div a = det A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (multrow k a A) div a = det A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (multrow k a A) div a = det A

goal (1 subgoal):
 1. det (multrow k a A) div a = det A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (multrow k a A) div a = det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closure_mono: "S \<subseteq> T \<Longrightarrow> closure S \<subseteq> closure T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> T \<Longrightarrow> closure S \<subseteq> closure T
[PROOF STEP]
unfolding closure_hull
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> T \<Longrightarrow> closed hull S \<subseteq> closed hull T
[PROOF STEP]
by (rule hull_mono)


[STATEMENT]
lemma mat_col_eqI:
  assumes wf1: "mat nr nc m1"
  and wf2: "mat nr nc m2"
  and id: "\<And> i. i < nc \<Longrightarrow> col m1 i = col m2 i"
  shows "m1 = m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m1 = m2
[PROOF STEP]
unfolding mat_col_eq[OF wf1 wf2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<nc. col m1 i = col m2 i
[PROOF STEP]
using id
[PROOF STATE]
proof (prove)
using this:
?i < nc \<Longrightarrow> col m1 ?i = col m2 ?i

goal (1 subgoal):
 1. \<forall>i<nc. col m1 i = col m2 i
[PROOF STEP]
by auto


[STATEMENT]
lemma index_tensor_mat_with_vec2_row_cond:
  fixes A B:: "complex Matrix.mat" and i:: "nat"
  assumes "i < 2 * (dim_row B)" and "i \<ge> dim_row B" and "dim_col B > 0"
and "dim_row A = 2" and "dim_col A = 1"
  shows "(A \<Otimes> B) $$ (i,0) = (A $$ (1,0)) * (B $$ (i-dim_row B,0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (1, 0) * B $$ (i - dim_row B, 0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (1, 0) * B $$ (i - dim_row B, 0)
[PROOF STEP]
have "(A \<Otimes> B) $$ (i,0) = A $$ (i div (dim_row B),0) * B $$ (i mod (dim_row B),0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (i div dim_row B, 0) * B $$ (i mod dim_row B, 0)
[PROOF STEP]
using assms index_tensor_mat[of A "dim_row A" "dim_col A" B "dim_row B" "dim_col B" i 0]
[PROOF STATE]
proof (prove)
using this:
i < 2 * dim_row B
dim_row B \<le> i
0 < dim_col B
dim_row A = 2
dim_col A = 1
\<lbrakk>dim_row A = dim_row A; dim_col A = dim_col A; dim_row B = dim_row B; dim_col B = dim_col B; i < dim_row A * dim_row B; 0 < dim_col A * dim_col B; 0 < dim_col A; 0 < dim_col B\<rbrakk> \<Longrightarrow> (A \<Otimes> B) $$ (i, 0) = A $$ (i div dim_row B, 0 div dim_col B) * B $$ (i mod dim_row B, 0 mod dim_col B)

goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (i div dim_row B, 0) * B $$ (i mod dim_row B, 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(A \<Otimes> B) $$ (i, 0) = A $$ (i div dim_row B, 0) * B $$ (i mod dim_row B, 0)

goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (1, 0) * B $$ (i - dim_row B, 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(A \<Otimes> B) $$ (i, 0) = A $$ (i div dim_row B, 0) * B $$ (i mod dim_row B, 0)

goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (1, 0) * B $$ (i - dim_row B, 0)
[PROOF STEP]
have "i div (dim_row B) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i div dim_row B = 1
[PROOF STEP]
using assms(1,2,4)
[PROOF STATE]
proof (prove)
using this:
i < 2 * dim_row B
dim_row B \<le> i
dim_row A = 2

goal (1 subgoal):
 1. i div dim_row B = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i div dim_row B = 1

goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (1, 0) * B $$ (i - dim_row B, 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i div dim_row B = 1
[PROOF STEP]
have "i mod (dim_row B) = i - (dim_row B)"
[PROOF STATE]
proof (prove)
using this:
i div dim_row B = 1

goal (1 subgoal):
 1. i mod dim_row B = i - dim_row B
[PROOF STEP]
by (simp add: modulo_nat_def)
[PROOF STATE]
proof (state)
this:
i mod dim_row B = i - dim_row B

goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (1, 0) * B $$ (i - dim_row B, 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(A \<Otimes> B) $$ (i, 0) = A $$ (i div dim_row B, 0) * B $$ (i mod dim_row B, 0)
i mod dim_row B = i - dim_row B
[PROOF STEP]
show "(A \<Otimes> B) $$ (i,0) = (A $$ (1,0)) * (B $$ (i-dim_row B,0))"
[PROOF STATE]
proof (prove)
using this:
(A \<Otimes> B) $$ (i, 0) = A $$ (i div dim_row B, 0) * B $$ (i mod dim_row B, 0)
i mod dim_row B = i - dim_row B

goal (1 subgoal):
 1. (A \<Otimes> B) $$ (i, 0) = A $$ (1, 0) * B $$ (i - dim_row B, 0)
[PROOF STEP]
by (simp add: \<open>i div dim_row B = 1\<close>)
[PROOF STATE]
proof (state)
this:
(A \<Otimes> B) $$ (i, 0) = A $$ (1, 0) * B $$ (i - dim_row B, 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma varnum_plus:
  "varnum X (s + t) = max (varnum X s) (varnum X (t::'x::countable \<Rightarrow>\<^sub>0 'b::ninv_comm_monoid_add))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. varnum X (s + t) = max (varnum X s) (varnum X t)
[PROOF STEP]
proof (simp add: varnum_def keys_plus_ninv_comm_monoid_add image_Un Un_Diff del: Diff_eq_empty_iff, intro impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
assume 1: "keys s - X \<noteq> {}" and 2: "keys t - X \<noteq> {}"
[PROOF STATE]
proof (state)
this:
keys s - X \<noteq> {}
keys t - X \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
have "finite (elem_index ` (keys s - X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (elem_index ` (keys s - X))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (elem_index ` (keys s - X))

goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (elem_index ` (keys s - X))

goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
keys s - X \<noteq> {}
[PROOF STEP]
have "elem_index ` (keys s - X) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
keys s - X \<noteq> {}

goal (1 subgoal):
 1. elem_index ` (keys s - X) \<noteq> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
elem_index ` (keys s - X) \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
elem_index ` (keys s - X) \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
have "finite (elem_index ` (keys t - X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (elem_index ` (keys t - X))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (elem_index ` (keys t - X))

goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (elem_index ` (keys t - X))

goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
from 2
[PROOF STATE]
proof (chain)
picking this:
keys t - X \<noteq> {}
[PROOF STEP]
have "elem_index ` (keys t - X) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
keys t - X \<noteq> {}

goal (1 subgoal):
 1. elem_index ` (keys t - X) \<noteq> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
elem_index ` (keys t - X) \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>keys s - X \<noteq> {}; keys t - X \<noteq> {}\<rbrakk> \<Longrightarrow> Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (elem_index ` (keys s - X))
elem_index ` (keys s - X) \<noteq> {}
finite (elem_index ` (keys t - X))
elem_index ` (keys t - X) \<noteq> {}
[PROOF STEP]
show "Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) =
                    max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))"
[PROOF STATE]
proof (prove)
using this:
finite (elem_index ` (keys s - X))
elem_index ` (keys s - X) \<noteq> {}
finite (elem_index ` (keys t - X))
elem_index ` (keys t - X) \<noteq> {}

goal (1 subgoal):
 1. Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))
[PROOF STEP]
by (rule Max_Un)
[PROOF STATE]
proof (state)
this:
Max (elem_index ` (keys s - X) \<union> elem_index ` (keys t - X)) = max (Max (elem_index ` (keys s - X))) (Max (elem_index ` (keys t - X)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj_Eps:
  assumes "equiv A r" and "X \<in> A//r"
  shows "proj r (Eps (\<lambda>x. x \<in> X)) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj r (SOME x. x \<in> X) = X
[PROOF STEP]
unfolding proj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r `` {SOME x. x \<in> X} = X
[PROOF STEP]
proof auto
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. (SOME x. x \<in> X, x) \<in> r \<Longrightarrow> x \<in> X
 2. \<And>x. x \<in> X \<Longrightarrow> (SOME x. x \<in> X, x) \<in> r
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. (SOME x. x \<in> X, x) \<in> r \<Longrightarrow> x \<in> X
 2. \<And>x. x \<in> X \<Longrightarrow> (SOME x. x \<in> X, x) \<in> r
[PROOF STEP]
assume x: "x \<in> X"
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (2 subgoals):
 1. \<And>x. (SOME x. x \<in> X, x) \<in> r \<Longrightarrow> x \<in> X
 2. \<And>x. x \<in> X \<Longrightarrow> (SOME x. x \<in> X, x) \<in> r
[PROOF STEP]
thus "(Eps (\<lambda>x. x \<in> X), x) \<in> r"
[PROOF STATE]
proof (prove)
using this:
x \<in> X

goal (1 subgoal):
 1. (SOME x. x \<in> X, x) \<in> r
[PROOF STEP]
using assms equiv_Eps_in in_quotient_imp_in_rel
[PROOF STATE]
proof (prove)
using this:
x \<in> X
equiv A r
X \<in> A // r
\<lbrakk>equiv ?A ?r; ?X \<in> ?A // ?r\<rbrakk> \<Longrightarrow> (SOME x. x \<in> ?X) \<in> ?X
\<lbrakk>equiv ?A ?r; ?X \<in> ?A // ?r; {?x, ?y} \<subseteq> ?X\<rbrakk> \<Longrightarrow> (?x, ?y) \<in> ?r

goal (1 subgoal):
 1. (SOME x. x \<in> X, x) \<in> r
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
(SOME x. x \<in> X, x) \<in> r

goal (1 subgoal):
 1. \<And>x. (SOME x. x \<in> X, x) \<in> r \<Longrightarrow> x \<in> X
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (SOME x. x \<in> X, x) \<in> r \<Longrightarrow> x \<in> X
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (SOME x. x \<in> X, x) \<in> r \<Longrightarrow> x \<in> X
[PROOF STEP]
assume "(Eps (\<lambda>x. x \<in> X),x) \<in> r"
[PROOF STATE]
proof (state)
this:
(SOME x. x \<in> X, x) \<in> r

goal (1 subgoal):
 1. \<And>x. (SOME x. x \<in> X, x) \<in> r \<Longrightarrow> x \<in> X
[PROOF STEP]
thus "x \<in> X"
[PROOF STATE]
proof (prove)
using this:
(SOME x. x \<in> X, x) \<in> r

goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
using in_quotient_imp_closed[OF assms equiv_Eps_in[OF assms]]
[PROOF STATE]
proof (prove)
using this:
(SOME x. x \<in> X, x) \<in> r
(SOME x. x \<in> X, ?y) \<in> r \<Longrightarrow> ?y \<in> X

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powser_sums_if:
  "(\<lambda>n. (if n = m then (1 :: 'a::{ring_1,topological_space}) else 0) * z^n) sums z^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) sums z ^ m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) sums z ^ m
[PROOF STEP]
have "(\<lambda>n. (if n = m then 1 else 0) * z^n) = (\<lambda>n. if n = m then z^n else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) = (\<lambda>n. if n = m then z ^ n else (0::'a))
[PROOF STEP]
by (intro ext) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) = (\<lambda>n. if n = m then z ^ n else (0::'a))

goal (1 subgoal):
 1. (\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) sums z ^ m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) = (\<lambda>n. if n = m then z ^ n else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) = (\<lambda>n. if n = m then z ^ n else (0::'a))

goal (1 subgoal):
 1. (\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) sums z ^ m
[PROOF STEP]
by (simp add: sums_single)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (if n = m then 1::'a else (0::'a)) * z ^ n) sums z ^ m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreflexive_linorder_matrix_2:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  assumes "\<forall>i . f (i,i) = bot"
    shows "matrix_stone_relation_algebra.irreflexive f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.irreflexive f
[PROOF STEP]
proof (unfold less_eq_matrix_def, rule allI, rule prod_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e a b. f (a, b) \<le> (\<ominus> mone) (a, b)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e a b. f (a, b) \<le> (\<ominus> mone) (a, b)
[PROOF STEP]
show "f (i,j) \<le> (\<ominus>mone) (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
proof (cases "i = j")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
 2. i \<noteq> j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
assume "i = j"
[PROOF STATE]
proof (state)
this:
i = j

goal (2 subgoals):
 1. i = j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
 2. i \<noteq> j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i = j

goal (1 subgoal):
 1. f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
f (i, j) \<le> (\<ominus> mone) (i, j)

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
assume "i \<noteq> j"
[PROOF STATE]
proof (state)
this:
i \<noteq> j

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
hence "(bot::'b) = mone (i,j)"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j

goal (1 subgoal):
 1. bot = mone (i, j)
[PROOF STEP]
by (simp add: one_matrix_def)
[PROOF STATE]
proof (state)
this:
bot = mone (i, j)

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
hence "(top::'b) = (\<ominus>mone) (i,j)"
[PROOF STATE]
proof (prove)
using this:
bot = mone (i, j)

goal (1 subgoal):
 1. top = (\<ominus> mone) (i, j)
[PROOF STEP]
by (simp add: uminus_matrix_def)
[PROOF STATE]
proof (state)
this:
top = (\<ominus> mone) (i, j)

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
top = (\<ominus> mone) (i, j)

goal (1 subgoal):
 1. f (i, j) \<le> (\<ominus> mone) (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (i, j) \<le> (\<ominus> mone) (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (i, j) \<le> (\<ominus> mone) (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_skelAbs_vsubstAbs:
assumes "wlsAbs (us,s) A"
shows "skelAbs (A $[y1 // y2]_ys) = skelAbs A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. skelAbs (A $[y1 // y2]_ys) = skelAbs A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A

goal (1 subgoal):
 1. skelAbs (A $[y1 // y2]_ys) = skelAbs A
[PROOF STEP]
by(simp add: skelAbs_vsubstAbs)


[STATEMENT]
lemma Collect_lessThan: "{i. enat i < n} = the_enat ` {..< n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. enat i < n} = the_enat ` {..<n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {i. enat i < n} = the_enat ` {..<n}
[PROOF STEP]
have 1: "\<infinity> \<notin> {..< n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<infinity> \<notin> {..<n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<infinity> \<notin> {..<n}

goal (1 subgoal):
 1. {i. enat i < n} = the_enat ` {..<n}
[PROOF STEP]
have "{i. enat i < n} = {i. enat i \<in> {..< n}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. enat i < n} = {i. enat i \<in> {..<n}}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{i. enat i < n} = {i. enat i \<in> {..<n}}

goal (1 subgoal):
 1. {i. enat i < n} = the_enat ` {..<n}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{i. enat i < n} = {i. enat i \<in> {..<n}}

goal (1 subgoal):
 1. {i. enat i < n} = the_enat ` {..<n}
[PROOF STEP]
have "\<dots> = the_enat ` {..< n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. enat i \<in> {..<n}} = the_enat ` {..<n}
[PROOF STEP]
using enat_Collect 1
[PROOF STATE]
proof (prove)
using this:
\<infinity> \<notin> ?A \<Longrightarrow> {i. enat i \<in> ?A} = the_enat ` ?A
\<infinity> \<notin> {..<n}

goal (1 subgoal):
 1. {i. enat i \<in> {..<n}} = the_enat ` {..<n}
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
{i. enat i \<in> {..<n}} = the_enat ` {..<n}

goal (1 subgoal):
 1. {i. enat i < n} = the_enat ` {..<n}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{i. enat i < n} = the_enat ` {..<n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{i. enat i < n} = the_enat ` {..<n}

goal (1 subgoal):
 1. {i. enat i < n} = the_enat ` {..<n}
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
{i. enat i < n} = the_enat ` {..<n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma group_card_in_sizes: "g \<in> \<G> \<Longrightarrow> card g \<in> group_sizes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> \<G> \<Longrightarrow> card g \<in> group_sizes
[PROOF STEP]
unfolding group_sizes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> \<G> \<Longrightarrow> card g \<in> {card G |G. G \<in> \<G>}
[PROOF STEP]
by auto


[STATEMENT]
lemma transitivity2_L:
  assumes \<open>\<forall>\<phi> \<in> B. A \<turnstile> \<phi>\<close>
      and \<open>B \<turnstile> \<psi>\<close>
    shows \<open>A \<turnstile> \<psi>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<turnstile> \<psi>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<turnstile> \<psi>
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<phi>\<in>B. A \<turnstile> \<phi>
[PROOF STEP]
have \<open>B \<subseteq> Cn(A)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>\<phi>\<in>B. A \<turnstile> \<phi>

goal (1 subgoal):
 1. B \<subseteq> Cn A
[PROOF STEP]
by (simp add: infer_def subsetI)
[PROOF STATE]
proof (state)
this:
B \<subseteq> Cn A

goal (1 subgoal):
 1. A \<turnstile> \<psi>
[PROOF STEP]
hence \<open>Cn(B) \<subseteq> Cn(A)\<close>
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> Cn A

goal (1 subgoal):
 1. Cn B \<subseteq> Cn A
[PROOF STEP]
using idempotency_L monotonicity_L
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> Cn A
Cn (Cn ?A) = Cn ?A
?A \<subseteq> ?B \<Longrightarrow> Cn ?A \<subseteq> Cn ?B

goal (1 subgoal):
 1. Cn B \<subseteq> Cn A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Cn B \<subseteq> Cn A

goal (1 subgoal):
 1. A \<turnstile> \<psi>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Cn B \<subseteq> Cn A

goal (1 subgoal):
 1. A \<turnstile> \<psi>
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
B \<turnstile> \<psi>
[PROOF STEP]
have \<open>\<psi> \<in> Cn(B)\<close>
[PROOF STATE]
proof (prove)
using this:
B \<turnstile> \<psi>

goal (1 subgoal):
 1. \<psi> \<in> Cn B
[PROOF STEP]
by (simp add: infer_def)
[PROOF STATE]
proof (state)
this:
\<psi> \<in> Cn B

goal (1 subgoal):
 1. A \<turnstile> \<psi>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Cn B \<subseteq> Cn A
\<psi> \<in> Cn B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Cn B \<subseteq> Cn A
\<psi> \<in> Cn B

goal (1 subgoal):
 1. A \<turnstile> \<psi>
[PROOF STEP]
using infer_def
[PROOF STATE]
proof (prove)
using this:
Cn B \<subseteq> Cn A
\<psi> \<in> Cn B
?A \<turnstile> ?\<phi> \<equiv> ?\<phi> \<in> Cn ?A

goal (1 subgoal):
 1. A \<turnstile> \<psi>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<turnstile> \<psi>

goal:
No subgoals!
[PROOF STEP]
qed