-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathLinearMap.lean
More file actions
1368 lines (1037 loc) · 54.3 KB
/
LinearMap.lean
File metadata and controls
1368 lines (1037 loc) · 54.3 KB
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
/-
Copyright (c) 2019 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jan-David Salchow, Sébastien Gouëzel, Jean Lo, Yury Kudryashov, Frédéric Dupuis,
Heather Macbeth
-/
module
public import Mathlib.Algebra.Module.LinearMap.DivisionRing
public import Mathlib.Algebra.Module.Submodule.EqLocus
public import Mathlib.LinearAlgebra.Projection
public import Mathlib.Topology.Algebra.ContinuousMonoidHom
public import Mathlib.Topology.Algebra.IsUniformGroup.Defs
public import Mathlib.Topology.Algebra.Module.Basic
/-!
# Continuous linear maps
In this file we define continuous (semi-)linear maps, as semilinear maps between topological
modules which are continuous. The set of continuous semilinear maps between the topological
`R₁`-module `M` and `R₂`-module `M₂` with respect to the `RingHom` `σ` is denoted by `M →SL[σ] M₂`.
Plain linear maps are denoted by `M →L[R] M₂` and star-linear maps by `M →L⋆[R] M₂`.
-/
@[expose] public section
assert_not_exists TrivialStar
open LinearMap (ker range)
open Topology Filter Pointwise
universe u v w u'
/-- Continuous linear maps between modules. We only put the type classes that are necessary for the
definition, although in applications `M` and `M₂` will be topological modules over the topological
ring `R`. -/
structure ContinuousLinearMap {R : Type*} {S : Type*} [Semiring R] [Semiring S] (σ : R →+* S)
(M : Type*) [TopologicalSpace M] [AddCommMonoid M] (M₂ : Type*) [TopologicalSpace M₂]
[AddCommMonoid M₂] [Module R M] [Module S M₂] extends M →ₛₗ[σ] M₂ where
cont : Continuous toFun := by fun_prop
attribute [inherit_doc ContinuousLinearMap] ContinuousLinearMap.cont
@[inherit_doc]
notation:25 M " →SL[" σ "] " M₂ => ContinuousLinearMap σ M M₂
@[inherit_doc]
notation:25 M " →L[" R "] " M₂ => ContinuousLinearMap (RingHom.id R) M M₂
/-- `ContinuousSemilinearMapClass F σ M M₂` asserts `F` is a type of bundled continuous
`σ`-semilinear maps `M → M₂`. See also `ContinuousLinearMapClass F R M M₂` for the case where
`σ` is the identity map on `R`. A map `f` between an `R`-module and an `S`-module over a ring
homomorphism `σ : R →+* S` is semilinear if it satisfies the two properties `f (x + y) = f x + f y`
and `f (c • x) = (σ c) • f x`. -/
class ContinuousSemilinearMapClass (F : Type*) {R S : outParam Type*} [Semiring R] [Semiring S]
(σ : outParam <| R →+* S) (M : outParam Type*) [TopologicalSpace M] [AddCommMonoid M]
(M₂ : outParam Type*) [TopologicalSpace M₂] [AddCommMonoid M₂] [Module R M]
[Module S M₂] [FunLike F M M₂] : Prop
extends SemilinearMapClass F σ M M₂, ContinuousMapClass F M M₂
/-- `ContinuousLinearMapClass F R M M₂` asserts `F` is a type of bundled continuous
`R`-linear maps `M → M₂`. This is an abbreviation for
`ContinuousSemilinearMapClass F (RingHom.id R) M M₂`. -/
abbrev ContinuousLinearMapClass (F : Type*) (R : outParam Type*) [Semiring R]
(M : outParam Type*) [TopologicalSpace M] [AddCommMonoid M] (M₂ : outParam Type*)
[TopologicalSpace M₂] [AddCommMonoid M₂] [Module R M] [Module R M₂] [FunLike F M M₂] :=
ContinuousSemilinearMapClass F (RingHom.id R) M M₂
/-- The *strong dual* of a topological vector space `M` over a ring `R`. This is the space of
continuous linear functionals and is equipped with the topology of uniform convergence
on bounded subsets. `StrongDual R M` is an abbreviation for `M →L[R] R`. -/
abbrev StrongDual (R : Type*) [Semiring R] [TopologicalSpace R]
(M : Type*) [TopologicalSpace M] [AddCommMonoid M] [Module R M] : Type _ := M →L[R] R
namespace ContinuousLinearMap
section Semiring
/-!
### Properties that hold for non-necessarily commutative semirings.
-/
variable {R₁ : Type*} {R₂ : Type*} {R₃ : Type*} [Semiring R₁] [Semiring R₂] [Semiring R₃]
{σ₁₂ : R₁ →+* R₂} {σ₂₃ : R₂ →+* R₃} {σ₁₃ : R₁ →+* R₃} {M₁ : Type*} [TopologicalSpace M₁]
[AddCommMonoid M₁] {M'₁ : Type*} [TopologicalSpace M'₁] [AddCommMonoid M'₁] {M₂ : Type*}
[TopologicalSpace M₂] [AddCommMonoid M₂] {M₃ : Type*} [TopologicalSpace M₃] [AddCommMonoid M₃]
{M₄ : Type*} [TopologicalSpace M₄] [AddCommMonoid M₄] [Module R₁ M₁] [Module R₁ M'₁]
[Module R₂ M₂] [Module R₃ M₃]
attribute [coe] ContinuousLinearMap.toLinearMap
/-- Coerce continuous linear maps to linear maps. -/
instance LinearMap.coe : Coe (M₁ →SL[σ₁₂] M₂) (M₁ →ₛₗ[σ₁₂] M₂) := ⟨toLinearMap⟩
theorem coe_injective : Function.Injective ((↑) : (M₁ →SL[σ₁₂] M₂) → M₁ →ₛₗ[σ₁₂] M₂) := by
intro f g H
cases f
cases g
congr
instance funLike : FunLike (M₁ →SL[σ₁₂] M₂) M₁ M₂ where
coe f := f.toLinearMap
coe_injective' _ _ h := coe_injective (DFunLike.coe_injective h)
instance continuousSemilinearMapClass :
ContinuousSemilinearMapClass (M₁ →SL[σ₁₂] M₂) σ₁₂ M₁ M₂ where
map_add f := map_add f.toLinearMap
map_continuous f := f.2
map_smulₛₗ f := f.toLinearMap.map_smul'
theorem coe_mk (f : M₁ →ₛₗ[σ₁₂] M₂) (h) : (mk f h : M₁ →ₛₗ[σ₁₂] M₂) = f :=
rfl
@[simp]
theorem coe_mk' (f : M₁ →ₛₗ[σ₁₂] M₂) (h) : (mk f h : M₁ → M₂) = f :=
rfl
@[continuity, fun_prop]
protected theorem continuous (f : M₁ →SL[σ₁₂] M₂) : Continuous f :=
f.2
@[continuity, fun_prop]
protected theorem continuous_toLinearMap (f : M₁ →SL[σ₁₂] M₂) : Continuous f.toLinearMap :=
f.2
@[simp]
protected theorem uniformContinuous {E₁ E₂ : Type*} [UniformSpace E₁] [UniformSpace E₂]
[AddCommGroup E₁] [AddCommGroup E₂] [Module R₁ E₁] [Module R₂ E₂] [IsUniformAddGroup E₁]
[IsUniformAddGroup E₂] (f : E₁ →SL[σ₁₂] E₂) : UniformContinuous f :=
uniformContinuous_addMonoidHom_of_continuous f.continuous
@[simp, norm_cast]
theorem coe_inj {f g : M₁ →SL[σ₁₂] M₂} : (f : M₁ →ₛₗ[σ₁₂] M₂) = g ↔ f = g :=
coe_injective.eq_iff
theorem coeFn_injective : @Function.Injective (M₁ →SL[σ₁₂] M₂) (M₁ → M₂) (↑) :=
DFunLike.coe_injective
theorem toContinuousAddMonoidHom_injective :
Function.Injective ((↑) : (M₁ →SL[σ₁₂] M₂) → ContinuousAddMonoidHom M₁ M₂) :=
(DFunLike.coe_injective.of_comp_iff _).1 DFunLike.coe_injective
@[simp, norm_cast]
theorem toContinuousAddMonoidHom_inj {f g : M₁ →SL[σ₁₂] M₂} :
(f : ContinuousAddMonoidHom M₁ M₂) = g ↔ f = g :=
toContinuousAddMonoidHom_injective.eq_iff
/-- See Note [custom simps projection]. We need to specify this projection explicitly in this case,
because it is a composition of multiple projections. -/
def Simps.apply (h : M₁ →SL[σ₁₂] M₂) : M₁ → M₂ :=
h
/-- See Note [custom simps projection]. -/
def Simps.coe (h : M₁ →SL[σ₁₂] M₂) : M₁ →ₛₗ[σ₁₂] M₂ :=
h
initialize_simps_projections ContinuousLinearMap (toFun → apply, toLinearMap → coe, as_prefix coe)
@[ext]
theorem ext {f g : M₁ →SL[σ₁₂] M₂} (h : ∀ x, f x = g x) : f = g :=
DFunLike.ext f g h
@[simp, norm_cast]
theorem coe_coe (f : M₁ →SL[σ₁₂] M₂) : ⇑(f : M₁ →ₛₗ[σ₁₂] M₂) = f :=
rfl
/-- Copy of a `ContinuousLinearMap` with a new `toFun` equal to the old one. Useful to fix
definitional equalities. -/
protected def copy (f : M₁ →SL[σ₁₂] M₂) (f' : M₁ → M₂) (h : f' = ⇑f) : M₁ →SL[σ₁₂] M₂ where
toLinearMap := f.toLinearMap.copy f' h
cont := show Continuous f' from h.symm ▸ f.continuous
@[simp]
theorem coe_copy (f : M₁ →SL[σ₁₂] M₂) (f' : M₁ → M₂) (h : f' = ⇑f) : ⇑(f.copy f' h) = f' :=
rfl
theorem copy_eq (f : M₁ →SL[σ₁₂] M₂) (f' : M₁ → M₂) (h : f' = ⇑f) : f.copy f' h = f :=
DFunLike.ext' h
theorem range_coeFn_eq :
Set.range ((⇑) : (M₁ →SL[σ₁₂] M₂) → (M₁ → M₂)) =
{f | Continuous f} ∩ Set.range ((⇑) : (M₁ →ₛₗ[σ₁₂] M₂) → (M₁ → M₂)) := by
ext f
constructor
· rintro ⟨f, rfl⟩
exact ⟨f.continuous, f, rfl⟩
· rintro ⟨hfc, f, rfl⟩
exact ⟨⟨f, hfc⟩, rfl⟩
lemma range_toLinearMap (f : M₁ →SL[σ₁₂] M₂) : Set.range f.toLinearMap = Set.range f := by simp
-- make some straightforward lemmas available to `simp`.
protected theorem map_zero (f : M₁ →SL[σ₁₂] M₂) : f (0 : M₁) = 0 :=
map_zero f
protected theorem map_add (f : M₁ →SL[σ₁₂] M₂) (x y : M₁) : f (x + y) = f x + f y :=
map_add f x y
@[simp]
protected theorem map_smulₛₗ (f : M₁ →SL[σ₁₂] M₂) (c : R₁) (x : M₁) : f (c • x) = σ₁₂ c • f x :=
(toLinearMap _).map_smulₛₗ _ _
protected theorem map_smul [Module R₁ M₂] (f : M₁ →L[R₁] M₂) (c : R₁) (x : M₁) :
f (c • x) = c • f x := by simp only [RingHom.id_apply, map_smulₛₗ]
@[simp]
theorem map_smul_of_tower {R S : Type*} [Semiring S] [SMul R M₁] [Module S M₁] [SMul R M₂]
[Module S M₂] [LinearMap.CompatibleSMul M₁ M₂ R S] (f : M₁ →L[S] M₂) (c : R) (x : M₁) :
f (c • x) = c • f x :=
LinearMap.CompatibleSMul.map_smul (f : M₁ →ₗ[S] M₂) c x
@[ext]
theorem ext_ring [TopologicalSpace R₁] {f g : R₁ →L[R₁] M₁} (h : f 1 = g 1) : f = g :=
coe_inj.1 <| LinearMap.ext_ring h
@[simp]
theorem apply_val_ker (f : M₁ →SL[σ₁₂] M₂) (x : f.ker) : f x = 0 := x.2
/-- If two continuous linear maps are equal on a set `s`, then they are equal on the closure
of the `Submodule.span` of this set. -/
theorem eqOn_closure_span [T2Space M₂] {s : Set M₁} {f g : M₁ →SL[σ₁₂] M₂} (h : Set.EqOn f g s) :
Set.EqOn f g (closure (Submodule.span R₁ s : Set M₁)) :=
(LinearMap.eqOn_span' h).closure f.continuous g.continuous
/-- If the submodule generated by a set `s` is dense in the ambient module, then two continuous
linear maps equal on `s` are equal. -/
theorem ext_on [T2Space M₂] {s : Set M₁} (hs : Dense (Submodule.span R₁ s : Set M₁))
{f g : M₁ →SL[σ₁₂] M₂} (h : Set.EqOn f g s) : f = g :=
ext fun x => eqOn_closure_span h (hs x)
/-- Under a continuous linear map, the image of the `TopologicalClosure` of a submodule is
contained in the `TopologicalClosure` of its image. -/
theorem _root_.Submodule.topologicalClosure_map [RingHomSurjective σ₁₂] [TopologicalSpace R₁]
[TopologicalSpace R₂] [ContinuousSMul R₁ M₁] [ContinuousAdd M₁] [ContinuousSMul R₂ M₂]
[ContinuousAdd M₂] (f : M₁ →SL[σ₁₂] M₂) (s : Submodule R₁ M₁) :
s.topologicalClosure.map (f : M₁ →ₛₗ[σ₁₂] M₂) ≤
(s.map (f : M₁ →ₛₗ[σ₁₂] M₂)).topologicalClosure :=
image_closure_subset_closure_image f.continuous
/-- If a continuous linear map stabilizes a submodule, then it stabilizes its topological
closure. -/
theorem _root_.Submodule.topologicalClosure_mem_invtSubmodule [TopologicalSpace R₁]
[ContinuousSMul R₁ M₁] [ContinuousAdd M₁] {f : M₁ →L[R₁] M₁} {s : Submodule R₁ M₁}
(hs : s ∈ Module.End.invtSubmodule f) :
s.topologicalClosure ∈ Module.End.invtSubmodule f := by
rw [Module.End.mem_invtSubmodule_iff_map_le] at hs ⊢
exact (s.topologicalClosure_map f).trans (Submodule.topologicalClosure_mono hs)
/-- Under a dense continuous linear map, a submodule whose `TopologicalClosure` is `⊤` is sent to
another such submodule. That is, the image of a dense set under a map with dense range is dense.
-/
theorem _root_.DenseRange.topologicalClosure_map_submodule [RingHomSurjective σ₁₂]
[TopologicalSpace R₁] [TopologicalSpace R₂] [ContinuousSMul R₁ M₁] [ContinuousAdd M₁]
[ContinuousSMul R₂ M₂] [ContinuousAdd M₂] {f : M₁ →SL[σ₁₂] M₂} (hf' : DenseRange f)
{s : Submodule R₁ M₁} (hs : s.topologicalClosure = ⊤) :
(s.map (f : M₁ →ₛₗ[σ₁₂] M₂)).topologicalClosure = ⊤ := by
rw [SetLike.ext'_iff] at hs ⊢
simp only [Submodule.topologicalClosure_coe, Submodule.top_coe, ← dense_iff_closure_eq] at hs ⊢
exact hf'.dense_image f.continuous hs
section SMul
variable {S₂ T₂ : Type*}
variable [DistribSMul S₂ M₂] [SMulCommClass R₂ S₂ M₂] [ContinuousConstSMul S₂ M₂]
variable [DistribSMul T₂ M₂] [SMulCommClass R₂ T₂ M₂] [ContinuousConstSMul T₂ M₂]
instance instSMul : SMul S₂ (M₁ →SL[σ₁₂] M₂) where
smul c f := ⟨c • (f : M₁ →ₛₗ[σ₁₂] M₂), (f.2.const_smul _ : Continuous fun x => c • f x)⟩
theorem smul_apply (c : S₂) (f : M₁ →SL[σ₁₂] M₂) (x : M₁) : (c • f) x = c • f x :=
rfl
@[simp, norm_cast]
theorem coe_smul (c : S₂) (f : M₁ →SL[σ₁₂] M₂) :
↑(c • f) = c • (f : M₁ →ₛₗ[σ₁₂] M₂) :=
rfl
@[simp, norm_cast]
theorem coe_smul' (c : S₂) (f : M₁ →SL[σ₁₂] M₂) :
↑(c • f) = c • (f : M₁ → M₂) :=
rfl
instance isScalarTower [SMul S₂ T₂] [IsScalarTower S₂ T₂ M₂] :
IsScalarTower S₂ T₂ (M₁ →SL[σ₁₂] M₂) :=
⟨fun a b f => ext fun x => smul_assoc a b (f x)⟩
instance smulCommClass [SMulCommClass S₂ T₂ M₂] : SMulCommClass S₂ T₂ (M₁ →SL[σ₁₂] M₂) :=
⟨fun a b f => ext fun x => smul_comm a b (f x)⟩
end SMul
section SMulMonoid
variable {S₂ : Type*} [Monoid S₂]
variable [DistribMulAction S₂ M₂] [SMulCommClass R₂ S₂ M₂] [ContinuousConstSMul S₂ M₂]
instance mulAction : MulAction S₂ (M₁ →SL[σ₁₂] M₂) where
one_smul _f := ext fun _x => one_smul _ _
mul_smul _a _b _f := ext fun _x => mul_smul _ _ _
end SMulMonoid
/-- The continuous map that is constantly zero. -/
instance zero : Zero (M₁ →SL[σ₁₂] M₂) :=
⟨⟨0, continuous_zero⟩⟩
instance inhabited : Inhabited (M₁ →SL[σ₁₂] M₂) :=
⟨0⟩
@[simp]
theorem default_def : (default : M₁ →SL[σ₁₂] M₂) = 0 :=
rfl
@[simp]
theorem zero_apply (x : M₁) : (0 : M₁ →SL[σ₁₂] M₂) x = 0 :=
rfl
@[simp, norm_cast]
theorem coe_zero : ((0 : M₁ →SL[σ₁₂] M₂) : M₁ →ₛₗ[σ₁₂] M₂) = 0 :=
rfl
/- no simp attribute on the next line as simp does not always simplify `0 x` to `0`
when `0` is the zero function, while it does for the zero continuous linear map,
and this is the most important property we care about. -/
@[norm_cast]
theorem coe_zero' : ⇑(0 : M₁ →SL[σ₁₂] M₂) = 0 :=
rfl
@[simp, norm_cast]
theorem toContinuousAddMonoidHom_zero :
((0 : M₁ →SL[σ₁₂] M₂) : ContinuousAddMonoidHom M₁ M₂) = 0 := rfl
instance uniqueOfLeft [Subsingleton M₁] : Unique (M₁ →SL[σ₁₂] M₂) :=
coe_injective.unique
instance uniqueOfRight [Subsingleton M₂] : Unique (M₁ →SL[σ₁₂] M₂) :=
coe_injective.unique
theorem exists_ne_zero {f : M₁ →SL[σ₁₂] M₂} (hf : f ≠ 0) : ∃ x, f x ≠ 0 := by
by_contra! h
exact hf (ContinuousLinearMap.ext h)
section
variable (R₁ M₁)
/-- the identity map as a continuous linear map. -/
protected def id : M₁ →L[R₁] M₁ :=
⟨LinearMap.id, continuous_id⟩
end
instance one : One (M₁ →L[R₁] M₁) :=
⟨.id R₁ M₁⟩
theorem one_def : (1 : M₁ →L[R₁] M₁) = .id R₁ M₁ := rfl
theorem id_apply (x : M₁) : ContinuousLinearMap.id R₁ M₁ x = x := rfl
@[simp, norm_cast]
theorem coe_id : (ContinuousLinearMap.id R₁ M₁ : M₁ →ₗ[R₁] M₁) = LinearMap.id :=
rfl
@[simp, norm_cast]
theorem coe_id' : ⇑(ContinuousLinearMap.id R₁ M₁) = id :=
rfl
@[simp, norm_cast]
theorem coe_one : ((1 : M₁ →L[R₁] M₁) : M₁ →ₗ[R₁] M₁) = 1 :=
rfl
@[simp, norm_cast]
theorem toContinuousAddMonoidHom_id :
(ContinuousLinearMap.id R₁ M₁ : ContinuousAddMonoidHom M₁ M₁) = .id _ := rfl
@[simp, norm_cast]
theorem coe_eq_id {f : M₁ →L[R₁] M₁} : (f : M₁ →ₗ[R₁] M₁) = LinearMap.id ↔ f = .id _ _ := by
rw [← coe_id, coe_inj]
@[simp] theorem one_apply (x : M₁) : (1 : M₁ →L[R₁] M₁) x = x := rfl
instance [Nontrivial M₁] : Nontrivial (M₁ →L[R₁] M₁) :=
⟨0, 1, fun e ↦
have ⟨x, hx⟩ := exists_ne (0 : M₁); hx (by simpa using DFunLike.congr_fun e.symm x)⟩
section Add
variable [ContinuousAdd M₂]
instance add : Add (M₁ →SL[σ₁₂] M₂) :=
⟨fun f g => ⟨f + g, f.2.add g.2⟩⟩
@[simp]
theorem add_apply (f g : M₁ →SL[σ₁₂] M₂) (x : M₁) : (f + g) x = f x + g x :=
rfl
@[simp, norm_cast]
theorem coe_add (f g : M₁ →SL[σ₁₂] M₂) : (↑(f + g) : M₁ →ₛₗ[σ₁₂] M₂) = f + g :=
rfl
@[norm_cast]
theorem coe_add' (f g : M₁ →SL[σ₁₂] M₂) : ⇑(f + g) = f + g :=
rfl
@[simp, norm_cast]
theorem toContinuousAddMonoidHom_add (f g : M₁ →SL[σ₁₂] M₂) :
↑(f + g) = (f + g : ContinuousAddMonoidHom M₁ M₂) := rfl
-- The `AddMonoid` instance exists to help speedup unification
instance : AddMonoid (M₁ →SL[σ₁₂] M₂) where
zero_add := by
intros
ext
apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm]
add_zero := by
intros
ext
apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm]
add_assoc := by
intros
ext
apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm]
nsmul := (· • ·)
nsmul_zero f := by
ext
simp
nsmul_succ n f := by
ext
simp [add_smul]
instance addCommMonoid : AddCommMonoid (M₁ →SL[σ₁₂] M₂) where
add_comm := by
intros
ext
apply_rules [zero_add, add_assoc, add_zero, neg_add_cancel, add_comm]
@[simp, norm_cast]
theorem coe_sum {ι : Type*} (t : Finset ι) (f : ι → M₁ →SL[σ₁₂] M₂) :
↑(∑ d ∈ t, f d) = (∑ d ∈ t, f d : M₁ →ₛₗ[σ₁₂] M₂) :=
map_sum (AddMonoidHom.mk ⟨((↑) : (M₁ →SL[σ₁₂] M₂) → M₁ →ₛₗ[σ₁₂] M₂), rfl⟩ fun _ _ => rfl) _ _
@[simp, norm_cast]
theorem coe_sum' {ι : Type*} (t : Finset ι) (f : ι → M₁ →SL[σ₁₂] M₂) :
⇑(∑ d ∈ t, f d) = ∑ d ∈ t, ⇑(f d) := by simp only [← coe_coe, coe_sum, LinearMap.coe_sum]
theorem sum_apply {ι : Type*} (t : Finset ι) (f : ι → M₁ →SL[σ₁₂] M₂) (b : M₁) :
(∑ d ∈ t, f d) b = ∑ d ∈ t, f d b := by simp only [coe_sum', Finset.sum_apply]
end Add
variable [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
/-- Composition of bounded linear maps. -/
def comp (g : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) : M₁ →SL[σ₁₃] M₃ :=
⟨(g : M₂ →ₛₗ[σ₂₃] M₃).comp (f : M₁ →ₛₗ[σ₁₂] M₂), g.2.comp f.2⟩
@[inherit_doc comp]
infixr:80 " ∘L " =>
@ContinuousLinearMap.comp _ _ _ _ _ _ (RingHom.id _) (RingHom.id _) (RingHom.id _) _ _ _ _ _ _ _ _
_ _ _ _ RingHomCompTriple.ids
@[simp, norm_cast]
theorem coe_comp (h : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) :
(h.comp f : M₁ →ₛₗ[σ₁₃] M₃) = (h : M₂ →ₛₗ[σ₂₃] M₃).comp (f : M₁ →ₛₗ[σ₁₂] M₂) :=
rfl
@[simp, norm_cast]
theorem coe_comp' (h : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) : ⇑(h.comp f) = h ∘ f :=
rfl
@[simp, norm_cast]
theorem toContinuousAddMonoidHom_comp (h : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) :
(↑(h.comp f) : ContinuousAddMonoidHom M₁ M₃) = (h : ContinuousAddMonoidHom M₂ M₃).comp f := rfl
theorem comp_apply (g : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) (x : M₁) : (g.comp f) x = g (f x) :=
rfl
@[simp]
theorem comp_id (f : M₁ →SL[σ₁₂] M₂) : f.comp (.id R₁ M₁) = f :=
ext fun _x => rfl
@[simp]
theorem id_comp (f : M₁ →SL[σ₁₂] M₂) : (ContinuousLinearMap.id R₂ M₂).comp f = f :=
ext fun _x => rfl
section
variable {R E F : Type*} [Semiring R]
[TopologicalSpace E] [AddCommMonoid E] [Module R E]
[TopologicalSpace F] [AddCommMonoid F] [Module R F]
/-- `g ∘ f = id` as `ContinuousLinearMap`s implies `g ∘ f = id` as functions. -/
lemma leftInverse_of_comp {f : E →L[R] F} {g : F →L[R] E}
(hinv : g.comp f = ContinuousLinearMap.id R E) : Function.LeftInverse g f := by
simpa [← Function.rightInverse_iff_comp] using congr(⇑$hinv)
/-- `f ∘ g = id` as `ContinuousLinearMap`s implies `f ∘ g = id` as functions. -/
lemma rightInverse_of_comp {f : E →L[R] F} {g : F →L[R] E}
(hinv : f.comp g = ContinuousLinearMap.id R F) : Function.RightInverse g f :=
leftInverse_of_comp hinv
end
@[simp]
theorem comp_zero (g : M₂ →SL[σ₂₃] M₃) : g.comp (0 : M₁ →SL[σ₁₂] M₂) = 0 := by
ext
simp
@[simp]
theorem zero_comp (f : M₁ →SL[σ₁₂] M₂) : (0 : M₂ →SL[σ₂₃] M₃).comp f = 0 := by
ext
simp
@[simp]
theorem comp_add [ContinuousAdd M₂] [ContinuousAdd M₃] (g : M₂ →SL[σ₂₃] M₃)
(f₁ f₂ : M₁ →SL[σ₁₂] M₂) : g.comp (f₁ + f₂) = g.comp f₁ + g.comp f₂ := by
ext
simp
@[simp]
theorem add_comp [ContinuousAdd M₃] (g₁ g₂ : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) :
(g₁ + g₂).comp f = g₁.comp f + g₂.comp f := by
ext
simp
theorem comp_finset_sum {ι : Type*} {s : Finset ι}
[ContinuousAdd M₂] [ContinuousAdd M₃] (g : M₂ →SL[σ₂₃] M₃)
(f : ι → M₁ →SL[σ₁₂] M₂) : g.comp (∑ i ∈ s, f i) = ∑ i ∈ s, g.comp (f i) := by
ext
simp
theorem finset_sum_comp {ι : Type*} {s : Finset ι}
[ContinuousAdd M₃] (g : ι → M₂ →SL[σ₂₃] M₃)
(f : M₁ →SL[σ₁₂] M₂) : (∑ i ∈ s, g i).comp f = ∑ i ∈ s, (g i).comp f := by
ext
simp only [coe_comp', coe_sum', Function.comp_apply, Finset.sum_apply]
theorem comp_assoc {R₄ : Type*} [Semiring R₄] [Module R₄ M₄] {σ₁₄ : R₁ →+* R₄} {σ₂₄ : R₂ →+* R₄}
{σ₃₄ : R₃ →+* R₄} [RingHomCompTriple σ₁₃ σ₃₄ σ₁₄] [RingHomCompTriple σ₂₃ σ₃₄ σ₂₄]
[RingHomCompTriple σ₁₂ σ₂₄ σ₁₄] (h : M₃ →SL[σ₃₄] M₄) (g : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) :
(h.comp g).comp f = h.comp (g.comp f) :=
rfl
theorem cancel_left {g : M₂ →SL[σ₂₃] M₃} {f₁ f₂ : M₁ →SL[σ₁₂] M₂} (hg : Function.Injective g)
(h : g.comp f₁ = g.comp f₂) : f₁ = f₂ := by
ext x
exact hg congr($h x)
instance instMul : Mul (M₁ →L[R₁] M₁) :=
⟨comp⟩
theorem mul_def (f g : M₁ →L[R₁] M₁) : f * g = f.comp g :=
rfl
@[simp, norm_cast]
theorem coe_mul (f g : M₁ →L[R₁] M₁) : (↑(f * g) : M₁ →ₗ[R₁] M₁) = f * g :=
rfl
@[simp, norm_cast]
theorem coe_mul' (f g : M₁ →L[R₁] M₁) : ⇑(f * g) = f ∘ g :=
rfl
theorem mul_apply (f g : M₁ →L[R₁] M₁) (x : M₁) : (f * g) x = f (g x) :=
rfl
instance monoidWithZero : MonoidWithZero (M₁ →L[R₁] M₁) where
mul_zero f := ext fun _ => map_zero f
zero_mul _ := ext fun _ => rfl
mul_one _ := ext fun _ => rfl
one_mul _ := ext fun _ => rfl
mul_assoc _ _ _ := ext fun _ => rfl
@[simp, norm_cast]
theorem coe_pow' (f : M₁ →L[R₁] M₁) (n : ℕ) : ⇑(f ^ n) = f^[n] :=
hom_coe_pow _ rfl (fun _ _ ↦ rfl) _ _
@[simp, norm_cast]
theorem coe_pow (f : M₁ →L[R₁] M₁) (n : ℕ) : (↑(f ^ n) : M₁ →ₗ[R₁] M₁) = f ^ n :=
DFunLike.ext' <| (coe_pow' f n).trans <| .symm <| hom_coe_pow _ rfl (fun _ _ ↦ rfl) _ _
instance instNatCast [ContinuousAdd M₁] : NatCast (M₁ →L[R₁] M₁) where
natCast n := n • (1 : M₁ →L[R₁] M₁)
instance semiring [ContinuousAdd M₁] : Semiring (M₁ →L[R₁] M₁) where
__ := ContinuousLinearMap.monoidWithZero
__ := ContinuousLinearMap.addCommMonoid
left_distrib f g h := ext fun x => map_add f (g x) (h x)
right_distrib _ _ _ := ext fun _ => LinearMap.add_apply _ _ _
toNatCast := instNatCast
natCast_zero := zero_smul ℕ (1 : M₁ →L[R₁] M₁)
natCast_succ n := AddMonoid.nsmul_succ n (1 : M₁ →L[R₁] M₁)
/-- `ContinuousLinearMap.toLinearMap` as a `RingHom`. -/
@[simps]
def toLinearMapRingHom [ContinuousAdd M₁] : (M₁ →L[R₁] M₁) →+* M₁ →ₗ[R₁] M₁ where
toFun := toLinearMap
map_zero' := rfl
map_one' := rfl
map_add' _ _ := rfl
map_mul' _ _ := rfl
@[simp]
theorem natCast_apply [ContinuousAdd M₁] (n : ℕ) (m : M₁) : (↑n : M₁ →L[R₁] M₁) m = n • m :=
rfl
@[simp]
theorem ofNat_apply [ContinuousAdd M₁] (n : ℕ) [n.AtLeastTwo] (m : M₁) :
(ofNat(n) : M₁ →L[R₁] M₁) m = OfNat.ofNat n • m :=
rfl
/-- Construct a homeomorphism from an invertible continuous linear map. -/
@[simps]
def homeomorphOfUnit (T : (M₁ →L[R₁] M₁)ˣ) : M₁ ≃ₜ M₁ where
toFun := T.1
invFun := T⁻¹.1
left_inv x := by rw [← mul_apply, Units.inv_mul, one_apply]
right_inv x := by rw [← mul_apply, Units.mul_inv, one_apply]
theorem isHomeomorph_of_isUnit {T : M₁ →L[R₁] M₁} (hT : IsUnit T) : IsHomeomorph T := by
obtain ⟨T, rfl⟩ := hT
exact (homeomorphOfUnit T).isHomeomorph
section ApplyAction
variable [ContinuousAdd M₁]
/-- The tautological action by `M₁ →L[R₁] M₁` on `M`.
This generalizes `Function.End.applyMulAction`. -/
instance applyModule : Module (M₁ →L[R₁] M₁) M₁ :=
Module.compHom _ toLinearMapRingHom
@[simp]
protected theorem smul_def (f : M₁ →L[R₁] M₁) (a : M₁) : f • a = f a :=
rfl
/-- `ContinuousLinearMap.applyModule` is faithful. -/
instance applyFaithfulSMul : FaithfulSMul (M₁ →L[R₁] M₁) M₁ :=
⟨fun {_ _} => ContinuousLinearMap.ext⟩
instance applySMulCommClass : SMulCommClass R₁ (M₁ →L[R₁] M₁) M₁ where
smul_comm r e m := (e.map_smul r m).symm
instance applySMulCommClass' : SMulCommClass (M₁ →L[R₁] M₁) R₁ M₁ where
smul_comm := map_smul
instance continuousConstSMul_apply : ContinuousConstSMul (M₁ →L[R₁] M₁) M₁ :=
⟨ContinuousLinearMap.continuous⟩
end ApplyAction
theorem isClosed_ker [T1Space M₂] (f : M₁ →SL[σ₁₂] M₂) :
IsClosed (f.ker : Set M₁) :=
continuous_iff_isClosed.1 (map_continuous f) _ isClosed_singleton
theorem isComplete_ker {M' : Type*} [UniformSpace M'] [CompleteSpace M'] [AddCommMonoid M']
[Module R₁ M'] [T1Space M₂] (f : M' →SL[σ₁₂] M₂) :
IsComplete (f.ker : Set M') :=
(isClosed_ker f).isComplete
instance completeSpace_ker {M' : Type*} [UniformSpace M'] [CompleteSpace M']
[AddCommMonoid M'] [Module R₁ M'] [T1Space M₂]
(f : M' →SL[σ₁₂] M₂) : CompleteSpace f.ker :=
(isComplete_ker f).completeSpace_coe
instance completeSpace_eqLocus {M' : Type*} [UniformSpace M'] [CompleteSpace M']
[AddCommMonoid M'] [Module R₁ M'] [T2Space M₂]
(f g : M' →SL[σ₁₂] M₂) : CompleteSpace (LinearMap.eqLocus f g) :=
IsClosed.completeSpace_coe (hs := isClosed_eq (map_continuous f) (map_continuous g))
/-- Restrict codomain of a continuous linear map. -/
def codRestrict (f : M₁ →SL[σ₁₂] M₂) (p : Submodule R₂ M₂) (h : ∀ x, f x ∈ p) :
M₁ →SL[σ₁₂] p where
cont := f.continuous.subtype_mk _
toLinearMap := (f : M₁ →ₛₗ[σ₁₂] M₂).codRestrict p h
@[norm_cast]
theorem coe_codRestrict (f : M₁ →SL[σ₁₂] M₂) (p : Submodule R₂ M₂) (h : ∀ x, f x ∈ p) :
(f.codRestrict p h : M₁ →ₛₗ[σ₁₂] p) = (f : M₁ →ₛₗ[σ₁₂] M₂).codRestrict p h :=
rfl
@[simp]
theorem coe_codRestrict_apply (f : M₁ →SL[σ₁₂] M₂) (p : Submodule R₂ M₂) (h : ∀ x, f x ∈ p) (x) :
(f.codRestrict p h x : M₂) = f x :=
rfl
@[simp]
theorem ker_codRestrict (f : M₁ →SL[σ₁₂] M₂) (p : Submodule R₂ M₂) (h : ∀ x, f x ∈ p) :
ker (f.codRestrict p h : M₁ →ₛₗ[σ₁₂] p) = ker (f : M₁ →ₛₗ[σ₁₂] M₂) :=
(f : M₁ →ₛₗ[σ₁₂] M₂).ker_codRestrict p h
/-- Restrict the codomain of a continuous linear map `f` to `f.range`. -/
abbrev rangeRestrict [RingHomSurjective σ₁₂] (f : M₁ →SL[σ₁₂] M₂) :=
f.codRestrict (LinearMap.range (f : M₁ →ₛₗ[σ₁₂] M₂)) (LinearMap.mem_range_self _)
@[simp]
theorem coe_rangeRestrict [RingHomSurjective σ₁₂] (f : M₁ →SL[σ₁₂] M₂) :
(f.rangeRestrict : M₁ →ₛₗ[σ₁₂] LinearMap.range (f : M₁ →ₛₗ[σ₁₂] M₂)) =
(f : M₁ →ₛₗ[σ₁₂] M₂).rangeRestrict :=
rfl
/-- `Submodule.subtype` as a `ContinuousLinearMap`. -/
def _root_.Submodule.subtypeL (p : Submodule R₁ M₁) : p →L[R₁] M₁ where
cont := continuous_subtype_val
toLinearMap := p.subtype
@[simp, norm_cast]
theorem _root_.Submodule.coe_subtypeL (p : Submodule R₁ M₁) :
(p.subtypeL : p →ₗ[R₁] M₁) = p.subtype :=
rfl
@[simp]
theorem _root_.Submodule.coe_subtypeL' (p : Submodule R₁ M₁) : ⇑p.subtypeL = p.subtype :=
rfl
@[simp]
theorem _root_.Submodule.subtypeL_apply (p : Submodule R₁ M₁) (x : p) : p.subtypeL x = x :=
rfl
theorem _root_.Submodule.range_subtypeL (p : Submodule R₁ M₁) :
range (p.subtypeL : p →ₗ[R₁] M₁) = p :=
Submodule.range_subtype _
theorem _root_.Submodule.ker_subtypeL (p : Submodule R₁ M₁) : ker (p.subtypeL : p →ₗ[R₁] M₁) = ⊥ :=
Submodule.ker_subtype _
section
variable {R S : Type*} [Semiring R] [Semiring S] [Module R M₁] [Module R M₂] [Module R S]
[Module S M₂] [IsScalarTower R S M₂] [TopologicalSpace S] [ContinuousSMul S M₂]
/-- The linear map `fun x => c x • f`. Associates to a scalar-valued linear map and an element of
`M₂` the `M₂`-valued linear map obtained by multiplying the two (a.k.a. tensoring by `M₂`).
See also `ContinuousLinearMap.smulRightₗ` and `ContinuousLinearMap.smulRightL`. -/
@[simps coe]
def smulRight (c : M₁ →L[R] S) (f : M₂) : M₁ →L[R] M₂ :=
{ c.toLinearMap.smulRight f with cont := c.2.smul continuous_const }
@[simp]
theorem smulRight_apply {c : M₁ →L[R] S} {f : M₂} {x : M₁} :
(smulRight c f : M₁ → M₂) x = c x • f :=
rfl
@[simp]
lemma smulRight_zero (f : M₁ →L[R] S) : f.smulRight (0 : M₂) = 0 := by ext; simp
@[simp]
theorem zero_smulRight {x : M₂} : (0 : M₁ →L[R] S).smulRight x = 0 := by ext; simp
end
variable [Module R₁ M₂] [TopologicalSpace R₁] [ContinuousSMul R₁ M₂]
theorem smulRight_comp_smulRight {M₃ : Type*} [AddCommMonoid M₃] [Module R₁ M₃]
[TopologicalSpace M₃] [ContinuousSMul R₁ M₃] (f : M₃ →L[R₁] R₁) (g : M₁ →L[R₁] R₁) {x : M₂}
{y : M₃} : (smulRight f x).comp (smulRight g y) = smulRight g (f y • x) := by
ext
simp
@[deprecated (since := "2025-12-18")] alias smulRight_comp := smulRight_comp_smulRight
theorem range_smulRight_apply {R : Type*} [DivisionSemiring R] [Module R M₁] [Module R M₂]
[TopologicalSpace R] [ContinuousSMul R M₂] {f : M₁ →L[R] R} (hf : f ≠ 0) (x : M₂) :
range (f.smulRight x : M₁ →ₗ[R] M₂) = Submodule.span R {x} :=
LinearMap.range_smulRight_apply (by simpa [coe_inj, ← coe_zero] using hf) x
section ToSpanSingleton
variable (R₁)
variable [ContinuousSMul R₁ M₁]
/-- Given an element `x` of a topological space `M` over a semiring `R`, the natural continuous
linear map from `R` to `M` by taking multiples of `x`. -/
def toSpanSingleton (x : M₁) : R₁ →L[R₁] M₁ where
toLinearMap := LinearMap.toSpanSingleton R₁ M₁ x
cont := continuous_id.smul continuous_const
@[simp]
theorem toSpanSingleton_apply (x : M₁) (r : R₁) : toSpanSingleton R₁ x r = r • x :=
rfl
@[simp]
theorem toSpanSingleton_zero : toSpanSingleton R₁ (0 : M₁) = 0 := by ext; simp
theorem toSpanSingleton_apply_one (x : M₁) : toSpanSingleton R₁ x 1 = x :=
one_smul _ _
@[deprecated (since := "2025-12-05")] alias toSpanSingleton_one := toSpanSingleton_apply_one
@[simp] theorem toSpanSingleton_apply_map_one (c : R₁ →L[R₁] M₂) :
toSpanSingleton R₁ (c 1) = c := by
ext
simp [← ContinuousLinearMap.map_smul_of_tower]
@[deprecated (since := "2025-12-18")] alias smulRight_one_one := toSpanSingleton_apply_map_one
theorem toSpanSingleton_add [ContinuousAdd M₁] (x y : M₁) :
toSpanSingleton R₁ (x + y) = toSpanSingleton R₁ x + toSpanSingleton R₁ y :=
coe_inj.mp <| LinearMap.toSpanSingleton_add _ _
theorem toSpanSingleton_smul {α} [Monoid α] [DistribMulAction α M₁] [ContinuousConstSMul α M₁]
[SMulCommClass R₁ α M₁] (c : α) (x : M₁) :
toSpanSingleton R₁ (c • x) = c • toSpanSingleton R₁ x :=
coe_inj.mp <| LinearMap.toSpanSingleton_smul _ _
theorem smulRight_id : smulRight (.id R₁ R₁) = toSpanSingleton R₁ (M₁ := M₁) := rfl
theorem smulRight_one_eq_toSpanSingleton (x : M₁) :
(1 : R₁ →L[R₁] R₁).smulRight x = toSpanSingleton R₁ x :=
rfl
@[deprecated (since := "2025-12-05")] alias one_smulRight_eq_toSpanSingleton :=
smulRight_one_eq_toSpanSingleton
@[simp]
theorem toLinearMap_toSpanSingleton (x : M₁) :
(toSpanSingleton R₁ x).toLinearMap = LinearMap.toSpanSingleton R₁ M₁ x := rfl
variable {R₁}
theorem comp_toSpanSingleton (f : M₁ →L[R₁] M₂) (x : M₁) :
f ∘L toSpanSingleton R₁ x = toSpanSingleton R₁ (f x) :=
coe_inj.mp <| LinearMap.comp_toSpanSingleton _ _
omit [ContinuousSMul R₁ M₁] in
theorem toSpanSingleton_comp (f : M₁ →L[R₁] R₁) (g : M₂) :
toSpanSingleton R₁ g ∘L f = f.smulRight g := rfl
@[simp] theorem toSpanSingleton_inj {f f' : M₂} :
toSpanSingleton R₁ f = toSpanSingleton R₁ f' ↔ f = f' := by
simp [ContinuousLinearMap.ext_ring_iff]
@[deprecated (since := "2025-12-18")] alias smulRight_one_eq_iff := toSpanSingleton_inj
theorem toSpanSingleton_comp_toSpanSingleton [ContinuousMul R₁] {x : M₂} {c : R₁} :
(toSpanSingleton R₁ x).comp (toSpanSingleton R₁ c) =
toSpanSingleton R₁ (c • x) := smulRight_comp_smulRight 1 1
end ToSpanSingleton
end Semiring
section Ring
variable {R : Type*} [Ring R] {R₂ : Type*} [Ring R₂] {R₃ : Type*} [Ring R₃] {M : Type*}
[TopologicalSpace M] [AddCommGroup M] {M₂ : Type*} [TopologicalSpace M₂] [AddCommGroup M₂]
{M₃ : Type*} [TopologicalSpace M₃] [AddCommGroup M₃] {M₄ : Type*} [TopologicalSpace M₄]
[AddCommGroup M₄] [Module R M] [Module R₂ M₂] [Module R₃ M₃] {σ₁₂ : R →+* R₂} {σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
section
protected theorem map_neg (f : M →SL[σ₁₂] M₂) (x : M) : f (-x) = -f x := by
exact map_neg f x
protected theorem map_sub (f : M →SL[σ₁₂] M₂) (x y : M) : f (x - y) = f x - f y := by
exact map_sub f x y
@[simp]
theorem sub_apply' (f g : M →SL[σ₁₂] M₂) (x : M) : ((f : M →ₛₗ[σ₁₂] M₂) - g) x = f x - g x :=
rfl
end
section
variable [IsTopologicalAddGroup M₂]
instance neg : Neg (M →SL[σ₁₂] M₂) :=
⟨fun f => ⟨-f, f.2.neg⟩⟩
@[simp]
theorem neg_apply (f : M →SL[σ₁₂] M₂) (x : M) : (-f) x = -f x :=
rfl
@[simp, norm_cast]
theorem coe_neg (f : M →SL[σ₁₂] M₂) : (↑(-f) : M →ₛₗ[σ₁₂] M₂) = -f :=
rfl
@[norm_cast]
theorem coe_neg' (f : M →SL[σ₁₂] M₂) : ⇑(-f) = -f :=
rfl
@[simp, norm_cast]
theorem toContinuousAddMonoidHom_neg (f : M →SL[σ₁₂] M₂) :
↑(-f) = -(f : ContinuousAddMonoidHom M M₂) := rfl
instance sub : Sub (M →SL[σ₁₂] M₂) :=
⟨fun f g => ⟨f - g, f.2.sub g.2⟩⟩
instance addCommGroup : AddCommGroup (M →SL[σ₁₂] M₂) where
sub_eq_add_neg _ _ := by ext; apply sub_eq_add_neg
zsmul := (· • ·)
zsmul_zero' f := by ext; simp
zsmul_succ' n f := by ext; simp [add_smul, add_comm]
zsmul_neg' n f := by ext; simp [add_smul]
neg_add_cancel _ := by ext; apply neg_add_cancel
theorem sub_apply (f g : M →SL[σ₁₂] M₂) (x : M) : (f - g) x = f x - g x :=
rfl
@[simp, norm_cast]
theorem coe_sub (f g : M →SL[σ₁₂] M₂) : (↑(f - g) : M →ₛₗ[σ₁₂] M₂) = f - g :=
rfl
@[simp, norm_cast]
theorem coe_sub' (f g : M →SL[σ₁₂] M₂) : ⇑(f - g) = f - g :=
rfl
@[simp, norm_cast]
theorem toContinuousAddMonoidHom_sub (f g : M →SL[σ₁₂] M₂) :
↑(f - g) = (f - g : ContinuousAddMonoidHom M M₂) := rfl
end
@[simp]
theorem comp_neg [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [IsTopologicalAddGroup M₂]
[IsTopologicalAddGroup M₃] (g : M₂ →SL[σ₂₃] M₃) (f : M →SL[σ₁₂] M₂) :
g.comp (-f) = -g.comp f := by
ext x
simp
@[simp]
theorem neg_comp [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [IsTopologicalAddGroup M₃] (g : M₂ →SL[σ₂₃] M₃)
(f : M →SL[σ₁₂] M₂) : (-g).comp f = -g.comp f := by
ext
simp
@[simp]
theorem comp_sub [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [IsTopologicalAddGroup M₂]
[IsTopologicalAddGroup M₃] (g : M₂ →SL[σ₂₃] M₃) (f₁ f₂ : M →SL[σ₁₂] M₂) :
g.comp (f₁ - f₂) = g.comp f₁ - g.comp f₂ := by
ext
simp
@[simp]
theorem sub_comp [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [IsTopologicalAddGroup M₃] (g₁ g₂ : M₂ →SL[σ₂₃] M₃)
(f : M →SL[σ₁₂] M₂) : (g₁ - g₂).comp f = g₁.comp f - g₂.comp f := by
ext
simp
instance ring [IsTopologicalAddGroup M] : Ring (M →L[R] M) where
__ := ContinuousLinearMap.semiring
__ := ContinuousLinearMap.addCommGroup
intCast z := z • (1 : M →L[R] M)
intCast_ofNat := natCast_zsmul _
intCast_negSucc := negSucc_zsmul _
@[simp]
theorem intCast_apply [IsTopologicalAddGroup M] (z : ℤ) (m : M) : (↑z : M →L[R] M) m = z • m :=
rfl
theorem toSpanSingleton_pow [TopologicalSpace R] [IsTopologicalRing R] (c : R) (n : ℕ) :
toSpanSingleton R c ^ n = toSpanSingleton R (c ^ n) := by
induction n with
| zero => ext; simp
| succ n ihn =>
rw [pow_succ, ihn, mul_def, toSpanSingleton_comp_toSpanSingleton, smul_eq_mul, pow_succ']
@[deprecated (since := "2025-12-18")] alias smulRight_one_pow := toSpanSingleton_pow
section
variable {σ₂₁ : R₂ →+* R} [RingHomInvPair σ₁₂ σ₂₁]
/-- Given a right inverse `f₂ : M₂ →L[R] M` to `f₁ : M →L[R] M₂`,
`projKerOfRightInverse f₁ f₂ h` is the projection `M →L[R] LinearMap.ker f₁` along
`LinearMap.range f₂`. -/
def projKerOfRightInverse [IsTopologicalAddGroup M] (f₁ : M →SL[σ₁₂] M₂) (f₂ : M₂ →SL[σ₂₁] M)
(h : Function.RightInverse f₂ f₁) : M →L[R] LinearMap.ker (f₁ : M →ₛₗ[σ₁₂] M₂) :=
(.id R M - f₂.comp f₁).codRestrict (LinearMap.ker f₁.toLinearMap) fun x => by simp [h (f₁ x)]
@[simp]
theorem coe_projKerOfRightInverse_apply [IsTopologicalAddGroup M] (f₁ : M →SL[σ₁₂] M₂)
(f₂ : M₂ →SL[σ₂₁] M) (h : Function.RightInverse f₂ f₁) (x : M) :
(f₁.projKerOfRightInverse f₂ h x : M) = x - f₂ (f₁ x) :=
rfl
@[simp]
theorem projKerOfRightInverse_apply_idem [IsTopologicalAddGroup M] (f₁ : M →SL[σ₁₂] M₂)
(f₂ : M₂ →SL[σ₂₁] M) (h : Function.RightInverse f₂ f₁) (x : f₁.ker) :
f₁.projKerOfRightInverse f₂ h x = x := by
ext1
simp
@[simp]
theorem projKerOfRightInverse_comp_inv [IsTopologicalAddGroup M] (f₁ : M →SL[σ₁₂] M₂)
(f₂ : M₂ →SL[σ₂₁] M) (h : Function.RightInverse f₂ f₁) (y : M₂) :
f₁.projKerOfRightInverse f₂ h (f₂ y) = 0 :=
Subtype.ext_iff.2 <| by simp [h y]
end
end Ring
section DivisionRing
variable {R M : Type*}
/-- A nonzero continuous linear functional is open. -/