Subsets of Topological Manifolds¶
The class ManifoldSubset
implements generic subsets of a
topological manifold. Open subsets are implemented by the class
TopologicalManifold
(since an
open subset of a manifold is a manifold by itself), which inherits
from ManifoldSubset
.
AUTHORS:
Eric Gourgoulhon, Michal Bejger (2013-2015): initial version
Travis Scrimshaw (2015): review tweaks; removal of facade parents
REFERENCES:
EXAMPLES:
Two subsets on a manifold:
sage: M = Manifold(2, 'M', structure='topological')
sage: a = M.subset('A'); a
Subset A of the 2-dimensional topological manifold M
sage: b = M.subset('B'); b
Subset B of the 2-dimensional topological manifold M
sage: M.list_of_subsets()
[Subset A of the 2-dimensional topological manifold M,
Subset B of the 2-dimensional topological manifold M,
2-dimensional topological manifold M]
The intersection of the two subsets:
sage: c = a.intersection(b); c
Subset A_inter_B of the 2-dimensional topological manifold M
Their union:
sage: d = a.union(b); d
Subset A_union_B of the 2-dimensional topological manifold M
Lists of subsets after the above operations:
sage: M.list_of_subsets()
[Subset A of the 2-dimensional topological manifold M,
Subset A_inter_B of the 2-dimensional topological manifold M,
Subset A_union_B of the 2-dimensional topological manifold M,
Subset B of the 2-dimensional topological manifold M,
2-dimensional topological manifold M]
sage: a.list_of_subsets()
[Subset A of the 2-dimensional topological manifold M,
Subset A_inter_B of the 2-dimensional topological manifold M]
sage: c.list_of_subsets()
[Subset A_inter_B of the 2-dimensional topological manifold M]
sage: d.list_of_subsets()
[Subset A of the 2-dimensional topological manifold M,
Subset A_inter_B of the 2-dimensional topological manifold M,
Subset A_union_B of the 2-dimensional topological manifold M,
Subset B of the 2-dimensional topological manifold M]
-
class
sage.manifolds.subset.
ManifoldSubset
(manifold, name, latex_name=None, category=None)¶ Bases:
sage.structure.unique_representation.UniqueRepresentation
,sage.structure.parent.Parent
Subset of a topological manifold.
The class
ManifoldSubset
inherits from the generic classParent
. The corresponding element class isManifoldPoint
.Note that open subsets are not implemented directly by this class, but by the derived class
TopologicalManifold
(an open subset of a topological manifold being itself a topological manifold).INPUT:
manifold
– topological manifold on which the subset is definedname
– string; name (symbol) given to the subsetlatex_name
– (default:None
) string; LaTeX symbol to denote the subset; if none are provided, it is set toname
category
– (default:None
) to specify the category; ifNone
, the category for generic subsets is used
EXAMPLES:
A subset of a manifold:
sage: M = Manifold(2, 'M', structure='topological') sage: from sage.manifolds.subset import ManifoldSubset sage: A = ManifoldSubset(M, 'A', latex_name=r'\mathcal{A}') sage: A Subset A of the 2-dimensional topological manifold M sage: latex(A) \mathcal{A} sage: A.is_subset(M) True
Instead of importing
ManifoldSubset
in the global namespace, it is recommended to use the methodsubset()
to create a new subset:sage: B = M.subset('B', latex_name=r'\mathcal{B}'); B Subset B of the 2-dimensional topological manifold M sage: M.list_of_subsets() [Subset A of the 2-dimensional topological manifold M, Subset B of the 2-dimensional topological manifold M, 2-dimensional topological manifold M]
The manifold is itself a subset:
sage: isinstance(M, ManifoldSubset) True sage: M in M.subsets() True
Instances of
ManifoldSubset
are parents:sage: isinstance(A, Parent) True sage: A.category() Category of subobjects of sets sage: p = A.an_element(); p Point on the 2-dimensional topological manifold M sage: p.parent() Subset A of the 2-dimensional topological manifold M sage: p in A True sage: p in M True
-
Element
¶ alias of
sage.manifolds.point.ManifoldPoint
-
ambient
()¶ Return the ambient manifold of
self
.EXAMPLES:
sage: M = Manifold(2, 'M', structure='topological') sage: A = M.subset('A') sage: A.manifold() 2-dimensional topological manifold M sage: A.manifold() is M True sage: B = A.subset('B') sage: B.manifold() is M True
An alias is
ambient
:sage: A.ambient() is A.manifold() True
-
declare_union
(dom1, dom2)¶ Declare that the current subset is the union of two subsets.
Suppose \(U\) is the current subset, then this method declares that \(U\)
\[U = U_1 \cup U_2,\]where \(U_1 \subset U\) and \(U_2 \subset U\).
INPUT:
dom1
– the subset \(U_1\)dom2
– the subset \(U_2\)
EXAMPLES:
sage: M = Manifold(2, 'M', structure='topological') sage: A = M.subset('A') sage: B = M.subset('B') sage: M.declare_union(A, B) sage: A.union(B) 2-dimensional topological manifold M
-
get_subset
(name)¶ Get a subset by its name.
The subset must have been previously created by the method
subset()
(oropen_subset()
)INPUT:
name
– (string) name of the subset
OUTPUT:
instance of
ManifoldSubset
(or of the derived classTopologicalManifold
for an open subset) representing the subset whose name isname
EXAMPLES:
sage: M = Manifold(4, 'M', structure='topological') sage: A = M.subset('A') sage: B = A.subset('B') sage: U = M.open_subset('U') sage: M.list_of_subsets() [Subset A of the 4-dimensional topological manifold M, Subset B of the 4-dimensional topological manifold M, 4-dimensional topological manifold M, Open subset U of the 4-dimensional topological manifold M] sage: M.get_subset('A') Subset A of the 4-dimensional topological manifold M sage: M.get_subset('A') is A True sage: M.get_subset('B') is B True sage: A.get_subset('B') is B True sage: M.get_subset('U') Open subset U of the 4-dimensional topological manifold M sage: M.get_subset('U') is U True
-
intersection
(other, name=None, latex_name=None)¶ Return the intersection of the current subset with another subset.
INPUT:
other
– another subset of the same manifoldname
– (default:None
) name given to the intersection in the case the latter has to be created; the default isself._name
interother._name
latex_name
– (default:None
) LaTeX symbol to denote the intersection in the case the latter has to be created; the default is built upon the symbol \(\cap\)
OUTPUT:
instance of
ManifoldSubset
representing the subset that is the intersection of the current subset withother
EXAMPLES:
Intersection of two subsets:
sage: M = Manifold(2, 'M', structure='topological') sage: a = M.subset('A') sage: b = M.subset('B') sage: c = a.intersection(b); c Subset A_inter_B of the 2-dimensional topological manifold M sage: a.list_of_subsets() [Subset A of the 2-dimensional topological manifold M, Subset A_inter_B of the 2-dimensional topological manifold M] sage: b.list_of_subsets() [Subset A_inter_B of the 2-dimensional topological manifold M, Subset B of the 2-dimensional topological manifold M] sage: c._supersets # random (set output) {Subset B of the 2-dimensional topological manifold M, Subset A_inter_B of the 2-dimensional topological manifold M, Subset A of the 2-dimensional topological manifold M, 2-dimensional topological manifold M}
Some checks:
sage: (a.intersection(b)).is_subset(a) True sage: (a.intersection(b)).is_subset(a) True sage: a.intersection(b) is b.intersection(a) True sage: a.intersection(a.intersection(b)) is a.intersection(b) True sage: (a.intersection(b)).intersection(a) is a.intersection(b) True sage: M.intersection(a) is a True sage: a.intersection(M) is a True
-
is_open
()¶ Return if
self
is an open set.This method always returns
False
, since open subsets must be constructed as instances of the subclassTopologicalManifold
(which redefinesis_open
)EXAMPLES:
sage: M = Manifold(2, 'M', structure='topological') sage: A = M.subset('A') sage: A.is_open() False
-
is_subset
(other)¶ Return
True
if and only ifself
is included inother
.EXAMPLES:
Subsets on a 2-dimensional manifold:
sage: M = Manifold(2, 'M', structure='topological') sage: a = M.subset('A') sage: b = a.subset('B') sage: c = M.subset('C') sage: a.is_subset(M) True sage: b.is_subset(a) True sage: b.is_subset(M) True sage: a.is_subset(b) False sage: c.is_subset(a) False
-
lift
(p)¶ Return the lift of
p
to the ambient manifold ofself
.INPUT:
p
– point of the subset
OUTPUT:
the same point, considered as a point of the ambient manifold
EXAMPLES:
sage: M = Manifold(2, 'M', structure='topological') sage: X.<x,y> = M.chart() sage: A = M.open_subset('A', coord_def={X: x>0}) sage: p = A((1, -2)); p Point on the 2-dimensional topological manifold M sage: p.parent() Open subset A of the 2-dimensional topological manifold M sage: q = A.lift(p); q Point on the 2-dimensional topological manifold M sage: q.parent() 2-dimensional topological manifold M sage: q.coord() (1, -2) sage: (p == q) and (q == p) True
-
list_of_subsets
()¶ Return the list of subsets that have been defined on the current subset.
The list is sorted by the alphabetical names of the subsets.
OUTPUT:
a list containing all the subsets that have been defined on the current subset
Note
To get the subsets as a Python set, used the method
subsets()
instead.EXAMPLES:
Subsets of a 2-dimensional manifold:
sage: M = Manifold(2, 'M', structure='topological') sage: U = M.open_subset('U') sage: V = M.subset('V') sage: M.list_of_subsets() [2-dimensional topological manifold M, Open subset U of the 2-dimensional topological manifold M, Subset V of the 2-dimensional topological manifold M]
The method
subsets()
returns a set instead of a list:sage: M.subsets() # random (set output) {Subset V of the 2-dimensional topological manifold M, 2-dimensional topological manifold M, Open subset U of the 2-dimensional topological manifold M}
-
manifold
()¶ Return the ambient manifold of
self
.EXAMPLES:
sage: M = Manifold(2, 'M', structure='topological') sage: A = M.subset('A') sage: A.manifold() 2-dimensional topological manifold M sage: A.manifold() is M True sage: B = A.subset('B') sage: B.manifold() is M True
An alias is
ambient
:sage: A.ambient() is A.manifold() True
-
open_covers
()¶ Return the list of open covers of the current subset.
If the current subset, \(A\) say, is a subset of the manifold \(M\), an open cover of \(A\) is list (indexed set) \((U_i)_{i\in I}\) of open subsets of \(M\) such that
\[A \subset \bigcup_{i \in I} U_i.\]If \(A\) is open, we ask that the above inclusion is actually an identity:
\[A = \bigcup_{i \in I} U_i.\]EXAMPLES:
sage: M = Manifold(2, 'M', structure='topological') sage: M.open_covers() [[2-dimensional topological manifold M]] sage: U = M.open_subset('U') sage: U.open_covers() [[Open subset U of the 2-dimensional topological manifold M]] sage: A = U.open_subset('A') sage: B = U.open_subset('B') sage: U.declare_union(A,B) sage: U.open_covers() [[Open subset U of the 2-dimensional topological manifold M], [Open subset A of the 2-dimensional topological manifold M, Open subset B of the 2-dimensional topological manifold M]] sage: V = M.open_subset('V') sage: M.declare_union(U,V) sage: M.open_covers() [[2-dimensional topological manifold M], [Open subset U of the 2-dimensional topological manifold M, Open subset V of the 2-dimensional topological manifold M], [Open subset A of the 2-dimensional topological manifold M, Open subset B of the 2-dimensional topological manifold M, Open subset V of the 2-dimensional topological manifold M]]
-
point
(coords=None, chart=None, name=None, latex_name=None)¶ Define a point in
self
.See
ManifoldPoint
for a complete documentation.INPUT:
coords
– the point coordinates (as a tuple or a list) in the chart specified bychart
chart
– (default:None
) chart in which the point coordinates are given; ifNone
, the coordinates are assumed to refer to the default chart of the current subsetname
– (default:None
) name given to the pointlatex_name
– (default:None
) LaTeX symbol to denote the point; ifNone
, the LaTeX symbol is set toname
OUTPUT:
the declared point, as an instance of
ManifoldPoint
EXAMPLES:
Points on a 2-dimensional manifold:
sage: M = Manifold(2, 'M', structure='topological') sage: c_xy.<x,y> = M.chart() sage: p = M.point((1,2), name='p'); p Point p on the 2-dimensional topological manifold M sage: p in M True sage: a = M.open_subset('A') sage: c_uv.<u,v> = a.chart() sage: q = a.point((-1,0), name='q'); q Point q on the 2-dimensional topological manifold M sage: q in a True sage: p._coordinates {Chart (M, (x, y)): (1, 2)} sage: q._coordinates {Chart (A, (u, v)): (-1, 0)}
-
retract
(p)¶ Return the retract of
p
toself
.INPUT:
p
– point of the ambient manifold
OUTPUT:
the same point, considered as a point of the subset
EXAMPLES:
sage: M = Manifold(2, 'M', structure='topological') sage: X.<x,y> = M.chart() sage: A = M.open_subset('A', coord_def={X: x>0}) sage: p = M((1, -2)); p Point on the 2-dimensional topological manifold M sage: p.parent() 2-dimensional topological manifold M sage: q = A.retract(p); q Point on the 2-dimensional topological manifold M sage: q.parent() Open subset A of the 2-dimensional topological manifold M sage: q.coord() (1, -2) sage: (q == p) and (p == q) True
Of course, if the point does not belong to
A
, theretract
method fails:sage: p = M((-1, 3)) # x < 0, so that p is not in A sage: q = A.retract(p) Traceback (most recent call last): ... ValueError: the Point on the 2-dimensional topological manifold M is not in Open subset A of the 2-dimensional topological manifold M
-
subset
(name, latex_name=None, is_open=False)¶ Create a subset of the current subset.
INPUT:
name
– name given to the subsetlatex_name
– (default:None
) LaTeX symbol to denote the subset; if none are provided, it is set toname
is_open
– (default:False
) ifTrue
, the created subset is assumed to be open with respect to the manifold’s topology
OUTPUT:
the subset, as an instance of
ManifoldSubset
, or of the derived classTopologicalManifold
ifis_open
isTrue
EXAMPLES:
Creating a subset of a manifold:
sage: M = Manifold(2, 'M', structure='topological') sage: a = M.subset('A'); a Subset A of the 2-dimensional topological manifold M
Creating a subset of
A
:sage: b = a.subset('B', latex_name=r'\mathcal{B}'); b Subset B of the 2-dimensional topological manifold M sage: latex(b) \mathcal{B}
We have then:
sage: b.is_subset(a) True sage: b in a.subsets() True
-
subsets
()¶ Return the set of subsets that have been defined on the current subset.
OUTPUT:
a Python set containing all the subsets that have been defined on the current subset
Note
To get the subsets as a list, used the method
list_of_subsets()
instead.EXAMPLES:
Subsets of a 2-dimensional manifold:
sage: M = Manifold(2, 'M', structure='topological') sage: U = M.open_subset('U') sage: V = M.subset('V') sage: M.subsets() # random (set output) {Subset V of the 2-dimensional topological manifold M, 2-dimensional topological manifold M, Open subset U of the 2-dimensional topological manifold M} sage: type(M.subsets()) <... 'frozenset'> sage: U in M.subsets() True
The method
list_of_subsets()
returns a list (sorted alphabetically by the subset names) instead of a set:sage: M.list_of_subsets() [2-dimensional topological manifold M, Open subset U of the 2-dimensional topological manifold M, Subset V of the 2-dimensional topological manifold M]
-
superset
(name, latex_name=None, is_open=False)¶ Create a superset of the current subset.
A superset is a manifold subset in which the current subset is included.
INPUT:
name
– name given to the supersetlatex_name
– (default:None
) LaTeX symbol to denote the superset; if none are provided, it is set toname
is_open
– (default:False
) ifTrue
, the created subset is assumed to be open with respect to the manifold’s topology
OUTPUT:
the superset, as an instance of
ManifoldSubset
or of the derived classTopologicalManifold
ifis_open
isTrue
EXAMPLES:
Creating some superset of a given subset:
sage: M = Manifold(2, 'M', structure='topological') sage: a = M.subset('A') sage: b = a.superset('B'); b Subset B of the 2-dimensional topological manifold M sage: b.list_of_subsets() [Subset A of the 2-dimensional topological manifold M, Subset B of the 2-dimensional topological manifold M] sage: a._supersets # random (set output) {Subset B of the 2-dimensional topological manifold M, Subset A of the 2-dimensional topological manifold M, 2-dimensional topological manifold M}
The superset of the whole manifold is itself:
sage: M.superset('SM') is M True
Two supersets of a given subset are a priori different:
sage: c = a.superset('C') sage: c == b False
-
union
(other, name=None, latex_name=None)¶ Return the union of the current subset with another subset.
INPUT:
other
– another subset of the same manifoldname
– (default:None
) name given to the union in the case the latter has to be created; the default isself._name
unionother._name
latex_name
– (default:None
) LaTeX symbol to denote the union in the case the latter has to be created; the default is built upon the symbol \(\cup\)
OUTPUT:
instance of
ManifoldSubset
representing the subset that is the union of the current subset withother
EXAMPLES:
Union of two subsets:
sage: M = Manifold(2, 'M', structure='topological') sage: a = M.subset('A') sage: b = M.subset('B') sage: c = a.union(b); c Subset A_union_B of the 2-dimensional topological manifold M sage: a._supersets # random (set output) set([subset 'A_union_B' of the 2-dimensional manifold 'M', 2-dimensional manifold 'M', subset 'A' of the 2-dimensional manifold 'M']) sage: b._supersets # random (set output) set([subset 'B' of the 2-dimensional manifold 'M', 2-dimensional manifold 'M', subset 'A_union_B' of the 2-dimensional manifold 'M']) sage: c._subsets # random (set output) set([subset 'A_union_B' of the 2-dimensional manifold 'M', subset 'A' of the 2-dimensional manifold 'M', subset 'B' of the 2-dimensional manifold 'M'])
Some checks:
sage: a.is_subset(a.union(b)) True sage: b.is_subset(a.union(b)) True sage: a.union(b) is b.union(a) True sage: a.union(a.union(b)) is a.union(b) True sage: (a.union(b)).union(a) is a.union(b) True sage: a.union(M) is M True sage: M.union(a) is M True