Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 5b72c4e

Browse files
committed
feat(linear_algebra/quotient): S.restrict_scalars.quotient is S.quotient (#9535)
This PR adds a more general module instance on submodule quotients, in order to show that `(S.restrict_scalars R).quotient` is equivalent to `S.quotient`. If we decide this instance is not a good idea, I can write it instead as `S.quotient.restrict_scalars`, but that is a bit less convenient to work with. Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
1 parent 9be8247 commit 5b72c4e

File tree

4 files changed

+91
-16
lines changed

4 files changed

+91
-16
lines changed

src/linear_algebra/quotient.lean

Lines changed: 73 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Johannes Hölzl, Mario Carneiro, Kevin Buzzard, Yury Kudryashov
55
-/
6+
import algebra.algebra.basic
67
import linear_algebra.basic
78

89
/-!
@@ -100,18 +101,81 @@ instance : add_comm_group (quotient p) :=
100101
refl },
101102
gsmul_neg' := by { rintros n ⟨x⟩, simp_rw [gsmul_neg_succ_of_nat, gsmul_coe_nat], refl }, }
102103

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
106105

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)
108107

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⟩
110110

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
115179

116180
lemma mk_surjective : function.surjective (@mk _ _ _ _ _ p) :=
117181
by { rintros ⟨x⟩, exact ⟨x, rfl⟩ }

src/ring_theory/adjoin_root.lean

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ quotient.induction_on' x ih
7373
/-- Embedding of the original ring `R` into `adjoin_root f`. -/
7474
def of : R →+* adjoin_root f := (mk f).comp C
7575

76-
instance : algebra R (adjoin_root f) := (of f).to_algebra
76+
instance : algebra R (adjoin_root f) :=
77+
{ smul := @@has_scalar.smul (submodule.quotient.has_scalar' _),
78+
smul_def' := λ r (x : submodule.quotient _),
79+
show r • x = mk f (C r) * x,
80+
by rw [C_eq_algebra_map, mk, ← ideal.quotient.mkₐ_eq_mk R,
81+
alg_hom.commutes, ← algebra.smul_def],
82+
.. (of f).to_algebra }
7783

7884
@[simp] lemma algebra_map_eq : algebra_map R (adjoin_root f) = of f := rfl
7985

src/ring_theory/finiteness.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ equiv (quotient hker hfp) (ideal.quotient_ker_alg_equiv_of_surjective hf)
322322
lemma iff : finite_presentation R A ↔
323323
∃ n (I : ideal (_root_.mv_polynomial (fin n) R)) (e : I.quotient ≃ₐ[R] A), I.fg :=
324324
begin
325-
refine ⟨λ h,_, λ h, _⟩,
326-
{ obtain ⟨n, f, hf⟩ := h,
327-
use [n, f.to_ring_hom.ker, ideal.quotient_ker_alg_equiv_of_surjective hf.1, hf.2] },
328-
{ obtain ⟨n, I, e, hfg⟩ := h,
325+
split,
326+
{ rintros ⟨n, f, hf⟩,
327+
exact ⟨n, f.to_ring_hom.ker, ideal.quotient_ker_alg_equiv_of_surjective hf.1, hf.2 },
328+
{ rintros ⟨n, I, e, hfg⟩,
329329
exact equiv (quotient hfg (mv_polynomial R _)) e }
330330
end
331331

src/ring_theory/ideal/operations.lean

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,12 @@ variables (R) {A : Type*} [comm_ring A] [algebra R A]
14461446

14471447
/-- The `R`-algebra structure on `A/I` for an `R`-algebra `A` -/
14481448
instance {I : ideal A} : algebra R (ideal.quotient I) :=
1449-
(ring_hom.comp (ideal.quotient.mk I) (algebra_map R A)).to_algebra
1449+
{ to_fun := λ x, ideal.quotient.mk I (algebra_map R A x),
1450+
smul := (•),
1451+
smul_def' := λ r x, quotient.induction_on' x $ λ x,
1452+
((quotient.mk I).congr_arg $ algebra.smul_def _ _).trans (ring_hom.map_mul _ _ _),
1453+
commutes' := λ _ _, mul_comm _ _,
1454+
.. ring_hom.comp (ideal.quotient.mk I) (algebra_map R A) }
14501455

14511456
/-- The canonical morphism `A →ₐ[R] I.quotient` as morphism of `R`-algebras, for `I` an ideal of
14521457
`A`, where `A` is an `R`-algebra. -/
@@ -1455,7 +1460,7 @@ def quotient.mkₐ (I : ideal A) : A →ₐ[R] I.quotient :=
14551460

14561461
lemma quotient.alg_map_eq (I : ideal A) :
14571462
algebra_map R I.quotient = (algebra_map A I.quotient).comp (algebra_map R A) :=
1458-
by simp only [ring_hom.algebra_map_to_algebra, ring_hom.comp_id]
1463+
rfl
14591464

14601465
instance [algebra S A] [algebra S R] [is_scalar_tower S R A]
14611466
{I : ideal A} : is_scalar_tower S R (ideal.quotient I) :=

0 commit comments

Comments
 (0)