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

r""" 

Additive groups 

""" 

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

# Copyright (C) 2013 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.misc.lazy_import import LazyImport 

from sage.categories.category_with_axiom import CategoryWithAxiom_singleton, CategoryWithAxiom 

from sage.categories.algebra_functor import AlgebrasCategory 

from sage.categories.additive_monoids import AdditiveMonoids 

Groups = LazyImport('sage.categories.groups', 'Groups', at_startup=True) 

 

class AdditiveGroups(CategoryWithAxiom_singleton): 

r""" 

The category of additive groups. 

 

An *additive group* is a set with an internal binary operation `+` which 

is associative, admits a zero, and where every element can be negated. 

 

EXAMPLES:: 

 

sage: from sage.categories.additive_groups import AdditiveGroups 

sage: from sage.categories.additive_monoids import AdditiveMonoids 

sage: AdditiveGroups() 

Category of additive groups 

sage: AdditiveGroups().super_categories() 

[Category of additive inverse additive unital additive magmas, 

Category of additive monoids] 

sage: AdditiveGroups().all_super_categories() 

[Category of additive groups, 

Category of additive inverse additive unital additive magmas, 

Category of additive monoids, 

Category of additive unital additive magmas, 

Category of additive semigroups, 

Category of additive magmas, 

Category of sets, 

Category of sets with partial maps, 

Category of objects] 

 

sage: AdditiveGroups().axioms() 

frozenset({'AdditiveAssociative', 'AdditiveInverse', 'AdditiveUnital'}) 

sage: AdditiveGroups() is AdditiveMonoids().AdditiveInverse() 

True 

 

TESTS:: 

 

sage: C = AdditiveGroups() 

sage: TestSuite(C).run() 

""" 

_base_category_class_and_axiom = (AdditiveMonoids, "AdditiveInverse") 

 

class Algebras(AlgebrasCategory): 

class ParentMethods: 

try: #PY2 

group = Groups.Algebras.ParentMethods.group.__func__ 

except AttributeError: #PY3 

group = Groups.Algebras.ParentMethods.group 

 

class Finite(CategoryWithAxiom): 

class Algebras(AlgebrasCategory): 

try: #PY2 

extra_super_categories = Groups.Finite.Algebras.extra_super_categories.__func__ 

except AttributeError: #PY3 

extra_super_categories = Groups.Finite.Algebras.extra_super_categories 

 

class ParentMethods: 

try: #PY2 

__init_extra__ = Groups.Finite.Algebras.ParentMethods.__init_extra__.__func__ 

except AttributeError: #PY3 

__init_extra__ = Groups.Finite.Algebras.ParentMethods.__init_extra__ 

 

AdditiveCommutative = LazyImport('sage.categories.commutative_additive_groups', 'CommutativeAdditiveGroups', at_startup=True)