This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
/
ulift.lean
99 lines (78 loc) · 3.3 KB
/
ulift.lean
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
/-
Copyright (c) 2020 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
import linear_algebra.basic
import algebra.ring.ulift
/-!
# `ulift` instances for module and multiplicative actions
This file defines instances for module, mul_action and related structures on `ulift` types.
(Recall `ulift α` is just a "copy" of a type `α` in a higher universe.)
We also provide `ulift.semimodule_equiv : ulift M ≃ₗ[R] M`.
-/
namespace ulift
universes u v w
variable {R : Type u}
variable {M : Type v}
variable {N : Type w}
instance has_scalar [has_scalar R M] :
has_scalar (ulift R) M :=
⟨λ s x, s.down • x⟩
@[simp] lemma smul_down [has_scalar R M] (s : ulift R) (x : M) : (s • x) = s.down • x := rfl
instance has_scalar' [has_scalar R M] :
has_scalar R (ulift M) :=
⟨λ s x, ⟨s • x.down⟩⟩
@[simp]
lemma smul_down' [has_scalar R M] (s : R) (x : ulift M) :
(s • x).down = s • x.down :=
rfl
instance is_scalar_tower [has_scalar R M] [has_scalar M N] [has_scalar R N]
[is_scalar_tower R M N] : is_scalar_tower (ulift R) M N :=
⟨λ x y z, show (x.down • y) • z = x.down • y • z, from smul_assoc _ _ _⟩
instance is_scalar_tower' [has_scalar R M] [has_scalar M N] [has_scalar R N]
[is_scalar_tower R M N] : is_scalar_tower R (ulift M) N :=
⟨λ x y z, show (x • y.down) • z = x • y.down • z, from smul_assoc _ _ _⟩
instance is_scalar_tower'' [has_scalar R M] [has_scalar M N] [has_scalar R N]
[is_scalar_tower R M N] : is_scalar_tower R M (ulift N) :=
⟨λ x y z, show up ((x • y) • z.down) = ⟨x • y • z.down⟩, by rw smul_assoc⟩
instance mul_action [monoid R] [mul_action R M] :
mul_action (ulift R) M :=
{ smul := (•),
mul_smul := λ r s f, by { cases r, cases s, simp [mul_smul], },
one_smul := λ f, by { simp [one_smul], } }
instance mul_action' [monoid R] [mul_action R M] :
mul_action R (ulift M) :=
{ smul := (•),
mul_smul := λ r s f, by { cases f, ext, simp [mul_smul], },
one_smul := λ f, by { ext, simp [one_smul], } }
instance distrib_mul_action [monoid R] [add_monoid M] [distrib_mul_action R M] :
distrib_mul_action (ulift R) M :=
{ smul_zero := λ c, by { cases c, simp [smul_zero], },
smul_add := λ c f g, by { cases c, simp [smul_add], },
..ulift.mul_action }
instance distrib_mul_action' [monoid R] [add_monoid M] [distrib_mul_action R M] :
distrib_mul_action R (ulift M) :=
{ smul_zero := λ c, by { ext, simp [smul_zero], },
smul_add := λ c f g, by { ext, simp [smul_add], },
..ulift.mul_action' }
instance semimodule [semiring R] [add_comm_monoid M] [semimodule R M] :
semimodule (ulift R) M :=
{ add_smul := λ c f g, by { cases c, simp [add_smul], },
zero_smul := λ f, by { simp [zero_smul], },
..ulift.distrib_mul_action }
instance semimodule' [semiring R] [add_comm_monoid M] [semimodule R M] :
semimodule R (ulift M) :=
{ add_smul := by { intros, ext1, apply add_smul },
zero_smul := by { intros, ext1, apply zero_smul } }
/--
The `R`-linear equivalence between `ulift M` and `M`.
-/
def semimodule_equiv [semiring R] [add_comm_monoid M] [semimodule R M] : ulift M ≃ₗ[R] M :=
{ to_fun := ulift.down,
inv_fun := ulift.up,
map_smul' := λ r x, rfl,
map_add' := λ x y, rfl,
left_inv := by tidy,
right_inv := by tidy, }
end ulift