Witnesses for odd composite moduli #
The Solovay–Strassen and Miller–Rabin bounds Solovay and Strassen
Rabin show that the bases fooling a primality test modulo an odd composite n lie in a
proper subgroup of (ZMod n)ˣ, hence make up at most half of the units. Both proofs split an odd
composite n into one of two shapes and build a unit witness for each; this file collects the
shared facts.
Main results #
Subgroup.two_mul_card_le_of_ne_top: a proper subgroup of a finite group has at most half of its elements.Nat.exists_sq_dvd_or_eq_mul_coprime: an odd composite number is divisible by the square of an odd prime, or is the product of an odd primepand an oddq > 1coprime top.ZMod.exists_unit_castHom_eq: the Chinese remainder theorem for units.ZMod.exists_unit_pow_of_sq_dvd: ifp ^ 2 ∣ nfor an odd primep, then the unit1 + n / pmodulonhasp ∣ mwhenever itsm-th power is1, and no power equal to-1.