  Let $L^0$ be the algebra of equivalence classes of real valued random
variables on a given probability space, and $(L^0)^n$ the $n$-ary Cartesian
power of $L^0$ for each integer $n\geq 2$. We consider $(L^0)^n$ as a free
module over $L^0$ and study affine geometry in $(L^0)^n$. One of our main
results states that: an injective mapping $T: (L^0)^n\to (L^0)^n$ which is
local and maps each $L^0$-line onto an $L^0$-line must be an $L^0$-affine
linear mapping. The other main result states that: a bijective mapping $T:
(L^0)^n\to (L^0)^n$ which is local and maps each $L^0$-line segment onto an
$L^0$-line segment must be an $L^0$-affine linear mapping. These results extend
the fundamental theorem of affine geometry from $\mathbb R^n$ to $(L^0)^n$.
