axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Re: "Factoring" Expression Integer/ simplifying powers


From: Francois Maltey
Subject: [Axiom-developer] Re: "Factoring" Expression Integer/ simplifying powers (an example)
Date: 05 Mar 2006 14:12:24 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

So I try to translate into axiom the work that my students make with mupad
or maple.

So I compare what maple, mupad and axiom can do. 

The questions and my solution with axiom are bellow.

My students must be do the exercice << with pencil and paper >>, 
                       and with a computer algebra system.

I can't translate theses french questions, my english is too poor.

The main differences are :

1/ with mupad I can define an operator *%* (with any priority), 
   so I type x *%* y and not etoile (x, y), it's nicer to read

2/ mupad and maple have expression as tree, 
   we must rewrite etoile (x, etoile (x, y)) when we want to test the 
   associative law, with expand or normal.
   axiom do this without any rewrite because the result is Polynomial.

3/ There is no problem for commutative : 
   mupad and maple rewrite sum in a internal order x*y=y*x, x+y=y+x

4/ axiom solve is nice to use : we get a list [ident = value]
   the maple solve is less nice to use, 
   sometime there is the name of the variable, sometimes not
   the result is a empty sequence, 
   so there is nothing to read when the set is empty
   the mupad solver is finest : 
   solve (x*y=0,x) gives  (y=0 => x \in C) AND (y<>0 => x=0)
   a little problem with axiom : 
   solve (x*y=0, [x,y]) doesn't work, I must type solve ([x*y=0],[x,y])

5/ With axiom I can't compute x^(n) for the indeterminate n
With other CAS I can transform :
(1+x)^n*(1+x) + x + 1 into (1+x)^n*(1+x) 

a/ Either with a solve (rec (u(n+1)=u(n)*(1+x)+x+1, u(0)=1, u(n)))
b/ or factor ((1+x)^n*(1+x) + x + 1) computes (1+x)^n*(1+x)

a/ It seems that solve (rec ...)) doesn't exist in axiom.

b/ Axiom is very adaptive for Polynomial :

   I can use Polynomial Integer, Fraction Polynomial Integer, 
   Polynomial Integer, Factored Polynomial Integer, etc.

   Other CAS have functions as collect, 
   With axiom, I also can do this with coerce : 

   (x+y+1)^2 ::DMP([x,y],Integer), (x+y+1)^2 ::DMP([y,x],Integer)

// Is it an axiom bug in axiom ?
  I don't understand why (x+y+1)^2 ::DMP([x],Integer) gives me an 
  Expression Integer, not an error.  //

But when I use Expression I only have ONE type : Expression Integer.
On this example the (1+x)^n term force me to use Expression Integer.

So I lose (almost) all the power of axiom.

I hope you find some interest to this mail !
Have a good day.

Francois Maltey

First are the questions in pseudo-latex.
My solution with axiom comes after, is there mistakes ?


--------------------------------------------------------------------
\section{étude d'une loi de composition interne}

Dans l'énoncé $E$ un ensemble muni d'une loi de composition interne~$\star$, 
et $\lambda$, $\mu$, $a$, $b$, $c$ et $d$ sont des nombres réels.
L'élément $u \in E$ est absorbant pour la loi $\star$ si et seulement si
$u$ vérifie cette proposition :

$$\forall x \in E \qquad u \star x = x \star u = u $$

Dans cette partie $x \in \R$, $(n, p) \in \Z^2$ et la loi 
$\star$ est définie sur $\R$ ainsi : 

$$ \forall (x, y) \in \R^2 \qquad x \star y = x + y - xy $$

Justifier que toute structure $(E, \star)$ possède au maximum un élément 
absorbant.

Montrer par la contraposée que tout groupe ayant au moins deux éléments ne 
possède aucun élément absorbant.

Étudier les éléments absorbants de $\R$ pour la loi $\star$ ;
en déduire que $(\R, \star)$ n'est pas un groupe.

Prouver que $(\R \setminus \set 1, \star)$ est un groupe
commutatif ; calculer l'élément neutre de $\star$ sur $\R \setminus \set 1$
et le symétrique d'un élément de $\star$ sur $\R \setminus \set 1$.

Les puissances itérées $x^{(n)}$ pour la loi $\star$ sont définies ainsi :
$$
x^{(n)} = 
\begin{cases}
\underbrace{x \star x \star x \star \cdots \star x}_{n \text{ fois}} 
  & \text {pour $n > 0$} \\
0 & \text {pour $n=0$} \\
(x^{(-1)})^{(-n)}=(x^{(-n)})^{(-1)} & \text{pour $n < 0$}
\end{cases}
$$

Elles vérifient 
$x^{(n)}\star x^{(p)} = x^{(n+p)}$ et $(x^{(n)})^{(p)} = x^{(np)}$.

Dans le cas où $n > 0$ calculer par récurrence $x^{(n)}$
à l'aide des opérations classiques d'additions, de multiplications, 
et de puissances sur $\R$.

Déterminer une formule similaire pour $x^{(n)}$ lorsque $n<0$.

Calculer un couple $(\lambda,\mu)$ pour que l'application~$f$
soit un isomorphisme du groupe
$(\R \setminus \set 1, \star)$ dans le groupe $(\R^*, \times)$ :

f : \R \setminus \set 1 \to \R^* \qquad f(x)=\lambda x + \mu 

------------------------------------------------------------------------
-- définitions et réinitialisations
)clear properties a b x y z etoile eltAbs eltNeutre sym 
etoile := (x,y) +-> x+y-x*y 

-- recherche de l'élément absorbant, et vérification
tmpres := solve (etoile(x,a)=a, a)
eltAbs := rhs (first tmpres)
etoile (x, eltAbs) = eltAbs
(etoile (x, eltAbs) = eltAbs)::Boolean

-- vérification que la loi etoile est de composition interne
solve (etoile (x,y)=1, [x,y])

-- recherche de l'élément neutre
tmpres := solve (etoile(x,e)=x, e)
eltNeutre := rhs (first tmpres)
etoile (x, eltNeutre) = x
(etoile (x, eltNeutre) = x)::Boolean

-- vérification de la commutativité
etoile (x, y)
etoile (y, x)
etoile(x,y) - etoile(y,x)
etoile(x,y) = etoile(y,x)
(etoile(x,y) = etoile(y,x))::Boolean

-- vérification de l'associativité 
etoile (etoile (x, y), z)
etoile (x, etoile (y, z))
etoile (etoile (x, y), z) = etoile (x, etoile (y, z))
etoile (etoile (x, y), z) - etoile (x, etoile (y, z))
(etoile (etoile (x, y), z) = etoile (x, etoile (y, z)))::Boolean

-- recherche du symétrique
tmpres := solve (etoile (x, y) = eltNeutre, y)
exprSym := rhs (first tmpres)
function (exprSym, 'sym, 'x) 
sym 
etoile (x, sym x) 
(etoile (x, sym x) = eltNeutre)::Boolean
(etoile (sym x, sym y) = sym etoile (x, y))::Boolean

-- puissances itérées dans le cas n>0
tmpres := [generate (y +-> etoile (y,x), 0::Polynomial Integer)]
[rmpres.k for k in 1..7]
[tmpres.k-1 for k in 1..7]
[factor (tmpres.k-1) for k in 1..7]

-- puissances itérées dans le cas n<0
tmpres2 := [generate (y +-> etoile (y,sym x), 0::Fraction Polynomial Integer)]
[tmpres2.k for k in 1..7]
[tmpres2.k-1 for k in 1..7]
[(tmpres2.k-1)::Fraction Factored Polynomial Integer for k in 1..7]

-- recherche du morphisme non constant
fct := x +-> a*x+b 
tmpres := solve ([fct (etoile (2, 3)) = fct 2 * fct 3,
        fct (etoile (2, 4)) = fct 2 * fct 4], [a,b])
tmpres := select (L +-> not (rhs (L.1) = 0), tmpres) 
function (subst (fct x, tmpres.1), fct2, x)
(fct2 x * fct2 y = fct2 (etoile (x,y)))::Boolean





reply via email to

[Prev in Thread] Current Thread [Next in Thread]