Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

r""" 

Hopf algebras with basis 

""" 

#***************************************************************************** 

# Copyright (C) 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr> 

# Copyright (C) 2008-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/ 

#****************************************************************************** 

 

from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring 

from sage.categories.tensor import TensorProductsCategory 

from sage.misc.abstract_method import abstract_method 

from sage.misc.cachefunc import cached_method 

from sage.misc.lazy_attribute import lazy_attribute 

from sage.misc.lazy_import import LazyImport 

 

class HopfAlgebrasWithBasis(CategoryWithAxiom_over_base_ring): 

""" 

The category of Hopf algebras with a distinguished basis 

 

EXAMPLES:: 

 

sage: C = HopfAlgebrasWithBasis(QQ) 

sage: C 

Category of hopf algebras with basis over Rational Field 

sage: C.super_categories() 

[Category of hopf algebras over Rational Field, 

Category of bialgebras with basis over Rational Field] 

 

We now show how to use a simple Hopf algebra, namely the group algebra of the dihedral group 

(see also AlgebrasWithBasis):: 

 

sage: A = C.example(); A 

An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field 

sage: A.__custom_name = "A" 

sage: A.category() 

Category of finite dimensional hopf algebras with basis over Rational Field 

 

sage: A.one_basis() 

() 

sage: A.one() 

B[()] 

 

sage: A.base_ring() 

Rational Field 

sage: A.basis().keys() 

Dihedral group of order 6 as a permutation group 

 

sage: [a,b] = A.algebra_generators() 

sage: a, b 

(B[(1,2,3)], B[(1,3)]) 

sage: a^3, b^2 

(B[()], B[()]) 

sage: a*b 

B[(1,2)] 

 

sage: A.product # todo: not quite ... 

<bound method MyGroupAlgebra_with_category._product_from_product_on_basis_multiply of A> 

sage: A.product(b,b) 

B[()] 

 

sage: A.zero().coproduct() 

0 

sage: A.zero().coproduct().parent() 

A # A 

sage: a.coproduct() 

B[(1,2,3)] # B[(1,2,3)] 

 

sage: TestSuite(A).run(verbose=True) 

running ._test_additive_associativity() . . . pass 

running ._test_an_element() . . . pass 

running ._test_antipode() . . . pass 

running ._test_associativity() . . . pass 

running ._test_cardinality() . . . pass 

running ._test_category() . . . pass 

running ._test_characteristic() . . . pass 

running ._test_distributivity() . . . pass 

running ._test_elements() . . . 

Running the test suite of self.an_element() 

running ._test_category() . . . pass 

running ._test_eq() . . . pass 

running ._test_new() . . . pass 

running ._test_nonzero_equal() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

pass 

running ._test_elements_eq_reflexive() . . . pass 

running ._test_elements_eq_symmetric() . . . pass 

running ._test_elements_eq_transitive() . . . pass 

running ._test_elements_neq() . . . pass 

running ._test_eq() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_one() . . . pass 

running ._test_pickling() . . . pass 

running ._test_prod() . . . pass 

running ._test_some_elements() . . . pass 

running ._test_zero() . . . pass 

sage: A.__class__ 

<class 'sage.categories.examples.hopf_algebras_with_basis.MyGroupAlgebra_with_category'> 

sage: A.element_class 

<class 'sage.categories.examples.hopf_algebras_with_basis.MyGroupAlgebra_with_category.element_class'> 

 

Let us look at the code for implementing A:: 

 

sage: A?? # todo: not implemented 

 

TESTS:: 

 

sage: TestSuite(A).run() 

sage: TestSuite(C).run() 

""" 

 

def example(self, G = None): 

""" 

Returns an example of algebra with basis:: 

 

sage: HopfAlgebrasWithBasis(QQ['x']).example() 

An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Univariate Polynomial Ring in x over Rational Field 

 

An other group can be specified as optional argument:: 

 

sage: HopfAlgebrasWithBasis(QQ).example(SymmetricGroup(4)) 

An example of Hopf algebra with basis: the group algebra of the Symmetric group of order 4! as a permutation group over Rational Field 

""" 

from sage.categories.examples.hopf_algebras_with_basis import MyGroupAlgebra 

from sage.groups.perm_gps.permgroup_named import DihedralGroup 

if G is None: 

G = DihedralGroup(3) 

return MyGroupAlgebra(self.base_ring(), G) 

 

# This is only correct in the finite dimensional / graded case 

# def dual(self): 

# """ 

# Returns the dual category 

 

# EXAMPLES: 

 

# The category of Hopf algebras over any field is self dual:: 

 

# sage: C = HopfAlgebrasWithBasis(QQ) 

# sage: C.dual() 

# Category of hopf algebras with basis over Rational Field 

# """ 

# return self 

 

FiniteDimensional = LazyImport('sage.categories.finite_dimensional_hopf_algebras_with_basis', 

'FiniteDimensionalHopfAlgebrasWithBasis') 

Filtered = LazyImport('sage.categories.filtered_hopf_algebras_with_basis', 

'FilteredHopfAlgebrasWithBasis') 

Graded = LazyImport('sage.categories.graded_hopf_algebras_with_basis', 

'GradedHopfAlgebrasWithBasis') 

Super = LazyImport('sage.categories.super_hopf_algebras_with_basis', 

'SuperHopfAlgebrasWithBasis') 

 

class ParentMethods: 

 

@abstract_method(optional=True) 

def antipode_on_basis(self, x): 

""" 

The antipode of the Hopf algebra on the basis (optional) 

 

INPUT: 

 

- ``x`` -- an index of an element of the basis of ``self`` 

 

Returns the antipode of the basis element indexed by ``x``. 

 

If this method is implemented, then :meth:`antipode` is defined 

from this by linearity. 

 

EXAMPLES:: 

 

sage: A = HopfAlgebrasWithBasis(QQ).example() 

sage: W = A.basis().keys(); W 

Dihedral group of order 6 as a permutation group 

sage: w = W.an_element(); w 

(1,2,3) 

sage: A.antipode_on_basis(w) 

B[(1,3,2)] 

""" 

 

@lazy_attribute 

def antipode(self): 

""" 

The antipode of this Hopf algebra. 

 

If :meth:`.antipode_basis` is available, this constructs the 

antipode morphism from ``self`` to ``self`` by extending it by 

linearity. Otherwise, :meth:`self.antipode_by_coercion` is used, if 

available. 

 

EXAMPLES:: 

 

sage: A = HopfAlgebrasWithBasis(ZZ).example(); A 

An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Integer Ring 

sage: A = HopfAlgebrasWithBasis(QQ).example() 

sage: [a,b] = A.algebra_generators() 

sage: a, A.antipode(a) 

(B[(1,2,3)], B[(1,3,2)]) 

sage: b, A.antipode(b) 

(B[(1,3)], B[(1,3)]) 

 

TESTS:: 

 

sage: all(A.antipode(x) * x == A.one() for x in A.basis()) 

True 

""" 

if self.antipode_on_basis is not NotImplemented: 

# Should give the information that this is an anti-morphism of algebra 

return self._module_morphism(self.antipode_on_basis, codomain = self) 

elif hasattr(self, "antipode_by_coercion"): 

return self.antipode_by_coercion 

 

def _test_antipode(self, **options): 

r""" 

Test the antipode. 

 

An *antipode* `S` of a Hopf algebra is a linear endomorphism of the 

Hopf algebra that satisfies the following conditions (see 

:wikipedia:`HopfAlgebra`). 

 

- If `\mu` and `\Delta` denote the product and coproduct of the 

Hopf algebra, respectively, then `S` satisfies 

 

.. MATH:: 

 

\mu \circ (S \tensor 1) \circ \Delta = unit \circ counit 

\mu \circ (1 \tensor S) \circ \Delta = unit \circ counit 

 

- `S` is an *anti*-homomorphism 

 

These properties are tested on :meth:`some_elements`. 

 

TESTS:: 

 

sage: R = NonCommutativeSymmetricFunctions(QQ).ribbon() 

sage: R._test_antipode() 

 

:: 

 

sage: s = SymmetricFunctions(QQ).schur() 

sage: s._test_antipode() 

 

""" 

tester = self._tester(**options) 

 

S = self.antipode 

 

IS = lambda x: self.sum(c * self.monomial(t1) * S(self.monomial(t2)) 

for ((t1, t2), c) in x.coproduct()) 

 

SI = lambda x: self.sum(c * S(self.monomial(t1)) * self.monomial(t2) 

for ((t1, t2), c) in x.coproduct()) 

 

for x in tester.some_elements(): 

 

# antipode is an anti-homomorphism 

for y in tester.some_elements(): 

tester.assertTrue(S(x) * S(y) == S(y * x)) 

 

# mu * (S # I) * delta == counit * unit 

tester.assertTrue(SI(x) == self.counit(x) * self.one()) 

 

# mu * (I # S) * delta == counit * unit 

tester.assertTrue(IS(x) == self.counit(x) * self.one()) 

 

class ElementMethods: 

pass 

 

class TensorProducts(TensorProductsCategory): 

""" 

The category of hopf algebras with basis constructed by tensor product of hopf algebras with basis 

""" 

 

@cached_method 

def extra_super_categories(self): 

""" 

EXAMPLES:: 

 

sage: C = HopfAlgebrasWithBasis(QQ).TensorProducts() 

sage: C.extra_super_categories() 

[Category of hopf algebras with basis over Rational Field] 

sage: sorted(C.super_categories(), key=str) 

[Category of hopf algebras with basis over Rational Field, 

Category of tensor products of algebras with basis over Rational Field, 

Category of tensor products of hopf algebras over Rational Field] 

""" 

return [self.base_category()] 

 

class ParentMethods: 

# todo: antipode 

pass 

 

class ElementMethods: 

pass