Integers mod n #
Definition of the integers mod n, and the field structure on the integers mod p.
Definitions #
val a is a natural number defined as:
- for
a : ZMod 0it is the absolute value ofa - for
a : ZMod nwith0 < nit is the least natural number in the equivalence class
See ZMod.valMinAbs for a variant that takes values in the integers.
Equations
Instances For
This lemma works in the case in which ZMod n is not infinite, i.e. n โ 0. The version
where a โ 0 is addOrderOf_coe'.
This lemma works in the case in which a โ 0. The version where
ZMod n is not infinite, i.e. n โ 0, is addOrderOf_coe.
We have that ringChar (ZMod n) = n.
Cast an integer modulo n to another semiring.
This function is a morphism if the characteristic of R divides n.
See ZMod.castHom for a bundled version.
Equations
Instances For
So-named because the coercion is Nat.cast into ZMod. For Nat.cast into an arbitrary ring,
see ZMod.natCast_val.
So-named because the outer coercion is Int.cast into ZMod. For Int.cast into an arbitrary
ring, see ZMod.intCast_cast.
If the characteristic of R divides n, then cast is a homomorphism.
Some specialised simp lemmas which apply when R has characteristic n.
The unique ring isomorphism between ZMod n and a ring R
of characteristic n and cardinality n.
Equations
Instances For
The unique ring isomorphism between ZMod p and a ring R of cardinality a prime p.
If you need any property of this isomorphism, first of all use ringEquivOfPrime_eq_ringEquiv
below (after have : CharP R p := ...) and deduce it by the results about ZMod.ringEquiv.
Equations
Instances For
Alias of the reverse direction of ZMod.intCast_eq_zero_iff_even.
Alias of ZMod.natCast_eq_zero_iff_even.
Alias of the reverse direction of ZMod.natCast_eq_zero_iff_even.
Alias of the reverse direction of ZMod.intCast_eq_one_iff_odd.
Alias of ZMod.natCast_eq_one_iff_odd.
Alias of the reverse direction of ZMod.natCast_eq_one_iff_odd.
Alias of ZMod.natCast_ne_zero_iff_odd.
unitOfCoprime makes an element of (ZMod n)หฃ given
a natural number x and a proof that x is coprime to n
Equations
Instances For
The Chinese remainder theorem. For a pair of coprime natural numbers, m and n,
the rings ZMod (m * n) and ZMod m ร ZMod n are isomorphic.
See Ideal.quotientInfRingEquivPiQuotient for the Chinese remainder theorem for ideals in any
ring.
Equations
Instances For
Any ring homomorphism into ZMod n has a right inverse.
Any ring homomorphism into ZMod n is surjective.
Groups of bounded torsion #
For G a group and n a natural number, G having torsion dividing n
(โ x : G, n โข x = 0) can be derived from Module R G where R has characteristic dividing n.
It is however painful to have the API for such groups G stated in this generality, as R does not
appear anywhere in the lemmas' return type. Instead of writing the API in terms of a general R, we
therefore specialise to the canonical ring of order n, namely ZMod n.
This spelling Module (ZMod n) G has the extra advantage of providing the canonical action by
ZMod n. It is however Type-valued, so we might want to acquire a Prop-valued version in the
future.
This cannot be made an instance because of the [Module (ZMod n) G] argument and the fact that
n only appears in the second argument of SMulMemClass, which is an OutParam.