A Riemmanian manifold is called flat if its curvature vanishes everywhere.
However, this does not mean that this is is an affine space.
It merely means (roughly) that locally it "is like an Euclidean space."
Examples of flat manifolds include circles (1-dim), cyclinders (2-dim), the Möbius strip (2-dim) and various other things.
Yet, let me add into the direction of your idea that the universal cover of a complete flat manifold is indeed an Euclidean space.
A linear transformation is any transformation $f:U\to V$ between vector spaces over $\mathbb F$ for which
- $f(x+y)=f(x)+f(y)$
- $f(\alpha x) = \alpha f(x)$
for all $x,y\in U$ and all $\alpha\in\mathbb F$.
An affine transformation is any transformation $f:U\to V$ for which, if $\sum_i\lambda_i = 1$, $$f(\sum_i \lambda_i x_i) = \sum_i \lambda_i f(x_i)$$
for all sets of vectors $x_i\in U$.
In effect, what these two definitions mean is:
- All linear transformations are affine transformations.
- Not all affine transformations are linear transformations.
- It can be shown that any affine transformation $A:U\to V$ can be written as $A(x) = L(x) + v_0$, where $v_0$ is some vector from $V$ and $L:U\to V$ is a linear transformation.
Take an example where $U=V=\mathbb R^2$. Then $$f:(x,y) \mapsto(-2x+y, 3x+8y)$$ is a linear transformation, since
$$f((x_1,y_1)+(x_2, y_2)) = (-2(x_1+x_2) + y_1+y_2, 3(x_1+x_2) + 8(y_1+y_2)) = \\
= (-2x_1 + y_1, 3x_1 + 8y_1) + (-2x_2 + y_2, 3x_2 + 8y_2) = f((x_1,y_1)+f((x_2, y_2))$$
However, $$g:(x,y)\mapsto (-2x+y+5, 3x+8y-2)$$
is not a linear function (you can immediatelly see this since $g((0,0)) \neq (0,0)$, while linear functions always map $0$ to $0$).
Both $g$ and $f$ are (you can check) affine functions.
Best Answer
A linear function fixes the origin, whereas an affine function need not do so. An affine function is the composition of a linear function with a translation, so while the linear part fixes the origin, the translation can map it somewhere else.
Linear functions between vector spaces preserve the vector space structure (so in particular they must fix the origin). While affine functions don't preserve the origin, they do preserve some of the other geometry of the space, such as the collection of straight lines.
If you choose bases for vector spaces $V$ and $W$ of dimensions $m$ and $n$ respectively, and consider functions $f\colon V\to W$, then $f$ is linear if $f(v)=Av$ for some $n\times m$ matrix $A$ and $f$ is affine if $f(v)=Av+b$ for some matrix $A$ and vector $b$, where coordinate representations are used with respect to the bases chosen.