Q:

K-Theory of $C(X)$ for $X$ totally disconnected

I am studying K-Theory for C*-algebras by the following book:
Rordam, Larsen and Laustsen.
I am having a problem with the the Exercise 3.4, which is:
Let $X$ be any compact Housdorff space.
In the part (i) of the exercise, I have shown that there is a surjective group homomorphism
$$\text{dim}: K_0(C(X)) \to C(X, \mathbb{Z})$$
which satisfies $\text{dim}([p]_0)(x)=\text{Tr}(p(x))$.
In the part (ii) of the exercise, I have shown that $\text{dim}([p]_0)=\text{dim}([q]_0)$ iff for each $x \in X$ there exists $v_x \in M_{m,n}(\mathbb{C})$ such that $v_xv_x^*=p(x)$ and $v_x^*v_x=q(x)$, for $p$ is a projection in $M_m(C(X))$ and $q$ is a projection in $M_m(C(X))$.
My problem is the part (iii) of this exercise, that is, I can not show that the $\text{dim}$ map in (i) is injective if $X$ is totally disconected.
Does anyone have have an ideia to help me?
Thank you!

A:

By continuity of $p, q :X \rightarrow M_n \mathbb(C)$, and (ii), and the total disconnectedess of $X$, find a partition of X into clopen sets $X_1,\cdots, X_k$ and complex matrix $v_1,\cdots,v_k$ such that $\|v_i^*v_i - p(x)\|<1$ and $\|v_iv_i^* - q(x)\|<1$ for all $x \in X_i$. 
Now, define the map $f: X \rightarrow M_n (C)$, $f(x) = v_i$, $x \in X_i$, and notice that $f$ is continuous. Prove that $\|f^*f - p\|<1$ and $\|ff^* - q\| <1$. So $p$ is Murray-von Neumann equivalent the $q$.

