Skip to content

Commit 72194f7

Browse files
committed
feat(Algebra): Submodule R A is algebra over Ideal A (#18493)
Also upgrade `Submodule.mapHom` and `Ideal.mapHom` to RingHoms and show the former is also an `AlgHom` (`Submodule.mapAlgHom`).
1 parent b04165d commit 72194f7

File tree

4 files changed

+61
-20
lines changed

4 files changed

+61
-20
lines changed

Mathlib/Algebra/Algebra/Operations.lean

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ theorem mul_le_mul_left (h : M ≤ N) : M * P ≤ N * P :=
159159
theorem mul_le_mul_right (h : N ≤ P) : M * N ≤ M * P :=
160160
AddSubmonoid.mul_le_mul_right h
161161

162+
theorem mul_comm_of_commute (h : ∀ m ∈ M, ∀ n ∈ N, Commute m n) : M * N = N * M :=
163+
toAddSubmonoid_injective <| AddSubmonoid.mul_comm_of_commute h
164+
162165
variable (M N P)
163166

164167
theorem mul_sup : M * (N ⊔ P) = M * N ⊔ M * P :=
@@ -505,14 +508,17 @@ protected theorem pow_induction_on_right {C : A → Prop} (hr : ∀ r : R, C (al
505508
(fun x y _i _hx _hy => hadd x y)
506509
(fun _i _x _hx => hmul _) hx
507510

508-
/-- `Submonoid.map` as a `MonoidWithZeroHom`, when applied to `AlgHom`s. -/
511+
/-- `Submonoid.map` as a `RingHom`, when applied to an `AlgHom`. -/
509512
@[simps]
510513
def mapHom {A'} [Semiring A'] [Algebra R A'] (f : A →ₐ[R] A') :
511-
Submodule R A →*₀ Submodule R A' where
514+
Submodule R A →+* Submodule R A' where
512515
toFun := map f.toLinearMap
513516
map_zero' := Submodule.map_bot _
517+
map_add' := (Submodule.map_sup · · _)
514518
map_one' := Submodule.map_one _
515-
map_mul' _ _ := Submodule.map_mul _ _ _
519+
map_mul' := (Submodule.map_mul · · _)
520+
521+
theorem mapHom_id : mapHom (.id R A) = .id _ := RingHom.ext map_id
516522

517523
/-- The ring of submodules of the opposite algebra is isomorphic to the opposite ring of
518524
submodules. -/
@@ -553,14 +559,11 @@ theorem map_unop_pow (n : ℕ) (M : Submodule R Aᵐᵒᵖ) :
553559
on either side). -/
554560
@[simps]
555561
def span.ringHom : SetSemiring A →+* Submodule R A where
556-
-- Note: the hint `(α := A)` is new in https://github.com/leanprover-community/mathlib4/pull/8386
557-
toFun s := Submodule.span R (SetSemiring.down (α := A) s)
562+
toFun s := Submodule.span R (SetSemiring.down s)
558563
map_zero' := span_empty
559564
map_one' := one_eq_span.symm
560565
map_add' := span_union
561-
map_mul' s t := by
562-
dsimp only -- Porting note: new, needed due to new-style structures
563-
rw [SetSemiring.down_mul, span_mul_span]
566+
map_mul' s t := by simp_rw [SetSemiring.down_mul, span_mul_span]
564567

565568
section
566569

Mathlib/Algebra/Group/Submonoid/Pointwise.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,10 @@ theorem iSup_mul (S : ι → AddSubmonoid R) (T : AddSubmonoid R) : (⨆ i, S i)
595595
theorem mul_iSup (T : AddSubmonoid R) (S : ι → AddSubmonoid R) : (T * ⨆ i, S i) = ⨆ i, T * S i :=
596596
smul_iSup T S
597597

598+
theorem mul_comm_of_commute (h : ∀ m ∈ M, ∀ n ∈ N, Commute m n) : M * N = N * M :=
599+
le_antisymm (mul_le.mpr fun m hm n hn ↦ h m hm n hn ▸ mul_mem_mul hn hm)
600+
(mul_le.mpr fun n hn m hm ↦ h m hm n hn ▸ mul_mem_mul hm hn)
601+
598602
end NonUnitalNonAssocSemiring
599603

600604
section NonUnitalNonAssocRing

Mathlib/RingTheory/Ideal/Maps.lean

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,16 @@ theorem smul_top_eq_map {R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra
248248
congrArg _ <| Eq.trans (Ideal.smul_eq_mul _ _) (Ideal.mul_top _)
249249

250250
@[simp]
251-
theorem coe_restrictScalars {R S : Type*} [CommSemiring R] [Semiring S] [Algebra R S]
252-
(I : Ideal S) : (I.restrictScalars R : Set S) = ↑I :=
251+
theorem coe_restrictScalars {R S : Type*} [Semiring R] [Semiring S] [Module R S]
252+
[IsScalarTower R S S] (I : Ideal S) : (I.restrictScalars R : Set S) = ↑I :=
253253
rfl
254254

255255
/-- The smallest `S`-submodule that contains all `x ∈ I * y ∈ J`
256256
is also the smallest `R`-submodule that does so. -/
257257
@[simp]
258-
theorem restrictScalars_mul {R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S]
259-
(I J : Ideal S) : (I * J).restrictScalars R = I.restrictScalars R * J.restrictScalars R :=
258+
theorem restrictScalars_mul {R S : Type*} [Semiring R] [Semiring S] [Module R S]
259+
[IsScalarTower R S S] (I J : Ideal S) :
260+
(I * J).restrictScalars R = I.restrictScalars R * J.restrictScalars R :=
260261
rfl
261262

262263
section Surjective
@@ -493,13 +494,13 @@ end Ring
493494

494495
section CommRing
495496

496-
variable {F : Type*} [CommRing R] [CommRing S]
497+
variable {F : Type*} [CommSemiring R] [CommSemiring S]
497498
variable [FunLike F R S] [rc : RingHomClass F R S]
498499
variable (f : F)
499-
variable {I J : Ideal R} {K L : Ideal S}
500-
variable (I J K L)
500+
variable (I J : Ideal R) (K L : Ideal S)
501501

502-
theorem map_mul : map f (I * J) = map f I * map f J :=
502+
theorem map_mul {R} [Semiring R] [FunLike F R S] [RingHomClass F R S] (f : F) (I J : Ideal R) :
503+
map f (I * J) = map f I * map f J :=
503504
le_antisymm
504505
(map_le_iff_le_comap.2 <|
505506
mul_le.2 fun r hri s hsj =>
@@ -511,12 +512,13 @@ theorem map_mul : map f (I * J) = map f I * map f J :=
511512
Set.singleton_subset_iff.2 <|
512513
hfri ▸ hfsj ▸ by rw [← _root_.map_mul]; exact mem_map_of_mem f (mul_mem_mul hri hsj)))
513514

514-
/-- The pushforward `Ideal.map` as a monoid-with-zero homomorphism. -/
515+
/-- The pushforward `Ideal.map` as a (semi)ring homomorphism. -/
515516
@[simps]
516-
def mapHom : Ideal R →*₀ Ideal S where
517+
def mapHom : Ideal R →+* Ideal S where
517518
toFun := map f
518-
map_mul' I J := Ideal.map_mul f I J
519+
map_mul' := Ideal.map_mul f
519520
map_one' := by simp only [one_eq_top]; exact Ideal.map_top f
521+
map_add' I J := Ideal.map_sup f I J
520522
map_zero' := Ideal.map_bot
521523

522524
protected theorem map_pow (n : ℕ) : map f (I ^ n) = map f I ^ n :=

Mathlib/RingTheory/Ideal/Operations.lean

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,6 @@ namespace Submodule
12411241
variable {R : Type u} {M : Type v}
12421242
variable [CommSemiring R] [AddCommMonoid M] [Module R M]
12431243

1244-
-- TODO: show `[Algebra R A] : Algebra (Ideal R) A` too
12451244
instance moduleSubmodule : Module (Ideal R) (Submodule R M) where
12461245
smul_add := smul_sup
12471246
add_smul := sup_smul
@@ -1260,6 +1259,39 @@ theorem set_smul_top_eq_span (s : Set R) :
12601259
s • ⊤ = Ideal.span s :=
12611260
(span_smul_eq s ⊤).symm.trans (Ideal.span s).mul_top
12621261

1262+
variable {A B} [Semiring A] [Semiring B] [Algebra R A] [Algebra R B]
1263+
1264+
open Submodule
1265+
1266+
instance algebraIdeal : Algebra (Ideal R) (Submodule R A) where
1267+
__ := moduleSubmodule
1268+
toFun := map (Algebra.linearMap R A)
1269+
map_one' := by
1270+
rw [one_eq_span, map_span, Set.image_singleton, Algebra.linearMap_apply, map_one, one_eq_span]
1271+
map_mul' := (Submodule.map_mul · · <| Algebra.ofId R A)
1272+
map_zero' := map_bot _
1273+
map_add' := (map_sup · · _)
1274+
commutes' I M := mul_comm_of_commute <| by rintro _ ⟨r, _, rfl⟩ a _; apply Algebra.commutes
1275+
smul_def' I M := le_antisymm (smul_le.mpr fun r hr a ha ↦ by
1276+
rw [Algebra.smul_def]; exact Submodule.mul_mem_mul ⟨r, hr, rfl⟩ ha) (Submodule.mul_le.mpr <| by
1277+
rintro _ ⟨r, hr, rfl⟩ a ha; rw [Algebra.linearMap_apply, ← Algebra.smul_def]
1278+
exact Submodule.smul_mem_smul hr ha)
1279+
1280+
/-- `Submonoid.map` as an `AlgHom`, when applied to an `AlgHom`. -/
1281+
@[simps!] def mapAlgHom (f : A →ₐ[R] B) : Submodule R A →ₐ[Ideal R] Submodule R B where
1282+
__ := mapHom f
1283+
commutes' I := (map_comp _ _ I).symm.trans (congr_arg (map · I) <| LinearMap.ext f.commutes)
1284+
1285+
/-- `Submonoid.map` as an `AlgEquiv`, when applied to an `AlgEquiv`. -/
1286+
-- TODO: when A, B noncommutative, still has `MulEquiv`.
1287+
@[simps!] def mapAlgEquiv (f : A ≃ₐ[R] B) : Submodule R A ≃ₐ[Ideal R] Submodule R B where
1288+
__ := mapAlgHom f
1289+
invFun := mapAlgHom f.symm
1290+
left_inv I := (map_comp _ _ I).symm.trans <|
1291+
(congr_arg (map · I) <| LinearMap.ext (f.left_inv ·)).trans (map_id I)
1292+
right_inv I := (map_comp _ _ I).symm.trans <|
1293+
(congr_arg (map · I) <| LinearMap.ext (f.right_inv ·)).trans (map_id I)
1294+
12631295
end Submodule
12641296

12651297
instance {R} [Semiring R] : NonUnitalSubsemiringClass (Ideal R) R where

0 commit comments

Comments
 (0)