We start with three preliminary observations.
Let U,V be two arbitrary subsets of G. For each x∈U and
y∈V there is a unique z∈G for which xyz=e. Therefore,
NUVG=∣U×V∣=∣U∣⋅∣V∣.(1)
Second, the equation xyz=e is equivalent to yzx=e and
zxy=e. For arbitrary sets U,V,W⊂G, this implies
{(x,y,z)∈U×V×W:xyz=e}={(x,y,z)∈U×V×W:yzx=e}={(x,y,z)∈U×V×W:zxy=e}
and therefore
NUVW=NVWU=NWUV.(2)
Third, if U,V⊂G and W1,W2,W3 are disjoint sets and
W=W1∪W2∪W3 then, for arbitrary
U,V⊂G,
{(x,y,z)∈U×V×W:xyz=e}={(x,y,z)∈U×V×W1:xyz=e}∪∪{(x,y,z)∈U×V×W2:xyz=e}∪{(x,y,z)∈U×V×W3:xyz=e}
so
NUVW=NUVW1+NUVW2+NUVW3.(3)
Applying these observations, the statement follows as
NABC=NABG−NABA−NABB=∣A∣⋅∣B∣−NBAA−NBAB==NBAG−NBAA−NBAB=NBAC=NCBA.