[STATEMENT]
lemma det_four_block_mat_lower_right_id:
  assumes A: "A \<in> carrier_mat m m"
and B: "B = 0\<^sub>m m (n-m)"
and C: "C = 0\<^sub>m (n-m) m"
and D: "D = 1\<^sub>m (n-m)"
and "n>m"
shows "Determinant.det (four_block_mat A B C D) = Determinant.det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat m m
B = 0\<^sub>m m (n - m)
C = 0\<^sub>m (n - m) m
D = 1\<^sub>m (n - m)
m < n

goal (1 subgoal):
 1. Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
proof (induct n arbitrary: A B C D)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (0 - m); C = 0\<^sub>m (0 - m) m; D = 1\<^sub>m (0 - m); m < 0\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
 2. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat m m
B = 0\<^sub>m m (0 - m)
C = 0\<^sub>m (0 - m) m
D = 1\<^sub>m (0 - m)
m < 0

goal (2 subgoals):
 1. \<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (0 - m); C = 0\<^sub>m (0 - m) m; D = 1\<^sub>m (0 - m); m < 0\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
 2. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat m m
B = 0\<^sub>m m (0 - m)
C = 0\<^sub>m (0 - m) m
D = 1\<^sub>m (0 - m)
m < 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat m m
B = 0\<^sub>m m (0 - m)
C = 0\<^sub>m (0 - m) m
D = 1\<^sub>m (0 - m)
m < 0

goal (1 subgoal):
 1. Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Determinant.det (four_block_mat A B C D) = Determinant.det A

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A \<in> carrier_mat m m; ?B = 0\<^sub>m m (n - m); ?C = 0\<^sub>m (n - m) m; ?D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat ?A ?B ?C ?D) = Determinant.det ?A
A \<in> carrier_mat m m
B = 0\<^sub>m m (Suc n - m)
C = 0\<^sub>m (Suc n - m) m
D = 1\<^sub>m (Suc n - m)
m < Suc n

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
let ?block = "(four_block_mat A B C D)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
let ?B = "Matrix.mat m (n-m) (\<lambda>(i,j). 0)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
let ?C = "Matrix.mat (n-m) m (\<lambda>(i,j). 0)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
let ?D = "1\<^sub>m (n-m)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have mat_eq: "(mat_delete ?block n n) = four_block_mat A ?B ?C ?D" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_delete (four_block_mat A B C D) n n = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))
[PROOF STEP]
proof (rule eq_matI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
assume i: "i < dim_row (four_block_mat A ?B ?C ?D)"
      and j: "j < dim_col (four_block_mat A ?B ?C ?D)"
[PROOF STATE]
proof (state)
this:
i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
let ?f = " (if i < dim_row A then if j < dim_col A then A $$ (i, j) else B $$ (i, j - dim_col A)
     else if j < dim_col A then C $$ (i - dim_row A, j) else D $$ (i - dim_row A, j - dim_col A))"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
let ?g = "(if i < dim_row A then if j < dim_col A then A $$ (i, j) else ?B $$ (i, j - dim_col A)
     else if j < dim_col A then ?C $$ (i - dim_row A, j) else ?D $$ (i - dim_row A, j - dim_col A))"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
have "(mat_delete ?block n n) $$ (i,j) = ?block $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A B C D $$ (i, j)
[PROOF STEP]
using i j Suc.prems
[PROOF STATE]
proof (prove)
using this:
i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
A \<in> carrier_mat m m
B = 0\<^sub>m m (Suc n - m)
C = 0\<^sub>m (Suc n - m) m
D = 1\<^sub>m (Suc n - m)
m < Suc n

goal (1 subgoal):
 1. mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A B C D $$ (i, j)
[PROOF STEP]
unfolding mat_delete_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
A \<in> carrier_mat m m
B = 0\<^sub>m m (Suc n - m)
C = 0\<^sub>m (Suc n - m) m
D = 1\<^sub>m (Suc n - m)
m < Suc n

goal (1 subgoal):
 1. Matrix.mat (dim_row (four_block_mat A B C D) - 1) (dim_col (four_block_mat A B C D) - 1) (\<lambda>(i', j'). four_block_mat A B C D $$ (if i' < n then i' else Suc i', if j' < n then j' else Suc j')) $$ (i, j) = four_block_mat A B C D $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A B C D $$ (i, j)

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A B C D $$ (i, j)

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
have "... = ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D $$ (i, j) = (if i < dim_row A then if j < dim_col A then A $$ (i, j) else B $$ (i, j - dim_col A) else if j < dim_col A then C $$ (i - dim_row A, j) else D $$ (i - dim_row A, j - dim_col A))
[PROOF STEP]
by (rule index_mat_four_block, insert Suc.prems i j, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (i, j) = (if i < dim_row A then if j < dim_col A then A $$ (i, j) else B $$ (i, j - dim_col A) else if j < dim_col A then C $$ (i - dim_row A, j) else D $$ (i - dim_row A, j - dim_col A))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (i, j) = (if i < dim_row A then if j < dim_col A then A $$ (i, j) else B $$ (i, j - dim_col A) else if j < dim_col A then C $$ (i - dim_row A, j) else D $$ (i - dim_row A, j - dim_col A))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
have "... = ?g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dim_row A then if j < dim_col A then A $$ (i, j) else B $$ (i, j - dim_col A) else if j < dim_col A then C $$ (i - dim_row A, j) else D $$ (i - dim_row A, j - dim_col A)) = (if i < dim_row A then if j < dim_col A then A $$ (i, j) else Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a) $$ (i, j - dim_col A) else if j < dim_col A then Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a) $$ (i - dim_row A, j) else 1\<^sub>m (n - m) $$ (i - dim_row A, j - dim_col A))
[PROOF STEP]
using i j Suc.prems
[PROOF STATE]
proof (prove)
using this:
i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
A \<in> carrier_mat m m
B = 0\<^sub>m m (Suc n - m)
C = 0\<^sub>m (Suc n - m) m
D = 1\<^sub>m (Suc n - m)
m < Suc n

goal (1 subgoal):
 1. (if i < dim_row A then if j < dim_col A then A $$ (i, j) else B $$ (i, j - dim_col A) else if j < dim_col A then C $$ (i - dim_row A, j) else D $$ (i - dim_row A, j - dim_col A)) = (if i < dim_row A then if j < dim_col A then A $$ (i, j) else Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a) $$ (i, j - dim_col A) else if j < dim_col A then Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a) $$ (i - dim_row A, j) else 1\<^sub>m (n - m) $$ (i - dim_row A, j - dim_col A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if i < dim_row A then if j < dim_col A then A $$ (i, j) else B $$ (i, j - dim_col A) else if j < dim_col A then C $$ (i - dim_row A, j) else D $$ (i - dim_row A, j - dim_col A)) = (if i < dim_row A then if j < dim_col A then A $$ (i, j) else Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a) $$ (i, j - dim_col A) else if j < dim_col A then Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a) $$ (i - dim_row A, j) else 1\<^sub>m (n - m) $$ (i - dim_row A, j - dim_col A))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if i < dim_row A then if j < dim_col A then A $$ (i, j) else B $$ (i, j - dim_col A) else if j < dim_col A then C $$ (i - dim_row A, j) else D $$ (i - dim_row A, j - dim_col A)) = (if i < dim_row A then if j < dim_col A then A $$ (i, j) else Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a) $$ (i, j - dim_col A) else if j < dim_col A then Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a) $$ (i - dim_row A, j) else 1\<^sub>m (n - m) $$ (i - dim_row A, j - dim_col A))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
have "... = four_block_mat A ?B ?C ?D $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i < dim_row A then if j < dim_col A then A $$ (i, j) else Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a) $$ (i, j - dim_col A) else if j < dim_col A then Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a) $$ (i - dim_row A, j) else 1\<^sub>m (n - m) $$ (i - dim_row A, j - dim_col A)) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
[PROOF STEP]
by (rule index_mat_four_block[symmetric], insert Suc.prems i j, auto)
[PROOF STATE]
proof (state)
this:
(if i < dim_row A then if j < dim_col A then A $$ (i, j) else Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a) $$ (i, j - dim_col A) else if j < dim_col A then Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a) $$ (i - dim_row A, j) else 1\<^sub>m (n - m) $$ (i - dim_row A, j - dim_col A)) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))); j < dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))\<rbrakk> \<Longrightarrow> mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
 2. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 3. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
[PROOF STEP]
show "?lhs $$ (i,j) = ?rhs $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)

goal (1 subgoal):
 1. mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mat_delete (four_block_mat A B C D) n n $$ (i, j) = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) $$ (i, j)

goal (2 subgoals):
 1. dim_row (mat_delete (four_block_mat A B C D) n n) = dim_row (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
 2. dim_col (mat_delete (four_block_mat A B C D) n n) = dim_col (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
qed (insert Suc.prems, auto)
[PROOF STATE]
proof (state)
this:
mat_delete (four_block_mat A B C D) n n = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have nn_1: "?block $$ (n, n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D $$ (n, n) = (1::'a)
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat m m
B = 0\<^sub>m m (Suc n - m)
C = 0\<^sub>m (Suc n - m) m
D = 1\<^sub>m (Suc n - m)
m < Suc n

goal (1 subgoal):
 1. four_block_mat A B C D $$ (n, n) = (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (n, n) = (1::'a)

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have rw0: "(\<Sum>i<n. ?block $$ (i,n) * Determinant.cofactor ?block i n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = (0::'a)
[PROOF STEP]
proof (rule sum.neutral, rule)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> four_block_mat A B C D $$ (x, n) * Determinant.cofactor (four_block_mat A B C D) x n = (0::'a)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> four_block_mat A B C D $$ (x, n) * Determinant.cofactor (four_block_mat A B C D) x n = (0::'a)
[PROOF STEP]
assume x: "x \<in> {..<n}"
[PROOF STATE]
proof (state)
this:
x \<in> {..<n}

goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> four_block_mat A B C D $$ (x, n) * Determinant.cofactor (four_block_mat A B C D) x n = (0::'a)
[PROOF STEP]
have block_index: "?block $$ (x,n) = (if x < dim_row A then if n < dim_col A then A $$ (x, n)
      else B $$ (x, n - dim_col A) else if n < dim_col A then C $$ (x - dim_row A, n)
      else D $$ (x - dim_row A, n - dim_col A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D $$ (x, n) = (if x < dim_row A then if n < dim_col A then A $$ (x, n) else B $$ (x, n - dim_col A) else if n < dim_col A then C $$ (x - dim_row A, n) else D $$ (x - dim_row A, n - dim_col A))
[PROOF STEP]
by (rule index_mat_four_block, insert Suc.prems x, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (x, n) = (if x < dim_row A then if n < dim_col A then A $$ (x, n) else B $$ (x, n - dim_col A) else if n < dim_col A then C $$ (x - dim_row A, n) else D $$ (x - dim_row A, n - dim_col A))

goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> four_block_mat A B C D $$ (x, n) * Determinant.cofactor (four_block_mat A B C D) x n = (0::'a)
[PROOF STEP]
have "four_block_mat A B C D $$ (x,n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D $$ (x, n) = (0::'a)
[PROOF STEP]
using x Suc.prems
[PROOF STATE]
proof (prove)
using this:
x \<in> {..<n}
A \<in> carrier_mat m m
B = 0\<^sub>m m (Suc n - m)
C = 0\<^sub>m (Suc n - m) m
D = 1\<^sub>m (Suc n - m)
m < Suc n

goal (1 subgoal):
 1. four_block_mat A B C D $$ (x, n) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (x, n) = (0::'a)

goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> four_block_mat A B C D $$ (x, n) * Determinant.cofactor (four_block_mat A B C D) x n = (0::'a)
[PROOF STEP]
thus "four_block_mat A B C D $$ (x, n) * Determinant.cofactor (four_block_mat A B C D) x n = 0"
[PROOF STATE]
proof (prove)
using this:
four_block_mat A B C D $$ (x, n) = (0::'a)

goal (1 subgoal):
 1. four_block_mat A B C D $$ (x, n) * Determinant.cofactor (four_block_mat A B C D) x n = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (x, n) * Determinant.cofactor (four_block_mat A B C D) x n = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = (0::'a)

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have "Determinant.det ?block = (\<Sum>i<Suc n. ?block $$ (i, n) * Determinant.cofactor ?block i n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (four_block_mat A B C D) = (\<Sum>i<Suc n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n)
[PROOF STEP]
by (rule laplace_expansion_column, insert Suc.prems, auto)
[PROOF STATE]
proof (state)
this:
Determinant.det (four_block_mat A B C D) = (\<Sum>i<Suc n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n)

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Determinant.det (four_block_mat A B C D) = (\<Sum>i<Suc n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n)

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have "... = ?block $$ (n, n) * Determinant.cofactor ?block n n
    + (\<Sum>i<n. ?block $$ (i,n) * Determinant.cofactor ?block i n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<Suc n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n + (\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<Suc n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n + (\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n)

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<Suc n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n + (\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n)

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have "... = ?block $$ (n, n) * Determinant.cofactor ?block n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n + (\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n
[PROOF STEP]
using rw0
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = (0::'a)

goal (1 subgoal):
 1. four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n + (\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n + (\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n + (\<Sum>i<n. four_block_mat A B C D $$ (i, n) * Determinant.cofactor (four_block_mat A B C D) i n) = four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have "... = Determinant.cofactor ?block n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n = Determinant.cofactor (four_block_mat A B C D) n n
[PROOF STEP]
using nn_1
[PROOF STATE]
proof (prove)
using this:
four_block_mat A B C D $$ (n, n) = (1::'a)

goal (1 subgoal):
 1. four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n = Determinant.cofactor (four_block_mat A B C D) n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n = Determinant.cofactor (four_block_mat A B C D) n n

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat A B C D $$ (n, n) * Determinant.cofactor (four_block_mat A B C D) n n = Determinant.cofactor (four_block_mat A B C D) n n

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have "... = Determinant.det (mat_delete ?block n n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.cofactor (four_block_mat A B C D) n n = Determinant.det (mat_delete (four_block_mat A B C D) n n)
[PROOF STEP]
unfolding cofactor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ (n + n) * Determinant.det (mat_delete (four_block_mat A B C D) n n) = Determinant.det (mat_delete (four_block_mat A B C D) n n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Determinant.cofactor (four_block_mat A B C D) n n = Determinant.det (mat_delete (four_block_mat A B C D) n n)

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Determinant.cofactor (four_block_mat A B C D) n n = Determinant.det (mat_delete (four_block_mat A B C D) n n)

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have "... = Determinant.det (four_block_mat A ?B ?C ?D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (mat_delete (four_block_mat A B C D) n n) = Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
using mat_eq
[PROOF STATE]
proof (prove)
using this:
mat_delete (four_block_mat A B C D) n n = four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))

goal (1 subgoal):
 1. Determinant.det (mat_delete (four_block_mat A B C D) n n) = Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Determinant.det (mat_delete (four_block_mat A B C D) n n) = Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Determinant.det (mat_delete (four_block_mat A B C D) n n) = Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)))

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
have "... = Determinant.det A" (is "Determinant.det ?lhs = Determinant.det ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
proof (cases "n = m")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
 2. n \<noteq> m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = m

goal (2 subgoals):
 1. n = m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
 2. n \<noteq> m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
have "?lhs = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) = A
[PROOF STEP]
by (rule four_block_mat_dim0, insert Suc.prems True, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) = A

goal (2 subgoals):
 1. n = m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
 2. n \<noteq> m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) = A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m)) = A

goal (1 subgoal):
 1. Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A

goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> m

goal (1 subgoal):
 1. n \<noteq> m \<Longrightarrow> Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A
[PROOF STEP]
by (rule Suc.hyps, insert Suc.prems False, auto)
[PROOF STATE]
proof (state)
this:
Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Determinant.det (four_block_mat A (Matrix.mat m (n - m) (\<lambda>(i, j). 0::'a)) (Matrix.mat (n - m) m (\<lambda>(i, j). 0::'a)) (1\<^sub>m (n - m))) = Determinant.det A

goal (1 subgoal):
 1. \<And>n A B C D. \<lbrakk>\<And>A B C D. \<lbrakk>A \<in> carrier_mat m m; B = 0\<^sub>m m (n - m); C = 0\<^sub>m (n - m) m; D = 1\<^sub>m (n - m); m < n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A; A \<in> carrier_mat m m; B = 0\<^sub>m m (Suc n - m); C = 0\<^sub>m (Suc n - m) m; D = 1\<^sub>m (Suc n - m); m < Suc n\<rbrakk> \<Longrightarrow> Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Determinant.det (four_block_mat A B C D) = Determinant.det A

goal (1 subgoal):
 1. Determinant.det (four_block_mat A B C D) = Determinant.det A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Determinant.det (four_block_mat A B C D) = Determinant.det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem induced_function_nn_integral:
  fixes f::"'a \<Rightarrow> ennreal"
  assumes A_meas [measurable]: "A \<in> sets M"
      and f_meas [measurable]: "f \<in> borel_measurable M"
  shows "(\<integral>\<^sup>+y. induced_function A f y \<partial>M) = (\<integral>\<^sup>+x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
obtain Y::"nat \<Rightarrow> 'a set" where Y_meas: "\<And> n. Y n \<in> sets M" and Y_fin: "\<And>n. emeasure M (Y n) \<noteq> \<infinity>"
        and Y_full: "(\<Union>n. Y n) = space M" and Y_inc: "incseq Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Y. \<lbrakk>\<And>n. Y n \<in> sets M; \<And>n. emeasure M (Y n) \<noteq> \<infinity>; \<Union> (range Y) = space M; incseq Y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson range_subsetD sigma_finite_incseq)
[PROOF STATE]
proof (state)
this:
Y ?n3 \<in> sets M
emeasure M (Y ?n3) \<noteq> \<infinity>
\<Union> (range Y) = space M
incseq Y

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
define F where "F = (\<lambda>(n::nat) x. min (f x) n * indicator (Y n) x)"
[PROOF STATE]
proof (state)
this:
F = (\<lambda>n x. min (f x) (of_nat n) * indicator (Y n) x)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have mes [measurable]: "\<And>n. (F n) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. F n \<in> borel_measurable M
[PROOF STEP]
unfolding F_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (\<lambda>x. min (f x) (of_nat n) * indicator (Y n) x) \<in> borel_measurable M
[PROOF STEP]
using assms(2) Y_meas
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
Y ?n3 \<in> sets M

goal (1 subgoal):
 1. \<And>n. (\<lambda>x. min (f x) (of_nat n) * indicator (Y n) x) \<in> borel_measurable M
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
F ?n3 \<in> borel_measurable M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
F ?n3 \<in> borel_measurable M
[PROOF STEP]
have mes_rel [measurable]: "(\<lambda>x. F n x * indicator (\<Union>n. (T^^n)--`A) x) \<in> borel_measurable M" for n
[PROOF STATE]
proof (prove)
using this:
F ?n3 \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. F n x * indicator (\<Union>n. (T ^^ n) --` A) x) \<in> borel_measurable M
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
(\<lambda>x. F ?n3 x * indicator (\<Union>n. (T ^^ n) --` A) x) \<in> borel_measurable M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have bound: "\<And>n x. F n x \<le> ennreal n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n x. F n x \<le> ennreal (real n)
[PROOF STEP]
by (simp add: F_def indicator_def ennreal_of_nat_eq_real_of_nat)
[PROOF STATE]
proof (state)
this:
F ?n3 ?x3 \<le> ennreal (real ?n3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "\<And>n. {x \<in> space M. F n x > 0} \<subseteq> Y n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {x \<in> space M. 0 < F n x} \<subseteq> Y n
[PROOF STEP]
unfolding F_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {x \<in> space M. 0 < min (f x) (of_nat n) * indicator (Y n) x} \<subseteq> Y n
[PROOF STEP]
using not_le
[PROOF STATE]
proof (prove)
using this:
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. \<And>n. {x \<in> space M. 0 < min (f x) (of_nat n) * indicator (Y n) x} \<subseteq> Y n
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{x \<in> space M. 0 < F ?n3 x} \<subseteq> Y ?n3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x \<in> space M. 0 < F ?n3 x} \<subseteq> Y ?n3
[PROOF STEP]
have le: "emeasure M {x \<in> space M. F n x > 0} \<le> emeasure M (Y n)" for n
[PROOF STATE]
proof (prove)
using this:
{x \<in> space M. 0 < F ?n3 x} \<subseteq> Y ?n3

goal (1 subgoal):
 1. emeasure M {x \<in> space M. 0 < F n x} \<le> emeasure M (Y n)
[PROOF STEP]
by (metis emeasure_mono Y_meas)
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> space M. 0 < F ?n3 x} \<le> emeasure M (Y ?n3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have fin: "emeasure M {x \<in> space M. F n x > 0} < \<infinity>" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M {x \<in> space M. 0 < F n x} < \<infinity>
[PROOF STEP]
using Y_fin[of n] le[of n]
[PROOF STATE]
proof (prove)
using this:
emeasure M (Y n) \<noteq> \<infinity>
emeasure M {x \<in> space M. 0 < F n x} \<le> emeasure M (Y n)

goal (1 subgoal):
 1. emeasure M {x \<in> space M. 0 < F n x} < \<infinity>
[PROOF STEP]
by (simp add: less_top)
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> space M. 0 < F ?n3 x} < \<infinity>

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have *: "(\<integral>\<^sup>+y. induced_function A (F n) y \<partial>M) = (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). (F n) x \<partial>M)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A (F n)) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F n)
[PROOF STEP]
by (rule induced_function_nn_integral_aux[OF A_meas mes bound _ fin]) simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A (F ?n3)) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F ?n3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have inc_Fx: "\<And>x. incseq (\<lambda>n. F n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. incseq (\<lambda>n. F n x)
[PROOF STEP]
unfolding F_def incseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<forall>m n. m \<le> n \<longrightarrow> min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x
[PROOF STEP]
proof (auto simp add: incseq_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x m n. m \<le> n \<Longrightarrow> min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x
[PROOF STEP]
fix x::"'a" and m n::"nat"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x m n. m \<le> n \<Longrightarrow> min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x
[PROOF STEP]
assume "m \<le> n"
[PROOF STATE]
proof (state)
this:
m \<le> n

goal (1 subgoal):
 1. \<And>x m n. m \<le> n \<Longrightarrow> min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<le> n
[PROOF STEP]
have "min (f x) m \<le> min (f x) n"
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. min (f x) (of_nat m) \<le> min (f x) (of_nat n)
[PROOF STEP]
using linear
[PROOF STATE]
proof (prove)
using this:
m \<le> n
?x \<le> ?y \<or> ?y \<le> ?x

goal (1 subgoal):
 1. min (f x) (of_nat m) \<le> min (f x) (of_nat n)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
min (f x) (of_nat m) \<le> min (f x) (of_nat n)

goal (1 subgoal):
 1. \<And>x m n. m \<le> n \<Longrightarrow> min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
min (f x) (of_nat m) \<le> min (f x) (of_nat n)

goal (1 subgoal):
 1. \<And>x m n. m \<le> n \<Longrightarrow> min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x
[PROOF STEP]
have "(indicator (Y m) x::ennreal) \<le> (indicator (Y n) x::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator (Y m) x \<le> indicator (Y n) x
[PROOF STEP]
using Y_inc
[PROOF STATE]
proof (prove)
using this:
incseq Y

goal (1 subgoal):
 1. indicator (Y m) x \<le> indicator (Y n) x
[PROOF STEP]
apply (auto simp add: incseq_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>m n. m \<le> n \<longrightarrow> Y m \<subseteq> Y n; x \<in> Y m\<rbrakk> \<Longrightarrow> x \<in> Y n
[PROOF STEP]
using \<open>m \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. \<lbrakk>\<forall>m n. m \<le> n \<longrightarrow> Y m \<subseteq> Y n; x \<in> Y m\<rbrakk> \<Longrightarrow> x \<in> Y n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
indicator (Y m) x \<le> indicator (Y n) x

goal (1 subgoal):
 1. \<And>x m n. m \<le> n \<Longrightarrow> min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
min (f x) (of_nat m) \<le> min (f x) (of_nat n)
indicator (Y m) x \<le> indicator (Y n) x
[PROOF STEP]
show "min (f x) m * (indicator (Y m) x::ennreal) \<le> min (f x) n * (indicator (Y n) x::ennreal)"
[PROOF STATE]
proof (prove)
using this:
min (f x) (of_nat m) \<le> min (f x) (of_nat n)
indicator (Y m) x \<le> indicator (Y n) x

goal (1 subgoal):
 1. min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x
[PROOF STEP]
by (auto split: split_indicator)
[PROOF STATE]
proof (state)
this:
min (f x) (of_nat m) * indicator (Y m) x \<le> min (f x) (of_nat n) * indicator (Y n) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>n. F n ?x3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
incseq (\<lambda>n. F n ?x3)
[PROOF STEP]
have "incseq (\<lambda>n. F n x * indicator (\<Union>n. (T^^n)--`A) x)" for x
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n. F n ?x3)

goal (1 subgoal):
 1. incseq (\<lambda>n. F n x * indicator (\<Union>n. (T ^^ n) --` A) x)
[PROOF STEP]
by (auto simp add: indicator_def incseq_def)
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>n. F n ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
incseq (\<lambda>n. F n ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3)
[PROOF STEP]
have inc_rel: "incseq (\<lambda>n x. F n x * indicator (\<Union>n. (T^^n)--`A) x)"
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n. F n ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3)

goal (1 subgoal):
 1. incseq (\<lambda>n x. F n x * indicator (\<Union>n. (T ^^ n) --` A) x)
[PROOF STEP]
by (auto simp add: incseq_def le_fun_def)
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>n x. F n x * indicator (\<Union>n. (T ^^ n) --` A) x)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
incseq (\<lambda>n x. F n x * indicator (\<Union>n. (T ^^ n) --` A) x)
[PROOF STEP]
have a: "(SUP n. (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). F n x \<partial>M))
              = (\<integral>\<^sup>+ x. (SUP n. F n x * indicator (\<Union>n. (T^^n)--`A) x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n x. F n x * indicator (\<Union>n. (T ^^ n) --` A) x)

goal (1 subgoal):
 1. (\<Squnion>n. set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F n)) = \<integral>\<^sup>+ x. (\<Squnion>n. F n x * indicator (\<Union>n. (T ^^ n) --` A) x) \<partial>M
[PROOF STEP]
using nn_integral_monotone_convergence_SUP[OF inc_rel, OF mes_rel]
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n x. F n x * indicator (\<Union>n. (T ^^ n) --` A) x)
\<integral>\<^sup>+ x. (\<Squnion>i. F i x * indicator (\<Union>n. (T ^^ n) --` A) x) \<partial>M = (\<Squnion>i. set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F i))

goal (1 subgoal):
 1. (\<Squnion>n. set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F n)) = \<integral>\<^sup>+ x. (\<Squnion>n. F n x * indicator (\<Union>n. (T ^^ n) --` A) x) \<partial>M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F n)) = \<integral>\<^sup>+ x. (\<Squnion>n. F n x * indicator (\<Union>n. (T ^^ n) --` A) x) \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have SUP_Fx: "(SUP n. F n x) = f x" if "x \<in> space M" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>n. F n x) = f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Squnion>n. F n x) = f x
[PROOF STEP]
obtain N where "x \<in> Y N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. x \<in> Y N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Y_full \<open>x \<in> space M\<close>
[PROOF STATE]
proof (prove)
using this:
\<Union> (range Y) = space M
x \<in> space M

goal (1 subgoal):
 1. (\<And>N. x \<in> Y N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> Y N

goal (1 subgoal):
 1. (\<Squnion>n. F n x) = f x
[PROOF STEP]
have "(SUP n. F n x) = (SUP n. inf (f x) (of_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>n. F n x) = (\<Squnion>n. f x \<sqinter> of_nat n)
[PROOF STEP]
proof (rule SUP_eq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<exists>j\<in>UNIV. F i x \<le> f x \<sqinter> of_nat j
 2. \<And>j. j \<in> UNIV \<Longrightarrow> \<exists>i\<in>UNIV. f x \<sqinter> of_nat j \<le> F i x
[PROOF STEP]
show "\<exists>j\<in>UNIV. F i x \<le> inf (f x) (of_nat j)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j\<in>UNIV. F i x \<le> f x \<sqinter> of_nat j
[PROOF STEP]
by (auto simp: F_def intro!: exI[of _ i] split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<exists>j\<in>UNIV. F ?i3 x \<le> f x \<sqinter> of_nat j

goal (1 subgoal):
 1. \<And>j. j \<in> UNIV \<Longrightarrow> \<exists>i\<in>UNIV. f x \<sqinter> of_nat j \<le> F i x
[PROOF STEP]
show "\<exists>i\<in>UNIV. inf (f x) (of_nat j) \<le> F i x" for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i\<in>UNIV. f x \<sqinter> of_nat j \<le> F i x
[PROOF STEP]
using \<open>x \<in> Y N\<close> \<open>incseq Y\<close>[THEN monoD, of N "max N j"]
[PROOF STATE]
proof (prove)
using this:
x \<in> Y N
N \<le> max N j \<Longrightarrow> Y N \<subseteq> Y (max N j)

goal (1 subgoal):
 1. \<exists>i\<in>UNIV. f x \<sqinter> of_nat j \<le> F i x
[PROOF STEP]
by (intro bexI[of _ "max N j"])
           (auto simp: F_def subset_eq not_le inf_min intro: min.coboundedI2 less_imp_le split: split_indicator split_max)
[PROOF STATE]
proof (state)
this:
\<exists>i\<in>UNIV. f x \<sqinter> of_nat ?j3 \<le> F i x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. F n x) = (\<Squnion>n. f x \<sqinter> of_nat n)

goal (1 subgoal):
 1. (\<Squnion>n. F n x) = f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Squnion>n. F n x) = (\<Squnion>n. f x \<sqinter> of_nat n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>n. F n x) = (\<Squnion>n. f x \<sqinter> of_nat n)

goal (1 subgoal):
 1. (\<Squnion>n. F n x) = f x
[PROOF STEP]
by (simp add: inf_SUP[symmetric] ennreal_SUP_of_nat_eq_top)
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. F n x) = f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. F n ?x3) = f ?x3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. F n ?x3) = f ?x3
[PROOF STEP]
have "(SUP n. F n x * indicator (\<Union>n. (T^^n)--`A) x) = f x * indicator (\<Union>n. (T^^n)--`A) x"
    if "x \<in> space M" for x
[PROOF STATE]
proof (prove)
using this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. F n ?x3) = f ?x3

goal (1 subgoal):
 1. (\<Squnion>n. F n x * indicator (\<Union>n. (T ^^ n) --` A) x) = f x * indicator (\<Union>n. (T ^^ n) --` A) x
[PROOF STEP]
by (auto simp add: indicator_def SUP_Fx that)
[PROOF STATE]
proof (state)
this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. F n ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3) = f ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. F n ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3) = f ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3
[PROOF STEP]
have **: "(SUP n. (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). F n x \<partial>M)) = (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. F n ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3) = f ?x3 * indicator (\<Union>n. (T ^^ n) --` A) ?x3

goal (1 subgoal):
 1. (\<Squnion>n. set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F n)) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
by (simp add: a cong: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F n)) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "incseq (\<lambda>n. induced_function A (F n) x)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>n. induced_function A (F n) x)
[PROOF STEP]
unfolding induced_function_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>n. \<Sum>i<return_time_function A x. F n ((T ^^ i) x))
[PROOF STEP]
using incseq_sumI2[of "{..<return_time_function A x}", of "\<lambda>i n. F n ((T^^i)x)"] inc_Fx
[PROOF STATE]
proof (prove)
using this:
(\<And>n. n \<in> {..<return_time_function A x} \<Longrightarrow> incseq (\<lambda>na. F na ((T ^^ n) x))) \<Longrightarrow> incseq (\<lambda>i. \<Sum>n<return_time_function A x. F i ((T ^^ n) x))
incseq (\<lambda>n. F n ?x3)

goal (1 subgoal):
 1. incseq (\<lambda>n. \<Sum>i<return_time_function A x. F n ((T ^^ i) x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>n. induced_function A (F n) ?x3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
incseq (\<lambda>n. induced_function A (F n) ?x3)
[PROOF STEP]
have "incseq (\<lambda>n. induced_function A (F n))"
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n. induced_function A (F n) ?x3)

goal (1 subgoal):
 1. incseq (\<lambda>n. induced_function A (F n))
[PROOF STEP]
by (auto simp add: incseq_def le_fun_def)
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>n. induced_function A (F n))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
incseq (\<lambda>n. induced_function A (F n))
[PROOF STEP]
have b: "(SUP n. (\<integral>\<^sup>+ x. induced_function A (F n) x \<partial>M)) = (\<integral>\<^sup>+ x. (SUP n. induced_function A (F n) x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n. induced_function A (F n))

goal (1 subgoal):
 1. (\<Squnion>n. integral\<^sup>N M (induced_function A (F n))) = \<integral>\<^sup>+ x. (\<Squnion>n. induced_function A (F n) x) \<partial>M
[PROOF STEP]
by (rule nn_integral_monotone_convergence_SUP[symmetric]) (measurable)
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. integral\<^sup>N M (induced_function A (F n))) = \<integral>\<^sup>+ x. (\<Squnion>n. induced_function A (F n) x) \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(SUP n. induced_function A (F n) x) = induced_function A f x" if [simp]: "x \<in> space M" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>n. induced_function A (F n) x) = induced_function A f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Squnion>n. induced_function A (F n) x) = induced_function A f x
[PROOF STEP]
have "(SUP n. (\<Sum> i \<in>{..<return_time_function A x}. F n ((T^^i)x)))
              = (\<Sum> i \<in> {..<return_time_function A x}. f ((T^^i)x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>n. \<Sum>i<return_time_function A x. F n ((T ^^ i) x)) = (\<Sum>i<return_time_function A x. f ((T ^^ i) x))
[PROOF STEP]
using ennreal_SUP_sum[OF inc_Fx, where ?I = "{..<return_time_function A x}"] SUP_Fx
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>n. \<Sum>i<return_time_function A x. F n (?x4 i)) = (\<Sum>i<return_time_function A x. \<Squnion>n. F n (?x4 i))
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. F n ?x3) = f ?x3

goal (1 subgoal):
 1. (\<Squnion>n. \<Sum>i<return_time_function A x. F n ((T ^^ i) x)) = (\<Sum>i<return_time_function A x. f ((T ^^ i) x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. \<Sum>i<return_time_function A x. F n ((T ^^ i) x)) = (\<Sum>i<return_time_function A x. f ((T ^^ i) x))

goal (1 subgoal):
 1. (\<Squnion>n. induced_function A (F n) x) = induced_function A f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Squnion>n. \<Sum>i<return_time_function A x. F n ((T ^^ i) x)) = (\<Sum>i<return_time_function A x. f ((T ^^ i) x))
[PROOF STEP]
show "(SUP n. induced_function A (F n) x) = induced_function A f x"
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>n. \<Sum>i<return_time_function A x. F n ((T ^^ i) x)) = (\<Sum>i<return_time_function A x. f ((T ^^ i) x))

goal (1 subgoal):
 1. (\<Squnion>n. induced_function A (F n) x) = induced_function A f x
[PROOF STEP]
by (auto simp add: induced_function_def)
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. induced_function A (F n) x) = induced_function A f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. induced_function A (F n) ?x3) = induced_function A f ?x3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. induced_function A (F n) ?x3) = induced_function A f ?x3
[PROOF STEP]
have "(SUP n. (\<integral>\<^sup>+ x. induced_function A (F n) x \<partial>M)) = (\<integral>\<^sup>+ x. induced_function A f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
?x3 \<in> space M \<Longrightarrow> (\<Squnion>n. induced_function A (F n) ?x3) = induced_function A f ?x3

goal (1 subgoal):
 1. (\<Squnion>n. integral\<^sup>N M (induced_function A (F n))) = integral\<^sup>N M (induced_function A f)
[PROOF STEP]
by (simp add: b cong: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. integral\<^sup>N M (induced_function A (F n))) = integral\<^sup>N M (induced_function A f)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Squnion>n. integral\<^sup>N M (induced_function A (F n))) = integral\<^sup>N M (induced_function A f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>n. integral\<^sup>N M (induced_function A (F n))) = integral\<^sup>N M (induced_function A f)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
using * **
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>n. integral\<^sup>N M (induced_function A (F n))) = integral\<^sup>N M (induced_function A f)
integral\<^sup>N M (induced_function A (F ?n3)) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F ?n3)
(\<Squnion>n. set_nn_integral M (\<Union>n. (T ^^ n) --` A) (F n)) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f

goal:
No subgoals!
[PROOF STEP]
qed