While solving Advent of Code Day 11 part 2, the implementation involved taking some number X and multiplying or adding some other constants to it 10,000 times and taking each partial product or sum and bucketing it based on modulo some number Q. Each bucket has it's own Q, so to preserve the correct bucketing behavior and finish processing in a reasonable amount time it induces you to take the modulo of X by the product of all Qs. Technically, it is the the lcm(q1, q2, ...) but all Qs were prime.
The solution seems to rely on the property that x % q == (x % q*a) % q
where q and a are not zero. It seems true, and it was sufficient to solve the problem. How do I prove this?
$$ x \cong (x\ \text{mod}\ qa)\ \text{mod}\ q $$