[STATEMENT]
lemma fmap_of_list_app[simp]: "fmap_of_list (xs @ ys) = fmap_of_list ys ++\<^sub>f fmap_of_list xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmap_of_list (xs @ ys) = fmap_of_list ys ++\<^sub>f fmap_of_list xs
[PROOF STEP]
by transfer' simp


[STATEMENT]
lemma pfsubset_ffilter:
  "(\<And>x. x |\<in>| A \<Longrightarrow> P x \<Longrightarrow> Q x) \<Longrightarrow> (x |\<in>| A \<and> \<not> P x \<and> Q x) \<Longrightarrow>
    ffilter P A |\<subset>| ffilter Q A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. \<lbrakk>x |\<in>| A; P x\<rbrakk> \<Longrightarrow> Q x; x |\<in>| A \<and> \<not> P x \<and> Q x\<rbrakk> \<Longrightarrow> ffilter P A |\<subset>| ffilter Q A
[PROOF STEP]
unfolding less_fset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. \<lbrakk>x |\<in>| A; P x\<rbrakk> \<Longrightarrow> Q x; x |\<in>| A \<and> \<not> P x \<and> Q x\<rbrakk> \<Longrightarrow> ffilter P A |\<subseteq>| ffilter Q A \<and> ffilter P A \<noteq> ffilter Q A
[PROOF STEP]
by (auto simp add: subset_ffilter eq_ffilter)


[STATEMENT]
lemma (in prob_space) indep_var_restrict:
  assumes ind: "indep_vars M' X I" and AB: "A \<inter> B = {}" "A \<subseteq> I" "B \<subseteq> I"
  shows "indep_var (PiM A M') (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) A) (PiM B M') (\<lambda>\<omega>. restrict (\<lambda>i. X i \<omega>) B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_var (Pi\<^sub>M A M') (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (Pi\<^sub>M B M') (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. indep_var (Pi\<^sub>M A M') (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (Pi\<^sub>M B M') (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>)
[PROOF STEP]
have *:
    "case_bool (Pi\<^sub>M A M') (Pi\<^sub>M B M') = (\<lambda>b. PiM (case_bool A B b) M')"
    "case_bool (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>) = (\<lambda>b \<omega>. \<lambda>i\<in>case_bool A B b. X i \<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. case_bool (Pi\<^sub>M A M') (Pi\<^sub>M B M') = (\<lambda>b. Pi\<^sub>M (case b of True \<Rightarrow> A | False \<Rightarrow> B) M') &&& case_bool (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>) = (\<lambda>b \<omega>. \<lambda>i\<in>case b of True \<Rightarrow> A | False \<Rightarrow> B. X i \<omega>)
[PROOF STEP]
by (simp_all add: fun_eq_iff split: bool.split)
[PROOF STATE]
proof (state)
this:
case_bool (Pi\<^sub>M A M') (Pi\<^sub>M B M') = (\<lambda>b. Pi\<^sub>M (case b of True \<Rightarrow> A | False \<Rightarrow> B) M')
case_bool (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>) = (\<lambda>b \<omega>. \<lambda>i\<in>case b of True \<Rightarrow> A | False \<Rightarrow> B. X i \<omega>)

goal (1 subgoal):
 1. indep_var (Pi\<^sub>M A M') (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (Pi\<^sub>M B M') (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_var (Pi\<^sub>M A M') (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (Pi\<^sub>M B M') (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>)
[PROOF STEP]
unfolding indep_var_def *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_vars (\<lambda>b. Pi\<^sub>M (case b of True \<Rightarrow> A | False \<Rightarrow> B) M') (\<lambda>b \<omega>. \<lambda>i\<in>case b of True \<Rightarrow> A | False \<Rightarrow> B. X i \<omega>) UNIV
[PROOF STEP]
using AB
[PROOF STATE]
proof (prove)
using this:
A \<inter> B = {}
A \<subseteq> I
B \<subseteq> I

goal (1 subgoal):
 1. indep_vars (\<lambda>b. Pi\<^sub>M (case b of True \<Rightarrow> A | False \<Rightarrow> B) M') (\<lambda>b \<omega>. \<lambda>i\<in>case b of True \<Rightarrow> A | False \<Rightarrow> B. X i \<omega>) UNIV
[PROOF STEP]
by (intro indep_vars_restrict[OF ind]) (auto simp: disjoint_family_on_def split: bool.split)
[PROOF STATE]
proof (state)
this:
indep_var (Pi\<^sub>M A M') (\<lambda>\<omega>. \<lambda>i\<in>A. X i \<omega>) (Pi\<^sub>M B M') (\<lambda>\<omega>. \<lambda>i\<in>B. X i \<omega>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_cancel:
  fixes c :: "'a::real_field"
  shows "of_nat (Suc n) * c / (fact (Suc n)) = c / (fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (Suc n) * c / fact (Suc n) = c / fact n
[PROOF STEP]
using of_nat_neq_0
[PROOF STATE]
proof (prove)
using this:
of_nat (Suc ?n) \<noteq> (0::?'a)

goal (1 subgoal):
 1. of_nat (Suc n) * c / fact (Suc n) = c / fact n
[PROOF STEP]
by force


[STATEMENT]
lemma fun_left_inverse:
  fixes f :: "'b \<Rightarrow> 'a::field"
  shows "zero_free f \<Longrightarrow> inverse f * f = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zero_free f \<Longrightarrow> inverse f * f = 1
[PROOF STEP]
by (simp add: fun_eq_iff)


[STATEMENT]
lemma GFP_lemma3:
  assumes "Mono f" "f \<in> carrier L \<rightarrow> carrier L"
  shows "f (GFP f) \<sqsubseteq> GFP f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (GFP f) \<sqsubseteq> GFP f
[PROOF STEP]
by (metis GFP_closed GFP_lemma2 GFP_upperbound assms funcset_mem use_iso2)


[STATEMENT]
lemma isLubD3: "isLub R S x \<Longrightarrow> leastP (isUb R S) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isLub R S x \<Longrightarrow> leastP (isUb R S) x
[PROOF STEP]
by (simp add: isLub_def)


[STATEMENT]
lemma twisted_partial_image_eq:
  assumes "as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "bs \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)"
  assumes "cs \<in> carrier (Q\<^sub>p\<^bsup>l\<^esup>)"
  assumes "x = as @ bs @ cs"
  shows "twisted_partial_image n m f x = as@((f bs)#cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ f bs # cs
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ f bs # cs
[PROOF STEP]
have 0: "(take n x) = as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take n x = as
[PROOF STEP]
by (metis append_eq_conv_conj assms(1) assms(4)
        cartesian_power_car_memE)
[PROOF STATE]
proof (state)
this:
take n x = as

goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ f bs # cs
[PROOF STEP]
have 1: "twisted_partial_image n m f x = as@(partial_image m f (bs@cs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ padic_fields.partial_image m f (bs @ cs)
[PROOF STEP]
using 0 assms twisted_partial_image_def
[PROOF STATE]
proof (prove)
using this:
take n x = as
as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
bs \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
cs \<in> carrier (Q\<^sub>p\<^bsup>l\<^esup>)
x = as @ bs @ cs
twisted_partial_image ?n ?m ?f ?xs = take ?n ?xs @ padic_fields.partial_image ?m ?f (drop ?n ?xs)

goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ padic_fields.partial_image m f (bs @ cs)
[PROOF STEP]
by (metis append_eq_conv_conj cartesian_power_car_memE)
[PROOF STATE]
proof (state)
this:
twisted_partial_image n m f x = as @ padic_fields.partial_image m f (bs @ cs)

goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ f bs # cs
[PROOF STEP]
have 2: "(partial_image m f (bs@cs)) = (f bs)#cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padic_fields.partial_image m f (bs @ cs) = f bs # cs
[PROOF STEP]
using partial_image_eq[of bs m cs l "bs@cs" f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bs \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>); cs \<in> carrier (Q\<^sub>p\<^bsup>l\<^esup>); bs @ cs = bs @ cs\<rbrakk> \<Longrightarrow> padic_fields.partial_image m f (bs @ cs) = f bs # cs
as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
bs \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
cs \<in> carrier (Q\<^sub>p\<^bsup>l\<^esup>)
x = as @ bs @ cs

goal (1 subgoal):
 1. padic_fields.partial_image m f (bs @ cs) = f bs # cs
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
padic_fields.partial_image m f (bs @ cs) = f bs # cs

goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ f bs # cs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ f bs # cs
[PROOF STEP]
using assms 0 1 2
[PROOF STATE]
proof (prove)
using this:
as \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
bs \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
cs \<in> carrier (Q\<^sub>p\<^bsup>l\<^esup>)
x = as @ bs @ cs
take n x = as
twisted_partial_image n m f x = as @ padic_fields.partial_image m f (bs @ cs)
padic_fields.partial_image m f (bs @ cs) = f bs # cs

goal (1 subgoal):
 1. twisted_partial_image n m f x = as @ f bs # cs
[PROOF STEP]
by (metis )
[PROOF STATE]
proof (state)
this:
twisted_partial_image n m f x = as @ f bs # cs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [simp]: "wp\<^sub>t (c\<^sub>1;c\<^sub>2) R = wp\<^sub>t c\<^sub>1 (wp\<^sub>t c\<^sub>2 R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wp\<^sub>t (c\<^sub>1; c\<^sub>2) R = wp\<^sub>t c\<^sub>1 (wp\<^sub>t c\<^sub>2 R)
[PROOF STEP]
apply(unfold wp_defs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>s. (\<forall>t. s -c\<^sub>1; c\<^sub>2\<rightarrow> t \<longrightarrow> R t) \<and> (c\<^sub>1; c\<^sub>2) \<down> s) = (\<lambda>s. (\<forall>t. s -c\<^sub>1\<rightarrow> t \<longrightarrow> (\<forall>ta. t -c\<^sub>2\<rightarrow> ta \<longrightarrow> R ta) \<and> c\<^sub>2 \<down> t) \<and> c\<^sub>1 \<down> s)
[PROOF STEP]
apply(rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. ((\<forall>t. s -c\<^sub>1; c\<^sub>2\<rightarrow> t \<longrightarrow> R t) \<and> (c\<^sub>1; c\<^sub>2) \<down> s) = ((\<forall>t. s -c\<^sub>1\<rightarrow> t \<longrightarrow> (\<forall>ta. t -c\<^sub>2\<rightarrow> ta \<longrightarrow> R ta) \<and> c\<^sub>2 \<down> t) \<and> c\<^sub>1 \<down> s)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path2_nontrivial[elim]:
    assumes "g \<turnstile> n-ns\<rightarrow>m" "n \<noteq> m"
    shows "length ns \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> length ns
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g \<turnstile> n-ns\<rightarrow>m
n \<noteq> m

goal (1 subgoal):
 1. 2 \<le> length ns
[PROOF STEP]
by (metis Suc_1 le_antisym length_1_last_hd not_less_eq_eq path2_hd path2_last path2_not_Nil3)


[STATEMENT]
lemma [simp]: "invertible\<^sub>L X \<Longrightarrow> inv\<^sub>L (inv\<^sub>L X) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible\<^sub>L X \<Longrightarrow> inv\<^sub>L (inv\<^sub>L X) = X
[PROOF STEP]
by (metis inv\<^sub>L_eq is_inverse\<^sub>L_comm)


[STATEMENT]
lemma Keys_bad_shrK_D: "\<lbrakk> shrK A B \<in> IK; Keys_bad IK Bad \<rbrakk> \<Longrightarrow> A \<in> Bad \<or> B \<in> Bad"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>shrK A B \<in> IK; Keys_bad IK Bad\<rbrakk> \<Longrightarrow> A \<in> Bad \<or> B \<in> Bad
[PROOF STEP]
by (auto simp add: Keys_bad_def)


[STATEMENT]
lemma "steps0 (1, [], [Oc]) tm_dither 2 = (1, [], [Oc])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. steps0 (1, [], [Oc]) tm_dither 2 = (1, [], [Oc])
[PROOF STEP]
by (simp add: step.simps steps.simps numeral_eqs_upto_12 tm_dither_def)


[STATEMENT]
lemma less_ord0_LimD: "x < ord0_Lim f \<Longrightarrow> \<exists>n. x \<le> f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < ord0_Lim f \<Longrightarrow> \<exists>n. x \<le> f n
[PROOF STEP]
apply (simp add: ord0_less_def, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa y z. \<lbrakk>(x, y) \<in> ord0_leq; (y, ord0_Lim f) \<in> ord0_prec\<^sup>+\<rbrakk> \<Longrightarrow> \<exists>n. x \<le> f n
[PROOF STEP]
apply (erule tranclE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa y z. \<lbrakk>(x, y) \<in> ord0_leq; (y, ord0_Lim f) \<in> ord0_prec\<rbrakk> \<Longrightarrow> \<exists>n. x \<le> f n
 2. \<And>xa y z c. \<lbrakk>(x, y) \<in> ord0_leq; (y, c) \<in> ord0_prec\<^sup>+; (c, ord0_Lim f) \<in> ord0_prec\<rbrakk> \<Longrightarrow> \<exists>n. x \<le> f n
[PROOF STEP]
apply (drule ord0_precD, clarify)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa y z fa n. (x, f n) \<in> ord0_leq \<Longrightarrow> \<exists>n. x \<le> f n
 2. \<And>xa y z c. \<lbrakk>(x, y) \<in> ord0_leq; (y, c) \<in> ord0_prec\<^sup>+; (c, ord0_Lim f) \<in> ord0_prec\<rbrakk> \<Longrightarrow> \<exists>n. x \<le> f n
[PROOF STEP]
apply (force simp add: ord0_le_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa y z c. \<lbrakk>(x, y) \<in> ord0_leq; (y, c) \<in> ord0_prec\<^sup>+; (c, ord0_Lim f) \<in> ord0_prec\<rbrakk> \<Longrightarrow> \<exists>n. x \<le> f n
[PROOF STEP]
apply (drule ord0_precD, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa y z c fa n. \<lbrakk>(x, y) \<in> ord0_leq; (y, f n) \<in> ord0_prec\<^sup>+\<rbrakk> \<Longrightarrow> \<exists>n. x \<le> f n
[PROOF STEP]
apply (rule_tac x=n in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa y z c fa n. \<lbrakk>(x, y) \<in> ord0_leq; (y, f n) \<in> ord0_prec\<^sup>+\<rbrakk> \<Longrightarrow> x \<le> f n
[PROOF STEP]
apply (rule ord0_less_imp_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa y z c fa n. \<lbrakk>(x, y) \<in> ord0_leq; (y, f n) \<in> ord0_prec\<^sup>+\<rbrakk> \<Longrightarrow> x < f n
[PROOF STEP]
apply (auto simp add: ord0_less_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ccw_switch23: "det3 0 P Q \<noteq> 0 \<Longrightarrow> (\<not> ccw 0 Q P \<longleftrightarrow> ccw 0 P Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det3 0 P Q \<noteq> 0 \<Longrightarrow> (\<not> ccw 0 Q P) = ccw 0 P Q
[PROOF STEP]
by (auto simp: ccw_def algebra_simps not_ccw'_eq ccw'_not_coll)


[STATEMENT]
lemma prove': "prove' l = (if l = [] then True else prove' ((% x. flatten (map subs x)) l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prove' l = (if l = [] then True else prove' (flatten (map subs l)))
[PROOF STEP]
apply(simp only: prove'_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>m. iter (\<lambda>x. flatten (map subs x)) l m = []) = (if l = [] then True else \<exists>m. iter (\<lambda>x. flatten (map subs x)) (flatten (map subs l)) m = [])
[PROOF STEP]
apply(rule ex_iter_fSucn)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
    \<comment> \<open>this is the main claim for efficiency- we have a tail recursive implementation via this lemma\<close>


[STATEMENT]
lemma (in encoding) indRelR_cond_respection_iff_indRelL_cond_respection:
  fixes Pred :: "('procS, 'procT) Proc \<Rightarrow> bool"
  shows "(\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred)
         = (\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred) = (\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred
 2. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
assume "\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred"
[PROOF STATE]
proof (state)
this:
\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred

goal (2 subgoals):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred
 2. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
obtain Rel where A1: "\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel"
                         and A2: "rel_respects_pred Rel Pred"
[PROOF STATE]
proof (prove)
using this:
\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred

goal (1 subgoal):
 1. (\<And>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel
rel_respects_pred Rel Pred

goal (2 subgoals):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred
 2. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel
[PROOF STEP]
have "\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> {(a, b). (b, a) \<in> Rel}"
[PROOF STATE]
proof (prove)
using this:
\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel

goal (1 subgoal):
 1. \<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> _Collect (a, b) ((b, a) \<in> Rel)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> _Collect (a, b) ((b, a) \<in> Rel)

goal (2 subgoals):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred
 2. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> _Collect (a, b) ((b, a) \<in> Rel)

goal (2 subgoals):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred
 2. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
rel_respects_pred Rel Pred
[PROOF STEP]
have "rel_respects_pred {(a, b). (b, a) \<in> Rel} Pred"
[PROOF STATE]
proof (prove)
using this:
rel_respects_pred Rel Pred

goal (1 subgoal):
 1. rel_respects_pred (_Collect (a, b) ((b, a) \<in> Rel)) Pred
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rel_respects_pred (_Collect (a, b) ((b, a) \<in> Rel)) Pred

goal (2 subgoals):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred
 2. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> _Collect (a, b) ((b, a) \<in> Rel)
rel_respects_pred (_Collect (a, b) ((b, a) \<in> Rel)) Pred
[PROOF STEP]
show "\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred"
[PROOF STATE]
proof (prove)
using this:
\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> _Collect (a, b) ((b, a) \<in> Rel)
rel_respects_pred (_Collect (a, b) ((b, a) \<in> Rel)) Pred

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
assume "\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred"
[PROOF STATE]
proof (state)
this:
\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
obtain Rel where A1: "\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel"
                         and A2: "rel_respects_pred Rel Pred"
[PROOF STATE]
proof (prove)
using this:
\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred

goal (1 subgoal):
 1. (\<And>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel
rel_respects_pred Rel Pred

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel
[PROOF STEP]
have "\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> {(a, b). (b, a) \<in> Rel}"
[PROOF STATE]
proof (prove)
using this:
\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel

goal (1 subgoal):
 1. \<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> _Collect (a, b) ((b, a) \<in> Rel)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> _Collect (a, b) ((b, a) \<in> Rel)

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> _Collect (a, b) ((b, a) \<in> Rel)

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
rel_respects_pred Rel Pred
[PROOF STEP]
have "rel_respects_pred {(a, b). (b, a) \<in> Rel} Pred"
[PROOF STATE]
proof (prove)
using this:
rel_respects_pred Rel Pred

goal (1 subgoal):
 1. rel_respects_pred (_Collect (a, b) ((b, a) \<in> Rel)) Pred
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rel_respects_pred (_Collect (a, b) ((b, a) \<in> Rel)) Pred

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_respects_pred Rel Pred \<Longrightarrow> \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> _Collect (a, b) ((b, a) \<in> Rel)
rel_respects_pred (_Collect (a, b) ((b, a) \<in> Rel)) Pred
[PROOF STEP]
show "\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred"
[PROOF STATE]
proof (prove)
using this:
\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> _Collect (a, b) ((b, a) \<in> Rel)
rel_respects_pred (_Collect (a, b) ((b, a) \<in> Rel)) Pred

goal (1 subgoal):
 1. \<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_respects_pred Rel Pred

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_of_array_shrink [simp]:
  "\<lbrakk> s \<le> array_length a\<rbrakk> \<Longrightarrow> list_of_array (array_shrink a s) = take s (list_of_array a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<le> array_length a \<Longrightarrow> list_of_array (array_shrink a s) = take s (list_of_array a)
[PROOF STEP]
by (cases a) simp


[STATEMENT]
lemma (in pair_sigma_finite) integrable_fst':
  fixes f :: "_ \<Rightarrow> _::{banach, second_countable_topology}"
  assumes f[measurable]: "integrable (M1 \<Otimes>\<^sub>M M2) f"
  shows "integrable M1 (\<lambda>x. \<integral>y. f (x, y) \<partial>M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M1 (\<lambda>x. LINT y|M2. f (x, y))
[PROOF STEP]
unfolding integrable_iff_bounded
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. LINT y|M2. f (x, y)) \<in> borel_measurable M1 \<and> \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. LINT y|M2. f (x, y)) \<in> borel_measurable M1
 2. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
show "(\<lambda>x. \<integral> y. f (x, y) \<partial>M2) \<in> borel_measurable M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. LINT y|M2. f (x, y)) \<in> borel_measurable M1
[PROOF STEP]
by (rule M2.borel_measurable_lebesgue_integral) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. LINT y|M2. f (x, y)) \<in> borel_measurable M1

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
have "(\<integral>\<^sup>+ x. ennreal (norm (\<integral> y. f (x, y) \<partial>M2)) \<partial>M1) \<le> (\<integral>\<^sup>+x. (\<integral>\<^sup>+y. norm (f (x, y)) \<partial>M2) \<partial>M1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 \<le> \<integral>\<^sup>+ x. \<integral>\<^sup>+ xa. ennreal (norm (f (x, xa))) \<partial>M2 \<partial>M1
[PROOF STEP]
using AE_integrable_fst'[OF f]
[PROOF STATE]
proof (prove)
using this:
AE x in M1. integrable M2 (\<lambda>y. f (x, y))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 \<le> \<integral>\<^sup>+ x. \<integral>\<^sup>+ xa. ennreal (norm (f (x, xa))) \<partial>M2 \<partial>M1
[PROOF STEP]
by (auto intro!: nn_integral_mono_AE integral_norm_bound_ennreal)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 \<le> \<integral>\<^sup>+ x. \<integral>\<^sup>+ xa. ennreal (norm (f (x, xa))) \<partial>M2 \<partial>M1

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 \<le> \<integral>\<^sup>+ x. \<integral>\<^sup>+ xa. ennreal (norm (f (x, xa))) \<partial>M2 \<partial>M1

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
have "(\<integral>\<^sup>+x. (\<integral>\<^sup>+y. norm (f (x, y)) \<partial>M2) \<partial>M1) = (\<integral>\<^sup>+x. norm (f x) \<partial>(M1 \<Otimes>\<^sub>M M2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. \<integral>\<^sup>+ xa. ennreal (norm (f (x, xa))) \<partial>M2 \<partial>M1 = \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M1 \<Otimes>\<^sub>M M2
[PROOF STEP]
by (rule M2.nn_integral_fst) simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ xa. ennreal (norm (f (x, xa))) \<partial>M2 \<partial>M1 = \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M1 \<Otimes>\<^sub>M M2

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. \<integral>\<^sup>+ xa. ennreal (norm (f (x, xa))) \<partial>M2 \<partial>M1 = \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M1 \<Otimes>\<^sub>M M2

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
have "(\<integral>\<^sup>+x. norm (f x) \<partial>(M1 \<Otimes>\<^sub>M M2)) < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M1 \<Otimes>\<^sub>M M2 < \<infinity>
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
integrable (M1 \<Otimes>\<^sub>M M2) f

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M1 \<Otimes>\<^sub>M M2 < \<infinity>
[PROOF STEP]
unfolding integrable_iff_bounded
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M2) \<and> \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M1 \<Otimes>\<^sub>M M2 < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M1 \<Otimes>\<^sub>M M2 < \<infinity>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (f x)) \<partial>M1 \<Otimes>\<^sub>M M2 < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
show "(\<integral>\<^sup>+ x. ennreal (norm (\<integral> y. f (x, y) \<partial>M2)) \<partial>M1) < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (LINT y|M2. f (x, y))) \<partial>M1 < \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma freeword_funlift_Abs_freeletter: "freeword_funlift f (Abs_freeletter s) = f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freeword_funlift f (Abs_freeletter s) = f s
[PROOF STEP]
using     theI'[OF universal_property, of f]
            comp_apply[of "freeword_funlift f" Abs_freeletter]
[PROOF STATE]
proof (prove)
using this:
(THE x. x \<circ> Abs_freeletter = f \<and> UGroupHom x) \<circ> Abs_freeletter = f \<and> UGroupHom (THE x. x \<circ> Abs_freeletter = f \<and> UGroupHom x)
(freeword_funlift f \<circ> Abs_freeletter) ?x = freeword_funlift f (Abs_freeletter ?x)

goal (1 subgoal):
 1. freeword_funlift f (Abs_freeletter s) = f s
[PROOF STEP]
unfolding freeword_funlift_def
[PROOF STATE]
proof (prove)
using this:
(THE x. x \<circ> Abs_freeletter = f \<and> UGroupHom x) \<circ> Abs_freeletter = f \<and> UGroupHom (THE x. x \<circ> Abs_freeletter = f \<and> UGroupHom x)
((THE g. g \<circ> Abs_freeletter = f \<and> UGroupHom g) \<circ> Abs_freeletter) ?x = (THE g. g \<circ> Abs_freeletter = f \<and> UGroupHom g) (Abs_freeletter ?x)

goal (1 subgoal):
 1. (THE g. g \<circ> Abs_freeletter = f \<and> UGroupHom g) (Abs_freeletter s) = f s
[PROOF STEP]
by        fastforce


[STATEMENT]
lemma RSadj_snd:"RSadj x y (snd \<nu>) = snd (Radj x y \<nu>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RSadj x y (snd \<nu>) = snd (Radj x y \<nu>)
[PROOF STEP]
unfolding RSadj_def Radj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>z. snd \<nu> $ swap x y z) = snd (\<chi>z. fst \<nu> $ swap x y z, \<chi>z. snd \<nu> $ swap x y z)
[PROOF STEP]
by auto


[STATEMENT]
lemma is_process6: "is_process P \<Longrightarrow>  \<forall> s X. (s@[tick],{}) \<in> FAILURES P \<longrightarrow> (s,X-{tick}) \<in> FAILURES P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_process P \<Longrightarrow> \<forall>s X. (s @ [tick], {}) \<in> FAILURES P \<longrightarrow> (s, X - {tick}) \<in> FAILURES P
[PROOF STEP]
by(drule is_process_spec[THEN iffD1], metis)


[STATEMENT]
lemma list_slice2_0: "
  list_slice2 xs 0 = (if (length xs = 0) then [] else [xs])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_slice2 xs 0 = (if length xs = 0 then [] else [xs])
[PROOF STEP]
by (simp add: list_slice2_def list_slice_0)


[STATEMENT]
lemma diag_compat_diagonal:
  assumes "B\<in> carrier_mat (dim_row B) (dim_row B)"
  and "diagonal_mat B"
  and "dim_row B = sum_list l"
shows "diag_compat B l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_compat B l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list l

goal (1 subgoal):
 1. diag_compat B l
[PROOF STEP]
proof (induct l  arbitrary: B)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list []\<rbrakk> \<Longrightarrow> diag_compat B []
 2. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list []

goal (2 subgoals):
 1. \<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list []\<rbrakk> \<Longrightarrow> diag_compat B []
 2. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list []

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

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
case (Cons a l)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
define B1 where "B1 = fst (split_block B a a)"
[PROOF STATE]
proof (state)
this:
B1 = fst (split_block B a a)

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
define B2 where "B2 = fst (snd (split_block B a a))"
[PROOF STATE]
proof (state)
this:
B2 = fst (snd (split_block B a a))

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
define B3 where "B3 = fst (snd (snd (split_block B a a)))"
[PROOF STATE]
proof (state)
this:
B3 = fst (snd (snd (split_block B a a)))

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
define B4 where "B4 = snd (snd (snd (split_block B a a)))"
[PROOF STATE]
proof (state)
this:
B4 = snd (snd (snd (split_block B a a)))

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
have sp: "split_block B a a = (B1, B2, B3, B4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. split_block B a a = (B1, B2, B3, B4)
[PROOF STEP]
using fst_conv snd_conv
[PROOF STATE]
proof (prove)
using this:
fst (?x1.0, ?x2.0) = ?x1.0
snd (?x1.0, ?x2.0) = ?x2.0

goal (1 subgoal):
 1. split_block B a a = (B1, B2, B3, B4)
[PROOF STEP]
unfolding B1_def B2_def B3_def B4_def
[PROOF STATE]
proof (prove)
using this:
fst (?x1.0, ?x2.0) = ?x1.0
snd (?x1.0, ?x2.0) = ?x2.0

goal (1 subgoal):
 1. split_block B a a = (fst (split_block B a a), fst (snd (split_block B a a)), fst (snd (snd (split_block B a a))), snd (snd (snd (split_block B a a))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
have "diagonal_mat B1 \<and> diagonal_mat B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_mat B1 \<and> diagonal_mat B4
[PROOF STEP]
proof (rule split_block_diagonal)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. diagonal_mat ?D
 2. ?D \<in> carrier_mat ?n ?n
 3. ?a \<le> ?n
 4. split_block ?D ?a ?a = (B1, ?D2.0, ?D3.0, B4)
[PROOF STEP]
show "split_block B a a = (B1, B2, B3, B4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. split_block B a a = (B1, B2, B3, B4)
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. split_block B a a = (B1, B2, B3, B4)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
split_block B a a = (B1, B2, B3, B4)

goal (3 subgoals):
 1. diagonal_mat B
 2. B \<in> carrier_mat ?n ?n
 3. a \<le> ?n
[PROOF STEP]
show "diagonal_mat B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_mat B
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

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

goal (2 subgoals):
 1. B \<in> carrier_mat ?n ?n
 2. a \<le> ?n
[PROOF STEP]
show "B\<in> carrier_mat (dim_row B) (dim_row B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat (dim_row B) (dim_row B)
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. B \<in> carrier_mat (dim_row B) (dim_row B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat (dim_row B) (dim_row B)

goal (1 subgoal):
 1. a \<le> dim_row B
[PROOF STEP]
show "a \<le> dim_row B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> dim_row B
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. a \<le> dim_row B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<le> dim_row B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
diagonal_mat B1 \<and> diagonal_mat B4

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
define n where "n = dim_row B"
[PROOF STATE]
proof (state)
this:
n = dim_row B

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
have "diag_compat B4 l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_compat B4 l
[PROOF STEP]
proof (rule Cons(1))
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. B4 \<in> carrier_mat (dim_row B4) (dim_row B4)
 2. diagonal_mat B4
 3. dim_row B4 = sum_list l
[PROOF STEP]
show "diagonal_mat B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_mat B4
[PROOF STEP]
using \<open>diagonal_mat B1 \<and> diagonal_mat B4\<close>
[PROOF STATE]
proof (prove)
using this:
diagonal_mat B1 \<and> diagonal_mat B4

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

goal (2 subgoals):
 1. B4 \<in> carrier_mat (dim_row B4) (dim_row B4)
 2. dim_row B4 = sum_list l
[PROOF STEP]
show "B4 \<in> carrier_mat (dim_row B4) (dim_row B4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B4 \<in> carrier_mat (dim_row B4) (dim_row B4)
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. B4 \<in> carrier_mat (dim_row B4) (dim_row B4)
[PROOF STEP]
unfolding split_block_def Let_def
[PROOF STATE]
proof (prove)
using this:
(Matrix.mat a a (($$) B), Matrix.mat a (dim_col B - a) (\<lambda>(i, j). B $$ (i, j + a)), Matrix.mat (dim_row B - a) a (\<lambda>(i, j). B $$ (i + a, j)), Matrix.mat (dim_row B - a) (dim_col B - a) (\<lambda>(i, j). B $$ (i + a, j + a))) = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

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

goal (1 subgoal):
 1. dim_row B4 = sum_list l
[PROOF STEP]
show "dim_row B4 = sum_list l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row B4 = sum_list l
[PROOF STEP]
using Cons sp
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. dim_row B4 = sum_list l
[PROOF STEP]
unfolding split_block_def Let_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)
(Matrix.mat a a (($$) B), Matrix.mat a (dim_col B - a) (\<lambda>(i, j). B $$ (i, j + a)), Matrix.mat (dim_row B - a) a (\<lambda>(i, j). B $$ (i + a, j)), Matrix.mat (dim_row B - a) (dim_col B - a) (\<lambda>(i, j). B $$ (i + a, j + a))) = (B1, B2, B3, B4)

goal (1 subgoal):
 1. dim_row B4 = sum_list l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row B4 = sum_list l

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
diag_compat B4 l

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
have "B2 = 0\<^sub>m a (n - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B2 = 0\<^sub>m a (n - a)
[PROOF STEP]
proof (rule eq_matI, auto)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < a; j < n - a\<rbrakk> \<Longrightarrow> B2 $$ (i, j) = (0::'a)
 2. dim_row B2 = a
 3. dim_col B2 = n - a
[PROOF STEP]
show "dim_row B2 = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row B2 = a
[PROOF STEP]
using sp
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. dim_row B2 = a
[PROOF STEP]
unfolding split_block_def Let_def n_def
[PROOF STATE]
proof (prove)
using this:
(Matrix.mat a a (($$) B), Matrix.mat a (dim_col B - a) (\<lambda>(i, j). B $$ (i, j + a)), Matrix.mat (dim_row B - a) a (\<lambda>(i, j). B $$ (i + a, j)), Matrix.mat (dim_row B - a) (dim_col B - a) (\<lambda>(i, j). B $$ (i + a, j + a))) = (B1, B2, B3, B4)

goal (1 subgoal):
 1. dim_row B2 = a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row B2 = a

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < a; j < n - a\<rbrakk> \<Longrightarrow> B2 $$ (i, j) = (0::'a)
 2. dim_col B2 = n - a
[PROOF STEP]
show "dim_col B2 = n-a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col B2 = n - a
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. dim_col B2 = n - a
[PROOF STEP]
unfolding split_block_def Let_def n_def
[PROOF STATE]
proof (prove)
using this:
(Matrix.mat a a (($$) B), Matrix.mat a (dim_col B - a) (\<lambda>(i, j). B $$ (i, j + a)), Matrix.mat (dim_row B - a) a (\<lambda>(i, j). B $$ (i + a, j)), Matrix.mat (dim_row B - a) (dim_col B - a) (\<lambda>(i, j). B $$ (i + a, j + a))) = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. dim_col B2 = dim_row B - a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_col B2 = n - a

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < a; j < n - a\<rbrakk> \<Longrightarrow> B2 $$ (i, j) = (0::'a)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < a; j < n - a\<rbrakk> \<Longrightarrow> B2 $$ (i, j) = (0::'a)
[PROOF STEP]
assume "i < a" and "j < n-a"
[PROOF STATE]
proof (state)
this:
i < a
j < n - a

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < a; j < n - a\<rbrakk> \<Longrightarrow> B2 $$ (i, j) = (0::'a)
[PROOF STEP]
thus "B2 $$(i,j) = 0"
[PROOF STATE]
proof (prove)
using this:
i < a
j < n - a

goal (1 subgoal):
 1. B2 $$ (i, j) = (0::'a)
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
i < a
j < n - a
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. B2 $$ (i, j) = (0::'a)
[PROOF STEP]
unfolding split_block_def Let_def n_def diagonal_mat_def
[PROOF STATE]
proof (prove)
using this:
i < a
j < dim_row B - a
(Matrix.mat a a (($$) B), Matrix.mat a (dim_col B - a) (\<lambda>(i, j). B $$ (i, j + a)), Matrix.mat (dim_row B - a) a (\<lambda>(i, j). B $$ (i + a, j)), Matrix.mat (dim_row B - a) (dim_col B - a) (\<lambda>(i, j). B $$ (i + a, j + a))) = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); \<forall>i<dim_row ?B. \<forall>j<dim_col ?B. i \<noteq> j \<longrightarrow> ?B $$ (i, j) = (0::'a); dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
\<forall>i<dim_row B. \<forall>j<dim_col B. i \<noteq> j \<longrightarrow> B $$ (i, j) = (0::'a)
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. B2 $$ (i, j) = (0::'a)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
B2 $$ (i, j) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
B2 = 0\<^sub>m a (n - a)

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
have "B3 = 0\<^sub>m (n - a) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B3 = 0\<^sub>m (n - a) a
[PROOF STEP]
proof (rule eq_matI, auto)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < n - a; j < a\<rbrakk> \<Longrightarrow> B3 $$ (i, j) = (0::'a)
 2. dim_row B3 = n - a
 3. dim_col B3 = a
[PROOF STEP]
show "dim_row B3 = n-a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row B3 = n - a
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. dim_row B3 = n - a
[PROOF STEP]
unfolding split_block_def Let_def n_def
[PROOF STATE]
proof (prove)
using this:
(Matrix.mat a a (($$) B), Matrix.mat a (dim_col B - a) (\<lambda>(i, j). B $$ (i, j + a)), Matrix.mat (dim_row B - a) a (\<lambda>(i, j). B $$ (i + a, j)), Matrix.mat (dim_row B - a) (dim_col B - a) (\<lambda>(i, j). B $$ (i + a, j + a))) = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. dim_row B3 = dim_row B - a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row B3 = n - a

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < n - a; j < a\<rbrakk> \<Longrightarrow> B3 $$ (i, j) = (0::'a)
 2. dim_col B3 = a
[PROOF STEP]
show "dim_col B3 = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col B3 = a
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. dim_col B3 = a
[PROOF STEP]
unfolding split_block_def Let_def n_def
[PROOF STATE]
proof (prove)
using this:
(Matrix.mat a a (($$) B), Matrix.mat a (dim_col B - a) (\<lambda>(i, j). B $$ (i, j + a)), Matrix.mat (dim_row B - a) a (\<lambda>(i, j). B $$ (i + a, j)), Matrix.mat (dim_row B - a) (dim_col B - a) (\<lambda>(i, j). B $$ (i + a, j + a))) = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. dim_col B3 = a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_col B3 = a

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < n - a; j < a\<rbrakk> \<Longrightarrow> B3 $$ (i, j) = (0::'a)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < n - a; j < a\<rbrakk> \<Longrightarrow> B3 $$ (i, j) = (0::'a)
[PROOF STEP]
assume "i < n-a" and "j < a"
[PROOF STATE]
proof (state)
this:
i < n - a
j < a

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < n - a; j < a\<rbrakk> \<Longrightarrow> B3 $$ (i, j) = (0::'a)
[PROOF STEP]
thus "B3 $$(i,j) = 0"
[PROOF STATE]
proof (prove)
using this:
i < n - a
j < a

goal (1 subgoal):
 1. B3 $$ (i, j) = (0::'a)
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
i < n - a
j < a
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. B3 $$ (i, j) = (0::'a)
[PROOF STEP]
unfolding split_block_def Let_def n_def diagonal_mat_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row B - a
j < a
(Matrix.mat a a (($$) B), Matrix.mat a (dim_col B - a) (\<lambda>(i, j). B $$ (i, j + a)), Matrix.mat (dim_row B - a) a (\<lambda>(i, j). B $$ (i + a, j)), Matrix.mat (dim_row B - a) (dim_col B - a) (\<lambda>(i, j). B $$ (i + a, j + a))) = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); \<forall>i<dim_row ?B. \<forall>j<dim_col ?B. i \<noteq> j \<longrightarrow> ?B $$ (i, j) = (0::'a); dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
\<forall>i<dim_row B. \<forall>j<dim_col B. i \<noteq> j \<longrightarrow> B $$ (i, j) = (0::'a)
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. B3 $$ (i, j) = (0::'a)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
B3 $$ (i, j) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
B3 = 0\<^sub>m (n - a) a

goal (1 subgoal):
 1. \<And>a l B. \<lbrakk>\<And>B. \<lbrakk>B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat B l; B \<in> carrier_mat (dim_row B) (dim_row B); diagonal_mat B; dim_row B = sum_list (a # l)\<rbrakk> \<Longrightarrow> diag_compat B (a # l)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_compat B (a # l)
[PROOF STEP]
proof (rule diag_compat.simps(2)[THEN iffD2], intro conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> dim_row B
 2. let n = dim_row B; (B1, B2, B3, B4) = split_block B a a in B2 = 0\<^sub>m a (n - a) \<and> B3 = 0\<^sub>m (n - a) a \<and> diag_compat B4 l
[PROOF STEP]
show "a \<le> dim_row B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> dim_row B
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat (dim_row ?B) (dim_row ?B); diagonal_mat ?B; dim_row ?B = sum_list l\<rbrakk> \<Longrightarrow> diag_compat ?B l
B \<in> carrier_mat (dim_row B) (dim_row B)
diagonal_mat B
dim_row B = sum_list (a # l)

goal (1 subgoal):
 1. a \<le> dim_row B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<le> dim_row B

goal (1 subgoal):
 1. let n = dim_row B; (B1, B2, B3, B4) = split_block B a a in B2 = 0\<^sub>m a (n - a) \<and> B3 = 0\<^sub>m (n - a) a \<and> diag_compat B4 l
[PROOF STEP]
show "let n = dim_row B;
      (B1, B2, B3, B4) = split_block B a a in B2 = 0\<^sub>m a (n - a) \<and>
      B3 = 0\<^sub>m (n - a) a \<and> diag_compat B4 l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let n = dim_row B; (B1, B2, B3, B4) = split_block B a a in B2 = 0\<^sub>m a (n - a) \<and> B3 = 0\<^sub>m (n - a) a \<and> diag_compat B4 l
[PROOF STEP]
using sp \<open>B3 = 0\<^sub>m (n - a) a\<close> \<open>B2 = 0\<^sub>m a (n - a)\<close>
        \<open>diag_compat B4 l\<close>
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
B3 = 0\<^sub>m (n - a) a
B2 = 0\<^sub>m a (n - a)
diag_compat B4 l

goal (1 subgoal):
 1. let n = dim_row B; (B1, B2, B3, B4) = split_block B a a in B2 = 0\<^sub>m a (n - a) \<and> B3 = 0\<^sub>m (n - a) a \<and> diag_compat B4 l
[PROOF STEP]
unfolding Let_def n_def
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
B3 = 0\<^sub>m (dim_row B - a) a
B2 = 0\<^sub>m a (dim_row B - a)
diag_compat B4 l

goal (1 subgoal):
 1. case split_block B a a of (B1, B2, B3, B4) \<Rightarrow> B2 = 0\<^sub>m a (dim_row B - a) \<and> B3 = 0\<^sub>m (dim_row B - a) a \<and> diag_compat B4 l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
let n = dim_row B; (B1, B2, B3, B4) = split_block B a a in B2 = 0\<^sub>m a (n - a) \<and> B3 = 0\<^sub>m (n - a) a \<and> diag_compat B4 l

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
diag_compat B (a # l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma omega_circ:
  "x\<^sup>\<omega>\<^sup>\<circ> = 1 \<squnion> x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<omega>\<^sup>\<circ> = (1::'a) \<squnion> x\<^sup>\<omega>
[PROOF STEP]
by (metis order.antisym circ_left_unfold mult_left_sub_dist_sup_left mult_1_right omega_sub_vector)


[STATEMENT]
lemma reduce_impl_carrier[simp,intro]: "A \<in> carrier_mat m n \<Longrightarrow> reduce_impl a b D A \<in> carrier_mat m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat m n \<Longrightarrow> reduce_impl a b D A \<in> carrier_mat m n
[PROOF STEP]
unfolding reduce_impl_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat m n \<Longrightarrow> (if Matrix.row A a $v 0 = 0 then A else case euclid_ext2 (Matrix.row A a $v 0) (Matrix.row A b $v 0) of (p, q, u, v, d) \<Rightarrow> change_row a (\<lambda>k ak. if k = 0 then if D dvd p * ak + q * Matrix.row A b $v k then D else p * ak + q * Matrix.row A b $v k else (p * ak + q * Matrix.row A b $v k) gmod D) (change_row b (\<lambda>k bk. if k = 0 then u * Matrix.row A a $v k + v * bk else (u * Matrix.row A a $v k + v * bk) gmod D) A)) \<in> carrier_mat m n
[PROOF STEP]
by (auto split: prod.splits)


[STATEMENT]
lemma keys_mult:
  "keys (f * g) \<subseteq> {a + b | a b. a \<in> keys f \<and> b \<in> keys g}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (f * g) \<subseteq> {a + b |a b. a \<in> keys f \<and> b \<in> keys g}
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g. \<lbrakk>finite {x. f x \<noteq> (0::'b)}; finite {x. g x \<noteq> (0::'b)}\<rbrakk> \<Longrightarrow> {k. prod_fun f g k \<noteq> (0::'b)} \<subseteq> {a + b |a b. a \<in> {k. f k \<noteq> (0::'b)} \<and> b \<in> {k. g k \<noteq> (0::'b)}}
[PROOF STEP]
apply (auto simp add: prod_fun_def dest!: mult_not_zero elim!: Sum_any.not_neutral_obtains_not_neutral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g a aa. \<lbrakk>finite {x. f x \<noteq> (0::'b)}; finite {x. g x \<noteq> (0::'b)}; f a \<noteq> (0::'b); g aa \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> \<exists>ab b. a + aa = ab + b \<and> f ab \<noteq> (0::'b) \<and> g b \<noteq> (0::'b)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma closest_supchamberD:
  assumes   "F\<in>X" "chamber D"
  shows     "chamber (closest_supchamber F D)" "F \<subseteq> closest_supchamber F D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chamber (closest_supchamber F D) &&& F \<subseteq> closest_supchamber F D
[PROOF STEP]
using     assms arg_min_natI[of "\<lambda>C. chamber C \<and> F\<subseteq>C" ] simplex_in_max[of F]
[PROOF STATE]
proof (prove)
using this:
F \<in> X
chamber D
chamber ?k \<and> F \<subseteq> ?k \<Longrightarrow> chamber (ARG_MIN ?m C. chamber C \<and> F \<subseteq> C) \<and> F \<subseteq> (ARG_MIN ?m C. chamber C \<and> F \<subseteq> C)
F \<in> X \<Longrightarrow> \<exists>x. chamber x \<and> F \<subseteq> x

goal (1 subgoal):
 1. chamber (closest_supchamber F D) &&& F \<subseteq> closest_supchamber F D
[PROOF STEP]
unfolding closest_supchamber_def
[PROOF STATE]
proof (prove)
using this:
F \<in> X
chamber D
chamber ?k \<and> F \<subseteq> ?k \<Longrightarrow> chamber (ARG_MIN ?m C. chamber C \<and> F \<subseteq> C) \<and> F \<subseteq> (ARG_MIN ?m C. chamber C \<and> F \<subseteq> C)
F \<in> X \<Longrightarrow> \<exists>x. chamber x \<and> F \<subseteq> x

goal (1 subgoal):
 1. chamber (ARG_MIN (\<lambda>C. chamber_distance C D) C. chamber C \<and> F \<subseteq> C) &&& F \<subseteq> (ARG_MIN (\<lambda>C. chamber_distance C D) C. chamber C \<and> F \<subseteq> C)
[PROOF STEP]
by        auto


[STATEMENT]
lemma tseytin_tran_small_clauses: "\<forall>C \<in> cnf (nnf (tseytin_tran F)). card C \<le> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C\<in>cnf (nnf (tseytin_tran F)). card C \<le> 3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>C\<in>cnf (nnf (tseytin_tran F)). card C \<le> 3
[PROOF STEP]
have 3: "card S \<le> 2 \<Longrightarrow> card (a \<triangleright> S) \<le> 3" for a S
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card S \<le> 2 \<Longrightarrow> card (a \<triangleright> S) \<le> 3
[PROOF STEP]
by(cases "finite S"; simp add: card_insert_le_m1)
[PROOF STATE]
proof (state)
this:
card ?S1 \<le> 2 \<Longrightarrow> card (?a1 \<triangleright> ?S1) \<le> 3

goal (1 subgoal):
 1. \<forall>C\<in>cnf (nnf (tseytin_tran F)). card C \<le> 3
[PROOF STEP]
have 2: "card S \<le> 1 \<Longrightarrow> card (a \<triangleright> S) \<le> 2" for a S
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card S \<le> 1 \<Longrightarrow> card (a \<triangleright> S) \<le> 2
[PROOF STEP]
by(cases "finite S"; simp add: card_insert_le_m1)
[PROOF STATE]
proof (state)
this:
card ?S2 \<le> 1 \<Longrightarrow> card (?a2 \<triangleright> ?S2) \<le> 2

goal (1 subgoal):
 1. \<forall>C\<in>cnf (nnf (tseytin_tran F)). card C \<le> 3
[PROOF STEP]
have 1: "card S \<le> 0 \<Longrightarrow> card (a \<triangleright> S) \<le> 1" for a S
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card S \<le> 0 \<Longrightarrow> card (a \<triangleright> S) \<le> 1
[PROOF STEP]
by(cases "finite S"; simp add: card_insert_le_m1)
[PROOF STATE]
proof (state)
this:
card ?S3 \<le> 0 \<Longrightarrow> card (?a3 \<triangleright> ?S3) \<le> 1

goal (1 subgoal):
 1. \<forall>C\<in>cnf (nnf (tseytin_tran F)). card C \<le> 3
[PROOF STEP]
have *: "\<lbrakk>G \<in> set (tseytin_tran1 (Atom \<circ> S) F); C \<in> cnf (nnf G)\<rbrakk> \<Longrightarrow> card C \<le> 3" for G C S
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<in> set (tseytin_tran1 (Atom \<circ> S) F); C \<in> cnf (nnf G)\<rbrakk> \<Longrightarrow> card C \<le> 3
[PROOF STEP]
by(induction F arbitrary: G; simp add: biimp_def; (elim disjE exE conjE | intro 1 2 3 | simp)+)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?G3 \<in> set (tseytin_tran1 (Atom \<circ> ?S3) F); ?C3 \<in> cnf (nnf ?G3)\<rbrakk> \<Longrightarrow> card ?C3 \<le> 3

goal (1 subgoal):
 1. \<forall>C\<in>cnf (nnf (tseytin_tran F)). card C \<le> 3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C\<in>cnf (nnf (tseytin_tran F)). card C \<le> 3
[PROOF STEP]
unfolding tseytin_tran_def  tseytin_toatom_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C\<in>cnf (nnf \<^bold>\<And>(Atom \<circ> the \<circ> map_of (map (\<lambda>(a, b). (b, a)) (tseytin_assmt F))) F # tseytin_tran1 (Atom \<circ> the \<circ> map_of (map (\<lambda>(a, b). (b, a)) (tseytin_assmt F))) F). card C \<le> 3
[PROOF STEP]
by(clarsimp simp add: cnf_BigAnd nnf_BigAnd comp_assoc *)
[PROOF STATE]
proof (state)
this:
\<forall>C\<in>cnf (nnf (tseytin_tran F)). card C \<le> 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Group) const_gbij:"gbij\<^bsub>(\<natural> {\<one>}),(\<natural> {\<one>})\<^esub> (1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gbij\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub> (1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub>)
[PROOF STEP]
apply (cut_tac special_sg_e,
       frule Group_Gp[of "{\<one>}"],
       frule const_ghom[of "\<natural> {\<one>}" "\<natural> {\<one>}"], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> {\<one>} ; Group (\<natural>{\<one>}); 1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub> \<in> gHom (\<natural>{\<one>}) (\<natural>{\<one>})\<rbrakk> \<Longrightarrow> gbij\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub> (1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub>)
[PROOF STEP]
apply (simp add:gbijec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> {\<one>} ; Group (\<natural>{\<one>}); 1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub> \<in> gHom (\<natural>{\<one>}) (\<natural>{\<one>})\<rbrakk> \<Longrightarrow> gsurj\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub> (1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub>) \<and> ginj\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub> (1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub>)
[PROOF STEP]
apply (rule conjI, simp add:gsurjec_def,
       simp add:surj_to_def Gp_def constghom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> {\<one>} ; Group (\<natural>{\<one>}); 1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub> \<in> gHom (\<natural>{\<one>}) (\<natural>{\<one>})\<rbrakk> \<Longrightarrow> ginj\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub> (1\<^bsub>(\<natural>{\<one>}),(\<natural>{\<one>})\<^esub>)
[PROOF STEP]
apply (simp add:ginjec_def inj_on_def Gp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma simplex_imp_polyhedron:
   "n simplex S \<Longrightarrow> polyhedron S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n simplex S \<Longrightarrow> polyhedron S
[PROOF STEP]
by (simp add: polytope_imp_polyhedron simplex_imp_polytope)