Sorry for my late response (I was busy traveling). I see what you are trying to suggest of implementing for imageset, but I am still not sure about it whether it will be a good idea or not. I will open an issue-cum-discussion for discussing the API.
Thanks! Yathartha On Saturday, March 24, 2018 at 7:14:54 AM UTC+5:30, Aaron Meurer wrote: > > On Fri, Mar 23, 2018 at 6:56 AM, Yathartha Joshi <yatha...@gmail.com > <javascript:>> wrote: > > I am not sure of IndexSet usage but the reason I thought of it was that > > whenever we need to represent arbitrary set we have a notion of indexing > so > > that is why I thought of having IndexSet. > > > https://math.stackexchange.com/questions/485244/indexed-families-and-arbitrary-sets-notation > > > http://www.math.umaine.edu/~farlow/sec22.pdf > > 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 > > > > > Thanks > > Yathartha > > On Friday, March 23, 2018 at 11:56:03 AM UTC+5:30, Aaron Meurer wrote: > >> > >> I'm not seeing an instance where IndexSet is useful. For finite > >> collections of sets, it is redundant, as Union and Intersection can > >> already take a finite number of arguments. For infinite collections, > >> whatever symbol you index over would already exist in the collection > >> itself (for instance, n in Interval(2*n, 2*n + 1)) > >> > >> And you still haven't answered where infinite unions are needed for > >> solveset. > >> > >> Aaron Meurer > >> > >> On Fri, Mar 23, 2018 at 12:14 AM, Yathartha Joshi <yatha...@gmail.com> > >> wrote: > >> > What I understood about BigUnion and BigIntersection from here. > BigUnion > >> > for > >> > set of finitesets will work similar to union but for set of imagesets > >> > (infinite sets) we will be returning a unified solution. > >> > > >> > say for eg: [2*n , 2*n - 1 for n in Integers] passing it to Bigunion > >> > will > >> > yield something like [n for n in Integers] and BigIntersection would > >> > yield > >> > EmptySet. > >> > > >> > See https://github.com/sympy/sympy/issues/9815#issuecomment-373978030 > >> > > >> > In solveset when union of imagesets are returned we can apply big > union > >> > to > >> > get the unified result (probably could help the _union of imagesets > once > >> > its > >> > implemented). > >> > > >> > IndexSet will be implemented to get access to set of sets through > >> > indexing, > >> > a number of sets will be passed as parameters and an instance of > >> > IndexSet > >> > will be returned with indices mapped to each of the sets in the sets. > >> > This > >> > way we can get access to a set of sets. > >> > > >> >>>> X = IndexSet(FiniteSet(1, 2, ,3), FiniteSet(4, 5)); X > >> >>>> X[0] > >> > FiniteSet(1, 2 ,3) > >> >>>>X[1] > >> > FiniteSet(4, 5) > >> > > >> > > >> > On Friday, March 23, 2018 at 5:44:13 AM UTC+5:30, Aaron Meurer wrote: > >> >> > >> >> Regarding BigUnion, what is the point of having it and IndexSet that > >> >> can only represent a finite number of sets? Union can already do > this > >> >> without the indirection. I'm also unclear where this will be needed > >> >> for solveset. > >> >> > >> >> Aaron Meurer > >> >> > >> >> On Thu, Mar 22, 2018 at 4:38 PM, Yathartha Joshi <yatha...@gmail.com> > > >> >> wrote: > >> >> > Sorry I just gave the access to amit kumar, I have changed it, > please > >> >> > have a > >> >> > look. > >> >> > > >> >> > Thanks! > >> >> > > >> >> > > >> >> > On Friday, March 23, 2018 at 1:54:31 AM UTC+5:30, Aaron Meurer > wrote: > >> >> >> > >> >> >> When I click on that link it says I don't have access. > >> >> >> > >> >> >> I recommend starting your proposal on > >> >> >> https://summerofcode.withgoogle.com and linking the draft > proposal > >> >> >> there. That will make it easier to find in the future. > >> >> >> > >> >> >> Aaron Meurer > >> >> >> > >> >> >> On Thu, Mar 22, 2018 at 4:01 PM, Yathartha Joshi > >> >> >> <yatha...@gmail.com> > >> >> >> wrote: > >> >> >> > I have created a proposal here. It would be great if you could > >> >> >> > review > >> >> >> > it > >> >> >> > and > >> >> >> > suggest any changes. > >> >> >> > > >> >> >> > Thanks in advance. > >> >> >> > Yathartha > >> >> >> > > >> >> >> > On Thursday, March 22, 2018 at 11:08:27 PM UTC+5:30, Yathartha > >> >> >> > Joshi > >> >> >> > wrote: > >> >> >> >> > >> >> >> >> > >> >> >> >> On Thursday, March 22, 2018 at 2:26:18 PM UTC+5:30, Amit Kumar > >> >> >> >> wrote: > >> >> >> >>> > >> >> >> >>> Hey Yathartha, > >> >> >> >>> > >> >> >> >>> That sounds good. > >> >> >> >>> > >> >> >> >>> Cheers! > >> >> >> >>> Amit > >> >> >> >> > >> >> >> >> > >> >> >> >> Okay! Thanks. > >> >> >> >> > >> >> >> >> Also, I was thinking was making absolute value expressions to > >> >> >> >> work > >> >> >> >> in > >> >> >> >> complex domain. I found a few equations that have complex > >> >> >> >> solutions: > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > http://www.wolframalpha.com/input/?i=solve(abs(x-2)+%2Babs(x)+-+7,+x) > >> >> >> >> http://www.wolframalpha.com/input/?i=solve(abs(x-2)+-2+,+x) > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > http://www.wolframalpha.com/input/?i=solve(abs(x-2)+%2Babs(x+%2B4)+-+16,+x) > >> >> >> >> > >> >> >> >> I was trying to figure out a possible way to solve this, but I > am > >> >> >> >> facing > >> >> >> >> difficulty in getting to the solution. I tried asking the > >> >> >> >> question > >> >> >> >> here, and > >> >> >> >> got the only possible way. Can you provide me with some > >> >> >> >> suggestions > >> >> >> >> regarding this? Is there a specific reason as to why solveset > >> >> >> >> (and > >> >> >> >> even > >> >> >> >> solve) is not made to solve in complex domain. > >> >> >> >> > >> >> >> > -- > >> >> >> > 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 sympy+un...@googlegroups.com. > >> >> >> > To post to this group, send email to sy...@googlegroups.com. > >> >> >> > Visit this group at https://groups.google.com/group/sympy. > >> >> >> > To view this discussion on the web visit > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > https://groups.google.com/d/msgid/sympy/aecef52c-4e2e-40b0-9b1c-3cf7c022374c%40googlegroups.com. > > > >> >> >> > > >> >> >> > For more options, visit https://groups.google.com/d/optout. > >> >> > > >> >> > -- > >> >> > 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 sympy+un...@googlegroups.com. > >> >> > To post to this group, send email to sy...@googlegroups.com. > >> >> > Visit this group at https://groups.google.com/group/sympy. > >> >> > To view this discussion on the web visit > >> >> > > >> >> > > >> >> > > https://groups.google.com/d/msgid/sympy/862ac528-e77b-46e6-b751-e5ef532a2e46%40googlegroups.com. > > > >> >> > > >> >> > For more options, visit https://groups.google.com/d/optout. > >> > > >> > -- > >> > 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 sympy+un...@googlegroups.com. > >> > To post to this group, send email to sy...@googlegroups.com. > >> > Visit this group at https://groups.google.com/group/sympy. > >> > To view this discussion on the web visit > >> > > >> > > https://groups.google.com/d/msgid/sympy/34765644-ae2a-4332-9a17-52e54c056f9c%40googlegroups.com. > > > >> > > >> > For more options, visit https://groups.google.com/d/optout. > > > > -- > > 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 sympy+un...@googlegroups.com <javascript:>. > > To post to this group, send email to sy...@googlegroups.com > <javascript:>. > > Visit this group at https://groups.google.com/group/sympy. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/sympy/5f6aa7cc-6d9e-4ef6-8190-5f9581d858bc%40googlegroups.com. > > > > > > For more options, visit https://groups.google.com/d/optout. > -- 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 sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/4afa0478-669b-4b40-8bab-f0a48db5f9ad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.