Well, I'm having some pr=
oblems in understanding the way "IndexedExponents" work.

I'm trying to use the RESRING domain, to create and ma=
nipulate Residue Rings.

I managed to properly create one object from ResidueRin=
g by doing:

R :=3D FRAC(INT) =A0 -- defining the f=
ield

ls : List Symbol :=3D [x]

V :=3D OV=
AR(ls)

-- V is the OrderedSet of ls, as the variables on the

-- pol=
ynomial ring I will create

E :=3D IndexedExponents=
(V)

-- Well, I don't know how this works, but I need an

-- OrderedAbelianMonoidSup to create a

-- Residue Ring, this=
step is the one I'm trying to get

-- help to understand

) id 1Q8SWQ-00044X-7j
for axiom-mail@nongnu.org; Sat, 09 Apr 2011 03:23:55 -0400
Received: from mo-p00-ob.rzone.de ([81.169.146.162]:50414)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1Q8SWP-00044D-Po
for axiom-mail@nongnu.org; Sat, 09 Apr 2011 03:23:54 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1302333831; l=2624;
s=domk; d=hemmecke.de;
h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:
Subject:To:MIME-Version:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH;
bh=aDl9K2P5zs8Njo4OfTgonNO68sg=;
b=WdFUtcvarDzeV3CCSrgx4PqvJ/KA7X5REiED0pzkCd/wsHHOIvOqB1erYIOvq71s4F7
TOkFZOH9nkDGfqp45b+UsG3BDNgci3D48hBrytt727zIcERnW7NJ7uBUtS3xWBmA9/mL7
A5dN5I6PQO0tmsAYNtNvIkhaSz7wBnMVBaU=
X-RZG-AUTH: :Pm0Ic2CgfvKqpyys4bXn/kzLaHTdYnTFXEqQA90LpSWk1ofrjzFjGky6mg==
X-RZG-CLASS-ID: mo00
Received: from [10.0.0.27] (62-47-52-55.adsl.highway.telekom.at [62.47.52.55])
by post.strato.de (fruni mo19) (RZmta 25.10)
with (DHE-RSA-AES128-SHA encrypted) ESMTPA id C03ef0n396MQhy ;
Sat, 9 Apr 2011 09:23:19 +0200 (MEST)
Message-ID: <4DA00966.7080402@hemmecke.de>
Date: Sat, 09 Apr 2011 09:23:18 +0200
From: Ralf Hemmecke
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version: 1.0
To: axiom-mail@nongnu.org
Subject: Re: [Axiom-mail] Doubt about IndexedExponents
References:
In-Reply-To:
X-Sent-by-Hemmecke: ralf@hemmecke.de
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 81.169.146.162
X-BeenThere: axiom-mail@nongnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: axiom-mail.nongnu.org
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sat, 09 Apr 2011 07:24:01 -0000
> E :=3D IndexedExponents(V)
> -- Well, I don't know how this works, but I need an
> -- OrderedAbelianMonoidSup to create a
> -- Residue Ring, this step is the one I'm trying to get
> -- help to understand
>
> P :=3D NSMP(R,V)
> -- Defining the polynomial ring, of only one variable
>
> L :=3D [x**2 - 1]
> -- Defining the Ideal which I'm going to use to
> -- get my Residue Ring
>
> S :=3D ResidueRing(R, E, V, P, L)
>
> Then I can properly use S to calculate what I want in that Residue Ring=
, but
> I certainly wish to know more about the IndexedExponents, like what it =
does
> and why it is needed.
In fact, I find the construction of polynomials not really optimal. Look =
at polynomials, one actually doesn't need variables. A polynomial is a=20
special instance of a monoid ring where in your case the coefficient=20
ring is R and the monoid is E. Now, if you look deeper in the code then=20
you find that internally, NSMP(R,V) constructs such a monoid ring by=20
constructing the monoid via IndexedExponents(V).
In such a monoid ring you would not be able to do reduction, because=20
there is need for an order on the power products. So one has to require=20
not just monoid, but OrderedMonoid (the "Abelian" in the name just means =
that you basically deal with an additively written monoid).
Furthermore, you need this ...Sup, because you have to be able to divide =
power products in order to reduce polynomials.
Simply taking variables doesn't give you anything. In Fricas you must=20
declare with which structures you actually work.
As you see with NSMP(R,V), FriCAS has some domains that cover the=20
standard case. But internally, the Gr=F6bner basis machinery is used and =
(as you might know), there is an additional parameter, namely the order=20
of terms, that influences the speed in which the result is computed. The =
specific order is not important mathematically, any will do, but most=20
people will claim that a degree reverse lexicographical order is better=20
suited for Gr=F6bner basis computations than a pure lexicographical one.
I hope that this gives you a hint of what is behind the need for=20
IndexedExponents.
Oh yes, I've forgotten something. It's also a way to represent the power =
products. Maybe you know you use case better and rather want a more=20
efficient implementation of power products. In FriCAS you can do this.=20
Just invent (program) the respective domain of power products. It is not =
really necessary to use IndexedExponents, if you have more inside in how =
everything works.
Ralf
From MAILER-DAEMON Mon Apr 11 22:29:07 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1Q9TLn-0005Rx-Tr
for mharc-axiom-mail@gnu.org; Mon, 11 Apr 2011 22:29:07 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53602)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1Q9TLj-0005Pe-SN
for axiom-mail@nongnu.org; Mon, 11 Apr 2011 22:29:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1Q9TLh-0006x0-Dh
for axiom-mail@nongnu.org; Mon, 11 Apr 2011 22:29:03 -0400
Received: from mail-fx0-f45.google.com ([209.85.161.45]:59857)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1Q9TLh-0006w9-1L
for axiom-mail@nongnu.org; Mon, 11 Apr 2011 22:29:01 -0400
Received: by fxm2 with SMTP id 2so4877026fxm.4
for ; Mon, 11 Apr 2011 19:28:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type;
bh=ngH/zh8ve0ujgzgYipacqLzO7qSqNG+p55WC+7ojAJE=;
b=bPg6036aPeXlFN7YPVDxsz1UX7HLfK8CBcu/FjWnpPJzvcgg7U/5jFniS0g2AJjkua
nwBOiup0lLD7aYdoS7sOhBul0gXoWEVG7sDRO7WlKVIDl+HbVGk4QzxbfCCWSnFK2sgr
2sz6GCsHam9A9IMa2HL+2VHRD7/obtsqz0CNs=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:content-type;
b=whRqeQUgFifzQXfh5IlsRh70D0A4ldyE2tMziQLhNoA2Qo0AqGcRwOYx3URedlzJbu
Alxmj4HTNHo8pHpUn9wQPq7Da8oHLZc0aBhXeNT5xv2957JUt8XAMHuYjpv+a7njA6fd
jz6WHDX6rurcCtK96AuD2bUSsCRKvQr3zziYM=
Received: by 10.223.33.80 with SMTP id g16mr4958153fad.125.1302575339748; Mon,
11 Apr 2011 19:28:59 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.59.20 with HTTP; Mon, 11 Apr 2011 19:14:20 -0700 (PDT)
In-Reply-To: <4DA38AC7.7060301@hemmecke.de>
References:
<4DA00966.7080402@hemmecke.de>
<4DA38AC7.7060301@hemmecke.de>
From: Gabriel Pires
Date: Mon, 11 Apr 2011 23:14:20 -0300
Message-ID:
To: axiom-mail@nongnu.org
Content-Type: multipart/alternative; boundary=00151747864c6b3c9d04a0af74fc
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.45
Subject: Re: [Axiom-mail] Doubt about IndexedExponents
X-BeenThere: axiom-mail@nongnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 12 Apr 2011 02:29:05 -0000
--00151747864c6b3c9d04a0af74fc
Content-Type: text/plain; charset=ISO-8859-1
Thank you again!
Yeah, I didn't mean to send a private mail, my intention was to send a reply
to the list, but I must have clicked somewhere stupid on my gmail.
That sure helped me a lot, now I suppose I understand how IndexedElements
work and can use it with my mind at ease!
Thanks,
Gabriel,
On Mon, Apr 11, 2011 at 8:12 PM, Ralf Hemmecke wrote:
> Are you sure you wanted to send a private email? I very much prefer if the
> discussion stays public.
>
> So, I used Axiom
>>
>
> As you have certainly realized, I'm a user/developer of FriCAS, a fork of
> Axiom. But all I'm saying probably also applies to Axiom. But if I point you
> to code, I'll point you to FriCAS code, simply, because I am more familiar
> with it than with the Axiom code base.
>
>
> to try to manipulate some objects in an
>> AbelianOrderedMonoidSup, but I can't seem to find a way. Let me show you
>> my
>> steps (they don't differ from OP, but anyways):
>>
>
> ls : List Symbol := [x]
>> V := OVAR(ls)
>> E := IndexedExponents(V)
>>
>
> Let's first look into the code.
>
> The implementation of IndexedExponents inherits most of its implementation
> from IndexedDirectProductOrderedAbelianMonoidSup.
>
>
> https://github.com/hemmecke/fricas-svn/blob/master/src/algebra/multpoly.spad.pamphlet#L820
>
> This inherits from IndexedDirectProductOrderedAbelianMonoid.
>
>
> https://github.com/hemmecke/fricas-svn/blob/master/src/algebra/indexedp.spad.pamphlet#L296
>
> etc. I hope you know how to use grep. It's a bit tedious, but you can learn
> a lot from the code.
>
> OK, you probably want a simpler method. Take hyperdoc browse and enter
> IndexedExponents. Click on Constructors. Then click Operations ->
> Signatures.
> Or simply type
>
> )show E
>
> after you have defined E like above.
>
> Now, as I said in my last mail about "Abelian", the Monoid E is additively
> written. In hyperdoc you see +:(%,%)->%, but no *:(%,%)->%.
>
> And sample:()->% is a function that returns an element of E. It is nowhere
> said that it returns a random element. So if it returns 1
>
> Showing 1 is a bit misleading, since it rather behaves like zero.
>
> (5) -> e:E :=sample()$E
>
> (5) 1
> Type: IndexedExponents(OrderedVariableList([x]))
> (6) -> e+e
>
> (6) 1
> Type: IndexedExponents(OrderedVariableList([x]))
>
>
> Ok, now, what I expect to see from what I learned is that E is a monoid of
>> powers of x, possibly with 1 being the "highest" term of the monoid.
>>
>
> I'd bet that 1 is rather the "lowest" term. That depends on how you read
> a
>
> And I can't use 'x' to make an object, or multiply by x, or multiply 1 by
>> a
>> constant... can't seem to use or know what are the objects in the
>> monoid...
>>
>
> If you just say
>
> x*e
>
> that will of course not work. Why? Because, the x you give here is of type
> Symbol. Do you find a function *: (Symbol, %) -> % in the list from ")show
> E"? No. So x*e can only return an error.
>
> How to construct the right x? Well, the x you are looking for is not the
> symbol x, but rather the monomial x^1 from E. And there is a function
>
> monomial : (NonNegativeInteger,OrderedVariableList([x])) -> %
>
> The first argument is the power and the second is an element of V.
> How to get an element of V? V has only 1 element, so lets
>
> )show V
> OrderedVariableList([x]) is a domain constructor.
> Abbreviation for OrderedVariableList is OVAR
> This constructor is not exposed in this frame.
> ------------------------------- Operations --------------------------------
>
> ? Boolean ?<=? : (%,%) -> Boolean
> ?=? : (%,%) -> Boolean ?>? : (%,%) -> Boolean
> ?>=? : (%,%) -> Boolean coerce : % -> OutputForm
> convert : % -> InputForm convert : % -> Pattern(Float)
> convert : % -> Pattern(Integer) convert : % -> Symbol
> enumerate : () -> List(%) hash : % -> SingleInteger
> index : PositiveInteger -> % latex : % -> String
> lookup : % -> PositiveInteger max : (%,%) -> %
> min : (%,%) -> % random : () -> %
> size : () -> NonNegativeInteger smaller? : (%,%) -> Boolean
> ?~=? : (%,%) -> Boolean
> variable : Symbol -> Union(%,"failed")
>
> I'm sure you try
>
> (7) -> v:V :=index 1
>
> (7) x
> Type: OrderedVariableList([x])
>
> first. Voila, there is your x, now stored in the variable v. Oh, but it's
> of type V, not E!!!
> OK, we use
>
> (10) -> z: E := monomial(1,v)
>
> (10) x
> Type: IndexedExponents(OrderedVariableList([x]))
>
> and have the x we were looking for (stored in the variable z).
> And now we can do monoid operations with this x.
>
> (12) -> z+z
>
> 2
> (12) x
> Type: IndexedExponents(OrderedVariableList([x]))
>
> (14) -> 3*z
>
> 3
> (14) x
> Type: IndexedExponents(OrderedVariableList([x]))
>
> I know this additive structure written in a multiplicative form is a bit
> confusing, but that's the way it is currently. Some long time ago, wrote my
> own polynomial domain with the corresponding monoid written
> multiplicatively. But here you have to live with it until somebody comes and
> changes it to something better.
>
> Does that help you?
>
> Ralf
>
> PS: If you like to reply, please do it on the mailing list. Other people
> might benefit from it. You have my permission to use the text from above.
>
> PPS: You should also try to use a sandbox on the axiomwiki
> http://axiom-wiki.newsynthesis.org/FrontPage
> Just replace "FrontPage" with "SandboxYourFancyTitle" in order to create a
> new page.
>
>
--00151747864c6b3c9d04a0af74fc
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Thank you again!

P :=3D NSMP(R,V)

-- Defining the polynomial =
ring, of only one variable

L :=3D [x**2 - 1]

-- Defining the Ideal which=
I'm going to use to

-- get my Residue Ring

S :=3D ResidueRing(R, E, V, P, L)

Then I c=
an properly use S to calculate what I want in that Residue Ring, but I cert=
ainly wish to know more about the IndexedExponents, like what it does and w=
hy it is needed.

Thanks in advance!

--001517447c724b023204a06fbe4a--
From MAILER-DAEMON Sat Apr 09 03:24:02 2011
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
id 1Q8SWY-0007mC-AG
for mharc-axiom-mail@gnu.org; Sat, 09 Apr 2011 03:24:02 -0400
Received: from [140.186.70.92] (port=51679 helo=eggs.gnu.org)
by lists.gnu.org with esmtp (Exim 4.43) id 1Q8SWR-0007ie-Oe
for axiom-mail@nongnu.org; Sat, 09 Apr 2011 03:24:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from Yeah, I didn't mean to send a priva=
te mail, my intention was to send a reply to the list, but I must have clic=
ked somewhere stupid on my gmail.

That sure helped=
me a lot, now I suppose I understand how IndexedElements work and can use =
it with my mind at ease!

Thanks,

Gabriel,

--00151747864c6b3c9d04a0af74fc--
On Mon, Apr 11, 2011 at 8:12 PM, Ralf Hemmecke <ralf@hemmecke.de>=
wrote:

Are you sure you wanted to send a private e= mail? I very much prefer if the discussion stays public.

So, I used Axiom

As you have certainly realized, I'm a user/developer of FriCAS, a fork = of Axiom. But all I'm saying probably also applies to Axiom. But if I p= oint you to code, I'll point you to FriCAS code, simply, because I am m= ore familiar with it than with the Axiom code base.Let's first look into the code.

to try to manipulate some objects in an

AbelianOrderedMonoidSup, but I can't seem to find a way. Let me show yo= u my

steps (they don't differ from OP, but anyways):

ls : List Symbol :=3D [x]

V :=3D OVAR(ls)

E :=3D IndexedExponents(V)

The implementation of IndexedExponents inherits most of its implementation = from IndexedDirectProductOrderedAbelianMonoidSup.

https://github.com/hemmecke/f= ricas-svn/blob/master/src/algebra/multpoly.spad.pamphlet#L820

This inherits from IndexedDirectProductOrderedAbelianMonoid.

https://github.com/hemmecke/f= ricas-svn/blob/master/src/algebra/indexedp.spad.pamphlet#L296

etc. I hope you know how to use grep. It's a bit tedious, but you can l= earn a lot from the code.

OK, you probably want a simpler method. Take hyperdoc browse and enter Inde= xedExponents. Click on Constructors. Then click Operations -> Signatures= .

Or simply type

=A0)show E

after you have defined E like above.

Now, as I said in my last mail about "Abelian", the Monoid E is a= dditively written. In hyperdoc you see +:(%,%)->%, but no *:(%,%)->%.=

And sample:()->% is a function that returns an element of E. It is nowhe= re said that it returns a random element. So if it returns 1

Showing 1 is a bit misleading, since it rather behaves like zero.

(5) -> e:E :=3Dsample()$E

=A0 (5) =A01

=A0 =A0 =A0 =A0Type: IndexedExponents(OrderedVariableList([x]))

(6) -> e+e

=A0 (6) =A01

=A0 =A0 =A0 =A0Type: IndexedExponents(OrderedVariableList([x]))I'd bet that 1 is rather the "lowest" term. That depends on h= ow you read a<b.

Ok, now, what I expect to see from what I learned is that E is a monoid of<= br> powers of x, possibly with 1 being the "highest" term of the mono= id.

If you just say

And I can't use 'x' to make an object, or multiply by x, or mul= tiply 1 by a

constant... can't seem to use or know what are the objects in the monoi= d...

=A0x*e

that will of course not work. Why? Because, the x you give here is of type = Symbol. Do you find a function *: (Symbol, %) -> % in the list from &quo= t;)show E"? No. So x*e can only return an error.

How to construct the right x? Well, the x you are looking for is not the sy= mbol x, but rather the monomial x^1 from E. And there is a function

=A0monomial : (NonNegativeInteger,OrderedVariableList([x])) -> %

The first argument is the power and the second is an element of V.

How to get an element of V? V has only 1 element, so lets

)show V

=A0OrderedVariableList([x]) is a domain constructor.

=A0Abbreviation for OrderedVariableList is OVAR

=A0This constructor is not exposed in this frame.

------------------------------- Operations --------------------------------=

=A0?<? : (%,%) -> Boolean =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0?<=3D? : = (%,%) -> Boolean

=A0?=3D? : (%,%) -> Boolean =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0?>? : (%,%= ) -> Boolean

=A0?>=3D? : (%,%) -> Boolean =A0 =A0 =A0 =A0 =A0 =A0 =A0 coerce : % -= > OutputForm

=A0convert : % -> InputForm =A0 =A0 =A0 =A0 =A0 =A0 =A0convert : % ->= Pattern(Float)

=A0convert : % -> Pattern(Integer) =A0 =A0 =A0 convert : % -> Symbol<= br> =A0enumerate : () -> List(%) =A0 =A0 =A0 =A0 =A0 =A0 hash : % -> Sing= leInteger

=A0index : PositiveInteger -> % =A0 =A0 =A0 =A0 =A0latex : % -> Strin= g

=A0lookup : % -> PositiveInteger =A0 =A0 =A0 =A0 max : (%,%) -> %

=A0min : (%,%) -> % =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0random : = () -> %

=A0size : () -> NonNegativeInteger =A0 =A0 =A0 smaller? : (%,%) -> Bo= olean

=A0?~=3D? : (%,%) -> Boolean

=A0variable : Symbol -> Union(%,"failed")

I'm sure you try

(7) -> v:V :=3Dindex 1

=A0 (7) =A0x

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Type: OrderedVariableList(= [x])

first. Voila, there is your x, now stored in the variable v. Oh, but it'= ;s of type V, not E!!!

OK, we use

(10) -> z: E :=3D monomial(1,v)

=A0 (10) =A0x

=A0 =A0 =A0 =A0 =A0 =A0Type: IndexedExponents(OrderedVariableList([x]))

and have the x we were looking for (stored in the variable z).

And now we can do monoid operations with this x.

(12) -> z+z

=A0 =A0 =A0 =A0 =A02

=A0 (12) =A0x

=A0 =A0 =A0 =A0 =A0 Type: IndexedExponents(OrderedVariableList([x]))

(14) -> 3*z

=A0 =A0 =A0 =A0 =A03

=A0 (14) =A0x

=A0 =A0 =A0 =A0 =A0 =A0Type: IndexedExponents(OrderedVariableList([x]))

I know this additive structure written in a multiplicative form is a bit co= nfusing, but that's the way it is currently. Some long time ago, wrote = my own polynomial domain with the corresponding monoid written multiplicati= vely. But here you have to live with it until somebody comes and changes it= to something better.

Does that help you?

Ralf

PS: If you like to reply, please do it on the mailing list. Other people mi= ght benefit from it. You have my permission to use the text from above.

PPS: You should also try to use a sandbox on the axiomwiki

= http://axiom-wiki.newsynthesis.org/FrontPage

Just replace "FrontPage" with "SandboxYourFancyTitle" i= n order to create a new page.