Q:

If $C$ is convex then $\cup_{y\in C} B(y,r)$ is convex.

I am studying for an upcoming exam on convex optimization and one of the practice exercises that I am working through is the following;

Let $C\subseteq \mathbb{R}^n$ be a convex set. Is the set
$$\mathcal{C} := \bigcup_{y \in C} B(y,r), \qquad r>0$$
also convex? If yes prove it and if not then give a counter example.

I have a hunch that this is set is convex, and I remember proving so at the start of the semester. But I have lost my working and as usual when revisiting a problem I am struggling to view it in a new instead of just trying to remember what I did.
Hints are favorable, but answers are also accepted. Cheers in advance for the help.

A:

If $x_1,x_2\in\bigcup_{y\in C} B(y,r)$, then $x_i=y_i+z_i$ for $y_i\in C$, $z_i\in B(0,r)$.  Now use convexity of $C$ and $B(0,r)$ to show that, for $\lambda\in[0,1]$,
$$
\lambda y_2+(1-\lambda)y_1 \in C\text{ and }
\lambda z_2+(1-\lambda)z_1 \in B(0,r).
$$
Hence
$$
\lambda x_2+(1-\lambda)x_1 = 
(\lambda y_2+(1-\lambda)y_1) +
(\lambda z_2+(1-\lambda)z_1) \in \bigcup_{y\in C}B(y,r).
$$

