In this case, I tend to agree with Palmieri.

On Dec 4, 10:27 pm, William Stein <[email protected]> wrote:
> I very strongly disagree.  What's wrong with making a polynomial ring
> with two distinct variables whose *print* names you happen to set to
> be the same?    The variables are different.  It's just that they
> print in the same way.   Magma also allows this, by the way.

Because we are using the print of the variables to identify unique
rings:

sage: K=QQ['x,y']
sage: var0, var1  = K.gens()
sage: QQ[var0, var1] is QQ[var1, var0]
False
sage: K=QQ['x,x']
sage: var0, var1  = K.gens()
sage: QQ[var0, var1] is QQ[var1, var0]
True

Here the behaviour is very different. Also, there is ambiguous
behaviour:

sage: K=QQ['x,x']
sage: var0, var1 = K.gens()
sage: K('x') is var0
False
sage: K('x') is var1
True

(I would have expected that K('x') would be var0)

Mathematically QQ['y,y'] should be a univariate polynomial ring. I do
not claim that Sage should return a univariate polynomial ring.

However, having said this, it is very convenient to be able to make
these constructions. Specially

> sage: R.<x> = QQ[]
> sage: S.<y> = R[]
> sage: T.<x> = S[]

Is not uncommon to create your own polynomial rings over some input
rings inside some methods. If I needed to create a polynomial ring I
should have to find a new variable that is not used in the recursive
definition of the ring. So we would need a method to construct such
variables. Something like polygen but aware of the existing variables
in the recursive definition of the ring (this would be nice to have
anyway). Also, I use rings like QQ[x,x] to test robustness of methods.

So yes, ideally, this should be an error, but to correct this you
would need to provide more constructors (not only for rings, but power
series, NumberFields etc.) and rewrite some parts of the sage library,
esentially whenever it is constructed a ring inside a method. I think
it is not worth the effort as lons as QQ[x,x] is robust.

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to