Proof that a coordinate-wise convex function is convex?

I feel like this should be straightforward, but does anyone have a proof of the following?

Let $f: \mathbb{R}^n \to \mathbb{R}$ satisfy the following. For each coordinate $i$, for an arbitrary vector $x_{i}$, define $ f_i(y)$ to be $f$ restricted to the $i^{th}$ parameter, fixing the others $ x_{i}$; then $ f_i(y)$ is convex. Then $f$ is a convex function.

Also, if there is a more standard math notation I should use to describe this problem, what would that be?

(Edit: or a counterexample...)

Thanks!


I should add what I've tried.

$g(\lambda \vec{x} + (1-\lambda)\vec{y}) = g(\lambda x_1 + (1-\lambda)y_1,\dots,\lambda x_n + (1-\lambda)y_n)$

$\leq \lambda g(x_1,\lambda x_2 + (1-\lambda)y_2,\dots) + (1-\lambda) g(y_1,\lambda x_2 + (1-\lambda)y_2,\dots)$

I don't see this going anywhere good, we end up with something nasty like

$\lambda^n g(\vec{x}) + \lambda^{n-1}(1-\lambda) \sum_i g(y_i,\vec{x}_{i}) + \dots + (1-\lambda)^n g(\vec{y})$

I think. Maybe we can get it from there?


Solution 1:

Simple counterexample (assuming I understood your setup): $xy$ is nonconvex while trivially convex (linear) when fixing one of the variables.