On Wednesday, May 22, 2019 at 7:25:26 AM UTC-7, Simon King wrote: > > > I tend to argue that in the first place, SageMath is a maths software. > And mathematically, universal constructions do come "with batteries" > included. Hence, the projections and coprojections are part of the > construction and it makes sense to let them be part of the constructed > objects. > > I don't think you have to come to that conclusion. As the routine V.direct_sum says, it returns the direct sum as a free module, Of course the projections and coprojections should be available (either between the module and an explicit cartesian product, or as separate projections maps and section maps (possibly with the section stored on the projection), but if the direct sum is modelled as a free module (and for efficiency reasons you have to) then there is not really room to store these objects on that module itself. Plus, doing so opens up another can of memory leak problems.
Using the coercion framework to store the projections and coprojections is similarly problematic: there is no satisfactory answer to which object should keep which alive. Plus, with direct powers, it's not so clear where to project. Returning the object as an element in an already implemented category together with the maps that follow naturally from the construction is definitely workable, and probably the most "basic" way of capturing the required datta. So I'd argue we should at least implement that basic interface. If someone wants to put some further sauce on that, it can be built on top. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/2fafda47-c40e-4c0f-9ac7-582cb8c55e2c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.