#10963: More functorial constructions
-------------------------------------+-------------------------------------
Reporter: nthiery | Owner: stumpc5
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.1
Component: categories | Resolution:
Keywords: days54 | Merged in:
Authors: Nicolas M. Thiéry | Reviewers: Simon King, Frédéric
Report Upstream: N/A | Chapoton
Branch: | Work issues:
public/ticket/10963 | Commit:
Dependencies: #11224, #8327, | 8045aa4a4b7ada735b3eb6055382f9b341a39f1e
#10193, #12895, #14516, #14722, | Stopgaps:
#13589, #14471, #15069, #15094, |
#11688, #13394, #15150, #15506 |
-------------------------------------+-------------------------------------
Comment (by nthiery):
Replying to [comment:380 vbraun]:
> So I read the documentation and it does a pretty good job of explaining
what is going on. The goals are very nice and I totally agree with you.
I am glad you appreciate it :-)
> I didn't see it spelled how and what kind of identities between
different categories with axioms can be found automaticaly.
The new section on deduction rules (i.e. mathematical facts encoded
into the system) might answer your question. Otherwise, let me know.
> It seems that this is about the same problem as normal form for toric
ideals so there needs to be some decision about monomials / axiom
orderings.
Hmm, I am not sure. It's more about computing recursively a closure
upon all available deduction rules to derive as much information as
possible from what's available.
> But thats not what I really want to bring up. I'm also more and more
convinced that the whole "axioms as strings" is an absolutely terrible
implementation. The very first example:
> {{{#!python
> sage: class Cs(Category):
> ....: def super_categories(self):
> ....: return [Sets()]
> ....: class Finite(CategoryWithAxiom):
> ....: class ParentMethods:
> ....: def foo(self):
> ....: print "I am a method on finite C's"
> }}}
> implements
> {{{#!python
> sage: P = Parent(category=Cs().Finite())
> sage: P.foo() # ok, nice
> I am a method on finite C's
> sage: P.is_finite() # What is this I don't even
> True
> }}}
> From a Python programmer's perspective, the fact that class names get
parsed under the hood is just about entirely unexpected. Sure its possible
to implement, but it is also entirely opposite of Python best practices. I
don't even want to bring up the poor guy who'll try this with "Endlich"
instead of "Finite" as a class name and be in for a surprise.
In the above example, there is no class name parsing. If the name
``Finite`` is special, that's because Cs is a subcategory of Sets, and
Sets defines the ``Finite`` axiom. Namewise, it's of the same nature
as implementing in a class a method declared in some superclass. I
just added a note to make this more explicit in the documentation.
> Slightly different angle, same problem IMHO:
> {{{
> sage: Cs().Finite().super_categories() # ok, nice
> [Category of finite sets, Category of cs]
> sage: Cs().Finite().axioms() # really, this is the
best we can do?
> frozenset(['Finite'])
> }}}
> Axioms are at the end of the day the analog of mixins in the category
framework, and as such implemented as classes. Just return the classes.
This should be obvious.
As pointed out by Nils, a single axiom (like Finite) corresponds to a
bunch of mixin classes (Groups.Finite, Crystals.Finite,
Lattices.Finite, ...). Each mixin models a given category with a given
axiom. Granted, the mixin in the category defining the axiom
(e.g. Sets.Finite) is a bit special; still it is a category, not the
axiom itself (mathematically speaking, we make a difference, even just
in the naming, between the axiom of associativity and the category of
associative magmas), so I would not want to model the axiom with it.
Now there is the question of whether we want to model the axioms at
all with objects (or classes), for example when returning the axioms
of a category. Honestly, in three years I haven't had a need for it;
in particular, I did not need to have operations on the axioms. The
only relevant operation I could see so far is asking an axiom in which
category it's defined. So for now let's keep it simple.
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/ticket/10963#comment:387>
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/groups/opt_out.