Linear function

While being one of the simplest and most ubiquitous function category, the definition of linear function is unfortunately not what high schools or most calculus courses teach as ... linear functions. In high schools, a function $$f(x) = mx + b$$ is linear. This contradicts the definition in linear algebra, which is as follows.

A function $$f:\mathbb{R}^n\to \mathbb{R}^m$$ is called linear if, for any $$\alpha, \beta \in \mathbb{R}$$ and for any $$x,y \in \mathbb{R}^n$$, it satisfies the following two properties: The two properties can be represented more succinctly as The properties above imply that superposition holds for linear functions, as illustrated below. That is, one may first obtain the sum $$x+y$$ and then evaluate $$f(\cdot)$$ on it, or evaluate $$f(x)$$ and $$f(y)$$ separately and then add them up; the result will be the same.
 * $$f(\alpha x) = \alpha f(x)$$
 * $$f(x + y) = f(x) + f(y).$$
 * $$f(\alpha x + \beta y) = \alpha f(x) + \beta f(y).$$



Clearly, the function $$mx+b$$ does not satisfy those properties in general. In fact, the proper term for functions in the form of $$mx+b$$ (or, more generally, $$Ax+B$$), is Affine function.

It can be shown that for any linear function $$f: \mathbb{R}^n\to \mathbb{R}^m$$ can be represented in a linear form, i.e., there $$A \in \mathbb{R}^{m\times n}$$ such that $$f(x) = Ax$$exists (see Lemma 22.6.1 ).