Prove that $\dim(U) - \dim (V) + \dim(W) - \dim(X) = 0$

Solution 1:

Hint: If $f:U\rightarrow V$ is a linear mapping, then $U/\ker (f)$ is isomorphic to $im(V)$ and so $\dim U = \dim\ker(f) + \dim im(V)$.

Solution 2:

using rank-nullity thm 3 times,
$\dim(U)=\dim(ker(f))+\dim(im(f))$
$\dim(V)=\dim(ker(g))+\dim(im(g))$
$\dim(W)=\dim(ker(h))+\dim(im(h))$

f is injective $\implies ker(f)=\phi$
h is surjective $\implies im(h)=X$

$\dim(U)-\dim(V)+\dim(W)-\dim(X)$
$=\dim(ker(f))+ (\dim(im(f))-\dim(ker(g))) + (-\dim(im(g))+\dim(ker(h))) + (\dim(im(h))-\dim(X))$
$=\dim(\phi)=0$

to address OP's claim "... $\dim(W)=\dim(X)=0$", this is not true. one counterexample is let all the vector spaces be $\mathbb R$ , f and h be identity maps , g be the zero map. then f and h are bijective, $im(f)=\mathbb R=ker(g)$ and $im(g)=0=ker(h)$.

note: $U \xrightarrow{f} V \xrightarrow{g} W \xrightarrow{h} X$ is an exact sequence.
special case of Dimensions of vector spaces in an exact sequence