#20963: __invert__ for Laurent polynomial is wrong
------------------------------+------------------------
       Reporter:  vdelecroix  |        Owner:
           Type:  defect      |       Status:  new
       Priority:  major       |    Milestone:  sage-7.3
      Component:  algebra     |   Resolution:
       Keywords:              |    Merged in:
        Authors:              |    Reviewers:
Report Upstream:  N/A         |  Work issues:
         Branch:              |       Commit:
   Dependencies:              |     Stopgaps:
------------------------------+------------------------

Comment (by tscrim):

 Replying to [comment:4 vdelecroix]:
 > Replying to [comment:3 tscrim]:
 > > It is ''really'' annoying to not be able to do `1 / x` and stay within
 Laurent polynomials as there is a lot more functionality available than in
 the fraction field. So -1 on always returning an element in the fraction
 field (in this case).
 >
 > Modifying the coercion model is out of the scope of this ticket ;-) What
 about `1 / 1`? The result should stay in whatever ring `1` belongs to? The
 advantage of the coercion model approach is that there is no ambiguity.

 The reason why I am okay with `1/1 in QQ` is because rationals behave the
 same as integers for nearly all purposes. However, for fraction fields of
 (Laurent polynomial) rings, they behave very differently than the Laruent
 polynomial rings.

 > I agree that we should be able to invert `x` inside the Laurent
 polynomials (hence my post on sage-devel mentioned in [comment:2
 comment:2]). But I don't agree that the syntax should be `1 / x`.

 However, this makes perfect sense mathematically and is the only real
 notation that we have for it other than `x^-1`. However, this would
 confuse so many people (and has) if `x^-1` is different than `1 / x`.
 Moreover this is such a common operation that forcing people to do
 `inverse_of_unit` (or anything like that), in addition to it being
 different than the print output, would lead to anger.

 I also think this abuse is okay from the POV of the code as the coercion
 framework allows you to not care when doing generic arithmetic operations.
 Besides, sometimes it is better to break principles/rules. ;)

--
Ticket URL: <https://trac.sagemath.org/ticket/20963#comment:5>
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