Skip to content

Commit 9d9cae3

Browse files
nthieryAnne Schilling
authored and
Anne Schilling
committed
# Sat Oct 19 11:50:04 2013 +0200
# Node ID f98c0b44c17dbb718c8449f3eabcbc7b8bdc825d # Parent 2306f17ea8f3e40d1a3668c24695a50bfad34d1f #10963: More functorial constructions
1 parent 0251a33 commit 9d9cae3

File tree

156 files changed

+7316
-3910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+7316
-3910
lines changed

src/doc/en/reference/categories/index.rst

+25-5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Category Theory
88
sage/categories/tutorial
99
sage/categories/category
1010
sage/categories/category_types
11+
sage/categories/category_singleton
12+
sage/categories/category_with_axiom
1113
sage/categories/map
1214
sage/categories/homset
1315
sage/categories/morphism
@@ -42,11 +44,16 @@ Categories
4244
.. toctree::
4345
:maxdepth: 2
4446

47+
sage/categories/additive_groups
4548
sage/categories/additive_magmas
49+
sage/categories/additive_monoids
50+
sage/categories/additive_semigroups
51+
sage/categories/affine_weyl_groups
4652
sage/categories/algebra_ideals
4753
sage/categories/algebra_modules
4854
sage/categories/algebras
4955
sage/categories/algebras_with_basis
56+
sage/categories/associative_algebras
5057
sage/categories/bialgebras
5158
sage/categories/bialgebras_with_basis
5259
sage/categories/bimodules
@@ -62,13 +69,14 @@ Categories
6269
sage/categories/commutative_rings
6370
sage/categories/coxeter_groups
6471
sage/categories/crystals
72+
sage/categories/distributive_magmas_and_additive_magmas
6573
sage/categories/division_rings
6674
sage/categories/domains
6775
sage/categories/enumerated_sets
6876
sage/categories/euclidean_domains
6977
sage/categories/fields
70-
sage/categories/finite_crystals
7178
sage/categories/finite_coxeter_groups
79+
sage/categories/finite_crystals
7280
sage/categories/finite_dimensional_algebras_with_basis
7381
sage/categories/finite_dimensional_bialgebras_with_basis
7482
sage/categories/finite_dimensional_coalgebras_with_basis
@@ -77,12 +85,14 @@ Categories
7785
sage/categories/finite_enumerated_sets
7886
sage/categories/finite_fields
7987
sage/categories/finite_groups
80-
sage/categories/finite_posets
8188
sage/categories/finite_lattice_posets
8289
sage/categories/finite_monoids
8390
sage/categories/finite_permutation_groups
91+
sage/categories/finite_posets
8492
sage/categories/finite_semigroups
93+
sage/categories/finite_sets
8594
sage/categories/finite_weyl_groups
95+
sage/categories/function_fields
8696
sage/categories/gcd_domains
8797
sage/categories/graded_algebras
8898
sage/categories/graded_algebras_with_basis
@@ -94,6 +104,7 @@ Categories
94104
sage/categories/graded_hopf_algebras_with_basis
95105
sage/categories/graded_modules
96106
sage/categories/graded_modules_with_basis
107+
sage/categories/group_algebras
97108
sage/categories/groupoid
98109
sage/categories/groups
99110
sage/categories/g_sets
@@ -106,6 +117,7 @@ Categories
106117
sage/categories/lattice_posets
107118
sage/categories/left_modules
108119
sage/categories/magmas
120+
sage/categories/magmatic_algebras
109121
sage/categories/matrix_algebras
110122
sage/categories/modular_abelian_varieties
111123
sage/categories/modules
@@ -115,10 +127,13 @@ Categories
115127
sage/categories/number_fields
116128
sage/categories/objects
117129
sage/categories/partially_ordered_monoids
118-
sage/categories/posets
130+
sage/categories/permutation_groups
119131
sage/categories/pointed_sets
132+
sage/categories/polyhedra
133+
sage/categories/posets
120134
sage/categories/principal_ideal_domains
121135
sage/categories/quotient_fields
136+
sage/categories/regular_crystals
122137
sage/categories/right_modules
123138
sage/categories/ring_ideals
124139
sage/categories/rings
@@ -128,7 +143,9 @@ Categories
128143
sage/categories/semirings
129144
sage/categories/sets_cat
130145
sage/categories/sets_with_grading
146+
sage/categories/sets_with_partial_maps
131147
sage/categories/unique_factorization_domains
148+
sage/categories/unital_algebras
132149
sage/categories/vector_spaces
133150
sage/categories/weyl_groups
134151

@@ -151,19 +168,22 @@ Examples of parents using categories
151168
sage/categories/examples/commutative_additive_semigroups
152169
sage/categories/examples/coxeter_groups
153170
sage/categories/examples/crystals
171+
sage/categories/examples/facade_sets
154172
sage/categories/examples/finite_coxeter_groups
155173
sage/categories/examples/finite_enumerated_sets
156174
sage/categories/examples/finite_monoids
157175
sage/categories/examples/finite_semigroups
158176
sage/categories/examples/finite_weyl_groups
177+
sage/categories/examples/group_algebras
159178
sage/categories/examples/hopf_algebras_with_basis
160179
sage/categories/examples/infinite_enumerated_sets
161180
sage/categories/examples/monoids
162-
sage/categories/examples/semigroups
181+
sage/categories/examples/posets
163182
sage/categories/examples/semigroups_cython
183+
sage/categories/examples/semigroups
164184
sage/categories/examples/sets_cat
165-
sage/categories/examples/with_realizations
166185
sage/categories/examples/sets_with_grading
186+
sage/categories/examples/with_realizations
167187

168188
Miscellaneous
169189
=============

src/doc/en/thematic_tutorials/coercion_and_categories.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ coincide::
404404

405405
sage: import inspect
406406
sage: len([s for s in dir(MS1) if inspect.ismethod(getattr(MS1,s,None))])
407-
55
407+
56
408408
sage: len([s for s in dir(MS2) if inspect.ismethod(getattr(MS2,s,None))])
409-
78
409+
79
410410
sage: MS1.__class__ is MS2.__class__
411411
True
412412

@@ -526,7 +526,7 @@ monoids\---see
526526
:meth:`~sage.categories.commutative_additive_monoids.CommutativeAdditiveMonoids.ParentMethods.sum`::
527527

528528
sage: P.sum.__module__
529-
'sage.categories.commutative_additive_monoids'
529+
'sage.categories.additive_monoids'
530530

531531
.. end of output
532532

src/doc/en/thematic_tutorials/tutorial-objects-and-classes.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ Some particular actions modify the data structure of ``el``::
308308
<type 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement'>
309309
sage: id4.__dict__
310310
dict_proxy({'__module__': 'sage.categories.category',
311-
'_reduction': (<built-in function getattr>, (Join of Category
312-
of finite permutation groups and Category of finite weyl
313-
groups, 'element_class')), '__doc__': '\n Put methods for
314-
elements here.\n ', '_sage_src_lines_': <staticmethod object
315-
at 0x...>})
311+
'_reduction': (<built-in function getattr>,
312+
(Join of Category of finite permutation groups
313+
and Category of finite weyl groups, 'element_class')),
314+
'__doc__': "...",
315+
'_sage_src_lines_': <staticmethod object at 0x...>})
316316

317317
.. note::
318318

src/sage/algebras/group_algebra_new.py

+48-93
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
from sage.misc.cachefunc import cached_method
113113
from sage.categories.pushout import ConstructionFunctor
114114
from sage.combinat.free_module import CombinatorialFreeModule
115-
from sage.categories.all import Rings, HopfAlgebrasWithBasis, Hom
115+
from sage.categories.all import Rings, GroupAlgebras, Hom
116116
from sage.categories.morphism import SetMorphism
117117

118118

@@ -133,7 +133,7 @@ class GroupAlgebraFunctor (ConstructionFunctor) :
133133
sage: loads(dumps(F)) == F
134134
True
135135
sage: GroupAlgebra(SU(2, GF(4, 'a')), IntegerModRing(12)).category()
136-
Category of hopf algebras with basis over Ring of integers modulo 12
136+
Category of group algebras over Ring of integers modulo 12
137137
"""
138138
def __init__(self, group) :
139139
r"""
@@ -143,7 +143,7 @@ def __init__(self, group) :
143143
144144
sage: from sage.algebras.group_algebra_new import GroupAlgebraFunctor
145145
sage: GroupAlgebra(SU(2, GF(4, 'a')), IntegerModRing(12)).category()
146-
Category of hopf algebras with basis over Ring of integers modulo 12
146+
Category of group algebras over Ring of integers modulo 12
147147
"""
148148
self.__group = group
149149

@@ -206,7 +206,7 @@ def _apply_functor_to_morphism(self, f) :
206206
codomain = self(f.codomain())
207207
return SetMorphism(Hom(self(f.domain()), codomain, Rings()), lambda x: sum(codomain(g) * f(c) for (g, c) in dict(x).iteritems()))
208208

209-
class GroupAlgebra(CombinatorialFreeModule, Algebra):
209+
class GroupAlgebra(CombinatorialFreeModule):
210210
r"""
211211
Create the given group algebra.
212212
@@ -231,10 +231,51 @@ class GroupAlgebra(CombinatorialFreeModule, Algebra):
231231
TypeError: "1" is not a group
232232
233233
sage: GroupAlgebra(SU(2, GF(4, 'a')), IntegerModRing(12)).category()
234-
Category of hopf algebras with basis over Ring of integers modulo 12
234+
Category of group algebras over Ring of integers modulo 12
235235
sage: GroupAlgebra(KleinFourGroup()) is GroupAlgebra(KleinFourGroup())
236236
True
237237
238+
The one of the group indexes the one of this algebra::
239+
240+
sage: A = GroupAlgebra(DihedralGroup(6), QQ)
241+
sage: A.one_basis()
242+
()
243+
sage: A.one()
244+
()
245+
246+
The product of two basis elements is induced by the product of the
247+
corresponding elements of the group::
248+
249+
sage: A = GroupAlgebra(DihedralGroup(3), QQ)
250+
sage: (a, b) = A._group.gens()
251+
sage: a*b
252+
(1,2)
253+
sage: A.product_on_basis(a, b)
254+
(1,2)
255+
256+
The basis elements are group-like for the coproduct:
257+
`\Delta(g) = g \otimes g`::
258+
259+
sage: A = GroupAlgebra(DihedralGroup(3), QQ)
260+
sage: (a, b) = A._group.gens()
261+
sage: A.coproduct_on_basis(a)
262+
(1,2,3) # (1,2,3)
263+
264+
The counit on the basis elements is 1::
265+
266+
sage: A = GroupAlgebra(DihedralGroup(6), QQ)
267+
sage: (a, b) = A._group.gens()
268+
sage: A.counit_on_basis(a)
269+
1
270+
271+
The antipode on basis elements is given by `\chi(g) = g^{-1}`::
272+
273+
sage: A = GroupAlgebra(DihedralGroup(3), QQ)
274+
sage: (a, b) = A._group.gens(); a
275+
(1,2,3)
276+
sage: A.antipode_on_basis(a)
277+
(1,3,2)
278+
238279
TESTS::
239280
240281
sage: A = GroupAlgebra(GL(3, GF(7)))
@@ -266,56 +307,17 @@ def __init__(self, group, base_ring=IntegerRing()):
266307
CombinatorialFreeModule.__init__(self, base_ring, group,
267308
prefix='',
268309
bracket=False,
269-
category=HopfAlgebrasWithBasis(base_ring))
310+
category=GroupAlgebras(base_ring))
270311

271312
if not base_ring.has_coerce_map_from(group) :
272313
## some matrix groups assume that coercion is only valid to
273314
## other matrix groups. This is a workaround
274315
## call _element_constructor_ to coerce group elements
275316
#try :
276-
self._populate_coercion_lists_(coerce_list=[base_ring, group])
277-
#except TypeError :
278-
# self._populate_coercion_lists_( coerce_list = [base_ring] )
279-
else :
280-
self._populate_coercion_lists_(coerce_list=[base_ring])
317+
self._populate_coercion_lists_(coerce_list=[group])
281318

282319
# Methods taken from sage.categories.examples.hopf_algebras_with_basis:
283320

284-
@cached_method
285-
def one_basis(self):
286-
"""
287-
Returns the one of the group, which indexes the one of this
288-
algebra, as per :meth:`AlgebrasWithBasis.ParentMethods.one_basis`.
289-
290-
EXAMPLES::
291-
292-
sage: A = GroupAlgebra(DihedralGroup(6), QQ)
293-
sage: A.one_basis()
294-
()
295-
sage: A.one()
296-
()
297-
"""
298-
return self._group.one()
299-
300-
def product_on_basis(self, g1, g2):
301-
r"""
302-
Product, on basis elements, as per
303-
:meth:`AlgebrasWithBasis.ParentMethods.product_on_basis`.
304-
305-
The product of two basis elements is induced by the product of
306-
the corresponding elements of the group.
307-
308-
EXAMPLES::
309-
310-
sage: A = GroupAlgebra(DihedralGroup(3), QQ)
311-
sage: (a, b) = A._group.gens()
312-
sage: a*b
313-
(1,2)
314-
sage: A.product_on_basis(a, b)
315-
(1,2)
316-
"""
317-
return self.basis()[g1 * g2]
318-
319321
@cached_method
320322
def algebra_generators(self):
321323
r"""
@@ -336,53 +338,6 @@ def algebra_generators(self):
336338

337339
gens = algebra_generators
338340

339-
def coproduct_on_basis(self, g):
340-
r"""
341-
Coproduct, on basis elements, as per :meth:`HopfAlgebrasWithBasis.ParentMethods.coproduct_on_basis`.
342-
343-
The basis elements are group-like: `\Delta(g) = g \otimes g`.
344-
345-
EXAMPLES::
346-
347-
sage: A = GroupAlgebra(DihedralGroup(3), QQ)
348-
sage: (a, b) = A._group.gens()
349-
sage: A.coproduct_on_basis(a)
350-
(1,2,3) # (1,2,3)
351-
"""
352-
from sage.categories.all import tensor
353-
g = self.monomial(g)
354-
return tensor([g, g])
355-
356-
def counit_on_basis(self, g):
357-
r"""
358-
Counit, on basis elements, as per :meth:`HopfAlgebrasWithBasis.ParentMethods.counit_on_basis`.
359-
360-
The counit on the basis elements is 1.
361-
362-
EXAMPLES::
363-
364-
sage: A = GroupAlgebra(DihedralGroup(6), QQ)
365-
sage: (a, b) = A._group.gens()
366-
sage: A.counit_on_basis(a)
367-
1
368-
"""
369-
return self.base_ring().one()
370-
371-
def antipode_on_basis(self, g):
372-
r"""
373-
Antipode, on basis elements, as per :meth:`HopfAlgebrasWithBasis.ParentMethods.antipode_on_basis`.
374-
375-
It is given, on basis elements, by `\chi(g) = g^{-1}`
376-
377-
EXAMPLES::
378-
379-
sage: A = GroupAlgebra(DihedralGroup(3), QQ)
380-
sage: (a, b) = A._group.gens()
381-
sage: A.antipode_on_basis(a)
382-
(1,3,2)
383-
"""
384-
return self.monomial(~g)
385-
386341
# other methods:
387342

388343
def ngens(self) :

0 commit comments

Comments
 (0)