# Showing that a function is affine in $\mathbb{R}^{n}$

I'm reading an analysis book, and I'm struggling with a question. First, here is the definition for an affine function:

A function is said to be affine if it is defined by

$$g(u) = c + \sum_{i=1}^{n}a_{i}u_{i}$$

where $$c$$ and the $$a_{i}'s$$ are prescribed values. If $$c = 0,$$ the function is linear.

Now, here's the problem:

Fix a point $$x$$ in $$\mathbb{R}^{n}$$ and let $$c$$ be a point in $$\mathbb{R}^{n}$$ and define $$\phi : \mathbb{R}^{n} : \mathbb{R}$$ by $$\phi(u) = \langle c, u - x \rangle .$$

(a) Show that $$\phi : \mathbb{R}^{n} \rightarrow \mathbb{R}$$ is affine.

(b) Show that given any nonconstant affine function $$\phi : \mathbb{R}^{n} \rightarrow \mathbb{R}$$, it is possible to choose points $$x, c \in \mathbb{R}^{n}$$ so that $$\phi : \mathbb{R}^{n} \rightarrow \mathbb{R}$$ has the above form.

For (a), I used the bilinearity property of the inner product as follows:

$$\langle c, u - x \rangle = \sum_{i=1}^{n} c_{i}u_{i} - \sum_{i=1}^{n} c_{i}x_{i}.$$

I don't know how to get it into the form used in the definition, though. I also don't know how to get an arbitrary affine function into the form provided above. I'm guessing you start with $$c + \sum_{i=1}^{n} a_{i}u_{i}$$ and manipulate it into what we want. I tried a lot of things, but I couldn't get it.

Any help is appreciated.

• Use of $c$ for a number in a) and for a vector in b) is confusing. Commented Mar 6, 2019 at 6:06

For b) take $$x_0=(a_1,a_2,...,a_n)$$ and $$x =-\frac c {\|(a_1,a_2,...,a_n)\|^{2}} x_0$$. Then $$\langle x_0, (u-x) \rangle =c+\sum a_i u_i$$.
• If a) holds with $a_i=0$ for all $i$ and $c \neq 0$ then it is not possible to prove b). Commented Mar 6, 2019 at 6:10
• how come there is an extra point $x_{0}$? shouldn't we be choosing $x$ and $c$ only? or is $x_{0}$ supposed to be $c$? Commented Mar 6, 2019 at 6:13
• Well, as I have commented above you are using $c$ for a number in a) and a vector in b). They are not the same. Commented Mar 6, 2019 at 6:14
The term $$-\sum_{i=1}^{n} c_ix_i$$ is just a constant since $$$$ is only a function of $$u$$. So, it does have the form of the affine function in the definition.
Part (b) follows from the fact that any number in $$\mathbb{R}$$ can be written as a linear combination of other numbers in $$\mathbb{R}$$ ($$\mathbb{R}$$ is closed under addition and scalar multiplication).