[STATEMENT]
lemma reduction_doesnt_break_things_invertibility_step1:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "nat list list"
  fixes signs :: "rat list list"
  assumes len_eq: "length subsets = length signs"
  assumes inv: "invertible_mat (matrix_A signs subsets)"
  assumes nonzero: "p \<noteq> 0"
  assumes welldefined_signs1: "well_def_signs (length qs) signs"
  assumes distinct_signs: "distinct signs"
  assumes all_info: "set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set(signs)"
  assumes match: "satisfy_equation p qs subsets signs"
  shows "vec_space.rank (length signs) (reduce_mat_cols (matrix_A signs subsets) (solve_for_lhs p qs subsets (matrix_A signs subsets))) =
    (length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
let ?og_mat = "(matrix_A signs subsets)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
let ?lhs = "(solve_for_lhs p qs subsets ?og_mat)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
let ?new_mat = "(take_rows_from_matrix (reduce_mat_cols ?og_mat ?lhs) (rows_to_keep (reduce_mat_cols ?og_mat ?lhs)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
have "square_mat (matrix_A signs subsets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_mat (M_mat signs subsets)
[PROOF STEP]
using inv
[PROOF STATE]
proof (prove)
using this:
invertible_mat (M_mat signs subsets)

goal (1 subgoal):
 1. square_mat (M_mat signs subsets)
[PROOF STEP]
using invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
invertible_mat (M_mat signs subsets)
invertible_mat ?A \<equiv> square_mat ?A \<and> (\<exists>B. inverts_mat ?A B \<and> inverts_mat B ?A)

goal (1 subgoal):
 1. square_mat (M_mat signs subsets)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
square_mat (M_mat signs subsets)

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
square_mat (M_mat signs subsets)
[PROOF STEP]
have mat_size: "?og_mat \<in> carrier_mat (length signs) (length signs)"
[PROOF STATE]
proof (prove)
using this:
square_mat (M_mat signs subsets)

goal (1 subgoal):
 1. M_mat signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
using size_of_mat
[PROOF STATE]
proof (prove)
using this:
square_mat (M_mat signs subsets)
M_mat ?signs ?subsets \<in> carrier_mat (length ?subsets) (length ?signs)

goal (1 subgoal):
 1. M_mat signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M_mat signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M_mat signs subsets \<in> carrier_mat (length signs) (length signs)
[PROOF STEP]
have mat_size_alt: "?og_mat \<in> carrier_mat (length subsets) (length subsets)"
[PROOF STATE]
proof (prove)
using this:
M_mat signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. M_mat signs subsets \<in> carrier_mat (length subsets) (length subsets)
[PROOF STEP]
using size_of_mat same_size assms
[PROOF STATE]
proof (prove)
using this:
M_mat signs subsets \<in> carrier_mat (length signs) (length signs)
M_mat ?signs ?subsets \<in> carrier_mat (length ?subsets) (length ?signs)
invertible_mat (M_mat ?signs ?subsets) \<Longrightarrow> length ?subsets = length ?signs
length subsets = length signs
invertible_mat (M_mat signs subsets)
p \<noteq> 0
well_def_signs (length qs) signs
distinct signs
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set signs
satisfy_equation p qs subsets signs

goal (1 subgoal):
 1. M_mat signs subsets \<in> carrier_mat (length subsets) (length subsets)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M_mat signs subsets \<in> carrier_mat (length subsets) (length subsets)

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
have det_h: "det ?og_mat \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (M_mat signs subsets) \<noteq> 0
[PROOF STEP]
using invertible_det[where A = "matrix_A signs subsets"] mat_size
[PROOF STATE]
proof (prove)
using this:
M_mat signs subsets \<in> carrier_mat ?n ?n \<Longrightarrow> invertible_mat (M_mat signs subsets) = (det (M_mat signs subsets) \<noteq> 0)
M_mat signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. det (M_mat signs subsets) \<noteq> 0
[PROOF STEP]
using inv
[PROOF STATE]
proof (prove)
using this:
M_mat signs subsets \<in> carrier_mat ?n ?n \<Longrightarrow> invertible_mat (M_mat signs subsets) = (det (M_mat signs subsets) \<noteq> 0)
M_mat signs subsets \<in> carrier_mat (length signs) (length signs)
invertible_mat (M_mat signs subsets)

goal (1 subgoal):
 1. det (M_mat signs subsets) \<noteq> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
det (M_mat signs subsets) \<noteq> 0

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
det (M_mat signs subsets) \<noteq> 0
[PROOF STEP]
have rank_h: "vec_space.rank (length signs) ?og_mat = (length signs)"
[PROOF STATE]
proof (prove)
using this:
det (M_mat signs subsets) \<noteq> 0

goal (1 subgoal):
 1. vec_space.rank (length signs) (M_mat signs subsets) = length signs
[PROOF STEP]
using vec_space.det_rank_iff  mat_size
[PROOF STATE]
proof (prove)
using this:
det (M_mat signs subsets) \<noteq> 0
?A \<in> carrier_mat ?n ?n \<Longrightarrow> (det ?A \<noteq> (0::?'a)) = (vec_space.rank ?n ?A = ?n)
M_mat signs subsets \<in> carrier_mat (length signs) (length signs)

goal (1 subgoal):
 1. vec_space.rank (length signs) (M_mat signs subsets) = length signs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_space.rank (length signs) (M_mat signs subsets) = length signs

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vec_space.rank (length signs) (M_mat signs subsets) = length signs
[PROOF STEP]
have dist_cols: "distinct (cols ?og_mat)"
[PROOF STATE]
proof (prove)
using this:
vec_space.rank (length signs) (M_mat signs subsets) = length signs

goal (1 subgoal):
 1. distinct (cols (M_mat signs subsets))
[PROOF STEP]
using mat_size vec_space.non_distinct_low_rank[where A = ?og_mat, where n = "length signs"]
[PROOF STATE]
proof (prove)
using this:
vec_space.rank (length signs) (M_mat signs subsets) = length signs
M_mat signs subsets \<in> carrier_mat (length signs) (length signs)
\<lbrakk>M_mat signs subsets \<in> carrier_mat (length signs) (length signs); \<not> distinct (cols (M_mat signs subsets))\<rbrakk> \<Longrightarrow> vec_space.rank (length signs) (M_mat signs subsets) < length signs

goal (1 subgoal):
 1. distinct (cols (M_mat signs subsets))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (cols (M_mat signs subsets))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
have well_def: "(\<And>j. j \<in> set (find_nonzeros_from_input_vec
                    (solve_for_lhs p qs subsets (matrix_A signs subsets))) \<Longrightarrow>
          j < length (cols (matrix_A signs subsets)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> j < length (cols (M_mat signs subsets))
[PROOF STEP]
using assms well_def_find_zeros_from_lhs_vec
[PROOF STATE]
proof (prove)
using this:
length subsets = length signs
invertible_mat (M_mat signs subsets)
p \<noteq> 0
well_def_signs (length qs) signs
distinct signs
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set signs
satisfy_equation p qs subsets signs
\<lbrakk>length ?subsets = length ?signs; invertible_mat (M_mat ?signs ?subsets); ?p \<noteq> 0; well_def_signs (length ?qs) ?signs; distinct ?signs; set (characterize_consistent_signs_at_roots_copr ?p ?qs) \<subseteq> set ?signs; satisfy_equation ?p ?qs ?subsets ?signs; ?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs ?p ?qs ?subsets (M_mat ?signs ?subsets)))\<rbrakk> \<Longrightarrow> ?j < length (cols (M_mat ?signs ?subsets))

goal (1 subgoal):
 1. \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> j < length (cols (M_mat signs subsets))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length (cols (M_mat signs subsets))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
have dist1: "distinct
     (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
unfolding find_nonzeros_from_input_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter (\<lambda>i. solve_for_lhs p qs subsets (M_mat signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
have clear: "set (take_indices (cols (matrix_A signs subsets))
          (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets))))
    \<subseteq> set (cols (matrix_A signs subsets))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets))
[PROOF STEP]
using assms take_cols_subsets_og_cols
[PROOF STATE]
proof (prove)
using this:
length subsets = length signs
invertible_mat (M_mat signs subsets)
p \<noteq> 0
well_def_signs (length qs) signs
distinct signs
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set signs
satisfy_equation p qs subsets signs
\<lbrakk>length ?subsets = length ?signs; invertible_mat (M_mat ?signs ?subsets); ?p \<noteq> 0; well_def_signs (length ?qs) ?signs; distinct ?signs; set (characterize_consistent_signs_at_roots_copr ?p ?qs) \<subseteq> set ?signs; satisfy_equation ?p ?qs ?subsets ?signs\<rbrakk> \<Longrightarrow> set (take_indices (cols (M_mat ?signs ?subsets)) (find_nonzeros_from_input_vec (solve_for_lhs ?p ?qs ?subsets (M_mat ?signs ?subsets)))) \<subseteq> set (cols (M_mat ?signs ?subsets))

goal (1 subgoal):
 1. set (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets))
[PROOF STEP]
have "distinct (take_indices (cols (matrix_A signs subsets))
          (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets))))"
[PROOF STATE]
proof (prove)
using this:
set (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets))

goal (1 subgoal):
 1. distinct (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
unfolding take_indices_def
[PROOF STATE]
proof (prove)
using this:
set (map ((!) (cols (M_mat signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets))

goal (1 subgoal):
 1. distinct (map ((!) (cols (M_mat signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
using dist1 dist_cols well_def conjugatable_vec_space.distinct_map_nth[where ls = "cols (matrix_A signs subsets)", where inds = "(find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))"]
[PROOF STATE]
proof (prove)
using this:
set (map ((!) (cols (M_mat signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets))
distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
distinct (cols (M_mat signs subsets))
?j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> ?j < length (cols (M_mat signs subsets))
\<lbrakk>distinct (cols (M_mat signs subsets)); distinct (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); \<And>j. j \<in> set (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> j < length (cols (M_mat signs subsets))\<rbrakk> \<Longrightarrow> distinct (map ((!) (cols (M_mat signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))

goal (1 subgoal):
 1. distinct (map ((!) (cols (M_mat signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
have unfold_thesis: "vec_space.rank (length signs) (mat_of_cols (dim_row ?og_mat) (take_indices (cols ?og_mat) (find_nonzeros_from_input_vec ?lhs)))
= (length (find_nonzeros_from_input_vec ?lhs))"
[PROOF STATE]
proof (prove)
using this:
distinct (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))

goal (1 subgoal):
 1. vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat signs subsets)) (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
using clear inv conjugatable_vec_space.rank_invertible_subset_cols[where A= "matrix_A signs subsets", where B = "(take_indices (cols (matrix_A signs subsets))
         (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets))))"]
[PROOF STATE]
proof (prove)
using this:
distinct (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
set (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets))
invertible_mat (M_mat signs subsets)
\<lbrakk>invertible_mat (M_mat signs subsets); M_mat signs subsets \<in> carrier_mat ?n ?n; set (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) \<subseteq> set (cols (M_mat signs subsets)); distinct (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))\<rbrakk> \<Longrightarrow> vec_space.rank ?n (mat_of_cols ?n (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))

goal (1 subgoal):
 1. vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat signs subsets)) (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
by (simp add: len_eq mat_size take_indices_def)
[PROOF STATE]
proof (state)
this:
vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat signs subsets)) (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat signs subsets)) (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat signs subsets)) (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))

goal (1 subgoal):
 1. vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_space.rank (length signs) (mat_of_cols (length subsets) (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> vec_space.rank (length signs) (take_cols_from_matrix (M_mat signs subsets) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
unfolding take_cols_from_matrix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_space.rank (length signs) (mat_of_cols (length subsets) (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) \<Longrightarrow> vec_space.rank (length signs) (mat_of_cols (dim_row (M_mat signs subsets)) (take_indices (cols (M_mat signs subsets)) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_space.rank (length signs) (reduce_mat_cols (M_mat signs subsets) (solve_for_lhs p qs subsets (M_mat signs subsets))) = length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Qp_int_nat_pow_pow:
  fixes n::int
  fixes m::nat
  assumes "a \<in> nonzero Q\<^sub>p"
  shows "(a[^](n*m)) = ((a[^]n)[^]m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] (n * int m) = (a [^] n) [^] m
[PROOF STEP]
by (simp add: Qp_int_pow_pow assms int_pow_int)


[STATEMENT]
lemma bernoulli_Suc':
  "bernoulli (Suc n) = -1/(real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
have "bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k)
[PROOF STEP]
unfolding bernoulli.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k)

goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k)

goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
have "(\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k) =
               (\<Sum>k\<le>n. real (n + 2 choose (n - k)) * bernoulli (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k) = (\<Sum>k\<le>n. real (n + 2 choose (n - k)) * bernoulli (n - k))
[PROOF STEP]
by (rule sum.reindex_bij_witness[of _ "\<lambda>k. n - k" "\<lambda>k. n - k"]) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k) = (\<Sum>k\<le>n. real (n + 2 choose (n - k)) * bernoulli (n - k))

goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. real (n + 2 choose k) * bernoulli k) = (\<Sum>k\<le>n. real (n + 2 choose (n - k)) * bernoulli (n - k))

goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
have "\<dots> = (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. real (n + 2 choose (n - k)) * bernoulli (n - k)) = (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
by (intro sum.cong refl, subst binomial_symmetric) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. real (n + 2 choose (n - k)) * bernoulli (n - k)) = (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))

goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))

goal (1 subgoal):
 1. bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
bernoulli (Suc n) = - 1 / (real n + 2) * (\<Sum>k\<le>n. real (n + 2 choose (k + 2)) * bernoulli (n - k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_subcls1: "finite (subcls1 G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subcls1 G)
[PROOF STEP]
apply (subst subcls1_def2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (SIGMA C:{C. is_class G C}. {D. C \<noteq> Object \<and> super (the (class G C)) = D})
[PROOF STEP]
apply (rule finite_SigmaI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {C. is_class G C}
 2. \<And>C. C \<in> {C. is_class G C} \<Longrightarrow> finite {D. C \<noteq> Object \<and> super (the (class G C)) = D}
[PROOF STEP]
apply (rule finite_is_class)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>C. C \<in> {C. is_class G C} \<Longrightarrow> finite {D. C \<noteq> Object \<and> super (the (class G C)) = D}
[PROOF STEP]
apply (rule_tac B = "{super (the (class G C))}" in finite_subset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>C. C \<in> {C. is_class G C} \<Longrightarrow> {D. C \<noteq> Object \<and> super (the (class G C)) = D} \<subseteq> {super (the (class G C))}
 2. \<And>C. C \<in> {C. is_class G C} \<Longrightarrow> finite {super (the (class G C))}
[PROOF STEP]
apply  auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_pole_tendsto:
  fixes f::"('a::topological_space \<Rightarrow> 'b::real_normed_div_algebra)"
  shows "is_pole f x \<Longrightarrow> ((inverse o f) \<longlongrightarrow> 0) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pole f x \<Longrightarrow> (inverse \<circ> f) \<midarrow>x\<rightarrow> (0::'b)
[PROOF STEP]
unfolding is_pole_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_infinity (at x) \<Longrightarrow> (inverse \<circ> f) \<midarrow>x\<rightarrow> (0::'b)
[PROOF STEP]
by (auto simp add:filterlim_inverse_at_iff[symmetric] comp_def filterlim_at)


[STATEMENT]
lemma heap_ordered_single:
"heap_ordered t = (\<forall>x \<in> set_mset (tree_to_multiset t). prio t \<le> snd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. heap_ordered t = (\<forall>x\<in>#tree_to_multiset t. prio t \<le> snd x)
[PROOF STEP]
by (cases t) auto


[STATEMENT]
lemma Afix_cong[fundef_cong]:
  "\<lbrakk> (\<And> e. e \<in> snd ` set heap2 \<Longrightarrow> aexp1 e = aexp2 e); heap1 = heap2 \<rbrakk>
      \<Longrightarrow> ArityAnalysis.Afix aexp1 heap1 = ArityAnalysis.Afix aexp2 heap2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>e. e \<in> snd ` set heap2 \<Longrightarrow> aexp1 e = aexp2 e; heap1 = heap2\<rbrakk> \<Longrightarrow> ArityAnalysis.Afix aexp1 heap1 = ArityAnalysis.Afix aexp2 heap2
[PROOF STEP]
unfolding ArityAnalysis.Afix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>e. e \<in> snd ` set heap2 \<Longrightarrow> aexp1 e = aexp2 e; heap1 = heap2\<rbrakk> \<Longrightarrow> (\<Lambda> ae. \<mu> x. ArityAnalysis.ABinds aexp1 heap1\<cdot>x \<squnion> ae) = (\<Lambda> ae. \<mu> x. ArityAnalysis.ABinds aexp2 heap2\<cdot>x \<squnion> ae)
[PROOF STEP]
by (metis Abinds_cong)


[STATEMENT]
lemma (in domain) trivial_ker_imp_transcendental:
  assumes "subring K R" and "x \<in> carrier R"
  shows "a_kernel (K[X]) R (\<lambda>p. eval p x) = { [] } \<Longrightarrow> (transcendental over K) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a_kernel (K [X]) R (\<lambda>p. local.eval p x) = {[]} \<Longrightarrow> (transcendental over K) x
[PROOF STEP]
using ring_hom_ring.trivial_ker_imp_inj[OF eval_ring_hom[OF assms]]
[PROOF STATE]
proof (prove)
using this:
a_kernel (K [X]) R (\<lambda>p. local.eval p x) = {\<zero>\<^bsub>K [X]\<^esub>} \<Longrightarrow> inj_on (\<lambda>p. local.eval p x) (carrier (K [X]))

goal (1 subgoal):
 1. a_kernel (K [X]) R (\<lambda>p. local.eval p x) = {[]} \<Longrightarrow> (transcendental over K) x
[PROOF STEP]
unfolding transcendental_def over_def
[PROOF STATE]
proof (prove)
using this:
a_kernel (K [X]) R (\<lambda>p. local.eval p x) = {\<zero>\<^bsub>K [X]\<^esub>} \<Longrightarrow> inj_on (\<lambda>p. local.eval p x) (carrier (K [X]))

goal (1 subgoal):
 1. a_kernel (K [X]) R (\<lambda>p. local.eval p x) = {[]} \<Longrightarrow> inj_on (\<lambda>p. local.eval p x) (carrier (K [X]))
[PROOF STEP]
by (simp add: univ_poly_zero)


[STATEMENT]
lemma infsum_swap_banach:
  fixes A :: "'a set" and B :: "'b set"
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::banach"
  assumes \<open>(\<lambda>(x, y). f x y) summable_on (A \<times> B)\<close>
  shows "infsum (\<lambda>x. infsum (\<lambda>y. f x y) B) A = infsum (\<lambda>y. infsum (\<lambda>x. f x y) A) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
have [simp]: \<open>(\<lambda>(x, y). f y x) summable_on (B \<times> A)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). f y x) summable_on B \<times> A
[PROOF STEP]
apply (subst product_swap[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). f y x) summable_on prod.swap ` (A \<times> B)
[PROOF STEP]
apply (subst summable_on_reindex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on prod.swap (A \<times> B)
 2. (\<lambda>(x, y). f y x) \<circ> prod.swap summable_on A \<times> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f x y) summable_on A \<times> B

goal (2 subgoals):
 1. inj_on prod.swap (A \<times> B)
 2. (\<lambda>(x, y). f y x) \<circ> prod.swap summable_on A \<times> B
[PROOF STEP]
by (auto simp: o_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>(x, y). f y x) summable_on B \<times> A

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
have \<open>infsum (\<lambda>x. infsum (\<lambda>y. f x y) B) A = infsum (\<lambda>(x,y). f x y) (A \<times> B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y)
[PROOF STEP]
apply (subst infsum_Sigma'_banach)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>(x, y). f x y) summable_on A \<times> B
 2. (\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f x y) summable_on A \<times> B

goal (2 subgoals):
 1. (\<lambda>(x, y). f x y) summable_on A \<times> B
 2. (\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
have \<open>\<dots> = infsum (\<lambda>(x,y). f y x) (B \<times> A)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x)
[PROOF STEP]
apply (subst product_swap[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>(x, y)\<in>prod.swap ` (B \<times> A). f x y) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x)
[PROOF STEP]
apply (subst infsum_reindex)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on prod.swap (B \<times> A)
 2. infsum ((\<lambda>(x, y). f x y) \<circ> prod.swap) (B \<times> A) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f x y) summable_on A \<times> B

goal (2 subgoals):
 1. inj_on prod.swap (B \<times> A)
 2. infsum ((\<lambda>(x, y). f x y) \<circ> prod.swap) (B \<times> A) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x)
[PROOF STEP]
by (auto simp: o_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>(x, y)\<in>A \<times> B. f x y) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
have \<open>\<dots> = infsum (\<lambda>y. infsum (\<lambda>x. f x y) A) B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
apply (subst infsum_Sigma'_banach)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>(x, y). f y x) summable_on B \<times> A
 2. (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f x y) summable_on A \<times> B

goal (2 subgoals):
 1. (\<lambda>(x, y). f y x) summable_on B \<times> A
 2. (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x) = (\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>(x, y)\<in>B \<times> A. f y x) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)

goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>x\<in>A. infsum (f x) B) = (\<Sum>\<^sub>\<infinity>y\<in>B. \<Sum>\<^sub>\<infinity>x\<in>A. f x y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_pow_int: "x ^ n = pow_int x n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ n = pow_int x (int n)
[PROOF STEP]
unfolding pow_int_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ n = (if int n < 0 then (1::'a) / x ^ nat (- int n) else x ^ nat (int n))
[PROOF STEP]
by auto


[STATEMENT]
lemma of_nat_word_less_iff:
  \<open>of_nat m < (of_nat n :: 'a::len word) \<longleftrightarrow> take_bit LENGTH('a) m < take_bit LENGTH('a) n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (word_of_nat m < word_of_nat n) = (take_bit LENGTH('a) m < take_bit LENGTH('a) n)
[PROOF STEP]
by transfer (simp add: take_bit_of_nat)


[STATEMENT]
lemma coprime_preserves: "coprime (#V :: 'p mod_ring poly) (#W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_monoid_mult_class.coprime (#(#v + Polynomial.smult (of_nat q) (#v'))) (#(#w + Polynomial.smult (of_nat q) (#w')))
[PROOF STEP]
apply (intro coprimeI,simp add: rebase_q_to_p.of_nat_CARD_eq_0[simplified] hom_distribs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>r dvd #v; r dvd #w\<rbrakk> \<Longrightarrow> r \<noteq> 0 \<and> degree r = 0
[PROOF STEP]
using coprime
[PROOF STATE]
proof (prove)
using this:
comm_monoid_mult_class.coprime (#v) (#w)

goal (1 subgoal):
 1. \<And>r. \<lbrakk>r dvd #v; r dvd #w\<rbrakk> \<Longrightarrow> r \<noteq> 0 \<and> degree r = 0
[PROOF STEP]
by (elim coprimeE, auto)


[STATEMENT]
lemma "(\<forall>x y. \<exists>z. \<forall>w. (P(x)\<and>Q(y)\<longrightarrow>R(z)\<and>S(w)))
    \<longrightarrow> (\<exists>x y. P(x) \<and> Q(y)) \<longrightarrow> (\<exists>z. R(z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. \<exists>z. \<forall>w. P x \<and> Q y \<longrightarrow> R z \<and> S w) \<longrightarrow> (\<exists>x y. P x \<and> Q y) \<longrightarrow> (\<exists>z. R z)
[PROOF STEP]
by blast


[STATEMENT]
lemma multiset_add_filter_size: "size {# a \<in># (A1 + A2) . P a #} = size {# a \<in># A1 . P a #} +
    size {# a \<in># A2 . P a #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset P (A1 + A2)) = size (filter_mset P A1) + size (filter_mset P A2)
[PROOF STEP]
by simp


[STATEMENT]
lemma fact_psi_bound_odd:
  assumes "odd k"
  shows "ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d=1..k. (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
from fact_expand_psi
[PROOF STATE]
proof (chain)
picking this:
ln (fact ?n) - 2 * ln (fact (?n div 2)) = (\<Sum>d = 1..?n. (- 1) ^ (d + 1) * psi (?n div d))
[PROOF STEP]
have "ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))"
[PROOF STATE]
proof (prove)
using this:
ln (fact ?n) - 2 * ln (fact (?n div 2)) = (\<Sum>d = 1..?n. (- 1) ^ (d + 1) * psi (?n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "\<dots> \<le> (\<Sum>d=1..k. (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
proof (cases "k \<le> n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
 2. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k \<le> n

goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
 2. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "(\<Sum>d=1..n. (-1)^(d+1) * psi (n div d)) \<le> (
             \<Sum>d=1..2*(n div 2)+1. (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (n div 2) + 1. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
by (cases "even n") (simp_all add: psi_pos)
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (n div 2) + 1. (- 1) ^ (d + 1) * psi (n div d))

goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
 2. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (n div 2) + 1. (- 1) ^ (d + 1) * psi (n div d))

goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
 2. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
from True assms psi_expansion_cutoff(2)[of "k div 2" "n div 2" n]
[PROOF STATE]
proof (chain)
picking this:
k \<le> n
odd k
k div 2 \<le> n div 2 \<Longrightarrow> (\<Sum>d = 1..2 * (n div 2) + 1. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (k div 2) + 1. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "\<dots> \<le> (\<Sum>d=1..k. (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
using this:
k \<le> n
odd k
k div 2 \<le> n div 2 \<Longrightarrow> (\<Sum>d = 1..2 * (n div 2) + 1. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (k div 2) + 1. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. (\<Sum>d = 1..2 * (n div 2) + 1. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..2 * (n div 2) + 1. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
 2. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> k \<le> n

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "(\<Sum>d=1..n. (-1)^(d+1) * psi (n div d)) \<le> (\<Sum>d=1..2*((n+1) div 2). (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * ((n + 1) div 2). (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
by (cases "even n") (simp_all add: psi_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * ((n + 1) div 2). (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * ((n + 1) div 2). (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
from False assms psi_expansion_cutoff(1)[of "(n+1) div 2" "k div 2" n]
[PROOF STATE]
proof (chain)
picking this:
\<not> k \<le> n
odd k
(n + 1) div 2 \<le> k div 2 \<Longrightarrow> (\<Sum>d = 1..2 * ((n + 1) div 2). (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (k div 2). (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "(\<Sum>d=1..2*((n+1) div 2). (-1)^(d+1) * psi (n div d)) \<le> (\<Sum>d=1..2*(k div 2). (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
using this:
\<not> k \<le> n
odd k
(n + 1) div 2 \<le> k div 2 \<Longrightarrow> (\<Sum>d = 1..2 * ((n + 1) div 2). (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (k div 2). (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. (\<Sum>d = 1..2 * ((n + 1) div 2). (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (k div 2). (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..2 * ((n + 1) div 2). (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (k div 2). (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..2 * ((n + 1) div 2). (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..2 * (k div 2). (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
odd k
[PROOF STEP]
have "\<dots> \<le> (\<Sum>d=1..k. (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
using this:
odd k

goal (1 subgoal):
 1. (\<Sum>d = 1..2 * (k div 2). (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
by (auto elim: oddE simp: psi_pos)
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..2 * (k div 2). (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) \<le> (\<Sum>d = 1..k. (- 1) ^ (d + 1) * psi (n div d))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cong_mult:
  "[b = c] (mod a) \<Longrightarrow> [d = e] (mod a) \<Longrightarrow> [b * d = c * e] (mod a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>[b = c] (mod a); [d = e] (mod a)\<rbrakk> \<Longrightarrow> [b * d = c * e] (mod a)
[PROOF STEP]
by (auto simp add: cong_def intro: mod_mult_cong)


[STATEMENT]
lemma poly_has_sgnx_left_right:
  fixes c a::real and p::"real poly"
  assumes "p\<noteq>0"
  shows "(poly p has_sgnx c) (at_left a) \<longleftrightarrow> (if even (order a p)
            then (poly p has_sgnx c) (at_right a)
            else (poly p has_sgnx -c) (at_right a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p has_sgnx c) (at_left a) = (if even (order a p) then (poly p has_sgnx c) (at_right a) else (poly p has_sgnx - c) (at_right a))
[PROOF STEP]
using poly_sgnx_left_right
[PROOF STATE]
proof (prove)
using this:
?p \<noteq> 0 \<Longrightarrow> sgnx (poly ?p) (at_left ?a) = (if even (order ?a ?p) then sgnx (poly ?p) (at_right ?a) else - sgnx (poly ?p) (at_right ?a))

goal (1 subgoal):
 1. (poly p has_sgnx c) (at_left a) = (if even (order a p) then (poly p has_sgnx c) (at_right a) else (poly p has_sgnx - c) (at_right a))
[PROOF STEP]
by (metis (no_types, opaque_lifting) add.inverse_inverse assms has_sgnx_unique
     sgnx_able_poly sgnx_able_sgnx trivial_limit_at_left_real trivial_limit_at_right_real)


[STATEMENT]
lemma four_block_diag_similar:
  assumes "unitarily_equiv A1 B1 U1"
  and "unitarily_equiv A2 B2 U2"
  and "dim_row A1 = dim_col A1"
  and "dim_row A2 = dim_col A2"
shows "similar_mat_wit
  (four_block_diag A1 A2)
  (four_block_diag B1 B2)
  (four_block_diag U1 U2)
  (Complex_Matrix.adjoint (four_block_diag U1 U2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit (four_block_diag A1 A2) (four_block_diag B1 B2) (four_block_diag U1 U2) (Complex_Matrix.adjoint (four_block_diag U1 U2))
[PROOF STEP]
unfolding similar_mat_wit_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let n = dim_row (four_block_diag A1 A2) in {four_block_diag A1 A2, four_block_diag B1 B2, four_block_diag U1 U2, Complex_Matrix.adjoint (four_block_diag U1 U2)} \<subseteq> carrier_mat n n \<and> four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m n \<and> Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m n \<and> four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
proof (simp add: Let_def, intro conjI)
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. four_block_diag A1 A2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 2. four_block_diag B1 B2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 3. four_block_diag U1 U2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 4. Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 5. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m (dim_row A1 + dim_row A2)
 6. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m (dim_row A1 + dim_row A2)
 7. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
define n where "n = dim_row A1 + dim_row A2"
[PROOF STATE]
proof (state)
this:
n = dim_row A1 + dim_row A2

goal (7 subgoals):
 1. four_block_diag A1 A2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 2. four_block_diag B1 B2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 3. four_block_diag U1 U2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 4. Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 5. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m (dim_row A1 + dim_row A2)
 6. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m (dim_row A1 + dim_row A2)
 7. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
show "four_block_diag A1 A2 \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag A1 A2 \<in> carrier_mat n n
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag A1 A2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitarily_equiv A1 B1 U1
unitarily_equiv A2 B2 U2
dim_row A1 = dim_col A1
dim_row A2 = dim_col A2

goal (1 subgoal):
 1. four_block_diag A1 A2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
four_block_diag A1 A2 \<in> carrier_mat n n

goal (6 subgoals):
 1. four_block_diag B1 B2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 2. four_block_diag U1 U2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 3. Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 4. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m (dim_row A1 + dim_row A2)
 5. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m (dim_row A1 + dim_row A2)
 6. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
show "four_block_diag B1 B2 \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag B1 B2 \<in> carrier_mat n n
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag B1 B2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitarily_equiv A1 B1 U1
unitarily_equiv A2 B2 U2
dim_row A1 = dim_col A1
dim_row A2 = dim_col A2

goal (1 subgoal):
 1. four_block_diag B1 B2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
[PROOF STEP]
by (metis carrier_matI four_block_carrier_mat unitarily_equiv_carrier(1))
[PROOF STATE]
proof (state)
this:
four_block_diag B1 B2 \<in> carrier_mat n n

goal (5 subgoals):
 1. four_block_diag U1 U2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 2. Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 3. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m (dim_row A1 + dim_row A2)
 4. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m (dim_row A1 + dim_row A2)
 5. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
show u: "four_block_diag U1 U2 \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag U1 U2 \<in> carrier_mat n n
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag U1 U2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitarily_equiv A1 B1 U1
unitarily_equiv A2 B2 U2
dim_row A1 = dim_col A1
dim_row A2 = dim_col A2

goal (1 subgoal):
 1. four_block_diag U1 U2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
[PROOF STEP]
by (metis carrier_matI four_block_carrier_mat unitarily_equiv_carrier(2))
[PROOF STATE]
proof (state)
this:
four_block_diag U1 U2 \<in> carrier_mat n n

goal (4 subgoals):
 1. Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
 2. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m (dim_row A1 + dim_row A2)
 3. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m (dim_row A1 + dim_row A2)
 4. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
thus cu: "Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
four_block_diag U1 U2 \<in> carrier_mat n n

goal (1 subgoal):
 1. Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat n n
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
four_block_diag U1 U2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)

goal (1 subgoal):
 1. Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
[PROOF STEP]
using adjoint_dim'
[PROOF STATE]
proof (prove)
using this:
four_block_diag U1 U2 \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
?A \<in> carrier_mat ?n ?m \<Longrightarrow> Complex_Matrix.adjoint ?A \<in> carrier_mat ?m ?n

goal (1 subgoal):
 1. Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat (dim_row A1 + dim_row A2) (dim_row A1 + dim_row A2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat n n

goal (3 subgoals):
 1. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m (dim_row A1 + dim_row A2)
 2. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m (dim_row A1 + dim_row A2)
 3. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
show "four_block_diag U1 U2*Complex_Matrix.adjoint (four_block_diag U1 U2) =
    1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m n
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m (dim_row A1 + dim_row A2)
[PROOF STEP]
using u assms four_block_diag_unitary n_def
      unitarily_equiv_def unitary_simps(2)
[PROOF STATE]
proof (prove)
using this:
four_block_diag U1 U2 \<in> carrier_mat n n
unitarily_equiv A1 B1 U1
unitarily_equiv A2 B2 U2
dim_row A1 = dim_col A1
dim_row A2 = dim_col A2
\<lbrakk>Complex_Matrix.unitary ?U1.0; Complex_Matrix.unitary ?U2.0\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (four_block_diag ?U1.0 ?U2.0)
n = dim_row A1 + dim_row A2
unitarily_equiv ?A ?B ?U \<equiv> Complex_Matrix.unitary ?U \<and> similar_mat_wit ?A ?B ?U (Complex_Matrix.adjoint ?U)
\<lbrakk>?A \<in> carrier_mat ?n ?n; Complex_Matrix.unitary ?A\<rbrakk> \<Longrightarrow> ?A * Complex_Matrix.adjoint ?A = 1\<^sub>m ?n

goal (1 subgoal):
 1. four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m (dim_row A1 + dim_row A2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m n

goal (2 subgoals):
 1. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m (dim_row A1 + dim_row A2)
 2. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
thus "Complex_Matrix.adjoint (four_block_diag U1 U2)*four_block_diag U1 U2 =
    1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m n

goal (1 subgoal):
 1. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m n
[PROOF STEP]
using cu mat_mult_left_right_inverse u
[PROOF STATE]
proof (prove)
using this:
four_block_diag U1 U2 * Complex_Matrix.adjoint (four_block_diag U1 U2) = 1\<^sub>m n
Complex_Matrix.adjoint (four_block_diag U1 U2) \<in> carrier_mat n n
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n; ?A * ?B = 1\<^sub>m ?n\<rbrakk> \<Longrightarrow> ?B * ?A = 1\<^sub>m ?n
four_block_diag U1 U2 \<in> carrier_mat n n

goal (1 subgoal):
 1. Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (four_block_diag U1 U2) * four_block_diag U1 U2 = 1\<^sub>m n

goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
have "four_block_diag A1 A2 =
    four_block_diag (U1 * B1 * (Complex_Matrix.adjoint U1))
    (U2 * B2 * (Complex_Matrix.adjoint U2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag (U1 * B1 * Complex_Matrix.adjoint U1) (U2 * B2 * Complex_Matrix.adjoint U2)
[PROOF STEP]
using assms unitarily_equiv_eq
[PROOF STATE]
proof (prove)
using this:
unitarily_equiv A1 B1 U1
unitarily_equiv A2 B2 U2
dim_row A1 = dim_col A1
dim_row A2 = dim_col A2
unitarily_equiv ?A ?B ?U \<Longrightarrow> ?A = ?U * ?B * Complex_Matrix.adjoint ?U

goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag (U1 * B1 * Complex_Matrix.adjoint U1) (U2 * B2 * Complex_Matrix.adjoint U2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
four_block_diag A1 A2 = four_block_diag (U1 * B1 * Complex_Matrix.adjoint U1) (U2 * B2 * Complex_Matrix.adjoint U2)

goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_diag A1 A2 = four_block_diag (U1 * B1 * Complex_Matrix.adjoint U1) (U2 * B2 * Complex_Matrix.adjoint U2)

goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
have "... = (four_block_diag (U1*B1) (U2*B2)) *
    (four_block_diag (Complex_Matrix.adjoint U1)
    (Complex_Matrix.adjoint U2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag (U1 * B1 * Complex_Matrix.adjoint U1) (U2 * B2 * Complex_Matrix.adjoint U2) = four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2)
[PROOF STEP]
proof (rule mult_four_block_diag[symmetric])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. U1 * B1 \<in> carrier_mat ?nr1.0 ?n1.0
 2. U2 * B2 \<in> carrier_mat ?nr2.0 ?n2.0
 3. Complex_Matrix.adjoint U1 \<in> carrier_mat ?n1.0 ?nc1.0
 4. Complex_Matrix.adjoint U2 \<in> carrier_mat ?n2.0 ?nc2.0
[PROOF STEP]
show "U1 * B1 \<in> carrier_mat (dim_row A1) (dim_row A1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U1 * B1 \<in> carrier_mat (dim_row A1) (dim_row A1)
[PROOF STEP]
by (metis assms(1) assms(3) carrier_mat_triv mult_carrier_mat
          unitarily_equiv_carrier(1) unitarily_equiv_carrier(2))
[PROOF STATE]
proof (state)
this:
U1 * B1 \<in> carrier_mat (dim_row A1) (dim_row A1)

goal (3 subgoals):
 1. U2 * B2 \<in> carrier_mat ?nr2.0 ?n2.0
 2. Complex_Matrix.adjoint U1 \<in> carrier_mat (dim_row A1) ?nc1.0
 3. Complex_Matrix.adjoint U2 \<in> carrier_mat ?n2.0 ?nc2.0
[PROOF STEP]
show "U2 * B2 \<in> carrier_mat (dim_row A2) (dim_row A2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U2 * B2 \<in> carrier_mat (dim_row A2) (dim_row A2)
[PROOF STEP]
by (metis assms(2) assms(4) carrier_mat_triv mult_carrier_mat
          unitarily_equiv_carrier(1) unitarily_equiv_carrier(2))
[PROOF STATE]
proof (state)
this:
U2 * B2 \<in> carrier_mat (dim_row A2) (dim_row A2)

goal (2 subgoals):
 1. Complex_Matrix.adjoint U1 \<in> carrier_mat (dim_row A1) ?nc1.0
 2. Complex_Matrix.adjoint U2 \<in> carrier_mat (dim_row A2) ?nc2.0
[PROOF STEP]
show "Complex_Matrix.adjoint U1 \<in> carrier_mat (dim_row A1) (dim_row A1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U1 \<in> carrier_mat (dim_row A1) (dim_row A1)
[PROOF STEP]
by (metis Complex_Matrix.unitary_def adjoint_dim assms(1)
          index_mult_mat(2) unitarily_equivD(1) unitarily_equiv_eq)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U1 \<in> carrier_mat (dim_row A1) (dim_row A1)

goal (1 subgoal):
 1. Complex_Matrix.adjoint U2 \<in> carrier_mat (dim_row A2) ?nc2.0
[PROOF STEP]
show "Complex_Matrix.adjoint U2 \<in> carrier_mat (dim_row A2) (dim_row A2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U2 \<in> carrier_mat (dim_row A2) (dim_row A2)
[PROOF STEP]
by (meson assms(2) carrier_mat_triv similar_mat_witD2(7)
          unitarily_equiv_def)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U2 \<in> carrier_mat (dim_row A2) (dim_row A2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
four_block_diag (U1 * B1 * Complex_Matrix.adjoint U1) (U2 * B2 * Complex_Matrix.adjoint U2) = four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2)

goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_diag (U1 * B1 * Complex_Matrix.adjoint U1) (U2 * B2 * Complex_Matrix.adjoint U2) = four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2)

goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
have "... = four_block_diag U1 U2 * four_block_diag B1 B2 *
    Complex_Matrix.adjoint (four_block_diag U1 U2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
have "four_block_diag (U1*B1) (U2*B2) =
      four_block_diag U1 U2 * four_block_diag B1 B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag (U1 * B1) (U2 * B2) = four_block_diag U1 U2 * four_block_diag B1 B2
[PROOF STEP]
proof (rule mult_four_block_diag[symmetric])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. U1 \<in> carrier_mat ?nr1.0 ?n1.0
 2. U2 \<in> carrier_mat ?nr2.0 ?n2.0
 3. B1 \<in> carrier_mat ?n1.0 ?nc1.0
 4. B2 \<in> carrier_mat ?n2.0 ?nc2.0
[PROOF STEP]
show "U1 \<in> carrier_mat (dim_row A1) (dim_row A1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U1 \<in> carrier_mat (dim_row A1) (dim_row A1)
[PROOF STEP]
by (metis assms(1) assms(3) carrier_mat_triv
            unitarily_equiv_carrier(2))
[PROOF STATE]
proof (state)
this:
U1 \<in> carrier_mat (dim_row A1) (dim_row A1)

goal (3 subgoals):
 1. U2 \<in> carrier_mat ?nr2.0 ?n2.0
 2. B1 \<in> carrier_mat (dim_row A1) ?nc1.0
 3. B2 \<in> carrier_mat ?n2.0 ?nc2.0
[PROOF STEP]
show "B1 \<in> carrier_mat (dim_row A1) (dim_row A1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B1 \<in> carrier_mat (dim_row A1) (dim_row A1)
[PROOF STEP]
by (metis assms(1) assms(3) carrier_mat_triv
            unitarily_equiv_carrier(1))
[PROOF STATE]
proof (state)
this:
B1 \<in> carrier_mat (dim_row A1) (dim_row A1)

goal (2 subgoals):
 1. U2 \<in> carrier_mat ?nr2.0 ?n2.0
 2. B2 \<in> carrier_mat ?n2.0 ?nc2.0
[PROOF STEP]
show "U2 \<in> carrier_mat (dim_row A2) (dim_row A2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U2 \<in> carrier_mat (dim_row A2) (dim_row A2)
[PROOF STEP]
by (metis assms(2) assms(4) carrier_mat_triv
            unitarily_equiv_carrier(2))
[PROOF STATE]
proof (state)
this:
U2 \<in> carrier_mat (dim_row A2) (dim_row A2)

goal (1 subgoal):
 1. B2 \<in> carrier_mat (dim_row A2) ?nc2.0
[PROOF STEP]
show "B2 \<in> carrier_mat (dim_row A2) (dim_row A2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B2 \<in> carrier_mat (dim_row A2) (dim_row A2)
[PROOF STEP]
by (metis assms(2) assms(4) carrier_mat_triv
            unitarily_equiv_carrier(1))
[PROOF STATE]
proof (state)
this:
B2 \<in> carrier_mat (dim_row A2) (dim_row A2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
four_block_diag (U1 * B1) (U2 * B2) = four_block_diag U1 U2 * four_block_diag B1 B2

goal (1 subgoal):
 1. four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
four_block_diag (U1 * B1) (U2 * B2) = four_block_diag U1 U2 * four_block_diag B1 B2

goal (1 subgoal):
 1. four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
have "four_block_diag (Complex_Matrix.adjoint U1)
     (Complex_Matrix.adjoint U2) =
      Complex_Matrix.adjoint (four_block_diag U1 U2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
by (rule four_block_diag_adjoint[symmetric])
[PROOF STATE]
proof (state)
this:
four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = Complex_Matrix.adjoint (four_block_diag U1 U2)

goal (1 subgoal):
 1. four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
four_block_diag (U1 * B1) (U2 * B2) = four_block_diag U1 U2 * four_block_diag B1 B2
four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
four_block_diag (U1 * B1) (U2 * B2) = four_block_diag U1 U2 * four_block_diag B1 B2
four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = Complex_Matrix.adjoint (four_block_diag U1 U2)

goal (1 subgoal):
 1. four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
four_block_diag (U1 * B1) (U2 * B2) * four_block_diag (Complex_Matrix.adjoint U1) (Complex_Matrix.adjoint U2) = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)

goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
show "four_block_diag A1 A2 =
    four_block_diag U1 U2 * four_block_diag B1 B2 *
    Complex_Matrix.adjoint (four_block_diag U1 U2)"
[PROOF STATE]
proof (prove)
using this:
four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)

goal (1 subgoal):
 1. four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
four_block_diag A1 A2 = four_block_diag U1 U2 * four_block_diag B1 B2 * Complex_Matrix.adjoint (four_block_diag U1 U2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Ring) sop_assoc:"\<lbrakk>ipp_cond1 (s_set R s A) i;
    ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
     inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
      sop_distr2 R s f i (s_set R s A) z;
       sop_assoc R s (aug_pm_set z i (s_set R s A));
        sop_inv R s i (s_set R s A); sop_z R s z;
         sop_one R s (aug_pm_set z i (s_set R s A))\<rbrakk> \<Longrightarrow>
   \<forall>a\<in>carrier R. \<forall>b\<in>carrier R.
      \<forall>x\<in>addition_set f (aug_pm_set z i (s_set R s A)).
                           a \<^sub>s\<cdot> (b \<^sub>s\<cdot> x) = ( a \<cdot>\<^sub>r b) \<^sub>s\<cdot> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ipp_cond1 (s_set R s A) i; ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i; inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z; sop_distr2 R s f i (s_set R s A) z; sop_assoc R s (aug_pm_set z i (s_set R s A)); sop_inv R s i (s_set R s A); sop_z R s z; sop_one R s (aug_pm_set z i (s_set R s A))\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier R. \<forall>b\<in>carrier R. \<forall>x\<in>addition_set f (aug_pm_set z i (s_set R s A)). a \<^sub>s\<cdot> (b \<^sub>s\<cdot> x) = a \<cdot>\<^sub>r b \<^sub>s\<cdot> x
[PROOF STEP]
apply (rule ballI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>ipp_cond1 (s_set R s A) i; ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i; inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z; sop_distr2 R s f i (s_set R s A) z; sop_assoc R s (aug_pm_set z i (s_set R s A)); sop_inv R s i (s_set R s A); sop_z R s z; sop_one R s (aug_pm_set z i (s_set R s A)); a \<in> carrier R; b \<in> carrier R; x \<in> addition_set f (aug_pm_set z i (s_set R s A))\<rbrakk> \<Longrightarrow> a \<^sub>s\<cdot> (b \<^sub>s\<cdot> x) = a \<cdot>\<^sub>r b \<^sub>s\<cdot> x
[PROOF STEP]
apply (simp add:addition_set_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>ipp_cond1 (s_set R s A) i; ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i; inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z; sop_distr2 R s f i (s_set R s A) z; sop_assoc R s (aug_pm_set z i (s_set R s A)); sop_inv R s i (s_set R s A); sop_z R s z; sop_one R s (aug_pm_set z i (s_set R s A)); a \<in> carrier R; b \<in> carrier R; \<exists>xa. (\<exists>n. xa = add_set f (aug_pm_set z i (s_set R s A)) n) \<and> x \<in> xa\<rbrakk> \<Longrightarrow> a \<^sub>s\<cdot> (b \<^sub>s\<cdot> x) = a \<cdot>\<^sub>r b \<^sub>s\<cdot> x
[PROOF STEP]
apply (erule exE, erule conjE, erule exE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x xa n. \<lbrakk>ipp_cond1 (s_set R s A) i; ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i; inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z; sop_distr2 R s f i (s_set R s A) z; sop_assoc R s (aug_pm_set z i (s_set R s A)); sop_inv R s i (s_set R s A); sop_z R s z; sop_one R s (aug_pm_set z i (s_set R s A)); a \<in> carrier R; b \<in> carrier R; x \<in> add_set f (aug_pm_set z i (s_set R s A)) n; xa = add_set f (aug_pm_set z i (s_set R s A)) n\<rbrakk> \<Longrightarrow> a \<^sub>s\<cdot> (b \<^sub>s\<cdot> x) = a \<cdot>\<^sub>r b \<^sub>s\<cdot> x
[PROOF STEP]
apply (simp add:sop_assocTr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma row_mat1: assumes i: "i < nr"
  shows "row (mat1I ze on nr) i = vec1I ze on nr i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat1I ze on nr) i = vec1I ze on nr i
[PROOF STEP]
by (simp only: col_transpose_is_row[OF mat1 i, symmetric],
  simp only: transpose_mat1,
  simp only: col_mat1[OF i])


[STATEMENT]
lemma join_meet_distrib2: "(y \<sqinter> z) \<squnion> x = (y \<squnion> x) \<sqinter> (z \<squnion> x)"
  if "x \<in> carrier L" "y \<in> carrier L" "z \<in> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> z \<squnion> x = (y \<squnion> x) \<sqinter> (z \<squnion> x)
[PROOF STEP]
by (simp add: join_comm join_meet_distrib1 that)


[STATEMENT]
lemma Sup_eq_PInfty:
  fixes S :: "ereal set"
  shows "\<infinity> \<in> S \<Longrightarrow> Sup S = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<infinity> \<in> S \<Longrightarrow> Sup S = \<infinity>
[PROOF STEP]
unfolding top_ereal_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top \<in> S \<Longrightarrow> Sup S = top
[PROOF STEP]
by auto


[STATEMENT]
lemma bij_betw_mset_set:
  shows "bij_betw mset_set {A. finite A} {M. \<forall>x. count M x \<le> 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw mset_set {A. finite A} {M. \<forall>x. count M x \<le> 1}
[PROOF STEP]
proof (rule bij_betw_byWitness[where f'="set_mset"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>a\<in>{A. finite A}. set_mset (mset_set a) = a
 2. \<forall>a'\<in>{M. \<forall>x. count M x \<le> 1}. mset_set (set_mset a') = a'
 3. mset_set ` {A. finite A} \<subseteq> {M. \<forall>x. count M x \<le> 1}
 4. set_mset ` {M. \<forall>x. count M x \<le> 1} \<subseteq> {A. finite A}
[PROOF STEP]
show "\<forall>A\<in>{A. finite A}. set_mset (mset_set A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A\<in>{A. finite A}. set_mset (mset_set A) = A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>A\<in>{A. finite A}. set_mset (mset_set A) = A

goal (3 subgoals):
 1. \<forall>a'\<in>{M. \<forall>x. count M x \<le> 1}. mset_set (set_mset a') = a'
 2. mset_set ` {A. finite A} \<subseteq> {M. \<forall>x. count M x \<le> 1}
 3. set_mset ` {M. \<forall>x. count M x \<le> 1} \<subseteq> {A. finite A}
[PROOF STEP]
show "\<forall>M\<in>{M. \<forall>x. count M x \<le> 1}. mset_set (set_mset M) = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>M\<in>{M. \<forall>x. count M x \<le> 1}. mset_set (set_mset M) = M
[PROOF STEP]
by (auto simp add: mset_set_set_mset')
[PROOF STATE]
proof (state)
this:
\<forall>M\<in>{M. \<forall>x. count M x \<le> 1}. mset_set (set_mset M) = M

goal (2 subgoals):
 1. mset_set ` {A. finite A} \<subseteq> {M. \<forall>x. count M x \<le> 1}
 2. set_mset ` {M. \<forall>x. count M x \<le> 1} \<subseteq> {A. finite A}
[PROOF STEP]
show "mset_set ` {A. finite A} \<subseteq> {M. \<forall>x. count M x \<le> 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set ` {A. finite A} \<subseteq> {M. \<forall>x. count M x \<le> 1}
[PROOF STEP]
using nat_le_linear
[PROOF STATE]
proof (prove)
using this:
?m \<le> ?n \<or> ?n \<le> ?m

goal (1 subgoal):
 1. mset_set ` {A. finite A} \<subseteq> {M. \<forall>x. count M x \<le> 1}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
mset_set ` {A. finite A} \<subseteq> {M. \<forall>x. count M x \<le> 1}

goal (1 subgoal):
 1. set_mset ` {M. \<forall>x. count M x \<le> 1} \<subseteq> {A. finite A}
[PROOF STEP]
show "set_mset ` {M. \<forall>x. count M x \<le> 1} \<subseteq> {A. finite A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset ` {M. \<forall>x. count M x \<le> 1} \<subseteq> {A. finite A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_mset ` {M. \<forall>x. count M x \<le> 1} \<subseteq> {A. finite A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma step_friends12:
assumes "step s a = (ou, s')"
and "a \<noteq> Cact (cFriend UID1 (pass s UID1) UID2) \<and> a \<noteq> Cact (cFriend UID2 (pass s UID2) UID1) \<and>
     a \<noteq> Dact (dFriend UID1 (pass s UID1) UID2) \<and> a \<noteq> Dact (dFriend UID2 (pass s UID2) UID1)"
shows "friends12 s' \<longleftrightarrow> friends12 s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. friends12 s' = friends12 s
[PROOF STEP]
using step_friendIDs[OF assms]
[PROOF STATE]
proof (prove)
using this:
(UID1 \<in>\<in> friendIDs s' UID2) = (UID1 \<in>\<in> friendIDs s UID2)
(UID2 \<in>\<in> friendIDs s' UID1) = (UID2 \<in>\<in> friendIDs s UID1)

goal (1 subgoal):
 1. friends12 s' = friends12 s
[PROOF STEP]
unfolding friends12_def
[PROOF STATE]
proof (prove)
using this:
(UID1 \<in>\<in> friendIDs s' UID2) = (UID1 \<in>\<in> friendIDs s UID2)
(UID2 \<in>\<in> friendIDs s' UID1) = (UID2 \<in>\<in> friendIDs s UID1)

goal (1 subgoal):
 1. (UID1 \<in>\<in> friendIDs s' UID2 \<and> UID2 \<in>\<in> friendIDs s' UID1) = (UID1 \<in>\<in> friendIDs s UID2 \<and> UID2 \<in>\<in> friendIDs s UID1)
[PROOF STEP]
by auto


[STATEMENT]
lemma support_impl_in: "G e \<longrightarrow> support (\<lambda>l s.  H e l s) \<subseteq> T
  \<Longrightarrow> support (\<lambda>l s. G e \<longrightarrow>  H e l s) \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G e \<longrightarrow> support (H e) \<subseteq> T \<Longrightarrow> support (\<lambda>l s. G e \<longrightarrow> H e l s) \<subseteq> T
[PROOF STEP]
unfolding support_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G e \<longrightarrow> {x. \<exists>l1 l2 s. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> H e l1 s \<noteq> H e l2 s} \<subseteq> T \<Longrightarrow> {x. \<exists>l1 l2 s. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> (G e \<longrightarrow> H e l1 s) \<noteq> (G e \<longrightarrow> H e l2 s)} \<subseteq> T
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x l1 l2 s. \<lbrakk>\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y; {x. \<exists>l1 l2. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> (\<exists>s. H e l1 s = (\<not> H e l2 s))} \<subseteq> T; G e; \<not> H e l2 s; H e l1 s\<rbrakk> \<Longrightarrow> x \<in> T
 2. \<And>x l1 l2 s. \<lbrakk>\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y; {x. \<exists>l1 l2. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> (\<exists>s. H e l1 s = (\<not> H e l2 s))} \<subseteq> T; x \<notin> T; G e; \<not> H e l1 s; H e l2 s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma gen_qe_eval_augment : "amount \<le> var+1 \<Longrightarrow>
      (\<exists>xs. (length xs = var + 1) \<and> eval (list_conj (map fm.Atom L @ F)) (xs @ \<Gamma>)) =
      (\<exists>xs. (length xs = var + 1) \<and> eval (step_augment gen_qe IdentityHeuristic amount var L F) (xs @ \<Gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. amount \<le> var + 1 \<Longrightarrow> (\<exists>xs. length xs = var + 1 \<and> eval (list_conj (map fm.Atom L @ F)) (xs @ \<Gamma>)) = (\<exists>xs. length xs = var + 1 \<and> eval (step_augment gen_qe IdentityHeuristic amount var L F) (xs @ \<Gamma>))
[PROOF STEP]
apply(rule step_augmenter_eval[of gen_qe IdentityHeuristic amount var L F \<Gamma>])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>xs vara L F \<Gamma>. \<lbrakk>amount \<le> var + 1; length xs = vara\<rbrakk> \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (gen_qe vara L F) (xs @ x # \<Gamma>))
 2. \<And>n vara L F. \<lbrakk>amount \<le> var + 1; IdentityHeuristic n L F = vara\<rbrakk> \<Longrightarrow> vara \<le> n
 3. amount \<le> var + 1 \<Longrightarrow> amount \<le> var + 1
[PROOF STEP]
using gen_qe_eval
[PROOF STATE]
proof (prove)
using this:
length ?xs = ?var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom ?L @ ?F)) (?xs @ x # ?\<Gamma>)) = (\<exists>x. eval (gen_qe ?var ?L ?F) (?xs @ x # ?\<Gamma>))

goal (3 subgoals):
 1. \<And>xs vara L F \<Gamma>. \<lbrakk>amount \<le> var + 1; length xs = vara\<rbrakk> \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (gen_qe vara L F) (xs @ x # \<Gamma>))
 2. \<And>n vara L F. \<lbrakk>amount \<le> var + 1; IdentityHeuristic n L F = vara\<rbrakk> \<Longrightarrow> vara \<le> n
 3. amount \<le> var + 1 \<Longrightarrow> amount \<le> var + 1
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n vara L F. \<lbrakk>amount \<le> var + 1; IdentityHeuristic n L F = vara\<rbrakk> \<Longrightarrow> vara \<le> n
 2. amount \<le> var + 1 \<Longrightarrow> amount \<le> var + 1
[PROOF STEP]
by auto