Minimal assumptions that must made in order to properly defining segment. Let $v$,$w$ be two points. the segment $[v,w]$ is usually defined as a connected set when $v,w\in\mathbb R^n$:
$[v,w]=\{x|| x=a v+(1-a)w\  \ \text{for some} \ a\in[0,1] \}$.
The question is: if we want to generalize the definition to a space that is as general as possible, what are some minimal assumptions needed for that space?
Hopefully we can keep using the same definition.
My try:  The definition of segment include addition operation and scalar multiplication operation.
Furthermore, those operations seem to be continuous, because the line segment is connected. Therefore, I think we at least need to have a convex subset of a topological vector space.
Does my guess make sense or I miss something?
One concern is that for segments we usually have $[v,w]=[w,v]$. Not entirely sure a TVS will be enough for these kinds of properties. Possibly it follows from the commutative properties of addition in TVS.
 A: One possibility is a convex space, which was apparently discovered/invented multiple times; see e.g. Fritz' paper "Convex Spaces I: Definition and Examples" (https://arxiv.org/abs/0903.5522) or Baez, Lynch and Moeller's paper "Compositional Thermostatics" (https://arxiv.org/abs/2111.10315). This formalism does not require an affine or linear structure.

For completeness, here is the definition:
Let $X$ be a set. A convex structure on $X$ is a family of functions $c_\bullet: [0,1]\to F(X\times X;X)$ satisfying

*

*$c_1(x,y)=x$,

*$c_\lambda(x,x)=x$,

*$c_\lambda(x,y)=c_{1-\lambda}(y,x)$,

*$c_\lambda(c_\mu(x,y),z)=c_{\lambda'}(x,c_{\mu'}(y,z))$ for $\lambda\mu=\lambda'$ and $1 − \lambda = (1 − \lambda′)(1 − \mu′)$.

Here $c_\bullet(x,y)$ models the "line segment" from $y$ to $x$ as $\lambda$ increases from $0$ to $1$, and the point $c_\lambda(x,y)$ models the point on the line segment from $y$ to $x$ that travelled the $\%\lambda$ of the segment.
A pair $(X,c_\bullet)$ where $X$ is a set and $c_\bullet$ is a convex structure on $X$ is a convex space. Of course, line segments in vector spaces are convex structures. Note that in this generality the segments are not necessarily connected, but of course one can consider topological convex spaces. Not all convex spaces can be realized as convex subsets of vector spaces (the ones that do are characterized by the so-called cancellation axiom; see the Baez & co paper above).
