#10668: Refactor category support for morphisms (Hom is not a functorial
construction!)
--------------------------+-------------------------------------------------
Reporter: nthiery | Owner: nthiery
Type: defect | Status: new
Priority: major | Milestone:
Component: categories | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------+-------------------------------------------------
Comment(by SimonKing):
Replying to [ticket:10668 nthiery]:
> - Add support for a MorphismsMethods subclass, similar to
> ElementMethods and ParentMethods. If Cat is a category, then
> Cat.MorphismMethods will provide generic methods for morphisms in
> Cat and in any subcategory.
Not in a sub-category! Namely, if `Cat` is the category of F-vectorspaces,
then `Cat.MorphismMethods` would include addition and skalar
multiplication. But for a sub-category of `Cat`, such as F-algebras, we
don't want that, as you had pointed out.
> This can be achieved by:
>
> - Building of a hierarchy of abstract classes Cat.morphism_class,
> similar to Cat.element_class and Cat.parent_class (10 lines of
> code; see Category.element_class).
I don't see such hierarchy.
> - Having morphisms in Cat inherit from Cat.morphism_class.
I really think the `Cat.hom_structure` formalism that I suggested would be
easier.
Any category would provide its own hom-structure (and there would be
''no'' inheritance for sub-categories), of course `Objects()` being the
default hom-structure.
Then, homsets in `Cat` would inherit from
`Cat.hom_structure.parent_class`, whereas morphisms in `Cat` would inherit
from `Cat.hom_structure.element_class`.
In particular, there is no need to provide `Cat.HomMethods` or
`Cat.MorphismMethods`. In fact, they are redundant: If you simply state
that `Cat.hom_structure` is `VectorSpaces(QQ)`, then the morphisms already
have the element methods of vector spaces, whereas in your approach you
needed to restate (copy-and-paste) them as `Cat.MorphismMethods`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10668#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.