[proofplan]
We use the Fine-Bayer-Klapper characterization of the Eulerian part of the ab-polynomial space: a homogeneous ab-polynomial satisfies the [generalized Dehn-Sommerville relations](/theorems/8119) exactly when it is obtained from a cd-polynomial by the substitution $c=a+b$ and $d=ab+ba$. Since $P$ is Eulerian, its ab-index satisfies those relations by the Bayer-Billera generalized Dehn-Sommerville relations. This gives existence after defining the substitution map on the weighted homogeneous cd-polynomial space. Uniqueness follows by proving directly that this substitution map is injective, using leading ab-words of cd-monomials.
[/proofplan]
[step:Place the ab-index in the Eulerian subspace of homogeneous ab-polynomials]
Let $\mathbb Q\langle a,b\rangle_n$ denote the $\mathbb Q$-[vector space](/page/Vector%20Space) of homogeneous noncommutative polynomials of total degree $n$ in the noncommuting variables $a$ and $b$. By the definition of the ab-index for a ranked poset of rank $n+1$, the polynomial
\begin{align*}
\Psi_P(a,b)\in \mathbb Q\langle a,b\rangle_n
\end{align*}
is homogeneous of degree $n$.
Since $P$ is Eulerian, its flag $f$-vector satisfies the Bayer-Billera generalized Dehn-Sommerville relations by [citetheorem:8118]. Equivalently, when those relations are translated from flag $f$-coordinates to the ab-monomial coordinates of the ab-index, $\Psi_P(a,b)$ satisfies the generalized Dehn-Sommerville relations in $\mathbb Q\langle a,b\rangle_n$.
[guided]
We first identify the vector space in which the problem takes place. Let $\mathbb Q\langle a,b\rangle_n$ be the $\mathbb Q$-vector space spanned by all words of length $n$ in the two noncommuting letters $a$ and $b$. The ab-index of a ranked poset of rank $n+1$ is, by definition, a homogeneous polynomial of degree $n$ in these two letters, so
\begin{align*}
\Psi_P(a,b)\in \mathbb Q\langle a,b\rangle_n.
\end{align*}
The hypothesis that $P$ is Eulerian is used precisely here. For Eulerian posets, the flag $f$-vector satisfies the Bayer-Billera generalized Dehn-Sommerville relations, by [citetheorem:8118]. The ab-index is a linear repackaging of the same flag-enumeration data into the word basis of $\mathbb Q\langle a,b\rangle_n$. Therefore the same linear restrictions become the generalized Dehn-Sommerville relations on the coefficients of $\Psi_P(a,b)$. Thus $\Psi_P(a,b)$ lies in the Eulerian subspace of $\mathbb Q\langle a,b\rangle_n$, namely the subspace of homogeneous ab-polynomials satisfying those relations.
[/guided]
[/step]
[step:Apply the Fine-Bayer-Klapper characterization to obtain a cd-polynomial]
Let $\mathbb Q\langle c,d\rangle_n$ denote the $\mathbb Q$-vector space spanned by all noncommutative monomials in $c$ and $d$ of weighted degree $n$, where $\deg c=1$ and $\deg d=2$. Define the substitution map
\begin{align*}
T_n:\mathbb Q\langle c,d\rangle_n\to \mathbb Q\langle a,b\rangle_n
\end{align*}
by
\begin{align*}
T_n(\Phi)=\Phi(a+b,ab+ba).
\end{align*}
The map is well-defined because replacing each $c$ by $a+b$ contributes degree $1$ and replacing each $d$ by $ab+ba$ contributes degree $2$.
We now use the Fine-Bayer-Klapper cd-index characterization: for every $n\in\mathbb N\cup\{0\}$, a homogeneous polynomial in $\mathbb Q\langle a,b\rangle_n$ satisfies the generalized Dehn-Sommerville relations if and only if it belongs to the image of the substitution map $T_n$. The hypotheses of this characterization are met because $\Psi_P(a,b)$ is homogeneous of degree $n$ and satisfies the generalized Dehn-Sommerville relations by the previous step. Therefore there exists a polynomial
\begin{align*}
\Phi_P(c,d)\in \mathbb Q\langle c,d\rangle_n
\end{align*}
such that
\begin{align*}
T_n(\Phi_P)=\Psi_P(a,b).
\end{align*}
By the definition of $T_n$, this is exactly
\begin{align*}
\Psi_P(a,b)=\Phi_P(a+b,ab+ba).
\end{align*}
This proves existence.
[guided]
The point of introducing $T_n$ is that the Fine-Bayer-Klapper characterization describes exactly its image. The characterization applies to the homogeneous degree-$n$ component $\mathbb Q\langle a,b\rangle_n$ and says that a polynomial in this component lies in $\operatorname{im} T_n$ precisely when its coefficients satisfy the generalized Dehn-Sommerville relations.
We verify the hypotheses for the polynomial at hand. From the definition of the ab-index of a ranked poset of rank $n+1$, we have
\begin{align*}
\Psi_P(a,b)\in \mathbb Q\langle a,b\rangle_n.
\end{align*}
From the preceding step, the Eulerian hypothesis on $P$ implies that $\Psi_P(a,b)$ satisfies the generalized Dehn-Sommerville relations. Hence the Fine-Bayer-Klapper characterization gives membership in the image of $T_n$.
Consequently there is a weighted homogeneous cd-polynomial
\begin{align*}
\Phi_P(c,d)\in \mathbb Q\langle c,d\rangle_n
\end{align*}
with
\begin{align*}
T_n(\Phi_P)=\Psi_P(a,b).
\end{align*}
Unpacking the definition of $T_n$, this means exactly that substituting $a+b$ for $c$ and $ab+ba$ for $d$ gives
\begin{align*}
\Psi_P(a,b)=\Phi_P(a+b,ab+ba).
\end{align*}
Thus the desired cd-polynomial exists.
[/guided]
[/step]
[step:Prove that the substitution map is injective on homogeneous cd-polynomials]
It remains to prove uniqueness. Fix the lexicographic order on words in the alphabet $\{a,b\}$ with $b>a$. For a cd-monomial $M$, define its leading ab-word $\operatorname{lt}(M)$ to be the lexicographically largest word appearing with nonzero coefficient in $T_n(M)$.
If
\begin{align*}
M=c^{\alpha_0}dc^{\alpha_1}d\cdots dc^{\alpha_r}
\end{align*}
is a cd-monomial of weighted degree $n$, where $r\ge 0$ and each $\alpha_i\ge 0$, then $T_n(M)$ is obtained by replacing every $c$ with $a+b$ and every $d$ with $ab+ba$. Under the order $b>a$, the leading choice from each $c$ is $b$, and the leading choice from each $d$ is $ba$. Hence
\begin{align*}
\operatorname{lt}(M)=b^{\alpha_0}ba\,b^{\alpha_1}ba\cdots ba\,b^{\alpha_r}.
\end{align*}
This word determines the positions of the subwords $ba$ coming from the $d$ factors, and therefore determines the original cd-monomial $M$. Thus distinct cd-monomials have distinct leading ab-words.
Now let
\begin{align*}
\Phi=\sum_M q_M M\in \mathbb Q\langle c,d\rangle_n
\end{align*}
be nonzero, where the sum is finite, each $M$ is a cd-monomial of weighted degree $n$, and each $q_M\in\mathbb Q$. Choose a monomial $M_0$ among those with $q_{M_0}\ne 0$ such that $\operatorname{lt}(M_0)$ is maximal. Since no other cd-monomial has the same leading ab-word, the coefficient of $\operatorname{lt}(M_0)$ in $T_n(\Phi)$ is $q_{M_0}$, which is nonzero. Hence $T_n(\Phi)\ne 0$. Therefore $\ker T_n=\{0\}$, so $T_n$ is injective.
[guided]
The uniqueness statement is exactly the injectivity of the substitution map
\begin{align*}
T_n:\mathbb Q\langle c,d\rangle_n\to \mathbb Q\langle a,b\rangle_n.
\end{align*}
To prove injectivity, we separate cd-monomials by a leading word after substitution.
Order words in $a$ and $b$ lexicographically with $b>a$. Consider a cd-monomial
\begin{align*}
M=c^{\alpha_0}dc^{\alpha_1}d\cdots dc^{\alpha_r},
\end{align*}
where $r\ge 0$ and $\alpha_i\ge 0$ for every $i$. Substituting $c=a+b$ and $d=ab+ba$ expands $M$ into a sum of ab-words. To get the lexicographically largest word, we choose the largest available contribution at every factor: from $c=a+b$ we choose $b$, and from $d=ab+ba$ we choose $ba$, because $ba>ab$ in the chosen lexicographic order. Therefore the leading ab-word is
\begin{align*}
\operatorname{lt}(M)=b^{\alpha_0}ba\,b^{\alpha_1}ba\cdots ba\,b^{\alpha_r}.
\end{align*}
Why does this prove separation? The displayed word records exactly where the letters $a$ occur, and each such $a$ is the second letter of a leading block $ba$ coming from one occurrence of $d$. The strings of $b$'s between these blocks record the exponents $\alpha_0,\alpha_1,\dots,\alpha_r$. Hence the leading ab-word determines the original cd-monomial. Distinct cd-monomials therefore have distinct leading ab-words.
Now take a nonzero homogeneous cd-polynomial
\begin{align*}
\Phi=\sum_M q_M M,
\end{align*}
where only finitely many rational coefficients $q_M$ are nonzero. Choose $M_0$ among the monomials with $q_{M_0}\ne 0$ so that $\operatorname{lt}(M_0)$ is maximal. Since no other monomial has the same leading ab-word, no cancellation can remove the coefficient of $\operatorname{lt}(M_0)$ in $T_n(\Phi)$. That coefficient is exactly $q_{M_0}$, so it is nonzero. Thus $T_n(\Phi)\ne 0$, proving that $T_n$ has trivial kernel.
[/guided]
[/step]
[step:Conclude uniqueness of the cd-index]
Suppose that $\Phi_1,\Phi_2\in \mathbb Q\langle c,d\rangle_n$ both satisfy
\begin{align*}
\Psi_P(a,b)=\Phi_1(a+b,ab+ba)=\Phi_2(a+b,ab+ba).
\end{align*}
Then
\begin{align*}
T_n(\Phi_1-\Phi_2)=0.
\end{align*}
Since $T_n$ is injective, $\Phi_1-\Phi_2=0$, so $\Phi_1=\Phi_2$. Therefore the polynomial $\Phi_P(c,d)$ obtained above is unique. This completes the proof of the existence and uniqueness of the cd-index.
[guided]
Why does uniqueness follow from injectivity? Because if two cd-polynomials give the same ab-index after the substitution $c\mapsto a+b$ and $d\mapsto ab+ba$, then their difference lies in the kernel of the substitution map. Concretely, if $\Phi_1$ and $\Phi_2$ both satisfy
\begin{align*}
\Psi_P(a,b)=\Phi_1(a+b,ab+ba)=\Phi_2(a+b,ab+ba),
\end{align*}
then subtracting gives
\begin{align*}
T_n(\Phi_1-\Phi_2)=0.
\end{align*}
The previous step proved that $T_n$ is injective, so its kernel is trivial. Hence $\Phi_1-\Phi_2=0$, which means $\Phi_1=\Phi_2$. This shows that the cd-polynomial constructed in the existence step is the only one with the required substitution property.
[/guided]
[/step]