Applying ZMod.finEquiv #
Mathlib defines ZMod.finEquiv : Fin n ≃+* ZMod n for [NeZero n] and states nothing about
applying it. This file states the two evaluation rules as @[simp] lemmas, so that an argument
indexed by Fin n rewrites into ZMod n arithmetic instead of being unfolded at each use.
Main results #
ZMod.finEquiv_apply:ZMod.finEquiv n jis the natural cast ofj.val.ZMod.finEquiv_symm_apply_val: it is(ZMod.finEquiv n).symmthat produces the canonicalFin nrepresentative of an element ofZMod n, and that representative's coerced natural value is the element'sval.TauCeti.mulModEquiv: multiplication bydmodulopas a permutation ofFin p, fordcoprime top, with its evaluation ruleTauCeti.mulModEquiv_apply_val. These take a modulus rather than aZModvalue, so they are not dot notation onZModand live inTauCeti.
Applying ZMod.finEquiv is the natural cast. ZMod.finEquiv n j is the image of j.val
under Nat.cast.
Mathlib defines finEquiv and states no evaluation rule for it in either direction, so this is
the lemma a Fin n-indexed statement rewrites through to reach ZMod n.
The canonical Fin n representative of z : ZMod n has natural value z.val. The
representative is produced by (ZMod.finEquiv n).symm, not by finEquiv itself, which maps the
other way. This is the companion of finEquiv_apply, and the form needed to index by Fin n an
element obtained by solving in ZMod n.
Multiplication by a unit permutes the residues: for d coprime to p, the map
b ↦ d b mod p is a permutation of Fin p. It is multiplication by the unit
ZMod.unitOfCoprime d hdp of ZMod p, read through ZMod.finEquiv.
Equations
- TauCeti.mulModEquiv p hdp = (ZMod.finEquiv p).trans (Equiv.trans (ZMod.unitOfCoprime d hdp).mulLeft (ZMod.finEquiv p).symm)
Instances For
The value of TauCeti.mulModEquiv: it sends b to the residue d b mod p.