◀ THE FOLD0ROOT.AI // WORLD II · GLITCH · OFF BY ONE◆ .dlw.fold
THE FOLD / GLITCH / OFF BY ONE / THE INCLUSION-EXCLUSION

THE INCLUSION-EXCLUSION

add the parts, subtract the overlaps
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Inclusion–exclusion is the exact bookkeeping for counting a union without double-counting. Add the sizes of all the sets, then subtract every pairwise overlap (counted twice), then add back every triple overlap (subtracted too much), and so on with alternating signs: |A₁∪…∪An| = Σ|Ai| - Σ|Ai∩Aj| + Σ|Ai∩Aj∩Ak| - … The same alternating machine counts derangements (permutations fixing no element), surjections, and numbers coprime to a set of primes. It is the ‘off-by-the-overlaps’ correction made exact.

LIT verified live: for thousands of random set systems the alternating sum equals a brute-force union count exactly, and the derangement formula Dn = n!Σ(-1)j/j! matches a brute count of fixed-point-free permutations (D₅ = 44) (window.__inex). FIG no framing; the alternating intersection sum, the brute union, and the derangement count all run in-browser.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at off-by-one — but off by the overlaps: naive addition over-counts every shared element, and inclusion–exclusion is the exact alternating correction that fixes the miscount. AVAN (AI) built the instrument: the alternating intersection sum, the brute-force union cross-check, and the derangement formula.

Credit as content: Abraham de Moivre and Daniel da Silva; formalized by J. J. Sylvester and Henri Poincaré. The weave: David names off-by-one; I confirm the alternating sum equals the true union and counts derangements.
3 ONE DIMENSION
Overlapping sets; add the singles, subtract the pair-overlaps, add back the triple — the alternating tally lands on the true union.
4 TWO DIMENSIONS · INTERACTIVE
New set systems; the alternating sum is compared term-by-term to the brute union, and derangements are checked.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the true size of the union.
AVAN’s addition (the inverse-companion): don’t count the union directly — add the parts and subtract the overlaps. The inverse of ‘how big is the union?’ is ‘the alternating sum over all intersections’, exact once every overlap is corrected. Magenta are the alternating ± overlap corrections; green is the true union they sum to. Miscount, then mend.
LIT Genuine inclusion-exclusion principle (de Moivre, da Silva; formalized by Sylvester and Poincaré). Verified live: for 3000 random set systems the alternating intersection sum equals a brute-force union count exactly, and the derangement formula Dₙ=n!Σ(−1)ʲ/j! matches a brute count of fixed-point-free permutations for n≤8 (D₅=44) (window.__inex.unionOk, .derangeOk).

FIG No framing; the alternating intersection sum, the brute union, and the derangement count all run in-browser. The AVAN inverse is honest — instead of counting the union directly, add the parts and subtract the overlaps: the alternating sum over all intersections, exact once every overlap is corrected. Magenta are the alternating ± overlap corrections; green is the true union they sum to. Miscount, then mend.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of OFF BY ONE · David Lee Wise (ROOT0), with AVAN