On Sat, Oct 28, 2023 at 10:47:54PM +0200, Ralf Hemmecke wrote:
> On 10/28/23 03:33, Waldek Hebisch wrote:
> > I think that in OutputForm "->" should be a binary operator.
>
> Agreed.
>
> And the meaning should be "mapping between types/sets", not mapping of
> values.
Yes.
> > Change to i-output.boot looks easy. Also, it is easy to modify
> > 'tex.spad' to handle this. There is question what various formats
> > should output for "TAG" and "->".
>
> First of all, I think TAG is a rather strange name. I think, we can
> agree that TAG stands for "mapping of values", i.e. what is usually
> denoted via \mapsto in LaTeX. Can we?
Well, is the following "mapping of values"?
(1) -> iO := IDPO(Integer, Symbol)
(1) IndexedDirectProductObject(Integer,Symbol)
Type: Type
(2) -> monomial(1, x)$iO
(2) [x -> 1]
Type: IndexedDirectProductObject(Integer,Symbol)
(3) -> monomial(1, x)$iO + monomial(2, y)$iO
(3) [y -> 2, x -> 1]
Type: IndexedDirectProductObject(Integer,Symbol)
> > Currently in my test version 'tex.spad' outputs '\rightarrow' and '\to'
> > respectively, which seem to be reasonable.
>
> This is where I do not agree. Why is this reasonable, when TAG actually
> denotes the mapping of values? When I denote a function, then I write
>
> \begin{gather}
> f : Z \to Z,\qquad x \mapsto x^2
> \end{gather}
See above: we give map for each value separately, not a formula
for a function. Also "reasonable" does not mean very good,
but '\rightarrow' is different symbol than both '\to' and '\mapsto'.
There is trouble that '\rightarrow' looks identical to '\to',
I thought that they look different. So '\rightarrow' probably
should be replaced by differently looking arrow.
Using '\rightarrow' (or rather some different arrow) is reasonable in
sense of preserving distinction. You somewhat argue that TAG and
'+->' are the same thing, and I think that they are not the same.
> The current usage of rarrow in MoebiusTransform(F) is clearly in the
> meaning of denoting the mapping of values.
>
> I.e. moebius: F^4 -> (F -> F),
> (a,b,c,d) +-> (x +-> (a*x+b)/(c*x+d))
For moebius "+->" could be reasonable, but I have some doubts
about "clearly": arguably we give value of mapping at single
(generic) point.
> If FriCAS would print it like this, it would agree with the usual
> mathematical notation..
>
> > fmtlatex.spad outputs '\to' for "TAG", which to me looks wrong, as
> > '\to' seem to be used for domain/codomain of mapping, that is types
> > and not for values.
>
> Right, \to for TAG is wrong.
>
> But put the attached files into your fricas checkout (with your patches) and
> run "bash outputtest.sh". You will get the attached outputtest.pdf.
>
> Look at the second output for moebius. The OutputForm contains TAG and not
> only fmtlatex translates this to \to, but all other formatters produce the
> equivalent of "->" or \rightarrow (in TexFormat). So it is not a problem of
> fmtlatex alone.
> That is why I am wishing for a new function (besides rarrow) in OutputForm.
> It would be a little confusing to use rarrow for \mapsto, since rarrow seems
> to suggest \rightarrow, but was probably meant (just my guess) to denote the
> mapping of values.
>
> I want to change the output for moebius to +->, because it actually denotes
> the value mapping. Currently, it defeats the intention of Format1D, namely
> that one can cut&paste the output in Format1D form as input into FriCAS.
> Yes, Format1D is not perfect, but close.
>
> The OutputForm operators TAG and +->, as well as rarrow are not used in many
> places, so I think we can make incompatible changes.
>
> My suggestion for OutputForm:
>
> Introduce functions
> mapsto(a, b)== convert [eform("+->"::Symbol, a, b]
> rarrow(a, b)== convert [eform( "->"::Symbol, a, b]
>
> How the internal OutputForm operators are called, I actually do not care
> much about, the could also be 'MAPSTO and 'RARROW.
>
> What I care about is a distinction between the type mapping and the value
> mapping, i.e., I want to see Integer -> Integer and x+->x^2.
>
> What's your wish?
I would like to have 3 different OutputForm-s. AFAICS currently
two of them, that is "->" and "+->" are produced only by
interpreter code. The third one is used by algebra.
If we use of TeX arrows for third form, than 'rarrow' is reasonable
name.
--
Waldek Hebisch