Skip to content

Commit

Permalink
sagemathgh-36673: capitals to Hopf, Lie, Coxeter by appropriate mecha…
Browse files Browse the repository at this point in the history
…nism

    
This is adding a proper mechanism to have capitalized proper names in
category names.

This is applied here to Coxeter, Lie and Hopf. Also Hecke and Weyl.

The important changes are in `src/sage/categories/category.py`

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have updated the documentation accordingly.
    
URL: sagemath#36673
Reported by: Frédéric Chapoton
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed Dec 6, 2023
2 parents 272582b + 6193042 commit b088a97
Show file tree
Hide file tree
Showing 49 changed files with 145 additions and 162 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/clifford_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ def __init__(self, R, names):
sage: E.<x,y,z> = ExteriorAlgebra(QQ)
sage: E.category()
Category of finite dimensional supercommutative supercocommutative
super hopf algebras with basis over Rational Field
super Hopf algebras with basis over Rational Field
sage: TestSuite(E).run()
sage: TestSuite(ExteriorAlgebra(GF(3), ['a', 'b'])).run()
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/free_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def super_categories(self):
sage: L.<x, y> = LieAlgebra(QQ)
sage: bases = FreeLieAlgebraBases(L)
sage: bases.super_categories()
[Category of lie algebras with basis over Rational Field,
[Category of Lie algebras with basis over Rational Field,
Category of realizations of Free Lie algebra generated by (x, y) over Rational Field]
"""
return [LieAlgebras(self.base().base_ring()).WithBasis(), Realizations(self.base())]
Expand Down
8 changes: 4 additions & 4 deletions src/sage/algebras/lie_algebras/lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ class LieAlgebra(Parent, UniqueRepresentation): # IndexedGenerators):
sage: L
Nilpotent Lie algebra on 3 generators (X, Y, Z) over Rational Field
sage: L.category()
Category of finite dimensional nilpotent lie algebras with basis over Rational Field
Category of finite dimensional nilpotent Lie algebras with basis over Rational Field
A second example defining the Engel Lie algebra::
Expand Down Expand Up @@ -530,7 +530,7 @@ def __init__(self, R, names=None, category=None):
sage: L.<x,y> = LieAlgebra(QQ, abelian=True)
sage: L.category()
Category of finite dimensional nilpotent lie algebras with basis over Rational Field
Category of finite dimensional nilpotent Lie algebras with basis over Rational Field
"""
category = LieAlgebras(R).or_subcategory(category)
Parent.__init__(self, base=R, names=names, category=category)
Expand Down Expand Up @@ -805,7 +805,7 @@ def __init__(self, R, names=None, index_set=None, category=None, prefix='L', **k
sage: L.<x,y> = LieAlgebra(QQ, abelian=True)
sage: L.category()
Category of finite dimensional nilpotent lie algebras with basis over Rational Field
Category of finite dimensional nilpotent Lie algebras with basis over Rational Field
"""
self._indices = index_set
LieAlgebra.__init__(self, R, names, category)
Expand Down Expand Up @@ -890,7 +890,7 @@ def __init__(self, R, names=None, index_set=None, category=None):
sage: L.<x,y> = LieAlgebra(QQ, abelian=True)
sage: L.category()
Category of finite dimensional nilpotent lie algebras with basis over Rational Field
Category of finite dimensional nilpotent Lie algebras with basis over Rational Field
"""
LieAlgebraWithGenerators.__init__(self, R, names, index_set, category)
self.__ngens = len(self._indices)
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/lie_algebras/morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class LieAlgebraHomomorphism_im_gens(Morphism):
It should be a map from the base ring of the domain to the
base ring of the codomain.
Note that if base_map is nontrivial then the result will
not be a morphism in the category of lie algebras over
not be a morphism in the category of Lie algebras over
the base ring.
- ``check`` -- whether to run checks on the validity of the defining data
Expand Down Expand Up @@ -380,7 +380,7 @@ class LieAlgebraMorphism_from_generators(LieAlgebraHomomorphism_im_gens):
It should be a map from the base ring of the domain to the
base ring of the codomain.
Note that if base_map is nontrivial then the result will
not be a morphism in the category of lie algebras over
not be a morphism in the category of Lie algebras over
the base ring.
- ``check`` -- (default: ``True``) boolean; if ``False`` the
values on the Lie brackets implied by ``on_generators`` will
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/nilpotent_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class FreeNilpotentLieAlgebra(NilpotentLieAlgebra_dense):
sage: L = LieAlgebra(QQ, 3, step=3)
sage: L.category()
Category of finite dimensional stratified lie algebras with basis over Rational Field
Category of finite dimensional stratified Lie algebras with basis over Rational Field
sage: L in LieAlgebras(QQ).Nilpotent()
True
Expand Down
2 changes: 1 addition & 1 deletion src/sage/algebras/lie_algebras/quotient.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class LieQuotient_finite_dimensional_with_basis(LieAlgebraWithStructureCoefficie
L: Free Nilpotent Lie algebra on 5 generators (X_1, X_2, X_12, X_112, X_122) over Rational Field
I: Ideal (X_122)
sage: E.category()
Join of Category of finite dimensional nilpotent lie algebras with basis
Join of Category of finite dimensional nilpotent Lie algebras with basis
over Rational Field and Category of subquotients of sets
sage: E.basis().list()
[X_1, X_2, X_12, X_112]
Expand Down
4 changes: 2 additions & 2 deletions src/sage/algebras/steenrod/steenrod_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def __init__(self, p=2, basis='milnor', **kwds):
sage: TestSuite(SteenrodAlgebra(basis='woody')).run() # long time
sage: A3 = SteenrodAlgebra(3)
sage: A3.category()
Category of supercocommutative super hopf algebras
Category of supercocommutative super Hopf algebras
with basis over Finite Field of size 3
sage: TestSuite(A3).run() # long time
sage: TestSuite(SteenrodAlgebra(basis='adem', p=3)).run()
Expand Down Expand Up @@ -3842,7 +3842,7 @@ def SteenrodAlgebra(p=2, basis='milnor', generic='auto', **kwds):
sage: A.is_division_algebra()
False
sage: A.category()
Category of supercocommutative super hopf algebras
Category of supercocommutative super Hopf algebras
with basis over Finite Field of size 2
There are methods for constructing elements of the Steenrod
Expand Down
23 changes: 12 additions & 11 deletions src/sage/categories/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
_join_cache = WeakValueDictionary()


HALL_OF_FAME = ['Coxeter', 'Hopf', 'Weyl', 'Lie', 'Hecke']


class Category(UniqueRepresentation, SageObject):
r"""
The base class for modeling mathematical categories, like for example:
Expand Down Expand Up @@ -513,14 +516,10 @@ def _repr_object_names(self):
sage: PrincipalIdealDomains()._repr_object_names()
'principal ideal domains'
"""
i = -1
s = self._label
while i < len(s) - 1:
for i in range(len(s)):
if s[i].isupper():
s = s[:i] + " " + s[i].lower() + s[i + 1:]
break
return s.lstrip()
words = "".join(letter if not letter.isupper() else ";" + letter
for letter in self._label).split(";")
return " ".join(w if w in HALL_OF_FAME else w.lower()
for w in words).lstrip()

def _short_name(self):
"""
Expand Down Expand Up @@ -1235,7 +1234,7 @@ def structure(self):
Category of right modules over Rational Field,
Category of left modules over Rational Field)
sage: structure(HopfAlgebras(QQ).Graded().WithBasis().Connected())
(Category of hopf algebras over Rational Field,
(Category of Hopf algebras over Rational Field,
Category of graded modules over Rational Field)
This method is used in :meth:`is_full_subcategory` for
Expand Down Expand Up @@ -2018,7 +2017,7 @@ def _with_axiom_as_tuple(self, axiom):
Category of commutative magmas,
Category of finite additive groups)
sage: HopfAlgebras(QQ)._with_axiom_as_tuple('FiniteDimensional')
(Category of hopf algebras over Rational Field,
(Category of Hopf algebras over Rational Field,
Category of finite dimensional vector spaces over Rational Field)
"""
if axiom in self.axioms():
Expand Down Expand Up @@ -2595,11 +2594,13 @@ def category_sample():
[Category of Coxeter groups,
Category of G-sets for Symmetric group of order 8! as a permutation group,
Category of Hecke modules over Rational Field,
Category of Hopf algebras over Rational Field,
Category of Hopf algebras with basis over Rational Field,
Category of Lie algebras over Rational Field,
Category of Weyl groups,
Category of additive magmas, ...,
Category of fields, ...,
Category of graded hopf algebras with basis over Rational Field, ...,
Category of graded Hopf algebras with basis over Rational Field, ...,
Category of modular abelian varieties over Rational Field, ...,
Category of simplicial complexes, ...,
Category of vector spaces over Rational Field, ...
Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/complex_reflection_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class ComplexReflectionGroups(Category_singleton):
sage: ComplexReflectionGroups()
Category of complex reflection groups
sage: ComplexReflectionGroups().super_categories()
[Category of complex reflection or generalized coxeter groups]
[Category of complex reflection or generalized Coxeter groups]
sage: ComplexReflectionGroups().all_super_categories()
[Category of complex reflection groups,
Category of complex reflection or generalized coxeter groups,
Category of complex reflection or generalized Coxeter groups,
Category of groups,
Category of monoids,
Category of finitely generated semigroups,
Expand Down Expand Up @@ -87,7 +87,7 @@ def super_categories(self):
sage: from sage.categories.complex_reflection_groups import ComplexReflectionGroups
sage: ComplexReflectionGroups().super_categories()
[Category of complex reflection or generalized coxeter groups]
[Category of complex reflection or generalized Coxeter groups]
"""
return [ComplexReflectionOrGeneralizedCoxeterGroups()]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ComplexReflectionOrGeneralizedCoxeterGroups(Category_singleton):
sage: from sage.categories.complex_reflection_or_generalized_coxeter_groups import ComplexReflectionOrGeneralizedCoxeterGroups
sage: C = ComplexReflectionOrGeneralizedCoxeterGroups(); C
Category of complex reflection or generalized coxeter groups
Category of complex reflection or generalized Coxeter groups
sage: C.super_categories()
[Category of finitely generated enumerated groups]
Expand All @@ -108,7 +108,7 @@ def super_categories(self):
sage: from sage.categories.complex_reflection_groups import ComplexReflectionGroups
sage: ComplexReflectionGroups().super_categories()
[Category of complex reflection or generalized coxeter groups]
[Category of complex reflection or generalized Coxeter groups]
"""
return [Groups().FinitelyGenerated()]

Expand All @@ -117,7 +117,7 @@ def Irreducible(self):
r"""
Return the full subcategory of irreducible objects of ``self``.
A complex reflection group, or generalized coxeter group
A complex reflection group, or generalized Coxeter group
is *reducible* if its simple reflections can be split in
two sets `X` and `Y` such that the elements of `X` commute
with that of `Y`. In particular, the group is then direct
Expand Down
15 changes: 2 additions & 13 deletions src/sage/categories/coxeter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CoxeterGroups(Category_singleton):
sage: C = CoxeterGroups(); C
Category of Coxeter groups
sage: C.super_categories()
[Category of generalized coxeter groups]
[Category of generalized Coxeter groups]
sage: W = C.example(); W
The symmetric group on {0, ..., 3}
Expand Down Expand Up @@ -105,7 +105,7 @@ def super_categories(self):
EXAMPLES::
sage: CoxeterGroups().super_categories()
[Category of generalized coxeter groups]
[Category of generalized Coxeter groups]
"""
return [GeneralizedCoxeterGroups()]

Expand All @@ -128,17 +128,6 @@ def additional_structure(self):
Finite = LazyImport('sage.categories.finite_coxeter_groups', 'FiniteCoxeterGroups')
Algebras = LazyImport('sage.categories.coxeter_group_algebras', 'CoxeterGroupAlgebras')

def _repr_object_names(self):
"""
Return the name of the objects of this category.
EXAMPLES::
sage: CoxeterGroups().Finite()
Category of finite Coxeter groups
"""
return "Coxeter groups"

class ParentMethods:
@abstract_method
def coxeter_matrix(self):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/examples/hopf_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, R, G):
sage: from sage.categories.examples.hopf_algebras_with_basis import MyGroupAlgebra
sage: A = MyGroupAlgebra(QQ, DihedralGroup(6))
sage: A.category()
Category of finite dimensional hopf algebras with basis over Rational Field
Category of finite dimensional Hopf algebras with basis over Rational Field
sage: TestSuite(A).run()
"""
self._group = G
Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/filtered_hopf_algebras_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class FilteredHopfAlgebrasWithBasis(FilteredModulesCategory):
EXAMPLES::
sage: C = HopfAlgebrasWithBasis(ZZ).Filtered(); C
Category of filtered hopf algebras with basis over Integer Ring
Category of filtered Hopf algebras with basis over Integer Ring
sage: C.super_categories()
[Category of hopf algebras with basis over Integer Ring,
[Category of Hopf algebras with basis over Integer Ring,
Category of filtered algebras with basis over Integer Ring,
Category of filtered coalgebras with basis over Integer Ring]
Expand All @@ -53,7 +53,7 @@ def super_categories(self):
EXAMPLES::
sage: HopfAlgebrasWithBasis(QQ).Filtered().WithRealizations().super_categories()
[Join of Category of hopf algebras over Rational Field
[Join of Category of Hopf algebras over Rational Field
and Category of filtered algebras over Rational Field
and Category of filtered coalgebras over Rational Field]
Expand Down
4 changes: 2 additions & 2 deletions src/sage/categories/finite_coxeter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FiniteCoxeterGroups(CategoryWithAxiom):
sage: CoxeterGroups.Finite()
Category of finite Coxeter groups
sage: FiniteCoxeterGroups().super_categories()
[Category of finite generalized coxeter groups,
[Category of finite generalized Coxeter groups,
Category of Coxeter groups]
sage: G = CoxeterGroups().Finite().example()
Expand All @@ -54,7 +54,7 @@ def extra_super_categories(self):
EXAMPLES::
sage: CoxeterGroups().Finite().super_categories()
[Category of finite generalized coxeter groups,
[Category of finite generalized Coxeter groups,
Category of Coxeter groups]
"""
from sage.categories.complex_reflection_groups import ComplexReflectionGroups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class FiniteDimensionalGradedLieAlgebrasWithBasis(CategoryWithAxiom_over_base_ri
EXAMPLES::
sage: C = LieAlgebras(ZZ).WithBasis().FiniteDimensional().Graded(); C
Category of finite dimensional graded lie algebras with basis over Integer Ring
Category of finite dimensional graded Lie algebras with basis over Integer Ring
sage: C.super_categories()
[Category of graded lie algebras with basis over Integer Ring,
Category of finite dimensional lie algebras with basis over Integer Ring]
[Category of graded Lie algebras with basis over Integer Ring,
Category of finite dimensional Lie algebras with basis over Integer Ring]
sage: C is LieAlgebras(ZZ).WithBasis().FiniteDimensional().Graded()
True
Expand Down Expand Up @@ -120,7 +120,7 @@ class Stratified(CategoryWithAxiom_over_base_ring):
sage: C = LieAlgebras(QQ).WithBasis().Graded().Stratified().FiniteDimensional()
sage: C
Category of finite dimensional stratified lie algebras with basis over Rational Field
Category of finite dimensional stratified Lie algebras with basis over Rational Field
A finite-dimensional stratified Lie algebra is nilpotent::
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
r"""
Finite dimensional Hopf algebras with basis
"""
#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr>
# 2011 Nicolas M. Thiery <nthiery at users.sf.net>
#
# Distributed under the terms of the GNU General Public License (GPL)
# http://www.gnu.org/licenses/
#******************************************************************************
# https://www.gnu.org/licenses/
# *****************************************************************************

from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring


class FiniteDimensionalHopfAlgebrasWithBasis(CategoryWithAxiom_over_base_ring):
"""
The category of finite dimensional Hopf algebras with a
distinguished basis.
EXAMPLES::
sage: FiniteDimensionalHopfAlgebrasWithBasis(QQ) # fixme: Hopf should be capitalized
Category of finite dimensional hopf algebras with basis over Rational Field
sage: FiniteDimensionalHopfAlgebrasWithBasis(QQ)
Category of finite dimensional Hopf algebras with basis over Rational Field
sage: FiniteDimensionalHopfAlgebrasWithBasis(QQ).super_categories()
[Category of hopf algebras with basis over Rational Field,
[Category of Hopf algebras with basis over Rational Field,
Category of finite dimensional algebras with basis over Rational Field]
TESTS::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Graded(GradedModulesCategory):
EXAMPLES::
sage: LieConformalAlgebras(QQbar).FinitelyGenerated().Graded() # needs sage.rings.number_field
Category of H-graded finitely generated lie conformal algebras
Category of H-graded finitely generated Lie conformal algebras
over Algebraic Field
"""
def _repr_object_names(self):
Expand Down
Loading

0 comments on commit b088a97

Please sign in to comment.