Let a discrete time system be
\begin{align}
x[k+1]=Ax[k]
\end{align}
If the system in Eq.1 is stable then always it will satisfy the Lyapunov equation as described below.
Let the Lyapunov function be $V[k]=x[k]^TPx[k]$, for a positive definite $P$. So, $\nabla V= V[k+1]-V[k]$ should be $<0$. This gives \begin{align} \nabla V= &V[k+1]-V[k]\\ = &x[k+1]^TPx[k+1] - Vx[k]^TPx[k]\\ = & x^T[k] (A^TPA-P) x^T[k] \end{align} So we can conclude $(A^TPA-P)<0$.
But in some places it is written as $(APA^T-P)<0$. WHY?? and HOW they are same.