-
Notifications
You must be signed in to change notification settings - Fork 1
/
Complex_Vector_Spaces.thy
2820 lines (2530 loc) · 120 KB
/
Complex_Vector_Spaces.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
section \<open>\<open>Complex_Vector_Spaces\<close> -- Complex Vector Spaces\<close>
(*
Authors:
Dominique Unruh, University of Tartu, unruh@ut.ee
Jose Manuel Rodriguez Caballero, University of Tartu, jose.manuel.rodriguez.caballero@ut.ee
*)
theory Complex_Vector_Spaces
imports
"HOL-Analysis.Elementary_Topology"
"HOL-Analysis.Operator_Norm"
"HOL-Analysis.Elementary_Normed_Spaces"
"HOL-Library.Set_Algebras"
"HOL-Analysis.Starlike"
"HOL-Types_To_Sets.Types_To_Sets"
"Complex_Bounded_Operators-Extra.Extra_Vector_Spaces"
"Complex_Bounded_Operators-Extra.Extra_Ordered_Fields"
"Complex_Bounded_Operators-Extra.Extra_Lattice"
"Complex_Bounded_Operators-Extra.Extra_General"
Complex_Vector_Spaces0
begin
bundle notation_norm begin
notation norm ("\<parallel>_\<parallel>")
end
subsection \<open>Misc\<close>
lemma (in scaleC) scaleC_real: assumes "r\<in>\<real>" shows "r *\<^sub>C x = Re r *\<^sub>R x"
unfolding scaleR_scaleC using assms by simp
lemma of_complex_of_real_eq [simp]: "of_complex (of_real n) = of_real n"
unfolding of_complex_def of_real_def unfolding scaleR_scaleC by simp
lemma Complexs_of_real [simp]: "of_real r \<in> \<complex>"
unfolding Complexs_def of_real_def of_complex_def
apply (subst scaleR_scaleC) by simp
lemma Reals_in_Complexs: "\<real> \<subseteq> \<complex>"
unfolding Reals_def by auto
lemma (in clinear) "linear f"
apply standard
by (simp_all add: add scaleC scaleR_scaleC)
lemma (in bounded_clinear) bounded_linear: "bounded_linear f"
by (simp add: add bounded bounded_linear.intro bounded_linear_axioms.intro linearI scaleC scaleR_scaleC)
lemma clinear_times: "clinear (\<lambda>x. c * x)"
for c :: "'a::complex_algebra"
by (auto simp: clinearI distrib_left)
lemma (in clinear) linear:
shows \<open>linear f\<close>
by (simp add: add linearI scaleC scaleR_scaleC)
lemma bounded_clinearI:
assumes \<open>\<And>b1 b2. f (b1 + b2) = f b1 + f b2\<close>
assumes \<open>\<And>r b. f (r *\<^sub>C b) = r *\<^sub>C f b\<close>
assumes \<open>\<forall>x. norm (f x) \<le> norm x * K\<close>
shows "bounded_clinear f"
using assms by (auto intro!: exI bounded_clinear.intro clinearI simp: bounded_clinear_axioms_def)
lemma bounded_clinear_id[simp]: \<open>bounded_clinear id\<close>
by (simp add: id_def)
(* The following would be a natural inclusion of locales, but unfortunately it leads to
name conflicts upon interpretation of bounded_cbilinear *)
(* sublocale bounded_cbilinear \<subseteq> bounded_bilinear
by (rule bounded_bilinear) *)
definition cbilinear :: \<open>('a::complex_vector \<Rightarrow> 'b::complex_vector \<Rightarrow> 'c::complex_vector) \<Rightarrow> bool\<close>
where \<open>cbilinear = (\<lambda> f. (\<forall> y. clinear (\<lambda> x. f x y)) \<and> (\<forall> x. clinear (\<lambda> y. f x y)) )\<close>
lemma cbilinear_add_left:
assumes \<open>cbilinear f\<close>
shows \<open>f (a + b) c = f a c + f b c\<close>
by (smt (verit, del_insts) assms cbilinear_def complex_vector.linear_add)
lemma cbilinear_add_right:
assumes \<open>cbilinear f\<close>
shows \<open>f a (b + c) = f a b + f a c\<close>
by (smt (verit, del_insts) assms cbilinear_def complex_vector.linear_add)
lemma cbilinear_times:
fixes g' :: \<open>'a::complex_vector \<Rightarrow> complex\<close> and g :: \<open>'b::complex_vector \<Rightarrow> complex\<close>
assumes \<open>\<And> x y. h x y = (g' x)*(g y)\<close> and \<open>clinear g\<close> and \<open>clinear g'\<close>
shows \<open>cbilinear h\<close>
proof -
have w1: "h (b1 + b2) y = h b1 y + h b2 y"
for b1 :: 'a
and b2 :: 'a
and y
proof-
have \<open>h (b1 + b2) y = g' (b1 + b2) * g y\<close>
using \<open>\<And> x y. h x y = (g' x)*(g y)\<close>
by auto
also have \<open>\<dots> = (g' b1 + g' b2) * g y\<close>
using \<open>clinear g'\<close>
unfolding clinear_def
by (simp add: assms(3) complex_vector.linear_add)
also have \<open>\<dots> = g' b1 * g y + g' b2 * g y\<close>
by (simp add: ring_class.ring_distribs(2))
also have \<open>\<dots> = h b1 y + h b2 y\<close>
using assms(1) by auto
finally show ?thesis by blast
qed
have w2: "h (r *\<^sub>C b) y = r *\<^sub>C h b y"
for r :: complex
and b :: 'a
and y
proof-
have \<open>h (r *\<^sub>C b) y = g' (r *\<^sub>C b) * g y\<close>
by (simp add: assms(1))
also have \<open>\<dots> = r *\<^sub>C (g' b * g y)\<close>
by (simp add: assms(3) complex_vector.linear_scale)
also have \<open>\<dots> = r *\<^sub>C (h b y)\<close>
by (simp add: assms(1))
finally show ?thesis by blast
qed
have "clinear (\<lambda>x. h x y)"
for y :: 'b
unfolding clinear_def
by (meson clinearI clinear_def w1 w2)
hence t2: "\<forall>y. clinear (\<lambda>x. h x y)"
by simp
have v1: "h x (b1 + b2) = h x b1 + h x b2"
for b1 :: 'b
and b2 :: 'b
and x
proof-
have \<open>h x (b1 + b2) = g' x * g (b1 + b2)\<close>
using \<open>\<And> x y. h x y = (g' x)*(g y)\<close>
by auto
also have \<open>\<dots> = g' x * (g b1 + g b2)\<close>
using \<open>clinear g'\<close>
unfolding clinear_def
by (simp add: assms(2) complex_vector.linear_add)
also have \<open>\<dots> = g' x * g b1 + g' x * g b2\<close>
by (simp add: ring_class.ring_distribs(1))
also have \<open>\<dots> = h x b1 + h x b2\<close>
using assms(1) by auto
finally show ?thesis by blast
qed
have v2: "h x (r *\<^sub>C b) = r *\<^sub>C h x b"
for r :: complex
and b :: 'b
and x
proof-
have \<open>h x (r *\<^sub>C b) = g' x * g (r *\<^sub>C b)\<close>
by (simp add: assms(1))
also have \<open>\<dots> = r *\<^sub>C (g' x * g b)\<close>
by (simp add: assms(2) complex_vector.linear_scale)
also have \<open>\<dots> = r *\<^sub>C (h x b)\<close>
by (simp add: assms(1))
finally show ?thesis by blast
qed
have "Vector_Spaces.linear (*\<^sub>C) (*\<^sub>C) (h x)"
for x :: 'a
using v1 v2
by (meson clinearI clinear_def)
hence t1: "\<forall>x. clinear (h x)"
unfolding clinear_def
by simp
show ?thesis
unfolding cbilinear_def
by (simp add: t1 t2)
qed
lemma csubspace_is_subspace: "csubspace A \<Longrightarrow> subspace A"
apply (rule subspaceI)
by (auto simp: complex_vector.subspace_def scaleR_scaleC)
lemma span_subset_cspan: "span A \<subseteq> cspan A"
unfolding span_def complex_vector.span_def
by (simp add: csubspace_is_subspace hull_antimono)
lemma cindependent_implies_independent:
assumes "cindependent (S::'a::complex_vector set)"
shows "independent S"
using assms unfolding dependent_def complex_vector.dependent_def
using span_subset_cspan by blast
lemma cspan_singleton: "cspan {x} = {\<alpha> *\<^sub>C x| \<alpha>. True}"
proof -
have \<open>cspan {x} = {y. y\<in>cspan {x}}\<close>
by auto
also have \<open>\<dots> = {\<alpha> *\<^sub>C x| \<alpha>. True}\<close>
apply (subst complex_vector.span_breakdown_eq)
by auto
finally show ?thesis
by -
qed
lemma cspan_as_span:
"cspan (B::'a::complex_vector set) = span (B \<union> scaleC \<i> ` B)"
proof auto
let ?cspan = complex_vector.span
let ?rspan = real_vector.span
fix \<psi>
assume cspan: "\<psi> \<in> ?cspan B"
have "\<exists>B' r. finite B' \<and> B' \<subseteq> B \<and> \<psi> = (\<Sum>b\<in>B'. r b *\<^sub>C b)"
using complex_vector.span_explicit[of B] cspan
by auto
then obtain B' r where "finite B'" and "B' \<subseteq> B" and \<psi>_explicit: "\<psi> = (\<Sum>b\<in>B'. r b *\<^sub>C b)"
by atomize_elim
define R where "R = B \<union> scaleC \<i> ` B"
have x2: "(case x of (b, i) \<Rightarrow> if i
then Im (r b) *\<^sub>R \<i> *\<^sub>C b
else Re (r b) *\<^sub>R b) \<in> span (B \<union> (*\<^sub>C) \<i> ` B)"
if "x \<in> B' \<times> (UNIV::bool set)"
for x :: "'a \<times> bool"
using that \<open>B' \<subseteq> B\<close> by (auto simp add: real_vector.span_base real_vector.span_scale subset_iff)
have x1: "\<psi> = (\<Sum>x\<in>B'. \<Sum>i\<in>UNIV. if i then Im (r x) *\<^sub>R \<i> *\<^sub>C x else Re (r x) *\<^sub>R x)"
if "\<And>b. r b *\<^sub>C b = Re (r b) *\<^sub>R b + Im (r b) *\<^sub>R \<i> *\<^sub>C b"
using that by (simp add: UNIV_bool \<psi>_explicit)
moreover have "r b *\<^sub>C b = Re (r b) *\<^sub>R b + Im (r b) *\<^sub>R \<i> *\<^sub>C b" for b
using complex_eq scaleC_add_left scaleC_scaleC scaleR_scaleC
by (metis (no_types, lifting) complex_of_real_i i_complex_of_real)
ultimately have "\<psi> = (\<Sum>(b,i)\<in>(B'\<times>UNIV). if i then Im (r b) *\<^sub>R (\<i> *\<^sub>C b) else Re (r b) *\<^sub>R b)"
by (simp add: sum.cartesian_product)
also have "\<dots> \<in> ?rspan R"
unfolding R_def
using x2
by (rule real_vector.span_sum)
finally show "\<psi> \<in> ?rspan R" by -
next
let ?cspan = complex_vector.span
let ?rspan = real_vector.span
define R where "R = B \<union> scaleC \<i> ` B"
fix \<psi>
assume rspan: "\<psi> \<in> ?rspan R"
have "subspace {a. a \<in> cspan B}"
by (rule real_vector.subspaceI, auto simp add: complex_vector.span_zero
complex_vector.span_add_eq2 complex_vector.span_scale scaleR_scaleC)
moreover have "x \<in> cspan B"
if "x \<in> R"
for x :: 'a
using that R_def complex_vector.span_base complex_vector.span_scale by fastforce
ultimately show "\<psi> \<in> ?cspan B"
using real_vector.span_induct rspan by blast
qed
lemma isomorphic_equal_cdim:
assumes lin_f: \<open>clinear f\<close>
assumes inj_f: \<open>inj_on f (cspan S)\<close>
assumes im_S: \<open>f ` S = T\<close>
shows \<open>cdim S = cdim T\<close>
proof -
obtain SB where SB_span: "cspan SB = cspan S" and indep_SB: \<open>cindependent SB\<close>
by (metis complex_vector.basis_exists complex_vector.span_mono complex_vector.span_span subset_antisym)
with lin_f inj_f have indep_fSB: \<open>cindependent (f ` SB)\<close>
apply (rule_tac complex_vector.linear_independent_injective_image)
by auto
from lin_f have \<open>cspan (f ` SB) = f ` cspan SB\<close>
by (meson complex_vector.linear_span_image)
also from SB_span lin_f have \<open>\<dots> = cspan T\<close>
by (metis complex_vector.linear_span_image im_S)
finally have \<open>cdim T = card (f ` SB)\<close>
using indep_fSB complex_vector.dim_eq_card by blast
also have \<open>\<dots> = card SB\<close>
apply (rule card_image) using inj_f
by (metis SB_span complex_vector.linear_inj_on_span_iff_independent_image indep_fSB lin_f)
also have \<open>\<dots> = cdim S\<close>
using indep_SB SB_span
by (metis complex_vector.dim_eq_card)
finally show ?thesis by simp
qed
lemma cindependent_inter_scaleC_cindependent:
assumes a1: "cindependent (B::'a::complex_vector set)" and a3: "c \<noteq> 1"
shows "B \<inter> (*\<^sub>C) c ` B = {}"
proof (rule classical, cases \<open>c = 0\<close>)
case True
then show ?thesis
using a1 by (auto simp add: complex_vector.dependent_zero)
next
case False
assume "\<not>(B \<inter> (*\<^sub>C) c ` B = {})"
hence "B \<inter> (*\<^sub>C) c ` B \<noteq> {}"
by blast
then obtain x where u1: "x \<in> B \<inter> (*\<^sub>C) c ` B"
by blast
then obtain b where u2: "x = b" and u3: "b\<in>B"
by blast
then obtain b' where u2': "x = c *\<^sub>C b'" and u3': "b'\<in>B"
using u1
by blast
have g1: "b = c *\<^sub>C b'"
using u2 and u2' by simp
hence "b \<in> complex_vector.span {b'}"
using False
by (simp add: complex_vector.span_base complex_vector.span_scale)
hence "b = b'"
by (metis u3' a1 complex_vector.dependent_def complex_vector.span_base
complex_vector.span_scale insertE insert_Diff u2 u2' u3)
hence "b' = c *\<^sub>C b'"
using g1 by blast
thus ?thesis
by (metis a1 a3 complex_vector.dependent_zero complex_vector.scale_right_imp_eq
mult_cancel_right2 scaleC_scaleC u3')
qed
lemma real_independent_from_complex_independent:
assumes "cindependent (B::'a::complex_vector set)"
defines "B' == ((*\<^sub>C) \<i> ` B)"
shows "independent (B \<union> B')"
proof (rule notI)
assume \<open>dependent (B \<union> B')\<close>
then obtain T f0 x where [simp]: \<open>finite T\<close> and \<open>T \<subseteq> B \<union> B'\<close> and f0_sum: \<open>(\<Sum>v\<in>T. f0 v *\<^sub>R v) = 0\<close>
and x: \<open>x \<in> T\<close> and f0_x: \<open>f0 x \<noteq> 0\<close>
by (auto simp: real_vector.dependent_explicit)
define f T1 T2 T' f' x' where \<open>f v = (if v \<in> T then f0 v else 0)\<close>
and \<open>T1 = T \<inter> B\<close> and \<open>T2 = scaleC (-\<i>) ` (T \<inter> B')\<close>
and \<open>T' = T1 \<union> T2\<close> and \<open>f' v = f v + \<i> * f (\<i> *\<^sub>C v)\<close>
and \<open>x' = (if x \<in> T1 then x else -\<i> *\<^sub>C x)\<close> for v
have \<open>B \<inter> B' = {}\<close>
by (simp add: assms cindependent_inter_scaleC_cindependent)
have \<open>T' \<subseteq> B\<close>
by (auto simp: T'_def T1_def T2_def B'_def)
have [simp]: \<open>finite T'\<close> \<open>finite T1\<close> \<open>finite T2\<close>
by (auto simp add: T'_def T1_def T2_def)
have f_sum: \<open>(\<Sum>v\<in>T. f v *\<^sub>R v) = 0\<close>
unfolding f_def using f0_sum by auto
have f_x: \<open>f x \<noteq> 0\<close>
using f0_x x by (auto simp: f_def)
have f'_sum: \<open>(\<Sum>v\<in>T'. f' v *\<^sub>C v) = 0\<close>
proof -
have \<open>(\<Sum>v\<in>T'. f' v *\<^sub>C v) = (\<Sum>v\<in>T'. complex_of_real (f v) *\<^sub>C v) + (\<Sum>v\<in>T'. (\<i> * complex_of_real (f (\<i> *\<^sub>C v))) *\<^sub>C v)\<close>
by (auto simp: f'_def sum.distrib scaleC_add_left)
also have \<open>(\<Sum>v\<in>T'. complex_of_real (f v) *\<^sub>C v) = (\<Sum>v\<in>T1. f v *\<^sub>R v)\<close> (is \<open>_ = ?left\<close>)
apply (auto simp: T'_def scaleR_scaleC intro!: sum.mono_neutral_cong_right)
using T'_def T1_def \<open>T' \<subseteq> B\<close> f_def by auto
also have \<open>(\<Sum>v\<in>T'. (\<i> * complex_of_real (f (\<i> *\<^sub>C v))) *\<^sub>C v) = (\<Sum>v\<in>T2. (\<i> * complex_of_real (f (\<i> *\<^sub>C v))) *\<^sub>C v)\<close> (is \<open>_ = ?right\<close>)
apply (auto simp: T'_def intro!: sum.mono_neutral_cong_right)
by (smt (z3) B'_def IntE IntI T1_def T2_def \<open>f \<equiv> \<lambda>v. if v \<in> T then f0 v else 0\<close> add.inverse_inverse complex_vector.vector_space_axioms i_squared imageI mult_minus_left vector_space.vector_space_assms(3) vector_space.vector_space_assms(4))
also have \<open>?right = (\<Sum>v\<in>T\<inter>B'. f v *\<^sub>R v)\<close> (is \<open>_ = ?right\<close>)
apply (rule sum.reindex_cong[symmetric, where l=\<open>scaleC \<i>\<close>])
apply (auto simp: T2_def image_image scaleR_scaleC)
using inj_on_def by fastforce
also have \<open>?left + ?right = (\<Sum>v\<in>T. f v *\<^sub>R v)\<close>
apply (subst sum.union_disjoint[symmetric])
using \<open>B \<inter> B' = {}\<close> \<open>T \<subseteq> B \<union> B'\<close> apply (auto simp: T1_def)
by (metis Int_Un_distrib Un_Int_eq(4) sup.absorb_iff1)
also have \<open>\<dots> = 0\<close>
by (rule f_sum)
finally show ?thesis
by -
qed
have x': \<open>x' \<in> T'\<close>
using \<open>T \<subseteq> B \<union> B'\<close> x by (auto simp: x'_def T'_def T1_def T2_def)
have f'_x': \<open>f' x' \<noteq> 0\<close>
using Complex_eq Complex_eq_0 f'_def f_x x'_def by auto
from \<open>finite T'\<close> \<open>T' \<subseteq> B\<close> f'_sum x' f'_x'
have \<open>cdependent B\<close>
using complex_vector.independent_explicit_module by blast
with assms show False
by auto
qed
lemma crepresentation_from_representation:
assumes a1: "cindependent B" and a2: "b \<in> B" and a3: "finite B"
shows "crepresentation B \<psi> b = (representation (B \<union> (*\<^sub>C) \<i> ` B) \<psi> b)
+ \<i> *\<^sub>C (representation (B \<union> (*\<^sub>C) \<i> ` B) \<psi> (\<i> *\<^sub>C b))"
proof (cases "\<psi> \<in> cspan B")
define B' where "B' = B \<union> (*\<^sub>C) \<i> ` B"
case True
define r where "r v = real_vector.representation B' \<psi> v" for v
define r' where "r' v = real_vector.representation B' \<psi> (\<i> *\<^sub>C v)" for v
define f where "f v = r v + \<i> *\<^sub>C r' v" for v
define g where "g v = crepresentation B \<psi> v" for v
have "(\<Sum>v | g v \<noteq> 0. g v *\<^sub>C v) = \<psi>"
unfolding g_def
using Collect_cong Collect_mono_iff DiffD1 DiffD2 True a1
complex_vector.finite_representation
complex_vector.sum_nonzero_representation_eq sum.mono_neutral_cong_left
by fastforce
moreover have "finite {v. g v \<noteq> 0}"
unfolding g_def
by (simp add: complex_vector.finite_representation)
moreover have "v \<in> B"
if "g v \<noteq> 0" for v
using that unfolding g_def
by (simp add: complex_vector.representation_ne_zero)
ultimately have rep1: "(\<Sum>v\<in>B. g v *\<^sub>C v) = \<psi>"
unfolding g_def
using a3 True a1 complex_vector.sum_representation_eq by blast
have l0': "inj ((*\<^sub>C) \<i>::'a \<Rightarrow>'a)"
unfolding inj_def
by simp
have l0: "inj ((*\<^sub>C) (- \<i>)::'a \<Rightarrow>'a)"
unfolding inj_def
by simp
have l1: "(*\<^sub>C) (- \<i>) ` B \<inter> B = {}"
using cindependent_inter_scaleC_cindependent[where B=B and c = "- \<i>"]
by (metis Int_commute a1 add.inverse_inverse complex_i_not_one i_squared mult_cancel_left1
neg_equal_0_iff_equal)
have l2: "B \<inter> (*\<^sub>C) \<i> ` B = {}"
by (simp add: a1 cindependent_inter_scaleC_cindependent)
have rr1: "r (\<i> *\<^sub>C v) = r' v" for v
unfolding r_def r'_def
by simp
have k1: "independent B'"
unfolding B'_def using a1 real_independent_from_complex_independent by simp
have "\<psi> \<in> span B'"
using B'_def True cspan_as_span by blast
have "v \<in> B'"
if "r v \<noteq> 0"
for v
unfolding r_def
using r_def real_vector.representation_ne_zero that by auto
have "finite B'"
unfolding B'_def using a3
by simp
have "(\<Sum>v\<in>B'. r v *\<^sub>R v) = \<psi>"
unfolding r_def
using True Real_Vector_Spaces.real_vector.sum_representation_eq[where B = B' and basis = B'
and v = \<psi>]
by (smt Real_Vector_Spaces.dependent_raw_def \<open>\<psi> \<in> Real_Vector_Spaces.span B'\<close> \<open>finite B'\<close>
equalityD2 k1)
have d1: "(\<Sum>v\<in>B. r (\<i> *\<^sub>C v) *\<^sub>R (\<i> *\<^sub>C v)) = (\<Sum>v\<in>(*\<^sub>C) \<i> ` B. r v *\<^sub>R v)"
using l0'
by (metis (mono_tags, lifting) inj_eq inj_on_def sum.reindex_cong)
have "(\<Sum>v\<in>B. (r v + \<i> * (r' v)) *\<^sub>C v) = (\<Sum>v\<in>B. r v *\<^sub>C v + (\<i> * r' v) *\<^sub>C v)"
by (meson scaleC_left.add)
also have "\<dots> = (\<Sum>v\<in>B. r v *\<^sub>C v) + (\<Sum>v\<in>B. (\<i> * r' v) *\<^sub>C v)"
using sum.distrib by fastforce
also have "\<dots> = (\<Sum>v\<in>B. r v *\<^sub>C v) + (\<Sum>v\<in>B. \<i> *\<^sub>C (r' v *\<^sub>C v))"
by auto
also have "\<dots> = (\<Sum>v\<in>B. r v *\<^sub>R v) + (\<Sum>v\<in>B. \<i> *\<^sub>C (r (\<i> *\<^sub>C v) *\<^sub>R v))"
unfolding r'_def r_def
by (metis (mono_tags, lifting) scaleR_scaleC sum.cong)
also have "\<dots> = (\<Sum>v\<in>B. r v *\<^sub>R v) + (\<Sum>v\<in>B. r (\<i> *\<^sub>C v) *\<^sub>R (\<i> *\<^sub>C v))"
by (metis (no_types, lifting) complex_vector.scale_left_commute scaleR_scaleC)
also have "\<dots> = (\<Sum>v\<in>B. r v *\<^sub>R v) + (\<Sum>v\<in>(*\<^sub>C) \<i> ` B. r v *\<^sub>R v)"
using d1
by simp
also have "\<dots> = \<psi>"
using l2 \<open>(\<Sum>v\<in>B'. r v *\<^sub>R v) = \<psi>\<close>
unfolding B'_def
by (simp add: a3 sum.union_disjoint)
finally have "(\<Sum>v\<in>B. f v *\<^sub>C v) = \<psi>" unfolding r'_def r_def f_def by simp
hence "0 = (\<Sum>v\<in>B. f v *\<^sub>C v) - (\<Sum>v\<in>B. crepresentation B \<psi> v *\<^sub>C v)"
using rep1
unfolding g_def
by simp
also have "\<dots> = (\<Sum>v\<in>B. f v *\<^sub>C v - crepresentation B \<psi> v *\<^sub>C v)"
by (simp add: sum_subtractf)
also have "\<dots> = (\<Sum>v\<in>B. (f v - crepresentation B \<psi> v) *\<^sub>C v)"
by (metis scaleC_left.diff)
finally have "0 = (\<Sum>v\<in>B. (f v - crepresentation B \<psi> v) *\<^sub>C v)".
hence "(\<Sum>v\<in>B. (f v - crepresentation B \<psi> v) *\<^sub>C v) = 0"
by simp
hence "f b - crepresentation B \<psi> b = 0"
using a1 a2 a3 complex_vector.independentD[where s = B and t = B
and u = "\<lambda>v. f v - crepresentation B \<psi> v" and v = b]
order_refl by smt
hence "crepresentation B \<psi> b = f b"
by simp
thus ?thesis unfolding f_def r_def r'_def B'_def by auto
next
define B' where "B' = B \<union> (*\<^sub>C) \<i> ` B"
case False
have b2: "\<psi> \<notin> real_vector.span B'"
unfolding B'_def
using False cspan_as_span by auto
have "\<psi> \<notin> complex_vector.span B"
using False by blast
have "crepresentation B \<psi> b = 0"
unfolding complex_vector.representation_def
by (simp add: False)
moreover have "real_vector.representation B' \<psi> b = 0"
unfolding real_vector.representation_def
by (simp add: b2)
moreover have "real_vector.representation B' \<psi> ((*\<^sub>C) \<i> b) = 0"
unfolding real_vector.representation_def
by (simp add: b2)
ultimately show ?thesis unfolding B'_def by simp
qed
lemma CARD_1_vec_0[simp]: \<open>(\<psi> :: _ ::{complex_vector,CARD_1}) = 0\<close>
by auto
lemma scaleC_cindependent:
assumes a1: "cindependent (B::'a::complex_vector set)" and a3: "c \<noteq> 0"
shows "cindependent ((*\<^sub>C) c ` B)"
proof-
have "u y = 0"
if g1: "y\<in>S" and g2: "(\<Sum>x\<in>S. u x *\<^sub>C x) = 0" and g3: "finite S" and g4: "S\<subseteq>(*\<^sub>C) c ` B"
for u y S
proof-
define v where "v x = u (c *\<^sub>C x)" for x
obtain S' where "S'\<subseteq>B" and S_S': "S = (*\<^sub>C) c ` S'"
by (meson g4 subset_imageE)
have "inj ((*\<^sub>C) c::'a\<Rightarrow>_)"
unfolding inj_def
using a3 by auto
hence "finite S'"
using S_S' finite_imageD g3 subset_inj_on by blast
have "t \<in> (*\<^sub>C) (inverse c) ` S"
if "t \<in> S'" for t
proof-
have "c *\<^sub>C t \<in> S"
using \<open>S = (*\<^sub>C) c ` S'\<close> that by blast
hence "(inverse c) *\<^sub>C (c *\<^sub>C t) \<in> (*\<^sub>C) (inverse c) ` S"
by blast
moreover have "(inverse c) *\<^sub>C (c *\<^sub>C t) = t"
by (simp add: a3)
ultimately show ?thesis by simp
qed
moreover have "t \<in> S'"
if "t \<in> (*\<^sub>C) (inverse c) ` S" for t
proof-
obtain t' where "t = (inverse c) *\<^sub>C t'" and "t' \<in> S"
using \<open>t \<in> (*\<^sub>C) (inverse c) ` S\<close> by auto
have "c *\<^sub>C t = c *\<^sub>C ((inverse c) *\<^sub>C t')"
using \<open>t = (inverse c) *\<^sub>C t'\<close> by simp
also have "\<dots> = (c * (inverse c)) *\<^sub>C t'"
by simp
also have "\<dots> = t'"
by (simp add: a3)
finally have "c *\<^sub>C t = t'".
thus ?thesis using \<open>t' \<in> S\<close>
using \<open>S = (*\<^sub>C) c ` S'\<close> a3 complex_vector.scale_left_imp_eq by blast
qed
ultimately have "S' = (*\<^sub>C) (inverse c) ` S"
by blast
hence "inverse c *\<^sub>C y \<in> S'"
using that(1) by blast
have t: "inj (((*\<^sub>C) c)::'a \<Rightarrow> _)"
using a3 complex_vector.injective_scale[where c = c]
by blast
have "0 = (\<Sum>x\<in>(*\<^sub>C) c ` S'. u x *\<^sub>C x)"
using \<open>S = (*\<^sub>C) c ` S'\<close> that(2) by auto
also have "\<dots> = (\<Sum>x\<in>S'. v x *\<^sub>C (c *\<^sub>C x))"
unfolding v_def
using t Groups_Big.comm_monoid_add_class.sum.reindex[where h = "((*\<^sub>C) c)" and A = S'
and g = "\<lambda>x. u x *\<^sub>C x"] subset_inj_on by auto
also have "\<dots> = c *\<^sub>C (\<Sum>x\<in>S'. v x *\<^sub>C x)"
by (metis (mono_tags, lifting) complex_vector.scale_left_commute scaleC_right.sum sum.cong)
finally have "0 = c *\<^sub>C (\<Sum>x\<in>S'. v x *\<^sub>C x)".
hence "(\<Sum>x\<in>S'. v x *\<^sub>C x) = 0"
using a3 by auto
hence "v (inverse c *\<^sub>C y) = 0"
using \<open>inverse c *\<^sub>C y \<in> S'\<close> \<open>finite S'\<close> \<open>S' \<subseteq> B\<close> a1
complex_vector.independentD
by blast
thus "u y = 0"
unfolding v_def
by (simp add: a3)
qed
thus ?thesis
using complex_vector.dependent_explicit
by (simp add: complex_vector.dependent_explicit )
qed
subsection \<open>Antilinear maps and friends\<close>
locale antilinear = additive f for f :: "'a::complex_vector \<Rightarrow> 'b::complex_vector" +
assumes scaleC: "f (scaleC r x) = cnj r *\<^sub>C f x"
sublocale antilinear \<subseteq> linear
proof (rule linearI)
show "f (b1 + b2) = f b1 + f b2"
for b1 :: 'a
and b2 :: 'a
by (simp add: add)
show "f (r *\<^sub>R b) = r *\<^sub>R f b"
for r :: real
and b :: 'a
unfolding scaleR_scaleC by (subst scaleC, simp)
qed
lemma antilinear_imp_scaleC:
fixes D :: "complex \<Rightarrow> 'a::complex_vector"
assumes "antilinear D"
obtains d where "D = (\<lambda>x. cnj x *\<^sub>C d)"
proof -
interpret clinear "D o cnj"
apply standard apply auto
apply (simp add: additive.add assms antilinear.axioms(1))
using assms antilinear.scaleC by fastforce
obtain d where "D o cnj = (\<lambda>x. x *\<^sub>C d)"
using clinear_axioms complex_vector.linear_imp_scale by blast
then have \<open>D = (\<lambda>x. cnj x *\<^sub>C d)\<close>
by (metis comp_apply complex_cnj_cnj)
then show ?thesis
by (rule that)
qed
corollary complex_antilinearD:
fixes f :: "complex \<Rightarrow> complex"
assumes "antilinear f" obtains c where "f = (\<lambda>x. c * cnj x)"
by (rule antilinear_imp_scaleC [OF assms]) (force simp: scaleC_conv_of_complex)
lemma antilinearI:
assumes "\<And>x y. f (x + y) = f x + f y"
and "\<And>c x. f (c *\<^sub>C x) = cnj c *\<^sub>C f x"
shows "antilinear f"
by standard (rule assms)+
lemma antilinear_o_antilinear: "antilinear f \<Longrightarrow> antilinear g \<Longrightarrow> clinear (g o f)"
apply (rule clinearI)
apply (simp add: additive.add antilinear_def)
by (simp add: antilinear.scaleC)
lemma clinear_o_antilinear: "antilinear f \<Longrightarrow> clinear g \<Longrightarrow> antilinear (g o f)"
apply (rule antilinearI)
apply (simp add: additive.add complex_vector.linear_add antilinear_def)
by (simp add: complex_vector.linear_scale antilinear.scaleC)
lemma antilinear_o_clinear: "clinear f \<Longrightarrow> antilinear g \<Longrightarrow> antilinear (g o f)"
apply (rule antilinearI)
apply (simp add: additive.add complex_vector.linear_add antilinear_def)
by (simp add: complex_vector.linear_scale antilinear.scaleC)
locale bounded_antilinear = antilinear f for f :: "'a::complex_normed_vector \<Rightarrow> 'b::complex_normed_vector" +
assumes bounded: "\<exists>K. \<forall>x. norm (f x) \<le> norm x * K"
lemma bounded_antilinearI:
assumes \<open>\<And>b1 b2. f (b1 + b2) = f b1 + f b2\<close>
assumes \<open>\<And>r b. f (r *\<^sub>C b) = cnj r *\<^sub>C f b\<close>
assumes \<open>\<forall>x. norm (f x) \<le> norm x * K\<close>
shows "bounded_antilinear f"
using assms by (auto intro!: exI bounded_antilinear.intro antilinearI simp: bounded_antilinear_axioms_def)
sublocale bounded_antilinear \<subseteq> bounded_linear
apply standard by (fact bounded)
lemma (in bounded_antilinear) bounded_linear: "bounded_linear f"
by (fact bounded_linear)
lemma (in bounded_antilinear) antilinear: "antilinear f"
by (fact antilinear_axioms)
lemma bounded_antilinear_intro:
assumes "\<And>x y. f (x + y) = f x + f y"
and "\<And>r x. f (scaleC r x) = scaleC (cnj r) (f x)"
and "\<And>x. norm (f x) \<le> norm x * K"
shows "bounded_antilinear f"
by standard (blast intro: assms)+
lemma bounded_antilinear_0[simp]: \<open>bounded_antilinear (\<lambda>_. 0)\<close>
by (rule bounded_antilinear_intro[where K=0], auto)
lemma cnj_bounded_antilinear[simp]: "bounded_antilinear cnj"
apply (rule bounded_antilinear_intro [where K = 1])
by auto
lemma bounded_antilinear_o_bounded_antilinear:
assumes "bounded_antilinear f"
and "bounded_antilinear g"
shows "bounded_clinear (\<lambda>x. f (g x))"
proof
interpret f: bounded_antilinear f by fact
interpret g: bounded_antilinear g by fact
fix b1 b2 b r
show "f (g (b1 + b2)) = f (g b1) + f (g b2)"
by (simp add: f.add g.add)
show "f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)"
by (simp add: f.scaleC g.scaleC)
have "bounded_linear (\<lambda>x. f (g x))"
using f.bounded_linear g.bounded_linear by (rule bounded_linear_compose)
then show "\<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K"
by (rule bounded_linear.bounded)
qed
lemma bounded_antilinear_o_bounded_clinear:
assumes "bounded_antilinear f"
and "bounded_clinear g"
shows "bounded_antilinear (\<lambda>x. f (g x))"
proof
interpret f: bounded_antilinear f by fact
interpret g: bounded_clinear g by fact
show "f (g (x + y)) = f (g x) + f (g y)" for x y
by (simp only: f.add g.add)
show "f (g (scaleC r x)) = scaleC (cnj r) (f (g x))" for r x
by (simp add: f.scaleC g.scaleC)
have "bounded_linear (\<lambda>x. f (g x))"
using f.bounded_linear g.bounded_linear by (rule bounded_linear_compose)
then show "\<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K"
by (rule bounded_linear.bounded)
qed
lemma bounded_clinear_o_bounded_antilinear:
assumes "bounded_clinear f"
and "bounded_antilinear g"
shows "bounded_antilinear (\<lambda>x. f (g x))"
proof
interpret f: bounded_clinear f by fact
interpret g: bounded_antilinear g by fact
show "f (g (x + y)) = f (g x) + f (g y)" for x y
by (simp only: f.add g.add)
show "f (g (scaleC r x)) = scaleC (cnj r) (f (g x))" for r x
using f.scaleC g.scaleC by fastforce
have "bounded_linear (\<lambda>x. f (g x))"
using f.bounded_linear g.bounded_linear by (rule bounded_linear_compose)
then show "\<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K"
by (rule bounded_linear.bounded)
qed
lemma bij_clinear_imp_inv_clinear: "clinear (inv f)"
if a1: "clinear f" and a2: "bij f"
proof
fix b1 b2 r b
show "inv f (b1 + b2) = inv f b1 + inv f b2"
by (simp add: a1 a2 bij_is_inj bij_is_surj complex_vector.linear_add inv_f_eq surj_f_inv_f)
show "inv f (r *\<^sub>C b) = r *\<^sub>C inv f b"
using that
by (smt bij_inv_eq_iff clinear_def complex_vector.linear_scale)
qed
locale bounded_sesquilinear =
fixes
prod :: "'a::complex_normed_vector \<Rightarrow> 'b::complex_normed_vector \<Rightarrow> 'c::complex_normed_vector"
(infixl "**" 70)
assumes add_left: "prod (a + a') b = prod a b + prod a' b"
and add_right: "prod a (b + b') = prod a b + prod a b'"
and scaleC_left: "prod (r *\<^sub>C a) b = (cnj r) *\<^sub>C (prod a b)"
and scaleC_right: "prod a (r *\<^sub>C b) = r *\<^sub>C (prod a b)"
and bounded: "\<exists>K. \<forall>a b. norm (prod a b) \<le> norm a * norm b * K"
sublocale bounded_sesquilinear \<subseteq> bounded_bilinear
apply standard
by (auto simp: add_left add_right scaleC_left scaleC_right bounded scaleR_scaleC)
lemma (in bounded_sesquilinear) bounded_bilinear[simp]: "bounded_bilinear prod"
by (fact bounded_bilinear_axioms)
lemma (in bounded_sesquilinear) bounded_antilinear_left: "bounded_antilinear (\<lambda>a. prod a b)"
apply standard
apply (auto simp add: scaleC_left add_left)
by (metis ab_semigroup_mult_class.mult_ac(1) bounded)
lemma (in bounded_sesquilinear) bounded_clinear_right: "bounded_clinear (\<lambda>b. prod a b)"
apply standard
apply (auto simp add: scaleC_right add_right)
by (metis ab_semigroup_mult_class.mult_ac(1) ordered_field_class.sign_simps(34) pos_bounded)
lemma (in bounded_sesquilinear) comp1:
assumes \<open>bounded_clinear g\<close>
shows \<open>bounded_sesquilinear (\<lambda>x. prod (g x))\<close>
proof
interpret bounded_clinear g by fact
fix a a' b b' r
show "prod (g (a + a')) b = prod (g a) b + prod (g a') b"
by (simp add: add add_left)
show "prod (g a) (b + b') = prod (g a) b + prod (g a) b'"
by (simp add: add add_right)
show "prod (g (r *\<^sub>C a)) b = cnj r *\<^sub>C prod (g a) b"
by (simp add: scaleC scaleC_left)
show "prod (g a) (r *\<^sub>C b) = r *\<^sub>C prod (g a) b"
by (simp add: scaleC_right)
interpret bounded_bilinear \<open>(\<lambda>x. prod (g x))\<close>
by (simp add: bounded_linear comp1)
show "\<exists>K. \<forall>a b. norm (prod (g a) b) \<le> norm a * norm b * K"
using bounded by blast
qed
lemma (in bounded_sesquilinear) comp2:
assumes \<open>bounded_clinear g\<close>
shows \<open>bounded_sesquilinear (\<lambda>x y. prod x (g y))\<close>
proof
interpret bounded_clinear g by fact
fix a a' b b' r
show "prod (a + a') (g b) = prod a (g b) + prod a' (g b)"
by (simp add: add add_left)
show "prod a (g (b + b')) = prod a (g b) + prod a (g b')"
by (simp add: add add_right)
show "prod (r *\<^sub>C a) (g b) = cnj r *\<^sub>C prod a (g b)"
by (simp add: scaleC scaleC_left)
show "prod a (g (r *\<^sub>C b)) = r *\<^sub>C prod a (g b)"
by (simp add: scaleC scaleC_right)
interpret bounded_bilinear \<open>(\<lambda>x y. prod x (g y))\<close>
apply (rule bounded_bilinear.flip)
using _ bounded_linear apply (rule bounded_bilinear.comp1)
using bounded_bilinear by (rule bounded_bilinear.flip)
show "\<exists>K. \<forall>a b. norm (prod a (g b)) \<le> norm a * norm b * K"
using bounded by blast
qed
lemma (in bounded_sesquilinear) comp: "bounded_clinear f \<Longrightarrow> bounded_clinear g \<Longrightarrow> bounded_sesquilinear (\<lambda>x y. prod (f x) (g y))"
using comp1 bounded_sesquilinear.comp2 by auto
lemma bounded_clinear_const_scaleR:
fixes c :: real
assumes \<open>bounded_clinear f\<close>
shows \<open>bounded_clinear (\<lambda> x. c *\<^sub>R f x )\<close>
proof-
have \<open>bounded_clinear (\<lambda> x. (complex_of_real c) *\<^sub>C f x )\<close>
by (simp add: assms bounded_clinear_const_scaleC)
thus ?thesis
by (simp add: scaleR_scaleC)
qed
lemma bounded_linear_bounded_clinear:
\<open>bounded_linear A \<Longrightarrow> \<forall>c x. A (c *\<^sub>C x) = c *\<^sub>C A x \<Longrightarrow> bounded_clinear A\<close>
apply standard
by (simp_all add: linear_simps bounded_linear.bounded)
lemma comp_bounded_clinear:
fixes A :: \<open>'b::complex_normed_vector \<Rightarrow> 'c::complex_normed_vector\<close>
and B :: \<open>'a::complex_normed_vector \<Rightarrow> 'b\<close>
assumes \<open>bounded_clinear A\<close> and \<open>bounded_clinear B\<close>
shows \<open>bounded_clinear (A \<circ> B)\<close>
by (metis clinear_compose assms(1) assms(2) bounded_clinear_axioms_def bounded_clinear_compose bounded_clinear_def o_def)
lemmas isCont_scaleC [simp] =
bounded_bilinear.isCont [OF bounded_cbilinear_scaleC[THEN bounded_cbilinear.bounded_bilinear]]
subsection \<open>Misc 2\<close>
lemmas sums_of_complex = bounded_linear.sums [OF bounded_clinear_of_complex[THEN bounded_clinear.bounded_linear]]
lemmas summable_of_complex = bounded_linear.summable [OF bounded_clinear_of_complex[THEN bounded_clinear.bounded_linear]]
lemmas suminf_of_complex = bounded_linear.suminf [OF bounded_clinear_of_complex[THEN bounded_clinear.bounded_linear]]
lemmas sums_scaleC_left = bounded_linear.sums[OF bounded_clinear_scaleC_left[THEN bounded_clinear.bounded_linear]]
lemmas summable_scaleC_left = bounded_linear.summable[OF bounded_clinear_scaleC_left[THEN bounded_clinear.bounded_linear]]
lemmas suminf_scaleC_left = bounded_linear.suminf[OF bounded_clinear_scaleC_left[THEN bounded_clinear.bounded_linear]]
lemmas sums_scaleC_right = bounded_linear.sums[OF bounded_clinear_scaleC_right[THEN bounded_clinear.bounded_linear]]
lemmas summable_scaleC_right = bounded_linear.summable[OF bounded_clinear_scaleC_right[THEN bounded_clinear.bounded_linear]]
lemmas suminf_scaleC_right = bounded_linear.suminf[OF bounded_clinear_scaleC_right[THEN bounded_clinear.bounded_linear]]
lemma closed_scaleC:
fixes S::\<open>'a::complex_normed_vector set\<close> and a :: complex
assumes \<open>closed S\<close>
shows \<open>closed ((*\<^sub>C) a ` S)\<close>
proof (cases \<open>a = 0\<close>)
case True
then show ?thesis
apply (cases \<open>S = {}\<close>)
by (auto simp: image_constant)
next
case False
then have \<open>(*\<^sub>C) a ` S = (*\<^sub>C) (inverse a) -` S\<close>
by (auto simp add: rev_image_eqI)
moreover have \<open>closed ((*\<^sub>C) (inverse a) -` S)\<close>
by (simp add: assms continuous_closed_vimage)
ultimately show ?thesis
by simp
qed
lemma closure_scaleC:
fixes S::\<open>'a::complex_normed_vector set\<close>
shows \<open>closure ((*\<^sub>C) a ` S) = (*\<^sub>C) a ` closure S\<close>
proof
have \<open>closed (closure S)\<close>
by simp
show "closure ((*\<^sub>C) a ` S) \<subseteq> (*\<^sub>C) a ` closure S"
by (simp add: closed_scaleC closure_minimal closure_subset image_mono)
have "x \<in> closure ((*\<^sub>C) a ` S)"
if "x \<in> (*\<^sub>C) a ` closure S"
for x :: 'a
proof-
obtain t where \<open>x = ((*\<^sub>C) a) t\<close> and \<open>t \<in> closure S\<close>
using \<open>x \<in> (*\<^sub>C) a ` closure S\<close> by auto
have \<open>\<exists>s. (\<forall>n. s n \<in> S) \<and> s \<longlonglongrightarrow> t\<close>
using \<open>t \<in> closure S\<close> Elementary_Topology.closure_sequential
by blast
then obtain s where \<open>\<forall>n. s n \<in> S\<close> and \<open>s \<longlonglongrightarrow> t\<close>
by blast
have \<open>(\<forall> n. scaleC a (s n) \<in> ((*\<^sub>C) a ` S))\<close>
using \<open>\<forall>n. s n \<in> S\<close> by blast
moreover have \<open>(\<lambda> n. scaleC a (s n)) \<longlonglongrightarrow> x\<close>
proof-
have \<open>isCont (scaleC a) t\<close>
by simp
thus ?thesis
using \<open>s \<longlonglongrightarrow> t\<close> \<open>x = ((*\<^sub>C) a) t\<close>
by (simp add: isCont_tendsto_compose)
qed
ultimately show ?thesis using Elementary_Topology.closure_sequential
by metis
qed
thus "(*\<^sub>C) a ` closure S \<subseteq> closure ((*\<^sub>C) a ` S)" by blast
qed
lemma onorm_scalarC:
fixes f :: \<open>'a::complex_normed_vector \<Rightarrow> 'b::complex_normed_vector\<close>
assumes a1: \<open>bounded_clinear f\<close>
shows \<open>onorm (\<lambda> x. r *\<^sub>C (f x)) = (cmod r) * onorm f\<close>
proof-
have \<open>(norm (f x)) / norm x \<le> onorm f\<close>
for x
using a1
by (simp add: bounded_clinear.bounded_linear le_onorm)
hence t2: \<open>bdd_above {(norm (f x)) / norm x | x. True}\<close>
by fastforce
have \<open>continuous_on UNIV ( (*) w ) \<close>
for w::real
by simp
hence \<open>isCont ( ((*) (cmod r)) ) x\<close>
for x
by simp
hence t3: \<open>continuous (at_left (Sup {(norm (f x)) / norm x | x. True})) ((*) (cmod r))\<close>
using Elementary_Topology.continuous_at_imp_continuous_within
by blast
have \<open>{(norm (f x)) / norm x | x. True} \<noteq> {}\<close>
by blast
moreover have \<open>mono ((*) (cmod r))\<close>
by (simp add: monoI ordered_comm_semiring_class.comm_mult_left_mono)
ultimately have \<open>Sup {((*) (cmod r)) ((norm (f x)) / norm x) | x. True}
= ((*) (cmod r)) (Sup {(norm (f x)) / norm x | x. True})\<close>
using t2 t3
by (simp add: continuous_at_Sup_mono full_SetCompr_eq image_image)
hence \<open>Sup {(cmod r) * ((norm (f x)) / norm x) | x. True}
= (cmod r) * (Sup {(norm (f x)) / norm x | x. True})\<close>
by blast
moreover have \<open>Sup {(cmod r) * ((norm (f x)) / norm x) | x. True}
= (SUP x. cmod r * norm (f x) / norm x)\<close>
by (simp add: full_SetCompr_eq)
moreover have \<open>(Sup {(norm (f x)) / norm x | x. True})
= (SUP x. norm (f x) / norm x)\<close>
by (simp add: full_SetCompr_eq)
ultimately have t1: "(SUP x. cmod r * norm (f x) / norm x)
= cmod r * (SUP x. norm (f x) / norm x)"
by simp
have \<open>onorm (\<lambda> x. r *\<^sub>C (f x)) = (SUP x. norm ( (\<lambda> t. r *\<^sub>C (f t)) x) / norm x)\<close>
by (simp add: onorm_def)
hence \<open>onorm (\<lambda> x. r *\<^sub>C (f x)) = (SUP x. (cmod r) * (norm (f x)) / norm x)\<close>
by simp
also have \<open>... = (cmod r) * (SUP x. (norm (f x)) / norm x)\<close>
using t1.
finally show ?thesis
by (simp add: onorm_def)
qed
lemma onorm_scaleC_left_lemma:
fixes f :: "'a::complex_normed_vector"
assumes r: "bounded_clinear r"
shows "onorm (\<lambda>x. r x *\<^sub>C f) \<le> onorm r * norm f"
proof (rule onorm_bound)
fix x
have "norm (r x *\<^sub>C f) = norm (r x) * norm f"
by simp
also have "\<dots> \<le> onorm r * norm x * norm f"
by (simp add: bounded_clinear.bounded_linear mult.commute mult_left_mono onorm r)
finally show "norm (r x *\<^sub>C f) \<le> onorm r * norm f * norm x"
by (simp add: ac_simps)
show "0 \<le> onorm r * norm f"
by (simp add: bounded_clinear.bounded_linear onorm_pos_le r)
qed
lemma onorm_scaleC_left:
fixes f :: "'a::complex_normed_vector"
assumes f: "bounded_clinear r"
shows "onorm (\<lambda>x. r x *\<^sub>C f) = onorm r * norm f"
proof (cases "f = 0")
assume "f \<noteq> 0"
show ?thesis
proof (rule order_antisym)
show "onorm (\<lambda>x. r x *\<^sub>C f) \<le> onorm r * norm f"
using f by (rule onorm_scaleC_left_lemma)
next
have bl1: "bounded_clinear (\<lambda>x. r x *\<^sub>C f)"
by (metis bounded_clinear_scaleC_const f)
have x1:"bounded_clinear (\<lambda>x. r x * norm f)"
by (metis bounded_clinear_mult_const f)
have "onorm r \<le> onorm (\<lambda>x. r x * complex_of_real (norm f)) / norm f"
if "onorm r \<le> onorm (\<lambda>x. r x * complex_of_real (norm f)) * cmod (1 / complex_of_real (norm f))"
and "f \<noteq> 0"
using that
by (metis complex_of_real_cmod complex_of_real_nn_iff field_class.field_divide_inverse
inverse_eq_divide nice_ordered_field_class.zero_le_divide_1_iff norm_ge_zero of_real_1
of_real_divide of_real_eq_iff)
hence "onorm r \<le> onorm (\<lambda>x. r x * norm f) * inverse (norm f)"
using \<open>f \<noteq> 0\<close> onorm_scaleC_left_lemma[OF x1, of "inverse (norm f)"]
by (simp add: inverse_eq_divide)
also have "onorm (\<lambda>x. r x * norm f) \<le> onorm (\<lambda>x. r x *\<^sub>C f)"
proof (rule onorm_bound)
have "bounded_linear (\<lambda>x. r x *\<^sub>C f)"
using bl1 bounded_clinear.bounded_linear by auto
thus "0 \<le> onorm (\<lambda>x. r x *\<^sub>C f)"
by (rule Operator_Norm.onorm_pos_le)
show "cmod (r x * complex_of_real (norm f)) \<le> onorm (\<lambda>x. r x *\<^sub>C f) * norm x"
for x :: 'b
by (smt \<open>bounded_linear (\<lambda>x. r x *\<^sub>C f)\<close> complex_of_real_cmod complex_of_real_nn_iff
complex_scaleC_def norm_ge_zero norm_scaleC of_real_eq_iff onorm)
qed