Cyclicity of the units of ZMod n #
ZMod.isCyclic_units_iff : (ZMod n)ˣ is cyclic iff
one of the following mutually exclusive cases happens:
n = 0(thenZMod 0 ≃+* ℤand the group of units is cyclic of order 2);n = 1,2or4nis a powerp ^ eof an odd prime number, or twice such a power (with1 ≤ e).
The individual cases are proved by inferInstance and are
also directly provided by :
The case of prime numbers is also an instance:
ZMod.not_isCyclic_units_eight:(ZMod 8)ˣis not cyclicZMod.orderOf_one_add_mul_prime: the order of1 + a * pmodulop ^ (n + 1)isp ^ nwhenpdoes not dividea.ZMod.orderOf_five: the order of5modulo2 ^ (n + 2)is2 ^ n.ZMod.isCyclic_units_of_prime_pow: the case of odd prime powersZMod.isCyclic_units_two_pow_iff:(ZMod (2 ^ n))ˣis cyclic iffn ≤ 2.ZMod.isComplement'_zpowers_unitFive_neg_one: the subgroups generated by5and by-1are complements in(ZMod (2 ^ n))ˣ.ZMod.zpowers_mk_unitFive_eq_top: the class of5generates the quotient of(ZMod (2 ^ n))ˣby⟨-1⟩, which is thus cyclic (ZMod.isCyclic_units_two_pow_quotient_neg_one).
The proofs mostly follow [Ireland and Rosen, A classical introduction to modern number theory, chapter 4] [IR90].
The subgroups generated by 5 and by -1 in (ZMod (2 ^ n))ˣ are disjoint.
The subgroups generated by 5 and by -1 are complements in (ZMod (2 ^ n))ˣ.
The class of 5 generates the quotient of (ZMod (2 ^ n))ˣ by ⟨-1⟩.
The quotient of (ZMod (2 ^ n))ˣ by ⟨-1⟩ is cyclic.