On Wed, Jun 4, 2008 at 10:16 PM, Bill Page <[EMAIL PROTECTED]> wrote:
>
> On Wed, Jun 4, 2008 at 11:06 PM, William Stein wrote:
>>
>> On Wed, Jun 4, 2008 at 7:35 PM, Bill Page wrote:
>>>
>>> On Wed, Jun 4, 2008 at 1:54 PM, Robert Bradshaw wrote:
>>>>
>>>> David's explanation of this is right on. We need parent() to work
>>>> in some sensible way on non-Elements (e.g. Python ints, objects
>>>> from outside Sage) to be able do some kind of coercion reasoning
>>>> on them. Python is a dynamically typed language, ever object has
>>>> a type.
>>>
>>> So is this essentially an admission that the concept of 'parent' is
>>> superfluous and could have in fact been implemented just as
>>> Python 'type'?
>>
>> That is not the case, except that of course *anything* that can
>> be implemented, can be implemented in any turing complete
>> language.
>>
>
> I did not mean to pose this question in a trivial way. I meant to
> suggest that the concept of type in the Python programming language,
> i.e. classes, could directly implement the concept of "parent" as used
> in Sage without abusing either concept at all. Can you suggest an
> example that demonstrates that this is not the case?

I think Robert's example of the integers modulo n is an excellent example
of precisely this.  I'm confused about why you don't see this.

>
>> ...
>> There are infinitely many different parents, one of each value
>> of n.   For a given n, the ring Z/nZ is a specific mathematical
>> object, which is itself for many many reasons worth modeling
>> in a computer.  If nothing else, it is the place on which to hang
>> functions like "multiplicative_generator()".
>
> Python classes can also take parameters.

I didn't know that.  I thought the only way to create a Python class
is for the Python interpreter to execute Python code that looks like this:

class Foo(...):
     ...

That makes a new class called Foo.  How are you going to make, at
runtime, new classes for each of Z/nZ say, for 1 <= n < 10^5, i.e.,
something like this in Sage:

  v = [Integers(n) for n in range(1,10^5)]

I do not think it is possible to concisely create a hundred thousand
separate Python classes like that.

>> Any computer algebra system that doesn't have first class
>> actual objects that represent basic mathematical structures
>> such as rings, fields, etc., feels extremely barren if one has
>> used Magma for a sufficient amount of time.
>>
>
> Sure. Rings and fields are categories.

I meant "Rings" and "fields" not as categories but specific rings
and specified fields as mathematical objects in their own right.
In Magma and Sage there is virtually no difference between
"a polynomial ring over the rational numbers" and a specific
polynomial over the rationals -- both are first class instances
in exactly the same way.

> Magma was not the first system
> to represent these mathematical structures in a computer.

I believe Magma was the first to very systematically represent
the objects of the categories as first class objects systematically
throughout the system.  I know of no other system that does this
(except Sage).

>
>> Specific rings, fields, vector spaces, etc., are all basic objects of
>> mathematics, that are just as important to fully implement and
>> model in a CAS as polynomials, rational numbers, vectors, etc.
>> I firmly believe Magma was the first ever system to really get this
>> right, and Sage merely copies this.   I really greatly appreciate
>> what Cannon et al. did...
>>
>
> I am sure Magma is an interesting system - everything I have been
> reading about it confirms that - but I do not think it was the first.
> I am also not yet convinced that it has implemented these general
> mathematically concepts in any substantially better way then, for
> example Axiom.

I think Magma is brilliant.   Disclaimer: I used to be one of the
biggest Magma zealots on the planet, so take that with a grain of salt!
It is also not my intention here to make any negative comments
at all about Axiom (say) -- only positive comments about Magma.

> Some things it does seem peculiar and ad hoc to me.
> These are the things that standout in my mind when I think about in
> what ways Sage resembles Magma. Of course there are some specific
> computations that Magma does much more efficiently than any other
> system. But that is not the point. We are talking here about general
> design issues.

Yet efficiency and design are closely linked.   When I first started using
Magma after years and years of C++, I was amazed how they were able
to unify so many ideas and bring such a vast amount of quality code
together in a way that worked pretty well.  I soon started writing, in the
Magma interpreter, vastly more efficient code than I could ever write in C++,
and code that accomplished a lot more.  Much of this was for me directly
a result of the excellent design ideas that went into Magma.  This was
a real eye opener for me.

>> ...
>>> "SymbolicRing" is another thing that worries me a little. Exactly
>>> what (mathematically) is a symbolic ring? E.g. Why is it a ring
>>> and not a field? Operations like 'sin(sin(sin(x))).parent()' doesn't
>>> look much like a ring to me. Probably most other computer algebra
>>> systems would just call this an "expression tree" or AST or
>>> something like that.
>> ...
>> To me, the SymbolicRing is the mathematical structure in which
>> calculus teachers, engineers, etc., are kept happy.  In Sage
>> that was 100% its purpose.  Ask Marshall Hampton, who is teaching
>> calculus right now using Sage, about what he needs to make
>> teaching calculus easy, and the answer is "The Symbolic Ring",
>> plus graphics and interact.
>>
>
> I don't doubt that doing symbolic mathematics by computer is very
> useful for teaching calculus - after all that is what is normally
> meant by the term "calculus", i.e. a method of calculation based on
> the symbolic manipulation of expressions. The name "Symbolic Ring"
> however makes it sound more "algebraic",i.e. concerned with structure,
> relation and quantity. So I was looking for a more formal mathematical
> definition of this sort. I did not expect it was a name intended just
> to keep certain people happy. :-(

It's "symbolic" in the sense of "symbolic calculus" as opposed to
"numerical" analysis.   The name wasn't chosen to keep people happy,
but the object itself was created to do so.  I think it might have been
called the SymbolicCalculusRing or SymbolicExpressionRing
at one point but that was too long.

>
>> ...
>
> Regards,
> Bill Page.
>
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to