Multiples of a divisor in ZMod N #
For d ∣ N, the residues x : ZMod N whose canonical value x.val is divisible by d are
exactly the subgroup generated by d, and there are N / d of them. The additive order of a
residue y is N / gcd(N, y.val).
Main results #
ZMod.mem_zmultiples_iff_dvd_val:x ∈ zmultiples (d : ZMod N) ↔ d ∣ x.valwhend ∣ N.ZMod.card_filter_dvd_val:#{x : ZMod N | d ∣ x.val} = N / dwhend ∣ N.ZMod.filter_dvd_val_nonempty: that set is nonempty.ZMod.addOrderOf_eq_div_gcd_val:addOrderOf y = N / gcd(N, y.val).