Skip to content

Commit 3bc69cd

Browse files
author
Release Manager
committed
gh-36399: fixing category of ncsym and dual by making them Commutative and CoCommutative resp. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36399 Reported by: Frédéric Chapoton Reviewer(s): Darij Grinberg
2 parents 9867e78 + 7443e0c commit 3bc69cd

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

src/sage/combinat/ncsym/dual.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
77
- Travis Scrimshaw (08-04-2013): Initial version
88
"""
9-
#*****************************************************************************
9+
# ****************************************************************************
1010
# Copyright (C) 2013 Travis Scrimshaw <tscrim at ucdavis.edu>
1111
#
1212
# Distributed under the terms of the GNU General Public License (GPL)
13-
# http://www.gnu.org/licenses/
14-
#*****************************************************************************
13+
# https://www.gnu.org/licenses/
14+
# ****************************************************************************
1515

1616
from sage.misc.lazy_attribute import lazy_attribute
1717
from sage.misc.misc_c import prod
@@ -49,9 +49,9 @@ def __init__(self, R):
4949
sage: TestSuite(SymmetricFunctionsNonCommutingVariables(QQ).dual()).run()
5050
"""
5151
# change the line below to assert R in Rings() once MRO issues from #15536, #15475 are resolved
52-
assert R in Fields() or R in Rings() # side effect of this statement assures MRO exists for R
52+
assert R in Fields() or R in Rings() # side effect of this statement assures MRO exists for R
5353
self._base = R # Won't be needed once CategoryObject won't override base_ring
54-
category = GradedHopfAlgebras(R) # TODO: .Commutative()
54+
category = GradedHopfAlgebras(R).Commutative()
5555
Parent.__init__(self, category=category.WithRealizations())
5656

5757
# Bases
@@ -104,7 +104,7 @@ def dual(self):
104104

105105
class w(NCSymBasis_abstract):
106106
r"""
107-
The Hopf algebra of symmetric functions in non-commuting variables
107+
The dual Hopf algebra of symmetric functions in non-commuting variables
108108
in the `\mathbf{w}` basis.
109109
110110
EXAMPLES::
@@ -135,10 +135,14 @@ def __init__(self, NCSymD):
135135
"""
136136
def key_func_set_part(A):
137137
return sorted(map(sorted, A))
138-
CombinatorialFreeModule.__init__(self, NCSymD.base_ring(), SetPartitions(),
138+
139+
R = NCSymD.base_ring()
140+
category = GradedHopfAlgebras(R).Commutative()
141+
category &= NCSymDualBases(NCSymD)
142+
CombinatorialFreeModule.__init__(self, R, SetPartitions(),
139143
prefix='w', bracket=False,
140144
sorting_key=key_func_set_part,
141-
category=NCSymDualBases(NCSymD))
145+
category=category)
142146

143147
@lazy_attribute
144148
def to_symmetric_function(self):

src/sage/combinat/ncsym/ncsym.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def __init__(self, R):
297297
# change the line below to assert R in Rings() once MRO issues from #15536, #15475 are resolved
298298
assert R in Fields() or R in Rings() # side effect of this statement assures MRO exists for R
299299
self._base = R # Won't be needed once CategoryObject won't override base_ring
300-
category = GradedHopfAlgebras(R) # TODO: .Cocommutative()
300+
category = GradedHopfAlgebras(R).Cocommutative()
301301
Parent.__init__(self, category=category.WithRealizations())
302302

303303
def _repr_(self):
@@ -362,9 +362,13 @@ def __init__(self, NCSym):
362362
sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
363363
sage: TestSuite(NCSym.m()).run()
364364
"""
365-
CombinatorialFreeModule.__init__(self, NCSym.base_ring(), SetPartitions(),
365+
R = NCSym.base_ring()
366+
category = GradedHopfAlgebras(R).Cocommutative()
367+
category &= NCSymBases(NCSym)
368+
369+
CombinatorialFreeModule.__init__(self, R, SetPartitions(),
366370
prefix='m', bracket=False,
367-
category=NCSymBases(NCSym))
371+
category=category)
368372

369373
@cached_method
370374
def _m_to_p_on_basis(self, A):

0 commit comments

Comments
 (0)