[STATEMENT]
lemma SA_Units_closed_fun:
  assumes "f \<in> Units (SA m)"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)"
  shows "f x \<in> carrier Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<in> carrier Q\<^sub>p
[PROOF STEP]
using SA_Units_closed SA_car_closed assms
[PROOF STATE]
proof (prove)
using this:
?f \<in> Units (SA ?n) \<Longrightarrow> ?f \<in> carrier (SA ?n)
\<lbrakk>?f \<in> carrier (SA ?m); ?x \<in> carrier (Q\<^sub>p\<^bsup>?m\<^esup>)\<rbrakk> \<Longrightarrow> ?f ?x \<in> carrier Q\<^sub>p
f \<in> Units (SA m)
x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>)

goal (1 subgoal):
 1. f x \<in> carrier Q\<^sub>p
[PROOF STEP]
by blast


[STATEMENT]
lemma f_image_is_empty: "(xs `\<^sup>f A = {}) = ({x. x \<in> A \<and> x < length xs} = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs `\<^sup>f A = {}) = ({x \<in> A. x < length xs} = {})
[PROOF STEP]
by blast


[STATEMENT]
lemma SA_constant_res_set_semialg:
  assumes "l \<in> carrier (Zp_res_ring n)"
  assumes "f \<in> carrier (SA m)"
  shows "is_semialgebraic m {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic m {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_semialgebraic m {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l}
[PROOF STEP]
have 0: "{x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l} = f  \<inverse>\<^bsub>m\<^esub> {x \<in> \<O>\<^sub>p. Qp_res x n = l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l} = f \<inverse>\<^bsub>m\<^esub> {x \<in> \<O>\<^sub>p. Qp_res x n = l}
[PROOF STEP]
unfolding evimage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l} = f -` {x \<in> \<O>\<^sub>p. Qp_res x n = l} \<inter> carrier (Q\<^sub>p\<^bsup>m\<^esup>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l} = f \<inverse>\<^bsub>m\<^esub> {x \<in> \<O>\<^sub>p. Qp_res x n = l}

goal (1 subgoal):
 1. is_semialgebraic m {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic m {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l}
[PROOF STEP]
unfolding 0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic m (f \<inverse>\<^bsub>m\<^esub> {x \<in> \<O>\<^sub>p. Qp_res x n = l})
[PROOF STEP]
by(rule evimage_is_semialg, rule assms, rule constant_res_set_semialg, rule assms)
[PROOF STATE]
proof (state)
this:
is_semialgebraic m {x \<in> carrier (Q\<^sub>p\<^bsup>m\<^esup>). f x \<in> \<O>\<^sub>p \<and> Qp_res (f x) n = l}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex1_eqI: "\<lbrakk>\<exists>!x. P x; P a; P b\<rbrakk> \<Longrightarrow> a=b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>!x. P x; P a; P b\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
by blast


[STATEMENT]
lemma Extend_SNOCs_zero_satisfies: "\<lbrakk>wf (SUC k idx) \<phi>; #\<^sub>V \<AA> = idx; lformula \<phi>\<rbrakk> \<Longrightarrow>
  Extend k 0 ((SNOC (zero (#\<^sub>V \<AA>)) ^^ i) \<AA>) P \<Turnstile> \<phi> \<longleftrightarrow> Extend k 0 \<AA> P \<Turnstile> \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.wf (SUC k idx) \<phi>; #\<^sub>V \<AA> = idx; lformula \<phi>\<rbrakk> \<Longrightarrow> (Extend k 0 ((SNOC (zero (#\<^sub>V \<AA>)) ^^ i) \<AA>) P \<Turnstile> \<phi>) = (Extend k 0 \<AA> P \<Turnstile> \<phi>)
[PROOF STEP]
by (rule satisfies_eqI)
   (auto simp: nvars_Extend nvars_SNOCs assigns_Extend assigns_SNOCs_zero LEQ_0 LESS_SUC
     dec_def gr0_conv_Suc)


[STATEMENT]
lemma \<nu>_eq_Pn: "\<nu> s = (\<Sum>i. l^i * measure_pmf.expectation (Pn' p s i) r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> s = (\<Sum>i. l ^ i * measure_pmf.expectation (Pn' p s i) r)
[PROOF STEP]
by (simp add: \<nu>_fin_eq_Pn \<nu>_eq_lim suminf_eq_lim)


[STATEMENT]
lemma smcf_dghm_smcf_proj_snd[slicing_commute]:
  "\<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>2 (smc_dg \<AA>) (smc_dg \<BB>) = smcf_dghm (\<pi>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>2 \<AA> \<BB>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>\<^sub>D\<^sub>G\<^sub>.\<^sub>2 (smc_dg \<AA>) (smc_dg \<BB>) = smcf_dghm (\<pi>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>2 \<AA> \<BB>)
[PROOF STEP]
unfolding
    smcf_proj_snd_def dghm_proj_snd_def slicing_commute[symmetric] if_distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi>\<^sub>D\<^sub>G (2\<^sub>\<nat>) (\<lambda>i. if i = []\<^sub>\<circ> \<Rightarrow> smc_dg \<AA> | otherwise \<Rightarrow> smc_dg \<BB>) (1\<^sub>\<nat>) = \<pi>\<^sub>D\<^sub>G (2\<^sub>\<nat>) (\<lambda>i. if i = []\<^sub>\<circ> \<Rightarrow> smc_dg \<AA> | otherwise \<Rightarrow> smc_dg \<BB>) (1\<^sub>\<nat>)
[PROOF STEP]
..


[STATEMENT]
lemma GreenThm_typeI_typeII_divisible_region_boundary:
  assumes
    gen_divisions: "gen_division s (cubeImage ` two_chain_typeI)"
    "gen_division s (cubeImage ` two_chain_typeII)" and
    typeI_two_cubes_trace_horizontal_boundaries:
    "two_chain_horizontal_boundary two_chain_typeI \<subseteq> \<gamma>" and
    typeII_two_cubes_trace_vertical_boundaries:
    "two_chain_vertical_boundary two_chain_typeII \<subseteq> \<gamma>" and
    boundary_of_region_is_subset_of_partition_boundaries:
    "\<gamma> \<subseteq> two_chain_boundary two_chain_typeI"
    "\<gamma> \<subseteq> two_chain_boundary two_chain_typeII"
  shows "integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
         = one_chain_line_integral F {i, j} \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
let ?F_b' = "partial_vector_derivative (\<lambda>a. F a \<bullet> i) j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
let ?F_a' = "partial_vector_derivative (\<lambda>a. F a \<bullet> j) i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
have typeI_regions_integral: "integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
using T1.GreenThm_typeI_divisible_region_boundary
        gen_divisions(1) typeI_two_cubes_trace_horizontal_boundaries
        boundary_of_region_is_subset_of_partition_boundaries(1)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>gen_division s (cubeImage ` two_chain_typeI); two_chain_horizontal_boundary two_chain_typeI \<subseteq> ?\<gamma>; ?\<gamma> \<subseteq> two_chain_boundary two_chain_typeI\<rbrakk> \<Longrightarrow> integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} ?\<gamma>
gen_division s (cubeImage ` two_chain_typeI)
two_chain_horizontal_boundary two_chain_typeI \<subseteq> \<gamma>
\<gamma> \<subseteq> two_chain_boundary two_chain_typeI

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
have typeII_regions_integral: "integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} \<gamma>
[PROOF STEP]
using T2.GreenThm_typeII_divisible_region_boundary gen_divisions(2)
         typeII_two_cubes_trace_vertical_boundaries
        boundary_of_region_is_subset_of_partition_boundaries(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>two_chain_vertical_boundary two_chain_typeII \<subseteq> ?\<gamma>; ?\<gamma> \<subseteq> two_chain_boundary two_chain_typeII\<rbrakk> \<Longrightarrow> integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} ?\<gamma>
gen_division s (cubeImage ` two_chain_typeII)
two_chain_vertical_boundary two_chain_typeII \<subseteq> \<gamma>
\<gamma> \<subseteq> two_chain_boundary two_chain_typeII

goal (1 subgoal):
 1. integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} \<gamma>

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
have integral_dis: "integral s (\<lambda>x. ?F_a' x - ?F_b' x) = integral s (\<lambda>x. ?F_a' x) + integral s (\<lambda>x. - ?F_b' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
have "\<forall>twoCube \<in> two_chain_typeII. (?F_a' has_integral integral (cubeImage twoCube) ?F_a') (cubeImage twoCube)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>twoCube\<in>two_chain_typeII. (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) (cubeImage twoCube)
[PROOF STEP]
by (simp add: analytically_valid_imp_part_deriv_integrable_on T2.F_anal_valid has_integral_iff)
[PROOF STATE]
proof (state)
this:
\<forall>twoCube\<in>two_chain_typeII. (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) (cubeImage twoCube)

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>twoCube\<in>two_chain_typeII. (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) (cubeImage twoCube)
[PROOF STEP]
have "\<And>u. u \<in> (cubeImage ` two_chain_typeII) \<Longrightarrow> (?F_a' has_integral integral u ?F_a') u"
[PROOF STATE]
proof (prove)
using this:
\<forall>twoCube\<in>two_chain_typeII. (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) (cubeImage twoCube)

goal (1 subgoal):
 1. \<And>u. u \<in> cubeImage ` two_chain_typeII \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral u (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?u \<in> cubeImage ` two_chain_typeII \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) ?u

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?u \<in> cubeImage ` two_chain_typeII \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) ?u
[PROOF STEP]
have "(?F_a' has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeII. integral img ?F_a')) s"
[PROOF STATE]
proof (prove)
using this:
?u \<in> cubeImage ` two_chain_typeII \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) ?u

goal (1 subgoal):
 1. (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeII. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))) s
[PROOF STEP]
using gen_divisions(2)
[PROOF STATE]
proof (prove)
using this:
?u \<in> cubeImage ` two_chain_typeII \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) ?u
gen_division s (cubeImage ` two_chain_typeII)

goal (1 subgoal):
 1. (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeII. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))) s
[PROOF STEP]
unfolding gen_division_def
[PROOF STATE]
proof (prove)
using this:
?u \<in> cubeImage ` two_chain_typeII \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i)) ?u
finite (cubeImage ` two_chain_typeII) \<and> \<Union> (cubeImage ` two_chain_typeII) = s \<and> pairwise (\<lambda>X Y. negligible (X \<inter> Y)) (cubeImage ` two_chain_typeII)

goal (1 subgoal):
 1. (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeII. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))) s
[PROOF STEP]
by (metis has_integral_Union)
[PROOF STATE]
proof (state)
this:
(partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeII. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))) s

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeII. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))) s
[PROOF STEP]
have F_a'_integrable: "(?F_a' integrable_on s)"
[PROOF STATE]
proof (prove)
using this:
(partial_vector_derivative (\<lambda>a. F a \<bullet> j) i has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeII. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i))) s

goal (1 subgoal):
 1. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i integrable_on s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
partial_vector_derivative (\<lambda>a. F a \<bullet> j) i integrable_on s

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
have "\<forall>twoCube \<in> two_chain_typeI. (?F_b' has_integral integral (cubeImage twoCube) ?F_b') (cubeImage twoCube)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>twoCube\<in>two_chain_typeI. (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) (cubeImage twoCube)
[PROOF STEP]
using analytically_valid_imp_part_deriv_integrable_on T1.F_anal_valid
[PROOF STATE]
proof (prove)
using this:
analytically_valid ?s ?f ?i \<Longrightarrow> partial_vector_derivative ?f ?i integrable_on ?s
\<forall>twoC\<in>two_chain_typeI. analytically_valid (cubeImage twoC) (\<lambda>x. F x \<bullet> i) j

goal (1 subgoal):
 1. \<forall>twoCube\<in>two_chain_typeI. (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) (cubeImage twoCube)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>twoCube\<in>two_chain_typeI. (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) (cubeImage twoCube)

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>twoCube\<in>two_chain_typeI. (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) (cubeImage twoCube)
[PROOF STEP]
have "\<And>u. u \<in> (cubeImage ` two_chain_typeI) \<Longrightarrow> (?F_b' has_integral integral u ?F_b') u"
[PROOF STATE]
proof (prove)
using this:
\<forall>twoCube\<in>two_chain_typeI. (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral (cubeImage twoCube) (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) (cubeImage twoCube)

goal (1 subgoal):
 1. \<And>u. u \<in> cubeImage ` two_chain_typeI \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral u (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?u \<in> cubeImage ` two_chain_typeI \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) ?u

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?u \<in> cubeImage ` two_chain_typeI \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) ?u
[PROOF STEP]
have "(?F_b' has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeI. integral img ?F_b')) s"
[PROOF STATE]
proof (prove)
using this:
?u \<in> cubeImage ` two_chain_typeI \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) ?u

goal (1 subgoal):
 1. (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeI. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))) s
[PROOF STEP]
using gen_divisions(1)
[PROOF STATE]
proof (prove)
using this:
?u \<in> cubeImage ` two_chain_typeI \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) ?u
gen_division s (cubeImage ` two_chain_typeI)

goal (1 subgoal):
 1. (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeI. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))) s
[PROOF STEP]
unfolding gen_division_def
[PROOF STATE]
proof (prove)
using this:
?u \<in> cubeImage ` two_chain_typeI \<Longrightarrow> (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral integral ?u (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j)) ?u
finite (cubeImage ` two_chain_typeI) \<and> \<Union> (cubeImage ` two_chain_typeI) = s \<and> pairwise (\<lambda>X Y. negligible (X \<inter> Y)) (cubeImage ` two_chain_typeI)

goal (1 subgoal):
 1. (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeI. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))) s
[PROOF STEP]
by (metis has_integral_Union)
[PROOF STATE]
proof (state)
this:
(partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeI. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))) s

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeI. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))) s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(partial_vector_derivative (\<lambda>a. F a \<bullet> i) j has_integral (\<Sum>img\<in>cubeImage ` two_chain_typeI. integral img (partial_vector_derivative (\<lambda>a. F a \<bullet> i) j))) s

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
[PROOF STEP]
by (simp add: F_a'_integrable Henstock_Kurzweil_Integration.integral_diff has_integral_iff)
[PROOF STATE]
proof (state)
this:
integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
have line_integral_dist: "one_chain_line_integral F {i, j} \<gamma> = one_chain_line_integral F {i} \<gamma> + one_chain_line_integral F {j} \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F {i, j} \<gamma> = one_chain_line_integral F {i} \<gamma> + one_chain_line_integral F {j} \<gamma>
[PROOF STEP]
proof (simp add: one_chain_line_integral_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i, j} g) = (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
have "k * line_integral F {i, j} g = k * line_integral F {i} g +  k * line_integral F {j} g"
      if kg: "(k,g) \<in> \<gamma>" for k g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int k * line_integral F {i, j} g = real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_int k * line_integral F {i, j} g = real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g
[PROOF STEP]
obtain twoCube_typeI where twoCube_typeI_props:
        "twoCube_typeI \<in> two_chain_typeI"
        "(k, g) \<in> boundary twoCube_typeI"
        "typeI_twoCube twoCube_typeI"
        "continuous_on (cubeImage twoCube_typeI) (\<lambda>x. F(x) \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>twoCube_typeI. \<lbrakk>twoCube_typeI \<in> two_chain_typeI; (k, g) \<in> boundary twoCube_typeI; typeI_twoCube twoCube_typeI; continuous_on (cubeImage twoCube_typeI) (\<lambda>x. F x \<bullet> i)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using boundary_of_region_is_subset_of_partition_boundaries(1) two_chain_boundary_def T1.valid_typeI_div
          T1.F_anal_valid kg
[PROOF STATE]
proof (prove)
using this:
\<gamma> \<subseteq> two_chain_boundary two_chain_typeI
two_chain_boundary ?twoChain \<equiv> \<Union> (boundary ` ?twoChain)
valid_typeI_division s two_chain_typeI
\<forall>twoC\<in>two_chain_typeI. analytically_valid (cubeImage twoC) (\<lambda>x. F x \<bullet> i) j
(k, g) \<in> \<gamma>

goal (1 subgoal):
 1. (\<And>twoCube_typeI. \<lbrakk>twoCube_typeI \<in> two_chain_typeI; (k, g) \<in> boundary twoCube_typeI; typeI_twoCube twoCube_typeI; continuous_on (cubeImage twoCube_typeI) (\<lambda>x. F x \<bullet> i)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: analytically_valid_def)
[PROOF STATE]
proof (state)
this:
twoCube_typeI \<in> two_chain_typeI
(k, g) \<in> boundary twoCube_typeI
typeI_twoCube twoCube_typeI
continuous_on (cubeImage twoCube_typeI) (\<lambda>x. F x \<bullet> i)

goal (1 subgoal):
 1. real_of_int k * line_integral F {i, j} g = real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g
[PROOF STEP]
obtain twoCube_typeII where twoCube_typeII_props:
        "twoCube_typeII \<in> two_chain_typeII"
        "(k, g) \<in> boundary twoCube_typeII"
        "typeII_twoCube twoCube_typeII"
        "continuous_on (cubeImage twoCube_typeII) (\<lambda>x. F(x) \<bullet> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>twoCube_typeII. \<lbrakk>twoCube_typeII \<in> two_chain_typeII; (k, g) \<in> boundary twoCube_typeII; typeII_twoCube twoCube_typeII; continuous_on (cubeImage twoCube_typeII) (\<lambda>x. F x \<bullet> j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using boundary_of_region_is_subset_of_partition_boundaries(2) two_chain_boundary_def T2.valid_typeII_div
          kg T2.F_anal_valid
[PROOF STATE]
proof (prove)
using this:
\<gamma> \<subseteq> two_chain_boundary two_chain_typeII
two_chain_boundary ?twoChain \<equiv> \<Union> (boundary ` ?twoChain)
valid_typeII_division s two_chain_typeII
(k, g) \<in> \<gamma>
\<forall>twoC\<in>two_chain_typeII. analytically_valid (cubeImage twoC) (\<lambda>x. F x \<bullet> j) i

goal (1 subgoal):
 1. (\<And>twoCube_typeII. \<lbrakk>twoCube_typeII \<in> two_chain_typeII; (k, g) \<in> boundary twoCube_typeII; typeII_twoCube twoCube_typeII; continuous_on (cubeImage twoCube_typeII) (\<lambda>x. F x \<bullet> j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: analytically_valid_def)
[PROOF STATE]
proof (state)
this:
twoCube_typeII \<in> two_chain_typeII
(k, g) \<in> boundary twoCube_typeII
typeII_twoCube twoCube_typeII
continuous_on (cubeImage twoCube_typeII) (\<lambda>x. F x \<bullet> j)

goal (1 subgoal):
 1. real_of_int k * line_integral F {i, j} g = real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g
[PROOF STEP]
have "line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
[PROOF STEP]
have int_exists_i: "line_integral_exists F {i} g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral_exists F {i} g
[PROOF STEP]
using T1.typeI_cube_line_integral_exists_boundary assms kg
[PROOF STATE]
proof (prove)
using this:
\<forall>(k, \<gamma>)\<in>two_chain_boundary two_chain_typeI. line_integral_exists F {i} \<gamma>
gen_division s (cubeImage ` two_chain_typeI)
gen_division s (cubeImage ` two_chain_typeII)
two_chain_horizontal_boundary two_chain_typeI \<subseteq> \<gamma>
two_chain_vertical_boundary two_chain_typeII \<subseteq> \<gamma>
\<gamma> \<subseteq> two_chain_boundary two_chain_typeI
\<gamma> \<subseteq> two_chain_boundary two_chain_typeII
(k, g) \<in> \<gamma>

goal (1 subgoal):
 1. line_integral_exists F {i} g
[PROOF STEP]
by (auto simp add: valid_two_chain_def)
[PROOF STATE]
proof (state)
this:
line_integral_exists F {i} g

goal (1 subgoal):
 1. line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
[PROOF STEP]
have int_exists_j: "line_integral_exists F {j} g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral_exists F {j} g
[PROOF STEP]
using T2.typeII_cube_line_integral_exists_boundary assms kg
[PROOF STATE]
proof (prove)
using this:
\<forall>(k, \<gamma>)\<in>two_chain_boundary two_chain_typeII. line_integral_exists F {j} \<gamma>
gen_division s (cubeImage ` two_chain_typeI)
gen_division s (cubeImage ` two_chain_typeII)
two_chain_horizontal_boundary two_chain_typeI \<subseteq> \<gamma>
two_chain_vertical_boundary two_chain_typeII \<subseteq> \<gamma>
\<gamma> \<subseteq> two_chain_boundary two_chain_typeI
\<gamma> \<subseteq> two_chain_boundary two_chain_typeII
(k, g) \<in> \<gamma>

goal (1 subgoal):
 1. line_integral_exists F {j} g
[PROOF STEP]
by (auto simp add: valid_two_chain_def)
[PROOF STATE]
proof (state)
this:
line_integral_exists F {j} g

goal (1 subgoal):
 1. line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
[PROOF STEP]
have finite: "finite {i, j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i, j}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {i, j}

goal (1 subgoal):
 1. line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
[PROOF STEP]
using line_integral_sum_gen[OF finite int_exists_i int_exists_j] R2.i_is_x_axis R2.j_is_y_axis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{i} \<union> {j} = {i, j}; {i} \<inter> {j} = {}\<rbrakk> \<Longrightarrow> line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
\<lbrakk>{i} \<union> {j} = {i, j}; {i} \<inter> {j} = {}\<rbrakk> \<Longrightarrow> line_integral_exists F {i, j} g
i = (1, 0)
j = (0, 1)

goal (1 subgoal):
 1. line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g

goal (1 subgoal):
 1. real_of_int k * line_integral F {i, j} g = real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g
[PROOF STEP]
show "k * line_integral F {i, j} g = k * line_integral F {i} g + k * line_integral F {j} g"
[PROOF STATE]
proof (prove)
using this:
line_integral F {i, j} g = line_integral F {i} g + line_integral F {j} g

goal (1 subgoal):
 1. real_of_int k * line_integral F {i, j} g = real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g
[PROOF STEP]
by (simp add: distrib_left)
[PROOF STATE]
proof (state)
this:
real_of_int k * line_integral F {i, j} g = real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(?k, ?g) \<in> \<gamma> \<Longrightarrow> real_of_int ?k * line_integral F {i, j} ?g = real_of_int ?k * line_integral F {i} ?g + real_of_int ?k * line_integral F {j} ?g

goal (1 subgoal):
 1. (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i, j} g) = (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?k, ?g) \<in> \<gamma> \<Longrightarrow> real_of_int ?k * line_integral F {i, j} ?g = real_of_int ?k * line_integral F {i} ?g + real_of_int ?k * line_integral F {j} ?g
[PROOF STEP]
have line_integral_distrib:
          "(\<Sum>(k,g)\<in>\<gamma>. k * line_integral F {i, j} g) =
           (\<Sum>(k,g)\<in>\<gamma>. k * line_integral F {i} g +  k * line_integral F {j} g)"
[PROOF STATE]
proof (prove)
using this:
(?k, ?g) \<in> \<gamma> \<Longrightarrow> real_of_int ?k * line_integral F {i, j} ?g = real_of_int ?k * line_integral F {i} ?g + real_of_int ?k * line_integral F {j} ?g

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i, j} g) = (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)
[PROOF STEP]
by (force intro: sum.cong split_cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i, j} g) = (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i, j} g) = (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
have "(\<lambda>x. (case x of (k, g) \<Rightarrow> (k::int) * line_integral F {i} g) + (case x of (k, g) \<Rightarrow> (k::int) * line_integral F {j} g)) =
                                     (\<lambda>x. (case x of (k, g) \<Rightarrow> (k * line_integral F {i} g) +  (k::int) * line_integral F {j} g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)) = (\<lambda>x. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)
[PROOF STEP]
using comm_monoid_add_class.sum.distrib
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>?A. ?g x + ?h x) = sum ?g ?A + sum ?h ?A

goal (1 subgoal):
 1. (\<lambda>x. (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)) = (\<lambda>x. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)) = (\<lambda>x. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i, j} g) = (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (\<Sum>x\<in>\<gamma>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)) = (\<lambda>x. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)
[PROOF STEP]
show "(\<Sum>(k, g)\<in>\<gamma>. k * line_integral F {i, j} g) =
          (\<Sum>(k, g)\<in>\<gamma>. (k::int) * line_integral F {i} g) + (\<Sum>(k, g)\<in>\<gamma>. (k::int) * line_integral F {j} g)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)) = (\<lambda>x. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i, j} g) = (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i} g) + (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {j} g)
[PROOF STEP]
using comm_monoid_add_class.sum.distrib[of "(\<lambda>(k, g).  k * line_integral F {i} g)" "(\<lambda>(k, g).  k * line_integral F {j} g)" \<gamma>]
        line_integral_distrib
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)) = (\<lambda>x. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)
(\<Sum>x\<in>\<gamma>. (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) + (case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {j} g)) = (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i} g) + (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {j} g)
(\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i, j} g) = (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i} g + real_of_int k * line_integral F {j} g)

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i, j} g) = (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i} g) + (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {j} g)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i, j} g) = (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {i} g) + (\<Sum>(k, g)\<in>\<gamma>. real_of_int k * line_integral F {j} g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i, j} \<gamma> = one_chain_line_integral F {i} \<gamma> + one_chain_line_integral F {j} \<gamma>

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
using integral_dis line_integral_dist typeI_regions_integral typeII_regions_integral
[PROOF STATE]
proof (prove)
using this:
integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = integral s (partial_vector_derivative (\<lambda>a. F a \<bullet> j) i) + integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x)
one_chain_line_integral F {i, j} \<gamma> = one_chain_line_integral F {i} \<gamma> + one_chain_line_integral F {j} \<gamma>
integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
integral s (partial_vector_derivative (\<lambda>x. F x \<bullet> j) i) = one_chain_line_integral F {j} \<gamma>

goal (1 subgoal):
 1. integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral s (\<lambda>x. partial_vector_derivative (\<lambda>a. F a \<bullet> j) i x - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i, j} \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem tortoise_hare:
  "\<lbrace>\<langle>True\<rangle>\<rbrace> tortoise_hare \<lbrace>nu \<^bold>\<in> \<langle>{0<..lambda + mu}\<rangle> \<^bold>\<and> l \<^bold>= \<langle>lambda\<rangle> \<^bold>\<and> m \<^bold>= \<langle>mu\<rangle>\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace>\<lambda>s. True\<rbrace> tortoise_hare \<lbrace>\<lambda>s. nu s \<in> {0<..lambda + mu} \<and> l s = lambda \<and> m s = mu\<rbrace>
[PROOF STEP]
unfolding tortoise_hare_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace>\<lambda>s. True\<rbrace> find_nu ;; find_mu ;; find_lambda \<lbrace>\<lambda>s. nu s \<in> {0<..lambda + mu} \<and> l s = lambda \<and> m s = mu\<rbrace>
[PROOF STEP]
by (rule find_nu find_mu find_lambda wp_intro)+


[STATEMENT]
lemma gbinomial_reduce_nat: "0 < k \<Longrightarrow> a gchoose k = (a - 1) gchoose (k - 1) + ((a - 1) gchoose k)"
  for a :: "'a::field_char_0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> a gchoose k = a - (1::'a) gchoose (k - 1) + (a - (1::'a) gchoose k)
[PROOF STEP]
by (metis Suc_pred' diff_add_cancel gbinomial_Suc_Suc)


[STATEMENT]
lemma f_Exec_Stream_expand_snoc: "
  \<lbrakk> 0 < k; n < length xs \<rbrakk> \<Longrightarrow>
  f_Exec_Comp_Stream trans_fun (xs \<odot>\<^sub>f k) c \<up> (n * k) \<down> k =
  f_Exec_Comp_Stream trans_fun (xs ! n # \<NoMsg>\<^bsup>k - Suc 0\<^esup>)
    (f_Exec_Comp trans_fun (xs \<down> n \<odot>\<^sub>f k) c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; n < length xs\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream trans_fun (xs \<odot> k) c \<up> (n * k) \<down> k = f_Exec_Comp_Stream trans_fun (xs ! n # NoMsg\<^bsup>k - Suc 0\<^esup>) (f_Exec_Comp trans_fun (xs \<down> n \<odot> k) c)
[PROOF STEP]
by (simp add: f_Exec_Stream_drop f_Exec_Stream_take f_expand_take_mod f_expand_drop_mod drop_take_1)


[STATEMENT]
lemma i_Exec_Stream_Acc_Output__State_Idle_nth[rule_format]: "
  \<lbrakk> 0 < l; l \<le> k; Exec_Equal_State localState trans_fun;
    \<forall>n\<le>i. State_Idle localState output_fun trans_fun (
      i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n) \<rbrakk> \<Longrightarrow>
  i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input c i =
  i_Exec_Comp_Stream_Acc_Output l output_fun trans_fun input c i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; \<forall>n\<le>i. State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n)\<rbrakk> \<Longrightarrow> i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input c i = i_Exec_Comp_Stream_Acc_Output l output_fun trans_fun input c i
[PROOF STEP]
apply (simp only: i_Exec_Stream_Acc_Output_nth_f_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; \<forall>n\<le>i. State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n)\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream_Acc_Output k output_fun trans_fun (input \<Down> Suc i) c ! i = f_Exec_Comp_Stream_Acc_Output l output_fun trans_fun (input \<Down> Suc i) c ! i
[PROOF STEP]
apply (rule f_Exec_Stream_Acc_Output__State_Idle_nth)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; \<forall>n\<le>i. State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n)\<rbrakk> \<Longrightarrow> 0 < l
 2. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; \<forall>n\<le>i. State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n)\<rbrakk> \<Longrightarrow> l \<le> k
 3. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; \<forall>n\<le>i. State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n)\<rbrakk> \<Longrightarrow> Exec_Equal_State ?localState8 trans_fun
 4. \<And>n. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; \<forall>n\<le>i. State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n); n \<le> i\<rbrakk> \<Longrightarrow> State_Idle ?localState8 output_fun trans_fun (f_Exec_Comp_Stream_Acc_LocalState l ?localState8 trans_fun (input \<Down> Suc i) c ! n)
 5. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; \<forall>n\<le>i. State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n)\<rbrakk> \<Longrightarrow> i < length (input \<Down> Suc i)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; \<forall>n\<le>i. State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n); n \<le> i\<rbrakk> \<Longrightarrow> State_Idle localState output_fun trans_fun (f_Exec_Comp_Stream_Acc_LocalState l localState trans_fun (input \<Down> Suc i) c ! n)
[PROOF STEP]
apply (drule_tac x=n in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < l; l \<le> k; Exec_Equal_State localState trans_fun; n \<le> i; n \<le> i \<longrightarrow> State_Idle localState output_fun trans_fun (i_Exec_Comp_Stream_Acc_LocalState l localState trans_fun input c n)\<rbrakk> \<Longrightarrow> State_Idle localState output_fun trans_fun (f_Exec_Comp_Stream_Acc_LocalState l localState trans_fun (input \<Down> Suc i) c ! n)
[PROOF STEP]
apply (simp add: f_Exec_Stream_Acc_LocalState_nth_eq_i_nth)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem partition_into_winning_regions:
  shows "V = winning_region Even \<union> winning_region Odd"
    and "winning_region Even \<inter> winning_region Odd = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V = winning_region Even \<union> winning_region Odd &&& winning_region Even \<inter> winning_region Odd = {}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. V \<subseteq> winning_region Even \<union> winning_region Odd
 2. winning_region Even \<union> winning_region Odd \<subseteq> V
 3. winning_region Even \<inter> winning_region Odd = {}
[PROOF STEP]
show "V \<subseteq> winning_region Even \<union> winning_region Odd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<subseteq> winning_region Even \<union> winning_region Odd
[PROOF STEP]
by (rule subsetI) (metis (full_types) Un_iff other_other_player positional_strategy_exists)
[PROOF STATE]
proof (state)
this:
V \<subseteq> winning_region Even \<union> winning_region Odd

goal (2 subgoals):
 1. winning_region Even \<union> winning_region Odd \<subseteq> V
 2. winning_region Even \<inter> winning_region Odd = {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. winning_region Even \<union> winning_region Odd \<subseteq> V
 2. winning_region Even \<inter> winning_region Odd = {}
[PROOF STEP]
show "winning_region Even \<union> winning_region Odd \<subseteq> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winning_region Even \<union> winning_region Odd \<subseteq> V
[PROOF STEP]
by (rule subsetI) (meson Un_iff subsetCE winning_region_in_V)
[PROOF STATE]
proof (state)
this:
winning_region Even \<union> winning_region Odd \<subseteq> V

goal (1 subgoal):
 1. winning_region Even \<inter> winning_region Odd = {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winning_region Even \<inter> winning_region Odd = {}
[PROOF STEP]
show "winning_region Even \<inter> winning_region Odd = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winning_region Even \<inter> winning_region Odd = {}
[PROOF STEP]
using winning_strategy_only_for_one_player[of Even]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>strategy Even ?\<sigma>; winning_strategy Even ?\<sigma> ?v; strategy Even** ?\<sigma>'; winning_strategy Even** ?\<sigma>' ?v; ?v \<in> V\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. winning_region Even \<inter> winning_region Odd = {}
[PROOF STEP]
unfolding winning_region_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>strategy Even ?\<sigma>; winning_strategy Even ?\<sigma> ?v; strategy Even** ?\<sigma>'; winning_strategy Even** ?\<sigma>' ?v; ?v \<in> V\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. {v \<in> V. \<exists>\<sigma>. strategy Even \<sigma> \<and> winning_strategy Even \<sigma> v} \<inter> {v \<in> V. \<exists>\<sigma>. strategy Odd \<sigma> \<and> winning_strategy Odd \<sigma> v} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
winning_region Even \<inter> winning_region Odd = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma union_lcomm: "M + (N + K) = N + (M + (K::'a multiset))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M + (N + K) = N + (M + K)
[PROOF STEP]
by (fact add.left_commute)


[STATEMENT]
theorem integral_Markov_inequality':
  fixes u :: "'a \<Rightarrow> real"
  assumes [measurable]: "set_integrable M A u" and "A \<in> sets M"
  assumes "AE x in M. x \<in> A \<longrightarrow> u x \<ge> 0" and "0 < (c::real)"
  shows "emeasure M {x\<in>A. u x \<ge> c} \<le> (1/c::real) * (\<integral>x\<in>A. u x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
have "(\<lambda>x. u x * indicator A x) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. u x * indicat_real A x) \<in> borel_measurable M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set_integrable M A u
A \<in> sets M
AE x\<in>A in M. 0 \<le> u x
0 < c

goal (1 subgoal):
 1. (\<lambda>x. u x * indicat_real A x) \<in> borel_measurable M
[PROOF STEP]
by (auto simp: set_integrable_def mult_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. u x * indicat_real A x) \<in> borel_measurable M

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
hence "(\<lambda>x. ennreal (u x * indicator A x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. u x * indicat_real A x) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. ennreal (u x * indicat_real A x)) \<in> borel_measurable M
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ennreal (u x * indicat_real A x)) \<in> borel_measurable M

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ennreal (u x * indicat_real A x)) \<in> borel_measurable M

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
have "(\<lambda>x. ennreal (u x * indicator A x)) = (\<lambda>x. ennreal (u x) * indicator A x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ennreal (u x * indicat_real A x)) = (\<lambda>x. ennreal (u x) * indicator A x)
[PROOF STEP]
by (intro ext) (auto simp: indicator_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ennreal (u x * indicat_real A x)) = (\<lambda>x. ennreal (u x) * indicator A x)

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. ennreal (u x) * indicator A x) \<in> borel_measurable M
[PROOF STEP]
have meas: "\<dots> \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ennreal (u x) * indicator A x) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. ennreal (u x) * indicator A x) \<in> borel_measurable M
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ennreal (u x) * indicator A x) \<in> borel_measurable M

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
AE x\<in>A in M. 0 \<le> u x
[PROOF STEP]
have AE: "AE x in M. 0 \<le> u x * indicator A x"
[PROOF STATE]
proof (prove)
using this:
AE x\<in>A in M. 0 \<le> u x

goal (1 subgoal):
 1. AE x in M. 0 \<le> u x * indicat_real A x
[PROOF STEP]
by eventually_elim (auto simp: indicator_def)
[PROOF STATE]
proof (state)
this:
AE x in M. 0 \<le> u x * indicat_real A x

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
have nonneg: "set_lebesgue_integral M A u \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> set_lebesgue_integral M A u
[PROOF STEP]
unfolding set_lebesgue_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> LINT x|M. indicat_real A x *\<^sub>R u x
[PROOF STEP]
by (intro Bochner_Integration.integral_nonneg_AE eventually_mono[OF AE]) (auto simp: mult_ac)
[PROOF STATE]
proof (state)
this:
0 \<le> set_lebesgue_integral M A u

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
have A: "A \<subseteq> space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> space M
[PROOF STEP]
using \<open>A \<in> sets M\<close>
[PROOF STATE]
proof (prove)
using this:
A \<in> sets M

goal (1 subgoal):
 1. A \<subseteq> space M
[PROOF STEP]
by (simp add: sets.sets_into_space)
[PROOF STATE]
proof (state)
this:
A \<subseteq> space M

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
have "{x \<in> A. u x \<ge> c} = {x \<in> A. ennreal(1/c) * u x \<ge> 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> A. c \<le> u x} = {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)}
[PROOF STEP]
using \<open>c>0\<close> A
[PROOF STATE]
proof (prove)
using this:
0 < c
A \<subseteq> space M

goal (1 subgoal):
 1. {x \<in> A. c \<le> u x} = {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)}
[PROOF STEP]
by (auto simp: ennreal_mult'[symmetric])
[PROOF STATE]
proof (state)
this:
{x \<in> A. c \<le> u x} = {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)}

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x \<in> A. c \<le> u x} = {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)}
[PROOF STEP]
have "emeasure M {x \<in> A. u x \<ge> c} = emeasure M ({x \<in> A. ennreal(1/c) * u x \<ge> 1})"
[PROOF STATE]
proof (prove)
using this:
{x \<in> A. c \<le> u x} = {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)}

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} = emeasure M {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> A. c \<le> u x} = emeasure M {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)}

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> A. c \<le> u x} = emeasure M {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)}

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
have "... \<le> ennreal(1/c) * (\<integral>\<^sup>+ x. ennreal(u x) * indicator A x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)} \<le> ennreal (1 / c) * (\<integral>\<^sup>+x\<in>A. ennreal (u x)\<partial>M)
[PROOF STEP]
by (intro nn_integral_Markov_inequality meas assms)
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)} \<le> ennreal (1 / c) * (\<integral>\<^sup>+x\<in>A. ennreal (u x)\<partial>M)

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> A. 1 \<le> ennreal (1 / c) * ennreal (u x)} \<le> ennreal (1 / c) * (\<integral>\<^sup>+x\<in>A. ennreal (u x)\<partial>M)

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
have "(\<integral>\<^sup>+ x. ennreal(u x) * indicator A x \<partial>M) = ennreal (set_lebesgue_integral M A u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>A. ennreal (u x)\<partial>M = ennreal (set_lebesgue_integral M A u)
[PROOF STEP]
unfolding set_lebesgue_integral_def nn_integral_set_ennreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (u x * indicat_real A x) \<partial>M = ennreal (LINT x|M. indicat_real A x *\<^sub>R u x)
[PROOF STEP]
using assms AE
[PROOF STATE]
proof (prove)
using this:
set_integrable M A u
A \<in> sets M
AE x\<in>A in M. 0 \<le> u x
0 < c
AE x in M. 0 \<le> u x * indicat_real A x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (u x * indicat_real A x) \<partial>M = ennreal (LINT x|M. indicat_real A x *\<^sub>R u x)
[PROOF STEP]
by (subst nn_integral_eq_integral) (simp_all add: mult_ac set_integrable_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>A. ennreal (u x)\<partial>M = ennreal (set_lebesgue_integral M A u)

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c) * ennreal (set_lebesgue_integral M A u)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c) * ennreal (set_lebesgue_integral M A u)

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
using \<open>c > 0\<close> nonneg
[PROOF STATE]
proof (prove)
using this:
emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c) * ennreal (set_lebesgue_integral M A u)
0 < c
0 \<le> set_lebesgue_integral M A u

goal (1 subgoal):
 1. emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)
[PROOF STEP]
by (subst ennreal_mult) auto
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> A. c \<le> u x} \<le> ennreal (1 / c * set_lebesgue_integral M A u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(X = Y \<union> Z) =
    (Y \<subseteq> X \<and> Z \<subseteq> X \<and> (\<forall>V. Y \<subseteq> V \<and> Z \<subseteq> V \<longrightarrow> X \<subseteq> V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X = Y \<union> Z) = (Y \<subseteq> X \<and> Z \<subseteq> X \<and> (\<forall>V. Y \<subseteq> V \<and> Z \<subseteq> V \<longrightarrow> X \<subseteq> V))
[PROOF STEP]
by blast


[STATEMENT]
lemma jordan_matrix_char_poly:
  "char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1:] ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
let ?n = "sum_list (map fst n_as)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
have "diag_mat
     ([:0, 1:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (jordan_matrix n_as)) =
    concat (map (\<lambda>(n, a). replicate n [:- a, 1:]) n_as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (jordan_matrix n_as)) = concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)
[PROOF STEP]
unfolding jordan_matrix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as))) = concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)
[PROOF STEP]
proof (induct n_as)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
case (Cons na n_as)
[PROOF STATE]
proof (state)
this:
diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as)

goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
obtain n a where na: "na = (n,a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n a. na = (n, a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
na = (n, a)

goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
let ?n2 = "sum_list (map fst n_as)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
note fbo = four_block_one_mat
[PROOF STATE]
proof (state)
this:
four_block_mat (1\<^sub>m ?n1.0) (0\<^sub>m ?n1.0 ?n2.0) (0\<^sub>m ?n2.0 ?n1.0) (1\<^sub>m ?n2.0) = 1\<^sub>m (?n1.0 + ?n2.0)

goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
note mz = zero_carrier_mat
[PROOF STATE]
proof (state)
this:
0\<^sub>m ?nr ?nc \<in> carrier_mat ?nr ?nc

goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
note mo = one_carrier_mat
[PROOF STATE]
proof (state)
this:
1\<^sub>m ?n \<in> carrier_mat ?n ?n

goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
have mA: "\<And> A. A \<in> carrier_mat (dim_row A) (dim_col A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. A \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
unfolding carrier_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. A \<in> {m. dim_row m = dim_row A \<and> dim_col m = dim_col A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?A \<in> carrier_mat (dim_row ?A) (dim_col ?A)

goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
let ?Bs = "map (\<lambda>(x, y). jordan_block x y) n_as"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
let ?B = "diag_block_mat ?Bs"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
from jordan_matrix_dim[of n_as, unfolded jordan_matrix_def]
[PROOF STATE]
proof (chain)
picking this:
dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)
dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)
[PROOF STEP]
have dimB: "dim_row ?B = ?n2" "dim_col ?B = ?n2"
[PROOF STATE]
proof (prove)
using this:
dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)
dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)

goal (1 subgoal):
 1. dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as) &&& dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)
dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)

goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
hence B: "?B \<in> carrier_mat ?n2 ?n2"
[PROOF STATE]
proof (prove)
using this:
dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)
dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)

goal (1 subgoal):
 1. diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as) \<in> carrier_mat (sum_list (map fst n_as)) (sum_list (map fst n_as))
[PROOF STEP]
unfolding carrier_mat_def
[PROOF STATE]
proof (prove)
using this:
dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)
dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)) = sum_list (map fst n_as)

goal (1 subgoal):
 1. diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as) \<in> {m. dim_row m = sum_list (map fst n_as) \<and> dim_col m = sum_list (map fst n_as)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as) \<in> carrier_mat (sum_list (map fst n_as)) (sum_list (map fst n_as))

goal (2 subgoals):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
 2. \<And>a n_as. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) n_as))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) n_as) \<Longrightarrow> diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (a # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (a # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (a # n_as))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (na # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (na # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (na # n_as))
[PROOF STEP]
unfolding na fbo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst ((n, a) # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) ((n, a) # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) ((n, a) # n_as))
[PROOF STEP]
apply (simp add: Let_def fbo[symmetric] del: fbo)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m four_block_mat (1\<^sub>m n) (0\<^sub>m n (sum_list (map fst n_as))) (0\<^sub>m (sum_list (map fst n_as)) n) (1\<^sub>m (sum_list (map fst n_as))) + map_mat (\<lambda>a. [:- a:]) (four_block_mat (jordan_block n a) (0\<^sub>m n (dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)))) (0\<^sub>m (dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as))) n) (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)))) = replicate n [:- a, 1::'a:] @ concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)
[PROOF STEP]
apply (subst smult_four_block_mat[OF mo mz mz mo])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat (four_block_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m n) ([:0::'a, 1::'a:] \<cdot>\<^sub>m 0\<^sub>m n (sum_list (map fst n_as))) ([:0::'a, 1::'a:] \<cdot>\<^sub>m 0\<^sub>m (sum_list (map fst n_as)) n) ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as))) + map_mat (\<lambda>a. [:- a:]) (four_block_mat (jordan_block n a) (0\<^sub>m n (dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)))) (0\<^sub>m (dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as))) n) (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)))) = replicate n [:- a, 1::'a:] @ concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)
[PROOF STEP]
apply (subst map_four_block_mat[OF jordan_block_carrier mz mz mA])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat (four_block_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m n) ([:0::'a, 1::'a:] \<cdot>\<^sub>m 0\<^sub>m n (sum_list (map fst n_as))) ([:0::'a, 1::'a:] \<cdot>\<^sub>m 0\<^sub>m (sum_list (map fst n_as)) n) ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as))) + four_block_mat (map_mat (\<lambda>a. [:- a:]) (jordan_block n a)) (map_mat (\<lambda>a. [:- a:]) (0\<^sub>m n (dim_col (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as))))) (map_mat (\<lambda>a. [:- a:]) (0\<^sub>m (dim_row (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as))) n)) (map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)))) = replicate n [:- a, 1::'a:] @ concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)
[PROOF STEP]
apply (subst add_four_block_mat[of _ n n _ ?n2 _ ?n2], auto simp: dimB B)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat (four_block_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m n + map_mat (\<lambda>a. [:- a:]) (jordan_block n a)) (map_mat (\<lambda>a. [:- a:]) (0\<^sub>m n (sum_list (map fst n_as)))) (map_mat (\<lambda>a. [:- a:]) (0\<^sub>m (sum_list (map fst n_as)) n)) ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as)))) = replicate n [:- a, 1::'a:] @ concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)
[PROOF STEP]
apply (subst diag_four_block_mat[of _ n _ ?n2], auto simp: dimB B)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m n + map_mat (\<lambda>a. [:- a:]) (jordan_block n a)) @ diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>(x, y). jordan_block x y) n_as))) = replicate n [:- a, 1::'a:] @ concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)
[PROOF STEP]
apply (subst Cons, auto simp: jordan_block_def diag_mat_def,
      intro nth_equalityI, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst (na # n_as))) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) (na # n_as)))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) (na # n_as))

goal (1 subgoal):
 1. diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst [])) + map_mat (\<lambda>a. [:- a:]) (diag_block_mat (map (\<lambda>a. case a of (a, b) \<Rightarrow> jordan_block a b) []))) = concat (map (\<lambda>a. case a of (n, a) \<Rightarrow> replicate n [:- a, 1::'a:]) [])
[PROOF STEP]
qed (force simp: diag_mat_def)
[PROOF STATE]
proof (state)
this:
diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (jordan_matrix n_as)) = concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)

goal (1 subgoal):
 1. char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (jordan_matrix n_as)) = concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)

goal (1 subgoal):
 1. char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
have "prod_list ... = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1:] ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
by (induct n_as, auto)
[PROOF STATE]
proof (state)
this:
prod_list (concat (map (\<lambda>(n, a). replicate n [:- a, 1::'a:]) n_as)) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)

goal (1 subgoal):
 1. char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prod_list (diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (jordan_matrix n_as))) = (\<Prod>a\<leftarrow>n_as. case a of (n, a) \<Rightarrow> [:- a, 1::'a:] ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prod_list (diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (jordan_matrix n_as))) = (\<Prod>a\<leftarrow>n_as. case a of (n, a) \<Rightarrow> [:- a, 1::'a:] ^ n)

goal (1 subgoal):
 1. char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
unfolding char_poly_defs
[PROOF STATE]
proof (prove)
using this:
prod_list (diag_mat ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (sum_list (map fst n_as)) + map_mat (\<lambda>a. [:- a:]) (jordan_matrix n_as))) = (\<Prod>a\<leftarrow>n_as. case a of (n, a) \<Rightarrow> [:- a, 1::'a:] ^ n)

goal (1 subgoal):
 1. det ([:0::'a, 1::'a:] \<cdot>\<^sub>m 1\<^sub>m (dim_row (jordan_matrix n_as)) + map_mat (\<lambda>a. [:- a:]) (jordan_matrix n_as)) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)
[PROOF STEP]
by (subst det_upper_triangular[of _ ?n], auto simp: jordan_matrix_upper_triangular)
[PROOF STATE]
proof (state)
this:
char_poly (jordan_matrix n_as) = (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n)

goal:
No subgoals!
[PROOF STEP]
qed