Structured proof · Unit 140
lemma IsPrimitiveLabel.isPrimitiveRoot_prod_roots
What it saysLet k be a finite field, c in k[X] and r a natural number with \operatorname{IsPrimitiveLabel}(r, c). Then the product of the roots of c in the algebraic closure of k, counted with multiplicity, is a primitive root of unity of order |k| - 1; and there is a natural number e such that \xi^e equals this product for every root \xi of c in the algebraic closure.
The argument in briefThe roots of the irreducible c are the Frobenius conjugates \xi^{q^i}, i < r, so their product is \xi^{1 + q + \cdots + q^{r-1}} for every root \xi; for the root \xi_0 of order q^r - 1 this power is a primitive (q - 1)-th root of unity.
Unpack \operatorname{IsPrimitiveLabel}(r, c): c is monic, squarefree, of degree r with c(0) nonzero, c is irreducible, and a root \xi_0 of c is a primitive root of unity of order q^r - 1 (q = |k|).
For every root \xi of c in the algebraic closure: \xi^{1 + q + \cdots + q^{r-1}} equals the product of the roots of c, because the roots of the irreducible c are exactly \xi^{q^i}, 0 \le i < r, each once.
Lean states
ξ ^ _ = (c.aroots _).prodHence the product is \xi_0^{(q^r - 1)/(q - 1)} (step 2 for \xi_0), a primitive root of unity of order q - 1 since \xi_0 has order q^r - 1 and (1 + q + \cdots + q^{r-1})(q - 1) = q^r - 1; and the exponent e = 1 + q + \cdots + q^{r-1} of step 2 serves for every root.