Changeset 8419:6054b29ac8d6
- Timestamp:
- 11/11/07 13:49:40 (6 years ago)
- Branch:
- default
- Location:
- sage/categories
- Files:
-
- 3 edited
-
category_types.py (modified) (2 diffs)
-
morphism.pxd (modified) (1 diff)
-
morphism.pyx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/categories/category_types.py
r6995 r8419 283 283 return Sets, tuple([]) 284 284 285 ############################################################# 286 # Pointed Sets 287 ############################################################# 288 289 class PointedSets(Category_uniq): 290 """ 291 The category of pointed sets. 292 293 EXAMPLES: 294 sage: PointedSets() 295 Category of pointed sets 296 """ 297 def __call__(self, X, pt): 298 import sage.sets.all 299 return sage.sets.all.Set(X, pt) 300 301 def __reduce__(self): 302 return PointedSets, tuple([]) 303 304 ############################################################# 305 # Sets with Partial Maps 306 ############################################################# 307 308 class SetsWithPartialMaps(Category_uniq): 309 """ 310 The category whose objects are sets and whose morphisms are 311 maps that are allowed to raise a ValueError on some inputs. 312 313 This category is equivalent to the category of pointed sets, 314 via the equivalence sending an object X to X union {error}, 315 a morphism f to the morphism of pointed sets that sends x 316 to f(x) if f does not raise an error on x, or to error if it 317 does. 318 319 EXAMPLES: 320 sage: SetsWithPartialMaps() 321 Category of Sets with 322 """ 323 def __call__(self, X, pt): 324 import sage.sets.all 325 return sage.sets.all.Set(X, pt) 326 327 def __reduce__(self): 328 return SetsWithPartialMaps, tuple([]) 329 330 def __repr__(self): 331 return "Category with objects Sets and morphisms partially defined maps" 285 332 286 333 ############################################################# … … 295 342 sage: S = SymmetricGroup(3) 296 343 sage: GSets(S) 297 Category of G-sets for Symmetric Group(3)344 Category of G-sets for Symmetric group of order 3! as a permutation group 298 345 """ 299 346 def __init__(self, G): -
sage/categories/morphism.pxd
r6774 r8419 16 16 cdef Element _call_c_impl(self, Element x) 17 17 18 cdef class Section(Morphism): 19 cdef Morphism _morphism 20 18 21 cdef class FormalCoercionMorphism(Morphism): 19 22 cdef Element _call_c(self, x) -
sage/categories/morphism.pyx
r7681 r8419 164 164 return generic_power(self, n) 165 165 166 cdef class Section(Morphism): 167 def __init__(self, morphism): 168 from sage.categories.homset import Hom 169 from sage.categories.category_types import SetsWithPartialMaps 170 Morphism.__init__(self, Hom(morphism.codomain(), morphism.domain(), SetsWithPartialMaps())) 171 self._morphism = morphism 172 173 def _repr_type(self): 174 return "Section" 175 166 176 cdef class FormalCoercionMorphism(Morphism): 167 177 def __init__(self, parent):
Note: See TracChangeset
for help on using the changeset viewer.
