@@ -2629,11 +2629,13 @@ def complement(self, superset=None, name=None, latex_name=None, is_open=False):
2629
2629
- ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the
2630
2630
complement in the case the latter has to be created; the default
2631
2631
is built upon the symbol `\setminus`
2632
+ - ``is_open`` -- (default: ``False``) if ``True``, the created subset
2633
+ is assumed to be open with respect to the manifold's topology
2632
2634
2633
2635
OUTPUT:
2634
2636
2635
- - instance of :class:`ManifoldSubset` representing the
2636
- subset that is difference of ``superset`` minus ``self``
2637
+ - instance of :class:`ManifoldSubset` representing the subset that
2638
+ is ``superset`` minus ``self``
2637
2639
2638
2640
EXAMPLES::
2639
2641
@@ -2650,6 +2652,15 @@ def complement(self, superset=None, name=None, latex_name=None, is_open=False):
2650
2652
...
2651
2653
TypeError: superset must be a superset of self
2652
2654
2655
+ Demanding that the complement is open makes ``self`` a closed subset::
2656
+
2657
+ sage: A.is_closed() # False a priori
2658
+ False
2659
+ sage: A.complement(is_open=True)
2660
+ Open subset M_minus_A of the 2-dimensional topological manifold M
2661
+ sage: A.is_closed()
2662
+ True
2663
+
2653
2664
"""
2654
2665
if superset is None :
2655
2666
superset = self .manifold ()
@@ -2672,11 +2683,13 @@ def difference(self, other, name=None, latex_name=None, is_open=False):
2672
2683
- ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the
2673
2684
difference in the case the latter has to be created; the default
2674
2685
is built upon the symbol `\setminus`
2686
+ - ``is_open`` -- (default: ``False``) if ``True``, the created subset
2687
+ is assumed to be open with respect to the manifold's topology
2675
2688
2676
2689
OUTPUT:
2677
2690
2678
- - instance of :class:`ManifoldSubset` representing the
2679
- subset that is difference of ``self`` minus ``other``
2691
+ - instance of :class:`ManifoldSubset` representing the subset that is
2692
+ ``self`` minus ``other``
2680
2693
2681
2694
EXAMPLES::
2682
2695
@@ -2706,6 +2719,13 @@ def difference(self, other, name=None, latex_name=None, is_open=False):
2706
2719
sage: M.difference(O, is_open=True)
2707
2720
Open subset CO2 of the 2-dimensional topological manifold M
2708
2721
2722
+ Since `O` is open and we have asked `M\setminus O` to be open, `O`
2723
+ is a clopen set (if `O\neq M` and `O\neq\emptyset`, this implies that
2724
+ `M` is not connected)::
2725
+
2726
+ sage: O.is_closed() and O.is_open()
2727
+ True
2728
+
2709
2729
"""
2710
2730
# See if it has been created already
2711
2731
diffs = []
0 commit comments