{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $A_1, \\dots, A_n$ be finite sets.\nFor a nonempty set $I \\subseteq \\{1, \\dots, n\\}$, let $A_I = \\bigcap_{i \\in I} A_i$.\nThen\n$$\\left| \\bigcup_{i=1}^{n} A_i \\right| = \\sum_{\\varnothing \\neq I \\subseteq \\{1, \\dots, n\\}} (-1)^{|I| + 1} |A_I|.$$\n\n## Remarks\n\nFor $n = 2$ this is [[inclusion–exclusion for two sets|0C4YEQ9H5E]].\nA common use counts the elements of a finite set $U$ that are in none of the sets $A_i \\subseteq U$. This number is $\\sum_{I} (-1)^{|I|} |A_I|$, over all $I$, with $A_\\varnothing = U$.\nThe [[formula for the number of derangements|03RSJXF728]] follows in this way.\n\n## Explanations\n\n### L1 human\n\nAdd the sizes of the single sets, subtract the sizes of the pairwise intersections, add the sizes of the triple intersections, and so on.\nEach element of the union is then counted exactly once in total.\n",
  "commit": "545acf83a9b75c8ddc375ef8b23d2ae101a4d7e4",
  "front": {
    "kind": "statement",
    "msc": [
      "05A05"
    ],
    "name": "Inclusion–exclusion principle",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q849335",
      "wikipedia": "Inclusion–exclusion principle"
    },
    "sources": [
      {
        "locator": "Formula",
        "url": "https://en.wikipedia.org/wiki/Inclusion–exclusion_principle"
      }
    ],
    "tag": "0FF7726C7P",
    "uses": [
      "05099E1NMJ",
      "0C4YEQ9H5E"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/0FF7726C7P/",
  "links": [
    {
      "field": "uses",
      "target": "05099E1NMJ"
    },
    {
      "field": "uses",
      "target": "0C4YEQ9H5E"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0FF7726C7P.md",
  "msc": [
    "05A05"
  ],
  "name": "Inclusion–exclusion principle",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0FF/0FF7726C7P.md",
  "status": null,
  "tag": "0FF7726C7P",
  "uri": "m2://0FF7726C7P",
  "url": "https://math2.tamnd.com/wiki/inclusion-exclusion-principle/",
  "writing": {
    "tag": "0FF7726C7P",
    "kind": "statement",
    "level": "W1",
    "next": [
      {
        "what": "edge about out",
        "note": "the concepts that the statement is about",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge proves in",
        "note": "at least one proof node",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of or illustrates in",
        "note": "one example that shows the statement at work",
        "have": 0,
        "want": 1
      },
      {
        "what": "explanation L2",
        "have": 0,
        "want": 1
      }
    ]
  }
}
