#C22.txt April 13, 2026 Help22:=proc(): print(`Rev(L), mBase(n,x), eBase(n,x) , pBase(n,x), hkn(k,n,x), hBase(n,x) `): print(`Coe(f,x,n,L), mVec(f,x,n)`): end: #mBse: The basis of Monomial Symmetric polynomial of total degree n mBase:=proc(n,x) local P,i: P:=Par(n): [seq(mL(x,n,P[i]),i=1..nops(P))]: end: #eBase(n,x): The e-base of the algebra of symmetric polynomials of degree n in x[1],...,x[n] eBase:=proc(n,x) local P,i,j: P:=Par(n): expand([seq( mul(ekn(P[i][j],n,x),j=1..nops(P[i])), i=1..nops(P))]): end: #pBase(n,x): The p-base of the algebra of symmetric polynomials of degree n in x[1],...,x[n] pBase:=proc(n,x) local P,i,j: P:=Par(n): expand([seq( mul(pkn(P[i][j],n,x),j=1..nops(P[i])), i=1..nops(P))]): end: #hkn(k,n,x): A cleverer way to output h_k(x[1], ..., x[n]) hkn:=proc(k,n,x) option remember: if k=0 then RETURN(1): fi: if n=0 then if k=0 then RETURN(1): else RETURN(0): fi: fi: expand(hkn(k,n-1,x)+ x[n]*hkn(k-1,n,x)): end: #hBase(n,x): The e-base of the algebra of symmetric polynomials of degree n in x[1],...,x[n] hBase:=proc(n,x) local P,i,j: P:=Par(n): expand([seq( mul(hkn(P[i][j],n,x),j=1..nops(P[i])), i=1..nops(P))]): end: #Coe(f,x,n,L): inputs any polynomial f of x[1], ..., x[n], and a list of integers #L output the coeff. of x[1]^L[1]*x[2]^L[2]*... Coe:=proc(f,x,n,L) local c,i: c:=f: for i from 1 to nops(L) do c:=coeff(c,x[i],L[i]): od: c: end: #mVec(f,x,n): inputs a symmetric poly of x[1], ..., x[n] of (total) degree n #outputs the coeffi vector (of length nops(Par(n)) when you express it in terms of #m-bases mVec:=proc(f,x,n) local P,i: P:=Par(n): [seq(Coe(f,x,n,P[i]),i=1..nops(P))]: end: with(linalg): #old stuff #C21.txt, April 9, 2026 Help21:=proc(): print(`SubsPi(f,x,pi), IsSymS(f,x,n) , IsSym(f,x,n) `): print(`Symm(f,x,n), rSymm(f,x,n), mL(x,n,L) , ekn(k,n,x), pkn(k,n,x) `): print(`eknC(k,n,x)`): end: with(combinat): #SubsPi(f,x,pi): inputs a polynomial f(x[1], ..., x[n]) (n:=nops(pi)) #and ouputs the new polynomial obtaine by substituting x[i]->x[pi[i]] SubsPi:=proc(f,x,pi) local n,i: n:=nops(pi): subs({seq(x[i]=x[pi[i]],i=1..n)},f): end: #IsSymS(f,x,n): checks that all the images of f under the symmetric group #coincide with f (that is a symmetric polynomial) IsSymS:=proc(f,x,n) local Sn,pi: Sn:=permute(n): evalb({seq(SubsPi(f,x,pi), pi in Sn)}={f}): end: #IsSym(f,x,n): checks that f(x[1], ..., x[n]) is symmetric the Pablo way IsSym:=proc(f,x,n) local i: evalb({seq(subs({x[i]=x[i+1],x[i+1]=x[i]},f),i=1..n-1)}={f}): end: #Symm(f,x,n): inputs an ARBITRARY polynomial f(x[1],...,x[n]) and #outputs the sum of all the images of f under S_n Symm:=proc(f,x,n) local Sn,pi: Sn:=permute(n): add(SubsPi(f,x,pi), pi in Sn): end: #rSymm(f,x,n): inputs an ARBITRARY polynomial f(x[1],...,x[n]) and #outputs the sum of all the distinct images rSymm:=proc(f,x,n) local Sn,pi: Sn:=permute(n): convert({seq(SubsPi(f,x,pi), pi in Sn)}, `+`): end: #Rev(L): the reverse of the list L Rev:=proc(L) local i,k: k:=nops(L): [seq(L[k-i],i=0..k-1)]: end: #Par(n): The set of partitions of n, the clever way. Par:=proc(n) local k,P,i: P:=partition(n): Rev([seq(Rev(P[i]),i=1..nops(P))]): end: #mL(x,n,L): inputs a variable name x a positive integer n and #an integer partition L outputs the symmetrizer of #x[1]^L[1]*...*x[nops(L)]^L[nops(L)], m_L(x[1], ..., x[n]) #MONOMIAL symmetric polymomial mL:=proc(x,n,L) local k,i: k:=nops(L): rSymm(mul(x[i]^L[i],i=1..k),x,n): end: #eknS(k,n,x): The elementary symmetric polynomial of degree k in x[1], ..., x[n] eknS:=proc(k,n,x) rSymm(mL(x,n,[1$k]),x,n ): end: #pkn(k,n,x): The power symmetric polynomial pkn:=proc(k,n,x) rSymm(mL(x,n,[k]),x,n ): end: #ekn(k,n,x): A cleverer way to output e_k(x[1], ..., x[n]) ekn:=proc(k,n,x) option remember: if k>n then RETURN(0): fi: if n=0 then if k=0 then RETURN(1): else RETURN(0): fi: fi: expand(ekn(k,n-1,x)+ x[n]*ekn(k-1,n-1,x)): end: