[STATEMENT]
lemma (in strategic_space_2p) hermite_cnj_of_U\<^sub>B:
  shows "U\<^sub>B\<^sup>\<dagger> = U\<^sub>B_cnj"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]); j < dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])\<rbrakk> \<Longrightarrow> Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] $$ (i, j)
 2. dim_row Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
 3. dim_col Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]); j < dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])\<rbrakk> \<Longrightarrow> Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] $$ (i, j)
 2. dim_row Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
 3. dim_col Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[PROOF STEP]
assume a0:"i < dim_row U\<^sub>B_cnj" and a1:"j < dim_col U\<^sub>B_cnj"
[PROOF STATE]
proof (state)
this:
i < dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
j < dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])

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

goal (1 subgoal):
 1. Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] $$ (i, j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]); j < dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])\<rbrakk> \<Longrightarrow> Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] $$ (i, j)
[PROOF STEP]
have "i\<in>{0,1} \<and> j\<in>{0,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> {0, 1} \<and> j \<in> {0, 1}
[PROOF STEP]
using a0 a1 mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
j < dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
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} \<and> j \<in> {0, 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in> {0, 1} \<and> j \<in> {0, 1}

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

goal (1 subgoal):
 1. Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] $$ (i, j)
[PROOF STEP]
using mat_of_cols_list_def dagger_def exp_of_real_cnj exp_of_real_cnj2
[PROOF STATE]
proof (prove)
using this:
i \<in> {0, 1} \<and> j \<in> {0, 1}
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)
?M\<^sup>\<dagger> \<equiv> Matrix.mat (dim_col ?M) (dim_row ?M) (\<lambda>(i, j). cnj (?M $$ (j, i)))
cnj (exp (\<i> * complex_of_real ?x)) = exp (- (\<i> * complex_of_real ?x))
cnj (exp (- (\<i> * complex_of_real ?x))) = exp (\<i> * complex_of_real ?x)

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

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

goal (2 subgoals):
 1. dim_row Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
 2. dim_col Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_row Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
 2. dim_col Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[PROOF STEP]
show "dim_row (U\<^sub>B\<^sup>\<dagger>) = dim_row U\<^sub>B_cnj"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[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 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_row (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])

goal (1 subgoal):
 1. dim_col Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_col Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[PROOF STEP]
show "dim_col (U\<^sub>B\<^sup>\<dagger>) = dim_col U\<^sub>B_cnj"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[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 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tensor_op_left_add: \<open>(x + y) \<otimes>\<^sub>o b = x \<otimes>\<^sub>o b + y \<otimes>\<^sub>o b\<close>
  for x y :: \<open>'a::finite ell2 \<Rightarrow>\<^sub>C\<^sub>L 'c::finite ell2\<close> and b :: \<open>'b::finite ell2 \<Rightarrow>\<^sub>C\<^sub>L 'd::finite ell2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y) \<otimes>\<^sub>o b = x \<otimes>\<^sub>o b + y \<otimes>\<^sub>o b
[PROOF STEP]
apply (auto intro!: equal_ket simp: tensor_op_ket)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ba. ((x + y) *\<^sub>V ket a) \<otimes>\<^sub>s b *\<^sub>V ket ba = (x \<otimes>\<^sub>o b + y \<otimes>\<^sub>o b) *\<^sub>V ket (a, ba)
[PROOF STEP]
by (simp add: plus_cblinfun.rep_eq tensor_ell2_add1 tensor_op_ket)


[STATEMENT]
lemma sum_disc_bound':
  fixes f :: "nat \<Rightarrow> 'b \<Rightarrow>\<^sub>b real"
  assumes h: "\<forall>n. norm (f n) \<le> B"
  shows "norm (\<Sum>x. l^x *\<^sub>R f x) \<le> B /(1-l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
have "norm (\<Sum>x. l^x *\<^sub>R f x) \<le>  (\<Sum>x. norm (l^x *\<^sub>R f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> (\<Sum>x. norm (l ^ x *\<^sub>R f x))
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
\<forall>n. norm (f n) \<le> B

goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> (\<Sum>x. norm (l ^ x *\<^sub>R f x))
[PROOF STEP]
by (fastforce intro!: boundedI summable_norm)
[PROOF STATE]
proof (state)
this:
norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> (\<Sum>x. norm (l ^ x *\<^sub>R f x))

goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> (\<Sum>x. norm (l ^ x *\<^sub>R f x))

goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
have "\<dots> \<le> (\<Sum>x. l^x * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x. norm (l ^ x *\<^sub>R f x)) \<le> (\<Sum>x. l ^ x * B)
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
\<forall>n. norm (f n) \<le> B

goal (1 subgoal):
 1. (\<Sum>x. norm (l ^ x *\<^sub>R f x)) \<le> (\<Sum>x. l ^ x * B)
[PROOF STEP]
by (auto intro!: suminf_le boundedI simp: mult_mono')
[PROOF STATE]
proof (state)
this:
(\<Sum>x. norm (l ^ x *\<^sub>R f x)) \<le> (\<Sum>x. l ^ x * B)

goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x. norm (l ^ x *\<^sub>R f x)) \<le> (\<Sum>x. l ^ x * B)

goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
have "\<dots> = B /(1-l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x. l ^ x * B) = B / (1 - l)
[PROOF STEP]
by (simp add: sum_disc_lim)
[PROOF STATE]
proof (state)
this:
(\<Sum>x. l ^ x * B) = B / (1 - l)

goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
show "norm (\<Sum>x. l^x *\<^sub>R f x) \<le> B /(1-l)"
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)

goal (1 subgoal):
 1. norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (\<Sum>x. l ^ x *\<^sub>R f x) \<le> B / (1 - l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma three_divs_0:
  shows "(3::nat) dvd (10^x - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 dvd 10 ^ x - 1
[PROOF STEP]
proof (induct x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 3 dvd 10 ^ 0 - 1
 2. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. 3 dvd 10 ^ 0 - 1
 2. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 dvd 10 ^ 0 - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 dvd 10 ^ 0 - 1

goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
3 dvd 10 ^ n - 1

goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
let ?thr = "(3::nat)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
have "?thr dvd 9"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 dvd 9
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 dvd 9

goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
3 dvd 9

goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
have "?thr dvd (10*(10^n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 dvd 10 * (10 ^ n - 1)
[PROOF STEP]
by (rule dvd_mult) (rule Suc)
[PROOF STATE]
proof (state)
this:
3 dvd 10 * (10 ^ n - 1)

goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
hence "?thr dvd (10^(n+1) - 10)"
[PROOF STATE]
proof (prove)
using this:
3 dvd 10 * (10 ^ n - 1)

goal (1 subgoal):
 1. 3 dvd 10 ^ (n + 1) - 10
[PROOF STEP]
by (simp add: nat_distrib)
[PROOF STATE]
proof (state)
this:
3 dvd 10 ^ (n + 1) - 10

goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
3 dvd 9
3 dvd 10 ^ (n + 1) - 10
[PROOF STEP]
have"?thr dvd ((10^(n+1) - 10) + 9)"
[PROOF STATE]
proof (prove)
using this:
3 dvd 9
3 dvd 10 ^ (n + 1) - 10

goal (1 subgoal):
 1. 3 dvd 10 ^ (n + 1) - 10 + 9
[PROOF STEP]
by (simp only: ac_simps) (rule dvd_add)
[PROOF STATE]
proof (state)
this:
3 dvd 10 ^ (n + 1) - 10 + 9

goal (1 subgoal):
 1. \<And>x. 3 dvd 10 ^ x - 1 \<Longrightarrow> 3 dvd 10 ^ Suc x - 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
3 dvd 10 ^ (n + 1) - 10 + 9

goal (1 subgoal):
 1. 3 dvd 10 ^ Suc n - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 dvd 10 ^ Suc n - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aff_dim_geq:
  fixes V :: "'n::euclidean_space set"
  shows "aff_dim V \<ge> -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 \<le> aff_dim V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - 1 \<le> aff_dim V
[PROOF STEP]
obtain B where "affine hull B = affine hull V"
    and "\<not> affine_dependent B"
    and "int (card B) = aff_dim V + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>affine hull B = affine hull V; \<not> affine_dependent B; int (card B) = aff_dim V + 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using aff_dim_basis_exists
[PROOF STATE]
proof (prove)
using this:
\<exists>B. affine hull B = affine hull ?V \<and> \<not> affine_dependent B \<and> int (card B) = aff_dim ?V + 1

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>affine hull B = affine hull V; \<not> affine_dependent B; int (card B) = aff_dim V + 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
affine hull B = affine hull V
\<not> affine_dependent B
int (card B) = aff_dim V + 1

goal (1 subgoal):
 1. - 1 \<le> aff_dim V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine hull B = affine hull V
\<not> affine_dependent B
int (card B) = aff_dim V + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
affine hull B = affine hull V
\<not> affine_dependent B
int (card B) = aff_dim V + 1

goal (1 subgoal):
 1. - 1 \<le> aff_dim V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- 1 \<le> aff_dim V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ai_exists1_gt0:
  assumes "\<And>n. a n \<in> {0,1}"
      and "\<exists>i. a i = 1"
    shows "0 < (\<Sum>n::nat. real (a n) * (1/2)^(Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
obtain k where h1: "a k = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. a k = 1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
\<exists>i. a i = 1

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

goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
have "(1/2)^(Suc k) = (\<Sum>n::nat. (if n = k then (1/2)^(Suc k) else (0::real)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
have "(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else (0::real)) = (\<lambda>n. if n = k then (1/2)^(Suc k) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) = (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) = (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)

goal (1 subgoal):
 1. (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) = (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)

goal (1 subgoal):
 1. (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
have "(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else (0::real)) sums (\<Sum>r\<in>{k}. (1 / 2) ^ Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) sums (\<Sum>r\<in>{k}. (1 / 2) ^ Suc k)
[PROOF STEP]
using sums_If_finite_set[of "{k}" "\<lambda>n. ((1::real)/2)^(Suc k)"]
[PROOF STATE]
proof (prove)
using this:
finite {k} \<Longrightarrow> (\<lambda>r. if r \<in> {k} then (1 / 2) ^ Suc k else 0) sums (\<Sum>r\<in>{k}. (1 / 2) ^ Suc k)

goal (1 subgoal):
 1. (\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) sums (\<Sum>r\<in>{k}. (1 / 2) ^ Suc k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) sums (\<Sum>r\<in>{k}. (1 / 2) ^ Suc k)

goal (1 subgoal):
 1. (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) = (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)
(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) sums (\<Sum>r\<in>{k}. (1 / 2) ^ Suc k)
[PROOF STEP]
have "(\<lambda>n. if n = k then (1 / 2) ^ Suc k else (0::real)) sums (1/2)^(Suc k)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) = (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)
(\<lambda>n. if n \<in> {k} then (1 / 2) ^ Suc k else 0) sums (\<Sum>r\<in>{k}. (1 / 2) ^ Suc k)

goal (1 subgoal):
 1. (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0) sums (1 / 2) ^ Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0) sums (1 / 2) ^ Suc k

goal (1 subgoal):
 1. (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0) sums (1 / 2) ^ Suc k

goal (1 subgoal):
 1. (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
using sums_unique[of "\<lambda>n. if n = k then (1 / 2) ^ Suc k else (0::real)" "(1/2)^(Suc k)"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0) sums (1 / 2) ^ Suc k
(\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0) sums (1 / 2) ^ Suc k \<Longrightarrow> (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)

goal (1 subgoal):
 1. (1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)

goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ Suc k = (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0)

goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
have "(\<Sum>n::nat. (if n = k then (1/2)^(Suc k) else 0)) \<le> (\<Sum>n::nat. real (a n) * (1/2)^(Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0) \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
proof(rule suminf_le)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. (if n = k then (1 / 2) ^ Suc k else 0) \<le> real (a n) * (1 / 2) ^ Suc n
 2. summable (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)
 3. summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
show "\<And>n. (if n = k then (1 / 2) ^ Suc k else 0) \<le> real (a n) * (1 / 2) ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (if n = k then (1 / 2) ^ Suc k else 0) \<le> real (a n) * (1 / 2) ^ Suc n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (if n = k then (1 / 2) ^ Suc k else 0) \<le> real (a n) * (1 / 2) ^ Suc n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (if n = k then (1 / 2) ^ Suc k else 0) \<le> real (a n) * (1 / 2) ^ Suc n
[PROOF STEP]
show "(if n = k then (1 / 2) ^ Suc k else 0) \<le> real (a n) * (1 / 2) ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if n = k then (1 / 2) ^ Suc k else 0) \<le> real (a n) * (1 / 2) ^ Suc n
[PROOF STEP]
by(cases "n = k"; simp add: h1)
[PROOF STATE]
proof (state)
this:
(if n = k then (1 / 2) ^ Suc k else 0) \<le> real (a n) * (1 / 2) ^ Suc n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if ?n = k then (1 / 2) ^ Suc k else 0) \<le> real (a ?n) * (1 / 2) ^ Suc ?n

goal (2 subgoals):
 1. summable (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)
 2. summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)
 2. summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
show "summable (\<lambda>n. if n = k then (1 / 2) ^ Suc k else (0::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
using summable_single[of k "\<lambda>n. ((1::real) / 2) ^ Suc k"]
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>r. if r = k then (1 / 2) ^ Suc k else 0)

goal (1 subgoal):
 1. summable (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. if n = k then (1 / 2) ^ Suc k else 0)

goal (1 subgoal):
 1. summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
show "summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
using binary_expression_summable[of a] assms(1)
[PROOF STATE]
proof (prove)
using this:
(\<And>n. a n \<in> {0, 1}) \<Longrightarrow> summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
a ?n \<in> {0, 1}

goal (1 subgoal):
 1. summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>n. if n = k then (1 / 2) ^ Suc k else 0) \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 / 2) ^ Suc k \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
have "(1 / 2) ^ Suc k \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)"
[PROOF STATE]
proof (prove)
using this:
(1 / 2) ^ Suc k \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. (1 / 2) ^ Suc k \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ Suc k \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ Suc k \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
have "0 < ((1::real) / 2) ^ Suc k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (1 / 2) ^ Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < (1 / 2) ^ Suc k

goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(1 / 2) ^ Suc k \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
0 < (1 / 2) ^ Suc k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 / 2) ^ Suc k \<le> (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
0 < (1 / 2) ^ Suc k

goal (1 subgoal):
 1. 0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < (\<Sum>n. real (a n) * (1 / 2) ^ Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_R1_finite:
  assumes "finite A"
  shows "finite (to_R1` A)"
        "card A = card (to_R1` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((\<lambda>a. [a]) ` A) &&& card A = card ((\<lambda>a. [a]) ` A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. finite ((\<lambda>a. [a]) ` A) &&& card A = card ((\<lambda>a. [a]) ` A)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = card ((\<lambda>a. [a]) ` A)
[PROOF STEP]
apply(rule finite.induct[of A])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite A
 2. card {} = card ((\<lambda>a. [a]) ` {})
 3. \<And>A a. \<lbrakk>finite A; card A = card ((\<lambda>a. [a]) ` A)\<rbrakk> \<Longrightarrow> card (insert a A) = card ((\<lambda>a. [a]) ` insert a A)
[PROOF STEP]
apply (simp add: assms(1))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. card {} = card ((\<lambda>a. [a]) ` {})
 2. \<And>A a. \<lbrakk>finite A; card A = card ((\<lambda>a. [a]) ` A)\<rbrakk> \<Longrightarrow> card (insert a A) = card ((\<lambda>a. [a]) ` insert a A)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; card A = card ((\<lambda>a. [a]) ` A)\<rbrakk> \<Longrightarrow> card (insert a A) = card ((\<lambda>a. [a]) ` insert a A)
[PROOF STEP]
by (smt card_insert_if finite_imageI image_iff image_insert list.inject)


[STATEMENT]
theorem f_drop_induct[rule_format]: "
  \<lbrakk> P (s \<up> 0);
    \<And>n.  \<lbrakk> Suc n < length s; P (s \<up> n) \<rbrakk> \<Longrightarrow> P ( s \<up> Suc n);
    i < length s\<rbrakk>
  \<Longrightarrow> P (s \<up> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P (s \<up> 0); \<And>n. \<lbrakk>Suc n < length s; P (s \<up> n)\<rbrakk> \<Longrightarrow> P (s \<up> Suc n); i < length s\<rbrakk> \<Longrightarrow> P (s \<up> i)
[PROOF STEP]
by (induct i, simp+)


[STATEMENT]
lemma full_rank_imp_is_basis2:
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
  assumes r: "rank A = ncols A"
  shows "vec.independent (columns A) \<and> vec.span (columns A) = col_space A
        \<and> card (columns A) = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
have "rank A = col_rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = col_rank A
[PROOF STEP]
unfolding rank_col_rank
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col_rank A = col_rank A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
rank A = col_rank A

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank A = col_rank A

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
have "... = vec.dim (col_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col_rank A = vec.dim (col_space A)
[PROOF STEP]
unfolding col_rank_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (col_space A) = vec.dim (col_space A)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
col_rank A = vec.dim (col_space A)

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
col_rank A = vec.dim (col_space A)

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
have "... = card (columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (col_space A) = card (columns A)
[PROOF STEP]
by (metis (full_types) antisym_conv calculation card_columns_le_ncols col_space_def
        finite_columns r vec.dim_le_card vec.dim_span vec.span_superset)
[PROOF STATE]
proof (state)
this:
vec.dim (col_space A) = card (columns A)

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rank A = card (columns A)
[PROOF STEP]
have *: "rank A = card (columns A)"
[PROOF STATE]
proof (prove)
using this:
rank A = card (columns A)

goal (1 subgoal):
 1. rank A = card (columns A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rank A = card (columns A)

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rank A = card (columns A)
[PROOF STEP]
have c_eq: "card (columns A) = ncols A"
[PROOF STATE]
proof (prove)
using this:
rank A = card (columns A)

goal (1 subgoal):
 1. card (columns A) = ncols A
[PROOF STEP]
unfolding r
[PROOF STATE]
proof (prove)
using this:
ncols A = card (columns A)

goal (1 subgoal):
 1. card (columns A) = ncols A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
card (columns A) = ncols A

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (columns A) = ncols A

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
have "vec.independent (columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (columns A)
[PROOF STEP]
by (metis * vec.card_eq_dim_span_indep
      col_rank_def col_space_def finite_columns rank_col_rank)
[PROOF STATE]
proof (state)
this:
vec.independent (columns A)

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec.independent (columns A)

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
have "vec.span (columns A) = col_space A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.span (columns A) = col_space A
[PROOF STEP]
by (metis col_space_def)
[PROOF STATE]
proof (state)
this:
vec.span (columns A) = col_space A

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (columns A) = ncols A
vec.independent (columns A)
vec.span (columns A) = col_space A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (columns A) = ncols A
vec.independent (columns A)
vec.span (columns A) = col_space A

goal (1 subgoal):
 1. vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec.independent (columns A) \<and> vec.span (columns A) = col_space A \<and> card (columns A) = ncols A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma even_succ_mod_exp [simp]:
  \<open>(1 + a) mod 2 ^ n = 1 + (a mod 2 ^ n)\<close> if \<open>even a\<close> and \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'a) + a) mod (2::'a) ^ n = (1::'a) + a mod (2::'a) ^ n
[PROOF STEP]
using div_mult_mod_eq [of \<open>1 + a\<close> \<open>2 ^ n\<close>] that
[PROOF STATE]
proof (prove)
using this:
((1::'a) + a) div (2::'a) ^ n * (2::'a) ^ n + ((1::'a) + a) mod (2::'a) ^ n = (1::'a) + a
even a
0 < n

goal (1 subgoal):
 1. ((1::'a) + a) mod (2::'a) ^ n = (1::'a) + a mod (2::'a) ^ n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a div (2::'a) ^ n * (2::'a) ^ n + ((1::'a) + a) mod (2::'a) ^ n = (1::'a) + a; even a; 0 < n\<rbrakk> \<Longrightarrow> ((1::'a) + a) mod (2::'a) ^ n = (1::'a) + a mod (2::'a) ^ n
[PROOF STEP]
by (metis local.add.left_commute local.add_left_cancel local.div_mult_mod_eq)


[STATEMENT]
lemma inf_Inf:
  "A \<noteq> {} \<Longrightarrow> inf x (Inf A) = Inf ((inf x) ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> x \<sqinter> Inf A = Inf ((\<sqinter>) x ` A)
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A \<noteq> {} \<Longrightarrow> x \<sqinter> Inf A \<le> Inf ((\<sqinter>) x ` A)
 2. A \<noteq> {} \<Longrightarrow> Inf ((\<sqinter>) x ` A) \<le> x \<sqinter> Inf A
[PROOF STEP]
apply (meson INF_greatest Inf_lower inf.sup_right_isotone)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Inf ((\<sqinter>) x ` A) \<le> x \<sqinter> Inf A
[PROOF STEP]
by (simp add: INF_inf_const1)


[STATEMENT]
lemma smult_monom: "smult a (monom b n) = monom (a * b) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult a (monom b n) = monom (a * b) n
[PROOF STEP]
by (induct n) (simp_all add: monom_0 monom_Suc)


[STATEMENT]
lemma higher_pderiv_monom:
  "k \<le> n \<Longrightarrow> (pderiv ^^ k) (monom c n) = monom (of_nat (pochhammer (n - k + 1) k) * c) (n - k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> (pderiv ^^ k) (Polynomial.monom c n) = Polynomial.monom (of_nat (pochhammer (n - k + 1) k) * c) (n - k)
[PROOF STEP]
by (induction k) (auto simp: pderiv_monom pochhammer_rec Suc_diff_le Suc_diff_Suc mult_ac)


[STATEMENT]
lemma mset_le_add_iff2:
  "i \<le> (j::nat) \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (m \<le> repeat_mset (j-i) u + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (m \<le> repeat_mset (j - i) u + n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (m \<le> repeat_mset (j - i) u + n)
[PROOF STEP]
assume "i \<le> j"
[PROOF STATE]
proof (state)
this:
i \<le> j

goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (m \<le> repeat_mset (j - i) u + n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<le> j
[PROOF STEP]
have "i + (j - i) = j"
[PROOF STATE]
proof (prove)
using this:
i \<le> j

goal (1 subgoal):
 1. i + (j - i) = j
[PROOF STEP]
using le_add_diff_inverse
[PROOF STATE]
proof (prove)
using this:
i \<le> j
?b \<le> ?a \<Longrightarrow> ?b + (?a - ?b) = ?a

goal (1 subgoal):
 1. i + (j - i) = j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i + (j - i) = j

goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (m \<le> repeat_mset (j - i) u + n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i + (j - i) = j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i + (j - i) = j

goal (1 subgoal):
 1. (repeat_mset i u + m \<le> repeat_mset j u + n) = (m \<le> repeat_mset (j - i) u + n)
[PROOF STEP]
by (metis (no_types) add_le_cancel_left left_add_mult_distrib_mset)
[PROOF STATE]
proof (state)
this:
(repeat_mset i u + m \<le> repeat_mset j u + n) = (m \<le> repeat_mset (j - i) u + n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Domainp_fun:
  assumes "left_unique A"
  shows
    "Domainp (rel_fun A B) =
      (\<lambda>f. f ` (Collect (Domainp A)) \<subseteq> (Collect (Domainp B)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domainp (A ===> B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Domainp (A ===> B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))
[PROOF STEP]
have
    "pred_fun (Domainp A) (Domainp B) =
      (\<lambda>f. f ` (Collect (Domainp A)) \<subseteq> (Collect (Domainp B)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pred_fun (Domainp A) (Domainp B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))
[PROOF STEP]
by (simp add: image_subset_iff)
[PROOF STATE]
proof (state)
this:
pred_fun (Domainp A) (Domainp B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))

goal (1 subgoal):
 1. Domainp (A ===> B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))
[PROOF STEP]
from Domainp_pred_fun_eq[OF \<open>left_unique A\<close>, of B, unfolded this]
[PROOF STATE]
proof (chain)
picking this:
Domainp (A ===> B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Domainp (A ===> B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))

goal (1 subgoal):
 1. Domainp (A ===> B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Domainp (A ===> B) = (\<lambda>f. f ` Collect (Domainp A) \<subseteq> Collect (Domainp B))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_filter_sort_nth:
  assumes "distinct xs" "n < length xs"
  shows "length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
have "length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = length (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = length (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs))
[PROOF STEP]
by (simp add: filter_sort)
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = length (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs))

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = length (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs))

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
have "... = size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)) = size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)))
[PROOF STEP]
using size_mset
[PROOF STATE]
proof (prove)
using this:
size (mset ?xs) = length ?xs

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)) = size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)) = size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)))

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)) = size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs)))

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
have "... = size ({# x \<in># mset (sort xs). x \<le> sort xs ! n #})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs))) = size {#x \<in># mset (sort xs). x \<le> sort xs ! n#}
[PROOF STEP]
using mset_filter
[PROOF STATE]
proof (prove)
using this:
mset (filter ?P ?xs) = filter_mset ?P (mset ?xs)

goal (1 subgoal):
 1. size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs))) = size {#x \<in># mset (sort xs). x \<le> sort xs ! n#}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs))) = size {#x \<in># mset (sort xs). x \<le> sort xs ! n#}

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
size (mset (filter (\<lambda>x. x \<le> sort xs ! n) (sort xs))) = size {#x \<in># mset (sort xs). x \<le> sort xs ! n#}

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
have "... = size (mset (take (n + 1) (sort xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size {#x \<in># mset (sort xs). x \<le> sort xs ! n#} = size (mset (take (n + 1) (sort xs)))
[PROOF STEP]
using length_filter_mset_sorted_nth assms sorted_sort distinct_sort length_sort
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distinct ?xs; ?n < length ?xs; sorted ?xs\<rbrakk> \<Longrightarrow> {#x \<in># mset ?xs. x \<le> ?xs ! ?n#} = mset (take (?n + 1) ?xs)
distinct xs
n < length xs
sorted (sort ?xs)
distinct (sort_key ?f ?xs) = distinct ?xs
length (sort_key ?f ?xs) = length ?xs

goal (1 subgoal):
 1. size {#x \<in># mset (sort xs). x \<le> sort xs ! n#} = size (mset (take (n + 1) (sort xs)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
size {#x \<in># mset (sort xs). x \<le> sort xs ! n#} = size (mset (take (n + 1) (sort xs)))

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = size (mset (take (n + 1) (sort xs)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = size (mset (take (n + 1) (sort xs)))

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = size (mset (take (n + 1) (sort xs)))
n < length xs

goal (1 subgoal):
 1. length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x. x \<le> sort xs ! n) xs) = n + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_vm_inv:
  assumes "x =  y *\<^sub>v\<^sub>m A" and "mat_det A \<noteq> 0"
  shows "y = x *\<^sub>v\<^sub>m (mat_inv A) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = x *\<^sub>v\<^sub>m mat_inv A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = y *\<^sub>v\<^sub>m A
mat_det A \<noteq> 0

goal (1 subgoal):
 1. y = x *\<^sub>v\<^sub>m mat_inv A
[PROOF STEP]
by (cases y) (simp add: mat_inv_r)


[STATEMENT]
lemma eln_mono2 [mono_intros]:
  assumes "x \<le> y"
  shows "eln x \<le> eln y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eln x \<le> eln y
[PROOF STEP]
using eln_mono assms
[PROOF STATE]
proof (prove)
using this:
mono eln
x \<le> y

goal (1 subgoal):
 1. eln x \<le> eln y
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x \<le> y \<longrightarrow> eln x \<le> eln y
x \<le> y

goal (1 subgoal):
 1. eln x \<le> eln y
[PROOF STEP]
by auto


[STATEMENT]
lemma sq_mtx_diag_simps[simp]:
  "i = j \<Longrightarrow> sq_mtx_diag f $$ i $ j = f i"
  "i \<noteq> j \<Longrightarrow> sq_mtx_diag f $$ i $ j = 0"
  "sq_mtx_diag f $$ i = axis i (f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i = j \<Longrightarrow> sq_mtx_diag f $$ i $ j = f i) &&& (i \<noteq> j \<Longrightarrow> sq_mtx_diag f $$ i $ j = 0) &&& sq_mtx_diag f $$ i = axis i (f i)
[PROOF STEP]
unfolding sq_mtx_diag_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i = j \<Longrightarrow> map_fun id to_mtx diag_mat f $$ i $ j = f i) &&& (i \<noteq> j \<Longrightarrow> map_fun id to_mtx diag_mat f $$ i $ j = 0) &&& map_fun id to_mtx diag_mat f $$ i = axis i (f i)
[PROOF STEP]
by (simp_all add: axis_def vec_eq_iff)


[STATEMENT]
lemma NSsummable_comparison_test: "\<exists>N. \<forall>n. N \<le> n \<longrightarrow> \<bar>f n\<bar> \<le> g n \<Longrightarrow> NSsummable g \<Longrightarrow> NSsummable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>N. \<forall>n\<ge>N. \<bar>f n\<bar> \<le> g n; NSsummable g\<rbrakk> \<Longrightarrow> NSsummable f
[PROOF STEP]
by (metis real_norm_def summable_NSsummable_iff summable_comparison_test)


[STATEMENT]
lemma iim_nonempty:"\<lbrakk>Group F; Group G; f \<in> gHom F G; G \<guillemotright> K\<rbrakk> \<Longrightarrow>
                       (iim F G f K) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; G \<guillemotright> K \<rbrakk> \<Longrightarrow> iim F G f K \<noteq> {}
[PROOF STEP]
apply (frule Group.sg_unit_closed[of "G" "K"], assumption+,
       frule Group.unit_closed[of "F"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; G \<guillemotright> K ; \<one>\<^bsub>G\<^esub> \<in> K; \<one>\<^bsub>F\<^esub> \<in> carrier F\<rbrakk> \<Longrightarrow> iim F G f K \<noteq> {}
[PROOF STEP]
apply (frule ghom_unit_unit[of "F" "G" "f"], assumption+, simp add:iim_def,
       frule sym, thin_tac "f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; G \<guillemotright> K ; f \<one>\<^bsub>F\<^esub> \<in> K; \<one>\<^bsub>F\<^esub> \<in> carrier F; \<one>\<^bsub>G\<^esub> = f \<one>\<^bsub>F\<^esub>\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> carrier F \<and> f x \<in> K
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "0 \<le> (x::real) \<and> 0 \<le> y \<longrightarrow> x * y * (x + y)\<^sup>2 \<le> (x\<^sup>2 + y\<^sup>2)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<and> 0 \<le> y \<longrightarrow> x * y * (x + y)\<^sup>2 \<le> (x\<^sup>2 + y\<^sup>2)\<^sup>2
[PROOF STEP]
by sos


[STATEMENT]
lemma continuous_on_arcsin': "continuous_on {-1 .. 1} arcsin"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {- 1..1} arcsin
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on {- 1..1} arcsin
[PROOF STEP]
have "continuous_on (sin ` {- pi/2 .. pi/2}) arcsin"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (sin ` {- pi / 2..pi / 2}) arcsin
[PROOF STEP]
by (rule continuous_on_inv) (auto intro: continuous_intros simp: arcsin_sin)
[PROOF STATE]
proof (state)
this:
continuous_on (sin ` {- pi / 2..pi / 2}) arcsin

goal (1 subgoal):
 1. continuous_on {- 1..1} arcsin
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
continuous_on (sin ` {- pi / 2..pi / 2}) arcsin

goal (1 subgoal):
 1. continuous_on {- 1..1} arcsin
[PROOF STEP]
have "sin ` {- pi/2 .. pi/2} = {-1 .. 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin ` {- pi / 2..pi / 2} = {- 1..1}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. xa \<in> {- pi / 2..pi / 2} \<Longrightarrow> sin xa \<in> {- 1..1}
 2. \<And>x. x \<in> {- 1..1} \<Longrightarrow> x \<in> sin ` {- pi / 2..pi / 2}
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. xa \<in> {- pi / 2..pi / 2} \<Longrightarrow> sin xa \<in> {- 1..1}
 2. \<And>x. x \<in> {- 1..1} \<Longrightarrow> x \<in> sin ` {- pi / 2..pi / 2}
[PROOF STEP]
assume "x \<in> {-1..1}"
[PROOF STATE]
proof (state)
this:
x \<in> {- 1..1}

goal (2 subgoals):
 1. \<And>x xa. xa \<in> {- pi / 2..pi / 2} \<Longrightarrow> sin xa \<in> {- 1..1}
 2. \<And>x. x \<in> {- 1..1} \<Longrightarrow> x \<in> sin ` {- pi / 2..pi / 2}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {- 1..1}
[PROOF STEP]
show "x \<in> sin ` {- pi/2..pi/2}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {- 1..1}

goal (1 subgoal):
 1. x \<in> sin ` {- pi / 2..pi / 2}
[PROOF STEP]
using arcsin_lbound arcsin_ubound
[PROOF STATE]
proof (prove)
using this:
x \<in> {- 1..1}
\<lbrakk>- 1 \<le> ?y; ?y \<le> 1\<rbrakk> \<Longrightarrow> - (pi / 2) \<le> arcsin ?y
\<lbrakk>- 1 \<le> ?y; ?y \<le> 1\<rbrakk> \<Longrightarrow> arcsin ?y \<le> pi / 2

goal (1 subgoal):
 1. x \<in> sin ` {- pi / 2..pi / 2}
[PROOF STEP]
by (intro image_eqI[where x="arcsin x"]) auto
[PROOF STATE]
proof (state)
this:
x \<in> sin ` {- pi / 2..pi / 2}

goal (1 subgoal):
 1. \<And>x xa. xa \<in> {- pi / 2..pi / 2} \<Longrightarrow> sin xa \<in> {- 1..1}
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
sin ` {- pi / 2..pi / 2} = {- 1..1}

goal (1 subgoal):
 1. continuous_on {- 1..1} arcsin
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
continuous_on {- 1..1} arcsin
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on {- 1..1} arcsin

goal (1 subgoal):
 1. continuous_on {- 1..1} arcsin
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
continuous_on {- 1..1} arcsin

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_ge_add_one_self_aux:
  fixes x :: real
  assumes "0 \<le> x"
  shows "1 + x \<le> exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + x \<le> exp x
[PROOF STEP]
using order_le_imp_less_or_eq [OF assms]
[PROOF STATE]
proof (prove)
using this:
0 < x \<or> 0 = x

goal (1 subgoal):
 1. 1 + x \<le> exp x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 1 + x \<le> exp x
 2. 0 = x \<Longrightarrow> 1 + x \<le> exp x
[PROOF STEP]
assume "0 < x"
[PROOF STATE]
proof (state)
this:
0 < x

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 1 + x \<le> exp x
 2. 0 = x \<Longrightarrow> 1 + x \<le> exp x
[PROOF STEP]
have "1 + x \<le> (\<Sum>n<2. inverse (fact n) * x^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + x \<le> (\<Sum>n<2. inverse (fact n) * x ^ n)
[PROOF STEP]
by (auto simp: numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
1 + x \<le> (\<Sum>n<2. inverse (fact n) * x ^ n)

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 1 + x \<le> exp x
 2. 0 = x \<Longrightarrow> 1 + x \<le> exp x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 + x \<le> (\<Sum>n<2. inverse (fact n) * x ^ n)

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 1 + x \<le> exp x
 2. 0 = x \<Longrightarrow> 1 + x \<le> exp x
[PROOF STEP]
have "\<dots> \<le> (\<Sum>n. inverse (fact n) * x^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n<2. inverse (fact n) * x ^ n) \<le> (\<Sum>n. inverse (fact n) * x ^ n)
[PROOF STEP]
using \<open>0 < x\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. (\<Sum>n<2. inverse (fact n) * x ^ n) \<le> (\<Sum>n. inverse (fact n) * x ^ n)
[PROOF STEP]
by (auto  simp add: zero_le_mult_iff intro: sum_le_suminf [OF summable_exp])
[PROOF STATE]
proof (state)
this:
(\<Sum>n<2. inverse (fact n) * x ^ n) \<le> (\<Sum>n. inverse (fact n) * x ^ n)

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 1 + x \<le> exp x
 2. 0 = x \<Longrightarrow> 1 + x \<le> exp x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 + x \<le> (\<Sum>n. inverse (fact n) * x ^ n)
[PROOF STEP]
show "1 + x \<le> exp x"
[PROOF STATE]
proof (prove)
using this:
1 + x \<le> (\<Sum>n. inverse (fact n) * x ^ n)

goal (1 subgoal):
 1. 1 + x \<le> exp x
[PROOF STEP]
by (simp add: exp_def)
[PROOF STATE]
proof (state)
this:
1 + x \<le> exp x

goal (1 subgoal):
 1. 0 = x \<Longrightarrow> 1 + x \<le> exp x
[PROOF STEP]
qed auto


[STATEMENT]
lemma unitary_col_inner_prod:
  assumes "A \<in> carrier_mat n n"
  and "0 < n"
and "Complex_Matrix.unitary A"
and "j < n"
and "k < n"
shows "Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) =
  (1\<^sub>m n) $$ (j,k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
have "Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) =
    (Complex_Matrix.adjoint A * A) $$ (j, k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = (Complex_Matrix.adjoint A * A) $$ (j, k)
[PROOF STEP]
using inner_prod_adjoint_comp[of A n A] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A \<in> carrier_mat n n; A \<in> carrier_mat n n; ?i < n; ?j < n\<rbrakk> \<Longrightarrow> Complex_Matrix.inner_prod (Matrix.col A ?i) (Matrix.col A ?j) = (Complex_Matrix.adjoint A * A) $$ (?i, ?j)
A \<in> carrier_mat n n
0 < n
Complex_Matrix.unitary A
j < n
k < n

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = (Complex_Matrix.adjoint A * A) $$ (j, k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = (Complex_Matrix.adjoint A * A) $$ (j, k)

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = (Complex_Matrix.adjoint A * A) $$ (j, k)

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
have "... = (1\<^sub>m n) $$ (j,k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Complex_Matrix.adjoint A * A) $$ (j, k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
0 < n
Complex_Matrix.unitary A
j < n
k < n

goal (1 subgoal):
 1. (Complex_Matrix.adjoint A * A) $$ (j, k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
unfolding Complex_Matrix.unitary_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
0 < n
A \<in> carrier_mat (dim_row A) (dim_row A) \<and> inverts_mat A (Complex_Matrix.adjoint A)
j < n
k < n

goal (1 subgoal):
 1. (Complex_Matrix.adjoint A * A) $$ (j, k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
by (simp add: assms(3))
[PROOF STATE]
proof (state)
this:
(Complex_Matrix.adjoint A * A) $$ (j, k) = 1\<^sub>m n $$ (j, k)

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (Matrix.col A j) (Matrix.col A k) = 1\<^sub>m n $$ (j, k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma CDERIV_inverse: "x \<noteq> 0 \<Longrightarrow> DERIV (\<lambda>x. inverse x) x :> - (inverse x)\<^sup>2"
  for x :: complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> (inverse has_field_derivative - (inverse x)\<^sup>2) (at x)
[PROOF STEP]
unfolding numeral_2_eq_2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> (inverse has_field_derivative - (inverse x ^ Suc (Suc 0))) (at x)
[PROOF STEP]
by (rule DERIV_inverse)


[STATEMENT]
lemma unitary_is_sq_length_preserving_bis [simp]:
  assumes "unitary U" and "dim_row v = dim_col U" and "dim_col v = 1"
  shows "\<parallel>col (U * v) 0\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>col (U * v) 0\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<parallel>col (U * v) 0\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
have "dim_vec (col v 0) = dim_col U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (col v 0) = dim_col U
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
dim_row v = dim_col U

goal (1 subgoal):
 1. dim_vec (col v 0) = dim_col U
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_vec (col v 0) = dim_col U

goal (1 subgoal):
 1. \<parallel>col (U * v) 0\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim_vec (col v 0) = dim_col U
[PROOF STEP]
have "\<parallel>col_fst (U * |col v 0\<rangle>)\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
dim_vec (col v 0) = dim_col U

goal (1 subgoal):
 1. \<parallel>col_fst (U * |col v 0\<rangle>)\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
using unitary_is_sq_length_preserving[of "U" "col v 0"] assms(1)
[PROOF STATE]
proof (prove)
using this:
dim_vec (col v 0) = dim_col U
\<lbrakk>unitary U; dim_vec (col v 0) = dim_col U\<rbrakk> \<Longrightarrow> \<parallel>col_fst (U * |col v 0\<rangle>)\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
unitary U

goal (1 subgoal):
 1. \<parallel>col_fst (U * |col v 0\<rangle>)\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>col_fst (U * |col v 0\<rangle>)\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>col (U * v) 0\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<parallel>col_fst (U * |col v 0\<rangle>)\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<parallel>col (U * v) 0\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
\<parallel>col_fst (U * |col v 0\<rangle>)\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
dim_col v = 1

goal (1 subgoal):
 1. \<parallel>col (U * v) 0\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<parallel>col (U * v) 0\<parallel>\<^sup>2 = \<parallel>col v 0\<parallel>\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_diff: assumes A: "A \<subseteq> carrier_vec n"
  and a: "a \<in> span A" and b: "b \<in> span A"
shows "a - b \<in> span A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b \<in> local.span A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a - b \<in> local.span A
[PROOF STEP]
from A a
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> carrier_vec n
a \<in> local.span A
[PROOF STEP]
have an: "a \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier_vec n
a \<in> local.span A

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

goal (1 subgoal):
 1. a - b \<in> local.span A
[PROOF STEP]
from A b
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> carrier_vec n
b \<in> local.span A
[PROOF STEP]
have bn: "b \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier_vec n
b \<in> local.span A

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

goal (1 subgoal):
 1. a - b \<in> local.span A
[PROOF STEP]
have "a + (-1 \<cdot>\<^sub>v b) \<in> span A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + - (1::'a) \<cdot>\<^sub>v b \<in> local.span A
[PROOF STEP]
by (rule span_add1[OF A a], insert b A, auto)
[PROOF STATE]
proof (state)
this:
a + - (1::'a) \<cdot>\<^sub>v b \<in> local.span A

goal (1 subgoal):
 1. a - b \<in> local.span A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a + - (1::'a) \<cdot>\<^sub>v b \<in> local.span A

goal (1 subgoal):
 1. a - b \<in> local.span A
[PROOF STEP]
have "a + (-1 \<cdot>\<^sub>v b) = a - b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + - (1::'a) \<cdot>\<^sub>v b = a - b
[PROOF STEP]
using an bn
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier_vec n
b \<in> carrier_vec n

goal (1 subgoal):
 1. a + - (1::'a) \<cdot>\<^sub>v b = a - b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a + - (1::'a) \<cdot>\<^sub>v b = a - b

goal (1 subgoal):
 1. a - b \<in> local.span A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a - b \<in> local.span A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a - b \<in> local.span A

goal (1 subgoal):
 1. a - b \<in> local.span A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a - b \<in> local.span A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_UNIV[simp]: "dim UNIV = card Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim UNIV = card Basis
[PROOF STEP]
using dim_eq_card[of Basis UNIV]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>span Basis = span UNIV; independent Basis\<rbrakk> \<Longrightarrow> dim UNIV = card Basis

goal (1 subgoal):
 1. dim UNIV = card Basis
[PROOF STEP]
by (simp add: independent_Basis span_Basis)


[STATEMENT]
theorem inorder_del:
  "\<lbrakk> avl t; sorted(inorder t) \<rbrakk>  \<Longrightarrow> inorder (tree(del x t)) = del_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>avl t; Sorted_Less.sorted (Tree2.inorder t)\<rbrakk> \<Longrightarrow> Tree2.inorder (tree (del x t)) = del_list x (Tree2.inorder t)
[PROOF STEP]
apply(induction t rule: tree2_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>avl \<langle>\<rangle>; Sorted_Less.sorted (Tree2.inorder \<langle>\<rangle>)\<rbrakk> \<Longrightarrow> Tree2.inorder (tree (del x \<langle>\<rangle>)) = del_list x (Tree2.inorder \<langle>\<rangle>)
 2. \<And>x1 a b x3. \<lbrakk>\<lbrakk>avl x1; Sorted_Less.sorted (Tree2.inorder x1)\<rbrakk> \<Longrightarrow> Tree2.inorder (tree (del x x1)) = del_list x (Tree2.inorder x1); \<lbrakk>avl x3; Sorted_Less.sorted (Tree2.inorder x3)\<rbrakk> \<Longrightarrow> Tree2.inorder (tree (del x x3)) = del_list x (Tree2.inorder x3); avl \<langle>x1, (a, b), x3\<rangle>; Sorted_Less.sorted (Tree2.inorder \<langle>x1, (a, b), x3\<rangle>)\<rbrakk> \<Longrightarrow> Tree2.inorder (tree (del x \<langle>x1, (a, b), x3\<rangle>)) = del_list x (Tree2.inorder \<langle>x1, (a, b), x3\<rangle>)
[PROOF STEP]
apply(auto simp: del_list_simps inorder_baldL inorder_baldR avl_delete inorder_split_maxD
           simp del: baldR.simps baldL.simps split!: splits prod.splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma convex_hull_affinity:
  "convex hull ((\<lambda>x. a + c *\<^sub>R x) ` S) = (\<lambda>x. a + c *\<^sub>R x) ` (convex hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull (\<lambda>x. a + c *\<^sub>R x) ` S = (\<lambda>x. a + c *\<^sub>R x) ` (convex hull S)
[PROOF STEP]
by (metis convex_hull_scaling convex_hull_translation image_image)


[STATEMENT]
lemma card_inj: "f \<in> A \<rightarrow> B \<Longrightarrow> inj_on f A \<Longrightarrow> finite B \<Longrightarrow> card A \<le> card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; inj_on f A; finite B\<rbrakk> \<Longrightarrow> card A \<le> card B
[PROOF STEP]
by (rule card_inj_on_le) auto


[STATEMENT]
lemma complex_cnj_one [simp]: "cnj 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj 1 = 1
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma derivative_component_fun_component:
  fixes i::"'a::euclidean_space"
  assumes "f differentiable (at x)"
  shows "((vector_derivative f (at x)) \<bullet> i) = ((vector_derivative (\<lambda>x. (f x) \<bullet> i) (at x)) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative f (at x) \<bullet> i = vector_derivative (\<lambda>x. f x \<bullet> i) (at x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vector_derivative f (at x) \<bullet> i = vector_derivative (\<lambda>x. f x \<bullet> i) (at x)
[PROOF STEP]
have "((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x)
[PROOF STEP]
using assms and bounded_linear.has_vector_derivative[of "(\<lambda>x. x \<bullet> i)" "f" "(vector_derivative f (at x))" "(at x)"] and
      bounded_linear_inner_left[of "i"] and vector_derivative_works[of "f" "(at x)"]
[PROOF STATE]
proof (prove)
using this:
f differentiable at x
\<lbrakk>bounded_linear (\<lambda>x. x \<bullet> i); (f has_vector_derivative vector_derivative f (at x)) (at x)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x)
bounded_linear (\<lambda>a. a \<bullet> i)
(f differentiable at x) = (f has_vector_derivative vector_derivative f (at x)) (at x)

goal (1 subgoal):
 1. ((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x)

goal (1 subgoal):
 1. vector_derivative f (at x) \<bullet> i = vector_derivative (\<lambda>x. f x \<bullet> i) (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x)
[PROOF STEP]
show "((vector_derivative f (at x)) \<bullet> i) = ((vector_derivative (\<lambda>x. (f x) \<bullet> i) (at x)) )"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x)

goal (1 subgoal):
 1. vector_derivative f (at x) \<bullet> i = vector_derivative (\<lambda>x. f x \<bullet> i) (at x)
[PROOF STEP]
using vector_derivative_works[of "(\<lambda>x. (f x) \<bullet> i)" "(at x)"] and
      differentiableI_vector[of "(\<lambda>x. (f x) \<bullet> i)" "(vector_derivative f (at x) \<bullet> i)" "(at x)"] and
      Derivative.vector_derivative_at
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x)
((\<lambda>x. f x \<bullet> i) differentiable at x) = ((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. f x \<bullet> i) (at x)) (at x)
((\<lambda>x. f x \<bullet> i) has_vector_derivative vector_derivative f (at x) \<bullet> i) (at x) \<Longrightarrow> (\<lambda>x. f x \<bullet> i) differentiable at x
(?f has_vector_derivative ?f') (at ?x) \<Longrightarrow> vector_derivative ?f (at ?x) = ?f'

goal (1 subgoal):
 1. vector_derivative f (at x) \<bullet> i = vector_derivative (\<lambda>x. f x \<bullet> i) (at x)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
vector_derivative f (at x) \<bullet> i = vector_derivative (\<lambda>x. f x \<bullet> i) (at x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma InfCard_csquare_eq:
  assumes "InfCard(\<kappa>)" shows "\<kappa> \<otimes> \<kappa> = \<kappa>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<kappa> \<otimes> \<kappa> = \<kappa>
[PROOF STEP]
using infinite_times_eqpoll_self [of "elts \<kappa>"] assms
[PROOF STATE]
proof (prove)
using this:
infinite (elts \<kappa>) \<Longrightarrow> elts \<kappa> \<times> elts \<kappa> \<approx> elts \<kappa>
InfCard \<kappa>

goal (1 subgoal):
 1. \<kappa> \<otimes> \<kappa> = \<kappa>
[PROOF STEP]
unfolding InfCard_iff Card_def
[PROOF STATE]
proof (prove)
using this:
infinite (elts \<kappa>) \<Longrightarrow> elts \<kappa> \<times> elts \<kappa> \<approx> elts \<kappa>
\<kappa> = vcard \<kappa> \<and> infinite (elts \<kappa>)

goal (1 subgoal):
 1. \<kappa> \<otimes> \<kappa> = \<kappa>
[PROOF STEP]
by (metis cardinal_cong cardinal_eqpoll cmult_def elts_vcard_VSigma_eqpoll eqpoll_trans)


[STATEMENT]
lemma card_multiset_only_sets:
  assumes "finite A"
  shows "card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k
[PROOF STEP]
have "bij_betw mset_set {X. X \<subseteq> A \<and> card X = k} {M. M \<subseteq># mset_set A \<and> size M = k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw mset_set {X. X \<subseteq> A \<and> card X = k} {M. M \<subseteq># mset_set A \<and> size M = k}
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. bij_betw mset_set {X. X \<subseteq> A \<and> card X = k} {M. M \<subseteq># mset_set A \<and> size M = k}
[PROOF STEP]
by (rule bij_betw_mset_set_card)
[PROOF STATE]
proof (state)
this:
bij_betw mset_set {X. X \<subseteq> A \<and> card X = k} {M. M \<subseteq># mset_set A \<and> size M = k}

goal (1 subgoal):
 1. card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
bij_betw mset_set {X. X \<subseteq> A \<and> card X = k} {M. M \<subseteq># mset_set A \<and> size M = k}
[PROOF STEP]
have "card {M. M \<subseteq># mset_set A \<and> size M = k} = card {X. X \<subseteq> A \<and> card X = k}"
[PROOF STATE]
proof (prove)
using this:
bij_betw mset_set {X. X \<subseteq> A \<and> card X = k} {M. M \<subseteq># mset_set A \<and> size M = k}

goal (1 subgoal):
 1. card {M. M \<subseteq># mset_set A \<and> size M = k} = card {X. X \<subseteq> A \<and> card X = k}
[PROOF STEP]
by (simp add: bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
card {M. M \<subseteq># mset_set A \<and> size M = k} = card {X. X \<subseteq> A \<and> card X = k}

goal (1 subgoal):
 1. card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {M. M \<subseteq># mset_set A \<and> size M = k} = card {X. X \<subseteq> A \<and> card X = k}

goal (1 subgoal):
 1. card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k
[PROOF STEP]
have " card {X. X \<subseteq> A \<and> card X = k} = card A choose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {X. X \<subseteq> A \<and> card X = k} = card A choose k
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. card {X. X \<subseteq> A \<and> card X = k} = card A choose k
[PROOF STEP]
by (rule n_subsets)
[PROOF STATE]
proof (state)
this:
card {X. X \<subseteq> A \<and> card X = k} = card A choose k

goal (1 subgoal):
 1. card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k

goal (1 subgoal):
 1. card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card {M. M \<subseteq># mset_set A \<and> size M = k} = card A choose k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma orthonormal_system_l2norm:
   "orthonormal_system S w \<Longrightarrow> l2norm S (w i) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthonormal_system S w \<Longrightarrow> l2norm S (w i) = 1
[PROOF STEP]
by (simp add: l2norm_def orthonormal_system_def)


[STATEMENT]
lemma help1: assumes " enat a + X \<le> Y"
    "enat b + Z \<le> X"
  shows "enat (a + b) + Z \<le> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat (a + b) + Z \<le> Y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
enat a + X \<le> Y
enat b + Z \<le> X

goal (1 subgoal):
 1. enat (a + b) + Z \<le> Y
[PROOF STEP]
by (metis ab_semigroup_add_class.add_ac(1) add_left_mono order_trans plus_enat_simps(1))


[STATEMENT]
lemma Norm_eq_lnorm: "\<lbrakk>f \<in> lspace M p; p > 0\<rbrakk> \<Longrightarrow> Norm (\<LL> (ennreal p) M) f = lnorm M p f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> lspace M (ennreal p); 0 < p\<rbrakk> \<Longrightarrow> Norm (\<LL> (ennreal p) M) f = lnorm M p f
[PROOF STEP]
by (simp add: Lp_D(3) lnorm_def)


[STATEMENT]
lemma scaleR_le_0_iff: "a *\<^sub>R b \<le> 0 \<longleftrightarrow> 0 < a \<and> b \<le> 0 \<or> a < 0 \<and> 0 \<le> b \<or> a = 0"
  for b::"'a::ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>R b \<le> (0::'a)) = (0 < a \<and> b \<le> (0::'a) \<or> a < 0 \<and> (0::'a) \<le> b \<or> a = 0)
[PROOF STEP]
by (insert zero_le_scaleR_iff [of "-a" b]) force


[STATEMENT]
lemma osum_Partial_order: "\<lbrakk>Partial_order r; Partial_order r'\<rbrakk> \<Longrightarrow> Partial_order (r +o r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Partial_order r; Partial_order r'\<rbrakk> \<Longrightarrow> Partial_order (r +o r')
[PROOF STEP]
unfolding partial_order_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Preorder r \<and> antisym r; Preorder r' \<and> antisym r'\<rbrakk> \<Longrightarrow> Preorder (r +o r') \<and> antisym (r +o r')
[PROOF STEP]
using osum_Preorder osum_antisym
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Preorder ?r; Preorder ?r'\<rbrakk> \<Longrightarrow> Preorder (?r +o ?r')
\<lbrakk>antisym ?r; antisym ?r'\<rbrakk> \<Longrightarrow> antisym (?r +o ?r')

goal (1 subgoal):
 1. \<lbrakk>Preorder r \<and> antisym r; Preorder r' \<and> antisym r'\<rbrakk> \<Longrightarrow> Preorder (r +o r') \<and> antisym (r +o r')
[PROOF STEP]
by blast


[STATEMENT]
lemma expands_to_imp_eventually_neg:
  assumes "basis_wf basis" "(f expands_to F) basis" "trimmed_neg F"
  shows   "eventually (\<lambda>x. f x < 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x < 0
[PROOF STEP]
using eval_pos_if_dominant_term_pos[of basis "-F"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>basis_wf basis; is_expansion (- F) basis; trimmed (- F); 0 < fst (dominant_term (- F))\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. 0 < eval (- F) x
basis_wf basis
(f expands_to F) basis
trimmed_neg F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x < 0
[PROOF STEP]
by (auto simp: expands_to.simps trimmed_neg_def is_expansion_uminus elim: eventually_elim2)


[STATEMENT]
lemma is_gcd_is_bezout_ext:
  assumes "is_bezout_ext bezout"
  shows "is_gcd (\<lambda>a b. case bezout a b of (x, xa,u,v, gcd') \<Rightarrow> gcd')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_gcd (\<lambda>a b. case bezout a b of (x, xa, u, v, gcd') \<Rightarrow> gcd')
[PROOF STEP]
unfolding is_gcd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b. (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd') dvd a \<and> (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd') dvd b \<and> (\<forall>d'. d' dvd a \<and> d' dvd b \<longrightarrow> d' dvd (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd'))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_bezout_ext bezout

goal (1 subgoal):
 1. \<forall>a b. (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd') dvd a \<and> (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd') dvd b \<and> (\<forall>d'. d' dvd a \<and> d' dvd b \<longrightarrow> d' dvd (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd'))
[PROOF STEP]
unfolding is_bezout_ext_def Let_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. case bezout a b of (p, q, u, v, gcd_a_b) \<Rightarrow> p * a + q * b = gcd_a_b \<and> gcd_a_b dvd a \<and> gcd_a_b dvd b \<and> (\<forall>d'. d' dvd a \<and> d' dvd b \<longrightarrow> d' dvd gcd_a_b) \<and> gcd_a_b * u = - b \<and> gcd_a_b * v = a

goal (1 subgoal):
 1. \<forall>a b. (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd') dvd a \<and> (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd') dvd b \<and> (\<forall>d'. d' dvd a \<and> d' dvd b \<longrightarrow> d' dvd (case bezout a b of (x, xaa, u, v, gcd') \<Rightarrow> gcd'))
[PROOF STEP]
by (simp add: split_beta)


[STATEMENT]
theorem "\<forall>(i::int). 8 \<le> i --> (\<exists>x y. 0 \<le> x & 0 \<le> y & 3 * x + 5 * y = i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<ge>8. \<exists>x y. 0 \<le> x \<and> 0 \<le> y \<and> 3 * x + 5 * y = i
[PROOF STEP]
by presburger


[STATEMENT]
theorem Right_Coset_Union:
  "(\<Union>x\<in>G. H |\<cdot> x) = G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> ((|\<cdot>) H ` G) = G
[PROOF STEP]
by (simp add: Right_Coset_is_orbit)