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

r""" 

CW Complexes 

""" 

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

# Copyright (C) 2015 Travis Scrimshaw <tscrim at ucdavis.edu> 

# 

# Distributed under the terms of the GNU General Public License (GPL) 

# http://www.gnu.org/licenses/ 

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

 

from sage.misc.abstract_method import abstract_method 

from sage.misc.cachefunc import cached_method 

from sage.categories.category_singleton import Category_singleton 

from sage.categories.category_with_axiom import CategoryWithAxiom 

from sage.categories.sets_cat import Sets 

 

class CWComplexes(Category_singleton): 

r""" 

The category of CW complexes. 

 

A CW complex is a Closure-finite cell complex in the Weak topology. 

 

REFERENCES: 

 

- :wikipedia:`CW_complex` 

 

.. NOTE:: 

 

The notion of "finite" is that the number of cells is finite. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: C = CWComplexes(); C 

Category of CW complexes 

 

TESTS:: 

 

sage: TestSuite(C).run() 

""" 

@cached_method 

def super_categories(self): 

""" 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: CWComplexes().super_categories() 

[Category of topological spaces] 

""" 

return [Sets().Topological()] 

 

def _repr_object_names(self): 

""" 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: CWComplexes() # indirect doctest 

Category of CW complexes 

""" 

return "CW complexes" 

 

class SubcategoryMethods: 

@cached_method 

def Connected(self): 

""" 

Return the full subcategory of the connected objects of ``self``. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: CWComplexes().Connected() 

Category of connected CW complexes 

 

TESTS:: 

 

sage: TestSuite(CWComplexes().Connected()).run() 

sage: CWComplexes().Connected.__module__ 

'sage.categories.cw_complexes' 

""" 

return self._with_axiom('Connected') 

 

@cached_method 

def FiniteDimensional(self): 

""" 

Return the full subcategory of the finite dimensional 

objects of ``self``. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: C = CWComplexes().FiniteDimensional(); C 

Category of finite dimensional CW complexes 

 

TESTS:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: C = CWComplexes().FiniteDimensional() 

sage: TestSuite(C).run() 

sage: CWComplexes().Connected().FiniteDimensional.__module__ 

'sage.categories.cw_complexes' 

""" 

return self._with_axiom('FiniteDimensional') 

 

class Connected(CategoryWithAxiom): 

""" 

The category of connected CW complexes. 

""" 

 

class FiniteDimensional(CategoryWithAxiom): 

""" 

Category of finite dimensional CW complexes. 

""" 

 

class Finite(CategoryWithAxiom): 

""" 

Category of finite CW complexes. 

 

A finite CW complex is a CW complex with a finite number of cells. 

""" 

def extra_super_categories(self): 

""" 

Return the extra super categories of ``self``. 

 

A finite CW complex is a compact finite-dimensional CW complex. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: C = CWComplexes().Finite() 

sage: C.extra_super_categories() 

[Category of finite dimensional CW complexes, 

Category of compact topological spaces] 

""" 

return [CWComplexes().FiniteDimensional(), Sets().Topological().Compact()] 

 

class ParentMethods: 

@cached_method 

def dimension(self): 

""" 

Return the dimension of ``self``. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: X = CWComplexes().example() 

sage: X.dimension() 

2 

""" 

C = self.cells() 

return max(c.dimension() for d in C.keys() for c in C[d]) 

 

def Compact_extra_super_categories(self): 

""" 

Return extraneous super categories for ``CWComplexes().Compact()``. 

 

A compact CW complex is finite, see Proposition A.1 in [Hat2002]_. 

 

.. TODO:: 

 

Fix the name of finite CW complexes. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: CWComplexes().Compact() # indirect doctest 

Category of finite finite dimensional CW complexes 

sage: CWComplexes().Compact() is CWComplexes().Finite() 

True 

""" 

return (Sets().Finite(),) 

 

class ElementMethods: 

@abstract_method 

def dimension(self): 

""" 

Return the dimension of ``self``. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: X = CWComplexes().example() 

sage: X.an_element().dimension() 

2 

""" 

 

class ParentMethods: 

@abstract_method 

def dimension(self): 

""" 

Return the dimension of ``self``. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: X = CWComplexes().example() 

sage: X.dimension() 

2 

""" 

 

@abstract_method(optional=True) 

def cells(self): 

""" 

Return the cells of ``self``. 

 

EXAMPLES:: 

 

sage: from sage.categories.cw_complexes import CWComplexes 

sage: X = CWComplexes().example() 

sage: C = X.cells() 

sage: sorted((d, C[d]) for d in C.keys()) 

[(0, (0-cell v,)), 

(1, (0-cell e1, 0-cell e2)), 

(2, (2-cell f,))] 

"""