# Show that $S$ is a convex set, if it is locally convex everywhere

Part 1

$$S\subseteq\mathbb R^2$$ is locally convex, in the sense that, for any point $$x\in\mathbb R^2,$$ there exists an open ball $$B(x,\epsilon)$$, such that $$S\cap B$$ is convex. Show that $$S$$ is convex.

This part seems easy. Here I would present a sketch of the proof. First take two balls $$B_1$$, $$B_2$$, such that their intersection with $$S$$ is convex and $$(B_1\cap S)\cap (B_2\cap S)\neq\emptyset$$. It is not hard to see that $$(B_1\cap S)\cap (B_2\cap S)$$ is convex and $$(B_1\cap S)\cup (B_2\cap S)$$ is convex. Since $$\mathbb R^2$$ must be covered by countable many balls, we can safely use induction to obtain our result.

Part 2

$$S\subseteq\mathbb R^2$$ is a set satisfying that, for any point $$x\in\mathbb R^2,$$ there exists an open ball $$B(x,\epsilon)$$, such that: either 1) $$S\cap B$$ is convex, or 2) $$S^c\cap B$$ is convex. Is it possible to show that either $$S$$ is convex, or $$S^c$$ is convex?

However the part 2 seems usually hard and I don't know what to do. Maybe we could start with two intersecting epsilon ball $$B_1,B_2$$. Then they must both satisfy the condition (1), or they must both satisfy the condition (2)?

• I'm not sure the proof of part 1 is true as stated. The step "... and $(B_1 \cap S) \cup (B_2 \cap S)$ is convex" is not true by taking $S = \mathbb{R}^2$ and taking two disks that have nonzero intersection but whose union is not convex. Commented Dec 18, 2019 at 5:46

Answer for part 2): Let $$S=\mathbb R^{2} \setminus \{x,y\}$$ where $$x \neq y$$. Then neither $$S$$ nor $$S^{c}$$ is convex. If $$z \notin \{x,y\}$$ it is obvious that the intersection of some ball around $$z$$ with $$S$$ is convex. Now let $$z=x$$. If $$B$$ is ball around $$x$$ not containing $$y$$ then $$B \cap S^{c}=\{x\}$$ which is convex. Similarly $$y$$ contains a ball whose intersection with $$S^{c}$$ is convex.