Aside from consistency with Python, the reason is that you can't really define a so-called algebraic ordering on complex numbers. Algebraic means that you can add both sides of an inequality (if a > b then a + c > b + c), and multiply them by something positive (if a > b and c > 0, then a*c > b*c).
For example, if you allow 1 + 2*I < 2 + 4*I, then rearranging by the first rule, you get 2*I + 1> 0. By the second rule, this is positive, so we can multiply it by both sides of the first inequality, giving -3 + 4*I < -6 + 8*I. Rearranging gives 4*I > 3. Since we still would have normal positive, numbers, 3 > 0, so by transitivity, 4*I > 0. But then multiplying that equation by 4*I by the first rule gives -8 > 0, which is not true. Basically, no matter how you try to define it, you can't make complex numbers into an algebraic ordering, because the way that I**2 gives a negative number screws up the second rule, and the first rule always lets you get to I > 0 or I < 0 (i.e., -I > 0), and since I**2 = (-I)**2 = -1, you get a contradiction either way. We *definitely* want > to mean an algebraic ordering in SymPy, since it implicitly lets us perform operations on inequalities like moving things to one side (saying a > b is equivalent to a - b being positive) and multiplying by positive things, which is really how you combine inequalities to do useful algebra with them. I say implicitly because things like, "solve (x - 1)*(x + 4) > 0 by finding where x - 1 and x + 4 are both positive or both negative" inherently rely on this rule. Aaron Meurer On Wed, Aug 6, 2014 at 10:40 AM, Chris Smith <[email protected]> wrote: > Python and SymPy both raise an error for something like I < 2*I -- is there > a good reason to disallow comparison of numbers that have the same arg even > though it is not 0 (as in the comparison of real numbers)? Allowing this > would allow 1 + 2*I < 2 + 4*I to be true, too. > > -- > 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 post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/c5adea66-a3e3-40f2-add4-17ee85dee5c9%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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2BuR9gzzvJnC2Q-teDdMk-XTNYuXwQ7RLLNes2831g87g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
