Example 4 Given $\cdots 1 \leqslant a \leqslant 1$, the inequality $\left(\frac{1}{2}\right)^{x^{2}+a x}<\left(\frac{1}{2}\right)^{2 x+a-1}$ always holds. Find the range of values for $x$.
Strategy: Convert the original inequality into an equivalent polynomial inequality, treating $a$ as the main variable, and express it as a linear inequality in $a$. Set up a linear function $f(a)$, and use the monotonicity of $f(a)$ to find the range of $x$.

Solution: The original inequality is transformed into
$$
x^{2}+a x>2 x+a-1 \text {, }
$$

which is equivalent to $(x-1) a+x^{2}-2 x+1>0$.
Let $f(a)=(x-1) a+x^{2}-2 x+1$.
$\because f(a)$ is always greater than 0 for $a \in[-1,1]$,
$$
\therefore\left\{\begin{array} { l } 
{ f ( - 1 ) > 0 , } \\
{ f ( 1 ) > 0 , }
\end{array} \text { i.e., } \left\{\begin{array}{l}
x^{2}-3 x+2>0, \\
x^{2}-x>0 .
\end{array}\right.\right.
$$

Solving these, we get $x>2$ or $x<1$ and $x>1$ or $x<0$.

Combining the results, we get $x>2$ or $x<0$.