Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
sage.manifolds.closure_topological_submanifold, TopologicalSubmanifol…
Browse files Browse the repository at this point in the history
…d.closure: New
  • Loading branch information
Matthias Koeppe committed Apr 11, 2021
1 parent 824f9cc commit 331aa59
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/sage/manifolds/closure_topological_submanifold.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
r"""
Topological closures of embedded submanifolds
"""

from sage.manifolds.subset import ManifoldSubset

class ClosureOfTopologicalSubmanifold(ManifoldSubset):

def __init__(self, submanifold, name=None, latex_name=None):

self._submanifold = submanifold
base_manifold = submanifold.embedding().codomain()
if name is None:
name = 'cl_' + submanifold._name
if latex_name is None:
if name is None:
latex_name = r'\mathop{\mathrm{cl}}(' + submanifold._latex_name + ')'
else:
latex_name = name
ManifoldSubset.__init__(self, base_manifold, name, latex_name=latex_name)

def _repr_(self):
r"""
String representation of the object.
TESTS::
"""
return "Topological closure {} of the {}".format(self._name, self._submanifold)


22 changes: 22 additions & 0 deletions src/sage/manifolds/topological_submanifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,3 +747,25 @@ def embedding(self):
if not self._embedded:
raise ValueError("the submanifold is not embedded")
return self._immersion

def closure(self):
r"""
Return the topological closure of ``self`` as a subset of the ambient manifold.
EXAMPLES::
sage: M = Manifold(2, 'M', structure="topological")
sage: N = Manifold(1, 'N', ambient=M, structure="topological")
sage: CM.<x,y> = M.chart()
sage: CN.<u> = N.chart()
sage: CN.add_restrictions([u > -1, u < 1])
sage: phi = N.continuous_map(M, {(CN,CM): [u, u^2]})
sage: N.set_embedding(phi)
sage: N
1-dimensional topological submanifold N embedded in the 2-dimensional topological manifold M
sage: N.closure()
Topological closure cl_N of the 1-dimensional topological submanifold N embedded in the 2-dimensional topological manifold M
"""
from .closure_topological_submanifold import ClosureOfTopologicalSubmanifold
return ClosureOfTopologicalSubmanifold(self)

0 comments on commit 331aa59

Please sign in to comment.