Give a general example for a linear mapping by its kernel definition I have a question regarding linear maps in my homework I can't figure out how to solve. Question is:
For some ${n \ge 3}$. 
Give an example of a linear mapping ${T:\mathbb{R}^n\rightarrow \mathbb{R}^n}$ so ${\mathrm{Im}(T) \cap \mathrm{Ker}(T)=\{0\}}$ and ${\mathrm{Ker}(T)=\{(x_1,x_2,...,x_n)|x_1+x_2+...+x_{n-2}=0\}}$. Example should be for general ${n}$.
So, I tried to solve this question by finding a basis for $\mathrm{Ker}(T)$ and then add a vector to get a base for $\mathbb{R}^n$ that will keep the linear map rules given in the question, however, it got a bit complicated to me.
Also, Sorry for my English, I hope I made the question clear. Thanks.
 A: Here is a nice example of such a function: Define $T: \mathbb{R}^n \rightarrow \mathbb{R}^n$, defined by $$T(x_1,...,x_n) = \bigg(\sum_{i=1}^{n-2}x_i,\sum_{i=1}^{n-2}x_i,...,0,0\bigg)\in \mathbb{R}^n$$
Does this satisfy the conditions? Well by construction, it will satisfy the definition of the kernel; any vector whose first $n-2$ terms sum to zero will get sent to the zero vector, and hence our kernel has the desired structure.
We then have to show that $\text{Im}(T) \cap \text{Ker} (T) = \{0\}$. But this is the same as showing that for any non-zero element of the kernel, that those elements are never part of the image of $T$.
But actually we can see this is true! Consider the definition of our map: $T(\bar{v}) = (a,a,...,0,0)$ for some $a \in \mathbb{R}$. If $\bar{v}$ is an element of the kernel, AND an element of the image, then $\bar{v} = (x_1,...,x_n) = (a,a,...,0,0)$. But the only way it is possible for the first $n-2$ terms to sum to zero in this case is if $a=0$. Hence, for any non-zero element of the kernel, it can never be in the image! So our construction $T$ satisfies the desired conditions.

PS: I just gave the above construction without really explaining where it came from. The intuition for me here was to simply use the kernel condition and realise that the zero vector can in fact be written in a way that is dependent on the coordinates of the input vector. This relationship allows us to come up with a map that satisfies at least that condition. From there it's quite fortunate the other condition holds (which we prove after our guess of what $T$ might look like). And of course we must also show $T$ is in fact linear, but this is straightforward from the defintion.
