I am trying to understand Gjergji Zaimi's answer in What are the periodic Dyck paths?. In the third paragraph he claims that
Next, we define the matrix $X_D$ similarly to the Cartan matrix except we put ones in coordinates $(i,i+c_i−1)$ and zeros everywhere else. So $X_D$ essentially consists of just the "righmost" 1's in the Cartan matrix. The matrix $Y_D$ is defined as the matrix with −1 's in positions $(u,u+1),(u,u+2),…,(u,v)$ as $(u,v)$ ranges through all the valleys, and zeros everywhere else. Finally let $A_n$ be the matrix with 1's in entries $(i,i+1)$ for i=1,…,n−1 . One can check the following explicit form for the Coxeter matrix of a Dyck path: $\phi_D=A_n+Y_D−X^T_D$.
My question is: why is $\phi_D=A_n+Y_D−X^T_D$?
So far, I tried to compute it straightforwardly, but that didn't work.