On Nov 24, 10:34 pm, Simon King <simon.k...@uni-jena.de> wrote: > Hi! > > When defining a number field, it is optional to provide a canonical > embedding into the real lazy field. > > If two number fields are defined by the same polynomial and the same > generator name, they are still considered different, if only one of > them defines a canonical embedding. > > Example: > sage: K.<a> = NumberField(x^3-5,embedding=0) > sage: L.<a> = NumberField(x^3-5) > sage: K==L > False > > But even more, there is no coercion: > sage: K.has_coerce_map_from(L) > False > sage: L.has_coerce_map_from(K) > False > > Shouldn't there be one coercion? But in what direction? L to K or K to > L?
I agree that there should be a coercion, coercion from K to L should not be hard to implement. Coercion from L to K would certainly be interesting, but I do not figure out right now how to make it consistent. Suppose the following: 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: K.has_coerce_map_from(L1) True sage: K.has_coerce_map_from(L2) True sage: L3.<a> = NumberField(x^2-2) If there where coercions from non-embedded fields to embedding field, there would be an embedding from L3 to L1 and L3 to L2. So, the coercion model would discover two possible coercions from L3 to K. How can we make them compatible? It seems that making a consistent coercion framework would be equivalent to compute a "canonical" coercion from every NumberField to QQbar. Specifying an embedding would be like overriding the "canonical" coercion by a different one. But then I could play a different game and construct: sage: K=Qp(7) sage: R = K[x](x^2-2).roots() sage: L1.<r1> = NumberField(x^2-2, embedding=R[0][0]) sage: L2.<r2> = NumberField(x^2-2, embedding=R[1][0]) sage: K(r1) 3 + 7 + 2*7^2 + 6*7^3 + 7^4 + 2*7^5 + 7^6 + 2*7^7 + 4*7^8 + 6*7^9 + 6*7^10 + 2*7^11 + 7^12 + 7^13 + 2*7^15 + 7^16 + 7^17 + 4*7^18 + 6*7^19 + O(7^20) sage: K(r2) 4 + 5*7 + 4*7^2 + 5*7^4 + 4*7^5 + 5*7^6 + 4*7^7 + 2*7^8 + 4*7^11 + 5*7^12 + 5*7^13 + 6*7^14 + 4*7^15 + 5*7^16 + 5*7^17 + 2*7^18 + O(7^20) By the way, is there a problem with coercions? With the first set of fields I encounter the following error: sage: r4+r2_1 r4^2 + r4 sage: r4+r2_2 -r4^2 + r4 sage: r2_1+r2_2 ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (1077, 0)) -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org