#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:              |  
--------------------------+-------------------------------------------------
 Hom is currently implemented as a covariant functorial
 construction:

 {{{
     sage: Rings().hom_category()
     Category of hom sets in Category of rings
     sage: Rings().hom_category().super_categories()
     [Category of hom sets in Category of sets]
 }}}

 The intention was to model the fact that a morphism in a category is
 also a morphism in any super category, via the forgetful functor. With
 the example above, if A and B are rings, then a ring morphism phi:
 A->B is also a set morphism. However, at the level of parents, and as
 noted in the documentation of sage.category.HomCategory, this is
 mathematically plain wrong: if A and B are rings, then Hom(A,B) in the
 category of rings does not coincide with Hom(A,B) in the category of
 sets.

 I, Nicolas, take full blame for this misfeature; it was just the
 shortest route to implement some urgently needed features about
 morphisms, and still get that huge chunk of category code done.

 Here are some thoughts for a proper implementation:

  - Add support for a HomMethods subclass, similar to ElementMethods
    and ParentMethods. If Cat is a category, then Cat.ElementMethods
    will provide generic methods for morphisms in Cat and any
    subcategory. This will require to implement the building of a
    hierarchy of abstract classes Cat.method_class. And to either tweak
    sage.categories.morphism.Morphism to add inheritance from this
    class, as is done in Element and Parent, or to tweak the
    implementation of Homset.element_class so that, for H a homset in
    Cat, H.element_class would inherit from Cat.method_class besides
    the usual stuff (I guess I prefer the later option).

  - Reimplement HomCategory. For Cat a category, the purpose of
    Cat.hom_category() shall be to provide mathematical information
    about its homsets (e.g. that a homset in the category of vector
    spaces is also a vector space). It should ignore the super
    categories of C in general, except if is a full subcategory (a
    homset in the category of finite groups is also a homset in the
    category of groups).

  - If CatA is a subcategory of catB, add automatic coercion (or just
    conversion?) from Hom(A,B, CatA) to Hom(A, B, CatB), modeling the
    appropriate forgetful functor. There are too many such coercions
    for them to be registered explicitly. So this probably need to be
    implemented through a specific CatB._has_coerce_map_from(A) for
    homsets.

    Some extra work will probably be needed if one wants to handle
    mixed morphism arithmetic (e.g. having the sum of an algebra
    morphism and a coalgebra morphism return a vector space morphism).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10668>
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.

Reply via email to