Opened 4 years ago
Last modified 5 weeks ago
#24176 new enhancement
ConditionSet, ImageSet: Implement formal Set comprehension
Reported by:  rws  Owned by:  

Priority:  major  Milestone:  sage9.6 
Component:  symbolics  Keywords:  
Cc:  tscrim, mantepse  Merged in:  
Authors:  Ralf Stephan  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/mkoeppe/implement_formal_set_comprehension (Commits, GitHub, GitLab)  Commit:  24789baf9f77ae75de9500085d196ad0a322aed5 
Dependencies:  #24171, #32013, #32089, #32121  Stopgaps: 
Description (last modified by )
In order to be able to express solution sets from SymPy's solveset
a set comprehension constructor as equivalent to SymPy's imageset
/ ConditionSet
is needed. As the arguments are symbolic the most natural way to do this would be a formal symbolic function named like set_of_all
taking a term argument and a list argument containing element_of(...)
function expressions.
This set would convert to a SymPy
ImageSet or ConditionSet
Related: ImageManifoldSubset
(#31653)
Change History (24)
comment:1 Changed 4 years ago by
 Dependencies set to #24171
comment:2 Changed 4 years ago by
 Dependencies changed from #24171 to #24171, pynac0.7.13
comment:3 Changed 4 years ago by
 Branch set to u/rws/implement_formal_set_comprehension
comment:4 Changed 4 years ago by
 Commit set to 9c77312e611f2d9fe5643e3e7a5bff51e511aa87
 Dependencies changed from #24171, pynac0.7.13 to #24171, #24262
New commits:
669ea22  24171: Formal set membership function

34c9773  24171: make RealSet inherit from Set_generic

af82717  24171: remove RealSet import; SR set coercion doctests

592ce87  24171: Py3 fixes

82b7c6f  Merge branch 'u/rws/formal_set_membership_function' of git://trac.sagemath.org/sage into t/24176/implement_formal_set_comprehension

ae29895  24176: check set argument of element_of()

9c77312  24176: Implement formal Set comprehension

comment:5 Changed 4 years ago by
 Branch changed from u/rws/implement_formal_set_comprehension to u/rws/24176
comment:6 Changed 4 years ago by
 Branch changed from u/rws/24176 to u/rws/implement_formal_set_comprehension
 Dependencies changed from #24171, #24262 to #24171, #24329
comment:7 Changed 7 months ago by
 Branch changed from u/rws/implement_formal_set_comprehension to u/mkoeppe/implement_formal_set_comprehension
comment:8 Changed 7 months ago by
 Commit changed from 9c77312e611f2d9fe5643e3e7a5bff51e511aa87 to ec393090edb11c220c0e0e39529445015a00623d
 Dependencies changed from #24171, #24329 to #24171
 Milestone changed from sage8.2 to sage9.4
Rebased on top of rebased #24171
New commits:
72565f2  24171: Formal set membership function

71bbf38  24171: Formal set membership function

6811a76  24171: make RealSet inherit from Set_generic

0a66f78  24171: remove RealSet import; SR set coercion doctests

e35349a  24171: Py3 fixes

26ef67d  24176: check set argument of element_of()

ec39309  24176: Implement formal Set comprehension

comment:9 Changed 7 months ago by
 Commit changed from ec393090edb11c220c0e0e39529445015a00623d to 24789baf9f77ae75de9500085d196ad0a322aed5
Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:
51c8152  Merge branch 't/31877/refine_category_of_realset' into t/24171/setmembershiprebased

5e623bb  RealSet.is_finite: Remove, inherited from category

7d19916  Do not use QQ.completion(oo,oo)  not implemented

9b4e224  24176: check set argument of element_of()

5310e04  Function_elementof: Remove use of is_Set

46d9795  24171: Formal set membership function

6995d1e  24171: make RealSet inherit from Set_generic

a41c5fc  24171: remove RealSet import; SR set coercion doctests

2a9c49a  24171: Py3 fixes

24789ba  24176: Implement formal Set comprehension

comment:10 Changed 7 months ago by
Rebased on top of updated #24171, which cherrypicked 1 commit from here.
Not sure about the changes on this ticket marked 24171. They are either from a newer or older version of 24171.
comment:11 Changed 7 months ago by
 Cc tscrim added
The fix to RealSet.__bool__
in 6995d1e/2a9c49a can go to #31941 (Make empty RealSet
false).
Unclear to me whether 6995d1e (make RealSet
inherit from Set_generic
) should be done
comment:12 Changed 7 months ago by
 Description modified (diff)
comment:13 Changed 7 months ago by
 Description modified (diff)
comment:14 followup: ↓ 16 Changed 7 months ago by
I think the approach on the current branch may be tied a bit too closely to SR
functions.
I think it's better to first implement:
ImageSubset
(as an abstract subobject of the codomain) for arbitraryMap
s  this would be a generalization ofImageManifoldSubset
(#31653). No relation toSR
(but by relaxing the code from #24171 that only allows some sets to be coerced toSR
, one would be able to coerce it toSR
).
ConditionSet
(as an abstract subobject of a parent in theSets
category)  defined via the element constructor of the parent and anSR
expression with truth value.
comment:15 Changed 7 months ago by
 Summary changed from Implement formal Set comprehension to ConditionSet, ImageSet: Implement formal Set comprehension
comment:16 in reply to: ↑ 14 ; followup: ↓ 18 Changed 7 months ago by
comment:17 Changed 7 months ago by
 Dependencies changed from #24171 to #24171, #32013
comment:18 in reply to: ↑ 16 Changed 7 months ago by
 Dependencies changed from #24171, #32013 to #24171, #32013, #32089
Replying to mkoeppe:
Replying to mkoeppe:
ConditionSet
(as an abstract subobject of a parent in theSets
category)  defined via the element constructor of the parent and anSR
expression with truth value.more precisely... an element of
CallableSymbolicExpression
(see #32008 for making this safer)
This is now implemented in #32089.
comment:19 Changed 7 months ago by
ImageSet
is essentially the same as the (deprecated?) sage.combinat.combinat.MapCombinatorialClass
, except that we would not insist that the map is injective.
comment:20 Changed 7 months ago by
 Dependencies changed from #24171, #32013, #32089 to #24171, #32013, #32089, #32121
Opened #32121 Replace MapCombinatorialClass
comment:21 Changed 7 months ago by
 Cc mantepse added
comment:22 Changed 7 months ago by
@mkoeppe: since you put me into the CC list, would this include symbolic roots of polynomials, given by the minimal polynomial?
I am guessing (because I'm not an expert there) that these would really need a special treatment, because one can compute with them quite well.
comment:23 Changed 6 months ago by
 Milestone changed from sage9.4 to sage9.5
comment:24 Changed 5 weeks ago by
 Milestone changed from sage9.5 to sage9.6
Accepting lists requires the function being a
GinacFunction
.