Treat $A,B, A|B$ as linear map form $R^n, R^k, R^{n+k}$ respectively to $R^m$.
By rank-nullity, the equality is
$(n+k)-dim(R(A|B)) = n-dim(R(A)) + k-dim(R(B)) + dim(R(A) \cap R(B))$
$dim(R(A|B)) = dim(R(A)) + dim(R(B)) - dim(R(A) \cap R(B))$
If we prove $R(A|B)=R(A)+R(B)$, the equality is equvalent to dimension fomula of $R(A)+R(B)$: $dim(R(A)+R(B)) = dim(R(A)) + dim(R(B)) - dim(R(A) \cap R(B))$
This formula is true, you can see:Dimension of the sum of two vector subspaces
Here is the rest of the proof($R(A|B)=R(A)+R(B)$):
For $x \in R(A)+R(B)$, there exist $v_a,v_b$ s.t. $x=Av_a+Bv_b$.
Let $v$ be (n+k)-vector with first n slots $v_a$ and last k slot $v_b$.
Then $x=(A|B)v \in R(A|B)$
Similarly, $x\in R(A|B)$, then $x=(A|B)v $ for some v.
Let $v_a$ be first n slots of v, $v_b$ be last k slots of v. Then $x=Av_a+Bv_b\in R(A)+R(B)$.
