TITLE: Grade this proof of a surjective map from $\mathbb{R}^3$ to $\mathbb{R}^3$.
QUESTION [5 upvotes]: I just received this homework proof back in my abstract algebra class with a grade of 20%.  I feel very cheated, to say the least.  I present it here verbatim for your critiques.  Please tell me what is wrong here.
prove: $f: \mathbb{R}^3 \rightarrow \mathbb{R}^3$ defined by $f(x,y,z)=(x+y,y+z,x+z)$ is onto.
we want to show: for every $b \in \mathbb{R}^3$, there exists $a \in \mathbb{R}^3$ such that $f(a)=b$
let $b=(p,q,r) \in \mathbb{R}^3$
$f\left(\frac{p}{2}-\frac{q}{2}+\frac{r}{2},\frac{p}{2}+\frac{q}{2}-\frac{r}{2},-\frac{p}{2}+\frac{q}{2}+\frac{r}{2}\right)$
$=\left(\frac{p}{2}-\frac{q}{2}+\frac{r}{2}+\frac{p}{2}+\frac{q}{2}-\frac{r}{2},\frac{p}{2}+\frac{q}{2}-\frac{r}{2}-\frac{p}{2}+\frac{q}{2}+\frac{r}{2},\frac{p}{2}-\frac{q}{2}+\frac{r}{2}-\frac{p}{2}+\frac{q}{2}+\frac{r}{2}\right)$
$=\left(\frac{p}{2}+\frac{p}{2},\frac{q}{2}+\frac{q}{2},\frac{r}{2}+\frac{r}{2} \right)$
$=\left(p,q,r \right)$
hence, for every $b=(p,q,r) \in \mathbb{R}^3$, there exists $a \in \mathbb{R}^3$ defined as $a=\left(\frac{p}{2}-\frac{q}{2}+\frac{r}{2},\frac{p}{2}+\frac{q}{2}-\frac{r}{2},-\frac{p}{2}+\frac{q}{2}+\frac{r}{2}\right)$ such that $f(a)=b$
therefore $f:\mathbb{R}^3\rightarrow\mathbb{R}^3$ defined by $f(x,y,z)=(x+y,y+z,x+z)$ is onto
$\square$

REPLY [3 votes]: Your solution is correct, but it jumps off from nowhere. What you have to solve is the equation $f(x,y,z)=(p,q,r)$, that is the system
$$
\begin{cases}
x+y=p\\
y+z=q\\
x+z=r
\end{cases}
$$
which can be solved with matrices:
\begin{align}
\left[\begin{array}{ccc|c}
1 & 1 & 0 & p \\
0 & 1 & 1 & q \\
1 & 0 & 1 & r
\end{array}\right]&\to
\left[\begin{array}{ccc|c}
1 & 1 & 0 & p \\
0 & 1 & 1 & q \\
0 & -1 & 1 & r-p
\end{array}\right]\\[2ex]
&\to
\left[\begin{array}{ccc|c}
1 & 1 & 0 & p \\
0 & 1 & 1 & q \\
0 & 0 & 2 & r-p+q
\end{array}\right]\\
\end{align}
This shows the matrix has rank $3$ so your system has a unique solution. By the way, this also shows the map is also injective.
Much less computations and no guesswork. If you want to write the inverse map, just go on with Gauss-Jordan elimination:
\begin{align}
\left[\begin{array}{ccc|c}
1 & 1 & 0 & p \\
0 & 1 & 1 & q \\
0 & 0 & 2 & r-p+q
\end{array}\right]&\to
\left[\begin{array}{ccc|c}
1 & 1 & 0 & p \\
0 & 1 & 1 & q \\
0 & 0 & 1 & (r-p+q)/2
\end{array}\right]\\[2ex]
&\to
\left[\begin{array}{ccc|c}
1 & 1 & 0 & p \\
0 & 1 & 0 & (q-r+p)/2 \\
0 & 0 & 1 & (r-p+q)/2
\end{array}\right]\\[2ex]
&\to
\left[\begin{array}{ccc|c}
1 & 0 & 0 & (p-q+r)/2 \\
0 & 1 & 0 & (q-r+p)/2 \\
0 & 0 & 1 & (r-p+q)/2
\end{array}\right]\
\end{align}
which means the inverse map is
$$
g\colon (p,q,r)\mapsto\left(\frac{p-q+r}{2},\frac{q-r+p}{2},\frac{r-p+q}{2}\right)
$$
Again, no guesswork.

I too wouldn't have graded your solution 100%. Maybe 20% is too low, but I'd have added

can you explain why you chose those values?