```markdown
### Convexity with respect to generalized inequalities

**Definition:**

A function \( f : \mathbb{R}^n \rightarrow \mathbb{R}^m \) is \( K \)-convex if \( \text{dom} \, f \) is convex and

\[
f(\theta x + (1 - \theta)y) \preceq_K \theta f(x) + (1 - \theta) f(y)
\]

for \( x, y \in \text{dom} \, f \), \( 0 \leq \theta \leq 1 \).

**Example:**

\( f : S^m \rightarrow S^m \), \( f(X) = X^2 \) is \( S^m_+ \)-convex.

**Proof:**

For fixed \( z \in \mathbb{R}^m \), \( z^T X^2 z = \| Xz \|_2^2 \) is convex in \( X \), i.e.,

\[
z^T (\theta X + (1 - \theta) Y)^2 z \leq \theta z^T X^2 z + (1 - \theta) z^T Y^2 z
\]

for \( X, Y \in S^m \), \( 0 \leq \theta \leq 1 \).

Therefore,

\[
(\theta X + (1 - \theta) Y)^2 \preceq \theta X^2 + (1 - \theta) Y^2
\]

*Source: A. d'Aspremont. Convex Optimization M2.*
```
