Now this would be more useful:
sage: K.<a> = NumberField(x^2+3)
sage: L.<w> = NumberField(x^2+x+1)
sage: K.has_coerce_map_from(L)
False
sage: L.has_coerce_map_from(K)
False
sage: K.is_isomorphic(L)
True
sage: K.embeddings(L)
[
Ring morphism:
From: Number Field in a with defining polynomial x^2 + 3
To: Number Field in w with defining polynomial x^2 + x + 1
Defn: a |--> 2*w + 1,
Ring morphism:
From: Number Field in a with defining polynomial x^2 + 3
To: Number Field in w with defining polynomial x^2 + x + 1
Defn: a |--> -2*w - 1
]
to turn into a coercion!
John
> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to sage-devel+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>
Surely a number field + embedding is a richer structure than an
abstract number field, so the coercion should go from the former to
the latter as a forgetful functor.
Are you going to similarly come up with the question of coercion
between two number fields which are the same abstract field and with
mathematically the same embedding, but with one of higher precision
than the other?
John
PS What's wrong with sage-nt?!
Take a look at the docstring for composite_fields() : it has a
parameter preserve_embedding which, if both fields come with
embeddings, only gives compositums (composita?) which are compatible
with both embeddings.
What I have difficulty with is the relation between (a) explicit code
with actual objects, such as the code for composite_fields(), and (b)
the very general merging-functors sort of code. Is it the case that
both are needed, and that (a) uses (b)?
John
And it is easy to do so:
sage: phi = K.embeddings(L)
sage: phi[0].register_as_coercion()
sage: a + w
3*w + 1
William