Finite Field Basic #
In this file we introduce some generally helpful lemmas for the finite field F with
q fulfilling IsPrimePow/Prime, Fintype.card F = q and q % 4 = 3.
The assumption IsPrimePow q of [bernstein2013a] never has to be stated: by
card_isPrimePow it is a consequence of Fintype.card F = q, so q ranges over exactly the
prime powers congruent to 3 modulo 4. Conversely, prime_of_natCast_surjective shows that
representing field elements by the naturals 0, 1, …, q - 1, as the string encoding of
Section 3.4 does, is possible only when q is prime.
References #
See [bernstein2013a] for the original account on this specifc finite field.
The cardinality of a finite field is always a prime power.
This is why no statement of this development has to assume IsPrimePow q: the hypothesis
Fintype.card F = q already forces q to be a prime power, so all results proved for a finite
field F with Fintype.card F = q and q % 4 = 3 are exactly the results of [bernstein2013a]
for an arbitrary prime power q ≡ 3 (mod 4).
If some algebraic identity would force -1 to be a square, contradiction - -1 is never
a square when q % 4 = 3. A common closing step for the r/d nonvanishing proofs.
The cast Fin q → F is injective
Every element of F is the cast of some n : Fin q:
this cast is injective and Fin q and F have the same cardinality, so it is bijective.
A natural number q is the cardinality of some finite field iff it is a prime power.
Together with Elligator.FiniteFieldBasic.card_isPrimePow this says that the standing
hypotheses Fintype.card F = q, q % 4 = 3 of this development describe exactly the setting of
[bernstein2013a], Section 3.1: an arbitrary prime power q ≡ 3 (mod 4).
If every element of F is the image of a natural number under the canonical cast, then the
cardinality of F is prime, not merely a prime power.
This is the precise reason why the string encoding ι of [bernstein2013a], Section 3.4, is
formalized for prime q only: it represents field elements by the naturals
0, 1, ..., q - 1, which requires the natural casts to exhaust F. The ϕ part of the
development makes no such assumption and therefore covers all prime powers.