[STATEMENT]
lemma real_diag_decomp_block:
  fixes Al::"complex Matrix.mat list"
  assumes "Al \<noteq> []"
  and "list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A)  Al"
shows "\<exists> Bl Ul. length Ul = length Al \<and>
  (\<forall>i < length Al.
    Ul!i \<in> carrier_mat (dim_row (Al!i)) (dim_col (Al!i)) \<and> unitary (Ul!i) \<and>
    Bl!i \<in> carrier_mat (dim_row (Al!i)) (dim_col (Al!i))) \<and>
  real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Al \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al

goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
proof (induct Al)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) []\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length [] \<and> (\<forall>i<length []. Ul ! i \<in> carrier_mat (dim_row ([] ! i)) (dim_col ([] ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ([] ! i)) (dim_col ([] ! i))) \<and> real_diag_decomp (diag_block_mat []) (diag_block_mat Bl) (diag_block_mat Ul)
 2. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
[] \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) []

goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) []\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length [] \<and> (\<forall>i<length []. Ul ! i \<in> carrier_mat (dim_row ([] ! i)) (dim_col ([] ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ([] ! i)) (dim_col ([] ! i))) \<and> real_diag_decomp (diag_block_mat []) (diag_block_mat Bl) (diag_block_mat Ul)
 2. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[] \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
[] \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) []

goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length [] \<and> (\<forall>i<length []. Ul ! i \<in> carrier_mat (dim_row ([] ! i)) (dim_col ([] ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ([] ! i)) (dim_col ([] ! i))) \<and> real_diag_decomp (diag_block_mat []) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>Bl Ul. length Ul = length [] \<and> (\<forall>i<length []. Ul ! i \<in> carrier_mat (dim_row ([] ! i)) (dim_col ([] ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ([] ! i)) (dim_col ([] ! i))) \<and> real_diag_decomp (diag_block_mat []) (diag_block_mat Bl) (diag_block_mat Ul)

goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
case (Cons A Al)
[PROOF STATE]
proof (state)
this:
\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
A # Al \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (A # Al)

goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
hence "hermitian A" "0 < dim_row A"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
A # Al \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (A # Al)

goal (1 subgoal):
 1. hermitian A &&& 0 < dim_row A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hermitian A
0 < dim_row A

goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
hence "A \<in> carrier_mat (dim_row A) (dim_row A)"
[PROOF STATE]
proof (prove)
using this:
hermitian A
0 < dim_row A

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

goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat (dim_row A) (dim_row A)
[PROOF STEP]
obtain B U where r: "real_diag_decomp A B U"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_row A) (dim_row A)

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using hermitian_real_diag_decomp \<open>hermitian A\<close> \<open>0 < dim_row A\<close>
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_row A) (dim_row A)
\<lbrakk>?A \<in> carrier_mat ?n ?n; 0 < ?n; hermitian ?A; \<And>B U. real_diag_decomp ?A B U \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
hermitian A
0 < dim_row A

goal (1 subgoal):
 1. (\<And>B U. real_diag_decomp A B U \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
real_diag_decomp A B U

goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have bcar: "B \<in> carrier_mat (dim_row A) (dim_col A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
using real_diag_decompD(1)
[PROOF STATE]
proof (prove)
using this:
real_diag_decomp ?A ?B ?U \<Longrightarrow> unitary_diag ?A ?B ?U

goal (1 subgoal):
 1. B \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
by (metis \<open>A \<in> carrier_mat (dim_row A) (dim_row A)\<close> carrier_matD(2) r
          unitary_diag_carrier(1))
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have ucar: "U \<in> carrier_mat (dim_row A) (dim_col A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
using real_diag_decompD(1)
[PROOF STATE]
proof (prove)
using this:
real_diag_decomp ?A ?B ?U \<Longrightarrow> unitary_diag ?A ?B ?U

goal (1 subgoal):
 1. U \<in> carrier_mat (dim_row A) (dim_col A)
[PROOF STEP]
by (metis \<open>A \<in> carrier_mat (dim_row A) (dim_row A)\<close> carrier_matD(2) r
          unitary_diag_carrier(2))
[PROOF STATE]
proof (state)
this:
U \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have unit: "unitary U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary U
[PROOF STEP]
by (meson r real_diag_decompD(1) unitary_diagD(3))
[PROOF STATE]
proof (state)
this:
Complex_Matrix.unitary U

goal (1 subgoal):
 1. \<And>a Al. \<lbrakk>\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); a # Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (a # Al)\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length (a # Al) \<and> (\<forall>i<length (a # Al). Ul ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((a # Al) ! i)) (dim_col ((a # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (a # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
proof (cases "Al = []")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Al = []

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
hence "diag_block_mat (Cons A Al) = A"
[PROOF STATE]
proof (prove)
using this:
Al = []

goal (1 subgoal):
 1. diag_block_mat (A # Al) = A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
diag_block_mat (A # Al) = A

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
diag_block_mat (A # Al) = A

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have "diag_block_mat [B] = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat [B] = B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
diag_block_mat [B] = B

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
diag_block_mat [B] = B

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have "diag_block_mat [U] = U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat [U] = U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
diag_block_mat [U] = U

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
diag_block_mat [U] = U

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have "unitary U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary U
[PROOF STEP]
using r real_diag_decompD(1) unitary_diagD(3)
[PROOF STATE]
proof (prove)
using this:
real_diag_decomp A B U
real_diag_decomp ?A ?B ?U \<Longrightarrow> unitary_diag ?A ?B ?U
unitary_diag ?A ?B ?U \<Longrightarrow> Complex_Matrix.unitary ?U

goal (1 subgoal):
 1. Complex_Matrix.unitary U
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Complex_Matrix.unitary U

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
diag_block_mat (A # Al) = A
diag_block_mat [B] = B
diag_block_mat [U] = U
Complex_Matrix.unitary U
[PROOF STEP]
have
      "real_diag_decomp (diag_block_mat (Cons A Al))
        (diag_block_mat [B]) (diag_block_mat [U])"
[PROOF STATE]
proof (prove)
using this:
diag_block_mat (A # Al) = A
diag_block_mat [B] = B
diag_block_mat [U] = U
Complex_Matrix.unitary U

goal (1 subgoal):
 1. real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat [B]) (diag_block_mat [U])
[PROOF STEP]
using \<open>real_diag_decomp A B U\<close>
[PROOF STATE]
proof (prove)
using this:
diag_block_mat (A # Al) = A
diag_block_mat [B] = B
diag_block_mat [U] = U
Complex_Matrix.unitary U
real_diag_decomp A B U

goal (1 subgoal):
 1. real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat [B]) (diag_block_mat [U])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat [B]) (diag_block_mat [U])

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat [B]) (diag_block_mat [U])

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have "(\<forall>i<length (A # Al).
      [U]!i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and>
      Complex_Matrix.unitary ([U] ! i) \<and> [B] ! i \<in>
      carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (A # Al). [U] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ([U] ! i) \<and> [B] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
Al = []

goal (1 subgoal):
 1. \<forall>i<length (A # Al). [U] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ([U] ! i) \<and> [B] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
by (simp add: bcar ucar unit)
[PROOF STATE]
proof (state)
this:
\<forall>i<length (A # Al). [U] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ([U] ! i) \<and> [B] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))

goal (2 subgoals):
 1. Al = [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
 2. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat [B]) (diag_block_mat [U])
\<forall>i<length (A # Al). [U] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ([U] ! i) \<and> [B] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat [B]) (diag_block_mat [U])
\<forall>i<length (A # Al). [U] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ([U] ! i) \<and> [B] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))

goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
using True \<open>Complex_Matrix.unitary U\<close> bcar  less_one ucar
[PROOF STATE]
proof (prove)
using this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat [B]) (diag_block_mat [U])
\<forall>i<length (A # Al). [U] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ([U] ! i) \<and> [B] ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
Al = []
Complex_Matrix.unitary U
B \<in> carrier_mat (dim_row A) (dim_col A)
(?n < 1) = (?n = 0)
U \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
by (metis length_list_update list_update_code(2))
[PROOF STATE]
proof (state)
this:
\<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Al \<noteq> []

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have "list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
A # Al \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (A # Al)

goal (1 subgoal):
 1. list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
hence "\<exists>Bl Ul. length Ul = length Al \<and>
       (\<forall>i<length Al.
           Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and>
           unitary (Ul!i) \<and>
            Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and>
       real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)"
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al

goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
using Cons False
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al
\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
A # Al \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (A # Al)
Al \<noteq> []

goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
obtain Bl Ul where "length Ul  =length Al" and
      rl: "real_diag_decomp (diag_block_mat Al)
      (diag_block_mat Bl) (diag_block_mat Ul)"
      and "\<forall>i<length Al.
           Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and>
            unitary (Ul!i) \<and>
            Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))"
[PROOF STATE]
proof (prove)
using this:
\<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)

goal (1 subgoal):
 1. (\<And>Ul Bl. \<lbrakk>length Ul = length Al; real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul); \<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length Ul = length Al
real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
note bu = this
[PROOF STATE]
proof (state)
this:
length Ul = length Al
real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have "real_diag_decomp (diag_block_mat (A # Al))
      (diag_block_mat (B # Bl)) (diag_block_mat (U # Ul))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat (B # Bl)) (diag_block_mat (U # Ul))
[PROOF STEP]
using four_block_real_diag_decomp[OF r rl]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dim_row A = dim_col A; dim_row (diag_block_mat Al) = dim_col (diag_block_mat Al)\<rbrakk> \<Longrightarrow> real_diag_decomp (four_block_diag A (diag_block_mat Al)) (four_block_diag B (diag_block_mat Bl)) (four_block_diag U (diag_block_mat Ul))

goal (1 subgoal):
 1. real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat (B # Bl)) (diag_block_mat (U # Ul))
[PROOF STEP]
by (metis \<open>A \<in> carrier_mat (dim_row A) (dim_row A)\<close>
          carrier_matD(2) diag_block_mat.simps(2) hermitian_square
          real_diag_decomp_hermitian rl)
[PROOF STATE]
proof (state)
this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat (B # Bl)) (diag_block_mat (U # Ul))

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat (B # Bl)) (diag_block_mat (U # Ul))

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have "length (U#Ul) = length (A#Al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (U # Ul) = length (A # Al)
[PROOF STEP]
using bu
[PROOF STATE]
proof (prove)
using this:
length Ul = length Al
real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))

goal (1 subgoal):
 1. length (U # Ul) = length (A # Al)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (U # Ul) = length (A # Al)

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length (U # Ul) = length (A # Al)

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
have "\<forall>i<length (A # Al).
           (U#Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and>
           unitary ((U#Ul)!i) \<and>
           (B#Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (A # Al). (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (A # Al) \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (A # Al) \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
assume "i < length (A#Al)"
[PROOF STATE]
proof (state)
this:
i < length (A # Al)

goal (1 subgoal):
 1. \<And>i. i < length (A # Al) \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
show "(U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i))
        (dim_col ((A # Al) ! i)) \<and> unitary ((U#Ul)!i) \<and>
        (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i))
        (dim_col ((A # Al) ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
proof (cases "i = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
 2. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = 0

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
 2. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i = 0

goal (1 subgoal):
 1. (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
by (simp add: bcar ucar unit)
[PROOF STATE]
proof (state)
this:
(U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> 0

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
hence "\<exists>j. i = Suc j"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> 0

goal (1 subgoal):
 1. \<exists>j. i = Suc j
[PROOF STEP]
by (simp add: not0_implies_Suc)
[PROOF STATE]
proof (state)
this:
\<exists>j. i = Suc j

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>j. i = Suc j
[PROOF STEP]
obtain j where j: "i = Suc j"
[PROOF STATE]
proof (prove)
using this:
\<exists>j. i = Suc j

goal (1 subgoal):
 1. (\<And>j. i = Suc j \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = Suc j

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
hence "j < length Al"
[PROOF STATE]
proof (prove)
using this:
i = Suc j

goal (1 subgoal):
 1. j < length Al
[PROOF STEP]
using \<open>i < length (A#Al)\<close>
[PROOF STATE]
proof (prove)
using this:
i = Suc j
i < length (A # Al)

goal (1 subgoal):
 1. j < length Al
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
j < length Al

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
have "(A#Al)!i = Al!j" "(U # Ul) ! i = Ul!j" "(B#Bl) ! i = Bl!j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A # Al) ! i = Al ! j &&& (U # Ul) ! i = Ul ! j &&& (B # Bl) ! i = Bl ! j
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
i = Suc j

goal (1 subgoal):
 1. (A # Al) ! i = Al ! j &&& (U # Ul) ! i = Ul ! j &&& (B # Bl) ! i = Bl ! j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A # Al) ! i = Al ! j
(U # Ul) ! i = Ul ! j
(B # Bl) ! i = Bl ! j

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(A # Al) ! i = Al ! j
(U # Ul) ! i = Ul ! j
(B # Bl) ! i = Bl ! j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(A # Al) ! i = Al ! j
(U # Ul) ! i = Ul ! j
(B # Bl) ! i = Bl ! j

goal (1 subgoal):
 1. (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
using Cons \<open>j < length Al\<close> bu(3)
[PROOF STATE]
proof (prove)
using this:
(A # Al) ! i = Al ! j
(U # Ul) ! i = Ul ! j
(B # Bl) ! i = Bl ! j
\<lbrakk>Al \<noteq> []; list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) Al\<rbrakk> \<Longrightarrow> \<exists>Bl Ul. length Ul = length Al \<and> (\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))) \<and> real_diag_decomp (diag_block_mat Al) (diag_block_mat Bl) (diag_block_mat Ul)
A # Al \<noteq> []
list_all (\<lambda>A. 0 < dim_row A \<and> hermitian A) (A # Al)
j < length Al
\<forall>i<length Al. Ul ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row (Al ! i)) (dim_col (Al ! i))

goal (1 subgoal):
 1. (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<length (A # Al). (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))

goal (1 subgoal):
 1. Al \<noteq> [] \<Longrightarrow> \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat (B # Bl)) (diag_block_mat (U # Ul))
length (U # Ul) = length (A # Al)
\<forall>i<length (A # Al). (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat (B # Bl)) (diag_block_mat (U # Ul))
length (U # Ul) = length (A # Al)
\<forall>i<length (A # Al). (U # Ul) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary ((U # Ul) ! i) \<and> (B # Bl) ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))

goal (1 subgoal):
 1. \<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>Bl Ul. length Ul = length (A # Al) \<and> (\<forall>i<length (A # Al). Ul ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i)) \<and> Complex_Matrix.unitary (Ul ! i) \<and> Bl ! i \<in> carrier_mat (dim_row ((A # Al) ! i)) (dim_col ((A # Al) ! i))) \<and> real_diag_decomp (diag_block_mat (A # Al)) (diag_block_mat Bl) (diag_block_mat Ul)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma differentiable_power_int [simp, derivative_intros]:
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_field"
  shows "f differentiable (at x within s) \<Longrightarrow> f x \<noteq> 0 \<Longrightarrow>
           (\<lambda>x. power_int (f x) n) differentiable (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f differentiable at x within s; f x \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> (\<lambda>x. f x powi n) differentiable at x within s
[PROOF STEP]
unfolding differentiable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>D. (f has_derivative D) (at x within s); f x \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> \<exists>D. ((\<lambda>x. f x powi n) has_derivative D) (at x within s)
[PROOF STEP]
by (blast intro: has_derivative_power_int)


[STATEMENT]
lemma infsetsum_Times:
  fixes A :: "'a set" and B :: "'b set"
  assumes [simp]: "countable A" and "countable B"
  assumes summable: "f abs_summable_on (A \<times> B)"
  shows   "infsetsum f (A \<times> B) = infsetsum (\<lambda>x. infsetsum (\<lambda>y. f (x, y)) B) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsetsum f (A \<times> B) = (\<Sum>\<^sub>ax\<in>A. \<Sum>\<^sub>ay\<in>B. f (x, y))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
countable A
countable B
f abs_summable_on A \<times> B

goal (1 subgoal):
 1. infsetsum f (A \<times> B) = (\<Sum>\<^sub>ax\<in>A. \<Sum>\<^sub>ay\<in>B. f (x, y))
[PROOF STEP]
by (subst infsetsum_Sigma) auto


[STATEMENT]
lemma simply_connected_eq_contractible_loop_any:
  fixes S :: "_::real_normed_vector set"
  shows "simply_connected S \<longleftrightarrow>
            (\<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S
                  \<longrightarrow> homotopic_loops S p (linepath a a))"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S = (\<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simply_connected S \<Longrightarrow> \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)
 2. \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a) \<Longrightarrow> simply_connected S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
simply_connected S

goal (2 subgoals):
 1. simply_connected S \<Longrightarrow> \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)
 2. \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a) \<Longrightarrow> simply_connected S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
simply_connected S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
simply_connected S

goal (1 subgoal):
 1. \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)
[PROOF STEP]
unfolding simply_connected_def
[PROOF STATE]
proof (prove)
using this:
\<forall>p q. path p \<and> pathfinish p = pathstart p \<and> path_image p \<subseteq> S \<and> path q \<and> pathfinish q = pathstart q \<and> path_image q \<subseteq> S \<longrightarrow> homotopic_loops S p q

goal (1 subgoal):
 1. \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)

goal (1 subgoal):
 1. \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a) \<Longrightarrow> simply_connected S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a) \<Longrightarrow> simply_connected S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)

goal (1 subgoal):
 1. \<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a) \<Longrightarrow> simply_connected S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
\<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)

goal (1 subgoal):
 1. simply_connected S
[PROOF STEP]
unfolding simply_connected_def
[PROOF STATE]
proof (prove)
using this:
\<forall>p a. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<and> a \<in> S \<longrightarrow> homotopic_loops S p (linepath a a)

goal (1 subgoal):
 1. \<forall>p q. path p \<and> pathfinish p = pathstart p \<and> path_image p \<subseteq> S \<and> path q \<and> pathfinish q = pathstart q \<and> path_image q \<subseteq> S \<longrightarrow> homotopic_loops S p q
[PROOF STEP]
by (metis pathfinish_in_path_image subsetD  homotopic_loops_trans homotopic_loops_sym)
[PROOF STATE]
proof (state)
this:
simply_connected S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem content_triangle:
  fixes A B C :: "real ^ 2"
  shows "content (convex hull {A, B, C}) =
           \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
define M :: "real ^ 2 ^ 2" where "M \<equiv> (\<chi> i. \<chi> j. (if j = 1 then B else C) $ i - A $ i)"
[PROOF STATE]
proof (state)
this:
M \<equiv> \<chi>i j. (if j = 1 then B else C) $ i - A $ i

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
define g where "g = (\<lambda>x. M *v x)"
[PROOF STATE]
proof (state)
this:
g = (*v) M

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
define std where "std = (convex hull insert 0 Basis :: (real ^ 2) set)"
[PROOF STATE]
proof (state)
this:
std = convex hull insert 0 Basis

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have [simp]: "M *v axis i 1 = (if i = 1 then B - A else C - A)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M *v axis i 1 = (if i = 1 then B - A else C - A)
[PROOF STEP]
by (auto simp: M_def matrix_vector_mult_basis column_def vec_eq_iff)
[PROOF STATE]
proof (state)
this:
M *v axis ?i 1 = (if ?i = 1 then B - A else C - A)

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have compact: "compact std"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact std
[PROOF STEP]
unfolding std_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (convex hull insert 0 Basis)
[PROOF STEP]
by (intro finite_imp_compact_convex_hull) auto
[PROOF STATE]
proof (state)
this:
compact std

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have "measure lebesgue (convex hull {A, B, C}) =
          measure lebesgue (((+) (-A)) ` (convex hull {A, B, C}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = Sigma_Algebra.measure lebesgue ((+) (- A) ` (convex hull {A, B, C}))
[PROOF STEP]
by (rule measure_translation [symmetric])
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = Sigma_Algebra.measure lebesgue ((+) (- A) ` (convex hull {A, B, C}))

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = Sigma_Algebra.measure lebesgue ((+) (- A) ` (convex hull {A, B, C}))

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have "((+) (-A)) ` (convex hull {A, B, C}) = convex hull (((+) (-A)) ` {A, B, C})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) (- A) ` (convex hull {A, B, C}) = convex hull (+) (- A) ` {A, B, C}
[PROOF STEP]
by (rule convex_hull_translation [symmetric])
[PROOF STATE]
proof (state)
this:
(+) (- A) ` (convex hull {A, B, C}) = convex hull (+) (- A) ` {A, B, C}

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(+) (- A) ` (convex hull {A, B, C}) = convex hull (+) (- A) ` {A, B, C}

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have "((+) (-A)) ` {A, B, C} = {0, B - A, C - A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) (- A) ` {A, B, C} = {0, B - A, C - A}
[PROOF STEP]
by (auto simp: image_iff)
[PROOF STATE]
proof (state)
this:
(+) (- A) ` {A, B, C} = {0, B - A, C - A}

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = Sigma_Algebra.measure lebesgue (convex hull {0, B - A, C - A})
[PROOF STEP]
have eq: "measure lebesgue (convex hull {A, B, C}) =
                      measure lebesgue (convex hull {0, B - A, C - A})"
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = Sigma_Algebra.measure lebesgue (convex hull {0, B - A, C - A})

goal (1 subgoal):
 1. Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = Sigma_Algebra.measure lebesgue (convex hull {0, B - A, C - A})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = Sigma_Algebra.measure lebesgue (convex hull {0, B - A, C - A})

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
from compact
[PROOF STATE]
proof (chain)
picking this:
compact std
[PROOF STEP]
have "measure lebesgue (g ` std) = \<bar>det M\<bar> * measure lebesgue std"
[PROOF STATE]
proof (prove)
using this:
compact std

goal (1 subgoal):
 1. Sigma_Algebra.measure lebesgue (g ` std) = \<bar>det M\<bar> * Sigma_Algebra.measure lebesgue std
[PROOF STEP]
by (subst measure_lebesgue_linear_transformation)
       (auto intro: finite_imp_bounded_convex_hull dest: compact_imp_closed simp: g_def std_def)
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure lebesgue (g ` std) = \<bar>det M\<bar> * Sigma_Algebra.measure lebesgue std

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure lebesgue (g ` std) = \<bar>det M\<bar> * Sigma_Algebra.measure lebesgue std

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have "measure lebesgue std = content std"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure lebesgue std = content std
[PROOF STEP]
using compact
[PROOF STATE]
proof (prove)
using this:
compact std

goal (1 subgoal):
 1. Sigma_Algebra.measure lebesgue std = content std
[PROOF STEP]
by (intro measure_completion) (auto dest: compact_imp_closed)
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure lebesgue std = content std

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure lebesgue std = content std

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have "content std = 1 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content std = 1 / 2
[PROOF STEP]
unfolding std_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (convex hull insert 0 Basis) = 1 / 2
[PROOF STEP]
by (simp add: content_std_simplex)
[PROOF STATE]
proof (state)
this:
content std = 1 / 2

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
content std = 1 / 2

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have "g ` std = convex hull (g ` insert 0 Basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` std = convex hull g ` insert 0 Basis
[PROOF STEP]
unfolding std_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` (convex hull insert 0 Basis) = convex hull g ` insert 0 Basis
[PROOF STEP]
by (rule convex_hull_linear_image) (auto simp: g_def)
[PROOF STATE]
proof (state)
this:
g ` std = convex hull g ` insert 0 Basis

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g ` std = convex hull g ` insert 0 Basis

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have "g ` insert 0 Basis = insert 0 (g ` Basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` insert 0 Basis = insert 0 (g ` Basis)
[PROOF STEP]
by (auto simp: g_def)
[PROOF STATE]
proof (state)
this:
g ` insert 0 Basis = insert 0 (g ` Basis)

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g ` insert 0 Basis = insert 0 (g ` Basis)

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
have "(2 :: 2) \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<noteq> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 \<noteq> 1

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
hence "\<not>(\<forall>y::2. y = 1)"
[PROOF STATE]
proof (prove)
using this:
2 \<noteq> 1

goal (1 subgoal):
 1. \<not> (\<forall>y. y = 1)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>y. y = 1)

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
hence "g ` Basis = {B - A, C - A}"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>y. y = 1)

goal (1 subgoal):
 1. g ` Basis = {B - A, C - A}
[PROOF STEP]
by (auto simp: g_def Basis_vec_def image_iff)
[PROOF STATE]
proof (state)
this:
g ` Basis = {B - A, C - A}

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g ` Basis = {B - A, C - A}

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
note eq [symmetric]
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure lebesgue (convex hull {0, B - A, C - A}) = Sigma_Algebra.measure lebesgue (convex hull {A, B, C})

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = \<bar>det M\<bar> * (1 / 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = \<bar>det M\<bar> * (1 / 2)

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
using finite_imp_compact_convex_hull[of "{A, B, C}"]
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure lebesgue (convex hull {A, B, C}) = \<bar>det M\<bar> * (1 / 2)
finite {A, B, C} \<Longrightarrow> compact (convex hull {A, B, C})

goal (1 subgoal):
 1. content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2
[PROOF STEP]
by (auto dest!: compact_imp_closed simp: det_2 M_def)
[PROOF STATE]
proof (state)
this:
content (convex hull {A, B, C}) = \<bar>(C $ 1 - A $ 1) * (B $ 2 - A $ 2) - (B $ 1 - A $ 1) * (C $ 2 - A $ 2)\<bar> / 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr_less_one:
  fixes x::real
  assumes "1 < x" "y < 0"
  shows "x powr y < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr y < 1
[PROOF STEP]
using assms less_log_iff
[PROOF STATE]
proof (prove)
using this:
1 < x
y < 0
\<lbrakk>1 < ?b; 0 < ?x\<rbrakk> \<Longrightarrow> (?y < log ?b ?x) = (?b powr ?y < ?x)

goal (1 subgoal):
 1. x powr y < 1
[PROOF STEP]
by force


[STATEMENT]
lemma filter_odd_map: "filter odd [0..<2*(x::nat)] = map (\<lambda> y. (2::nat)*y +1) [0..<x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter odd [0..<2 * x] = map (\<lambda>y. 2 * y + 1) [0..<x]
[PROOF STEP]
by(induction x) simp+


[STATEMENT]
lemma prodinf_nonneg:
  fixes f :: "nat \<Rightarrow> 'a::{linordered_idom,linorder_topology}"
  assumes "f has_prod a" "\<And>i. 1 \<le> f i"
  shows "1 \<le> prodinf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) \<le> prodinf f
[PROOF STEP]
using prod_le_prodinf[of f a 0] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f has_prod a; \<And>i. (0::'a) \<le> f i; \<And>i. 0 \<le> i \<Longrightarrow> (1::'a) \<le> f i\<rbrakk> \<Longrightarrow> prod f {..<0} \<le> prodinf f
f has_prod a
(1::'a) \<le> f ?i

goal (1 subgoal):
 1. (1::'a) \<le> prodinf f
[PROOF STEP]
by (metis order_trans prod_ge_1 zero_le_one)


[STATEMENT]
lemma rel_frontier_translation:
  fixes a :: "'a::euclidean_space"
  shows "rel_frontier((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` (rel_frontier S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier ((+) a ` S) = (+) a ` rel_frontier S
[PROOF STEP]
by (simp add: rel_frontier_def translation_diff rel_interior_translation closure_translation)


[STATEMENT]
lemma conv_radius_shift:
  fixes f :: "nat \<Rightarrow> 'a :: {banach, real_normed_div_algebra}"
  shows   "conv_radius (\<lambda>n. f (n + m)) = conv_radius f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>n. f (n + m)) = conv_radius f
[PROOF STEP]
unfolding conv_radius_conv_Sup summable_powser_ignore_initial_segment
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. f n * z ^ n)} = Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. f n * z ^ n)}
[PROOF STEP]
..


[STATEMENT]
lemma "{(s::nat) .. e} \<inter> {s' .. e'} = {} \<longleftrightarrow> s > e' \<or> s' > e \<or> s > e \<or> s' > e'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({s..e} \<inter> {s'..e'} = {}) = (e' < s \<or> e < s' \<or> e < s \<or> e' < s')
[PROOF STEP]
by simp linarith


[STATEMENT]
lemma One_less_Two_le_iff: "1 < k \<longleftrightarrow> 2 \<le> (k :: nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 < k) = (2 \<le> k)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma lower_le_mid: "lower x \<le> mid x" "real_of_float (lower x) \<le> mid x"
  and mid_le_upper: "mid x \<le> upper x" "real_of_float (mid x) \<le> upper x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lower x \<le> mid x &&& real_of_float (lower x) \<le> real_of_float (mid x)) &&& mid x \<le> upper x &&& real_of_float (mid x) \<le> real_of_float (upper x)
[PROOF STEP]
unfolding mid_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lower x \<le> (lower x + upper x) * Float 1 (- 1) &&& real_of_float (lower x) \<le> real_of_float ((lower x + upper x) * Float 1 (- 1))) &&& (lower x + upper x) * Float 1 (- 1) \<le> upper x &&& real_of_float ((lower x + upper x) * Float 1 (- 1)) \<le> real_of_float (upper x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower x \<le> (lower x + upper x) * Float 1 (- 1)
[PROOF STEP]
by transfer (auto simp: powr_neg_one)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. real_of_float (lower x) \<le> real_of_float ((lower x + upper x) * Float 1 (- 1))
 2. (lower x + upper x) * Float 1 (- 1) \<le> upper x
 3. real_of_float ((lower x + upper x) * Float 1 (- 1)) \<le> real_of_float (upper x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float (lower x) \<le> real_of_float ((lower x + upper x) * Float 1 (- 1))
[PROOF STEP]
by transfer (auto simp: powr_neg_one)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (lower x + upper x) * Float 1 (- 1) \<le> upper x
 2. real_of_float ((lower x + upper x) * Float 1 (- 1)) \<le> real_of_float (upper x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lower x + upper x) * Float 1 (- 1) \<le> upper x
[PROOF STEP]
by transfer (auto simp: powr_neg_one)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float ((lower x + upper x) * Float 1 (- 1)) \<le> real_of_float (upper x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_float ((lower x + upper x) * Float 1 (- 1)) \<le> real_of_float (upper x)
[PROOF STEP]
by transfer (auto simp: powr_neg_one)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma checker2_def': "checker2 a b c d e f = (
  let distance   = d - a;
      precond    = check_precond a b c d e f;
      safe_dist1 = first_safe_dist b c;
      safe_dist2 = second_safe_dist b c e f;
      C          = c < f \<and> e < b \<and> b * f > c * e;
      P1         = (e - b)\<^sup>2 < 2 * distance * (f - c);
      P2         = - b\<^sup>2 / c + e\<^sup>2 / f < 2 * distance
  in precond \<and> (safe_dist1 < distance \<or>
                safe_dist1 \<ge> distance \<and> (C \<and> P1 \<or> \<not>C \<and> P2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. checker2 a b c d e f = (let distance = d - a; precond = check_precond a b c d e f; safe_dist1 = first_safe_dist b c; safe_dist2 = second_safe_dist b c e f; C = c < f \<and> e < b \<and> c * e < b * f; P1 = (e - b)\<^sup>2 < 2 * distance * (f - c); P2 = - b\<^sup>2 / c + e\<^sup>2 / f < 2 * distance in precond \<and> (safe_dist1 < distance \<or> distance \<le> safe_dist1 \<and> (C \<and> P1 \<or> \<not> C \<and> P2)))
[PROOF STEP]
unfolding checker2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let distance = d - a; precond = check_precond a b c d e f; safe_dist1 = first_safe_dist b c; safe_dist2 = second_safe_dist b c e f; safe_dist3 = - rel_dist_to_stop (e - b) (f - c) in if \<not> precond then False else if safe_dist1 < distance then True else if c < f \<and> e < b \<and> b - c / f * e < 0 then safe_dist3 < distance else safe_dist2 < distance) = (let distance = d - a; precond = check_precond a b c d e f; safe_dist1 = first_safe_dist b c; safe_dist2 = second_safe_dist b c e f; C = c < f \<and> e < b \<and> c * e < b * f; P1 = (e - b)\<^sup>2 < 2 * distance * (f - c); P2 = - b\<^sup>2 / c + e\<^sup>2 / f < 2 * distance in precond \<and> (safe_dist1 < distance \<or> distance \<le> safe_dist1 \<and> (C \<and> P1 \<or> \<not> C \<and> P2)))
[PROOF STEP]
by (auto simp: Let_def field_split_simps check_precond_def second_safe_dist_def
    rel_dist_to_stop_def)


[STATEMENT]
lemma (in prob_space) prob_neg: "{x\<in>space M. P x} \<in> events \<Longrightarrow> \<P>(x in M. \<not> P x) = 1 - \<P>(x in M. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. P x} \<in> events \<Longrightarrow> prob {x \<in> space M. \<not> P x} = 1 - prob {x \<in> space M. P x}
[PROOF STEP]
by (auto intro!: arg_cong[where f=prob] simp add: prob_compl[symmetric])


[STATEMENT]
lemma shortest_path_walk_length: "shortest_path u v = n \<Longrightarrow> p \<in> connecting_paths u v \<Longrightarrow> walk_length p \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>shortest_path u v = enat n; p \<in> connecting_paths u v\<rbrakk> \<Longrightarrow> n \<le> walk_length p
[PROOF STEP]
using shortest_path_def INF_lower[of p "connecting_paths u v" "\<lambda> p . enat (walk_length p)"]
[PROOF STATE]
proof (prove)
using this:
shortest_path ?u ?v \<equiv> INF p\<in>connecting_paths ?u ?v. enat (walk_length p)
p \<in> connecting_paths u v \<Longrightarrow> (INF i\<in>connecting_paths u v. enat (walk_length i)) \<le> enat (walk_length p)

goal (1 subgoal):
 1. \<lbrakk>shortest_path u v = enat n; p \<in> connecting_paths u v\<rbrakk> \<Longrightarrow> n \<le> walk_length p
[PROOF STEP]
by auto


[STATEMENT]
lemma complex_not_root_unity:
    "1 \<le> n \<Longrightarrow> \<exists>u::complex. norm u = 1 \<and> u^n \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> n \<Longrightarrow> \<exists>u. cmod u = 1 \<and> u ^ n \<noteq> 1
[PROOF STEP]
apply (rule_tac x="exp (of_real pi * \<i> * of_real (1 / n))" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> n \<Longrightarrow> cmod (exp (complex_of_real pi * \<i> * complex_of_real (1 / real n))) = 1 \<and> exp (complex_of_real pi * \<i> * complex_of_real (1 / real n)) ^ n \<noteq> 1
[PROOF STEP]
apply (auto simp: Re_complex_div_eq_0 exp_of_nat_mult [symmetric] mult_ac exp_Euler)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma powr_powr: "(x powr a) powr b = x powr (a * b)"
  for a b x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x powr a) powr b = x powr (a * b)
[PROOF STEP]
by (simp add: powr_def)


[STATEMENT]
lemma not_ex_in_conv: "(\<not> (\<exists>x. x \<in> A)) = (A = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>x. x \<in> A) = (A = {})
[PROOF STEP]
by blast


[STATEMENT]
lemma fps_hypergeo_minus_nat:
  "fps_hypergeo [- of_nat n] [- of_nat (n + m)] (c::'a::field_char_0) $ k =
    (if k \<le> n then
      pochhammer (- of_nat n) k * c ^ k / (pochhammer (- of_nat (n + m)) k * of_nat (fact k))
     else 0)"
  "fps_hypergeo [- of_nat m] [- of_nat (m + n)] (c::'a::field_char_0) $ k =
    (if k \<le> m then
      pochhammer (- of_nat m) k * c ^ k / (pochhammer (- of_nat (m + n)) k * of_nat (fact k))
     else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_hypergeo [- of_nat n] [- of_nat (n + m)] c $ k = (if k \<le> n then pochhammer (- of_nat n) k * c ^ k / (pochhammer (- of_nat (n + m)) k * of_nat (fact k)) else (0::'a)) &&& fps_hypergeo [- of_nat m] [- of_nat (m + n)] c $ k = (if k \<le> m then pochhammer (- of_nat m) k * c ^ k / (pochhammer (- of_nat (m + n)) k * of_nat (fact k)) else (0::'a))
[PROOF STEP]
by (simp_all add: pochhammer_eq_0_iff)


[STATEMENT]
lemma scalar_mult_add: "scalar_mult y (a+b) = (scalar_mult y a) + (scalar_mult y b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scalar_mult y (a + b) = scalar_mult y a + scalar_mult y b
[PROOF STEP]
by (simp add: scalar_mult_def apply_matrix_add algebra_simps)


[STATEMENT]
lemma ivl_splice_Un:
  "{0..<2*n::nat} = ((*) 2 ` {0..<n}) \<union> ((%i. Suc (2*i)) ` {0..<n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<2 * n} = (*) 2 ` {0..<n} \<union> (\<lambda>i. Suc (2 * i)) ` {0..<n}
[PROOF STEP]
apply (unfold image_def Bex_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<2 * n} = {y. \<exists>x. x \<in> {0..<n} \<and> y = 2 * x} \<union> {y. \<exists>x. x \<in> {0..<n} \<and> y = Suc (2 * x)}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x < 2 * n; \<forall>xa<n. x \<noteq> Suc (2 * xa)\<rbrakk> \<Longrightarrow> \<exists>xa<n. x = 2 * xa
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma poly_prod_root_unity: "poly (prod_root_unity ns) x = 0 \<longleftrightarrow> (\<exists>k\<in>set ns. x ^ k = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (prod_root_unity ns) x = (0::'a)) = (\<exists>k\<in>set ns. x ^ k = (1::'a))
[PROOF STEP]
unfolding prod_root_unity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (prod_list (map root_unity ns)) x = (0::'a)) = (\<exists>k\<in>set ns. x ^ k = (1::'a))
[PROOF STEP]
by (simp add: poly_prod_list prod_list_zero_iff o_def image_def poly_root_unity)


[STATEMENT]
lemma Sigma_mset_Un_distrib2: "(SIGMAMSET i\<in>#I. A i \<union># B i) = Sigma_mset I A \<union># Sigma_mset I B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SIGMAMSET i\<in>#I. A i \<union># B i) = Sigma_mset I A \<union># Sigma_mset I B
[PROOF STEP]
by (auto simp: multiset_eq_iff count_sum_mset count_image_mset_Pair sum_mset_if_eq_constant
    Sigma_mset_def diff_mult_distrib2 iterate_op_plus max_def not_in_iff)


[STATEMENT]
lemma prime_dvd_prod_mset_iff: "prime p \<Longrightarrow> p dvd prod_mset A \<longleftrightarrow> (\<exists>x. x \<in># A \<and> p dvd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p \<Longrightarrow> (p dvd \<Prod>\<^sub># A) = (\<exists>x. x \<in># A \<and> p dvd x)
[PROOF STEP]
by (induction A) (simp_all add: prime_elem_dvd_mult_iff prime_imp_prime_elem, blast+)


[STATEMENT]
lemma index_oddpart_unique:
  assumes "odd (m :: nat)" "odd m'"
  shows "(2 ^ i * m = 2 ^ i' * m') \<longleftrightarrow> (i = i' \<and> m = m')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ i * m = 2 ^ i' * m') = (i = i' \<and> m = m')
[PROOF STEP]
proof (induct i arbitrary: i')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i'. (2 ^ 0 * m = 2 ^ i' * m') = (0 = i' \<and> m = m')
 2. \<And>i i'. (\<And>i'. (2 ^ i * m = 2 ^ i' * m') = (i = i' \<and> m = m')) \<Longrightarrow> (2 ^ Suc i * m = 2 ^ i' * m') = (Suc i = i' \<and> m = m')
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>i'. (2 ^ 0 * m = 2 ^ i' * m') = (0 = i' \<and> m = m')
 2. \<And>i i'. (\<And>i'. (2 ^ i * m = 2 ^ i' * m') = (i = i' \<and> m = m')) \<Longrightarrow> (2 ^ Suc i * m = 2 ^ i' * m') = (Suc i = i' \<and> m = m')
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
odd m
odd m'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
odd m
odd m'

goal (1 subgoal):
 1. (2 ^ 0 * m = 2 ^ i' * m') = (0 = i' \<and> m = m')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 ^ 0 * m = 2 ^ i' * m') = (0 = i' \<and> m = m')

goal (1 subgoal):
 1. \<And>i i'. (\<And>i'. (2 ^ i * m = 2 ^ i' * m') = (i = i' \<and> m = m')) \<Longrightarrow> (2 ^ Suc i * m = 2 ^ i' * m') = (Suc i = i' \<and> m = m')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i i'. (\<And>i'. (2 ^ i * m = 2 ^ i' * m') = (i = i' \<and> m = m')) \<Longrightarrow> (2 ^ Suc i * m = 2 ^ i' * m') = (Suc i = i' \<and> m = m')
[PROOF STEP]
case (Suc _ i')
[PROOF STATE]
proof (state)
this:
(2 ^ i_ * m = 2 ^ ?i' * m') = (i_ = ?i' \<and> m = m')

goal (1 subgoal):
 1. \<And>i i'. (\<And>i'. (2 ^ i * m = 2 ^ i' * m') = (i = i' \<and> m = m')) \<Longrightarrow> (2 ^ Suc i * m = 2 ^ i' * m') = (Suc i = i' \<and> m = m')
[PROOF STEP]
from assms this
[PROOF STATE]
proof (chain)
picking this:
odd m
odd m'
(2 ^ i_ * m = 2 ^ ?i' * m') = (i_ = ?i' \<and> m = m')
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
odd m
odd m'
(2 ^ i_ * m = 2 ^ ?i' * m') = (i_ = ?i' \<and> m = m')

goal (1 subgoal):
 1. (2 ^ Suc i_ * m = 2 ^ i' * m') = (Suc i_ = i' \<and> m = m')
[PROOF STEP]
by (cases i') auto
[PROOF STATE]
proof (state)
this:
(2 ^ Suc i_ * m = 2 ^ i' * m') = (Suc i_ = i' \<and> m = m')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_slice_append_mult: "
  \<And>xs. length xs = m * k \<Longrightarrow>
  list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. length xs = m * k \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k
[PROOF STEP]
apply (case_tac "k = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xs. \<lbrakk>length xs = m * k; k = 0\<rbrakk> \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k
 2. \<And>xs. \<lbrakk>length xs = m * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k
[PROOF STEP]
apply (simp add: list_slice_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>length xs = m * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k
[PROOF STEP]
apply (induct m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xs. \<lbrakk>length xs = 0 * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k
 2. \<And>m xs. \<lbrakk>\<And>xs. \<lbrakk>length xs = m * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k; length xs = Suc m * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k
[PROOF STEP]
apply (simp add: list_slice_Nil)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m xs. \<lbrakk>\<And>xs. \<lbrakk>length xs = m * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k; length xs = Suc m * k; k \<noteq> 0\<rbrakk> \<Longrightarrow> list_slice (xs @ ys) k = list_slice xs k @ list_slice ys k
[PROOF STEP]
apply (simp add: list_slice_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m xs. \<lbrakk>\<And>xs. length xs = m * k \<Longrightarrow> list_slice_aux (xs @ ys) k (m + length ys div k) = list_slice_aux xs k m @ list_slice_aux ys k (length ys div k); length xs = k + m * k; 0 < k\<rbrakk> \<Longrightarrow> list_slice_aux (xs @ ys) k ((k + m * k + length ys) div k) = xs \<down> k # list_slice_aux (xs \<up> k) k m @ list_slice_aux ys k (length ys div k)
[PROOF STEP]
apply (simp add: list_slice_def add.commute[of _ "length ys"] add.assoc[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma commutativity_sums_over_funs:
  fixes X :: "'x set"
  fixes Y :: "'y set"
  shows "(\<Sum>i\<in>X. \<Sum>j\<in>Y. (f i j *\<^sub>R C \<bullet> g j)) = (\<Sum>j\<in>Y.\<Sum>i\<in>X. (f i j *\<^sub>R C \<bullet> g j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>X. \<Sum>j\<in>Y. f i j *\<^sub>R C \<bullet> g j) = (\<Sum>j\<in>Y. \<Sum>i\<in>X. f i j *\<^sub>R C \<bullet> g j)
[PROOF STEP]
using Groups_Big.comm_monoid_add_class.sum.swap
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>?A. sum (?g i) ?B) = (\<Sum>j\<in>?B. \<Sum>i\<in>?A. ?g i j)

goal (1 subgoal):
 1. (\<Sum>i\<in>X. \<Sum>j\<in>Y. f i j *\<^sub>R C \<bullet> g j) = (\<Sum>j\<in>Y. \<Sum>i\<in>X. f i j *\<^sub>R C \<bullet> g j)
[PROOF STEP]
by auto


[STATEMENT]
lemma borel_measurable_Min[measurable (raw)]:
  "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. Min ((\<lambda>i. f i x)`I) :: 'b::{second_countable_topology, linorder_topology}) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M\<rbrakk> \<Longrightarrow> (\<lambda>x. MIN i\<in>I. f i x) \<in> borel_measurable M
[PROOF STEP]
proof (induct I rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MIN i\<in>{}. f i x) \<in> borel_measurable M
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MIN i\<in>F. f i x) \<in> borel_measurable M; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable M\<rbrakk> \<Longrightarrow> (\<lambda>xa. MIN i\<in>insert x F. f i xa) \<in> borel_measurable M
[PROOF STEP]
case (insert i I)
[PROOF STATE]
proof (state)
this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MIN i\<in>I. f i x) \<in> borel_measurable M
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable M

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MIN i\<in>{}. f i x) \<in> borel_measurable M
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MIN i\<in>F. f i x) \<in> borel_measurable M; \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable M\<rbrakk> \<Longrightarrow> (\<lambda>xa. MIN i\<in>insert x F. f i xa) \<in> borel_measurable M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MIN i\<in>I. f i x) \<in> borel_measurable M
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MIN i\<in>I. f i x) \<in> borel_measurable M
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. MIN i\<in>insert i I. f i x) \<in> borel_measurable M
[PROOF STEP]
by (cases "I = {}") auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. MIN i\<in>insert i I. f i x) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable M) \<Longrightarrow> (\<lambda>x. MIN i\<in>{}. f i x) \<in> borel_measurable M
[PROOF STEP]
qed auto