If $S = \{(x,y) : y = e^x\}$ was convex, the following relation holds
\begin{align}
&t y_1 + (1-t) y_2 = e^{t x_1 + (1-t) x_2} \tag{1}\\[2mm]
\Longleftrightarrow \quad & t e^{x_1} + (1-t) e^{x_2} - e^{t x_1 + (1-t) x_2} = 0 \tag{2}
\end{align}
for any $x_1, x_2 \in \mathbb{R}$, $x_1 \neq x_2$ and $t \in (0,1)$.
- Is my definition of convexity correct?
For $t=0.5$ (2) becomes \begin{align} &0.5(e^{x_1} + e^{x_2}) - e^{0.5(x_1 + x_2)} = 0 \tag{3}\\ \Longleftrightarrow \quad &e^{x_1} + e^{x_2} - 2e^{0.5(x_1 + x_2)} = 0 \tag{4}\\ \Longleftrightarrow \quad &(e^{0.5 x_1} - e^{0.5 x_2})^2 = 0 \tag{5} \end{align}
where (5) is a contradiction (do you guys use any symbols for that matter?) and thus $S$ is not convex.
- Can we verify the statement in a general manner with $t$ being free?
Now show that $S' = \{(x,y) : y \geq e^x\}$ is convex. (5) then becomes \begin{align} (e^{0.5 x_1} - e^{0.5 x_2})^2 \geq 0 \tag{6} \end{align}
which is true and thus $S'$ is convex. Again, I'd like to show this in a rather general way.
Edit
I added 'If it is not convex, give a counterexample.' to the title. I was just wondering if we can construct a general counterexample without specifying some values for $x_1,x_2,y_1,y_2$ and $t$.