ogposets.GrSubset

class rewalt.ogposets.GrSubset(support, ambient, **params)

Bases: object

Class for graded subsets, that is, pairs of a GrSet and an “ambient” OgPoset, where the first is seen as a subset of the second.

While objects of the class GrSet are mutable, once they are tied to an OgPoset they should be treated as immutable.

Parameters
  • support (GrSet) – The underlying graded set.

  • ambient (OgPoset) – The ambient oriented graded poset.

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 is True).

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 set1 to triangle as a subset.

>>> subset = GrSubset(set1, triangle)
>>> assert subset.support == set1

Trying to do the same with set2 returns a ValueError because El(0, 3) is out of range.

We can compute the downwards closure of set1 in triangle.

>>> 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

ambient

Returns the ambient oriented graded poset.

dim

Shorthand for support.dim.

isclosed

Returns whether the subset is (downwards) closed.

support

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

GrSet

property ambient

Returns the ambient oriented graded poset.

Returns

ambient – The ambient oriented graded poset.

Return type

OgPoset

property dim

Shorthand for support.dim.

property isclosed

Returns whether the subset is (downwards) closed.

Returns

isclosedTrue if 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

GrSubset

Notes

If all the arguments have type Closed, the union also has type Closed.

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

GrSubset

Notes

If all the arguments have type Closed, the intersection also has type Closed.

difference(other)

Returns the difference with another graded subset of the same oriented graded poset.

Parameters

other (GrSubset) – Another graded subset of the same oriented graded poset.

Returns

difference – The difference between the two graded subsets.

Return type

GrSubset

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

issubsetTrue if 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

issubsetTrue if 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

Closed

image(ogmap)

Returns the image of the graded subset through a map of oriented graded posets.

Parameters

ogmap (OgMap) – A map from the ambient to another OgPoset.

Returns

image – The image of the subset through the given map.

Return type

GrSubset

Notes

If the object has type Closed, its image has also type Closed.