Well I'd say use lagrange's formula from group theory, but I'm not sure how to delineate that.
OK say you have the original vector space X, where X has the basis {e1,e2,e3...en}
for a subspace V of X, the basis of V is a subcollection of the basis of X , ie V has a basis {e1,e5,e7,..e(n-1)} say for a grand total of M vectors in the basis.
now consider another subspace U of X, but this one has {e1,e3,e8,...en} , we'll say K vectors, where K<M.
Now consider the basis of the intersection of U and V =W.
If every vector in the basis of U is in W, then W has dimension k. V will have extra basis vectors that U will not have, so Dim(u,v) would be k. where k is the min (dim(U),dim(V))
but that's assuming that every vector on the basis of U is found on the basis of V.
So that means the dim(u,v) would be less than the min(dim(u),dim(v))
like say X has basis {e1,e2,e3,e4,e5,e6}Dim(X)=6 and U has {e1,e4,e5} (dim U=3) and V has {e1,e3,e4,e6} dim(v)=4
then the only vectors on the basis of W would be e1 and e3 , so it'd have dim(2)