Let me formulate the problem this way:
Vector space [tex]\ V_1[/tex] contains [tex]\ n_1[/tex] linearly indipendent vectors.Hence the basis set is:
[tex]\ B_1 = {|\ u_1>,|\ u_2>, |\ u_3>...|\ u_i>,...|\ u_k>,...|\ u_n1>}[/tex]
Similarly,vector space [tex]\ V_2[/tex] contains [tex]\ n_2[/tex] linearly indipendent vectors. Hence, the basis set is:
[tex]\ B_2 = {|\ v_1>,|\ v_2>, |\ v_3>...|\ v_p>,...|\ v_r>,...|\ v_n2>}[/tex]
Given:
[tex]<\ u_i|\ u_k>=0[/tex]......A [for all i,j,k in the set [1,2,...,n1]]
[tex]<\ v_p|\ v_r>=0[/tex]......B [for all p,q,r in the set [1,2,...,n2]]
Additionally, [tex]<\ u_i|\ v_p>=0[/tex]...C [for all i,j,k,...p,q,r]
Let us consider the set:
[tex]\ B'={|\ u_1>,|\ u_2>,...|\ u_n1,|\ v_1>,|\ v_2>,...|\ v_n2>}[/tex]
containing [tex]\ n_1+\ n_2[/tex] linearly indipendent vectors.
The basis set [tex]\ B[/tex] for the vector space [tex]\ V[/tex]will be a subset of this.The number of elements in the set [tex]\ B[/tex] will be less than or equal to [tex]\ n_1+\ n_2[/tex] depending on whether all the [tex]\ n_1[/tex] vectors in [tex]\ B_1[/tex] are orthogonal to all [tex]\ n_2[/tex] vectors in [tex]\ B_2[/tex].
Since,we have C satisfied by all [tex]\ u_i[/tex] and [tex]\ v_p[/tex],
[tex]\ B=\ B_1 \ U \ B_2[/tex] has all distinct elements because of A,B and C.So, there are total [tex]\ n_1+\ n_2[/tex] elements.All of them are linearly indipendent of each other. And they are therefore, a good choice of basis of the vector space V.
Hence, the vector space V is spanned by [tex]\ n_1+\ n_2[/tex] vectors.No more,no less.Insertion of any non-trivial extra element in [tex]\ B'[/tex] will result in [tex]\ n_1+\n_2+\1[/tex] vectors and the set of vectors will be lineraly dependent.
With our choice, [tex]\ B=\ B'[/tex].Any vector in vector space V can be written as a linear combination of those [tex]\ n_1+\ n_2[/tex] vectors in [tex]\ B[/tex].So, the dimension of the vector space [tex]\ V[/tex] will be [tex]\ n_1+\ n_2[/tex]