[STATEMENT]
lemma arc_blocks_end_subset: assumes "E \<subseteq> arcs G"  and "{x, y} \<in> (arc_to_block ` E)"
  shows "(x, y) \<in> ((arc_to_ends G) ` E) \<or> (y, x) \<in> ((arc_to_ends G) ` E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
obtain e where "e \<in> E" and "arc_to_block e = {x,y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>e \<in> E; arc_to_block e = {x, y}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
E \<subseteq> arcs G
{x, y} \<in> arc_to_block ` E

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>e \<in> E; arc_to_block e = {x, y}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
e \<in> E
arc_to_block e = {x, y}

goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e \<in> E
arc_to_block e = {x, y}
[PROOF STEP]
have "arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)"
[PROOF STATE]
proof (prove)
using this:
e \<in> E
arc_to_block e = {x, y}

goal (1 subgoal):
 1. arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)
[PROOF STEP]
using arc_to_ends_to_block
[PROOF STATE]
proof (prove)
using this:
e \<in> E
arc_to_block e = {x, y}
arc_to_block ?e = {?x, ?y} \<Longrightarrow> arc_to_ends G ?e = (?x, ?y) \<or> arc_to_ends G ?e = (?y, ?x)

goal (1 subgoal):
 1. arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)

goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
arc_to_ends G e = (x, y) \<or> arc_to_ends G e = (y, x)

goal (1 subgoal):
 1. (x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E
[PROOF STEP]
by (metis \<open>e \<in> E\<close> image_iff)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> arc_to_ends G ` E \<or> (y, x) \<in> arc_to_ends G ` E

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comp_fun_idem_insert_clause: "comp_fun_idem insert_clause"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_idem insert_clause
[PROOF STEP]
apply(unfold_locales)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y x. insert_clause y \<circ> insert_clause x = insert_clause x \<circ> insert_clause y
 2. \<And>x. insert_clause x \<circ> insert_clause x = insert_clause x
[PROOF STEP]
subgoal for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert_clause x \<circ> insert_clause y = insert_clause y \<circ> insert_clause x
[PROOF STEP]
by(cases x; cases y; simp; metis commute_left_comp comp_fun_commute rewriteL_comp_comp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. insert_clause x \<circ> insert_clause x = insert_clause x
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert_clause x \<circ> insert_clause x = insert_clause x
[PROOF STEP]
by(cases x; simp; metis (no_types, opaque_lifting) commute_left_comp comp_assoc comp_fun_idem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma genby_lcoset_empty: "(w::'a::group_add) +o \<langle>{}\<rangle> = {w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
have "\<langle>{}::'a set\<rangle> = (0::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>{}\<rangle> = 0
[PROOF STEP]
using genby_empty
[PROOF STATE]
proof (prove)
using this:
\<langle>{}\<rangle> = 0

goal (1 subgoal):
 1. \<langle>{}\<rangle> = 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<langle>{}\<rangle> = 0

goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<langle>{}\<rangle> = 0

goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
using lcoset_0
[PROOF STATE]
proof (prove)
using this:
\<langle>{}\<rangle> = 0
?w +o 0 = {?w}

goal (1 subgoal):
 1. w +o \<langle>{}\<rangle> = {w}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w +o \<langle>{}\<rangle> = {w}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma greater_mask_decomp:
  assumes "greater_mask a (add_masks b c)"
  shows "\<exists>a1 a2. a = add_masks a1 a2 \<and> greater_mask a1 b \<and> greater_mask a2 c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a1 a2. a = add_masks a1 a2 \<and> greater_mask a1 b \<and> greater_mask a2 c
[PROOF STEP]
by (metis add_masks_asso assms greater_mask_def greater_mask_properties(1))


[STATEMENT]
lemma (in topology) open_kriterion:
  assumes t_contains_open: "\<And> x. x\<in>t \<Longrightarrow> \<exists>t'. t' open \<and> x\<in>t' \<and> t'\<subseteq>t"
  shows "t open"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t open
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t open
[PROOF STEP]
let ?M = "\<Union>x\<in>t. {t'. t' open \<and> x\<in>t' \<and> t'\<subseteq>t}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t open
[PROOF STEP]
have "\<forall> m \<in> ?M. m open"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m\<in>\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}. m open
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>m\<in>\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}. m open

goal (1 subgoal):
 1. t open
[PROOF STEP]
hence  "\<Union>?M open"
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}. m open

goal (1 subgoal):
 1. \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open

goal (1 subgoal):
 1. t open
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open

goal (1 subgoal):
 1. t open
[PROOF STEP]
have "t = \<Union>?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t = \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t})
[PROOF STEP]
by (auto dest!: t_contains_open)
[PROOF STATE]
proof (state)
this:
t = \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t})

goal (1 subgoal):
 1. t open
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open
t = \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t}) open
t = \<Union> (\<Union>x\<in>t. {t'. t' open \<and> x \<in> t' \<and> t' \<subseteq> t})

goal (1 subgoal):
 1. t open
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
t open

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_set_conv: "(\<exists>x. x \<in> set xs) \<longleftrightarrow> xs \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. x \<in> set xs) = (xs \<noteq> [])
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> \<exists>x. x \<in> set xs
[PROOF STEP]
apply(auto simp add: neq_Nil_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma less_divide_eq_1_neg [simp]:
  "a < 0 \<Longrightarrow> (1 < b/a) = (b < a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < (0::'a) \<Longrightarrow> ((1::'a) < b / a) = (b < a)
[PROOF STEP]
using local.dual_order.strict_iff_order
[PROOF STATE]
proof (prove)
using this:
(?b < ?a) = (?b \<le> ?a \<and> ?a \<noteq> ?b)

goal (1 subgoal):
 1. a < (0::'a) \<Longrightarrow> ((1::'a) < b / a) = (b < a)
[PROOF STEP]
by auto


[STATEMENT]
lemma inj_on_linepath:
  assumes "a \<noteq> b" shows "inj_on (linepath a b) {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (linepath a b) {0..1}
[PROOF STEP]
proof (clarsimp simp: inj_on_def linepath_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b; 0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b; 0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b" "0 \<le> x" "x \<le> 1" "0 \<le> y" "y \<le> 1"
[PROOF STATE]
proof (state)
this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b; 0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1
[PROOF STEP]
have "x *\<^sub>R (a - b) = y *\<^sub>R (a - b)"
[PROOF STATE]
proof (prove)
using this:
(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b
0 \<le> x
x \<le> 1
0 \<le> y
y \<le> 1

goal (1 subgoal):
 1. x *\<^sub>R (a - b) = y *\<^sub>R (a - b)
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
x *\<^sub>R (a - b) = y *\<^sub>R (a - b)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b; 0 \<le> x; x \<le> 1; 0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>R (a - b) = y *\<^sub>R (a - b)
[PROOF STEP]
show "x=y"
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>R (a - b) = y *\<^sub>R (a - b)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>R (a - b) = y *\<^sub>R (a - b)
a \<noteq> b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_zip_replicate2[simp]: "index (zip as (replicate d b)) (a, b) = index as a"
  if "d = length as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (zip as (replicate d b)) (a, b) = index as a
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
d = length as

goal (1 subgoal):
 1. index (zip as (replicate d b)) (a, b) = index as a
[PROOF STEP]
by (induction as arbitrary: d) auto


[STATEMENT]
lemma tmf_ivl_cs_length:
  assumes "tmf_ivl_cs prec n A a f = Some cs"
  shows "length cs = n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length cs = n + 1
[PROOF STEP]
by (simp add: Some_those_length[OF assms[unfolded tmf_ivl_cs.simps]])


[STATEMENT]
lemma fds_perzeta_frac [simp]: "fds_perzeta (frac q) = fds_perzeta q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_perzeta (frac q) = fds_perzeta q
[PROOF STEP]
using fds_perzeta.plus_of_int[of "frac q" "\<lfloor>q\<rfloor>"]
[PROOF STATE]
proof (prove)
using this:
fds_perzeta (frac q + real_of_int \<lfloor>q\<rfloor>) = fds_perzeta (frac q)

goal (1 subgoal):
 1. fds_perzeta (frac q) = fds_perzeta q
[PROOF STEP]
by (simp add: frac_def)


[STATEMENT]
lemma finite_measure_restr_to_subalg:
  assumes "subalgebra M F"
          "finite_measure M"
  shows "finite_measure (restr_to_subalg M F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_measure (restr_to_subalg M F)
[PROOF STEP]
by (metis (no_types, lifting) assms emeasure_restr_to_subalg finite_measure.finite_emeasure_space
    finite_measureI sets.top space_restr_to_subalg subalgebra_def infinity_ennreal_def)


[STATEMENT]
lemma fmrestrict_set_fmmap[simp]: "fmrestrict_set A (fmmap f m) = fmmap f (fmrestrict_set A m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrestrict_set A (fmmap f m) = fmmap f (fmrestrict_set A m)
[PROOF STEP]
unfolding fmfilter_alt_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmfilter (\<lambda>a. a \<in> A) (fmmap f m) = fmmap f (fmfilter (\<lambda>a. a \<in> A) m)
[PROOF STEP]
by simp


[STATEMENT]
lemma ni2:"3 \<le> i \<Longrightarrow> i \<le> k \<Longrightarrow> n i \<noteq> n 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>3 \<le> i; i \<le> k\<rbrakk> \<Longrightarrow> n i \<noteq> n 2
[PROOF STEP]
by (metis Suc_numeral \<delta> delta_gt k2 le_imp_less_Suc le_less n_ge_trans not_le one_le_numeral
      semiring_norm(5) zero_less_diff)


[STATEMENT]
lemma Ssegment_inc:"\<lbrakk>Order D; a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow>
                  (a \<prec>\<^bsub>D\<^esub> b) = (a \<in> Ssegment D b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow> a \<prec>\<^bsub>D\<^esub> b = (a \<in> Ssegment D b)
[PROOF STEP]
by (simp add:Ssegment_def)


[STATEMENT]
lemma D_base_finite':
  "finite {len m i j xs | xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
[PROOF STEP]
have "{len m i j xs | xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
        \<subseteq> {len m i j xs | xs. set xs \<subseteq> {0..k} \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)} \<subseteq> {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)} \<subseteq> {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}

goal (1 subgoal):
 1. finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
[PROOF STEP]
with D_base_finite[of m i j k]
[PROOF STATE]
proof (chain)
picking this:
finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}
{len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)} \<subseteq> {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}
{len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)} \<subseteq> {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct xs}

goal (1 subgoal):
 1. finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}
[PROOF STEP]
by (rule rev_finite_subset)
[PROOF STATE]
proof (state)
this:
finite {len m i j xs |xs. set xs \<subseteq> {0..k} \<and> distinct (i # j # xs)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma run_eval_list: "\<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
define f where "f env_es_s = (case env_es_s of (env, es, s::'a state) \<Rightarrow> evaluate_list True env s es)" for env_es_s
[PROOF STATE]
proof (state)
this:
f ?env_es_s = (case ?env_es_s of (env, es, s) \<Rightarrow> evaluate_list True env s es)

goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
have "\<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)
[PROOF STEP]
proof (rule choice, safe, unfold f_def prod.case)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. Ex (evaluate_list True a b aa)
[PROOF STEP]
fix env es
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. Ex (evaluate_list True a b aa)
[PROOF STEP]
fix s :: "'a state"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b. Ex (evaluate_list True a b aa)
[PROOF STEP]
obtain s' r where "evaluate_list True env s es (s', r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s' r. evaluate_list True env s es (s', r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis evaluate_list_total)
[PROOF STATE]
proof (state)
this:
evaluate_list True env s es (s', r)

goal (1 subgoal):
 1. \<And>a aa b. Ex (evaluate_list True a b aa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
evaluate_list True env s es (s', r)
[PROOF STEP]
show "\<exists>r. evaluate_list True env s es r"
[PROOF STATE]
proof (prove)
using this:
evaluate_list True env s es (s', r)

goal (1 subgoal):
 1. \<exists>r. evaluate_list True env s es r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>r. evaluate_list True env s es r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)

goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>g. \<forall>env_es_s. f env_es_s (g env_es_s)

goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
\<exists>g. \<forall>env_es_s. (case env_es_s of (env, es, s) \<Rightarrow> evaluate_list True env s es) (g env_es_s)

goal (1 subgoal):
 1. \<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>run_eval_list. \<forall>env es s. evaluate_list True env s es (run_eval_list env es s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coreflexive_pp_dist_comp:
  assumes "coreflexive x"
      and "coreflexive y"
    shows "(x * y)'' = x '' * y ''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
have "(x * y)'' = --(x * y) \<sqinter> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y) ' ' = - (x * y) '
[PROOF STEP]
by (simp add: double_coreflexive_complement)
[PROOF STATE]
proof (state)
this:
(x * y) ' ' = - (x * y) '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x * y) ' ' = - (x * y) '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
have "... = --x \<sqinter> --y \<sqinter> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x * y) ' = - - x \<sqinter> - - y \<sqinter> (1::'a)
[PROOF STEP]
by (simp add: assms coreflexive_comp_inf)
[PROOF STATE]
proof (state)
this:
- (x * y) ' = - - x \<sqinter> - - y \<sqinter> (1::'a)

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (x * y) ' = - - x \<sqinter> - - y \<sqinter> (1::'a)

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
have "... = (--x \<sqinter> 1) * (--y \<sqinter> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - - x \<sqinter> - - y \<sqinter> (1::'a) = - x ' * - y '
[PROOF STEP]
by (simp add: coreflexive_comp_inf inf.left_commute inf.sup_monoid.add_assoc)
[PROOF STATE]
proof (state)
this:
- - x \<sqinter> - - y \<sqinter> (1::'a) = - x ' * - y '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- - x \<sqinter> - - y \<sqinter> (1::'a) = - x ' * - y '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
have "... = x '' * y ''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x ' * - y ' = x ' ' * y ' '
[PROOF STEP]
by (simp add: double_coreflexive_complement)
[PROOF STATE]
proof (state)
this:
- x ' * - y ' = x ' ' * y ' '

goal (1 subgoal):
 1. (x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x * y) ' ' = x ' ' * y ' '
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x * y) ' ' = x ' ' * y ' '

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_tabulate[simp]: "map f (tabulate g x n) = tabulate (\<lambda>x. f (g x)) x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (tabulate g x n) = tabulate (\<lambda>x. f (g x)) x n
[PROOF STEP]
by (induction n arbitrary: x) simp_all


[STATEMENT]
lemma axis_inverse:
  fixes v :: "real^'n"
  assumes "v \<in> Basis"
  shows "\<exists>i. v = axis i 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. v = axis i 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i. v = axis i 1
[PROOF STEP]
have "v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})
[PROOF STEP]
using assms Basis_vec_def
[PROOF STATE]
proof (prove)
using this:
v \<in> Basis
Basis = (\<Union>i. \<Union>u\<in>Basis. {axis i u})

goal (1 subgoal):
 1. v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})

goal (1 subgoal):
 1. \<exists>i. v = axis i 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<in> (\<Union>n. \<Union>r\<in>Basis. {axis n r})

goal (1 subgoal):
 1. \<exists>i. v = axis i 1
[PROOF STEP]
by (force simp add: vec_eq_iff)
[PROOF STATE]
proof (state)
this:
\<exists>i. v = axis i 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rec_by_index_inj: "rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1=x2 \<and> y1=y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
assume "rec_by_index x1 y1 = rec_by_index x2 y2"
[PROOF STATE]
proof (state)
this:
rec_by_index x1 y1 = rec_by_index x2 y2

goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
hence "c_pair 6 (c_pair x1 y1) = c_pair 6 (c_pair x2 y2)"
[PROOF STATE]
proof (prove)
using this:
rec_by_index x1 y1 = rec_by_index x2 y2

goal (1 subgoal):
 1. c_pair 6 (c_pair x1 y1) = c_pair 6 (c_pair x2 y2)
[PROOF STEP]
by (unfold rec_by_index_def)
[PROOF STATE]
proof (state)
this:
c_pair 6 (c_pair x1 y1) = c_pair 6 (c_pair x2 y2)

goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
hence "c_pair x1 y1 = c_pair x2 y2"
[PROOF STATE]
proof (prove)
using this:
c_pair 6 (c_pair x1 y1) = c_pair 6 (c_pair x2 y2)

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2
[PROOF STEP]
by (rule c_pair_inj2)
[PROOF STATE]
proof (state)
this:
c_pair x1 y1 = c_pair x2 y2

goal (1 subgoal):
 1. rec_by_index x1 y1 = rec_by_index x2 y2 \<Longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
c_pair x1 y1 = c_pair x2 y2

goal (1 subgoal):
 1. x1 = x2 \<and> y1 = y2
[PROOF STEP]
by (rule c_pair_inj)
[PROOF STATE]
proof (state)
this:
x1 = x2 \<and> y1 = y2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma kpower_inv:
  fixes F :: "'a \<Rightarrow> 'a set"
  assumes "\<forall>s. I s \<longrightarrow> (\<forall>s'. s' \<in> F s \<longrightarrow> I s')"
  shows "\<forall>s. I s \<longrightarrow> (\<forall>s'. s' \<in> (kpower F n s) \<longrightarrow> I s')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s. I s \<longrightarrow> (\<forall>s'. s' \<in> kpower F n s \<longrightarrow> I s')
[PROOF STEP]
apply(clarsimp, induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s s'. \<lbrakk>I s; s' \<in> kpower F 0 s\<rbrakk> \<Longrightarrow> I s'
 2. \<And>n s s'. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> kpower F (Suc n) s\<rbrakk> \<Longrightarrow> I s'
[PROOF STEP]
unfolding kpower_base kpower_simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s s'. \<lbrakk>I s; s' \<in> skip s\<rbrakk> \<Longrightarrow> I s'
 2. \<And>n s s'. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> (F ; kpower F n) s\<rbrakk> \<Longrightarrow> I s'
[PROOF STEP]
apply(simp_all add: kcomp_eq, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n s s' y. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> kpower F n y; y \<in> F s\<rbrakk> \<Longrightarrow> I s'
[PROOF STEP]
apply(subgoal_tac "I y", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n s s' y. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> kpower F n y; y \<in> F s\<rbrakk> \<Longrightarrow> I y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>s. I s \<longrightarrow> (\<forall>s'. s' \<in> F s \<longrightarrow> I s')

goal (1 subgoal):
 1. \<And>n s s' y. \<lbrakk>\<And>s s'. \<lbrakk>I s; s' \<in> kpower F n s\<rbrakk> \<Longrightarrow> I s'; I s; s' \<in> kpower F n y; y \<in> F s\<rbrakk> \<Longrightarrow> I y
[PROOF STEP]
by blast


[STATEMENT]
lemma quat_inner_k_left [simp]: "inner \<k> x = Im3 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<k> \<bullet> x = Im3 x
[PROOF STEP]
unfolding inner_quat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat.Re \<k> * quat.Re x + Im1 \<k> * Im1 x + Im2 \<k> * Im2 x + Im3 \<k> * Im3 x = Im3 x
[PROOF STEP]
by simp


[STATEMENT]
lemma Replace_cong [cong]:
    "\<lbrakk> A=B;  \<And>x y. x \<^bold>\<in> B \<Longrightarrow> P x y \<longleftrightarrow> Q x y \<rbrakk>  \<Longrightarrow> Replace A P = Replace B Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; \<And>x y. x \<^bold>\<in> B \<Longrightarrow> P x y = Q x y\<rbrakk> \<Longrightarrow> Replace A P = Replace B Q
[PROOF STEP]
by (simp add: hf_ext cong: conj_cong)


[STATEMENT]
lemma sum_list_ge_0: fixes xs :: "('a :: ordered_semiring_0)list"
  assumes ge: "\<And> x. x \<in> set xs \<Longrightarrow> x \<ge> 0"
  shows "sum_list xs \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> sum_list xs
[PROOF STEP]
by (rule sum_list_ge_0_nth, insert ge[unfolded set_conv_nth], auto)


[STATEMENT]
lemma sums_mult_D: "(\<lambda>n. c * f n) sums a \<Longrightarrow> c \<noteq> 0 \<Longrightarrow> f sums (a/c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. c * f n) sums a; c \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> f sums (a / c)
[PROOF STEP]
using sums_mult_iff
[PROOF STATE]
proof (prove)
using this:
?c \<noteq> (0::?'a) \<Longrightarrow> (\<lambda>n. ?c * ?f n) sums (?c * ?d) = ?f sums ?d

goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. c * f n) sums a; c \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> f sums (a / c)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma insert_transpose_board:
  "insert (transpose_square s\<^sub>i) (transpose_board b) = transpose_board (insert s\<^sub>i b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (transpose_square s\<^sub>i) (transpose_board b) = transpose_board (insert s\<^sub>i b)
[PROOF STEP]
unfolding transpose_board_def transpose_square_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert (case s\<^sub>i of (i, j) \<Rightarrow> (j, i)) {(j, i) |i j. (i, j) \<in> b} = {(j, i) |i j. (i, j) \<in> insert s\<^sub>i b}
[PROOF STEP]
by (auto split: prod.splits)


[STATEMENT]
lemma circle_cube_nice:
  shows "circle_cube = (\<lambda>(x,y). (d * x_coord x, (2 * y - 1) * d * circle_y (x_coord x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circle_cube = (\<lambda>(x, y). (d * x_coord x, (2 * y - 1) * d * circle_y (x_coord x)))
[PROOF STEP]
by (auto simp add: circle_cube_def circle_y_def x_coord_def)


[STATEMENT]
lemma radical_ideal_Int: "\<surd>(ideal F \<inter> ideal G) = \<surd>ideal F \<inter> \<surd>ideal G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<surd>(ideal F \<inter> ideal G) = \<surd>ideal F \<inter> \<surd>ideal G
[PROOF STEP]
using radical_Int_subset
[PROOF STATE]
proof (prove)
using this:
\<surd>(?A \<inter> ?B) \<subseteq> \<surd>?A \<inter> \<surd>?B

goal (1 subgoal):
 1. \<surd>(ideal F \<inter> ideal G) = \<surd>ideal F \<inter> \<surd>ideal G
[PROOF STEP]
proof (rule subset_antisym)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<surd>ideal F \<inter> \<surd>ideal G \<subseteq> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
show "\<surd>ideal F \<inter> \<surd>ideal G \<subseteq> \<surd>(ideal F \<inter> ideal G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<surd>ideal F \<inter> \<surd>ideal G \<subseteq> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
assume "p \<in> \<surd>ideal F \<inter> \<surd>ideal G"
[PROOF STATE]
proof (state)
this:
p \<in> \<surd>ideal F \<inter> \<surd>ideal G

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
hence "p \<in> \<surd>ideal F" and "p \<in> \<surd>ideal G"
[PROOF STATE]
proof (prove)
using this:
p \<in> \<surd>ideal F \<inter> \<surd>ideal G

goal (1 subgoal):
 1. p \<in> \<surd>ideal F &&& p \<in> \<surd>ideal G
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
p \<in> \<surd>ideal F
p \<in> \<surd>ideal G

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
from this(1)
[PROOF STATE]
proof (chain)
picking this:
p \<in> \<surd>ideal F
[PROOF STEP]
obtain m1 where p1: "p ^ m1 \<in> ideal F"
[PROOF STATE]
proof (prove)
using this:
p \<in> \<surd>ideal F

goal (1 subgoal):
 1. (\<And>m1. p ^ m1 \<in> ideal F \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule radicalE)
[PROOF STATE]
proof (state)
this:
p ^ m1 \<in> ideal F

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
from \<open>p \<in> \<surd>ideal G\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<in> \<surd>ideal G
[PROOF STEP]
obtain m2 where "p ^ m2 \<in> ideal G"
[PROOF STATE]
proof (prove)
using this:
p \<in> \<surd>ideal G

goal (1 subgoal):
 1. (\<And>m2. p ^ m2 \<in> ideal G \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule radicalE)
[PROOF STATE]
proof (state)
this:
p ^ m2 \<in> ideal G

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
hence "p ^ m1 * p ^ m2 \<in> ideal G"
[PROOF STATE]
proof (prove)
using this:
p ^ m2 \<in> ideal G

goal (1 subgoal):
 1. p ^ m1 * p ^ m2 \<in> ideal G
[PROOF STEP]
by (rule ideal.span_scale)
[PROOF STATE]
proof (state)
this:
p ^ m1 * p ^ m2 \<in> ideal G

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p ^ m1 * p ^ m2 \<in> ideal G

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
from p1
[PROOF STATE]
proof (chain)
picking this:
p ^ m1 \<in> ideal F
[PROOF STEP]
have "p ^ m2 * p ^ m1 \<in> ideal F"
[PROOF STATE]
proof (prove)
using this:
p ^ m1 \<in> ideal F

goal (1 subgoal):
 1. p ^ m2 * p ^ m1 \<in> ideal F
[PROOF STEP]
by (rule ideal.span_scale)
[PROOF STATE]
proof (state)
this:
p ^ m2 * p ^ m1 \<in> ideal F

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p ^ m1 * p ^ m2 \<in> ideal G
p ^ m2 * p ^ m1 \<in> ideal F
[PROOF STEP]
have "p ^ (m1 + m2) \<in> ideal F \<inter> ideal G"
[PROOF STATE]
proof (prove)
using this:
p ^ m1 * p ^ m2 \<in> ideal G
p ^ m2 * p ^ m1 \<in> ideal F

goal (1 subgoal):
 1. p ^ (m1 + m2) \<in> ideal F \<inter> ideal G
[PROOF STEP]
by (simp add: power_add mult.commute)
[PROOF STATE]
proof (state)
this:
p ^ (m1 + m2) \<in> ideal F \<inter> ideal G

goal (1 subgoal):
 1. \<And>x. x \<in> \<surd>ideal F \<inter> \<surd>ideal G \<Longrightarrow> x \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
thus "p \<in> \<surd>(ideal F \<inter> ideal G)"
[PROOF STATE]
proof (prove)
using this:
p ^ (m1 + m2) \<in> ideal F \<inter> ideal G

goal (1 subgoal):
 1. p \<in> \<surd>(ideal F \<inter> ideal G)
[PROOF STEP]
by (rule radicalI)
[PROOF STATE]
proof (state)
this:
p \<in> \<surd>(ideal F \<inter> ideal G)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<surd>ideal F \<inter> \<surd>ideal G \<subseteq> \<surd>(ideal F \<inter> ideal G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emeasure_eP:
  assumes \<omega>[simp]: "\<omega> \<in> space (PiM {0..<n} M)" and A[measurable]: "A \<in> sets (PiM {0..<Suc n} M)"
  shows "eP n \<omega> A = P n \<omega> ((\<lambda>x. \<omega>(n := x)) -` A \<inter> space (M n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (eP n \<omega>) A = emeasure (P n \<omega>) (fun_upd \<omega> n -` A \<inter> space (M n))
[PROOF STEP]
using nn_integral_eP[of \<omega> n "indicator A"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<omega> \<in> space (Pi\<^sub>M {0..<n} M); indicator A \<in> borel_measurable (Pi\<^sub>M {0..<Suc n} M)\<rbrakk> \<Longrightarrow> integral\<^sup>N (eP n \<omega>) (indicator A) = \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega>

goal (1 subgoal):
 1. emeasure (eP n \<omega>) A = emeasure (P n \<omega>) (fun_upd \<omega> n -` A \<inter> space (M n))
[PROOF STEP]
apply (simp add: sets_eP nn_integral_indicator[symmetric] sets_P del: nn_integral_indicator)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (eP n \<omega>) (indicator A) = \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega> \<Longrightarrow> \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega> = emeasure (P n \<omega>) (fun_upd \<omega> n -` A \<inter> space (M n))
[PROOF STEP]
apply (subst nn_integral_indicator[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. integral\<^sup>N (eP n \<omega>) (indicator A) = \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega> \<Longrightarrow> fun_upd \<omega> n -` A \<inter> space (M n) \<in> sets (P n \<omega>)
 2. integral\<^sup>N (eP n \<omega>) (indicator A) = \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega> \<Longrightarrow> \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega> = integral\<^sup>N (P n \<omega>) (indicator (fun_upd \<omega> n -` A \<inter> space (M n)))
[PROOF STEP]
using measurable_sets[OF measurable_fun_upd[OF _ measurable_const[OF \<omega>] measurable_id] A, of n]
[PROOF STATE]
proof (prove)
using this:
{0..<Suc n} = {0..<n} \<union> {n} \<Longrightarrow> fun_upd \<omega> n -` A \<inter> space (M n) \<in> sets (M n)

goal (2 subgoals):
 1. integral\<^sup>N (eP n \<omega>) (indicator A) = \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega> \<Longrightarrow> fun_upd \<omega> n -` A \<inter> space (M n) \<in> sets (P n \<omega>)
 2. integral\<^sup>N (eP n \<omega>) (indicator A) = \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega> \<Longrightarrow> \<integral>\<^sup>+ x. indicator A (\<omega>(n := x)) \<partial>P n \<omega> = integral\<^sup>N (P n \<omega>) (indicator (fun_upd \<omega> n -` A \<inter> space (M n)))
[PROOF STEP]
apply (auto simp add: sets_P atLeastLessThanSuc space_P simp del: nn_integral_indicator
     intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma i0_less[simp]: "(0::enat) < n \<longleftrightarrow> n \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < n) = (n \<noteq> 0)
[PROOF STEP]
by (rule zero_less_iff_neq_zero)


[STATEMENT]
lemma list_conj_nb: " \<forall>p\<in> set ps. bound0 p \<Longrightarrow> bound0 (list_conj ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>set ps. bound0 p \<Longrightarrow> bound0 (list_conj ps)
[PROOF STEP]
by (induct ps, auto simp add: list_conj_def)


[STATEMENT]
lemma filter_mset_neq_cond: "{#x \<in># M. P x \<and> x \<noteq> y#} = removeAll_mset y {# x\<in>#M. P x#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#x \<in># M. P x \<and> x \<noteq> y#} = removeAll_mset y (filter_mset P M)
[PROOF STEP]
by (metis filter_filter_mset filter_mset_neq)


[STATEMENT]
lemma type_less_eq_x_ObjectType_intro [intro]:
  "\<tau> = \<langle>\<C>\<rangle>\<^sub>\<T> \<Longrightarrow> \<C> \<le> \<D> \<Longrightarrow> \<tau> \<le> \<langle>\<D>\<rangle>\<^sub>\<T>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<tau> = \<langle>\<C>\<rangle>\<^sub>\<T>; \<C> \<le> \<D>\<rbrakk> \<Longrightarrow> \<tau> \<le> \<langle>\<D>\<rangle>\<^sub>\<T>
[PROOF STEP]
using order.order_iff_strict
[PROOF STATE]
proof (prove)
using this:
(?a \<le> ?b) = (?a < ?b \<or> ?a = ?b)

goal (1 subgoal):
 1. \<lbrakk>\<tau> = \<langle>\<C>\<rangle>\<^sub>\<T>; \<C> \<le> \<D>\<rbrakk> \<Longrightarrow> \<tau> \<le> \<langle>\<D>\<rangle>\<^sub>\<T>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma possafetyD:
  "\<lbrakk> possafety A P;  t \<in> A\<^sup>\<spadesuit>;
    \<And>r. r \<in> pfinpref A t \<Longrightarrow> \<exists> s \<in> A\<^sup>\<infinity>. r @@ s \<in> P
  \<rbrakk> \<Longrightarrow> t \<in> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>possafety A P; t \<in> A\<^sup>\<spadesuit>; \<And>r. r \<in> pfinpref A t \<Longrightarrow> \<exists>s\<in>A\<^sup>\<infinity>. r @@ s \<in> P\<rbrakk> \<Longrightarrow> t \<in> P
[PROOF STEP]
by (unfold possafety_def) blast


[STATEMENT]
lemma ev_smap[iff]: "ev P (smap f w) \<longleftrightarrow> ev (P \<circ> smap f) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ev P (smap f w) = ev (P \<circ> smap f) w
[PROOF STEP]
using ev_smap
[PROOF STATE]
proof (prove)
using this:
ev ?P (smap ?f ?s) = ev (\<lambda>x. ?P (smap ?f x)) ?s

goal (1 subgoal):
 1. ev P (smap f w) = ev (P \<circ> smap f) w
[PROOF STEP]
unfolding comp_apply
[PROOF STATE]
proof (prove)
using this:
ev ?P (smap ?f ?s) = ev (\<lambda>x. ?P (smap ?f x)) ?s

goal (1 subgoal):
 1. ev P (smap f w) = ev (\<lambda>x. P (smap f x)) w
[PROOF STEP]
by this


[STATEMENT]
lemma binrelchain_propcong_Cons_snoc:
  assumes "\<And>x y. Q x \<Longrightarrow> P x y \<Longrightarrow> Q y"
  shows   "Q x \<Longrightarrow> binrelchain P (x#xs@[y]) \<Longrightarrow> Q y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Q x; binrelchain P (x # xs @ [y])\<rbrakk> \<Longrightarrow> Q y
[PROOF STEP]
proof (induct xs arbitrary: x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>Q x; binrelchain P (x # [] @ [y])\<rbrakk> \<Longrightarrow> Q y
 2. \<And>a xs x. \<lbrakk>\<And>x. \<lbrakk>Q x; binrelchain P (x # xs @ [y])\<rbrakk> \<Longrightarrow> Q y; Q x; binrelchain P (x # (a # xs) @ [y])\<rbrakk> \<Longrightarrow> Q y
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
\<lbrakk>Q ?x; binrelchain P (?x # xs_ @ [y])\<rbrakk> \<Longrightarrow> Q y
Q x
binrelchain P (x # (a_ # xs_) @ [y])

goal (2 subgoals):
 1. \<And>x. \<lbrakk>Q x; binrelchain P (x # [] @ [y])\<rbrakk> \<Longrightarrow> Q y
 2. \<And>a xs x. \<lbrakk>\<And>x. \<lbrakk>Q x; binrelchain P (x # xs @ [y])\<rbrakk> \<Longrightarrow> Q y; Q x; binrelchain P (x # (a # xs) @ [y])\<rbrakk> \<Longrightarrow> Q y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>Q ?x; P ?x ?y\<rbrakk> \<Longrightarrow> Q ?y
\<lbrakk>Q ?x; binrelchain P (?x # xs_ @ [y])\<rbrakk> \<Longrightarrow> Q y
Q x
binrelchain P (x # (a_ # xs_) @ [y])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Q ?x; P ?x ?y\<rbrakk> \<Longrightarrow> Q ?y
\<lbrakk>Q ?x; binrelchain P (?x # xs_ @ [y])\<rbrakk> \<Longrightarrow> Q y
Q x
binrelchain P (x # (a_ # xs_) @ [y])

goal (1 subgoal):
 1. Q y
[PROOF STEP]
using binrelchain_Cons_reduce
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Q ?x; P ?x ?y\<rbrakk> \<Longrightarrow> Q ?y
\<lbrakk>Q ?x; binrelchain P (?x # xs_ @ [y])\<rbrakk> \<Longrightarrow> Q y
Q x
binrelchain P (x # (a_ # xs_) @ [y])
binrelchain ?P (?x # ?xs) \<Longrightarrow> binrelchain ?P ?xs

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>Q x; binrelchain P (x # [] @ [y])\<rbrakk> \<Longrightarrow> Q y
[PROOF STEP]
qed (simp add: assms)


[STATEMENT]
lemma (in algebra) Int_stable: "Int_stable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Int_stable M
[PROOF STEP]
unfolding Int_stable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>M. \<forall>b\<in>M. a \<inter> b \<in> M
[PROOF STEP]
by auto


[STATEMENT]
lemma iT_Plus_iSince_conv: "(P t1. t1 \<S> t2 (I \<oplus> k). Q t2) = (P (t1 + k). t1 \<S> t2 I. Q (t2 + k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P t1. t1 \<S> t2 I \<oplus> k. Q t2) = (P (t1 + k). t1 \<S> t2 I. Q (t2 + k))
[PROOF STEP]
by (simp add: iSince_def iT_Plus_iAll_conv iT_Plus_iEx_conv iT_Plus_cut_greater2)


[STATEMENT]
lemma fun_ran_mwb_lens: "\<lbrakk> mwb_lens X; mwb_lens Y \<rbrakk> \<Longrightarrow> mwb_lens (fun_ran_lens X Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mwb_lens X; mwb_lens Y\<rbrakk> \<Longrightarrow> mwb_lens (fun_ran_lens X Y)
[PROOF STEP]
by (unfold_locales, auto simp add: fun_ran_lens_def)


[STATEMENT]
theorem (in group) subgroups_Inter:
  assumes subgr: "(\<And>H. H \<in> A \<Longrightarrow> subgroup H G)"
    and not_empty: "A \<noteq> {}"
  shows "subgroup (\<Inter>A) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (\<Inter> A) G
[PROOF STEP]
proof (rule subgroupI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<Inter> A \<subseteq> carrier G
 2. \<Inter> A \<noteq> {}
 3. \<And>a. a \<in> \<Inter> A \<Longrightarrow> inv a \<in> \<Inter> A
 4. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
from subgr [THEN subgroup.subset] and not_empty
[PROOF STATE]
proof (chain)
picking this:
?H \<in> A \<Longrightarrow> ?H \<subseteq> carrier G
A \<noteq> {}
[PROOF STEP]
show "\<Inter>A \<subseteq> carrier G"
[PROOF STATE]
proof (prove)
using this:
?H \<in> A \<Longrightarrow> ?H \<subseteq> carrier G
A \<noteq> {}

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

goal (3 subgoals):
 1. \<Inter> A \<noteq> {}
 2. \<And>a. a \<in> \<Inter> A \<Longrightarrow> inv a \<in> \<Inter> A
 3. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<Inter> A \<noteq> {}
 2. \<And>a. a \<in> \<Inter> A \<Longrightarrow> inv a \<in> \<Inter> A
 3. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
from subgr [THEN subgroup.one_closed]
[PROOF STATE]
proof (chain)
picking this:
?H \<in> A \<Longrightarrow> \<one> \<in> ?H
[PROOF STEP]
show "\<Inter>A \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
?H \<in> A \<Longrightarrow> \<one> \<in> ?H

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

goal (2 subgoals):
 1. \<And>a. a \<in> \<Inter> A \<Longrightarrow> inv a \<in> \<Inter> A
 2. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a \<in> \<Inter> A \<Longrightarrow> inv a \<in> \<Inter> A
 2. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a \<in> \<Inter> A \<Longrightarrow> inv a \<in> \<Inter> A
 2. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
assume "x \<in> \<Inter>A"
[PROOF STATE]
proof (state)
this:
x \<in> \<Inter> A

goal (2 subgoals):
 1. \<And>a. a \<in> \<Inter> A \<Longrightarrow> inv a \<in> \<Inter> A
 2. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
with subgr [THEN subgroup.m_inv_closed]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?H \<in> A; ?x \<in> ?H\<rbrakk> \<Longrightarrow> inv ?x \<in> ?H
x \<in> \<Inter> A
[PROOF STEP]
show "inv x \<in> \<Inter>A"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?H \<in> A; ?x \<in> ?H\<rbrakk> \<Longrightarrow> inv ?x \<in> ?H
x \<in> \<Inter> A

goal (1 subgoal):
 1. inv x \<in> \<Inter> A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv x \<in> \<Inter> A

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
assume "x \<in> \<Inter>A" "y \<in> \<Inter>A"
[PROOF STATE]
proof (state)
this:
x \<in> \<Inter> A
y \<in> \<Inter> A

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> \<Inter> A; b \<in> \<Inter> A\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> \<Inter> A
[PROOF STEP]
with subgr [THEN subgroup.m_closed]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?H \<in> A; ?x \<in> ?H; ?y \<in> ?H\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y \<in> ?H
x \<in> \<Inter> A
y \<in> \<Inter> A
[PROOF STEP]
show "x \<otimes> y \<in> \<Inter>A"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?H \<in> A; ?x \<in> ?H; ?y \<in> ?H\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y \<in> ?H
x \<in> \<Inter> A
y \<in> \<Inter> A

goal (1 subgoal):
 1. x \<otimes> y \<in> \<Inter> A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<otimes> y \<in> \<Inter> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma range_mapping_Max_mapping[simp]:
  "finite X \<Longrightarrow> X \<noteq> {} \<Longrightarrow> \<forall>x\<in>X. range_mapping i (j x) (P x) \<Longrightarrow> range_mapping i (Max (j ` X)) (Max_mapping (P ` X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; X \<noteq> {}; \<forall>x\<in>X. range_mapping i (j x) (P x)\<rbrakk> \<Longrightarrow> range_mapping i (Max (j ` X)) (Max_mapping (P ` X))
[PROOF STEP]
by (force simp: pred_mapping_alt Max_mapping_def dom_def image_iff
      intro!: Max_ge_iff[THEN iffD2] split: if_splits)


[STATEMENT]
lemma partitionListRight:
  assumes "xs@ys=xs'@y#ys'"
  and     "y mem ys"
  and     "distinct(xs@ys)"

  obtains zs where "xs' = xs@zs" and "ys=zs@y#ys'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>zs. \<lbrakk>xs' = xs @ zs; ys = zs @ y # ys'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs @ ys = xs' @ y # ys'
y mem ys
distinct (xs @ ys)

goal (1 subgoal):
 1. (\<And>zs. \<lbrakk>xs' = xs @ zs; ys = zs @ y # ys'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(force simp add: append_eq_append_conv2 append_eq_Cons_conv)


[STATEMENT]
lemma preImageE: "x : preImage f A ==> f x : A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> preImage f A \<Longrightarrow> f x \<in> A
[PROOF STEP]
by(simp add: preImage_def)


[STATEMENT]
lemma SUP_real_ennreal:
  assumes "A \<noteq> {}" "bdd_above (f`A)"
  shows "(SUP a\<in>A. ennreal (f a)) = ennreal(SUP a\<in>A. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>a\<in>A. ennreal (f a)) = ennreal (\<Squnion> (f ` A))
[PROOF STEP]
apply (rule antisym, simp add: SUP_least assms(2) cSUP_upper ennreal_leI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (\<Squnion> (f ` A)) \<le> (\<Squnion>a\<in>A. ennreal (f a))
[PROOF STEP]
by (metis assms(1) ennreal_SUP ennreal_less_top le_less)


[STATEMENT]
lemma eventually_going_to_at_bot_dense:
  fixes f :: "'a \<Rightarrow> 'b :: {linorder,no_bot}"
  shows "eventually P (f going_to at_bot within A) \<longleftrightarrow> (\<exists>C. \<forall>x\<in>A. f x < C \<longrightarrow> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (f going_to at_bot within A) = (\<exists>C. \<forall>x\<in>A. f x < C \<longrightarrow> P x)
[PROOF STEP]
unfolding going_to_within_def eventually_filtercomap
    eventually_inf_principal eventually_at_bot_dense
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>Q. (\<exists>N. \<forall>n<N. Q n) \<and> (\<forall>x. Q (f x) \<longrightarrow> x \<in> A \<longrightarrow> P x)) = (\<exists>C. \<forall>x\<in>A. f x < C \<longrightarrow> P x)
[PROOF STEP]
by fast


[STATEMENT]
lemma sum_polynomial_eval:
  "peval (sum_polynomial f idxs) a = (\<Sum>k=0..<length idxs. peval (f (idxs!k)) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. peval (sum_polynomial f idxs) a = (\<Sum>k = 0..<length idxs. peval (f (idxs ! k)) a)
[PROOF STEP]
proof (induction "idxs" rule: List.rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. peval (sum_polynomial f []) a = (\<Sum>k = 0..<length []. peval (f ([] ! k)) a)
 2. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. peval (sum_polynomial f []) a = (\<Sum>k = 0..<length []. peval (f ([] ! k)) a)
 2. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. peval (sum_polynomial f []) a = (\<Sum>k = 0..<length []. peval (f ([] ! k)) a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
peval (sum_polynomial f []) a = (\<Sum>k = 0..<length []. peval (f ([] ! k)) a)

goal (1 subgoal):
 1. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
case (snoc x xs)
[PROOF STATE]
proof (state)
this:
peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a)

goal (1 subgoal):
 1. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a)

goal (1 subgoal):
 1. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
have suc: "peval (sum_polynomial f (xs @ [x])) a = peval (sum_polynomial f (x # xs)) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. peval (sum_polynomial f (xs @ [x])) a = peval (sum_polynomial f (x # xs)) a
[PROOF STEP]
by (induction xs, auto)
[PROOF STATE]
proof (state)
this:
peval (sum_polynomial f (xs @ [x])) a = peval (sum_polynomial f (x # xs)) a

goal (1 subgoal):
 1. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
peval (sum_polynomial f (xs @ [x])) a = peval (sum_polynomial f (x # xs)) a

goal (1 subgoal):
 1. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
have list_property: "xa < length xs \<Longrightarrow> (xs ! xa) = (xs @ [x]) ! xa" for xa
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xa < length xs \<Longrightarrow> xs ! xa = (xs @ [x]) ! xa
[PROOF STEP]
by (simp add: nth_append)
[PROOF STATE]
proof (state)
this:
?xa < length xs \<Longrightarrow> xs ! ?xa = (xs @ [x]) ! ?xa

goal (1 subgoal):
 1. \<And>x xs. peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a) \<Longrightarrow> peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a)
peval (sum_polynomial f (xs @ [x])) a = peval (sum_polynomial f (x # xs)) a
?xa < length xs \<Longrightarrow> xs ! ?xa = (xs @ [x]) ! ?xa
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
peval (sum_polynomial f xs) a = (\<Sum>k = 0..<length xs. peval (f (xs ! k)) a)
peval (sum_polynomial f (xs @ [x])) a = peval (sum_polynomial f (x # xs)) a
?xa < length xs \<Longrightarrow> xs ! ?xa = (xs @ [x]) ! ?xa

goal (1 subgoal):
 1. peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
peval (sum_polynomial f (xs @ [x])) a = (\<Sum>k = 0..<length (xs @ [x]). peval (f ((xs @ [x]) ! k)) a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dghm_comp_ArrMap_vdomain[dg_cs_simps]:
  assumes "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>"
  shows "\<D>\<^sub>\<circ> ((\<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<CC>
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M \<FF>)\<lparr>ArrMap\<rparr>) = \<AA>\<lparr>Arr\<rparr>
[PROOF STEP]
by
    (
      cs_concl
        cs_simp: dghm_comp_components dg_cs_simps V_cs_simps
        cs_intro: is_dghm.dghm_ArrMap_vrange
    )


[STATEMENT]
lemma closed_vimage_snd: "closed S \<Longrightarrow> closed (snd -` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S \<Longrightarrow> closed (snd -` S)
[PROOF STEP]
unfolding closed_open vimage_Compl [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (- S) \<Longrightarrow> open (snd -` (- S))
[PROOF STEP]
by (rule open_vimage_snd)


[STATEMENT]
lemma compute_int_floor_fl[code]:
  "int_floor_fl (Float m e) = (if 0 \<le> e then m * 2 ^ nat e else m div (2 ^ (nat (-e))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_floor_fl (Float m e) = (if 0 \<le> e then m * 2 ^ nat e else m div 2 ^ nat (- e))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m e. \<lfloor>real_of_int m * 2 powr real_of_int e\<rfloor> = (if 0 \<le> e then m * 2 ^ nat e else m div 2 ^ nat (- e))
[PROOF STEP]
apply (simp add: powr_int floor_divide_of_int_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m e. (0 \<le> e \<longrightarrow> \<lfloor>real_of_int m * 2 ^ nat e\<rfloor> = m * 2 ^ nat e) \<and> (\<not> 0 \<le> e \<longrightarrow> \<lfloor>real_of_int m / 2 ^ nat (- e)\<rfloor> = m div 2 ^ nat (- e))
[PROOF STEP]
apply (metis (no_types, opaque_lifting)floor_divide_of_int_eq of_int_numeral of_int_power floor_of_int of_int_mult)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma to_poly_inverse:
  assumes "f \<in> carrier P"
  assumes "degree f = 0"
  shows "f = to_poly (f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = to_polynomial R (f 0)
[PROOF STEP]
using P_def assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
P \<equiv> UP R
f \<in> carrier P
deg R f = 0

goal (1 subgoal):
 1. f = to_polynomial R (f 0)
[PROOF STEP]
by (metis ltrm_deg_0 to_polynomial_def)


[STATEMENT]
lemma sums_mult_D: "(\<lambda>n. c * f n) sums a \<Longrightarrow> c \<noteq> 0 \<Longrightarrow> f sums (a/c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. c * f n) sums a; c \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> f sums (a / c)
[PROOF STEP]
using sums_mult_iff
[PROOF STATE]
proof (prove)
using this:
?c \<noteq> (0::?'a) \<Longrightarrow> (\<lambda>n. ?c * ?f n) sums (?c * ?d) = ?f sums ?d

goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. c * f n) sums a; c \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> f sums (a / c)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma continuous_on_of_int_ceiling:
  "continuous_on (UNIV - \<int>::'a::{order_topology, floor_ceiling} set)
    (\<lambda>x. of_int (ceiling x)::'b::{ring_1, topological_space})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (UNIV - \<int>) (\<lambda>x. of_int \<lceil>x\<rceil>)
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV - \<int>. ((\<lambda>x. of_int \<lceil>x\<rceil>) \<longlongrightarrow> of_int \<lceil>x\<rceil>) (at x within UNIV - \<int>)
[PROOF STEP]
by (auto intro!: tendsto_of_int_ceiling)


[STATEMENT]
lemma refines_trans: "\<lbrakk>refines A P Q; refines A Q R\<rbrakk> \<Longrightarrow> refines A P R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>refines A P Q; refines A Q R\<rbrakk> \<Longrightarrow> refines A P R
[PROOF STEP]
by (meson order.trans refines_def)


[STATEMENT]
lemma rtranclp_closed: "rtranclp R q q' \<Longrightarrow> X = X \<union> {q'. \<exists>q \<in> X. R q q'} \<Longrightarrow>
  q \<in> X \<Longrightarrow> q' \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R\<^sup>*\<^sup>* q q'; X = X \<union> {q'. \<exists>q\<in>X. R q q'}; q \<in> X\<rbrakk> \<Longrightarrow> q' \<in> X
[PROOF STEP]
by (induction q q' rule: rtranclp.induct) auto


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


[STATEMENT]
lemma halfspace_eq_empty_gt:
  "{x. a \<bullet> x > b} = {} \<longleftrightarrow> a = 0 \<and> b \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x. b < a \<bullet> x} = {}) = (a = (0::'a) \<and> 0 \<le> b)
[PROOF STEP]
using halfspace_eq_empty_lt [of "-a" "-b"]
[PROOF STATE]
proof (prove)
using this:
({x. - a \<bullet> x < - b} = {}) = (- a = (0::'a) \<and> - b \<le> 0)

goal (1 subgoal):
 1. ({x. b < a \<bullet> x} = {}) = (a = (0::'a) \<and> 0 \<le> b)
[PROOF STEP]
by simp


[STATEMENT]
lemma is_sorted_list_of_set_by_mono:
  "\<lbrakk> R \<subseteq> S; is_sorted_list_of_set_by R A xs \<rbrakk> \<Longrightarrow> is_sorted_list_of_set_by S A xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R \<subseteq> S; is_sorted_list_of_set_by R A xs\<rbrakk> \<Longrightarrow> is_sorted_list_of_set_by S A xs
[PROOF STEP]
by (auto simp add: is_sorted_list_of_set_by_def)


[STATEMENT]
lemma set_mono_sublist: "sublist xs ys \<Longrightarrow> set xs \<subseteq> set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sublist xs ys \<Longrightarrow> set xs \<subseteq> set ys
[PROOF STEP]
by (auto simp add: sublist_def)


[STATEMENT]
lemma Times_mset_Int_distrib1: "(A \<inter># B) \<times># C = A \<times># C \<inter># B \<times># C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<inter># B) \<times># C = A \<times># C \<inter># B \<times># C
[PROOF STEP]
by (fact Sigma_mset_Int_distrib1)


[STATEMENT]
lemma distinct_union[simp]: "distinct(List.union xs ys) = distinct ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (List.union xs ys) = distinct ys
[PROOF STEP]
unfolding List.union_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (fold List.insert xs ys) = distinct ys
[PROOF STEP]
by(induct xs arbitrary: ys) simp_all


[STATEMENT]
lemma fin: "finite X" if "X \<subseteq> {n. real n \<le> x}" for X x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X
[PROOF STEP]
by (rule finite_subset[of _ "{..nat \<lfloor>x\<rfloor>}"]) (use that in \<open>auto simp: le_nat_iff le_floor_iff\<close>)


[STATEMENT]
lemma finite_graph_iff_finite_dom[simp]: "finite (graph m) = finite (dom m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (graph m) = finite (dom m)
[PROOF STEP]
by (metis graph_eq_to_snd_dom finite_imageI fst_graph_eq_dom)


[STATEMENT]
lemma zmult_zless_mono_neg:"\<lbrakk>(i::int) < j; k < 0\<rbrakk> \<Longrightarrow> j * k < i * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < j; k < 0\<rbrakk> \<Longrightarrow> j * k < i * k
[PROOF STEP]
apply (subgoal_tac "0 < -k",
       frule int_mult_mono[of "i" "j" "-k"], assumption+,
       simp add:mult.commute, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma the_inv_into_image_eq: "inj_on f A \<Longrightarrow> Y \<subseteq> f ` A \<Longrightarrow> the_inv_into A f ` Y = f -` Y \<inter> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f A; Y \<subseteq> f ` A\<rbrakk> \<Longrightarrow> the_inv_into A f ` Y = f -` Y \<inter> A
[PROOF STEP]
using f_the_inv_into_f the_inv_into_f_f[where f = f and A = A]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>inj_on ?f ?A; ?y \<in> ?f ` ?A\<rbrakk> \<Longrightarrow> ?f (the_inv_into ?A ?f ?y) = ?y
\<lbrakk>inj_on f A; ?x \<in> A\<rbrakk> \<Longrightarrow> the_inv_into A f (f ?x) = ?x

goal (1 subgoal):
 1. \<lbrakk>inj_on f A; Y \<subseteq> f ` A\<rbrakk> \<Longrightarrow> the_inv_into A f ` Y = f -` Y \<inter> A
[PROOF STEP]
by force


[STATEMENT]
lemma (in Finite_Graph) sum_incoming_alt: "\<lbrakk>\<forall>e. 0 \<le> g e \<and> g e \<le> c e\<rbrakk> \<Longrightarrow>
  \<forall>v \<in> V. (\<Sum>e \<in> incoming v. g e) = (\<Sum>u \<in> V. g (u, v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e. (0::'a) \<le> g e \<and> g e \<le> c e \<Longrightarrow> \<forall>v\<in>V. sum g (incoming v) = (\<Sum>u\<in>V. g (u, v))
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<lbrakk>\<forall>e. (0::'a) \<le> g e \<and> g e \<le> c e; v \<in> V\<rbrakk> \<Longrightarrow> sum g (incoming v) = (\<Sum>u\<in>V. g (u, v))
[PROOF STEP]
apply (rule sum_incoming_extend)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v u. \<lbrakk>\<forall>e. (0::'a) \<le> g e \<and> g e \<le> c e; v \<in> V; u \<in> V; (u, v) \<notin> E\<rbrakk> \<Longrightarrow> g (u, v) = (0::'a)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v u. \<lbrakk>\<forall>a b. (0::'a) \<le> g (a, b) \<and> g (a, b) \<le> c (a, b); v \<in> V; u \<in> V; (u, v) \<notin> E\<rbrakk> \<Longrightarrow> g (u, v) = (0::'a)
[PROOF STEP]
by (metis antisym zero_cap_simp)


[STATEMENT]
lemma monomial_power_map_scale: "(monomial c t) ^ n = monomial (c ^ n) (n \<cdot> t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomial c t ^ n = monomial (c ^ n) (n \<cdot> t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monomial c t ^ n = monomial (c ^ n) (n \<cdot> t)
[PROOF STEP]
have "(\<Sum>i = 0..<n. t) = (\<Sum>i = 0..<n. 1) \<cdot> t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. t) = (\<Sum>i = 0..<n. 1) \<cdot> t
[PROOF STEP]
by (simp only: map_scale_sum_distrib_right map_scale_one_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. t) = (\<Sum>i = 0..<n. 1) \<cdot> t

goal (1 subgoal):
 1. monomial c t ^ n = monomial (c ^ n) (n \<cdot> t)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<n. t) = (\<Sum>i = 0..<n. 1) \<cdot> t

goal (1 subgoal):
 1. monomial c t ^ n = monomial (c ^ n) (n \<cdot> t)
[PROOF STEP]
by (simp add: punit.monomial_power)
[PROOF STATE]
proof (state)
this:
monomial c t ^ n = monomial (c ^ n) (n \<cdot> t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hm_key_of_exch_conv[simp]:
      "\<lbrakk>hm_valid hm i; hm_valid hm j; hm_valid hm k\<rbrakk> \<Longrightarrow>
        hm_key_of (hm_exch hm i j) k = (
          if k=i then hm_key_of hm j
          else if k=j then hm_key_of hm i
          else hm_key_of hm k
          )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>hm_valid hm i; hm_valid hm j; hm_valid hm k\<rbrakk> \<Longrightarrow> hm_key_of (hm_exch hm i j) k = (if k = i then hm_key_of hm j else if k = j then hm_key_of hm i else hm_key_of hm k)
[PROOF STEP]
unfolding hm_exch_def hm_valid_def hm_length_def hm_key_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i \<and> i \<le> (case hm of (pq, uu_) \<Rightarrow> length pq); 0 < j \<and> j \<le> (case hm of (pq, uu_) \<Rightarrow> length pq); 0 < k \<and> k \<le> (case hm of (pq, uu_) \<Rightarrow> length pq)\<rbrakk> \<Longrightarrow> (case (case hm of (pq, m) \<Rightarrow> \<lambda>i j. (swap pq (i - 1) (j - 1), m)) i j of (pq, m) \<Rightarrow> \<lambda>i. pq ! (i - 1)) k = (if k = i then (case hm of (pq, m) \<Rightarrow> \<lambda>i. pq ! (i - 1)) j else if k = j then (case hm of (pq, m) \<Rightarrow> \<lambda>i. pq ! (i - 1)) i else (case hm of (pq, m) \<Rightarrow> \<lambda>i. pq ! (i - 1)) k)
[PROOF STEP]
by (auto split: prod.splits)


[STATEMENT]
lemma set_integral_null_delta:
  fixes f::"_ \<Rightarrow> _ :: {banach, second_countable_topology}"
  assumes [measurable]: "integrable M f" "A \<in> sets M" "B \<in> sets M"
    and null: "(A - B) \<union> (B - A) \<in> null_sets M"
  shows "(\<integral>x \<in> A. f x \<partial>M) = (\<integral>x \<in> B. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_lebesgue_integral M A f = set_lebesgue_integral M B f
[PROOF STEP]
proof (rule set_integral_cong_set)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. set_borel_measurable M B f
 2. set_borel_measurable M A f
 3. AE x in M. (x \<in> B) = (x \<in> A)
[PROOF STEP]
have *: "AE a in M. a \<notin> (A - B) \<union> (B - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE a in M. a \<notin> A - B \<union> (B - A)
[PROOF STEP]
using null AE_not_in
[PROOF STATE]
proof (prove)
using this:
A - B \<union> (B - A) \<in> null_sets M
?N \<in> null_sets ?M \<Longrightarrow> AE x in ?M. x \<notin> ?N

goal (1 subgoal):
 1. AE a in M. a \<notin> A - B \<union> (B - A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
AE a in M. a \<notin> A - B \<union> (B - A)

goal (3 subgoals):
 1. set_borel_measurable M B f
 2. set_borel_measurable M A f
 3. AE x in M. (x \<in> B) = (x \<in> A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE a in M. a \<notin> A - B \<union> (B - A)
[PROOF STEP]
show "AE x in M. (x \<in> B) = (x \<in> A)"
[PROOF STATE]
proof (prove)
using this:
AE a in M. a \<notin> A - B \<union> (B - A)

goal (1 subgoal):
 1. AE x in M. (x \<in> B) = (x \<in> A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. (x \<in> B) = (x \<in> A)

goal (2 subgoals):
 1. set_borel_measurable M B f
 2. set_borel_measurable M A f
[PROOF STEP]
qed (simp_all add: set_borel_measurable_def)


[STATEMENT]
lemma borel_Ici: "borel = sigma UNIV (range (\<lambda>x::real. {x ..}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. borel = sigma UNIV (range atLeast)
[PROOF STEP]
proof (safe intro!: borel_eq_sigmaI1[OF borel_Iio])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> {..<xa} \<in> sets (sigma UNIV (range atLeast))
 2. \<And>i. i \<in> UNIV \<Longrightarrow> {i..} \<in> sets borel
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> {..<xa} \<in> sets (sigma UNIV (range atLeast))
 2. \<And>i. i \<in> UNIV \<Longrightarrow> {i..} \<in> sets borel
[PROOF STEP]
have eq: "{..<x} = space (sigma UNIV (range atLeast)) - {x ..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<x} = space (sigma UNIV (range atLeast)) - {x..}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{..<x} = space (sigma UNIV (range atLeast)) - {x..}

goal (2 subgoals):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> {..<xa} \<in> sets (sigma UNIV (range atLeast))
 2. \<And>i. i \<in> UNIV \<Longrightarrow> {i..} \<in> sets borel
[PROOF STEP]
show "{..<x} \<in> sets (sigma UNIV (range atLeast))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<x} \<in> sets (sigma UNIV (range atLeast))
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (sigma UNIV (range atLeast)) - {x..} \<in> sets (sigma UNIV (range atLeast))
[PROOF STEP]
by (intro sets.compl_sets) auto
[PROOF STATE]
proof (state)
this:
{..<x} \<in> sets (sigma UNIV (range atLeast))

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> {i..} \<in> sets borel
[PROOF STEP]
qed auto


[STATEMENT]
lemma ts_tuple_rel_filter: "ts_tuple_rel (set (filter (\<lambda>(t, X). P t) xs)) =
  {(t, X) \<in> ts_tuple_rel (set xs). P t}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ts_tuple_rel (set (filter (\<lambda>(t, X). P t) xs)) = {(t, X). (t, X) \<in> ts_tuple_rel (set xs) \<and> P t}
[PROOF STEP]
by (auto simp add: ts_tuple_rel_def)


[STATEMENT]
lemma poly_condD:
  assumes "poly_cond p"
  shows "irreducible p" and "lead_coeff p > 0" and "root_free p" and "square_free p" and "p \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (irreducible p &&& 0 < lead_coeff p) &&& root_free p &&& square_free p &&& p \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
poly_cond p

goal (1 subgoal):
 1. (irreducible p &&& 0 < lead_coeff p) &&& root_free p &&& square_free p &&& p \<noteq> 0
[PROOF STEP]
unfolding poly_cond_def
[PROOF STATE]
proof (prove)
using this:
0 < lead_coeff p \<and> irreducible p

goal (1 subgoal):
 1. (irreducible p &&& 0 < lead_coeff p) &&& root_free p &&& square_free p &&& p \<noteq> 0
[PROOF STEP]
using irreducible_root_free irreducible_imp_square_free cf_pos_def
[PROOF STATE]
proof (prove)
using this:
0 < lead_coeff p \<and> irreducible p
irreducible ?p \<Longrightarrow> root_free ?p
irreducible ?p \<Longrightarrow> square_free ?p
cf_pos ?p = (content ?p = 1 \<and> 0 < lead_coeff ?p)

goal (1 subgoal):
 1. (irreducible p &&& 0 < lead_coeff p) &&& root_free p &&& square_free p &&& p \<noteq> 0
[PROOF STEP]
by auto


[STATEMENT]
lemma timpl_closure'_timpls_trancl_supset:
  "timpl_closure' c \<subseteq> timpl_closure' (c\<^sup>+)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. timpl_closure' c \<subseteq> timpl_closure' (c\<^sup>+)
[PROOF STEP]
using timpl_closure'_timpls_trancl_supset'[of c]
      timpl_closure'_mono[of "{(a,b) \<in> c\<^sup>+. a \<noteq> b}" "c\<^sup>+"]
[PROOF STATE]
proof (prove)
using this:
timpl_closure' c \<subseteq> timpl_closure' {(a, b). (a, b) \<in> c\<^sup>+ \<and> a \<noteq> b}
{(a, b). (a, b) \<in> c\<^sup>+ \<and> a \<noteq> b} \<subseteq> c\<^sup>+ \<Longrightarrow> timpl_closure' {(a, b). (a, b) \<in> c\<^sup>+ \<and> a \<noteq> b} \<subseteq> timpl_closure' (c\<^sup>+)

goal (1 subgoal):
 1. timpl_closure' c \<subseteq> timpl_closure' (c\<^sup>+)
[PROOF STEP]
by fast


[STATEMENT]
lemma gen_gba_impl_rel_sv[relator_props]:
  "\<lbrakk>single_valued Rl; single_valued Rm\<rbrakk>
  \<Longrightarrow> single_valued (\<langle>Rm,Rl\<rangle>gen_gba_impl_rel_eext)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued Rl; single_valued Rm\<rbrakk> \<Longrightarrow> single_valued (\<langle>Rm, Rl\<rangle>gen_gba_impl_rel_eext)
[PROOF STEP]
unfolding gen_gba_impl_rel_eext_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued Rl; single_valued Rm\<rbrakk> \<Longrightarrow> single_valued {(\<lparr>gbai_L = Li, \<dots> = mi\<rparr>, \<lparr>gba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}
[PROOF STEP]
apply (rule single_valuedI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>single_valued Rl; single_valued Rm; (x, y) \<in> {(\<lparr>gbai_L = Li, \<dots> = mi\<rparr>, \<lparr>gba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}; (x, z) \<in> {(\<lparr>gbai_L = Li, \<dots> = mi\<rparr>, \<lparr>gba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}\<rbrakk> \<Longrightarrow> y = z
[PROOF STEP]
apply (clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> L = La \<and> m = ma
[PROOF STEP]
apply (intro conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> L = La
 2. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> m = ma
[PROOF STEP]
apply (rule single_valuedD[rotated], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> m = ma
[PROOF STEP]
apply (rule single_valuedD[rotated], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma box_right_mult_n_n:
  "|x](n(y) * n(z)) = |x]n(y) * |x]n(z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. | x ] (n y * n z) = | x ] n y * | x ] n z
[PROOF STEP]
by (smt an_dist_sup an_export_n an_n_L mult_assoc mult_left_dist_sup mult_right_dist_sup nbox_def)


[STATEMENT]
lemma triangle_paths_neq:
  assumes tri_abc: "\<triangle> a b c"
      and path_ab: "path ab a b"
      and path_ac: "path ac a c"
  shows "ab \<noteq> ac"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ab \<noteq> ac
[PROOF STEP]
using assms triangle_diff_paths
[PROOF STATE]
proof (prove)
using this:
\<triangle> a b c
path ab a b
path ac a c
\<triangle> ?a ?b ?c \<Longrightarrow> \<not> (\<exists>Q\<in>\<P>. ?a \<in> Q \<and> ?b \<in> Q \<and> ?c \<in> Q)

goal (1 subgoal):
 1. ab \<noteq> ac
[PROOF STEP]
by blast


[STATEMENT]
lemma graph_homomorphismI:
  assumes "vertices s = Domain h"
          "h `` vertices s \<subseteq> vertices t"
          "univalent h"
          "edge_preserving h (edges s) (edges t)"
          "s = restrict s" "t = restrict t"
  shows "graph_homomorphism s t h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph_homomorphism s t h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
vertices s = Domain h
h `` vertices s \<subseteq> vertices t
univalent h
edge_preserving h (edges s) (edges t)
graph s
graph t

goal (1 subgoal):
 1. graph_homomorphism s t h
[PROOF STEP]
unfolding graph_homomorphism_def
[PROOF STATE]
proof (prove)
using this:
vertices s = Domain h
h `` vertices s \<subseteq> vertices t
univalent h
edge_preserving h (edges s) (edges t)
graph s
graph t

goal (1 subgoal):
 1. vertices s = Domain h \<and> graph s \<and> graph t \<and> h `` vertices s \<subseteq> vertices t \<and> univalent h \<and> edge_preserving h (edges s) (edges t)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in ACeD) foldD_Un_disjoint:
  "\<lbrakk>finite A; finite B; A Int B = {}; A \<subseteq> D; B \<subseteq> D\<rbrakk> \<Longrightarrow>
    foldD D f e (A Un B) = foldD D f e A \<cdot> foldD D f e B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; A \<inter> B = {}; A \<subseteq> D; B \<subseteq> D\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) e (A \<union> B) = foldD D (\<cdot>) e A \<cdot> foldD D (\<cdot>) e B
[PROOF STEP]
by (simp add: foldD_Un_Int
    left_commute LCD.foldD_closed [OF LCD.intro [of D]])


[STATEMENT]
lemma after_summary_zmset_of_nonneg[simp, intro]: "0 \<le> zcount (after_summary (zmset_of M) S) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> zcount (after_summary (zmset_of M) S) t
[PROOF STEP]
by (simp add: mset_neg_image_zmset mset_neg_sum_set mset_neg_zcount_nonneg after_summary_def)


[STATEMENT]
lemma fmsubset_pred: "fmpred P m \<Longrightarrow> n \<subseteq>\<^sub>f m \<Longrightarrow> fmpred P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fmpred P m; n \<subseteq>\<^sub>f m\<rbrakk> \<Longrightarrow> fmpred P n
[PROOF STEP]
unfolding fmsubset_alt_def fmpred_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x y. fmlookup m x = Some y \<longrightarrow> P x y; \<forall>x y. fmlookup n x = Some y \<longrightarrow> fmlookup m x = Some y\<rbrakk> \<Longrightarrow> \<forall>x y. fmlookup n x = Some y \<longrightarrow> P x y
[PROOF STEP]
by auto


[STATEMENT]
lemma subprob_space_sigma [simp]: "\<Omega> \<noteq> {} \<Longrightarrow> subprob_space (sigma \<Omega> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Omega> \<noteq> {} \<Longrightarrow> subprob_space (sigma \<Omega> X)
[PROOF STEP]
by(rule subprob_spaceI)(simp_all add: emeasure_sigma space_measure_of_conv)


[STATEMENT]
lemma mset_image_eq_filter_eq: "A = image_mset f B \<Longrightarrow>
  filter_mset P A = (image_mset f (filter_mset (\<lambda> x. P (f x)) B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = image_mset f B \<Longrightarrow> filter_mset P A = image_mset f {#x \<in># B. P (f x)#}
[PROOF STEP]
by (simp add: filter_mset_image_mset)


[STATEMENT]
lemma finite_graph_iff_finite_dom[simp]: "finite (graph m) = finite (dom m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (graph m) = finite (dom m)
[PROOF STEP]
by (metis graph_eq_to_snd_dom finite_imageI fst_graph_eq_dom)


[STATEMENT]
lemma transp_llist_all2: "transp R \<Longrightarrow> transp (llist_all2 R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transp R \<Longrightarrow> transp (llist_all2 R)
[PROOF STEP]
by (rule transpI) (rule llist_all2_trans)


[STATEMENT]
lemma bij_Rep_perm: "bij (Rep_perm p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij (Rep_perm p)
[PROOF STEP]
using Rep_perm [of p]
[PROOF STATE]
proof (prove)
using this:
Rep_perm p \<in> perms

goal (1 subgoal):
 1. bij (Rep_perm p)
[PROOF STEP]
unfolding perms_def
[PROOF STATE]
proof (prove)
using this:
Rep_perm p \<in> {f. bij f \<and> finite {x. f x \<noteq> x}}

goal (1 subgoal):
 1. bij (Rep_perm p)
[PROOF STEP]
by simp


[STATEMENT]
lemma get_fin_long_ch_bounds2:
  assumes "local_long_ch_by_ord f X"
    and "finite X"
  obtains x y z n\<^sub>x n\<^sub>y n\<^sub>z
  where "x\<in>X" "y\<in>X" "z\<in>X" "[f\<leadsto>X|x..y..z]" "f n\<^sub>x = x" "f n\<^sub>y = y" "f n\<^sub>z = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y z n\<^sub>x n\<^sub>y n\<^sub>z. \<lbrakk>x \<in> X; y \<in> X; z \<in> X; [f\<leadsto>X|x..y..z]; f n\<^sub>x = x; f n\<^sub>y = y; f n\<^sub>z = z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using get_fin_long_ch_bounds assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>local_long_ch_by_ord ?f ?X; finite ?X\<rbrakk> \<Longrightarrow> \<exists>x\<in>?X. \<exists>y\<in>?X. \<exists>z\<in>?X. [?f\<leadsto>?X|x..y..z]
local_long_ch_by_ord f X
finite X

goal (1 subgoal):
 1. (\<And>x y z n\<^sub>x n\<^sub>y n\<^sub>z. \<lbrakk>x \<in> X; y \<in> X; z \<in> X; [f\<leadsto>X|x..y..z]; f n\<^sub>x = x; f n\<^sub>y = y; f n\<^sub>z = z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson finite_chain_with_def finite_long_chain_with_alt index_middle_element)


[STATEMENT]
lemma mono_greek_less: "mono greek_less"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono greek_less
[PROOF STEP]
unfolding greek_less_def mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<subseteq> y \<longrightarrow> lfp (nest x) \<subseteq> lfp (nest y)
[PROOF STEP]
proof (intro allI impI lfp_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y Z. x \<subseteq> y \<Longrightarrow> nest x Z \<subseteq> nest y Z
[PROOF STEP]
fix r s :: "('a \<times> 'a) set" and R :: "('a greek \<times> 'a greek) set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y Z. x \<subseteq> y \<Longrightarrow> nest x Z \<subseteq> nest y Z
[PROOF STEP]
assume "r \<subseteq> s"
[PROOF STATE]
proof (state)
this:
r \<subseteq> s

goal (1 subgoal):
 1. \<And>x y Z. x \<subseteq> y \<Longrightarrow> nest x Z \<subseteq> nest y Z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<subseteq> s
[PROOF STEP]
have "letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R"
[PROOF STATE]
proof (prove)
using this:
r \<subseteq> s

goal (1 subgoal):
 1. letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R
[PROOF STEP]
using mono_letter_less mono_lex1
[PROOF STATE]
proof (prove)
using this:
r \<subseteq> s
mono letter_less
mono (\<lambda>r. r <*lex*> ?s)

goal (1 subgoal):
 1. letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
using this:
r \<subseteq> s
\<forall>x y. x \<subseteq> y \<longrightarrow> letter_less x \<subseteq> letter_less y
\<forall>x y. x \<subseteq> y \<longrightarrow> x <*lex*> ?s \<subseteq> y <*lex*> ?s

goal (1 subgoal):
 1. letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R

goal (1 subgoal):
 1. \<And>x y Z. x \<subseteq> y \<Longrightarrow> nest x Z \<subseteq> nest y Z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R
[PROOF STEP]
show "nest r R \<subseteq> nest s R"
[PROOF STATE]
proof (prove)
using this:
letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R

goal (1 subgoal):
 1. nest r R \<subseteq> nest s R
[PROOF STEP]
using mono_mult
[PROOF STATE]
proof (prove)
using this:
letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R
mono mult

goal (1 subgoal):
 1. nest r R \<subseteq> nest s R
[PROOF STEP]
unfolding nest_def mono_def
[PROOF STATE]
proof (prove)
using this:
letter_less r <*lex*> R \<subseteq> letter_less s <*lex*> R
\<forall>x y. x \<subseteq> y \<longrightarrow> mult x \<subseteq> mult y

goal (1 subgoal):
 1. {(a, b). (ms_of_greek a, ms_of_greek b) \<in> mult (letter_less r <*lex*> R)} \<subseteq> {(a, b). (ms_of_greek a, ms_of_greek b) \<in> mult (letter_less s <*lex*> R)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
nest r R \<subseteq> nest s R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fine_subset: "p \<subseteq> q \<Longrightarrow> d fine q \<Longrightarrow> d fine p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<subseteq> q; d fine q\<rbrakk> \<Longrightarrow> d fine p
[PROOF STEP]
unfolding fine_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<subseteq> q; \<forall>(x, k)\<in>q. k \<subseteq> d x\<rbrakk> \<Longrightarrow> \<forall>(x, k)\<in>p. k \<subseteq> d x
[PROOF STEP]
by blast


[STATEMENT]
lemma closed_vimage_snd: "closed S \<Longrightarrow> closed (snd -` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S \<Longrightarrow> closed (snd -` S)
[PROOF STEP]
unfolding closed_open vimage_Compl [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (- S) \<Longrightarrow> open (snd -` (- S))
[PROOF STEP]
by (rule open_vimage_snd)


[STATEMENT]
lemma lesspoll_imp_Card_less:
  assumes "elts a \<prec> elts b" shows "vcard a < vcard b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard a < vcard b
[PROOF STEP]
by (metis assms cardinal_eqpoll eqpoll_sym eqpoll_trans lepoll_imp_Card_le less_V_def lesspoll_def)


[STATEMENT]
lemma least_multrow:
  assumes "A \<in> carrier_mat m n" and "i<m" and eA: "echelon_form_JNF A"
  assumes ia: "ia < dim_row A" and nz_ia_mrA: "\<not> is_zero_row_JNF ia (multrow i (- 1) A)"
  shows "(LEAST n. multrow i (- 1) A $$ (ia, n) \<noteq> 0) = (LEAST n. A $$ (ia, n) \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. multrow i (- (1::'a)) A $$ (ia, n) \<noteq> (0::'a)) = (LEAST n. A $$ (ia, n) \<noteq> (0::'a))
[PROOF STEP]
proof (rule Least_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. multrow i (- (1::'a)) A $$ (ia, LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<noteq> (0::'a)
 2. \<And>y. multrow i (- (1::'a)) A $$ (ia, y) \<noteq> (0::'a) \<Longrightarrow> (LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<le> y
[PROOF STEP]
have nz_ia_A: "\<not> is_zero_row_JNF ia A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_zero_row_JNF ia A
[PROOF STEP]
using nz_ia_mrA ia
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row_JNF ia (multrow i (- (1::'a)) A)
ia < dim_row A

goal (1 subgoal):
 1. \<not> is_zero_row_JNF ia A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> is_zero_row_JNF ia A

goal (2 subgoals):
 1. multrow i (- (1::'a)) A $$ (ia, LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<noteq> (0::'a)
 2. \<And>y. multrow i (- (1::'a)) A $$ (ia, y) \<noteq> (0::'a) \<Longrightarrow> (LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<le> y
[PROOF STEP]
have Least_Aian_n: "(LEAST n. A $$ (ia, n) \<noteq> 0) < dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. A $$ (ia, n) \<noteq> (0::'a)) < dim_col A
[PROOF STEP]
by (smt dual_order.strict_trans is_zero_row_JNF_def not_less_Least not_less_iff_gr_or_eq nz_ia_A)
[PROOF STATE]
proof (state)
this:
(LEAST n. A $$ (ia, n) \<noteq> (0::'a)) < dim_col A

goal (2 subgoals):
 1. multrow i (- (1::'a)) A $$ (ia, LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<noteq> (0::'a)
 2. \<And>y. multrow i (- (1::'a)) A $$ (ia, y) \<noteq> (0::'a) \<Longrightarrow> (LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<le> y
[PROOF STEP]
show "multrow i (- 1) A $$ (ia, LEAST n. A $$ (ia, n) \<noteq> 0) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multrow i (- (1::'a)) A $$ (ia, LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<noteq> (0::'a)
[PROOF STEP]
by (smt LeastI Least_Aian_n class_cring.cring_simprules(22) equation_minus_iff ia
        index_mat_multrow(1) is_zero_row_JNF_def mult_minus1 nz_ia_A)
[PROOF STATE]
proof (state)
this:
multrow i (- (1::'a)) A $$ (ia, LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>y. multrow i (- (1::'a)) A $$ (ia, y) \<noteq> (0::'a) \<Longrightarrow> (LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<le> y
[PROOF STEP]
show " \<And>y. multrow i (- 1) A $$ (ia, y) \<noteq> 0 \<Longrightarrow> (LEAST n. A $$ (ia, n) \<noteq> 0) \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. multrow i (- (1::'a)) A $$ (ia, y) \<noteq> (0::'a) \<Longrightarrow> (LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<le> y
[PROOF STEP]
by (metis (mono_tags, lifting) Least_Aian_n class_cring.cring_simprules(22) ia
        index_mat_multrow(1) leI mult_minus1 order.strict_trans wellorder_Least_lemma(2))
[PROOF STATE]
proof (state)
this:
multrow i (- (1::'a)) A $$ (ia, ?y) \<noteq> (0::'a) \<Longrightarrow> (LEAST n. A $$ (ia, n) \<noteq> (0::'a)) \<le> ?y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_subid_glb_iff: "z \<cdot> 0 \<le> x \<cdot> 0 \<and> z \<cdot> 0 \<le> y \<cdot> 0 \<longleftrightarrow> z \<cdot> 0 \<le> (x \<cdot> 0) \<parallel> (y \<cdot> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<cdot> (0::'a) \<le> x \<cdot> (0::'a) \<and> z \<cdot> (0::'a) \<le> y \<cdot> (0::'a)) = (z \<cdot> (0::'a) \<le> x \<cdot> (0::'a) \<parallel> (y \<cdot> (0::'a)))
[PROOF STEP]
using local.order_trans p_subid_glb p_subid_lb1 p_subid_lb2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z
?z \<cdot> (0::'a) \<le> ?x \<cdot> (0::'a) \<and> ?z \<cdot> (0::'a) \<le> ?y \<cdot> (0::'a) \<Longrightarrow> ?z \<cdot> (0::'a) \<le> ?x \<cdot> (0::'a) \<parallel> (?y \<cdot> (0::'a))
?x \<cdot> (0::'a) \<parallel> (?y \<cdot> (0::'a)) \<le> ?x \<cdot> (0::'a)
?x \<cdot> (0::'a) \<parallel> (?y \<cdot> (0::'a)) \<le> ?y \<cdot> (0::'a)

goal (1 subgoal):
 1. (z \<cdot> (0::'a) \<le> x \<cdot> (0::'a) \<and> z \<cdot> (0::'a) \<le> y \<cdot> (0::'a)) = (z \<cdot> (0::'a) \<le> x \<cdot> (0::'a) \<parallel> (y \<cdot> (0::'a)))
[PROOF STEP]
by blast


[STATEMENT]
lemma not_iWeakUntil: "
  (\<not> (P t1. t1 \<W> t2 I. Q t2)) =
  ((\<box> t I. (Q t \<longrightarrow> (\<diamond> t' (I \<down>< t). \<not> P t'))) \<and> (\<diamond> t I. \<not> P t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (P t1. t1 \<W> t2 I. Q t2)) = ((\<box> t I. Q t \<longrightarrow> (\<diamond> t' I \<down>< t. \<not> P t')) \<and> (\<diamond> t I. \<not> P t))
[PROOF STEP]
by (simp add: iWeakUntil_iUntil_conv not_iUntil)


[STATEMENT]
lemma (in prob_space) uniform_onD:
  assumes "uniform_on X A"
  shows "prob {\<omega> \<in> space M. X \<omega> \<in> B} = card (A \<inter> B) / card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
have "prob {\<omega> \<in> space M. X \<omega> \<in> B} = prob (X -` B \<inter> space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = prob (X -` B \<inter> space M)
[PROOF STEP]
by (subst Int_commute, simp add:vimage_def Int_def)
[PROOF STATE]
proof (state)
this:
prob {\<omega> \<in> space M. X \<omega> \<in> B} = prob (X -` B \<inter> space M)

goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prob {\<omega> \<in> space M. X \<omega> \<in> B} = prob (X -` B \<inter> space M)

goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
have "... = measure (distr M (count_space UNIV) X) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (X -` B \<inter> space M) = Sigma_Algebra.measure (distr M (count_space UNIV) X) B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uniform_on X A

goal (1 subgoal):
 1. prob (X -` B \<inter> space M) = Sigma_Algebra.measure (distr M (count_space UNIV) X) B
[PROOF STEP]
by (subst measure_distr, auto simp:uniform_on_def)
[PROOF STATE]
proof (state)
this:
prob (X -` B \<inter> space M) = Sigma_Algebra.measure (distr M (count_space UNIV) X) B

goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prob (X -` B \<inter> space M) = Sigma_Algebra.measure (distr M (count_space UNIV) X) B

goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
have "... = measure (uniform_measure (count_space UNIV) A) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (distr M (count_space UNIV) X) B = Sigma_Algebra.measure (uniform_measure (count_space UNIV) A) B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uniform_on X A

goal (1 subgoal):
 1. Sigma_Algebra.measure (distr M (count_space UNIV) X) B = Sigma_Algebra.measure (uniform_measure (count_space UNIV) A) B
[PROOF STEP]
by (simp add:uniform_on_def)
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure (distr M (count_space UNIV) X) B = Sigma_Algebra.measure (uniform_measure (count_space UNIV) A) B

goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure (distr M (count_space UNIV) X) B = Sigma_Algebra.measure (uniform_measure (count_space UNIV) A) B

goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
have "... = card (A \<inter> B) / card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (uniform_measure (count_space UNIV) A) B = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uniform_on X A

goal (1 subgoal):
 1. Sigma_Algebra.measure (uniform_measure (count_space UNIV) A) B = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
by (subst measure_uniform_measure, auto simp:uniform_on_def)+
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure (uniform_measure (count_space UNIV) A) B = real (card (A \<inter> B)) / real (card A)

goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)

goal (1 subgoal):
 1. prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prob {\<omega> \<in> space M. X \<omega> \<in> B} = real (card (A \<inter> B)) / real (card A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_poly_x_mult_y[simp]:
  fixes p :: "'a :: {idom, ring_char_0} poly"
  shows "degree (poly_x_mult_y p) = degree p" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_x_mult_y p) = degree p
[PROOF STEP]
proof(rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree (poly_x_mult_y p) \<le> degree p
 2. degree p \<le> degree (poly_x_mult_y p)
[PROOF STEP]
show "?r \<le> ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p \<le> degree (poly_x_mult_y p)
[PROOF STEP]
by (cases "p=0", auto intro: le_degree simp: coeff_poly_x_mult_y)
[PROOF STATE]
proof (state)
this:
degree p \<le> degree (poly_x_mult_y p)

goal (1 subgoal):
 1. degree (poly_x_mult_y p) \<le> degree p
[PROOF STEP]
show "?l \<le> ?r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_x_mult_y p) \<le> degree p
[PROOF STEP]
unfolding poly_x_mult_y_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (\<Sum>i\<le>degree p. monom (monom (coeff p i) i) i) \<le> degree p
[PROOF STEP]
by (auto intro: degree_sum_le le_trans[OF degree_monom_le])
[PROOF STATE]
proof (state)
this:
degree (poly_x_mult_y p) \<le> degree p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma funpow_shift1:
  "(Ipoly bs (funpow n shift1 p) :: 'a :: comm_ring_1) =
    Ipoly bs (Mul (Pw (Bound 0) n) p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly bs ((shift1 ^^ n) p) = Ipoly bs (Mul (Pw (Bound 0) n) p)
[PROOF STEP]
by (induct n arbitrary: p) (simp_all add: shift1_isnpoly shift1)


[STATEMENT]
lemma leadsTo_cancel1:
     "[| F \<in> A leadsTo (B \<union> A'); F \<in> B leadsTo B' |]
    ==> F \<in> A leadsTo (B' \<union> A')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A \<longmapsto> B \<union> A'; F \<in> B \<longmapsto> B'\<rbrakk> \<Longrightarrow> F \<in> A \<longmapsto> B' \<union> A'
[PROOF STEP]
apply (simp add: Un_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A \<longmapsto> A' \<union> B; F \<in> B \<longmapsto> B'\<rbrakk> \<Longrightarrow> F \<in> A \<longmapsto> A' \<union> B'
[PROOF STEP]
apply (blast intro!: leadsTo_cancel2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma degree_monom_le: "degree (monom a n) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (monom a n) \<le> n
[PROOF STEP]
by (rule degree_le, simp)