Do we need p-adic rings, where p is not prime

35 views
Skip to first unread message

Simon King

unread,
Feb 9, 2013, 10:20:40 AM2/9/13
to sag...@googlegroups.com
Hi!

Currently, one can create p-adic rings where p is not a prime number,
using check=False. The resulting ring still believes that it is a
Euclidean domain:
sage: P = Zp(15, check=False)
sage: P.__class__.mro()
[sage.rings.padics.padic_base_leaves.pAdicRingCappedRelative_with_category,
...
sage.rings.ring.EuclideanDomain,
...
]
sage: P.is_integral_domain()
True

That makes me wonder: Are these mock p-adic rings used anywhere? Would
anyone see a problem when all p-adic rings (including the mock rings)
would be initialised as objects in the category of Euclidean domains?

Best regards,
Simon

Robert Bradshaw

unread,
Feb 9, 2013, 4:06:12 PM2/9/13
to sage-nt
Having a check=False parameter is useful when checking for primality
is expensive (say, for very large p). I think this is totally fine,
the contract is that p should be prime, and if you pass it a non-prime
and explicitly dissalow Sage from verifying this that for you, it
should just assume it's a prime even you lying to it results in
incorrect results.
> --
> You received this message because you are subscribed to the Google Groups "sage-nt" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-nt+u...@googlegroups.com.
> To post to this group, send an email to sag...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-nt?hl=en-GB.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Simon King

unread,
Feb 9, 2013, 4:26:34 PM2/9/13
to sag...@googlegroups.com
Hi Robert,

On 2013-02-09, Robert Bradshaw <robe...@gmail.com> wrote:
> Having a check=False parameter is useful when checking for primality
> is expensive (say, for very large p). I think this is totally fine,
> the contract is that p should be prime, and if you pass it a non-prime
> and explicitly dissalow Sage from verifying this that for you, it
> should just assume it's a prime even you lying to it results in
> incorrect results.

OK. This is how I understood the meaning of "check=False" - I was just
worried whether breaking the contract (i.e., providing a non-prime p on
purpose) was used somewhere.

BTW, my patch to make Zp(p), Qp(p) and power series rings using a
smaller category and to make the FractionFields functor have
IntegralDomains() and not Rings() as domain is almost finished, so,
#14084 will soon be ready for review.

Best regards,
Simon

Robert Bradshaw

unread,
Feb 9, 2013, 4:49:12 PM2/9/13
to sage-nt
On Sat, Feb 9, 2013 at 1:26 PM, Simon King <simon...@uni-jena.de> wrote:
> Hi Robert,
>
> On 2013-02-09, Robert Bradshaw <robe...@gmail.com> wrote:
>> Having a check=False parameter is useful when checking for primality
>> is expensive (say, for very large p). I think this is totally fine,
>> the contract is that p should be prime, and if you pass it a non-prime
>> and explicitly dissalow Sage from verifying this that for you, it
>> should just assume it's a prime even you lying to it results in
>> incorrect results.
>
> OK. This is how I understood the meaning of "check=False" - I was just
> worried whether breaking the contract (i.e., providing a non-prime p on
> purpose) was used somewhere.

I know faking GF(p) is handy for implementing a (prototype-level)
elliptic curve factoring. This can also be handy for working with
cryptographic-sized primes.

> BTW, my patch to make Zp(p), Qp(p) and power series rings using a
> smaller category and to make the FractionFields functor have
> IntegralDomains() and not Rings() as domain is almost finished, so,
> #14084 will soon be ready for review.
>
> Best regards,
> Simon
>

David Roe

unread,
Feb 9, 2013, 8:27:07 PM2/9/13
to sag...@googlegroups.com
Having a check=False parameter is useful when checking for primality
is expensive (say, for very large p). I think this is totally fine,
the contract is that p should be prime, and if you pass it a non-prime
and explicitly dissalow Sage from verifying this that for you, it
should just assume it's a prime even you lying to it results in
incorrect results.

+1
 
Reply all
Reply to author
Forward
0 new messages