[STATEMENT]
lemma has_integral_substitution:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space" and g :: "real \<Rightarrow> real"
  assumes "a \<le> b" "g a \<le> g b" "g ` {a..b} \<subseteq> {c..d}"
      and "continuous_on {c..d} f"
      and "\<And>x. x \<in> {a..b} \<Longrightarrow> (g has_field_derivative g' x) (at x within {a..b})"
    shows "((\<lambda>x. g' x *\<^sub>R f (g x)) has_integral (integral {g a..g b} f)) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. g' x *\<^sub>R f (g x)) has_integral integral {g a..g b} f) {a..b}
[PROOF STEP]
by (intro has_integral_substitution_strong[of "{}" a b g c d] assms)
     (auto intro: DERIV_continuous_on assms)


[STATEMENT]
lemma (in Module) single_span:"\<lbrakk>ideal R A; z \<in> carrier M;
    h \<in> {j. j \<le> (n::nat)} \<rightarrow> {z}; t \<in> {j. j \<le> n} \<rightarrow> A\<rbrakk> \<Longrightarrow>
     \<exists>s\<in>{0::nat} \<rightarrow> A. \<Sigma>\<^sub>e M (\<lambda>j. t j \<cdot>\<^sub>s (h j)) n =  s 0 \<cdot>\<^sub>s z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; z \<in> carrier M; h \<in> {j. j \<le> n} \<rightarrow> {z}; t \<in> {j. j \<le> n} \<rightarrow> A\<rbrakk> \<Longrightarrow> \<exists>s\<in>{0} \<rightarrow> A. \<Sigma>\<^sub>e M (\<lambda>j. t j \<cdot>\<^sub>s h j) n = s 0 \<cdot>\<^sub>s z
[PROOF STEP]
apply (simp add:finite_lin_spanTr1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "hierarchy_next [Department ''i20'' [], Department ''i8'' [Department ''CoffeeMachine'' [], Department ''TeaMachine'' []]]
        (''i0''--Leaf)
        = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hierarchy_next [Department ''i20'' [], Department ''i8'' [Department ''CoffeeMachine'' [], Department ''TeaMachine'' []]] (''i0'' -- Leaf) = None
[PROOF STEP]
by eval


[STATEMENT]
lemma passes_test_cases_from_io_tree :
  assumes "observable M"
  and     "observable I"
  and     "qM \<in> states M"
  and     "qI \<in> states I"
  and     "finite_tree t"
shows "list_all (passes_test_case I qI) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M qM t)) = ((set t \<inter> LS M qM) = (set t \<inter> LS I qI))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (passes_test_case I qI) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M qM t)) = (Prefix_Tree.set t \<inter> LS M qM = Prefix_Tree.set t \<inter> LS I qI)
[PROOF STEP]
unfolding passes_test_cases_of_test_suite[OF assms] passes_test_suite_from_io_tree[OF assms(1-4)]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Prefix_Tree.set t \<inter> LS M qM = Prefix_Tree.set t \<inter> LS I qI) = (Prefix_Tree.set t \<inter> LS M qM = Prefix_Tree.set t \<inter> LS I qI)
[PROOF STEP]
by blast


[STATEMENT]
lemma eq_MV_Rel[transfer_rule]: "(MV_Rel ===> MV_Rel ===> (=)) (\<lambda> v v' . vec_mod v = vec_mod v') (=) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MV_Rel ===> MV_Rel ===> (=)) (\<lambda>v v'. vec_mod v = vec_mod v') (=)
[PROOF STEP]
unfolding MV_Rel_def rel_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. vec_mod x = to_int_vec y \<longrightarrow> (\<forall>xa ya. vec_mod xa = to_int_vec ya \<longrightarrow> (vec_mod x = vec_mod xa) = (y = ya))
[PROOF STEP]
using to_int_mod_ring_hom.vec_hom_inj
[PROOF STATE]
proof (prove)
using this:
to_int_vec ?v = to_int_vec ?w \<Longrightarrow> ?v = ?w

goal (1 subgoal):
 1. \<forall>x y. vec_mod x = to_int_vec y \<longrightarrow> (\<forall>xa ya. vec_mod xa = to_int_vec ya \<longrightarrow> (vec_mod x = vec_mod xa) = (y = ya))
[PROOF STEP]
by auto


[STATEMENT]
lemma Ord_pred_HUnion: "Ord(k) \<Longrightarrow> pred k = \<Squnion>k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord k \<Longrightarrow> pred k = \<Squnion>k
[PROOF STEP]
by (metis HUnion_hempty Ordinal.Ord_pred pred_0 pred_succ)


[STATEMENT]
lemma moebius_preserve_circline_angle [simp]:
  shows "cos_angle (moebius_ocircline M H1) (moebius_ocircline M H2) =
         cos_angle H1 H2 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos_angle (moebius_ocircline M H1) (moebius_ocircline M H2) = cos_angle H1 H2
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M H1 H2. \<lbrakk>mat_det M \<noteq> 0; hermitean H1 \<and> H1 \<noteq> mat_zero; hermitean H2 \<and> H2 \<noteq> mat_zero\<rbrakk> \<Longrightarrow> cos_angle_cmat (moebius_circline_cmat_cmat M H1) (moebius_circline_cmat_cmat M H2) = cos_angle_cmat H1 H2
[PROOF STEP]
fix H1 H2 M :: complex_mat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M H1 H2. \<lbrakk>mat_det M \<noteq> 0; hermitean H1 \<and> H1 \<noteq> mat_zero; hermitean H2 \<and> H2 \<noteq> mat_zero\<rbrakk> \<Longrightarrow> cos_angle_cmat (moebius_circline_cmat_cmat M H1) (moebius_circline_cmat_cmat M H2) = cos_angle_cmat H1 H2
[PROOF STEP]
assume hh: "mat_det M \<noteq> 0"
[PROOF STATE]
proof (state)
this:
mat_det M \<noteq> 0

goal (1 subgoal):
 1. \<And>M H1 H2. \<lbrakk>mat_det M \<noteq> 0; hermitean H1 \<and> H1 \<noteq> mat_zero; hermitean H2 \<and> H2 \<noteq> mat_zero\<rbrakk> \<Longrightarrow> cos_angle_cmat (moebius_circline_cmat_cmat M H1) (moebius_circline_cmat_cmat M H2) = cos_angle_cmat H1 H2
[PROOF STEP]
show "cos_angle_cmat (moebius_circline_cmat_cmat M H1) (moebius_circline_cmat_cmat M H2) = cos_angle_cmat H1 H2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos_angle_cmat (moebius_circline_cmat_cmat M H1) (moebius_circline_cmat_cmat M H2) = cos_angle_cmat H1 H2
[PROOF STEP]
unfolding cos_angle_cmat_def moebius_circline_cmat_cmat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Re (mat_det_12 (congruence (mat_inv M) H1) (congruence (mat_inv M) H2)) / (2 * sqrt (Re (mat_det (congruence (mat_inv M) H1) * mat_det (congruence (mat_inv M) H2)))) = - Re (mat_det_12 H1 H2) / (2 * sqrt (Re (mat_det H1 * mat_det H2)))
[PROOF STEP]
unfolding Let_def mat_det_12_congruence mat_det_congruence
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Re (cor ((cmod (mat_det (mat_inv M)))\<^sup>2) * mat_det_12 H1 H2) / (2 * sqrt (Re (cor ((cmod (mat_det (mat_inv M)))\<^sup>2) * mat_det H1 * (cor ((cmod (mat_det (mat_inv M)))\<^sup>2) * mat_det H2)))) = - Re (mat_det_12 H1 H2) / (2 * sqrt (Re (mat_det H1 * mat_det H2)))
[PROOF STEP]
using hh mat_det_inv[of M]
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M

goal (1 subgoal):
 1. - Re (cor ((cmod (mat_det (mat_inv M)))\<^sup>2) * mat_det_12 H1 H2) / (2 * sqrt (Re (cor ((cmod (mat_det (mat_inv M)))\<^sup>2) * mat_det H1 * (cor ((cmod (mat_det (mat_inv M)))\<^sup>2) * mat_det H2)))) = - Re (mat_det_12 H1 H2) / (2 * sqrt (Re (mat_det H1 * mat_det H2)))
[PROOF STEP]
apply (subst cor_squared[symmetric])+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mat_det M \<noteq> 0; mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M; mat_det M \<noteq> 0; mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M; mat_det M \<noteq> 0; mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M\<rbrakk> \<Longrightarrow> - Re ((cor (cmod (mat_det (mat_inv M))))\<^sup>2 * mat_det_12 H1 H2) / (2 * sqrt (Re ((cor (cmod (mat_det (mat_inv M))))\<^sup>2 * mat_det H1 * ((cor (cmod (mat_det (mat_inv M))))\<^sup>2 * mat_det H2)))) = - Re (mat_det_12 H1 H2) / (2 * sqrt (Re (mat_det H1 * mat_det H2)))
[PROOF STEP]
apply (subst cos_angle_den_scale, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mat_det M \<noteq> 0; mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M; mat_det M \<noteq> 0; mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M; mat_det M \<noteq> 0; mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M\<rbrakk> \<Longrightarrow> - Re ((cor (cmod (mat_det (mat_inv M))))\<^sup>2 * mat_det_12 H1 H2) / (2 * (cmod (mat_det (mat_inv M)) * cmod (mat_det (mat_inv M)) * sqrt (Re (mat_det H1 * mat_det H2)))) = - Re (mat_det_12 H1 H2) / (2 * sqrt (Re (mat_det H1 * mat_det H2)))
[PROOF STEP]
apply (auto simp add: power2_eq_square real_sqrt_mult field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cos_angle_cmat (moebius_circline_cmat_cmat M H1) (moebius_circline_cmat_cmat M H2) = cos_angle_cmat H1 H2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pair_measure_eq_distr_PiM:
  fixes M1 :: "'a measure" and M2 :: "'a measure"
  assumes "sigma_finite_measure M1" "sigma_finite_measure M2"
  shows "(M1 \<Otimes>\<^sub>M M2) = distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))"
    (is "?P = ?D")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M1 \<Otimes>\<^sub>M M2 = distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))
[PROOF STEP]
proof (rule pair_measure_eqI[OF assms])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
interpret B: product_sigma_finite "case_bool M1 M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_sigma_finite (case_bool M1 M2)
[PROOF STEP]
unfolding product_sigma_finite_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. sigma_finite_measure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sigma_finite_measure M1
sigma_finite_measure M2

goal (1 subgoal):
 1. \<forall>i. sigma_finite_measure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2)
[PROOF STEP]
by (auto split: bool.split)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
let ?B = "Pi\<^sub>M UNIV (case_bool M1 M2)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
have [simp]: "fst \<circ> (\<lambda>x. (x True, x False)) = (\<lambda>x. x True)" "snd \<circ> (\<lambda>x. (x True, x False)) = (\<lambda>x. x False)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst \<circ> (\<lambda>x. (x True, x False)) = (\<lambda>x. x True) &&& snd \<circ> (\<lambda>x. (x True, x False)) = (\<lambda>x. x False)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst \<circ> (\<lambda>x. (x True, x False)) = (\<lambda>x. x True)
snd \<circ> (\<lambda>x. (x True, x False)) = (\<lambda>x. x False)

goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
fix A B
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
assume A: "A \<in> sets M1" and B: "B \<in> sets M2"
[PROOF STATE]
proof (state)
this:
A \<in> sets M1
B \<in> sets M2

goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
have "emeasure M1 A * emeasure M2 B = (\<Prod> i\<in>UNIV. emeasure (case_bool M1 M2 i) (case_bool A B i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M1 A * emeasure M2 B = (\<Prod>i\<in>UNIV. emeasure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2) (case i of True \<Rightarrow> A | False \<Rightarrow> B))
[PROOF STEP]
by (simp add: UNIV_bool ac_simps)
[PROOF STATE]
proof (state)
this:
emeasure M1 A * emeasure M2 B = (\<Prod>i\<in>UNIV. emeasure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2) (case i of True \<Rightarrow> A | False \<Rightarrow> B))

goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M1 A * emeasure M2 B = (\<Prod>i\<in>UNIV. emeasure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2) (case i of True \<Rightarrow> A | False \<Rightarrow> B))

goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
have "\<dots> = emeasure ?B (Pi\<^sub>E UNIV (case_bool A B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>UNIV. emeasure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) = emeasure (Pi\<^sub>M UNIV (case_bool M1 M2)) (Pi\<^sub>E UNIV (case_bool A B))
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> sets M1
B \<in> sets M2

goal (1 subgoal):
 1. (\<Prod>i\<in>UNIV. emeasure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) = emeasure (Pi\<^sub>M UNIV (case_bool M1 M2)) (Pi\<^sub>E UNIV (case_bool A B))
[PROOF STEP]
by (subst B.emeasure_PiM) (auto split: bool.split)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>UNIV. emeasure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) = emeasure (Pi\<^sub>M UNIV (case_bool M1 M2)) (Pi\<^sub>E UNIV (case_bool A B))

goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>UNIV. emeasure (case i of True \<Rightarrow> M1 | False \<Rightarrow> M2) (case i of True \<Rightarrow> A | False \<Rightarrow> B)) = emeasure (Pi\<^sub>M UNIV (case_bool M1 M2)) (Pi\<^sub>E UNIV (case_bool A B))

goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
have "Pi\<^sub>E UNIV (case_bool A B) = (\<lambda>x. (x True, x False)) -` (A \<times> B) \<inter> space ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi\<^sub>E UNIV (case_bool A B) = (\<lambda>x. (x True, x False)) -` (A \<times> B) \<inter> space (Pi\<^sub>M UNIV (case_bool M1 M2))
[PROOF STEP]
using A[THEN sets.sets_into_space] B[THEN sets.sets_into_space]
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> space M1
B \<subseteq> space M2

goal (1 subgoal):
 1. Pi\<^sub>E UNIV (case_bool A B) = (\<lambda>x. (x True, x False)) -` (A \<times> B) \<inter> space (Pi\<^sub>M UNIV (case_bool M1 M2))
[PROOF STEP]
by (auto simp: PiE_iff all_bool_eq space_PiM split: bool.split)
[PROOF STATE]
proof (state)
this:
Pi\<^sub>E UNIV (case_bool A B) = (\<lambda>x. (x True, x False)) -` (A \<times> B) \<inter> space (Pi\<^sub>M UNIV (case_bool M1 M2))

goal (2 subgoals):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
 2. \<And>A B. \<lbrakk>A \<in> sets M1; B \<in> sets M2\<rbrakk> \<Longrightarrow> emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M1 A * emeasure M2 B = emeasure (Pi\<^sub>M UNIV (\<lambda>a. case a of True \<Rightarrow> M1 | False \<Rightarrow> M2)) ((\<lambda>x. (x True, x False)) -` (A \<times> B) \<inter> space (Pi\<^sub>M UNIV (case_bool M1 M2)))
[PROOF STEP]
show "emeasure M1 A * emeasure M2 B = emeasure ?D (A \<times> B)"
[PROOF STATE]
proof (prove)
using this:
emeasure M1 A * emeasure M2 B = emeasure (Pi\<^sub>M UNIV (\<lambda>a. case a of True \<Rightarrow> M1 | False \<Rightarrow> M2)) ((\<lambda>x. (x True, x False)) -` (A \<times> B) \<inter> space (Pi\<^sub>M UNIV (case_bool M1 M2)))

goal (1 subgoal):
 1. emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
using A B
      measurable_component_singleton[of True UNIV "case_bool M1 M2"]
      measurable_component_singleton[of False UNIV "case_bool M1 M2"]
[PROOF STATE]
proof (prove)
using this:
emeasure M1 A * emeasure M2 B = emeasure (Pi\<^sub>M UNIV (\<lambda>a. case a of True \<Rightarrow> M1 | False \<Rightarrow> M2)) ((\<lambda>x. (x True, x False)) -` (A \<times> B) \<inter> space (Pi\<^sub>M UNIV (case_bool M1 M2)))
A \<in> sets M1
B \<in> sets M2
True \<in> UNIV \<Longrightarrow> (\<lambda>x. x True) \<in> Pi\<^sub>M UNIV (case_bool M1 M2) \<rightarrow>\<^sub>M (case True of True \<Rightarrow> M1 | False \<Rightarrow> M2)
False \<in> UNIV \<Longrightarrow> (\<lambda>x. x False) \<in> Pi\<^sub>M UNIV (case_bool M1 M2) \<rightarrow>\<^sub>M (case False of True \<Rightarrow> M1 | False \<Rightarrow> M2)

goal (1 subgoal):
 1. emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)
[PROOF STEP]
by (subst emeasure_distr) (auto simp: measurable_pair_iff)
[PROOF STATE]
proof (state)
this:
emeasure M1 A * emeasure M2 B = emeasure (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False))) (A \<times> B)

goal (1 subgoal):
 1. sets (M1 \<Otimes>\<^sub>M M2) = sets (distr (Pi\<^sub>M UNIV (case_bool M1 M2)) (M1 \<Otimes>\<^sub>M M2) (\<lambda>x. (x True, x False)))
[PROOF STEP]
qed simp


[STATEMENT]
lemma infinite_contains_2_elems:
  assumes "infinite A"
  shows "\<exists> x y. x \<noteq> y \<and> x \<in> A \<and> y \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<noteq> y \<and> x \<in> A \<and> y \<in> A
[PROOF STEP]
by (metis assms finite.simps is_singletonI' is_singleton_def)


[STATEMENT]
theorem (in SecurityInvariant_withOffendingFlows) ENFnrSR_offending_set:
    "\<lbrakk> sinvar_all_edges_normal_form_not_refl_SR P \<rbrakk> \<Longrightarrow>
    set_offending_flows G nP = (if sinvar G nP then
      {}
     else
      { {(e1,e2). (e1, e2) \<in> edges G \<and> e1 \<noteq> e2 \<and> \<not> P (nP e1) e1 (nP e2) e2} })"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sinvar_all_edges_normal_form_not_refl_SR P \<Longrightarrow> set_offending_flows G nP = (if sinvar G nP then {} else {{(e1, e2). (e1, e2) \<in> edges G \<and> e1 \<noteq> e2 \<and> \<not> P (nP e1) e1 (nP e2) e2}})
[PROOF STEP]
by(auto dest: ENFnrSR_to_ENFsr simp: ENFsr_offending_set)


[STATEMENT]
lemma (in Ring) dsumMhom_mHom:"\<lbrakk>\<forall>i\<in>I. (R module (M i));
      \<forall>i\<in>I. (R module (N i)); \<forall>i\<in>I. ((S i) \<in> mHom R (M i) (N i))\<rbrakk> \<Longrightarrow>
                dsumMhom I M N S \<in> mHom R (dsumM R I M) (dsumM R I N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> dsumMhom I M N S \<in> mHom R (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M) (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N)
[PROOF STEP]
apply (subst mHom_def, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> dsumMhom I M N S \<in> aHom (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M) (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N) \<and> (\<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m)
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> dsumMhom I M N S \<in> aHom (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M) (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N)
 2. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (simp add:aHom_def,
        rule conjI,
        simp add:dsumM_def dsumMhom_mem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> dsumMhom I M N S \<in> extensional (carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M)) \<and> (\<forall>a\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). \<forall>b\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<plusminus>\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> b) = dsumMhom I M N S a \<plusminus>\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S b)
 2. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (rule conjI,
        simp add:dsumMhom_def extensional_def dsumM_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). \<forall>b\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<plusminus>\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> b) = dsumMhom I M N S a \<plusminus>\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S b
 2. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (rule ballI)+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M); b \<in> carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M)\<rbrakk> \<Longrightarrow> dsumMhom I M N S (a \<plusminus>\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> b) = dsumMhom I M N S a \<plusminus>\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S b
 2. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (simp add:dsumM_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prod_pOp I M a b) = prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b)
 2. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (subgoal_tac "\<forall>i\<in>I. aGroup (M i)",
        frule_tac X = a and Y = b in dsum_pOp_mem [of I M], assumption+,
        frule_tac x = "prod_pOp I M a b" in dsumMhom_mem [of I M N S],
        assumption+,
        frule_tac x = a in dsumMhom_mem [of I M N S], assumption+,
        frule_tac x = b in dsumMhom_mem [of I M N S], assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prod_pOp I M a b) = prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b)
 2. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 3. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (subgoal_tac "\<forall>i\<in>I. aGroup (N i)")
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i)\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prod_pOp I M a b) = prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b)
 2. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (N i)
 3. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 4. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (frule_tac X = "dsumMhom I M N S a" and Y = "dsumMhom I M N S b" in
                                      dsum_pOp_mem [of I N], assumption+)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b) \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prod_pOp I M a b) = prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b)
 2. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (N i)
 3. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 4. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (rule carr_dsumM_mem_eq [of I N], assumption+, rule ballI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b) \<in> carr_dsumag I N; j \<in> I\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prod_pOp I M a b) j = prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b) j
 2. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (N i)
 3. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 4. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (cut_tac carr_dsum_prod1 [of  I M], cut_tac carr_dsum_prod1 [of I N])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prod_pOp I M a b) j = prod_pOp I N (dsumMhom I M N S a) (dsumMhom I M N S b) j
 2. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (N i)
 3. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 4. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (simp add:prod_pOp_def)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; dsumMhom I M N S (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. dsumMhom I M N S a x \<plusminus>\<^bsub>N x\<^esub> dsumMhom I M N S b x) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> dsumMhom I M N S (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) j = dsumMhom I M N S a j \<plusminus>\<^bsub>N j\<^esub> dsumMhom I M N S b j
 2. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (N i)
 3. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 4. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (simp add:dsumMhom_def)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a k \<plusminus>\<^bsub>M k\<^esub> b k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (a k)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (b k)) \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. (if x \<in> I then S x (a x) else undefined) \<plusminus>\<^bsub>N x\<^esub> (if x \<in> I then S x (b x) else undefined)) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> S j (a j \<plusminus>\<^bsub>M j\<^esub> b j) = S j (a j) \<plusminus>\<^bsub>N j\<^esub> S j (b j)
 2. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (N i)
 3. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 4. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (rule_tac R = R and M = "M j" and N = "N j" and m = "a j" and n = "b j"
        in  Module.mHom_add)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a k \<plusminus>\<^bsub>M k\<^esub> b k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (a k)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (b k)) \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. (if x \<in> I then S x (a x) else undefined) \<plusminus>\<^bsub>N x\<^esub> (if x \<in> I then S x (b x) else undefined)) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> R module M j
 2. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a k \<plusminus>\<^bsub>M k\<^esub> b k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (a k)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (b k)) \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. (if x \<in> I then S x (a x) else undefined) \<plusminus>\<^bsub>N x\<^esub> (if x \<in> I then S x (b x) else undefined)) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> R module N j
 3. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a k \<plusminus>\<^bsub>M k\<^esub> b k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (a k)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (b k)) \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. (if x \<in> I then S x (a x) else undefined) \<plusminus>\<^bsub>N x\<^esub> (if x \<in> I then S x (b x) else undefined)) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> S j \<in> mHom R (M j) (N j)
 4. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a k \<plusminus>\<^bsub>M k\<^esub> b k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (a k)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (b k)) \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. (if x \<in> I then S x (a x) else undefined) \<plusminus>\<^bsub>N x\<^esub> (if x \<in> I then S x (b x) else undefined)) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> a j \<in> carrier (M j)
 5. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a k \<plusminus>\<^bsub>M k\<^esub> b k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (a k)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (b k)) \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. (if x \<in> I then S x (a x) else undefined) \<plusminus>\<^bsub>N x\<^esub> (if x \<in> I then S x (b x) else undefined)) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> b j \<in> carrier (M j)
 6. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (N i)
 7. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 8. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a k \<plusminus>\<^bsub>M k\<^esub> b k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (a k)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (b k)) \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. (if x \<in> I then S x (a x) else undefined) \<plusminus>\<^bsub>N x\<^esub> (if x \<in> I then S x (b x) else undefined)) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> a j \<in> carrier (M j)
 2. \<And>a b j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); (\<lambda>x\<in>I. a x \<plusminus>\<^bsub>M x\<^esub> b x) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a k \<plusminus>\<^bsub>M k\<^esub> b k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (a k)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (b k)) \<in> carr_dsumag I N; \<forall>i\<in>I. aGroup (N i); (\<lambda>x\<in>I. (if x \<in> I then S x (a x) else undefined) \<plusminus>\<^bsub>N x\<^esub> (if x \<in> I then S x (b x) else undefined)) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I M \<longrightarrow> x \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> b j \<in> carrier (M j)
 3. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M; \<forall>i\<in>I. aGroup (M i); prod_pOp I M a b \<in> carr_dsumag I M; dsumMhom I M N S (prod_pOp I M a b) \<in> carr_dsumag I N; dsumMhom I M N S a \<in> carr_dsumag I N; dsumMhom I M N S b \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (N i)
 4. \<And>a b. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carr_dsumag I M; b \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> \<forall>i\<in>I. aGroup (M i)
 5. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (simp add:carr_dsumag_def carr_prodag_def finiteHom_def,
         simp add:carr_dsumag_def carr_prodag_def finiteHom_def,
         rule ballI, rotate_tac 1,
         drule_tac x = i in bspec, assumption,
         simp add:Module.module_is_ag,
         rule ballI, drule_tac x = i in bspec, assumption,
         simp add:Module.module_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>m\<in>carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M). dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (rule ballI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carrier (\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M)\<rbrakk> \<Longrightarrow> dsumMhom I M N S (a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> M\<^esub> m) = a \<cdot>\<^sub>s\<^bsub>\<^bsub>R\<^esub>\<Sigma>\<^sub>d\<^bsub>I\<^esub> N\<^esub> dsumMhom I M N S m
[PROOF STEP]
apply (simp add:dsumM_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) = prodM_sprod R I N a (dsumMhom I M N S m)
[PROOF STEP]
apply (frule_tac a = a and b = m in dsum_sprod_mem [of I M], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) = prodM_sprod R I N a (dsumMhom I M N S m)
[PROOF STEP]
apply (frule_tac x = "prodM_sprod R I M a m" in
                  dsumMhom_mem [of I M N S], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M; dsumMhom I M N S (prodM_sprod R I M a m) \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) = prodM_sprod R I N a (dsumMhom I M N S m)
[PROOF STEP]
apply (frule_tac x = m in dsumMhom_mem [of I M N S], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M; dsumMhom I M N S (prodM_sprod R I M a m) \<in> carr_dsumag I N; dsumMhom I M N S m \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) = prodM_sprod R I N a (dsumMhom I M N S m)
[PROOF STEP]
apply (frule_tac a = a and b = "dsumMhom I M N S m" in
                    dsum_sprod_mem [of I N], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M; dsumMhom I M N S (prodM_sprod R I M a m) \<in> carr_dsumag I N; dsumMhom I M N S m \<in> carr_dsumag I N; prodM_sprod R I N a (dsumMhom I M N S m) \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) = prodM_sprod R I N a (dsumMhom I M N S m)
[PROOF STEP]
apply (rule carr_dsumM_mem_eq [of I N], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M; dsumMhom I M N S (prodM_sprod R I M a m) \<in> carr_dsumag I N; dsumMhom I M N S m \<in> carr_dsumag I N; prodM_sprod R I N a (dsumMhom I M N S m) \<in> carr_dsumag I N\<rbrakk> \<Longrightarrow> \<forall>j\<in>I. dsumMhom I M N S (prodM_sprod R I M a m) j = prodM_sprod R I N a (dsumMhom I M N S m) j
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M; dsumMhom I M N S (prodM_sprod R I M a m) \<in> carr_dsumag I N; dsumMhom I M N S m \<in> carr_dsumag I N; prodM_sprod R I N a (dsumMhom I M N S m) \<in> carr_dsumag I N; j \<in> I\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) j = prodM_sprod R I N a (dsumMhom I M N S m) j
[PROOF STEP]
apply (cut_tac carr_dsum_prod1 [of I])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M; dsumMhom I M N S (prodM_sprod R I M a m) \<in> carr_dsumag I N; dsumMhom I M N S m \<in> carr_dsumag I N; prodM_sprod R I N a (dsumMhom I M N S m) \<in> carr_dsumag I N; j \<in> I; \<forall>x. x \<in> carr_dsumag I (?M64 a m j) \<longrightarrow> x \<in> carr_prodag I (?M64 a m j)\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) j = prodM_sprod R I N a (dsumMhom I M N S m) j
[PROOF STEP]
apply (drule_tac a = m in forall_spec, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M; dsumMhom I M N S (prodM_sprod R I M a m) \<in> carr_dsumag I N; dsumMhom I M N S m \<in> carr_dsumag I N; prodM_sprod R I N a (dsumMhom I M N S m) \<in> carr_dsumag I N; j \<in> I; m \<in> carr_prodag I M\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) j = prodM_sprod R I N a (dsumMhom I M N S m) j
[PROOF STEP]
apply (cut_tac carr_dsum_prod1 [of I N],
         frule_tac a = "dsumMhom I M N S m" in forall_spec,
         assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; prodM_sprod R I M a m \<in> carr_dsumag I M; dsumMhom I M N S (prodM_sprod R I M a m) \<in> carr_dsumag I N; dsumMhom I M N S m \<in> carr_dsumag I N; prodM_sprod R I N a (dsumMhom I M N S m) \<in> carr_dsumag I N; j \<in> I; m \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N; dsumMhom I M N S m \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> dsumMhom I M N S (prodM_sprod R I M a m) j = prodM_sprod R I N a (dsumMhom I M N S m) j
[PROOF STEP]
apply (simp add:dsumMhom_def prodM_sprod_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; (\<lambda>j\<in>I. a \<cdot>\<^sub>s\<^bsub>M j\<^esub> m j) \<in> carr_dsumag I M; (\<lambda>k\<in>I. S k (if k \<in> I then a \<cdot>\<^sub>s\<^bsub>M k\<^esub> m k else undefined)) \<in> carr_dsumag I N; (\<lambda>k\<in>I. S k (m k)) \<in> carr_dsumag I N; (\<lambda>j\<in>I. a \<cdot>\<^sub>s\<^bsub>N j\<^esub> (if j \<in> I then S j (m j) else undefined)) \<in> carr_dsumag I N; j \<in> I; m \<in> carr_prodag I M; \<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N\<rbrakk> \<Longrightarrow> S j (a \<cdot>\<^sub>s\<^bsub>M j\<^esub> m j) = a \<cdot>\<^sub>s\<^bsub>N j\<^esub> S j (m j)
[PROOF STEP]
apply (thin_tac "(\<lambda>j\<in>I. a \<cdot>\<^sub>s\<^bsub>M j\<^esub> m j) \<in> carr_dsumag I M",
         thin_tac "(\<lambda>k\<in>I. S k (if k \<in> I then a \<cdot>\<^sub>s\<^bsub>M k\<^esub> m k else undefined))
        \<in> carr_dsumag I N",
         thin_tac "(\<lambda>k\<in>I. S k (m k)) \<in> carr_dsumag I N",
         thin_tac "(\<lambda>j\<in>I. a \<cdot>\<^sub>s\<^bsub>N j\<^esub> (if j \<in> I then S j (m j) else undefined))
        \<in> carr_dsumag I N",
         thin_tac "\<forall>x. x \<in> carr_dsumag I N \<longrightarrow> x \<in> carr_prodag I N")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m j. \<lbrakk>\<forall>i\<in>I. R module M i; \<forall>i\<in>I. R module N i; \<forall>i\<in>I. S i \<in> mHom R (M i) (N i); a \<in> carrier R; m \<in> carr_dsumag I M; j \<in> I; m \<in> carr_prodag I M\<rbrakk> \<Longrightarrow> S j (a \<cdot>\<^sub>s\<^bsub>M j\<^esub> m j) = a \<cdot>\<^sub>s\<^bsub>N j\<^esub> S j (m j)
[PROOF STEP]
apply (drule_tac x = j in bspec, assumption,
         drule_tac x = j in bspec, assumption,
         drule_tac x = j in bspec, assumption,
         simp add:carr_prodag_def, (erule conjE)+,
         drule_tac x = j in bspec, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a m j. \<lbrakk>a \<in> carrier R; m \<in> carr_dsumag I M; j \<in> I; R module M j; R module N j; S j \<in> mHom R (M j) (N j); m \<in> extensional I; m \<in> I \<rightarrow> Un_carrier I M; m j \<in> carrier (M j)\<rbrakk> \<Longrightarrow> S j (a \<cdot>\<^sub>s\<^bsub>M j\<^esub> m j) = a \<cdot>\<^sub>s\<^bsub>N j\<^esub> S j (m j)
[PROOF STEP]
apply (simp add:Module.mHom_lin)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma int_nat_div:
   "(int a) div (int b) = int ((a::nat) div b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int a div int b = int (a div b)
[PROOF STEP]
by (metis zdiv_int)


[STATEMENT]
lemma reflcl_lang:
  "gta_lang (finsert None (Some |`| Q)) (reflcl_automaton \<F> \<A>) = gta_lang Q \<A> \<union> \<T>\<^sub>G (fset \<F>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gta_lang (finsert None (Some |`| Q)) (reflcl_automaton \<F> \<A>) = gta_lang Q \<A> \<union> \<T>\<^sub>G (fset \<F>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gta_lang (finsert None (Some |`| Q)) (reflcl_automaton \<F> \<A>) = gta_lang Q \<A> \<union> \<T>\<^sub>G (fset \<F>)
[PROOF STEP]
have st: "None |\<notin>| \<Q> (fmap_states_ta Some \<A>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. None |\<notin>| \<Q> (fmap_states_ta Some \<A>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
None |\<notin>| \<Q> (fmap_states_ta Some \<A>)

goal (1 subgoal):
 1. gta_lang (finsert None (Some |`| Q)) (reflcl_automaton \<F> \<A>) = gta_lang Q \<A> \<union> \<T>\<^sub>G (fset \<F>)
[PROOF STEP]
have "gta_lang Q \<A> = gta_lang (Some |`| Q) (fmap_states_ta Some \<A>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gta_lang Q \<A> = gta_lang (Some |`| Q) (fmap_states_ta Some \<A>)
[PROOF STEP]
by (simp add: finj_Some fmap_states_ta_lang2)
[PROOF STATE]
proof (state)
this:
gta_lang Q \<A> = gta_lang (Some |`| Q) (fmap_states_ta Some \<A>)

goal (1 subgoal):
 1. gta_lang (finsert None (Some |`| Q)) (reflcl_automaton \<F> \<A>) = gta_lang Q \<A> \<union> \<T>\<^sub>G (fset \<F>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gta_lang Q \<A> = gta_lang (Some |`| Q) (fmap_states_ta Some \<A>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gta_lang Q \<A> = gta_lang (Some |`| Q) (fmap_states_ta Some \<A>)

goal (1 subgoal):
 1. gta_lang (finsert None (Some |`| Q)) (reflcl_automaton \<F> \<A>) = gta_lang Q \<A> \<union> \<T>\<^sub>G (fset \<F>)
[PROOF STEP]
unfolding reflcl_automaton_def Let_def gen_reflcl_lang[OF st, of "Some |`| Q" \<F>]
[PROOF STATE]
proof (prove)
using this:
gta_lang Q \<A> = gta_lang (Some |`| Q) (fmap_states_ta Some \<A>)

goal (1 subgoal):
 1. gta_lang (Some |`| Q) (fmap_states_ta Some \<A>) \<union> \<T>\<^sub>G (fset \<F>) = gta_lang Q \<A> \<union> \<T>\<^sub>G (fset \<F>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gta_lang (finsert None (Some |`| Q)) (reflcl_automaton \<F> \<A>) = gta_lang Q \<A> \<union> \<T>\<^sub>G (fset \<F>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinal_neq_0 [iff]: "(x \<noteq> 0) = (0 < (x::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<noteq> 0) = (0 < x)
[PROOF STEP]
by (simp add: order_less_le)


[STATEMENT]
lemma "\<forall>(x::'a::linordered_field) y. \<exists>z>0. \<bar>x - y\<bar> \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. \<exists>z>0::'a. \<bar>x - y\<bar> \<le> z
[PROOF STEP]
by ferrack


[STATEMENT]
lemma disj_conj_dsitr:"((P::'\<alpha> predicate) \<or> (Q \<and> R)) = ((P \<or> Q) \<and> (P \<or> R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<or> Q \<and> R) = ((P \<or> Q) \<and> (P \<or> R))
[PROOF STEP]
by (rule ext) blast


[STATEMENT]
lemma unfold_fold_2:
  assumes "isotone f"
      and "apx.isotone f"
      and "has_least_prefixpoint f"
      and "has_greatest_fixpoint f"
      and "apx.has_least_fixpoint f"
      and "f(x) \<le> x"
      and "\<kappa> f \<sqinter> L \<le> x \<sqinter> L"
    shows "\<kappa> f \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<kappa> f \<le> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<kappa> f \<le> x
[PROOF STEP]
have "\<kappa> f \<sqinter> L = \<nu> f \<sqinter> L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<kappa> f \<sqinter> L = \<nu> f \<sqinter> L
[PROOF STEP]
by (smt (z3) apx_meet_L assms(4,5) order.eq_iff inf.cobounded1 kappa_apx_below_nu kappa_below_nu le_inf_iff)
[PROOF STATE]
proof (state)
this:
\<kappa> f \<sqinter> L = \<nu> f \<sqinter> L

goal (1 subgoal):
 1. \<kappa> f \<le> x
[PROOF STEP]
hence "\<kappa> f = (\<kappa> f \<sqinter> L) \<squnion> \<mu> f"
[PROOF STATE]
proof (prove)
using this:
\<kappa> f \<sqinter> L = \<nu> f \<sqinter> L

goal (1 subgoal):
 1. \<kappa> f = \<kappa> f \<sqinter> L \<squnion> \<mu> f
[PROOF STEP]
by (metis assms(1-5) apx_meet_below_nu_kappa_mu_nu has_apx_least_fixpoint_kappa_apx_meet sup_commute least_fixpoint_char least_prefixpoint_fixpoint kappa_apx_meet_apx_meet_below_nu kappa_mu_nu_def)
[PROOF STATE]
proof (state)
this:
\<kappa> f = \<kappa> f \<sqinter> L \<squnion> \<mu> f

goal (1 subgoal):
 1. \<kappa> f \<le> x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<kappa> f = \<kappa> f \<sqinter> L \<squnion> \<mu> f

goal (1 subgoal):
 1. \<kappa> f \<le> x
[PROOF STEP]
by (metis assms(1,3,6,7) sup_least is_least_prefixpoint_def least_prefixpoint le_inf_iff pmu_mu)
[PROOF STATE]
proof (state)
this:
\<kappa> f \<le> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fpxs_compose_power_eq_1_iff [simp]:
  assumes "l > 0"
  shows   "fpxs_compose_power p l = 1 \<longleftrightarrow> p = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fpxs_compose_power p l = 1) = (p = 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (fpxs_compose_power p l = 1) = (p = 1)
[PROOF STEP]
have "fpxs_compose_power p l = 1 \<longleftrightarrow> fpxs_compose_power p l = fpxs_compose_power 1 l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fpxs_compose_power p l = 1) = (fpxs_compose_power p l = fpxs_compose_power 1 l)
[PROOF STEP]
by (subst fpxs_compose_power_1) (use assms in auto)
[PROOF STATE]
proof (state)
this:
(fpxs_compose_power p l = 1) = (fpxs_compose_power p l = fpxs_compose_power 1 l)

goal (1 subgoal):
 1. (fpxs_compose_power p l = 1) = (p = 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fpxs_compose_power p l = 1) = (fpxs_compose_power p l = fpxs_compose_power 1 l)

goal (1 subgoal):
 1. (fpxs_compose_power p l = 1) = (p = 1)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> p = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fpxs_compose_power p l = fpxs_compose_power 1 l) = (p = 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < l

goal (1 subgoal):
 1. (fpxs_compose_power p l = fpxs_compose_power 1 l) = (p = 1)
[PROOF STEP]
by (subst fpxs_compose_power_eq_iff) auto
[PROOF STATE]
proof (state)
this:
(fpxs_compose_power p l = fpxs_compose_power 1 l) = (p = 1)

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

goal (1 subgoal):
 1. (fpxs_compose_power p l = 1) = (p = 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(fpxs_compose_power p l = 1) = (p = 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma awalk_ends_eqD:
  assumes "awalk u p u" "awalk v p w"
  shows "v = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = w
[PROOF STEP]
using awalk_ends[OF assms(1,2)]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> [] \<and> u = v \<and> u = w \<or> p = [] \<and> u = u \<and> v = w

goal (1 subgoal):
 1. v = w
[PROOF STEP]
by auto


[STATEMENT]
lemma eval_fds_uminus: "fds_converges f s \<Longrightarrow> eval_fds (-f) s = -eval_fds f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_converges f s \<Longrightarrow> eval_fds (- f) s = - eval_fds f s
[PROOF STEP]
by (simp add: fds_converges_def eval_fds_def suminf_minus)


[STATEMENT]
lemma cong_less_modulus_unique_nat: "[x = y] (mod m) \<Longrightarrow> x < m \<Longrightarrow> y < m \<Longrightarrow> x = y"
  for x y :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>[x = y] (mod m); x < m; y < m\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (simp add: cong_def)


[STATEMENT]
lemma mat_of_rows_mult_as_finsum:
  assumes "v \<in> carrier_vec (length lst)" "\<And> i. i < length lst \<Longrightarrow> lst ! i \<in> carrier_vec n"
  defines "f l \<equiv> sum (\<lambda> i. if l = lst ! i then v $ i else 0) {0..<length lst}"
  shows mat_of_cols_mult_as_finsum:"mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec (length lst)
?i2 < length lst \<Longrightarrow> lst ! ?i2 \<in> carrier_vec n
f ?l2 \<equiv> \<Sum>i = 0..<length lst. if ?l2 = lst ! i then v $v i else (0::'a)
[PROOF STEP]
have "\<forall> i < length lst. lst ! i \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec (length lst)
?i2 < length lst \<Longrightarrow> lst ! ?i2 \<in> carrier_vec n
f ?l2 \<equiv> \<Sum>i = 0..<length lst. if ?l2 = lst ! i then v $v i else (0::'a)

goal (1 subgoal):
 1. \<forall>i<length lst. lst ! i \<in> carrier_vec n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i<length lst. lst ! i \<in> carrier_vec n

goal (1 subgoal):
 1. mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)
[PROOF STEP]
note an = all_nth_imp_all_set[OF this]
[PROOF STATE]
proof (state)
this:
?x \<in> set lst \<Longrightarrow> ?x \<in> carrier_vec n

goal (1 subgoal):
 1. mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)
[PROOF STEP]
hence slc:"set lst \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set lst \<Longrightarrow> ?x \<in> carrier_vec n

goal (1 subgoal):
 1. set lst \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set lst \<subseteq> carrier_vec n

goal (1 subgoal):
 1. mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)
[PROOF STEP]
hence dn [simp]:"\<And> x. x \<in> set lst \<Longrightarrow> dim_vec x = n"
[PROOF STATE]
proof (prove)
using this:
set lst \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<And>x. x \<in> set lst \<Longrightarrow> dim_vec x = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x2 \<in> set lst \<Longrightarrow> dim_vec ?x2 = n

goal (1 subgoal):
 1. mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)
[PROOF STEP]
have dl [simp]:"dim_vec (lincomb f (set lst)) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (lincomb f (set lst)) = n
[PROOF STEP]
using an
[PROOF STATE]
proof (prove)
using this:
?x \<in> set lst \<Longrightarrow> ?x \<in> carrier_vec n

goal (1 subgoal):
 1. dim_vec (lincomb f (set lst)) = n
[PROOF STEP]
by (simp add: slc)
[PROOF STATE]
proof (state)
this:
dim_vec (lincomb f (set lst)) = n

goal (1 subgoal):
 1. mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
 2. dim_vec (mat_of_cols n lst *\<^sub>v v) = dim_vec (lincomb f (set lst))
[PROOF STEP]
show "dim_vec (mat_of_cols n lst *\<^sub>v v) = dim_vec (lincomb f (set lst))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (mat_of_cols n lst *\<^sub>v v) = dim_vec (lincomb f (set lst))
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec (length lst)
?i2 < length lst \<Longrightarrow> lst ! ?i2 \<in> carrier_vec n

goal (1 subgoal):
 1. dim_vec (mat_of_cols n lst *\<^sub>v v) = dim_vec (lincomb f (set lst))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_vec (mat_of_cols n lst *\<^sub>v v) = dim_vec (lincomb f (set lst))

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
assume i:"i < dim_vec (lincomb f (set lst))"
[PROOF STATE]
proof (state)
this:
i < dim_vec (lincomb f (set lst))

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
hence i':"i < n"
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (lincomb f (set lst))

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

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
with an
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set lst \<Longrightarrow> ?x \<in> carrier_vec n
i < n
[PROOF STEP]
have fcarr:"(\<lambda>v. f v \<cdot>\<^sub>v v) \<in> set lst \<rightarrow> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set lst \<Longrightarrow> ?x \<in> carrier_vec n
i < n

goal (1 subgoal):
 1. (\<lambda>v. f v \<cdot>\<^sub>v v) \<in> set lst \<rightarrow> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>v. f v \<cdot>\<^sub>v v) \<in> set lst \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
from i'
[PROOF STATE]
proof (chain)
picking this:
i < n
[PROOF STEP]
have "(mat_of_cols n lst *\<^sub>v v) $ i = row (mat_of_cols n lst) i \<bullet> v"
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. (mat_of_cols n lst *\<^sub>v v) $v i = row (mat_of_cols n lst) i \<bullet> v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(mat_of_cols n lst *\<^sub>v v) $v i = row (mat_of_cols n lst) i \<bullet> v

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(mat_of_cols n lst *\<^sub>v v) $v i = row (mat_of_cols n lst) i \<bullet> v

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
have "\<dots> = (\<Sum>ia = 0..<dim_vec v. lst ! ia $ i * v $ ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat_of_cols n lst) i \<bullet> v = (\<Sum>ia = 0..<dim_vec v. lst ! ia $v i * v $v ia)
[PROOF STEP]
unfolding mat_of_cols_def row_def scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<dim_vec v. row (Matrix.mat n (length lst) (\<lambda>(i, j). lst ! j $v i)) i $v ia * v $v ia) = (\<Sum>ia = 0..<dim_vec v. lst ! ia $v i * v $v ia)
[PROOF STEP]
apply(rule sum.cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<dim_vec v} \<Longrightarrow> row (Matrix.mat n (length lst) (\<lambda>(i, j). lst ! j $v i)) i $v x * v $v x = lst ! x $v i * v $v x
[PROOF STEP]
using i an assms(1)
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (lincomb f (set lst))
?x \<in> set lst \<Longrightarrow> ?x \<in> carrier_vec n
v \<in> carrier_vec (length lst)

goal (1 subgoal):
 1. \<And>x. x \<in> {0..<dim_vec v} \<Longrightarrow> row (Matrix.mat n (length lst) (\<lambda>(i, j). lst ! j $v i)) i $v x * v $v x = lst ! x $v i * v $v x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row (mat_of_cols n lst) i \<bullet> v = (\<Sum>ia = 0..<dim_vec v. lst ! ia $v i * v $v ia)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row (mat_of_cols n lst) i \<bullet> v = (\<Sum>ia = 0..<dim_vec v. lst ! ia $v i * v $v ia)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
have "\<dots> = (\<Sum>ia = 0..<length lst. lst ! ia $ i * v $ ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<dim_vec v. lst ! ia $v i * v $v ia) = (\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec (length lst)

goal (1 subgoal):
 1. (\<Sum>ia = 0..<dim_vec v. lst ! ia $v i * v $v ia) = (\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<dim_vec v. lst ! ia $v i * v $v ia) = (\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<dim_vec v. lst ! ia $v i * v $v ia) = (\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>set lst. f x * x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia) = (\<Sum>x\<in>set lst. f x * x $v i)
[PROOF STEP]
unfolding f_def sum_distrib_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia) = (\<Sum>x\<in>set lst. \<Sum>n = 0..<length lst. (if x = lst ! n then v $v n else (0::'a)) * x $v i)
[PROOF STEP]
apply (subst sum.swap)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia) = (\<Sum>j = 0..<length lst. \<Sum>ia\<in>set lst. (if ia = lst ! j then v $v j else (0::'a)) * ia $v i)
[PROOF STEP]
apply(rule sum.cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<length lst} \<Longrightarrow> lst ! x $v i * v $v x = (\<Sum>ia\<in>set lst. (if ia = lst ! x then v $v x else (0::'a)) * ia $v i)
[PROOF STEP]
unfolding if_distrib if_distribR mult_zero_left sum.delta[OF finite_set]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<length lst} \<Longrightarrow> if lst ! x \<in> set lst then lst ! x $v i * v $v x = v $v x * lst ! x $v i else lst ! x $v i * v $v x = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia) = (\<Sum>x\<in>set lst. f x * x $v i)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<length lst. lst ! ia $v i * v $v ia) = (\<Sum>x\<in>set lst. f x * x $v i)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>set lst. (f x \<cdot>\<^sub>v x) $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>set lst. f x * x $v i) = (\<Sum>x\<in>set lst. (f x \<cdot>\<^sub>v x) $v i)
[PROOF STEP]
apply(rule sum.cong[OF refl],subst index_smult_vec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set lst \<Longrightarrow> i < dim_vec x
 2. \<And>x. x \<in> set lst \<Longrightarrow> f x * x $v i = f x * x $v i
[PROOF STEP]
using i slc
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (lincomb f (set lst))
set lst \<subseteq> carrier_vec n

goal (2 subgoals):
 1. \<And>x. x \<in> set lst \<Longrightarrow> i < dim_vec x
 2. \<And>x. x \<in> set lst \<Longrightarrow> f x * x $v i = f x * x $v i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>set lst. f x * x $v i) = (\<Sum>x\<in>set lst. (f x \<cdot>\<^sub>v x) $v i)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>set lst. f x * x $v i) = (\<Sum>x\<in>set lst. (f x \<cdot>\<^sub>v x) $v i)

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
have "\<dots> = (\<Oplus>\<^bsub>V\<^esub>v\<in>set lst. f v \<cdot>\<^sub>v v) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>set lst. (f x \<cdot>\<^sub>v x) $v i) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set lst. f v \<cdot>\<^sub>v v) $v i
[PROOF STEP]
unfolding finsum_index[OF i' fcarr slc]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>set lst. (f x \<cdot>\<^sub>v x) $v i) = (\<Sum>x\<in>set lst. (f x \<cdot>\<^sub>v x) $v i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>set lst. (f x \<cdot>\<^sub>v x) $v i) = (\<Oplus>\<^bsub>V\<^esub>v\<in>set lst. f v \<cdot>\<^sub>v v) $v i

goal (1 subgoal):
 1. \<And>i. i < dim_vec (lincomb f (set lst)) \<Longrightarrow> (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(mat_of_cols n lst *\<^sub>v v) $v i = (\<Oplus>\<^bsub>V\<^esub>v\<in>set lst. f v \<cdot>\<^sub>v v) $v i
[PROOF STEP]
show "(mat_of_cols n lst *\<^sub>v v) $ i = lincomb f (set lst) $ i"
[PROOF STATE]
proof (prove)
using this:
(mat_of_cols n lst *\<^sub>v v) $v i = (\<Oplus>\<^bsub>V\<^esub>v\<in>set lst. f v \<cdot>\<^sub>v v) $v i

goal (1 subgoal):
 1. (mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i
[PROOF STEP]
by (auto simp:lincomb_def)
[PROOF STATE]
proof (state)
this:
(mat_of_cols n lst *\<^sub>v v) $v i = lincomb f (set lst) $v i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mat_of_cols n lst *\<^sub>v v = lincomb f (set lst)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interleaving_Nil_iff1:
  "interleavings [] ys zs \<longleftrightarrow> (ys = zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interleavings [] ys zs = (ys = zs)
[PROOF STEP]
using interleaving_Nil_implies_eq1
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>interleavings ?xs ?ys ?zs; ?xs = []\<rbrakk> \<Longrightarrow> ?ys = ?zs

goal (1 subgoal):
 1. interleavings [] ys zs = (ys = zs)
[PROOF STEP]
by (auto simp add: interleavings.intros(1))


[STATEMENT]
lemma len_lexext_wf: "wfP (\<lambda>x y. gt y x) \<Longrightarrow> wfP (\<lambda>xs ys. len_lexext gt ys xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP (\<lambda>x y. gt y x) \<Longrightarrow> wfP (\<lambda>xs ys. len_lexext gt ys xs)
[PROOF STEP]
unfolding wfP_def len_lexext_iff_lenlex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(x, y). gt y x} \<Longrightarrow> wf {(xs, ys). (xs, ys) \<in> lenlex {(x, y). gt y x}}
[PROOF STEP]
by (simp add: wf_lenlex)


[STATEMENT]
lemma branchI: "[| (f 0 = Gamma);
  !n . terminal subs (f n) --> f (Suc n) = f n;
  !n . ~ terminal subs (f n) --> f (Suc n) \<in> subs (f n) |] ==> branch subs Gamma f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f 0 = Gamma; \<forall>n. terminal subs (f n) \<longrightarrow> f (Suc n) = f n; \<forall>n. \<not> terminal subs (f n) \<longrightarrow> f (Suc n) \<in> subs (f n)\<rbrakk> \<Longrightarrow> branch subs Gamma f
[PROOF STEP]
by (simp add: branch_def)


[STATEMENT]
lemma e_hd_0 [simp]: "e_hd 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e_hd 0 = 0
[PROOF STEP]
using e_hd_def
[PROOF STATE]
proof (prove)
using this:
e_hd ?e \<equiv> if ?e = 0 then 0 else hd (Partial_Recursive.list_decode ?e)

goal (1 subgoal):
 1. e_hd 0 = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma arsinh_0 [simp]: "arsinh 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arsinh (0::'a) = (0::'a)
[PROOF STEP]
by (simp add: arsinh_def)


[STATEMENT]
lemma hv_minus [simp]: "Hv(-x) = -Hv x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hv (- x) = - Hv x
[PROOF STEP]
by (simp add: Hv_def quat_eq_iff)


[STATEMENT]
lemma mignotte_bound:
  assumes "f \<noteq> 0" "g dvd f" "degree g \<le> n"
  shows "\<bar>coeff g k\<bar> \<le> mignotte_bound f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
let ?bnd = 2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
let ?n = "(n - 1) choose ((n - 1) div 2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
have to_n: "(n - 1 choose k) \<le> real ?n" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (n - 1 choose k) \<le> real (n - 1 choose (n - 1) div 2)
[PROOF STEP]
using choose_approx[OF le_refl]
[PROOF STATE]
proof (prove)
using this:
?N choose ?k \<le> ?N choose ?N div 2

goal (1 subgoal):
 1. real (n - 1 choose k) \<le> real (n - 1 choose (n - 1) div 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (n - 1 choose ?k1) \<le> real (n - 1 choose (n - 1) div 2)

goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
from mignotte_bound_main[OF assms, of k]
[PROOF STATE]
proof (chain)
picking this:
\<bar>poly.coeff g k\<bar> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar>
[PROOF STEP]
have "\<bar>coeff g k\<bar> \<le>
    \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> +
    int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>poly.coeff g k\<bar> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar>

goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>poly.coeff g k\<bar> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar>

goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>poly.coeff g k\<bar> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar>

goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
have "\<dots> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> +
    int ((n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (n - 1 choose (k - 1)) * \<bar>lead_coeff f\<bar>
[PROOF STEP]
by (rule add_left_mono[OF mult_right_mono], cases k, auto)
[PROOF STATE]
proof (state)
this:
\<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (n - 1 choose (k - 1)) * \<bar>lead_coeff f\<bar>

goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (min k 1 * (n - 1 choose (k - 1))) * \<bar>lead_coeff f\<bar> \<le> \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (n - 1 choose (k - 1)) * \<bar>lead_coeff f\<bar>

goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
have "\<dots> \<le> mignotte_bound f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (n - 1 choose (k - 1)) * \<bar>lead_coeff f\<bar> \<le> mignotte_bound f n
[PROOF STEP]
unfolding mignotte_bound_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (n - 1 choose (k - 1)) * \<bar>lead_coeff f\<bar> \<le> mahler_approximation 2 (n - 1 choose (n - 1) div 2) f + int (n - 1 choose (n - 1) div 2) * \<bar>lead_coeff f\<bar>
[PROOF STEP]
by (rule add_mono[OF order.trans[OF floor_mono[OF mult_right_mono]
    mahler_approximation[of ?n f ?bnd]] mult_right_mono], insert to_n mahler_measure_ge_0, auto)
[PROOF STATE]
proof (state)
this:
\<lfloor>real (n - 1 choose k) * mahler_measure f\<rfloor> + int (n - 1 choose (k - 1)) * \<bar>lead_coeff f\<bar> \<le> mignotte_bound f n

goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n

goal (1 subgoal):
 1. \<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>poly.coeff g k\<bar> \<le> mignotte_bound f n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dickson_less_v_trans:
  assumes "dickson_less_v d m v u" and "dickson_less_v d m u w"
  shows "dickson_less_v d m v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dickson_less_v d m v w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dickson_less_v d m v u
dickson_less_v d m u w

goal (1 subgoal):
 1. dickson_less_v d m v w
[PROOF STEP]
by (auto simp add: dickson_less_v_def)


[STATEMENT]
lemma triangle_commu1:
  assumes "triangle_in_graph x y z G"
  shows "triangle_in_graph y x z G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. triangle_in_graph y x z G
[PROOF STEP]
using assms triangle_in_graph_def
[PROOF STATE]
proof (prove)
using this:
triangle_in_graph x y z G
triangle_in_graph ?x ?y ?z ?G \<equiv> {?x, ?y} \<in> uedges ?G \<and> {?y, ?z} \<in> uedges ?G \<and> {?x, ?z} \<in> uedges ?G

goal (1 subgoal):
 1. triangle_in_graph y x z G
[PROOF STEP]
by (auto simp add: insert_commute)