[STATEMENT]
lemma conjugate_eq_unitarily_equiv:
  assumes "A\<in> carrier_mat n n"
  and "V\<in> carrier_mat n n"
  and "unitarily_equiv A B U"
  and "unitary V"
  and "V * B * (Complex_Matrix.adjoint V) = B"
shows "unitarily_equiv A B (U*V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitarily_equiv A B (U * V)
[PROOF STEP]
unfolding unitarily_equiv_def similar_mat_wit_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary (U * V) \<and> {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A) \<and> U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A) \<and> Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A) \<and> A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
proof (intro conjI)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. Complex_Matrix.unitary (U * V)
 2. {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)
 3. U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)
 4. Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)
 5. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
have "B\<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat n n
[PROOF STEP]
using assms(1) assms(3) unitarily_equiv_carrier(1)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
unitarily_equiv A B U
\<lbrakk>?A \<in> carrier_mat ?n ?n; unitarily_equiv ?A ?B ?U\<rbrakk> \<Longrightarrow> ?B \<in> carrier_mat ?n ?n

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

goal (5 subgoals):
 1. Complex_Matrix.unitary (U * V)
 2. {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)
 3. U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)
 4. Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)
 5. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
have "U\<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<in> carrier_mat n n
[PROOF STEP]
using assms(1) assms(3) unitarily_equiv_carrier(2)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
unitarily_equiv A B U
\<lbrakk>?A \<in> carrier_mat ?n ?n; unitarily_equiv ?A ?B ?U\<rbrakk> \<Longrightarrow> ?U \<in> carrier_mat ?n ?n

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

goal (5 subgoals):
 1. Complex_Matrix.unitary (U * V)
 2. {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)
 3. U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)
 4. Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)
 5. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
show u: "unitary (U*V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary (U * V)
[PROOF STEP]
by (metis Complex_Matrix.unitary_def adjoint_dim_col assms(1) assms(2)
        assms(3) assms(4) carrier_matD(2) index_mult_mat(3) unitarily_equivD(1)
        unitarily_equiv_eq unitary_times_unitary)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.unitary (U * V)

goal (4 subgoals):
 1. {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)
 2. U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)
 3. Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)
 4. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
thus l: "U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)"
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.unitary (U * V)

goal (1 subgoal):
 1. U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)
[PROOF STEP]
by (metis Complex_Matrix.unitary_def assms(1) assms(2) carrier_matD(1)
        carrier_matD(2) index_mult_mat(3) inverts_mat_def)
[PROOF STATE]
proof (state)
this:
U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)

goal (3 subgoals):
 1. {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)
 2. Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)
 3. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
thus r: "Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)"
[PROOF STATE]
proof (prove)
using this:
U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)

goal (1 subgoal):
 1. Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)
[PROOF STEP]
using u
[PROOF STATE]
proof (prove)
using this:
U * V * Complex_Matrix.adjoint (U * V) = 1\<^sub>m (dim_row A)
Complex_Matrix.unitary (U * V)

goal (1 subgoal):
 1. Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)
[PROOF STEP]
by (metis Complex_Matrix.unitary_def index_mult_mat(2) index_one_mat(2)
        unitary_simps(1))
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (U * V) * (U * V) = 1\<^sub>m (dim_row A)

goal (2 subgoals):
 1. {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)
 2. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
show "{A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq>
    carrier_mat (dim_row A) (dim_row A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)
[PROOF STEP]
using \<open>B \<in> carrier_mat n n\<close> \<open>U \<in> carrier_mat n n\<close> adjoint_dim' assms
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
U \<in> carrier_mat n n
?A \<in> carrier_mat ?n ?m \<Longrightarrow> Complex_Matrix.adjoint ?A \<in> carrier_mat ?m ?n
A \<in> carrier_mat n n
V \<in> carrier_mat n n
unitarily_equiv A B U
Complex_Matrix.unitary V
V * B * Complex_Matrix.adjoint V = B

goal (1 subgoal):
 1. {A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{A, B, U * V, Complex_Matrix.adjoint (U * V)} \<subseteq> carrier_mat (dim_row A) (dim_row A)

goal (1 subgoal):
 1. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
have "U * V * B * Complex_Matrix.adjoint (U * V) =
    U * V * B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * V * B * Complex_Matrix.adjoint (U * V) = U * V * B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)
[PROOF STEP]
by (metis \<open>U \<in> carrier_mat n n\<close> adjoint_mult assms(2))
[PROOF STATE]
proof (state)
this:
U * V * B * Complex_Matrix.adjoint (U * V) = U * V * B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)

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

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

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

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

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

goal (1 subgoal):
 1. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
have "... = U * V * B * (Complex_Matrix.adjoint V *
    Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * V * B * Complex_Matrix.adjoint V * Complex_Matrix.adjoint U = U * V * B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)
[PROOF STEP]
proof (rule assoc_mult_mat, auto simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.adjoint V \<in> carrier_mat (dim_col B) (dim_col U)
[PROOF STEP]
show "Complex_Matrix.adjoint V \<in> carrier_mat (dim_col B) (dim_col U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint V \<in> carrier_mat (dim_col B) (dim_col U)
[PROOF STEP]
by (metis \<open>B \<in> carrier_mat n n\<close> \<open>U \<in> carrier_mat n n\<close> adjoint_dim'
          assms(2) carrier_matD(2))
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint V \<in> carrier_mat (dim_col B) (dim_col U)

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

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

goal (1 subgoal):
 1. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
have "... = U * V * (B * (Complex_Matrix.adjoint V *
    Complex_Matrix.adjoint U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * V * B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U) = U * V * (B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U))
[PROOF STEP]
proof (rule assoc_mult_mat, auto simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B \<in> carrier_mat (dim_col V) (dim_col V)
[PROOF STEP]
show "B \<in> carrier_mat (dim_col V) (dim_col V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat (dim_col V) (dim_col V)
[PROOF STEP]
by (metis \<open>B \<in> carrier_mat n n\<close> assms(2) carrier_matD(2))
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat (dim_col V) (dim_col V)

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

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

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

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

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

goal (1 subgoal):
 1. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
U * V * B * Complex_Matrix.adjoint (U * V) = U * (V * (B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)))
[PROOF STEP]
have eq: "U * V * B * Complex_Matrix.adjoint (U * V) =
    U * (V * (B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)))"
[PROOF STATE]
proof (prove)
using this:
U * V * B * Complex_Matrix.adjoint (U * V) = U * (V * (B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)))

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

goal (1 subgoal):
 1. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
have "V * (B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)) =
    V * B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V * (B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)) = V * B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint 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 V) (dim_col V)
[PROOF STEP]
show "B \<in> carrier_mat (dim_col V) (dim_col V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat (dim_col V) (dim_col V)
[PROOF STEP]
using \<open>B \<in> carrier_mat n n\<close> assms(2)
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
V \<in> carrier_mat n n

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

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

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

goal (1 subgoal):
 1. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
have "... = V * B * Complex_Matrix.adjoint V * Complex_Matrix.adjoint U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V * B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U) = V * B * Complex_Matrix.adjoint V * Complex_Matrix.adjoint U
[PROOF STEP]
proof (rule assoc_mult_mat[symmetric], auto simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.adjoint V \<in> carrier_mat (dim_col B) (dim_col U)
[PROOF STEP]
show "Complex_Matrix.adjoint V \<in> carrier_mat (dim_col B) (dim_col U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint V \<in> carrier_mat (dim_col B) (dim_col U)
[PROOF STEP]
by (metis \<open>B \<in> carrier_mat n n\<close> \<open>U \<in> carrier_mat n n\<close>
          adjoint_dim_row assms(2) assms(5) carrier_matD(2) carrier_mat_triv
          index_mult_mat(3))
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint V \<in> carrier_mat (dim_col B) (dim_col U)

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

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

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

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

goal (1 subgoal):
 1. A = U * V * B * Complex_Matrix.adjoint (U * V)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
V * (B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)) = B * Complex_Matrix.adjoint U
[PROOF STEP]
have "V *(B *(Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)) =
    B* Complex_Matrix.adjoint U"
[PROOF STATE]
proof (prove)
using this:
V * (B * (Complex_Matrix.adjoint V * Complex_Matrix.adjoint U)) = B * Complex_Matrix.adjoint U

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

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

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

goal (1 subgoal):
 1. U * V * B * Complex_Matrix.adjoint (U * V) = U * B * Complex_Matrix.adjoint U
[PROOF STEP]
by (metis \<open>B \<in> carrier_mat n n\<close> \<open>U \<in> carrier_mat n n\<close> adjoint_dim' assoc_mult_mat)
[PROOF STATE]
proof (state)
this:
U * V * B * Complex_Matrix.adjoint (U * V) = U * B * Complex_Matrix.adjoint U

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

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filterlim_at_top_imp_at_infinity: "filterlim f at_top F \<Longrightarrow> filterlim f at_infinity F"
  for f :: "_ \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_top F \<Longrightarrow> filterlim f at_infinity F
[PROOF STEP]
by (rule filterlim_mono[OF _ at_top_le_at_infinity order_refl])


[STATEMENT]
lemma distinct_length_le:"finite s \<Longrightarrow> set xs \<subseteq> s \<Longrightarrow> distinct xs \<Longrightarrow> length xs \<le> card s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite s; set xs \<subseteq> s; distinct xs\<rbrakk> \<Longrightarrow> length xs \<le> card s
[PROOF STEP]
by (metis card_mono distinct_card)


[STATEMENT]
lemma concatMap_singleton [simp]:
  "concatMap\<cdot>(\<Lambda> x. [f\<cdot>x])\<cdot>xs = map\<cdot>f\<cdot>xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concatMap\<cdot>(\<Lambda> x. [f\<cdot>x])\<cdot>xs = map\<cdot>f\<cdot>xs
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma Abs_freelist_Cons: "Abs_freelist (x#xs) = Abs_freeletter x + Abs_freelist xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_freelist (x # xs) = Abs_freeletter x + Abs_freelist xs
[PROOF STEP]
using proper_signed_list_map_uniform_snd[of True "x#xs"] Abs_freeword_Cons
[PROOF STATE]
proof (prove)
using this:
proper_signed_list (map pairtrue (x # xs))
proper_signed_list (?x # ?xs) \<Longrightarrow> Abs_freeword (?x # ?xs) = Abs_freeword [?x] + Abs_freeword ?xs

goal (1 subgoal):
 1. Abs_freelist (x # xs) = Abs_freeletter x + Abs_freelist xs
[PROOF STEP]
by    simp


[STATEMENT]
lemma moebius_translation_zero [simp]:
  shows "moebius_translation 0 = id_moebius"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_translation 0 = id_moebius
[PROOF STEP]
unfolding moebius_translation_def moebius_similarity_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id_moebius = id_moebius
[PROOF STEP]
by simp


[STATEMENT]
lemma interval_lemma2: "\<lbrakk>S \<subseteq> interval r a b; x \<in> S\<rbrakk> \<Longrightarrow> (x, b) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> interval r a b; x \<in> S\<rbrakk> \<Longrightarrow> (x, b) \<in> r
[PROOF STEP]
unfolding interval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> {x. (a, x) \<in> r \<and> (x, b) \<in> r}; x \<in> S\<rbrakk> \<Longrightarrow> (x, b) \<in> r
[PROOF STEP]
by fast


[STATEMENT]
lemma carrier_substitute1: "carrier t \<subseteq> carrier (substitute f T t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier t \<subseteq> carrier (substitute f T t)
[PROOF STEP]
by (rule carrier_mono) (rule substitute_contains_arg)


[STATEMENT]
lemma path_compression_invariant_simplify:
  assumes "point w"
      and "p\<^sup>T\<^sup>+ * w \<le> -w"
      and "w \<noteq> y"
    shows "p[[w]] \<noteq> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p[[w]] \<noteq> w
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p[[w]] = w \<Longrightarrow> False
[PROOF STEP]
assume "p[[w]] = w"
[PROOF STATE]
proof (state)
this:
p[[w]] = w

goal (1 subgoal):
 1. p[[w]] = w \<Longrightarrow> False
[PROOF STEP]
hence "w \<le> p\<^sup>T\<^sup>+ * w"
[PROOF STATE]
proof (prove)
using this:
p[[w]] = w

goal (1 subgoal):
 1. w \<le> (p[[p\<^sup>T\<^sup>\<star>]]) * w
[PROOF STEP]
by (metis comp_isotone eq_refl star.circ_mult_increasing)
[PROOF STATE]
proof (state)
this:
w \<le> (p[[p\<^sup>T\<^sup>\<star>]]) * w

goal (1 subgoal):
 1. p[[w]] = w \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w \<le> (p[[p\<^sup>T\<^sup>\<star>]]) * w

goal (1 subgoal):
 1. p[[w]] = w \<Longrightarrow> False
[PROOF STEP]
have "... \<le> -w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p[[p\<^sup>T\<^sup>\<star>]]) * w \<le> - w
[PROOF STEP]
by (simp add: assms(2))
[PROOF STATE]
proof (state)
this:
(p[[p\<^sup>T\<^sup>\<star>]]) * w \<le> - w

goal (1 subgoal):
 1. p[[w]] = w \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
w \<le> - w
[PROOF STEP]
have "w = bot"
[PROOF STATE]
proof (prove)
using this:
w \<le> - w

goal (1 subgoal):
 1. w = bot
[PROOF STEP]
using inf.orderE
[PROOF STATE]
proof (prove)
using this:
w \<le> - w
\<lbrakk>?a \<le> ?b; ?a = ?a \<sqinter> ?b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. w = bot
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
w = bot

goal (1 subgoal):
 1. p[[w]] = w \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
w = bot

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(1,3) le_bot
[PROOF STATE]
proof (prove)
using this:
w = bot
point w
w \<noteq> y
?a \<le> bot \<Longrightarrow> ?a = bot

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma croot_principal: assumes n: "n \<noteq> 0"
  and y: "y ^ n = x"
  and neq: "y \<noteq> croot n x"
shows "Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
 2. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
 2. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
with neq y
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> croot n x
y ^ n = x
x = 0
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
y \<noteq> croot n x
y ^ n = x
x = 0

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

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
 2. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
case x: False
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
let ?root = "croot n x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
have n1: "real n \<ge> 1" "real n > 0" "real n \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. 1 \<le> real n &&& 0 < real n &&& real n \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> real n
0 < real n
real n \<noteq> 0

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from x y n
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
y ^ n = x
n \<noteq> 0
[PROOF STEP]
have y0: "y \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0
y ^ n = x
n \<noteq> 0

goal (1 subgoal):
 1. y \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<noteq> 0

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from croot_power[OF n, of x] y
[PROOF STATE]
proof (chain)
picking this:
croot n x ^ n = x
y ^ n = x
[PROOF STEP]
have id: "?root ^ n = y ^ n"
[PROOF STATE]
proof (prove)
using this:
croot n x ^ n = x
y ^ n = x

goal (1 subgoal):
 1. croot n x ^ n = y ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
croot n x ^ n = y ^ n

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
hence "cmod (?root ^ n) = cmod (y ^ n)"
[PROOF STATE]
proof (prove)
using this:
croot n x ^ n = y ^ n

goal (1 subgoal):
 1. cmod (croot n x ^ n) = cmod (y ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (croot n x ^ n) = cmod (y ^ n)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
hence norm_eq: "cmod ?root = cmod y"
[PROOF STATE]
proof (prove)
using this:
cmod (croot n x ^ n) = cmod (y ^ n)

goal (1 subgoal):
 1. cmod (croot n x) = cmod y
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
cmod (croot n x ^ n) = cmod (y ^ n)
n \<noteq> 0

goal (1 subgoal):
 1. cmod (croot n x) = cmod y
[PROOF STEP]
unfolding norm_power
[PROOF STATE]
proof (prove)
using this:
cmod (croot n x) ^ n = cmod y ^ n
n \<noteq> 0

goal (1 subgoal):
 1. cmod (croot n x) = cmod y
[PROOF STEP]
by (meson gr_zeroI norm_ge_zero power_eq_imp_eq_base)
[PROOF STATE]
proof (state)
this:
cmod (croot n x) = cmod y

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "cis (Arg y * real n) = cis (Arg (y^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (Arg y * real n) = cis (Arg (y ^ n))
[PROOF STEP]
by (subst cis_Arg_power[OF y0], simp)
[PROOF STATE]
proof (state)
this:
cis (Arg y * real n) = cis (Arg (y ^ n))

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cis (Arg y * real n) = cis (Arg (y ^ n))

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "\<dots> = cis (Arg x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (Arg (y ^ n)) = cis (Arg x)
[PROOF STEP]
using y
[PROOF STATE]
proof (prove)
using this:
y ^ n = x

goal (1 subgoal):
 1. cis (Arg (y ^ n)) = cis (Arg x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cis (Arg (y ^ n)) = cis (Arg x)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cis (Arg y * real n) = cis (Arg x)
[PROOF STEP]
have ciseq: "cis (Arg y * real n) = cis (Arg x)"
[PROOF STATE]
proof (prove)
using this:
cis (Arg y * real n) = cis (Arg x)

goal (1 subgoal):
 1. cis (Arg y * real n) = cis (Arg x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cis (Arg y * real n) = cis (Arg x)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from cis_eq[OF ciseq]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xa. Arg y * real n - Arg x = 2 * real_of_int xa * pi
[PROOF STEP]
obtain i where
    "Arg y * real n - Arg x = 2 * real_of_int i * pi"
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. Arg y * real n - Arg x = 2 * real_of_int xa * pi

goal (1 subgoal):
 1. (\<And>i. Arg y * real n - Arg x = 2 * real_of_int i * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Arg y * real n - Arg x = 2 * real_of_int i * pi

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
hence "Arg y * real n = Arg x + 2 * real_of_int i * pi"
[PROOF STATE]
proof (prove)
using this:
Arg y * real n - Arg x = 2 * real_of_int i * pi

goal (1 subgoal):
 1. Arg y * real n = Arg x + 2 * real_of_int i * pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Arg y * real n = Arg x + 2 * real_of_int i * pi

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from arg_cong[OF this, of "\<lambda> x. x / real n"] n1
[PROOF STATE]
proof (chain)
picking this:
Arg y * real n / real n = (Arg x + 2 * real_of_int i * pi) / real n
1 \<le> real n
0 < real n
real n \<noteq> 0
[PROOF STEP]
have Argy: "Arg y = Arg ?root + 2 * real_of_int i * pi / real n"
[PROOF STATE]
proof (prove)
using this:
Arg y * real n / real n = (Arg x + 2 * real_of_int i * pi) / real n
1 \<le> real n
0 < real n
real n \<noteq> 0

goal (1 subgoal):
 1. Arg y = Arg (croot n x) + 2 * real_of_int i * pi / real n
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
Arg y = Arg (croot n x) + 2 * real_of_int i * pi / real n

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have i0: "i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i = 0 \<Longrightarrow> False
[PROOF STEP]
assume "i = 0"
[PROOF STATE]
proof (state)
this:
i = 0

goal (1 subgoal):
 1. i = 0 \<Longrightarrow> False
[PROOF STEP]
hence "Arg y = Arg ?root"
[PROOF STATE]
proof (prove)
using this:
i = 0

goal (1 subgoal):
 1. Arg y = Arg (croot n x)
[PROOF STEP]
unfolding Argy
[PROOF STATE]
proof (prove)
using this:
i = 0

goal (1 subgoal):
 1. Arg (croot n x) + 2 * real_of_int i * pi / real n = Arg (croot n x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Arg y = Arg (croot n x)

goal (1 subgoal):
 1. i = 0 \<Longrightarrow> False
[PROOF STEP]
with norm_eq
[PROOF STATE]
proof (chain)
picking this:
cmod (croot n x) = cmod y
Arg y = Arg (croot n x)
[PROOF STEP]
have "?root = y"
[PROOF STATE]
proof (prove)
using this:
cmod (croot n x) = cmod y
Arg y = Arg (croot n x)

goal (1 subgoal):
 1. croot n x = y
[PROOF STEP]
by (metis rcis_cmod_Arg)
[PROOF STATE]
proof (state)
this:
croot n x = y

goal (1 subgoal):
 1. i = 0 \<Longrightarrow> False
[PROOF STEP]
with neq
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> croot n x
croot n x = y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
y \<noteq> croot n x
croot n x = y

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:
i \<noteq> 0

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from y0
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> 0
[PROOF STEP]
have cy0: "cmod y > 0"
[PROOF STATE]
proof (prove)
using this:
y \<noteq> 0

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

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from Arg_bounded[of x]
[PROOF STATE]
proof (chain)
picking this:
- pi < Arg x \<and> Arg x \<le> pi
[PROOF STEP]
have abs_pi: "abs (Arg x) \<le> pi"
[PROOF STATE]
proof (prove)
using this:
- pi < Arg x \<and> Arg x \<le> pi

goal (1 subgoal):
 1. \<bar>Arg x\<bar> \<le> pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>Arg x\<bar> \<le> pi

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "Re y \<le> Re ?root \<longleftrightarrow> Re y / cmod y \<le> Re ?root / cmod y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re y \<le> Re (croot n x)) = (Re y / cmod y \<le> Re (croot n x) / cmod y)
[PROOF STEP]
using cy0
[PROOF STATE]
proof (prove)
using this:
0 < cmod y

goal (1 subgoal):
 1. (Re y \<le> Re (croot n x)) = (Re y / cmod y \<le> Re (croot n x) / cmod y)
[PROOF STEP]
unfolding divide_le_cancel
[PROOF STATE]
proof (prove)
using this:
0 < cmod y

goal (1 subgoal):
 1. (Re y \<le> Re (croot n x)) = ((0 < cmod y \<longrightarrow> Re y \<le> Re (croot n x)) \<and> (cmod y < 0 \<longrightarrow> Re (croot n x) \<le> Re y))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(Re y \<le> Re (croot n x)) = (Re y / cmod y \<le> Re (croot n x) / cmod y)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(Re y \<le> Re (croot n x)) = (Re y / cmod y \<le> Re (croot n x) / cmod y)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have cosy: "Re y / cmod y = cos (Arg y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re y / cmod y = cos (Arg y)
[PROOF STEP]
unfolding cos_arg[OF y0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re y / cmod y = Re y / cmod y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Re y / cmod y = cos (Arg y)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re y / cmod y = cos (Arg y)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have cosrt: "Re ?root / cmod y = cos (Arg ?root)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (croot n x) / cmod y = cos (Arg (croot n x))
[PROOF STEP]
unfolding norm_eq[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (croot n x) / cmod (croot n x) = cos (Arg (croot n x))
[PROOF STEP]
by (subst cos_arg, insert norm_eq cy0, auto)
[PROOF STATE]
proof (state)
this:
Re (croot n x) / cmod y = cos (Arg (croot n x))

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re (croot n x) / cmod y = cos (Arg (croot n x))

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "cos (Arg y) \<le> cos (Arg ?root) \<longleftrightarrow> abs (Arg ?root) \<le> abs (Arg y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos (Arg y) \<le> cos (Arg (croot n x))) = (\<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>)
[PROOF STEP]
by (rule cos_mono_le, insert Arg_bounded[of y] Arg_bounded[of ?root], auto)
[PROOF STATE]
proof (state)
this:
(cos (Arg y) \<le> cos (Arg (croot n x))) = (\<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(cos (Arg y) \<le> cos (Arg (croot n x))) = (\<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> abs (Arg ?root) * real n \<le> abs (Arg y) * real n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>) = (\<bar>Arg (croot n x)\<bar> * real n \<le> \<bar>Arg y\<bar> * real n)
[PROOF STEP]
unfolding mult_le_cancel_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>) = ((0 < real n \<longrightarrow> \<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>) \<and> (real n < 0 \<longrightarrow> \<bar>Arg y\<bar> \<le> \<bar>Arg (croot n x)\<bar>))
[PROOF STEP]
using n1
[PROOF STATE]
proof (prove)
using this:
1 \<le> real n
0 < real n
real n \<noteq> 0

goal (1 subgoal):
 1. (\<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>) = ((0 < real n \<longrightarrow> \<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>) \<and> (real n < 0 \<longrightarrow> \<bar>Arg y\<bar> \<le> \<bar>Arg (croot n x)\<bar>))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>) = (\<bar>Arg (croot n x)\<bar> * real n \<le> \<bar>Arg y\<bar> * real n)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<bar>Arg (croot n x)\<bar> \<le> \<bar>Arg y\<bar>) = (\<bar>Arg (croot n x)\<bar> * real n \<le> \<bar>Arg y\<bar> * real n)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> abs (Arg x) \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>Arg (croot n x)\<bar> * real n \<le> \<bar>Arg y\<bar> * real n) = (\<bar>Arg x\<bar> \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>)
[PROOF STEP]
unfolding Argy
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>Arg (croot n x)\<bar> * real n \<le> \<bar>Arg (croot n x) + 2 * real_of_int i * pi / real n\<bar> * real n) = (\<bar>Arg x\<bar> \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>)
[PROOF STEP]
using n1
[PROOF STATE]
proof (prove)
using this:
1 \<le> real n
0 < real n
real n \<noteq> 0

goal (1 subgoal):
 1. (\<bar>Arg (croot n x)\<bar> * real n \<le> \<bar>Arg (croot n x) + 2 * real_of_int i * pi / real n\<bar> * real n) = (\<bar>Arg x\<bar> \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(\<bar>Arg (croot n x)\<bar> * real n \<le> \<bar>Arg y\<bar> * real n) = (\<bar>Arg x\<bar> \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<bar>Arg (croot n x)\<bar> * real n \<le> \<bar>Arg y\<bar> * real n) = (\<bar>Arg x\<bar> \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "\<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Arg x\<bar> \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>
[PROOF STEP]
using abs_pi
[PROOF STATE]
proof (prove)
using this:
\<bar>Arg x\<bar> \<le> pi

goal (1 subgoal):
 1. \<bar>Arg x\<bar> \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>
[PROOF STEP]
by (rule abs_add_2_mult_bound)
[PROOF STATE]
proof (state)
this:
\<bar>Arg x\<bar> \<le> \<bar>Arg x + 2 * real_of_int i * pi\<bar>

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Re y \<le> Re (croot n x)
[PROOF STEP]
have le: "Re y \<le> Re (croot n x)"
[PROOF STATE]
proof (prove)
using this:
Re y \<le> Re (croot n x)

goal (1 subgoal):
 1. Re y \<le> Re (croot n x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Re y \<le> Re (croot n x)

goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
proof (cases "Re y = Re (croot n x)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
 2. Re y \<noteq> Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Re y \<noteq> Re (croot n x)

goal (2 subgoals):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
 2. Re y \<noteq> Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
with le
[PROOF STATE]
proof (chain)
picking this:
Re y \<le> Re (croot n x)
Re y \<noteq> Re (croot n x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re y \<le> Re (croot n x)
Re y \<noteq> Re (croot n x)

goal (1 subgoal):
 1. Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Re y = Re (croot n x)

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
hence "Re y / cmod y = Re ?root / cmod y"
[PROOF STATE]
proof (prove)
using this:
Re y = Re (croot n x)

goal (1 subgoal):
 1. Re y / cmod y = Re (croot n x) / cmod y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Re y / cmod y = Re (croot n x) / cmod y

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
hence "cos (Arg y) = cos (Arg ?root)"
[PROOF STATE]
proof (prove)
using this:
Re y / cmod y = Re (croot n x) / cmod y

goal (1 subgoal):
 1. cos (Arg y) = cos (Arg (croot n x))
[PROOF STEP]
unfolding cosy cosrt
[PROOF STATE]
proof (prove)
using this:
cos (Arg y) = cos (Arg (croot n x))

goal (1 subgoal):
 1. cos (Arg y) = cos (Arg (croot n x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cos (Arg y) = cos (Arg (croot n x))

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
hence "cos (abs (Arg y)) = cos (abs (Arg ?root))"
[PROOF STATE]
proof (prove)
using this:
cos (Arg y) = cos (Arg (croot n x))

goal (1 subgoal):
 1. cos \<bar>Arg y\<bar> = cos \<bar>Arg (croot n x)\<bar>
[PROOF STEP]
unfolding cos_abs
[PROOF STATE]
proof (prove)
using this:
cos (Arg y) = cos (Arg (croot n x))

goal (1 subgoal):
 1. cos (Arg y) = cos (Arg (croot n x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cos \<bar>Arg y\<bar> = cos \<bar>Arg (croot n x)\<bar>

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from cos_inj_pi[OF _ _ _ _ this]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 \<le> \<bar>Arg y\<bar>; \<bar>Arg y\<bar> \<le> pi; 0 \<le> \<bar>Arg (croot n x)\<bar>; \<bar>Arg (croot n x)\<bar> \<le> pi\<rbrakk> \<Longrightarrow> \<bar>Arg y\<bar> = \<bar>Arg (croot n x)\<bar>
[PROOF STEP]
have "abs (Arg y) = abs (Arg ?root)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> \<bar>Arg y\<bar>; \<bar>Arg y\<bar> \<le> pi; 0 \<le> \<bar>Arg (croot n x)\<bar>; \<bar>Arg (croot n x)\<bar> \<le> pi\<rbrakk> \<Longrightarrow> \<bar>Arg y\<bar> = \<bar>Arg (croot n x)\<bar>

goal (1 subgoal):
 1. \<bar>Arg y\<bar> = \<bar>Arg (croot n x)\<bar>
[PROOF STEP]
using Arg_bounded[of y] Arg_bounded[of ?root]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> \<bar>Arg y\<bar>; \<bar>Arg y\<bar> \<le> pi; 0 \<le> \<bar>Arg (croot n x)\<bar>; \<bar>Arg (croot n x)\<bar> \<le> pi\<rbrakk> \<Longrightarrow> \<bar>Arg y\<bar> = \<bar>Arg (croot n x)\<bar>
- pi < Arg y \<and> Arg y \<le> pi
- pi < Arg (croot n x) \<and> Arg (croot n x) \<le> pi

goal (1 subgoal):
 1. \<bar>Arg y\<bar> = \<bar>Arg (croot n x)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>Arg y\<bar> = \<bar>Arg (croot n x)\<bar>

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
hence "abs (Arg y) * real n = abs (Arg ?root) * real n"
[PROOF STATE]
proof (prove)
using this:
\<bar>Arg y\<bar> = \<bar>Arg (croot n x)\<bar>

goal (1 subgoal):
 1. \<bar>Arg y\<bar> * real n = \<bar>Arg (croot n x)\<bar> * real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>Arg y\<bar> * real n = \<bar>Arg (croot n x)\<bar> * real n

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
hence "abs (Arg x) = \<bar>Arg x + 2 * real_of_int i * pi\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>Arg y\<bar> * real n = \<bar>Arg (croot n x)\<bar> * real n

goal (1 subgoal):
 1. \<bar>Arg x\<bar> = \<bar>Arg x + 2 * real_of_int i * pi\<bar>
[PROOF STEP]
unfolding Argy
[PROOF STATE]
proof (prove)
using this:
\<bar>Arg (croot n x) + 2 * real_of_int i * pi / real n\<bar> * real n = \<bar>Arg (croot n x)\<bar> * real n

goal (1 subgoal):
 1. \<bar>Arg x\<bar> = \<bar>Arg x + 2 * real_of_int i * pi\<bar>
[PROOF STEP]
using n1
[PROOF STATE]
proof (prove)
using this:
\<bar>Arg (croot n x) + 2 * real_of_int i * pi / real n\<bar> * real n = \<bar>Arg (croot n x)\<bar> * real n
1 \<le> real n
0 < real n
real n \<noteq> 0

goal (1 subgoal):
 1. \<bar>Arg x\<bar> = \<bar>Arg x + 2 * real_of_int i * pi\<bar>
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<bar>Arg x\<bar> = \<bar>Arg x + 2 * real_of_int i * pi\<bar>

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
from abs_eq_add_2_mult[OF this _ _ \<open>i \<noteq> 0\<close>] Arg_bounded[of x]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>- pi < Arg x; Arg x \<le> pi\<rbrakk> \<Longrightarrow> Arg x = pi \<and> i = - 1
- pi < Arg x \<and> Arg x \<le> pi
[PROOF STEP]
have Argx: "Arg x = pi" and i: "i = -1"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- pi < Arg x; Arg x \<le> pi\<rbrakk> \<Longrightarrow> Arg x = pi \<and> i = - 1
- pi < Arg x \<and> Arg x \<le> pi

goal (1 subgoal):
 1. Arg x = pi &&& i = - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Arg x = pi
i = - 1

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have Argy: "Arg y = -pi / real n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg y = - pi / real n
[PROOF STEP]
unfolding Argy Arg_croot i Argx
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi / real n + 2 * real_of_int (- 1) * pi / real n = - pi / real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Arg y = - pi / real n

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "Im ?root > Im y \<longleftrightarrow> Im ?root / cmod ?root > Im y / cmod y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im y < Im (croot n x)) = (Im y / cmod y < Im (croot n x) / cmod (croot n x))
[PROOF STEP]
unfolding norm_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im y < Im (croot n x)) = (Im y / cmod y < Im (croot n x) / cmod y)
[PROOF STEP]
using cy0
[PROOF STATE]
proof (prove)
using this:
0 < cmod y

goal (1 subgoal):
 1. (Im y < Im (croot n x)) = (Im y / cmod y < Im (croot n x) / cmod y)
[PROOF STEP]
by (meson divide_less_cancel divide_strict_right_mono)
[PROOF STATE]
proof (state)
this:
(Im y < Im (croot n x)) = (Im y / cmod y < Im (croot n x) / cmod (croot n x))

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(Im y < Im (croot n x)) = (Im y / cmod y < Im (croot n x) / cmod (croot n x))

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> sin (Arg ?root) > sin (Arg y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im y / cmod y < Im (croot n x) / cmod (croot n x)) = (sin (Arg y) < sin (Arg (croot n x)))
[PROOF STEP]
by (subst (1 2) sin_arg, insert y0 norm_eq, auto)
[PROOF STATE]
proof (state)
this:
(Im y / cmod y < Im (croot n x) / cmod (croot n x)) = (sin (Arg y) < sin (Arg (croot n x)))

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(Im y / cmod y < Im (croot n x) / cmod (croot n x)) = (sin (Arg y) < sin (Arg (croot n x)))

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> sin (- pi / real n) < sin (pi / real n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin (Arg y) < sin (Arg (croot n x))) = (sin (- pi / real n) < sin (pi / real n))
[PROOF STEP]
unfolding Argy Arg_croot Argx
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin (- pi / real n) < sin (pi / real n)) = (sin (- pi / real n) < sin (pi / real n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(sin (Arg y) < sin (Arg (croot n x))) = (sin (- pi / real n) < sin (pi / real n))

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(sin (Arg y) < sin (Arg (croot n x))) = (sin (- pi / real n) < sin (pi / real n))

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
have \<dots>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (- pi / real n) < sin (pi / real n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sin (- pi / real n) < sin (pi / real n)
[PROOF STEP]
have "sin (- pi / real n) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (- pi / real n) < 0
[PROOF STEP]
using n1
[PROOF STATE]
proof (prove)
using this:
1 \<le> real n
0 < real n
real n \<noteq> 0

goal (1 subgoal):
 1. sin (- pi / real n) < 0
[PROOF STEP]
by (smt (verit) Arg_bounded Argy divide_neg_pos sin_gt_zero sin_minus)
[PROOF STATE]
proof (state)
this:
sin (- pi / real n) < 0

goal (1 subgoal):
 1. sin (- pi / real n) < sin (pi / real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sin (- pi / real n) < 0

goal (1 subgoal):
 1. sin (- pi / real n) < sin (pi / real n)
[PROOF STEP]
have "\<dots> < sin (pi / real n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sin (pi / real n)
[PROOF STEP]
using n1 calculation
[PROOF STATE]
proof (prove)
using this:
1 \<le> real n
0 < real n
real n \<noteq> 0
sin (- pi / real n) < 0

goal (1 subgoal):
 1. 0 < sin (pi / real n)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < sin (pi / real n)

goal (1 subgoal):
 1. sin (- pi / real n) < sin (pi / real n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sin (- pi / real n) < sin (pi / real n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sin (- pi / real n) < sin (pi / real n)

goal (1 subgoal):
 1. sin (- pi / real n) < sin (pi / real n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sin (- pi / real n) < sin (pi / real n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sin (- pi / real n) < sin (pi / real n)

goal (1 subgoal):
 1. Re y = Re (croot n x) \<Longrightarrow> Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Im y < Im (croot n x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im y < Im (croot n x)

goal (1 subgoal):
 1. Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
using le
[PROOF STATE]
proof (prove)
using this:
Im y < Im (croot n x)
Re y \<le> Re (croot n x)

goal (1 subgoal):
 1. Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re y < Re (croot n x) \<or> Re y = Re (croot n x) \<and> Im y < Im (croot n x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subtree_antisym: "\<lbrakk>is_subtree t1 t2; is_subtree t2 t1\<rbrakk> \<Longrightarrow> t1 = t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_subtree t1 t2; is_subtree t2 t1\<rbrakk> \<Longrightarrow> t1 = t2
[PROOF STEP]
using subtree_size_le subtree_size_decr
[PROOF STATE]
proof (prove)
using this:
is_subtree ?t1.0 ?t2.0 \<Longrightarrow> size ?t1.0 \<le> size ?t2.0
\<lbrakk>is_subtree ?t1.0 ?t2.0; ?t1.0 \<noteq> ?t2.0\<rbrakk> \<Longrightarrow> size ?t1.0 < size ?t2.0

goal (1 subgoal):
 1. \<lbrakk>is_subtree t1 t2; is_subtree t2 t1\<rbrakk> \<Longrightarrow> t1 = t2
[PROOF STEP]
by fastforce


[STATEMENT]
lemma supto_split3: \<comment>\<open>From \<open>HOL.List\<close>\<close>
  assumes "i \<le> j"
  assumes "j \<le> k"
  shows "supto\<cdot>(MkI\<cdot>i)\<cdot>(MkI\<cdot>k) = supto\<cdot>(MkI\<cdot>i)\<cdot>(MkI\<cdot>(j - 1)) :@ MkI\<cdot>j :# supto\<cdot>(MkI\<cdot>(j + 1))\<cdot>(MkI\<cdot>k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supto\<cdot>(MkI\<cdot>i)\<cdot>(MkI\<cdot>k) = supto\<cdot>(MkI\<cdot>i)\<cdot>(MkI\<cdot>(j - 1)) :@ MkI\<cdot>j :# supto\<cdot>(MkI\<cdot>(j + 1))\<cdot>(MkI\<cdot>k)
[PROOF STEP]
using assms supto_simp(2) supto_split1
[PROOF STATE]
proof (prove)
using this:
i \<le> j
j \<le> k
?i \<le> ?j \<Longrightarrow> supto\<cdot>(MkI\<cdot>?i)\<cdot>(MkI\<cdot>?j) = MkI\<cdot>?i :# supto\<cdot>(MkI\<cdot>?i + 1)\<cdot>(MkI\<cdot>?j)
\<lbrakk>?i \<le> ?j; ?j \<le> ?k\<rbrakk> \<Longrightarrow> supto\<cdot>(MkI\<cdot>?i)\<cdot>(MkI\<cdot>?k) = supto\<cdot>(MkI\<cdot>?i)\<cdot>(MkI\<cdot>(?j - 1)) :@ supto\<cdot>(MkI\<cdot>?j)\<cdot>(MkI\<cdot>?k)

goal (1 subgoal):
 1. supto\<cdot>(MkI\<cdot>i)\<cdot>(MkI\<cdot>k) = supto\<cdot>(MkI\<cdot>i)\<cdot>(MkI\<cdot>(j - 1)) :@ MkI\<cdot>j :# supto\<cdot>(MkI\<cdot>(j + 1))\<cdot>(MkI\<cdot>k)
[PROOF STEP]
by (metis one_Integer_def plus_MkI_MkI)


[STATEMENT]
lemma X_minus_closed:
  assumes "a \<in> carrier R"
  shows "(X_minus a) \<in> carrier P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X_poly_minus R a \<in> carrier P
[PROOF STEP]
unfolding X_poly_minus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X_poly R \<ominus>\<^bsub>UP R\<^esub> to_polynomial R a \<in> carrier P
[PROOF STEP]
using X_closed to_poly_closed
[PROOF STATE]
proof (prove)
using this:
X_poly R \<in> carrier P
?a \<in> carrier R \<Longrightarrow> to_polynomial R ?a \<in> carrier P

goal (1 subgoal):
 1. X_poly R \<ominus>\<^bsub>UP R\<^esub> to_polynomial R a \<in> carrier P
[PROOF STEP]
by (simp add: P_def UP_cring.UP_cring UP_cring_axioms assms cring.cring_simprules(4))


[STATEMENT]
lemma snd_o_Pair_conv_id: "snd o Pair a = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd \<circ> Pair a = id
[PROOF STEP]
by(simp add: o_def id_def)


[STATEMENT]
lemma degree_map_poly:
  assumes "\<And>x. x \<noteq> 0 \<Longrightarrow> f x \<noteq> 0"
  shows "degree (map_poly f p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly f p) = degree p
[PROOF STEP]
by (simp add: degree_eq_length_coeffs coeffs_map_poly' assms)


[STATEMENT]
lemma (in group) subgroup_of_powers:
  "x \<in> carrier G \<Longrightarrow> subgroup (range (\<lambda>n::int. x [^] n)) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> subgroup (range (([^]) x)) G
[PROOF STEP]
apply (auto simp: subgroup_def image_iff simp flip: int_pow_mult int_pow_neg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> \<exists>xa. \<one> = x [^] xa
[PROOF STEP]
apply (metis group.int_pow_diff int_pow_closed is_group r_inv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma matrix_vector_mul_bounded_linear[intro, simp]: "bounded_linear ((*v) A)" for A :: "'a::{euclidean_space,real_algebra_1}^'n^'m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear ((*v) A)
[PROOF STEP]
using matrix_vector_mul_linear[of A]
[PROOF STATE]
proof (prove)
using this:
linear ((*v) A)

goal (1 subgoal):
 1. bounded_linear ((*v) A)
[PROOF STEP]
by (simp add: linear_conv_bounded_linear linear_matrix_vector_mul_eq)


[STATEMENT]
lemma to_list_dtree_wf_dverts: "wf_dverts to_list_dtree"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_dverts to_list_dtree
[PROOF STEP]
using finite_directed_tree.wf_dverts_to_dtree[OF to_list_tree_finite_directed_tree]
[PROOF STATE]
proof (prove)
using this:
wf_dverts (finite_directed_tree.to_dtree to_list_tree [root])

goal (1 subgoal):
 1. wf_dverts to_list_dtree
[PROOF STEP]
by(simp add: to_list_dtree_def)


[STATEMENT]
lemma lfinite_Liminf_llist: "lfinite Xs \<Longrightarrow> Liminf_llist Xs = (if lnull Xs then {} else llast Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfinite Xs \<Longrightarrow> Liminf_llist Xs = (if lnull Xs then {} else llast Xs)
[PROOF STEP]
proof (induction rule: lfinite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. lnull xs \<Longrightarrow> Liminf_llist xs = (if lnull xs then {} else llast xs)
 2. \<And>xs. \<lbrakk>lfinite xs; \<not> lnull xs; Liminf_llist (ltl xs) = (if lnull (ltl xs) then {} else llast (ltl xs))\<rbrakk> \<Longrightarrow> Liminf_llist xs = (if lnull xs then {} else llast xs)
[PROOF STEP]
case (LCons xs)
[PROOF STATE]
proof (state)
this:
lfinite xs
\<not> lnull xs
Liminf_llist (ltl xs) = (if lnull (ltl xs) then {} else llast (ltl xs))

goal (2 subgoals):
 1. \<And>xs. lnull xs \<Longrightarrow> Liminf_llist xs = (if lnull xs then {} else llast xs)
 2. \<And>xs. \<lbrakk>lfinite xs; \<not> lnull xs; Liminf_llist (ltl xs) = (if lnull (ltl xs) then {} else llast (ltl xs))\<rbrakk> \<Longrightarrow> Liminf_llist xs = (if lnull xs then {} else llast xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lfinite xs
\<not> lnull xs
Liminf_llist (ltl xs) = (if lnull (ltl xs) then {} else llast (ltl xs))
[PROOF STEP]
obtain y ys where
    xs: "xs = LCons y ys"
[PROOF STATE]
proof (prove)
using this:
lfinite xs
\<not> lnull xs
Liminf_llist (ltl xs) = (if lnull (ltl xs) then {} else llast (ltl xs))

goal (1 subgoal):
 1. (\<And>y ys. xs = LCons y ys \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson not_lnull_conv)
[PROOF STATE]
proof (state)
this:
xs = LCons y ys

goal (2 subgoals):
 1. \<And>xs. lnull xs \<Longrightarrow> Liminf_llist xs = (if lnull xs then {} else llast xs)
 2. \<And>xs. \<lbrakk>lfinite xs; \<not> lnull xs; Liminf_llist (ltl xs) = (if lnull (ltl xs) then {} else llast (ltl xs))\<rbrakk> \<Longrightarrow> Liminf_llist xs = (if lnull xs then {} else llast xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Liminf_llist xs = (if lnull xs then {} else llast xs)
[PROOF STEP]
unfolding xs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Liminf_llist (LCons y ys) = (if lnull (LCons y ys) then {} else llast (LCons y ys))
[PROOF STEP]
by (simp add: Liminf_llist_LCons LCons.IH[unfolded xs, simplified] llast_LCons)
[PROOF STATE]
proof (state)
this:
Liminf_llist xs = (if lnull xs then {} else llast xs)

goal (1 subgoal):
 1. \<And>xs. lnull xs \<Longrightarrow> Liminf_llist xs = (if lnull xs then {} else llast xs)
[PROOF STEP]
qed (simp add: Liminf_llist_def)


[STATEMENT]
lemma dual_inf: "(x \<sqinter> y) ^ o = (x ^ o) \<squnion> (y ^ o)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqinter> y) ^ o = x ^ o \<squnion> y ^ o
[PROOF STEP]
apply (rule order.antisym, simp_all, safe)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (x \<sqinter> y) ^ o \<le> x ^ o \<squnion> y ^ o
 2. x ^ o \<le> (x \<sqinter> y) ^ o
 3. y ^ o \<le> (x \<sqinter> y) ^ o
[PROOF STEP]
apply (subst dual_le, simp, safe)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. (x ^ o \<squnion> y ^ o) ^ o \<le> x
 2. (x ^ o \<squnion> y ^ o) ^ o \<le> y
 3. x ^ o \<le> (x \<sqinter> y) ^ o
 4. y ^ o \<le> (x \<sqinter> y) ^ o
[PROOF STEP]
apply (subst dual_le, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (x ^ o \<squnion> y ^ o) ^ o \<le> y
 2. x ^ o \<le> (x \<sqinter> y) ^ o
 3. y ^ o \<le> (x \<sqinter> y) ^ o
[PROOF STEP]
apply (subst dual_le, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x ^ o \<le> (x \<sqinter> y) ^ o
 2. y ^ o \<le> (x \<sqinter> y) ^ o
[PROOF STEP]
apply (subst dual_le, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y ^ o \<le> (x \<sqinter> y) ^ o
[PROOF STEP]
by (subst dual_le, simp)


[STATEMENT]
lemma finite_cspan_crepresentation_bounded:
  fixes B :: "'a::complex_normed_vector set"
  assumes a1: "finite B" and a2: "cindependent B"
  shows "\<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
define B' where "B' = (B \<union> scaleC \<i> ` B)"
[PROOF STATE]
proof (state)
this:
B' = B \<union> (*\<^sub>C) \<i> ` B

goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have independent_B': "independent B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent B'
[PROOF STEP]
using B'_def \<open>cindependent B\<close>
[PROOF STATE]
proof (prove)
using this:
B' = B \<union> (*\<^sub>C) \<i> ` B
cindependent B

goal (1 subgoal):
 1. independent B'
[PROOF STEP]
by (simp add: real_independent_from_complex_independent a1)
[PROOF STATE]
proof (state)
this:
independent B'

goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "finite B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B'
[PROOF STEP]
unfolding B'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (B \<union> (*\<^sub>C) \<i> ` B)
[PROOF STEP]
using \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite B

goal (1 subgoal):
 1. finite (B \<union> (*\<^sub>C) \<i> ` B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite B'

goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
obtain D' where "D' > 0" and D': "norm (real_vector.representation B' \<psi> b) \<le> norm \<psi> * D'"
    for \<psi> b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>D'. \<lbrakk>0 < D'; \<And>\<psi> b. norm (representation B' \<psi> b) \<le> norm \<psi> * D'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply atomize_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>D'>0. \<forall>\<psi> b. norm (representation B' \<psi> b) \<le> norm \<psi> * D'
[PROOF STEP]
using independent_B' \<open>finite B'\<close>
[PROOF STATE]
proof (prove)
using this:
independent B'
finite B'

goal (1 subgoal):
 1. \<exists>D'>0. \<forall>\<psi> b. norm (representation B' \<psi> b) \<le> norm \<psi> * D'
[PROOF STEP]
by (simp add: finite_span_representation_bounded)
[PROOF STATE]
proof (state)
this:
0 < D'
norm (representation B' ?\<psi> ?b) \<le> norm ?\<psi> * D'

goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
define D where "D = 2*D'"
[PROOF STATE]
proof (state)
this:
D = 2 * D'

goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
from \<open>D' > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < D'
[PROOF STEP]
have \<open>D > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < D'

goal (1 subgoal):
 1. 0 < D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
using this:
0 < D'

goal (1 subgoal):
 1. 0 < 2 * D'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < D

goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "norm (crepresentation B \<psi> b) \<le> norm \<psi> * D" for \<psi> b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
proof (cases "b\<in>B")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b \<in> B

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have d3: "norm \<i> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod \<i> = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod \<i> = 1

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "norm (\<i> *\<^sub>C complex_of_real (real_vector.representation B' \<psi> (\<i> *\<^sub>C b)))
          = norm \<i> * norm (complex_of_real (real_vector.representation B' \<psi> (\<i> *\<^sub>C b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod \<i> * cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
using norm_scaleC
[PROOF STATE]
proof (prove)
using this:
norm (?a *\<^sub>C ?x) = cmod ?a * norm ?x

goal (1 subgoal):
 1. cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod \<i> * cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod \<i> * cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod \<i> * cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "\<dots> = norm (complex_of_real (real_vector.representation B' \<psi> (\<i> *\<^sub>C b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod \<i> * cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
using d3
[PROOF STATE]
proof (prove)
using this:
cmod \<i> = 1

goal (1 subgoal):
 1. cmod \<i> * cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod \<i> * cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
have d2:"norm (\<i> *\<^sub>C complex_of_real (real_vector.representation B' \<psi> (\<i> *\<^sub>C b)))
          = norm (complex_of_real (real_vector.representation B' \<psi> (\<i> *\<^sub>C b)))"
[PROOF STATE]
proof (prove)
using this:
cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (1 subgoal):
 1. cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "norm (crepresentation B \<psi> b)
        = norm (complex_of_real (real_vector.representation B' \<psi> b)
            + \<i> *\<^sub>C complex_of_real (real_vector.representation B' \<psi> (\<i> *\<^sub>C b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (crepresentation B \<psi> b) = cmod (complex_of_real (representation B' \<psi> b) + \<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
by (simp add: B'_def True a1 a2 crepresentation_from_representation)
[PROOF STATE]
proof (state)
this:
cmod (crepresentation B \<psi> b) = cmod (complex_of_real (representation B' \<psi> b) + \<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (crepresentation B \<psi> b) = cmod (complex_of_real (representation B' \<psi> b) + \<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "\<dots> \<le> norm (complex_of_real (real_vector.representation B' \<psi> b))
             + norm (\<i> *\<^sub>C complex_of_real (real_vector.representation B' \<psi> (\<i> *\<^sub>C b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real (representation B' \<psi> b) + \<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) \<le> cmod (complex_of_real (representation B' \<psi> b)) + cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
using norm_triangle_ineq
[PROOF STATE]
proof (prove)
using this:
norm (?x + ?y) \<le> norm ?x + norm ?y

goal (1 subgoal):
 1. cmod (complex_of_real (representation B' \<psi> b) + \<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) \<le> cmod (complex_of_real (representation B' \<psi> b)) + cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (representation B' \<psi> b) + \<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) \<le> cmod (complex_of_real (representation B' \<psi> b)) + cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (representation B' \<psi> b) + \<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) \<le> cmod (complex_of_real (representation B' \<psi> b)) + cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "\<dots> = norm (complex_of_real (real_vector.representation B' \<psi> b))
                  + norm (complex_of_real (real_vector.representation B' \<psi> (\<i> *\<^sub>C b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real (representation B' \<psi> b)) + cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> b)) + cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
using d2
[PROOF STATE]
proof (prove)
using this:
cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (1 subgoal):
 1. cmod (complex_of_real (representation B' \<psi> b)) + cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> b)) + cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (representation B' \<psi> b)) + cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> b)) + cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (representation B' \<psi> b)) + cmod (\<i> *\<^sub>C complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = cmod (complex_of_real (representation B' \<psi> b)) + cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b)))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "\<dots> = norm (real_vector.representation B' \<psi> b)
                  + norm (real_vector.representation B' \<psi> (\<i> *\<^sub>C b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real (representation B' \<psi> b)) + cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = norm (representation B' \<psi> b) + norm (representation B' \<psi> (\<i> *\<^sub>C b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (representation B' \<psi> b)) + cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = norm (representation B' \<psi> b) + norm (representation B' \<psi> (\<i> *\<^sub>C b))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (representation B' \<psi> b)) + cmod (complex_of_real (representation B' \<psi> (\<i> *\<^sub>C b))) = norm (representation B' \<psi> b) + norm (representation B' \<psi> (\<i> *\<^sub>C b))

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "\<dots> \<le> norm \<psi> * D' + norm \<psi> * D'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (representation B' \<psi> b) + norm (representation B' \<psi> (\<i> *\<^sub>C b)) \<le> norm \<psi> * D' + norm \<psi> * D'
[PROOF STEP]
by (rule add_mono; rule D')
[PROOF STATE]
proof (state)
this:
norm (representation B' \<psi> b) + norm (representation B' \<psi> (\<i> *\<^sub>C b)) \<le> norm \<psi> * D' + norm \<psi> * D'

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (representation B' \<psi> b) + norm (representation B' \<psi> (\<i> *\<^sub>C b)) \<le> norm \<psi> * D' + norm \<psi> * D'

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
have "\<dots> \<le> norm \<psi> * D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm \<psi> * D' + norm \<psi> * D' \<le> norm \<psi> * D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm \<psi> * D' + norm \<psi> * D' \<le> norm \<psi> * (2 * D')
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
norm \<psi> * D' + norm \<psi> * D' \<le> norm \<psi> * D

goal (2 subgoals):
 1. b \<in> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
 2. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D

goal (1 subgoal):
 1. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D

goal (1 subgoal):
 1. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
b \<notin> B

goal (1 subgoal):
 1. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
hence "crepresentation B \<psi> b = 0"
[PROOF STATE]
proof (prove)
using this:
b \<notin> B

goal (1 subgoal):
 1. crepresentation B \<psi> b = 0
[PROOF STEP]
using complex_vector.representation_ne_zero
[PROOF STATE]
proof (prove)
using this:
b \<notin> B
crepresentation ?basis ?v ?b \<noteq> 0 \<Longrightarrow> ?b \<in> ?basis

goal (1 subgoal):
 1. crepresentation B \<psi> b = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
crepresentation B \<psi> b = 0

goal (1 subgoal):
 1. b \<notin> B \<Longrightarrow> cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
crepresentation B \<psi> b = 0

goal (1 subgoal):
 1. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
by (smt \<open>0 < D\<close> norm_ge_zero norm_zero split_mult_pos_le)
[PROOF STATE]
proof (state)
this:
cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cmod (crepresentation B ?\<psi> ?b) \<le> norm ?\<psi> * D

goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
with \<open>D > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < D
cmod (crepresentation B ?\<psi> ?b) \<le> norm ?\<psi> * D
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < D
cmod (crepresentation B ?\<psi> ?b) \<le> norm ?\<psi> * D

goal (1 subgoal):
 1. \<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>D>0. \<forall>\<psi> b. cmod (crepresentation B \<psi> b) \<le> norm \<psi> * D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_witness_option1:
  assumes "rel_option A x y"
  shows "rel_option (\<lambda>a (a', b). a = a' \<and> A a' b) x (rel_witness_option (x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option (\<lambda>a (a', b). a = a' \<and> A a' b) x (rel_witness_option (x, y))
[PROOF STEP]
using map1_rel_witness_option[OF assms, symmetric]
[PROOF STATE]
proof (prove)
using this:
x = map_option fst (rel_witness_option (x, y))

goal (1 subgoal):
 1. rel_option (\<lambda>a (a', b). a = a' \<and> A a' b) x (rel_witness_option (x, y))
[PROOF STEP]
unfolding option.rel_eq[symmetric] option.rel_map
[PROOF STATE]
proof (prove)
using this:
rel_option (\<lambda>x y. x = fst y) x (rel_witness_option (x, y))

goal (1 subgoal):
 1. rel_option (\<lambda>a (a', b). a = a' \<and> A a' b) x (rel_witness_option (x, y))
[PROOF STEP]
by(rule option.rel_mono_strong)(auto intro: set_rel_witness_option[OF assms])


[STATEMENT]
lemma range_to_fract_dvd_iff: assumes b: "b \<noteq> 0"
  shows "Fract a b \<in> range to_fract \<longleftrightarrow> b dvd a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Fraction_Field.Fract a b \<in> range to_fract) = (b dvd a)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> Fraction_Field.Fract a b \<in> range to_fract
[PROOF STEP]
assume "b dvd a"
[PROOF STATE]
proof (state)
this:
b dvd a

goal (2 subgoals):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> Fraction_Field.Fract a b \<in> range to_fract
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b dvd a
[PROOF STEP]
obtain c where a: "a = b * c"
[PROOF STATE]
proof (prove)
using this:
b dvd a

goal (1 subgoal):
 1. (\<And>c. a = b * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. a = b * k

goal (1 subgoal):
 1. (\<And>c. a = b * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = b * c

goal (2 subgoals):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> Fraction_Field.Fract a b \<in> range to_fract
[PROOF STEP]
have "Fract a b = Fract c 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a)
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)

goal (1 subgoal):
 1. Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a)
[PROOF STEP]
unfolding a
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)

goal (1 subgoal):
 1. Fraction_Field.Fract (b * c) b = Fraction_Field.Fract c (1::'a)
[PROOF STEP]
by (simp add: eq_fract)
[PROOF STATE]
proof (state)
this:
Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a)

goal (2 subgoals):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> Fraction_Field.Fract a b \<in> range to_fract
[PROOF STEP]
thus "Fract a b \<in> range to_fract"
[PROOF STATE]
proof (prove)
using this:
Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a)

goal (1 subgoal):
 1. Fraction_Field.Fract a b \<in> range to_fract
[PROOF STEP]
unfolding to_fract_def
[PROOF STATE]
proof (prove)
using this:
Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a)

goal (1 subgoal):
 1. Fraction_Field.Fract a b \<in> range (\<lambda>x. Fraction_Field.Fract x (1::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Fraction_Field.Fract a b \<in> range to_fract

goal (1 subgoal):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
[PROOF STEP]
assume "Fract a b \<in> range to_fract"
[PROOF STATE]
proof (state)
this:
Fraction_Field.Fract a b \<in> range to_fract

goal (1 subgoal):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Fraction_Field.Fract a b \<in> range to_fract
[PROOF STEP]
obtain c where "Fract a b = Fract c 1"
[PROOF STATE]
proof (prove)
using this:
Fraction_Field.Fract a b \<in> range to_fract

goal (1 subgoal):
 1. (\<And>c. Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding to_fract_def
[PROOF STATE]
proof (prove)
using this:
Fraction_Field.Fract a b \<in> range (\<lambda>x. Fraction_Field.Fract x (1::'a))

goal (1 subgoal):
 1. (\<And>c. Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a)

goal (1 subgoal):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
[PROOF STEP]
hence "a = b * c"
[PROOF STATE]
proof (prove)
using this:
Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a)

goal (1 subgoal):
 1. a = b * c
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
Fraction_Field.Fract a b = Fraction_Field.Fract c (1::'a)
b \<noteq> (0::'a)

goal (1 subgoal):
 1. a = b * c
[PROOF STEP]
by (simp add: eq_fract)
[PROOF STATE]
proof (state)
this:
a = b * c

goal (1 subgoal):
 1. Fraction_Field.Fract a b \<in> range to_fract \<Longrightarrow> b dvd a
[PROOF STEP]
thus "b dvd a"
[PROOF STATE]
proof (prove)
using this:
a = b * c

goal (1 subgoal):
 1. b dvd a
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
b dvd a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cf_comp_cf_const_right'[cat_cs_simps]:
  assumes "category \<alpha> \<AA>"
    and "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>"
    and "f = \<BB>\<lparr>CId\<rparr>\<lparr>b\<rparr>"
  shows "\<GG> \<circ>\<^sub>C\<^sub>F dghm_const \<AA> \<BB> b f = cf_const \<AA> \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M dghm_const \<AA> \<BB> b f = dghm_const \<AA> \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>) (\<CC>\<lparr>CId\<rparr>\<lparr>\<GG>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>\<rparr>)
[PROOF STEP]
using assms(1-3)
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M dghm_const \<AA> \<BB> b f = dghm_const \<AA> \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>) (\<CC>\<lparr>CId\<rparr>\<lparr>\<GG>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>\<rparr>)
[PROOF STEP]
unfolding assms(4)
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<GG> \<circ>\<^sub>D\<^sub>G\<^sub>H\<^sub>M dghm_const \<AA> \<BB> b (\<BB>\<lparr>CId\<rparr>\<lparr>b\<rparr>) = dghm_const \<AA> \<CC> (\<GG>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>) (\<CC>\<lparr>CId\<rparr>\<lparr>\<GG>\<lparr>ObjMap\<rparr>\<lparr>b\<rparr>\<rparr>)
[PROOF STEP]
by (rule cf_comp_cf_const_right)


[STATEMENT]
lemma rcis_div_cis[simp]: "rcis n a / cis b = rcis n (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis n a / cis b = rcis n (a - b)
[PROOF STEP]
unfolding cis_rcis_eq rcis_divide
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis (n / 1) (a - b) = rcis n (a - b)
[PROOF STEP]
by simp


[STATEMENT]
lemma jointfun_hom0:"\<lbrakk> f \<in> {j. j \<le> n} \<rightarrow> A; g \<in> {k. k \<le> m} \<rightarrow> B \<rbrakk> \<Longrightarrow>
        (jointfun n f m g) \<in> {l. l \<le> (Suc (n + m))} \<rightarrow>  (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {j. j \<le> n} \<rightarrow> A; g \<in> {k. k \<le> m} \<rightarrow> B\<rbrakk> \<Longrightarrow> jointfun n f m g \<in> {l. l \<le> Suc (n + m)} \<rightarrow> A \<union> B
[PROOF STEP]
by (simp add:jointfun_def sliden_def Pi_def)