# How to prove that a function is affine?

I am trying to understand the concept of affinity of functions. First, I thought that every affine function has to be a linear function, too, because my teacher's notes define linear and affine functions as follows:

$$T(\sum_{i=0}^n \alpha_iu_i) = \sum_{i=0}^n\alpha_iT(u_i)$$ is a linear function. An affine function is defined as $T(\sum_{i=0}^n \alpha_iu_i)$ with $\sum_{i=0}^n \alpha_i = 1$ and the above condition of a linear function.

Then, I found the example of $f(x) = 2x + 3$ which is an affine function but not linear which is pretty confusing to me (I understand why it is not linear, but have no clue as to why it is affine according to the definitions).

I also have to solve a problem such as: $$T: \mathbb{R} \to \mathbb{R}, T(x,y,z) := (x − z + 1, y - 5, z - y, 2)$$ but I really have no idea how to proof if it's affine or not. There are no $\alpha$ and that function is not linear, so I am kind of stuck here.

I appreciate any sort of help, like links to websites or anything that helps me to understand this because I have no strategy to solve this problem.

• Every linear function is affine but not the other way around. Think of an affine function as a linear function plus a constant. – copper.hat Dec 7 '16 at 18:53

A function is affine iff $$T(\lambda x + (1-\lambda) y) = \lambda T(x) + (1-\lambda) T(y)$$ for all $$x,y$$ and $$\lambda \in \mathbb{R}$$.

It is straightforward to show that the above definition is the same as the one in the question.

You can use this to answer your question by checking that $$T(\lambda (x_1,y_1,z_1) + (1-\lambda)(x_2,y_2,z_2)) = \lambda T((x_1,y_1,z_1)) + (1-\lambda)T((x_2,y_2,z_2))$$ for any scalar $$\lambda$$.

Also, note that if $$T$$ is affine and we let $$L(x) = T(x)-T(0)$$, then $$L(\lambda x) = T(\lambda x) - T(0) = T (\lambda x + (1-\lambda) 0) - T(0) =\lambda T(x)+(1-\lambda) T(0) - T(0) = \lambda L(x)$$, and $$L(x+y) = 2 L({1 \over 2} (x+y))= 2 T({1 \over 2} (x+y)) - 2T(0)= 2( {1 \over 2}(T(x)+T(y)))-2 T(0) = L(x)+L(y)$$. Hence $$L$$ is linear, and we can write $$T(x) = T(0)+L(x)$$.

It is easy to check that if $$L$$ is linear and $$c$$ is a constant vector, then $$T(x) = L(x)+ c$$ is affine.

So we see that $$T$$ is affine iff it can be written as a constant plus a linear function.

In your case, we see that we can write $$T((x,y,z)) = A (x,y,z)^T + b$$ for some matrix $$A$$ and some vector $$b$$.

• Ok, I think I am getting the hang of it. But just to be clear: the function is not linear so this approach would pretty much end up with the same result, right? If multiplying with a scalar proofs that it is not a linear function, following this approach, it would also proof that it is not affine, right? – Urmir Dec 7 '16 at 19:05
• The function you have is not linear (it is affine). The above means you just need to check for two $u$s, not $n$ of them... – copper.hat Dec 7 '16 at 19:06
• So I randomly choose six values plus an $\lambda$ and check if the equation holds for these values? – Urmir Dec 7 '16 at 19:16
• No, there's no randomness. Compute the three expressions $T(\lambda (x_1,y_1,z_1) + (1-\lambda)(x_2,y_2,z_2))$, $T((x_1,y_1,z_1))$, and $T((x_2,y_2,z_2))$ and check that the above equality holds. – copper.hat Dec 7 '16 at 19:18
• So what I did is $$T(\alpha (x_1,y_1,z_1) + (1-\alpha)(x_2,y_2,z_2)) = ((\alpha x_1 + (1-\alpha)(x_2))-(\alpha y_1 + (1-\alpha)y_2)+2, ...$$ and so on for the equation in my question above. I ended up with $\alpha(x_1-x2+2, ...)$ and $(1-\alpha)(y_1-y_2+2, ...)$. Is that path to the solution? – Urmir Dec 7 '16 at 19:46

Every affine function is a linear function "plus a constant vector". That is, for every affine function $A(x)$, there is a vector $v$ and a linear function $T(x)$ such that $A(x)=T(x)+v$.

What is the difference between linear and affine function