[STATEMENT]
lemma prod_in_Complexs [intro,simp]: "(\<And>i. i \<in> s \<Longrightarrow> f i \<in> \<complex>) \<Longrightarrow> prod f s \<in> \<complex>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> s \<Longrightarrow> f i \<in> \<complex>) \<Longrightarrow> prod f s \<in> \<complex>
[PROOF STEP]
proof (induct s rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>i. i \<in> A \<Longrightarrow> f i \<in> \<complex>\<rbrakk> \<Longrightarrow> prod f A \<in> \<complex>
 2. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<complex>) \<Longrightarrow> prod f {} \<in> \<complex>
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<complex>) \<Longrightarrow> prod f F \<in> \<complex>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<complex>\<rbrakk> \<Longrightarrow> prod f (insert x F) \<in> \<complex>
[PROOF STEP]
case infinite
[PROOF STATE]
proof (state)
this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<complex>

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; \<And>i. i \<in> A \<Longrightarrow> f i \<in> \<complex>\<rbrakk> \<Longrightarrow> prod f A \<in> \<complex>
 2. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<complex>) \<Longrightarrow> prod f {} \<in> \<complex>
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<complex>) \<Longrightarrow> prod f F \<in> \<complex>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<complex>\<rbrakk> \<Longrightarrow> prod f (insert x F) \<in> \<complex>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<complex>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
infinite A_
?i \<in> A_ \<Longrightarrow> f ?i \<in> \<complex>

goal (1 subgoal):
 1. prod f A_ \<in> \<complex>
[PROOF STEP]
by (metis Complexs_1 prod.infinite)
[PROOF STATE]
proof (state)
this:
prod f A_ \<in> \<complex>

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> \<complex>) \<Longrightarrow> prod f {} \<in> \<complex>
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> \<complex>) \<Longrightarrow> prod f F \<in> \<complex>; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> \<complex>\<rbrakk> \<Longrightarrow> prod f (insert x F) \<in> \<complex>
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma nrec_admissible: "nrec.admissible (\<lambda>(f::'a \<Rightarrow> 'b nres).
  (\<forall>x0. f x0 \<le> SPEC (P x0)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrec.admissible (\<lambda>f. \<forall>x0. f x0 \<le> SPEC (P x0))
[PROOF STEP]
apply (rule ccpo.admissibleI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>Complete_Partial_Order.chain nrec.le_fun A; A \<noteq> {}; \<forall>x\<in>A. \<forall>x0. x x0 \<le> SPEC (P x0)\<rbrakk> \<Longrightarrow> \<forall>x0. nrec.lub_fun A x0 \<le> SPEC (P x0)
[PROOF STEP]
apply (unfold fun_lub_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>Complete_Partial_Order.chain nrec.le_fun A; A \<noteq> {}; \<forall>x\<in>A. \<forall>x0. x x0 \<le> SPEC (P x0)\<rbrakk> \<Longrightarrow> \<forall>x0. Sup {y. \<exists>f\<in>A. y = f x0} \<le> SPEC (P x0)
[PROOF STEP]
apply (intro allI impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A x0. \<lbrakk>Complete_Partial_Order.chain nrec.le_fun A; A \<noteq> {}; \<forall>x\<in>A. \<forall>x0. x x0 \<le> SPEC (P x0)\<rbrakk> \<Longrightarrow> Sup {y. \<exists>f\<in>A. y = f x0} \<le> SPEC (P x0)
[PROOF STEP]
apply (rule Sup_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A x0 x. \<lbrakk>Complete_Partial_Order.chain nrec.le_fun A; A \<noteq> {}; \<forall>x\<in>A. \<forall>x0. x x0 \<le> SPEC (P x0); x \<in> {y. \<exists>f\<in>A. y = f x0}\<rbrakk> \<Longrightarrow> x \<le> SPEC (P x0)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma permute_profile_o:
  assumes "bij f" "bij g"
  shows   "permute_profile f (permute_profile g R) = permute_profile (f \<circ> g) R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_profile f (permute_profile g R) = permute_profile (f \<circ> g) R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij f
bij g

goal (1 subgoal):
 1. permute_profile f (permute_profile g R) = permute_profile (f \<circ> g) R
[PROOF STEP]
by (simp add: permute_profile_def o_inv_distrib)


[STATEMENT]
lemma DJ:
  assumes fdj: "\<forall>p q. Ifm bs (f (Or p q)) = Ifm bs (Or (f p) (f q))"
    and fF: "f F = F"
  shows "Ifm bs (DJ f p) = Ifm bs (f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
have "Ifm bs (DJ f p) = (\<exists>q \<in> set (disjuncts p). Ifm bs (f q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ifm bs (DJ f p) = (\<exists>q\<in>set (disjuncts p). Ifm bs (f q))
[PROOF STEP]
by (simp add: DJ_def evaldjf_ex)
[PROOF STATE]
proof (state)
this:
Ifm bs (DJ f p) = (\<exists>q\<in>set (disjuncts p). Ifm bs (f q))

goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Ifm bs (DJ f p) = (\<exists>q\<in>set (disjuncts p). Ifm bs (f q))

goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
have "\<dots> = Ifm bs (f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>q\<in>set (disjuncts p). Ifm bs (f q)) = Ifm bs (f p)
[PROOF STEP]
using fdj fF
[PROOF STATE]
proof (prove)
using this:
\<forall>p q. Ifm bs (f (Or p q)) = Ifm bs (Or (f p) (f q))
f F = F

goal (1 subgoal):
 1. (\<exists>q\<in>set (disjuncts p). Ifm bs (f q)) = Ifm bs (f p)
[PROOF STEP]
by (induct p rule: disjuncts.induct) auto
[PROOF STATE]
proof (state)
this:
(\<exists>q\<in>set (disjuncts p). Ifm bs (f q)) = Ifm bs (f p)

goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Ifm bs (DJ f p) = Ifm bs (f p)

goal (1 subgoal):
 1. Ifm bs (DJ f p) = Ifm bs (f p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Ifm bs (DJ f p) = Ifm bs (f p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sup_isotone:
  assumes "-p \<le> -q"
      and "-r \<le> -s"
    shows "-p \<squnion> -r \<le> -q \<squnion> -s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p \<squnion> - r \<le> - q \<squnion> - s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - p \<squnion> - r \<le> - q \<squnion> - s
[PROOF STEP]
have "\<And>x y. \<not> -x \<le> -y \<squnion> -r \<or> -x \<le> -y \<squnion> -s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<not> - x \<le> - y \<squnion> - r \<or> - x \<le> - y \<squnion> - s
[PROOF STEP]
by (metis (full_types) assms(2) sub_sup_closed sub_sup_right_isotone transitive)
[PROOF STATE]
proof (state)
this:
\<not> - ?x \<le> - ?y \<squnion> - r \<or> - ?x \<le> - ?y \<squnion> - s

goal (1 subgoal):
 1. - p \<squnion> - r \<le> - q \<squnion> - s
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> - ?x \<le> - ?y \<squnion> - r \<or> - ?x \<le> - ?y \<squnion> - s

goal (1 subgoal):
 1. - p \<squnion> - r \<le> - q \<squnion> - s
[PROOF STEP]
by (metis (no_types) assms(1) sub_sup_closed sub_sup_left_isotone)
[PROOF STATE]
proof (state)
this:
- p \<squnion> - r \<le> - q \<squnion> - s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cosh_real_eq_iff [simp]: "cosh x = cosh y \<longleftrightarrow> abs x = abs (y :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cosh x = cosh y) = (\<bar>x\<bar> = \<bar>y\<bar>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (cosh x = cosh y) = (\<bar>x\<bar> = \<bar>y\<bar>)
[PROOF STEP]
have "cosh x = cosh y \<longleftrightarrow> x = y" if "x \<ge> 0" "y \<ge> 0" for x y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cosh x = cosh y) = (x = y)
[PROOF STEP]
using cosh_real_strict_mono[of x y] cosh_real_strict_mono[of y x] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> x; x < y\<rbrakk> \<Longrightarrow> cosh x < cosh y
\<lbrakk>0 \<le> y; y < x\<rbrakk> \<Longrightarrow> cosh y < cosh x
0 \<le> x
0 \<le> y

goal (1 subgoal):
 1. (cosh x = cosh y) = (x = y)
[PROOF STEP]
by (cases x y rule: linorder_cases) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?x; 0 \<le> ?y\<rbrakk> \<Longrightarrow> (cosh ?x = cosh ?y) = (?x = ?y)

goal (1 subgoal):
 1. (cosh x = cosh y) = (\<bar>x\<bar> = \<bar>y\<bar>)
[PROOF STEP]
from this[of "abs x" "abs y"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> \<bar>x\<bar>; 0 \<le> \<bar>y\<bar>\<rbrakk> \<Longrightarrow> (cosh \<bar>x\<bar> = cosh \<bar>y\<bar>) = (\<bar>x\<bar> = \<bar>y\<bar>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> \<bar>x\<bar>; 0 \<le> \<bar>y\<bar>\<rbrakk> \<Longrightarrow> (cosh \<bar>x\<bar> = cosh \<bar>y\<bar>) = (\<bar>x\<bar> = \<bar>y\<bar>)

goal (1 subgoal):
 1. (cosh x = cosh y) = (\<bar>x\<bar> = \<bar>y\<bar>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(cosh x = cosh y) = (\<bar>x\<bar> = \<bar>y\<bar>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma new_leaf_out_0:
  assumes "G = \<lparr>verts = V \<union> {v}, arcs = A \<union> {a}, tail = t(a := u), head = h(a := v)\<rparr>"
      and "G' = \<lparr>verts = V, arcs = A, tail = t, head = h\<rparr>"
      and "wf_digraph G'"
      and "u \<in> V"
      and "v \<notin> V"
      and "a \<notin> A"
    shows "out_degree G v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out_degree G v = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. out_degree G v = 0
[PROOF STEP]
have "tail G a = u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tail G a = u
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
G = \<lparr>verts = V \<union> {v}, arcs = A \<union> {a}, tail = t(a := u), head = h(a := v)\<rparr>

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

goal (1 subgoal):
 1. out_degree G v = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tail G a = u
[PROOF STEP]
have 0: "{e \<in> arcs G. tail G e = v} = {e \<in> arcs G'. tail G' e = v}"
[PROOF STATE]
proof (prove)
using this:
tail G a = u

goal (1 subgoal):
 1. {e \<in> arcs G. tail G e = v} = {e \<in> arcs G'. tail G' e = v}
[PROOF STEP]
using new_leaf_out_sets_eq assms(1,2,4-6)
[PROOF STATE]
proof (prove)
using this:
tail G a = u
\<lbrakk>G = \<lparr>verts = ?V \<union> {?v}, arcs = ?A \<union> {?a}, tail = ?t(?a := ?u), head = ?h(?a := ?v)\<rparr>; ?G' = \<lparr>verts = ?V, arcs = ?A, tail = ?t, head = ?h\<rparr>; ?u \<in> ?V; ?v \<notin> ?V; ?a \<notin> ?A\<rbrakk> \<Longrightarrow> {e \<in> arcs G. tail G e = ?v} = {e \<in> arcs ?G'. tail ?G' e = ?v}
G = \<lparr>verts = V \<union> {v}, arcs = A \<union> {a}, tail = t(a := u), head = h(a := v)\<rparr>
G' = \<lparr>verts = V, arcs = A, tail = t, head = h\<rparr>
u \<in> V
v \<notin> V
a \<notin> A

goal (1 subgoal):
 1. {e \<in> arcs G. tail G e = v} = {e \<in> arcs G'. tail G' e = v}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{e \<in> arcs G. tail G e = v} = {e \<in> arcs G'. tail G' e = v}

goal (1 subgoal):
 1. out_degree G v = 0
[PROOF STEP]
have "out_degree G' v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out_degree G' v = 0
[PROOF STEP]
using assms(2,3,5) wf_digraph.not_elem_out_0
[PROOF STATE]
proof (prove)
using this:
G' = \<lparr>verts = V, arcs = A, tail = t, head = h\<rparr>
wf_digraph G'
v \<notin> V
\<lbrakk>wf_digraph ?G; ?v \<notin> verts ?G\<rbrakk> \<Longrightarrow> out_degree ?G ?v = 0

goal (1 subgoal):
 1. out_degree G' v = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
out_degree G' v = 0

goal (1 subgoal):
 1. out_degree G v = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
out_degree G' v = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
out_degree G' v = 0

goal (1 subgoal):
 1. out_degree G v = 0
[PROOF STEP]
unfolding out_degree_def out_arcs_def
[PROOF STATE]
proof (prove)
using this:
card {e \<in> arcs G'. tail G' e = v} = 0

goal (1 subgoal):
 1. card {e \<in> arcs G. tail G e = v} = 0
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
card {e \<in> arcs G'. tail G' e = v} = 0
{e \<in> arcs G. tail G e = v} = {e \<in> arcs G'. tail G' e = v}

goal (1 subgoal):
 1. card {e \<in> arcs G. tail G e = v} = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
out_degree G v = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cf_maps_subset_Vset:
  assumes "\<Z> \<beta>" and "\<alpha> \<in>\<^sub>\<circ> \<beta>"
  shows "{cf_map \<FF> | \<FF>. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>} \<subseteq> elts (Vset \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {cf_map \<FF> |\<FF>. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>} \<subseteq> elts (Vset \<beta>)
[PROOF STEP]
proof(intro subsetI, unfold mem_Collect_eq, elim exE conjE)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x \<FF>. \<lbrakk>x = cf_map \<FF>; \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>\<rbrakk> \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<beta>
[PROOF STEP]
fix x \<FF>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x \<FF>. \<lbrakk>x = cf_map \<FF>; \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>\<rbrakk> \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<beta>
[PROOF STEP]
assume x_def: "x = cf_map \<FF>" and \<FF>: "\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>"
[PROOF STATE]
proof (state)
this:
x = cf_map \<FF>
\<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>

goal (1 subgoal):
 1. \<And>x \<FF>. \<lbrakk>x = cf_map \<FF>; \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>\<rbrakk> \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<beta>
[PROOF STEP]
interpret is_functor \<alpha> \<AA> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule \<FF>)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x \<FF>. \<lbrakk>x = cf_map \<FF>; \<FF> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>\<rbrakk> \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<beta>
[PROOF STEP]
show "x \<in>\<^sub>\<circ> Vset \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in>\<^sub>\<circ> Vset \<beta>
[PROOF STEP]
unfolding x_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cf_map \<FF> \<in>\<^sub>\<circ> Vset \<beta>
[PROOF STEP]
by (rule cf_map_in_Vset[OF assms])
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> Vset \<beta>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Keys_minus_zero: "Keys (A - {0}) = Keys A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Keys (A - {0}) = Keys A
[PROOF STEP]
proof (cases "0 \<in> A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<in> A \<Longrightarrow> Keys (A - {0}) = Keys A
 2. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<in> A

goal (2 subgoals):
 1. 0 \<in> A \<Longrightarrow> Keys (A - {0}) = Keys A
 2. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
hence "(A - {0}) \<union> {0} = A"
[PROOF STATE]
proof (prove)
using this:
0 \<in> A

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

goal (2 subgoals):
 1. 0 \<in> A \<Longrightarrow> Keys (A - {0}) = Keys A
 2. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
hence "Keys A = Keys ((A - {0}) \<union> {0})"
[PROOF STATE]
proof (prove)
using this:
A - {0} \<union> {0} = A

goal (1 subgoal):
 1. Keys A = Keys (A - {0} \<union> {0})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Keys A = Keys (A - {0} \<union> {0})

goal (2 subgoals):
 1. 0 \<in> A \<Longrightarrow> Keys (A - {0}) = Keys A
 2. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Keys A = Keys (A - {0} \<union> {0})

goal (2 subgoals):
 1. 0 \<in> A \<Longrightarrow> Keys (A - {0}) = Keys A
 2. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
have "... = Keys (A - {0}) \<union> Keys {0::('a \<Rightarrow>\<^sub>0 'b)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Keys (A - {0} \<union> {0}) = Keys (A - {0}) \<union> Keys {0}
[PROOF STEP]
by (fact Keys_Un)
[PROOF STATE]
proof (state)
this:
Keys (A - {0} \<union> {0}) = Keys (A - {0}) \<union> Keys {0}

goal (2 subgoals):
 1. 0 \<in> A \<Longrightarrow> Keys (A - {0}) = Keys A
 2. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Keys (A - {0} \<union> {0}) = Keys (A - {0}) \<union> Keys {0}

goal (2 subgoals):
 1. 0 \<in> A \<Longrightarrow> Keys (A - {0}) = Keys A
 2. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
have "... = Keys (A - {0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Keys (A - {0}) \<union> Keys {0} = Keys (A - {0})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Keys (A - {0}) \<union> Keys {0} = Keys (A - {0})

goal (2 subgoals):
 1. 0 \<in> A \<Longrightarrow> Keys (A - {0}) = Keys A
 2. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Keys A = Keys (A - {0})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Keys A = Keys (A - {0})

goal (1 subgoal):
 1. Keys (A - {0}) = Keys A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Keys (A - {0}) = Keys A

goal (1 subgoal):
 1. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
0 \<notin> A

goal (1 subgoal):
 1. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
hence "A - {0} = A"
[PROOF STATE]
proof (prove)
using this:
0 \<notin> A

goal (1 subgoal):
 1. A - {0} = A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A - {0} = A

goal (1 subgoal):
 1. 0 \<notin> A \<Longrightarrow> Keys (A - {0}) = Keys A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A - {0} = A

goal (1 subgoal):
 1. Keys (A - {0}) = Keys A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Keys (A - {0}) = Keys A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma treap_of_set_tree_unique:
  "\<lbrakk> finite A; inj_on fst A; inj_on snd A \<rbrakk>
  \<Longrightarrow> set_tree (treap_of A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; inj_on fst A; inj_on snd A\<rbrakk> \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
proof(induction "A" rule: treap_of.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>KP. \<lbrakk>\<And>x xa xb. \<lbrakk>\<not> (infinite KP \<or> KP = {}); x = arg_min_on snd KP; xa = {p \<in> KP. fst p < fst x}; xb = {p \<in> KP. fst x < fst p}; finite xa; inj_on fst xa; inj_on snd xa\<rbrakk> \<Longrightarrow> set_tree (treap_of xa) = xa; \<And>x xa xb. \<lbrakk>\<not> (infinite KP \<or> KP = {}); x = arg_min_on snd KP; xa = {p \<in> KP. fst p < fst x}; xb = {p \<in> KP. fst x < fst p}; finite xb; inj_on fst xb; inj_on snd xb\<rbrakk> \<Longrightarrow> set_tree (treap_of xb) = xb; finite KP; inj_on fst KP; inj_on snd KP\<rbrakk> \<Longrightarrow> set_tree (treap_of KP) = KP
[PROOF STEP]
case (1 A)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xa; inj_on fst ?xa; inj_on snd ?xa\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xa) = ?xa
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xb; inj_on fst ?xb; inj_on snd ?xb\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xb) = ?xb
finite A
inj_on fst A
inj_on snd A

goal (1 subgoal):
 1. \<And>KP. \<lbrakk>\<And>x xa xb. \<lbrakk>\<not> (infinite KP \<or> KP = {}); x = arg_min_on snd KP; xa = {p \<in> KP. fst p < fst x}; xb = {p \<in> KP. fst x < fst p}; finite xa; inj_on fst xa; inj_on snd xa\<rbrakk> \<Longrightarrow> set_tree (treap_of xa) = xa; \<And>x xa xb. \<lbrakk>\<not> (infinite KP \<or> KP = {}); x = arg_min_on snd KP; xa = {p \<in> KP. fst p < fst x}; xb = {p \<in> KP. fst x < fst p}; finite xb; inj_on fst xb; inj_on snd xb\<rbrakk> \<Longrightarrow> set_tree (treap_of xb) = xb; finite KP; inj_on fst KP; inj_on snd KP\<rbrakk> \<Longrightarrow> set_tree (treap_of KP) = KP
[PROOF STEP]
note IH = 1
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xa; inj_on fst ?xa; inj_on snd ?xa\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xa) = ?xa
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xb; inj_on fst ?xb; inj_on snd ?xb\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xb) = ?xb
finite A
inj_on fst A
inj_on snd A

goal (1 subgoal):
 1. \<And>KP. \<lbrakk>\<And>x xa xb. \<lbrakk>\<not> (infinite KP \<or> KP = {}); x = arg_min_on snd KP; xa = {p \<in> KP. fst p < fst x}; xb = {p \<in> KP. fst x < fst p}; finite xa; inj_on fst xa; inj_on snd xa\<rbrakk> \<Longrightarrow> set_tree (treap_of xa) = xa; \<And>x xa xb. \<lbrakk>\<not> (infinite KP \<or> KP = {}); x = arg_min_on snd KP; xa = {p \<in> KP. fst p < fst x}; xb = {p \<in> KP. fst x < fst p}; finite xb; inj_on fst xb; inj_on snd xb\<rbrakk> \<Longrightarrow> set_tree (treap_of xb) = xb; finite KP; inj_on fst KP; inj_on snd KP\<rbrakk> \<Longrightarrow> set_tree (treap_of KP) = KP
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_tree (treap_of A) = A
[PROOF STEP]
proof (cases "infinite A \<or> A = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. infinite A \<or> A = {} \<Longrightarrow> set_tree (treap_of A) = A
 2. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
assume "infinite A \<or> A = {}"
[PROOF STATE]
proof (state)
this:
infinite A \<or> A = {}

goal (2 subgoals):
 1. infinite A \<or> A = {} \<Longrightarrow> set_tree (treap_of A) = A
 2. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
with IH
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xa; inj_on fst ?xa; inj_on snd ?xa\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xa) = ?xa
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xb; inj_on fst ?xb; inj_on snd ?xb\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xb) = ?xb
finite A
inj_on fst A
inj_on snd A
infinite A \<or> A = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xa; inj_on fst ?xa; inj_on snd ?xa\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xa) = ?xa
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xb; inj_on fst ?xb; inj_on snd ?xb\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xb) = ?xb
finite A
inj_on fst A
inj_on snd A
infinite A \<or> A = {}

goal (1 subgoal):
 1. set_tree (treap_of A) = A
[PROOF STEP]
by (simp add: treap_of.simps)
[PROOF STATE]
proof (state)
this:
set_tree (treap_of A) = A

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
assume not_inf_or_empty: "\<not> (infinite A \<or> A = {})"
[PROOF STATE]
proof (state)
this:
\<not> (infinite A \<or> A = {})

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
let ?m = "arg_min_on snd A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
let ?L = "{p \<in> A. fst p < fst ?m}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
let ?R = "{p \<in> A. fst p > fst ?m}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
obtain l a r where t: "treap_of A = Node l a r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l a r. treap_of A = \<langle>l, a, r\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using not_inf_or_empty
[PROOF STATE]
proof (prove)
using this:
\<not> (infinite A \<or> A = {})

goal (1 subgoal):
 1. (\<And>l a r. treap_of A = \<langle>l, a, r\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases "treap_of A") (auto simp: Let_def elim!: treap_of.elims split: if_splits)
[PROOF STATE]
proof (state)
this:
treap_of A = \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
have [simp]: "inj_on fst {p \<in> A. fst p < fst (arg_min_on snd A)}"
                 "inj_on snd {p \<in> A. fst p < fst (arg_min_on snd A)}"
                 "inj_on fst {p \<in> A. fst (arg_min_on snd A) < fst p}"
                 "inj_on snd {p \<in> A. fst (arg_min_on snd A) < fst p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inj_on fst {p \<in> A. fst p < fst (arg_min_on snd A)} &&& inj_on snd {p \<in> A. fst p < fst (arg_min_on snd A)}) &&& inj_on fst {p \<in> A. fst (arg_min_on snd A) < fst p} &&& inj_on snd {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
using IH
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xa; inj_on fst ?xa; inj_on snd ?xa\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xa) = ?xa
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xb; inj_on fst ?xb; inj_on snd ?xb\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xb) = ?xb
finite A
inj_on fst A
inj_on snd A

goal (1 subgoal):
 1. (inj_on fst {p \<in> A. fst p < fst (arg_min_on snd A)} &&& inj_on snd {p \<in> A. fst p < fst (arg_min_on snd A)}) &&& inj_on fst {p \<in> A. fst (arg_min_on snd A) < fst p} &&& inj_on snd {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
by (auto intro: inj_on_subset)
[PROOF STATE]
proof (state)
this:
inj_on fst {p \<in> A. fst p < fst (arg_min_on snd A)}
inj_on snd {p \<in> A. fst p < fst (arg_min_on snd A)}
inj_on fst {p \<in> A. fst (arg_min_on snd A) < fst p}
inj_on snd {p \<in> A. fst (arg_min_on snd A) < fst p}

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
have lr: "l = treap_of ?L" "r = treap_of ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = treap_of {p \<in> A. fst p < fst (arg_min_on snd A)} &&& r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
treap_of A = \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. l = treap_of {p \<in> A. fst p < fst (arg_min_on snd A)} &&& r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
by (auto simp: Let_def elim: treap_of.elims split: if_splits)
[PROOF STATE]
proof (state)
this:
l = treap_of {p \<in> A. fst p < fst (arg_min_on snd A)}
r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l = treap_of {p \<in> A. fst p < fst (arg_min_on snd A)}
r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
have l: "set_tree l = ?L"
[PROOF STATE]
proof (prove)
using this:
l = treap_of {p \<in> A. fst p < fst (arg_min_on snd A)}
r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}

goal (1 subgoal):
 1. set_tree l = {p \<in> A. fst p < fst (arg_min_on snd A)}
[PROOF STEP]
using not_inf_or_empty IH
[PROOF STATE]
proof (prove)
using this:
l = treap_of {p \<in> A. fst p < fst (arg_min_on snd A)}
r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}
\<not> (infinite A \<or> A = {})
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xa; inj_on fst ?xa; inj_on snd ?xa\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xa) = ?xa
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xb; inj_on fst ?xb; inj_on snd ?xb\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xb) = ?xb
finite A
inj_on fst A
inj_on snd A

goal (1 subgoal):
 1. set_tree l = {p \<in> A. fst p < fst (arg_min_on snd A)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_tree l = {p \<in> A. fst p < fst (arg_min_on snd A)}

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
have "r = treap_of ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
treap_of A = \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
by (auto simp: Let_def elim: treap_of.elims split: if_splits)
[PROOF STATE]
proof (state)
this:
r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
have r: "set_tree r = ?R"
[PROOF STATE]
proof (prove)
using this:
r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}

goal (1 subgoal):
 1. set_tree r = {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
using not_inf_or_empty IH(2)
[PROOF STATE]
proof (prove)
using this:
r = treap_of {p \<in> A. fst (arg_min_on snd A) < fst p}
\<not> (infinite A \<or> A = {})
\<lbrakk>\<not> (infinite A \<or> A = {}); ?x = arg_min_on snd A; ?xa = {p \<in> A. fst p < fst ?x}; ?xb = {p \<in> A. fst ?x < fst p}; finite ?xb; inj_on fst ?xb; inj_on snd ?xb\<rbrakk> \<Longrightarrow> set_tree (treap_of ?xb) = ?xb

goal (1 subgoal):
 1. set_tree r = {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
set_tree r = {p \<in> A. fst (arg_min_on snd A) < fst p}

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
have a: "a = ?m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = arg_min_on snd A
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
treap_of A = \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. a = arg_min_on snd A
[PROOF STEP]
by (elim treap_of.elims) (simp add: Let_def split: if_splits)
[PROOF STATE]
proof (state)
this:
a = arg_min_on snd A

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
have "a \<noteq> fst (arg_min_on snd A)" if "(a,b) \<in> A" "(a, b) \<noteq> arg_min_on snd A" for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> fst (arg_min_on snd A)
[PROOF STEP]
using IH(4,5) that not_inf_or_empty arg_min_if_finite(1) inj_on_eq_iff
[PROOF STATE]
proof (prove)
using this:
inj_on fst A
inj_on snd A
(a, b) \<in> A
(a, b) \<noteq> arg_min_on snd A
\<not> (infinite A \<or> A = {})
\<lbrakk>finite ?S; ?S \<noteq> {}\<rbrakk> \<Longrightarrow> arg_min_on ?f ?S \<in> ?S
\<lbrakk>inj_on ?f ?A; ?x \<in> ?A; ?y \<in> ?A\<rbrakk> \<Longrightarrow> (?f ?x = ?f ?y) = (?x = ?y)

goal (1 subgoal):
 1. a \<noteq> fst (arg_min_on snd A)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>(?a, ?b) \<in> A; (?a, ?b) \<noteq> arg_min_on snd A\<rbrakk> \<Longrightarrow> ?a \<noteq> fst (arg_min_on snd A)

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(?a, ?b) \<in> A; (?a, ?b) \<noteq> arg_min_on snd A\<rbrakk> \<Longrightarrow> ?a \<noteq> fst (arg_min_on snd A)
[PROOF STEP]
have "a < fst (arg_min_on snd A)"
       if "(a,b) \<in> A" "(a, b) \<noteq> arg_min_on snd A" "fst (arg_min_on snd A) \<ge> a" for a b
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?a, ?b) \<in> A; (?a, ?b) \<noteq> arg_min_on snd A\<rbrakk> \<Longrightarrow> ?a \<noteq> fst (arg_min_on snd A)

goal (1 subgoal):
 1. a < fst (arg_min_on snd A)
[PROOF STEP]
using le_neq_trans that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?a, ?b) \<in> A; (?a, ?b) \<noteq> arg_min_on snd A\<rbrakk> \<Longrightarrow> ?a \<noteq> fst (arg_min_on snd A)
\<lbrakk>?a \<le> ?b; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> ?a < ?b
(a, b) \<in> A
(a, b) \<noteq> arg_min_on snd A
a \<le> fst (arg_min_on snd A)

goal (1 subgoal):
 1. a < fst (arg_min_on snd A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>(?a, ?b) \<in> A; (?a, ?b) \<noteq> arg_min_on snd A; ?a \<le> fst (arg_min_on snd A)\<rbrakk> \<Longrightarrow> ?a < fst (arg_min_on snd A)

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>(?a, ?b) \<in> A; (?a, ?b) \<noteq> arg_min_on snd A; ?a \<le> fst (arg_min_on snd A)\<rbrakk> \<Longrightarrow> ?a < fst (arg_min_on snd A)

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
have "arg_min_on snd A \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arg_min_on snd A \<in> A
[PROOF STEP]
using not_inf_or_empty arg_min_if_finite
[PROOF STATE]
proof (prove)
using this:
\<not> (infinite A \<or> A = {})
\<lbrakk>finite ?S; ?S \<noteq> {}\<rbrakk> \<Longrightarrow> arg_min_on ?f ?S \<in> ?S
\<lbrakk>finite ?S; ?S \<noteq> {}\<rbrakk> \<Longrightarrow> \<not> (\<exists>x\<in>?S. ?f x < ?f (arg_min_on ?f ?S))

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

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(?a, ?b) \<in> A; (?a, ?b) \<noteq> arg_min_on snd A; ?a \<le> fst (arg_min_on snd A)\<rbrakk> \<Longrightarrow> ?a < fst (arg_min_on snd A)
arg_min_on snd A \<in> A
[PROOF STEP]
have A: "A = {?m} \<union> ?L \<union> ?R"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?a, ?b) \<in> A; (?a, ?b) \<noteq> arg_min_on snd A; ?a \<le> fst (arg_min_on snd A)\<rbrakk> \<Longrightarrow> ?a < fst (arg_min_on snd A)
arg_min_on snd A \<in> A

goal (1 subgoal):
 1. A = {arg_min_on snd A} \<union> {p \<in> A. fst p < fst (arg_min_on snd A)} \<union> {p \<in> A. fst (arg_min_on snd A) < fst p}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = {arg_min_on snd A} \<union> {p \<in> A. fst p < fst (arg_min_on snd A)} \<union> {p \<in> A. fst (arg_min_on snd A) < fst p}

goal (1 subgoal):
 1. \<not> (infinite A \<or> A = {}) \<Longrightarrow> set_tree (treap_of A) = A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_tree (treap_of A) = A
[PROOF STEP]
using l r a A t
[PROOF STATE]
proof (prove)
using this:
set_tree l = {p \<in> A. fst p < fst (arg_min_on snd A)}
set_tree r = {p \<in> A. fst (arg_min_on snd A) < fst p}
a = arg_min_on snd A
A = {arg_min_on snd A} \<union> {p \<in> A. fst p < fst (arg_min_on snd A)} \<union> {p \<in> A. fst (arg_min_on snd A) < fst p}
treap_of A = \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. set_tree (treap_of A) = A
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
set_tree (treap_of A) = A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_tree (treap_of A) = A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polytope_facet_exists:
  fixes p :: "'a :: euclidean_space set"
  assumes "polytope p" "0 < aff_dim p"
  obtains F where "F facet_of p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>F. F facet_of p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "p = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>F. F facet_of p \<Longrightarrow> thesis; p = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>F. F facet_of p \<Longrightarrow> thesis; p \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = {}

goal (2 subgoals):
 1. \<lbrakk>\<And>F. F facet_of p \<Longrightarrow> thesis; p = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>F. F facet_of p \<Longrightarrow> thesis; p \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
polytope p
0 < aff_dim p
p = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
polytope p
0 < aff_dim p
p = {}

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

goal (1 subgoal):
 1. \<lbrakk>\<And>F. F facet_of p \<Longrightarrow> thesis; p \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>F. F facet_of p \<Longrightarrow> thesis; p \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>\<And>F. F facet_of p \<Longrightarrow> thesis; p \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> {}
[PROOF STEP]
obtain v where "v extreme_point_of p"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> {}

goal (1 subgoal):
 1. (\<And>v. v extreme_point_of p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using extreme_point_exists_convex
[PROOF STATE]
proof (prove)
using this:
p \<noteq> {}
\<lbrakk>compact ?S; convex ?S; ?S \<noteq> {}; \<And>x. x extreme_point_of ?S \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>v. v extreme_point_of p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: \<open>polytope p\<close> polytope_imp_compact polytope_imp_convex)
[PROOF STATE]
proof (state)
this:
v extreme_point_of p

goal (1 subgoal):
 1. \<lbrakk>\<And>F. F facet_of p \<Longrightarrow> thesis; p \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v extreme_point_of p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v extreme_point_of p

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (metis face_of_polyhedron_subset_facet polytope_imp_polyhedron aff_dim_sing
       all_not_in_conv assms face_of_singleton less_irrefl singletonI that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integration_by_parts:
  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  assumes "bounded_bilinear (prod)" "a \<le> b"
          "continuous_on {a..b} f" "continuous_on {a..b} g"
  assumes "\<And>x. x\<in>{a..b} \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
          "\<And>x. x\<in>{a..b} \<Longrightarrow> (g has_vector_derivative g' x) (at x)"
  assumes "((\<lambda>x. prod (f x) (g' x)) has_integral (prod (f b) (g b) - prod (f a) (g a) - y)) {a..b}"
  shows   "((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. prod (f' x) (g x)) has_integral y) {a..b}
[PROOF STEP]
by (rule integration_by_parts_interior[of _ _ _ f g f' g']) (insert assms, simp_all)


[STATEMENT]
lemma ANR_imp_neighbourhood_retract:
  fixes S :: "'a::euclidean_space set"
  assumes "ANR S" "closedin (top_of_set U) S"
  obtains V where "openin (top_of_set U) V" "S retract_of V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ANR_imp_absolute_neighbourhood_retract assms homeomorphic_refl
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ANR ?S; ?S homeomorphic ?S'; closedin (top_of_set ?U) ?S'; \<And>V. \<lbrakk>openin (top_of_set ?U) V; ?S' retract_of V\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
ANR S
closedin (top_of_set U) S
?s homeomorphic ?s

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>openin (top_of_set U) V; S retract_of V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma det_0[simp]: "det 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det 0 = (0::'a)
[PROOF STEP]
by transfer (simp add: zero_power)


[STATEMENT]
lemma less_add_1_iff_le_hmset: "m < n + 1 \<longleftrightarrow> m \<le> n" for m n :: zhmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m < n + 1) = (m \<le> n)
[PROOF STEP]
by (rule less_iff_add1_le_zhmset[of m "n + 1", simplified])


[STATEMENT]
lemma accepts_atom: "accepts (atom a) w = (w = [a])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NAe.accepts (atom a) w = (w = [a])
[PROOF STEP]
by (simp add: accepts_def start_fin_in_steps_atom fin_atom)


[STATEMENT]
lemma less_sqrt_iff: "y \<ge> 0 \<Longrightarrow> x < sqrt y \<longleftrightarrow> (x \<ge> 0 \<longrightarrow> x\<^sup>2 < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> y \<Longrightarrow> (x < sqrt y) = (0 \<le> x \<longrightarrow> x\<^sup>2 < y)
[PROOF STEP]
by (smt real_le_lsqrt real_less_rsqrt real_sqrt_ge_zero)


[STATEMENT]
lemma of_int_mod_integer: "(of_int (x mod y) :: integer) = (of_int x :: integer) mod (of_int y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (x mod y) = of_int x mod of_int y
[PROOF STEP]
using integer_of_int_eq_of_int modulo_integer.abs_eq
[PROOF STATE]
proof (prove)
using this:
integer_of_int = of_int
integer_of_int ?xa mod integer_of_int ?x = integer_of_int (?xa mod ?x)

goal (1 subgoal):
 1. of_int (x mod y) = of_int x mod of_int y
[PROOF STEP]
by presburger


[STATEMENT]
lemma emeasure_density:
  assumes f[measurable]: "f \<in> borel_measurable M" and A[measurable]: "A \<in> sets M"
  shows "emeasure (density M f) A = (\<integral>\<^sup>+ x. f x * indicator A x \<partial>M)"
    (is "_ = ?\<mu> A")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (density M f) A = \<integral>\<^sup>+ x. f x * indicator A x \<partial>M
[PROOF STEP]
unfolding density_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (measure_of (space M) (sets M) (\<lambda>A. \<integral>\<^sup>+ x. f x * indicator A x \<partial>M)) A = \<integral>\<^sup>+ x. f x * indicator A x \<partial>M
[PROOF STEP]
proof (rule emeasure_measure_of_sigma)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. sigma_algebra (space M) (sets M)
 2. positive (sets M) (\<lambda>A. \<integral>\<^sup>+ x. f x * indicator A x \<partial>M)
 3. countably_additive (sets M) (\<lambda>A. \<integral>\<^sup>+ x. f x * indicator A x \<partial>M)
 4. A \<in> sets M
[PROOF STEP]
show "sigma_algebra (space M) (sets M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra (space M) (sets M)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
sigma_algebra (space M) (sets M)

goal (3 subgoals):
 1. positive (sets M) (\<lambda>A. \<integral>\<^sup>+ x. f x * indicator A x \<partial>M)
 2. countably_additive (sets M) (\<lambda>A. \<integral>\<^sup>+ x. f x * indicator A x \<partial>M)
 3. A \<in> sets M
[PROOF STEP]
show "positive (sets M) ?\<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positive (sets M) (\<lambda>a. \<integral>\<^sup>+ x. f x * indicator a x \<partial>M)
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M

goal (1 subgoal):
 1. positive (sets M) (\<lambda>a. \<integral>\<^sup>+ x. f x * indicator a x \<partial>M)
[PROOF STEP]
by (auto simp: positive_def)
[PROOF STATE]
proof (state)
this:
positive (sets M) (\<lambda>a. \<integral>\<^sup>+ x. f x * indicator a x \<partial>M)

goal (2 subgoals):
 1. countably_additive (sets M) (\<lambda>A. \<integral>\<^sup>+ x. f x * indicator A x \<partial>M)
 2. A \<in> sets M
[PROOF STEP]
show "countably_additive (sets M) ?\<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countably_additive (sets M) (\<lambda>a. \<integral>\<^sup>+ x. f x * indicator a x \<partial>M)
[PROOF STEP]
proof (intro countably_additiveI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
fix A :: "nat \<Rightarrow> 'a set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
assume "range A \<subseteq> sets M"
[PROOF STATE]
proof (state)
this:
range A \<subseteq> sets M

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
range A \<subseteq> sets M
[PROOF STEP]
have "\<And>i. A i \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
range A \<subseteq> sets M

goal (1 subgoal):
 1. \<And>i. A i \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A ?i \<in> sets M

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A ?i \<in> sets M
[PROOF STEP]
have *: "\<And>i. (\<lambda>x. f x * indicator (A i) x) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
A ?i \<in> sets M

goal (1 subgoal):
 1. \<And>i. (\<lambda>x. f x * indicator (A i) x) \<in> borel_measurable M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x * indicator (A ?i) x) \<in> borel_measurable M

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
assume disj: "disjoint_family A"
[PROOF STATE]
proof (state)
this:
disjoint_family A

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
disjoint_family A
[PROOF STEP]
have "(\<Sum>n. ?\<mu> (A n)) = (\<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
disjoint_family A

goal (1 subgoal):
 1. (\<Sum>n. \<integral>\<^sup>+ x. f x * indicator (A n) x \<partial>M) = \<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M
[PROOF STEP]
using f *
[PROOF STATE]
proof (prove)
using this:
disjoint_family A
f \<in> borel_measurable M
(\<lambda>x. f x * indicator (A ?i) x) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<Sum>n. \<integral>\<^sup>+ x. f x * indicator (A n) x \<partial>M) = \<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M
[PROOF STEP]
by (subst nn_integral_suminf) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n. \<integral>\<^sup>+ x. f x * indicator (A n) x \<partial>M) = \<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. \<integral>\<^sup>+ x. f x * indicator (A n) x \<partial>M) = \<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
have "(\<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M) = (\<integral>\<^sup>+ x. f x * (\<Sum>n. indicator (A n) x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M = \<integral>\<^sup>+ x. f x * (\<Sum>n. indicator (A n) x) \<partial>M
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M = \<integral>\<^sup>+ x. f x * (\<Sum>n. indicator (A n) x) \<partial>M
[PROOF STEP]
by (auto intro!: ennreal_suminf_cmult nn_integral_cong_AE)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M = \<integral>\<^sup>+ x. f x * (\<Sum>n. indicator (A n) x) \<partial>M

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<Sum>n. f x * indicator (A n) x) \<partial>M = \<integral>\<^sup>+ x. f x * (\<Sum>n. indicator (A n) x) \<partial>M

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. f x * indicator (\<Union>n. A n) x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * (\<Sum>n. indicator (A n) x) \<partial>M = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
unfolding suminf_indicator[OF disj]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f x * (\<Sum>n. indicator (A n) x) \<partial>M = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M

goal (1 subgoal):
 1. \<And>A. \<lbrakk>range A \<subseteq> sets M; disjoint_family A; \<Union> (range A) \<in> sets M\<rbrakk> \<Longrightarrow> (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n. \<integral>\<^sup>+ x. f x * indicator (A n) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
show "(\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union>i. A i) x \<partial>M"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. \<integral>\<^sup>+ x. f x * indicator (A n) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M

goal (1 subgoal):
 1. (\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i. \<integral>\<^sup>+ x. f x * indicator (A i) x \<partial>M) = \<integral>\<^sup>+ x. f x * indicator (\<Union> (range A)) x \<partial>M

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
countably_additive (sets M) (\<lambda>a. \<integral>\<^sup>+ x. f x * indicator a x \<partial>M)

goal (1 subgoal):
 1. A \<in> sets M
[PROOF STEP]
qed fact


[STATEMENT]
lemma N_prime_elem_ge:
  assumes "prime_elem p"
  shows   "N p \<ge> 1 / (q\<^sup>2 * (q - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
proof (cases "p \<ge> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N p
 2. \<not> 0 \<le> p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> p

goal (2 subgoals):
 1. 0 \<le> p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N p
 2. \<not> 0 \<le> p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
with assms N_prime_ge
[PROOF STATE]
proof (chain)
picking this:
prime_elem p
prime ?p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N ?p
0 \<le> p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime_elem p
prime ?p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N ?p
0 \<le> p

goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / (q\<^sup>2 * (q - 1)) \<le> N p

goal (1 subgoal):
 1. \<not> 0 \<le> p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> p

goal (1 subgoal):
 1. \<not> 0 \<le> p \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
with assms N_prime_ge[of "-p"]
[PROOF STATE]
proof (chain)
picking this:
prime_elem p
prime (- p) \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N (- p)
\<not> 0 \<le> p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prime_elem p
prime (- p) \<Longrightarrow> 1 / (q\<^sup>2 * (q - 1)) \<le> N (- p)
\<not> 0 \<le> p

goal (1 subgoal):
 1. 1 / (q\<^sup>2 * (q - 1)) \<le> N p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / (q\<^sup>2 * (q - 1)) \<le> N p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_merge_adj:
  "\<lbrakk> even(length xss); \<forall>xs \<in> set xss. length xs = m \<rbrakk>
  \<Longrightarrow> \<forall>xs \<in> set (merge_adj xss). length xs = 2*m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>even (length xss); \<forall>xs\<in>set xss. length xs = m\<rbrakk> \<Longrightarrow> \<forall>xs\<in>set (merge_adj xss). length xs = 2 * m
[PROOF STEP]
by(induction xss rule: merge_adj.induct) (auto simp: length_merge)


[STATEMENT]
lemma viette2_monic:
  fixes b c \<xi>1 \<xi>2 :: real
  assumes "b\<^sup>2 - 4*c \<ge> 0" and "\<xi>1\<^sup>2 + b*\<xi>1 + c = 0" and "\<xi>2\<^sup>2 + b*\<xi>2 + c = 0" and "\<xi>1 \<noteq> \<xi>2"
  shows "\<xi>1*\<xi>2 = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<xi>1 * \<xi>2 = c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> b\<^sup>2 - 4 * c
\<xi>1\<^sup>2 + b * \<xi>1 + c = 0
\<xi>2\<^sup>2 + b * \<xi>2 + c = 0
\<xi>1 \<noteq> \<xi>2

goal (1 subgoal):
 1. \<xi>1 * \<xi>2 = c
[PROOF STEP]
by algebra


[STATEMENT]
lemma real_vector_eq_affinity: "m \<noteq> 0 \<Longrightarrow> y = m *\<^sub>R x + c \<longleftrightarrow> inverse m *\<^sub>R y - (inverse m *\<^sub>R c) = x"
  for x :: "'a::real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (y = m *\<^sub>R x + c) = (y /\<^sub>R m - c /\<^sub>R m = x)
[PROOF STEP]
using real_vector_affinity_eq[where m=m and x=x and y=y and c=c]
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0 \<Longrightarrow> (m *\<^sub>R x + c = y) = (x = y /\<^sub>R m - c /\<^sub>R m)

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (y = m *\<^sub>R x + c) = (y /\<^sub>R m - c /\<^sub>R m = x)
[PROOF STEP]
by metis


[STATEMENT]
theorem straighten_downtop_inv:"straighten_downtop w1 w2 \<Longrightarrow> (kauff_mat w1) = (kauff_mat w2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. straighten_downtop w1 w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
unfolding straighten_downtop_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w1 = basic [cup, vert] \<circ> basic [vert, cap] \<and> w2 = basic [vert] \<circ> basic [vert] \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
using striaghten_downtop_computation
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic [cup, vert] \<circ> basic [vert, cap]) = kauff_mat (basic [vert] \<circ> basic [vert])

goal (1 subgoal):
 1. w1 = basic [cup, vert] \<circ> basic [vert, cap] \<and> w2 = basic [vert] \<circ> basic [vert] \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
by auto


[STATEMENT]
lemma gauss_jordan_inverse_one_direction:
  assumes A: "A \<in> carrier_mat n n" and B: "B \<in> carrier_mat n nc"
  and res: "gauss_jordan A B = (1\<^sub>m n, B')"
  shows "A \<in> Units (ring_mat TYPE('a :: field) n b)"
  "B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> Units (ring_mat TYPE('a) n b) &&& (B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<in> Units (ring_mat TYPE('a) n b)
 2. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
let ?R = "ring_mat TYPE('a) n b"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<in> Units (ring_mat TYPE('a) n b)
 2. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
let ?U = "Units ?R"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<in> Units (ring_mat TYPE('a) n b)
 2. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
interpret m: ring ?R
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring (ring_mat TYPE('a) n b)
[PROOF STEP]
by (rule ring_mat)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<in> Units (ring_mat TYPE('a) n b)
 2. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
from gauss_jordan_transform[OF A B res, of b]
[PROOF STATE]
proof (chain)
picking this:
\<exists>P\<in>Units (ring_mat TYPE('a) n b). 1\<^sub>m n = P * A \<and> B' = P * B
[PROOF STEP]
obtain P where P: "P \<in> ?U" and id: "P * A = 1\<^sub>m n" and B': "B' = P * B"
[PROOF STATE]
proof (prove)
using this:
\<exists>P\<in>Units (ring_mat TYPE('a) n b). 1\<^sub>m n = P * A \<and> B' = P * B

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>P \<in> Units (ring_mat TYPE('a) n b); P * A = 1\<^sub>m n; B' = P * B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<in> Units (ring_mat TYPE('a) n b)
P * A = 1\<^sub>m n
B' = P * B

goal (2 subgoals):
 1. A \<in> Units (ring_mat TYPE('a) n b)
 2. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
P \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
have Pc: "P \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
P \<in> Units (ring_mat TYPE('a) n b)

goal (1 subgoal):
 1. P \<in> carrier_mat n n
[PROOF STEP]
unfolding Units_def ring_mat_def
[PROOF STATE]
proof (prove)
using this:
P \<in> {y \<in> carrier \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>. \<exists>x\<in>carrier \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>. x \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> y = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> \<and> y \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub>}

goal (1 subgoal):
 1. P \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<in> carrier_mat n n

goal (2 subgoals):
 1. A \<in> Units (ring_mat TYPE('a) n b)
 2. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
from m.Units_one_side_I(1)[of A P] A P id
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>A \<in> carrier (ring_mat TYPE('a) n b); P \<in> Units (ring_mat TYPE('a) n b); P \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>\<rbrakk> \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
A \<in> carrier_mat n n
P \<in> Units (ring_mat TYPE('a) n b)
P * A = 1\<^sub>m n
[PROOF STEP]
show Au: "A \<in> ?U"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> carrier (ring_mat TYPE('a) n b); P \<in> Units (ring_mat TYPE('a) n b); P \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>\<rbrakk> \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
A \<in> carrier_mat n n
P \<in> Units (ring_mat TYPE('a) n b)
P * A = 1\<^sub>m n

goal (1 subgoal):
 1. A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
unfolding ring_mat_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> carrier \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>; P \<in> Units \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>; P \<otimes>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub> A = \<one>\<^bsub>\<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>\<^esub>\<rbrakk> \<Longrightarrow> A \<in> Units \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>
A \<in> carrier_mat n n
P \<in> Units \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>
P * A = 1\<^sub>m n

goal (1 subgoal):
 1. A \<in> Units \<lparr>carrier = carrier_mat n n, monoid.mult = (*), one = 1\<^sub>m n, zero = 0\<^sub>m n n, add = (+), \<dots> = b\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> Units (ring_mat TYPE('a) n b)

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
assume B: "B = 1\<^sub>m n"
[PROOF STATE]
proof (state)
this:
B = 1\<^sub>m n

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
from B'[unfolded this] Pc
[PROOF STATE]
proof (chain)
picking this:
B' = P * 1\<^sub>m n
P \<in> carrier_mat n n
[PROOF STEP]
have B': "B' = P"
[PROOF STATE]
proof (prove)
using this:
B' = P * 1\<^sub>m n
P \<in> carrier_mat n n

goal (1 subgoal):
 1. B' = P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B' = P

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
show "A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n
[PROOF STEP]
unfolding B'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * P = 1\<^sub>m n \<and> P * A = 1\<^sub>m n
[PROOF STEP]
using m.Units_inv_comm[OF _ P Au] id
[PROOF STATE]
proof (prove)
using this:
P \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> A = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub> \<Longrightarrow> A \<otimes>\<^bsub>ring_mat TYPE('a) n b\<^esub> P = \<one>\<^bsub>ring_mat TYPE('a) n b\<^esub>
P * A = 1\<^sub>m n

goal (1 subgoal):
 1. A * P = 1\<^sub>m n \<and> P * A = 1\<^sub>m n
[PROOF STEP]
by (auto simp: ring_mat_def)
[PROOF STATE]
proof (state)
this:
A * B' = 1\<^sub>m n \<and> B' * A = 1\<^sub>m n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma same_price_in_argmax :
  assumes i_agt: "i \<in> agents"
  assumes lns : "local_nonsatiation consumption_set Pr[i]"
  assumes "x \<in> arg_max_set (U[i]) (budget_constraint (calculate_value P) consumption_set (poe_wealth P i Y))"
  assumes "y \<in> arg_max_set (U[i]) (budget_constraint (calculate_value P) consumption_set (poe_wealth P i Y))"
  shows "(P \<bullet> x) = (P \<bullet> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> x = P \<bullet> y
[PROOF STEP]
using am_utilises_entire_bgt assms lns
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> agents; local_nonsatiation consumption_set Pr[?i]; ?X \<in> arg_max_set U[?i] (budget_constraint ((\<bullet>) ?P) consumption_set (poe_wealth ?P ?i ?Y))\<rbrakk> \<Longrightarrow> ?P \<bullet> ?X = poe_wealth ?P ?i ?Y
i \<in> agents
local_nonsatiation consumption_set Pr[i]
x \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i Y))
y \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i Y))
local_nonsatiation consumption_set Pr[i]

goal (1 subgoal):
 1. P \<bullet> x = P \<bullet> y
[PROOF STEP]
by (metis (no_types) am_utilises_entire_bgt assms(3) assms(4) i_agt lns)


[STATEMENT]
theorem WPO_S_subset_WPO_NS: "WPO_S \<subseteq> WPO_NS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. WPO_S \<subseteq> WPO_NS
[PROOF STEP]
using wpo_s_imp_ns
[PROOF STATE]
proof (prove)
using this:
?s \<succ> ?t \<Longrightarrow> ?s \<succeq> ?t

goal (1 subgoal):
 1. WPO_S \<subseteq> WPO_NS
[PROOF STEP]
by blast


[STATEMENT]
lemma accepting_pair\<^sub>G\<^sub>R_simp[simp]:
  "accepting_pair\<^sub>G\<^sub>R \<delta> q\<^sub>0 (F, \<I>) w \<equiv> limit (run\<^sub>t \<delta> q\<^sub>0 w) \<inter> F = {} \<and> (\<forall>I \<in> \<I>. limit (run\<^sub>t \<delta> q\<^sub>0 w) \<inter> I \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. accepting_pair\<^sub>G\<^sub>R \<delta> q\<^sub>0 (F, \<I>) w \<equiv> limit (run\<^sub>t \<delta> q\<^sub>0 w) \<inter> F = {} \<and> (\<forall>I\<in>\<I>. limit (run\<^sub>t \<delta> q\<^sub>0 w) \<inter> I \<noteq> {})
[PROOF STEP]
by simp


[STATEMENT]
lemma le_succ_iff: "Ord i \<Longrightarrow> Ord j \<Longrightarrow> succ i \<le> succ j \<longleftrightarrow> i \<le> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord i; Ord j\<rbrakk> \<Longrightarrow> (ZFC_in_HOL.succ i \<le> ZFC_in_HOL.succ j) = (i \<le> j)
[PROOF STEP]
by (metis Ord_linear_le Ord_succ le_succE order_antisym)


[STATEMENT]
lemma signed_measure_inf_sum:
  assumes "signed_measure M \<mu>"
    and "range A \<subseteq> M"
    and "disjoint_family A"
    and "\<Union> (range A) \<in> sets M"
  shows "(\<Sum>i. \<mu> (A i)) = \<mu> (\<Union> (range A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. \<mu> (A i)) = \<mu> (\<Union> (range A))
[PROOF STEP]
using sums_unique assms
    signed_measure_sums
[PROOF STATE]
proof (prove)
using this:
?f sums ?s \<Longrightarrow> ?s = suminf ?f
signed_measure M \<mu>
range A \<subseteq> sets M
disjoint_family A
\<Union> (range A) \<in> sets M
\<lbrakk>signed_measure ?M ?\<mu>; range ?A \<subseteq> sets ?M; disjoint_family ?A; \<Union> (range ?A) \<in> sets ?M\<rbrakk> \<Longrightarrow> (\<lambda>i. ?\<mu> (?A i)) sums ?\<mu> (\<Union> (range ?A))

goal (1 subgoal):
 1. (\<Sum>i. \<mu> (A i)) = \<mu> (\<Union> (range A))
[PROOF STEP]
by (metis)


[STATEMENT]
lemma asymp_equiv_norm [asymp_equiv_intros]:
  fixes f g :: "'a \<Rightarrow> 'b :: real_normed_field"
  assumes "f \<sim>[F] g"
  shows   "(\<lambda>x. norm (f x)) \<sim>[F] (\<lambda>x. norm (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. norm (f x)) \<sim>[F] (\<lambda>x. norm (g x))
[PROOF STEP]
using tendsto_norm[OF asymp_equivD[OF assms]]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. norm (if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x)) \<longlongrightarrow> norm (1::'b)) F

goal (1 subgoal):
 1. (\<lambda>x. norm (f x)) \<sim>[F] (\<lambda>x. norm (g x))
[PROOF STEP]
by (simp add: if_distrib asymp_equiv_def norm_divide cong: if_cong)


[STATEMENT]
lemma prod_diff_prod: "(x ** y - a ** b) = (x - a) ** (y - b) + (x - a) ** b + a ** (y - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ** y - a ** b = (x - a) ** (y - b) + (x - a) ** b + a ** (y - b)
[PROOF STEP]
by (simp add: diff_left diff_right)


[STATEMENT]
lemma disjoint_bind: "\<And>S T f g. (\<And>s t. S s \<and> T t \<Longrightarrow> f s \<inter> g t = {}) \<Longrightarrow> ({s. S s} \<bind> f) \<inter> ({t. T t} \<bind> g) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S T f g. (\<And>s t. S s \<and> T t \<Longrightarrow> f s \<inter> g t = {}) \<Longrightarrow> ({s. S s} \<bind> f) \<inter> ({t. T t} \<bind> g) = {}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Infinitesimal_add_not_zero: "h \<in> Infinitesimal \<Longrightarrow> x \<noteq> 0 \<Longrightarrow> star_of x + h \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<in> Infinitesimal; x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> star_of x + h \<noteq> 0
[PROOF STEP]
by (metis Infinitesimal_add_approx_self star_of_approx_zero_iff)


[STATEMENT]
lemma nat_diff_left_cancel_le2: "\<lbrakk> k - m \<le> k - (n::nat); n \<le> k \<rbrakk> \<Longrightarrow> n \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k - m \<le> k - n; n \<le> k\<rbrakk> \<Longrightarrow> n \<le> m
[PROOF STEP]
by simp


[STATEMENT]
lemma i_squared [simp]:
  \<open>\<i>\<^sup>2 = - 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i>\<^sup>2 = - 1
[PROOF STEP]
by (simp add: power2_eq_square)


[STATEMENT]
lemma line_convex_combination12: "(1 - u) *\<^sub>R line a b i + u *\<^sub>R line a b j = line a b (i + u * (j - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - u) *\<^sub>R {a -- b}\<^bsub>i\<^esub> + u *\<^sub>R {a -- b}\<^bsub>j\<^esub> = {a -- b}\<^bsub>i + u * (j - i)\<^esub>
[PROOF STEP]
by (auto simp: line_def algebra_simps)


[STATEMENT]
lemma betweenE_if_dist_leq:
  fixes A B X :: "'a::euclidean_space"
  assumes "between (A, B) X"
  assumes "dist A X \<le> dist B X"
  obtains u where "1 / 2 \<le> u" "u \<le> 1" and "X = u *\<^sub>R A + (1 - u) *\<^sub>R B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "A = B")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A \<noteq> B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
assume "A \<noteq> B"
[PROOF STATE]
proof (state)
this:
A \<noteq> B

goal (2 subgoals):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A \<noteq> B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from \<open>between (A, B) X\<close>
[PROOF STATE]
proof (chain)
picking this:
between (A, B) X
[PROOF STEP]
obtain u where u: "u \<ge> 0" "u \<le> 1" and X: "X = u *\<^sub>R A + (1 - u) *\<^sub>R B"
[PROOF STATE]
proof (prove)
using this:
between (A, B) X

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis add.commute betweenE between_commute)
[PROOF STATE]
proof (state)
this:
0 \<le> u
u \<le> 1
X = u *\<^sub>R A + (1 - u) *\<^sub>R B

goal (2 subgoals):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A \<noteq> B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from X
[PROOF STATE]
proof (chain)
picking this:
X = u *\<^sub>R A + (1 - u) *\<^sub>R B
[PROOF STEP]
have "X = B + u *\<^sub>R (A - B)" and "X = A + (u - 1) *\<^sub>R (A - B)"
[PROOF STATE]
proof (prove)
using this:
X = u *\<^sub>R A + (1 - u) *\<^sub>R B

goal (1 subgoal):
 1. X = B + u *\<^sub>R (A - B) &&& X = A + (u - 1) *\<^sub>R (A - B)
[PROOF STEP]
by (simp add: scaleR_diff_left real_vector.scale_right_diff_distrib)+
[PROOF STATE]
proof (state)
this:
X = B + u *\<^sub>R (A - B)
X = A + (u - 1) *\<^sub>R (A - B)

goal (2 subgoals):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A \<noteq> B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from \<open>X = B + u *\<^sub>R (A - B)\<close>
[PROOF STATE]
proof (chain)
picking this:
X = B + u *\<^sub>R (A - B)
[PROOF STEP]
have dist_B: "dist B X = norm (u *\<^sub>R (A - B))"
[PROOF STATE]
proof (prove)
using this:
X = B + u *\<^sub>R (A - B)

goal (1 subgoal):
 1. dist B X = norm (u *\<^sub>R (A - B))
[PROOF STEP]
by (auto simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
dist B X = norm (u *\<^sub>R (A - B))

goal (2 subgoals):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A \<noteq> B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from \<open>X = A + (u - 1) *\<^sub>R (A - B)\<close>
[PROOF STATE]
proof (chain)
picking this:
X = A + (u - 1) *\<^sub>R (A - B)
[PROOF STEP]
have dist_A: "dist A X = norm ((u - 1) *\<^sub>R (A - B))"
[PROOF STATE]
proof (prove)
using this:
X = A + (u - 1) *\<^sub>R (A - B)

goal (1 subgoal):
 1. dist A X = norm ((u - 1) *\<^sub>R (A - B))
[PROOF STEP]
by (auto simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
dist A X = norm ((u - 1) *\<^sub>R (A - B))

goal (2 subgoals):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A \<noteq> B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from \<open>A \<noteq> B\<close>
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> B
[PROOF STEP]
have "norm (A - B) > 0"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B

goal (1 subgoal):
 1. 0 < norm (A - B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < norm (A - B)

goal (2 subgoals):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A \<noteq> B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from this \<open>dist A X \<le> dist B X\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < norm (A - B)
dist A X \<le> dist B X
[PROOF STEP]
have "u \<ge> 1 / 2"
[PROOF STATE]
proof (prove)
using this:
0 < norm (A - B)
dist A X \<le> dist B X

goal (1 subgoal):
 1. 1 / 2 \<le> u
[PROOF STEP]
using dist_A dist_B
[PROOF STATE]
proof (prove)
using this:
0 < norm (A - B)
dist A X \<le> dist B X
dist A X = norm ((u - 1) *\<^sub>R (A - B))
dist B X = norm (u *\<^sub>R (A - B))

goal (1 subgoal):
 1. 1 / 2 \<le> u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / 2 \<le> u

goal (2 subgoals):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A \<noteq> B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from this \<open>u \<le> 1\<close> X that
[PROOF STATE]
proof (chain)
picking this:
1 / 2 \<le> u
u \<le> 1
X = u *\<^sub>R A + (1 - u) *\<^sub>R B
\<lbrakk>1 / 2 \<le> ?u; ?u \<le> 1; X = ?u *\<^sub>R A + (1 - ?u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
1 / 2 \<le> u
u \<le> 1
X = u *\<^sub>R A + (1 - u) *\<^sub>R B
\<lbrakk>1 / 2 \<le> ?u; ?u \<le> 1; X = ?u *\<^sub>R A + (1 - ?u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis

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

goal (1 subgoal):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
assume "A = B"
[PROOF STATE]
proof (state)
this:
A = B

goal (1 subgoal):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
define u :: real where "u = 1"
[PROOF STATE]
proof (state)
this:
u = 1

goal (1 subgoal):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from \<open>between (A, B) X\<close> \<open>A = B\<close>
[PROOF STATE]
proof (chain)
picking this:
between (A, B) X
A = B
[PROOF STEP]
have "1 / 2 \<le> u" "u \<le> 1" "X = u *\<^sub>R A + (1 - u) *\<^sub>R B"
[PROOF STATE]
proof (prove)
using this:
between (A, B) X
A = B

goal (1 subgoal):
 1. 1 / 2 \<le> u &&& u \<le> 1 &&& X = u *\<^sub>R A + (1 - u) *\<^sub>R B
[PROOF STEP]
unfolding u_def
[PROOF STATE]
proof (prove)
using this:
between (A, B) X
A = B

goal (1 subgoal):
 1. 1 / 2 \<le> 1 &&& 1 \<le> 1 &&& X = 1 *\<^sub>R A + (1 - 1) *\<^sub>R B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / 2 \<le> u
u \<le> 1
X = u *\<^sub>R A + (1 - u) *\<^sub>R B

goal (1 subgoal):
 1. \<lbrakk>\<And>u. \<lbrakk>1 / 2 \<le> u; u \<le> 1; X = u *\<^sub>R A + (1 - u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis; A = B\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>1 / 2 \<le> ?u; ?u \<le> 1; X = ?u *\<^sub>R A + (1 - ?u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis
1 / 2 \<le> u
u \<le> 1
X = u *\<^sub>R A + (1 - u) *\<^sub>R B
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 / 2 \<le> ?u; ?u \<le> 1; X = ?u *\<^sub>R A + (1 - ?u) *\<^sub>R B\<rbrakk> \<Longrightarrow> thesis
1 / 2 \<le> u
u \<le> 1
X = u *\<^sub>R A + (1 - u) *\<^sub>R B

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bot_sup_induct [case_names bot sup]:
  fixes f g :: "'b::finite \<Rightarrow> 'a"
  assumes bot: "P bot bot"
      and sup: "\<And>j I . j \<notin> I \<Longrightarrow> P (\<Squnion>\<^bsub>i\<in>I\<^esub> f i) (\<Squnion>\<^bsub>i\<in>I\<^esub> g i) \<Longrightarrow> P (f j \<squnion> (\<Squnion>\<^bsub>i\<in>I\<^esub> f i)) (g j \<squnion> (\<Squnion>\<^bsub>i\<in>I\<^esub> g i))"
    shows "P (\<Squnion>\<^sub>k f k) (\<Squnion>\<^sub>k g k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (comm_monoid_add.sum (\<squnion>) bot f {k. True}) (comm_monoid_add.sum (\<squnion>) bot g {k. True})
[PROOF STEP]
apply (induct rule: one_sup_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. P (f i) (g i)
 2. \<And>j I. \<lbrakk>j \<notin> I; P (comm_monoid_add.sum (\<squnion>) bot f I) (comm_monoid_add.sum (\<squnion>) bot g I)\<rbrakk> \<Longrightarrow> P (f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I) (g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I)
[PROOF STEP]
using bot sup
[PROOF STATE]
proof (prove)
using this:
P bot bot
\<lbrakk>?j1 \<notin> ?I1; P (comm_monoid_add.sum (\<squnion>) bot f ?I1) (comm_monoid_add.sum (\<squnion>) bot g ?I1)\<rbrakk> \<Longrightarrow> P (f ?j1 \<squnion> comm_monoid_add.sum (\<squnion>) bot f ?I1) (g ?j1 \<squnion> comm_monoid_add.sum (\<squnion>) bot g ?I1)

goal (2 subgoals):
 1. \<And>i. P (f i) (g i)
 2. \<And>j I. \<lbrakk>j \<notin> I; P (comm_monoid_add.sum (\<squnion>) bot f I) (comm_monoid_add.sum (\<squnion>) bot g I)\<rbrakk> \<Longrightarrow> P (f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I) (g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I)
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; P (comm_monoid_add.sum (\<squnion>) bot f I) (comm_monoid_add.sum (\<squnion>) bot g I)\<rbrakk> \<Longrightarrow> P (f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I) (g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I)
[PROOF STEP]
using sup
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?j1 \<notin> ?I1; P (comm_monoid_add.sum (\<squnion>) bot f ?I1) (comm_monoid_add.sum (\<squnion>) bot g ?I1)\<rbrakk> \<Longrightarrow> P (f ?j1 \<squnion> comm_monoid_add.sum (\<squnion>) bot f ?I1) (g ?j1 \<squnion> comm_monoid_add.sum (\<squnion>) bot g ?I1)

goal (1 subgoal):
 1. \<And>j I. \<lbrakk>j \<notin> I; P (comm_monoid_add.sum (\<squnion>) bot f I) (comm_monoid_add.sum (\<squnion>) bot g I)\<rbrakk> \<Longrightarrow> P (f j \<squnion> comm_monoid_add.sum (\<squnion>) bot f I) (g j \<squnion> comm_monoid_add.sum (\<squnion>) bot g I)
[PROOF STEP]
by blast


[STATEMENT]
lemma space_exponential: "space (exponential l) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (exponential l) = UNIV
[PROOF STEP]
by (simp add: exponential_def)


[STATEMENT]
lemma sets_Pair: "{x} \<in> sets M1 \<Longrightarrow> {y} \<in> sets M2 \<Longrightarrow> {(x, y)} \<in> sets (M1 \<Otimes>\<^sub>M M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{x} \<in> sets M1; {y} \<in> sets M2\<rbrakk> \<Longrightarrow> {(x, y)} \<in> sets (M1 \<Otimes>\<^sub>M M2)
[PROOF STEP]
using pair_measureI[of "{x}" M1 "{y}" M2]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{x} \<in> sets M1; {y} \<in> sets M2\<rbrakk> \<Longrightarrow> {x} \<times> {y} \<in> sets (M1 \<Otimes>\<^sub>M M2)

goal (1 subgoal):
 1. \<lbrakk>{x} \<in> sets M1; {y} \<in> sets M2\<rbrakk> \<Longrightarrow> {(x, y)} \<in> sets (M1 \<Otimes>\<^sub>M M2)
[PROOF STEP]
by simp


[STATEMENT]
lemma replicate_count_mset_eq_filter_eq: "replicate (count (mset xs) k) k = filter (HOL.eq k) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. replicate (count (mset xs) k) k = filter ((=) k) xs
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma zero_in_Field: assumes "Field r \<noteq> {}"  shows "zero \<in> Field r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zero \<in> Field r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Field r \<noteq> {}

goal (1 subgoal):
 1. zero \<in> Field r
[PROOF STEP]
unfolding zero_def
[PROOF STATE]
proof (prove)
using this:
Field r \<noteq> {}

goal (1 subgoal):
 1. local.minim (Field r) \<in> Field r
[PROOF STEP]
by (metis Field_ofilter minim_in ofilter_def)


[STATEMENT]
lemma continuity_lem_gt0_expanded:
  fixes r:: "real"
  fixes a b c:: "real"
  fixes k::"real"
  assumes kgt: "k > r"
  shows "a*r^2 + b*r + c > 0 \<Longrightarrow>
    \<exists>x\<in>{r<..k}. a*x^2 + b*x + c > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a * r\<^sup>2 + b * r + c \<Longrightarrow> \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < a * r\<^sup>2 + b * r + c \<Longrightarrow> \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
assume "a*r^2 + b*r + c > 0"
[PROOF STATE]
proof (state)
this:
0 < a * r\<^sup>2 + b * r + c

goal (1 subgoal):
 1. 0 < a * r\<^sup>2 + b * r + c \<Longrightarrow> \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < a * r\<^sup>2 + b * r + c
[PROOF STEP]
have "\<exists>y'> r. \<forall>x\<in>{r<..y'}. poly [:c, b, a:] x > 0"
[PROOF STATE]
proof (prove)
using this:
0 < a * r\<^sup>2 + b * r + c

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
using continuity_lem_gt0 quadratic_poly_eval[of c b a r]
[PROOF STATE]
proof (prove)
using this:
0 < a * r\<^sup>2 + b * r + c
0 < poly [:?c, ?b, ?a:] ?r \<Longrightarrow> \<exists>y'>?r. \<forall>x\<in>{?r<..y'}. 0 < poly [:?c, ?b, ?a:] x
poly [:c, b, a:] r = a * r\<^sup>2 + b * r + c

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x

goal (1 subgoal):
 1. 0 < a * r\<^sup>2 + b * r + c \<Longrightarrow> \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
obtain y' where y_prop: "y' > r \<and> (\<forall>x\<in>{r<..y'}. poly [:c, b, a:] x > 0)"
[PROOF STATE]
proof (prove)
using this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x

goal (1 subgoal):
 1. (\<And>y'. r < y' \<and> (\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x)

goal (1 subgoal):
 1. 0 < a * r\<^sup>2 + b * r + c \<Longrightarrow> \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x)
[PROOF STEP]
have "\<exists>q. q > r \<and> q < min k y'"
[PROOF STATE]
proof (prove)
using this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x)

goal (1 subgoal):
 1. \<exists>q>r. q < min k y'
[PROOF STEP]
using kgt dense
[PROOF STATE]
proof (prove)
using this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x)
r < k
?x < ?y \<Longrightarrow> \<exists>z>?x. z < ?y

goal (1 subgoal):
 1. \<exists>q>r. q < min k y'
[PROOF STEP]
by (metis min_less_iff_conj)
[PROOF STATE]
proof (state)
this:
\<exists>q>r. q < min k y'

goal (1 subgoal):
 1. 0 < a * r\<^sup>2 + b * r + c \<Longrightarrow> \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>q>r. q < min k y'
[PROOF STEP]
obtain q where q_prop: "q > r \<and>q < min k y'"
[PROOF STATE]
proof (prove)
using this:
\<exists>q>r. q < min k y'

goal (1 subgoal):
 1. (\<And>q. r < q \<and> q < min k y' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r < q \<and> q < min k y'

goal (1 subgoal):
 1. 0 < a * r\<^sup>2 + b * r + c \<Longrightarrow> \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r < q \<and> q < min k y'
[PROOF STEP]
have "a*q^2 + b*q + c > 0"
[PROOF STATE]
proof (prove)
using this:
r < q \<and> q < min k y'

goal (1 subgoal):
 1. 0 < a * q\<^sup>2 + b * q + c
[PROOF STEP]
using y_prop  quadratic_poly_eval[of c b a q]
[PROOF STATE]
proof (prove)
using this:
r < q \<and> q < min k y'
r < y' \<and> (\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x)
poly [:c, b, a:] q = a * q\<^sup>2 + b * q + c

goal (1 subgoal):
 1. 0 < a * q\<^sup>2 + b * q + c
[PROOF STEP]
by (metis greaterThanAtMost_iff less_eq_real_def min_less_iff_conj)
[PROOF STATE]
proof (state)
this:
0 < a * q\<^sup>2 + b * q + c

goal (1 subgoal):
 1. 0 < a * r\<^sup>2 + b * r + c \<Longrightarrow> \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < a * q\<^sup>2 + b * q + c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < a * q\<^sup>2 + b * q + c

goal (1 subgoal):
 1. \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
using q_prop
[PROOF STATE]
proof (prove)
using this:
0 < a * q\<^sup>2 + b * q + c
r < q \<and> q < min k y'

goal (1 subgoal):
 1. \<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{r<..k}. 0 < a * x\<^sup>2 + b * x + c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma incseq_imp_monoseq:  "incseq X \<Longrightarrow> monoseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq X \<Longrightarrow> monoseq X
[PROOF STEP]
by (simp add: incseq_def monoseq_def)


[STATEMENT]
lemma vars_Sum_any: "vars (Sum_any h) \<subseteq> (\<Union>i. vars (h i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (Sum_any h) \<subseteq> (\<Union>i. vars (h i))
[PROOF STEP]
unfolding Sum_any.expand_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (sum h {a. h a \<noteq> 0}) \<subseteq> (\<Union>i. vars (h i))
[PROOF STEP]
by (intro order.trans[OF vars_sum]) auto


[STATEMENT]
lemma ffff_4: assumes dx: "dim_vec x = 4"
  and be: "x $ 0 = False \<and> x $ 1 = False \<and> x $ 2 = False \<and> x $ 3 = False"
  shows "ceros_of_boolean_input x = {0,1,2,3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 1, 2, 3}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = False \<and> x $ 2 = False \<and> x $ 3 = False

goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 1, 2, 3}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = False \<and> x $ 2 = False \<and> x $ 3 = False

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 1, 2, 3}
[PROOF STEP]
using less_4_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = False \<and> x $ 2 = False \<and> x $ 3 = False
?n < 4 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2 \<or> ?n = 3

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 1, 2, 3}
[PROOF STEP]
by auto


[STATEMENT]
lemma (in ring) univ_poly_consistent:
  assumes "subring K R"
  shows "univ_poly (R \<lparr> carrier := K \<rparr>) = univ_poly R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ_poly (R\<lparr>carrier := K\<rparr>) = univ_poly R
[PROOF STEP]
unfolding univ_poly_def polynomial_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>Ka. \<lparr>carrier = {p. p = [] \<or> set p \<subseteq> Ka \<and> lead_coeff p \<noteq> \<zero>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub>}, monoid.mult = ring.poly_mult (R\<lparr>carrier := K\<rparr>), one = [\<one>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub>], zero = [], add = ring.poly_add (R\<lparr>carrier := K\<rparr>)\<rparr>) = (\<lambda>K. \<lparr>carrier = {p. p = [] \<or> set p \<subseteq> K \<and> lead_coeff p \<noteq> \<zero>}, monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>)
[PROOF STEP]
using poly_add_consistent[OF assms]
        poly_mult_consistent[OF assms]
        subringE(1)[OF assms]
[PROOF STATE]
proof (prove)
using this:
ring.poly_add (R\<lparr>carrier := K\<rparr>) = poly_add
ring.poly_mult (R\<lparr>carrier := K\<rparr>) = poly_mult
K \<subseteq> carrier R

goal (1 subgoal):
 1. (\<lambda>Ka. \<lparr>carrier = {p. p = [] \<or> set p \<subseteq> Ka \<and> lead_coeff p \<noteq> \<zero>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub>}, monoid.mult = ring.poly_mult (R\<lparr>carrier := K\<rparr>), one = [\<one>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub>], zero = [], add = ring.poly_add (R\<lparr>carrier := K\<rparr>)\<rparr>) = (\<lambda>K. \<lparr>carrier = {p. p = [] \<or> set p \<subseteq> K \<and> lead_coeff p \<noteq> \<zero>}, monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>)
[PROOF STEP]
by auto


[STATEMENT]
lemma InfCard_ge_ord_of_nat:
  assumes "InfCard \<kappa>" shows "ord_of_nat n \<le> \<kappa>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_of_nat n \<le> \<kappa>
[PROOF STEP]
using InfCard_def assms ord_of_nat_le_omega
[PROOF STATE]
proof (prove)
using this:
InfCard ?\<kappa> \<equiv> Card ?\<kappa> \<and> \<omega> \<le> ?\<kappa>
InfCard \<kappa>
ord_of_nat ?n \<le> \<omega>

goal (1 subgoal):
 1. ord_of_nat n \<le> \<kappa>
[PROOF STEP]
by blast


[STATEMENT]
lemma card_min_max:"i \<noteq> \<emptyset> \<longrightarrow> |i| = (maximum i - minimum i) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> bot \<longrightarrow> |i| = maximum i - minimum i + 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> bot \<Longrightarrow> |i| = maximum i - minimum i + 1
[PROOF STEP]
assume assm:"i \<noteq> \<emptyset>"
[PROOF STATE]
proof (state)
this:
i \<noteq> bot

goal (1 subgoal):
 1. i \<noteq> bot \<Longrightarrow> |i| = maximum i - minimum i + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> bot
[PROOF STEP]
have "Rep_nat_int i = {minimum i .. maximum i}"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> bot

goal (1 subgoal):
 1. Rep_nat_int i = {minimum i..maximum i}
[PROOF STEP]
by (metis leq_max_sup leq_min_inf nat_int.maximum_def nat_int.minimum_def
        rep_non_empty_means_seq)
[PROOF STATE]
proof (state)
this:
Rep_nat_int i = {minimum i..maximum i}

goal (1 subgoal):
 1. i \<noteq> bot \<Longrightarrow> |i| = maximum i - minimum i + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Rep_nat_int i = {minimum i..maximum i}
[PROOF STEP]
have "card (Rep_nat_int i) = maximum i - minimum i + 1"
[PROOF STATE]
proof (prove)
using this:
Rep_nat_int i = {minimum i..maximum i}

goal (1 subgoal):
 1. card (Rep_nat_int i) = maximum i - minimum i + 1
[PROOF STEP]
using Rep_nat_int_inject assm bot_nat_int.rep_eq
[PROOF STATE]
proof (prove)
using this:
Rep_nat_int i = {minimum i..maximum i}
(Rep_nat_int ?x = Rep_nat_int ?y) = (?x = ?y)
i \<noteq> bot
Rep_nat_int bot = {}

goal (1 subgoal):
 1. card (Rep_nat_int i) = maximum i - minimum i + 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card (Rep_nat_int i) = maximum i - minimum i + 1

goal (1 subgoal):
 1. i \<noteq> bot \<Longrightarrow> |i| = maximum i - minimum i + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (Rep_nat_int i) = maximum i - minimum i + 1
[PROOF STEP]
show " |i| = (maximum i - minimum i) + 1"
[PROOF STATE]
proof (prove)
using this:
card (Rep_nat_int i) = maximum i - minimum i + 1

goal (1 subgoal):
 1. |i| = maximum i - minimum i + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|i| = maximum i - minimum i + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma special_points_on_x_axis'' [simp]:
  shows "0\<^sub>h \<in> circline_set x_axis" and "1\<^sub>h \<in> circline_set x_axis" and "\<infinity>\<^sub>h \<in> circline_set x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>h \<in> circline_set x_axis &&& 1\<^sub>h \<in> circline_set x_axis &&& \<infinity>\<^sub>h \<in> circline_set x_axis
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>h \<in> Collect (on_circline x_axis) &&& 1\<^sub>h \<in> Collect (on_circline x_axis) &&& \<infinity>\<^sub>h \<in> Collect (on_circline x_axis)
[PROOF STEP]
by auto


[STATEMENT]
lemma ordLess_omax:
assumes "finite R" and "\<forall> r \<in> R. Well_order r"
and "r \<in> R" and "p <o r"
shows "p <o omax R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p <o omax R
[PROOF STEP]
using assms omax_maxim[of R r]
[PROOF STATE]
proof (prove)
using this:
finite R
\<forall>r\<in>R. Well_order r
r \<in> R
p <o r
\<lbrakk>finite R; \<forall>r\<in>R. Well_order r; r \<in> R\<rbrakk> \<Longrightarrow> r \<le>o omax R

goal (1 subgoal):
 1. p <o omax R
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite R; \<forall>r\<in>R. Well_order r; r \<in> R; p <o r; r \<le>o omax R\<rbrakk> \<Longrightarrow> p <o omax R
[PROOF STEP]
using ordLess_ordLeq_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?r <o ?r'; ?r' \<le>o ?r''\<rbrakk> \<Longrightarrow> ?r <o ?r''

goal (1 subgoal):
 1. \<lbrakk>finite R; \<forall>r\<in>R. Well_order r; r \<in> R; p <o r; r \<le>o omax R\<rbrakk> \<Longrightarrow> p <o omax R
[PROOF STEP]
by blast