Check if set is convex: $$V = \{x \in \mathbb{R^n} : \lVert x\rVert = r \}$$
Obviously this set is non convex, but if there
is a method to show that numerically instead of
by logical thinking. I mean, in my class we prove
the set is convex by:
$$V = \{x \in \mathbb{R^n} : \lVert x\rVert \le r \}$$
$\lVert \theta x + (1 - \theta)y \rVert = \lVert \theta x \rVert + \lVert (1 - \theta)y \rVert =
\theta \lVert x \rVert + (1 - \theta) \lVert y \rVert \le \theta r + (1 - \theta)r = r$
which implies that V is convex. But why it does not hold for the first set? $\lVert \theta x + (1 - \theta)y \rVert = \lVert \theta x \rVert + \lVert (1 - \theta)y \rVert = \theta \lVert x \rVert + (1 - \theta) \lVert y \rVert = \theta r + (1 - \theta)r = r$
For me this looks valid, but for sure it should not. I know that if I find a subset that does not satisfy this inequality then it will be a proof that this set is non convex. But besides having intuiton that given set might non be convex a then looking for some subset is there a way to check numerically without guessing that it might not be convex?