I think there's a few things that could be done here:
- Make top-level intersection work by inverting the function in the
image set. This needs to be done carefully, however.
- Make the inner intersection resolve to {n*pi | n in Z+}
- From there, make the image set of an image set resolve to a single imageset.
Aaron Meurer
On Wed, Sep 1, 2021 at 1:30 PM Oscar Benjamin
<[email protected]> wrote:
>
> On Wed, 1 Sept 2021 at 20:06, Charlie Hartman
> <[email protected]> wrote:
>>
>> When do image sets resolve to finite sets when intersected with an interval?
>> For example:
>>
>> I'm seeing that this looks great:
>>
>> solveset(sin(x),domain = Reals).intersect(Interval(2,50))
>> {𝜋,2𝜋,3𝜋,4𝜋,5𝜋,6𝜋,7𝜋,8𝜋,9𝜋,10𝜋,11𝜋,12𝜋,13𝜋,14𝜋,15𝜋}
>
>
> The code that handles this is here:
> https://github.com/sympy/sympy/blob/5c2dfe728fd7a93b13a38dd5d547c2acaf4aa8ba/sympy/sets/handlers/intersection.py#L329-L384
>
>>
>> but
>>
>> solveset(sin(sqrt(x)),domain = Reals).intersect(Interval(2,50))
>> [2,50]∩{𝑥2|𝑥∈[0,∞)∩{𝑛𝜋|𝑛∈ℤ}}
>
>
> In this case it is the inner intersection that does not evaluate and that has
> the intersection of an infinite interval with an infinite imageset. The
> inverter for the sup returns empty set because the answer is oo but that
> isn't considered to be part of the reals:
> https://github.com/sympy/sympy/blob/5c2dfe728fd7a93b13a38dd5d547c2acaf4aa8ba/sympy/sets/handlers/intersection.py#L344
>
>
> Oscar
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAHVvXxREwkU8f58%3DcCqu09bEgCPsKs8Tycb-%3DA4OrDao-ty7Vw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAKgW%3D6KV18s0mNdnENX0K3Tbxd24oUHsdb0VDmp0X9%3D2Wewrzw%40mail.gmail.com.