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

Commit e053bda

Browse files
committed
feat(category_theory/monoidal/internal): Mon_ (Module R) ≌ Algebra R (#3695)
The category of internal monoid objects in `Module R` is equivalent to the category of "native" bundled `R`-algebras. Moreover, this equivalence is compatible with the forgetful functors to `Module R`. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 036527a commit e053bda

File tree

5 files changed

+217
-5
lines changed

5 files changed

+217
-5
lines changed

src/algebra/category/Module/monoidal.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,21 @@ instance : comm_ring ((𝟙_ (Module R) : Module R) : Type u) := (by apply_insta
135135
namespace monoidal_category
136136

137137
@[simp]
138-
lemma left_unitor_hom {M : Module R} (r : R) (m : M) :
138+
lemma hom_apply {K L M N : Module R} (f : K ⟶ L) (g : M ⟶ N) (k : K) (m : M) :
139+
(f ⊗ g) (k ⊗ₜ m) = f k ⊗ₜ g m := rfl
140+
141+
@[simp]
142+
lemma left_unitor_hom_apply {M : Module R} (r : R) (m : M) :
139143
((λ_ M).hom : 𝟙_ (Module R) ⊗ M ⟶ M) (r ⊗ₜ[R] m) = r • m :=
140144
tensor_product.lid_tmul m r
141145

142146
@[simp]
143-
lemma right_unitor_hom {M : Module R} (m : M) (r : R) :
147+
lemma right_unitor_hom_apply {M : Module R} (m : M) (r : R) :
144148
((ρ_ M).hom : M ⊗ 𝟙_ (Module R) ⟶ M) (m ⊗ₜ r) = r • m :=
145149
tensor_product.rid_tmul m r
146150

147151
@[simp]
148-
lemma associator_hom {M N K : Module R} (m : M) (n : N) (k : K) :
152+
lemma associator_hom_apply {M N K : Module R} (m : M) (n : N) (k : K) :
149153
((α_ M N K).hom : (M ⊗ N) ⊗ K ⟶ M ⊗ (N ⊗ K)) ((m ⊗ₜ n) ⊗ₜ k) = (m ⊗ₜ (n ⊗ₜ k)) := rfl
150154

151155
end monoidal_category

src/algebra/module/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ lemma coe_fn_congr : Π {x x' : M}, x = x' → f x = f x'
295295
theorem ext_iff : f = g ↔ ∀ x, f x = g x :=
296296
by { rintro rfl x, refl } , ext⟩
297297

298+
/-- If two linear maps are equal, they are equal at each point. -/
299+
lemma lcongr_fun (h : f = g) (m : M) : f m = g m :=
300+
congr_fun (congr_arg linear_map.to_fun h) m
301+
298302
variables (f g)
299303

300304
@[simp] lemma map_add (x y : M) : f (x + y) = f x + f y := f.map_add' x y
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
/-
2+
Copyright (c) 2020 Scott Morrison. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Scott Morrison
5+
-/
6+
import algebra.category.Module.monoidal
7+
import algebra.category.Algebra.basic
8+
import category_theory.monoidal.internal
9+
10+
11+
/-!
12+
# `Mon_ (Module R) ≌ Algebra R`
13+
14+
The category of internal monoid objects in `Module R`
15+
is equivalent to the category of "native" bundled `R`-algebras.
16+
17+
Moreover, this equivalence is compatible with the forgetful functors to `Module R`.
18+
-/
19+
20+
universes v u
21+
22+
open category_theory
23+
open linear_map
24+
25+
open_locale tensor_product
26+
27+
namespace Module
28+
29+
variables {R : Type u} [comm_ring R]
30+
31+
namespace Mon_Module_equivalence_Algebra
32+
33+
@[simps]
34+
instance (A : Mon_ (Module R)) : ring A.X :=
35+
{ one := A.one (1 : R),
36+
mul := λ x y, A.mul (x ⊗ₜ y),
37+
one_mul := λ x, by { convert lcongr_fun A.one_mul ((1 : R) ⊗ₜ x), simp, },
38+
mul_one := λ x, by { convert lcongr_fun A.mul_one (x ⊗ₜ (1 : R)), simp, },
39+
mul_assoc := λ x y z, by convert lcongr_fun A.mul_assoc ((x ⊗ₜ y) ⊗ₜ z),
40+
left_distrib := λ x y z,
41+
begin
42+
convert A.mul.map_add (x ⊗ₜ y) (x ⊗ₜ z),
43+
rw ←tensor_product.tmul_add,
44+
refl,
45+
end,
46+
right_distrib := λ x y z,
47+
begin
48+
convert A.mul.map_add (x ⊗ₜ z) (y ⊗ₜ z),
49+
rw ←tensor_product.add_tmul,
50+
refl,
51+
end,
52+
..(by apply_instance : add_comm_group A.X) }
53+
54+
instance (A : Mon_ (Module R)) : algebra R A.X :=
55+
{ map_zero' := A.one.map_zero,
56+
map_one' := rfl,
57+
map_mul' := λ x y,
58+
begin
59+
have h := lcongr_fun A.one_mul.symm (x ⊗ₜ (A.one y)),
60+
rwa [monoidal_category.left_unitor_hom_apply, ←A.one.map_smul] at h,
61+
end,
62+
commutes' := λ r a,
63+
begin dsimp,
64+
have h₁ := lcongr_fun A.one_mul (r ⊗ₜ a),
65+
have h₂ := lcongr_fun A.mul_one (a ⊗ₜ r),
66+
exact h₁.trans h₂.symm,
67+
end,
68+
smul_def' := λ r a, by { convert (lcongr_fun A.one_mul (r ⊗ₜ a)).symm, simp, },
69+
..A.one }
70+
71+
@[simp] lemma algebra_map (A : Mon_ (Module R)) (r : R) : algebra_map R A.X r = A.one r := rfl
72+
73+
/--
74+
Converting a monoid object in `Module R` to a bundled algebra.
75+
-/
76+
@[simps]
77+
def functor : Mon_ (Module R) ⥤ Algebra R :=
78+
{ obj := λ A, Algebra.of R A.X,
79+
map := λ A B f,
80+
{ to_fun := f.hom,
81+
map_one' := lcongr_fun f.one_hom (1 : R),
82+
map_mul' := λ x y, lcongr_fun f.mul_hom (x ⊗ₜ y),
83+
commutes' := λ r, lcongr_fun f.one_hom r,
84+
..(f.hom.to_add_monoid_hom) }, }.
85+
86+
/--
87+
Converting a bundled algebra to a monoid object in `Module R`.
88+
-/
89+
@[simps]
90+
def inverse_obj (A : Algebra.{u} R) : Mon_ (Module.{u} R) :=
91+
{ X := Module.of R A,
92+
one := algebra.linear_map R A,
93+
mul := algebra.lmul' R A,
94+
one_mul' :=
95+
begin
96+
ext x,
97+
dsimp,
98+
rw [algebra.lmul'_apply, monoidal_category.left_unitor_hom_apply, algebra.smul_def],
99+
refl,
100+
end,
101+
mul_one' :=
102+
begin
103+
ext x,
104+
dsimp,
105+
rw [algebra.lmul'_apply, monoidal_category.right_unitor_hom_apply,
106+
←algebra.commutes, algebra.smul_def],
107+
refl,
108+
end,
109+
mul_assoc' :=
110+
begin
111+
ext xy z,
112+
dsimp,
113+
apply tensor_product.induction_on xy,
114+
{ simp only [linear_map.map_zero, tensor_product.zero_tmul], },
115+
{ intros x y, dsimp, simp [mul_assoc], },
116+
{ intros x y hx hy, dsimp, simp [tensor_product.add_tmul, hx, hy], },
117+
end }
118+
119+
/--
120+
Converting a bundled algebra to a monoid object in `Module R`.
121+
-/
122+
@[simps]
123+
def inverse : Algebra.{u} R ⥤ Mon_ (Module.{u} R) :=
124+
{ obj := inverse_obj,
125+
map := λ A B f,
126+
{ hom := f.to_linear_map, }, }.
127+
128+
end Mon_Module_equivalence_Algebra
129+
130+
open Mon_Module_equivalence_Algebra
131+
132+
/--
133+
The category of internal monoid objects in `Module R`
134+
is equivalent to the category of "native" bundled `R`-algebras.
135+
-/
136+
def Mon_Module_equivalence_Algebra : Mon_ (Module R) ≌ Algebra R :=
137+
{ functor := functor,
138+
inverse := inverse,
139+
unit_iso := nat_iso.of_components
140+
(λ A,
141+
{ hom := { hom := { to_fun := id, map_add' := λ x y, rfl, map_smul' := λ r a, rfl, } },
142+
inv := { hom := { to_fun := id, map_add' := λ x y, rfl, map_smul' := λ r a, rfl, } } })
143+
(by tidy),
144+
counit_iso := nat_iso.of_components (λ A,
145+
{ hom :=
146+
{ to_fun := id,
147+
map_zero' := rfl,
148+
map_add' := λ x y, rfl,
149+
map_one' := (algebra_map R A).map_one,
150+
map_mul' := λ x y, algebra.lmul'_apply,
151+
commutes' := λ r, rfl, },
152+
inv :=
153+
{ to_fun := id,
154+
map_zero' := rfl,
155+
map_add' := λ x y, rfl,
156+
map_one' := (algebra_map R A).map_one.symm,
157+
map_mul' := λ x y, algebra.lmul'_apply.symm,
158+
commutes' := λ r, rfl } }) (by tidy), }.
159+
160+
/--
161+
The equivalence `Mon_ (Module R) ≌ Algebra R`
162+
is naturally compatible with the forgetful functors to `Module R`.
163+
-/
164+
def Mon_Module_equivalence_Algebra_forget :
165+
Mon_Module_equivalence_Algebra.functor ⋙ forget₂ (Algebra R) (Module R) ≅ Mon_.forget :=
166+
nat_iso.of_components (λ A,
167+
{ hom :=
168+
{ to_fun := id,
169+
map_add' := λ x y, rfl,
170+
map_smul' := λ c x, rfl },
171+
inv :=
172+
{ to_fun := id,
173+
map_add' := λ x y, rfl,
174+
map_smul' := λ c x, rfl }, }) (by tidy)
175+
176+
end Module

src/category_theory/monoidal/types.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import category_theory.monoidal.of_has_finite_products
77
import category_theory.limits.shapes.finite_products
88
import category_theory.limits.shapes.types
99

10+
/-!
11+
# The category of types is a symmetric monoidal category
12+
-/
13+
1014
open category_theory
1115
open category_theory.limits
1216
open tactic

src/ring_theory/algebra.lean

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,22 @@ by rw [smul_def, smul_def, left_comm]
151151
(r • x) * y = r • (x * y) :=
152152
by rw [smul_def, smul_def, mul_assoc]
153153

154-
variables (R)
154+
variables (R A)
155+
156+
/--
157+
The canonical ring homomorphism `algebra_map R A : R →* A` for any `R`-algebra `A`,
158+
packaged as an `R`-linear map.
159+
-/
160+
protected def linear_map : R →ₗ[R] A :=
161+
{ map_smul' := λ x y, begin dsimp, simp [algebra.smul_def], end,
162+
..algebra_map R A }
163+
164+
@[simp]
165+
lemma linear_map_apply (r : R) : algebra.linear_map R A r = algebra_map R A r := rfl
166+
155167
instance id : algebra R R := (ring_hom.id R).to_algebra
156-
variables {R}
168+
169+
variables {R A}
157170

158171
namespace id
159172

@@ -208,6 +221,10 @@ def lmul_right (r : A) : A →ₗ A :=
208221
def lmul_left_right (vw: A × A) : A →ₗ[R] A :=
209222
(lmul_right R A vw.2).comp (lmul_left R A vw.1)
210223

224+
/-- The multiplication map on an algebra, as an `R`-linear map from `A ⊗[R] A` to `A`. -/
225+
def lmul' : A ⊗[R] A →ₗ[R] A :=
226+
tensor_product.lift (algebra.lmul R A)
227+
211228
variables {R A}
212229

213230
@[simp] lemma lmul_apply (p q : A) : lmul R A p q = p * q := rfl
@@ -216,6 +233,12 @@ variables {R A}
216233
@[simp] lemma lmul_left_right_apply (vw : A × A) (p : A) :
217234
lmul_left_right R A vw p = vw.1 * p * vw.2 := rfl
218235

236+
@[simp] lemma lmul'_apply {x y} : algebra.lmul' R A (x ⊗ₜ y) = x * y :=
237+
begin
238+
dsimp [algebra.lmul'],
239+
simp,
240+
end
241+
219242
end semiring
220243

221244
end algebra
@@ -1122,6 +1145,7 @@ variable {I : Type u} -- The indexing type
11221145
variable {f : I → Type v} -- The family of types already equipped with instances
11231146
variables (x y : Π i, f i) (i : I)
11241147
variables (I f)
1148+
11251149
instance algebra (α) {r : comm_semiring α}
11261150
[s : ∀ i, semiring (f i)] [∀ i, algebra α (f i)] :
11271151
algebra α (Π i : I, f i) :=

0 commit comments

Comments
 (0)