Pullbacks (preimages) of manifold subsets under continuous maps
mkoeppe opened this issue · 115 comments
Similar to #31653, given a continuous map \Phi: N -> M and a manifold subset S of M, we define the pullback (preimage) of S as the subset of N of points p with \Phi(p) in S.
Given a real scalar field Phi: N -> R and a RealSet S, we define the pullback in the same way.
Also, we view a chart C as a continuous function Phi: C.domain() -> R^n and allow pulling back any subset of R^n (an object with a __contains__ method; for example polyhedra, lattices, linear subspaces, tensor modules) by it as well.
In all cases, because Phi is continuous, topological closures/interiors pull back.
An application is in #31981.
Depends on #31883
Depends on #31904
Depends on #31653
Depends on #31916
Depends on #31644
Depends on #31959
Depends on #31990
Depends on #21243
CC: @egourgoulhon @tscrim @mjungmath
Component: manifolds
Author: Matthias Koeppe
Branch/Commit: 4558e26
Reviewer: Eric Gourgoulhon
Issue created by migration from https://trac.sagemath.org/ticket/31688
Description changed:
---
+++
@@ -1,2 +1,7 @@
Similar to #31653, given a continuous map `\Phi: N -> M` and a manifold subset `S` of `M`, we define the pullback (preimage) of `S` as the subset of `N` of points `p` with `\Phi(p)` in `S`.
+Given a real scalar field `Phi: N -> R` and a RealSet `S`, we define the pullback in the same way.
+
+In both cases, because `Phi` is continuous, topological closures/interiors pull back.
+
+Commit: 941001b
Author: Matthias Koeppe
Description changed:
---
+++
@@ -1,6 +1,6 @@
Similar to #31653, given a continuous map `\Phi: N -> M` and a manifold subset `S` of `M`, we define the pullback (preimage) of `S` as the subset of `N` of points `p` with `\Phi(p)` in `S`.
-Given a real scalar field `Phi: N -> R` and a RealSet `S`, we define the pullback in the same way.
+Given a real scalar field `Phi: N -> R` and a `RealSet` `S`, we define the pullback in the same way.
In both cases, because `Phi` is continuous, topological closures/interiors pull back.
Branch pushed to git repo; I updated commit sha1. New commits:
90f763f | ManifoldSubsetPullback.__contains__: New |
Branch pushed to git repo; I updated commit sha1. New commits:
5abb86d | ManifoldSubsetPullback: More WIP |
Branch pushed to git repo; I updated commit sha1. New commits:
e597e6d | ManifoldSubsetPullback: Allow pulling back by charts, pulling back polyehdra |
Description changed:
---
+++
@@ -2,6 +2,8 @@
Given a real scalar field `Phi: N -> R` and a `RealSet` `S`, we define the pullback in the same way.
-In both cases, because `Phi` is continuous, topological closures/interiors pull back.
+Also, we view a chart `C` as a continuous function `Phi: C.domain() -> R^n` and allow pulling back by it as well.
+
+In all cases, because `Phi` is continuous, topological closures/interiors pull back.
Description changed:
---
+++
@@ -2,7 +2,7 @@
Given a real scalar field `Phi: N -> R` and a `RealSet` `S`, we define the pullback in the same way.
-Also, we view a chart `C` as a continuous function `Phi: C.domain() -> R^n` and allow pulling back by it as well.
+Also, we view a chart `C` as a continuous function `Phi: C.domain() -> R^n` and allow pulling back any subset of `R^n` (an object with a `__contains__` method; for example polyhedra) by it as well.
In all cases, because `Phi` is continuous, topological closures/interiors pull back.
Branch pushed to git repo; I updated commit sha1. New commits:
1623cc5 | ManifoldSubsetPullback: Move computation of names to __classcall_private__ |
Branch pushed to git repo; I updated commit sha1. New commits:
dcc1f9a | ManifoldSubsetPullback: Prepare for pullbacks of opens |
Branch pushed to git repo; I updated commit sha1. New commits:
a2dd182 | ManifoldSubsetPullback: Recognize more closed sets |
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
459758e | ImageManifoldSubset, ContinuousMap.image: Add optional 'inverse' argument, use it in __contains__ |
26c7e56 | src/sage/manifolds/continuous_map_image.py: Update doctests |
3e273bb | TopologicalSubmanifold.as_subset: New |
9726d36 | Docstring work |
19762ae | ImageManifoldSubset: New parameter domain_subset, use it in ContinuousMap.image |
964f9f7 | src/sage/manifolds/continuous_map.py: Update copyright |
e711215 | src/sage/manifolds/continuous_map_image.py: Add tests |
0f3e36d | Link in documentation of sage.manifolds.continuous_map_image |
4a13d8b | Merge #31653 |
79232db | ContinuousMap.preimage: New, make pullback an alias; add example |
Description changed:
Branch pushed to git repo; I updated commit sha1. New commits:
3c6666a | ManifoldSubsetPullback: Make pullback of open RealSet under a ScalarField an open set |
Description changed:
---
+++
@@ -2,7 +2,7 @@
Given a real scalar field `Phi: N -> R` and a `RealSet` `S`, we define the pullback in the same way.
-Also, we view a chart `C` as a continuous function `Phi: C.domain() -> R^n` and allow pulling back any subset of `R^n` (an object with a `__contains__` method; for example polyhedra) by it as well.
+Also, we view a chart `C` as a continuous function `Phi: C.domain() -> R^n` and allow pulling back any subset of `R^n` (an object with a `__contains__` method; for example polyhedra, lattices, or linear subspaces) by it as well.
In all cases, because `Phi` is continuous, topological closures/interiors pull back.
Branch pushed to git repo; I updated commit sha1. New commits:
ff5eb8b | ManifoldSubsetPullback: Add doctests |
Branch pushed to git repo; I updated commit sha1. New commits:
c268d34 | ManifoldSubsetPullback: Fix example using the embedding map |
This is not quite ready yet, but comments are very welcome
For a possible follow-up, it might be a good idea to bear in mind that the preimage of a regular value of a differentiable map between manifolds of dimension n and m respectively is a differentiable manifold of dimension n-m again.
Branch pushed to git repo; I updated commit sha1. New commits:
9df2104 | sage.geometry.relative_interior: Move here from sage.geometry.polyhedron.relint |
b8bfe20 | ConvexRationalPolyhedralCone: Add methods interior, relative_interior |
6869673 | relative_interior: Fix for dimension 0 |
021d073 | RelativeInterior: Add documentation, tests, comparison methods, method relative_interior |
8f38e04 | ConvexRationalPolyhedralCone.interior, relative_interior: Add doctests |
3a5870e | Merge #31916 |
Description changed:
---
+++
@@ -2,7 +2,7 @@
Given a real scalar field `Phi: N -> R` and a `RealSet` `S`, we define the pullback in the same way.
-Also, we view a chart `C` as a continuous function `Phi: C.domain() -> R^n` and allow pulling back any subset of `R^n` (an object with a `__contains__` method; for example polyhedra, lattices, or linear subspaces) by it as well.
+Also, we view a chart `C` as a continuous function `Phi: C.domain() -> R^n` and allow pulling back any subset of `R^n` (an object with a `__contains__` method; for example polyhedra, lattices, linear subspaces, tensor modules) by it as well.
In all cases, because `Phi` is continuous, topological closures/interiors pull back.
Branch pushed to git repo; I updated commit sha1. New commits:
d11280e | src/sage/manifolds/subsets/pullback.py: Fixup import |
cd3ca79 | Update doctests for refined category of ScalarField |
105bb8b | Merge #31883 |
5f9c852 | RelativeInterior.interior: New |
5c089ec | RelativeInterior.__eq__, __ne__: Handle comparisons with objects of other types |
86ce301 | Polyhedron_base.is_relatively_open: New; fix relative_interior for affine subspaces |
216cb81 | ConvexRationalPolyhedralCone.is_relatively_open: New, fix ConvexRationalPolyhedralCone.relative_interior for linear subspaces |
44cde1e | src/doc/en/reference/discrete_geometry/index.rst: Add sage/geometry/relative_interior |
fa4c2d2 | Whitespace fixes |
e802a21 | Merge #31916 |
Description changed:
---
+++
@@ -7,3 +7,5 @@
In all cases, because `Phi` is continuous, topological closures/interiors pull back.
+An application is in #31981.
+Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
6bef52b | ConvexSet_base._test_convex_set: Run the testsuite of relint |
6ab5677 | RelativeInterior.is_universe: New |
c085d30 | Polyhedron_base.interior: Handle the empty polyhedron correctly |
686d0af | Polyhedron_base.product: Add doctest for alias 'cartesian_product' |
2b1d108 | Merge #31919 |
7323b10 | ConvexSet_base._test_contains: Only test extension to AA for exact base rings |
e0d2eeb | Merge #31959 |
e6c3ed5 | RelativeInterior.__hash__: New |
4c7d57f | src/sage/geometry/relative_interior.py: Fix doctest output |
9ea0cea | ManifoldSubsetPullback: Do not trip over relative interiors of cones |
As revealed by the patchbot, there are some doctest failures, as well as some coverage and pyflakes issues.
Thanks for taking a look! Yes, I'll have to add more documentation and examples.
Branch pushed to git repo; I updated commit sha1. New commits:
87f3e30 | ManifoldSubsetPullback: Add documentation and tests |
Branch pushed to git repo; I updated commit sha1. New commits:
7d3ae5c | Merge #31959 |
2b1040c | ConvexSet_base.{an_element,some_elements}, Polyhedron.some_elements, RelativeInterior.some_elements: New |
a884517 | PolyhedronFace.some_elements: New |
f6cc8f7 | Merge #31990 |
1a4805c | ManifoldSubsetPullback: For charts, use .point as the inverse |
754e002 | ManifoldSubsetPullback._an_element_, some_elements: Implement |
Branch pushed to git repo; I updated commit sha1. New commits:
a8e607c | ManifoldSubsetPullback._coord_def: Add documentation and examples |
Branch pushed to git repo; I updated commit sha1. New commits:
f0e7c58 | ambient_vector_space docstring: Fix bad blocks |
200d967 | ConvexSet_base.ambient doctest: Actually test the method |
1c2bef5 | Merge #31959 |
ed898e6 | ConvexSet_base.an_element, some_elements: Go through generator method `_some_elements_`, make some_elements return a list |
7ae21da | Merge #31990 |
Reviewer: Eric Gourgoulhon
Thanks for the last changes.
Some comments regarding the documentation:
- there is no entry for the class
ManifoldSubsetPullbackin the reference manual - in the files
continuous_map.pyandsubsets/pullback.py, each instance of:class:`ManifoldSubset`should be replaced by:class:`~sage.manifolds.subset.ManifoldSubset` - the docstring of
ScalarField.pullbackshould have an INPUT and OUTPUT sections similar to those ofContinuousMap.preimage. By the way, to be consistent withContinuousMap.preimage, shouldn'tScalarField.pullbackbe renamed toScalarField.preimage, withpullbackdefined as an alias topreimage? - the INPUT and OUTPUT sections of
DiffMap.pullbackshould be updated to take into account the new arguments.
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
8d3ad85 | Merge #31764 |
60505b0 | Merge #31798 |
b9909c0 | ManifoldSubsetClosure: Add examples, fix docstring markup |
16c6a72 | ManifoldSubsetClosure, ManifoldSubset.closure: Improve documentation |
2514586 | Merge #31644 |
3ca139a | src/doc/en/reference/manifolds: Add pullback |
1d430ee | src/sage/manifolds/continuous_map.py, src/sage/manifolds/subsets: Use qualified class name in docstrings |
1266de9 | src/sage/geometry/convex_set.py: Fix docstring markup |
df64125 | ScalarField.preimage: Make pullback an alias; expand documentation |
3877c5f | ManifoldSubsetPullback.is_closed: Remove unfinished NNC_Polyhedron example |
Branch pushed to git repo; I updated commit sha1. New commits:
0c549f0 | Chart.pullback, preimage: New |
7bb720e | ManifoldSubsetPullback.__contains__: Handle the case of charts, which return tuples of coordinates, not vectors |
60ea044 | ContinuousMap.preimage, ScalarField.preimage: Document that output can also be a manifold |
Branch pushed to git repo; I updated commit sha1. New commits:
5b8ceca | InternalRealInterval, RealSet: Add `_latex_` methods |
69ca854 | RealSet._repr_: Use unicode cup sign instead of + |
dbdfc06 | InternalRealInterval, RealSet: Remove extra whitespace in latex, add documentation |
a0e3bf5 | Merge #31880 |
181b128 | RealSet.is_open, is_closed, closure, interior, boundary: New |
7f56338 | PiecewiseFunction: Adjust doctests for changed RealSet repr |
8cd74b5 | Merge #31880 |
8fdb104 | RealSet.boundary: Add another doctest |
9d41f0e | src/sage/sets/real_set.py: Remove unnecessary import |
c36e43b | Merge #21243 |
In the docstring of ManifoldSubsetPullback:
-
in the INPUT section, there seems to be no entry for
ConvexSet_basein the documentation -
in the following part of the EXAMPLES block:
sage: r_squared = M.scalar_field(x^2+y^2)
sage: r_squared.set_immutable()
sage: cl_I = RealSet((1, 4)); cl_I
(1, 4)
sage: cl_O = ManifoldSubsetPullback(r_squared, None, I); cl_O
I guess I in the last line (which, at this stage, is the imaginary number i) should be replaced by cl_I and the subsequent True and False should become False and True respectively. But then, cl_I and cl_O are identical to I and O in the example that follows...
Branch pushed to git repo; I updated commit sha1. New commits:
c540d35 | ManifoldSubsetPullback: Fix up some doctests with closed intervals |
Thanks for spotting this - I have fixed this and a similar example
Replying to @egourgoulhon:
In the docstring of
ManifoldSubsetPullback:
- in the INPUT section, there seems to be no entry for
ConvexSet_basein the documentation
You may need to run ./sage -docbuild reference/discrete_geometry html
Replying to @mkoeppe:
Replying to @egourgoulhon:
In the docstring of
ManifoldSubsetPullback:
- in the INPUT section, there seems to be no entry for
ConvexSet_basein the documentationYou may need to run
./sage -docbuild reference/discrete_geometry html
Yes indeed!
Replying to @mkoeppe:
Thanks for spotting this - I have fixed this and a similar example
Thanks.
At the moment, we have
sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: M.identity_map().preimage(M)
Subset Id_M_inv_M of the 2-dimensional differentiable manifold M
sage: M.identity_map().preimage(M) is M
False
sage: M.zero_scalar_field().preimage(RealSet.point(0))
Subset zero_inv_{0} of the 2-dimensional differentiable manifold M
sage: M.zero_scalar_field().preimage(RealSet.point(0)) is M
False
Do you think it would be easy to have both answers to be True? If no, this should not hamper the current ticket, but be differed to another ticket.
Branch pushed to git repo; I updated commit sha1. New commits:
facad97 | ContinuousMap.preimage: Handle identity_map specially |
Sure, that's easy to do and certainly a good idea. Here it is for ContinuousMap.preimage already, I'll look into the case of the scalar fields
Branch pushed to git repo; I updated commit sha1. New commits:
c2ecf3e | ScalarField.preimage: Handle the case of the zero scalar field |
More general things such as detecting that the preimage of [0,oo) under squaring is the full domain will have to wait until a follow-up ticket
Replying to @mkoeppe:
Sure, that's easy to do and certainly a good idea. Here it is for
ContinuousMap.preimagealready,
Thanks. Maybe one can add
if self._is_isomorphism and codomain_subset == self._codomain:
return self._domain
The patchbot reports a doctest error in src/sage/geometry/polyhedron/base.py as well as pyflakes errors in src/sage/manifolds/subsets/pullback.py.
Replying to @egourgoulhon:
Maybe one can add
if self._is_isomorphism and codomain_subset == self._codomain: return self._domain
I think I can do more generally
if self._codomain.is_subset(codomain_subset):
return self._domain
Replying to @egourgoulhon:
The patchbot reports a doctest error in
src/sage/geometry/polyhedron/base.py
I've seen this one before locally, I don't think it's coming from this ticket, but I have opened #32030 for it
Branch pushed to git repo; I updated commit sha1. New commits:
3b1c428 | ManifoldSubsetPullback: Make codomain_subset required 2nd init arg; fix pycodestyle/pyflakes warnings |
Replying to @mkoeppe:
Replying to @egourgoulhon:
Maybe one can add
if self._is_isomorphism and codomain_subset == self._codomain: return self._domainI think I can do more generally
if self._codomain.is_subset(codomain_subset): return self._domain
Yes, indeed! Being an isomorphism is not necessary in that case.
Branch pushed to git repo; I updated commit sha1. New commits:
d321b93 | ContinuousMap: Return domain if the map's codomain is contained in the given subset |