You do need indexing to represent U A_i in general, but my point is
that ImageSet as you've defined it shouldn't be necessary.
To represent something like U [2*n, 2*n + 1] would require something
like BigUnion(Interval(2*n, 2*n + 1), n, Integers). The indexing is
done by the symbol that's used to define the set. We could also make
some way to create an arbitrary set parameterized by a variable, like
A_k so that U_{k \in I} A_k can be represented (do we currently have
any kind of arbitrary set object?).
>
>> And you still haven't answered where infinite unions are needed for
>> solveset.
>
> I thought of using BigUnion where there is a union of more than one
> imagesets, (like in case of trigonometric equations)
>
>>>> solveset(sin(x), x, S.Reals)
> Union(ImageSet(Lambda(_n, 2*_n*pi), S.Integers), ImageSet(Lambda(_n, 2*_n*pi
> + pi), S.Integers))
> # (sin(2*x) + sin(4*x) + sin(6*x)) will have lots of union of imagesets
> BigUnion could give `ImageSet(Lambda(_n, _n*pi), S.Integers)`, (although
> _union of imageset is under development, BigUnion can act as helper)
I'm still not following why it is needed, since this is still a union
of a finite number of sets (even though the sets themselves are
infinite). But maybe I'm missing something.
However, I suppose it could be useful for inequalities, and possibly
solutions in the complex domain or in higher dimensions. For instance,
sin(x) >= 0 has a solution set U_{n integer} [2*n*pi, (2*n + 1)*pi].
>
> I guess this is an idea that is in an initial stage (and that is why I can't
> imagine it in larger scale), and if you suggest that it won't be feasible I
> would rather remove it from the proposal.
I think it is feasible. BigUnion is probably quite straightforward to
implement, once we agree on an API.
Aaron Meurer
>
https://groups.google.com/d/msgid/sympy/5f6aa7cc-6d9e-4ef6-8190-5f9581d858bc%40googlegroups.com.