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

r""" 

SetsWithPartialMaps 

""" 

from __future__ import absolute_import 

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

# Copyright (C) 2008 David Kohel <kohel@maths.usyd.edu> and 

# William Stein <wstein@math.ucsd.edu> 

# 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_singleton import Category_singleton 

from .objects import Objects 

 

class SetsWithPartialMaps(Category_singleton): 

""" 

The category whose objects are sets and whose morphisms are 

maps that are allowed to raise a ValueError on some inputs. 

 

This category is equivalent to the category of pointed sets, 

via the equivalence sending an object X to X union {error}, 

a morphism f to the morphism of pointed sets that sends x 

to f(x) if f does not raise an error on x, or to error if it 

does. 

 

EXAMPLES:: 

 

sage: SetsWithPartialMaps() 

Category of sets with partial maps 

 

sage: SetsWithPartialMaps().super_categories() 

[Category of objects] 

 

TESTS:: 

 

sage: TestSuite(SetsWithPartialMaps()).run() 

""" 

#def __call__(self, X, pt): 

# import sage.sets.all 

# return sage.sets.all.Set(X, pt) 

 

def super_categories(self): 

""" 

EXAMPLES:: 

 

sage: SetsWithPartialMaps().super_categories() 

[Category of objects] 

""" 

return [Objects()]