#17367: Classes of combinatorial structures
-------------------------------------+-------------------------------------
       Reporter:  elixyre            |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.9
      Component:  combinatorics      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jean-Baptiste      |    Reviewers:
  Priez                              |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  c13301a1fe97f639089a691bd0f75d78cc8aa6a0
  u/elixyre/class_of_combinatorial_structures|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:19 elixyre]:
 > Replying to [comment:17 vdelecroix]:
 > > I strongly think that creating this category is useless
 >
 > This seems '''not''' totally useless to create a new category or I don't
 know how to do that easily using the category framework of sage.
 > Let me ask you how to that in the following...
 >
 > > '''and''' I certainly understand that it is needed. What I propose is
 to not create a new category but make this featured sets with NN grading
 and finite slices available. What I would rather implement is:
 > >  - making the grading set a parameter of the category
 `SetsWithGrading` (in your case it would be `NN`)
 >
 > The parameter ''grading set'' is already provided in the
 `SetsWithGrading` category.

 This is not true. It is provided by the parents that belong to the
 category. You have no category `Sets with grading NN`. Whereas you have
 {{{
 sage: Modules(ZZ)
 Category of modules over Integer Ring
 sage: Modules(Zmod(4)['a','b'])
 Category of modules over Multivariate Polynomial Ring
   in a, b over Ring of integers modulo 4
 }}}
 In the case of `SetsWithGrading` the grading set is not attached to the
 category. It is just a mandatory attribute (in the common sense) of the
 parents of this category.

 > >  - adding an axiom `FiniteSlice` to `SetsWithGrading`
 >
 > I also wish to provide a category `GradedComponent` (or `Subset`) with
 methods `ambient` (which return the set with grading) and `grade` (why
 not). Where put this class:

 Do you mean a method of the parent belonging to that category?

 - For the `.ambient()` method, this is not specific to the parent that are
 the graded component of a graded set. The lack is that there is nothing
 right now for a parent that needs to be seen as a subset of another
 parent. That would be the most natural. The facades are already close to
 that.

 - Do you really want to impose a `.grade()` method in each of the graded
 component?

 - On the other hand, I think that there should be a special mechanism in
 `SetsWithGrading` to be able to specify any restriction on the category of
 the graded components. That would be the most natural and certainly the
 easiest to implement.

 > It seems natural to have `GradedComponent` as a nested class of
 `SetWithGrading`, right? (There is no reason that it appears elsewhere.)

 I don't think that this `GradedComponent` should exist. As I said above,
 it would be better to have something to be able to specify an ambient
 parent.

 > At this point, if I use `FiniteSlice` as an axiom,  ''a priori'' this
 class `GradedComponent` should have `FiniteSets` (or better
 `FiniteEnumeratedSets`) as super category but without the axiom this only
 should have `Sets`. How do that (easily and properly)?

 I still do not think that this `GradedComponent` should exist... so there
 is no trouble.

 > So my opinion is `FiniteSlice` is not an axiom and the code of
 `GradedComponent` should be duplicate, one using `Sets` as super category
 and the other using `FiniteSets`.

 Certainly not. Solutions for categories should never be with a class for
 each particular problem.

 > If we have a finite sets (in sage), could we assume that it is an
 enumerated sets? (I suppose the answer is '''no''' but...)

 Indeed. The problem is that the behavior are actually quite different (see
 also [http://trac.sagemath.org/ticket/18411#comment:39 #18411 comment 39]
 and [http://trac.sagemath.org/ticket/18411#comment:40 #18411 comment 40]):
 {{{
 sage: FiniteEnumeratedSet([1,2,3]) == FiniteEnumeratedSet([3,2,1])
 False
 sage: Set([1,2,3]) == Set([3,2,1])
 True
 }}}
 Enumerated in the Sage category context does not mean iterable, it is
 rather ''with a presribed iteration order''. Nicolas wanted a new category
 `IterableSets` but I think it is going too far.

 When we will converge to something reasonable, it would be better to split
 the features:
  - a ticket to implement being subset of a parent (i.e. the `ambient`
 method)
  - a ticket to implement the category restrictions on the slices
  - etc

 The most important is to actually '''not''' focus on your particular case
 if you want to implement something useful for categories.

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