Basic question about my understanding of the Lyapunov equation Consider the system $\dot{x}(t) =Ax(t)$ where $A \in \Bbb R^{n\times n}$. Now let $P$ be a symmetric matrix and define $V(x) = x^T Px$. Then $V(x)$ satisfies
$$\frac{d}{dt}V(x) = -x^TQ x,$$
where $Q = -(A^TP+PA)$. Now the theorem is:
The system $\dot{x}(t)=Ax(t)$ is stable iff there exist symmetric positive definite matrices $Q$ and $P$ such that 
$$A^TP +PA = -Q$$
Now I wonder if I understand why this is true. Here is my (probably flawed understanding) of why it is true.
If $P$ is positive definite $V(x) >0$ for all $x(t)$, and thus $V$ can be used a measure of the length of $x$. I am not sure if it would satisfy the properties of a metric though... Now If $Q$ is positive definite then $x^TQx >0$ and thus 
$$\frac{d}{dt}V(x) = -x^TQ x <0,$$
so that if we accept $V$ as a measure of the length of the $x$, the length is always decreasing, and thus $x \to 0$ as $t\to \infty$.
This is my very basic intuitive understanding of why the theorem is true. I have a few problems with my own reasoning though. The first is that I can't decide if $V$ would satisfy the conditions of being a metric. I will show my attempt of deciding this below. First let $$d(x,y) =V(y-x) = (y-x)^TP(y-x)$$
1) $d(x,y)=V(y-x) \geq 0$ for all $x,y$ with $V(y-x)=0$ iff $x =y$. This is straightforward to see due to the positive definiteness of $P$.
2) $d(x,y)=V(y-x)=(y-x)^TP(y-x) = -(x-y)^TP(-(x-y)) = V(x-y)=d(y,x)$.
3) I dont know how to show $V(z-x) \leq V(y-x) +V(z-y)$ if it is even true.
So now, if I assume the triangle equality for a moment then $V$ is a metric on $\Bbb R^n$ and thus we have that if $Q$ is positive definite $V(x)$ would decreasing for all $t\geq 0$. However, this doesn't mean that $x\to 0$ as $t \to 0$. For instance if we have a solution to $\dot{x}(t) = Ax(t)$ in $\Bbb R^2$ where $x(t) = (1/(t+1) +2 ,3/(t+2))$ it is true that the length of $x$ decreases for all $t\geq 0$ however $x \to (2,0) \neq(0,0)$.
So that is my basic understanding of why the theorem might be true but why I can't see the complete picture. If anyone could fill in the blanks that would be great or maybe there is a better way of showing this result. Thanks in advance! Sorry if my explanation is dodgy at points.
 A: Your intuition that $V$ can be used as a measure of the "length" of $x$ is on the right track, though traditionally in control theory the quantity $x^TPx$ is referred to as the generalized "energy" of the system. In particular, using $V$ doesn't necessarily provide a metric for $x$, but it can be used to tell us that the "energy" of the system is decreasing over time, which then implies asymptotic stability; if $x^TPx$ decreases over time for a constant matrix $P$, it must be the case that $x$ is moving towards the origin. 
To see why the Lyapunov equation helps us assess stability, first note that by the definition of the norm of a matrix, the quantity $x^TQx$ is greater than or equal to the minimum eigenvalue of $Q$ times the square of the norm of $x$, i.e.,
\begin{equation}
\lambda_{min}(Q)\|x\|^2  \leq x^TQx
\end{equation}
Then taking the time derivative of $V(x)$ (as you've done above) gives
\begin{equation}
\frac{d}{dt}V(x) = -x^TQx \leq -\lambda_{min}(Q)\|x\|^2 \,\,\,\,\,\,\,\, (*)
\end{equation}
Now examine the quantity $x^TPx$. Again using the definition of the norm of a matrix, we see that
\begin{equation}
x^TPx \leq \lambda_{max}(P)\|x\|^2
\end{equation}
(this inequality is the counterpart to the one we used above for $Q$). Taking the negative of this inequality and re-arranging terms gives
\begin{equation}
-\|x\|^2 \leq -\frac{x^TPx}{\lambda_{max}(P)}
\end{equation}
Substituting this into equation $(*)$ above gives
\begin{equation}
\frac{d}{dt}V(x) \leq -\frac{\lambda_{min}(Q)}{\lambda_{max}(P)}x^TPx
\end{equation} 
Since $\lambda_{min}(Q)$ and $\lambda_{max}(P)$ are constants, we can define 
$k = \frac{\lambda_{min}(Q)}{\lambda_{max}(P)}$, giving us that
\begin{equation}
\frac{d}{dt} V = -kV
\end{equation}
which is exponentially stable. Note here that because this is a linear time-invariant (LTI) system, exponential stability and global asymptotic stability both imply each other.
Edit: to see why $x \to 0$ as $t \to \infty$, first note that $V(x)$ outputs a scalar, so the solution to $\frac{d}{dt}V = -kV$ is $V(x(t)) = V(x(0))e^{-kt}$; from this solution, we see that $V(x(t)) \to 0$ as $t \to \infty$. For simplicity, I'll write $V(x(t))$ as $V(x)$ from now on. Since $V(x) \to 0$ as $t \to \infty$, given any $\epsilon > 0$, we can find a time $t_1$ such that for all $t > t_1$, $V(x) < \epsilon$. 
Using this fact, given some $\epsilon > 0$, let us find $t_1$ so that
\begin{equation}
V(x) < \epsilon\lambda_{min}(P)
\end{equation}
for every $t > t_1$. As we did for $Q$ above, we can easily see that
\begin{equation}
\lambda_{min}(P)\|x\|^2 \leq x^TPx = V(x)
\end{equation}
Substituting this into the above inequality, we have
\begin{equation}
\lambda_{min}(P)\|x\|^2 < \epsilon\lambda_{min}(P)
\end{equation}
where dividing by $\lambda_{min}(P)$ (which is allowed since $\lambda_{min}(P) > 0$) gives
\begin{equation}
\|x\|^2 < \epsilon
\end{equation}
for all $t > t_1$ which means that $\|x\| \to 0$ as $t \to \infty$. 
