[STATEMENT]
lemma append_one_elem_zero_dotP:
  assumes "dim_vec u = m"
    and "dim_vec x = n"
  shows "(one_element_vec n e @\<^sub>v (0\<^sub>v m)) \<bullet> (x @\<^sub>v u) = (\<Sum>i\<in>{0 ..< dim_vec x}. e * x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
let ?OEV = "one_element_vec n e"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
have "dim_vec (?OEV @\<^sub>v (0\<^sub>v m)) = dim_vec (x @\<^sub>v u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (one_element_vec n e @\<^sub>v 0\<^sub>v m) = dim_vec (x @\<^sub>v u)
[PROOF STEP]
by (simp add: assms(1) assms(2) one_element_vec_carrier)
[PROOF STATE]
proof (state)
this:
dim_vec (one_element_vec n e @\<^sub>v 0\<^sub>v m) = dim_vec (x @\<^sub>v u)

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
have "(one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u
[PROOF STEP]
using scalar_prod_append[of ?OEV _ "0\<^sub>v m" _ x u] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>one_element_vec n e \<in> carrier_vec ?n1.0; 0\<^sub>v m \<in> carrier_vec ?n2.0; x \<in> carrier_vec ?n1.0; u \<in> carrier_vec ?n2.0\<rbrakk> \<Longrightarrow> (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u
dim_vec u = m
dim_vec x = n

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u
[PROOF STEP]
by (meson carrier_vec_dim_vec one_element_vec_carrier zero_carrier_vec)
[PROOF STATE]
proof (state)
this:
(one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
have "... = (\<Sum>i\<in>{0..<dim_vec x}. ?OEV $ i * x $ i) + (\<Sum>i\<in>{0..<dim_vec u}. (0\<^sub>v m)$i * u$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u = (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i)
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i) = (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u = (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i)

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
one_element_vec n e \<bullet> x + 0\<^sub>v m \<bullet> u = (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i)

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
have "... = (\<Sum>i\<in>{0..<dim_vec x}. ?OEV $ i * x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i) = (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
dim_vec u = m

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i) = (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i) = (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i)

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) + (\<Sum>i = 0..<dim_vec u. 0\<^sub>v m $ i * u $ i) = (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i)

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
have "... = (\<Sum>i\<in>{0..<dim_vec x}. e * x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
dim_vec x = n

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<dim_vec x. one_element_vec n e $ i * x $ i) = (\<Sum>i = 0..<dim_vec x. e * x $ i)

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)

goal (1 subgoal):
 1. (one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(one_element_vec n e @\<^sub>v 0\<^sub>v m) \<bullet> (x @\<^sub>v u) = (\<Sum>i = 0..<dim_vec x. e * x $ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_fract [simp]:
  "\<lbrakk> b \<noteq> 0; d \<noteq> 0 \<rbrakk> \<Longrightarrow> Fract a b \<le> Fract c d \<longleftrightarrow> (a * d) * (b * d) \<le> (c * b) * (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> (0::'a); d \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (Fract a b \<le> Fract c d) = (a * d * (b * d) \<le> c * b * (b * d))
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma summable_Dirichlet_L':
  assumes nonprincipal: "\<chi> \<noteq> \<chi>\<^sub>0"
  assumes s: "Re s > 0"
  shows  "summable (\<lambda>n. \<chi> n * of_nat n powr -s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. \<chi> n * of_nat n powr - s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. \<chi> n * of_nat n powr - s)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<chi> \<noteq> \<chi>\<^sub>0
0 < Re s
[PROOF STEP]
have "fds_converges (fds \<chi>) s"
[PROOF STATE]
proof (prove)
using this:
\<chi> \<noteq> \<chi>\<^sub>0
0 < Re s

goal (1 subgoal):
 1. fds_converges (fds \<chi>) s
[PROOF STEP]
by (intro fds_converges le_less_trans[OF conv_abscissa_le_0]) auto
[PROOF STATE]
proof (state)
this:
fds_converges (fds \<chi>) s

goal (1 subgoal):
 1. summable (\<lambda>n. \<chi> n * of_nat n powr - s)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_converges (fds \<chi>) s

goal (1 subgoal):
 1. summable (\<lambda>n. \<chi> n * of_nat n powr - s)
[PROOF STEP]
by (simp add: fds_converges_def powr_minus divide_simps fds_nth_fds')
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. \<chi> n * of_nat n powr - s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_fact:
  "fact 0 = 1"
  "fact (Suc 0) = 1"
  "fact (numeral n) = numeral n * fact (pred_numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact 0 = (1::'a) &&& fact (Suc 0) = (1::'b) &&& fact (numeral n) = numeral n * fact (pred_numeral n)
[PROOF STEP]
by (simp, simp, simp_all only: numeral_eq_Suc fact_Suc,
      simp only: numeral_eq_Suc [symmetric] of_nat_numeral)


[STATEMENT]
lemma pochhammer_eq_0_iff: "pochhammer a n = (0::'a::field_char_0) \<longleftrightarrow> (\<exists>k < n. a = - of_nat k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pochhammer a n = (0::'a)) = (\<exists>k<n. a = - of_nat k)
[PROOF STEP]
by (auto simp add: pochhammer_prod eq_neg_iff_add_eq_0)


[STATEMENT]
lemma norm_le_square: "norm x \<le> a \<longleftrightarrow> 0 \<le> a \<and> inner x x \<le> a\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm x \<le> a) = (0 \<le> a \<and> inner x x \<le> a\<^sup>2)
[PROOF STEP]
apply (simp add: dot_square_norm abs_le_square_iff[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm x \<le> a) = (0 \<le> a \<and> norm x \<le> \<bar>a\<bar>)
[PROOF STEP]
using norm_ge_zero[of x]
[PROOF STATE]
proof (prove)
using this:
0 \<le> norm x

goal (1 subgoal):
 1. (norm x \<le> a) = (0 \<le> a \<and> norm x \<le> \<bar>a\<bar>)
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma is_increasing_comp:
  assumes "is_increasing f"
  assumes "is_increasing g"
  shows "is_increasing (f \<circ> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_increasing (f \<circ> g)
[PROOF STEP]
using assms(1) assms(2) is_increasing_def
[PROOF STATE]
proof (prove)
using this:
is_increasing f
is_increasing g
is_increasing ?f = (\<forall>n m. m < n \<longrightarrow> ?f m < ?f n)

goal (1 subgoal):
 1. is_increasing (f \<circ> g)
[PROOF STEP]
by auto


[STATEMENT]
lemma nat_pow_Suc [simp]: "x [^]\<^bsub>G\<^esub> (Suc n) = (x [^]\<^bsub>G\<^esub> n)\<otimes>\<^bsub>G\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>G\<^esub> Suc n = x [^]\<^bsub>G\<^esub> n \<otimes>\<^bsub>G\<^esub> x
[PROOF STEP]
by (simp add: nat_pow_def)


[STATEMENT]
lemma matrix_vector_right_distrib: "M *v (v + w) = M *v v + M *v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M *v (v + w) = M *v v + M *v w
[PROOF STEP]
by (transfer_hma rule: mult_add_distrib_mat_vec)


[STATEMENT]
lemma lowner_le_matrix_sum:
  fixes f g :: "nat \<Rightarrow> complex mat"
  shows "(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> (\<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d)
    \<Longrightarrow> (\<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k)
    \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>k. k < 0 \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < 0 \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < 0 \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f 0 \<le>\<^sub>L matrix_sum d g 0
 2. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?k < 0 \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < 0 \<Longrightarrow> g ?k \<in> carrier_mat d d
?k < 0 \<Longrightarrow> f ?k \<le>\<^sub>L g ?k

goal (2 subgoals):
 1. \<lbrakk>\<And>k. k < 0 \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < 0 \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < 0 \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f 0 \<le>\<^sub>L matrix_sum d g 0
 2. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d f 0 \<le>\<^sub>L matrix_sum d g 0
[PROOF STEP]
unfolding matrix_sum.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m d d \<le>\<^sub>L 0\<^sub>m d d
[PROOF STEP]
using lowner_le_refl[of "0\<^sub>m d d" d]
[PROOF STATE]
proof (prove)
using this:
0\<^sub>m d d \<in> carrier_mat d d \<Longrightarrow> 0\<^sub>m d d \<le>\<^sub>L 0\<^sub>m d d

goal (1 subgoal):
 1. 0\<^sub>m d d \<le>\<^sub>L 0\<^sub>m d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d f 0 \<le>\<^sub>L matrix_sum d g 0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> f ?k \<le>\<^sub>L g ?k

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> f ?k \<le>\<^sub>L g ?k
[PROOF STEP]
have dfn: "f n \<in> carrier_mat d d" and dgn: "g n \<in> carrier_mat d d" and le1: "f n \<le>\<^sub>L g n"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> f ?k \<le>\<^sub>L g ?k

goal (1 subgoal):
 1. f n \<in> carrier_mat d d &&& g n \<in> carrier_mat d d &&& f n \<le>\<^sub>L g n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f n \<in> carrier_mat d d
g n \<in> carrier_mat d d
f n \<le>\<^sub>L g n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f n \<in> carrier_mat d d
g n \<in> carrier_mat d d
f n \<le>\<^sub>L g n
[PROOF STEP]
have le2: "matrix_sum d f n \<le>\<^sub>L matrix_sum d g n"
[PROOF STATE]
proof (prove)
using this:
f n \<in> carrier_mat d d
g n \<in> carrier_mat d d
f n \<le>\<^sub>L g n

goal (1 subgoal):
 1. matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
f n \<in> carrier_mat d d
g n \<in> carrier_mat d d
f n \<le>\<^sub>L g n
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> f ?k \<le>\<^sub>L g ?k

goal (1 subgoal):
 1. matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d f n \<le>\<^sub>L matrix_sum d g n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
have "k < n \<Longrightarrow> f k \<in> carrier_mat d d" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < n \<Longrightarrow> f k \<in> carrier_mat d d
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> f ?k \<le>\<^sub>L g ?k

goal (1 subgoal):
 1. k < n \<Longrightarrow> f k \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < n \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k < n \<Longrightarrow> f ?k \<in> carrier_mat d d
[PROOF STEP]
have dsf: "matrix_sum d f n \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
using this:
?k < n \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. matrix_sum d f n \<in> carrier_mat d d
[PROOF STEP]
using matrix_sum_dim
[PROOF STATE]
proof (prove)
using this:
?k < n \<Longrightarrow> f ?k \<in> carrier_mat d d
(\<And>k. k < ?n \<Longrightarrow> ?f k \<in> carrier_mat ?d ?d) \<Longrightarrow> matrix_sum ?d ?f ?n \<in> carrier_mat ?d ?d

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

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
have "k < n \<Longrightarrow> g k \<in> carrier_mat d d" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < n \<Longrightarrow> g k \<in> carrier_mat d d
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n
?k < Suc n \<Longrightarrow> f ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> g ?k \<in> carrier_mat d d
?k < Suc n \<Longrightarrow> f ?k \<le>\<^sub>L g ?k

goal (1 subgoal):
 1. k < n \<Longrightarrow> g k \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < n \<Longrightarrow> g ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k < n \<Longrightarrow> g ?k \<in> carrier_mat d d
[PROOF STEP]
have dsg: "matrix_sum d g n \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
using this:
?k < n \<Longrightarrow> g ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. matrix_sum d g n \<in> carrier_mat d d
[PROOF STEP]
using matrix_sum_dim
[PROOF STATE]
proof (prove)
using this:
?k < n \<Longrightarrow> g ?k \<in> carrier_mat d d
(\<And>k. k < ?n \<Longrightarrow> ?f k \<in> carrier_mat ?d ?d) \<Longrightarrow> matrix_sum ?d ?f ?n \<in> carrier_mat ?d ?d

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

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f n \<le>\<^sub>L matrix_sum d g n; \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> g k \<in> carrier_mat d d; \<And>k. k < Suc n \<Longrightarrow> f k \<le>\<^sub>L g k\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)
[PROOF STEP]
unfolding matrix_sum.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n + matrix_sum d f n \<le>\<^sub>L g n + matrix_sum d g n
[PROOF STEP]
using lowner_le_add dfn dsf dgn dsg le1 le2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n; ?C \<in> carrier_mat ?n ?n; ?D \<in> carrier_mat ?n ?n; ?A \<le>\<^sub>L ?B; ?C \<le>\<^sub>L ?D\<rbrakk> \<Longrightarrow> ?A + ?C \<le>\<^sub>L ?B + ?D
f n \<in> carrier_mat d d
matrix_sum d f n \<in> carrier_mat d d
g n \<in> carrier_mat d d
matrix_sum d g n \<in> carrier_mat d d
f n \<le>\<^sub>L g n
matrix_sum d f n \<le>\<^sub>L matrix_sum d g n

goal (1 subgoal):
 1. f n + matrix_sum d f n \<le>\<^sub>L g n + matrix_sum d g n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d f (Suc n) \<le>\<^sub>L matrix_sum d g (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fr_ClBr: "\<forall>A. Fr(A) = (Cl(A) \<and> Br(A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A. (\<forall>w. \<F> A w = A w) = ((\<forall>w. \<C> A w = A w) \<and> (\<forall>w. \<B> A w = A w))
[PROOF STEP]
using Br_fr_def Cl_fr_def join_def meet_def
[PROOF STATE]
proof (prove)
using this:
\<B>\<^sub>F ?\<F> \<equiv> \<lambda>A. A \<^bold>\<and> ?\<F> A
\<C>\<^sub>F ?\<F> \<equiv> \<lambda>A. A \<^bold>\<or> ?\<F> A
?A \<^bold>\<or> ?B \<equiv> \<lambda>w. ?A w \<or> ?B w
?A \<^bold>\<and> ?B \<equiv> \<lambda>w. ?A w \<and> ?B w

goal (1 subgoal):
 1. \<forall>A. (\<forall>w. \<F> A w = A w) = ((\<forall>w. \<C> A w = A w) \<and> (\<forall>w. \<B> A w = A w))
[PROOF STEP]
by auto


[STATEMENT]
lemma distr_M_component: "distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
have "distr M (count_space UNIV) (\<lambda>f. f i) = distr M (measure_pmf (bernoulli_pmf p)) (\<lambda>f. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr M (count_space UNIV) (\<lambda>f. f i) = distr M (measure_pmf (bernoulli_pmf p)) (\<lambda>f. f i)
[PROOF STEP]
by (rule distr_cong) auto
[PROOF STATE]
proof (state)
this:
distr M (count_space UNIV) (\<lambda>f. f i) = distr M (measure_pmf (bernoulli_pmf p)) (\<lambda>f. f i)

goal (1 subgoal):
 1. distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
distr M (count_space UNIV) (\<lambda>f. f i) = distr M (measure_pmf (bernoulli_pmf p)) (\<lambda>f. f i)

goal (1 subgoal):
 1. distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
have "\<dots> = measure_pmf (bernoulli_pmf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr M (measure_pmf (bernoulli_pmf p)) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr (Pi\<^sub>M UNIV (\<lambda>i. measure_pmf (bernoulli_pmf p))) (measure_pmf (bernoulli_pmf p)) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
by (subst distr_PiM_component) (simp_all add: measure_pmf.prob_space_axioms)
[PROOF STATE]
proof (state)
this:
distr M (measure_pmf (bernoulli_pmf p)) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)

goal (1 subgoal):
 1. distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)

goal (1 subgoal):
 1. distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
distr M (count_space UNIV) (\<lambda>f. f i) = measure_pmf (bernoulli_pmf p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma val_Zp_dist_res_eq2:
  assumes "a \<in> carrier Zp"
  assumes "b \<in> carrier Zp"
  assumes "(a k) = (b k)"
  shows "val_Zp_dist a b \<ge> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eint (int k) \<le> val_Zp_dist a b
[PROOF STEP]
using assms(1) assms(2) assms(3) Zp_residue_eq2
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Zp
b \<in> carrier Zp
a k = b k
\<lbrakk>?a \<in> carrier Zp; ?b \<in> carrier Zp; ?a ?k = ?b ?k; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> eint (int ?k) \<le> val_Zp (?a \<ominus> ?b)

goal (1 subgoal):
 1. eint (int k) \<le> val_Zp_dist a b
[PROOF STEP]
unfolding val_Zp_dist_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Zp
b \<in> carrier Zp
a k = b k
\<lbrakk>?a \<in> carrier Zp; ?b \<in> carrier Zp; ?a ?k = ?b ?k; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> eint (int ?k) \<le> val_Zp (?a \<ominus> ?b)

goal (1 subgoal):
 1. eint (int k) \<le> val_Zp (a \<ominus> b)
[PROOF STEP]
by (simp add: val_Zp_def)


[STATEMENT]
lemma monom_coeff:
  assumes "a \<in> carrier R"
  shows "(a \<odot>\<^bsub>P\<^esub> X [^]\<^bsub>P\<^esub> (n::nat)) k = (if (k = n) then a else \<zero>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n) k = (if k = n then a else \<zero>)
[PROOF STEP]
using assms cfs_monom monom_rep_X_pow
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
?a \<in> carrier R \<Longrightarrow> monom P ?a ?m ?n = (if ?m = ?n then ?a else \<zero>)
?a \<in> carrier R \<Longrightarrow> monom P ?a ?n = ?a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> ?n

goal (1 subgoal):
 1. (a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n) k = (if k = n then a else \<zero>)
[PROOF STEP]
by auto


[STATEMENT]
lemma lemma1:
   "[| B \<subseteq> A2;
       F \<in> (A1 - B) co (A1 \<union> B);
       F \<in> (A2 - C) co (A2 \<union> C) |]
    ==> F \<in> (A1 \<union> A2 - C) co (A1 \<union> A2 \<union> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B \<subseteq> A2; F \<in> A1 - B co A1 \<union> B; F \<in> A2 - C co A2 \<union> C\<rbrakk> \<Longrightarrow> F \<in> A1 \<union> A2 - C co A1 \<union> A2 \<union> C
[PROOF STEP]
by (unfold constrains_def, clarify,  blast)


[STATEMENT]
lemma negligible_const_iff [simp]: "negligible (\<lambda>_. c :: real) \<longleftrightarrow> c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible (\<lambda>_. c) = (c = 0)
[PROOF STEP]
by(auto simp add: negligible_def const_smallo_inverse_powr filterlim_real_sequentially dest!: spec[where x=1])


[STATEMENT]
lemma bezout_matrix_works_transpose1:
  assumes ib: "is_bezout_ext bezout"
  and a_not_b: "a \<noteq> b"
shows "(A**transpose (bezout_matrix (transpose A) a b i bezout)) $ i $ a
    = snd (snd (snd (snd (bezout (A $ i $ a) (A $ i $ b)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
have "(A**transpose (bezout_matrix (transpose A) a b i bezout)) $h i $h a
    = transpose (A**transpose (bezout_matrix (transpose A) a b i bezout)) $h a $h i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = Finite_Cartesian_Product.transpose (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h a $h i
[PROOF STEP]
by (simp add: transpose_code transpose_row_code)
[PROOF STATE]
proof (state)
this:
(A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = Finite_Cartesian_Product.transpose (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h a $h i

goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = Finite_Cartesian_Product.transpose (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h a $h i

goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
have "... = ((bezout_matrix (transpose A) a b i bezout) ** (transpose A)) $h a $h i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Cartesian_Product.transpose (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h a $h i = (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout ** Finite_Cartesian_Product.transpose A) $h a $h i
[PROOF STEP]
by (simp add: matrix_transpose_mul)
[PROOF STATE]
proof (state)
this:
Finite_Cartesian_Product.transpose (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h a $h i = (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout ** Finite_Cartesian_Product.transpose A) $h a $h i

goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Finite_Cartesian_Product.transpose (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h a $h i = (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout ** Finite_Cartesian_Product.transpose A) $h a $h i

goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
have "... = snd (snd (snd (snd (bezout ((transpose A) $ a $ i) ((transpose A) $ b $ i)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout ** Finite_Cartesian_Product.transpose A) $h a $h i = snd (snd (snd (snd (bezout (Finite_Cartesian_Product.transpose A $h a $h i) (Finite_Cartesian_Product.transpose A $h b $h i)))))
[PROOF STEP]
by (rule bezout_matrix_works1[OF ib a_not_b])
[PROOF STATE]
proof (state)
this:
(bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout ** Finite_Cartesian_Product.transpose A) $h a $h i = snd (snd (snd (snd (bezout (Finite_Cartesian_Product.transpose A $h a $h i) (Finite_Cartesian_Product.transpose A $h b $h i)))))

goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout ** Finite_Cartesian_Product.transpose A) $h a $h i = snd (snd (snd (snd (bezout (Finite_Cartesian_Product.transpose A $h a $h i) (Finite_Cartesian_Product.transpose A $h b $h i)))))

goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
have "... = snd (snd (snd (snd (bezout (A $ i $ a) (A $ i $ b)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (snd (snd (snd (bezout (Finite_Cartesian_Product.transpose A $h a $h i) (Finite_Cartesian_Product.transpose A $h b $h i))))) = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
by (simp add: transpose_code transpose_row_code)
[PROOF STATE]
proof (state)
this:
snd (snd (snd (snd (bezout (Finite_Cartesian_Product.transpose A $h a $h i) (Finite_Cartesian_Product.transpose A $h b $h i))))) = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))

goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))

goal (1 subgoal):
 1. (A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(A ** Finite_Cartesian_Product.transpose (bezout_matrix (Finite_Cartesian_Product.transpose A) a b i bezout)) $h i $h a = snd (snd (snd (snd (bezout (A $h i $h a) (A $h i $h b)))))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ket_plus_eval [simp]:
  "i < 2 \<Longrightarrow> ket_plus $ i = 1 / csqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 \<Longrightarrow> ket_plus $ i = 1 / csqrt 2
[PROOF STEP]
apply (simp only: ket_plus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2 \<Longrightarrow> Matrix.vec 2 (\<lambda>k. 1 / csqrt 2) $ i = 1 / csqrt 2
[PROOF STEP]
using index_vec less_2_cases
[PROOF STATE]
proof (prove)
using this:
?i < ?n \<Longrightarrow> Matrix.vec ?n ?f $ ?i = ?f ?i
?n < 2 \<Longrightarrow> ?n = 0 \<or> ?n = Suc 0

goal (1 subgoal):
 1. i < 2 \<Longrightarrow> Matrix.vec 2 (\<lambda>k. 1 / csqrt 2) $ i = 1 / csqrt 2
[PROOF STEP]
by force


[STATEMENT]
lemma LIMSEQ_powreal_minus_nat:
  "a > 1 \<Longrightarrow> (\<lambda>n. a pow\<^sub>\<real> (-real n)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < a \<Longrightarrow> (\<lambda>n. a pow\<^sub>\<real> - real n) \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: powreal_minus powreal_power_eq
        LIMSEQ_inverse_realpow_zero)


[STATEMENT]
lemma E_linear_sum_allg: "finite (set_pmf D) \<Longrightarrow> E(map_pmf (\<lambda>x. (\<Sum>i\<in> A. f i x)) D)
      = (\<Sum>i\<in> (A::'a set). E(map_pmf (f i) D))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set_pmf D) \<Longrightarrow> E (map_pmf (\<lambda>x. \<Sum>i\<in>A. f i x) D) = (\<Sum>i\<in>A. E (map_pmf (f i) D))
[PROOF STEP]
unfolding E_def integral_map_pmf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set_pmf D) \<Longrightarrow> measure_pmf.expectation D (\<lambda>x. \<Sum>i\<in>A. f i x) = (\<Sum>i\<in>A. measure_pmf.expectation D (f i))
[PROOF STEP]
apply(rule Bochner_Integration.integral_sum)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>finite (set_pmf D); i \<in> A\<rbrakk> \<Longrightarrow> integrable (measure_pmf D) (f i)
[PROOF STEP]
by (simp add: integrable_measure_pmf_finite)


[STATEMENT]
lemma hvzk_z1_r1_tuple_rewrite:
  assumes r1: "r1 < order \<G>"
  shows "(\<^bold>g [^] r1 \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>) =
              (\<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>)
                  \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>g [^] r1 \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>) = (\<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>) \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<^bold>g [^] r1 \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>) = (\<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>) \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>)
[PROOF STEP]
have "\<^bold>g [^] r1 = \<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] r1 = \<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>)
[PROOF STEP]
using assms hvzk_z_r
[PROOF STATE]
proof (prove)
using this:
r1 < order \<G>
?r1.0 < order \<G> \<Longrightarrow> ?r1.0 = ((?r1.0 + ?c * ?x1.0) mod order \<G> + order \<G> * ?c * ?x1.0 - ?c * ?x1.0) mod order \<G>

goal (1 subgoal):
 1. \<^bold>g [^] r1 = \<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] r1 = \<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>)

goal (1 subgoal):
 1. (\<^bold>g [^] r1 \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>) = (\<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>) \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] r1 = \<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>)

goal (1 subgoal):
 1. (\<^bold>g [^] r1 \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>) = (\<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>) \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] r1 \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>) = (\<^bold>g [^] (((r1 + c * x1) mod order \<G> + order \<G> * c * x1 - c * x1) mod order \<G>) \<otimes> g' [^] r2, c, (r1 + c * x1) mod order \<G>, (r2 + c * x2) mod order \<G>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma circline_line':
  assumes "z1 \<noteq> z2"
  shows "circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
let ?B = "\<i> * (z2 - z1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
let ?D = "Re (- cnj_mix ?B z1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
have "circline 0 ?B ?D = {z. cnj ?B*z + ?B*cnj z + complex_of_real ?D = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = {z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z1 \<noteq> z2

goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = {z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0}
[PROOF STEP]
by (simp add: circline_def)
[PROOF STATE]
proof (state)
this:
circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = {z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0}

goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = {z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0}

goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
have "is_real (- cnj_mix (\<i> * (z2 - z1)) z1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (- cnj_mix (\<i> * (z2 - z1)) z1)
[PROOF STEP]
using cnj_mix_real[of ?B z1]
[PROOF STATE]
proof (prove)
using this:
is_real (cnj_mix (\<i> * (z2 - z1)) z1)

goal (1 subgoal):
 1. is_real (- cnj_mix (\<i> * (z2 - z1)) z1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_real (- cnj_mix (\<i> * (z2 - z1)) z1)

goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
hence "{z. cnj ?B*z + ?B*cnj z + complex_of_real ?D = 0} =
         {z. cnj ?B*z + ?B*cnj z - (cnj ?B*z1 + ?B*cnj z1) = 0}"
[PROOF STATE]
proof (prove)
using this:
is_real (- cnj_mix (\<i> * (z2 - z1)) z1)

goal (1 subgoal):
 1. {z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0} = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
[PROOF STEP]
apply (subst complex_of_real_Re, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (- cnj_mix (\<i> * (z2 - z1)) z1) \<Longrightarrow> {z. cnj_mix (\<i> * (z2 - z1)) z + - cnj_mix (\<i> * (z2 - z1)) z1 = 0} = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
[PROOF STEP]
unfolding diff_conv_add_uminus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (- cnj_mix (\<i> * (z2 + - z1)) z1) \<Longrightarrow> {z. cnj_mix (\<i> * (z2 + - z1)) z + - cnj_mix (\<i> * (z2 + - z1)) z1 = 0} = {z. cnj_mix (\<i> * (z2 + - z1)) z + - cnj_mix (\<i> * (z2 + - z1)) z1 = 0}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0} = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}

goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0} = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}

goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
have "line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
[PROOF STEP]
using line_equation[of z1 z2 ?B] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>z1 \<noteq> z2; \<i> * (z2 - z1) = rot90 (z2 - z1)\<rbrakk> \<Longrightarrow> line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
z1 \<noteq> z2

goal (1 subgoal):
 1. line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
[PROOF STEP]
unfolding rot90_ii
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>z1 \<noteq> z2; \<i> * (z2 - z1) = (z2 - z1) * \<i>\<rbrakk> \<Longrightarrow> line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
z1 \<noteq> z2

goal (1 subgoal):
 1. line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}

goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = {z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0}
{z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0} = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = {z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0}
{z. cnj_mix (\<i> * (z2 - z1)) z + cor (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = 0} = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}
line z1 z2 = {z. cnj_mix (\<i> * (z2 - z1)) z - cnj_mix (\<i> * (z2 - z1)) z1 = 0}

goal (1 subgoal):
 1. circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
circline 0 (\<i> * (z2 - z1)) (Re (- cnj_mix (\<i> * (z2 - z1)) z1)) = line z1 z2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interior_of_eq_empty:
   "X interior_of S = {} \<longleftrightarrow> (\<forall>T. openin X T \<and> T \<subseteq> S \<longrightarrow> T = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X interior_of S = {}) = (\<forall>T. openin X T \<and> T \<subseteq> S \<longrightarrow> T = {})
[PROOF STEP]
by (metis bot.extremum_uniqueI interior_of_maximal interior_of_subset openin_interior_of)


[STATEMENT]
lemma "\<forall>x::real. (\<lfloor>x\<rfloor> = \<lceil>x\<rceil> \<longleftrightarrow> (x = real_of_int \<lfloor>x\<rfloor>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<lfloor>x\<rfloor> = \<lceil>x\<rceil>) = (x = real_of_int \<lfloor>x\<rfloor>)
[PROOF STEP]
by mir


[STATEMENT]
lemma nullspace_inter_rowspace:
  fixes A :: "real^'n^'m"
  shows "A *v x = 0 \<and> x \<in> span(rows A) \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *v x = 0 \<and> x \<in> span (rows A)) = (x = 0)
[PROOF STEP]
using orthogonal_nullspace_rowspace orthogonal_self span_zero matrix_vector_mult_0_right
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A *v ?x = 0; ?y \<in> span (rows ?A)\<rbrakk> \<Longrightarrow> orthogonal ?x ?y
orthogonal ?x ?x = (?x = (0::?'a))
(0::?'a) \<in> span ?S
?A *v 0 = 0

goal (1 subgoal):
 1. (A *v x = 0 \<and> x \<in> span (rows A)) = (x = 0)
[PROOF STEP]
by blast


[STATEMENT]
lemma a_insert: "T_insert a t + \<Phi>(skew_heap.insert a t) - \<Phi> t \<le> 3 * log 2 (size1 t + 2) + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (T_insert a t + \<Phi> (skew_heap.insert a t) - \<Phi> t) \<le> 3 * log 2 (real (size1 t + 2)) + 2
[PROOF STEP]
using a_merge[of "Node Leaf a Leaf" "t"]
[PROOF STATE]
proof (prove)
using this:
real_of_int (int (T_merge \<langle>\<langle>\<rangle>, a, \<langle>\<rangle>\<rangle> t) + \<Phi> (merge \<langle>\<langle>\<rangle>, a, \<langle>\<rangle>\<rangle> t) - \<Phi> \<langle>\<langle>\<rangle>, a, \<langle>\<rangle>\<rangle> - \<Phi> t) \<le> 3 * log 2 (real (size1 \<langle>\<langle>\<rangle>, a, \<langle>\<rangle>\<rangle> + size1 t)) + 1

goal (1 subgoal):
 1. real_of_int (T_insert a t + \<Phi> (skew_heap.insert a t) - \<Phi> t) \<le> 3 * log 2 (real (size1 t + 2)) + 2
[PROOF STEP]
by (simp add: numeral_eq_Suc T_insert_def rh_def)


[STATEMENT]
lemma pi_approx_32: "\<bar>pi - 13493037705/4294967296 :: real\<bar> \<le> inverse(2 ^ 32)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - 13493037705 / 4294967296\<bar> \<le> inverse (2 ^ 32)
[PROOF STEP]
by (rule approx_coarsen[OF pi_approx_75]) simp


[STATEMENT]
lemma p1: "p > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < p
[PROOF STEP]
using p prime_gt_1_int
[PROOF STATE]
proof (prove)
using this:
prime p
prime ?p \<Longrightarrow> 1 < ?p

goal (1 subgoal):
 1. 1 < p
[PROOF STEP]
by auto


[STATEMENT]
lemma (in prisoner) J_times_J_cnj:
  shows "J * (J\<^sup>\<dagger>) = 1\<^sub>m 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 1\<^sub>m 4
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m 4); j < dim_col (1\<^sub>m 4)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)
 2. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 4)
 3. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m 4); j < dim_col (1\<^sub>m 4)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)
 2. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 4)
 3. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
assume a0:"i < dim_row (1\<^sub>m 4)" and a1:"j < dim_col (1\<^sub>m 4)"
[PROOF STATE]
proof (state)
this:
i < dim_row (1\<^sub>m 4)
j < dim_col (1\<^sub>m 4)

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m 4); j < dim_col (1\<^sub>m 4)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)
 2. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 4)
 3. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row (1\<^sub>m 4)
j < dim_col (1\<^sub>m 4)
[PROOF STEP]
show "(J * (J\<^sup>\<dagger>)) $$ (i,j) = 1\<^sub>m 4 $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
i < dim_row (1\<^sub>m 4)
j < dim_col (1\<^sub>m 4)

goal (1 subgoal):
 1. (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>i < dim_row (1\<^sub>m 4); j < dim_col (1\<^sub>m 4)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)
[PROOF STEP]
have "i\<in>{0,1,2,3} \<and> j\<in>{0,1,2,3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> {0, 1, 2, 3} \<and> j \<in> {0, 1, 2, 3}
[PROOF STEP]
using a0 a1 mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row (1\<^sub>m 4)
j < dim_col (1\<^sub>m 4)
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. i \<in> {0, 1, 2, 3} \<and> j \<in> {0, 1, 2, 3}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in> {0, 1, 2, 3} \<and> j \<in> {0, 1, 2, 3}

goal (1 subgoal):
 1. \<lbrakk>i < dim_row (1\<^sub>m 4); j < dim_col (1\<^sub>m 4)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i \<in> {0, 1, 2, 3} \<and> j \<in> {0, 1, 2, 3}

goal (1 subgoal):
 1. (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)
[PROOF STEP]
using mat_of_cols_list_def hermite_cnj_of_J set_4 cos_sin_squared_add_cpx
[PROOF STATE]
proof (prove)
using this:
i \<in> {0, 1, 2, 3} \<and> j \<in> {0, 1, 2, 3}
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, - \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]
{..<4} = {0, 1, 2, 3}
complex_of_real (cos (?\<gamma> / 2)) * complex_of_real (cos (?\<gamma> / 2)) - \<i> * complex_of_real (sin (?\<gamma> / 2)) * (\<i> * complex_of_real (sin (?\<gamma> / 2))) = 1

goal (1 subgoal):
 1. (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 4 $$ (i, j)

goal (2 subgoals):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 4)
 2. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 4)
 2. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
show "dim_row (J * (J\<^sup>\<dagger>)) = dim_row (1\<^sub>m 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 4)
[PROOF STEP]
using mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 4)

goal (1 subgoal):
 1. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
show "dim_col (J * (J\<^sup>\<dagger>)) = dim_col (1\<^sub>m 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
using mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 4)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_diff [continuous_intros]:
  fixes f g :: "_ \<Rightarrow> 'b::topological_group_add"
  shows "continuous_on s f \<Longrightarrow> continuous_on s g \<Longrightarrow> continuous_on s (\<lambda>x. f x - g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on s f; continuous_on s g\<rbrakk> \<Longrightarrow> continuous_on s (\<lambda>x. f x - g x)
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>s. (f \<longlongrightarrow> f x) (at x within s); \<forall>x\<in>s. (g \<longlongrightarrow> g x) (at x within s)\<rbrakk> \<Longrightarrow> \<forall>x\<in>s. ((\<lambda>x. f x - g x) \<longlongrightarrow> f x - g x) (at x within s)
[PROOF STEP]
by (auto intro: tendsto_diff)


[STATEMENT]
lemma norm_add_leD: "norm (a + b) \<le> c \<Longrightarrow> norm b \<le> norm a + c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (a + b) \<le> c \<Longrightarrow> norm b \<le> norm a + c
[PROOF STEP]
by (metis ab_semigroup_add_class.add.commute add_commute diff_le_eq norm_diff_ineq order_trans)


[STATEMENT]
lemma hom_dim_gen_eigenspace: assumes A: "A \<in> carrier_mat n n"
  shows "dim_gen_eigenspace (mat\<^sub>h A) (hom x) = dim_gen_eigenspace A x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_gen_eigenspace (mat\<^sub>h A) (hom x) = dim_gen_eigenspace A x
[PROOF STEP]
proof (intro ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. dim_gen_eigenspace (mat\<^sub>h A) (hom x) xa = dim_gen_eigenspace A x xa
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. dim_gen_eigenspace (mat\<^sub>h A) (hom x) xa = dim_gen_eigenspace A x xa
[PROOF STEP]
show "dim_gen_eigenspace (mat\<^sub>h A) (hom x) k = dim_gen_eigenspace A x k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_gen_eigenspace (mat\<^sub>h A) (hom x) k = dim_gen_eigenspace A x k
[PROOF STEP]
unfolding dim_gen_eigenspace_def hom_char_matrix[OF A]
      mat_hom_pow[OF char_matrix_closed[OF A], symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kernel_dim (mat\<^sub>h (char_matrix A x ^\<^sub>m k)) = kernel_dim (char_matrix A x ^\<^sub>m k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_gen_eigenspace (mat\<^sub>h A) (hom x) k = dim_gen_eigenspace A x k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_nzrows_row_echelon: "distinct (nzrows (row_echelon A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (nzrows (row_echelon A))
[PROOF STEP]
unfolding nzrows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter (\<lambda>r. r \<noteq> 0\<^sub>v (dim_col (row_echelon A))) (rows (row_echelon A)))
[PROOF STEP]
proof (rule distinct_filterI, simp del: dim_row_echelon)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
let ?B = "row_echelon A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
fix i j::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
assume "i < j" and "j < dim_row ?B"
[PROOF STATE]
proof (state)
this:
i < j
j < dim_row (row_echelon A)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
hence "i \<noteq> j" and "i < dim_row ?B"
[PROOF STATE]
proof (prove)
using this:
i < j
j < dim_row (row_echelon A)

goal (1 subgoal):
 1. i \<noteq> j &&& i < dim_row (row_echelon A)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
i \<noteq> j
i < dim_row (row_echelon A)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
assume ri: "row ?B i \<noteq> 0\<^sub>v (dim_col ?B)" and rj: "row ?B j \<noteq> 0\<^sub>v (dim_col ?B)"
[PROOF STATE]
proof (state)
this:
row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A))
row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
obtain f where pf: "pivot_fun ?B f (dim_col ?B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. pivot_fun (row_echelon A) f (dim_col (row_echelon A)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (fact row_echelon_pivot_fun)
[PROOF STATE]
proof (state)
this:
pivot_fun (row_echelon A) f (dim_col (row_echelon A))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
from rj
[PROOF STATE]
proof (chain)
picking this:
row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))
[PROOF STEP]
have "f j < dim_col ?B"
[PROOF STATE]
proof (prove)
using this:
row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))

goal (1 subgoal):
 1. f j < dim_col (row_echelon A)
[PROOF STEP]
by (simp only: row_not_zero_iff_pivot_fun[OF pf \<open>j < dim_row ?B\<close>])
[PROOF STATE]
proof (state)
this:
f j < dim_col (row_echelon A)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
from _ pf \<open>j < dim_row ?B\<close> this \<open>i < dim_row ?B\<close> \<open>i \<noteq> j\<close>
[PROOF STATE]
proof (chain)
picking this:
PROP ?psi \<Longrightarrow> PROP ?psi
pivot_fun (row_echelon A) f (dim_col (row_echelon A))
j < dim_row (row_echelon A)
f j < dim_col (row_echelon A)
i < dim_row (row_echelon A)
i \<noteq> j
[PROOF STEP]
have *: "?B $$ (i, f j) = 0"
[PROOF STATE]
proof (prove)
using this:
PROP ?psi \<Longrightarrow> PROP ?psi
pivot_fun (row_echelon A) f (dim_col (row_echelon A))
j < dim_row (row_echelon A)
f j < dim_col (row_echelon A)
i < dim_row (row_echelon A)
i \<noteq> j

goal (1 subgoal):
 1. row_echelon A $$ (i, f j) = (0::'a)
[PROOF STEP]
by (rule pivot_funD(5), intro refl)
[PROOF STATE]
proof (state)
this:
row_echelon A $$ (i, f j) = (0::'a)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < j; j < dim_row (row_echelon A); row (row_echelon A) i \<noteq> 0\<^sub>v (dim_col (row_echelon A)); row (row_echelon A) j \<noteq> 0\<^sub>v (dim_col (row_echelon A))\<rbrakk> \<Longrightarrow> row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
show "row ?B i \<noteq> row ?B j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (row_echelon A) i \<noteq> row (row_echelon A) j
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. row (row_echelon A) i = row (row_echelon A) j \<Longrightarrow> False
[PROOF STEP]
assume "row ?B i = row ?B j"
[PROOF STATE]
proof (state)
this:
row (row_echelon A) i = row (row_echelon A) j

goal (1 subgoal):
 1. row (row_echelon A) i = row (row_echelon A) j \<Longrightarrow> False
[PROOF STEP]
hence "row ?B i $ (f j) = row ?B j $ (f j)"
[PROOF STATE]
proof (prove)
using this:
row (row_echelon A) i = row (row_echelon A) j

goal (1 subgoal):
 1. row (row_echelon A) i $ f j = row (row_echelon A) j $ f j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row (row_echelon A) i $ f j = row (row_echelon A) j $ f j

goal (1 subgoal):
 1. row (row_echelon A) i = row (row_echelon A) j \<Longrightarrow> False
[PROOF STEP]
with \<open>i < dim_row ?B\<close> \<open>j < dim_row ?B\<close> \<open>f j < dim_col ?B\<close>
[PROOF STATE]
proof (chain)
picking this:
i < dim_row (row_echelon A)
j < dim_row (row_echelon A)
f j < dim_col (row_echelon A)
row (row_echelon A) i $ f j = row (row_echelon A) j $ f j
[PROOF STEP]
have "?B $$ (i, f j) = ?B $$ (j, f j)"
[PROOF STATE]
proof (prove)
using this:
i < dim_row (row_echelon A)
j < dim_row (row_echelon A)
f j < dim_col (row_echelon A)
row (row_echelon A) i $ f j = row (row_echelon A) j $ f j

goal (1 subgoal):
 1. row_echelon A $$ (i, f j) = row_echelon A $$ (j, f j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row_echelon A $$ (i, f j) = row_echelon A $$ (j, f j)

goal (1 subgoal):
 1. row (row_echelon A) i = row (row_echelon A) j \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row_echelon A $$ (i, f j) = row_echelon A $$ (j, f j)

goal (1 subgoal):
 1. row (row_echelon A) i = row (row_echelon A) j \<Longrightarrow> False
[PROOF STEP]
from _ pf \<open>j < dim_row ?B\<close> \<open>f j < dim_col ?B\<close>
[PROOF STATE]
proof (chain)
picking this:
PROP ?psi \<Longrightarrow> PROP ?psi
pivot_fun (row_echelon A) f (dim_col (row_echelon A))
j < dim_row (row_echelon A)
f j < dim_col (row_echelon A)
[PROOF STEP]
have "... = 1"
[PROOF STATE]
proof (prove)
using this:
PROP ?psi \<Longrightarrow> PROP ?psi
pivot_fun (row_echelon A) f (dim_col (row_echelon A))
j < dim_row (row_echelon A)
f j < dim_col (row_echelon A)

goal (1 subgoal):
 1. row_echelon A $$ (j, f j) = (1::'a)
[PROOF STEP]
by (rule pivot_funD, intro refl)
[PROOF STATE]
proof (state)
this:
row_echelon A $$ (j, f j) = (1::'a)

goal (1 subgoal):
 1. row (row_echelon A) i = row (row_echelon A) j \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
row_echelon A $$ (i, f j) = (1::'a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
row_echelon A $$ (i, f j) = (1::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row (row_echelon A) i \<noteq> row (row_echelon A) j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_rbt_joinR[simp]: "size (rbt_joinR t1 a b t2) = Suc (size t1 + size t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (rbt_joinR t1 a b t2) = Suc (size t1 + size t2)
[PROOF STEP]
by (induction t1 a b t2 rule: rbt_joinR.induct)
     (auto simp: rbt_joinR.simps split: RBT_Impl.rbt.splits RBT_Impl.color.splits)


[STATEMENT]
lemma det_one[simp]: "det (1\<^sub>m n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (1\<^sub>m n) = (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (1\<^sub>m n) = (1::'a)
[PROOF STEP]
have "det (1\<^sub>m n) = prod_list (diag_mat (1\<^sub>m n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (1\<^sub>m n) = prod_list (diag_mat (1\<^sub>m n))
[PROOF STEP]
by (rule det_upper_triangular[of _ n], auto)
[PROOF STATE]
proof (state)
this:
det (1\<^sub>m n) = prod_list (diag_mat (1\<^sub>m n))

goal (1 subgoal):
 1. det (1\<^sub>m n) = (1::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (1\<^sub>m n) = prod_list (diag_mat (1\<^sub>m n))

goal (1 subgoal):
 1. det (1\<^sub>m n) = (1::'a)
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (diag_mat (1\<^sub>m n)) = (1::'b)
[PROOF STEP]
by (induct n, auto)
[PROOF STATE]
proof (state)
this:
prod_list (diag_mat (1\<^sub>m n)) = (1::?'b2)

goal (1 subgoal):
 1. det (1\<^sub>m n) = (1::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (1\<^sub>m n) = (1::?'b3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (1\<^sub>m n) = (1::?'b3)

goal (1 subgoal):
 1. det (1\<^sub>m n) = (1::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (1\<^sub>m n) = (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_set_eq_eq: "rel_set (=) A B \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_set (=) A B \<Longrightarrow> A = B
[PROOF STEP]
unfolding rel_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>A. Bex B ((=) x)) \<and> (\<forall>y\<in>B. \<exists>x\<in>A. x = y) \<Longrightarrow> A = B
[PROOF STEP]
by fast


[STATEMENT]
lemma dagger_adjoint:
shows "dagger M = Complex_Matrix.adjoint M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M\<^sup>\<dagger> = Complex_Matrix.adjoint M
[PROOF STEP]
unfolding dagger_def Complex_Matrix.adjoint_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (dim_col M) (dim_row M) (\<lambda>(i, j). cnj (M $$ (j, i))) = Matrix.mat (dim_col M) (dim_row M) (\<lambda>(i, j). conjugate (M $$ (j, i)))
[PROOF STEP]
by (simp add: cong_mat)


[STATEMENT]
lemma degree_pCons_0: "degree (pCons a 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (pCons a 0) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (pCons a 0) = 0
[PROOF STEP]
have "degree (pCons a 0) \<le> Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (pCons a 0) \<le> Suc 0
[PROOF STEP]
by (metis (no_types) degree_0 degree_pCons_le)
[PROOF STATE]
proof (state)
this:
degree (pCons a 0) \<le> Suc 0

goal (1 subgoal):
 1. degree (pCons a 0) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree (pCons a 0) \<le> Suc 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (pCons a 0) \<le> Suc 0

goal (1 subgoal):
 1. degree (pCons a 0) = 0
[PROOF STEP]
by (metis coeff_0 coeff_pCons_Suc degree_0 eq_zero_or_degree_less less_Suc0)
[PROOF STATE]
proof (state)
this:
degree (pCons a 0) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_quotient_iff:
  assumes "equiv A R"
  shows "finite A \<longleftrightarrow> (finite (A // R) \<and> (\<forall>X \<in> A // R. finite X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A = (finite (A // R) \<and> (\<forall>X\<in>A // R. finite X))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
equiv A R

goal (1 subgoal):
 1. finite A = (finite (A // R) \<and> (\<forall>X\<in>A // R. finite X))
[PROOF STEP]
by (meson equiv_type finite_equiv_class finite_equiv_implies_finite_carrier finite_quotient)


[STATEMENT]
lemma complex_Im_numeral [simp]: "Im (numeral v) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (numeral v) = 0
[PROOF STEP]
using complex_Im_of_int [of "numeral v"]
[PROOF STATE]
proof (prove)
using this:
Im (of_int (numeral v)) = 0

goal (1 subgoal):
 1. Im (numeral v) = 0
[PROOF STEP]
by simp