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

Commit a8d6bdf

Browse files
committed
feat(algebra/category/AddCommGroup): has_image_maps (#3366)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent fa6c45a commit a8d6bdf

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

src/algebra/category/Group/images.lean

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,25 @@ noncomputable instance : has_image f :=
8585
{ lift := image.lift,
8686
lift_fac' := image.lift_fac } }
8787

88-
noncomputable instance : has_images.{0} AddCommGroup.{0} :=
88+
noncomputable instance : has_images AddCommGroup.{0} :=
8989
{ has_image := infer_instance }
9090

91+
-- We'll later get this as a consequence of `[abelian AddCommGroup]`.
92+
-- Nevertheless this instance has the desired definitional behaviour,
93+
-- and is useful in the meantime for doing cohomology.
94+
95+
-- When the `[abelian AddCommGroup]` instance is available
96+
-- this instance should be reviewed, and ideally removed if the `[abelian]` instance
97+
-- provides something definitionally equivalent.
98+
noncomputable instance : has_image_maps AddCommGroup.{0} :=
99+
{ has_image_map := λ f g st,
100+
{ map :=
101+
{ to_fun := image.map ((forget AddCommGroup).map_arrow.map st),
102+
map_zero' := by { ext, simp, },
103+
map_add' := λ x y, by { ext, simp, refl, } } } }
104+
105+
@[simp] lemma image_map {f g : arrow AddCommGroup.{0}} (st : f ⟶ g) (x : image f.hom):
106+
(image.map st x).val = st.right x.1 :=
107+
rfl
108+
91109
end AddCommGroup

src/category_theory/arrow.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,24 @@ end
112112

113113
end arrow
114114

115+
namespace functor
116+
117+
universes v₁ v₂ u₁ u₂
118+
119+
variables {C : Type u₁} [category.{v₁} C] {D : Type u₂} [category.{v₂} D]
120+
121+
/-- A functor `C ⥤ D` induces a functor between the corresponding arrow categories. -/
122+
@[simps]
123+
def map_arrow (F : C ⥤ D) : arrow C ⥤ arrow D :=
124+
{ obj := λ a,
125+
{ left := F.obj a.left,
126+
right := F.obj a.right,
127+
hom := F.map a.hom, },
128+
map := λ a b f,
129+
{ left := F.map f.left,
130+
right := F.map f.right,
131+
w' := by { have w := f.w, simp only [id_map] at w, dsimp, simp only [←F.map_comp, w], } } }
132+
133+
end functor
134+
115135
end category_theory

src/category_theory/limits/types.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,18 @@ noncomputable instance : has_image f :=
129129
noncomputable instance : has_images (Type u) :=
130130
{ has_image := infer_instance }
131131

132+
noncomputable instance : has_image_maps (Type u) :=
133+
{ has_image_map := λ f g st,
134+
{ map := λ x, ⟨st.right x.1, ⟨st.left (classical.some x.2),
135+
begin
136+
have p := st.w,
137+
replace p := congr_fun p (classical.some x.2),
138+
simp only [functor.id_map, types_comp_apply, subtype.val_eq_coe] at p,
139+
erw [p, classical.some_spec x.2],
140+
end⟩⟩ } }
141+
142+
@[simp] lemma image_map {f g : arrow (Type u)} (st : f ⟶ g) (x : image f.hom) :
143+
(image.map st x).val = st.right x.1 :=
144+
rfl
145+
132146
end category_theory.limits.types

0 commit comments

Comments
 (0)