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.)



Non-affine, projective vector field on $R^n$
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](http://en.wikipedia.org/wiki/Ceva%2527s_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.


