#16618: Fix: the optimization Category_over_base._subcategory_hook_ really 
belongs
to Category_over_base_ring
--------------------------+-------------------------------------
   Reporter:  nthiery     |            Owner:
       Type:  defect      |           Status:  new
   Priority:  major       |        Milestone:  sage-6.3
  Component:  categories  |         Keywords:
  Merged in:              |          Authors:  Nicolas M. ThiƩry
  Reviewers:              |  Report Upstream:  N/A
Work issues:              |           Branch:
     Commit:              |     Dependencies:
   Stopgaps:              |
--------------------------+-------------------------------------
 {{{
            sage: from sage.categories.category_types import
 Category_over_base
            sage: D = Modules(Rings())
            sage: class Cs(Category_over_base):
            ....:    def super_categories(self):
            ....:        return [D]
            sage: C = Cs(SymmetricGroup(3))
            sage: C.is_subcategory(D)         # OOPS
            False
 }}}

 This is due to:
 {{{
            sage: D._subcategory_hook_(C)
            False
 }}}

 My analysis is that the optimization implemented in
 `Category_over_base._subcategory_hook_` (if the base is not the same,
 then they can't be comparable) is only actually valid for
 `Category_over_base_ring`s. So I moved `_subcategory_hook_` down
 there. This allows for improving the answer in one corner case that
 was pinpointed in the doctests.

 Does this sound reasonable? Are there `Category_over_base` for which
 we care about such an optimization that are not
 `Category_over_base_ring`?

 For the record: this issue was detected while trying with Darij to use
 categories over a base ring category in symmetric functions, while the
 homset ticket #10668 was applied; this triggered a recursion loop in:
 {{{
             sage: Sym = SymmetricFunctions(FractionField(QQ['q','t']))
             sage: P = Sym.macdonald().P()
             sage: m = Sym.monomial()
             sage: P.transition_matrix(m,2)
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16618>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to