Metamath Proof Explorer


Theorem cncongr2

Description: The other direction of the bicondition in cncongr . (Contributed by AV, 11-Jul-2021)

Ref Expression
Assertion cncongr2 A B C N M = N C gcd N A mod M = B mod M A C mod N = B C mod N

Proof

Step Hyp Ref Expression
1 zcn A A
2 1 mul01d A A 0 = 0
3 2 3ad2ant1 A B C A 0 = 0
4 zcn B B
5 4 mul01d B B 0 = 0
6 5 3ad2ant2 A B C B 0 = 0
7 3 6 eqtr4d A B C A 0 = B 0
8 7 adantr A B C N M = N C gcd N A 0 = B 0
9 8 oveq1d A B C N M = N C gcd N A 0 mod N = B 0 mod N
10 9 adantr A B C N M = N C gcd N A mod M = B mod M A 0 mod N = B 0 mod N
11 oveq2 C = 0 A C = A 0
12 11 oveq1d C = 0 A C mod N = A 0 mod N
13 oveq2 C = 0 B C = B 0
14 13 oveq1d C = 0 B C mod N = B 0 mod N
15 12 14 eqeq12d C = 0 A C mod N = B C mod N A 0 mod N = B 0 mod N
16 10 15 syl5ibr C = 0 A B C N M = N C gcd N A mod M = B mod M A C mod N = B C mod N
17 oveq2 M = N C gcd N A mod M = A mod N C gcd N
18 oveq2 M = N C gcd N B mod M = B mod N C gcd N
19 17 18 eqeq12d M = N C gcd N A mod M = B mod M A mod N C gcd N = B mod N C gcd N
20 19 adantl N M = N C gcd N A mod M = B mod M A mod N C gcd N = B mod N C gcd N
21 20 adantl A B C N M = N C gcd N A mod M = B mod M A mod N C gcd N = B mod N C gcd N
22 simpl N M = N C gcd N N
23 simp3 A B C C
24 divgcdnnr N C N C gcd N
25 22 23 24 syl2anr A B C N M = N C gcd N N C gcd N
26 simpl1 A B C N M = N C gcd N A
27 simpl2 A B C N M = N C gcd N B
28 moddvds N C gcd N A B A mod N C gcd N = B mod N C gcd N N C gcd N A B
29 25 26 27 28 syl3anc A B C N M = N C gcd N A mod N C gcd N = B mod N C gcd N N C gcd N A B
30 25 nnzd A B C N M = N C gcd N N C gcd N
31 zsubcl A B A B
32 31 3adant3 A B C A B
33 32 adantr A B C N M = N C gcd N A B
34 30 33 jca A B C N M = N C gcd N N C gcd N A B
35 divides N C gcd N A B N C gcd N A B k k N C gcd N = A B
36 34 35 syl A B C N M = N C gcd N N C gcd N A B k k N C gcd N = A B
37 21 29 36 3bitrd A B C N M = N C gcd N A mod M = B mod M k k N C gcd N = A B
38 simpr A B C N M = N C gcd N C 0 k k
39 30 adantr A B C N M = N C gcd N C 0 N C gcd N
40 39 adantr A B C N M = N C gcd N C 0 k N C gcd N
41 38 40 zmulcld A B C N M = N C gcd N C 0 k k N C gcd N
42 41 zcnd A B C N M = N C gcd N C 0 k k N C gcd N
43 31 zcnd A B A B
44 43 3adant3 A B C A B
45 44 ad3antrrr A B C N M = N C gcd N C 0 k A B
46 23 zcnd A B C C
47 46 ad3antrrr A B C N M = N C gcd N C 0 k C
48 simpr A B C N M = N C gcd N C 0 C 0
49 48 adantr A B C N M = N C gcd N C 0 k C 0
50 42 45 47 49 mulcan2d A B C N M = N C gcd N C 0 k k N C gcd N C = A B C k N C gcd N = A B
51 zcn C C
52 subdir A B C A B C = A C B C
53 1 4 51 52 syl3an A B C A B C = A C B C
54 53 ad3antrrr A B C N M = N C gcd N C 0 k A B C = A C B C
55 54 eqeq2d A B C N M = N C gcd N C 0 k k N C gcd N C = A B C k N C gcd N C = A C B C
56 50 55 bitr3d A B C N M = N C gcd N C 0 k k N C gcd N = A B k N C gcd N C = A C B C
57 nnz N N
58 57 adantr N k N
59 simpr N k k
60 59 zcnd N k k
61 60 adantl A B C N k k
62 46 adantr A B C N k C
63 simpl N k N
64 63 nnzd N k N
65 23 64 anim12i A B C N k C N
66 gcdcl C N C gcd N 0
67 65 66 syl A B C N k C gcd N 0
68 67 nn0cnd A B C N k C gcd N
69 nnne0 N N 0
70 69 neneqd N ¬ N = 0
71 70 adantr N k ¬ N = 0
72 71 adantl A B C N k ¬ N = 0
73 72 intnand A B C N k ¬ C = 0 N = 0
74 gcdeq0 C N C gcd N = 0 C = 0 N = 0
75 65 74 syl A B C N k C gcd N = 0 C = 0 N = 0
76 75 necon3abid A B C N k C gcd N 0 ¬ C = 0 N = 0
77 73 76 mpbird A B C N k C gcd N 0
78 61 62 68 77 divassd A B C N k k C C gcd N = k C C gcd N
79 59 adantl A B C N k k
80 57 69 jca N N N 0
81 80 adantr N k N N 0
82 23 81 anim12i A B C N k C N N 0
83 3anass C N N 0 C N N 0
84 82 83 sylibr A B C N k C N N 0
85 divgcdz C N N 0 C C gcd N
86 84 85 syl A B C N k C C gcd N
87 79 86 zmulcld A B C N k k C C gcd N
88 78 87 eqeltrd A B C N k k C C gcd N
89 dvdsmul1 N k C C gcd N N N k C C gcd N
90 58 88 89 syl2an2 A B C N k N N k C C gcd N
91 63 nncnd N k N
92 91 adantl A B C N k N
93 divmulasscom k N C C gcd N C gcd N 0 k N C gcd N C = N k C C gcd N
94 61 92 62 68 77 93 syl32anc A B C N k k N C gcd N C = N k C C gcd N
95 90 94 breqtrrd A B C N k N k N C gcd N C
96 95 exp32 A B C N k N k N C gcd N C
97 96 adantrd A B C N M = N C gcd N k N k N C gcd N C
98 97 imp A B C N M = N C gcd N k N k N C gcd N C
99 98 adantr A B C N M = N C gcd N C 0 k N k N C gcd N C
100 99 imp A B C N M = N C gcd N C 0 k N k N C gcd N C
101 breq2 k N C gcd N C = A C B C N k N C gcd N C N A C B C
102 100 101 syl5ibcom A B C N M = N C gcd N C 0 k k N C gcd N C = A C B C N A C B C
103 56 102 sylbid A B C N M = N C gcd N C 0 k k N C gcd N = A B N A C B C
104 103 rexlimdva A B C N M = N C gcd N C 0 k k N C gcd N = A B N A C B C
105 22 adantl A B C N M = N C gcd N N
106 zmulcl A C A C
107 106 3adant2 A B C A C
108 107 adantr A B C N M = N C gcd N A C
109 zmulcl B C B C
110 109 3adant1 A B C B C
111 110 adantr A B C N M = N C gcd N B C
112 moddvds N A C B C A C mod N = B C mod N N A C B C
113 105 108 111 112 syl3anc A B C N M = N C gcd N A C mod N = B C mod N N A C B C
114 113 adantr A B C N M = N C gcd N C 0 A C mod N = B C mod N N A C B C
115 104 114 sylibrd A B C N M = N C gcd N C 0 k k N C gcd N = A B A C mod N = B C mod N
116 115 ex A B C N M = N C gcd N C 0 k k N C gcd N = A B A C mod N = B C mod N
117 116 com23 A B C N M = N C gcd N k k N C gcd N = A B C 0 A C mod N = B C mod N
118 37 117 sylbid A B C N M = N C gcd N A mod M = B mod M C 0 A C mod N = B C mod N
119 118 imp A B C N M = N C gcd N A mod M = B mod M C 0 A C mod N = B C mod N
120 119 com12 C 0 A B C N M = N C gcd N A mod M = B mod M A C mod N = B C mod N
121 16 120 pm2.61ine A B C N M = N C gcd N A mod M = B mod M A C mod N = B C mod N
122 121 ex A B C N M = N C gcd N A mod M = B mod M A C mod N = B C mod N