The Chinese remainder theorem on units, and squares modulo a prime #
For coprime p and q, the Chinese remainder isomorphism ZMod (p * q) ≃+* ZMod p × ZMod q
restricts to the unit groups. A unit modulo p * q is a square exactly when both of its
components are, and half of the units modulo an odd prime are squares. These facts underlie the
quadratic residuosity assumption and Goldwasser–Micali decryption ([KL20],
Section 15.4).
Main definitions #
ZMod.unitsChineseRemainder:(ZMod (p * q))ˣ ≃* (ZMod p)ˣ × (ZMod q)ˣfor coprimep,q.
Main results #
ZMod.coe_unitsChineseRemainder_fst,ZMod.coe_unitsChineseRemainder_snd: the components are the images under the Chinese remainder isomorphism.ZMod.isSquare_iff_unitsChineseRemainder: a unit modulop * qis a square iff both components are.ZMod.two_mul_card_squares_units,ZMod.card_nonsquares_units: an odd primephas as many square units as nonsquare units,(p - 1) / 2of each.ZMod.isSquare_mul_of_not_isSquare_units: the product of two nonsquare units modulo a prime is a square.
References #
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, Section 15.4.
The first component of unitsChineseRemainder h u is the first component of the Chinese
remainder image of u.
The second component of unitsChineseRemainder h u is the second component of the Chinese
remainder image of u.