//teste l'absolue irréductibilité des courbes planes sur un corps fini. IsAbsIrreducible:=function(f) P:=Parent(f); F:=BaseRing(P); p:=#F; x:=Name(P,1); y:=Name(P,2); // mise en x pour le plus petit degre chang:=homP|y,x>; if Degree(f,x) gt Degree(f,y) then f:=chang(f);end if; //indicateur d'absolue irreductibilite irred:=true; //calcul du contenu de f pgcd:=0; for i:=0 to Degree(f,x) do pgcd:=Gcd(pgcd,Coefficient(f,x,i)); end for; if Degree(pgcd,y) ne 0 then irred:=false; end if; //f squarefree if TotalDegree(Gcd(f,Derivative(f,x))) ne 0 then irred:=false;end if; if irred ne false then //mise sous forme monique ldc:=LeadingCoefficient(f,x); f:=P!(ldc^(Degree(f,x)-1)*Evaluate(f,[x/ldc,y])); //si on cherche le genre on peut avoir des infos complementaires mais //malh. sur le degre total d'un facteur que peut avoir le poly il est dans //[2,Binf] ou [Bsup,d] mais bon c'est pas genial car c'est pas le //degree en x ou en y. //Pfiel:=FunctionField(F); //Pffiel:=PolynomialRing(Pfiel); //fphi:=homPffiel|X,Y>; //fielf:=fphi(f); //ffiel:=FunctionField(fielf); //g:=Genus(ffiel); //td:=TotalDegree(f); //B:=4*g-4+6*td-td^2; //Binf:=Floor((td-Sqrt(B))/2); //Bsup:=Ceiling((td+Sqrt(B))/2); Disc:=Discriminant(f,x); //extension ou f peut etre squarefree tg:=Degree(Disc,y); ss:=Ceiling(Log(tg)/Log(p)); Pint:=PolynomialRing(F); phiint:=homPint|0,yi>; Dint:=phiint(Disc); for i:=1 to ss do LL:=PrimePolynomials(Pint,i); for poly in LL do if Degree(Gcd(poly,Dint)) eq 0 then polye:=poly; break i; end if; end for; end for; if Degree(polye) eq 1 then w1:=Roots(polye)[1][1]; else F:=ext;end if; P1:=PolynomialRing(F,2); phid:=homP1|x1,y1>; f:=phid(f); P0:=PolynomialRing(F); //fonction de reduction mod v^(i) trunc:=function(f,v,i) t:=0; for j:=0 to i-1 do t:=t+Coefficient(f,v,j)*v^j; end for; return t; end function; //translation en w1 pour y=0 phit:=homP1|x1,y1+w1>; f:=phit(f); //recherche d'une extension dans laquelle f0 admet une racine phi:=homP0 | a,0>; f0:=phi(f); Lf0:=Factorization(f0); d:=Degree(f0); for fp in Lf0 do if Degree(fp[1]) le d then ff:=fp[1];d:=Degree(fp[1]); end if; end for; if d ne 1 then FF:=ext; else FF:=F;w:=Roots(ff)[1][1]; end if; PP:=PolynomialRing(FF,2); PY:=PolynomialRing(FF); phi2:=homPP|u,v>; phi3:=homPY|0,z>; f:=phi2(f); n:=Degree(f,1);d:=Degree(f,2);K:=(2*n-1)*d; //algo de newton t:=1/Evaluate(Derivative(f0),w); a0:=w; for i:= 1 to K do a0:=a0-t*Evaluate(f,[a0,v]); a0:=trunc(a0,v,i+1); end for; lalpha:=[]; for i:=0 to n-1 do alpha:=phi3(trunc(a0^i,v,K+1)); lalpha:=Append(lalpha,alpha); end for; irred:=true; //creation du polynome minimal m:=2; while (irred eq true and m le n) do M:=Matrix(FF,K+1,m*(d+1)+1,[]); for i:=1 to K+1 do for j:=1 to m do for k:=1 to Minimum(d+1,i) do M[i,(j-1)*(d+1)+k]:=Coefficient(lalpha[j],i-k); end for; end for; M[i,m*(d+1)+1]:=-Coefficient(lalpha[m],i-1); end for; if Rank(M) lt m*(d+1) then irred:=false; end if; m:=m+1; end while; end if; return irred; end function;