[STATEMENT]
lemma (in strategic_space_2p) J_cnj_is_gate:
  shows "gate 2 (J\<^sup>\<dagger>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gate 2 Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. dim_row Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 2\<^sup>2
 2. square_mat Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
 3. unitary Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
[PROOF STEP]
show "dim_row (J\<^sup>\<dagger>) = 2\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 2\<^sup>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 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 2\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 2\<^sup>2

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

goal (2 subgoals):
 1. square_mat Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
 2. unitary Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
[PROOF STEP]
show "square_mat (J\<^sup>\<dagger>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_mat Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
[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. square_mat Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
square_mat Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>

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

goal (1 subgoal):
 1. unitary Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
[PROOF STEP]
have "(J\<^sup>\<dagger>)\<^sup>\<dagger> = J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>\<^sup>\<dagger> = Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]
[PROOF STEP]
using dagger_of_dagger_is_id
[PROOF STATE]
proof (prove)
using this:
?M\<^sup>\<dagger>\<^sup>\<dagger> = ?M

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

goal (1 subgoal):
 1. unitary Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim_row Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 2\<^sup>2
square_mat Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>\<^sup>\<dagger> = Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]
[PROOF STEP]
show "unitary (J\<^sup>\<dagger>)"
[PROOF STATE]
proof (prove)
using this:
dim_row Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 2\<^sup>2
square_mat Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>\<^sup>\<dagger> = Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]

goal (1 subgoal):
 1. unitary Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
[PROOF STEP]
using mat_of_cols_list_def unitary_def J_cnj_times_J J_times_J_cnj
[PROOF STATE]
proof (prove)
using this:
dim_row Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 2\<^sup>2
square_mat Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger>\<^sup>\<dagger> = Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)
unitary ?M \<equiv> ?M\<^sup>\<dagger> * ?M = 1\<^sub>m (dim_col ?M) \<and> ?M * ?M\<^sup>\<dagger> = 1\<^sub>m (dim_row ?M)
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] = 1\<^sub>m 4
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 1\<^sub>m 4

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_imp_less_mset: "A \<subset># B \<Longrightarrow> A < B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subset># B \<Longrightarrow> A < B
[PROOF STEP]
by (simp add: order.not_eq_order_implies_strict subset_eq_imp_le_multiset)


[STATEMENT]
lemma quantale_closed_unital_maps_iff: "f \<in> quantale_closed_unital_maps = (\<forall> x y. f x \<cdot> f y \<le> f (x \<cdot> y) \<and> 1 \<le> f 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> quantale_closed_unital_maps) = (\<forall>x y. f x \<cdot> f y \<le> f (x \<cdot> y) \<and> (1::'b) \<le> f (1::'a))
[PROOF STEP]
unfolding quantale_closed_unital_maps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> {f. (\<forall>x y. f x \<cdot> f y \<le> f (x \<cdot> y)) \<and> (1::'b) \<le> f (1::'a)}) = (\<forall>x y. f x \<cdot> f y \<le> f (x \<cdot> y) \<and> (1::'b) \<le> f (1::'a))
[PROOF STEP]
by clarsimp


[STATEMENT]
lemma map_us_map_IInf_inv: "map_us \<circ> map_IInf = (id::('a::complete_lattice_with_dual upset \<Rightarrow> 'b::complete_lattice_with_dual upset) \<Rightarrow> ('a upset \<Rightarrow> 'b upset))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_us \<circ> map_IInf = id
[PROOF STEP]
unfolding map_IInf_def map_us_def IInf_def us_def id_def comp_def fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x xa. Abs_upset (\<up> (\<Sqinter> Rep_upset (x (Abs_upset (\<up> (\<Sqinter> Rep_upset xa)))))) = x xa
[PROOF STEP]
by (metis (no_types, lifting) Inf_upset_id Rep_upset Rep_upset_inverse image_iff pointfree_idE)


[STATEMENT]
lemma ennreal_SUP_add_right:
  fixes c :: ennreal shows "I \<noteq> {} \<Longrightarrow> c + (SUP i\<in>I. f i) = (SUP i\<in>I. c + f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> c + Sup (f ` I) = (SUP i\<in>I. c + f i)
[PROOF STEP]
using ennreal_SUP_add_left[of I f c]
[PROOF STATE]
proof (prove)
using this:
I \<noteq> {} \<Longrightarrow> (SUP i\<in>I. f i + c) = Sup (f ` I) + c

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> c + Sup (f ` I) = (SUP i\<in>I. c + f i)
[PROOF STEP]
by (simp add: add.commute)


[STATEMENT]
lemma bilinear_eq_stdbasis:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space \<Rightarrow> _"
  assumes bf: "bilinear f"
    and bg: "bilinear g"
    and fg: "\<And>i j. i \<in> Basis \<Longrightarrow> j \<in> Basis \<Longrightarrow> f i j = g i j"
  shows "f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = g
[PROOF STEP]
using bilinear_eq[OF bf bg equalityD2[OF span_Basis] equalityD2[OF span_Basis]] fg
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> UNIV; ?y \<in> UNIV; \<And>x y. \<lbrakk>x \<in> Basis; y \<in> Basis\<rbrakk> \<Longrightarrow> f x y = g x y\<rbrakk> \<Longrightarrow> f ?x ?y = g ?x ?y
\<lbrakk>?i \<in> Basis; ?j \<in> Basis\<rbrakk> \<Longrightarrow> f ?i ?j = g ?i ?j

goal (1 subgoal):
 1. f = g
[PROOF STEP]
by blast


[STATEMENT]
lemma 1: "poly_mod_type TYPE('a :: nontriv) m = (m = int CARD('a))"
  and 2: "class.nontriv TYPE('a) = (CARD('a) \<ge> 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mod_type TYPE('a) m = (m = int CARD('a)) &&& class.nontriv TYPE('a) = (2 \<le> CARD('a))
[PROOF STEP]
unfolding poly_mod_type_def class.prime_card_def class.nontriv_def poly_mod_prime_type_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m = int CARD('a)) = (m = int CARD('a)) &&& (1 < CARD('a)) = (2 \<le> CARD('a))
[PROOF STEP]
by auto


[STATEMENT]
lemma i_set_min_i_UN_set_min_eq: "i_set_min = i_UN_set_min"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i_set_min = i_UN_set_min
[PROOF STEP]
by (simp add: i_set_min_def i_UN_set_min_def i_set_i_UN_set_sets_eq)


[STATEMENT]
lemma setprod_atMost_Suc[simp]:
  "(\<Prod>i \<le> Suc n. f i) = (\<Prod>i \<le> n. f i) * f(Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f {..Suc n} = prod f {..n} * f (Suc n)
[PROOF STEP]
by(simp add:atMost_Suc mult_ac)


[STATEMENT]
lemma zero_less_limit_ordinal [simp]: "limit_ordinal x \<Longrightarrow> 0 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limit_ordinal x \<Longrightarrow> 0 < x
[PROOF STEP]
by (simp add: limit_ordinal_def)


[STATEMENT]
lemma arccos_le_pi2: "\<lbrakk>0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> arccos y \<le> pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> y; y \<le> 1\<rbrakk> \<Longrightarrow> arccos y \<le> pi / 2
[PROOF STEP]
by (metis (mono_tags) arccos_0 arccos cos_le_one cos_monotone_0_pi_le
      cos_pi cos_pi_half pi_half_ge_zero antisym_conv less_eq_neg_nonpos linear minus_minus order.trans order_refl)


[STATEMENT]
lemma inside_simple_curve_imp_closed:
  fixes \<gamma> :: "real \<Rightarrow> 'a::euclidean_space"
    shows "\<lbrakk>simple_path \<gamma>; x \<in> inside(path_image \<gamma>)\<rbrakk> \<Longrightarrow> pathfinish \<gamma> = pathstart \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>simple_path \<gamma>; x \<in> inside (path_image \<gamma>)\<rbrakk> \<Longrightarrow> pathfinish \<gamma> = pathstart \<gamma>
[PROOF STEP]
using arc_simple_path  inside_arc_empty
[PROOF STATE]
proof (prove)
using this:
arc ?g = (simple_path ?g \<and> pathfinish ?g \<noteq> pathstart ?g)
arc ?\<gamma> \<Longrightarrow> inside (path_image ?\<gamma>) = {}

goal (1 subgoal):
 1. \<lbrakk>simple_path \<gamma>; x \<in> inside (path_image \<gamma>)\<rbrakk> \<Longrightarrow> pathfinish \<gamma> = pathstart \<gamma>
[PROOF STEP]
by blast


[STATEMENT]
lemma sin_eq_0:
  fixes z::complex
  shows "sin z = 0 \<longleftrightarrow> (\<exists>n::int. z = of_real(n * pi))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin z = 0) = (\<exists>x. z = complex_of_real (real_of_int x * pi))
[PROOF STEP]
by (simp add: sin_exp_eq exp_eq)


[STATEMENT]
lemma monotone_case_prodI:
  "\<lbrakk> \<And>a. monotone ordb ordc (f a); \<And>b. monotone orda ordc (\<lambda>a. f a b);
    class.preorder orda (mk_less orda); class.preorder ordb (mk_less ordb);
    class.preorder ordc (mk_less ordc) \<rbrakk>
  \<Longrightarrow> monotone (rel_prod orda ordb) ordc (case_prod f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>a. monotone ordb ordc (f a); \<And>b. monotone orda ordc (\<lambda>a. f a b); class.preorder orda (mk_less orda); class.preorder ordb (mk_less ordb); class.preorder ordc (mk_less ordc)\<rbrakk> \<Longrightarrow> monotone (rel_prod orda ordb) ordc (\<lambda>(x, y). f x y)
[PROOF STEP]
by(rule monotone_rel_prodI) simp_all


[STATEMENT]
lemma measure_interior:
   "\<lbrakk>bounded S; negligible(frontier S)\<rbrakk> \<Longrightarrow> measure lebesgue (interior S) = measure lebesgue S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bounded S; negligible (frontier S)\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure lebesgue (interior S) = Sigma_Algebra.measure lebesgue S
[PROOF STEP]
using measure_closure measure_frontier negligible_imp_measure0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bounded ?S; negligible (frontier ?S)\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure lebesgue (closure ?S) = Sigma_Algebra.measure lebesgue ?S
bounded ?S \<Longrightarrow> Sigma_Algebra.measure lebesgue (frontier ?S) = Sigma_Algebra.measure lebesgue (closure ?S) - Sigma_Algebra.measure lebesgue (interior ?S)
negligible ?S \<Longrightarrow> Sigma_Algebra.measure lebesgue ?S = 0

goal (1 subgoal):
 1. \<lbrakk>bounded S; negligible (frontier S)\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure lebesgue (interior S) = Sigma_Algebra.measure lebesgue S
[PROOF STEP]
by fastforce


[STATEMENT]
lemma of_nat_monom:
  "of_nat n = monom (of_nat n) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n = monom (of_nat n) 0
[PROOF STEP]
by (simp add: of_nat_poly monom_0)


[STATEMENT]
lemma constant_term_denominator_nonzero_imp_constant_term_denominator_div_gcd_nonzero:
  "constant_term (denominator x div gcd a (denominator x)) \<noteq> 0"
  if "constant_term (denominator x) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. constant_term (denominator x div gcd a (denominator x)) \<noteq> (0::'a)
[PROOF STEP]
using that coeff_0_normalize_quot_nonzero [of "(a, denominator x)"]
  normalize_quot_proj(2) [of "denominator x" a]
[PROOF STATE]
proof (prove)
using this:
constant_term (denominator x) \<noteq> (0::'a)
constant_term (snd (a, denominator x)) \<noteq> (0::'a) \<Longrightarrow> constant_term (snd (normalize_quot (a, denominator x))) \<noteq> (0::'a)
denominator x \<noteq> 0 \<Longrightarrow> snd (normalize_quot (a, denominator x)) = normalize (denominator x) div gcd a (denominator x)

goal (1 subgoal):
 1. constant_term (denominator x div gcd a (denominator x)) \<noteq> (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma cmod_unit_one: "cmod (cos a + \<i> * sin a) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real (cos a) + \<i> * complex_of_real (sin a)) = 1
[PROOF STEP]
by (simp add: norm_complex_def)


[STATEMENT]
lemma (in \<Z>) vsnd_arrow_is_cat_Rel_arr'[cat_Rel_par_set_cs_intros]:
  assumes "A \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>"
    and "B \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>"
    and "AB = A \<times>\<^sub>\<circ> B"
    and "B' = B"
    and "\<CC>' = cat_Rel \<alpha>"
  shows "vsnd_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsnd_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
using assms(1-2)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vsnd_arrow A B : AB \<mapsto>\<^bsub>\<CC>'\<^esub> B'
[PROOF STEP]
unfolding assms(3-5)
[PROOF STATE]
proof (prove)
using this:
A \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>
B \<in>\<^sub>\<circ> cat_Rel \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. vsnd_arrow A B : A \<times>\<^sub>\<circ> B \<mapsto>\<^bsub>cat_Rel \<alpha>\<^esub> B
[PROOF STEP]
by (rule vsnd_arrow_is_cat_Rel_arr)


[STATEMENT]
lemma strict_alt_def_utility_g:
  assumes "p \<succ>[relation] q"
  shows "(\<Sum>z\<in>outcomes. (pmf p z) * (u z)) > (\<Sum>z\<in>outcomes. (pmf q z) * (u z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) < (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
using assms not_outside(1) not_outside(2) strict_alt_def
[PROOF STATE]
proof (prove)
using this:
p \<succeq> q \<and> (q, p) \<notin> relation
?p \<succeq> ?q \<Longrightarrow> ?p \<in> \<P> outcomes
?p \<succeq> ?q \<Longrightarrow> ?q \<in> \<P> outcomes
\<lbrakk>?p \<in> \<P> outcomes; ?q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> (?p \<succeq> ?q \<and> (?q, ?p) \<notin> relation) = ((\<Sum>z\<in>outcomes. pmf ?q z * u z) < (\<Sum>z\<in>outcomes. pmf ?p z * u z))

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf q z * u z) < (\<Sum>z\<in>outcomes. pmf p z * u z)
[PROOF STEP]
by meson


[STATEMENT]
lemma mset_eq_finite:
  \<open>finite {ys. mset ys = mset xs}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {ys. mset ys = mset xs}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {ys. mset ys = mset xs}
[PROOF STEP]
have \<open>{ys. mset ys = mset xs} \<subseteq> {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {ys. mset ys = mset xs} \<subseteq> {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}
[PROOF STEP]
by (auto simp add: dest: mset_eq_setD mset_eq_length)
[PROOF STATE]
proof (state)
this:
{ys. mset ys = mset xs} \<subseteq> {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}

goal (1 subgoal):
 1. finite {ys. mset ys = mset xs}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{ys. mset ys = mset xs} \<subseteq> {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}

goal (1 subgoal):
 1. finite {ys. mset ys = mset xs}
[PROOF STEP]
have \<open>finite {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}
[PROOF STEP]
using finite_lists_length_le
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> finite {xs. set xs \<subseteq> ?A \<and> length xs \<le> ?n}

goal (1 subgoal):
 1. finite {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}

goal (1 subgoal):
 1. finite {ys. mset ys = mset xs}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{ys. mset ys = mset xs} \<subseteq> {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}
finite {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{ys. mset ys = mset xs} \<subseteq> {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}
finite {ys. set ys \<subseteq> set xs \<and> length ys \<le> length xs}

goal (1 subgoal):
 1. finite {ys. mset ys = mset xs}
[PROOF STEP]
by (rule finite_subset)
[PROOF STATE]
proof (state)
this:
finite {ys. mset ys = mset xs}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infsetsum_finite [simp]: "finite A \<Longrightarrow> infsetsum f A = (\<Sum>x\<in>A. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> infsetsum f A = sum f A
[PROOF STEP]
by (simp add: infsetsum_def lebesgue_integral_count_space_finite)


[STATEMENT]
lemma exp_converges: "(\<lambda>n. x^n /\<^sub>R fact n) sums exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. x ^ n /\<^sub>R fact n) sums exp x
[PROOF STEP]
unfolding exp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. x ^ n /\<^sub>R fact n) sums (\<Sum>n. x ^ n /\<^sub>R fact n)
[PROOF STEP]
by (rule summable_exp_generic [THEN summable_sums])


[STATEMENT]
lemma vunion_fun_mono:
  assumes "mono f"
  shows "f A \<union>\<^sub>\<circ> f B \<subseteq>\<^sub>\<circ> f (A \<union>\<^sub>\<circ> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f A \<union>\<^sub>\<circ> f B \<subseteq>\<^sub>\<circ> f (A \<union>\<^sub>\<circ> B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mono f

goal (1 subgoal):
 1. f A \<union>\<^sub>\<circ> f B \<subseteq>\<^sub>\<circ> f (A \<union>\<^sub>\<circ> B)
[PROOF STEP]
by (fact mono_sup)


[STATEMENT]
lemma unitary_ZmX:
  shows "Complex_Matrix.unitary ZmX"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary ZmX
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.unitary ZmX
[PROOF STEP]
have "Complex_Matrix.adjoint ZmX * ZmX = (1\<^sub>m 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint ZmX * ZmX = 1\<^sub>m 2
[PROOF STEP]
using ZmX_inv ZmX_hermitian
[PROOF STATE]
proof (prove)
using this:
ZmX * ZmX = 1\<^sub>m 2
hermitian ZmX

goal (1 subgoal):
 1. Complex_Matrix.adjoint ZmX * ZmX = 1\<^sub>m 2
[PROOF STEP]
unfolding hermitian_def
[PROOF STATE]
proof (prove)
using this:
ZmX * ZmX = 1\<^sub>m 2
Complex_Matrix.adjoint ZmX = ZmX

goal (1 subgoal):
 1. Complex_Matrix.adjoint ZmX * ZmX = 1\<^sub>m 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint ZmX * ZmX = 1\<^sub>m 2

goal (1 subgoal):
 1. Complex_Matrix.unitary ZmX
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint ZmX * ZmX = 1\<^sub>m 2

goal (1 subgoal):
 1. Complex_Matrix.unitary ZmX
[PROOF STEP]
unfolding unitary_def
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint ZmX * ZmX = 1\<^sub>m 2

goal (1 subgoal):
 1. ZmX \<in> carrier_mat (dim_row ZmX) (dim_row ZmX) \<and> inverts_mat ZmX (Complex_Matrix.adjoint ZmX)
[PROOF STEP]
by (metis Complex_Matrix.adjoint_adjoint Complex_Matrix.unitary_def ZmX_carrier adjoint_dim
        carrier_matD(1) inverts_mat_def unitary_adjoint)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.unitary ZmX

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma c_pair_sum_inj: "c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 + y1 = x2 + y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 + y1 = x2 + y2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 + y1 = x2 + y2
[PROOF STEP]
assume A1: "c_pair x1 y1 = c_pair x2 y2"
[PROOF STATE]
proof (state)
this:
c_pair x1 y1 = c_pair x2 y2

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 + y1 = x2 + y2
[PROOF STEP]
have S1: "(x1::nat) + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2
[PROOF STEP]
by (rule less_not_refl3, rule c_pair_sum_mono, auto)
[PROOF STATE]
proof (state)
this:
x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 + y1 = x2 + y2
[PROOF STEP]
have S2: "(x2::nat) + y2 < x1 + y1 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 + y2 < x1 + y1 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2
[PROOF STEP]
by (rule less_not_refl2, rule c_pair_sum_mono, auto)
[PROOF STATE]
proof (state)
this:
x2 + y2 < x1 + y1 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 + y1 = x2 + y2
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2
x2 + y2 < x1 + y1 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2
[PROOF STEP]
have "(x1::nat) + y1 \<noteq> x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2"
[PROOF STATE]
proof (prove)
using this:
x1 + y1 < x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2
x2 + y2 < x1 + y1 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2

goal (1 subgoal):
 1. x1 + y1 \<noteq> x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2
[PROOF STEP]
by (arith)
[PROOF STATE]
proof (state)
this:
x1 + y1 \<noteq> x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2

goal (1 subgoal):
 1. c_pair x1 y1 = c_pair x2 y2 \<Longrightarrow> x1 + y1 = x2 + y2
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
c_pair x1 y1 = c_pair x2 y2
x1 + y1 \<noteq> x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c_pair x1 y1 = c_pair x2 y2
x1 + y1 \<noteq> x2 + y2 \<Longrightarrow> c_pair x1 y1 \<noteq> c_pair x2 y2

goal (1 subgoal):
 1. x1 + y1 = x2 + y2
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
x1 + y1 = x2 + y2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigE_nonneg_real:
  assumes "f \<in> Lr F (g)" "eventually (\<lambda>x. f x \<ge> 0) F"
  obtains c where "c > 0" "eventually (\<lambda>x. R (f x) (c * \<bar>g x\<bar>)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. R (f x) (c * \<bar>g x\<bar>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. R (f x) (c * \<bar>g x\<bar>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
f \<in> Lr F g
[PROOF STEP]
obtain c where c: "c > 0" "eventually (\<lambda>x. R (norm (f x)) (c * norm (g x))) F"
[PROOF STATE]
proof (prove)
using this:
f \<in> Lr F g

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: Lr_def)
[PROOF STATE]
proof (state)
this:
0 < c
\<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. R (f x) (c * \<bar>g x\<bar>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from c(2) assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))
\<forall>\<^sub>F x in F. 0 \<le> f x
[PROOF STEP]
have "eventually (\<lambda>x. R (f x) (c * \<bar>g x\<bar>)) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. R (norm (f x)) (c * norm (g x))
\<forall>\<^sub>F x in F. 0 \<le> f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. R (f x) (c * \<bar>g x\<bar>)
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. R (f x) (c * \<bar>g x\<bar>)

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. R (f x) (c * \<bar>g x\<bar>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from c(1) and this
[PROOF STATE]
proof (chain)
picking this:
0 < c
\<forall>\<^sub>F x in F. R (f x) (c * \<bar>g x\<bar>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < c
\<forall>\<^sub>F x in F. R (f x) (c * \<bar>g x\<bar>)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (rule that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma app_arg_max_ge: "has_arg_max (f :: 'b \<Rightarrow> real) X \<Longrightarrow> x \<in> X \<Longrightarrow> f x \<le> f (arg_max_on f X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>has_arg_max f X; x \<in> X\<rbrakk> \<Longrightarrow> f x \<le> f (arg_max_on f X)
[PROOF STEP]
unfolding has_arg_max_def arg_max_on_def arg_max_def is_arg_max_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y); x \<in> X\<rbrakk> \<Longrightarrow> f x \<le> f (SOME x. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y))
[PROOF STEP]
using someI[where ?P = "\<lambda>x. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y)"] le_less_linear
[PROOF STATE]
proof (prove)
using this:
?x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f ?x < f y) \<Longrightarrow> (SOME x. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y)) \<in> X \<and> (\<nexists>y. y \<in> X \<and> f (SOME x. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y)) < f y)
?x \<le> ?y \<or> ?y < ?x

goal (1 subgoal):
 1. \<lbrakk>\<exists>x. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y); x \<in> X\<rbrakk> \<Longrightarrow> f x \<le> f (SOME x. x \<in> X \<and> (\<nexists>y. y \<in> X \<and> f x < f y))
[PROOF STEP]
by auto


[STATEMENT]
theorem meet_related [elim?]: "x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqinter> y = x
[PROOF STEP]
proof (rule meetI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> x
 2. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> y
 3. \<And>z. \<lbrakk>x \<sqsubseteq> y; z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
assume "x \<sqsubseteq> y"
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> y

goal (3 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> x
 2. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> y
 3. \<And>z. \<lbrakk>x \<sqsubseteq> y; z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
show "x \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> x

goal (2 subgoals):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<sqsubseteq> y
 2. \<And>z. \<lbrakk>x \<sqsubseteq> y; z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
show "x \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> y
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> y

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> y; z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> y; z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
assume "z \<sqsubseteq> x" and "z \<sqsubseteq> y"
[PROOF STATE]
proof (state)
this:
z \<sqsubseteq> x
z \<sqsubseteq> y

goal (1 subgoal):
 1. \<And>z. \<lbrakk>x \<sqsubseteq> y; z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
show "z \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<sqsubseteq> x
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
z \<sqsubseteq> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connectedin:
     "connectedin X S \<longleftrightarrow>
        S \<subseteq> topspace X \<and>
         (\<nexists>E1 E2.
             openin X E1 \<and> openin X E2 \<and>
             S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 \<inter> S = {} \<and> E1 \<inter> S \<noteq> {} \<and> E2 \<inter> S \<noteq> {})"  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 \<inter> S = {} \<and> E1 \<inter> S \<noteq> {} \<and> E2 \<inter> S \<noteq> {}))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 \<inter> S = {} \<and> E1 \<inter> S \<noteq> {} \<and> E2 \<inter> S \<noteq> {}))
[PROOF STEP]
have *: "(\<exists>E1:: 'a set. \<exists>E2:: 'a set. (\<exists>T1:: 'a set. P1 T1 \<and> E1 = f1 T1) \<and> (\<exists>T2:: 'a set. P2 T2 \<and> E2 = f2 T2) \<and>
             R E1 E2) \<longleftrightarrow> (\<exists>T1 T2. P1 T1 \<and> P2 T2 \<and> R(f1 T1) (f2 T2))" for P1 f1 P2 f2 R
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>E1 E2. (\<exists>T1. P1 T1 \<and> E1 = f1 T1) \<and> (\<exists>T2. P2 T2 \<and> E2 = f2 T2) \<and> R E1 E2) = (\<exists>T1 T2. P1 T1 \<and> P2 T2 \<and> R (f1 T1) (f2 T2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>E1 E2. (\<exists>T1. ?P1.0 T1 \<and> E1 = ?f1.0 T1) \<and> (\<exists>T2. ?P2.0 T2 \<and> E2 = ?f2.0 T2) \<and> ?R E1 E2) = (\<exists>T1 T2. ?P1.0 T1 \<and> ?P2.0 T2 \<and> ?R (?f1.0 T1) (?f2.0 T2))

goal (1 subgoal):
 1. connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 \<inter> S = {} \<and> E1 \<inter> S \<noteq> {} \<and> E2 \<inter> S \<noteq> {}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 \<inter> S = {} \<and> E1 \<inter> S \<noteq> {} \<and> E2 \<inter> S \<noteq> {}))
[PROOF STEP]
unfolding connectedin_def connected_space_def openin_subtopology topspace_subtopology *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S \<subseteq> topspace X \<and> (\<nexists>T Ta. openin X T \<and> openin X Ta \<and> topspace X \<inter> S \<subseteq> T \<inter> S \<union> Ta \<inter> S \<and> T \<inter> S \<inter> (Ta \<inter> S) = {} \<and> T \<inter> S \<noteq> {} \<and> Ta \<inter> S \<noteq> {})) = (S \<subseteq> topspace X \<and> (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 \<inter> S = {} \<and> E1 \<inter> S \<noteq> {} \<and> E2 \<inter> S \<noteq> {}))
[PROOF STEP]
by (intro conj_cong arg_cong [where f=Not] ex_cong1; blast dest!: openin_subset)
[PROOF STATE]
proof (state)
this:
connectedin X S = (S \<subseteq> topspace X \<and> (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> S \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 \<inter> S = {} \<and> E1 \<inter> S \<noteq> {} \<and> E2 \<inter> S \<noteq> {}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Qp_char_0'':
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "a \<noteq> \<zero>"
  assumes "(k::nat) > 0"
  shows "[k]\<cdot>a \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [k] \<cdot> a \<noteq> \<zero>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [k] \<cdot> a \<noteq> \<zero>
[PROOF STEP]
have 0: "[k]\<cdot>\<one> \<noteq>\<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [k] \<cdot> \<one> \<noteq> \<zero>
[PROOF STEP]
using Qp_char_0 assms(3)
[PROOF STATE]
proof (prove)
using this:
?n \<noteq> 0 \<Longrightarrow> [?n] \<cdot> \<one> \<noteq> \<zero>
0 < k

goal (1 subgoal):
 1. [k] \<cdot> \<one> \<noteq> \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[k] \<cdot> \<one> \<noteq> \<zero>

goal (1 subgoal):
 1. [k] \<cdot> a \<noteq> \<zero>
[PROOF STEP]
have "[k]\<cdot>a = [k]\<cdot>\<one> \<otimes> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [k] \<cdot> a = [k] \<cdot> \<one> \<otimes> a
[PROOF STEP]
using Qp.add_pow_ldistr Qp.l_one Qp.one_closed assms(1)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?b \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> [?k] \<cdot> ?a \<otimes> ?b = [?k] \<cdot> (?a \<otimes> ?b)
?x \<in> carrier Q\<^sub>p \<Longrightarrow> \<one> \<otimes> ?x = ?x
\<one> \<in> carrier Q\<^sub>p
a \<in> carrier Q\<^sub>p

goal (1 subgoal):
 1. [k] \<cdot> a = [k] \<cdot> \<one> \<otimes> a
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
[k] \<cdot> a = [k] \<cdot> \<one> \<otimes> a

goal (1 subgoal):
 1. [k] \<cdot> a \<noteq> \<zero>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
[k] \<cdot> a = [k] \<cdot> \<one> \<otimes> a

goal (1 subgoal):
 1. [k] \<cdot> a \<noteq> \<zero>
[PROOF STEP]
using 0 assms
[PROOF STATE]
proof (prove)
using this:
[k] \<cdot> a = [k] \<cdot> \<one> \<otimes> a
[k] \<cdot> \<one> \<noteq> \<zero>
a \<in> carrier Q\<^sub>p
a \<noteq> \<zero>
0 < k

goal (1 subgoal):
 1. [k] \<cdot> a \<noteq> \<zero>
[PROOF STEP]
using Qp.integral
[PROOF STATE]
proof (prove)
using this:
[k] \<cdot> a = [k] \<cdot> \<one> \<otimes> a
[k] \<cdot> \<one> \<noteq> \<zero>
a \<in> carrier Q\<^sub>p
a \<noteq> \<zero>
0 < k
\<lbrakk>?a \<otimes> ?b = \<zero>; ?a \<in> carrier Q\<^sub>p; ?b \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?a = \<zero> \<or> ?b = \<zero>

goal (1 subgoal):
 1. [k] \<cdot> a \<noteq> \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[k] \<cdot> a \<noteq> \<zero>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma insort_key_append1:
  "\<forall>y \<in> set ys. f x < f y \<Longrightarrow> insort_key f x (xs @ ys) = insort_key f x xs @ ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>set ys. f x < f y \<Longrightarrow> insort_key f x (xs @ ys) = insort_key f x xs @ ys
[PROOF STEP]
proof(induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>y\<in>set ys. f x < f y \<Longrightarrow> insort_key f x ([] @ ys) = insort_key f x [] @ ys
 2. \<And>a xs. \<lbrakk>\<forall>y\<in>set ys. f x < f y \<Longrightarrow> insort_key f x (xs @ ys) = insort_key f x xs @ ys; \<forall>y\<in>set ys. f x < f y\<rbrakk> \<Longrightarrow> insort_key f x ((a # xs) @ ys) = insort_key f x (a # xs) @ ys
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>set ys. f x < f y

goal (2 subgoals):
 1. \<forall>y\<in>set ys. f x < f y \<Longrightarrow> insort_key f x ([] @ ys) = insort_key f x [] @ ys
 2. \<And>a xs. \<lbrakk>\<forall>y\<in>set ys. f x < f y \<Longrightarrow> insort_key f x (xs @ ys) = insort_key f x xs @ ys; \<forall>y\<in>set ys. f x < f y\<rbrakk> \<Longrightarrow> insort_key f x ((a # xs) @ ys) = insort_key f x (a # xs) @ ys
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>set ys. f x < f y

goal (1 subgoal):
 1. insort_key f x ([] @ ys) = insort_key f x [] @ ys
[PROOF STEP]
by(cases ys) auto
[PROOF STATE]
proof (state)
this:
insort_key f x ([] @ ys) = insort_key f x [] @ ys

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<forall>y\<in>set ys. f x < f y \<Longrightarrow> insort_key f x (xs @ ys) = insort_key f x xs @ ys; \<forall>y\<in>set ys. f x < f y\<rbrakk> \<Longrightarrow> insort_key f x ((a # xs) @ ys) = insort_key f x (a # xs) @ ys
[PROOF STEP]
qed simp