Quasisymmetric function

In algebra and in particular in algebraic combinatorics, a quasisymmetric function is any element in the ring of quasisymmetric functions which is in turn a subring of the formal power series ring with a countable number of variables. This ring generalizes the ring of symmetric functions. This ring can be realized as a specific limit of the rings of quasisymmetric polynomials in "n" variables, as "n" goes to infinity. This ring serves as universal structure in which relations between quasisymmetric polynomials can be expressed in a way independent of the number "n" of variables (but its elements are neither polynomials nor functions).
Definitions.
The ring of quasisymmetric functions, denoted QSym, can be defined over any commutative ring "R" such as the integers. 
Quasisymmetric 
functions are power series of bounded degree in variables formula_1 with coefficients in "R", which are shift invariant in the sense that the coefficient of the monomial formula_2 is equal to the coefficient of the monomial formula_3 for any strictly increasing sequence of positive integers 
formula_4 indexing the variables and any positive integer sequence formula_5 of exponents.
Much of the study of quasisymmetric functions is based on that of symmetric functions.
A quasisymmetric function in finitely many variables is a "quasisymmetric polynomial".
Both symmetric and quasisymmetric polynomials may be characterized in terms of actions of the symmetric group formula_6
on a polynomial ring in formula_7 variables formula_8. 
One such action of formula_6 permutes variables,
changing a polynomial formula_10 by iteratively swapping pairs formula_11
of variables having consecutive indices.
Those polynomials unchanged by all such swaps
form the subring of symmetric polynomials.
A second action of formula_6 conditionally permutes variables, 
changing a polynomial formula_13
by swapping pairs formula_11 of variables
"except" in monomials containing both variables.
Those polynomials unchanged by all such conditional swaps form
the subring of quasisymmetric polynomials. One quasisymmetric function in four variables formula_15 is the polynomial
The simplest symmetric function containing these monomials is
Important bases.
QSym is a graded "R"-algebra, decomposing as 
where formula_19 is the formula_20-span of all quasisymmetric functions that are homogeneous of degree formula_7. Two natural bases for formula_19 are the monomial basis formula_23 and the fundamental basis formula_24 indexed by compositions formula_25 of formula_7, denoted formula_27. The monomial basis consists of formula_28 and all formal power series 
The fundamental basis consists formula_30 and all formal power series 
where formula_32 means we can obtain formula_33 by adding together adjacent parts of formula_34, for example, (3,2,4,2) formula_35 (3,1,1,1,2,1,2). Thus, when the ring formula_20 is the ring of rational numbers, one has
Then one can define the algebra of symmetric functions formula_38 as the subalgebra of QSym spanned by the monomial symmetric functions formula_39 and all formal power series formula_40 where the sum is over all compositions formula_33 which rearrange to the partition formula_42. Moreover, we have formula_43. For example, formula_44 and formula_45
Other important bases for quasisymmetric functions include the basis of quasisymmetric Schur functions, and bases related to enumeration in matroids.
Applications.
Quasisymmetric functions have been applied in enumerative combinatorics, symmetric function theory, representation theory, and number theory. Applications of
quasisymmetric functions include enumeration of P-partitions,
permutations, tableaux, chains of posets, reduced decompositions in finite Coxeter groups (via Stanley symmetric functions), and parking functions. In symmetric function theory and representation theory, applications include the study of Schubert polynomials, Macdonald polynomials,
Hecke algebras, and Kazhdan–Lusztig polynomials. Often quasisymmetric functions provide a powerful bridge between combinatorial structures and symmetric functions.
Related algebras.
As a graded Hopf algebra, the dual of the ring of quasisymmetric functions is the ring of noncommutative symmetric functions. 
Every symmetric function is also a quasisymmetric function, and hence the ring of symmetric functions is a subalgebra of the ring of quasisymmetric functions.
The ring of quasisymmetric functions is the terminal object in category of graded Hopf algebras with a single character.
Hence any such Hopf algebra has a morphism to the ring of quasisymmetric functions.
One example of this is the peak algebra.
Other related algebras.
The Malvenuto–Reutenauer algebra is a Hopf algebra based on permutations that relates the rings of symmetric functions, quasisymmetric functions, and noncommutative symmetric functions, (denoted Sym, QSym, and NSym respectively), as depicted the following commutative diagram. The duality between QSym and NSym mentioned above is reflected in the main diagonal of this diagram.
Many related Hopf algebras were constructed from Hopf monoids in the category of species by Aguiar and Majahan.
One can also construct the ring of quasisymmetric functions in noncommuting variables.