#15348: "R.<a> =" syntactic sugar incorrect for EquationOrder
-------------------------------------+-------------------------------------
       Reporter:  emassop            |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.0
      Component:  number fields      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/15348            |  496f5ac31807f7613aaddbef6dd8119e33ca4366
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by emassop):

 Replying to [comment:33 jdemeyer]:
 > I now changed `_defining_generators()` to use the number field gens
 instead. This fixes the case of relative extensions.

 Disregarding the change to `gen_dict()`, this makes sense to me. I would
 on first sight argue that `defining_generators` should not be defined for
 an order that has not been defined by generators, but since this is a
 private method used only by `R.<...>` (disregarding `gen_dict`), which
 moreover throws an exception if the elements are not in the order, I think
 it's fine here.

 Taking `gen_dict()` back into the picture, I'm not so happy with its
 elements not necessarily generating the order anymore (as a module, or as
 a ring), as there is nothing in the name `gen_dict` that suggests this
 would not be the case. For instance
 {{{
 K.<a> = QuadraticField(-163)
 R = K.ring_of_integers()
 dict_gens_values = [R(x) for x in K.gens()]
 S = K.order(dict_gens_values)
 print S.index_in(R)
 }}}
 prints 2 instead of the expected 1.

 Tangentially, `NumberField.ring_of_integers` should pass its arguments to
 `self.maximal_order`, in the same way that `NumberField.OK` does. (For the
 deprecation policy, this is probably not currently feasible, but we can
 deprecate non-empty arguments.) As a side-effect, this prohibits the
 syntax `R.<w> = K.ring_of_integers()`, in the same that `R.<w> =
 K.order(...)` is prohibited (which made one of my earlier points moot).
 This also makes the following impossible, where `w` does not become the
 expected generator:
 {{{
 K.<a> = QuadraticField(-163)
 R.<w> = K.ring_of_integers()
 w = a # Since I'm not running the version with the patch.
 print K.order(w).index_in(R)  # R.<w> suggests this prints 1, but it
 actually prints 2.
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/15348#comment:34>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to