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).
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 with coefficients in R, which are shift invariant in the sense that the coefficient of the monomial is equal to the coefficient of the monomial for any strictly increasing sequence of positive integers indexing the variables and any positive integer sequence of exponents. Much of the study of quasisymmetric functions is based on that of symmetric functions.