ogposets.GrSubset
- class rewalt.ogposets.GrSubset(support, ambient, **params)
Bases:
objectClass for graded subsets, that is, pairs of a
GrSetand an “ambient”OgPoset, where the first is seen as a subset of the second.While objects of the class
GrSetare mutable, once they are tied to anOgPosetthey should be treated as immutable.- Parameters
- Keyword Arguments
wfcheck (
bool) – Check whether the support is a well-formed subset of the ambient, that is, it has no elements out of range (default isTrue).
Notes
Two graded subsets are equal if and only if they have the same elements, and they are subsets of the same
OgPoset.Examples
We create an oriented graded poset and a pair of graded sets.
>>> point = OgPoset.point() >>> triangle = point >> point >> point >>> set1 = GrSet(El(1, 1), El(0, 1)) >>> set2 = GrSet(El(0, 3))
We can attach
set1totriangleas a subset.>>> subset = GrSubset(set1, triangle) >>> assert subset.support == set1
Trying to do the same with
set2returns aValueErrorbecauseEl(0, 3)is out of range.We can compute the downwards closure of
set1intriangle.>>> subset.closure().support GrSet(El(0, 0), El(0, 1), El(0, 2), El(1, 1))
All the set-theoretic operations apply to graded subsets as long as they have the same ambient
OgPoset.Methods
closure()Returns the downwards closure of the graded subset.
difference(other)Returns the difference with another graded subset of the same oriented graded poset.
image(ogmap)Returns the image of the graded subset through a map of oriented graded posets.
intersection(*others)Returns the intersection with other graded subsets of the same oriented graded poset.
isdisjoint(other)Returns whether the object is disjoint from another graded subset of the same oriented graded poset.
issubset(other)Returns whether the object is a subset of another subset of the same oriented graded poset.
union(*others)Returns the union with other graded subsets of the same oriented graded poset.
Attributes
Returns the ambient oriented graded poset.
Shorthand for
support.dim.Returns whether the subset is (downwards) closed.
Returns the underlying graded set (the "support" of the subset).
- property support
Returns the underlying graded set (the “support” of the subset).
- Returns
support – The underlying graded set.
- Return type
- property ambient
Returns the ambient oriented graded poset.
- Returns
ambient – The ambient oriented graded poset.
- Return type
- property dim
Shorthand for
support.dim.
- property isclosed
Returns whether the subset is (downwards) closed.
- Returns
isclosed –
Trueif and only if the subset is downwards closed.- Return type
bool
- union(*others)
Returns the union with other graded subsets of the same oriented graded poset.
- Parameters
*others (
GrSubset) – Any number of graded subsets of the same oriented graded poset.- Returns
union – The union of the graded subset with all the given others.
- Return type
Notes
If all the arguments have type
Closed, the union also has typeClosed.
- intersection(*others)
Returns the intersection with other graded subsets of the same oriented graded poset.
- Parameters
*others (
GrSubset) – Any number of graded subsets of the same oriented graded poset.- Returns
intersection – The intersection of the graded subset with all the given others.
- Return type
Notes
If all the arguments have type
Closed, the intersection also has typeClosed.
- difference(other)
Returns the difference with another graded subset of the same oriented graded poset.
- issubset(other)
Returns whether the object is a subset of another subset of the same oriented graded poset.
- Parameters
other (
GrSubset) – Another graded subset of the same oriented graded poset.- Returns
issubset –
Trueif and only self is a subset of other.- Return type
bool
- isdisjoint(other)
Returns whether the object is disjoint from another graded subset of the same oriented graded poset.
- Parameters
other (
GrSubset) – Another graded subset of the same oriented graded poset.- Returns
issubset –
Trueif and only self and other are disjoint.- Return type
bool
- closure()
Returns the downwards closure of the graded subset.
- Returns
closure – The downwards closure of the subset.
- Return type