Hi William and Bill! On 2015-10-01, William Stein <wst...@gmail.com> wrote: >> Is there a reasonably short description of categories in Sage "for >> category theorists"?
There is something about both parent-element scheme and category framework in the thematic tutorial http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html#coercion-and-categories >> Do you consider the coercion model as part of or motivated by category >> theory in Sage? > > Yes, very much so -- that's the part I worried about more. Though > another motivation is for category theory is better code sharing > (that's more of the part that Nicolas added). Indeed, the underlying notions of the current coercion framework in Sage are adopted from category theory: - A coercion map is a morphism in an appropriate category containing both domain and codomain. - The identity morphism is a coercion. - For each pair P,Q of objects there is at most one coercion morphism from P to Q. - The composition of a coercion morphism from P to Q with a coercion morphism from Q to R is a (the!) coercion morphism from P to R. Moreover, there is the notion of so-called "construction functors". That's a functor F from category C to category D, such that for any object P of C there is a coercion from P to F(P). For example, there is a functor that maps each ring R to the polynomial ring R[x], and there is a coercion from R to R[x]. William mentioned the example of adding a rational number to a polynomial over the integers, resulting in a polynomial over the rational numbers. What we see at work here is a combination of the "fraction field" and the "polynomial ring" construction functors. The above-mentioned tutorial provides examples for all that, and how to implement it. Best regards, Simon -- 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 http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.