On Wed, Jul 31, 2024 at 05:55:30PM +0200, Ralf Hemmecke wrote:
> On 7/31/24 16:49, Waldek Hebisch wrote:>> ((*$sTO)(rs1, s3) - rs2)$sTO
> >>
> >> gives the same "wrong" result.
> >
> > It should be
> >
> > ((*$sTO)(s3, rs1) - rs2)$sTO
> >
> > and this works without the patch.
> I know, but why do you claim that it must be the way you say in a
> non-commutative ring? I do not think that it is only my opinion that this is
> ambiguous.
Well, people use various weird conventions. But mainstream practice
to is chose conventions in a way that make computations simpler.
Normal rule is s*(x/y) = (s*x)/y. Another rule is (x/y)*y = x.
Both rules would be broken if you define division differently.
Or to put is differenly, if you want simple rules do not move things
to the other side on the whim.
> >> I have nothing against introducing right-/left- division, but / should be
> >> reserved for the case when x * y^(-1) = y^(-1) * x otherwise I would
> leave
> >> it undefined.
>
> > Well, division solves equation x = d*y, so we have d = x * y^(-1).
> How can you say so in a non-commutative ring? I guess some people claim that
> it solves x=y*d.
>
> > This definition is necessary to have sane interaction with multiplication.
> > To do it on the other side is a different operation. If you look
> > at definitions in the algebra, FreeDivisionAlgebra, Group and
> > XPolynomialRing are quite explicit and define x/y as x * y^(-1).
> > In most other cases order does not matter as corresponding
> > multiplication is commutative. Possibly the only unclear definition
> > is the one in StreamTaylorSeriesOperations.
> OK, you convinced me with our definitions in FriCAS. I still see danger that
> our formatters transform x/y to \frac{x}{y} also for a non-commutative
> domain (I haven't actually checked) and that would be certainly wrong.
If they do, we would need to fix this. But it is likely that formatters
do not produce 'x/y'.
> And yes, the docstring of / in StreamTaylorSeriesOperations must definitely
> reflect compatibility with FreeDivisionAlgebra and all other
> (non-commutative) places.
Yes.
OK. However, operations normally should be defined in categories
and users should look for definitions in categories. In some cases
like StreamTaylorSeriesOperations we want to keep functionality
as a package. Technically we can not reuse definition from categories
in such case, but users should understand that the operation are
the same or at least as close as possible do definitions in
categories. The definition above is from MagmaWithUnit, and is
inherited by Ring. StreamTaylorSeriesOperations in general
description says that it 'implements Taylor series arithmetic'.
I am not sure how explict we should be in the description, but
Taylor series _domains_ are declared to be a Ring, and "arithmetic"
operations defined in StreamTaylorSeriesOperations should satisfy
Ring properties. So, any deviations from definition in Ring either
are bugs or rewording wiht the same meaning or maybe a specialization
(ring of power series have some special properties compared to
deneral rings). From my point of view clearest docsting would say
"see corresponding operation in Ring".
To put this differently, at programming language level programmers
can implement quite a different property for operations with the same
name. But in many cases including StreamTaylorSeriesOperations
users should regard operations as "the same" as operations defined
in relevant category, that is Ring in this case.
> Should we introduce also a function "\" into StreamTaylorSeriesOperations?
If you wish. For me it is important to avoid breaking things
that used to work, so '/' is important. To say the truth, 'exquo'
is more important as is has uses in other places and is not the
the same as multiplication by reciprocal (which in case of 'exquo'
may be non-existent). Also, if you want tha add new operation
than something like 'leftExquo' probably would fit.
--
Waldek Hebisch