TITLE: Solution set of an LMI is convex
QUESTION [9 upvotes]: I was going through Boyd & Vandenberghe's Convex Optimization. On page 38, the authors mentioned that the solution set of a linear matrix inequality (LMI) is convex.
$$ A(x) := x_1 A_1 + \dots + x_n A_n \preceq B $$
where $A_1, \dots, A_n, B \in \mathbb{S}^m$, is called an LMI in $x$. They also gave a brief explanation where they mentioned that this is because

it is the inverse image of the positive semi-definite cone under the affine function.

I could not figure out what would be the affine function that they mentioned.

REPLY [3 votes]: Given a linear matrix polynomial $\mathrm A : \mathbb{R}^{n} \to \mbox{Sym}_k (\mathbb{R})$ defined by
$$\mathrm A (x) = \mathrm A_0 + x_1 \mathrm A_1 + \cdots + x_n \mathrm  A_n$$
where $\mbox{Sym}_k (\mathbb{R})$ is the set of $k \times k$ real symmetric matrices, and matrices $\mathrm A_0, \mathrm  A_1, \dots, \mathrm A_n$ are symmetric, we form the following linear matrix inequality (LMI)
$$\mathrm A (\mathrm x) \succeq \mathrm O_k$$
whose solution set is the spectrahedron
$$\mathcal S := \{ \mathrm x \in \mathbb{R}^n \mid \mathrm A (\mathrm x) \succeq \mathrm O_k\}$$
Let $\mathrm x, \mathrm y \in \mathcal S$ and $\lambda \in [0,1]$. Hence,
$$\mathrm A (\lambda \mathrm x + (1-\lambda) \mathrm y) = \cdots = \lambda \, \underbrace{\mathrm A (\mathrm x)}_{\succeq \mathrm O_k} + (1-\lambda) \, \underbrace{\mathrm A (\mathrm y)}_{\succeq \mathrm  O_k} \succeq \mathrm  O_k$$
Since a convex combination of two positive semidefinite matrices is also positive semidefinite, we conclude that set $\mathcal S$ is convex.

convex-analysis linear-matrix-inequality spectrahedra