I have some doubts when it comes to my approach to this problem and I would appreciate any feedback.
Let $C\subset E$ be a closed subset of a topological vector space. I want to show that $C$ is convex if and only if $\frac{1}{2}(x+y) \in C$ for all $x,y \in C$.
Since I'm using the definition that $C$ is convex if $$\forall_{x,y \in C} \forall_{\lambda \in [0,1]} \lambda x+(1-\lambda)y \in C$$ thus one direction we get automatically with $\lambda = \frac{1}{2}$. Now for the other direction my idea is the following: we fix $x,y \in C$ and $\lambda \in [0,1]$. Denote $z=\frac{1}{2}(x+y) \in C$. From the assumption we get that $\frac{1}{2}(z+x) \in C$ so $$\frac{1}{2}(z+x) = \frac{1}{2}(\frac{1}{2}(x+y)+x) = \frac{3}{4}x + \frac{1}{4}y \in C.$$ By taking $\frac{1}{2}(z+y)$ we also get that $\frac{1}{4}x+\frac{3}{4}y \in C$. Continuing this way we can prove that for every $n \in \mathbb{N_0}$ and $k=1,2,...2^n-1$ we have $$\frac{k}{2^n} x + (1-\frac{k}{2^n})y \in C.$$ Now, let's suppose for now that we already have that for every $q \in \mathbb{Q}\cap [0,1]$ $$qx + (1-q)y \in C.$$ Then using closeness of $C$ I can choose a sequence of rational numbers $q_n \rightarrow \lambda$ to get my result.
The step that is missing is how to get from having the result for $\frac{k}{2^n}$ where $n\in \mathbb{N_0}$, $k=1,2,...2^n-1$ to having it for $q \in \mathbb{Q}\cap [0,1]$. My intuition here is that we should be able to approach such $q$ with fractions $\frac{k}{2^n}$. For example $$ \sup\{\frac{k}{2^n}: n\in \mathbb{N_0}, k=1,2,...2^n-1, \frac{k}{2^n}<q \} =q $$ and by the property of supremum we can find a sequence of such elements $\frac{k}{2^n}$ approaching $q$ (or even perhaps any $\lambda \in [0,1]$, if changing $q$ for $\lambda$ in the formula above?). My doubts coming from the fact that usually the existing sequence of fractions is completely abstract, compare to the sequence $\frac{k}{2^n}$ that is very specific.
But here I'm not sure if this idea is rigorous enough, that is why I would love to hear some feedback here.
Thanks!