Skip to content

[fixed by #5508] Coercion between relative and absolute number fields #4193

@loefflerd

Description

@loefflerd
mannequin

Is there supposed to be a canonical coercion map between a relative number field and its associated absolute field?

At the moment (in 3.1.2) there apparently isn't, and trying to force one raises a TypeError:

sage: K1.<a> = NumberField(x^3 - 2)
sage: R.<y> = PolynomialRing(K1)
sage: K2.<b> = K1.extension(y^2 - a)
sage: K2abs = K2.absolute_field('w')
sage: K2abs(b)
TypeError: Cannot coerce element into this number field

I suppose it's sort of fair enough as there exist multiple K1-linear embeddings from K2 into K2abs, but shouldn't the definition of K2abs give a distinguished element of this set, sending the generator b of K2 to the generator w of K2abs?

This causes problems elsewhere, as the code for relative orders in number fields relies on having such a coercion to do basic element-creation and membership-testing routines, and these are all broken as a result:

sage: R = K2.order(b)
sage: b in R
False
sage: bb = R.gens()[1] # b by any other name
sage: bb == b
True
sage: bb.parent() is R
True
sage: bb in R
False
sage: R(bb) # trying to coerce something into its own parent!
TypeError: Cannot coerce element into this number field

I uncovered this last problem first while trying to fix #4190, or more precisely while trying to write a doctest for a fix that I'd already written. (I have a fix which works for absolute orders and should work for relative orders too, but there's no way it can work given the above general brokenness.)

David

CC: @sagetrac-fwclarke

Component: number theory

Issue created by migration from https://trac.sagemath.org/ticket/4193

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions