{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $\\F_q$ be the [[finite field|08RTDHX1SK]] with $q$ elements and let $f \\in \\F_q[x]$ be a nonzero polynomial.\nFactoring $f$ over $\\F_q$ means computing its [[factorization into irreducibles|EFDBS6ZME8]] $f = c \\, p_1^{e_1} \\cdots p_k^{e_k}$ in $\\F_q[x]$.\nThe standard algorithms do this in three stages:\n\n1. square-free factorization: write the monic part of $f$ as $g_1 g_2^2 \\cdots g_s^s$, with the $g_i$ square-free and pairwise coprime, using $\\gcd(f, f')$ for the [[formal derivative|0AD4VS02H3]] $f'$;\n2. distinct-degree factorization: for a square-free monic $g$, compute for each $d \\ge 1$ the product $h_d$ of the monic irreducible factors of $g$ of degree $d$;\n3. equal-degree factorization: split each $h_d$ into its irreducible factors of degree $d$.\n\n## Remarks\n\nStage 2 uses that $x^{q^d} - x$ is the product of all monic irreducible polynomials in $\\F_q[x]$ whose degree divides $d$.\nSo $h_1 = \\gcd(g, x^q - x)$, and $h_d$ is the [[gcd|99J1WXG3F7]] of $x^{q^d} - x$ with $g$ divided by $h_1 \\cdots h_{d-1}$.\nIn stage 1, if $f' = 0$ then $f$ is a $p$-th power, where $p$ is the characteristic, since every element of $\\F_q$ is a $p$-th power.\nStage 3 is usually done with a randomised method, such as the Cantor–Zassenhaus algorithm; [[Berlekamp's algorithm|EM8MFGFAGN]] is a deterministic alternative to stages 2 and 3.\nExample: over $\\F_2$, $g = x^3 + 1$ is square-free, $\\gcd(g, x^2 - x) = x + 1$, so $h_1 = x + 1$ and $h_2 = x^2 + x + 1$.\nNon-example: $(x + 1)(x^3 + 1) = (x + 1)^2 (x^2 + x + 1)$ is not square-free, so stage 2 does not apply before stage 1.\n\n## Explanations\n\n### L1 human\n\nFirst take out repeated factors, then sort the factors by degree, then separate factors of the same degree.\nEach stage uses only greatest common divisors and powers modulo $f$.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "XNE7F0BAGE",
    "kind": "definition",
    "msc": [
      "11T06",
      "12E20",
      "11Y16"
    ],
    "name": "Factorization of polynomials over finite fields",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Factorization_of_polynomials_over_finite_fields"
      }
    ],
    "tag": "XXQ378NQE2",
    "uses": [
      "08RTDHX1SK",
      "EFDBS6ZME8",
      "99J1WXG3F7",
      "0AD4VS02H3"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/XXQ378NQE2/",
  "links": [
    {
      "field": "defines",
      "target": "XNE7F0BAGE"
    },
    {
      "field": "uses",
      "target": "08RTDHX1SK"
    },
    {
      "field": "uses",
      "target": "EFDBS6ZME8"
    },
    {
      "field": "uses",
      "target": "99J1WXG3F7"
    },
    {
      "field": "uses",
      "target": "0AD4VS02H3"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/XXQ378NQE2.md",
  "msc": [
    "11T06",
    "12E20",
    "11Y16"
  ],
  "name": "Factorization of polynomials over finite fields",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/XXQ/XXQ378NQE2.md",
  "status": null,
  "tag": "XXQ378NQE2",
  "uri": "m2://XXQ378NQE2",
  "url": "https://math2.tamnd.com/wiki/factorization-of-polynomials-over-finite-fields-definition/",
  "writing": {
    "tag": "XXQ378NQE2",
    "kind": "definition",
    "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
      }
    ]
  }
}
