Changes between Version 35 and Version 62 of Ticket #8800


Ignore:
Timestamp:
12/08/10 09:01:10 (10 years ago)
Author:
SimonKing
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8800

    • Property Work issues changed from to change 32-bit test; remove forgetful coercion
  • Ticket #8800 – Description

    v35 v62  
    370370
    371371__Coercion__
     372
     373Important for the discussion is: What will we do with embeddings?
     374
     375Currently, the embedding of two number fields is used to construct a coercion (compatible with the embedding). Of course, the given embedding is also used as a coerce map.
     376
     377It was discussed to additionally have a "forgetful" coercion from an embedded to a non-embedded number field.
     378
     379It turned out that with bidirectional and forgetful coercions together, one can construct examples in which the coercions do not form a commutative diagram. Hence, we do ''not'' introduce forgetful coercions here.
     380
     381However, some improvement of the existing implementation was needed.
    372382
    373383  Was:
     
    456466__Comparison of fractional ideals / identity of Residue Fields__
    457467
    458   Fractional ideals have a `__cmp__` method that only took into account the Hermite normal form. In addition with coercion, we obtain:
     468  Fractional ideals have a `__cmp__` method that only took into account the Hermite normal form. Originally, the comparison of fractional ideals by "==" and by "cmp" yields different results. Since "==" of fractional ideals is used for caching residue fields, but "cmp" was used for comparing residue fields, the residue fields did not provide unique parents.
     469
     470  Was:
    459471  {{{
    460472sage: L.<b> = NumberField(x^8-x^4+1)
     
    467479sage: FK = K.fractional_ideal(K.0)
    468480sage: FL = L.fractional_ideal(L.0)
    469 sage: FK == FL
    470 True
    471   }}}
    472 
    473   Since the residue fields of two equal fractional fields are the same (caching), we obtain:
    474   {{{
     481sage: FK != FL
     482True
    475483sage: RL = ResidueField(FL)
    476484sage: RK = ResidueField(FK)
    477485sage: RK is RL
    478 True
    479   }}}
    480 
    481   Thus, `RK` is in fact defined with the embedded field `L`, not with the unembedded `K`. Hence, there is no coercion from the order of `K` to `RK`. However, ''conversion'' works (this used to fail!):
     486False
     487sage: RK == RL
     488True
     489  }}}
     490
     491  Now:
     492  {{{
     493sage: L.<b> = NumberField(x^8-x^4+1)
     494sage: F_2 = L.fractional_ideal(b^2-1)
     495sage: F_4 = L.fractional_ideal(b^4-1)
     496sage: F_2==F_4
     497True
     498sage: K.<r4> = NumberField(x^4-2)
     499sage: L.<r4> = NumberField(x^4-2, embedding=CDF.0)
     500sage: FK = K.fractional_ideal(K.0)
     501sage: FL = L.fractional_ideal(L.0)
     502sage: FK != FL
     503True
     504sage: RL = ResidueField(FL)
     505sage: RK = ResidueField(FK)
     506sage: RK is RL
     507False
     508sage: RK == RL
     509False
     510  }}}
     511
     512  Since `RL` is defined with the embedded field `L`, not with the unembedded `K`, there is no coercion from the order of `K` to `RL`. However, ''conversion'' works (this used to fail!):
    482513
    483514  {{{
    484515sage: OK = K.maximal_order()
    485 sage: RK.has_coerce_map_from(OK)
    486 False
    487 sage: RK(OK.1)
     516sage: RL.has_coerce_map_from(OK)
     517False
     518sage: RL(OK.1)
    4885190
    489520  }}}
    490521
    491   Note that I also had to change some arithmetic stuff in the `_tate` method of elliptic curves: The old implementation relied on the assumption that fractional ideals in an embedded field and in a non-embedded field can't be equal.
     522  Note that I also had to change some arithmetic stuff in the `_tate` method of elliptic curves: The old implementation relied on the assumption that fractional ideals in an embedded field and in a non-embedded field can't be equal. This assumption should still hold (since we do not introduce forgetful coercion), but I think it is OK to keep the change in _tate.