A sum is a direct sum if and only if dimensions add up

Suppose VV is finite-dimensional and U1,,UmU_1,\dots,U_m are subspaces of VV. Then U1++UmU_1+\dots+U_m is a direct sum if and only if

dim(U1++Um)=dimU1++dimUm\dim(U_1+\dots+U_m) = \dim U_1 + \dots + \dim U_m