Coercions for number fields

17 views
Skip to first unread message

Simon King

unread,
Nov 26, 2010, 8:24:24 AM11/26/10
to sage-nt
Hi!

I have a couple of questions relating number fields and coercions.

When defining a number field, one can provide an embedding as an
additional structure.

1.
Do you think that there should be a coercion from a number field with
embedding to an isomorphic number field without embedding (but not the
other way around)?
Hence, do you want
sage: K.<a> = NumberField(x^3-7)
sage: L.<b> = NumberField(x^3-7, embedding=1.1)
sage: a+b # not implemented
2*a
?

2.
Should there be a coercion for isomorphic number fields that have
different embeddings in the same field, via
EmbeddedNumberFieldMorphism?
Hence, do you want
sage: K.<r4> = NumberField(x^4-2)
sage: L1.<r2_1> = NumberField(x^2-2, embedding = r4**2)
sage: L2.<r2_2> = NumberField(x^2-2, embedding = -r4**2)
sage: r2_1 + r2_2
0
sage: parent(r2_1+r2_2) is L2
True
sage: L1.coerce_map_from(L2)
Generic morphism:
From: Number Field in r2_2 with defining polynomial x^2
- 2
To: Number Field in r2_1 with defining polynomial x^2
- 2
Defn: r2_2 -> -r2_1
sage: L2.coerce_map_from(L1)
Generic morphism:
From: Number Field in r2_1 with defining polynomial x^2
- 2
To: Number Field in r2_2 with defining polynomial x^2
- 2
Defn: r2_1 -> -r2_2
sage: type(L1.coerce_map_from(L2))
<type
'sage.rings.number_field.number_field_morphisms.EmbeddedNumberFieldMorphism'>

Or do you prefer that the summation is done in the image of the
embeddings, hence, in K?

3.
How shall the pushout of two polynomial rings over different number
fields K,L be dealt with?
My suggestion is:
If K and L have coercion via embeddings, one should have
sage: K.<a> = NumberField(x^3-2, embedding=1.2)
sage: L.<b> = NumberField(x^6-2, embedding=1.1)
sage: from sage.categories.pushout import pushout
sage: pushout(K['t'],L['t'])
Univariate Polynomial Ring in t over Number Field in b
with defining polynomial x^6 - 2

If both K and L have embeddings, but there is no coercion between K
and L, then one should have
sage: K.<a> = NumberField(x^3-2,
embedding=CDF(1/2*I*2^(1/3)*sqrt(3) - 1/2*2^(1/3)))
sage: L.<b> = NumberField(x^6-2, embedding=1.1)
sage: L.coerce_map_from(K)
sage: pushout(K['t'],L['t'])
Univariate Polynomial Ring in t over Algebraic Field
Hence, the result is a polynomial ring over the field into which both
K and L embed.

I'd be glad to get some feedback. Background is my work on #8800. I
keep hitting bug after bug. And since I try to smash the bugs in a
conceptual way, I often use coercion as bug spray. But I wonder if
people would accept the outcome.

Best regards,
Simon

David Roe

unread,
Nov 26, 2010, 8:46:40 AM11/26/10
to sag...@googlegroups.com
1.
Do you think that there should be a coercion from a number field with
embedding to an isomorphic number field without embedding (but not the
other way around)?
Hence, do you want
sage: K.<a> = NumberField(x^3-7)
sage: L.<b> = NumberField(x^3-7, embedding=1.1)
sage: a+b   # not implemented
2*a
?

This sounds reasonable to me, and analogous to what we do for Zmod(p) and GF(p).


I'm strongly of the opinion that the summation should be done in K.  I think we should avoid coercion maps going in both directions when possible.
 
3.
How shall the pushout of two polynomial rings over different number
fields K,L be dealt with?
My suggestion is:
If K and L have coercion via embeddings, one should have
           sage: K.<a> = NumberField(x^3-2, embedding=1.2)
           sage: L.<b> = NumberField(x^6-2, embedding=1.1)
           sage: from sage.categories.pushout import pushout
           sage: pushout(K['t'],L['t'])
           Univariate Polynomial Ring in t over Number Field in b
with defining polynomial x^6 - 2

If both K and L have embeddings, but there is no coercion between K
and L, then one should have
           sage: K.<a> = NumberField(x^3-2,
embedding=CDF(1/2*I*2^(1/3)*sqrt(3) - 1/2*2^(1/3)))
           sage: L.<b> = NumberField(x^6-2, embedding=1.1)
           sage: L.coerce_map_from(K)
           sage: pushout(K['t'],L['t'])
           Univariate Polynomial Ring in t over Algebraic Field
Hence, the result is a polynomial ring over the field into which both
K and L embed.

I think this is okay, though I'm slightly worried about speed consequences if someone accidentally adds polynomials with incompatible base rings.  This problem currently arises when you do arithmetic and accidentally make an element of the Symbolic Ring.  The Algebraic Field isn't as bad as the symbolic ring, but still suffers more overhead than a number field.

I need to keep preparing for the talk on Sage I'm giving in half an hour, but I'm happy to give you more feedback later.
David

Simon King

unread,
Nov 26, 2010, 11:34:08 AM11/26/10
to sage-nt
Hi David,

On 26 Nov., 14:46, David Roe <r...@math.harvard.edu> wrote:
> > Or do you prefer that the summation is done in the image of the
> > embeddings, hence, in K?
>
> I'm strongly of the opinion that the summation should be done in K.  I think
> we should avoid coercion maps going in both directions when possible.

Would there be any serious consequences of having coercion in both
directions? Of course, a+b and b+a might have different parents, since
IIRC the rule is that the left summand counts if there are coercions
in both directions. But the fact that there is a rule for that case
shows that it is not absolutely essential to have coercions in both
directions.

> > Hence, the result is a polynomial ring over the field into which both
> > K and L embed.
>
> I think this is okay, though I'm slightly worried about speed consequences
> if someone accidentally adds polynomials with incompatible base rings.

Would it be better to get an error (as would currently be the case)?

Thanks for the feed back
Simon

Simon King

unread,
Nov 26, 2010, 12:01:21 PM11/26/10
to sage-nt
Hi!

A different question: Let K be a cyclotomic field and let L be a
number field isomorphic to K. Should there be a coercion from K to L?
From L to K? Both?

Cheers,
Simon

Simon King

unread,
Nov 26, 2010, 3:02:36 PM11/26/10
to sage-nt
Since a cyclotomic field comes with an embedding and since it seems
consense to coerce from fields with embeddings to fields without
embeddings, I guess the coercion should be from K to L, right?

Cheers,
Simon

David Roe

unread,
Nov 26, 2010, 3:06:53 PM11/26/10
to sag...@googlegroups.com
Yeah, I think that if you have a normal number field defined by the nth cyclotomic polynomial then there should be a coercion from the appropriate cyclotomic field to this number field.
David


Cheers,
Simon

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


Reply all
Reply to author
Forward
0 new messages