sage: ZZ(1) == QQ(1) == RR(1) == CC(1)
True
I think it would be unfortunate not to have "FK==FL" being True.
(Though not "FK is FL"). The behaviour of == in sage is already rathe
rstrange mathematically:
sage: GF(7)(1) == GF(5)(1)
False
sage: GF(7)(1) == ZZ(1) == GF(5)(1)
True
John
> --
> 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.
>
>
But there is no way in which the residue field's identity is affected
by an embedding into CC or RR, so in your example I see no reason why
the exact same residue field could not be used for both.
(continued below)
I'm not sure I understand that.
Next point: we want this embedding stuff to also apply when it's a
p-adic field that the number field is being embedded into. For
example, in the above example but with embeddings into Q5, one can map
i to either one of the square roots of -1 in Q5. And this does effect
the residue fields at the primes above 5 (generated by 2+i and 2-i)
since in one embedding 2+i maps to 0 mod 5 and in the other it maps to
something nonzero mod 5. SO there would be a case for the residue
field of 2+i w.r.t. the first embedding being equal to that of 2-i
w.r.t. the second embedding!
My guess is that this is too complicated to work out in general.
Maybe David Roe and p-adic people can assist?
John
I would be happier of there were more opinions though -- where are
you, 100+ sage-nt subscribers? Simon is not a number theorist but is
implementing stuff which will make our work easier!!!
John
On Wed, Dec 1, 2010 at 9:48 AM, Simon King <simon...@uni-jena.de> wrote:
> Hi y'all,
>
> On 30 Nov., 23:22, Simon King <simon.k...@uni-jena.de> wrote:
>> "Safest and easiest" aside: Solution (ii) should be doable as well.
>> The question is whether it is worth the additional effort or not.
>
> I think I would not be happy with the easy solution if it violates
> what number theorists expect.
>
> I would thus prefer a solution which is based on answers (from sage-nt
> people) how number fields should coerce, how fractional ideals should
> compare, and when residue fields should be identical resp. equal.
> Therefore I try to sum up the state of the discussion.
>
> Number fields:
> - EmbeddedNumberFieldMorphism should continued to be used for
> cooercion; only the implementation should be improved.
OK
> - NEW: There should be a "forgetful coercion" mapping generator to
> generator and disregarding the embedding, provided that the defining
> polynomials compare equal.
OK
> - Not clear to me: Assume that two number fields K1,K2 are embedded,
> but there is no direct coercion; should arithmetic be done in the
> pushout of the codomains of the embeddings? Otherwise, there will be
> no arithmetic at all between elements of K1 and K2, but perhaps that
> is what people would expect/prefer. There have been different answers
> so far.
>
No. If people want to (say) add elements of K1 to elements of K2,
whether or not the fields both have embeddings somewhere, I think that
the user should construct the compositum explicitly. Sage allows for
that, and in such a way that embeddings are preserved where relevant.
I'm not sure of the definition of pushout, but it sounded to me that
you were saying that if K1, K2 both had embeddings into CC then adding
an element of
K1 to an element of K2 would give a result in CC. I cannot imagine
that being what people would want as the default behaviour.
> Fractional ideals:
> Let F1 and F2 be fractional ideals in K1, K2. Currently we have a
> crucial difference between the meaning of cmp(F1,F2)==0 and F1==F2:
> * "cmp" is only comparing F1.pari_hnf() with F2.pari_hnf()
> * "==" first tries to find a common parent and then
> compares .pari_hnf():
> {{{
> sage: K.<i> = NumberField(x^2+1,embedding=CDF(I))
> sage: L.<i> = NumberField(x^2+1,embedding=-CDF(I))
> sage: FK = K.fractional_ideal(-K.0 + 2)
> sage: FL = L.fractional_ideal(-L.0 + 2)
> sage: FK==FL
> False
> sage: cmp(FK,FL)==0
> True
> }}}
> Do we want that difference?
>
NO
> Residue fields:
> Let R1, R2 be the residue fields provided by fractional ideals F1, F2,
> using the same generator name. Currently, we have
> "R1 is R2" <=> F1==F2
> "R1==R2" <=> cmp(F1,F2)==0
> Currently, that is a difference, hence, we have a violation of
> uniqueness of parent structures.
> Would it be a mathematically correct solution to have
> "R1 is R2" <=> F1.pari_hnf()=F2.pari_hnf() ?
No.
> Then I suggest to use F1.pari_hnf() in the unique key for
> ResidueField(F1) -- currently, F1 itself is used.
>
Keep using F1.
> When these questions are settled, potential other problems (like the
> one in _tate I mentioned before) will be tackled separately.
>
OK -- keep on asking!
John
> Thanks for your patience,
> Simon
>
sage: K.<i> = NumberField(x^2+1)
sage: L.<j> = QuadraticField(-1)
sage: K is L
False
sage: K == L
False
but I do not know how to tell which of those fields has an embedding
set. (When there is an embedding, the function
._populate_coercion_lists_() is called by the constructor).
This is a different situation from one in which the user has specified
an embedding (in my opinion).
On Wed, Dec 1, 2010 at 12:40 PM, Simon King <simon...@uni-jena.de> wrote:
> Hi John,
>
> On 1 Dez., 12:55, John Cremona <john.crem...@gmail.com> wrote:
>> [I hope I am not the only one reading this!]
>
> Don't you like to be a dictator? :-)
>
>>...
>> I'm not sure of the definition of pushout, but it sounded to me that
>> you were saying that if K1, K2 both had embeddings into CC then adding
>> an element of
>> K1 to an element of K2 would give a result in CC.
>
> Yes, that was my question.
>
>> I cannot imagine
>> that being what people would want as the default behaviour.
>
> There has been at least one person, namely "luisfe" at
> http://groups.google.com/group/sage-devel/browse_thread/thread/b080f34ba3cbc015/b6457ab70dd79c41?lnk=gst&q=NumberField+EOF#b6457ab70dd79c41,
> stating about L1->K, L2->K, where L1 has generator r2_1:
> """
> As long as you construct L1 with a specified embedding to K, from a
> user point of view you are stating "I am working on this subfield L1
> of K, but I want a subfield representation in terms of powers of
> r2_1". In that sense yes, K would be canónical. It would not be in L2
> had not an embedding to K or an embedding to a different field.
> """
>
> So, indeed we have two opinions.
I don't think I agree with Luis on this point, mainly because of what
I said above, namely that for quadratic and cyclotomic fields there is
an embedding by default, but you cannot say that the user has
expressed any preference by leaving that as default.
>
>> > {{{
I seem to have changed my mind!
John
> I would not mind about that consequence, but perhaps you (or other
> people) do.
>
> Cheers,
> Simon
>
In case (1) I have no objection at all to doing arithmetic in the
common overfield K3; but in (2) I would object. For a start, number
fields are exact while the complete fields are not, so we should only
move to working in the inexact fields when explicitly requested.
Is it too hard on the categorical approach to make the behaviour
depend on what sort of field the embedding codomain is?
John
> Example:
> sage: L.<b> = NumberField(x^8-x^4+1)
> sage: F_4 = L.fractional_ideal(b^4-1)
> sage: F_2 = L.fractional_ideal(b^2-1)
> sage: F_4
> Fractional ideal (1)
> sage: F_2
> Fractional ideal (1)
...
> 1. Comparison as ideals (via generators)
> sage: F_4.gens()
> (b^4 - 1,)
> sage: F_2.gens()
> (b^2 - 1,)
> sage: F_4==F_2
> False
Argh.
> 2. Comparison as elements (using _cmp_, which uses pari_hnf)
> sage: F_2.pari_hnf()==F_4.pari_hnf()
> True
> sage: F_2==F_4
> True
>
> Am I right that number theorists prefer the second way of comparison?
Yes, and I consider the first comparison (of ideals) a bug
(the former is defaulting to "is"?).
Cheers,
David
John
> Hi!
>
> I'd like to do some fine tuning in the comparison of fractional
> ideals.
>
> As ideals, they inherit a __cmp__ method of the class of ideals: It
> simply compares the list of generators.
Hi everyone,
I am not actually reading this thread, and I have no idea if anyone has already said what I'm about to say, but here goes:
*** Fractional ideals should not be a subclass of ideals. ***
http://trac.sagemath.org/sage_trac/ticket/3680
It's as crazy as having Rational be a subclass of Integer.
If there is any way of fixing this during the current round of tinkering....
david
I was also shocked by the same line, but forgot or omitted saying
anything. Ideals and fractional ideals should be subclasses of
projective modules (of rank 1). In particular, elements of the
ideals will coerce into the order, but this is not the case for
fractional ideals (or projective modules in general).
I say projective modules but there are ideals for non-maximal
orders which are not projective (= not invertible), so maybe the
class should be broadened to admit such ideals.
However, I think some number theorists need to look at the code
and come up with a proposal for the class hierarchy and what
functions and functionality should apply to the classes therein.
--David