Hopf algebra structure of generalized quasi-symmetric functions in partially commutative variables

We introduce a coloured generalization $\mathrm{NSym}_A$ of the Hopf algebra of non-commutative symmetric functions described as a subalgebra of the of rooted ordered coloured trees Hopf algebra. Its natural basis can be identified with the set of sentences over alphabet $A$ (the set of colours). We present also its graded dual algebra $\mathrm{QSym}_A$ of coloured quasi-symmetric functions together with its realization in terms of power series in partially commutative variables. We provide formulas expressing multiplication, comultiplication and the antipode for these Hopf algebras in various bases -- the corresponding generalizations of the complete homogeneous, elementary, ribbon Schur and power sum bases of $\mathrm{NSym}$, and the monomial and fundamental bases of $\mathrm{QSym}$. We study also certain distinguished series of trees in the setting of restricted duals to Hopf algebras.


Introduction
Theory of Hopf algebras forms a modern basis for understanding symmetries of solvable models in quantum and statistical theoretical physics [56,44,12]. Application of Hopf algebras [1,75] to combinatorics can be traced back to Rota [42], see also [71,33] for more recent reviews of the subject, which has expanded since then. Combinatorial aspects of the Bethe ansatz and of the quantum inverse scattering method [46] were studied, for example, in works by Fomin, Kirillov and Reshetikhin [30,43]. For more about mutual interactions between the theory of integrable systems and combinatorics, see recent reviews [14,35,16,79].
Hopf algebras of rooted trees appeared in the analysis of Runge-Kutta methods by Butcher [10] and Dür [24], and in works by Grossman and Larson [34] in the context of symbolic computation. More recently they were used by Connes and Kreimer [13] to describe renormalization procedure of quantum field theory, see also [8,9]. The non-commutative Hopf algebra of trees and forests, generalizing that of Connes and Kreimer, was considered by Foissy [28], and independently by Holtkamp [39].
The theory of symmetric functions [73,53] is by now well established subject with numerous applications in algebraic topology, combinatorics, representation theory, integrable systems and geometry. Quasi-symmetric functions, introduced by Gessel [32] (see also an earlier relevant work of Stanley [72]), are extensions of symmetric functions that are becoming of comparable importance [52,3,59]. As a graded Hopf algebra, the dual of the algebra of quasi-symmetric functions is the Hopf algebra of non-commutative symmetric functions introduced by Gelfand, Krob, Lascoux, Leclerc, Retakh, and Thibon [31]. In works of Zhao [78] and Hoffman [38] there was established isomorphism between the Hopf algebra of non-commutative symmetric functions and certain subalgebra of rooted ordered trees, see also [25] for application of such trees (called ladders) to study integrable aspect of the renormalization.
Our work arose from the search for generalization of the relationship between theory of symmetric functions, combinatorics and the integrable systems on the non-commutative level. Already the standard description of the Kadomtsev-Petviashvili (KP) hierarchy of integrable partial differential equations in terms of free fermions by the Kyoto School [63] involves large part of the theory of symmetric functions [70], see also a generalization [17] in direction of quasi-symmetric functions. For example, the Schur functions when expressed in suitably scaled power sum functions (times of the KP hierarchy) provide polynomial τ -function solutions of the equations. Non-commutative extensions of integrable systems are of growing interest in mathematical physics [48,7,64,27,15,45,18,20,22,21]. In this paper we define and study properties of a coloured version of the Hopf algebra of non-commutative symmetric function and of its graded dual. The idea to consider coloured versions of various algebras is not new, see for example [2,40,41,58,66,65,67], where some generalizations of the Hopf algebras of non-commutative symmetric functions or quasi-symmetric functions have been discussed as well. The generalization presented in our work is to our best knowledge new, and in particular it extends some of the previous concepts, see the last remark of Section 3.1.
Let us present the structure of the paper, where we present step by step our generalization of the basic structural elements of the theory of quasi-symmetric and non-commutative symmetric functions showing similarities and differences with the original theory. In introductory Section 2 we recall necessary elements of the theory of graded Hopf algebras. As basic example we take the free Hopf algebra over finite alphabet, the Hopf algebra of quasi-symmetric functions, and their duals -the shuffle algebra and the algebra of non-commutative symmetric functions. We pay also special attention to the Hopf algebra of rooted ordered coloured trees, closely related to the algebraic renormalization procedure of the quantum field theory.
Then in Section 3 we study in detail the Hopf algebra of sentences (coloured compositions or tall trees), the partial order in the set of sentences, and we provide briefly an interpretation of the sentences as words of certain basic context-free language. Then we change slightly our point of view by presenting the sentences over alphabet A as the analog of the complete homogeneous basis in our coloured noncommutative generalization NSym A of the Hopf algebra of symmetric functions. Then we introduce the corresponding analog of the basis of elementary functions and discuss coloured version of the standard formulas describing mutual interrelation between the complete homogeneous and elementary functions.
We devote Section 4 to description of the Hopf algebra QSym A of coloured quasi-symmetric functions as graded dual of NSym A . We define first the basis of coloured monomial quasi-symmetric functions in the standard way as the dual basis to the coloured complete homogeneous functions. Then we construct its 'polynomial' realization in terms of certain power series of bounded degree in partially commuting variables. Such a partial commutativity is completely new ingredient of our generalization of the theory of quasi-symmetric functions. We remark that partially commutative variables have been introduced to study combinatorial problems by Cartier and Foata in [11]. They also have found applications in algebra, theory of orthogonal polynomials, statistical physics and computer science; see review by Viennot [77] written in terms of heaps of pieces. In theoretical computer science, as was proposed by Mazurkiewicz [60], they describe concurrent computations. We would like to stress that both algebras NSym A and QSym A are non-commutative and non-cocommutative for |A| > 1.
Sections 5 and 6 are devoted to presentation of the coloured generalization of other rudimentary elements of the theory of symmetric functions. We define and study the fundamental basis of QSym A and its dual basis in NSym A of coloured non-commutative ribbon Schur functions. Finally we construct the coloured non-commutative version of the power sum symmetric functions. In Section 6 we extended also the algebra of trees to its infinite series version working within the setting of the restricted dual Hopf algebras. This point of view was useful in studying the coloured non-commutative power sum functions, but certainly deserves deeper studies in the context of applications of combinatorial Hopf algebras to integrable systems and theoretical physics.
Acknowledgements. The research was supported by National Science Centre, Poland, under grant 2015/19/B/ST2/03575 Discrete integrable systems -theory and applications.

Hopf algebras of trees and quasi-symmetric functions
We assume that the Reader is familiar with the basic definitions and properties of Hopf algebras, as covered in [1] or [75]. All the results presented in this Section are known, but we recall them to provide necessary terminology and background to formulate new ones in the next Sections. In the paper all algebras are over a fixed field k of characteristic zero, although sometimes a commutative ring may be enough.
2.1. Hopf algebras. By (H, µ, η, ∆, ) denote a bialgebra which is: (1) an associative algebra (H, µ, η) consisting of k-linear multiplication µ : H ⊗ H → H and k-linear unit map η : k → H satisfying properties described by the diagrams: (2) a co-associative coalgebra (H, ∆, ) consisting of k-linear comultiplication ∆ : H → H ⊗ H and k-linear counit map : H → k satisfying properties described by the diagrams: Bialgebra H is graded if it is graded as k-module H = n≥0 H (n) with the structure maps respecting the gradation The space of k-linear operators End(H) can be equipped with the convolution product : Such a product is associative with neutral element η • . A bialgebra H is called a Hopf algebra if there is an element S ∈ End k (H), called antipode, which is two-sided inverse under for the identity map id H , which means When it exists, the antipode S is unique and is algebra anti-endomorphism: S(1) = 1, and S(ab) = S(b)S(a) for all a, b ∈ H. It is known [61,76] that any graded connected bialgebra is a Hopf algebra.
In that case the antipode of any homogeneous element x ∈ H (n) of degree n > 0 can be calculated recursively by and y i , z i have degrees less then n.
. . , a m } be a finite set, called alphabet, whose elements will be called letters.
A finite sequence of letters is called a word. The set of all words on A is denoted by A * (the Kleene closure operation * used here shouldn't be confused with the duality sign) and turns out to be free monoid with the concatenation product (denoted by dot "." but usually omitted). The empty sequence plays the role of the neutral element of multiplication and will be denoted by 1. Consider free algebra k A = (kA * , . ), whose linear basis consists of words, and the multiplication is given by concatenation of words, extended by linearity. The unique compatible comultiplication and counit in k A is given on letters a i ∈ A by and extended by homomorphism to words and by linearity to the whole algebra. Given word w = a i1 . . . a in we have then where the multiindex J = (j 1 , j 2 , . . . , j k ) is a subsequence of (i 1 , i 2 , . . . , i n ), w J = (a j1 a j2 . . . a j k ), and wJ is defined analogously for the complementary subsequenceJ. The algebra is cocommutative, graded with gradation being the length of words |a i1 . . . a in | = n, locally finite and connected. The antipode on words reads S(a i1 . . . a in ) = (−1) n a in . . . a i1 .
Two Hopf k-algebras A, B are dually paired by a map , : which is then extended to tensor products pairwise. This means that the product of A and coproduct of B are adjoint to each other under , , and vice-versa. Likewise, the units and counits are mutually adjoint, and the antipodes are adjoint. In such case any subalgebra of A gives rise to the corresponding quotient algebra in B.
When the Hopf algebra H is finite dimensional then the natural pairing between the k-module H and its dual H * allows to introduce on the latter the dual Hopf algebra structure. When H is infinite dimensional then there is no such general construction, which is caused by the fact that the inclusion H * ⊗ H * ⊂ (H ⊗ H) * fails to be equality. For connected graded Hopf algebra H = n≥0 H (n) which is locally finite (each homogeneous component H (n) is finite dimensional), one can define its graded dual as H gr = n≥0 H (n) * which has the property that H gr ⊗ H gr = (H ⊗ H) gr and (H gr ) gr ∼ = H. Then H gr ⊂ H * is a Hopf algebra where the evaluation map H gr ⊗ H → k provides a duality pairing of H with H gr .
Remark. In Section 6 we will consider also another construction of a dual Hopf algebra, called the restricted (or Sweedler's) dual [1,75].
Example 2.2. The graded dual do the Hopf free algebra k A is described as follows. By standard abuse of notation one identifies a fixed linear basis of a finite dimensional space with its dual. The dual (deconcatenation) coproduct δ is given on words by The corresponding product (called shuffle product) dual to the coproduct ∆ is given by where summation is over all sequences I = (k 1 , k 2 , . . . , k n ) such that (i 1 , i 2 , . . . , i k ) ⊂ I is its subsequence, and (j 1 , j 2 , . . . , j l ) is the complementary subsequence. The unit, counit and antipode in the graded dual are the same as in the previous example.
Remark. It is known [51] that the shuffle product of words can be defined recursively for all words u, v and all letters a, b by Remark. To distinguish between the free Hopf algebra and its graded dual, we denote them by (kA * , ., ∆) and (kA * , , δ) respectively, skipping the unit and counit symbols.

2.2.
Hopf algebra structures on rooted ordered coloured trees. Below we present (slightly reformulated -see the first Remark after Proposition 2.1) results by Foissy [28] relevant to our paper. A rooted ordered tree (called also rooted plane tree) is a finite rooted tree t such that for each vertex v of t, the children of v are totally ordered (from left to right on our pictures). Together with the depth partial order (defined by the distance from the root) this induces linear order on the vertex set V (t) of the tree obtained from left-to-right depth-first search; see Figure 1. By the trivial rooted tree we understand the tree consisting of the root only. A planted rooted tree is a non-trivial rooted tree such that its root has only one child. A rooted ordered coloured (ROC) tree is a rooted tree t together with a function from a set E(t) of its edges to the set A of colours, we assume |A| < ∞. By kT A denote the linear space of finite formal combinations of A-coloured rooted ordered trees with coefficients in the field k. The space kT A is graded with the weight |t| of a ROC-tree t being the number of its edges A . By the well known connection [73] between rooted ordered trees and Catalan numbers C k , dimension of each graded component kT Define the product "·" on kT A as the concatenation of trees by identification of their roots; see Figure 2 for an example. The product respects the gradation, is associative with the trivial tree t being  In order to define compatible coproduct on kT A one has first to describe the operation of pruning of a tree. A rooted subtree t s of a ROC-tree t is called admissible if it shares the root of t. Such an admissible subtree is again ROC-tree with the root, order and colours inherited from t. The set of admissible subtrees of t (including the trivial tree and t itself) will be denoted by A(t). Given such admissible subtree t s ⊂ t it defines a sequence (t 1 , . . . , t m ) of planted trees being branches of t pruned to get t s , with the order in the sequence inherited from the order on t. By concatenation of the pruned branches we obtain the complementary tree t c = t 1 · . . . · t m to the admissible subtree t s of t. Such a pruning operation gives an element t c ⊗ t s ; see Figure 3 for an example.
The coproduct of a tree is defined as sum of pairs t c ⊗ t s for all admissible subtrees of t; see Figure 4 (2.17) and then extended to kT A by linearity. Figure 4. The pruning coproduct of a ROC-tree Such coproduct is coassociative, respects the gradation, and is compatible with the counit defined on trees as In this context it is convenient to define the operation B + i of planting of a tree on a new root by attaching it to the old one by additional edge coloured by i. In particular, planting allows to define the coproduct recursively starting from ∆( t ) = t ⊗ t , and using then the formula , together with compatibility of the coproduct ∆ with the concatenation product. Equation (2.19) has the following simple meaning: apart from the trivial subtree, all admissible subtrees of a planted tree contain the lowest (i.e. incident to the root) edge.
Proposition 2.1. The concatenation multiplication and pruning coproduct with the corresponding unit and counit maps equip kT A with the structure of graded locally finite and connected bialgebra (thus Hopf algebra).
Remark. The above result was given by Foissy [28] in the equivalent setting of the rooted ordered vertex-coloured (or decorated) forests. Any ROC tree is uniquely mapped, by deletion of the root, to an ordered forest colouring first its vertices using colours of adjacent edges below them; see the bijection map visualized on Figure 5. This notation resulted as decorated and non-commutative version of the Connes-Kreimer Hopf algebra [13] used to explain the renormalization procedure in the quantum field theory. Remark. In [28] one can find, among others, also the corresponding description of the antipode, which can be transferred from the ROD-forests to ROC-trees.
Corollary 2.2. The subalgebra of kT A generated by one-edge planted trees a i = B + i ( t ) is a Hopf subalgebra isomorphic to the free Hopf algebra described in Example 2.1.
We conclude this Section by presenting the graded dual of the Hopf algebra of ROC-trees, which is again reformulation of the corresponding results of [28]. Because the natural basis of the finite dimensional subspace kT (k) A is provided by ROC-trees of weight k it seems natural to represent the dual basis of (kT 0 otherwise by standard abuse of notation is identified with t. The dual (deconcatenation) coproduct δ = (.) * to the concatenation product acts on trees as i.e. when t = t 1 . . . t m is planted trees decomposition, then see Figure 6. Figure 6. The deconcatenation coproduct of a ROC-tree Corollary 2.3. Equation (2.21) implies the following matching condition between the deconcatenation coproduct and the concatenation product where, by the standard abuse of notation, we extended the product sign from kT A to kT A ⊗ kT A .
The (asymmetric shuffle or grafting) product T = ∆ * , dual to the pruning coproduct satisfies and is defined with the help of the grafting procedure that follows from comparison of equations (2.17) and (2.24). Given ROC-tree t = t 1 . . . . , t m decomposed into the planted factors, its (non-unique) grafting on ROC-tree t is defined as attaching roots of the factors t i to vertices of t in a way, which preserves the original ordering of the factors. In other words, a grafting of t on t gives a treet such that there exists a pruning with t =t s with the corresponding t =t c ; see Figure 7 for an example.
With the grafting product T , deconcatenation coproduct δ, the unit η = * and counit = η * maps, Figure 7. The asymmetric shuffle (or grafting) product of two ROC-trees; grafted branches are thickened the space spanned by ROC-trees is equipped with another bialgebra (thus Hopf algebra) structure -the graded dual to the previous one.
Remark. It is remarkable fact, discovered by Foissy [28], that the duality described above is self-duality. The situation is analogous to the well known self-duality of the Hopf algebra of symmetric functions [73].

2.3.
Hopf algebra of quasi-symmetric functions, and its graded dual. Let x = (x 1 , x 2 , x 3 , . . . ) denote infinite totally ordered set of commuting variables, and let k[[x 1 , x 2 , x 3 , . . . ]] be the algebra of formal power series of bounded degree. Such a formal series is called quasi-symmetric function if the coefficient of any term The linear space QSym of quasi-symmetric functions has as a basis the monomial quasisymmetric functions indexed by compositions. Recall that a composition of m, written α |= m, is a finite sequences of positive integers α = (α 1 , α 2 , . . . , α k ) such that |α| = α 1 + α 2 + · · · + α k = m. In this case we say that α has k parts, or it is of length (α) = k. The elements of the basis are of the form where the sum is over all k-tuples (i 1 , i 2 , . . . , i k ) of strictly increasing; by definition M ∅ = 1. The algebra QSym is graded with each graded component QSym (m) spanned by those M α for which |α| = m. By the well known bijection [52] any such composition can be identified with a subset We can put a partial order on the set of all compositions of m by refinement. The covering relations are of the form This allows to define another important basis formed by the fundamental quasi-symmetric functions, also indexed by compositions By inclusion-exclusion we can express the M α in terms of the F α The product in QSym, inherited from the standard multiplication of power series, can be described in the basis (M α ) in terms of the quasi-shuffle (or overlapping shuffle) Q of compositions: in addition to shuffling components α i and β j of two compositions α = (α 1 , . . . , α k ) and β = (β 1 , . . . , β l ) we may replace any number of pairs of consecutive components α i and β j in the shuffle by their sum α i + β j where γ is a summand in quasi-shuffle of α and β.
The coproduct δ in the algebra of quasi-symmetric functions can be defined using the doubling variables trick. Here to the totally ordered set of variables x = (x 1 , x 2 , x 3 , . . . ) we add its copy y = (y 1 , y 2 , y 3 , . . . ) placing elements of y after elements of x, and getting the ordered sum of the sets of variables. To obtain the coproduct δ(f ) of a quasi-symmetric function f we expand the function over the doubled variables, decompose resulting expression into sum of products of functions of x and y getting this way In the basis of monomial quasi-symmetric functions (M α ) the coproduct formula reads where β · γ is concatenation of two compositions. As a result we obtain graded, locally finite and connected bialgebra (thus Hopf algebra) which is commutative but not cocommutative.
getting this way The graded dual to QSym is called the Hopf algebra of non-commutative symmetric functions [31] and denoted by NSym. Let (H α ) be the dual basis to (M β ) then by dualization of equations (2.30) and (2.33) we obtain the product and coproduct formulas in NSym where α can be obtained as a summand in quasi-shuffle of β and γ. In particular, for a composition α = (α 1 , . . . , α k ) one has This leads to the conclusion that, as algebra, NSym is freely generated by non-commuting elements H 1 , H 2 , . . .
The coproduct formula for the generators follows from equations (2.36) and reads Remark. It is known [38] that the Hopf algebra NSym is isomorphic to a Hopf subalgebra of rooted ordered (monochromatic) trees generated by (B + ) m ( t ) ↔ H m , where in the monochromatic |A| = 1 case we skip the lower index i = 1 describing the colour of the attached edge.
Remark. One can recapitulate this Section in the spirit of Examples 2.1 and 2.2 that we presented two, mutually dual, Hopf algebra structures in the space of compositions. Similarly to the shuffle product of words, the quasi-shuffle of compositions can be defined recursively [37] for all compositions α, β and all natural numbers k, l by 3. The Hopf algebra of coloured non-commutative symmetric functions 3.1. The Hopf algebra of sentences. Given finite set A = {a 1 , . . . , a n } called alphabet, and whose elements are called letters. Words are finite sequences of letters (written without separation), sentences are finite sequences of words (instead of spacing to separate them we use commas). The size of a word w = a i1 . . . a i k is the number |w| = k of its letters, the size of a sentence I = (w 1 , w 2 , . . . , w m ) is the sum |I| = |w 1 | + |w 2 | + · · · + |w m | of sizes of its words, while the length of the sentence is the number (I) = m of its words. The maximal word of the sentence is the concatenation w(I) = w 1 w 2 . . . w m of all its words. Remark. For unary alphabet A = {a} we will identify words with their size, and then identify sentences with corresponding compositions, for example (aaa, aa, aaa) ←→ (3,2,3). Speaking about colours in the place of letters, instead of sentences we may use the notion of coloured compositions.
Given two sentences I, J, we say that I is coarsening of J (or equivalently, J is refinement of I), denoted by I J, if we can obtain the words of I by concatenation of adjacent words of J. For example (aba, ca, bac) (ab, a, ca, ba, c). With the refinement order, the poset of sentences having the same maximal word w is isomorphic to the poset of compositions of |w|, and therefore isomorphic (recall the bijection set mentioned in Section 2.3) to the (dual of the) Boolean poset of {1, 2, . . . , |w| − 1}. This  Define also two involutions acting on sentences: reversal and complement. The reversal of I, denoted by I r is obtained by writing the words of I in the reverse order The complement of I, denoted by I c is the sentence with the same maximal word as I but whose image under the map set is the complementary subset of {1, 2, . . . , |I| − 1}. Equivalently, in the maximal word w(I) we put separating commas between letters if there was no comma between the letters in I. We may represent sentences in terms of ribbons placing its words in subsequent rows such that the first letter of the next word is exactly below the last letter of the previous one. Then the ribbon diagram of I c is obtained by transposition of the ribbon diagram of I, see Figure 9.
From yet another point of view, we may identify words with the so called planted tall trees (or ladders) . Then sentences are in correspondence with concatenations of such trees, see Figure 10 for an example.  Figure 9. The ribbon diagrams of the sentence (aba, ca, bac) and of its complement • production rules Roughly speaking, the second rule produces words, while the first rule builds sentences from words. The relation of the Hopf algebra of trees and its subalgebras to context-free languages will be presented in another publication.
Example 3.3. The element of the context-free language described above, which corresponds to the sentence (aba, ca, bac) isābāabaāccacābbac.
Notice that since an admissible subtree of a tall tree and its complementary tree are also of such form then the pruning coproduct (2.17) of tall trees doesn't lead out of that space. Remark. To avoid confusion we recall that the empty sentence, in accordance to our previous notation, is denoted by by 1, the corresponding empty composition was denoted previously by ∅, and the corresponding trivial tree by t .   Figure 4 reads in the present setting as follows Remark. As the above Example shows, the comultiplication in the Hopf algebra of sentences is not cocommutative.
Corollary 3.5. The bialgebra of sentences over alphabet A is graded, with the weight of a sentence being its size, locally finite and connected (thus Hopf algebra). The dimension of the graded component consisting of sentences of size m > 0 is |A| m 2 m−1 .
Corollary 3.6. The action of the comultiplication on single-word generators reads as follows Remark. In the present setting the free Hopf algebra of Example 2.1 should be identified with the subalgebra of sentences built out of single-letter words, see also Corollary 2.2.
In [28] one can find also detailed description of the antipode of the Hopf algebra of ROD-forests, which can be used to define the antipode of the Hopf algebra of tall trees, and thus to transfer it into the language of the Hopf algebra of sentences. To make the paper self-contained we perform below the corresponding calculation from scratch avoiding this route.  Proof. We will show first that the above formula gives the antipode for single-word sentences, which generate the algebra of sentences. The coproduct formula (3.9) and equation (2.6) give the recurrence relation which, in particular, for k = 1 gives the correct formula Assume that the expression for the antipode holds true for generators indexed by single-word sentences of size not greater than k, then for k + 1 we have which gives the correct expression, because we separated the last word of the sentence refining (a i1 a i2 . . . a i k+1 ). By the anti-endomorphism property of the antipode we have what concludes the proof.
Remark. In [2,5,41,58,67] another notion of coloured compositions is considered. In our approach such a variant corresponds to sentences made of words with definite colours, for example (bbb, a, bb, cccc). Because concatenation and pruning operations leave such property untouched one obtains this way a Hopf subalgebra of that introduced in this Section. Notice [41] that the dimension of the graded component consisting of such compositions/sentences of size m > 0 is |A|(|A| + 1) m−1 , to be compared with the dimension calculated in Corollary 3.5.

3.2.
Coloured non-commutative symmetric functions. Because of the isomorphism of the Hopf algebra of sentences on unary alphabet with the Hopf algebra NSym of non-commutative symmetric functions, the algebra of sentences over alphabet A can be also called the algebra of coloured noncommutative symmetric functions, and denoted by NSym A . We will discuss also other bases of NSym A indexed by sentences, therefore the linear basis of sentences will be denoted from now on by (H I ) and called the basis of complete homogeneous coloured non-commutative symmetric functions. The multiplication, comultiplication and the antipode in the new notation read      Because for |A| > 1 the Hopf algebra NSym A is both non-commutative and non-cocommutative we cannot expect that the antipode is an involution. It turns out that its superposition with the reversal is.
Proposition 3.11. In the Hopf algebra NSym A of coloured non-commutative symmetric functions Proof. Notice first that In particular, we have two recurrence formulas which start from E 1 = 1, and read Finally we present formula for their coproduct.  Proof. It is enough to prove the second equation, because then Proposition 3.8 implies the first one.
Since it holds for k = 1, then we can start induction by applying the coproduct operation on the recurrence (3.32). Using the homomorphism property of the comultiplication we can expand corresponding expressions and collect coefficients at various terms of consecutive degrees on the right hand side of the tensor product sign. By the recurrence relations (3.32) most of them vanishes, and what remains gives equation (3.34).
Example 3.6. To calculate the coproduct of There is only one term (. . . ) ⊗ 1 of the right degree zero. Its coefficient is E Remark. Notice that, contrary to the unary (monochromatic) case |A| = 1, for |A| > 1 the coproduct formulas for single-word coloured non-commutative complete and elementary symmetric functions are not the same.

Coloured quasi-symmetric functions
In this Section we study basic properties of the graded dual to the Hopf algebra NSym A , which we later will call the Hopf algebra of coloured quasi-symmetric functions, and denote by QSym A . In particular, we introduce the dual basis to complete function basis (H I ), which will be called later the basis of coloured monomial quasi-symmetric functions. Then we will provide a realization of the algebra QSym A in terms of series of bounded degree with partially commuting variables. In particular, elements of the dual basis indexed by single-word sentences are primitive elements of the coproduct. The product in (NSym A ) gr can be defined directly by dualization of the pruning coproduct of tall trees described in the basis of complete functions by formula (3.16). Equivalently, it can be described in terms of the original grafting product of trees and the dual to the injection map NSym A → kT A . It is therefore restriction of the grafting product from ROC-trees to tall trees, i.e. we can graft planted tall trees at the root or on the top of another such tree, with the restriction that two trees cannot be grafted on the same top. The geometric procedure on the level of trees is the same as that in the monochromatic case, so we keep the same name and symbol of the quasi-shuffle product. Quasi-shuffle I Q J of two sentences I = (u 1 , u 2 , . . . , u k ) and J = (v 1 , v 2 , . . . , v m ) is thus the sum of shuffles of components u i and v j of I and J, where in addition we may replace any number of pairs of consecutive words u i , v j in the shuffle by their concatenation u i v j . It can be represented, compare with [52], by a path in the lattice of size k × m from the left bottom corner to the right top corner with horizontal steps (1, 0) representing words u i , vertical steps (0, 1) representing words v j and oblique steps (1, 1) representing words u i v j , see Figure 11 for an example.  Figure 11. The lattice for quasi-shuffle product of (u 1 , u 2 ) and Therefore we have (compare with equation (2.30)) where K can be obtained as a summand in quasi-shuffle of I and J. By dualizing the coproduct formula (3.16) we can see that there exists week sentence J ⊂ K such that J = J and I = K \ J .
Remark. Similarly to the quasi-shuffle product of compositions, the quasi-shuffle of sentences can be defined recursively for all sentences I, J and all non-empty words u, v by Example 4.1. The quasi-shuffle product of two tall trees takes the form given in Figure 12, and the product of corresponding monomial functions reads a,b) , compare also with Figure 7 describing the asymmetric shuffle product of the same trees. Remark. We have equipped the space of sentences over A with the dual Hopf algebra structure, graded dual to that described in Section 3.1, with quasi-shuffle product and deconcatenation coproduct. Being dual to non-commutative and non-cocommutative Hopf algebra the new algebra, for |A| > 1, is also both non-commutative and non-cocommutative.
Let us calculate the number of quasi-shuffle paths with prescribed number of oblique steps, which will be used in Section 6.3.
Proof. Two quasi-shuffle paths are called to have the same shuffle part if they coincide after contracting all the oblique segments (1, 1), see Figure 13 for an example. Decomposition of the set of paths with exactly i oblique segments into disjoint classes having the same shuffle part, and then fixing location of the segments, gives the first part of formula (4.5). Two other expressions, which can be derived by simple algebra, also have combinatorial interpretation . The second/third one means that the path can be encoded by first fixing columns/rows for the oblique segments (1, 1), and then by choosing which steps of the path are vertical/horizontal segments (0, 1)/(1, 0).  (x a,1 , x a,2 , x a,3 , . . . ) denote infinite totally ordered set of variables, each of degree 1, define also x A = a∈A x a . We assume partial commutativity of the variables, i.e. within each set the variables commute, but for different colours commutativity is allowed for different second indices only We will consider a subset QSym A of the algebra k[x A ] of series of bounded degree with natural multiplication, which can be described as follows. Due to partial commutativity any monomial in variables x a,i can be uniquely reordered in such a way that the second indices of variables form weakly increasing (finite) sequence, say i 1 ≤ i 2 ≤ · · · ≤ i k . Given word w = a i1 a i2 . . . a i k and given j ∈ N, by x w,j denote monomial of degree |w| (4.7) x w,j = x ai 1 ,j x ai 2 ,j . . . x ai k ,j , for example x abb,2 = x a,2 x 2 b,2 . From the other side, given reordered monomial x w1,j1 x w2,j2 . . . x wm,jm with j 1 < j 2 < · · · < j m by its sentence we mean (w 1 , w 2 , . . . , w m ). A formal series belongs to QSym A when its coefficients in front of monomials with the same sentence coincide.
It is easy to see that the set QSym A is in fact linear space with basis indexed by sentences. In fact, given sentence I = (w 1 , w 2 , . . . , w m ), by M I denote the infinite series of the finite degree |I| x w1,j1 x w2,j2 . . . x wm,jm , which will be called a coloured monomial quasi-symmetric function.
Example 4.2. Consider product of two such series which after the reordering reads and compare with Example 4.1 or Figure 12. To define the coproduct δ in QSym A we use the doubling variables trick described in Section 2.3, i.e. to the set of variables x A we add its copy y A . We place the new variables after the old ones, what in particular implies that the new and old variables commute and allows to separate the variables in the reordering process.  → x a,1 x b,1 x b,2 + · · · + x a,1 x b,1 y b,1 + · · · + y a,1 y b,1 y b,2 + · · · = = M (ab,b) (x) + M (ab) (x)M (b) (y) + M (ab,b) (y), getting this way  Proof. It is enough to consider how the variables doubling works for the monomial x w1,1 x w2,2 . . . x wm,m . Finiteness of the size of the sentence assures finite sum decomposition.
Remark. There is no need to check coassociativity of the coproduct in QSym A or its compatibility with the (quasi-shuffle) product, because this holds by definition of (NSym A ) gr .
Finally let us present the formula for the antipode S * in the monomial basis of QSym A . By dualizing the corresponding formula (3.17) for the antipode S in the complete basis of NSym A we get which for unary words (i.e. usual compositions) reduce to that found in [57,26]. and extend them to QSym A by linearity.

The fundamental basis of QSym A and its dual basis in NSym A
In this Section we define and study another basis of the Hopf algebra of coloured quasi-symmetric functions QSym A , which is the analog of the fundamental basis [72,26]. Then we consider the dual basis in NSym A to the coloured fundamental functions, which can be called the basis of coloured ribbon non-commutative Schur functions. what shows that the fundamental functions form a linear basis in QSym A . Let us find expressions for coproduct, product and the antipode of QSym A in the fundamental basis.
Proposition 5.1. The coproduct in the fundamental basis where the summation is over pairs of sentences which give the indexing sentence I by concatenation or the near-concatenation.
Proof. By definition (5.1) and coproduct formula (4.9) in the monomial basis, and grouping terms where the sum is over the pairs (K , K ) which give splitting of I into two parts. The segmentation may be either between words of I or in the middle of a word. The first case gives I = K · K , while the second one gives I = K K . In order to describe multiplication in the fundamental basis notice that in multiplying F I and F J we multiply M I and M J for any I I and J J. Then we group monomial functions into the fundamental ones. This procedure leads to definition of the fundamental shuffle I F J of sentences described as follows.
(1) perform ordinary shuffle of letters of maximal words of both sentences, (2) concatenate neighboring letters of words of I, and concatenate neighboring letters of words of J, (3) concatenate pairs of neighboring subwords of words of I and J (in this order), which gives directly the desired formula.
Proposition 5.2. Multiplication of two fundamental functions is given by where sentence K is a summand of I Remark. In passing to the unary alphabet we obtain the corresponding multiplication formula for the fundamental quasi-symmetric functions [73,33]. Because the same structure of posets of compositions and of sentences the proof presented there can be transferred also to our context. One has to label letters of the maximal words of the two sentences by integers, whose descent sets model the separation of letters into words.
where the last sum is over sentences J which refine simultaneously K and I. By properties of the Moebius function of the poset of such refinements the sum doesn't vanish only if the poset consists of one element only, which must be therefore the sentence of one-letter words. In this case (J) = |I| and K must be a refinement of the complement of I, i.e. K I c . This gives the corresponding version of monochromatic formulas of [26,57]  As an exercise we recommend for the interested Reader to perform the calculation in the monomial basis. In the monochromatic case such basis was introduced in [31] as a non-commutative analog of the ribbon Schur functions [54]. Corollary 5.7. The dual version of Proposition 5.2 gives the comultiplication in the ribbon basis

Coloured ribbon non-commutative Schur functions. Consider the basis (R I ) in NSym
Example 5.4. Both calculations using the complete basis expansion (5.15) with the corresponding coproduct formula (3.16) or the above Corollary and definition of the fundamental shuffle give In particular, we have In the monochromatic case there exists [33] a convenient formula, of the form (5.8), expressing the coproduct in the ribbon basis. Because in the coloured case taking refinements does not commute with reversal we can provide only the following result.
Corollary 5.8. The dual version of equation (5.8) reads as follows Proof. This can be shown by dualization of equation ( Above we sum up with respect to all sentences K having the same maximal word w(I), and the inner sum is over sentences J which coarsen simultaneously K and I. This sum doesn't vanish only when this poset of sentences is trivial what happens only if K coarsens the complement of I. In this case J is the single-word sentence, thus (J) = 1. To conclude the calculation we notice that (I)+ (I c ) = |I|−1.

Formal series of trees and coloured non-commutative power sum functions
Up to now we considered the duality problem for infinite-dimensional Hopf algebras in the graded case only. Another option to tackle the problem is to define [1,75] the restricted (or Sweedler's) dual of H which is the subspace H • ⊂ H * consisting of all linear maps f that satisfy one of equivalent conditions: 6.1. Formal series of ROC trees. In this Section we consider power series of trees as the linear dual to space of rooted ordered coloured (by A) trees kT A . A formal tree series F is function T A → k extended to kT A by linearity. The image by F ∈ (kT A ) * of a tree t ∈ T A is denoted by F, t and is called the coefficient of t in T . The support of F is the subset of T A Polynomials kT A ⊂ (kT A ) * are embedded naturally as series with finite support. Usually one writes remembering that the sum has a finite support.
Remark. Notice that, by the standard coding of trees by (coloured) Dyck words [73], any such series of trees can be interpreted as a series of words within theory of non-commutative power series [69]. As it was mentioned in Corollary 3.2, our description of the algebra NSym A can be stated in terms of a certain context-free language.
Remark. If k is equipped with discrete topology, then the set of formal tree series can be equipped with the product topology. A sequence of its elements converges only if for each tree the corresponding coefficient stabilizes.
Actually, two products of such series are well defined: • the extension of the concatenation product "." of trees (i.e. the Cauchy product of series) • the extension of the grafting product T of trees The tensor product F ⊗ G ∈ (kT A ) * ⊗ (kT A ) * of two series reads The deconcatenation coproduct extended from tree polynomials to series is in general an element of (kT A ⊗ kT A ) * . A series F which allows for finite decomposition is an element of the restricted dual (kT A , . , ∆) • . The pruning coproduct of a tree series can be defined analogously Let us describe a distinguished example of two of such tree series. By F * let us denote the characteristic series of the set of all ROC trees, i.e. F * = t∈T A t, and by F = t∈T A t denote the characteristic series of the subset T A of planted trees. Relations between these series can be written down as follows: (i) an arbitrary planted tree is obtained by action of the operator B + i , i = 1, 2, . . . , |A|, on the corresponding tree (6.10) (ii) any non-trivial tree can be uniquely decomposed into concatenation product of planted trees (this justifies our notation) Remark. Equations (6.10)-(6.11) expresses the standard grammar rules of the |A|-th Dyck language [69].
Remark. By combining equations (6.10) and (6.11) we obtain a single equation for series F in the form of the combinatorial Dyson-Schwinger equation [8,29].
Proposition 6.1. The series F and F * are elements of the restricted dual (kT A , . , ∆) • of the Hopf algebra of rooted ordered coloured trees, in particular F is primitive element and F * is group-like Proof. Equation (6.13) follows from the analogous result valid for any planted tree t ∈ T A When t ∈ T A is a planted tree and t ∈ T A is an arbitrary tree then by Corollary 2.3 which by linearity leads to the following equation on the level of the corresponding series (6.16) δ(F.F * ) = t ⊗ (F.F * ) + (F ⊗ t ).δ(F * ).
Corollary 6.2. Any series, whose support is a subset of planted trees T A is primitive element of the restricted dual.
Remark. Notice that Corollary 2.3 implies the following matching condition between the cut comultiplication δ and the Cauchy product of two series G and H of trees in the restricted dual 6.2. Formal series of tall trees. By H * = I I denote the characteristic series of the set of coloured tall trees (indexed by sentences over A) and by H = w∈A * \{1} (w) denote the characteristic series of planted coloured tall trees (indexed by single word sentences). The planting operator B + a , a ∈ A, acts on single word sentence (w) by forming the single word sentence (wa). Properties of the series can be stated as follows: (i) an arbitrary planted tall tree is obtained by action of the operator B + i , i = 1, 2, . . . , |A| on the trivial tree or on the corresponding smaller planted tall tree The following result can be proven in the same way like the previous Proposition 6.1. where F (w) is the fundamental function indexed by the corresponding single-word composition, and apply Proposition 5.3.
Because bases of both algebras NSym A and QSym A are indexed by sentences one can apply also the pruning coproduct ∆ on series of tall trees. In particular, we will show that the series H can be considered as an element of the restricted dual (QSym A ) • . From now on we use the notation of the theory of the non-commutative coloured symmetric functions. Therefore, summing up with respect to the arbitrary prefix (u) first, we can write where for any subset L ⊂ A * by definition [55] u −1 L = {v | uv ∈ L}. Proof. The first part follows directly from the definition of P , where we recall that the length (I) of the sentence I is the number of its words. For the second part we provide two proofs. The first one follows the corresponding reasoning [57] in the monochromatic case. The second proof is of elementary combinatorial nature. I. By linearity and morphism property of ∆ with respect to the concatenation product, and using Corollary 6. where we also used the standard property of logarithm for commuting factors.
II. By the basic coproduct formula (3.16) applied to equation (6.31) we can see that where we sum with respect to the sentences I which give J ⊗ K upon action of the coproduct, i.e. I is a summand in the quasi-shuffle J Q K. Interpretation of such terms as special paths in the lattice (J) × (K), and application of Proposition 4.1 implies that the weighted alternating sum we are looking for equals (without losing generality we assume (K) ≥ (J)) which vanishes by standard application of the inclusion-exclusion principle.
Finally, we define the coloured non-commutative analogs of the power sum symmetric functions. By splitting series P into parts with the same maximal words, see Corollary 3.1, we obtain from equation (6.31) Here |w|P (w) are coloured analogs of the non-commutative power sums of the second kind defined in [31]. For trivial sentence define P 1 = 1, and for any non-empty sentence I = (w 1 , w 2 , . . . , w (I) ) define (6.36) P I = P (w1) P (w2) . . . P (w (I) ) . Proof. By the standard relation between exponential and logarithm, valid also for formal non-commuting series, we have As the above example demonstrates, contrary to the monochromatic/unary case the coloured power sum functions are in general not primitive elements of the Hopf algebra NSym A . However, by splitting equation (6.32) into homogeneous parts we obtain the following weaker result, which provides infinite number of primitive elements of the algebra. Corollary 6.9. For n ∈ N define P n = |w|=n P (w) then (6.39) ∆(P n ) = 1 ⊗ P n + P n ⊗ 1.