formal sets

34 views
Skip to first unread message

Ralf Stephan

unread,
Nov 5, 2017, 9:14:16 AM11/5/17
to sage-support
Hello,

The set of integers can be formally represented as
sage: Set(ZZ)
Set of elements of Integer Ring

A bit more tricky are the reals:
sage: Set(RealSet(-oo,oo))
Set of elements of (-oo, +oo)

How could one represent the complexes? Is it a cartesian product?

Regards,

Dima Pasechnik

unread,
Nov 5, 2017, 2:35:35 PM11/5/17
to sage-support
sure - if you are willing to sacrifice the field structure.

sage: RealSet(-oo,oo).cartesian_product(RealSet(-oo,oo))
The Cartesian product of ((-oo, +oo), (-oo, +oo))

Eric Gourgoulhon

unread,
Nov 5, 2017, 2:56:44 PM11/5/17
to sage-support
Hi,

Le dimanche 5 novembre 2017 15:14:16 UTC+1, Ralf Stephan a écrit :
A bit more tricky are the reals:
sage: Set(RealSet(-oo,oo))
Set of elements of (-oo, +oo)


Well, this one is maybe too tricky:
sage: R = Set(RealSet(-oo,oo))
sage
: R.an_element()
(-oo, +oo)
???

In passing, we may also note that
sage: RealSet(-oo,+oo).an_element()
...
SignError: cannot add infinity to minus infinity


Eric.

Ralf Stephan

unread,
Nov 6, 2017, 1:49:08 AM11/6/17
to sage-support
On Sunday, November 5, 2017 at 8:56:44 PM UTC+1, Eric Gourgoulhon wrote:
sage: R = Set(RealSet(-oo,oo))
sage
: R.an_element()
(-oo, +oo)

I see, R is a set with one element, so there is a difference to Set(ZZ)

In passing, we may also note that
sage: RealSet(-oo,+oo).an_element()
...
SignError: cannot add infinity to minus infinity


Thanks. I think this needs to be fixed. 

Ralf Stephan

unread,
Nov 6, 2017, 2:14:35 AM11/6/17
to sage-support

Ralf Stephan

unread,
Nov 6, 2017, 4:54:05 AM11/6/17
to sage-support
On another note, while there is support for sets with maps from ZZ in EnumeratedSetFromIterator. How can for example the set under a function from the positive reals be formally represented? I'm looking for an equivalent of SymPy's ImageSet.

Regards,
Reply all
Reply to author
Forward
0 new messages