[STATEMENT]
lemma tm_cf_diagonal_ObjMap_vrange:
  assumes "tiny_category \<alpha> \<JJ>" and "category \<alpha> \<CC>"
  shows "\<R>\<^sub>\<circ> (\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<JJ> \<CC>\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (\<Delta>\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>m \<alpha> \<JJ> \<CC>\<lparr>ObjMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding tm_cf_diagonal_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>\<CC>\<lparr>Obj\<rparr>. cf_map (dghm_const \<JJ> \<CC> a (\<CC>\<lparr>CId\<rparr>\<lparr>a\<rparr>))) \<subseteq>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
proof(rule vrange_VLambda_vsubset)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr> \<Longrightarrow> cf_map (dghm_const \<JJ> \<CC> x (\<CC>\<lparr>CId\<rparr>\<lparr>x\<rparr>)) \<in>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr> \<Longrightarrow> cf_map (dghm_const \<JJ> \<CC> x (\<CC>\<lparr>CId\<rparr>\<lparr>x\<rparr>)) \<in>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
assume "x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr> \<Longrightarrow> cf_map (dghm_const \<JJ> \<CC> x (\<CC>\<lparr>CId\<rparr>\<lparr>x\<rparr>)) \<in>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
with assms category_cat_Funct[OF assms]
[PROOF STATE]
proof (chain)
picking this:
tiny_category \<alpha> \<JJ>
category \<alpha> \<CC>
category \<alpha> (cat_Funct \<alpha> \<JJ> \<CC>)
x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
show
    "cf_map (cf_const \<JJ> \<CC> x) \<in>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
using this:
tiny_category \<alpha> \<JJ>
category \<alpha> \<CC>
category \<alpha> (cat_Funct \<alpha> \<JJ> \<CC>)
x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. cf_map (dghm_const \<JJ> \<CC> x (\<CC>\<lparr>CId\<rparr>\<lparr>x\<rparr>)) \<in>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cat_Funct_components(1)
[PROOF STATE]
proof (prove)
using this:
tiny_category \<alpha> \<JJ>
category \<alpha> \<CC>
category \<alpha> (cat_Funct \<alpha> \<JJ> \<CC>)
x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. cf_map (dghm_const \<JJ> \<CC> x (\<CC>\<lparr>CId\<rparr>\<lparr>x\<rparr>)) \<in>\<^sub>\<circ> tm_cf_maps \<alpha> \<JJ> \<CC>
[PROOF STEP]
by (cs_concl cs_intro: cat_small_cs_intros cat_FUNCT_cs_intros)
[PROOF STATE]
proof (state)
this:
cf_map (dghm_const \<JJ> \<CC> x (\<CC>\<lparr>CId\<rparr>\<lparr>x\<rparr>)) \<in>\<^sub>\<circ> cat_Funct \<alpha> \<JJ> \<CC>\<lparr>Obj\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<forall>z. (\<exists>y. (\<forall>x. f x y = (f x z \<and> \<not> f x x))))
      \<longrightarrow> \<not> (\<exists>z. \<forall>x. f x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>z. \<exists>y. \<forall>x. f x y = (f x z \<and> \<not> f x x)) \<longrightarrow> (\<nexists>z. \<forall>x. f x z)
[PROOF STEP]
by blast


[STATEMENT]
lemma assert_Sup_range: "{.\<Squnion> (range (p::'W \<Rightarrow> 'a::complete_distrib_lattice)).} = \<Squnion> (range (assert o p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {. \<Squnion>range p .} = \<Squnion>range (assert \<circ> p)
[PROOF STEP]
by (simp add: fun_eq_iff assert_def SUP_inf image_comp)


[STATEMENT]
lemma intuitionistic_exists:
  "(\<And>x. intuitionistic (P x)) \<Longrightarrow> intuitionistic (EXS x. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. intuitionistic (P x)) \<Longrightarrow> intuitionistic (\<lambda>s. \<exists>x. P x s)
[PROOF STEP]
by (force intro: intuitionisticI dest: intuitionisticD)


[STATEMENT]
lemma reduce_basis_cost_expanded:
  assumes "Lg \<ge> nat \<lceil>log (of_rat (4 * \<alpha> / (4 + \<alpha>))) N\<rceil>"
  shows "cost (reduce_basis_cost fs_init)
  \<le> 4 * Lg * m * m * m * n
    + 4 * Lg * m * m * m * m
    + 16 * Lg * m * m * m
    + 4 * Lg * m * m
    + 3 * m * m * m
    + 3 * m * m * n
    + 10 * m * m
    + 2 * n * m
    + 3 * m"
  (is "?cost \<le> ?exp Lg")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
define Log where "Log = nat \<lceil>log (of_rat (4 * \<alpha> / (4 + \<alpha>))) N\<rceil>"
[PROOF STATE]
proof (state)
this:
Log = nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil>

goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
have Lg: "Log \<le> Lg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Log \<le> Lg
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> \<le> Lg

goal (1 subgoal):
 1. Log \<le> Lg
[PROOF STEP]
unfolding Log_def
[PROOF STATE]
proof (prove)
using this:
nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> \<le> Lg

goal (1 subgoal):
 1. nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> \<le> Lg
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Log \<le> Lg

goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
have "?cost \<le> ?exp Log"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Log * m * m * m * n + 4 * Log * m * m * m * m + 16 * Log * m * m * m + 4 * Log * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
unfolding Log_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> * m * m * m * n + 4 * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> * m * m * m * m + 16 * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> * m * m * m + 4 * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
using reduce_basis_cost(2)[unfolded num_loops_def body_cost_def initial_gso_cost_def base_def]
[PROOF STATE]
proof (prove)
using this:
cost (reduce_basis_cost fs_init) \<le> m * (m * (m + n + 2) + 2 * n + 1) + (2 + (8 + 2 * n + 2 * m) * m) * (m + 2 * m * m * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil>)

goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> * m * m * m * n + 4 * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> * m * m * m * m + 16 * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> * m * m * m + 4 * nat \<lceil>log (real_of_rat (4 * \<alpha> / (4 + \<alpha>))) (real N)\<rceil> * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
cost (reduce_basis_cost fs_init) \<le> 4 * Log * m * m * m * n + 4 * Log * m * m * m * m + 16 * Log * m * m * m + 4 * Log * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m

goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cost (reduce_basis_cost fs_init) \<le> 4 * Log * m * m * m * n + 4 * Log * m * m * m * m + 16 * Log * m * m * m + 4 * Log * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m

goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
have "\<dots> \<le> ?exp Lg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * Log * m * m * m * n + 4 * Log * m * m * m * m + 16 * Log * m * m * m + 4 * Log * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
by (intro add_mono mult_mono Lg, auto)
[PROOF STATE]
proof (state)
this:
4 * Log * m * m * m * n + 4 * Log * m * m * m * m + 16 * Log * m * m * m + 4 * Log * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m

goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m

goal (1 subgoal):
 1. cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cost (reduce_basis_cost fs_init) \<le> 4 * Lg * m * m * m * n + 4 * Lg * m * m * m * m + 16 * Lg * m * m * m + 4 * Lg * m * m + 3 * m * m * m + 3 * m * m * n + 10 * m * m + 2 * n * m + 3 * m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ASSIGN:
  "(\<forall> s ss. s \<approx> ss \<longrightarrow> evalE e s = evalE e ss) \<Longrightarrow>
   G \<rhd> (Assign x e)
     : (Sec (\<lambda> (s, t) . s \<approx> (update t x (evalE e t))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s ss.  s \<approx> ss  \<longrightarrow> evalE e s = evalE e ss \<Longrightarrow> G \<rhd> Assign x e : Sec (\<lambda>(s, t).  s \<approx> update t x (evalE e t) )
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s ss.  s \<approx> ss  \<longrightarrow> evalE e s = evalE e ss \<Longrightarrow> G \<rhd> Assign x e : Sec (\<lambda>(s, t).  s \<approx> update t x (evalE e t) )
[PROOF STEP]
apply (rule VDMConseq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>s ss.  s \<approx> ss  \<longrightarrow> evalE e s = evalE e ss \<Longrightarrow> G \<rhd> Assign x e : ?A
 2. \<forall>s ss.  s \<approx> ss  \<longrightarrow> evalE e s = evalE e ss \<Longrightarrow> \<forall>s t. ?A s t \<longrightarrow> Sec (\<lambda>(s, t).  s \<approx> update t x (evalE e t) ) s t
[PROOF STEP]
apply(rule VDMAssign)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s ss.  s \<approx> ss  \<longrightarrow> evalE e s = evalE e ss \<Longrightarrow> \<forall>s t. t = update s x (evalE e s) \<longrightarrow> Sec (\<lambda>(s, t).  s \<approx> update t x (evalE e t) ) s t
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. \<forall>s ss.  s \<approx> ss  \<longrightarrow> evalE e s = evalE e ss \<Longrightarrow> Sec (\<lambda>(s, t).  s \<approx> update t x (evalE e t) ) s (update s x (evalE e s))
[PROOF STEP]
apply (simp add: Sec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. \<forall>s ss.  s \<approx> ss  \<longrightarrow> evalE e s = evalE e ss \<Longrightarrow> \<forall>r.  s \<approx> r  \<longrightarrow>  update s x (evalE e r) \<approx> update r x (evalE e r)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s r. \<lbrakk>\<forall>s ss.  s \<approx> ss  \<longrightarrow> evalE e s = evalE e ss;  s \<approx> r \<rbrakk> \<Longrightarrow>  update s x (evalE e r) \<approx> update r x (evalE e r)
[PROOF STEP]
apply (erule_tac x=s in allE, erule_tac x=r in allE, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s r. \<lbrakk> s \<approx> r ; evalE e s = evalE e r\<rbrakk> \<Longrightarrow>  update s x (evalE e r) \<approx> update r x (evalE e r)
[PROOF STEP]
apply (simp add: twiddle_def update_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lang_pow_add: "A ^^ (n + m) = A ^^ n @@ A ^^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ^^ (n + m) = A ^^ n @@ A ^^ m
[PROOF STEP]
by (induct n) (auto simp: conc_assoc)


[STATEMENT]
lemma enat_add1_eq [simp]: "enat x + y = enat x + z \<longleftrightarrow> y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (enat x + y = enat x + z) = (y = z)
[PROOF STEP]
by (metis enat_add_mono add.commute neq_iff)


[STATEMENT]
lemma (in project) lang_eq_ext_Nil_fold_Deriv:
  fixes r s n
  assumes WF: "wf n r" "wf n s"
  defines "\<BB> \<equiv> {(fold lQuot w (lang n r), fold lQuot w (lang n s))| w. w\<in>lists (\<Sigma> n)}"
  shows "lang n r = lang n s \<longleftrightarrow> (\<forall>(K, L) \<in> \<BB>. [] \<in> K \<longleftrightarrow> [] \<in> L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lang n r = lang n s) = (\<forall>(K, L)\<in>\<BB>. ([] \<in> K) = ([] \<in> L))
[PROOF STEP]
unfolding lang_eq_ext[OF WF] \<BB>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>w\<in>lists (\<Sigma> n). (w \<in> lang n r) = (w \<in> lang n s)) = (\<forall>(K, L)\<in>{(fold lQuot w (lang n r), fold lQuot w (lang n s)) |w. w \<in> lists (\<Sigma> n)}. ([] \<in> K) = ([] \<in> L))
[PROOF STEP]
by (subst (1 2) in_fold_lQuot[of "[]", simplified, symmetric]) auto


[STATEMENT]
lemma m_s2_rep: assumes "finite(X)" and "S1 = S2 on -X" and "\<forall>x. S1 x \<le> S2 x" and "S1 \<noteq> S2"
shows "(\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. S1 x \<le> S2 x
[PROOF STEP]
have 1: "\<forall>x\<in>X. m(S1 x) \<ge> m(S2 x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. S1 x \<le> S2 x

goal (1 subgoal):
 1. \<forall>x\<in>X. m (S2 x) \<le> m (S1 x)
[PROOF STEP]
by (simp add: m1)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>X. m (S2 x) \<le> m (S1 x)

goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
from assms(2,3,4)
[PROOF STATE]
proof (chain)
picking this:
S1 = S2 on - X
\<forall>x. S1 x \<le> S2 x
S1 \<noteq> S2
[PROOF STEP]
have "\<exists>x\<in>X. S1 x < S2 x"
[PROOF STATE]
proof (prove)
using this:
S1 = S2 on - X
\<forall>x. S1 x \<le> S2 x
S1 \<noteq> S2

goal (1 subgoal):
 1. \<exists>x\<in>X. S1 x < S2 x
[PROOF STEP]
by(simp add: fun_eq_iff) (metis Compl_iff le_neq_trans)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. S1 x < S2 x

goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
hence 2: "\<exists>x\<in>X. m(S1 x) > m(S2 x)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>X. S1 x < S2 x

goal (1 subgoal):
 1. \<exists>x\<in>X. m (S2 x) < m (S1 x)
[PROOF STEP]
by (metis m2)
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. m (S2 x) < m (S1 x)

goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
from sum_strict_mono_ex1[OF \<open>finite X\<close> 1 2]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
show "(\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))

goal (1 subgoal):
 1. (\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in encoding_wrt_barbs) indRelSTEQ_impl_SRel_and_TRel_preserve_barbs:
  fixes SRel :: "('procS \<times> 'procS) set"
    and TRel :: "('procT \<times> 'procT) set"
  assumes preservation: "rel_preserves_barbs (indRelSTEQ SRel TRel) (STCalWB SWB TWB)"
  shows "rel_preserves_barbs SRel SWB"
    and "rel_preserves_barbs TRel TWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_preserves_binary_pred SRel (\<lambda>a. hasBarb a SWB) &&& rel_preserves_binary_pred TRel (\<lambda>a. hasBarb a TWB)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rel_preserves_binary_pred SRel (\<lambda>a. hasBarb a SWB)
 2. rel_preserves_binary_pred TRel (\<lambda>a. hasBarb a TWB)
[PROOF STEP]
show "rel_preserves_barbs SRel SWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_preserves_binary_pred SRel (\<lambda>a. hasBarb a SWB)
[PROOF STEP]
using preservation rel_with_source_impl_SRel_preserves_barbs[where
                          Rel="indRelSTEQ SRel TRel" and SRel="SRel"]
[PROOF STATE]
proof (prove)
using this:
rel_preserves_binary_pred (indRelSTEQ SRel TRel) (\<lambda>a. hasBarb a (STCalWB SWB TWB))
rel_preserves_binary_pred (indRelSTEQ SRel TRel) (\<lambda>a. hasBarb a (STCalWB SWB TWB)) \<and> (\<forall>S1 S2. (S1, S2) \<in> SRel \<longrightarrow> SourceTerm S1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> SourceTerm S2) \<Longrightarrow> rel_preserves_binary_pred SRel (\<lambda>a. hasBarb a SWB)

goal (1 subgoal):
 1. rel_preserves_binary_pred SRel (\<lambda>a. hasBarb a SWB)
[PROOF STEP]
by (simp add: indRelSTEQ.source)
[PROOF STATE]
proof (state)
this:
rel_preserves_binary_pred SRel (\<lambda>a. hasBarb a SWB)

goal (1 subgoal):
 1. rel_preserves_binary_pred TRel (\<lambda>a. hasBarb a TWB)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_preserves_binary_pred TRel (\<lambda>a. hasBarb a TWB)
[PROOF STEP]
show "rel_preserves_barbs TRel TWB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_preserves_binary_pred TRel (\<lambda>a. hasBarb a TWB)
[PROOF STEP]
using preservation rel_with_target_impl_TRel_preserves_barbs[where
                          Rel="indRelSTEQ SRel TRel" and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
rel_preserves_binary_pred (indRelSTEQ SRel TRel) (\<lambda>a. hasBarb a (STCalWB SWB TWB))
rel_preserves_binary_pred (indRelSTEQ SRel TRel) (\<lambda>a. hasBarb a (STCalWB SWB TWB)) \<and> (\<forall>T1 T2. (T1, T2) \<in> TRel \<longrightarrow> TargetTerm T1 \<sim>\<lbrakk>\<cdot>\<rbrakk><SRel,TRel> TargetTerm T2) \<Longrightarrow> rel_preserves_binary_pred TRel (\<lambda>a. hasBarb a TWB)

goal (1 subgoal):
 1. rel_preserves_binary_pred TRel (\<lambda>a. hasBarb a TWB)
[PROOF STEP]
by (simp add: indRelSTEQ.target)
[PROOF STATE]
proof (state)
this:
rel_preserves_binary_pred TRel (\<lambda>a. hasBarb a TWB)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma empty_eq_union [iff]: "{#} = M + N \<longleftrightarrow> M = {#} \<and> N = {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({#} = M + N) = (M = {#} \<and> N = {#})
[PROOF STEP]
by (auto simp add: multiset_eq_iff)


[STATEMENT]
lemma (in Corps) vals_pos_nonempty:"valuation K v \<Longrightarrow>
                       {x. x \<in> v ` carrier K \<and> 0 < x} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valuation K v \<Longrightarrow> {x \<in> v ` carrier K. 0 < x} \<noteq> {}
[PROOF STEP]
using val_axiom5[of v] value_noninf_nonzero[of v] value_of_inv[THEN sym, of v]
[PROOF STATE]
proof (prove)
using this:
valuation K v \<Longrightarrow> \<exists>x. x \<in> carrier K \<and> v x \<noteq> \<infinity> \<and> v x \<noteq> 0
\<lbrakk>valuation K v; ?x \<in> carrier K; v ?x \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> ?x \<noteq> \<zero>
\<lbrakk>valuation K v; ?x1 \<in> carrier K; ?x1 \<noteq> \<zero>\<rbrakk> \<Longrightarrow> - v ?x1 = v (?x1\<^bsup>\<hyphen> K\<^esup>)

goal (1 subgoal):
 1. valuation K v \<Longrightarrow> {x \<in> v ` carrier K. 0 < x} \<noteq> {}
[PROOF STEP]
by (auto simp: ex_image_cong_iff) (metis Ring.ring_is_ag aGroup.ag_mOp_closed aGroup.ag_pOp_closed aGroup.ag_r_inv1 f_is_ring zero_lt_inf)


[STATEMENT]
lemma pull_up_senior_older_seniors:
  "senior x n = senior y n \<Longrightarrow> older_seniors x n = older_seniors y n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. senior x n = senior y n \<Longrightarrow> older_seniors x n = older_seniors y n
[PROOF STEP]
unfolding older_seniors.simps senior.simps senior_token_run
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the (oldest_token (token_run x n) n) = the (oldest_token (token_run y n) n) \<Longrightarrow> {s. \<exists>y. s = the (oldest_token (token_run y n) n) \<and> s < the (oldest_token (token_run x n) n) \<and> \<not> sink (token_run s n)} = {s. \<exists>ya. s = the (oldest_token (token_run ya n) n) \<and> s < the (oldest_token (token_run y n) n) \<and> \<not> sink (token_run s n)}
[PROOF STEP]
by presburger


[STATEMENT]
lemma "((\<lambda>x::real. (1 + y / x) powr x) \<longlongrightarrow> exp y) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (1 + y / x) powr x) \<longlongrightarrow> exp y) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma pt_ex1_eqvt:
  fixes  pi :: "'x prm"
  and     x :: "'a"
  assumes pt: "pt TYPE('a) TYPE('x)"
  and     at: "at TYPE('x)"
  shows  "(pi\<bullet>(\<exists>!x. P (x::'a))) = (\<exists>!x. pi\<bullet>(P (rev pi\<bullet>x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi \<bullet> (\<exists>!x. P x) = (\<exists>!x. pi \<bullet> P (rev pi \<bullet> x))
[PROOF STEP]
unfolding Ex1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi \<bullet> (\<exists>x. P x \<and> (\<forall>y. P y \<longrightarrow> y = x)) = (\<exists>x. pi \<bullet> P (rev pi \<bullet> x) \<and> (\<forall>y. pi \<bullet> P (rev pi \<bullet> y) \<longrightarrow> y = x))
[PROOF STEP]
by (simp add: pt_ex_eqvt[OF pt at] conj_eqvt pt_all_eqvt[OF pt at]
              imp_eqvt pt_eq_eqvt[OF pt at] pt_pi_rev[OF pt at])


[STATEMENT]
lemma lt_\<omega>_imp_times_minus_right: "m < \<omega> \<Longrightarrow> n < \<omega> \<Longrightarrow> l * (m - n) = l * m - l * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m < \<omega>; n < \<omega>\<rbrakk> \<Longrightarrow> l * (m - n) = l * m - l * n
[PROOF STEP]
by (metis lt_\<omega>_imp_ex_of_nat times_of_nat_minus_right)


[STATEMENT]
lemma continuous_imp_measurable_on_sets_lebesgue:
  assumes f: "continuous_on S f" and S: "S \<in> sets lebesgue"
  shows "f \<in> borel_measurable (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
have "sets (restrict_space borel S) \<subseteq> sets (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (restrict_space borel S) \<subseteq> sets (lebesgue_on S)
[PROOF STEP]
by (simp add: mono_restrict_space subsetI)
[PROOF STATE]
proof (state)
this:
sets (restrict_space borel S) \<subseteq> sets (lebesgue_on S)

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sets (restrict_space borel S) \<subseteq> sets (lebesgue_on S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sets (restrict_space borel S) \<subseteq> sets (lebesgue_on S)

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
by (simp add: borel_measurable_continuous_on_restrict [OF f] borel_measurable_subalgebra
                  space_restrict_space)
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable (lebesgue_on S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linear_order_cases:
    "((x::'a::linear_order) \<sqsubseteq> y \<Longrightarrow> C) \<Longrightarrow> (y \<sqsubseteq> x \<Longrightarrow> C) \<Longrightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> y \<Longrightarrow> C; y \<sqsubseteq> x \<Longrightarrow> C\<rbrakk> \<Longrightarrow> C
[PROOF STEP]
by (insert leq_linear) blast


[STATEMENT]
lemma iIN_iT_Div_Int_mod_0: "
  \<lbrakk> 0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d \<rbrakk> \<Longrightarrow>
  (A \<inter> [n\<dots>,d]) \<oslash> k = (A \<oslash> k) \<inter> ([n\<dots>,d] \<oslash> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d\<rbrakk> \<Longrightarrow> A \<inter> [n\<dots>,d] \<oslash> k = (A \<oslash> k) \<inter> ([n\<dots>,d] \<oslash> k)
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d\<rbrakk> \<Longrightarrow> (x \<in> A \<inter> [n\<dots>,d] \<oslash> k) = (x \<in> (A \<oslash> k) \<inter> ([n\<dots>,d] \<oslash> k))
[PROOF STEP]
apply (simp add: iT_Div_mem_iff Bex_def iIN_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d\<rbrakk> \<Longrightarrow> (\<exists>xa. xa \<in> A \<and> n \<le> xa \<and> xa \<le> n + d \<and> xa div k = x) = ((\<exists>xa. xa \<in> A \<and> xa div k = x) \<and> (\<exists>xa\<ge>n. xa \<le> n + d \<and> xa div k = x))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; \<exists>xa. xa \<in> A \<and> n \<le> xa \<and> xa \<le> n + d \<and> xa div k = x\<rbrakk> \<Longrightarrow> (\<exists>xa. xa \<in> A \<and> xa div k = x) \<and> (\<exists>xa\<ge>n. xa \<le> n + d \<and> xa div k = x)
 2. \<And>x. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; (\<exists>xa. xa \<in> A \<and> xa div k = x) \<and> (\<exists>xa\<ge>n. xa \<le> n + d \<and> xa div k = x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> A \<and> n \<le> xa \<and> xa \<le> n + d \<and> xa div k = x
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; (\<exists>xa. xa \<in> A \<and> xa div k = x) \<and> (\<exists>xa\<ge>n. xa \<le> n + d \<and> xa div k = x)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> A \<and> n \<le> xa \<and> xa \<le> n + d \<and> xa div k = x
[PROOF STEP]
apply (elim conjE exE, rename_tac x1 x2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> A \<and> n \<le> xa \<and> xa \<le> n + d \<and> xa div k = x
[PROOF STEP]
apply (rule_tac x=x1 in exI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x\<rbrakk> \<Longrightarrow> n \<le> x1 \<and> x1 \<le> n + d
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x\<rbrakk> \<Longrightarrow> n \<le> x1
 2. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x\<rbrakk> \<Longrightarrow> x1 \<le> n + d
[PROOF STEP]
apply (rule ccontr, simp add: linorder_not_le)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x; x1 < n\<rbrakk> \<Longrightarrow> False
 2. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x\<rbrakk> \<Longrightarrow> x1 \<le> n + d
[PROOF STEP]
apply (drule_tac m=n and n=x2 and k=k in div_le_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; x2 \<le> n + d; x2 div k = x; x1 < n; n div k \<le> x2 div k\<rbrakk> \<Longrightarrow> False
 2. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x\<rbrakk> \<Longrightarrow> x1 \<le> n + d
[PROOF STEP]
apply (drule_tac a=x1 and m=k in less_mod_0_imp_div_less)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; x2 \<le> n + d; x2 div k = x; n div k \<le> x2 div k\<rbrakk> \<Longrightarrow> n mod k = 0
 2. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; x2 \<le> n + d; x2 div k = x; n div k \<le> x2 div k; x1 div k < n div k\<rbrakk> \<Longrightarrow> False
 3. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x\<rbrakk> \<Longrightarrow> x1 \<le> n + d
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; \<forall>x\<in>A. x div k \<le> (n + d) div k \<longrightarrow> x \<le> n + d; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x\<rbrakk> \<Longrightarrow> x1 \<le> n + d
[PROOF STEP]
apply (drule_tac x=x1 in bspec, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; x1 \<in> A; x1 div k = x; n \<le> x2; x2 \<le> n + d; x2 div k = x; x1 div k \<le> (n + d) div k \<longrightarrow> x1 \<le> n + d\<rbrakk> \<Longrightarrow> x1 \<le> n + d
[PROOF STEP]
apply (drule div_le_mono[of _ "n + d" k])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x1 x2. \<lbrakk>0 < k; n mod k = 0; x1 \<in> A; x1 div k = x; n \<le> x2; x2 div k = x; x1 div k \<le> (n + d) div k \<longrightarrow> x1 \<le> n + d; x2 div k \<le> (n + d) div k\<rbrakk> \<Longrightarrow> x1 \<le> n + d
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lm083:
  assumes "card N > 0" "distinct G"
  shows "winningAllocationsRel N (set G) bids \<subseteq> set (allAllocationsAlg N G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winningAllocationRel N (set G) (\<subseteq>) bids (set (allAllocationsAlg N G))
[PROOF STEP]
using assms winningAllocationPossible allAllocationsBridgingLemma
[PROOF STATE]
proof (prove)
using this:
0 < card N
distinct G
winningAllocationRel ?N ?G (\<subseteq>) ?b (allAllocations ?N ?G)
\<lbrakk>0 < card ?N; distinct ?G\<rbrakk> \<Longrightarrow> allAllocations ?N (set ?G) = set (allAllocationsAlg ?N ?G)

goal (1 subgoal):
 1. winningAllocationRel N (set G) (\<subseteq>) bids (set (allAllocationsAlg N G))
[PROOF STEP]
by (metis(no_types))


[STATEMENT]
lemma Infinitesimal_less_SReal: "x \<in> \<real> \<Longrightarrow> y \<in> Infinitesimal \<Longrightarrow> 0 < x \<Longrightarrow> y < x"
  for x y :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; y \<in> Infinitesimal; 0 < x\<rbrakk> \<Longrightarrow> y < x
[PROOF STEP]
using InfinitesimalD
[PROOF STATE]
proof (prove)
using this:
?x \<in> Infinitesimal \<Longrightarrow> \<forall>r\<in>\<real>. 0 < r \<longrightarrow> hnorm ?x < r

goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; y \<in> Infinitesimal; 0 < x\<rbrakk> \<Longrightarrow> y < x
[PROOF STEP]
by fastforce


[STATEMENT]
lemma finite_subcls1: "finite (subcls1 P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subcls1 P)
[PROOF STEP]
apply(subgoal_tac "subcls1 P = (SIGMA C: {C. is_class P C} .
                     {D. D \<in> baseClasses (fst(the(class P C)))})")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. subcls1 P = (SIGMA C:{C. is_class P C}. {D. D \<in> baseClasses (fst (the (class P C)))}) \<Longrightarrow> finite (subcls1 P)
 2. subcls1 P = (SIGMA C:{C. is_class P C}. {D. D \<in> baseClasses (fst (the (class P C)))})
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. subcls1 P = (SIGMA C:{C. is_class P C}. {D. D \<in> baseClasses (fst (the (class P C)))})
 2. subcls1 P = (SIGMA C:{C. is_class P C}. {D. D \<in> baseClasses (fst (the (class P C)))}) \<Longrightarrow> finite (subcls1 P)
[PROOF STEP]
apply(fastforce simp:is_class_def dest: subcls1D elim: subcls1I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcls1 P = (SIGMA C:{C. is_class P C}. {D. D \<in> baseClasses (fst (the (class P C)))}) \<Longrightarrow> finite (subcls1 P)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcls1 P = (SIGMA C:{C. is_class P C}. baseClasses (fst (the (class P C)))) \<Longrightarrow> finite (SIGMA C:{C. is_class P C}. baseClasses (fst (the (class P C))))
[PROOF STEP]
apply(rule finite_SigmaI [OF finite_is_class])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>C. \<lbrakk>subcls1 P = (SIGMA C:{C. is_class P C}. baseClasses (fst (the (class P C)))); C \<in> {C. is_class P C}\<rbrakk> \<Longrightarrow> finite (baseClasses (fst (the (class P C))))
[PROOF STEP]
apply(rule_tac B = "baseClasses (fst (the (class P C)))" in finite_subset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>C. \<lbrakk>subcls1 P = (SIGMA C:{C. is_class P C}. baseClasses (fst (the (class P C)))); C \<in> {C. is_class P C}\<rbrakk> \<Longrightarrow> baseClasses (fst (the (class P C))) \<subseteq> baseClasses (fst (the (class P C)))
 2. \<And>C. \<lbrakk>subcls1 P = (SIGMA C:{C. is_class P C}. baseClasses (fst (the (class P C)))); C \<in> {C. is_class P C}\<rbrakk> \<Longrightarrow> finite (baseClasses (fst (the (class P C))))
[PROOF STEP]
apply (auto intro:finite_baseClasses simp:is_class_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma round_up_uminus_eq: "round_up p (-x) = - round_down p x"
  and round_down_uminus_eq: "round_down p (-x) = - round_up p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round_up p (- x) = - round_down p x &&& round_down p (- x) = - round_up p x
[PROOF STEP]
by (auto simp: round_up_def round_down_def ceiling_def)


[STATEMENT]
lemma contra_hsubsetD: "\<lbrakk> A \<le> B; c \<notin> B \<rbrakk>  \<Longrightarrow> c \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; c \<notin> B\<rbrakk> \<Longrightarrow> c \<notin> A
[PROOF STEP]
by blast


[STATEMENT]
lemma mono2mono_inf:
  assumes f: "monotone ord (\<le>) (\<lambda>x. f x)"
  and g: "monotone ord (\<le>) (\<lambda>x. g x)"
  shows "monotone ord (\<le>) (\<lambda>x. f x \<sqinter> g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone ord (\<le>) (\<lambda>x. f x \<sqinter> g x)
[PROOF STEP]
by(auto 4 3 dest: monotoneD[OF f] monotoneD[OF g] intro: le_infI1 le_infI2 intro!: monotoneI)


[STATEMENT]
lemma gcd_swap: "gcd m n = gcd n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arith2.gcd m n = Arith2.gcd n m
[PROOF STEP]
apply (simp add: gcd_def cd_swap)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma in_replicate_mset[simp]: "x \<in># replicate_mset n y \<longleftrightarrow> n > 0 \<and> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in># replicate_mset n y) = (0 < n \<and> x = y)
[PROOF STEP]
unfolding replicate_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in># (add_mset y ^^ n) {#}) = (0 < n \<and> x = y)
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma zero_transpose_mat[simp]: "transpose_mat (0\<^sub>m n m) = (0\<^sub>m m n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_mat (0\<^sub>m n m) = 0\<^sub>m m n
[PROOF STEP]
by (rule eq_matI, auto)


[STATEMENT]
lemma mat_mult[simp,intro]: assumes wf1: "mat nr n m1"
  and wf2: "mat n nc m2"
  shows "mat nr nc (mat_multI ze pl ti nr m1 m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat nr nc (mat_multI ze pl ti nr m1 m2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat nr n m1
mat n nc m2

goal (1 subgoal):
 1. mat nr nc (mat_multI ze pl ti nr m1 m2)
[PROOF STEP]
unfolding mat_def mat_multI_def
[PROOF STATE]
proof (prove)
using this:
length m1 = n \<and> Ball (set m1) (vec nr)
length m2 = nc \<and> Ball (set m2) (vec n)

goal (1 subgoal):
 1. length (map (matT_vec_multI ze pl ti (Matrix_Legacy.transpose nr m1)) m2) = nc \<and> Ball (set (map (matT_vec_multI ze pl ti (Matrix_Legacy.transpose nr m1)) m2)) (vec nr)
[PROOF STEP]
by (auto simp: matT_vec_multI[OF transpose[OF wf1]])


[STATEMENT]
lemma subst_term_fv: "fv (subst_term [((x, \<tau>), Fv y \<tau>)] t)
  = (if (x,\<tau>) \<in> fv t then insert (y,\<tau>) else id) (fv t - {(x,\<tau>)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv (subst_term [((x, \<tau>), Fv y \<tau>)] t) = (if (x, \<tau>) \<in> fv t then insert (y, \<tau>) else id) (fv t - {(x, \<tau>)})
[PROOF STEP]
by (induction t) auto


[STATEMENT]
lemma set_Neg_getNeg_subset: "Neg ` set (getNeg x) \<subseteq> set x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Neg ` set (getNeg x) \<subseteq> set x
[PROOF STEP]
apply(induction x rule: getNeg.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. Neg ` set (getNeg []) \<subseteq> set []
 2. \<And>x xs. Neg ` set (getNeg xs) \<subseteq> set xs \<Longrightarrow> Neg ` set (getNeg (Neg x # xs)) \<subseteq> set (Neg x # xs)
 3. \<And>v xs. Neg ` set (getNeg xs) \<subseteq> set xs \<Longrightarrow> Neg ` set (getNeg (Pos v # xs)) \<subseteq> set (Pos v # xs)
[PROOF STEP]
apply(simp_all)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs. Neg ` set (getNeg xs) \<subseteq> set xs \<Longrightarrow> Neg ` set (getNeg xs) \<subseteq> insert (Neg x) (set xs)
 2. \<And>v xs. Neg ` set (getNeg xs) \<subseteq> set xs \<Longrightarrow> Neg ` set (getNeg xs) \<subseteq> insert (Pos v) (set xs)
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dual_blocks_points_index_inter:
  assumes "i1 < \<b>" "i2 < \<b>"
  shows "(mset \<B>s*) index {i1, i2} = (\<B>s ! i1) |\<inter>| (\<B>s ! i2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2
[PROOF STEP]
have "(mset \<B>s*) index {i1, i2} = mat_point_index (ordered_dual_sys.N) {i1, i2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = mat_point_index ordered_dual_sys.N {i1, i2}
[PROOF STEP]
using assms(1) assms(2) blocks_list_length ord_dual_blocks_v ordered_dual_sys.dim_row_is_v
      ordered_dual_sys.incidence_mat_two_index ordered_dual_sys.mat_ord_inc_sys_point
[PROOF STATE]
proof (prove)
using this:
i1 < \<b>
i2 < \<b>
length \<B>s = \<b>
ordered_dual_sys.\<v> = \<b>
dim_row ordered_dual_sys.N = ordered_dual_sys.\<v>
\<lbrakk>?i1.0 < ordered_dual_sys.\<v>; ?i2.0 < ordered_dual_sys.\<v>\<rbrakk> \<Longrightarrow> mat_point_index ordered_dual_sys.N {?i1.0, ?i2.0} = ordered_dual_sys.\<B> index {[0..<length \<B>s] ! ?i1.0, [0..<length \<B>s] ! ?i2.0}
?x < dim_row ordered_dual_sys.N \<Longrightarrow> [0..<dim_row ordered_dual_sys.N] ! ?x = ?x

goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = mat_point_index ordered_dual_sys.N {i1, i2}
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
ordered_dual_sys.\<B> index {i1, i2} = mat_point_index ordered_dual_sys.N {i1, i2}

goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ordered_dual_sys.\<B> index {i1, i2} = mat_point_index ordered_dual_sys.N {i1, i2}

goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2
[PROOF STEP]
have "... = mat_inter_num N i1 i2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_point_index ordered_dual_sys.N {i1, i2} = mat_inter_num N i1 i2
[PROOF STEP]
using dual_incidence_mat_eq_trans trans_mat_point_index_inter_sym(1)
[PROOF STATE]
proof (prove)
using this:
ordered_dual_sys.N = N\<^sup>T
\<lbrakk>?i1.0 < dim_row ?M; ?i2.0 < dim_row ?M\<rbrakk> \<Longrightarrow> mat_point_index ?M {?i1.0, ?i2.0} = mat_inter_num ?M\<^sup>T ?i1.0 ?i2.0

goal (1 subgoal):
 1. mat_point_index ordered_dual_sys.N {i1, i2} = mat_inter_num N i1 i2
[PROOF STEP]
by (metis assms(1) assms(2) dual_incidence_mat_eq_trans_rev ord_dual_blocks_v ordered_dual_sys.dim_row_is_v)
[PROOF STATE]
proof (state)
this:
mat_point_index ordered_dual_sys.N {i1, i2} = mat_inter_num N i1 i2

goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ordered_dual_sys.\<B> index {i1, i2} = mat_inter_num N i1 i2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ordered_dual_sys.\<B> index {i1, i2} = mat_inter_num N i1 i2

goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2
[PROOF STEP]
using mat_inter_num_conv
[PROOF STATE]
proof (prove)
using this:
ordered_dual_sys.\<B> index {i1, i2} = mat_inter_num N i1 i2
\<lbrakk>?j1.0 < dim_col N; ?j2.0 < dim_col N\<rbrakk> \<Longrightarrow> \<B>s ! ?j1.0 |\<inter>| \<B>s ! ?j2.0 = mat_inter_num N ?j1.0 ?j2.0

goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2
[PROOF STEP]
using assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
ordered_dual_sys.\<B> index {i1, i2} = mat_inter_num N i1 i2
\<lbrakk>?j1.0 < dim_col N; ?j2.0 < dim_col N\<rbrakk> \<Longrightarrow> \<B>s ! ?j1.0 |\<inter>| \<B>s ! ?j2.0 = mat_inter_num N ?j1.0 ?j2.0
i1 < \<b>
i2 < \<b>

goal (1 subgoal):
 1. ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ordered_dual_sys.\<B> index {i1, i2} = \<B>s ! i1 |\<inter>| \<B>s ! i2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in is_functor) cf_universal_arrow_fo_is_iso_arr:
  assumes "universal_arrow_fo \<FF> c r u"
    and "universal_arrow_fo \<FF> c r' u'"
    and "f : r' \<mapsto>\<^bsub>\<AA>\<^esub> r"
    and "u' = umap_fo \<FF> c r u r'\<lparr>ArrVal\<rparr>\<lparr>f\<rparr>"
  shows "f : r' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<AA>\<^esub> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f : r' \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<AA>\<^esub> r
[PROOF STEP]
by
    (
      rule
        is_functor.cf_universal_arrow_of_is_iso_arr[
          OF is_functor_op, unfolded cat_op_simps, OF assms
          ]
    )


[STATEMENT]
lemma mat_base_case:
  shows "matrix_A [[1],[-1]] [[],[0]] = (mat_of_rows_list 2 [[1, 1], [1, -1]])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_mat [[1], [- 1]] [[], [0]] = mat_of_rows_list 2 [[1, 1], [1, - 1]]
[PROOF STEP]
unfolding matrix_A_def mtx_row_def z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows_list (length [[1], [- 1]]) (map (\<lambda>index_list. map (\<lambda>sign_asg. prod_list (map ((!) sign_asg) index_list)) [[1], [- 1]]) [[], [0]]) = mat_of_rows_list 2 [[1, 1], [1, - 1]]
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows_list (Suc (Suc 0)) [[1, 1], [1, - 1]] = mat_of_rows_list 2 [[1, 1], [1, - 1]]
[PROOF STEP]
by (simp add: numeral_2_eq_2)


[STATEMENT]
lemma midpoint__coplanar:
  assumes "A Midpoint B C"
  shows "Coplanar A B C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
using assms midpoint_col ncop__ncol
[PROOF STATE]
proof (prove)
using this:
A Midpoint B C
?M Midpoint ?A ?B \<Longrightarrow> Col ?M ?A ?B
\<not> Coplanar ?A ?B ?C ?D \<Longrightarrow> \<not> Col ?A ?B ?C

goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
by blast


[STATEMENT]
lemma card_of_rec_disjointify:
"card (rec_disjointify m f) \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (rec_disjointify m f) \<le> m
[PROOF STEP]
apply(induction m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. card (rec_disjointify 0 f) \<le> 0
 2. \<And>m. card (rec_disjointify m f) \<le> m \<Longrightarrow> card (rec_disjointify (Suc m) f) \<le> Suc m
[PROOF STEP]
unfolding rec_disjointify.simps
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. card {} \<le> 0
 2. \<And>m. card (rec_disjointify m f) \<le> m \<Longrightarrow> card (insert (f m - \<Union> (rec_disjointify m f)) (rec_disjointify m f)) \<le> Suc m
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. card (rec_disjointify m f) \<le> m \<Longrightarrow> card (insert (f m - \<Union> (rec_disjointify m f)) (rec_disjointify m f)) \<le> Suc m
[PROOF STEP]
by (metis Suc_le_mono card.infinite card_insert_disjoint finite_insert insert_absorb le_SucI)


[STATEMENT]
lemma conc_partitions_intro:
  assumes "(u, v) \<in> Partitions x \<and> u \<in> A \<and>  v \<in> B"
  shows "x \<in> A \<cdot> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<cdot> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> Partitions x \<and> u \<in> A \<and> v \<in> B

goal (1 subgoal):
 1. x \<in> A \<cdot> B
[PROOF STEP]
unfolding conc_def Partitions_def
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> {(x\<^sub>p, x\<^sub>s). x\<^sub>p @ x\<^sub>s = x} \<and> u \<in> A \<and> v \<in> B

goal (1 subgoal):
 1. x \<in> {xs @ ys |xs ys. xs \<in> A \<and> ys \<in> B}
[PROOF STEP]
by auto


[STATEMENT]
lemma Pi'_eq_empty[simp]:
  assumes "finite A" shows "(Pi' A B) = {} \<longleftrightarrow> (\<exists>x\<in>A. B x = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Pi' A B = {}) = (\<exists>x\<in>A. B x = {})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (Pi' A B = {}) = (\<exists>x\<in>A. B x = {})
[PROOF STEP]
apply (simp add: Pi'_def, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; \<forall>x. domain x = A \<longrightarrow> (\<exists>i. i \<in> A \<and> (x)\<^sub>F i \<notin> B i)\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. B x = {}
[PROOF STEP]
apply (drule_tac x = "finmap_of A (\<lambda>u. SOME y. y \<in> B u)" in spec, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>finite A; i \<in> A; (SOME y. y \<in> B i) \<notin> B i\<rbrakk> \<Longrightarrow> \<exists>x\<in>A. B x = {}
[PROOF STEP]
apply (cut_tac P= "%y. y \<in> B i" in some_eq_ex, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Suc_0_xor_eq:
  \<open>Suc 0 XOR n = n + of_bool (even n) - of_bool (odd n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 XOR n = n + of_bool (even n) - of_bool (odd n)
[PROOF STEP]
using one_xor_eq [of n]
[PROOF STATE]
proof (prove)
using this:
1 XOR n = n + of_bool (even n) - of_bool (odd n)

goal (1 subgoal):
 1. Suc 0 XOR n = n + of_bool (even n) - of_bool (odd n)
[PROOF STEP]
by simp


[STATEMENT]
lemma sets_eq_impl_correct_aux1:
    assumes A: "(pn', pn) \<in> pnet_rel"
    assumes WF: "well_formed_pn pn"

    assumes F: "finite ((Graph.E (pn_c (pnet_\<alpha> pn')))\<^sup>* `` {s})"
    shows "sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s))
      \<longleftrightarrow> pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
(pn', pn) \<in> pnet_rel
[PROOF STEP]
have S1i: "(pn_V' pn', pn_V pn) \<in> br ahs.\<alpha> ahs.invar"
[PROOF STATE]
proof (prove)
using this:
(pn', pn) \<in> pnet_rel

goal (1 subgoal):
 1. (pn_V' pn', pn_V pn) \<in> br ahs.\<alpha> ahs.invar
[PROOF STEP]
unfolding pnet_rel_def br_def pnet_\<alpha>_def
[PROOF STATE]
proof (prove)
using this:
(pn', pn) \<in> {(c, a). a = \<lparr>pn_c = (the_default 0 \<circ>\<circ>\<circ> map_op_\<alpha>) ahm_ops (pn_c' c), pn_V = ahs.\<alpha> (pn_V' c), pn_succ = (the_default [] \<circ>\<circ>\<circ> map_op_\<alpha>) ahm_ops (pn_succ' c), pn_pred = (the_default [] \<circ>\<circ>\<circ> map_op_\<alpha>) ahm_ops (pn_pred' c), pn_adjmap = (the_default [] \<circ>\<circ>\<circ> map_op_\<alpha>) ahm_ops (pn_adjmap' c), pn_s_node = pn_s_node' c, pn_t_node = pn_t_node' c\<rparr> \<and> True}

goal (1 subgoal):
 1. (pn_V' pn', pn_V pn) \<in> {(c, a). a = ahs.\<alpha> c \<and> ahs.invar c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(pn_V' pn', pn_V pn) \<in> br ahs.\<alpha> ahs.invar

goal (1 subgoal):
 1. sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
note GI = graph_of_impl_correct[OF WF A]
[PROOF STATE]
proof (state)
this:
(graph_of_impl pn' ?s, graph_of pn ?s) \<in> \<langle>unit_rel, nat_rel\<rangle>g_impl_rel_ext

goal (1 subgoal):
 1. sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
have G: "graph (graph_of pn s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph (graph_of pn s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
graph (graph_of pn s)

goal (1 subgoal):
 1. sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
have F': "finite ((g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
using F A
[PROOF STATE]
proof (prove)
using this:
finite ((Graph.E (pn_c (pnet_\<alpha> pn')))\<^sup>* `` {s})
(pn', pn) \<in> pnet_rel

goal (1 subgoal):
 1. finite ((g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
by (simp add: graph_of_def pnet_\<alpha>_def pnet_rel_def br_def)
[PROOF STATE]
proof (state)
this:
finite ((g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))

goal (1 subgoal):
 1. sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
note S2i = reachable_impl.refine[simplified, OF F' G GI]
[PROOF STATE]
proof (state)
this:
(reachable_impl (graph_of_impl pn' s), (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s)) \<in> \<langle>nat_rel\<rangle>ahs_rel bounded_hashcode_nat

goal (1 subgoal):
 1. sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
from sets_eq_impl.refine[simplified, OF S1i S2i]
[PROOF STATE]
proof (chain)
picking this:
sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))

goal (1 subgoal):
 1. sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sets_eq_impl (pn_V' pn') (reachable_impl (graph_of_impl pn' s)) = (pn_V pn = (g_E (graph_of pn s))\<^sup>* `` g_V0 (graph_of pn s))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disj_matrices_add_le_x: "disj_matrices A B \<Longrightarrow> disj_matrices B C \<Longrightarrow>
  (B + A <= C) = (A <= C &  (B::('a::lattice_ab_group_add) matrix) <= 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>disj_matrices A B; disj_matrices B C\<rbrakk> \<Longrightarrow> (B + A \<le> C) = (A \<le> C \<and> B \<le> 0)
[PROOF STEP]
by (auto simp add: disj_matrices_add[of B A 0 C,simplified] disj_matrices_commute)


[STATEMENT]
lemma SReal_dense: "x \<in> \<real> \<Longrightarrow> y \<in> \<real> \<Longrightarrow> x < y \<Longrightarrow> \<exists>r \<in> Reals. x < r \<and> r < y"
  for x y :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; y \<in> \<real>; x < y\<rbrakk> \<Longrightarrow> \<exists>r\<in>\<real>. x < r \<and> r < y
[PROOF STEP]
using dense
[PROOF STATE]
proof (prove)
using this:
?x < ?y \<Longrightarrow> \<exists>z>?x. z < ?y

goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; y \<in> \<real>; x < y\<rbrakk> \<Longrightarrow> \<exists>r\<in>\<real>. x < r \<and> r < y
[PROOF STEP]
by (fastforce simp add: SReal_def)


[STATEMENT]
lemma fundef_ex1_eqvt_at:
  fixes x::"'a::pt"
  assumes f_def: "f == (\<lambda>x::'a. THE_default (d x) (G x))"
  assumes eqvt: "eqvt G"
  assumes ex1: "\<exists>!y. G x y"
  shows "eqvt_at f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqvt_at f x
[PROOF STEP]
unfolding eqvt_at_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p. p \<bullet> f x = f (p \<bullet> x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<equiv> \<lambda>x. THE_default (d x) (G x)
eqvt G
\<exists>!y. G x y

goal (1 subgoal):
 1. \<forall>p. p \<bullet> f x = f (p \<bullet> x)
[PROOF STEP]
by (auto intro: fundef_ex1_eqvt)


[STATEMENT]
lemma poincare_section_rep1:
  "{(7::real, -3::real, -3::real, -10::real)..(7, 3, 3, 10)} = {eucl_of_list [7, -3, -3, -10]..eucl_of_list [7, 3, 3, 10]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(7, - 3, - 3, - 10)..(7, 3, 3, 10)} = {eucl_of_list [7, - 3, - 3, - 10]..eucl_of_list [7, 3, 3, 10]}
[PROOF STEP]
by (auto simp: eucl_of_list_prod)


[STATEMENT]
lemma finite_closed_segment [simp]: "finite(closed_segment a b) \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (closed_segment a b) = (a = b)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (closed_segment a b) \<Longrightarrow> a = b
[PROOF STEP]
apply (rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (closed_segment a b); a \<noteq> b\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add: segment_image_interval)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0..1}); a \<noteq> b\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using infinite_Icc [OF zero_less_one] finite_imageD [OF _ inj_segment]
[PROOF STATE]
proof (prove)
using this:
infinite {0::?'a2..1::?'a2}
\<lbrakk>finite ((\<lambda>u. (1 - u) *\<^sub>R ?a1 + u *\<^sub>R ?b1) ` ?A); ?a1 \<noteq> ?b1\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. \<lbrakk>finite ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0..1}); a \<noteq> b\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma maxsimpchain_in_subcomplex:
  "\<lbrakk> Subcomplex Y; set ys \<subseteq> Y; maxsimpchain ys \<rbrakk> \<Longrightarrow>
    SimplicialComplex.maxsimpchain Y ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Subcomplex Y; set ys \<subseteq> Y; maxsimpchain ys\<rbrakk> \<Longrightarrow> SimplicialComplex.maxsimpchain Y ys
[PROOF STEP]
using maxsimpchain_def max_in_subcomplex
        SimplicialComplex.maxsimpchain_def
[PROOF STATE]
proof (prove)
using this:
maxsimpchain ?xs \<equiv> Ball (set ?xs) maxsimp \<and> adjacentchain ?xs
\<lbrakk>Subcomplex ?Y; ?y \<in> ?Y; maxsimp ?y\<rbrakk> \<Longrightarrow> SimplicialComplex.maxsimp ?Y ?y
SimplicialComplex ?X \<Longrightarrow> SimplicialComplex.maxsimpchain ?X ?xs \<equiv> (\<forall>x\<in>set ?xs. SimplicialComplex.maxsimp ?X x) \<and> adjacentchain ?xs

goal (1 subgoal):
 1. \<lbrakk>Subcomplex Y; set ys \<subseteq> Y; maxsimpchain ys\<rbrakk> \<Longrightarrow> SimplicialComplex.maxsimpchain Y ys
[PROOF STEP]
by    force


[STATEMENT]
lemma power_inductl: "z + x \<cdot> y \<le> y \<Longrightarrow> (x ^ n) \<cdot> z \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z + x \<cdot> y \<le> y \<Longrightarrow> x ^ n \<cdot> z \<le> y
[PROOF STEP]
by(induct n, auto, metis mult.assoc mult_isol order_trans)


[STATEMENT]
lemma INFM_disj_distrib: "(\<exists>\<^sub>\<infinity>x. P x \<or> Q x) \<longleftrightarrow> (\<exists>\<^sub>\<infinity>x. P x) \<or> (\<exists>\<^sub>\<infinity>x. Q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>x. P x \<or> Q x) = ((\<exists>\<^sub>\<infinity>x. P x) \<or> (\<exists>\<^sub>\<infinity>x. Q x))
[PROOF STEP]
by (fact frequently_disj_iff)


[STATEMENT]
lemma in_steps_append[iff]:
  "(p,r) : steps A (v@w) = ((p,r) : (steps A v O steps A w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((p, r) \<in> steps A (v @ w)) = ((p, r) \<in> steps A v O steps A w)
[PROOF STEP]
apply(rule steps_append[THEN equalityE])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>steps ?A1 (?v1 @ ?w1) \<subseteq> steps ?A1 ?v1 O steps ?A1 ?w1; steps ?A1 ?v1 O steps ?A1 ?w1 \<subseteq> steps ?A1 (?v1 @ ?w1)\<rbrakk> \<Longrightarrow> ((p, r) \<in> steps A (v @ w)) = ((p, r) \<in> steps A v O steps A w)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_integrable_abs_iff:
  fixes f :: "_ \<Rightarrow> real"
  shows "set_borel_measurable M A f \<Longrightarrow> set_integrable M A (\<lambda>x. \<bar>f x\<bar>) = set_integrable M A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_borel_measurable M A f \<Longrightarrow> set_integrable M A (\<lambda>x. \<bar>f x\<bar>) = set_integrable M A f
[PROOF STEP]
unfolding set_integrable_def set_borel_measurable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. indicat_real A x *\<^sub>R f x) \<in> borel_measurable M \<Longrightarrow> integrable M (\<lambda>x. indicat_real A x *\<^sub>R \<bar>f x\<bar>) = integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x)
[PROOF STEP]
by (subst (2) integrable_abs_iff[symmetric]) (simp_all add: abs_mult ac_simps)


[STATEMENT]
lemma total_implies_local:
  "ordering f ord X \<Longrightarrow> local_ordering f ord X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. TernaryOrdering.ordering f ord X \<Longrightarrow> local_ordering f ord X
[PROOF STEP]
unfolding ordering_def local_ordering_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. (finite X \<longrightarrow> n < card X) \<longrightarrow> f n \<in> X) \<and> (\<forall>x\<in>X. \<exists>n. (finite X \<longrightarrow> n < card X) \<and> f n = x) \<and> (\<forall>n n' n''. (finite X \<longrightarrow> n'' < card X) \<and> n < n' \<and> n' < n'' \<longrightarrow> ord (f n) (f n') (f n'')) \<Longrightarrow> (\<forall>n. (finite X \<longrightarrow> n < card X) \<longrightarrow> f n \<in> X) \<and> (\<forall>x\<in>X. \<exists>n. (finite X \<longrightarrow> n < card X) \<and> f n = x) \<and> (\<forall>n. (finite X \<longrightarrow> Suc (Suc n) < card X) \<longrightarrow> ord (f n) (f (Suc n)) (f (Suc (Suc n))))
[PROOF STEP]
using lessI
[PROOF STATE]
proof (prove)
using this:
?n < Suc ?n

goal (1 subgoal):
 1. (\<forall>n. (finite X \<longrightarrow> n < card X) \<longrightarrow> f n \<in> X) \<and> (\<forall>x\<in>X. \<exists>n. (finite X \<longrightarrow> n < card X) \<and> f n = x) \<and> (\<forall>n n' n''. (finite X \<longrightarrow> n'' < card X) \<and> n < n' \<and> n' < n'' \<longrightarrow> ord (f n) (f n') (f n'')) \<Longrightarrow> (\<forall>n. (finite X \<longrightarrow> n < card X) \<longrightarrow> f n \<in> X) \<and> (\<forall>x\<in>X. \<exists>n. (finite X \<longrightarrow> n < card X) \<and> f n = x) \<and> (\<forall>n. (finite X \<longrightarrow> Suc (Suc n) < card X) \<longrightarrow> ord (f n) (f (Suc n)) (f (Suc (Suc n))))
[PROOF STEP]
by presburger


[STATEMENT]
lemma left_inverse_linear:
  assumes lf: "linear scale scale f"
    and gf: "g \<circ> f = id"
  shows "linear scale scale g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
from gf
[PROOF STATE]
proof (chain)
picking this:
g \<circ> f = id
[PROOF STEP]
have fi: "inj f"
[PROOF STATE]
proof (prove)
using this:
g \<circ> f = id

goal (1 subgoal):
 1. inj f
[PROOF STEP]
by (auto simp add: inj_on_def o_def id_def fun_eq_iff) metis
[PROOF STATE]
proof (state)
this:
inj f

goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
interpret finite_dimensional_vector_space_pair scale Basis scale Basis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_dimensional_vector_space_pair (*s) Basis (*s) Basis
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
from linear_injective_isomorphism[OF lf fi]
[PROOF STATE]
proof (chain)
picking this:
dim UNIV = dim UNIV \<Longrightarrow> \<exists>f'. linear (*s) (*s) f' \<and> (\<forall>x. f' (f x) = x) \<and> (\<forall>x. f (f' x) = x)
[PROOF STEP]
obtain h :: "'b \<Rightarrow> 'b" where "linear scale scale h" and h: "\<forall>x. h (f x) = x" "\<forall>x. f (h x) = x"
[PROOF STATE]
proof (prove)
using this:
dim UNIV = dim UNIV \<Longrightarrow> \<exists>f'. linear (*s) (*s) f' \<and> (\<forall>x. f' (f x) = x) \<and> (\<forall>x. f (f' x) = x)

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>linear (*s) (*s) h; \<forall>x. h (f x) = x; \<forall>x. f (h x) = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
linear (*s) (*s) h
\<forall>x. h (f x) = x
\<forall>x. f (h x) = x

goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
have "h = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h = g
[PROOF STEP]
by (metis gf h isomorphism_expand left_right_inverse_eq)
[PROOF STATE]
proof (state)
this:
h = g

goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
with \<open>linear scale scale h\<close>
[PROOF STATE]
proof (chain)
picking this:
linear (*s) (*s) h
h = g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
linear (*s) (*s) h
h = g

goal (1 subgoal):
 1. linear (*s) (*s) g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
linear (*s) (*s) g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mpoly_eq_iff: "p = q \<longleftrightarrow> (\<forall>m. MPoly_Type.coeff p m = MPoly_Type.coeff q m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p = q) = (\<forall>m. MPoly_Type.coeff p m = MPoly_Type.coeff q m)
[PROOF STEP]
by transfer (auto simp: poly_mapping_eqI)


[STATEMENT]
lemma subspace_diff: "subspace S \<Longrightarrow> x \<in> S \<Longrightarrow> y \<in> S \<Longrightarrow> x - y \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subspace S; x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x - y \<in> S
[PROOF STEP]
by (metis diff_conv_add_uminus subspace_add subspace_neg)


[STATEMENT]
lemma arith_prog_altdef: "arith_prog a b = range (\<lambda>n. a + int b * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arith_prog a b = range (\<lambda>n. a + int b * n)
[PROOF STEP]
proof (cases "b = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b = 0 \<Longrightarrow> arith_prog a b = range (\<lambda>n. a + int b * n)
 2. b \<noteq> 0 \<Longrightarrow> arith_prog a b = range (\<lambda>n. a + int b * n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
b \<noteq> 0

goal (2 subgoals):
 1. b = 0 \<Longrightarrow> arith_prog a b = range (\<lambda>n. a + int b * n)
 2. b \<noteq> 0 \<Longrightarrow> arith_prog a b = range (\<lambda>n. a + int b * n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0

goal (1 subgoal):
 1. arith_prog a b = range (\<lambda>n. a + int b * n)
[PROOF STEP]
using bij_betw_arith_prog[of b]
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0
0 < b \<Longrightarrow> bij_betw (\<lambda>n. ?a + int b * n) UNIV (arith_prog ?a b)

goal (1 subgoal):
 1. arith_prog a b = range (\<lambda>n. a + int b * n)
[PROOF STEP]
by (auto simp: bij_betw_def)
[PROOF STATE]
proof (state)
this:
arith_prog a b = range (\<lambda>n. a + int b * n)

goal (1 subgoal):
 1. b = 0 \<Longrightarrow> arith_prog a b = range (\<lambda>n. a + int b * n)
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in domain) univ_poly_carrier_units_incl:
  shows "Units ((carrier R) [X]) \<subseteq> { [ k ] | k. k \<in> carrier R - { \<zero> } }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Units (poly_ring R) \<subseteq> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
assume "p \<in> Units ((carrier R) [X])"
[PROOF STATE]
proof (state)
this:
p \<in> Units (poly_ring R)

goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> Units (poly_ring R)
[PROOF STEP]
obtain q
    where p: "polynomial (carrier R) p" and q: "polynomial (carrier R) q" and pq: "poly_mult p q = [ \<one> ]"
[PROOF STATE]
proof (prove)
using this:
p \<in> Units (poly_ring R)

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>polynomial (carrier R) p; polynomial (carrier R) q; poly_mult p q = [\<one>]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Units_def univ_poly_def
[PROOF STATE]
proof (prove)
using this:
p \<in> {y \<in> carrier \<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>. \<exists>x\<in>carrier \<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>. x \<otimes>\<^bsub>\<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>\<^esub> y = \<one>\<^bsub>\<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>\<^esub> \<and> y \<otimes>\<^bsub>\<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>\<^esub>}

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>polynomial (carrier R) p; polynomial (carrier R) q; poly_mult p q = [\<one>]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
polynomial (carrier R) p
polynomial (carrier R) q
poly_mult p q = [\<one>]

goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
hence not_nil: "p \<noteq> []" and "q \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
polynomial (carrier R) p
polynomial (carrier R) q
poly_mult p q = [\<one>]

goal (1 subgoal):
 1. p \<noteq> [] &&& q \<noteq> []
[PROOF STEP]
using poly_mult_integral[OF carrier_is_subring p q] poly_mult_zero[OF polynomial_incl[OF p]]
[PROOF STATE]
proof (prove)
using this:
polynomial (carrier R) p
polynomial (carrier R) q
poly_mult p q = [\<one>]
poly_mult p q = [] \<Longrightarrow> p = [] \<or> q = []
poly_mult [] p = []
poly_mult p [] = []

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

goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
hence "degree p = 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> []
q \<noteq> []

goal (1 subgoal):
 1. degree p = 0
[PROOF STEP]
using poly_mult_degree_eq[OF carrier_is_subring p q]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> []
q \<noteq> []
degree (poly_mult p q) = (if p = [] \<or> q = [] then 0 else degree p + degree q)

goal (1 subgoal):
 1. degree p = 0
[PROOF STEP]
unfolding pq
[PROOF STATE]
proof (prove)
using this:
p \<noteq> []
q \<noteq> []
degree [\<one>] = (if p = [] \<or> q = [] then 0 else degree p + degree q)

goal (1 subgoal):
 1. degree p = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree p = 0

goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
hence "length p = 1"
[PROOF STATE]
proof (prove)
using this:
degree p = 0

goal (1 subgoal):
 1. length p = 1
[PROOF STEP]
using not_nil
[PROOF STATE]
proof (prove)
using this:
degree p = 0
p \<noteq> []

goal (1 subgoal):
 1. length p = 1
[PROOF STEP]
by (metis One_nat_def Suc_pred length_greater_0_conv)
[PROOF STATE]
proof (state)
this:
length p = 1

goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length p = 1
[PROOF STEP]
obtain k where k: "p = [ k ]"
[PROOF STATE]
proof (prove)
using this:
length p = 1

goal (1 subgoal):
 1. (\<And>k. p = [k] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis One_nat_def length_0_conv length_Suc_conv)
[PROOF STATE]
proof (state)
this:
p = [k]

goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
hence "k \<in> carrier R - { \<zero> }"
[PROOF STATE]
proof (prove)
using this:
p = [k]

goal (1 subgoal):
 1. k \<in> carrier R - {\<zero>}
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
p = [k]
polynomial (carrier R) p

goal (1 subgoal):
 1. k \<in> carrier R - {\<zero>}
[PROOF STEP]
unfolding polynomial_def
[PROOF STATE]
proof (prove)
using this:
p = [k]
p = [] \<or> set p \<subseteq> carrier R \<and> lead_coeff p \<noteq> \<zero>

goal (1 subgoal):
 1. k \<in> carrier R - {\<zero>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<in> carrier R - {\<zero>}

goal (1 subgoal):
 1. \<And>x. x \<in> Units (poly_ring R) \<Longrightarrow> x \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
thus "p \<in> { [ k ] | k. k \<in> carrier R - { \<zero> } }"
[PROOF STATE]
proof (prove)
using this:
k \<in> carrier R - {\<zero>}

goal (1 subgoal):
 1. p \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
unfolding k
[PROOF STATE]
proof (prove)
using this:
k \<in> carrier R - {\<zero>}

goal (1 subgoal):
 1. [k] \<in> {[k] |k. k \<in> carrier R - {\<zero>}}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<in> {[k] |k. k \<in> carrier R - {\<zero>}}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_cblinfun_of_matrix:
  assumes "\<And>i j. i \<in> CBasis \<Longrightarrow> j \<in> CBasis \<Longrightarrow> ((\<lambda>n. b n i j) \<longlongrightarrow> a i j) F"
  shows "((\<lambda>n. cblinfun_of_matrix (b n)) \<longlongrightarrow> cblinfun_of_matrix a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>n. cblinfun_of_matrix (b n)) \<longlongrightarrow> cblinfun_of_matrix a) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>n. cblinfun_of_matrix (b n)) \<longlongrightarrow> cblinfun_of_matrix a) F
[PROOF STEP]
have "\<And>i j. i \<in> CBasis \<Longrightarrow> j \<in> CBasis \<Longrightarrow> Zfun (\<lambda>x. norm (b x i j - a i j)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i \<in> CBasis; j \<in> CBasis\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. cmod (b x i j - a i j)) F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> CBasis; ?j \<in> CBasis\<rbrakk> \<Longrightarrow> ((\<lambda>n. b n ?i ?j) \<longlongrightarrow> a ?i ?j) F

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i \<in> CBasis; j \<in> CBasis\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. cmod (b x i j - a i j)) F
[PROOF STEP]
unfolding tendsto_Zfun_iff Zfun_norm_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> CBasis; ?j \<in> CBasis\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. b x ?i ?j - a ?i ?j) F

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i \<in> CBasis; j \<in> CBasis\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. b x i j - a i j) F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i \<in> CBasis; ?j \<in> CBasis\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. cmod (b x ?i ?j - a ?i ?j)) F

goal (1 subgoal):
 1. ((\<lambda>n. cblinfun_of_matrix (b n)) \<longlongrightarrow> cblinfun_of_matrix a) F
[PROOF STEP]
hence "Zfun (\<lambda>x. (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. cmod (b x i j - a i j))) F"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> CBasis; ?j \<in> CBasis\<rbrakk> \<Longrightarrow> Zfun (\<lambda>x. cmod (b x ?i ?j - a ?i ?j)) F

goal (1 subgoal):
 1. Zfun (\<lambda>x. \<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. cmod (b x i j - a i j)) F
[PROOF STEP]
by (auto intro!: Zfun_sum)
[PROOF STATE]
proof (state)
this:
Zfun (\<lambda>x. \<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. cmod (b x i j - a i j)) F

goal (1 subgoal):
 1. ((\<lambda>n. cblinfun_of_matrix (b n)) \<longlongrightarrow> cblinfun_of_matrix a) F
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Zfun (\<lambda>x. \<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. cmod (b x i j - a i j)) F

goal (1 subgoal):
 1. ((\<lambda>n. cblinfun_of_matrix (b n)) \<longlongrightarrow> cblinfun_of_matrix a) F
[PROOF STEP]
unfolding tendsto_Zfun_iff cblinfun_of_matrix_minus
[PROOF STATE]
proof (prove)
using this:
Zfun (\<lambda>x. \<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. cmod (b x i j - a i j)) F

goal (1 subgoal):
 1. Zfun (\<lambda>x. cblinfun_of_matrix (b x - a)) F
[PROOF STEP]
by (rule Zfun_le) (auto intro!: order_trans[OF norm_cblinfun_of_matrix])
[PROOF STATE]
proof (state)
this:
((\<lambda>n. cblinfun_of_matrix (b n)) \<longlongrightarrow> cblinfun_of_matrix a) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) cyclic_group_generated:
  "cyclic_group (subgroup_generated G {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cyclic_group (subgroup_generated G {x})
[PROOF STEP]
using group.cyclic_group_alt group_subgroup_generated subgroup_generated2
[PROOF STATE]
proof (prove)
using this:
Group.group ?G \<Longrightarrow> cyclic_group ?G = (\<exists>x. subgroup_generated ?G {x} = ?G)
Group.group (subgroup_generated G ?S)
subgroup_generated (subgroup_generated G ?S) ?S = subgroup_generated G ?S

goal (1 subgoal):
 1. cyclic_group (subgroup_generated G {x})
[PROOF STEP]
by blast


[STATEMENT]
lemma le_epred[iff]: "l < epred k \<longleftrightarrow> eSuc l < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l < epred k) = (eSuc l < k)
[PROOF STEP]
by (metis eSuc_le_iff epred_eSuc epred_le_epredI less_le_not_le not_le)


[STATEMENT]
lemma eqpoll_imp_lepoll: "A \<approx> B \<Longrightarrow> A \<lesssim> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<approx> B \<Longrightarrow> A \<lesssim> B
[PROOF STEP]
unfolding eqpoll_def lepoll_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. bij_betw f A B \<Longrightarrow> \<exists>f. inj_on f A \<and> f ` A \<subseteq> B
[PROOF STEP]
by (metis bij_betw_def order_refl)


[STATEMENT]
lemma typ_of_Abs_bind_fv:
  assumes "typ_of A = Some ty"
  shows "typ_of (Abs bT (bind_fv (v, bT) A)) = Some (bT \<rightarrow> ty)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. typ_of (Abs_fv v bT A) = Some (bT \<rightarrow> ty)
[PROOF STEP]
using bind_fv2_preserves_type bind_fv_def assms typ_of_def
[PROOF STATE]
proof (prove)
using this:
typ_of1 ?Ts ?t = Some ?ty \<Longrightarrow> typ_of1 (?Ts @ [?T]) (bind_fv2 (?v, ?T) (length ?Ts) ?t) = Some ?ty
bind_fv ?vT ?t = bind_fv2 ?vT 0 ?t
typ_of A = Some ty
typ_of ?t \<equiv> typ_of1 [] ?t

goal (1 subgoal):
 1. typ_of (Abs_fv v bT A) = Some (bT \<rightarrow> ty)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma rel_pred_conversep: "rel_pred A\<inverse>\<inverse> = (rel_pred A)\<inverse>\<inverse>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_pred A\<inverse>\<inverse> = (rel_pred A)\<inverse>\<inverse>
[PROOF STEP]
using rel_fun_conversep[of _ "(=)"]
[PROOF STATE]
proof (prove)
using this:
?A\<inverse>\<inverse> ===> (=)\<inverse>\<inverse> = (?A ===> (=))\<inverse>\<inverse>

goal (1 subgoal):
 1. rel_pred A\<inverse>\<inverse> = (rel_pred A)\<inverse>\<inverse>
[PROOF STEP]
by (simp add: rel_pred_def)


[STATEMENT]
lemma fps_integral0_add:
  "fps_integral0 (a+b) = fps_integral0 a + fps_integral0 b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_integral0 (a + b) = fps_integral0 a + fps_integral0 b
[PROOF STEP]
by (intro fps_ext) (simp add: fps_integral_def algebra_simps)


[STATEMENT]
lemma [code]:
  "A @@ B = (%(xs, ys). xs @ ys) ` (A \<times> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A @@ B = (\<lambda>(xs, ys). xs @ ys) ` (A \<times> B)
[PROOF STEP]
unfolding conc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs @ ys |xs ys. xs \<in> A \<and> ys \<in> B} = (\<lambda>(xs, ys). xs @ ys) ` (A \<times> B)
[PROOF STEP]
by auto


[STATEMENT]
lemma Qp_funs_add':
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f \<in> (carrier (Fun\<^bsub>n\<^esub> Q\<^sub>p))"
  assumes "g \<in> (carrier (Fun\<^bsub>n\<^esub> Q\<^sub>p))"
  shows "(f \<oplus>\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> g) x = f x \<oplus>\<^bsub>Q\<^sub>p\<^esub> g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<oplus>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g) x = f x \<oplus> g x
[PROOF STEP]
using assms Qp_funs_add Qp_funs_car_memE
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
g \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
\<lbrakk>?x \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>); ?f \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<rightarrow> carrier Q\<^sub>p; ?g \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<rightarrow> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> (?f \<oplus>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p\<^esub> ?g) ?x = ?f ?x \<oplus> ?g ?x
?f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p) \<Longrightarrow> ?f \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<rightarrow> carrier Q\<^sub>p

goal (1 subgoal):
 1. (f \<oplus>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g) x = f x \<oplus> g x
[PROOF STEP]
by blast


[STATEMENT]
theorem has_absolute_integral_change_of_variables_invertible:
  fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_"
  assumes der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)"
      and hg: "\<And>x. x \<in> S \<Longrightarrow> h(g x) = x"
      and conth: "continuous_on (g ` S) h"
  shows "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b \<longleftrightarrow>
         f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
let ?S = "{x \<in> S. invertible (matrix (g' x))}" and ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have *: "?D absolutely_integrable_on ?S \<and> integral ?S ?D = b
           \<longleftrightarrow> f absolutely_integrable_on (g ` ?S) \<and> integral (g ` ?S) f = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` {x \<in> S. invertible (matrix (g' x))} \<and> integral (g ` {x \<in> S. invertible (matrix (g' x))}) f = b)
[PROOF STEP]
proof (rule cv_inv_version4)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {x \<in> S. invertible (matrix (g' x))} \<Longrightarrow> (g has_derivative g' x) (at x within {x \<in> S. invertible (matrix (g' x))}) \<and> invertible (matrix (g' x))
 2. \<And>x. x \<in> {x \<in> S. invertible (matrix (g' x))} \<Longrightarrow> continuous_on (g ` {x \<in> S. invertible (matrix (g' x))}) ?h \<and> ?h (g x) = x
[PROOF STEP]
show "(g has_derivative g' x) (at x within ?S) \<and> invertible (matrix (g' x))"
      if "x \<in> ?S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g' x) (at x within {x \<in> S. invertible (matrix (g' x))}) \<and> invertible (matrix (g' x))
[PROOF STEP]
using der_g that has_derivative_subset that
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> (g has_derivative g' ?x) (at ?x within S)
x \<in> {x \<in> S. invertible (matrix (g' x))}
\<lbrakk>(?f has_derivative ?f') (at ?x within ?s); ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> (?f has_derivative ?f') (at ?x within ?t)
x \<in> {x \<in> S. invertible (matrix (g' x))}

goal (1 subgoal):
 1. (g has_derivative g' x) (at x within {x \<in> S. invertible (matrix (g' x))}) \<and> invertible (matrix (g' x))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
?x \<in> {x \<in> S. invertible (matrix (g' x))} \<Longrightarrow> (g has_derivative g' ?x) (at ?x within {x \<in> S. invertible (matrix (g' x))}) \<and> invertible (matrix (g' ?x))

goal (1 subgoal):
 1. \<And>x. x \<in> {x \<in> S. invertible (matrix (g' x))} \<Longrightarrow> continuous_on (g ` {x \<in> S. invertible (matrix (g' x))}) ?h \<and> ?h (g x) = x
[PROOF STEP]
show "continuous_on (g ` ?S) h \<and> h (g x) = x"
      if "x \<in> ?S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (g ` {x \<in> S. invertible (matrix (g' x))}) h \<and> h (g x) = x
[PROOF STEP]
using that continuous_on_subset [OF conth]
[PROOF STATE]
proof (prove)
using this:
x \<in> {x \<in> S. invertible (matrix (g' x))}
?t \<subseteq> g ` S \<Longrightarrow> continuous_on ?t h

goal (1 subgoal):
 1. continuous_on (g ` {x \<in> S. invertible (matrix (g' x))}) h \<and> h (g x) = x
[PROOF STEP]
by (simp add: hg image_mono)
[PROOF STATE]
proof (state)
this:
?x \<in> {x \<in> S. invertible (matrix (g' x))} \<Longrightarrow> continuous_on (g ` {x \<in> S. invertible (matrix (g' x))}) h \<and> h (g ?x) = ?x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` {x \<in> S. invertible (matrix (g' x))} \<and> integral (g ` {x \<in> S. invertible (matrix (g' x))}) f = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have "(g has_derivative g' x) (at x within {x \<in> S. rank (matrix (g' x)) < CARD('m)})" if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g' x) (at x within {x \<in> S. rank (matrix (g' x)) < CARD('m)})
[PROOF STEP]
by (metis (no_types, lifting) der_g has_derivative_subset mem_Collect_eq subsetI that)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> (g has_derivative g' ?x) (at ?x within {x \<in> S. rank (matrix (g' x)) < CARD('m)})

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> S \<Longrightarrow> (g has_derivative g' ?x) (at ?x within {x \<in> S. rank (matrix (g' x)) < CARD('m)})
[PROOF STEP]
have "negligible (g ` {x \<in> S. \<not> invertible (matrix (g' x))})"
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> (g has_derivative g' ?x) (at ?x within {x \<in> S. rank (matrix (g' x)) < CARD('m)})

goal (1 subgoal):
 1. negligible (g ` {x \<in> S. \<not> invertible (matrix (g' x))})
[PROOF STEP]
by (auto simp: invertible_det_nz det_eq_0_rank intro: baby_Sard)
[PROOF STATE]
proof (state)
this:
negligible (g ` {x \<in> S. \<not> invertible (matrix (g' x))})

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
negligible (g ` {x \<in> S. \<not> invertible (matrix (g' x))})
[PROOF STEP]
have neg: "negligible {x \<in> g ` S. x \<notin> g ` ?S \<and> f x \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
negligible (g ` {x \<in> S. \<not> invertible (matrix (g' x))})

goal (1 subgoal):
 1. negligible {x \<in> g ` S. x \<notin> g ` {x \<in> S. invertible (matrix (g' x))} \<and> f x \<noteq> 0}
[PROOF STEP]
by (auto intro: negligible_subset)
[PROOF STATE]
proof (state)
this:
negligible {x \<in> g ` S. x \<notin> g ` {x \<in> S. invertible (matrix (g' x))} \<and> f x \<noteq> 0}

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have [simp]: "{x \<in> g ` ?S. x \<notin> g ` S \<and> f x \<noteq> 0} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> g ` {x \<in> S. invertible (matrix (g' x))}. x \<notin> g ` S \<and> f x \<noteq> 0} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> g ` {x \<in> S. invertible (matrix (g' x))}. x \<notin> g ` S \<and> f x \<noteq> 0} = {}

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have "?D absolutely_integrable_on ?S \<and> integral ?S ?D = b
    \<longleftrightarrow> ?D absolutely_integrable_on S \<and> integral S ?D = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
[PROOF STEP]
apply (intro conj_cong absolutely_integrable_spike_set_eq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. negligible {x \<in> {x \<in> S. invertible (matrix (g' x))} - S. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}
 2. negligible {x \<in> S - {x \<in> S. invertible (matrix (g' x))}. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}
 3. (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<Longrightarrow> (integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
[PROOF STEP]
apply(auto simp: integral_spike_set invertible_det_nz empty_imp_negligible neg)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have "f absolutely_integrable_on (g ` ?S) \<and> integral (g ` ?S) f = b
    \<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f absolutely_integrable_on g ` {x \<in> S. invertible (matrix (g' x))} \<and> integral (g ` {x \<in> S. invertible (matrix (g' x))}) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
by (auto intro!: conj_cong absolutely_integrable_spike_set_eq integral_spike_set neg)
[PROOF STATE]
proof (state)
this:
(f absolutely_integrable_on g ` {x \<in> S. invertible (matrix (g' x))} \<and> integral (g ` {x \<in> S. invertible (matrix (g' x))}) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
(f absolutely_integrable_on g ` {x \<in> S. invertible (matrix (g' x))} \<and> integral (g ` {x \<in> S. invertible (matrix (g' x))}) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
(f absolutely_integrable_on g ` {x \<in> S. invertible (matrix (g' x))} \<and> integral (g ` {x \<in> S. invertible (matrix (g' x))}) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
using "*"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
(f absolutely_integrable_on g ` {x \<in> S. invertible (matrix (g' x))} \<and> integral (g ` {x \<in> S. invertible (matrix (g' x))}) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on {x \<in> S. invertible (matrix (g' x))} \<and> integral {x \<in> S. invertible (matrix (g' x))} (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` {x \<in> S. invertible (matrix (g' x))} \<and> integral (g ` {x \<in> S. invertible (matrix (g' x))}) f = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_maps_compose:
   "homeomorphic_maps X Y f h \<and>
        homeomorphic_maps Y X'' g k
        \<Longrightarrow> homeomorphic_maps X X'' (g \<circ> f) (h \<circ> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_maps X Y f h \<and> homeomorphic_maps Y X'' g k \<Longrightarrow> homeomorphic_maps X X'' (g \<circ> f) (h \<circ> k)
[PROOF STEP]
unfolding homeomorphic_maps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (continuous_map X Y f \<and> continuous_map Y X h \<and> (\<forall>x\<in>topspace X. h (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (h y) = y)) \<and> continuous_map Y X'' g \<and> continuous_map X'' Y k \<and> (\<forall>x\<in>topspace Y. k (g x) = x) \<and> (\<forall>y\<in>topspace X''. g (k y) = y) \<Longrightarrow> continuous_map X X'' (g \<circ> f) \<and> continuous_map X'' X (h \<circ> k) \<and> (\<forall>x\<in>topspace X. (h \<circ> k) ((g \<circ> f) x) = x) \<and> (\<forall>y\<in>topspace X''. (g \<circ> f) ((h \<circ> k) y) = y)
[PROOF STEP]
by (auto simp: continuous_map_compose; simp add: continuous_map_def)


[STATEMENT]
lemma unique_append [rule_format (no_asm)]: "unique l' \<Longrightarrow> unique l \<Longrightarrow>
    (\<forall>(x,y)\<in>set l. \<forall>(x',y')\<in>set l'. x' \<noteq> x) \<longrightarrow> unique (l @ l')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unique l'; unique l\<rbrakk> \<Longrightarrow> (\<forall>(x, y)\<in>set l. \<forall>(x', y')\<in>set l'. x' \<noteq> x) \<longrightarrow> unique (l @ l')
[PROOF STEP]
by (induct l) (auto dest: fst_in_set_lemma)


[STATEMENT]
lemma pCons_as_add:
  fixes p :: "'a :: comm_semiring_1 poly"
  shows "pCons a p = [:a:] + monom 1 1 * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pCons a p = [:a:] + monom (1::'a) 1 * p
[PROOF STEP]
by (auto simp: monom_Suc)