Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/categories/coalgebras.py
4100 views
1
r"""
2
Coalgebras
3
"""
4
#*****************************************************************************
5
# Copyright (C) 2008 Teresa Gomez-Diaz (CNRS) <[email protected]>
6
# Copyright (C) 2008-2009 Nicolas M. Thiery <nthiery at users.sf.net>
7
#
8
# Distributed under the terms of the GNU General Public License (GPL)
9
# http://www.gnu.org/licenses/
10
#******************************************************************************
11
12
from category_types import Category_over_base_ring
13
from sage.categories.all import Modules, Algebras
14
from sage.categories.tensor import TensorProductsCategory, tensor
15
from sage.categories.dual import DualObjectsCategory
16
from sage.misc.abstract_method import abstract_method
17
from sage.misc.cachefunc import cached_method
18
19
class Coalgebras(Category_over_base_ring):
20
"""
21
The category of coalgebras
22
23
EXAMPLES::
24
25
sage: Coalgebras(QQ)
26
Category of coalgebras over Rational Field
27
sage: Coalgebras(QQ).super_categories()
28
[Category of vector spaces over Rational Field]
29
sage: Coalgebras(QQ).all_super_categories()
30
[Category of coalgebras over Rational Field,
31
Category of vector spaces over Rational Field,
32
Category of modules over Rational Field,
33
Category of bimodules over Rational Field on the left and Rational Field on the right,
34
Category of left modules over Rational Field,
35
Category of right modules over Rational Field,
36
Category of commutative additive groups,
37
Category of commutative additive monoids,
38
Category of commutative additive semigroups,
39
Category of additive magmas,
40
Category of sets,
41
Category of sets with partial maps,
42
Category of objects]
43
44
TESTS::
45
46
sage: TestSuite(Coalgebras(ZZ)).run()
47
"""
48
def super_categories(self):
49
"""
50
EXAMPLES::
51
52
sage: Coalgebras(QQ).super_categories()
53
[Category of vector spaces over Rational Field]
54
"""
55
return [Modules(self.base_ring())]
56
57
class ParentMethods:
58
#def __init_add__(self): # The analogue of initDomainAdd
59
# # Will declare the coproduct of self to the coercion mechanism when it exists
60
# pass
61
62
@cached_method
63
def tensor_square(self):
64
"""
65
Returns the tensor square of ``self``
66
67
EXAMPLES::
68
69
sage: A = HopfAlgebrasWithBasis(QQ).example()
70
sage: A.tensor_square()
71
An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field # An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field
72
"""
73
return tensor([self, self])
74
75
@abstract_method
76
def counit(self, x):
77
"""
78
Returns the counit of x.
79
80
Eventually, there will be a default implementation,
81
delegating to the overloading mechanism and forcing the
82
conversion back
83
84
EXAMPLES::
85
86
sage: A = HopfAlgebrasWithBasis(QQ).example(); A
87
An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field
88
sage: [a,b] = A.algebra_generators()
89
sage: a, A.counit(a)
90
(B[(1,2,3)], 1)
91
sage: b, A.counit(b)
92
(B[(1,3)], 1)
93
94
TODO: implement some tests of the axioms of coalgebras, bialgebras
95
and Hopf algebras using the counit.
96
"""
97
98
99
@abstract_method
100
def coproduct(self, x):
101
"""
102
Returns the coproduct of x.
103
104
Eventually, there will be a default implementation,
105
delegating to the overloading mechanism and forcing the
106
conversion back
107
108
EXAMPLES::
109
110
sage: A = HopfAlgebrasWithBasis(QQ).example(); A
111
An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field
112
sage: [a,b] = A.algebra_generators()
113
sage: a, A.coproduct(a)
114
(B[(1,2,3)], B[(1,2,3)] # B[(1,2,3)])
115
sage: b, A.coproduct(b)
116
(B[(1,3)], B[(1,3)] # B[(1,3)])
117
"""
118
#return self.tensor_square()(overloaded_coproduct(x))
119
120
class ElementMethods:
121
def coproduct(self):
122
"""
123
Returns the coproduct of ``self``
124
125
EXAMPLES::
126
127
sage: A = HopfAlgebrasWithBasis(QQ).example(); A
128
An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field
129
sage: [a,b] = A.algebra_generators()
130
sage: a, a.coproduct()
131
(B[(1,2,3)], B[(1,2,3)] # B[(1,2,3)])
132
sage: b, b.coproduct()
133
(B[(1,3)], B[(1,3)] # B[(1,3)])
134
"""
135
return self.parent().coproduct(self)
136
137
def counit(self):
138
"""
139
Returns the counit of ``self``
140
141
EXAMPLES::
142
143
sage: A = HopfAlgebrasWithBasis(QQ).example(); A
144
An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field
145
sage: [a,b] = A.algebra_generators()
146
sage: a, a.counit()
147
(B[(1,2,3)], 1)
148
sage: b, b.counit()
149
(B[(1,3)], 1)
150
"""
151
return self.parent().counit(self)
152
153
class TensorProducts(TensorProductsCategory):
154
155
@cached_method
156
def extra_super_categories(self):
157
"""
158
EXAMPLES::
159
160
sage: Coalgebras(QQ).TensorProducts().extra_super_categories()
161
[Category of coalgebras over Rational Field]
162
sage: Coalgebras(QQ).TensorProducts().super_categories()
163
[Category of coalgebras over Rational Field]
164
165
Meaning: a tensor product of coalgebras is a coalgebra
166
"""
167
return [self.base_category()]
168
169
class ParentMethods:
170
# TODO: provide this default implementation of one if one_basis is not implemented
171
#def one(self):
172
# return tensor(module.one() for module in self.modules)
173
pass
174
175
class ElementMethods:
176
pass
177
178
class DualObjects(DualObjectsCategory):
179
180
def extra_super_categories(self):
181
r"""
182
Returns the dual category
183
184
EXAMPLES:
185
186
The category of coalgebras over the Rational Field is dual
187
to the category of algebras over the same field::
188
189
sage: C = Coalgebras(QQ)
190
sage: C.dual()
191
Category of duals of coalgebras over Rational Field
192
sage: C.dual().super_categories() # indirect doctest
193
[Category of algebras over Rational Field, Category of duals of vector spaces over Rational Field]
194
195
"""
196
from sage.categories.algebras import Algebras
197
return [Algebras(self.base_category().base_ring())]
198
199