Denote $\mathcal F$ as the function class consisting of gradients of all real-valued convex functions in $\mathbb R^d$, that is, $\mathcal F = \{ \nabla \phi ~|~ \phi: \mathbb R^d \to \mathbb R \text{ and $\phi$ is convex}\}$. Note that every element of $\mathcal F$ is a function from $\mathbb R^d$ to $\mathbb R^d$. Then is $\mathcal F$ closed under composition operation? That is, suppose $f \in \mathcal F$ and $ g\in \mathcal F$, do we have $f\circ g \in \mathcal F$ where $\circ$ denotes function composition?
Note: the statement should be true for $d = 1$ since:
- Gradient of a univariate real-valued convex function is non-decreasing;
- Composition of two non-decreasing functions is still non-decreasing;
- Non-decreasing gradient corresponds to a convex function.
Best Answer
Set
$$A = \begin{pmatrix} 2 & 1\\ 1 & 1\end{pmatrix} \quad\text{and}\quad B = \begin{pmatrix} 5 & 2\\ 2 & 1\end{pmatrix}.$$ Both matrices are positive definite because their diagonal entries are positive as are their determinants. Hence, they are gradients of convex functions, namely $\tfrac{1}{2}\langle x,Ax\rangle$ and $\tfrac{1}{2}\langle x,Bx\rangle$, respectively.
However, $$AB = \begin{pmatrix} 12 & 5 \\ 7 & 3\end{pmatrix}$$ is not even symmetric, so it cannot be a gradient of a convex function.
Note: The matrices were already used in a sister question: Product of any two arbitrary positive definite matrices is positive definite or NOT?