Confused about power series ring identity

27 views
Skip to first unread message

Nils Bruin

unread,
Feb 17, 2023, 12:04:43 AM2/17/23
to sage-devel
From "PowerSeriesRing" docstring:

   There is a unique power series ring over each base ring with given
   variable name. Two power series over the same base ring with
   different variable names are not equal or isomorphic.

However (and I think it should be like that):

sage: P1.<x>=PowerSeriesRing(QQ,default_prec=30)
sage: P2.<x>=PowerSeriesRing(QQ,default_prec=20)
sage: P1 == P2
False

So .. I think a mistake in the documentation?

This bit is a little more questionable:

sage: (P1.0+P2.0).parent() == P1
True
sage: (P1.0+P2.0).parent() == P2
False
sage: (P2.0+P1.0).parent() == P2
True

I'm not quite sure if P1 or P2 should be preferred, but I think preferring just the left parent might not be desirable.

David Roe

unread,
Feb 17, 2023, 1:59:44 AM2/17/23
to sage-...@googlegroups.com
On Fri, Feb 17, 2023 at 6:04 AM Nils Bruin <nbr...@sfu.ca> wrote:
From "PowerSeriesRing" docstring:

   There is a unique power series ring over each base ring with given
   variable name. Two power series over the same base ring with
   different variable names are not equal or isomorphic.

However (and I think it should be like that):

sage: P1.<x>=PowerSeriesRing(QQ,default_prec=30)
sage: P2.<x>=PowerSeriesRing(QQ,default_prec=20)
sage: P1 == P2
False

So .. I think a mistake in the documentation?

I agree, this is a mistake in the documentation.
 
This bit is a little more questionable:

sage: (P1.0+P2.0).parent() == P1
True
sage: (P1.0+P2.0).parent() == P2
False
sage: (P2.0+P1.0).parent() == P2
True

I'm not quite sure if P1 or P2 should be preferred, but I think preferring just the left parent might not be desirable.

Since elements of power series rings track their own precision, I would suggest choosing the parent with higher precision.  This is what is done for p-adic capped relative and capped absolute rings:

sage: R1 = Qp(5, 30)
sage: R2 = Qp(5, 20)
sage: (R1(1) + R2(1)).parent() is R1
True
sage: (R2(1) + R1(1)).parent() is R1
True

David
 

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/a439bebf-377a-4336-b3a3-5a1bc467f1c9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages