For bounded weak compositions, start with the unrestricted stars and bars set and let be its subset where . For an index subset , subtract from each coordinate with . This is a bijection from to nonnegative tuples summing to
Thus
where a negative remaining sum gives zero, in accordance with the stipulated convention. Apply the avoidance form of the inclusion-exclusion principle:
Expanding by subset size gives the alternating single-index, pair-index and higher-index sums. The empty subset supplies .