I'm trying to figure out what is linearity and what is a linear function. But the wikipedia page confused me.
Firstly it defines as polynomial :
$f(x) = ax +c$
Than it defines as linear map:
$f(x) + f(y) = f(x+y)$
$ af(x) = f(ax)$
This two definitions do conflict with each other.
$f(x) = 2x + 3\\ f(2) = 7\\ f(1) + f(1) = 10 \neq 7$
Does linearity has different meanings at different contexts, or is there something I'm missing.
Thanks.
If $A$ and $B$ are vector spaces (i.e., set whose elements you can add to and subtract from one another, and which you can multiply with elements from some field $K$ (e.g. $\mathbb{R}$,$\mathbb{Q}$,$\mathbb{C}$,$\ldots$) then $$ f \,:\, A \to B $$ is called linear if $$\begin{eqnarray} f(x + y) &=& f(x) + f(y) &\text{for all $x,y \in A$,} \\ f(\lambda x) &=& \lambda f(x) &\text{for all $x \in A$, $\lambda \in K$.} \end{eqnarray}$$ Note that you don't really need $A$ and $B$ to be vector spaces here, though - the definition is sensible as long as there are operations $+ \,:\, A\times A \to A$ and $+ \,:\, B\times B \to B$, and (for the second part) also operations $\cdot \,:\, K\times A \to A$ and $\cdot \,:\, K\times B \to B$.
Note that the graph of a linear function $f \,:\, \mathbb{R}^2 \to \mathbb{R}^2$ is necessarily a line through the origin. Thus, not every function $\mathbb{R}^2 \to \mathbb{R}^2$ whose graph is a line is linear - that's true only if the line goes through the origin. Functions $\mathbb{R}^2 \to \mathbb{R}^2$ whose graph is a line, but doesn't necessarily go through the origin are called affine.
For polynomials, unfortunately, polynomials of degree $1$, i.e. of the form $ax + b$, are often called linear, even though they aren't linear functions, only affine functions.