JSFHwith(LinearAlgebra):estNilpotent := proc(A)
local n,i,M;
if ColumnDimension(A)=RowDimension(A) then
n:=ColumnDimension(A);
M:=A;
for i from 1 to n-1
while not Equal(M,ZeroMatrix(n))
do
M:=MatrixMatrixMultiply(A,M);
od;
if i<n-1 then true
else Equal(M,ZeroMatrix(n))
fi;
else ERROR (`La matrice n'est pas carr\303\251e`)
fi;
end:
A:=Matrix([[0,1,0,0],[0,0,1,0],[0,0,0,1],[0,0,0,0]]);
estNilpotent(A);estNilpotent(MatrixAdd(A,IdentityMatrix(4)));with(LinearAlgebra):decompositionBezout := proc(l,x)
local s,t,res,g,i,j;
res:=[1];
g:=collect(l[1],x);
for i from 2 to nops(l) do
g:=gcdex(collect(g,x),collect(l[i],x),x,'s','t');
res:=[seq(normal(res[j]*s),j=1..i-1)];
res:=[op(res),t];
od;
res:=[g,res];
end:liste:=[(x+2)*(x+3),(x+1)*(x+3),(x+1)*(x+2)];
decompositionBezout(liste,x);decomposePolyMin := proc(A,x)
local poly,r,i,q,res;
poly:=MinimalPolynomial(A,x);
r:=roots(poly,x,{I});
res:=[];
for i from 1 to nops(r)
do
q[i]:=[r[i][1],r[i][2],collect(factor(poly/(x-r[i][1])^r[i][2]),x)];
res:=[op(res),q[i]];
od;
end:A:=Matrix([[5,1,3],[4,3,4],[-1,-1,1]]);
decomposePolyMin(A,x);projecteursSpectraux := proc(A)
local polyCar,r,p,q,suiteQ,bezout,i,P,suiteProj;
polyCar:=CharacteristicPolynomial(A,x);
r:=roots(polyCar,x,{I});
q:=decomposePolyMin(A,x);
p:=nops(q);
suiteQ:=[seq(q[i][3],i=1..p)];
bezout:=decompositionBezout(suiteQ,x);
for i from 1 to p
do
P[i]:=MatrixFunction(A,collect(bezout[2][i]*q[i][3],x),x);
od;
suiteProj:=[seq(P[i],i=1..p)];
end:projecteursSpectraux(A);JSFHPolyn\303\264me minnimalwith(LinearAlgebra):n:=10:
A:=RandomMatrix(n,n,generator=1..n^2);sol:=NULL:
for k to n^2 while sol=NULL do
M:=MatrixAdd(add(MatrixScalarMultiply(MatrixPower(A,i),a[i]),i=0..k-1),MatrixPower(A,k));
sol:=solve({seq(seq(M[i,j],j=1..n),i=1..n)},{seq(a[i],i=0..k-1)});
od:
sol;
m1:=subs(sol,add(a[i]*x^i,i=0..k-2)+x^{k-1});
m2:=MinimalPolynomial(A,x);JSFHJSFHTTdSMApJNlJUQUJMRV9TQVZFLzE2NjAwMjYzNlgsJSlhbnl0aGluZ0c2IjYiW2dsISIlISEhIzEiJSIlIiIhRidGJ0YnIiIiRidGJ0YnRidGKEYnRidGJ0YnRihGJ0YmTTdSMApJNlJUQUJMRV9TQVZFLzE2ODc0MTAwOFgsJSlhbnl0aGluZ0c2IjYiW2dsISIlISEhIyoiJCIkIiImIiIlISIiIiIiIiIkRilGK0YoRipGJg==TTdSMApJNlJUQUJMRV9TQVZFLzE2ODc2ODY1MlgsJSlhbnl0aGluZ0c2IjYiW2dsISIlISEhIyoiJCIkISIlRiciIiUiIiJGKSEiIkYnRidGKEYmTTdSMApJNlJUQUJMRV9TQVZFLzE1MTU5NDk0NFgsJSlhbnl0aGluZ0c2IjYiW2dsISIlISEhIyoiJCIkIyIiKCIiIyIiJSMhIiZGKSIiIUYtRi1GJ0YqRitGJg==TTdSMApJNlJUQUJMRV9TQVZFLzE1MTQ4NzQ5MlgsJSlhbnl0aGluZ0c2IjYiW2dsISIlISEhIyoiJCIkIyIiJCIiIyIiISMhIiRGKSEiIkYqIiIiI0YuRilGKiNGLUYpRiY=TTdSMApJNlJUQUJMRV9TQVZFLzE3MzI3Njc2NFgsJSlhbnl0aGluZ0c2IjYiW2dsISIlISEhI19xIisiKyIjISoiIigiIycpIiIiIiNwIiNDIiNsIiIkIiIjIiNPIiNQIiNOIiNuIiM4RjQiIyQpIiNpIiNMIiNVIiNcIiNIIiN3RigiI1YiI0kiI1siIyQqRjYiIykpRjZGMCIjSiIjUUZARi9GPiIjaiIjUkYzRjYiI3pGM0YwIiNAIiNdIiNnIiNvIiMiKkY9IiQrIiIjeCIjNSIjdCIjIyoiIykqRj4iIyEpIiNgRk4iI0FGP0YuRkBGN0YrRi5GKSIjKipGUkY6IiM2IiNoIiM3IiMlKUZYIiNkRjJGPEZUIiNlRjAiI3lGM0ZEIiIlRlQiI2YiI21GKkY9RjkiIyMpRldGOyIjXiIjP0ZBRjgiIygqIiNhRiY=