Non-affine, projective vector field on $R^n$ I wanted recently to discuss with a fairly elementary mathematics class the kinds of self-maps of Euclidean space that carry triangles to triangles.  Obviously linear maps do this, and it seemed just as obvious to me that they were the only ones (up to translation).
I asked a colleague, and he pointed out an obvious counterexample:  Project to the $x$-axis, then apply whatever continuous but non-linear map one likes.  He quickly suggested a remedy:  Is a line-segment-preserving local diffeomorphism necessarily (affine) linear?
Well, surely that's enough --but I have been told that Walter Poor's "Differential geometric structures" assigns as an exercise to prove that there exist non-affine, projective vector fields on $\mathbb R^n$, and that a solution to this exercise gives a counterexample to the revised conjecture.  (I don't know the words, but it sounds plausible to me.)
Under fairly weak continuity hypotheses (certainly local diffeomorphism is sufficient!), it suffices to prove additivity; and, to prove additivity, it suffices to prove that parallelograms are carried to parallelograms.  The only way that this can fail for a local diffeomorphism is if there are some lines carried onto proper subsets of lines; and I just can't seem to see how this can happen without breaking some line segments.
(Another colleague to whom I proposed the problem argued as follows:  If the Jacobian matrix isn't constant, then there is a point at which the Hessian is non-$0$.  Near this point, the map is approximately a non-linear quadratic, and one can show that such quadratics don't preserve line segments.  Of course, it is the ‘approximately’ that bites us here; but I'd be interested in seeing how such a straightforward estimate fails.)
 A: I don't know what was meant in that exercise, but your revised conjecture is certainly true and well-known. Here is an elementary proof.
The assumptions (local injectivity, continuity and segment-to-segment mapping) imply that the map is injective and preserves collinearity of points and endpoints of segments. By continuity it suffices to show that the midpoint of every segment is sent to the midpoint of its image.
Consider any two points $A,B$. Let $A',B'$ be their images and $D'$ the midpoint of $[A'B']$. By continuity there is a point $D\in[AB]$ mapped to $D'$. We are to prove that $D$ is the midpoint of $[AB]$. Pick a point $C$ such that its image $C'$ is not collinear with $A'$ and $B'$ and choose points $E\in[AC]$ and $F\in[BC]$ such that $CD$, $BE$ and $AF$ have a common point $G$ in the triangle $ABC$. Note that all these points belong to the plane containing $A,B,C$.
By elementary geometry (see e.g. Ceva's theorem), $D$ is the midpoint of $[AB]$ if and only if $EF$ is parallel to $AB$. Suppose it is not, then the line $EF$ intersects the line $AB$ at some point $H$. This configuration is mapped to a configuration $A',B',\dots,H'$ with the same collinearity relations. Since $E'F'$ is not parallel to $A'B'$ (they intersects at $H'$), the same application of Ceva's theorem shows that $D'$ is not the midpoint of $[A'B']$, a contradiction.
A: The short way of stating the answer is, I guess, that the vector fields you refer to are not complete on $\mathbb{R}^n$, so that they do not integrate to a diffeomorphism of Euclidean space.
Here are some details. Projective transformations map lines to lines, and therefore triangles to triangles (and even non-degenerate triangles to non-degenerate triangles), but they do not act on $\mathbb{R}^n$ (unless they are affine) but on the projective space $\mathbb{R}\mathrm{P}^n$ (which I recall is the quotient $\mathbb{R}^{n+1}/\mathbb{R}^*$ where the action is by multiplication, in other words the projective space is the set of linear lines of $\mathbb{R}^{n+1}$ ; it is acted upon by $\mathrm{GL}(n+1;\mathbb{R})$ or, quotienting by the kernel of scalar matrices,
$\mathrm{PGL}(n+1;\mathbb{R})$ ; details awailable in any old-school projective geometry book, for example Pierre Samuel's one, or Marcel Berger's geometry).
A simple exemple of a projective non-affine transformation is
$$(x,y)\mapsto \left(\frac{x}{x+1},\frac{y}{x+1}\right).$$
You can easily check that it maps lines to lines where it is defined (and in fact, if the goal space is extended to the projective plane it is defined everywhere).
On the level of vector fields, you can consider the $t$ derivative of
$$\left(\frac{x}{tx+1},\frac{y}{tx+1}\right)$$
to get one that does what you ask for. As stated above, the point is that the vector field you get is not complete (although it becomes complete on the projective space).
A: Recall two connections on a manifold are said to be projectively equivalent, if they have the same geodesics.  You want to know what local diffeos $\mathbb{R}^n\mapsto\mathbb{R}^n$ preserve geodesics; that is, what flat metrics on $\mathbb{R}^n$ are projectively equivalent to the Euclidean one.  I think your conjecture, that the only such metrics are those obtained by affine-linear transformations of the Euclidean metric, is correct.
Let's discuss this first locally, then globally.
Local question: What flat connections on a neighbourhood of $\mathbb{R}^n$ are projectively equivalent to the Euclidean one?
Answer:  If $n=1$, all.  If $n\geq 2$, exactly those obtained by what depending on your terminology you might call a a perspective transformation or a projective linear transformation or something else.
Comment:  Sketch proof below.  The case distinction (which explains your colleague's observation) comes from a factor of $1/(n-1)$ in the formula for the appropriate Schouten curvature tensor.  This is analogous to the case distinction $n\leq 2$ vs $n\geq 3$ in conformal geometry, see
http://en.wikipedia.org/wiki/Liouville's_theorem_(conformal_mappings)
Now we can deal with
Global question: What flat connections on $\mathbb{R}^n$ are projectively equivalent to the Euclidean one?
Answer:  Just the standard one.  The others "blow up"/"go off to infinity"/involve-division-somewhere-by-zero if you try to extend them to all $\mathbb{R}^n$.
Sketch proof of local version:  Use the notation and some formulae from, eg.,
http://www.maths.adelaide.edu.au/michael.eastwood/projective.pdf
Let $\nabla$ be the standard connection on $\mathbb{R}^n$.  Consider a projectively equivalent connection defined by a 1-form $\Upsilon_i$ (so the new connection acts on a 1-form $\omega_i$ by,
$\nabla_i\omega_j - \Upsilon_i\omega_j -\Upsilon_j\omega_i$.)
The projective Schouten curvature tensor of $\nabla$ is zero (since it's flat).  If the new connection's also flat, then, applying appropriate transformation laws, we have that
$\nabla_i\Upsilon_j = \Upsilon_i\Upsilon_j$,
and that $\Upsilon_i$ is closed, so locally exact.
Write $\Upsilon = df$.  Then in standard Euclidean co-ordinates we have the system of PDE
$\partial_i\partial_j f = \partial_i f \ \partial_j f$
for the function $f$, which we can solve to get
$f(x^1, ... x^n) =-\log (a_1 x^1+ \cdots + a_nx^n + c)$
for some fixed constants $a_i$ and $c$.  Hence $\Upsilon_i = \frac{-a_i}{a_1 x^1+ \cdots + a_nx^n + c}$.  It should probably turn out that the family of connections this gives are all indeed flat, and correspond to the projective-linear-transformations of the Euclidean metric on $\mathbb{R}^n$.
