Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
loefflerd mannequin opened this issue Sep 25, 2008 · 6 comments
Closed

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

loefflerd mannequin opened this issue Sep 25, 2008 · 6 comments

Comments

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Sep 25, 2008

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

@loefflerd loefflerd mannequin added this to the sage-3.4.2 milestone Sep 25, 2008
@loefflerd loefflerd mannequin assigned williamstein Sep 25, 2008
@loefflerd

This comment has been minimized.

@loefflerd
Copy link
Mannequin Author

loefflerd mannequin commented Mar 17, 2009

comment:1

I'm pleased to report that this seems to be fixed by fwclarke's patch for #5508. There isn't automatic coercion between relative + absolute fields but it's debatable whether there should be; the more severe issue was the problems with orders assuming that there was in their coercion code, which is now fixed. Well done that man.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Mar 25, 2009

comment:2

To close this we would need a doctest.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title Coercion between relative and absolute number fields [fixed by #5508] Coercion between relative and absolute number fields Mar 25, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-3.4.2, sage-3.4.1 Mar 25, 2009
@loefflerd
Copy link
Mannequin Author

loefflerd mannequin commented Mar 27, 2009

comment:4

I have added a doctest that checks this is corrected to my latest patch at #5159. This also includes another patch to catch a doctest failure arising from #5508 on 32-bit machines.

@loefflerd
Copy link
Mannequin Author

loefflerd mannequin commented Apr 24, 2009

comment:5

Michael: can we close this ticket now, as with 5508 and 5159 merged, the code contains both a fix and a doctest to prove the fix works?

Regards,

David

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Apr 24, 2009

comment:6

Fixed in Sage 3.4.2.alpha0 by #5508.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-4.0, sage-3.4.2 Apr 24, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Apr 24, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant