Metamath Proof Explorer


Theorem modprmn0modprm0

Description: For an integer not being 0 modulo a given prime number and a nonnegative integer less than the prime number, there is always a second nonnegative integer (less than the given prime number) so that the sum of this second nonnegative integer multiplied with the integer and the first nonnegative integer is 0 ( modulo the given prime number). (Contributed by Alexander van der Vekens, 10-Nov-2018)

Ref Expression
Assertion modprmn0modprm0 P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P = 0

Proof

Step Hyp Ref Expression
1 simpl1 P N N mod P 0 I 0 ..^ P P
2 prmnn P P
3 zmodfzo N P N mod P 0 ..^ P
4 2 3 sylan2 N P N mod P 0 ..^ P
5 4 ancoms P N N mod P 0 ..^ P
6 5 3adant3 P N N mod P 0 N mod P 0 ..^ P
7 fzo1fzo0n0 N mod P 1 ..^ P N mod P 0 ..^ P N mod P 0
8 7 simplbi2com N mod P 0 N mod P 0 ..^ P N mod P 1 ..^ P
9 8 3ad2ant3 P N N mod P 0 N mod P 0 ..^ P N mod P 1 ..^ P
10 6 9 mpd P N N mod P 0 N mod P 1 ..^ P
11 10 adantr P N N mod P 0 I 0 ..^ P N mod P 1 ..^ P
12 simpr P N N mod P 0 I 0 ..^ P I 0 ..^ P
13 nnnn0modprm0 P N mod P 1 ..^ P I 0 ..^ P j 0 ..^ P I + j N mod P mod P = 0
14 1 11 12 13 syl3anc P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P mod P = 0
15 elfzoelz j 0 ..^ P j
16 15 zcnd j 0 ..^ P j
17 2 anim1ci P N N P
18 zmodcl N P N mod P 0
19 nn0cn N mod P 0 N mod P
20 17 18 19 3syl P N N mod P
21 20 3adant3 P N N mod P 0 N mod P
22 21 adantr P N N mod P 0 I 0 ..^ P N mod P
23 mulcom j N mod P j N mod P = N mod P j
24 16 22 23 syl2anr P N N mod P 0 I 0 ..^ P j 0 ..^ P j N mod P = N mod P j
25 24 oveq2d P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P = I + N mod P j
26 25 oveq1d P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P mod P = I + N mod P j mod P
27 elfzoelz I 0 ..^ P I
28 27 zred I 0 ..^ P I
29 28 adantl P N N mod P 0 I 0 ..^ P I
30 29 adantr P N N mod P 0 I 0 ..^ P j 0 ..^ P I
31 zre N N
32 31 3ad2ant2 P N N mod P 0 N
33 32 adantr P N N mod P 0 I 0 ..^ P N
34 33 adantr P N N mod P 0 I 0 ..^ P j 0 ..^ P N
35 15 adantl P N N mod P 0 I 0 ..^ P j 0 ..^ P j
36 2 nnrpd P P +
37 36 3ad2ant1 P N N mod P 0 P +
38 37 adantr P N N mod P 0 I 0 ..^ P P +
39 38 adantr P N N mod P 0 I 0 ..^ P j 0 ..^ P P +
40 modaddmulmod I N j P + I + N mod P j mod P = I + N j mod P
41 30 34 35 39 40 syl31anc P N N mod P 0 I 0 ..^ P j 0 ..^ P I + N mod P j mod P = I + N j mod P
42 zcn N N
43 42 adantr N j 0 ..^ P N
44 16 adantl N j 0 ..^ P j
45 43 44 mulcomd N j 0 ..^ P N j = j N
46 45 ex N j 0 ..^ P N j = j N
47 46 3ad2ant2 P N N mod P 0 j 0 ..^ P N j = j N
48 47 adantr P N N mod P 0 I 0 ..^ P j 0 ..^ P N j = j N
49 48 imp P N N mod P 0 I 0 ..^ P j 0 ..^ P N j = j N
50 49 oveq2d P N N mod P 0 I 0 ..^ P j 0 ..^ P I + N j = I + j N
51 50 oveq1d P N N mod P 0 I 0 ..^ P j 0 ..^ P I + N j mod P = I + j N mod P
52 26 41 51 3eqtrrd P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P = I + j N mod P mod P
53 52 eqeq1d P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P = 0 I + j N mod P mod P = 0
54 53 rexbidva P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P = 0 j 0 ..^ P I + j N mod P mod P = 0
55 14 54 mpbird P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P = 0
56 55 ex P N N mod P 0 I 0 ..^ P j 0 ..^ P I + j N mod P = 0