Proving congruence using a theorem