{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $G$ be a finite simple [[graph|00C0BR7D7H]] with vertex set $V$.\nFor disjoint nonempty sets $X, Y \\subseteq V$, let $e(X, Y)$ be the number of edges with one end in $X$ and one in $Y$, and let $d(X, Y) = e(X, Y) / (|X| |Y|)$.\nLet $\\varepsilon \u003e 0$.\nA pair $(A, B)$ of disjoint nonempty sets is *$\\varepsilon$-regular* if $\\abs{d(X, Y) - d(A, B)} \\le \\varepsilon$ whenever $X \\subseteq A$, $Y \\subseteq B$, $|X| \\ge \\varepsilon |A|$ and $|Y| \\ge \\varepsilon |B|$.\nA [[partition|08QMKTWF9T]] $V = V_1 \\cup \\cdots \\cup V_k$ is *equitable* if any two parts differ in size by at most $1$.\n\nFor every $\\varepsilon \u003e 0$ and every integer $m \\ge 1$ there is an integer $M = M(\\varepsilon, m)$ with the following property.\nLet $G$ have at least $m$ vertices.\nThen $G$ has an equitable partition $V_1, \\ldots, V_k$ of its vertex set with $m \\le k \\le M$.\nIn this partition, all but at most $\\varepsilon k^2$ of the pairs $(V_i, V_j)$ with $i \u003c j$ are $\\varepsilon$-regular.\n\n## Remarks\n\nThe proof uses an energy, the mean square of the densities $d(V_i, V_j)$, which lies between $0$ and $1$.\nIf the current partition has too many irregular pairs, the sets $X, Y$ that witness irregularity are used to refine it.\nThen the energy increases by at least a fixed amount depending on $\\varepsilon$.\nSo the process stops after a bounded number of steps.\nEach step multiplies the number of parts by an exponential, so $M$ is a tower of exponentials of height polynomial in $1/\\varepsilon$.\nGowers showed that bounds of tower type are necessary.\n\nThe lemma comes with a counting lemma: if parts $V_1, V_2, V_3$ are pairwise $\\varepsilon$-regular with densities at least $\\delta$ and $\\varepsilon$ is small compared with $\\delta$, then they span many triangles.\nTogether they prove the [[triangle removal lemma|XMS1QRAQZC]] and the [[Erdős–Stone theorem|XZF9BFJFXB]].\n\n## Explanations\n\n### L1 human\n\nEvery large graph, however messy, can be cut into a bounded number of pieces of equal size so that between most pairs of pieces the edges look random.\n\"Look random\" means that the edge density is about the same between any two large subsets of the two pieces.\nThe number of pieces depends only on the accuracy you ask for, not on the size of the graph.\n\n### L2 human\n\nThe lemma replaces a huge graph by a small weighted \"reduced graph\" on the parts, with the densities as weights.\nQuestions about copies of a fixed small graph can then be answered in the reduced graph through the counting lemma.\nThis is the route to the [[triangle removal lemma|XMS1QRAQZC]], to [[Roth's theorem|E7H8NWXESF]], and to the [[Erdős–Stone theorem|XZF9BFJFXB]].\nSzemerédi first proved a version for bipartite graphs as a step towards [[Szemerédi's theorem|B23B0QEMN5]] on arithmetic progressions.\nThe limit object of this point of view is the [[graphon|QMJ5PNSF9X]].\n",
  "commit": "efe85cee8dbc57d85bedbacfb97b99d1b7bee843",
  "front": {
    "about": [
      "SC5QB5F4TE"
    ],
    "kind": "statement",
    "msc": [
      "05C35",
      "05D99"
    ],
    "name": "Szemerédi regularity lemma",
    "role": "lemma",
    "same_as": {
      "wikidata": "Q1295910",
      "wikipedia": "Szemerédi regularity lemma"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Szemerédi_regularity_lemma"
      }
    ],
    "tag": "ETMAPNQY7T",
    "uses": [
      "00C0BR7D7H",
      "08QMKTWF9T"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/ETMAPNQY7T/",
  "links": [
    {
      "field": "about",
      "target": "SC5QB5F4TE"
    },
    {
      "field": "uses",
      "target": "00C0BR7D7H"
    },
    {
      "field": "uses",
      "target": "08QMKTWF9T"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/ETMAPNQY7T.md",
  "msc": [
    "05C35",
    "05D99"
  ],
  "name": "Szemerédi regularity lemma",
  "prov": null,
  "role": "lemma",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/ETM/ETMAPNQY7T.md",
  "status": null,
  "tag": "ETMAPNQY7T",
  "uri": "m2://ETMAPNQY7T",
  "url": "https://math2.tamnd.com/wiki/szemeredi-regularity-lemma/",
  "writing": {
    "tag": "ETMAPNQY7T",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
