(***********************************************************************
This file was generated automatically by the Mathematica front end.
It contains Initialization cells from a Notebook file, which typically
will have the same name as this file except ending in ".nb" instead of
".m".

This file is intended to be loaded into the Mathematica kernel using
the package loading commands Get or Needs.  Doing so is equivalent to
using the Evaluate Initialiation Cells menu command in the front end.

DO NOT EDIT THIS FILE.  This entire file is regenerated automatically 
each time the parent Notebook file is saved in the Mathematica front end.
Any changes you make to this file will be overwritten.
***********************************************************************)





<< "Algebra`SymmetricPolynomials`"
<< "DiscreteMath`Combinatorica`"
Off[General::"spell1"]


(* Define elementary symmetric polynomials *)
Clear[eps]
eps[X_,0] = 0;
eps[X_, k_Integer] := 
If[k<= Length[X],
SymmetricPolynomial[X,k] ,0]
eps[X_, lambda_List] := 
  Expand[Product[eps[X, lambda[[i]]], {i, 1, Length[lambda]}]]

power[X_List,lambda_List] :=  
  If[Length[lambda] <= Length[X], 
    Product[X[[i]]^lambda[[i]],{i,1,Length[lambda]}],0]


(*Expansion in elementary symmetric functions*)
Clear[logg]
logg[x[k_], k_] := 1
logg[x[k_]^a_, k_] := a
logg[y___*x[k_], k_] := 1
logg[y___*x[k_]^a_, k_] := a
logg[z_,k_] := 0 /; FreeQ[z, x[k]]
	llambda[z_] := Table[logg[z,k], {k,1,NumbVars}]
myorderQ[a_,b_] := OrderedQ[llambda[a], llambda[b]]
mysort[p_] := Sort[Apply[List, p],  myorderQ[{#1, #2}]&]
leadingTerm[p_] :=
		If[Head[p]===Plus, mysort[p][[1]],p]
leadingPartition[p_] := llambda[leadingTerm[p]]
leadingMonomial[p_] := Module[{a},
		a= leadingPartition[p];
		Product[x[i]^a[[i]], {i,1,NumbVars}]]
leadingCoefficient[p_] := leadingTerm[p]/leadingMonomial[p]
Clear[\[Epsilon]]


elementaryExpand[p_] := Module[{p1,plist, \[Epsilon]\[Epsilon]},
		n = NumbVars;
		\[Epsilon]\[Epsilon]:= Array[\[Epsilon], n];
		p1= Expand[p];
	plist = {};
		While[Not[p1 === 0],
		plist = 
        Append[plist, {leadingCoefficient[p1],
            TransposePartition[leadingPartition[p1]]}];
			p1 = 
			Expand[
          p1 - leadingCoefficient[p1]*
              eps[X,TransposePartition[leadingPartition[p1]]]];
			];

	plist  =Apply[Plus, 
        Map[#[[1]]*
              Product[ 
                \[Epsilon]\[Epsilon][[#[[2,i]]]]  ,{i,1,Length[#[[2]]]}]&,
          plist]]
		]


(* Compute monomial symmetric function corresponding to a partition. An 
    alphabet of variables must be specified.*)

monomialSymmetric[X_, lambda_List] := Module[{permlist,mu},
		mu = lambda//. {a__,0} -> {a};
	If[Length[mu] > Length[X], Return[0]];
		While[Length[mu] < Length[X], mu = Append[mu,0]];
		permlist = DistinctPermutations[mu];
		permlist = Apply[Plus,Map[ power[X,#] & , permlist]]
]





Discr[X_] :=
Product[X[[i]]-X[[j]], {i,1,Length[X]-1},{j,i+1,Length[X]}]^2


	






















































































\!\(Discr[X_] := 
    \((\[Product]\+\(i = 1\)\%\(Length[X] - 1
              \)\(\[Product]\+\(j = i + 1\)\%\(Length[X]\)\((
              X\[LeftDoubleBracket]i\[RightDoubleBracket] - 
                X\[LeftDoubleBracket]j\[RightDoubleBracket])\)\))\)\^2\)















