An application of the Inclusion Principle to Chemistry? (Proof Verification)
It is nice that you can do rigorous math with electron counting rules but I should advise you that they are only heuristic rules used to rationalize the structure of molecules, reactivity etc. Well, they are quite accurate but to know the distribution of electrons in the molecule one has to perform a measurement or apply a quantum mechanical model, both depict a more complicated pattern. Moreover, you would not know how to assign electrons because you would not know where is the boundary between one atom and others, not to mention what is the bonding region.
Nevertheless, many people has worked in that direction because it is important to rationalize the properties of molecules in terms of their constituents. Some researchers have come to the conclusion that the best way is to partition the real space where the molecule "lives" and then count electrons integrating the electronic distribution $|\Psi|^2$ in these regions. So, instead of applying the inclusion principle in the model you brought to the table I suggest you to find out that the probability of finding exactly an integer number of electrons $\nu$ in a region of the Euclidean space $\Omega$ (an atom for instance) is given by the formula $$ p(\nu) = \frac{1}{v!} \sum_{i=0,N-\nu} \frac{(-1)^i}{i!} \int_\Omega \Gamma^{(\nu+i)} $$ where $N$ is the total number of electrons in the molecule, that is broken in two regions ($\mathbb{R}^3 = \Omega + \Omega^c$), and $$\Gamma^{(m)} = \frac{N!}{(N-m)!} \int |\Psi|^2 \, d\pmb r_{m+1} \cdots d\pmb r_{N} $$ is a reduced density matrix of order $m$, whose integration $$ \int_\Omega \Gamma^{(m)} $$ means the average number of electrons in $\Omega$ when $m=1$, average number of electron pairs when $m=2$, and so on up to $N$.
You will find the equation and the details here. I am pretty sure that it follows applying the inclusion principle. I did it once but not totally rigorous.
If you like this topic you will enjoy another article that describes the same probabilities with a more mathematical treatment.
I arrived at the same conclusion using another approach. My approach is to let $G(X,E)$ be a graph whose vertices are the atoms $X_i$, and the edges are the bonds $b_{ij}=(X_i,X_j)$. And using your definition of $H_i$ and $N_i$ , we observe that for all vertices:$$H_i +\deg(X_i) = N_i$$ Since degree of an atom corresponds to the number of bonds that atom made, number of electrons needed in the final configuration is just the number of electrons already existing in the atom and the ones that are gained by bonds and since each bond brings another electron this statement holds. Then, using Handshaking lemma:$$ \sum_{X_i\in{X}}\deg(X_i)=2|E|=2B \\ \sum_{X_i\in{X}}\deg(X_i)=\sum_{X_i\in{X}}(N_i-H_i)=N-H \\ B=\frac{N-H}{2}$$