Metamath Proof Explorer


Theorem cncongrprm

Description: Corollary 2 of Cancellability of Congruences: Two products with a common factor are congruent modulo a prime number not dividing the common factor iff the other factors are congruent modulo the prime number. (Contributed by AV, 13-Jul-2021)

Ref Expression
Assertion cncongrprm A B C P ¬ P C A C mod P = B C mod P A mod P = B mod P

Proof

Step Hyp Ref Expression
1 prmnn P P
2 1 ad2antrl A B C P ¬ P C P
3 coprm P C ¬ P C P gcd C = 1
4 prmz P P
5 gcdcom P C P gcd C = C gcd P
6 4 5 sylan P C P gcd C = C gcd P
7 6 eqeq1d P C P gcd C = 1 C gcd P = 1
8 3 7 bitrd P C ¬ P C C gcd P = 1
9 8 ancoms C P ¬ P C C gcd P = 1
10 9 biimpd C P ¬ P C C gcd P = 1
11 10 expimpd C P ¬ P C C gcd P = 1
12 11 3ad2ant3 A B C P ¬ P C C gcd P = 1
13 12 imp A B C P ¬ P C C gcd P = 1
14 2 13 jca A B C P ¬ P C P C gcd P = 1
15 cncongrcoprm A B C P C gcd P = 1 A C mod P = B C mod P A mod P = B mod P
16 14 15 syldan A B C P ¬ P C A C mod P = B C mod P A mod P = B mod P