On Sun, Jun 5, 2011 at 12:38 PM, Ronan Lamy <ronan.l...@gmail.com> wrote:
> Le dimanche 05 juin 2011 à 06:13 -0700, Vinzent Steinberg a écrit :
>> On 4 Jun., 18:24, Ronan Lamy <ronan.l...@gmail.com> wrote:
>> > No, it shouldn't, because ZZ isn't a set. That's indeed the problem with
>> > using the name of an abstract mathematical set to designate a concrete
>> > type.
>>
>> If I understand it correctly, ZZ is the implementation of the ring of
>> integers, so mathematically it is nothing but a set with some special
>> elements and a few mappings, satisfying some axioms. For convenience,
>> you refer to the set only, even if you mean the ring. So I think the
>> implementation is fine.
>>
> Your understanding seems to contradict Aaron's. ZZ can't be
> simultaneously a proxy for a concrete type and a representation of an an
> abstract mathematical concept.
>
>> > "Symbol('n', integer=True) in ZZ" looks like something that should
>> > obviously be True, but actually it doesn't make sense.
>>
>> Well, in polys this would be rather ZZ[n], because ZZ means concrete
>> integers and not symbolic ones.
>
> But we need symbolic integers if we want to do any symbolic manipulation
> on integers. In the main core, there's .is_integer and .is_Integer, they
> are different and we need both. Why change the rules in the polynomial
> core?

Because you can't really work with symbolic integers, or at least not
in the way that you can work with actual ones.  It would be awesome if
you could.  But what is quo(x**n - 1, x - 1)?  Or factor(x**n - 1)?
(these are actually a nice questions because it's not to difficult to
represent the answer using a summation, but you can imagine how
difficult it can be in general)?

That's symbolic powers, but the same thing applies to symbolic
coefficients.  For example, what is quo(x**2 + n*x + m, x - 1)?  Maybe
you could generate a general answer, but how that's actually
relatively simple.  How about determining if x**3 + n*x**2 + m*x + k
is irreducible over the rationals, where n, m, and k are all
rationals.   If n, m, and k are given, it can be determined, but for
symbolic n, m, and k an answer would involve all kinds of crazy number
theory functions, if an answer can even be expressed at all.

Aaron Meurer

>
>> > So 'isinstance(a,
>> > int_type)' isn't just more readable, it also prevents dangerous
>> > misunderstandings.
>>
>> > BTW, ZZ.__contains__ does exist and does something different from
>> > ZZ.of_type.
>>
>> The difference is subtle, ZZ.__contains__ tries to convert the type,
>> but ZZ.of_type only checks the type. It is like '==' vs. 'is'.
>>
>> Vinzent
>>
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to