#18529: Topological manifolds: basics
-------------------------------------+-------------------------------------
Reporter: egourgoulhon | Owner: egourgoulhon
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-7.0
Component: geometry | Resolution:
Keywords: topological | Merged in:
manifolds | Reviewers: Travis Scrimshaw
Authors: Eric Gourgoulhon, | Work issues:
Travis Scrimshaw | Commit:
Report Upstream: N/A | 3cd03a48d847e12745ed8c25b23f19db141c179a
Branch: | Stopgaps:
public/manifolds/top_manif_basics |
Dependencies: #18175 |
-------------------------------------+-------------------------------------
Comment (by egourgoulhon):
I've continued to propagate the refactorization initialized in comment:67
up to #19124 (curves in differentiable manifolds) in the ticket hierarchy
of #18528. At this stage, the class hierarchy is an extension of the
second diagram of comment:72:
{{{
Hierarchy-1:
AbstractSet
/ \
ManifoldSubset TopologicalManifold
| ____/ |
| / |
OpenTopSubmanifold |
| |
| DifferentiableMixin |
| / \ |
OpenDiffSubmanifold DifferentiableManifold
| |
| IntervalMixin |
| / \ |
OpenSubinterval OpenInterval
|
RealLine
}}}
Now, prior to the refactoring, the class hierarchy was
{{{
Hierarchy-2:
ManifoldSubset
|
TopologicalManifold
|
DifferentiableManifold
|
OpenInterval
|
RealLine
}}}
It is clear that Hierarchy-2 is much simpler than Hierarchy-1: it involves
much less classes and has no multiple heritage issues. Moreover,
Hierarchy-2 reflects fully the mathematics: the real line '''R''' is the
open interval (-oo, +oo), which is a 1-dimensional differentiable
manifold, which is a 1-dimensional topological manifold, which is a subset
of a topological manifold (itself). Within Hierarchy-2, open subsets are
not handled by a specific class, but directly by the manifold classes: an
open subset of a topological (resp. differentiable) manifold is created as
an instance of `TopologicalManifold` (resp. `DifferentiableManifold`).
Again, this reflects the mathematics since an open subset of a manifold
inherits the manifold structure.
The classes of Hierarchy-2 have an attribute `_manifold` (which could also
be called `_ambient`), which is the only piece that permits to distinguish
between a manifold per se (`_manifold` is then set to `self`) and an open
subset of a larger manifold (`_manifold` is then set to the latter). In
Hierarchy-1, the attribute `_manifold` exists only for the subset classes.
For motivating Hierarchy-1, you said that it avoids tests of the type
`self is self._manifold`. Now, in Hierarchy-2, these tests appear only in
two places: (i) the `_repr_` method (to return "Open subset of..." instead
of "Manifold...") and (ii) the `union` and `intersection` methods. Hence
the question: are there any other reason to introduce Hierarchy-1? Given
its complexity, as compared with Hierarchy-2, I am wondering whether it is
worth continuing with it...
Note that with Hierarchy-2, one can still distinguish open subsets from
the ambient manifold by the category: `Manifolds(K).Subobjects()` for open
subsets versus `Manifolds(K)` for the ambient manifold. There is no need
to have a separate class for this.
Another argument in favor of Hierarchy-2 regards the construction of a new
manifold by the disjoint union of two manifolds (not implemented yet):
suppose we have two manifolds ''A'' and ''B'' of the same dimension over
the same topological field '''K'''. We can then form the manifold ''M =
A'' U ''B'' and consider ''A'' and ''B'' as open subsets of ''M'' by
simplify changing their attribute `_manifold` from `self` to ''M''. With
Hierarchy-1, one would need to create brand new objects of the subset type
by copying all the information (atlases, vector frames, etc.) contained in
''A'' and ''B''.
--
Ticket URL: <http://trac.sagemath.org/ticket/18529#comment:107>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.