# $Source: /u/maple/research/lib/LREtools/src/RCS/p_curv,v $ # $Notify: mvanhoei@scg.math.uwaterloo.ca macro( p_curv=`LREtools/p_curv`, co=`LREtools/p_curv/co`, AFactor=`LREtools/p_curv/AFactor`, order1=`LREtools/p_curv/order1` ): # Compute the factors of the characteristic polynomial of # the p-curvature of a difference operator. # # Mark van Hoeij, 1998. # L in C[x,tau] # args[5..-1] can be used to specify additional field extensions. # # If p=list of primes then just check if an order1 factor could # exist, then the output is true/false. # # If p=prime then compute the characteristic polynomial of the # p-curvature and factor it over the algebraic closure. p_curv:=proc(L,x,tau,p) local M,N,n,i,c,b,F; option `Copyright (c) 1998 Waterloo Maple Inc. All rights reserved.`; if type(p,list) then for i in p do M:=traperror(procname(L,x,tau,i,'test')); if M=false then return M fi; od; return true fi; M:=ReduceField([L,indets([args],{'RootOf','radical','nonreal'})] ,indets([args[2..-1]],'name')) mod p; M, F:=Primpart(M[1],tau) mod p, indets(M,'RootOf'); if args[-1]='test' and degree(M,tau)0,[tau-infinity,1,n],NULL),seq([i[1],1,i[2]],i=C1), seq(seq([j,degree(i[1],tau),i[2],i[1]],j=i[3]),i=C)] end: # If a polynomial in 2 variables is a product of factors of deg 1 in tau, # and irreducible over the base field, then factor it over closure of # the base field. AFactor:=proc(f,x,tau,p) local i,n,R,S; option `Copyright (c) 1998 Waterloo Maple Inc. All rights reserved.`; n:=degree(f,tau); if n=1 or {seq(irem(degree(f,i),n),i=[x,{x,tau}])}<>{0} or member(1 ,{seq(irem(i[2],2),i=(Sqrfree(Discrim(f,tau) mod p) mod p)[2])}) then R:=f # f is not a product of deg 1 factors. elif args[-1]='test' then # Just check if a 1st order factor could exist, which is # the case. R:=tau$n else R:=op(indets(f,'RootOf')); if R=NULL then R:=RootOf(Randprime(n,x) mod p) mod p; R:=seq(i[1],i=(Factors(f,R) mod p)[2]) else S:=RootOf(Randprime(n*degree(op(1,R),_Z),x) mod p) mod p; R:=seq(i[1],i=(Factors(subs(R=(Roots(subs(_Z=x,op(1,R)) ,S) mod p)[1][1],f),S) mod p)[2]) fi fi; [seq(collect(i/lcoeff(i,tau),tau,Normal) mod p,i=[R])] end: ######################################################### # Extract local information at x=infinity from p_curv # ######################################################### macro( expansion=`LREtools/cnd_count/expansion`, cnd_count=`LREtools/cnd_count`, x = _Env_LRE_x, tau = _Env_LRE_tau, NO_RAT = 3 # See hsolsR ): # F is the p_curvature polynomial in x and tau. # R is the c*x^n*(1+d*(1/x)) # We want the number of roots with c*x^n+lower terms expansion:=proc(F,R,p,deg_R) local l,n,i; l:=lcoeff(F,tau); if l<>1 then n:=degree(F,tau); procname(Expand(tau^n+ add(coeff(F,tau,i)*l^(n-1-i)*tau^i,i=0..n-1)) mod p ,collect(R*l,x,Normal) mod p,p) elif ldegree(R,x){} then v:=v union {I} fi; v:=[L,op(indets(L,{'RootOf','radical','name'})),op(v)]; # Could generate an error: w:=traperror(`mod/ReduceField`(v,{x,tau},p)); if w=lasterror then return cnds fi; delta:=degree(L,tau)-degree(w[1],tau) + ldegree(w[1],tau)-ldegree(L,tau); if delta >= max(seq(cnd[-1],cnd=cnds)) then return cnds fi; pc:=p_curv(w[1],x,tau,p,`dont factor`); res:=NULL; for cnd in cnds do if TO_DO=NO_RAT and cnd[-1]=1 then # are not searching for rational hypergeomsols. next fi; if delta >= cnd[-1] then res:=res,cnd; next fi; f:=Normal(cnd[1]^p*x^(-cnd[2])*(1-(cnd[3]^p-cnd[3])/x)); f:=traperror(`mod/ReduceField`([subs( {seq(v[i]=w[i],i=2..nops(v))},f),pc],{x,tau},p)); if f=lasterror or f[1]=0 then res:=res,cnd; next fi; i, f := op(f); i:=expansion(f,i,p); if i=0 or (i=1 and TO_DO = NO_RAT) then next fi; res:=res, subsop(-1=min(cnd[-1],i+delta),cnd) od; [res] end: #savelib('order1','AFactor','p_curv','co'): #savelib('expansion','cnd_count'):