[STATEMENT]
lemma mat_conj_commute:
  assumes "A \<in> carrier_mat n n"
  and "B\<in> carrier_mat n n"
  and "U \<in> carrier_mat n n"
  and "unitary U"
  and "A*B = B*A"
shows "(mat_conj (Complex_Matrix.adjoint U) A) *
  (mat_conj (Complex_Matrix.adjoint U) B) =
  (mat_conj (Complex_Matrix.adjoint U) B) *
  (mat_conj (Complex_Matrix.adjoint U) A)" (is "?L*?R = ?R* ?L")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have u: "Complex_Matrix.adjoint U \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

goal (1 subgoal):
 1. Complex_Matrix.adjoint U \<in> carrier_mat n n
[PROOF STEP]
by (simp add: adjoint_dim')
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U \<in> carrier_mat n n

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have ca: "Complex_Matrix.adjoint U * A * U \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * U \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * U \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * A * U \<in> carrier_mat n n

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have cb: "Complex_Matrix.adjoint U * B * U \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * U \<in> carrier_mat n n

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have  "?L * ?R =
    ?L * (Complex_Matrix.adjoint U * (B * U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U))
[PROOF STEP]
have "Complex_Matrix.adjoint U * B * U =
      Complex_Matrix.adjoint U * (B * U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U = Complex_Matrix.adjoint U * (B * U)
[PROOF STEP]
using assoc_mult_mat[of _ n n B n U] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat n n; B \<in> carrier_mat n n; U \<in> carrier_mat n ?n\<^sub>4\<rbrakk> \<Longrightarrow> ?A * B * U = ?A * (B * U)
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U = Complex_Matrix.adjoint U * (B * U)
[PROOF STEP]
by (meson adjoint_dim')
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * U = Complex_Matrix.adjoint U * (B * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint U * B * U = Complex_Matrix.adjoint U * (B * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U))
[PROOF STEP]
using mat_conj_adjoint
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint U * B * U = Complex_Matrix.adjoint U * (B * U)
mat_conj (Complex_Matrix.adjoint ?U) ?V = Complex_Matrix.adjoint ?U * ?V * ?U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U))

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U))

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = ?L * Complex_Matrix.adjoint U * (B*U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U)) = mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U)) = mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U)
[PROOF STEP]
have "\<exists>na nb. Complex_Matrix.adjoint U \<in> carrier_mat n na \<and>
      B * U \<in> carrier_mat na nb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>na nb. Complex_Matrix.adjoint U \<in> carrier_mat n na \<and> B * U \<in> carrier_mat na nb
[PROOF STEP]
by (metis (no_types) assms(2) carrier_matD(1) carrier_mat_triv index_mult_mat(2) u)
[PROOF STATE]
proof (state)
this:
\<exists>na nb. Complex_Matrix.adjoint U \<in> carrier_mat n na \<and> B * U \<in> carrier_mat na nb

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U)) = mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>na nb. Complex_Matrix.adjoint U \<in> carrier_mat n na \<and> B * U \<in> carrier_mat na nb
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>na nb. Complex_Matrix.adjoint U \<in> carrier_mat n na \<and> B * U \<in> carrier_mat na nb

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U)) = mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U)
[PROOF STEP]
using ca
[PROOF STATE]
proof (prove)
using this:
\<exists>na nb. Complex_Matrix.adjoint U \<in> carrier_mat n na \<and> B * U \<in> carrier_mat na nb
Complex_Matrix.adjoint U * A * U \<in> carrier_mat n n

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U)) = mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U)
[PROOF STEP]
by (metis assoc_mult_mat mat_conj_adjoint)
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U)) = mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U)) = mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * (Complex_Matrix.adjoint U * (B * U)) = mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * A*
    (U * (Complex_Matrix.adjoint U)) * (B * U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U) = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U) = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U)
[PROOF STEP]
have "Complex_Matrix.adjoint U * A * U * Complex_Matrix.adjoint U =
      Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * U * Complex_Matrix.adjoint U = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U)
[PROOF STEP]
using assoc_mult_mat[of "Complex_Matrix.adjoint U * A" n n]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.adjoint U * A \<in> carrier_mat n n; ?B \<in> carrier_mat n ?n\<^sub>3; ?C \<in> carrier_mat ?n\<^sub>3 ?n\<^sub>4\<rbrakk> \<Longrightarrow> Complex_Matrix.adjoint U * A * ?B * ?C = Complex_Matrix.adjoint U * A * (?B * ?C)

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * U * Complex_Matrix.adjoint U = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U)
[PROOF STEP]
by (metis assms(1) assms(3) mult_carrier_mat u)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * A * U * Complex_Matrix.adjoint U = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U) = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint U * A * U * Complex_Matrix.adjoint U = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U) = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U)
[PROOF STEP]
by (simp add: mat_conj_adjoint)
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U) = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U) = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * Complex_Matrix.adjoint U * (B * U) = Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * A*  (B * U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U) = Complex_Matrix.adjoint U * A * (B * U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U) = Complex_Matrix.adjoint U * A * (B * U)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U) = Complex_Matrix.adjoint U * A * (B * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * A * (U * Complex_Matrix.adjoint U) * (B * U) = Complex_Matrix.adjoint U * A * (B * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * A * B * U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * (B * U) = Complex_Matrix.adjoint U * A * B * U
[PROOF STEP]
proof (rule assoc_mult_mat[symmetric], auto simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B \<in> carrier_mat (dim_col A) (dim_row U)
[PROOF STEP]
show "B \<in> carrier_mat (dim_col A) (dim_row U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat (dim_col A) (dim_row U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * A * (B * U) = Complex_Matrix.adjoint U * A * B * U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * A * (B * U) = Complex_Matrix.adjoint U * A * B * U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * (A * B) * U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * B * U = Complex_Matrix.adjoint U * (A * B) * U
[PROOF STEP]
using assms u
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A
Complex_Matrix.adjoint U \<in> carrier_mat n n

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * A * B * U = Complex_Matrix.adjoint U * (A * B) * U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * A * B * U = Complex_Matrix.adjoint U * (A * B) * U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * A * B * U = Complex_Matrix.adjoint U * (A * B) * U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * (B * A) * U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * (A * B) * U = Complex_Matrix.adjoint U * (B * A) * U
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * (A * B) * U = Complex_Matrix.adjoint U * (B * A) * U
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * (A * B) * U = Complex_Matrix.adjoint U * (B * A) * U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * (A * B) * U = Complex_Matrix.adjoint U * (B * A) * U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * B * A * U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * (B * A) * U = Complex_Matrix.adjoint U * B * A * U
[PROOF STEP]
using assms u
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A
Complex_Matrix.adjoint U \<in> carrier_mat n n

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * (B * A) * U = Complex_Matrix.adjoint U * B * A * U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * (B * A) * U = Complex_Matrix.adjoint U * B * A * U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * (B * A) * U = Complex_Matrix.adjoint U * B * A * U

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * B * (A * U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * A * U = Complex_Matrix.adjoint U * B * (A * U)
[PROOF STEP]
proof (rule assoc_mult_mat, auto simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col B) (dim_row U)
[PROOF STEP]
show "A \<in> carrier_mat (dim_col B) (dim_row U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col B) (dim_row U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * A * U = Complex_Matrix.adjoint U * B * (A * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * A * U = Complex_Matrix.adjoint U * B * (A * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * B*
    (U * (Complex_Matrix.adjoint U)) * (A * U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * (A * U) = Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * (A * U) = Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * (A * U) = Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * (A * U) = Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * B*
    U * (Complex_Matrix.adjoint U) * (A * U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U) = Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U) = Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U)
[PROOF STEP]
have "Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U =
      Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U = Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U)
[PROOF STEP]
proof (rule assoc_mult_mat, auto simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. U \<in> carrier_mat (dim_col B) (dim_col U)
[PROOF STEP]
show "U \<in> carrier_mat (dim_col B) (dim_col U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<in> carrier_mat (dim_col B) (dim_col U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

goal (1 subgoal):
 1. U \<in> carrier_mat (dim_col B) (dim_col U)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
U \<in> carrier_mat (dim_col B) (dim_col U)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U = Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U) = Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U = Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U) = Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U) = Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U) = Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * (U * Complex_Matrix.adjoint U) * (A * U) = Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * B*
    U * ((Complex_Matrix.adjoint U) * (A * U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U))
[PROOF STEP]
proof (rule assoc_mult_mat, auto simp add: u cb)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * U \<in> carrier_mat (dim_row U) ?n\<^sub>4
[PROOF STEP]
show "A * U \<in> carrier_mat (dim_row U) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * U \<in> carrier_mat (dim_row U) n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U))

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * U * Complex_Matrix.adjoint U * (A * U) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U))

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
have "... = Complex_Matrix.adjoint U * B*
    U * ((Complex_Matrix.adjoint U) * A * U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U)) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * A * U)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U)) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * A * U)
[PROOF STEP]
have "(Complex_Matrix.adjoint U) * (A * U) =
      (Complex_Matrix.adjoint U) * A * U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint U * (A * U) = Complex_Matrix.adjoint U * A * U
[PROOF STEP]
proof (rule assoc_mult_mat[symmetric], auto simp add: assms u)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_row U) (dim_row U)
[PROOF STEP]
show "A \<in> carrier_mat (dim_row U) (dim_row U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_row U) (dim_row U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
U \<in> carrier_mat n n
Complex_Matrix.unitary U
A * B = B * A

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * (A * U) = Complex_Matrix.adjoint U * A * U

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U)) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * A * U)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint U * (A * U) = Complex_Matrix.adjoint U * A * U

goal (1 subgoal):
 1. Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U)) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * A * U)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U)) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * A * U)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * (A * U)) = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * A * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * A * U)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = Complex_Matrix.adjoint U * B * U * (Complex_Matrix.adjoint U * A * U)

goal (1 subgoal):
 1. mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A
[PROOF STEP]
by (metis mat_conj_adjoint)
[PROOF STATE]
proof (state)
this:
mat_conj (Complex_Matrix.adjoint U) A * mat_conj (Complex_Matrix.adjoint U) B = mat_conj (Complex_Matrix.adjoint U) B * mat_conj (Complex_Matrix.adjoint U) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_distrib_or: "(\<exists>\<^sub>Ax. P x \<or>\<^sub>A Q) = (\<exists>\<^sub>Ax. P x) \<or>\<^sub>A Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>Ax. P x \<or>\<^sub>A Q) = (\<exists>\<^sub>Ax. P x) \<or>\<^sub>A Q
[PROOF STEP]
unfolding ex_assn_def sup_assn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_assn (\<lambda>h. \<exists>x. h \<Turnstile> Abs_assn (\<lambda>h. h \<Turnstile> P x \<or> h \<Turnstile> Q)) = Abs_assn (\<lambda>h. h \<Turnstile> Abs_assn (\<lambda>h. \<exists>x. h \<Turnstile> P x) \<or> h \<Turnstile> Q)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. (h \<Turnstile> Abs_assn (\<lambda>h. \<exists>x. h \<Turnstile> P x) \<or> h \<Turnstile> Q) = (h \<Turnstile> Abs_assn (\<lambda>h. \<exists>x. h \<Turnstile> Abs_assn (\<lambda>h. h \<Turnstile> P x \<or> h \<Turnstile> Q)))
[PROOF STEP]
apply (auto simp add: Abs_assn_inverse)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma less_multiset\<^sub>D\<^sub>M:
  "M < N \<longleftrightarrow> (\<exists>X Y. X \<noteq> {#} \<and> X \<subseteq># N \<and> M = N - X + Y \<and> (\<forall>k. k \<in># Y \<longrightarrow> (\<exists>a. a \<in># X \<and> k < a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M < N) = (\<exists>X Y. X \<noteq> {#} \<and> X \<subseteq># N \<and> M = N - X + Y \<and> (\<forall>k. k \<in># Y \<longrightarrow> (\<exists>a. a \<in># X \<and> k < a)))
[PROOF STEP]
by (rule mult\<^sub>D\<^sub>M[folded multp_def less_multiset_def])


[STATEMENT]
lemma poly_of_pm_minus: "poly_of_pm x (p - q) = poly_of_pm x p - poly_of_pm x q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_pm x (p - q) = poly_of_pm x p - poly_of_pm x q
[PROOF STEP]
unfolding Polynomial.minus_poly.abs_eq coeff_poly_of_pm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_pm x (p - q) = Abs_poly (\<lambda>n. lookup p (monomial n x) - lookup q (monomial n x))
[PROOF STEP]
by (simp add: poly_of_pm_def lookup_minus)


[STATEMENT]
lemma dim_psubset:
  "span S \<subset> span T \<Longrightarrow> dim S < dim T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span S \<subset> span T \<Longrightarrow> dim S < dim T
[PROOF STEP]
by (metis (no_types, opaque_lifting) dim_span less_le not_le subspace_dim_equal subspace_span)


[STATEMENT]
lemma all_edges_between_swap:
  "all_edges_between X Y G = (\<lambda>(x,y). (y,x)) ` (all_edges_between Y X G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges_between X Y G = (\<lambda>(x, y). (y, x)) ` all_edges_between Y X G
[PROOF STEP]
unfolding all_edges_between_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). x \<in> X \<and> y \<in> Y \<and> {x, y} \<in> uedges G} = (\<lambda>(x, y). (y, x)) ` {(x, y). x \<in> Y \<and> y \<in> X \<and> {x, y} \<in> uedges G}
[PROOF STEP]
by (auto simp add: insert_commute image_iff split: prod.split)


[STATEMENT]
lemma n_o_narrow:
  "top_on_opt S1 (-X) \<Longrightarrow> top_on_opt S2 (-X) \<Longrightarrow> finite X
  \<Longrightarrow> S2 \<le> S1 \<Longrightarrow> S1 \<triangle> S2 < S1 \<Longrightarrow> n\<^sub>o (S1 \<triangle> S2) X < n\<^sub>o S1 X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>top_on\<^sub>o S1 (- X); top_on\<^sub>o S2 (- X); finite X; S2 \<le> S1; S1 \<triangle> S2 < S1\<rbrakk> \<Longrightarrow> n\<^sub>o (S1 \<triangle> S2) X < n\<^sub>o S1 X
[PROOF STEP]
apply(induction S1 S2 rule: narrow_option.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>top_on\<^sub>o None (- X); top_on\<^sub>o x (- X); finite X; x \<le> None; None \<triangle> x < None\<rbrakk> \<Longrightarrow> n\<^sub>o (None \<triangle> x) X < n\<^sub>o None X
 2. \<And>v. \<lbrakk>top_on\<^sub>o (Some v) (- X); top_on\<^sub>o None (- X); finite X; None \<le> Some v; Some v \<triangle> None < Some v\<rbrakk> \<Longrightarrow> n\<^sub>o (Some v \<triangle> None) X < n\<^sub>o (Some v) X
 3. \<And>x y. \<lbrakk>top_on\<^sub>o (Some x) (- X); top_on\<^sub>o (Some y) (- X); finite X; Some y \<le> Some x; Some x \<triangle> Some y < Some x\<rbrakk> \<Longrightarrow> n\<^sub>o (Some x \<triangle> Some y) X < n\<^sub>o (Some x) X
[PROOF STEP]
apply(auto simp: n_o_def n_s_narrow)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma countable_Fpow: "countable S \<Longrightarrow> countable (Fpow S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable S \<Longrightarrow> countable (Fpow S)
[PROOF STEP]
using countable_Collect_finite_subset
[PROOF STATE]
proof (prove)
using this:
countable ?T \<Longrightarrow> countable {A. finite A \<and> A \<subseteq> ?T}

goal (1 subgoal):
 1. countable S \<Longrightarrow> countable (Fpow S)
[PROOF STEP]
by (force simp add: Fpow_def conj_commute)


[STATEMENT]
lemma mod_qr_poly:
assumes "degree f \<ge> n" "degree f < 2*n"
shows "(f :: 'a mod_ring poly) mod qr_poly = take_deg n f - drop_deg n f "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f mod qr_poly = take_deg n f - drop_deg n f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f mod qr_poly = take_deg n f - drop_deg n f
[PROOF STEP]
have "degree (take_deg n f - drop_deg n f) < deg_qr TYPE('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (take_deg n f - drop_deg n f) < deg_qr TYPE('a)
[PROOF STEP]
using degree_diff_le_max[of "take_deg n f" "drop_deg n f"]
     degree_drop_2n[OF assms(2)]  degree_take_n
[PROOF STATE]
proof (prove)
using this:
degree (take_deg n f - drop_deg n f) \<le> max (degree (take_deg n f)) (degree (drop_deg n f))
degree (drop_deg n f) < n
degree (take_deg n ?f) < n

goal (1 subgoal):
 1. degree (take_deg n f - drop_deg n f) < deg_qr TYPE('a)
[PROOF STEP]
by (metis deg_qr_n degree_diff_less nat_int)
[PROOF STATE]
proof (state)
this:
degree (take_deg n f - drop_deg n f) < deg_qr TYPE('a)

goal (1 subgoal):
 1. f mod qr_poly = take_deg n f - drop_deg n f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree (take_deg n f - drop_deg n f) < deg_qr TYPE('a)
[PROOF STEP]
have "(take_deg n f - drop_deg n f) mod qr_poly =
    take_deg n f - drop_deg n f"
[PROOF STATE]
proof (prove)
using this:
degree (take_deg n f - drop_deg n f) < deg_qr TYPE('a)

goal (1 subgoal):
 1. (take_deg n f - drop_deg n f) mod qr_poly = take_deg n f - drop_deg n f
[PROOF STEP]
by (subst deg_mod_qr_poly, auto)
[PROOF STATE]
proof (state)
this:
(take_deg n f - drop_deg n f) mod qr_poly = take_deg n f - drop_deg n f

goal (1 subgoal):
 1. f mod qr_poly = take_deg n f - drop_deg n f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(take_deg n f - drop_deg n f) mod qr_poly = take_deg n f - drop_deg n f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(take_deg n f - drop_deg n f) mod qr_poly = take_deg n f - drop_deg n f

goal (1 subgoal):
 1. f mod qr_poly = take_deg n f - drop_deg n f
[PROOF STEP]
by (subst split_mod_qr_poly[OF assms(1)], auto)
[PROOF STATE]
proof (state)
this:
f mod qr_poly = take_deg n f - drop_deg n f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma stable_imp_take_bit_eq:
  \<open>take_bit n a = (if even a then 0 else 2 ^ n - 1)\<close>
    if \<open>a div 2 = a\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit n a = (if even a then 0::'a else (2::'a) ^ n - (1::'a))
[PROOF STEP]
proof (rule bit_eqI[unfolded possible_bit_def])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>na. (2::'a) ^ na \<noteq> (0::'a) \<Longrightarrow> bit (take_bit n a) na = bit (if even a then 0::'a else (2::'a) ^ n - (1::'a)) na
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>na. (2::'a) ^ na \<noteq> (0::'a) \<Longrightarrow> bit (take_bit n a) na = bit (if even a then 0::'a else (2::'a) ^ n - (1::'a)) na
[PROOF STEP]
assume \<open>2 ^ m \<noteq> 0\<close>
[PROOF STATE]
proof (state)
this:
(2::'a) ^ m \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>na. (2::'a) ^ na \<noteq> (0::'a) \<Longrightarrow> bit (take_bit n a) na = bit (if even a then 0::'a else (2::'a) ^ n - (1::'a)) na
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
a div (2::'a) = a
(2::'a) ^ m \<noteq> (0::'a)
[PROOF STEP]
show \<open>bit (take_bit n a) m \<longleftrightarrow> bit (if even a then 0 else 2 ^ n - 1) m\<close>
[PROOF STATE]
proof (prove)
using this:
a div (2::'a) = a
(2::'a) ^ m \<noteq> (0::'a)

goal (1 subgoal):
 1. bit (take_bit n a) m = bit (if even a then 0::'a else (2::'a) ^ n - (1::'a)) m
[PROOF STEP]
by (simp add: bit_take_bit_iff bit_mask_sub_iff possible_bit_def stable_imp_bit_iff_odd)
[PROOF STATE]
proof (state)
this:
bit (take_bit n a) m = bit (if even a then 0::'a else (2::'a) ^ n - (1::'a)) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_entry_append_conv:
  "path_entry (g_E G) (v#l) w \<longleftrightarrow> (path_entry (g_E G) l v \<and> (v,w) \<in> (g_E G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_entry (g_E G) (v # l) w = (path_entry (g_E G) l v \<and> (v, w) \<in> g_E G)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path_entry (g_E G) (v # l) w \<Longrightarrow> path_entry (g_E G) l v \<and> (v, w) \<in> g_E G
 2. path_entry (g_E G) l v \<and> (v, w) \<in> g_E G \<Longrightarrow> path_entry (g_E G) (v # l) w
[PROOF STEP]
assume "path_entry (g_E G) (v # l) w "
[PROOF STATE]
proof (state)
this:
path_entry (g_E G) (v # l) w

goal (2 subgoals):
 1. path_entry (g_E G) (v # l) w \<Longrightarrow> path_entry (g_E G) l v \<and> (v, w) \<in> g_E G
 2. path_entry (g_E G) l v \<and> (v, w) \<in> g_E G \<Longrightarrow> path_entry (g_E G) (v # l) w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path_entry (g_E G) (v # l) w
[PROOF STEP]
show "path_entry (g_E G) l v \<and> (v, w) \<in> g_E G"
[PROOF STATE]
proof (prove)
using this:
path_entry (g_E G) (v # l) w

goal (1 subgoal):
 1. path_entry (g_E G) l v \<and> (v, w) \<in> g_E G
[PROOF STEP]
by (auto simp add:path_entry_cons_conv)
[PROOF STATE]
proof (state)
this:
path_entry (g_E G) l v \<and> (v, w) \<in> g_E G

goal (1 subgoal):
 1. path_entry (g_E G) l v \<and> (v, w) \<in> g_E G \<Longrightarrow> path_entry (g_E G) (v # l) w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_entry (g_E G) l v \<and> (v, w) \<in> g_E G \<Longrightarrow> path_entry (g_E G) (v # l) w
[PROOF STEP]
assume "path_entry (g_E G) l v \<and> (v, w) \<in> g_E G"
[PROOF STATE]
proof (state)
this:
path_entry (g_E G) l v \<and> (v, w) \<in> g_E G

goal (1 subgoal):
 1. path_entry (g_E G) l v \<and> (v, w) \<in> g_E G \<Longrightarrow> path_entry (g_E G) (v # l) w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path_entry (g_E G) l v \<and> (v, w) \<in> g_E G
[PROOF STEP]
show "path_entry (g_E G) (v # l) w "
[PROOF STATE]
proof (prove)
using this:
path_entry (g_E G) l v \<and> (v, w) \<in> g_E G

goal (1 subgoal):
 1. path_entry (g_E G) (v # l) w
[PROOF STEP]
by (fastforce intro: path_entry_append)
[PROOF STATE]
proof (state)
this:
path_entry (g_E G) (v # l) w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subpath_to_frontier_explicit:
    fixes S :: "'a::metric_space set"
    assumes g: "path g" and "pathfinish g \<notin> S"
    obtains u where "0 \<le> u" "u \<le> 1"
                "\<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S"
                "(g u \<notin> interior S)" "(u = 0 \<or> g u \<in> closure S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have gcon: "continuous_on {0..1} g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} g
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
path g

goal (1 subgoal):
 1. continuous_on {0..1} g
[PROOF STEP]
by (simp add: path_def)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} g

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} g

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "bounded ({u. g u \<in> closure (- S)} \<inter> {0..1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded ({u. g u \<in> closure (- S)} \<inter> {0..1})
[PROOF STEP]
using compact_eq_bounded_closed
[PROOF STATE]
proof (prove)
using this:
compact ?S = (bounded ?S \<and> closed ?S)

goal (1 subgoal):
 1. bounded ({u. g u \<in> closure (- S)} \<inter> {0..1})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
bounded ({u. g u \<in> closure (- S)} \<inter> {0..1})

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on {0..1} g
bounded ({u. g u \<in> closure (- S)} \<inter> {0..1})
[PROOF STEP]
have com: "compact ({0..1} \<inter> {u. g u \<in> closure (- S)})"
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g
bounded ({u. g u \<in> closure (- S)} \<inter> {0..1})

goal (1 subgoal):
 1. compact ({0..1} \<inter> {u. g u \<in> closure (- S)})
[PROOF STEP]
using closed_vimage_Int
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g
bounded ({u. g u \<in> closure (- S)} \<inter> {0..1})
\<lbrakk>closed ?s; continuous_on ?t ?f; closed ?t\<rbrakk> \<Longrightarrow> closed (?f -` ?s \<inter> ?t)

goal (1 subgoal):
 1. compact ({0..1} \<inter> {u. g u \<in> closure (- S)})
[PROOF STEP]
by (metis (full_types) Int_commute closed_atLeastAtMost closed_closure compact_eq_bounded_closed vimage_def)
[PROOF STATE]
proof (state)
this:
compact ({0..1} \<inter> {u. g u \<in> closure (- S)})

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "1 \<in> {u. g u \<in> closure (- S)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<in> {u. g u \<in> closure (- S)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path g
pathfinish g \<notin> S

goal (1 subgoal):
 1. 1 \<in> {u. g u \<in> closure (- S)}
[PROOF STEP]
by (simp add: pathfinish_def closure_def)
[PROOF STATE]
proof (state)
this:
1 \<in> {u. g u \<in> closure (- S)}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<in> {u. g u \<in> closure (- S)}
[PROOF STEP]
have dis: "{0..1} \<inter> {u. g u \<in> closure (- S)} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
1 \<in> {u. g u \<in> closure (- S)}

goal (1 subgoal):
 1. {0..1} \<inter> {u. g u \<in> closure (- S)} \<noteq> {}
[PROOF STEP]
using atLeastAtMost_iff zero_le_one
[PROOF STATE]
proof (prove)
using this:
1 \<in> {u. g u \<in> closure (- S)}
(?i \<in> {?l..?u}) = (?l \<le> ?i \<and> ?i \<le> ?u)
(0::?'a) \<le> (1::?'a)

goal (1 subgoal):
 1. {0..1} \<inter> {u. g u \<in> closure (- S)} \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{0..1} \<inter> {u. g u \<in> closure (- S)} \<noteq> {}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{0..1} \<inter> {u. g u \<in> closure (- S)} \<noteq> {}
[PROOF STEP]
obtain u where "0 \<le> u" "u \<le> 1" and gu: "g u \<in> closure (- S)"
                  and umin: "\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; g t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> t"
[PROOF STATE]
proof (prove)
using this:
{0..1} \<inter> {u. g u \<in> closure (- S)} \<noteq> {}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; g u \<in> closure (- S); \<And>t. \<lbrakk>0 \<le> t; t \<le> 1; g t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using compact_attains_inf [OF com dis]
[PROOF STATE]
proof (prove)
using this:
{0..1} \<inter> {u. g u \<in> closure (- S)} \<noteq> {}
\<exists>s\<in>{0..1} \<inter> {u. g u \<in> closure (- S)}. \<forall>t\<in>{0..1} \<inter> {u. g u \<in> closure (- S)}. s \<le> t

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; g u \<in> closure (- S); \<And>t. \<lbrakk>0 \<le> t; t \<le> 1; g t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 \<le> u
u \<le> 1
g u \<in> closure (- S)
\<lbrakk>0 \<le> ?t; ?t \<le> 1; g ?t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> ?t

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> u
u \<le> 1
g u \<in> closure (- S)
\<lbrakk>0 \<le> ?t; ?t \<le> 1; g ?t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> ?t
[PROOF STEP]
have umin': "\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; t < u\<rbrakk> \<Longrightarrow>  g t \<in> S"
[PROOF STATE]
proof (prove)
using this:
0 \<le> u
u \<le> 1
g u \<in> closure (- S)
\<lbrakk>0 \<le> ?t; ?t \<le> 1; g ?t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> ?t

goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> 1; t < u\<rbrakk> \<Longrightarrow> g t \<in> S
[PROOF STEP]
using closure_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> u
u \<le> 1
g u \<in> closure (- S)
\<lbrakk>0 \<le> ?t; ?t \<le> 1; g ?t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> ?t
closure ?S = ?S \<union> {x. x islimpt ?S}

goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 \<le> t; t \<le> 1; t < u\<rbrakk> \<Longrightarrow> g t \<in> S
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?t; ?t \<le> 1; ?t < u\<rbrakk> \<Longrightarrow> g ?t \<in> S

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have \<section>: "g u \<in> closure S" if "u \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
have "u > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < u
[PROOF STEP]
using that \<open>0 \<le> u\<close>
[PROOF STATE]
proof (prove)
using this:
u \<noteq> 0
0 \<le> u

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

goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
0 < u

goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
fix e::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
assume "e > 0"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
obtain d where "d>0" and d: "\<And>x'. \<lbrakk>x' \<in> {0..1}; dist x' u \<le> d\<rbrakk> \<Longrightarrow> dist (g x') (g u) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<And>x'. \<lbrakk>x' \<in> {0..1}; dist x' u \<le> d\<rbrakk> \<Longrightarrow> dist (g x') (g u) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using continuous_onE [OF gcon _ \<open>e > 0\<close>] \<open>0 \<le> _\<close> \<open>_ \<le> 1\<close> atLeastAtMost_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> {0..1}; \<And>d. \<lbrakk>0 < d; \<And>x'. \<lbrakk>x' \<in> {0..1}; dist x' ?x \<le> d\<rbrakk> \<Longrightarrow> dist (g x') (g ?x) < e\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
0 \<le> u
u \<le> 1
(?i \<in> {?l..?u}) = (?l \<le> ?i \<and> ?i \<le> ?u)

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<And>x'. \<lbrakk>x' \<in> {0..1}; dist x' u \<le> d\<rbrakk> \<Longrightarrow> dist (g x') (g u) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < d
\<lbrakk>?x' \<in> {0..1}; dist ?x' u \<le> d\<rbrakk> \<Longrightarrow> dist (g ?x') (g u) < e

goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
have *: "dist (max 0 (u - d / 2)) u \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (max 0 (u - d / 2)) u \<le> d
[PROOF STEP]
using \<open>0 \<le> u\<close> \<open>u \<le> 1\<close> \<open>d > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> u
u \<le> 1
0 < d

goal (1 subgoal):
 1. dist (max 0 (u - d / 2)) u \<le> d
[PROOF STEP]
by (simp add: dist_real_def)
[PROOF STATE]
proof (state)
this:
dist (max 0 (u - d / 2)) u \<le> d

goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
have "\<exists>y\<in>S. dist y (g u) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>S. dist y (g u) < e
[PROOF STEP]
using \<open>0 < u\<close> \<open>u \<le> 1\<close> \<open>d > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < u
u \<le> 1
0 < d

goal (1 subgoal):
 1. \<exists>y\<in>S. dist y (g u) < e
[PROOF STEP]
by (force intro: d [OF _ *] umin')
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. dist y (g u) < e

goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?e2 \<Longrightarrow> \<exists>y\<in>S. dist y (g u) < ?e2

goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?e2 \<Longrightarrow> \<exists>y\<in>S. dist y (g u) < ?e2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < ?e2 \<Longrightarrow> \<exists>y\<in>S. dist y (g u) < ?e2

goal (1 subgoal):
 1. g u \<in> closure S
[PROOF STEP]
by (simp add: frontier_def closure_approachable)
[PROOF STATE]
proof (state)
this:
g u \<in> closure S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u \<noteq> 0 \<Longrightarrow> g u \<in> closure S

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S; g u \<notin> interior S; u = 0 \<or> g u \<in> closure S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. 0 \<le> ?u
 2. ?u \<le> 1
 3. \<And>x. 0 \<le> x \<and> x < ?u \<Longrightarrow> g x \<in> interior S
 4. g ?u \<notin> interior S
 5. ?u = 0 \<or> g ?u \<in> closure S
[PROOF STEP]
show "\<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S
[PROOF STEP]
using \<open>u \<le> 1\<close> interior_closure umin
[PROOF STATE]
proof (prove)
using this:
u \<le> 1
interior ?S = - closure (- ?S)
\<lbrakk>0 \<le> ?t; ?t \<le> 1; g ?t \<in> closure (- S)\<rbrakk> \<Longrightarrow> u \<le> ?t

goal (1 subgoal):
 1. \<And>x. 0 \<le> x \<and> x < u \<Longrightarrow> g x \<in> interior S
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 \<le> ?x \<and> ?x < u \<Longrightarrow> g ?x \<in> interior S

goal (4 subgoals):
 1. 0 \<le> u
 2. u \<le> 1
 3. g u \<notin> interior S
 4. u = 0 \<or> g u \<in> closure S
[PROOF STEP]
show "g u \<notin> interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g u \<notin> interior S
[PROOF STEP]
by (simp add: gu interior_closure)
[PROOF STATE]
proof (state)
this:
g u \<notin> interior S

goal (3 subgoals):
 1. 0 \<le> u
 2. u \<le> 1
 3. u = 0 \<or> g u \<in> closure S
[PROOF STEP]
qed (use \<open>0 \<le> u\<close> \<open>u \<le> 1\<close> \<section> in auto)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma independent_append:
  assumes "independent K Us" and "independent K Vs" and "Span K Us \<inter> Span K Vs = { \<zero> }"
  shows "independent K (Us @ Vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.independent K (Us @ Vs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
local.independent K Us
local.independent K Vs
Span K Us \<inter> Span K Vs = {\<zero>}

goal (1 subgoal):
 1. local.independent K (Us @ Vs)
[PROOF STEP]
proof (induct Us rule: list.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>local.independent K []; local.independent K Vs; Span K [] \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ([] @ Vs)
 2. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
local.independent K []
local.independent K Vs
Span K [] \<inter> Span K Vs = {\<zero>}

goal (2 subgoals):
 1. \<lbrakk>local.independent K []; local.independent K Vs; Span K [] \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ([] @ Vs)
 2. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
local.independent K []
local.independent K Vs
Span K [] \<inter> Span K Vs = {\<zero>}

goal (1 subgoal):
 1. local.independent K ([] @ Vs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.independent K ([] @ Vs)

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
case (Cons u Us)
[PROOF STATE]
proof (state)
this:
\<lbrakk>local.independent K Us; local.independent K Vs; Span K Us \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (Us @ Vs)
local.independent K (u # Us)
local.independent K Vs
Span K (u # Us) \<inter> Span K Vs = {\<zero>}

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
hence in_carrier:
    "u \<in> carrier R" "set Us \<subseteq> carrier R" "set Vs \<subseteq> carrier R" "set (u # Us) \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>local.independent K Us; local.independent K Vs; Span K Us \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (Us @ Vs)
local.independent K (u # Us)
local.independent K Vs
Span K (u # Us) \<inter> Span K Vs = {\<zero>}

goal (1 subgoal):
 1. (u \<in> carrier R &&& set Us \<subseteq> carrier R) &&& set Vs \<subseteq> carrier R &&& set (u # Us) \<subseteq> carrier R
[PROOF STEP]
using Cons(2-3)[THEN independent_in_carrier]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>local.independent K Us; local.independent K Vs; Span K Us \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (Us @ Vs)
local.independent K (u # Us)
local.independent K Vs
Span K (u # Us) \<inter> Span K Vs = {\<zero>}
set (u # Us) \<subseteq> carrier R
set Vs \<subseteq> carrier R

goal (1 subgoal):
 1. (u \<in> carrier R &&& set Us \<subseteq> carrier R) &&& set Vs \<subseteq> carrier R &&& set (u # Us) \<subseteq> carrier R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<in> carrier R
set Us \<subseteq> carrier R
set Vs \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
hence "Span K Us \<subseteq> Span K (u # Us)"
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier R
set Us \<subseteq> carrier R
set Vs \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R

goal (1 subgoal):
 1. Span K Us \<subseteq> Span K (u # Us)
[PROOF STEP]
using mono_Span
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier R
set Us \<subseteq> carrier R
set Vs \<subseteq> carrier R
set (u # Us) \<subseteq> carrier R
\<lbrakk>set ?Us \<subseteq> carrier R; ?u \<in> carrier R\<rbrakk> \<Longrightarrow> Span K ?Us \<subseteq> Span K (?u # ?Us)

goal (1 subgoal):
 1. Span K Us \<subseteq> Span K (u # Us)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Span K Us \<subseteq> Span K (u # Us)

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
hence "Span K Us \<inter> Span K Vs = { \<zero> }"
[PROOF STATE]
proof (prove)
using this:
Span K Us \<subseteq> Span K (u # Us)

goal (1 subgoal):
 1. Span K Us \<inter> Span K Vs = {\<zero>}
[PROOF STEP]
using Cons(4) Span_subgroup_props(2)[OF in_carrier(2)]
[PROOF STATE]
proof (prove)
using this:
Span K Us \<subseteq> Span K (u # Us)
Span K (u # Us) \<inter> Span K Vs = {\<zero>}
\<zero> \<in> Span K Us

goal (1 subgoal):
 1. Span K Us \<inter> Span K Vs = {\<zero>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Span K Us \<inter> Span K Vs = {\<zero>}

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
hence "independent K (Us @ Vs)"
[PROOF STATE]
proof (prove)
using this:
Span K Us \<inter> Span K Vs = {\<zero>}

goal (1 subgoal):
 1. local.independent K (Us @ Vs)
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
Span K Us \<inter> Span K Vs = {\<zero>}
\<lbrakk>local.independent K Us; local.independent K Vs; Span K Us \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (Us @ Vs)
local.independent K (u # Us)
local.independent K Vs
Span K (u # Us) \<inter> Span K Vs = {\<zero>}

goal (1 subgoal):
 1. local.independent K (Us @ Vs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.independent K (Us @ Vs)

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local.independent K (Us @ Vs)

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
have "u \<notin> Span K (Us @ Vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<notin> Span K (Us @ Vs)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> u \<notin> Span K (Us @ Vs)"
[PROOF STATE]
proof (state)
this:
\<not> u \<notin> Span K (Us @ Vs)

goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> u \<notin> Span K (Us @ Vs)
[PROOF STEP]
obtain u' v'
      where u': "u' \<in> Span K Us" "u' \<in> carrier R"
        and v': "v' \<in> Span K Vs" "v' \<in> carrier R" and u:"u = u' \<oplus> v'"
[PROOF STATE]
proof (prove)
using this:
\<not> u \<notin> Span K (Us @ Vs)

goal (1 subgoal):
 1. (\<And>u' v'. \<lbrakk>u' \<in> Span K Us; u' \<in> carrier R; v' \<in> Span K Vs; v' \<in> carrier R; u = u' \<oplus> v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Span_append_eq_set_add[OF in_carrier(2-3)] in_carrier(2-3)[THEN Span_subgroup_props(1)]
[PROOF STATE]
proof (prove)
using this:
\<not> u \<notin> Span K (Us @ Vs)
Span K (Us @ Vs) = Span K Us <+> Span K Vs
Span K Us \<subseteq> carrier R
Span K Vs \<subseteq> carrier R

goal (1 subgoal):
 1. (\<And>u' v'. \<lbrakk>u' \<in> Span K Us; u' \<in> carrier R; v' \<in> Span K Vs; v' \<in> carrier R; u = u' \<oplus> v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding set_add_def'
[PROOF STATE]
proof (prove)
using this:
\<not> u \<notin> Span K (Us @ Vs)
Span K (Us @ Vs) = (\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k})
Span K Us \<subseteq> carrier R
Span K Vs \<subseteq> carrier R

goal (1 subgoal):
 1. (\<And>u' v'. \<lbrakk>u' \<in> Span K Us; u' \<in> carrier R; v' \<in> Span K Vs; v' \<in> carrier R; u = u' \<oplus> v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u' \<in> Span K Us
u' \<in> carrier R
v' \<in> Span K Vs
v' \<in> carrier R
u = u' \<oplus> v'

goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
hence "u \<oplus> (\<ominus> u') = v'"
[PROOF STATE]
proof (prove)
using this:
u' \<in> Span K Us
u' \<in> carrier R
v' \<in> Span K Vs
v' \<in> carrier R
u = u' \<oplus> v'

goal (1 subgoal):
 1. u \<oplus> \<ominus> u' = v'
[PROOF STEP]
using in_carrier(1)
[PROOF STATE]
proof (prove)
using this:
u' \<in> Span K Us
u' \<in> carrier R
v' \<in> Span K Vs
v' \<in> carrier R
u = u' \<oplus> v'
u \<in> carrier R

goal (1 subgoal):
 1. u \<oplus> \<ominus> u' = v'
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
u \<oplus> \<ominus> u' = v'

goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
u \<oplus> \<ominus> u' = v'

goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
have "u \<in> Span K (u # Us)" and "u' \<in> Span K (u # Us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<in> Span K (u # Us) &&& u' \<in> Span K (u # Us)
[PROOF STEP]
using Span_base_incl[OF in_carrier(4)] mono_Span[OF in_carrier(2,1)] u'(1)
[PROOF STATE]
proof (prove)
using this:
set (u # Us) \<subseteq> Span K (u # Us)
Span K Us \<subseteq> Span K (u # Us)
u' \<in> Span K Us

goal (1 subgoal):
 1. u \<in> Span K (u # Us) &&& u' \<in> Span K (u # Us)
[PROOF STEP]
by (auto simp del: Span.simps)
[PROOF STATE]
proof (state)
this:
u \<in> Span K (u # Us)
u' \<in> Span K (u # Us)

goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
hence "u \<oplus> (\<ominus> u') \<in> Span K (u # Us)"
[PROOF STATE]
proof (prove)
using this:
u \<in> Span K (u # Us)
u' \<in> Span K (u # Us)

goal (1 subgoal):
 1. u \<oplus> \<ominus> u' \<in> Span K (u # Us)
[PROOF STEP]
using Span_subgroup_props(3-4)[OF in_carrier(4)]
[PROOF STATE]
proof (prove)
using this:
u \<in> Span K (u # Us)
u' \<in> Span K (u # Us)
\<lbrakk>?v1.0 \<in> Span K (u # Us); ?v2.0 \<in> Span K (u # Us)\<rbrakk> \<Longrightarrow> ?v1.0 \<oplus> ?v2.0 \<in> Span K (u # Us)
?v \<in> Span K (u # Us) \<Longrightarrow> \<ominus> ?v \<in> Span K (u # Us)

goal (1 subgoal):
 1. u \<oplus> \<ominus> u' \<in> Span K (u # Us)
[PROOF STEP]
by (auto simp del: Span.simps)
[PROOF STATE]
proof (state)
this:
u \<oplus> \<ominus> u' \<in> Span K (u # Us)

goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
u \<oplus> \<ominus> u' = v'
u \<oplus> \<ominus> u' \<in> Span K (u # Us)
[PROOF STEP]
have "u \<oplus> (\<ominus> u') = \<zero>"
[PROOF STATE]
proof (prove)
using this:
u \<oplus> \<ominus> u' = v'
u \<oplus> \<ominus> u' \<in> Span K (u # Us)

goal (1 subgoal):
 1. u \<oplus> \<ominus> u' = \<zero>
[PROOF STEP]
using Cons(4) v'(1)
[PROOF STATE]
proof (prove)
using this:
u \<oplus> \<ominus> u' = v'
u \<oplus> \<ominus> u' \<in> Span K (u # Us)
Span K (u # Us) \<inter> Span K Vs = {\<zero>}
v' \<in> Span K Vs

goal (1 subgoal):
 1. u \<oplus> \<ominus> u' = \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<oplus> \<ominus> u' = \<zero>

goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
hence "u = u'"
[PROOF STATE]
proof (prove)
using this:
u \<oplus> \<ominus> u' = \<zero>

goal (1 subgoal):
 1. u = u'
[PROOF STEP]
using Cons(4) v'(1) in_carrier(1) u'(2) \<open>u \<oplus> \<ominus> u' = v'\<close> u
[PROOF STATE]
proof (prove)
using this:
u \<oplus> \<ominus> u' = \<zero>
Span K (u # Us) \<inter> Span K Vs = {\<zero>}
v' \<in> Span K Vs
u \<in> carrier R
u' \<in> carrier R
u \<oplus> \<ominus> u' = v'
u = u' \<oplus> v'

goal (1 subgoal):
 1. u = u'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = u'

goal (1 subgoal):
 1. \<not> u \<notin> Span K (Us @ Vs) \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
u = u'

goal (1 subgoal):
 1. False
[PROOF STEP]
using u'(1) independent_backwards(1)[OF Cons(2)]
[PROOF STATE]
proof (prove)
using this:
u = u'
u' \<in> Span K Us
u \<notin> Span K Us

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u \<notin> Span K (Us @ Vs)

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<lbrakk>local.independent K x2; local.independent K Vs; Span K x2 \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K (x2 @ Vs); local.independent K (x1 # x2); local.independent K Vs; Span K (x1 # x2) \<inter> Span K Vs = {\<zero>}\<rbrakk> \<Longrightarrow> local.independent K ((x1 # x2) @ Vs)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local.independent K (Us @ Vs)
u \<notin> Span K (Us @ Vs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local.independent K (Us @ Vs)
u \<notin> Span K (Us @ Vs)

goal (1 subgoal):
 1. local.independent K ((u # Us) @ Vs)
[PROOF STEP]
using in_carrier(1) li_Cons
[PROOF STATE]
proof (prove)
using this:
local.independent K (Us @ Vs)
u \<notin> Span K (Us @ Vs)
u \<in> carrier R
\<lbrakk>?u \<in> carrier R; ?u \<notin> Span ?K ?Us; local.independent ?K ?Us\<rbrakk> \<Longrightarrow> local.independent ?K (?u # ?Us)

goal (1 subgoal):
 1. local.independent K ((u # Us) @ Vs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.independent K ((u # Us) @ Vs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_1_fun: "mat 1 $ a $ b = (\<lambda>i j. if i=j then 1 else 0) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (1::'a) $ a $ b = (if a = b then 1::'a else (0::'a))
[PROOF STEP]
unfolding mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. if i = j then 1::'a else (0::'a)) $ a $ b = (if a = b then 1::'a else (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma lex_trans:
  fixes ps1 ps2 ps3 :: "nat list"
  assumes "ps1 \<sqsubset>lex ps2" "ps2 \<sqsubset>lex ps3"
  shows "ps1 \<sqsubset>lex ps3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps1 \<sqsubset>lex ps3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ps1 \<sqsubset>lex ps2
ps2 \<sqsubset>lex ps3

goal (1 subgoal):
 1. ps1 \<sqsubset>lex ps3
[PROOF STEP]
by (induct arbitrary: ps3 rule: lex_list.induct)
   (auto elim: lex_list.cases)


[STATEMENT]
lemma subadditiveD:
  assumes "subadditive u"
  shows "u (m+n) \<le> u m + u n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (m + n) \<le> u m + u n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subadditive u

goal (1 subgoal):
 1. u (m + n) \<le> u m + u n
[PROOF STEP]
unfolding subadditive_def
[PROOF STATE]
proof (prove)
using this:
\<forall>m n. u (m + n) \<le> u m + u n

goal (1 subgoal):
 1. u (m + n) \<le> u m + u n
[PROOF STEP]
by auto


[STATEMENT]
lemma netlimit_at [simp]:
  fixes a :: "'a::{perfect_space,t2_space}"
  shows "netlimit (at a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. netlimit (at a) = a
[PROOF STEP]
using Lim_ident_at [of a UNIV]
[PROOF STATE]
proof (prove)
using this:
at a \<noteq> bot \<Longrightarrow> netlimit (at a) = a

goal (1 subgoal):
 1. netlimit (at a) = a
[PROOF STEP]
by simp


[STATEMENT]
lemma emeasure_lborel_Ioo[simp]:
  assumes [simp]: "l \<le> u"
  shows "emeasure lborel {l <..< u} = ennreal (u - l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel {l<..<u} = ennreal (u - l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure lborel {l<..<u} = ennreal (u - l)
[PROOF STEP]
have "emeasure lborel {l <..< u} = emeasure lborel {l .. u}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel {l<..<u} = emeasure lborel {l..u}
[PROOF STEP]
using AE_lborel_singleton[of u] AE_lborel_singleton[of l]
[PROOF STATE]
proof (prove)
using this:
AE x in lborel. x \<noteq> u
AE x in lborel. x \<noteq> l

goal (1 subgoal):
 1. emeasure lborel {l<..<u} = emeasure lborel {l..u}
[PROOF STEP]
by (intro emeasure_eq_AE) auto
[PROOF STATE]
proof (state)
this:
emeasure lborel {l<..<u} = emeasure lborel {l..u}

goal (1 subgoal):
 1. emeasure lborel {l<..<u} = ennreal (u - l)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel {l<..<u} = emeasure lborel {l..u}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure lborel {l<..<u} = emeasure lborel {l..u}

goal (1 subgoal):
 1. emeasure lborel {l<..<u} = ennreal (u - l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure lborel {l<..<u} = ennreal (u - l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lipschitz_on_cmult [lipschitz_intros]:
  fixes f::"'a::metric_space \<Rightarrow> 'b::real_normed_vector"
  assumes "C-lipschitz_on U f"
  shows "(abs(a) * C)-lipschitz_on U (\<lambda>x. a *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>a\<bar> * C)-lipschitz_on U (\<lambda>x. a *\<^sub>R f x)
[PROOF STEP]
proof (rule lipschitz_onI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
 2. 0 \<le> \<bar>a\<bar> * C
[PROOF STEP]
show "abs(a) * C \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<bar>a\<bar> * C
[PROOF STEP]
using lipschitz_on_nonneg[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
0 \<le> C

goal (1 subgoal):
 1. 0 \<le> \<bar>a\<bar> * C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> \<bar>a\<bar> * C

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
assume H: "x \<in> U" "y \<in> U"
[PROOF STATE]
proof (state)
this:
x \<in> U
y \<in> U

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
have "dist (a *\<^sub>R f x) (a *\<^sub>R f y) = abs(a) * dist (f x) (f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (a *\<^sub>R f x) (a *\<^sub>R f y) = \<bar>a\<bar> * dist (f x) (f y)
[PROOF STEP]
by (metis dist_norm norm_scaleR real_vector.scale_right_diff_distrib)
[PROOF STATE]
proof (state)
this:
dist (a *\<^sub>R f x) (a *\<^sub>R f y) = \<bar>a\<bar> * dist (f x) (f y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (a *\<^sub>R f x) (a *\<^sub>R f y) = \<bar>a\<bar> * dist (f x) (f y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
have "... \<le> abs(a) * C * dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a\<bar> * dist (f x) (f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
using lipschitz_onD(1)[OF assms(1) H]
[PROOF STATE]
proof (prove)
using this:
dist (f x) (f y) \<le> C * dist x y

goal (1 subgoal):
 1. \<bar>a\<bar> * dist (f x) (f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
by (simp add: Groups.mult_ac(1) mult_left_mono)
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> * dist (f x) (f y) \<le> \<bar>a\<bar> * C * dist x y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
show "dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y"
[PROOF STATE]
proof (prove)
using this:
dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y

goal (1 subgoal):
 1. dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (a *\<^sub>R f x) (a *\<^sub>R f y) \<le> \<bar>a\<bar> * C * dist x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefixes_length_mono': "e_length (prefixes j t) \<le> e_length (prefixes j (t + d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d))
[PROOF STEP]
proof (induction d)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + 0))
 2. \<And>d. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d)) \<Longrightarrow> e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + Suc d))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + 0))
 2. \<And>d. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d)) \<Longrightarrow> e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + Suc d))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + 0))

goal (1 subgoal):
 1. \<And>d. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d)) \<Longrightarrow> e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + Suc d))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d)) \<Longrightarrow> e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + Suc d))
[PROOF STEP]
case (Suc d)
[PROOF STATE]
proof (state)
this:
e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d))

goal (1 subgoal):
 1. \<And>d. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d)) \<Longrightarrow> e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + Suc d))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d))

goal (1 subgoal):
 1. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + Suc d))
[PROOF STEP]
using prefixes_length_mono le_less_trans
[PROOF STATE]
proof (prove)
using this:
e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + d))
e_length (local.prefixes ?j ?t) < e_length (local.prefixes ?j (Suc ?t))
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + Suc d))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
e_length (local.prefixes j t) \<le> e_length (local.prefixes j (t + Suc d))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordLeq3_finite_infinite:
  assumes A: "finite A" and B: "infinite B" shows "ordLeq3 (card_of A) (card_of B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordLeq3 (card_of A) (card_of B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordLeq3 (card_of A) (card_of B)
[PROOF STEP]
have \<open>ordLeq3 (card_of A) (card_of B) \<or> ordLeq3 (card_of B) (card_of A)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordLeq3 (card_of A) (card_of B) \<or> ordLeq3 (card_of B) (card_of A)
[PROOF STEP]
by (intro ordLeq_total card_of_Well_order)
[PROOF STATE]
proof (state)
this:
ordLeq3 (card_of A) (card_of B) \<or> ordLeq3 (card_of B) (card_of A)

goal (1 subgoal):
 1. ordLeq3 (card_of A) (card_of B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ordLeq3 (card_of A) (card_of B) \<or> ordLeq3 (card_of B) (card_of A)

goal (1 subgoal):
 1. ordLeq3 (card_of A) (card_of B)
[PROOF STEP]
have "\<not> ordLeq3 (card_of B) (card_of A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card_of B, card_of A) \<notin> ordLeq
[PROOF STEP]
using B A card_of_ordLeq_finite[of B A]
[PROOF STATE]
proof (prove)
using this:
infinite B
finite A
\<lbrakk>ordLeq3 (card_of B) (card_of A); finite A\<rbrakk> \<Longrightarrow> finite B

goal (1 subgoal):
 1. (card_of B, card_of A) \<notin> ordLeq
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(card_of B, card_of A) \<notin> ordLeq

goal (1 subgoal):
 1. ordLeq3 (card_of A) (card_of B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ordLeq3 (card_of A) (card_of B) \<or> ordLeq3 (card_of B) (card_of A)
(card_of B, card_of A) \<notin> ordLeq
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ordLeq3 (card_of A) (card_of B) \<or> ordLeq3 (card_of B) (card_of A)
(card_of B, card_of A) \<notin> ordLeq

goal (1 subgoal):
 1. ordLeq3 (card_of A) (card_of B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ordLeq3 (card_of A) (card_of B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma phull_closed_lin_red:
  assumes "phull B \<subseteq> phull A" and "p \<in> phull A" and "lin_red B p q"
  shows "q \<in> phull A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<in> phull A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. q \<in> phull A
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
lin_red B p q
[PROOF STEP]
obtain f where "f \<in> B" and "red_single p q f 0"
[PROOF STATE]
proof (prove)
using this:
lin_red B p q

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> B; red_single p q f (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule lin_redE)
[PROOF STATE]
proof (state)
this:
f \<in> B
red_single p q f (0::'a)

goal (1 subgoal):
 1. q \<in> phull A
[PROOF STEP]
hence q: "q = p - (lookup p (lt f) / lc f) \<cdot> f"
[PROOF STATE]
proof (prove)
using this:
f \<in> B
red_single p q f (0::'a)

goal (1 subgoal):
 1. q = p - (lookup p (lt f) / lc f) \<cdot> f
[PROOF STEP]
by (simp add: red_single_def term_simps map_scale_eq_monom_mult)
[PROOF STATE]
proof (state)
this:
q = p - (lookup p (lt f) / lc f) \<cdot> f

goal (1 subgoal):
 1. q \<in> phull A
[PROOF STEP]
have "q - p \<in> phull B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q - p \<in> phull B
[PROOF STEP]
by (simp add: q, rule phull.span_neg, rule phull.span_scale, rule phull.span_base, fact \<open>f \<in> B\<close>)
[PROOF STATE]
proof (state)
this:
q - p \<in> phull B

goal (1 subgoal):
 1. q \<in> phull A
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
phull B \<subseteq> phull A
q - p \<in> phull B
[PROOF STEP]
have "q - p \<in> phull A"
[PROOF STATE]
proof (prove)
using this:
phull B \<subseteq> phull A
q - p \<in> phull B

goal (1 subgoal):
 1. q - p \<in> phull A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
q - p \<in> phull A

goal (1 subgoal):
 1. q \<in> phull A
[PROOF STEP]
from this assms(2)
[PROOF STATE]
proof (chain)
picking this:
q - p \<in> phull A
p \<in> phull A
[PROOF STEP]
have "(q - p) + p \<in> phull A"
[PROOF STATE]
proof (prove)
using this:
q - p \<in> phull A
p \<in> phull A

goal (1 subgoal):
 1. q - p + p \<in> phull A
[PROOF STEP]
by (rule phull.span_add)
[PROOF STATE]
proof (state)
this:
q - p + p \<in> phull A

goal (1 subgoal):
 1. q \<in> phull A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
q - p + p \<in> phull A

goal (1 subgoal):
 1. q \<in> phull A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q \<in> phull A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connecting_path_split_length:
  assumes "connecting_path u v xs" "connecting_path v z ys"
  obtains p where "connecting_path u z p" and "walk_length p \<le> walk_length xs + walk_length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>connecting_path u z p; walk_length p \<le> walk_length xs + walk_length ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>connecting_path u z p; walk_length p \<le> walk_length xs + walk_length ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "connecting_walk u z (xs @ (tl ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connecting_walk u z (xs @ tl ys)
[PROOF STEP]
using connecting_walk_split assms connecting_path_walk
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>connecting_walk ?u ?v ?xs; connecting_walk ?v ?z ?ys\<rbrakk> \<Longrightarrow> connecting_walk ?u ?z (?xs @ tl ?ys)
connecting_path u v xs
connecting_path v z ys
connecting_path ?u ?v ?xs \<Longrightarrow> connecting_walk ?u ?v ?xs

goal (1 subgoal):
 1. connecting_walk u z (xs @ tl ys)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
connecting_walk u z (xs @ tl ys)

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>connecting_path u z p; walk_length p \<le> walk_length xs + walk_length ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "walk_length (xs @ (tl ys)) \<le> walk_length xs + walk_length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. walk_length (xs @ tl ys) \<le> walk_length xs + walk_length ys
[PROOF STEP]
using walk_length_app_ineq
[PROOF STATE]
proof (prove)
using this:
walk_length ?xs + walk_length ?ys \<le> walk_length (?xs @ ?ys) \<and> walk_length (?xs @ ?ys) \<le> walk_length ?xs + walk_length ?ys + 1

goal (1 subgoal):
 1. walk_length (xs @ tl ys) \<le> walk_length xs + walk_length ys
[PROOF STEP]
by (simp add: le_diff_conv walk_length_conv)
[PROOF STATE]
proof (state)
this:
walk_length (xs @ tl ys) \<le> walk_length xs + walk_length ys

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>connecting_path u z p; walk_length p \<le> walk_length xs + walk_length ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
walk_length (xs @ tl ys) \<le> walk_length xs + walk_length ys

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using connecting_path_split
[PROOF STATE]
proof (prove)
using this:
walk_length (xs @ tl ys) \<le> walk_length xs + walk_length ys
\<lbrakk>connecting_path ?u ?v ?xs; connecting_path ?v ?z ?ys; \<And>p. \<lbrakk>connecting_path ?u ?z p; walk_length p \<le> walk_length (?xs @ tl ?ys)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (metis (full_types) assms(1) assms(2) dual_order.trans that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_enat: "open {enat n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {enat n}
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> open {enat n}
 2. \<And>nat. n = Suc nat \<Longrightarrow> open {enat n}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> open {enat n}
 2. \<And>nat. n = Suc nat \<Longrightarrow> open {enat n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
have "{enat n} = {..< eSuc 0}"
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. {enat n} = {..<eSuc 0}
[PROOF STEP]
by (auto simp: enat_0)
[PROOF STATE]
proof (state)
this:
{enat n} = {..<eSuc 0}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> open {enat n}
 2. \<And>nat. n = Suc nat \<Longrightarrow> open {enat n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{enat n} = {..<eSuc 0}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{enat n} = {..<eSuc 0}

goal (1 subgoal):
 1. open {enat n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
open {enat n}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> open {enat n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> open {enat n}
[PROOF STEP]
case (Suc n')
[PROOF STATE]
proof (state)
this:
n = Suc n'

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> open {enat n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = Suc n'
[PROOF STEP]
have "{enat n} = {enat n' <..< enat (Suc n)}"
[PROOF STATE]
proof (prove)
using this:
n = Suc n'

goal (1 subgoal):
 1. {enat n} = {enat n'<..<enat (Suc n)}
[PROOF STEP]
using enat_iless
[PROOF STATE]
proof (prove)
using this:
n = Suc n'
?n < enat ?m \<Longrightarrow> \<exists>k. ?n = enat k

goal (1 subgoal):
 1. {enat n} = {enat n'<..<enat (Suc n)}
[PROOF STEP]
by (fastforce simp: set_eq_iff)
[PROOF STATE]
proof (state)
this:
{enat n} = {enat n'<..<enat (Suc n)}

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> open {enat n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{enat n} = {enat n'<..<enat (Suc n)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{enat n} = {enat n'<..<enat (Suc n)}

goal (1 subgoal):
 1. open {enat n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
open {enat n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_component [simp]:
  fixes f:: " 'a \<Rightarrow> ('b::comm_monoid_add) ^'n"
  shows "(sum f S)$i = sum (\<lambda>x. (f x)$i) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f S $ i = (\<Sum>x\<in>S. f x $ i)
[PROOF STEP]
proof (cases "finite S")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite S \<Longrightarrow> sum f S $ i = (\<Sum>x\<in>S. f x $ i)
 2. infinite S \<Longrightarrow> sum f S $ i = (\<Sum>x\<in>S. f x $ i)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite S

goal (2 subgoals):
 1. finite S \<Longrightarrow> sum f S $ i = (\<Sum>x\<in>S. f x $ i)
 2. infinite S \<Longrightarrow> sum f S $ i = (\<Sum>x\<in>S. f x $ i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. sum f S $ i = (\<Sum>x\<in>S. f x $ i)
[PROOF STEP]
by induct simp_all
[PROOF STATE]
proof (state)
this:
sum f S $ i = (\<Sum>x\<in>S. f x $ i)

goal (1 subgoal):
 1. infinite S \<Longrightarrow> sum f S $ i = (\<Sum>x\<in>S. f x $ i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite S \<Longrightarrow> sum f S $ i = (\<Sum>x\<in>S. f x $ i)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite S

goal (1 subgoal):
 1. infinite S \<Longrightarrow> sum f S $ i = (\<Sum>x\<in>S. f x $ i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite S

goal (1 subgoal):
 1. sum f S $ i = (\<Sum>x\<in>S. f x $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f S $ i = (\<Sum>x\<in>S. f x $ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma small_powers_of_2:
  \<open>x < 2 ^ (x - 1)\<close> if \<open>x \<ge> 3\<close> for x :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < 2 ^ (x - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x < 2 ^ (x - 1)
[PROOF STEP]
define m where \<open>m = x - 3\<close>
[PROOF STATE]
proof (state)
this:
m = x - 3

goal (1 subgoal):
 1. x < 2 ^ (x - 1)
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
3 \<le> x
m = x - 3
[PROOF STEP]
have \<open>x = m + 3\<close>
[PROOF STATE]
proof (prove)
using this:
3 \<le> x
m = x - 3

goal (1 subgoal):
 1. x = m + 3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = m + 3

goal (1 subgoal):
 1. x < 2 ^ (x - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x = m + 3

goal (1 subgoal):
 1. x < 2 ^ (x - 1)
[PROOF STEP]
have \<open>m + 3 < 4 * 2 ^ m\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m + 3 < 4 * 2 ^ m
[PROOF STEP]
by (induction m) simp_all
[PROOF STATE]
proof (state)
this:
m + 3 < 4 * 2 ^ m

goal (1 subgoal):
 1. x < 2 ^ (x - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x = m + 3
m + 3 < 4 * 2 ^ m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = m + 3
m + 3 < 4 * 2 ^ m

goal (1 subgoal):
 1. x < 2 ^ (x - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x < 2 ^ (x - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nths_Nil[simp]: "(nths xs inds = []) = (\<forall>i \<in> inds. i \<ge> length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (nths xs inds = []) = (\<forall>i\<in>inds. length xs \<le> i)
[PROOF STEP]
apply (induct xs arbitrary: inds)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>inds. (nths [] inds = []) = Ball inds ((\<le>) (length []))
 2. \<And>a xs inds. (\<And>inds. (nths xs inds = []) = Ball inds ((\<le>) (length xs))) \<Longrightarrow> (nths (a # xs) inds = []) = Ball inds ((\<le>) (length (a # xs)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs inds. (\<And>inds. (nths xs inds = []) = Ball inds ((\<le>) (length xs))) \<Longrightarrow> (nths (a # xs) inds = []) = Ball inds ((\<le>) (length (a # xs)))
[PROOF STEP]
apply (simp add: nths_Cons)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs inds. (\<And>inds. (nths xs inds = []) = Ball inds ((\<le>) (length xs))) \<Longrightarrow> (0 \<in> inds \<longrightarrow> (\<exists>x\<in>inds. \<not> Suc (length xs) \<le> x)) \<and> (0 \<notin> inds \<longrightarrow> (\<forall>x. Suc x \<in> inds \<longrightarrow> length xs \<le> x) = Ball inds ((\<le>) (Suc (length xs))))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs inds x. \<lbrakk>\<And>inds. (nths xs inds = []) = (\<forall>x\<in>inds. length xs \<le> x); 0 \<notin> inds; \<forall>x. Suc x \<in> inds \<longrightarrow> length xs \<le> x; x \<in> inds\<rbrakk> \<Longrightarrow> Suc (length xs) \<le> x
[PROOF STEP]
apply (erule_tac x="{j. Suc j \<in> inds}" in meta_allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs inds x. \<lbrakk>0 \<notin> inds; \<forall>x. Suc x \<in> inds \<longrightarrow> length xs \<le> x; x \<in> inds; (nths xs {j. Suc j \<in> inds} = []) = (\<forall>x\<in>{j. Suc j \<in> inds}. length xs \<le> x)\<rbrakk> \<Longrightarrow> Suc (length xs) \<le> x
[PROOF STEP]
apply (case_tac x, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma coplanar_perm_16:
  assumes "Coplanar A B C D"
  shows "Coplanar C D A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar C D A B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Coplanar C D A B
[PROOF STEP]
obtain X where P1: "(Col A B X \<and> Col C D X) \<or> (Col A C X \<and> Col B D X) \<or> (Col A D X \<and> Col B C X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Coplanar_def assms
[PROOF STATE]
proof (prove)
using this:
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Coplanar A B C D

goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar C D A B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar C D A B
[PROOF STEP]
using Coplanar_def col_permutation_4
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Col ?A ?B ?C \<Longrightarrow> Col ?B ?A ?C

goal (1 subgoal):
 1. Coplanar C D A B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Coplanar C D A B

goal:
No subgoals!
[PROOF STEP]
qed