#10667: Morphisms and Objects of Categories
----------------------------------+-----------------------------------------
   Reporter:  SimonKing           |          Owner:  nthiery                    
  
       Type:  enhancement         |         Status:  needs_work                 
  
   Priority:  major               |      Milestone:  sage-5.0                   
  
  Component:  categories          |       Keywords:  objects morphisms 
containment
Work_issues:  Cartesian products  |       Upstream:  N/A                        
  
   Reviewer:                      |         Author:  Simon King                 
  
     Merged:                      |   Dependencies:  #9138, #11115, #11780      
  
----------------------------------+-----------------------------------------

Comment(by SimonKing):

 Aha! I understand!

 `Hom(N,N)` reduces to `N._Hom_(N)`, which ''directly'' constructs a number
 field hom set.

 By consequence, `Hom(N,N)` does not become a unique parent, even though it
 inherits from `UniqueRepresentation` via inheritance from the category.
 But that inheritance takes place ''after'' creation of the hom set, so
 that it is too late for `Rings().HomCategory.ParentMethods.__classcall__`.

 In other words: Via category inheritance, `Hom(N,N)` inherits `__eq__`
 from `UniqueRepresentation`, which is used for comparison and precedes the
 use of the custom `__cmp__` method of number field homsets. However,
 `__eq__` expects unique parents.

 We thus have:
 {{{
 age: N = NumberField(x^12 - 4*x^11 + 6*x^10 - 5*x^9 + 5*x^8 - 9*x^7 +
 21*x^6 - 9*x^5 + 5*x^4 - 5*x^3 + 6*x^2 - 4*x + 1, 'a')
 sage: H = Hom(N,N)
 sage: H == Hom(N,N)
 False
 sage: H > Hom(N,N)
 False
 sage: H < Hom(N,N)
 False
 }}}

 I guess, until number fields are truly unique parents, I should add an
 `__eq__` to number field hom sets, in order to not have it inherited from
 `UniqueRepresentation`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10667#comment:55>
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