#C19.txt (Nov. 10, 2016) Help:=proc(): print(` AS(f,x,n), inv1(pi) , sL(L,x) , sLm(L,M), sLe(L,E) , TabsMoGood(L,k) `): end: #inv1(pi): the number of inversions of the permutation pi inv1:=proc(pi) local i,j,n,co: n:=nops(pi): co:=0: for i from 1 to n do for j from i+1 to n do if pi[i]>pi[j] then co:=co+1: fi: od: od: co: end: with(combinat): #AS(f,x,n): the anti-symmstrizer of the function f of x[1], ..., x[n] AS:=proc(f,x,n) local S: S:=permute(n): add((-1)^inv1(pi)* ApplyPi(f,x,n,pi),pi in S): end: #sL(L,x): Inputs an integer partition L (of n, say) and a letter x #outputs the Schur symmetric polynomial s_L(x1, ..., xn) sL:=proc(L,x) local n,L1, rich,i: n:=convert(L,`+`): L1:=[op(L),0$(n-nops(L))]: rich:=[seq(n-i,i=1..n)]: L1:=L1+rich: normal(AS(mul(x[i]^L1[i],i=1..n),x,n)/mul(mul(x[i]-x[j],j=i+1..n),i=1..n-1)): end: #sLm(L,M): s_L(x) in terms of the Monomial Symmetric Functions sLm:=proc(L,M) local n,x: n:=convert(L,`+`): ToM(sL(L,x),x,n,M): end: #sLe(L,E): s_L(x) in terms of the e-basis sLe:=proc(L,E) local n,x: n:=convert(L,`+`): ToE(sL(L,x),x,n,E): end: #TabsNoGood(L,k) A failed attempt to write a procedure that inputs a partition L and a pos. integer k (k>=nops(L)) #outputs the set of all (column-strict) tableaux of shape L using {1, ..., k} TabsNoGood:=proc(L,k) local L1,S,S1,i,i1,s1: option remember: print(`DO NOT USE`): if kL[i+1] then L1:=[op(1..i-1 , L), L[i]-1, op(i+1..nops(L),L)]: S1:= {seq(op(Tabs(L1,i1)),i1=1..k)}: S:=S union {seq([op(1..i-1,s1),[op(s1[i]),k],op(i+1..nops(s1),s1)], s1 in S1)}: fi: od: for i from nops(L) to nops(L) do if L[i]>1 then L1:=[op(1..i-1 , L), L[i]-1]: else L1:=[op(1..i-1,L)]: fi: S1:= {seq(op(Tabs(L1,i1)),i1=1..k)}: S:=S union {seq([op(1..i-1,s1),[op(s1[i]),k]], s1 in S1)}: od: S: end: #stuff from previous classes #C18.txt, Nov. 7, 2016, Dr. Z.'s Experimental Mathematics Class, Bases of Symmetric Polynomials Help18:=proc(): print(` Toe(f,x,n,e), ToE(f,x,n,E), Andrew(F,x,n), mToe(n) `): end: with(linalg): #Stuff from C15.txt ################## #C15.txt: ExpMath, Rutgers, Oct. 27, 2016, Bases of the alg. of Symmetric Polynomials Help15:=proc(): print(`P(n), ApplyPi(f,x,n,pi), Sym(f,x,n), mL(x,L,n)`): print(`IsSym(f,x,n), ToM(f,x,n,M), ei(x,i,n), eL(x,L,n), eTom(n) `): end: with(combinat): #Rev(L): reverse of L Rev:=proc(L) local n,i: n:=nops(L): [seq(L[n-i+1],i=1..n)]: end: #P(n): the list of (integer) partitons of n in non-increasing order P:=proc(n) local S,i: S:=partition(n): Rev([seq(Rev(S[i]),i=1..nops(S))]): end: #ApplyPi(f,x,n,pi): inputs f, x, n, pi, where f is an expression in x[1],...,x[n] #pos. integer n, letter x, and a permutation pi of {1, ...,n}, applies x[i]->x[pi[i]] #to f ApplyPi:=proc(f,x,n,pi) local i: if nops(pi)<>n then RETURN(FAIL): fi: subs({seq(x[i]=x[pi[i]],i=1..n)},f): end: #Sym(f,x,n): the symmetrizer of f Sym:=proc(f,x,n) local pi,S: S:=permute(n): convert({seq(ApplyPi(f,x,n,pi), pi in S)},`+`): end: #mL(x,L,n): The monomial symmetric function m_L(x1,..., xn) where n>=nops(L) mL:=proc(x,L,n) local i: if n0 then RETURN(false): fi: od: true: end: KickZ:=proc(L) local i: for i from 1 to nops(L) while L[i]<>0 do od: [op(1..i-1,L)]: end: #ToM(f,x,n,M): inputs a symmetric polynomial f in x[1]..., x[n] #outputs it as a linear combination of M[L] ToM:=proc(f,x,n,M) local F,f1,mono,L,c,i: if not IsSym(f,x,n) then RETURN(FAIL): fi: if not type(f,`+`) then c:=normal(f/mul(x[i],i=1..n)): if not type(c,integer) then RETURN(FAIL): else RETURN(c*M[[1$n]]): fi: fi: f1:=f: F:=0: while f1<>0 do mono:=op(1,f1): L:=[seq(degree(mono,x[i]),i=1..n)]: c:=normal(mono/mul(x[i]^L[i],i=1..nops(L))): L:=KickZ(sort(L,`>`)): F:=F+c*M[L]: f1:=expand(f1-c*mL(x,L,n)): od: F: end: #ei(x,i,n): the elementary symmetric function e_i(x[1], ..., x[n]) ei:=proc(x,i,n) : if i>n then 0: else mL(x,[1$i],n): fi: end: #eL(x,L,n): the mul(e_L[i], i=1..n) eL:=proc(x,L,n) local i: mul(ei(x,L[i] ,n),i=1..nops(L)): end: #eTom(n): code by JinYoung Park eTom:=proc(n) local Pn,k,A,B,M,i,M1,j,x: Pn:=P(n): k:=nops(Pn): A:=[seq(M[Pn[i]],i=1..k)]: B:=[seq(ToM(expand(eL(x,Pn[i],n)),x,n,M),i=1..k)]: M:=[]: for i from 1 to nops(A) do M1:=[seq(coeff(B[i],A[j]),j=1..nops(A))]: M:=[op(M),M1]: od: end: ######Code from previou classes #End Stuff from C15.txt ################## #Start Stuff from C18.txt #mToe(n): the transition matrix from the m-basis to the e-basis mToe:=proc(n) inverse(eTom(n)): end: #Andrew(F,x,n): inputs a symmetric polynomial F, in x[1],..., x[n] abd ouputs the vector of coefficients Andrew:=proc(F,x,n) local A,Pars,M,i: A:=ToM(expand(F),x,n,M): Pars:=P(n): [seq(coeff(A,M[Pars[i]],1),i=1..nops(Pars))]: end: #ToE(f,x,n,E): inputs a symmetric function f, homog. of total degree n, of x[1]. ..., x[n] #and a positive integer n, and a symbol E, expresses it as a linear combination of #the E-basis, where E[L] means e_L[1]*...e_L[nops(L)] ToE:=proc(f,x,n,E) local v,Pars,i: v:=multiply(Andrew(f,x,n),mToe(n)): Pars:=P(n): add(v[i]*E[Pars[i]],i=1..nops(Pars)): end: #Toe(f,x,n,e): inputs a symmetric function f, homog. of total degree n, of x[1]. ..., x[n] #and a positive integer n, and a symbol e, expresses it as polynomial expression in e[1],e[2],...,e[n] #thereby confirming the fundamental theorem of Symmetric Functions that any summetric polynomial #in x[1],..,x[n] of degree<=n can be thus expressed Toe:=proc(f,x,n,e) local v,Pars,i,j: v:=multiply(Andrew(f,x,n),mToe(n)): Pars:=P(n): add(v[i]*mul(e[Pars[i][j]],j=1..nops(Pars[i])),i=1..nops(Pars)): end: ###end stuff from C18.txt