forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefs.lean
More file actions
639 lines (475 loc) Β· 25.2 KB
/
Copy pathDefs.lean
File metadata and controls
639 lines (475 loc) Β· 25.2 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
/-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Nathaniel Thomas, Jeremy Avigad, Johannes HΓΆlzl, Mario Carneiro, Anne Baanen,
FrΓ©dΓ©ric Dupuis, Heather Macbeth
-/
module
public import Mathlib.Algebra.Module.LinearMap.Defs
/-!
# (Semi)linear equivalences
In this file we define
* `LinearEquiv Ο M Mβ`, `M βββ[Ο] Mβ`: an invertible semilinear map. Here, `Ο` is a `RingHom`
from `R` to `Rβ` and an `e : M βββ[Ο] Mβ` satisfies `e (c β’ x) = (Ο c) β’ (e x)`. The plain
linear version, with `Ο` being `RingHom.id R`, is denoted by `M ββ[R] Mβ`, and the
star-linear version (with `Ο` being `starRingEnd`) is denoted by `M βββ[R] Mβ`.
## Implementation notes
To ensure that composition works smoothly for semilinear equivalences, we use the typeclasses
`RingHomCompTriple`, `RingHomInvPair` and `RingHomSurjective` from
`Algebra/Ring/CompTypeclasses`.
The group structure on automorphisms, `LinearEquiv.automorphismGroup`, is provided elsewhere.
## TODO
* Parts of this file have not yet been generalized to semilinear maps
## Tags
linear equiv, linear equivalences, linear isomorphism, linear isomorphic
-/
@[expose] public section
assert_not_exists Field Pi.module
open Function
variable {R Rβ Rβ Rβ Rβ S M Mβ Mβ Mβ Mβ Nβ Nβ : Type*}
section
/-- A linear equivalence is an invertible linear map. -/
structure LinearEquiv {R : Type*} {S : Type*} [Semiring R] [Semiring S] (Ο : R β+* S)
{Ο' : S β+* R} [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο] (M : Type*) (Mβ : Type*)
[AddCommMonoid M] [AddCommMonoid Mβ] [Module R M] [Module S Mβ] extends LinearMap Ο M Mβ, M β+ Mβ
attribute [coe] LinearEquiv.toLinearMap
/-- The linear map underlying a linear equivalence. -/
add_decl_doc LinearEquiv.toLinearMap
/-- The additive equivalence of types underlying a linear equivalence. -/
add_decl_doc LinearEquiv.toAddEquiv
/-- The backwards directed function underlying a linear equivalence. -/
add_decl_doc LinearEquiv.invFun
/-- `LinearEquiv.invFun` is a right inverse to the linear equivalence's underlying function. -/
add_decl_doc LinearEquiv.right_inv
/-- `LinearEquiv.invFun` is a left inverse to the linear equivalence's underlying function. -/
add_decl_doc LinearEquiv.left_inv
/-- `M βββ[Ο] Mβ` denotes the type of linear equivalences between `M` and `Mβ` over a
ring homomorphism `Ο`. -/
notation:50 M " βββ[" Ο "] " Mβ => LinearEquiv Ο M Mβ
/-- `M ββ[R] Mβ` denotes the type of linear equivalences between `M` and `Mβ` over
a plain linear map `M ββ Mβ`. -/
notation:50 M " ββ[" R "] " Mβ => LinearEquiv (RingHom.id R) M Mβ
/-- `SemilinearEquivClass F Ο M Mβ` asserts `F` is a type of bundled `Ο`-semilinear equivs
`M β Mβ`.
See also `LinearEquivClass 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 SemilinearEquivClass (F : Type*) {R S : outParam Type*} [Semiring R] [Semiring S]
(Ο : outParam <| R β+* S) {Ο' : outParam <| S β+* R} [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο]
(M Mβ : outParam Type*) [AddCommMonoid M] [AddCommMonoid Mβ] [Module R M] [Module S Mβ]
[EquivLike F M Mβ] : Prop
extends AddEquivClass F M Mβ where
/-- Applying a semilinear equivalence `f` over `Ο` to `r β’ x` equals `Ο r β’ f x`. -/
map_smulββ : β (f : F) (r : R) (x : M), f (r β’ x) = Ο r β’ f x
-- `R, S, Ο, Ο'` become metavars, but it's OK since they are outparams.
/-- `LinearEquivClass F R M Mβ` asserts `F` is a type of bundled `R`-linear equivs `M β Mβ`.
This is an abbreviation for `SemilinearEquivClass F (RingHom.id R) M Mβ`.
-/
abbrev LinearEquivClass (F : Type*) (R M Mβ : outParam Type*) [Semiring R] [AddCommMonoid M]
[AddCommMonoid Mβ] [Module R M] [Module R Mβ] [EquivLike F M Mβ] :=
SemilinearEquivClass F (RingHom.id R) M Mβ
end
namespace SemilinearEquivClass
variable (F : Type*) [Semiring R] [Semiring S]
variable [AddCommMonoid M] [AddCommMonoid Mβ] [AddCommMonoid Mβ]
variable [Module R M] [Module S Mβ] {Ο : R β+* S} {Ο' : S β+* R}
instance (priority := 100) [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο]
[EquivLike F M Mβ] [s : SemilinearEquivClass F Ο M Mβ] : SemilinearMapClass F Ο M Mβ :=
{ s with }
variable {F}
/-- Reinterpret an element of a type of semilinear equivalences as a semilinear equivalence. -/
@[coe]
def semilinearEquiv [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο]
[EquivLike F M Mβ] [SemilinearEquivClass F Ο M Mβ] (f : F) : M βββ[Ο] Mβ :=
{ (f : M β+ Mβ), (f : M βββ[Ο] Mβ) with }
end SemilinearEquivClass
namespace LinearEquiv
section AddCommMonoid
variable [Semiring R] [Semiring S]
section
variable [AddCommMonoid M] [AddCommMonoid Mβ] [AddCommMonoid Mβ]
-- See note [implicit instance arguments]
variable {modM : Module R M} {modMβ : Module S Mβ} {Ο : R β+* S} {Ο' : S β+* R}
variable [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο]
instance : Coe (M βββ[Ο] Mβ) (M βββ[Ο] Mβ) :=
β¨toLinearMapβ©
-- This exists for compatibility, previously `ββ[R]` extended `β` instead of `β+`.
/-- The equivalence of types underlying a linear equivalence. -/
def toEquiv (e : M βββ[Ο] Mβ) : M β Mβ := e.toAddEquiv.toEquiv
theorem toEquiv_injective :
(toEquiv (modM := modM) (modMβ := modMβ) : (M βββ[Ο] Mβ) β M β Mβ).Injective :=
fun β¨β¨β¨_, _β©, _β©, _, _, _β© β¨β¨β¨_, _β©, _β©, _, _, _β© h β¦
(LinearEquiv.mk.injEq _ _ _ _ _ _ _ _).mpr
β¨LinearMap.ext (congr_fun (Equiv.mk.inj h).1), (Equiv.mk.inj h).2β©
@[simp]
theorem toEquiv_inj {eβ eβ : M βββ[Ο] Mβ} : eβ.toEquiv = eβ.toEquiv β eβ = eβ :=
toEquiv_injective.eq_iff
theorem toLinearMap_injective : Injective (toLinearMap : (M βββ[Ο] Mβ) β M βββ[Ο] Mβ) :=
fun _ _ H β¦ toEquiv_injective <| Equiv.ext <| LinearMap.congr_fun H
@[simp, norm_cast]
theorem toLinearMap_inj {eβ eβ : M βββ[Ο] Mβ} : (βeβ : M βββ[Ο] Mβ) = eβ β eβ = eβ :=
toLinearMap_injective.eq_iff
instance : EquivLike (M βββ[Ο] Mβ) M Mβ where
coe e := e.toFun
inv := LinearEquiv.invFun
coe_injective' _ _ h _ := toLinearMap_injective (DFunLike.coe_injective h)
left_inv := LinearEquiv.left_inv
right_inv := LinearEquiv.right_inv
instance : SemilinearEquivClass (M βββ[Ο] Mβ) Ο M Mβ where
map_add := (Β·.map_add')
map_smulββ := (Β·.map_smul')
theorem toLinearMap_eq_coe {e : M βββ[Ο] Mβ} : e.toLinearMap = SemilinearMapClass.semilinearMap e :=
rfl
@[simp]
theorem coe_mk {f invFun left_inv right_inv} :
((β¨f, invFun, left_inv, right_invβ© : M βββ[Ο] Mβ) : M β Mβ) = f := rfl
theorem coe_injective : @Injective (M βββ[Ο] Mβ) (M β Mβ) DFunLike.coe :=
DFunLike.coe_injective
@[simp]
lemma _root_.SemilinearEquivClass.semilinearEquiv_apply {F : Type*} [EquivLike F M Mβ]
[SemilinearEquivClass F Ο M Mβ] (f : F) (x : M) :
SemilinearEquivClass.semilinearEquiv (Mβ := Mβ) f x = f x := rfl
end
section
variable [Semiring Rβ] [Semiring Rβ] [Semiring Rβ] [Semiring Rβ]
variable [AddCommMonoid M] [AddCommMonoid Mβ] [AddCommMonoid Mβ] [AddCommMonoid Mβ]
variable [AddCommMonoid Mβ]
variable [AddCommMonoid Nβ] [AddCommMonoid Nβ]
variable {module_M : Module R M} {module_S_Mβ : Module S Mβ} {Ο : R β+* S} {Ο' : S β+* R}
variable {reβ : RingHomInvPair Ο Ο'} {reβ : RingHomInvPair Ο' Ο}
variable (e e' : M βββ[Ο] Mβ)
@[simp, norm_cast]
theorem coe_coe : β(e : M βββ[Ο] Mβ) = e :=
rfl
@[simp]
theorem coe_toEquiv : β(e.toEquiv) = e :=
rfl
@[simp]
theorem coe_toLinearMap : βe.toLinearMap = e :=
rfl
theorem toFun_eq_coe : e.toFun = e := by dsimp
section
variable {e e'}
@[ext]
theorem ext (h : β x, e x = e' x) : e = e' :=
DFunLike.ext _ _ h
protected theorem congr_arg {x x'} : x = x' β e x = e x' :=
DFunLike.congr_arg e
protected theorem congr_fun (h : e = e') (x : M) : e x = e' x :=
DFunLike.congr_fun h x
end
section
variable (M R)
/-- The identity map is a linear equivalence. -/
@[refl]
def refl [Module R M] : M ββ[R] M :=
{ LinearMap.id, Equiv.refl M with }
end
@[simp]
theorem refl_apply [Module R M] (x : M) : refl R M x = x :=
rfl
/-- Linear equivalences are symmetric. -/
@[symm]
def symm (e : M βββ[Ο] Mβ) : Mβ βββ[Ο'] M :=
{ e.toLinearMap.inverse e.invFun e.left_inv e.right_inv,
e.toEquiv.symm with
toFun := e.toLinearMap.inverse e.invFun e.left_inv e.right_inv
invFun := e.toEquiv.symm.invFun
map_smul' r x := by rw [map_smulββ] }
/-- See Note [custom simps projection] -/
def Simps.apply {R : Type*} {S : Type*} [Semiring R] [Semiring S]
{Ο : R β+* S} {Ο' : S β+* R} [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο]
{M : Type*} {Mβ : Type*} [AddCommMonoid M] [AddCommMonoid Mβ] [Module R M] [Module S Mβ]
(e : M βββ[Ο] Mβ) : M β Mβ :=
e
/-- See Note [custom simps projection] -/
def Simps.symm_apply {R S : Type*} [Semiring R] [Semiring S]
{Ο : R β+* S} {Ο' : S β+* R} [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο]
{M Mβ : Type*} [AddCommMonoid M] [AddCommMonoid Mβ] [Module R M] [Module S Mβ]
(e : M βββ[Ο] Mβ) : Mβ β M :=
e.symm
initialize_simps_projections LinearEquiv (toFun β apply, invFun β symm_apply)
@[simp]
theorem invFun_eq_symm : e.invFun = e.symm :=
rfl
theorem coe_toEquiv_symm : e.toEquiv.symm = e.symm := rfl
@[simp]
theorem toEquiv_symm : e.symm.toEquiv = e.toEquiv.symm :=
rfl
@[simp]
theorem coe_symm_toEquiv : βe.toEquiv.symm = e.symm := rfl
variable {module_Mβ : Module Rβ Mβ} {module_Mβ : Module Rβ Mβ} {module_Mβ : Module Rβ Mβ}
variable {module_Mβ : Module Rβ Mβ} {module_Nβ : Module Rβ Nβ} {module_Nβ : Module Rβ Nβ}
variable {Οββ : Rβ β+* Rβ} {Οββ : Rβ β+* Rβ}
variable {Οββ : Rβ β+* Rβ} {Οββ : Rβ β+* Rβ} [RingHomInvPair Οββ Οββ] [RingHomInvPair Οββ Οββ]
variable {Οββ : Rβ β+* Rβ} {Οββ : Rβ β+* Rβ} [RingHomInvPair Οββ Οββ] [RingHomInvPair Οββ Οββ]
variable {Οββ : Rβ β+* Rβ} {Οββ : Rβ β+* Rβ}
variable {Οββ : Rβ β+* Rβ} {Οββ : Rβ β+* Rβ} [RingHomInvPair Οββ Οββ] [RingHomInvPair Οββ Οββ]
variable {Οββ : Rβ β+* Rβ} {Οββ : Rβ β+* Rβ} [RingHomInvPair Οββ Οββ] [RingHomInvPair Οββ Οββ]
variable {reββ : RingHomInvPair Οββ Οββ} {reββ : RingHomInvPair Οββ Οββ}
variable {reββ : RingHomInvPair Οββ Οββ} {reββ : RingHomInvPair Οββ Οββ}
variable [RingHomCompTriple Οββ Οββ Οββ] [RingHomCompTriple Οββ Οββ Οββ]
variable [RingHomCompTriple Οββ Οββ Οββ] [RingHomCompTriple Οββ Οββ Οββ]
variable [RingHomCompTriple Οββ Οββ Οββ] [RingHomCompTriple Οββ Οββ Οββ]
variable [RingHomCompTriple Οββ Οββ Οββ] [RingHomCompTriple Οββ Οββ Οββ]
variable (eββ : Mβ βββ[Οββ] Mβ) (eββ : Mβ βββ[Οββ] Mβ)
set_option linter.overlappingInstances false in
/-- Linear equivalences are transitive. -/
-- Note: the `RingHomCompTriple Οββ Οββ Οββ` is unused, but is convenient to carry around
-- implicitly for lemmas like `LinearEquiv.self_trans_symm`.
@[trans, nolint unusedArguments]
def trans
[RingHomCompTriple Οββ Οββ Οββ] [RingHomCompTriple Οββ Οββ Οββ]
{reββ : RingHomInvPair Οββ Οββ} {reββ : RingHomInvPair Οββ Οββ}
[RingHomInvPair Οββ Οββ] {reββ : RingHomInvPair Οββ Οββ}
{reββ : RingHomInvPair Οββ Οββ} [RingHomInvPair Οββ Οββ]
(eββ : Mβ βββ[Οββ] Mβ) (eββ : Mβ βββ[Οββ] Mβ) : Mβ βββ[Οββ] Mβ :=
{ eββ.toLinearMap.comp eββ.toLinearMap, eββ.toEquiv.trans eββ.toEquiv with }
/-- `eβ βͺβ«β eβ` denotes the composition of the linear equivalences `eβ` and `eβ`. -/
notation3:80 (name := transNotation) eβ:80 " βͺβ«β " eβ:81 =>
@LinearEquiv.trans _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ (RingHom.id _) (RingHom.id _) (RingHom.id _)
(RingHom.id _) (RingHom.id _) (RingHom.id _) RingHomCompTriple.ids RingHomCompTriple.ids
RingHomInvPair.ids RingHomInvPair.ids RingHomInvPair.ids RingHomInvPair.ids RingHomInvPair.ids
RingHomInvPair.ids eβ eβ
/-- `LinearEquiv.symm` defines an equivalence between `Ξ± βββ[Ο] Ξ²` and `Ξ² βββ[Ο] Ξ±`. -/
@[simps!]
def symmEquiv : (M βββ[Ο] Mβ) β (Mβ βββ[Ο'] M) where
toFun := .symm
invFun := .symm
variable {eββ} {eββ}
theorem coe_toAddEquiv : e.toAddEquiv = e :=
rfl
@[simp]
lemma coe_addEquiv_apply (x : M) : (e : M β+ Mβ) x = e x :=
rfl
/-- The two paths coercion can take to an `AddMonoidHom` are equivalent -/
theorem toAddMonoidHom_commutes : e.toLinearMap.toAddMonoidHom = e.toAddEquiv.toAddMonoidHom :=
rfl
lemma coe_toAddEquiv_symm : (eββ.symm : Mβ β+ Mβ) = (eββ : Mβ β+ Mβ).symm :=
rfl
@[simp]
theorem trans_apply (c : Mβ) : (eββ.trans eββ : Mβ βββ[Οββ] Mβ) c = eββ (eββ c) :=
rfl
theorem coe_trans :
(eββ.trans eββ : Mβ βββ[Οββ] Mβ) = (eββ : Mβ βββ[Οββ] Mβ).comp (eββ : Mβ βββ[Οββ] Mβ) :=
rfl
@[simp]
theorem apply_symm_apply (c : Mβ) : e (e.symm c) = c :=
e.right_inv c
@[simp]
theorem symm_apply_apply (b : M) : e.symm (e b) = b :=
e.left_inv b
theorem comp_symm : e.toLinearMap βββ e.symm.toLinearMap = LinearMap.id :=
LinearMap.ext e.apply_symm_apply
theorem symm_comp : e.symm.toLinearMap βββ e.toLinearMap = LinearMap.id :=
LinearMap.ext e.symm_apply_apply
@[simp]
lemma comp_symm_assoc (f : Mβ βββ[Οββ] Mβ) [RingHomCompTriple Οββ Οββ Οββ] :
eββ.toLinearMap βββ eββ.symm.toLinearMap βββ f = f := by ext; simp
@[simp]
lemma symm_comp_assoc (f : Mβ βββ[Οββ] Mβ) [RingHomCompTriple Οββ Οββ Οββ] :
eββ.symm.toLinearMap βββ eββ.toLinearMap βββ f = f := by ext; simp
@[simp]
theorem trans_symm : (eββ.trans eββ : Mβ βββ[Οββ] Mβ).symm = eββ.symm.trans eββ.symm :=
rfl
theorem symm_trans_apply (c : Mβ) :
(eββ.trans eββ : Mβ βββ[Οββ] Mβ).symm c = eββ.symm (eββ.symm c) :=
rfl
@[simp]
theorem trans_refl : e.trans (refl S Mβ) = e :=
toEquiv_injective e.toEquiv.trans_refl
@[simp]
theorem refl_trans : (refl R M).trans e = e :=
toEquiv_injective e.toEquiv.refl_trans
theorem symm_apply_eq {x y} : e.symm x = y β x = e y :=
e.toEquiv.symm_apply_eq
theorem eq_symm_apply {x y} : y = e.symm x β e y = x :=
e.toEquiv.eq_symm_apply
theorem eq_comp_symm {Ξ± : Type*} (f : Mβ β Ξ±) (g : Mβ β Ξ±) : f = g β eββ.symm β f β eββ = g :=
eββ.toEquiv.eq_comp_symm f g
theorem comp_symm_eq {Ξ± : Type*} (f : Mβ β Ξ±) (g : Mβ β Ξ±) : g β eββ.symm = f β g = f β eββ :=
eββ.toEquiv.comp_symm_eq f g
theorem eq_symm_comp {Ξ± : Type*} (f : Ξ± β Mβ) (g : Ξ± β Mβ) : f = eββ.symm β g β eββ β f = g :=
eββ.toEquiv.eq_symm_comp f g
theorem symm_comp_eq {Ξ± : Type*} (f : Ξ± β Mβ) (g : Ξ± β Mβ) : eββ.symm β g = f β g = eββ β f :=
eββ.toEquiv.symm_comp_eq f g
@[simp]
theorem comp_coe (f : Mβ βββ[Οββ] Mβ) (f' : Mβ βββ[Οββ] Mβ) :
(f' : Mβ βββ[Οββ] Mβ).comp (f : Mβ βββ[Οββ] Mβ) = (f.trans f' : Mβ βββ[Οββ] Mβ) :=
rfl
lemma trans_assoc (eββ : Mβ βββ[Οββ] Mβ) (eββ : Mβ βββ[Οββ] Mβ) (eββ : Mβ βββ[Οββ] Mβ) :
(eββ.trans eββ).trans eββ = eββ.trans (eββ.trans eββ) := rfl
variable [RingHomCompTriple Οββ Οββ Οββ] [RingHomCompTriple Οββ Οββ Οββ]
theorem eq_comp_toLinearMap_symm (f : Mβ βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) :
f = g.comp eββ.symm.toLinearMap β f.comp eββ.toLinearMap = g := by
constructor <;> intro H <;> ext
Β· simp [H]
Β· simp [β H]
theorem comp_toLinearMap_symm_eq (f : Mβ βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) :
g.comp eββ.symm.toLinearMap = f β g = f.comp eββ.toLinearMap := by
constructor <;> intro H <;> ext
Β· simp [β H]
Β· simp [H]
theorem eq_toLinearMap_symm_comp (f : Mβ βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) :
f = eββ.symm.toLinearMap.comp g β eββ.toLinearMap.comp f = g := by
constructor <;> intro H <;> ext
Β· simp [H]
Β· simp [β H]
theorem toLinearMap_symm_comp_eq (f : Mβ βββ[Οββ] Mβ) (g : Mβ βββ[Οββ] Mβ) :
eββ.symm.toLinearMap.comp g = f β g = eββ.toLinearMap.comp f := by
constructor <;> intro H <;> ext
Β· simp [β H]
Β· simp [H]
@[simp]
theorem comp_toLinearMap_eq_iff (f g : Mβ βββ[Οββ] Mβ) :
eββ.toLinearMap.comp f = eββ.toLinearMap.comp g β f = g := by
refine β¨fun h => ?_, congrArg eββ.compβ©
rw [β (toLinearMap_symm_comp_eq g (eββ.toLinearMap.comp f)).mpr h, eq_toLinearMap_symm_comp]
@[simp]
theorem eq_comp_toLinearMap_iff (f g : Mβ βββ[Οββ] Mβ) :
f.comp eββ.toLinearMap = g.comp eββ.toLinearMap β f = g := by
refine β¨fun h => ?_, fun a β¦ congrFun (congrArg LinearMap.comp a) eββ.toLinearMapβ©
rw [(eq_comp_toLinearMap_symm g (f.comp eββ.toLinearMap)).mpr h.symm, eq_comp_toLinearMap_symm]
lemma comp_symm_cancel_left (e : Mβ βββ[Οββ] Mβ) (f : Mβ βββ[Οββ] Mβ) :
e.toLinearMap βββ (e.symm.toLinearMap βββ f) = f := by ext; simp
lemma symm_comp_cancel_left (e : Mβ βββ[Οββ] Mβ) (f : Mβ βββ[Οββ] Mβ) :
e.symm.toLinearMap βββ (e.toLinearMap βββ f) = f := by ext; simp
lemma comp_symm_cancel_right (e : Mβ βββ[Οββ] Mβ) (f : Mβ βββ[Οββ] Mβ) :
(f βββ e.toLinearMap) βββ e.symm.toLinearMap = f := by ext; simp
lemma symm_comp_cancel_right (e : Mβ βββ[Οββ] Mβ) (f : Mβ βββ[Οββ] Mβ) :
(f βββ e.symm.toLinearMap) βββ e.toLinearMap = f := by ext; simp
lemma trans_symm_cancel_left (e : Mβ βββ[Οββ] Mβ) (f : Mβ βββ[Οββ] Mβ) :
e.trans (e.symm.trans f) = f := by ext; simp
lemma symm_trans_cancel_left (e : Mβ βββ[Οββ] Mβ) (f : Mβ βββ[Οββ] Mβ) :
e.symm.trans (e.trans f) = f := by ext; simp
lemma trans_symm_cancel_right (e : Mβ βββ[Οββ] Mβ) (f : Mβ βββ[Οββ] Mβ) :
(f.trans e).trans e.symm = f := by ext; simp
lemma symm_trans_cancel_right (e : Mβ βββ[Οββ] Mβ) (f : Mβ βββ[Οββ] Mβ) :
(f.trans e.symm).trans e = f := by ext; simp
@[simp]
theorem refl_symm [Module R M] : (refl R M).symm = LinearEquiv.refl R M :=
rfl
@[simp]
theorem self_trans_symm (f : Mβ βββ[Οββ] Mβ) : f.trans f.symm = LinearEquiv.refl Rβ Mβ := by
ext x
simp
@[simp]
theorem symm_trans_self (f : Mβ βββ[Οββ] Mβ) : f.symm.trans f = LinearEquiv.refl Rβ Mβ := by
ext x
simp
@[simp]
theorem refl_toLinearMap [Module R M] : (LinearEquiv.refl R M : M ββ[R] M) = LinearMap.id :=
rfl
@[simp]
theorem mk_coe (f hβ hβ) : (LinearEquiv.mk e f hβ hβ : M βββ[Ο] Mβ) = e :=
ext fun _ β¦ rfl
protected theorem map_add (a b : M) : e (a + b) = e a + e b :=
map_add e a b
protected theorem map_zero : e 0 = 0 :=
map_zero e
protected theorem map_smulββ (c : R) (x : M) : e (c β’ x) = (Ο : R β S) c β’ e x :=
e.map_smul' c x
theorem map_smul (e : Nβ ββ[Rβ] Nβ) (c : Rβ) (x : Nβ) : e (c β’ x) = c β’ e x :=
map_smulββ e c x
theorem map_eq_zero_iff {x : M} : e x = 0 β x = 0 :=
e.toAddEquiv.map_eq_zero_iff
theorem map_ne_zero_iff {x : M} : e x β 0 β x β 0 :=
e.toAddEquiv.map_ne_zero_iff
@[simp]
theorem symm_symm (e : M βββ[Ο] Mβ) : e.symm.symm = e := rfl
theorem symm_bijective [Module R M] [Module S Mβ] [RingHomInvPair Ο' Ο] [RingHomInvPair Ο Ο'] :
Function.Bijective (symm : (M βββ[Ο] Mβ) β Mβ βββ[Ο'] M) :=
Function.bijective_iff_has_inverse.mpr β¨_, symm_symm, symm_symmβ©
@[simp]
theorem mk_coe' (f hβ hβ hβ hβ) :
(LinearEquiv.mk β¨β¨f, hββ©, hββ© (βe) hβ hβ : Mβ βββ[Ο'] M) = e.symm :=
symm_bijective.injective <| ext fun _ β¦ rfl
@[simp]
theorem symm_mk (toLinearMap invFun hβ hβ) : dsimp%
(mk toLinearMap invFun hβ hβ : M βββ[Ο] Mβ).symm =
{ (mk toLinearMap invFun hβ hβ : M βββ[Ο] Mβ).symm with
toFun := invFun
invFun := toLinearMap } :=
rfl
/-- For a more powerful version, see `coe_symm_mk'`. -/
theorem coe_symm_mk [Module R M] [Module R Mβ]
{to_fun inv_fun map_add map_smul left_inv right_inv} :
β(β¨β¨β¨to_fun, map_addβ©, map_smulβ©, inv_fun, left_inv, right_invβ© : M ββ[R] Mβ).symm = inv_fun :=
rfl
@[simp]
theorem coe_symm_mk' [Module R M] [Module R Mβ]
{f inv_fun left_inv right_inv} :
β(β¨f, inv_fun, left_inv, right_invβ© : M ββ[R] Mβ).symm = inv_fun :=
rfl
protected theorem bijective : Function.Bijective e :=
e.toEquiv.bijective
protected theorem injective : Function.Injective e :=
e.toEquiv.injective
protected theorem surjective : Function.Surjective e :=
e.toEquiv.surjective
protected theorem image_eq_preimage_symm (s : Set M) : e '' s = e.symm β»ΒΉ' s :=
e.toEquiv.image_eq_preimage_symm s
protected theorem image_symm_eq_preimage (s : Set Mβ) : e.symm '' s = e β»ΒΉ' s :=
e.toEquiv.symm.image_eq_preimage_symm s
end
/-- `Equiv.cast (congrArg _ h)` as a linear equiv.
Note that unlike `Equiv.cast`, this takes an equality of indices rather than an equality of types,
to avoid having to deal with an equality of the algebraic structure itself. -/
@[simps!]
protected def cast {ΞΉ : Type*} {M : ΞΉ β Type*}
[β i, AddCommMonoid (M i)] [β i, Module R (M i)] {i j : ΞΉ} (h : i = j) :
M i ββ[R] M j where
toAddEquiv := AddEquiv.cast h
map_smul' _ _ := by cases h; rfl
/-- Interpret a `RingEquiv` `f` as an `f`-semilinear equiv. -/
@[simps]
def _root_.RingEquiv.toSemilinearEquiv (f : R β+* S) :
haveI := RingHomInvPair.of_ringEquiv f
haveI := RingHomInvPair.symm (βf : R β+* S) (f.symm : S β+* R)
R βββ[(βf : R β+* S)] S :=
haveI := RingHomInvPair.of_ringEquiv f
haveI := RingHomInvPair.symm (βf : R β+* S) (f.symm : S β+* R)
{ f with
toFun := f
map_smul' := f.map_mul }
@[simp]
lemma _root_.RingEquiv.symm_toSemilinearEquiv_symm_apply (f : R β+* S) (x : R) :
f.symm.toSemilinearEquiv.symm (Ο' := RingHomClass.toRingHom f) x = f x := rfl
variable [AddCommMonoid M]
/-- An involutive linear map is a linear equivalence. -/
def ofInvolutive {Ο Ο' : R β+* R} [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο]
{_ : Module R M} (f : M βββ[Ο] M) (hf : Involutive f) : M βββ[Ο] M :=
{ f, hf.toPerm f with }
@[simp]
theorem coe_ofInvolutive {Ο Ο' : R β+* R} [RingHomInvPair Ο Ο'] [RingHomInvPair Ο' Ο]
{_ : Module R M} (f : M βββ[Ο] M) (hf : Involutive f) : β(ofInvolutive f hf) = f :=
rfl
end AddCommMonoid
section smul
variable {S R V W G : Type*} [Semiring R] [Semiring S]
[AddCommMonoid V] [Module R V] [Module S V]
[AddCommMonoid W] [Module R W] [Module S W]
[AddCommMonoid G] [Module R G] [Module S G]
[SMulCommClass R S W] [SMul S R] [IsScalarTower S R V] [IsScalarTower S R W]
/-- Left scalar multiplication of a unit and a linear equivalence, as a linear equivalence. -/
instance : SMul SΛ£ (V ββ[R] W) where smul Ξ± e :=
{ __ := (Ξ± : S) β’ e.toLinearMap
invFun x := (βΞ±β»ΒΉ : S) β’ e.symm x
left_inv _ := by simp [LinearMapClass.map_smul_of_tower e.symm, smul_smul]
right_inv _ := by simp [smul_smul] }
@[simp] theorem smul_apply (Ξ± : SΛ£) (e : V ββ[R] W) (x : V) : (Ξ± β’ e) x = (Ξ± : S) β’ e x := rfl
theorem symm_smul_apply (e : V ββ[R] W) (Ξ± : SΛ£) (x : W) :
(Ξ± β’ e).symm x = (βΞ±β»ΒΉ : S) β’ e.symm x := rfl
@[simp] theorem symm_smul [SMulCommClass R S V] (e : V ββ[R] W) (Ξ± : SΛ£) :
(Ξ± β’ e).symm = Ξ±β»ΒΉ β’ e.symm := rfl
@[simp] theorem toLinearMap_smul (e : V ββ[R] W) (Ξ± : SΛ£) :
(Ξ± β’ e).toLinearMap = (Ξ± : S) β’ e.toLinearMap := rfl
theorem smul_trans [SMulCommClass R S V] [IsScalarTower S R G]
(Ξ± : SΛ£) (e : G ββ[R] V) (f : V ββ[R] W) :
(Ξ± β’ e).trans f = Ξ± β’ (e.trans f) := by ext; simp [LinearMapClass.map_smul_of_tower f]
theorem trans_smul [IsScalarTower S R G]
(Ξ± : SΛ£) (e : G ββ[R] V) (f : V ββ[R] W) :
e.trans (Ξ± β’ f) = Ξ± β’ (e.trans f) := by ext; simp
end smul
end LinearEquiv