[om] Algebraic Numbers
Andreas Strotmann
Strotmann at rrz.uni-koeln.de
Fri Nov 28 19:21:10 CET 2003
Clare,
you may want to take a brief look at the old OpenMath Objectives paper
for a reason why these algebraic numbers probably need to be used via
bound variables (you sometimes have to make sure that you get the *same*
root in all cases in an expression).
Clare So wrote:
>Dear OpenMathers,
>
>The MONET group at ORCCA is trying to figure out the appropriate
>OpenMath representation for algebraic numbers. We propose two
>approaches. Let's say we would like to encode $ {\alpha}{x^2} +
>(\alpha - 1)x + (1 + \alpha )y $ in OpenMath where \alpha is
>the algebraic expression representing RootOf(z^2+z+1):
>
>* First Approach *
>
><OMA>
> <OMS cd="algext1" name="algebraicnumber"/>
> <OMBIND>
> <OMS cd="fns1" name="lambda"/>
> <OMBVAR>
> <OMV name="alpha"/>
> </OMBVAR>
> <OMA>
> [$ {\alpha ^ 2} + \alpha + 1 $ in OpenMath]
> </OMA>
> <OMA>
> [$ {\alpha}{x^2} + (\alpha - 1)x + (1 + \alpha )y $ in OpenMath]
> </OMA>
> </OMBIND>
></OMA>
>
>
>
This is technically not allowed (OMBIND only takes a single body
expression), but I think it's on the right track. What you may need is
something like this (using a much abbreviated syntax):
(1) apply(binding(lambda,alpha, [alpha*x^2+alpha+1]),
apply(algebraicnumber, binding(lambda,alpha,alpha^2+1))
Since algebraic numbers could in principle be defined as closed-form
expressions involving nth-roots and complex integers, you may need to
change this slightly to:
(2) apply(binding(lambda,alpha, [alpha*x^2+alpha+1]),
apply(algebraicnumber,
apply(anyroot,binding(lambda,alpha,[alpha^2+1]),C))
(i.e. first construct a root over the complex numbers and then "cast" it
to algebraic number).
Notice that this doesn't say what name the algebraic number is going to
have, which is consistent with the way that indefinite integration is
specified in OpenMath.
An exact mirror of the integration symbol would allow you to say
(3) ( < apply(algebraicnumber, binding(lambda,alpha,alpha^2+1) >
)*x^2+alpha+1),
since the variable alpha would be implicitly exported, and thus alpha
well-defined (although free) outside the lambda. However, that may be
asking a bit much, and one could consider re-writing the example again as
(4) (apply(apply(algebraicnumber,
binding(lambda,alpha,alpha^2+1)),alpha)*x^2+alpha+1),
with a signature of algebraicnmuber: unary-function -> unary-function,
where the resulting unary function might be defined to be defined only
if the argument is the algebraic number it represents (thus forcing the
correct interpretation for the argument variable).
In all, though, I think the cleanest approach given the limited ability
of Openmath to express co-references would be to ask that an OpenMath
version of the statement "let alpha be the algebraic number defined by
.." be wrapped around an expression that uses algebraic numbers, as in
the first two examples (1) or (2) or via some equation.
This is essentially your approach below, except for noting that one can
bind the algebraic number to a variable in order to avoid having to
repeat the algebraic number's definition all the time, and except for
making explicit the need to use a functional argument for
"algebraicnumber" below to make explicit the variable with respect to
which the root is taken.
-- Andreas
>For this approach, alpha is defined in the second argument of of
><OMS cd="fns1" name="lambda"/> and is used in the expression in the
>third argument.
>
>
>* Second Approach *
>
><OMA>
> <OMS cd ="arith1" name="plus"/>
> <OMA>
> <OMS cd="arith1" name="times"/>
> <OMA>
> <OMS cd="algext1" name="algebraicnumber"/>
> [$ {\alpha ^ 2} + \alpha + 1 $ in OpenMath]
> </OMA>
> <OMA>
> <OMS cd="arith1" name="power"/>
> <OMV name="x"/>
> <OMI> 2 </OMI>
> </OMA>
> </OMA>
> <OMA>
> <OMS cd="arith1" name="times"/>
> <OMA>
> <OMS cd="arith1" name="minus"/>
> <OMA>
> <OMS cd="algext1" name="algebraicnumber"/>
> [$ {\alpha ^ 2} + \alpha + 1 $ in OpenMath]
> </OMA>
> <OMI> 1 </OMI>
> </OMA>
> <OMV name="x"/>
> </OMA>
> <OMA>
> <OMS cd="arith1" name="times"/>
> <OMA>
> <OMS cd="arith1" name="plus"/>
> <OMA>
> <OMS cd="algext1" name="algebraicnumber"/>
> [$ {\alpha ^ 2} + \alpha + 1 $ in OpenMath]
> </OMA>
> <OMI> 1 </OMI>
> </OMA>
> <OMV name="y"/>
> </OMA>
></OMA>
>
>The algebraic number is defined every time we need it.
>
>
>First approach is a compact way to express algebraic number because
>alpha is defined once for the entire expression. Second approach is
>a straight-forward way because alpha is defined exactly the place we
>need it.
>
>Please let us know which approach you think should be used for this
>purpose.
>
>
>Clare & MONET group at UWO
>--
>om at openmath.org - general discussion on OpenMath
>Post public announcements to om-announce at openmath.org
>Automatic list maintenance software at majordomo at openmath.org
>Mail om-owner at openmath.org for assistance with any problems
>
>
--
om at openmath.org - general discussion on OpenMath
Post public announcements to om-announce at openmath.org
Automatic list maintenance software at majordomo at openmath.org
Mail om-owner at openmath.org for assistance with any problems
More information about the Om
mailing list