@@ -3,6 +3,7 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov
5
5
-/
6
+ import algebra.algebra.basic
6
7
import linear_algebra.basic
7
8
8
9
/-!
@@ -100,18 +101,81 @@ instance : add_comm_group (quotient p) :=
100
101
refl },
101
102
gsmul_neg' := by { rintros n ⟨x⟩, simp_rw [gsmul_neg_succ_of_nat, gsmul_coe_nat], refl }, }
102
103
103
- instance : has_scalar R (quotient p) :=
104
- ⟨λ a x, quotient.lift_on' x (λ x, mk (a • x)) $
105
- λ x y h, (quotient.eq p).2 $ by simpa [smul_sub] using smul_mem p a h⟩
104
+ section has_scalar
106
105
107
- @[simp] theorem mk_smul : (mk (r • x) : quotient p) = r • mk x := rfl
106
+ variables {S : Type *} [has_scalar S R] [has_scalar S M] [is_scalar_tower S R M] (P : submodule R M)
108
107
109
- @[simp] theorem mk_nsmul (n : ℕ) : (mk (n • x) : quotient p) = n • mk x := rfl
108
+ instance has_scalar' : has_scalar S (quotient P) :=
109
+ ⟨λ a, quotient.map' ((•) a) $ λ x y h, by simpa [smul_sub] using P.smul_mem (a • 1 : R) h⟩
110
110
111
- instance : module R (quotient p) :=
112
- module.of_core $ by refine {smul := (•), ..};
113
- repeat {rintro ⟨⟩ <|> intro}; simp [smul_add, add_smul, smul_smul,
114
- -mk_add, (mk_add p).symm, -mk_smul, (mk_smul p).symm]
111
+ /-- Shortcut to help the elaborator in the common case. -/
112
+ instance has_scalar : has_scalar R (quotient P) :=
113
+ quotient.has_scalar' P
114
+
115
+ @[simp] theorem mk_smul (r : S) (x : M) : (mk (r • x) : quotient P) = r • mk x := rfl
116
+
117
+ instance (T : Type *) [has_scalar T R] [has_scalar T M] [is_scalar_tower T R M]
118
+ [smul_comm_class S T M] : smul_comm_class S T P.quotient :=
119
+ { smul_comm := λ x y, quotient.ind' $ by exact λ z, congr_arg mk (smul_comm _ _ _) }
120
+
121
+ instance (T : Type *) [has_scalar T R] [has_scalar T M] [is_scalar_tower T R M] [has_scalar S T]
122
+ [is_scalar_tower S T M] : is_scalar_tower S T P.quotient :=
123
+ { smul_assoc := λ x y, quotient.ind' $ by exact λ z, congr_arg mk (smul_assoc _ _ _) }
124
+
125
+ end has_scalar
126
+
127
+ section module
128
+
129
+ variables {S : Type *}
130
+
131
+ instance mul_action' [monoid S] [has_scalar S R] [mul_action S M] [is_scalar_tower S R M]
132
+ (P : submodule R M) : mul_action S (quotient P) :=
133
+ function.surjective.mul_action mk (surjective_quot_mk _) P^.quotient.mk_smul
134
+
135
+ instance mul_action (P : submodule R M) : mul_action R (quotient P) :=
136
+ quotient.mul_action' P
137
+
138
+ instance distrib_mul_action' [monoid S] [has_scalar S R] [distrib_mul_action S M]
139
+ [is_scalar_tower S R M]
140
+ (P : submodule R M) : distrib_mul_action S (quotient P) :=
141
+ function.surjective.distrib_mul_action
142
+ ⟨mk, rfl, λ _ _, rfl⟩ (surjective_quot_mk _) P^.quotient.mk_smul
143
+
144
+ instance distrib_mul_action (P : submodule R M) : distrib_mul_action R (quotient P) :=
145
+ quotient.distrib_mul_action' P
146
+
147
+ instance module' [semiring S] [has_scalar S R] [module S M] [is_scalar_tower S R M]
148
+ (P : submodule R M) : module S (quotient P) :=
149
+ function.surjective.module _
150
+ ⟨mk, rfl, λ _ _, rfl⟩ (surjective_quot_mk _) P^.quotient.mk_smul
151
+
152
+ instance module (P : submodule R M) : module R (quotient P) :=
153
+ quotient.module' P
154
+
155
+ variables (S)
156
+
157
+ /-- The quotient of `P` as an `S`-submodule is the same as the quotient of `P` as an `R`-submodule,
158
+ where `P : submodule R M`.
159
+ -/
160
+ def restrict_scalars_equiv [ring S] [has_scalar S R] [module S M] [is_scalar_tower S R M]
161
+ (P : submodule R M) :
162
+ (P.restrict_scalars S).quotient ≃ₗ[S] P.quotient :=
163
+ { map_add' := λ x y, quotient.induction_on₂' x y (λ x' y', rfl),
164
+ map_smul' := λ c x, quotient.induction_on' x (λ x', rfl),
165
+ ..quotient.congr_right $ λ _ _, iff.rfl }
166
+
167
+ @[simp] lemma restrict_scalars_equiv_mk
168
+ [ring S] [has_scalar S R] [module S M] [is_scalar_tower S R M] (P : submodule R M)
169
+ (x : M) : restrict_scalars_equiv S P (mk x) = mk x :=
170
+ rfl
171
+
172
+ @[simp] lemma restrict_scalars_equiv_symm_mk
173
+ [ring S] [has_scalar S R] [module S M] [is_scalar_tower S R M] (P : submodule R M)
174
+ (x : M) : (restrict_scalars_equiv S P).symm (mk x) = mk x :=
175
+ rfl
176
+
177
+
178
+ end module
115
179
116
180
lemma mk_surjective : function.surjective (@mk _ _ _ _ _ p) :=
117
181
by { rintros ⟨x⟩, exact ⟨x, rfl⟩ }
0 commit comments