[STATEMENT]
lemma ce_rel_lm_29: "\<lbrakk> A \<in> ce_sets; B \<in> ce_sets \<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
assume A_ce: "A \<in> ce_sets"
[PROOF STATE]
proof (state)
this:
A \<in> ce_sets

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
assume B_ce: "B \<in> ce_sets"
[PROOF STATE]
proof (state)
this:
B \<in> ce_sets

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
define r_a where "r_a = {(x,(0::nat)) | x. x \<in> A}"
[PROOF STATE]
proof (state)
this:
r_a = {(x, 0) |x. x \<in> A}

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
define r_b where "r_b = {((0::nat),z) | z. z \<in> B}"
[PROOF STATE]
proof (state)
this:
r_b = {(0, z) |z. z \<in> B}

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
have L1: "r_a O r_b = A \<times> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r_a O r_b = A \<times> B
[PROOF STEP]
by (unfold r_a_def, unfold r_b_def, auto)
[PROOF STATE]
proof (state)
this:
r_a O r_b = A \<times> B

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
have r_a_ce: "r_a \<in> ce_rels"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r_a \<in> ce_rels
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r_a \<in> ce_rels
[PROOF STEP]
have loc1: "ce_rel_to_set r_a = { c_pair x 0 | x. x \<in> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ce_rel_to_set r_a = {c_pair x 0 |x. x \<in> A}
[PROOF STEP]
by (unfold r_a_def, unfold ce_rel_to_set_def, auto)
[PROOF STATE]
proof (state)
this:
ce_rel_to_set r_a = {c_pair x 0 |x. x \<in> A}

goal (1 subgoal):
 1. r_a \<in> ce_rels
[PROOF STEP]
define p where "p x = c_pair x 0" for x
[PROOF STATE]
proof (state)
this:
p ?x = c_pair ?x 0

goal (1 subgoal):
 1. r_a \<in> ce_rels
[PROOF STEP]
have p_is_pr: "p \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> PrimRec1
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c_pair x 0) \<in> PrimRec1
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
p \<in> PrimRec1

goal (1 subgoal):
 1. r_a \<in> ce_rels
[PROOF STEP]
from A_ce p_is_pr
[PROOF STATE]
proof (chain)
picking this:
A \<in> ce_sets
p \<in> PrimRec1
[PROOF STEP]
have "{ c_pair x 0 | x. x \<in> A} \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
A \<in> ce_sets
p \<in> PrimRec1

goal (1 subgoal):
 1. {c_pair x 0 |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
A \<in> ce_sets
(\<lambda>x. c_pair x 0) \<in> PrimRec1

goal (1 subgoal):
 1. {c_pair x 0 |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
by (simp add: ce_set_lm_7)
[PROOF STATE]
proof (state)
this:
{c_pair x 0 |x. x \<in> A} \<in> ce_sets

goal (1 subgoal):
 1. r_a \<in> ce_rels
[PROOF STEP]
with loc1
[PROOF STATE]
proof (chain)
picking this:
ce_rel_to_set r_a = {c_pair x 0 |x. x \<in> A}
{c_pair x 0 |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
have "ce_rel_to_set r_a \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
ce_rel_to_set r_a = {c_pair x 0 |x. x \<in> A}
{c_pair x 0 |x. x \<in> A} \<in> ce_sets

goal (1 subgoal):
 1. ce_rel_to_set r_a \<in> ce_sets
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ce_rel_to_set r_a \<in> ce_sets

goal (1 subgoal):
 1. r_a \<in> ce_rels
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ce_rel_to_set r_a \<in> ce_sets
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ce_rel_to_set r_a \<in> ce_sets

goal (1 subgoal):
 1. r_a \<in> ce_rels
[PROOF STEP]
by (rule ce_rel_lm_7)
[PROOF STATE]
proof (state)
this:
r_a \<in> ce_rels

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
r_a \<in> ce_rels

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
have r_b_ce: "r_b \<in> ce_rels"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r_b \<in> ce_rels
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r_b \<in> ce_rels
[PROOF STEP]
have loc1: "ce_rel_to_set r_b = { c_pair 0 z | z. z \<in> B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ce_rel_to_set r_b = {c_pair 0 z |z. z \<in> B}
[PROOF STEP]
by (unfold r_b_def, unfold ce_rel_to_set_def, auto)
[PROOF STATE]
proof (state)
this:
ce_rel_to_set r_b = {c_pair 0 z |z. z \<in> B}

goal (1 subgoal):
 1. r_b \<in> ce_rels
[PROOF STEP]
define p where "p z = c_pair 0 z" for z
[PROOF STATE]
proof (state)
this:
p ?z = c_pair 0 ?z

goal (1 subgoal):
 1. r_b \<in> ce_rels
[PROOF STEP]
have p_is_pr: "p \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> PrimRec1
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_pair 0 \<in> PrimRec1
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
p \<in> PrimRec1

goal (1 subgoal):
 1. r_b \<in> ce_rels
[PROOF STEP]
from B_ce p_is_pr
[PROOF STATE]
proof (chain)
picking this:
B \<in> ce_sets
p \<in> PrimRec1
[PROOF STEP]
have "{ c_pair 0 z | z. z \<in> B} \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
B \<in> ce_sets
p \<in> PrimRec1

goal (1 subgoal):
 1. {c_pair 0 z |z. z \<in> B} \<in> ce_sets
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
using this:
B \<in> ce_sets
c_pair 0 \<in> PrimRec1

goal (1 subgoal):
 1. {c_pair 0 z |z. z \<in> B} \<in> ce_sets
[PROOF STEP]
by (simp add: ce_set_lm_7)
[PROOF STATE]
proof (state)
this:
{c_pair 0 z |z. z \<in> B} \<in> ce_sets

goal (1 subgoal):
 1. r_b \<in> ce_rels
[PROOF STEP]
with loc1
[PROOF STATE]
proof (chain)
picking this:
ce_rel_to_set r_b = {c_pair 0 z |z. z \<in> B}
{c_pair 0 z |z. z \<in> B} \<in> ce_sets
[PROOF STEP]
have "ce_rel_to_set r_b \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
ce_rel_to_set r_b = {c_pair 0 z |z. z \<in> B}
{c_pair 0 z |z. z \<in> B} \<in> ce_sets

goal (1 subgoal):
 1. ce_rel_to_set r_b \<in> ce_sets
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ce_rel_to_set r_b \<in> ce_sets

goal (1 subgoal):
 1. r_b \<in> ce_rels
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ce_rel_to_set r_b \<in> ce_sets
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ce_rel_to_set r_b \<in> ce_sets

goal (1 subgoal):
 1. r_b \<in> ce_rels
[PROOF STEP]
by (rule ce_rel_lm_7)
[PROOF STATE]
proof (state)
this:
r_b \<in> ce_rels

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
r_b \<in> ce_rels

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
from r_b_ce r_a_ce
[PROOF STATE]
proof (chain)
picking this:
r_b \<in> ce_rels
r_a \<in> ce_rels
[PROOF STEP]
have "r_a O r_b \<in> ce_rels"
[PROOF STATE]
proof (prove)
using this:
r_b \<in> ce_rels
r_a \<in> ce_rels

goal (1 subgoal):
 1. r_a O r_b \<in> ce_rels
[PROOF STEP]
by (rule ce_rel_lm_24)
[PROOF STATE]
proof (state)
this:
r_a O r_b \<in> ce_rels

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; B \<in> ce_sets\<rbrakk> \<Longrightarrow> A \<times> B \<in> ce_rels
[PROOF STEP]
with L1
[PROOF STATE]
proof (chain)
picking this:
r_a O r_b = A \<times> B
r_a O r_b \<in> ce_rels
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r_a O r_b = A \<times> B
r_a O r_b \<in> ce_rels

goal (1 subgoal):
 1. A \<times> B \<in> ce_rels
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<times> B \<in> ce_rels

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_fst_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> y \<in> B \<Longrightarrow> A \<subseteq> fst ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<times> B \<subseteq> S; y \<in> B\<rbrakk> \<Longrightarrow> A \<subseteq> fst ` S
[PROOF STEP]
unfolding image_def subset_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A \<times> B. x \<in> S; y \<in> B\<rbrakk> \<Longrightarrow> \<forall>x\<in>A. x \<in> {y. \<exists>x\<in>S. y = fst x}
[PROOF STEP]
by force


[STATEMENT]
lemma arc_eq_1:
  assumes "arc x"
    shows "x = x * x\<^sup>T * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = x * x\<^sup>T * x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = x * x\<^sup>T * x
[PROOF STEP]
have "x * x\<^sup>T * x \<le> x * top * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * x\<^sup>T * x \<le> x * top * x
[PROOF STEP]
by (simp add: mult_left_isotone mult_right_isotone)
[PROOF STATE]
proof (state)
this:
x * x\<^sup>T * x \<le> x * top * x

goal (1 subgoal):
 1. x = x * x\<^sup>T * x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * x\<^sup>T * x \<le> x * top * x

goal (1 subgoal):
 1. x = x * x\<^sup>T * x
[PROOF STEP]
have "... \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * top * x \<le> x
[PROOF STEP]
by (simp add: assms arc_top_arc)
[PROOF STATE]
proof (state)
this:
x * top * x \<le> x

goal (1 subgoal):
 1. x = x * x\<^sup>T * x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x * x\<^sup>T * x \<le> x
[PROOF STEP]
have "x * x\<^sup>T * x \<le> x"
[PROOF STATE]
proof (prove)
using this:
x * x\<^sup>T * x \<le> x

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

goal (1 subgoal):
 1. x = x * x\<^sup>T * x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x * x\<^sup>T * x \<le> x

goal (1 subgoal):
 1. x = x * x\<^sup>T * x
[PROOF STEP]
by (simp add: order.antisym ex231c)
[PROOF STATE]
proof (state)
this:
x = x * x\<^sup>T * x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_upds_fold_map_upd:
  "m(ks[\<mapsto>]vs) = foldl (\<lambda>m (k, v). m(k \<mapsto> v)) m (zip ks vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m(ks [\<mapsto>] vs) = foldl (\<lambda>m (k, v). m(k \<mapsto> v)) m (zip ks vs)
[PROOF STEP]
unfolding map_upds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m ++ map_of (rev (zip ks vs)) = foldl (\<lambda>m (k, v). m(k \<mapsto> v)) m (zip ks vs)
[PROOF STEP]
proof (rule sym, rule zip_obtain_same_length)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>zs ws n. \<lbrakk>length zs = length ws; n = min (length ks) (length vs); zs = take n ks; ws = take n vs\<rbrakk> \<Longrightarrow> foldl (\<lambda>m a. case a of (k, v) \<Rightarrow> m(k \<mapsto> v)) m (zip zs ws) = m ++ map_of (rev (zip zs ws))
[PROOF STEP]
fix ks :: "'a list" and vs :: "'b list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>zs ws n. \<lbrakk>length zs = length ws; n = min (length ks) (length vs); zs = take n ks; ws = take n vs\<rbrakk> \<Longrightarrow> foldl (\<lambda>m a. case a of (k, v) \<Rightarrow> m(k \<mapsto> v)) m (zip zs ws) = m ++ map_of (rev (zip zs ws))
[PROOF STEP]
assume "length ks = length vs"
[PROOF STATE]
proof (state)
this:
length ks = length vs

goal (1 subgoal):
 1. \<And>zs ws n. \<lbrakk>length zs = length ws; n = min (length ks) (length vs); zs = take n ks; ws = take n vs\<rbrakk> \<Longrightarrow> foldl (\<lambda>m a. case a of (k, v) \<Rightarrow> m(k \<mapsto> v)) m (zip zs ws) = m ++ map_of (rev (zip zs ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length ks = length vs
[PROOF STEP]
show "foldl (\<lambda>m (k, v). m(k\<mapsto>v)) m (zip ks vs) = m ++ map_of (rev (zip ks vs))"
[PROOF STATE]
proof (prove)
using this:
length ks = length vs

goal (1 subgoal):
 1. foldl (\<lambda>m (k, v). m(k \<mapsto> v)) m (zip ks vs) = m ++ map_of (rev (zip ks vs))
[PROOF STEP]
by(induct arbitrary: m rule: list_induct2) simp_all
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>m (k, v). m(k \<mapsto> v)) m (zip ks vs) = m ++ map_of (rev (zip ks vs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma edges_empty[simp]: "edges empty = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges Graph.empty = {}
[PROOF STEP]
unfolding empty_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges \<lparr>nodes = {}, edges = {}\<rparr> = {}
[PROOF STEP]
by simp


[STATEMENT]
lemma qelim:
  assumes qe_inv: "\<forall>bs p. qfree p \<longrightarrow> qfree (qe p) \<and> (Ifm vs bs (qe p) = Ifm vs bs (E p))"
  shows "\<And> bs. qfree (qelim p qe) \<and> (Ifm vs bs (qelim p qe) = Ifm vs bs p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>bs. qfree (qelim p qe) \<and> Ifm vs bs (qelim p qe) = Ifm vs bs p
[PROOF STEP]
using qe_inv DJ_qe[OF CJNB_qe[OF qe_inv]]
[PROOF STATE]
proof (prove)
using this:
\<forall>bs p. qfree p \<longrightarrow> qfree (qe p) \<and> Ifm vs bs (qe p) = Ifm vs bs (E p)
\<forall>bs p. qfree p \<longrightarrow> qfree (DJ (CJNB qe) p) \<and> Ifm vs bs (DJ (CJNB qe) p) = Ifm vs bs (E p)

goal (1 subgoal):
 1. \<And>bs. qfree (qelim p qe) \<and> Ifm vs bs (qelim p qe) = Ifm vs bs p
[PROOF STEP]
by (induct p rule: qelim.induct) auto


[STATEMENT]
lemma G_lower:
  assumes x: "x > 0" and n: "n \<ge> 1"
  shows  "Gamma_series x n \<le> G x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
have "(ln \<circ> G) (real (Suc n)) \<le> ((ln \<circ> G) (real (Suc n) + x) -
          (ln \<circ> G) (real (Suc n) - 1)) / (real (Suc n) + x - (real (Suc n) - 1)) *
           (real (Suc n) - (real (Suc n) - 1)) + (ln \<circ> G) (real (Suc n) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ln \<circ> G) (real (Suc n)) \<le> ((ln \<circ> G) (real (Suc n) + x) - (ln \<circ> G) (real (Suc n) - 1)) / (real (Suc n) + x - (real (Suc n) - 1)) * (real (Suc n) - (real (Suc n) - 1)) + (ln \<circ> G) (real (Suc n) - 1)
[PROOF STEP]
using x n
[PROOF STATE]
proof (prove)
using this:
0 < x
1 \<le> n

goal (1 subgoal):
 1. (ln \<circ> G) (real (Suc n)) \<le> ((ln \<circ> G) (real (Suc n) + x) - (ln \<circ> G) (real (Suc n) - 1)) / (real (Suc n) + x - (real (Suc n) - 1)) * (real (Suc n) - (real (Suc n) - 1)) + (ln \<circ> G) (real (Suc n) - 1)
[PROOF STEP]
by (intro convex_onD_Icc' convex_on_subset[OF log_convex_G]) auto
[PROOF STATE]
proof (state)
this:
(ln \<circ> G) (real (Suc n)) \<le> ((ln \<circ> G) (real (Suc n) + x) - (ln \<circ> G) (real (Suc n) - 1)) / (real (Suc n) + x - (real (Suc n) - 1)) * (real (Suc n) - (real (Suc n) - 1)) + (ln \<circ> G) (real (Suc n) - 1)

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
hence "S (of_nat n) (of_nat (Suc n)) \<le> S (of_nat (Suc n)) (of_nat (Suc n) + x)"
[PROOF STATE]
proof (prove)
using this:
(ln \<circ> G) (real (Suc n)) \<le> ((ln \<circ> G) (real (Suc n) + x) - (ln \<circ> G) (real (Suc n) - 1)) / (real (Suc n) + x - (real (Suc n) - 1)) * (real (Suc n) - (real (Suc n) - 1)) + (ln \<circ> G) (real (Suc n) - 1)

goal (1 subgoal):
 1. S (real n) (real (Suc n)) \<le> S (real (Suc n)) (real (Suc n) + x)
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
(ln \<circ> G) (real (Suc n)) \<le> ((ln \<circ> G) (real (Suc n) + x) - (ln \<circ> G) (real (Suc n) - 1)) / (real (Suc n) + x - (real (Suc n) - 1)) * (real (Suc n) - (real (Suc n) - 1)) + (ln \<circ> G) (real (Suc n) - 1)

goal (1 subgoal):
 1. (ln (G (real (Suc n))) - ln (G (real n))) / (real (Suc n) - real n) \<le> (ln (G (real (Suc n) + x)) - ln (G (real (Suc n)))) / (real (Suc n) + x - real (Suc n))
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
(ln \<circ> G) (real (Suc n)) \<le> ((ln \<circ> G) (real (Suc n) + x) - (ln \<circ> G) (real (Suc n) - 1)) / (real (Suc n) + x - (real (Suc n) - 1)) * (real (Suc n) - (real (Suc n) - 1)) + (ln \<circ> G) (real (Suc n) - 1)
0 < x

goal (1 subgoal):
 1. (ln (G (real (Suc n))) - ln (G (real n))) / (real (Suc n) - real n) \<le> (ln (G (real (Suc n) + x)) - ln (G (real (Suc n)))) / (real (Suc n) + x - real (Suc n))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
S (real n) (real (Suc n)) \<le> S (real (Suc n)) (real (Suc n) + x)

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S (real n) (real (Suc n)) \<le> S (real (Suc n)) (real (Suc n) + x)

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
have "S (of_nat n) (of_nat (Suc n)) = ln (fact n) - ln (fact (n-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S (real n) (real (Suc n)) = ln (fact n) - ln (fact (n - 1))
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ln (G (real (Suc n))) - ln (G (real n))) / (real (Suc n) - real n) = ln (fact n) - ln (fact (n - 1))
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. (ln (G (real (Suc n))) - ln (G (real n))) / (real (Suc n) - real n) = ln (fact n) - ln (fact (n - 1))
[PROOF STEP]
by (subst (1 2) G_fact [symmetric]) (simp_all add: add_ac of_nat_diff)
[PROOF STATE]
proof (state)
this:
S (real n) (real (Suc n)) = ln (fact n) - ln (fact (n - 1))

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S (real n) (real (Suc n)) = ln (fact n) - ln (fact (n - 1))

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
have "\<dots> = ln (fact n / fact (n-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (fact n) - ln (fact (n - 1)) = ln (fact n / fact (n - 1))
[PROOF STEP]
by (subst ln_div) simp_all
[PROOF STATE]
proof (state)
this:
ln (fact n) - ln (fact (n - 1)) = ln (fact n / fact (n - 1))

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (fact n) - ln (fact (n - 1)) = ln (fact n / fact (n - 1))

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n
[PROOF STEP]
have "fact n / fact (n - 1) = n"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. fact n / fact (n - 1) = real n
[PROOF STEP]
by (cases n) simp_all
[PROOF STATE]
proof (state)
this:
fact n / fact (n - 1) = real n

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (real n) \<le> S (real (Suc n)) (real (Suc n) + x)
[PROOF STEP]
have "x * ln (real n) + ln (fact n) \<le> ln (G (real (Suc n) + x))"
[PROOF STATE]
proof (prove)
using this:
ln (real n) \<le> S (real (Suc n)) (real (Suc n) + x)

goal (1 subgoal):
 1. x * ln (real n) + ln (fact n) \<le> ln (G (real (Suc n) + x))
[PROOF STEP]
using x n
[PROOF STATE]
proof (prove)
using this:
ln (real n) \<le> S (real (Suc n)) (real (Suc n) + x)
0 < x
1 \<le> n

goal (1 subgoal):
 1. x * ln (real n) + ln (fact n) \<le> ln (G (real (Suc n) + x))
[PROOF STEP]
by (subst (asm) S_eq) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
x * ln (real n) + ln (fact n) \<le> ln (G (real (Suc n) + x))

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * ln (real n) + ln (fact n) \<le> ln (G (real (Suc n) + x))

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
have "x * ln (real n) + ln (fact n) = ln (exp (x * ln (real n)) * fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * ln (real n) + ln (fact n) = ln (exp (x * ln (real n)) * fact n)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. x * ln (real n) + ln (fact n) = ln (exp (x * ln (real n)) * fact n)
[PROOF STEP]
by (simp add: ln_mult)
[PROOF STATE]
proof (state)
this:
x * ln (real n) + ln (fact n) = ln (exp (x * ln (real n)) * fact n)

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (exp (x * ln (real n)) * fact n) \<le> ln (G (real (Suc n) + x))
[PROOF STEP]
have "exp (x * ln (real n)) * fact n \<le> G (real (Suc n) + x)"
[PROOF STATE]
proof (prove)
using this:
ln (exp (x * ln (real n)) * fact n) \<le> ln (G (real (Suc n) + x))

goal (1 subgoal):
 1. exp (x * ln (real n)) * fact n \<le> G (real (Suc n) + x)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
ln (exp (x * ln (real n)) * fact n) \<le> ln (G (real (Suc n) + x))
0 < x

goal (1 subgoal):
 1. exp (x * ln (real n)) * fact n \<le> G (real (Suc n) + x)
[PROOF STEP]
by (subst (asm) ln_le_cancel_iff) (simp_all add: G_pos)
[PROOF STATE]
proof (state)
this:
exp (x * ln (real n)) * fact n \<le> G (real (Suc n) + x)

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (x * ln (real n)) * fact n \<le> G (real (Suc n) + x)

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
have "G (real (Suc n) + x) = pochhammer x (Suc n) * G x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G (real (Suc n) + x) = pochhammer x (Suc n) * G x
[PROOF STEP]
using G_plus1[of "real (Suc n) + x" for n] G_plus1[of x] x
[PROOF STATE]
proof (prove)
using this:
0 < real (Suc ?na2) + x \<Longrightarrow> G (real (Suc ?na2) + x + 1) = (real (Suc ?na2) + x) * G (real (Suc ?na2) + x)
0 < x \<Longrightarrow> G (x + 1) = x * G x
0 < x

goal (1 subgoal):
 1. G (real (Suc n) + x) = pochhammer x (Suc n) * G x
[PROOF STEP]
by (induction n) (simp_all add: pochhammer_Suc add_ac)
[PROOF STATE]
proof (state)
this:
G (real (Suc n) + x) = pochhammer x (Suc n) * G x

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
exp (x * ln (real n)) * fact n \<le> pochhammer x (Suc n) * G x
[PROOF STEP]
show "Gamma_series x n \<le> G x"
[PROOF STATE]
proof (prove)
using this:
exp (x * ln (real n)) * fact n \<le> pochhammer x (Suc n) * G x

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
exp (x * ln (real n)) * fact n \<le> pochhammer x (Suc n) * G x
0 < x

goal (1 subgoal):
 1. Gamma_series x n \<le> G x
[PROOF STEP]
by (simp add: field_simps pochhammer_pos Gamma_series_def)
[PROOF STATE]
proof (state)
this:
Gamma_series x n \<le> G x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma non_empty[simp]: "space (M i) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (M i) \<noteq> {}
[PROOF STEP]
proof (induction i rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> space (M y) \<noteq> {}) \<Longrightarrow> space (M x) \<noteq> {}
[PROOF STEP]
case (less i)
[PROOF STATE]
proof (state)
this:
?y < i \<Longrightarrow> space (M ?y) \<noteq> {}

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> space (M y) \<noteq> {}) \<Longrightarrow> space (M x) \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?y < i \<Longrightarrow> space (M ?y) \<noteq> {}
[PROOF STEP]
obtain x where "\<And>j. j < i \<Longrightarrow> x j \<in> space (M j)"
[PROOF STATE]
proof (prove)
using this:
?y < i \<Longrightarrow> space (M ?y) \<noteq> {}

goal (1 subgoal):
 1. (\<And>x. (\<And>j. j < i \<Longrightarrow> x j \<in> space (M j)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding ex_in_conv[symmetric]
[PROOF STATE]
proof (prove)
using this:
?y < i \<Longrightarrow> \<exists>x. x \<in> space (M ?y)

goal (1 subgoal):
 1. (\<And>x. (\<And>j. j < i \<Longrightarrow> x j \<in> space (M j)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?j < i \<Longrightarrow> x ?j \<in> space (M ?j)

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> space (M y) \<noteq> {}) \<Longrightarrow> space (M x) \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?j < i \<Longrightarrow> x ?j \<in> space (M ?j)
[PROOF STEP]
have *: "restrict x {0..<i} \<in> space (PiM {0..<i} M)"
[PROOF STATE]
proof (prove)
using this:
?j < i \<Longrightarrow> x ?j \<in> space (M ?j)

goal (1 subgoal):
 1. restrict x {0..<i} \<in> space (Pi\<^sub>M {0..<i} M)
[PROOF STEP]
by (auto simp: space_PiM PiE_iff)
[PROOF STATE]
proof (state)
this:
restrict x {0..<i} \<in> space (Pi\<^sub>M {0..<i} M)

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> space (M y) \<noteq> {}) \<Longrightarrow> space (M x) \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
restrict x {0..<i} \<in> space (Pi\<^sub>M {0..<i} M)
[PROOF STEP]
interpret prob_space "P i (restrict x {0..<i})"
[PROOF STATE]
proof (prove)
using this:
restrict x {0..<i} \<in> space (Pi\<^sub>M {0..<i} M)

goal (1 subgoal):
 1. prob_space (P i (restrict x {0..<i}))
[PROOF STEP]
by (rule prob_space_P)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> space (M y) \<noteq> {}) \<Longrightarrow> space (M x) \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (M i) \<noteq> {}
[PROOF STEP]
using not_empty subprob_measurableD(1)[OF P, OF *]
[PROOF STATE]
proof (prove)
using this:
space (P i (restrict x {0..<i})) \<noteq> {}
space (P i (restrict x {0..<i})) = space (M i)

goal (1 subgoal):
 1. space (M i) \<noteq> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
space (M i) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_fx_plus_fy_ineq:
  fixes f::"real \<Rightarrow> real"
  assumes "convex_on {0..} f"
          "x \<ge> 0" "y \<ge> 0" "f 0 = 0"
  shows "f x + f y \<le> f (x+y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x + f y \<le> f (x + y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x + f y \<le> f (x + y)
[PROOF STEP]
have *: "f a + f b \<le> f (a+b)" if "a \<ge> 0" "b \<ge> a" for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a + f b \<le> f (a + b)
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> f a + f b \<le> f (a + b)
 2. a \<noteq> 0 \<Longrightarrow> f a + f b \<le> f (a + b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> f a + f b \<le> f (a + b)
 2. a \<noteq> 0 \<Longrightarrow> f a + f b \<le> f (a + b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
[PROOF STEP]
have "a > 0" "b > 0"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. 0 < a &&& 0 < b
[PROOF STEP]
using \<open>b \<ge> a\<close> \<open>a \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
a \<le> b
0 \<le> a

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

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> f a + f b \<le> f (a + b)
 2. a \<noteq> 0 \<Longrightarrow> f a + f b \<le> f (a + b)
[PROOF STEP]
have "(f 0 - f a) / (0 - a) \<le> (f 0 - f (a+b))/ (0 - (a+b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f 0 - f a) / (0 - a) \<le> (f 0 - f (a + b)) / (0 - (a + b))
[PROOF STEP]
apply (rule convex_on_diff[OF \<open>convex_on {0..} f\<close>])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 \<in> {0..}
 2. a + b \<in> {0..}
 3. 0 < a
 4. a < a + b
[PROOF STEP]
using \<open>a > 0\<close> \<open>b > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b

goal (4 subgoals):
 1. 0 \<in> {0..}
 2. a + b \<in> {0..}
 3. 0 < a
 4. a < a + b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f 0 - f a) / (0 - a) \<le> (f 0 - f (a + b)) / (0 - (a + b))

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> f a + f b \<le> f (a + b)
 2. a \<noteq> 0 \<Longrightarrow> f a + f b \<le> f (a + b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f 0 - f a) / (0 - a) \<le> (f 0 - f (a + b)) / (0 - (a + b))

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> f a + f b \<le> f (a + b)
 2. a \<noteq> 0 \<Longrightarrow> f a + f b \<le> f (a + b)
[PROOF STEP]
have "... \<le> (f b - f (a+b)) / (b - (a+b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f 0 - f (a + b)) / (0 - (a + b)) \<le> (f b - f (a + b)) / (b - (a + b))
[PROOF STEP]
apply (rule convex_on_diff[OF \<open>convex_on {0..} f\<close>])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 \<in> {0..}
 2. a + b \<in> {0..}
 3. 0 < b
 4. b < a + b
[PROOF STEP]
using \<open>a > 0\<close> \<open>b > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < a
0 < b

goal (4 subgoals):
 1. 0 \<in> {0..}
 2. a + b \<in> {0..}
 3. 0 < b
 4. b < a + b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f 0 - f (a + b)) / (0 - (a + b)) \<le> (f b - f (a + b)) / (b - (a + b))

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> f a + f b \<le> f (a + b)
 2. a \<noteq> 0 \<Longrightarrow> f a + f b \<le> f (a + b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f 0 - f a) / (0 - a) \<le> (f b - f (a + b)) / (b - (a + b))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f 0 - f a) / (0 - a) \<le> (f b - f (a + b)) / (b - (a + b))

goal (1 subgoal):
 1. f a + f b \<le> f (a + b)
[PROOF STEP]
using \<open>a > 0\<close> \<open>b > 0\<close> \<open>f 0 = 0\<close>
[PROOF STATE]
proof (prove)
using this:
(f 0 - f a) / (0 - a) \<le> (f b - f (a + b)) / (b - (a + b))
0 < a
0 < b
f 0 = 0

goal (1 subgoal):
 1. f a + f b \<le> f (a + b)
[PROOF STEP]
by (auto simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
f a + f b \<le> f (a + b)

goal (1 subgoal):
 1. a = 0 \<Longrightarrow> f a + f b \<le> f (a + b)
[PROOF STEP]
qed (simp add: \<open>f 0 = 0\<close>)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?a; ?a \<le> ?b\<rbrakk> \<Longrightarrow> f ?a + f ?b \<le> f (?a + ?b)

goal (1 subgoal):
 1. f x + f y \<le> f (x + y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> ?a; ?a \<le> ?b\<rbrakk> \<Longrightarrow> f ?a + f ?b \<le> f (?a + ?b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?a; ?a \<le> ?b\<rbrakk> \<Longrightarrow> f ?a + f ?b \<le> f (?a + ?b)

goal (1 subgoal):
 1. f x + f y \<le> f (x + y)
[PROOF STEP]
using \<open>x \<ge> 0\<close> \<open>y \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> ?a; ?a \<le> ?b\<rbrakk> \<Longrightarrow> f ?a + f ?b \<le> f (?a + ?b)
0 \<le> x
0 \<le> y

goal (1 subgoal):
 1. f x + f y \<le> f (x + y)
[PROOF STEP]
by (metis add.commute le_less not_le)
[PROOF STATE]
proof (state)
this:
f x + f y \<le> f (x + y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm047:
  assumes "(Range P) \<inter> (Range Q) = {}" "runiq (P^-1)" "runiq (Q^-1)"
  shows "runiq ((P \<union> Q)^-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. runiq ((P \<union> Q)\<inverse>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Range P \<inter> Range Q = {}
runiq (P\<inverse>)
runiq (Q\<inverse>)

goal (1 subgoal):
 1. runiq ((P \<union> Q)\<inverse>)
[PROOF STEP]
by (metis Domain_converse converse_Un disj_Un_runiq)


[STATEMENT]
lemma map_of_set_pcs_notin: "C \<notin> (\<lambda>t. snd (fst t)) ` set FDTs \<Longrightarrow> map_of FDTs (F, C) = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<notin> (\<lambda>t. snd (fst t)) ` set FDTs \<Longrightarrow> map_of FDTs (F, C) = None
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<notin> (\<lambda>t. snd (fst t)) ` set FDTs \<Longrightarrow> map_of FDTs (F, C) = None
[PROOF STEP]
by (metis image_eqI image_image map_of_eq_None_iff snd_conv)


[STATEMENT]
theorem isRevNth_equalsU:
assumes a: "reach s" and r: "isRevNth s confID uID papID n" "isRevNth s confID uID1 papID n"
shows "uID = uID1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uID = uID1
[PROOF STEP]
using isRevNth_equalsU1[OF a] r
[PROOF STATE]
proof (prove)
using this:
isRevNth_equalsU s
isRevNth s confID uID papID n
isRevNth s confID uID1 papID n

goal (1 subgoal):
 1. uID = uID1
[PROOF STEP]
unfolding isRevNth_equalsU_def
[PROOF STATE]
proof (prove)
using this:
\<forall>confID uID uID1 papID n. isRevNth s confID uID papID n \<and> isRevNth s confID uID1 papID n \<longrightarrow> uID = uID1
isRevNth s confID uID papID n
isRevNth s confID uID1 papID n

goal (1 subgoal):
 1. uID = uID1
[PROOF STEP]
by blast


[STATEMENT]
lemma add_multiple_rows_index_eq:
  assumes "i < dim_row A" and "j < dim_col A" and "i \<notin> set ls" and "\<And> l . l \<in> set ls \<Longrightarrow> l < dim_row A"
  shows "add_multiple_rows a i ls A $$ (i,j) = (\<Sum>l\<leftarrow>ls. a * A $$(l,j)) + A$$(i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A
i \<notin> set ls
?l \<in> set ls \<Longrightarrow> ?l < dim_row A

goal (1 subgoal):
 1. add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
proof (induct ls)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set []; \<And>l. l \<in> set [] \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i [] A $$ (i, j) = (\<Sum>l\<leftarrow>[]. a * A $$ (l, j)) + A $$ (i, j)
 2. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
i < dim_row A
j < dim_col A
i \<notin> set []
?l \<in> set [] \<Longrightarrow> ?l < dim_row A

goal (2 subgoals):
 1. \<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set []; \<And>l. l \<in> set [] \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i [] A $$ (i, j) = (\<Sum>l\<leftarrow>[]. a * A $$ (l, j)) + A $$ (i, j)
 2. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row A
j < dim_col A
i \<notin> set []
?l \<in> set [] \<Longrightarrow> ?l < dim_row A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A
i \<notin> set []
?l \<in> set [] \<Longrightarrow> ?l < dim_row A

goal (1 subgoal):
 1. add_multiple_rows a i [] A $$ (i, j) = (\<Sum>l\<leftarrow>[]. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
add_multiple_rows a i [] A $$ (i, j) = (\<Sum>l\<leftarrow>[]. a * A $$ (l, j)) + A $$ (i, j)

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
case (Cons aa ls)
[PROOF STATE]
proof (state)
this:
\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
i < dim_row A
j < dim_col A
i \<notin> set (aa # ls)
?l \<in> set (aa # ls) \<Longrightarrow> ?l < dim_row A

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
i < dim_row A
j < dim_col A
i \<notin> set (aa # ls)
?l \<in> set (aa # ls) \<Longrightarrow> ?l < dim_row A
[PROOF STEP]
have ne: "i \<noteq> aa"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
i < dim_row A
j < dim_col A
i \<notin> set (aa # ls)
?l \<in> set (aa # ls) \<Longrightarrow> ?l < dim_row A

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

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
have lt: "aa < dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aa < dim_row A
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
i < dim_row A

goal (1 subgoal):
 1. aa < dim_row A
[PROOF STEP]
by (simp add: Cons.prems(4))
[PROOF STATE]
proof (state)
this:
aa < dim_row A

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
have "(add_multiple_rows a i (aa # ls) A) $$ (i, j) =
      (addrow a i aa (add_multiple_rows a i ls A)) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_multiple_rows a i (aa # ls) A $$ (i, j) = addrow a i aa (add_multiple_rows a i ls A) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
add_multiple_rows a i (aa # ls) A $$ (i, j) = addrow a i aa (add_multiple_rows a i ls A) $$ (i, j)

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
add_multiple_rows a i (aa # ls) A $$ (i, j) = addrow a i aa (add_multiple_rows a i ls A) $$ (i, j)

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
have "... = a * add_multiple_rows a i ls A $$ (aa, j) + (add_multiple_rows a i ls A) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow a i aa (add_multiple_rows a i ls A) $$ (i, j) = a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)
[PROOF STEP]
using assms(1) assms(2) index_mat_addrow_basic(2)[of "i" "(add_multiple_rows a i ls A)" "j" "a" "aa"]
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A
\<lbrakk>i < dim_row (add_multiple_rows a i ls A); j < dim_col (add_multiple_rows a i ls A)\<rbrakk> \<Longrightarrow> addrow a i aa (add_multiple_rows a i ls A) $$ (i, j) = a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)

goal (1 subgoal):
 1. addrow a i aa (add_multiple_rows a i ls A) $$ (i, j) = a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
addrow a i aa (add_multiple_rows a i ls A) $$ (i, j) = a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
addrow a i aa (add_multiple_rows a i ls A) $$ (i, j) = a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
have "... = a * A $$(aa, j) + (add_multiple_rows a i ls A) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j) = a * A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)
[PROOF STEP]
using lt ne
[PROOF STATE]
proof (prove)
using this:
aa < dim_row A
i \<noteq> aa

goal (1 subgoal):
 1. a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j) = a * A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)
[PROOF STEP]
by (simp add: assms(2))
[PROOF STATE]
proof (state)
this:
a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j) = a * A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * add_multiple_rows a i ls A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j) = a * A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j)

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
have "... = a * A $$(aa, j) + (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j) = a * A $$ (aa, j) + (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
using Cons.hyps assms(1) assms(2) Cons.prems(3) Cons.prems(4)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
i < dim_row A
j < dim_col A
i \<notin> set (aa # ls)
?l \<in> set (aa # ls) \<Longrightarrow> ?l < dim_row A

goal (1 subgoal):
 1. a * A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j) = a * A $$ (aa, j) + (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
by (metis (mono_tags, lifting) ab_semigroup_add_class.add_ac(1) list.set_intros(2))
[PROOF STATE]
proof (state)
this:
a * A $$ (aa, j) + add_multiple_rows a i ls A $$ (i, j) = a * A $$ (aa, j) + (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)

goal (1 subgoal):
 1. \<And>aa ls. \<lbrakk>\<lbrakk>i < dim_row A; j < dim_col A; i \<notin> set ls; \<And>l. l \<in> set ls \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i ls A $$ (i, j) = (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j); i < dim_row A; j < dim_col A; i \<notin> set (aa # ls); \<And>l. l \<in> set (aa # ls) \<Longrightarrow> l < dim_row A\<rbrakk> \<Longrightarrow> add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
add_multiple_rows a i (aa # ls) A $$ (i, j) = a * A $$ (aa, j) + (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
show "(add_multiple_rows a i (aa # ls) A) $$ (i, j) =
      (\<Sum>l\<leftarrow>(aa #ls). a * A $$ (l, j)) + A $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
add_multiple_rows a i (aa # ls) A $$ (i, j) = a * A $$ (aa, j) + (\<Sum>l\<leftarrow>ls. a * A $$ (l, j)) + A $$ (i, j)

goal (1 subgoal):
 1. add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
add_multiple_rows a i (aa # ls) A $$ (i, j) = (\<Sum>l\<leftarrow>aa # ls. a * A $$ (l, j)) + A $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rcoset_equiv :
  assumes "Subgroup H"
  shows   "equiv G (rcoset_rel H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv G (rcoset_rel H)
[PROOF STEP]
proof (rule equivI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. refl_on G (rcoset_rel H)
 2. sym (rcoset_rel H)
 3. trans (rcoset_rel H)
[PROOF STEP]
show "refl_on G (rcoset_rel H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on G (rcoset_rel H)
[PROOF STEP]
proof (rule refl_onI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rcoset_rel H \<subseteq> G \<times> G
 2. \<And>x. x \<in> G \<Longrightarrow> (x, x) \<in> rcoset_rel H
[PROOF STEP]
show "(rcoset_rel H) \<subseteq> G \<times> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcoset_rel H \<subseteq> G \<times> G
[PROOF STEP]
using rcoset_rel_def
[PROOF STATE]
proof (prove)
using this:
rcoset_rel ?H \<equiv> {(g, g'). g \<in> G \<and> g' \<in> G \<and> g - g' \<in> ?H}

goal (1 subgoal):
 1. rcoset_rel H \<subseteq> G \<times> G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rcoset_rel H \<subseteq> G \<times> G

goal (1 subgoal):
 1. \<And>x. x \<in> G \<Longrightarrow> (x, x) \<in> rcoset_rel H
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> G \<Longrightarrow> (x, x) \<in> rcoset_rel H
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> G \<Longrightarrow> (x, x) \<in> rcoset_rel H
[PROOF STEP]
assume "x \<in> G"
[PROOF STATE]
proof (state)
this:
x \<in> G

goal (1 subgoal):
 1. \<And>x. x \<in> G \<Longrightarrow> (x, x) \<in> rcoset_rel H
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
Subgroup H
x \<in> G
[PROOF STEP]
show "(x,x) \<in> (rcoset_rel H)"
[PROOF STATE]
proof (prove)
using this:
Subgroup H
x \<in> G

goal (1 subgoal):
 1. (x, x) \<in> rcoset_rel H
[PROOF STEP]
using rcoset_rel_def Group.zero_closed
[PROOF STATE]
proof (prove)
using this:
Subgroup H
x \<in> G
rcoset_rel ?H \<equiv> {(g, g'). g \<in> G \<and> g' \<in> G \<and> g - g' \<in> ?H}
Group ?G \<Longrightarrow> (0::?'g) \<in> ?G

goal (1 subgoal):
 1. (x, x) \<in> rcoset_rel H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x, x) \<in> rcoset_rel H

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
refl_on G (rcoset_rel H)

goal (2 subgoals):
 1. sym (rcoset_rel H)
 2. trans (rcoset_rel H)
[PROOF STEP]
show "sym (rcoset_rel H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym (rcoset_rel H)
[PROOF STEP]
proof (rule symI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> rcoset_rel H \<Longrightarrow> (b, a) \<in> rcoset_rel H
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> rcoset_rel H \<Longrightarrow> (b, a) \<in> rcoset_rel H
[PROOF STEP]
assume "(a,b) \<in> (rcoset_rel H)"
[PROOF STATE]
proof (state)
this:
(a, b) \<in> rcoset_rel H

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> rcoset_rel H \<Longrightarrow> (b, a) \<in> rcoset_rel H
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
Subgroup H
(a, b) \<in> rcoset_rel H
[PROOF STEP]
show "(b,a) \<in> (rcoset_rel H)"
[PROOF STATE]
proof (prove)
using this:
Subgroup H
(a, b) \<in> rcoset_rel H

goal (1 subgoal):
 1. (b, a) \<in> rcoset_rel H
[PROOF STEP]
using rcoset_rel_def Group.neg_closed[of H "a - b"] minus_diff_eq
[PROOF STATE]
proof (prove)
using this:
Subgroup H
(a, b) \<in> rcoset_rel H
rcoset_rel ?H \<equiv> {(g, g'). g \<in> G \<and> g' \<in> G \<and> g - g' \<in> ?H}
\<lbrakk>Group H; a - b \<in> H\<rbrakk> \<Longrightarrow> - (a - b) \<in> H
- (?a - ?b) = ?b - ?a

goal (1 subgoal):
 1. (b, a) \<in> rcoset_rel H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(b, a) \<in> rcoset_rel H

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sym (rcoset_rel H)

goal (1 subgoal):
 1. trans (rcoset_rel H)
[PROOF STEP]
show "trans (rcoset_rel H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (rcoset_rel H)
[PROOF STEP]
proof (rule transI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> rcoset_rel H; (y, z) \<in> rcoset_rel H\<rbrakk> \<Longrightarrow> (x, z) \<in> rcoset_rel H
[PROOF STEP]
fix x y z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> rcoset_rel H; (y, z) \<in> rcoset_rel H\<rbrakk> \<Longrightarrow> (x, z) \<in> rcoset_rel H
[PROOF STEP]
assume "(x,y) \<in> (rcoset_rel H)" "(y,z) \<in> (rcoset_rel H)"
[PROOF STATE]
proof (state)
this:
(x, y) \<in> rcoset_rel H
(y, z) \<in> rcoset_rel H

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>(x, y) \<in> rcoset_rel H; (y, z) \<in> rcoset_rel H\<rbrakk> \<Longrightarrow> (x, z) \<in> rcoset_rel H
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
Subgroup H
(x, y) \<in> rcoset_rel H
(y, z) \<in> rcoset_rel H
[PROOF STEP]
show "(x,z) \<in> (rcoset_rel H)"
[PROOF STATE]
proof (prove)
using this:
Subgroup H
(x, y) \<in> rcoset_rel H
(y, z) \<in> rcoset_rel H

goal (1 subgoal):
 1. (x, z) \<in> rcoset_rel H
[PROOF STEP]
using rcoset_rel_def Group.add_closed[of H "x - y" "y - z"]
[PROOF STATE]
proof (prove)
using this:
Subgroup H
(x, y) \<in> rcoset_rel H
(y, z) \<in> rcoset_rel H
rcoset_rel ?H \<equiv> {(g, g'). g \<in> G \<and> g' \<in> G \<and> g - g' \<in> ?H}
\<lbrakk>Group H; x - y \<in> H; y - z \<in> H\<rbrakk> \<Longrightarrow> x - y + (y - z) \<in> H

goal (1 subgoal):
 1. (x, z) \<in> rcoset_rel H
[PROOF STEP]
by    (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(x, z) \<in> rcoset_rel H

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
trans (rcoset_rel H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pderiv_eq_0:
  assumes "degree p = 0"
  shows   "pderiv p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv p = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree p = 0

goal (1 subgoal):
 1. pderiv p = 0
[PROOF STEP]
by (auto elim!: degree_eq_zeroE)


[STATEMENT]
lemma not_alw_not[simp]: "not (alw (not \<phi>)) = ev \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xs. \<not> alw (\<lambda>xs. \<not> \<phi> xs) xs) = ev \<phi>
[PROOF STEP]
unfolding not_alw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ev (\<lambda>xs. \<not> \<not> \<phi> xs) = ev \<phi>
[PROOF STEP]
by simp


[STATEMENT]
lemma hom_deg_set_subset: "homogeneous_set A \<Longrightarrow> hom_deg_set z A \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homogeneous_set A \<Longrightarrow> hom_deg_set z A \<subseteq> A
[PROOF STEP]
by (auto dest: homogeneous_setD simp: hom_deg_set_def)


[STATEMENT]
lemma conseq2: "[| G|-{P}.c.{Q'}; \<forall>Z s. Q' Z s \<longrightarrow> Q Z s |] ==> G|-{P}.c.{Q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G|-{P}. c .{Q'}; \<forall>Z s. Q' Z s \<longrightarrow> Q Z s\<rbrakk> \<Longrightarrow> G|-{P}. c .{Q}
[PROOF STEP]
apply (erule conseq12)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Z s. Q' Z s \<longrightarrow> Q Z s \<Longrightarrow> \<forall>Z s. P Z s \<longrightarrow> (\<forall>s'. (\<forall>Z'. P Z' s \<longrightarrow> Q' Z' s') \<longrightarrow> Q Z s')
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


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

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

goal (1 subgoal):
 1. x = -\<^sub>\<int> (-\<^sub>\<int> x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x = -\<^sub>\<int> (-\<^sub>\<int> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sym_factor_mono: "r \<subseteq> s \<Longrightarrow> sym_factor r \<subseteq> sym_factor s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<subseteq> s \<Longrightarrow> sym_factor r \<subseteq> sym_factor s
[PROOF STEP]
unfolding sym_factor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<subseteq> s \<Longrightarrow> {(x, y). (x, y) \<in> r \<and> (y, x) \<in> r} \<subseteq> {(x, y). (x, y) \<in> s \<and> (y, x) \<in> s}
[PROOF STEP]
by auto


[STATEMENT]
lemma Cauchy_derivative_integral_circlepath:
  assumes contf: "continuous_on (cball z r) f"
      and holf: "f holomorphic_on ball z r"
      and w: "w \<in> ball z r"
    shows "(\<lambda>u. f u/(u - w)^2) contour_integrable_on (circlepath z r)"
           (is "?thes1")
      and "(f has_field_derivative (1 / (2 * of_real pi * \<i>) * contour_integral(circlepath z r) (\<lambda>u. f u / (u - w)^2))) (at w)"
           (is "?thes2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r &&& (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r
 2. (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
have [simp]: "r \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> r
[PROOF STEP]
using w
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r

goal (1 subgoal):
 1. 0 \<le> r
[PROOF STEP]
using ball_eq_empty
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r
(ball ?x ?e = {}) = (?e \<le> 0)

goal (1 subgoal):
 1. 0 \<le> r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 \<le> r

goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r
 2. (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
have f: "continuous_on (path_image (circlepath z r)) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (path_image (circlepath z r)) f
[PROOF STEP]
by (rule continuous_on_subset [OF contf]) (force simp: cball_def sphere_def)
[PROOF STATE]
proof (state)
this:
continuous_on (path_image (circlepath z r)) f

goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r
 2. (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
have int: "\<And>w. dist z w < r \<Longrightarrow>
                 ((\<lambda>u. f u / (u - w)) has_contour_integral (\<lambda>x. 2 * of_real pi * \<i> * f x) w) (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. dist z w < r \<Longrightarrow> ((\<lambda>u. f u / (u - w)) has_contour_integral 2 * complex_of_real pi * \<i> * f w) (circlepath z r)
[PROOF STEP]
by (rule Cauchy_integral_circlepath [OF contf holf]) (simp add: dist_norm norm_minus_commute)
[PROOF STATE]
proof (state)
this:
dist z ?w < r \<Longrightarrow> ((\<lambda>u. f u / (u - ?w)) has_contour_integral 2 * complex_of_real pi * \<i> * f ?w) (circlepath z r)

goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r
 2. (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
show ?thes1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r
[PROOF STEP]
apply (simp add: power2_eq_square)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. f u / ((u - w) * (u - w))) contour_integrable_on circlepath z r
[PROOF STEP]
apply (rule Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1, simplified])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. dist z w < r \<Longrightarrow> ((\<lambda>u. f u / (u - w)) has_contour_integral ?g w) (circlepath z r)
[PROOF STEP]
apply (blast intro: int)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r

goal (1 subgoal):
 1. (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
have "((\<lambda>x. 2 * of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)^2)) (at w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. 2 * complex_of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
apply (simp add: power2_eq_square)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. 2 * complex_of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / ((u - w) * (u - w)))) (at w)
[PROOF STEP]
apply (rule Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1 and g = "\<lambda>x. 2 * of_real pi * \<i> * f x", simplified])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. dist z w < r \<Longrightarrow> ((\<lambda>u. f u / (u - w)) has_contour_integral 2 * complex_of_real pi * \<i> * f w) (circlepath z r)
[PROOF STEP]
apply (blast intro: int)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
((\<lambda>x. 2 * complex_of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)

goal (1 subgoal):
 1. (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. 2 * complex_of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
have fder: "(f has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)^2) / (2 * of_real pi * \<i>)) (at w)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. 2 * complex_of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)

goal (1 subgoal):
 1. (f has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2) / (2 * complex_of_real pi * \<i>)) (at w)
[PROOF STEP]
by (rule DERIV_cdivide [where f = "\<lambda>x. 2 * of_real pi * \<i> * f x" and c = "2 * of_real pi * \<i>", simplified])
[PROOF STATE]
proof (state)
this:
(f has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2) / (2 * complex_of_real pi * \<i>)) (at w)

goal (1 subgoal):
 1. (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
show ?thes2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)
[PROOF STEP]
by simp (rule fder)
[PROOF STATE]
proof (state)
this:
(f has_field_derivative 1 / (2 * complex_of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) (at w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma process_rule_3: "(xs, Y) \<in> failures P \<Longrightarrow> X \<subseteq> Y \<Longrightarrow> (xs, X) \<in> failures P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(xs, Y) \<in> failures P; X \<subseteq> Y\<rbrakk> \<Longrightarrow> (xs, X) \<in> failures P
[PROOF STEP]
proof (simp add: failures_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>(xs, Y) \<in> fst (Rep_process P); X \<subseteq> Y\<rbrakk> \<Longrightarrow> (xs, X) \<in> fst (Rep_process P)
[PROOF STEP]
have "Rep_process P \<in> process_set" (is "?P' \<in> _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_process P \<in> process_set
[PROOF STEP]
by (rule Rep_process)
[PROOF STATE]
proof (state)
this:
Rep_process P \<in> process_set

goal (1 subgoal):
 1. \<lbrakk>(xs, Y) \<in> fst (Rep_process P); X \<subseteq> Y\<rbrakk> \<Longrightarrow> (xs, X) \<in> fst (Rep_process P)
[PROOF STEP]
hence "\<forall>xs X Y. (xs, Y) \<in> fst ?P' \<and> X \<subseteq> Y \<longrightarrow> (xs, X) \<in> fst ?P'"
[PROOF STATE]
proof (prove)
using this:
Rep_process P \<in> process_set

goal (1 subgoal):
 1. \<forall>xs X Y. (xs, Y) \<in> fst (Rep_process P) \<and> X \<subseteq> Y \<longrightarrow> (xs, X) \<in> fst (Rep_process P)
[PROOF STEP]
by (simp add: process_set_def process_prop_3_def)
[PROOF STATE]
proof (state)
this:
\<forall>xs X Y. (xs, Y) \<in> fst (Rep_process P) \<and> X \<subseteq> Y \<longrightarrow> (xs, X) \<in> fst (Rep_process P)

goal (1 subgoal):
 1. \<lbrakk>(xs, Y) \<in> fst (Rep_process P); X \<subseteq> Y\<rbrakk> \<Longrightarrow> (xs, X) \<in> fst (Rep_process P)
[PROOF STEP]
thus "(xs, Y) \<in> fst ?P' \<Longrightarrow> X \<subseteq> Y \<Longrightarrow> (xs, X) \<in> fst ?P'"
[PROOF STATE]
proof (prove)
using this:
\<forall>xs X Y. (xs, Y) \<in> fst (Rep_process P) \<and> X \<subseteq> Y \<longrightarrow> (xs, X) \<in> fst (Rep_process P)

goal (1 subgoal):
 1. \<lbrakk>(xs, Y) \<in> fst (Rep_process P); X \<subseteq> Y\<rbrakk> \<Longrightarrow> (xs, X) \<in> fst (Rep_process P)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>(xs, Y) \<in> fst (Rep_process P); X \<subseteq> Y\<rbrakk> \<Longrightarrow> (xs, X) \<in> fst (Rep_process P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hypnat_diff_cancel [simp]: "\<And>k m n::hypnat. (k + m) - (k + n) = m - n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k m n. k + m - (k + n) = m - n
[PROOF STEP]
by transfer (rule diff_cancel)


[STATEMENT]
lemma vars_add: "vars (p1 + p2) \<subseteq> vars p1 \<union> vars p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (p1 + p2) \<subseteq> vars p1 \<union> vars p2
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> vars (p1 + p2) \<Longrightarrow> x \<in> vars p1 \<union> vars p2
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> vars (p1 + p2) \<Longrightarrow> x \<in> vars p1 \<union> vars p2
[PROOF STEP]
assume "w \<in> vars (p1 + p2)"
[PROOF STATE]
proof (state)
this:
w \<in> vars (p1 + p2)

goal (1 subgoal):
 1. \<And>x. x \<in> vars (p1 + p2) \<Longrightarrow> x \<in> vars p1 \<union> vars p2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> vars (p1 + p2)
[PROOF STEP]
obtain m where "w \<in> keys m" "m \<in> keys (mapping_of (p1 + p2))"
[PROOF STATE]
proof (prove)
using this:
w \<in> vars (p1 + p2)

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>w \<in> keys m; m \<in> keys (mapping_of (p1 + p2))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis UN_E vars_def)
[PROOF STATE]
proof (state)
this:
w \<in> keys m
m \<in> keys (mapping_of (p1 + p2))

goal (1 subgoal):
 1. \<And>x. x \<in> vars (p1 + p2) \<Longrightarrow> x \<in> vars p1 \<union> vars p2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> keys m
m \<in> keys (mapping_of (p1 + p2))
[PROOF STEP]
have "m \<in> keys (mapping_of (p1)) \<union> keys (mapping_of (p2))"
[PROOF STATE]
proof (prove)
using this:
w \<in> keys m
m \<in> keys (mapping_of (p1 + p2))

goal (1 subgoal):
 1. m \<in> keys (mapping_of p1) \<union> keys (mapping_of p2)
[PROOF STEP]
by (metis Poly_Mapping.keys_add plus_mpoly.rep_eq subset_iff)
[PROOF STATE]
proof (state)
this:
m \<in> keys (mapping_of p1) \<union> keys (mapping_of p2)

goal (1 subgoal):
 1. \<And>x. x \<in> vars (p1 + p2) \<Longrightarrow> x \<in> vars p1 \<union> vars p2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<in> keys (mapping_of p1) \<union> keys (mapping_of p2)
[PROOF STEP]
show "w \<in> vars p1 \<union> vars p2"
[PROOF STATE]
proof (prove)
using this:
m \<in> keys (mapping_of p1) \<union> keys (mapping_of p2)

goal (1 subgoal):
 1. w \<in> vars p1 \<union> vars p2
[PROOF STEP]
using vars_def \<open>w \<in> keys m\<close>
[PROOF STATE]
proof (prove)
using this:
m \<in> keys (mapping_of p1) \<union> keys (mapping_of p2)
vars ?p = \<Union> (keys ` keys (mapping_of ?p))
w \<in> keys m

goal (1 subgoal):
 1. w \<in> vars p1 \<union> vars p2
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
w \<in> vars p1 \<union> vars p2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_regular_spair_alt_spp: "is_regular_spair p q \<longleftrightarrow> is_regular_spair_spp (spp_of p) (spp_of q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_regular_spair p q = is_regular_spair_spp (spp_of p) (spp_of q)
[PROOF STEP]
by (auto simp: is_regular_spair_spp_def fst_spp_of snd_spp_of intro: is_regular_spairI
          dest: is_regular_spairD1 is_regular_spairD2 is_regular_spairD3)


[STATEMENT]
lemma div_abs_eq:
  assumes mod: "(a::int) mod b = 0"
  and b: "0 < b"
  shows "\<bar>a div b\<bar> = \<bar>a\<bar> div b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
proof (cases "0 \<le> a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
 2. \<not> 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> a

goal (2 subgoals):
 1. 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
 2. \<not> 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
with pos_imp_zdiv_nonneg_iff [OF b]
[PROOF STATE]
proof (chain)
picking this:
(0 \<le> ?a div b) = (0 \<le> ?a)
0 \<le> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0 \<le> ?a div b) = (0 \<le> ?a)
0 \<le> a

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

goal (1 subgoal):
 1. \<not> 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
from b
[PROOF STATE]
proof (chain)
picking this:
0 < b
[PROOF STEP]
have "b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < b

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

goal (1 subgoal):
 1. \<not> 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> a

goal (1 subgoal):
 1. \<not> 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 \<le> a
[PROOF STEP]
have "a < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> a

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

goal (1 subgoal):
 1. \<not> 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
have "\<bar>a div b\<bar> = - (a div b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a div b\<bar> = - (a div b)
[PROOF STEP]
by (simp add: div_neg_pos_less0 [OF \<open>a < 0\<close> b] zabs_def)
[PROOF STATE]
proof (state)
this:
\<bar>a div b\<bar> = - (a div b)

goal (1 subgoal):
 1. \<not> 0 \<le> a \<Longrightarrow> \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
with abs_of_neg [OF \<open>a < 0\<close>] zdiv_zminus1_eq_if [OF \<open>b \<noteq> 0\<close>] mod
[PROOF STATE]
proof (chain)
picking this:
\<bar>a\<bar> = - a
- ?a div b = (if ?a mod b = 0 then - (?a div b) else - (?a div b) - 1)
a mod b = 0
\<bar>a div b\<bar> = - (a div b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>a\<bar> = - a
- ?a div b = (if ?a mod b = 0 then - (?a div b) else - (?a div b) - 1)
a mod b = 0
\<bar>a div b\<bar> = - (a div b)

goal (1 subgoal):
 1. \<bar>a div b\<bar> = \<bar>a\<bar> div b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>a div b\<bar> = \<bar>a\<bar> div b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma HSem_reorder_head_append:
  assumes "x \<notin> domA \<Gamma>"
  shows "\<lbrace>(x,e)#\<Gamma>@\<Delta>\<rbrace>\<rho> = \<lbrace>\<Gamma> @ ((x,e)#\<Delta>)\<rbrace>\<rho>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace> (x, e) # \<Gamma> @ \<Delta> \<rbrace>\<rho> = \<lbrace> \<Gamma> @ (x, e) # \<Delta> \<rbrace>\<rho>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrace> (x, e) # \<Gamma> @ \<Delta> \<rbrace>\<rho> = \<lbrace> \<Gamma> @ (x, e) # \<Delta> \<rbrace>\<rho>
[PROOF STEP]
have "set ((x,e)#\<Gamma>@\<Delta>) = set (\<Gamma> @ ((x,e)#\<Delta>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ((x, e) # \<Gamma> @ \<Delta>) = set (\<Gamma> @ (x, e) # \<Delta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set ((x, e) # \<Gamma> @ \<Delta>) = set (\<Gamma> @ (x, e) # \<Delta>)

goal (1 subgoal):
 1. \<lbrace> (x, e) # \<Gamma> @ \<Delta> \<rbrace>\<rho> = \<lbrace> \<Gamma> @ (x, e) # \<Delta> \<rbrace>\<rho>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
set ((x, e) # \<Gamma> @ \<Delta>) = set (\<Gamma> @ (x, e) # \<Delta>)

goal (1 subgoal):
 1. \<lbrace> (x, e) # \<Gamma> @ \<Delta> \<rbrace>\<rho> = \<lbrace> \<Gamma> @ (x, e) # \<Delta> \<rbrace>\<rho>
[PROOF STEP]
unfolding HSem_def  evalHeap_reorder_head_append[OF assms]
[PROOF STATE]
proof (prove)
using this:
set ((x, e) # \<Gamma> @ \<Delta>) = set (\<Gamma> @ (x, e) # \<Delta>)

goal (1 subgoal):
 1. (\<Lambda> \<rho>. \<mu> xa. \<rho> ++\<^bsub>domA ((x, e) # \<Gamma> @ \<Delta>)\<^esub> \<^bold>\<lbrakk> \<Gamma> @ (x, e) # \<Delta> \<^bold>\<rbrakk>\<^bsub>xa\<^esub>)\<cdot>\<rho> = (\<Lambda> \<rho>. \<mu> xa. \<rho> ++\<^bsub>domA (\<Gamma> @ (x, e) # \<Delta>)\<^esub> \<^bold>\<lbrakk> \<Gamma> @ (x, e) # \<Delta> \<^bold>\<rbrakk>\<^bsub>xa\<^esub>)\<cdot>\<rho>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrace> (x, e) # \<Gamma> @ \<Delta> \<rbrace>\<rho> = \<lbrace> \<Gamma> @ (x, e) # \<Delta> \<rbrace>\<rho>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma c_list_asi_if_tree_sel:
  fixes sf cf h r
  defines "rank \<equiv> (\<lambda>l. (ldeep_T (contr_sel sf) cf l - 1) / c_list (contr_sel sf) cf h r l)"
  assumes "tree_sel sf"
      and "sel_reasonable sf"
      and "\<forall>x. cf x > 0"
      and "\<forall>x. h x > 0"
    shows "asi rank r (c_list (contr_sel sf) cf h r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. asi rank r (c_list (contr_sel sf) cf h r)
[PROOF STEP]
using c_list_asi assms contr_sel_eq_ldeep_s_if_tree_dst_fwd_verts' dst_fwd_all_verts_ex
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sel_reasonable ?sf; \<forall>x. 0 < ?cf x; \<forall>x. 0 < ?h x\<rbrakk> \<Longrightarrow> asi (\<lambda>l. (ldeep_T (ldeep_s ?sf ?xs) ?cf l - 1) / c_list (ldeep_s ?sf ?xs) ?cf ?h ?r l) ?r (c_list (ldeep_s ?sf ?xs) ?cf ?h ?r)
rank \<equiv> \<lambda>l. (ldeep_T (contr_sel sf) cf l - 1) / c_list (contr_sel sf) cf h r l
tree_sel sf
sel_reasonable sf
\<forall>x. 0 < cf x
\<forall>x. 0 < h x
\<lbrakk>tree_sel ?sel; distinct ?xs; forward ?xs; set ?xs = verts T\<rbrakk> \<Longrightarrow> contr_sel ?sel = ldeep_s ?sel (rev ?xs)
\<exists>xs. forward xs \<and> distinct xs \<and> set xs = verts T

goal (1 subgoal):
 1. asi rank r (c_list (contr_sel sf) cf h r)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma clinear_tensor_left[simp]: \<open>clinear (\<lambda>a. a \<otimes>\<^sub>o b :: _::finite ell2 \<Rightarrow>\<^sub>C\<^sub>L _::finite ell2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clinear (\<lambda>a. a \<otimes>\<^sub>o b)
[PROOF STEP]
apply (rule clinearI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b1 b2. (b1 + b2) \<otimes>\<^sub>o b = b1 \<otimes>\<^sub>o b + b2 \<otimes>\<^sub>o b
 2. \<And>r ba. r *\<^sub>C ba \<otimes>\<^sub>o b = r *\<^sub>C (ba \<otimes>\<^sub>o b)
[PROOF STEP]
apply (rule tensor_op_left_add)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r ba. r *\<^sub>C ba \<otimes>\<^sub>o b = r *\<^sub>C (ba \<otimes>\<^sub>o b)
[PROOF STEP]
by (rule tensor_op_scaleC_left)


[STATEMENT]
lemma "((P \<and> Q) \<longrightarrow> R) \<Longrightarrow> (P \<longrightarrow> Q  \<longrightarrow> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<and> Q \<longrightarrow> R \<Longrightarrow> P \<longrightarrow> Q \<longrightarrow> R
[PROOF STEP]
by auto