A simple implementation of intersecting subspaces specified by a basis

BeginPackage["QuantumGroups`Utilities`IntersectSubspaces`"]

IntersectSubspaces::usage="IntersectSubspaces[n,(Subscript[β, 1]),(Subscript[β, 2]),...] gives a basis for the intersection of the subspaces of \!\(\*SuperscriptBox[\(A\), \(\(n\)\(\\ \)\)]\)spanned by the (Subscript[β, i]).";

Begin["`Private`"];

IntersectSubspaces[n_,{}]:=IdentityMatrix[n]

IntersectSubspaces[n_,{basis_}]:=basis

IntersectSubspaces[n_,{{},_}]:={}
IntersectSubspaces[n_,{_,{}}]:={}

IntersectSubspaces[n_,{basis1_,basis2_}]:=NullSpace[Join@@(NullSpace/@{basis1,basis2})]

IntersectSubspaces[n_,{basis1_,basis2_,bases__}]:=IntersectSubspaces[n,{basis1,IntersectSubspaces[n,{basis2,bases}]}]

End[];

EndPackage[];