[STATEMENT]
lemma "(\<exists>x. F(x)) \<and> (\<exists>y. G(y))
    \<longrightarrow> ( ((\<forall>x. F(x)\<longrightarrow>H(x)) \<and> (\<forall>y. G(y)\<longrightarrow>J(y)))  =
          (\<forall>x y. F(x) \<and> G(y) \<longrightarrow> H(x) \<and> J(y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. F x) \<and> (\<exists>y. G y) \<longrightarrow> ((\<forall>x. F x \<longrightarrow> H x) \<and> (\<forall>y. G y \<longrightarrow> J y)) = (\<forall>x y. F x \<and> G y \<longrightarrow> H x \<and> J y)
[PROOF STEP]
by blast


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

goal (1 subgoal):
 1. Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [- sin (\<theta>\<^sub>A / 2)], [complex_of_real (sin (\<theta>\<^sub>A / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 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>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]); j < dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]])\<rbrakk> \<Longrightarrow> Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [- sin (\<theta>\<^sub>A / 2)], [complex_of_real (sin (\<theta>\<^sub>A / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 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>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]])
j < dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 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>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]); j < dim_col (Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]])\<rbrakk> \<Longrightarrow> Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [- sin (\<theta>\<^sub>A / 2)], [complex_of_real (sin (\<theta>\<^sub>A / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 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>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [- sin (\<theta>\<^sub>A / 2)], [complex_of_real (sin (\<theta>\<^sub>A / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 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>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [- sin (\<theta>\<^sub>A / 2)], [complex_of_real (sin (\<theta>\<^sub>A / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 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>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [- sin (\<theta>\<^sub>A / 2)], [complex_of_real (sin (\<theta>\<^sub>A / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 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>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [- sin (\<theta>\<^sub>A / 2)], [complex_of_real (sin (\<theta>\<^sub>A / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]]\<^sup>\<dagger> $$ (i, j) = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2)) # map complex_of_real [sin (\<theta>\<^sub>A / 2)], [complex_of_real (- sin (\<theta>\<^sub>A / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>A) * complex_of_real (cos (\<theta>\<^sub>A / 2))]] $$ (i, j)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_comp_times:
  fixes a b :: "'a :: semiring_0"
  shows "of_comp (a * b) = of_comp a * of_comp b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_comp (a * b) = of_comp a * of_comp b
[PROOF STEP]
by (simp add: of_comp_def times_hyperdual.code)


[STATEMENT]
lemma gen_qe_eval' : "
      (\<exists>xs. (length xs = var + 1) \<and> eval (list_conj (map fm.Atom L @ F)) (xs @ \<Gamma>)) =
      (\<exists>xs. (length xs = var + 1) \<and> eval (gen_qe var L F) (xs @ \<Gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = var + 1 \<and> eval (list_conj (map fm.Atom L @ F)) (xs @ \<Gamma>)) = (\<exists>xs. length xs = var + 1 \<and> eval (gen_qe var L F) (xs @ \<Gamma>))
[PROOF STEP]
apply(rule step_converter[of gen_qe var L F \<Gamma>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs var L F \<Gamma>. length xs = var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (gen_qe var L F) (xs @ x # \<Gamma>))
[PROOF STEP]
using gen_qe_eval
[PROOF STATE]
proof (prove)
using this:
length ?xs = ?var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom ?L @ ?F)) (?xs @ x # ?\<Gamma>)) = (\<exists>x. eval (gen_qe ?var ?L ?F) (?xs @ x # ?\<Gamma>))

goal (1 subgoal):
 1. \<And>xs var L F \<Gamma>. length xs = var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (gen_qe var L F) (xs @ x # \<Gamma>))
[PROOF STEP]
by blast


[STATEMENT]
lemma (in ring) canonical_proj_ext_ker:
  assumes "\<And>i. i \<le> (n :: nat) \<Longrightarrow> ideal (I i) R"
  shows "a_kernel R (RDirProd_list (map (\<lambda>i. R Quot (I i)) [0..< Suc n])) (canonical_proj_ext I n) = (\<Inter>i \<le> n. I i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n})
[PROOF STEP]
let ?map_Quot = "\<lambda>I n. map (\<lambda>i. R Quot (I i)) [0..< Suc n]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n})
[PROOF STEP]
let ?ker = "\<lambda>I n. a_kernel R (RDirProd_list (?map_Quot I n)) (canonical_proj_ext I n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n})
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
?i \<le> n \<Longrightarrow> ideal (I ?i) R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i \<le> n \<Longrightarrow> ideal (I ?i) R

goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n})
[PROOF STEP]
proof (induct n arbitrary: I)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>I. (\<And>i. i \<le> 0 \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc 0])) (canonical_proj_ext I 0) = \<Inter> (I ` {..0})
 2. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?i \<le> 0 \<Longrightarrow> ideal (I ?i) R

goal (2 subgoals):
 1. \<And>I. (\<And>i. i \<le> 0 \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc 0])) (canonical_proj_ext I 0) = \<Inter> (I ` {..0})
 2. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<le> 0 \<Longrightarrow> ideal (I ?i) R
[PROOF STEP]
have I: "ideal (I 0) R"
[PROOF STATE]
proof (prove)
using this:
?i \<le> 0 \<Longrightarrow> ideal (I ?i) R

goal (1 subgoal):
 1. ideal (I 0) R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ideal (I 0) R

goal (2 subgoals):
 1. \<And>I. (\<And>i. i \<le> 0 \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc 0])) (canonical_proj_ext I 0) = \<Inter> (I ` {..0})
 2. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc 0])) (canonical_proj_ext I 0) = \<Inter> (I ` {..0})
[PROOF STEP]
unfolding a_kernel_def' RDirProd_list_zero canonical_proj_ext_def FactRing_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier R. map (\<lambda>i. I i +> x) [0..<Suc 0] = foldr (\<lambda>R. (#) \<zero>\<^bsub>R\<^esub>) (map (\<lambda>i. \<lparr>carrier = a_rcosets I i, mult = rcoset_mult R (I i), one = I i +> \<one>, zero = I i, add = (<+>)\<rparr>) [0..<Suc 0]) []} = \<Inter> (I ` {..0})
[PROOF STEP]
using ideal.rcos_const_imp_mem a_rcos_zero ideal.Icarr I
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ideal ?I ?R; ?i \<in> carrier ?R; ?I +>\<^bsub>?R\<^esub> ?i = ?I\<rbrakk> \<Longrightarrow> ?i \<in> ?I
\<lbrakk>ideal ?I R; ?i \<in> ?I\<rbrakk> \<Longrightarrow> ?I +> ?i = ?I
\<lbrakk>ideal ?I ?R; ?i \<in> ?I\<rbrakk> \<Longrightarrow> ?i \<in> carrier ?R
ideal (I 0) R

goal (1 subgoal):
 1. {x \<in> carrier R. map (\<lambda>i. I i +> x) [0..<Suc 0] = foldr (\<lambda>R. (#) \<zero>\<^bsub>R\<^esub>) (map (\<lambda>i. \<lparr>carrier = a_rcosets I i, mult = rcoset_mult R (I i), one = I i +> \<one>, zero = I i, add = (<+>)\<rparr>) [0..<Suc 0]) []} = \<Inter> (I ` {..0})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc 0])) (canonical_proj_ext I 0) = \<Inter> (I ` {..0})

goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<And>i. i \<le> n \<Longrightarrow> ideal (?I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot ?I i) [0..<Suc n])) (canonical_proj_ext ?I n) = \<Inter> (?I ` {..n})
?i \<le> Suc n \<Longrightarrow> ideal (I ?i) R

goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
hence I: "ideal (I 0) R"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<le> n \<Longrightarrow> ideal (?I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot ?I i) [0..<Suc n])) (canonical_proj_ext ?I n) = \<Inter> (?I ` {..n})
?i \<le> Suc n \<Longrightarrow> ideal (I ?i) R

goal (1 subgoal):
 1. ideal (I 0) R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ideal (I 0) R

goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
have map_simp: "?map_Quot I (Suc n) = (R Quot I 0) # (?map_Quot (\<lambda>i. I (Suc i)) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)] = (R Quot I 0) # map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n]
[PROOF STEP]
by (induct n) (auto)
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)] = (R Quot I 0) # map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n]

goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
have ker_I0: "I 0 = a_kernel R (R Quot (I 0)) (\<lambda>a. (I 0) +> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I 0 = a_kernel R (R Quot I 0) ((+>) (I 0))
[PROOF STEP]
using ideal.rcos_const_imp_mem[OF I] a_rcos_zero[OF I] ideal.Icarr[OF I]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> carrier R; I 0 +> ?i = I 0\<rbrakk> \<Longrightarrow> ?i \<in> I 0
?i \<in> I 0 \<Longrightarrow> I 0 +> ?i = I 0
?i \<in> I 0 \<Longrightarrow> ?i \<in> carrier R

goal (1 subgoal):
 1. I 0 = a_kernel R (R Quot I 0) ((+>) (I 0))
[PROOF STEP]
unfolding a_kernel_def' FactRing_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> carrier R; I 0 +> ?i = I 0\<rbrakk> \<Longrightarrow> ?i \<in> I 0
?i \<in> I 0 \<Longrightarrow> I 0 +> ?i = I 0
?i \<in> I 0 \<Longrightarrow> ?i \<in> carrier R

goal (1 subgoal):
 1. I 0 = {x \<in> carrier R. I 0 +> x = \<zero>\<^bsub>\<lparr>carrier = a_rcosets I 0, mult = rcoset_mult R (I 0), one = I 0 +> \<one>, zero = I 0, add = (<+>)\<rparr>\<^esub>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
I 0 = a_kernel R (R Quot I 0) ((+>) (I 0))

goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
hence "?ker I (Suc n) = (?ker (\<lambda>i. I (Suc i)) n) \<inter> (I 0)"
[PROOF STATE]
proof (prove)
using this:
I 0 = a_kernel R (R Quot I 0) ((+>) (I 0))

goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) \<inter> I 0
[PROOF STEP]
unfolding a_kernel_def' map_simp RDirProd_list_zero' canonical_proj_ext_tl
[PROOF STATE]
proof (prove)
using this:
I 0 = {x \<in> carrier R. I 0 +> x = \<zero>\<^bsub>R Quot I 0\<^esub>}

goal (1 subgoal):
 1. {x \<in> carrier R. (I 0 +> x) # canonical_proj_ext (\<lambda>i. I (Suc i)) n x = \<zero>\<^bsub>R Quot I 0\<^esub> # \<zero>\<^bsub>RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])\<^esub>} = {x \<in> carrier R. canonical_proj_ext (\<lambda>i. I (Suc i)) n x = \<zero>\<^bsub>RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])\<^esub>} \<inter> I 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) \<inter> I 0

goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) \<inter> I 0

goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
have "?ker (\<lambda>i. I (Suc i)) n = (\<Inter>i \<le> n. I (Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) = (\<Inter>i\<le>n. I (Suc i))
[PROOF STEP]
using Suc(1)[of "\<lambda>i. I (Suc i)"] Suc(2)
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<le> n \<Longrightarrow> ideal (I (Suc i)) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>a. I (Suc a)) n) = (\<Inter>a\<le>n. I (Suc a))
?i \<le> Suc n \<Longrightarrow> ideal (I ?i) R

goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) = (\<Inter>i\<le>n. I (Suc i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) = (\<Inter>i\<le>n. I (Suc i))

goal (1 subgoal):
 1. \<And>n I. \<lbrakk>\<And>I. (\<And>i. i \<le> n \<Longrightarrow> ideal (I i) R) \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n}); \<And>i. i \<le> Suc n \<Longrightarrow> ideal (I i) R\<rbrakk> \<Longrightarrow> a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) \<inter> I 0
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) = (\<Inter>i\<le>n. I (Suc i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) \<inter> I 0
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I (Suc i)) [0..<Suc n])) (canonical_proj_ext (\<lambda>i. I (Suc i)) n) = (\<Inter>i\<le>n. I (Suc i))

goal (1 subgoal):
 1. a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})
[PROOF STEP]
by (auto simp add: INT_extend_simps(10) atMost_atLeast0)
         (metis atLeastAtMost_iff le_zero_eq not_less_eq_eq)
[PROOF STATE]
proof (state)
this:
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc (Suc n)])) (canonical_proj_ext I (Suc n)) = \<Inter> (I ` {..Suc n})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a_kernel R (RDirProd_list (map (\<lambda>i. R Quot I i) [0..<Suc n])) (canonical_proj_ext I n) = \<Inter> (I ` {..n})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_interior_closure:
  fixes S :: "'n::euclidean_space set"
  assumes "convex S"
  shows "interior (closure S) = interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (closure S) = interior S
[PROOF STEP]
using closure_aff_dim[of S] interior_rel_interior_gen[of S]
    interior_rel_interior_gen[of "closure S"]
    convex_rel_interior_closure[of S] assms
[PROOF STATE]
proof (prove)
using this:
aff_dim (closure S) = aff_dim S
interior S = (if aff_dim S = int DIM('n) then rel_interior S else {})
interior (closure S) = (if aff_dim (closure S) = int DIM('n) then rel_interior (closure S) else {})
convex S \<Longrightarrow> rel_interior (closure S) = rel_interior S
convex S

goal (1 subgoal):
 1. interior (closure S) = interior S
[PROOF STEP]
by auto


[STATEMENT]
lemma union_eq_empty [iff]: "M + N = {#} \<longleftrightarrow> M = {#} \<and> N = {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M + N = {#}) = (M = {#} \<and> N = {#})
[PROOF STEP]
by (auto simp add: multiset_eq_iff)


[STATEMENT]
lemma residue_is_hom_1:
  assumes "n > 1"
  assumes "m > 1"
  assumes "n dvd m"
  shows "residue n \<in> ring_hom (residue_ring m) (residue_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue n \<in> ring_hom (residue_ring m) (residue_ring n)
[PROOF STEP]
proof(rule ring_hom_memI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. x \<in> carrier (residue_ring m) \<Longrightarrow> residue n x \<in> carrier (residue_ring n)
 2. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<otimes>\<^bsub>residue_ring m\<^esub> y) = residue n x \<otimes>\<^bsub>residue_ring n\<^esub> residue n y
 3. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<oplus>\<^bsub>residue_ring m\<^esub> y) = residue n x \<oplus>\<^bsub>residue_ring n\<^esub> residue n y
 4. residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>
[PROOF STEP]
have 0: "residues n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residues n
[PROOF STEP]
by (simp add: assms(1) residues_def)
[PROOF STATE]
proof (state)
this:
residues n

goal (4 subgoals):
 1. \<And>x. x \<in> carrier (residue_ring m) \<Longrightarrow> residue n x \<in> carrier (residue_ring n)
 2. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<otimes>\<^bsub>residue_ring m\<^esub> y) = residue n x \<otimes>\<^bsub>residue_ring n\<^esub> residue n y
 3. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<oplus>\<^bsub>residue_ring m\<^esub> y) = residue n x \<oplus>\<^bsub>residue_ring n\<^esub> residue n y
 4. residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>
[PROOF STEP]
have 1: "residues m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residues m
[PROOF STEP]
by (simp add: assms(2) residues_def)
[PROOF STATE]
proof (state)
this:
residues m

goal (4 subgoals):
 1. \<And>x. x \<in> carrier (residue_ring m) \<Longrightarrow> residue n x \<in> carrier (residue_ring n)
 2. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<otimes>\<^bsub>residue_ring m\<^esub> y) = residue n x \<otimes>\<^bsub>residue_ring n\<^esub> residue n y
 3. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<oplus>\<^bsub>residue_ring m\<^esub> y) = residue n x \<oplus>\<^bsub>residue_ring n\<^esub> residue n y
 4. residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>
[PROOF STEP]
show "\<And>x. x \<in> carrier (residue_ring m) \<Longrightarrow> residue n x \<in> carrier (residue_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (residue_ring m) \<Longrightarrow> residue n x \<in> carrier (residue_ring n)
[PROOF STEP]
using assms(1) residue_def residue_ring_def
[PROOF STATE]
proof (prove)
using this:
1 < n
residue ?n ?m = ?m mod ?n
residue_ring ?m = \<lparr>carrier = {0..?m - 1}, monoid.mult = \<lambda>x y. x * y mod ?m, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod ?m\<rparr>

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (residue_ring m) \<Longrightarrow> residue n x \<in> carrier (residue_ring n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> carrier (residue_ring m) \<Longrightarrow> residue n ?x \<in> carrier (residue_ring n)

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<otimes>\<^bsub>residue_ring m\<^esub> y) = residue n x \<otimes>\<^bsub>residue_ring n\<^esub> residue n y
 2. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<oplus>\<^bsub>residue_ring m\<^esub> y) = residue n x \<oplus>\<^bsub>residue_ring n\<^esub> residue n y
 3. residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>
[PROOF STEP]
show "\<And>x y. x \<in> carrier (residue_ring m) \<Longrightarrow>
               y \<in> carrier (residue_ring m) \<Longrightarrow>
          residue n (x \<otimes>\<^bsub>residue_ring m\<^esub> y) = residue n x \<otimes>\<^bsub>residue_ring n\<^esub> residue n y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<otimes>\<^bsub>residue_ring m\<^esub> y) = residue n x \<otimes>\<^bsub>residue_ring n\<^esub> residue n y
[PROOF STEP]
using 0 1 assms
[PROOF STATE]
proof (prove)
using this:
residues n
residues m
1 < n
1 < m
n dvd m

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<otimes>\<^bsub>residue_ring m\<^esub> y) = residue n x \<otimes>\<^bsub>residue_ring n\<^esub> residue n y
[PROOF STEP]
by (metis mod_mod_cancel residue_def residues.mult_cong residues.res_mult_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier (residue_ring m); ?y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (?x \<otimes>\<^bsub>residue_ring m\<^esub> ?y) = residue n ?x \<otimes>\<^bsub>residue_ring n\<^esub> residue n ?y

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<oplus>\<^bsub>residue_ring m\<^esub> y) = residue n x \<oplus>\<^bsub>residue_ring n\<^esub> residue n y
 2. residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>
[PROOF STEP]
show "\<And>x y. x \<in> carrier (residue_ring m)
        \<Longrightarrow> y \<in> carrier (residue_ring m)
        \<Longrightarrow> residue n (x \<oplus>\<^bsub>residue_ring m\<^esub> y) = residue n x \<oplus>\<^bsub>residue_ring n\<^esub> residue n y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<oplus>\<^bsub>residue_ring m\<^esub> y) = residue n x \<oplus>\<^bsub>residue_ring n\<^esub> residue n y
[PROOF STEP]
using 0 1 assms
[PROOF STATE]
proof (prove)
using this:
residues n
residues m
1 < n
1 < m
n dvd m

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (residue_ring m); y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (x \<oplus>\<^bsub>residue_ring m\<^esub> y) = residue n x \<oplus>\<^bsub>residue_ring n\<^esub> residue n y
[PROOF STEP]
by (metis mod_mod_cancel residue_def residues.add_cong residues.res_add_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier (residue_ring m); ?y \<in> carrier (residue_ring m)\<rbrakk> \<Longrightarrow> residue n (?x \<oplus>\<^bsub>residue_ring m\<^esub> ?y) = residue n ?x \<oplus>\<^bsub>residue_ring n\<^esub> residue n ?y

goal (1 subgoal):
 1. residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>
[PROOF STEP]
show "residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>
[PROOF STEP]
by (simp add: assms(1) residue_def residue_ring_def)
[PROOF STATE]
proof (state)
this:
residue n \<one>\<^bsub>residue_ring m\<^esub> = \<one>\<^bsub>residue_ring n\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma \<nu>\<^sub>b_vec_opt[code]: "policy_eval' (vec_to_fun d) = vec_to_bfun (Matrix_To_IArray.iarray_to_vec (Matrix_To_IArray.vec_to_iarray ((fst (Gauss_Jordan_PA ((mat 1 - l *\<^sub>R (P_mat (vec_to_fun d)))))) *v (r_vec' (vec_to_fun d)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. policy_eval' (vec_to_fun d) = vec_to_bfun (Matrix_To_IArray.iarray_to_vec (Matrix_To_IArray.vec_to_iarray (fst (Gauss_Jordan_PA (mat 1 - l *\<^sub>R P_mat (vec_to_fun d))) *v r_vec' (vec_to_fun d))))
[PROOF STEP]
using \<nu>\<^sub>b_vec
[PROOF STATE]
proof (prove)
using this:
policy_eval' (vec_to_fun ?d) = vec_to_bfun (matrix_inv (mat 1 - l *\<^sub>R P_mat (vec_to_fun ?d)) *v r_vec' (vec_to_fun ?d))

goal (1 subgoal):
 1. policy_eval' (vec_to_fun d) = vec_to_bfun (Matrix_To_IArray.iarray_to_vec (Matrix_To_IArray.vec_to_iarray (fst (Gauss_Jordan_PA (mat 1 - l *\<^sub>R P_mat (vec_to_fun d))) *v r_vec' (vec_to_fun d))))
[PROOF STEP]
by (auto simp: mat_eq_blinfun matrix_inv_Gauss_Jordan_PA blinfun_to_matrix_inverse(1) invertible\<^sub>L_inf_sum iarray_to_vec_vec_to_iarray)


[STATEMENT]
lemma "8 * 11 ^ 3 - 6 = (2::5)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 8 * 11 ^ 3 - 6 = 2
[PROOF STEP]
by simp


[STATEMENT]
lemma pmf_try_spmf_None [simp]: "pmf (TRY p ELSE q) None = pmf p None * pmf q None" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (TRY p ELSE q) None = pmf p None * pmf q None
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pmf (TRY p ELSE q) None = pmf p None * pmf q None
[PROOF STEP]
have "?lhs = \<integral> x. pmf q None * indicator {None} x \<partial>measure_pmf p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (TRY p ELSE q) None = measure_pmf.expectation p (\<lambda>x. pmf q None * indicat_real {None} x)
[PROOF STEP]
unfolding try_spmf_def pmf_bind
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation p (\<lambda>x. pmf (case x of None \<Rightarrow> q | Some y \<Rightarrow> return_spmf y) None) = measure_pmf.expectation p (\<lambda>x. pmf q None * indicat_real {None} x)
[PROOF STEP]
by(rule Bochner_Integration.integral_cong)(simp_all split: option.split)
[PROOF STATE]
proof (state)
this:
pmf (TRY p ELSE q) None = measure_pmf.expectation p (\<lambda>x. pmf q None * indicat_real {None} x)

goal (1 subgoal):
 1. pmf (TRY p ELSE q) None = pmf p None * pmf q None
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pmf (TRY p ELSE q) None = measure_pmf.expectation p (\<lambda>x. pmf q None * indicat_real {None} x)

goal (1 subgoal):
 1. pmf (TRY p ELSE q) None = pmf p None * pmf q None
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation p (\<lambda>x. pmf q None * indicat_real {None} x) = pmf p None * pmf q None
[PROOF STEP]
by(simp add: measure_pmf_single)
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation p (\<lambda>x. pmf q None * indicat_real {None} x) = pmf p None * pmf q None

goal (1 subgoal):
 1. pmf (TRY p ELSE q) None = pmf p None * pmf q None
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pmf (TRY p ELSE q) None = pmf p None * pmf q None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
pmf (TRY p ELSE q) None = pmf p None * pmf q None

goal (1 subgoal):
 1. pmf (TRY p ELSE q) None = pmf p None * pmf q None
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
pmf (TRY p ELSE q) None = pmf p None * pmf q None

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sin_le_zero: "pi \<le> x \<Longrightarrow> x < 2 * pi \<Longrightarrow> sin x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pi \<le> x; x < 2 * pi\<rbrakk> \<Longrightarrow> sin x \<le> 0
[PROOF STEP]
using sin_ge_zero [of "x - pi"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> x - pi; x - pi \<le> pi\<rbrakk> \<Longrightarrow> 0 \<le> sin (x - pi)

goal (1 subgoal):
 1. \<lbrakk>pi \<le> x; x < 2 * pi\<rbrakk> \<Longrightarrow> sin x \<le> 0
[PROOF STEP]
by (simp add: sin_diff)


[STATEMENT]
lemma nth_take_lemma:
  "k \<le> length xs \<Longrightarrow> k \<le> length ys \<Longrightarrow>
     (\<And>i. i < k \<longrightarrow> xs!i = ys!i) \<Longrightarrow> take k xs = take k ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k \<le> length xs; k \<le> length ys; \<And>i. i < k \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take k xs = take k ys
[PROOF STEP]
proof (induct k arbitrary: xs ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs ys. \<lbrakk>0 \<le> length xs; 0 \<le> length ys; \<And>i. i < 0 \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take 0 xs = take 0 ys
 2. \<And>k xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>k \<le> length xs; k \<le> length ys; \<And>i. i < k \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take k xs = take k ys; Suc k \<le> length xs; Suc k \<le> length ys; \<And>i. i < Suc k \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take (Suc k) xs = take (Suc k) ys
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
\<lbrakk>k \<le> length ?xs; k \<le> length ?ys; \<And>i. i < k \<longrightarrow> ?xs ! i = ?ys ! i\<rbrakk> \<Longrightarrow> take k ?xs = take k ?ys
Suc k \<le> length xs
Suc k \<le> length ys
?i < Suc k \<longrightarrow> xs ! ?i = ys ! ?i

goal (2 subgoals):
 1. \<And>xs ys. \<lbrakk>0 \<le> length xs; 0 \<le> length ys; \<And>i. i < 0 \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take 0 xs = take 0 ys
 2. \<And>k xs ys. \<lbrakk>\<And>xs ys. \<lbrakk>k \<le> length xs; k \<le> length ys; \<And>i. i < k \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take k xs = take k ys; Suc k \<le> length xs; Suc k \<le> length ys; \<And>i. i < Suc k \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take (Suc k) xs = take (Suc k) ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>k \<le> length ?xs; k \<le> length ?ys; \<And>i. i < k \<longrightarrow> ?xs ! i = ?ys ! i\<rbrakk> \<Longrightarrow> take k ?xs = take k ?ys
Suc k \<le> length xs
Suc k \<le> length ys
?i < Suc k \<longrightarrow> xs ! ?i = ys ! ?i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>k \<le> length ?xs; k \<le> length ?ys; \<And>i. i < k \<longrightarrow> ?xs ! i = ?ys ! i\<rbrakk> \<Longrightarrow> take k ?xs = take k ?ys
Suc k \<le> length xs
Suc k \<le> length ys
?i < Suc k \<longrightarrow> xs ! ?i = ys ! ?i

goal (1 subgoal):
 1. take (Suc k) xs = take (Suc k) ys
[PROOF STEP]
apply (simp add: less_Suc_eq_0_disj)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>xs ys. \<lbrakk>k \<le> length xs; k \<le> length ys; \<And>i. i < k \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take k xs = take k ys; Suc k \<le> length xs; Suc k \<le> length ys; \<And>i. (i = 0 \<longrightarrow> xs ! 0 = ys ! 0) \<and> ((\<exists>j. i = Suc j \<and> j < k) \<longrightarrow> xs ! i = ys ! i)\<rbrakk> \<Longrightarrow> take (Suc k) xs = take (Suc k) ys
[PROOF STEP]
by (simp add: Suc.prems(3) take_Suc_conv_app_nth)
[PROOF STATE]
proof (state)
this:
take (Suc k) xs = take (Suc k) ys

goal (1 subgoal):
 1. \<And>xs ys. \<lbrakk>0 \<le> length xs; 0 \<le> length ys; \<And>i. i < 0 \<longrightarrow> xs ! i = ys ! i\<rbrakk> \<Longrightarrow> take 0 xs = take 0 ys
[PROOF STEP]
qed simp


[STATEMENT]
lemma split_block: assumes res: "split_block A sr1 sc1 = (A1,A2,A3,A4)"
  and dims: "dim_row A = sr1 + sr2" "dim_col A = sc1 + sc2"
  shows "A1 \<in> carrier_mat sr1 sc1" "A2 \<in> carrier_mat sr1 sc2"
    "A3 \<in> carrier_mat sr2 sc1" "A4 \<in> carrier_mat sr2 sc2"
    "A = four_block_mat A1 A2 A3 A4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A1 \<in> carrier_mat sr1 sc1 &&& A2 \<in> carrier_mat sr1 sc2) &&& A3 \<in> carrier_mat sr2 sc1 &&& A4 \<in> carrier_mat sr2 sc2 &&& A = four_block_mat A1 A2 A3 A4
[PROOF STEP]
using res
[PROOF STATE]
proof (prove)
using this:
split_block A sr1 sc1 = (A1, A2, A3, A4)

goal (1 subgoal):
 1. (A1 \<in> carrier_mat sr1 sc1 &&& A2 \<in> carrier_mat sr1 sc2) &&& A3 \<in> carrier_mat sr2 sc1 &&& A4 \<in> carrier_mat sr2 sc2 &&& A = four_block_mat A1 A2 A3 A4
[PROOF STEP]
unfolding split_block_def Let_def
[PROOF STATE]
proof (prove)
using this:
(mat sr1 sc1 (($$) A), mat sr1 (dim_col A - sc1) (\<lambda>(i, j). A $$ (i, j + sc1)), mat (dim_row A - sr1) sc1 (\<lambda>(i, j). A $$ (i + sr1, j)), mat (dim_row A - sr1) (dim_col A - sc1) (\<lambda>(i, j). A $$ (i + sr1, j + sc1))) = (A1, A2, A3, A4)

goal (1 subgoal):
 1. (A1 \<in> carrier_mat sr1 sc1 &&& A2 \<in> carrier_mat sr1 sc2) &&& A3 \<in> carrier_mat sr2 sc1 &&& A4 \<in> carrier_mat sr2 sc2 &&& A = four_block_mat A1 A2 A3 A4
[PROOF STEP]
by (auto simp: dims)


[STATEMENT]
lemma sqrt_even_pow2:
  assumes n: "even n"
  shows "sqrt (2 ^ n) = 2 ^ (n div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (2 ^ n) = 2 ^ (n div 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrt (2 ^ n) = 2 ^ (n div 2)
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
even n
[PROOF STEP]
obtain m where m: "n = 2 * m"
[PROOF STATE]
proof (prove)
using this:
even n

goal (1 subgoal):
 1. (\<And>m. n = 2 * m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
n = 2 * m

goal (1 subgoal):
 1. sqrt (2 ^ n) = 2 ^ (n div 2)
[PROOF STEP]
from m
[PROOF STATE]
proof (chain)
picking this:
n = 2 * m
[PROOF STEP]
have "sqrt (2 ^ n) = sqrt ((2 ^ m)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
n = 2 * m

goal (1 subgoal):
 1. sqrt (2 ^ n) = sqrt ((2 ^ m)\<^sup>2)
[PROOF STEP]
by (simp only: power_mult[symmetric] mult.commute)
[PROOF STATE]
proof (state)
this:
sqrt (2 ^ n) = sqrt ((2 ^ m)\<^sup>2)

goal (1 subgoal):
 1. sqrt (2 ^ n) = 2 ^ (n div 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sqrt (2 ^ n) = sqrt ((2 ^ m)\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sqrt (2 ^ n) = sqrt ((2 ^ m)\<^sup>2)

goal (1 subgoal):
 1. sqrt (2 ^ n) = 2 ^ (n div 2)
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
sqrt (2 ^ n) = sqrt ((2 ^ m)\<^sup>2)
n = 2 * m

goal (1 subgoal):
 1. sqrt (2 ^ n) = 2 ^ (n div 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (2 ^ n) = 2 ^ (n div 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_all_closed: \<open>\<exists>m. list_all (closed m) G\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. list_all (closed m) G
[PROOF STEP]
proof (induct G)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>m. list_all (closed m) []
 2. \<And>a G. \<exists>m. list_all (closed m) G \<Longrightarrow> \<exists>m. list_all (closed m) (a # G)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>m. list_all (closed m) []
 2. \<And>a G. \<exists>m. list_all (closed m) G \<Longrightarrow> \<exists>m. list_all (closed m) (a # G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. list_all (closed m) []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>m. list_all (closed m) []

goal (1 subgoal):
 1. \<And>a G. \<exists>m. list_all (closed m) G \<Longrightarrow> \<exists>m. list_all (closed m) (a # G)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a G. \<exists>m. list_all (closed m) G \<Longrightarrow> \<exists>m. list_all (closed m) (a # G)
[PROOF STEP]
case (Cons a G)
[PROOF STATE]
proof (state)
this:
\<exists>m. list_all (closed m) G

goal (1 subgoal):
 1. \<And>a G. \<exists>m. list_all (closed m) G \<Longrightarrow> \<exists>m. list_all (closed m) (a # G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>m. list_all (closed m) G
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<exists>m. list_all (closed m) G

goal (1 subgoal):
 1. \<exists>m. list_all (closed m) (a # G)
[PROOF STEP]
unfolding list_all_def
[PROOF STATE]
proof (prove)
using this:
\<exists>m. Ball (set G) (closed m)

goal (1 subgoal):
 1. \<exists>m. Ball (set (a # G)) (closed m)
[PROOF STEP]
using ex_closed closed_mono
[PROOF STATE]
proof (prove)
using this:
\<exists>m. Ball (set G) (closed m)
\<exists>m. closed m ?p
\<lbrakk>?i \<le> ?j; closed ?i ?p\<rbrakk> \<Longrightarrow> closed ?j ?p

goal (1 subgoal):
 1. \<exists>m. Ball (set (a # G)) (closed m)
[PROOF STEP]
by (metis Ball_set list_all_simps(1) nat_le_linear)
[PROOF STATE]
proof (state)
this:
\<exists>m. list_all (closed m) (a # G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in padic_integers) Zp_residue_eq2:
  assumes "a \<in> carrier Zp"
  assumes "b \<in> carrier Zp"
  assumes "(a k) = (b k)"
  assumes "a \<noteq> b"
  shows "val_Zp (a \<ominus> b) \<ge> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eint (int k) \<le> val_Zp (a \<ominus> b)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eint (int k) \<le> val_Zp (a \<ominus> b)
[PROOF STEP]
have "(a \<ominus> b) k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<ominus> b) k = 0
[PROOF STEP]
using assms residue_of_diff
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Zp
b \<in> carrier Zp
a k = b k
a \<noteq> b
?b \<in> carrier Zp \<Longrightarrow> (?a \<ominus> ?b) ?k = ?a ?k \<ominus>\<^bsub>residue_ring (p ^ ?k)\<^esub> ?b ?k

goal (1 subgoal):
 1. (a \<ominus> b) k = 0
[PROOF STEP]
by (simp add: Zp_def padic_integers.residue_of_diff' padic_integers_axioms)
[PROOF STATE]
proof (state)
this:
(a \<ominus> b) k = 0

goal (1 subgoal):
 1. eint (int k) \<le> val_Zp (a \<ominus> b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a \<ominus> b) k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a \<ominus> b) k = 0

goal (1 subgoal):
 1. eint (int k) \<le> val_Zp (a \<ominus> b)
[PROOF STEP]
using assms(1) assms(2) ord_Zp_def ord_Zp_geq val_Zp_def
[PROOF STATE]
proof (prove)
using this:
(a \<ominus> b) k = 0
a \<in> carrier Zp
b \<in> carrier Zp
ord_Zp = padic_val p
\<lbrakk>?x \<in> carrier Zp; ?x ?n = 0; ?x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> int ?n \<le> ord_Zp ?x
val_Zp = (\<lambda>x. if x = \<zero> then \<infinity> else eint (padic_val p x))

goal (1 subgoal):
 1. eint (int k) \<le> val_Zp (a \<ominus> b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eint (int k) \<le> val_Zp (a \<ominus> b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigthetaI_tendsto_norm:
  assumes c_not_0: "(c::real) \<noteq> 0"
  assumes lim:     "((\<lambda>x. norm (f x / g x)) \<longlongrightarrow> c) F"
  shows   "f \<in> \<Theta>[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> \<Theta>[F](g)
[PROOF STEP]
proof (rule bigthetaI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> O[F](g)
 2. f \<in> \<Omega>[F](g)
[PROOF STEP]
from c_not_0
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
[PROOF STEP]
have "\<bar>c\<bar> > 0"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. 0 < \<bar>c\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < \<bar>c\<bar>

goal (2 subgoals):
 1. f \<in> O[F](g)
 2. f \<in> \<Omega>[F](g)
[PROOF STEP]
with lim
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. norm (f x / g x)) \<longlongrightarrow> c) F
0 < \<bar>c\<bar>
[PROOF STEP]
have "eventually (\<lambda>x. norm (norm (f x / g x) - c) < \<bar>c\<bar>) F"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. norm (f x / g x)) \<longlongrightarrow> c) F
0 < \<bar>c\<bar>

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (norm (f x / g x) - c) < \<bar>c\<bar>
[PROOF STEP]
by (subst (asm) tendsto_iff) (simp add: dist_real_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (norm (f x / g x) - c) < \<bar>c\<bar>

goal (2 subgoals):
 1. f \<in> O[F](g)
 2. f \<in> \<Omega>[F](g)
[PROOF STEP]
hence g: "eventually (\<lambda>x. g x \<noteq> 0) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (norm (f x / g x) - c) < \<bar>c\<bar>

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. g x \<noteq> (0::'b)
[PROOF STEP]
by eventually_elim (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. g x \<noteq> (0::'b)

goal (2 subgoals):
 1. f \<in> O[F](g)
 2. f \<in> \<Omega>[F](g)
[PROOF STEP]
from lim g
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. norm (f x / g x)) \<longlongrightarrow> c) F
\<forall>\<^sub>F x in F. g x \<noteq> (0::'b)
[PROOF STEP]
show "f \<in> O[F](g)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. norm (f x / g x)) \<longlongrightarrow> c) F
\<forall>\<^sub>F x in F. g x \<noteq> (0::'b)

goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
by (rule bigoI_tendsto_norm)
[PROOF STATE]
proof (state)
this:
f \<in> O[F](g)

goal (1 subgoal):
 1. f \<in> \<Omega>[F](g)
[PROOF STEP]
from c_not_0 and lim
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
((\<lambda>x. norm (f x / g x)) \<longlongrightarrow> c) F
[PROOF STEP]
show "f \<in> \<Omega>[F](g)"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0
((\<lambda>x. norm (f x / g x)) \<longlongrightarrow> c) F

goal (1 subgoal):
 1. f \<in> \<Omega>[F](g)
[PROOF STEP]
by (rule bigomegaI_tendsto_norm)
[PROOF STATE]
proof (state)
this:
f \<in> \<Omega>[F](g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_0_iff:
  "xs = zeroes n \<longleftrightarrow> length xs = n \<and> (\<forall>x\<in>set xs. x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs = zeroes n) = (length xs = n \<and> (\<forall>x\<in>set xs. x = 0))
[PROOF STEP]
using in_set_replicate [of _ n 0] and replicate_eqI [of xs n 0]
[PROOF STATE]
proof (prove)
using this:
(?x \<in> set (replicate n (0::?'a1))) = (?x = (0::?'a1) \<and> n \<noteq> 0)
\<lbrakk>length xs = n; \<And>y. y \<in> set xs \<Longrightarrow> y = 0\<rbrakk> \<Longrightarrow> xs = zeroes n

goal (1 subgoal):
 1. (xs = zeroes n) = (length xs = n \<and> (\<forall>x\<in>set xs. x = 0))
[PROOF STEP]
by auto


[STATEMENT]
lemma exp_bound:
  fixes x :: real
  assumes a: "0 \<le> x"
    and b: "x \<le> 1"
  shows "exp x \<le> 1 + x + x\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp x \<le> 1 + x + x\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp x \<le> 1 + x + x\<^sup>2
[PROOF STEP]
have "suminf (\<lambda>n. inverse(fact (n+2)) * (x ^ (n + 2))) \<le> x\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
have "(\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums (x\<^sup>2 / 2 * (1 / (1 - 1 / 2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums (x\<^sup>2 / 2 * (1 / (1 - 1 / 2)))
[PROOF STEP]
by (intro sums_mult geometric_sums) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums (x\<^sup>2 / 2 * (1 / (1 - 1 / 2)))

goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums (x\<^sup>2 / 2 * (1 / (1 - 1 / 2)))
[PROOF STEP]
have sumsx: "(\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums x\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums (x\<^sup>2 / 2 * (1 / (1 - 1 / 2)))

goal (1 subgoal):
 1. (\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums x\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n) sums x\<^sup>2

goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
have "suminf (\<lambda>n. inverse(fact (n+2)) * (x ^ (n + 2))) \<le> suminf (\<lambda>n. (x\<^sup>2/2) * ((1/2)^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> (\<Sum>n. x\<^sup>2 / 2 * (1 / 2) ^ n)
[PROOF STEP]
proof (intro suminf_le allI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
 2. summable (\<lambda>n. inverse (fact (n + 2)) * x ^ (n + 2))
 3. summable (\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n)
[PROOF STEP]
show "inverse (fact (n + 2)) * x ^ (n + 2) \<le> (x\<^sup>2/2) * ((1/2)^n)" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
have "(2::nat) * 2 ^ n \<le> fact (n + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * 2 ^ n \<le> fact (n + 2)
[PROOF STEP]
by (induct n) simp_all
[PROOF STATE]
proof (state)
this:
2 * 2 ^ n \<le> fact (n + 2)

goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * 2 ^ n \<le> fact (n + 2)
[PROOF STEP]
have "real ((2::nat) * 2 ^ n) \<le> real_of_nat (fact (n + 2))"
[PROOF STATE]
proof (prove)
using this:
2 * 2 ^ n \<le> fact (n + 2)

goal (1 subgoal):
 1. real (2 * 2 ^ n) \<le> real (fact (n + 2))
[PROOF STEP]
by (simp only: of_nat_le_iff)
[PROOF STATE]
proof (state)
this:
real (2 * 2 ^ n) \<le> real (fact (n + 2))

goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (2 * 2 ^ n) \<le> real (fact (n + 2))
[PROOF STEP]
have "((2::real) * 2 ^ n) \<le> fact (n + 2)"
[PROOF STATE]
proof (prove)
using this:
real (2 * 2 ^ n) \<le> real (fact (n + 2))

goal (1 subgoal):
 1. 2 * 2 ^ n \<le> fact (n + 2)
[PROOF STEP]
unfolding of_nat_fact
[PROOF STATE]
proof (prove)
using this:
real (2 * 2 ^ n) \<le> fact (n + 2)

goal (1 subgoal):
 1. 2 * 2 ^ n \<le> fact (n + 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * 2 ^ n \<le> fact (n + 2)

goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * 2 ^ n \<le> fact (n + 2)
[PROOF STEP]
have "inverse (fact (n + 2)) \<le> inverse ((2::real) * 2 ^ n)"
[PROOF STATE]
proof (prove)
using this:
2 * 2 ^ n \<le> fact (n + 2)

goal (1 subgoal):
 1. inverse (fact (n + 2)) \<le> inverse (2 * 2 ^ n)
[PROOF STEP]
by (rule le_imp_inverse_le) simp
[PROOF STATE]
proof (state)
this:
inverse (fact (n + 2)) \<le> inverse (2 * 2 ^ n)

goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (fact (n + 2)) \<le> inverse (2 * 2 ^ n)
[PROOF STEP]
have "inverse (fact (n + 2)) \<le> 1/(2::real) * (1/2)^n"
[PROOF STATE]
proof (prove)
using this:
inverse (fact (n + 2)) \<le> inverse (2 * 2 ^ n)

goal (1 subgoal):
 1. inverse (fact (n + 2)) \<le> 1 / 2 * (1 / 2) ^ n
[PROOF STEP]
by (simp add: power_inverse [symmetric])
[PROOF STATE]
proof (state)
this:
inverse (fact (n + 2)) \<le> 1 / 2 * (1 / 2) ^ n

goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (fact (n + 2)) \<le> 1 / 2 * (1 / 2) ^ n
[PROOF STEP]
have "inverse (fact (n + 2)) * (x^n * x\<^sup>2) \<le> 1/2 * (1/2)^n * (1 * x\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
inverse (fact (n + 2)) \<le> 1 / 2 * (1 / 2) ^ n

goal (1 subgoal):
 1. inverse (fact (n + 2)) * (x ^ n * x\<^sup>2) \<le> 1 / 2 * (1 / 2) ^ n * (1 * x\<^sup>2)
[PROOF STEP]
by (rule mult_mono) (rule mult_mono, simp_all add: power_le_one a b)
[PROOF STATE]
proof (state)
this:
inverse (fact (n + 2)) * (x ^ n * x\<^sup>2) \<le> 1 / 2 * (1 / 2) ^ n * (1 * x\<^sup>2)

goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (fact (n + 2)) * (x ^ n * x\<^sup>2) \<le> 1 / 2 * (1 / 2) ^ n * (1 * x\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inverse (fact (n + 2)) * (x ^ n * x\<^sup>2) \<le> 1 / 2 * (1 / 2) ^ n * (1 * x\<^sup>2)

goal (1 subgoal):
 1. inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
unfolding power_add
[PROOF STATE]
proof (prove)
using this:
inverse (fact (n + 2)) * (x ^ n * x\<^sup>2) \<le> 1 / 2 * (1 / 2) ^ n * (1 * x\<^sup>2)

goal (1 subgoal):
 1. inverse (fact (n + 2)) * (x ^ n * x\<^sup>2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n
[PROOF STEP]
by (simp add: ac_simps del: fact_Suc)
[PROOF STATE]
proof (state)
this:
inverse (fact (n + 2)) * x ^ (n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inverse (fact (?n + 2)) * x ^ (?n + 2) \<le> x\<^sup>2 / 2 * (1 / 2) ^ ?n

goal (2 subgoals):
 1. summable (\<lambda>n. inverse (fact (n + 2)) * x ^ (n + 2))
 2. summable (\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n)
[PROOF STEP]
show "summable (\<lambda>n. inverse (fact (n + 2)) * x ^ (n + 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. inverse (fact (n + 2)) * x ^ (n + 2))
[PROOF STEP]
by (rule summable_exp [THEN summable_ignore_initial_segment])
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. inverse (fact (n + 2)) * x ^ (n + 2))

goal (1 subgoal):
 1. summable (\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n)
[PROOF STEP]
show "summable (\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n)
[PROOF STEP]
by (rule sums_summable [OF sumsx])
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. x\<^sup>2 / 2 * (1 / 2) ^ n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> (\<Sum>n. x\<^sup>2 / 2 * (1 / 2) ^ n)

goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> (\<Sum>n. x\<^sup>2 / 2 * (1 / 2) ^ n)

goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
have "\<dots> = x\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. x\<^sup>2 / 2 * (1 / 2) ^ n) = x\<^sup>2
[PROOF STEP]
by (rule sums_unique [THEN sym]) (rule sumsx)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. x\<^sup>2 / 2 * (1 / 2) ^ n) = x\<^sup>2

goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2

goal (1 subgoal):
 1. (\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2

goal (1 subgoal):
 1. exp x \<le> 1 + x + x\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2

goal (1 subgoal):
 1. exp x \<le> 1 + x + x\<^sup>2
[PROOF STEP]
unfolding exp_first_two_terms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. inverse (fact (n + 2)) * x ^ (n + 2)) \<le> x\<^sup>2

goal (1 subgoal):
 1. 1 + x + (\<Sum>n. x ^ (n + 2) /\<^sub>R fact (n + 2)) \<le> 1 + x + x\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
exp x \<le> 1 + x + x\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Max_less_iMin_imp_disjoint: "
  \<lbrakk> finite A; Max A < iMin B \<rbrakk> \<Longrightarrow> A \<inter> B = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; Max A < iMin B\<rbrakk> \<Longrightarrow> A \<inter> B = {}
[PROOF STEP]
apply (case_tac "A = {}", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; Max A < iMin B; A \<noteq> {}\<rbrakk> \<Longrightarrow> A \<inter> B = {}
[PROOF STEP]
apply (case_tac "B = {}", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; Max A < iMin B; A \<noteq> {}; B \<noteq> {}\<rbrakk> \<Longrightarrow> A \<inter> B = {}
[PROOF STEP]
apply (rule disjoint_iff_not_equal[THEN iffD2])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; Max A < iMin B; A \<noteq> {}; B \<noteq> {}\<rbrakk> \<Longrightarrow> \<forall>x\<in>A. \<forall>y\<in>B. x \<noteq> y
[PROOF STEP]
apply (intro ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>finite A; Max A < iMin B; A \<noteq> {}; B \<noteq> {}; x \<in> A; y \<in> B\<rbrakk> \<Longrightarrow> x \<noteq> y
[PROOF STEP]
apply (rule less_imp_neq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>finite A; Max A < iMin B; A \<noteq> {}; B \<noteq> {}; x \<in> A; y \<in> B\<rbrakk> \<Longrightarrow> x < y
[PROOF STEP]
by (rule Max_less_iMin_imp_less)


[STATEMENT]
lemma frontier_halfspace_ge:
  assumes "a \<noteq> 0 \<or> b \<noteq> 0"
    shows "frontier {x. a \<bullet> x \<ge> b} = {x. a \<bullet> x = b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
 2. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = (0::'a)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
 2. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a) \<or> b \<noteq> 0
a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a) \<or> b \<noteq> 0
a = (0::'a)

goal (1 subgoal):
 1. frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
by (force simp: frontier_def closed_halfspace_ge)
[PROOF STATE]
proof (state)
this:
frontier {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_k_impl_uniform_block_size:
  assumes "((u\<^sub>v (dim_row M)) \<^sub>v* M) = k \<cdot>\<^sub>v (u\<^sub>v (dim_col M))"
  assumes "bl \<in># (image_mset map_col_to_block (mset (cols M)))"
  shows "card bl = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card bl = k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card bl = k
[PROOF STEP]
obtain j where jlt: "j < dim_col M" and bleq: "bl = map_col_to_block (col M j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j < dim_col M; bl = map_col_to_block (col M j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2) obtain_block_index_map_block_set
[PROOF STATE]
proof (prove)
using this:
bl \<in># image_mset map_col_to_block (mset (cols M))
\<lbrakk>?bl \<in># image_mset map_col_to_block (mset (cols M)); \<And>j. \<lbrakk>j < dim_col M; ?bl = map_col_to_block (col M j)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j < dim_col M; bl = map_col_to_block (col M j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
j < dim_col M
bl = map_col_to_block (col M j)

goal (1 subgoal):
 1. card bl = k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j < dim_col M
bl = map_col_to_block (col M j)
[PROOF STEP]
have "card (map_col_to_block (col M j)) = mat_block_size M j"
[PROOF STATE]
proof (prove)
using this:
j < dim_col M
bl = map_col_to_block (col M j)

goal (1 subgoal):
 1. card (map_col_to_block (col M j)) = mat_block_size M j
[PROOF STEP]
by (simp add: map_col_to_block_size)
[PROOF STATE]
proof (state)
this:
card (map_col_to_block (col M j)) = mat_block_size M j

goal (1 subgoal):
 1. card bl = k
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card (map_col_to_block (col M j)) = mat_block_size M j

goal (1 subgoal):
 1. card bl = k
[PROOF STEP]
using vec_k_uniform_mat_block_size assms(1) bleq jlt
[PROOF STATE]
proof (prove)
using this:
card (map_col_to_block (col M j)) = mat_block_size M j
\<lbrakk>u\<^sub>v (dim_row M) \<^sub>v* M = int ?k \<cdot>\<^sub>v u\<^sub>v (dim_col M); ?j < dim_col M\<rbrakk> \<Longrightarrow> mat_block_size M ?j = ?k
u\<^sub>v (dim_row M) \<^sub>v* M = int k \<cdot>\<^sub>v u\<^sub>v (dim_col M)
bl = map_col_to_block (col M j)
j < dim_col M

goal (1 subgoal):
 1. card bl = k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card bl = k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma principal_ideal_eq_left:
  "principal_ideal S = (\<exists>a. left_ideal_generated {a} = S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. principal_ideal S = (\<exists>a. left_ideal_generated {a} = S)
[PROOF STEP]
unfolding principal_ideal_def ideal_generated_def left_ideal_generated_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>a. \<Inter> {I. ideal I \<and> {a} \<subseteq> I} = S) = (\<exists>a. \<Inter> {I. left_ideal I \<and> {a} \<subseteq> I} = S)
[PROOF STEP]
unfolding ideal_eq_left_ideal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>a. \<Inter> {I. left_ideal I \<and> {a} \<subseteq> I} = S) = (\<exists>a. \<Inter> {I. left_ideal I \<and> {a} \<subseteq> I} = S)
[PROOF STEP]
..


[STATEMENT]
theorem while_SE_unfold:
"(while\<^sub>S\<^sub>E b do c od) = (if\<^sub>S\<^sub>E b then (c ;- (while\<^sub>S\<^sub>E b do c od)) else result () fi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. _while_SE b c = _if_SE b (c ;- _while_SE b c) (unit\<^sub>S\<^sub>E ())
[PROOF STEP]
apply (simp add: if_SE_def bind_SE'_def while_SE_def unit_SE_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rel2Mon (lfp (\<Gamma> b (Mon2Rel c))) = (\<lambda>\<sigma>. if b \<sigma> then (_bind_SE _ c (Rel2Mon (lfp (\<Gamma> b (Mon2Rel c))))) \<sigma> else Some ((), \<sigma>))
[PROOF STEP]
apply (subst lfp_unfold [OF mono_if_cont, OF cont_\<Gamma>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rel2Mon (\<Gamma> b (Mon2Rel c) (lfp (\<Gamma> b (Mon2Rel c)))) = (\<lambda>\<sigma>. if b \<sigma> then (_bind_SE _ c (Rel2Mon (lfp (\<Gamma> b (Mon2Rel c))))) \<sigma> else Some ((), \<sigma>))
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<sigma>. Rel2Mon (\<Gamma> b (Mon2Rel c) (lfp (\<Gamma> b (Mon2Rel c)))) \<sigma> = (if b \<sigma> then (_bind_SE _ c (Rel2Mon (lfp (\<Gamma> b (Mon2Rel c))))) \<sigma> else Some ((), \<sigma>))
[PROOF STEP]
apply (subst \<Gamma>_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<sigma>. Rel2Mon {(s, t). if b s then (s, t) \<in> Mon2Rel c O lfp (\<Gamma> b (Mon2Rel c)) else s = t} \<sigma> = (if b \<sigma> then (_bind_SE _ c (Rel2Mon (lfp (\<Gamma> b (Mon2Rel c))))) \<sigma> else Some ((), \<sigma>))
[PROOF STEP]
apply (auto simp: Rel2Mon_if Rel2Mon_homomorphism bind_SE'_def Rel2Mon_Id [simplified comp_def]
                  single_valued_Mon2Rel single_valued_lfp_Mon2Rel )
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma abelian_group_mat: "abelian_group (module_mat TYPE('a :: comm_ring_1) nr nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abelian_group (module_mat TYPE('a) nr nc)
[PROOF STEP]
by (unfold_locales, insert add_inv_exists_mat, auto simp: module_mat_def Units_def)


[STATEMENT]
lemma polyhedron_affine_hull:
  fixes S :: "'a :: euclidean_space set"
  shows "polyhedron(affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polyhedron (affine hull S)
[PROOF STEP]
by (simp add: affine_imp_polyhedron)


[STATEMENT]
lemma strassen_measure_add[simp]:
  "strassen_measure (A + B, C) = strassen_measure (B,C)"
  "strassen_measure (A, B + C) = strassen_measure (A,C)"
  "strassen_measure (A - B, C) = strassen_measure (B,C)"
  "strassen_measure (A, B - C) = strassen_measure (A,C)"
  "strassen_measure (- A, B) = strassen_measure (A,B)"
  "strassen_measure (A, - B) = strassen_measure (A,B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (strassen_measure (A + B, C) = strassen_measure (B, C) &&& strassen_measure (A, B + C) = strassen_measure (A, C) &&& strassen_measure (A - B, C) = strassen_measure (B, C)) &&& strassen_measure (A, B - C) = strassen_measure (A, C) &&& strassen_measure (- A, B) = strassen_measure (A, B) &&& strassen_measure (A, - B) = strassen_measure (A, B)
[PROOF STEP]
unfolding strassen_measure_def strassen_even_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((case (A + B, C) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) = (case (B, C) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) &&& (case (A, B + C) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) = (case (A, C) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) &&& (case (A - B, C) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) = (case (B, C) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1))) &&& (case (A, B - C) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) = (case (A, C) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) &&& (case (- A, B) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) = (case (A, B) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) &&& (case (A, - B) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1)) = (case (A, B) of (A, B) \<Rightarrow> dim_row A + dim_col A + dim_col B + (dim_row A + dim_col A + dim_col B) + (if even (dim_row A) \<and> even (dim_col A) \<and> even (dim_col B) then 0 else 1))
[PROOF STEP]
by auto


[STATEMENT]
lemma distinct_seteq_set_Cons'':
  "\<lbrakk>Finite_Set.card xs = Suc n; x \<in> {ys. set ys = xs \<and> distinct ys}\<rbrakk>
    \<Longrightarrow> \<exists>y ys zs. y # ys = x \<and> y \<in> xs
        \<and> set ys = zs \<and> Finite_Set.card zs = n \<and> distinct ys \<and> finite zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Finite_Set.card xs = Suc n; x \<in> {ys. set ys = xs \<and> distinct ys}\<rbrakk> \<Longrightarrow> \<exists>y ys zs. y # ys = x \<and> y \<in> xs \<and> set ys = zs \<and> Finite_Set.card zs = n \<and> distinct ys \<and> finite zs
[PROOF STEP]
using distinct_seteq_set_Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Finite_Set.card ?xs = Suc ?n; ?x \<in> {ys. set ys = ?xs \<and> distinct ys}\<rbrakk> \<Longrightarrow> \<exists>y ys. y # ys = ?x \<and> length ys = ?n \<and> distinct ys \<and> finite (set ys)

goal (1 subgoal):
 1. \<lbrakk>Finite_Set.card xs = Suc n; x \<in> {ys. set ys = xs \<and> distinct ys}\<rbrakk> \<Longrightarrow> \<exists>y ys zs. y # ys = x \<and> y \<in> xs \<and> set ys = zs \<and> Finite_Set.card zs = n \<and> distinct ys \<and> finite zs
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in \<Z>) vfst_arrow_is_cat_Set_iso_arr'[cat_rel_par_Set_cs_intros]:
  assumes "A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "b \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "AB = A \<times>\<^sub>\<circ> set {b}"
    and "A' = A"
    and "\<CC>' = cat_Set \<alpha>"
  shows "vfst_arrow A (set {b}) : AB \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfst_arrow A (ZFC_in_HOL.set {b}) : AB \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> A
[PROOF STEP]
using assms(1-2)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
b \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vfst_arrow A (ZFC_in_HOL.set {b}) : AB \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<CC>'\<^esub> A
[PROOF STEP]
unfolding assms(3-5)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>
b \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vfst_arrow A (ZFC_in_HOL.set {b}) : A \<times>\<^sub>\<circ> ZFC_in_HOL.set {b} \<mapsto>\<^sub>i\<^sub>s\<^sub>o\<^bsub>cat_Set \<alpha>\<^esub> A
[PROOF STEP]
by (rule vfst_arrow_is_cat_Set_iso_arr)