MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  odzdvds Structured version   Unicode version

Theorem odzdvds 13173
Description: The only powers of  A that are congruent to  1 are the multiples of the order of  A. (Contributed by Mario Carneiro, 28-Feb-2014.)
Assertion
Ref Expression
odzdvds  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( N  ||  (
( A ^ K
)  -  1 )  <-> 
( ( od Z `  N ) `  A
)  ||  K )
)

Proof of Theorem odzdvds
Dummy variable  n is distinct from all other variables.
StepHypRef Expression
1 nn0re 10222 . . . . . . . . 9  |-  ( K  e.  NN0  ->  K  e.  RR )
21adantl 453 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  RR )
3 odzcl 13171 . . . . . . . . . 10  |-  ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  ->  (
( od Z `  N ) `  A
)  e.  NN )
43adantr 452 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  NN )
54nnrpd 10639 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR+ )
6 modlt 11250 . . . . . . . 8  |-  ( ( K  e.  RR  /\  ( ( od Z `  N ) `  A
)  e.  RR+ )  ->  ( K  mod  (
( od Z `  N ) `  A
) )  <  (
( od Z `  N ) `  A
) )
72, 5, 6syl2anc 643 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  <  (
( od Z `  N ) `  A
) )
8 nn0z 10296 . . . . . . . . . . 11  |-  ( K  e.  NN0  ->  K  e.  ZZ )
98adantl 453 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  ZZ )
109, 4zmodcld 11259 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  NN0 )
1110nn0red 10267 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  RR )
124nnred 10007 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR )
1311, 12ltnled 9212 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( K  mod  ( ( od Z `  N ) `  A
) )  <  (
( od Z `  N ) `  A
)  <->  -.  ( ( od Z `  N ) `
 A )  <_ 
( K  mod  (
( od Z `  N ) `  A
) ) ) )
147, 13mpbid 202 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  -.  ( ( od Z `  N ) `  A
)  <_  ( K  mod  ( ( od Z `  N ) `  A
) ) )
15 oveq2 6081 . . . . . . . . . . . 12  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( A ^ n )  =  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) ) )
1615oveq1d 6088 . . . . . . . . . . 11  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  (
( A ^ n
)  -  1 )  =  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  - 
1 ) )
1716breq2d 4216 . . . . . . . . . 10  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( N  ||  ( ( A ^ n )  - 
1 )  <->  N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 ) ) )
1817elrab 3084 . . . . . . . . 9  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  e.  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  <->  ( ( K  mod  ( ( od
Z `  N ) `  A ) )  e.  NN  /\  N  ||  ( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  - 
1 ) ) )
19 ssrab2 3420 . . . . . . . . . . 11  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  NN
20 nnuz 10513 . . . . . . . . . . 11  |-  NN  =  ( ZZ>= `  1 )
2119, 20sseqtri 3372 . . . . . . . . . 10  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  ( ZZ>=
`  1 )
22 infmssuzle 10550 . . . . . . . . . 10  |-  ( ( { n  e.  NN  |  N  ||  ( ( A ^ n )  -  1 ) } 
C_  ( ZZ>= `  1
)  /\  ( K  mod  ( ( od Z `  N ) `  A
) )  e.  {
n  e.  NN  |  N  ||  ( ( A ^ n )  - 
1 ) } )  ->  sup ( { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) } ,  RR ,  `'  <  )  <_ 
( K  mod  (
( od Z `  N ) `  A
) ) )
2321, 22mpan 652 . . . . . . . . 9  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  e.  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  ->  sup ( { n  e.  NN  |  N  ||  ( ( A ^ n )  -  1 ) } ,  RR ,  `'  <  )  <_  ( K  mod  ( ( od Z `  N ) `  A
) ) )
2418, 23sylbir 205 . . . . . . . 8  |-  ( ( ( K  mod  (
( od Z `  N ) `  A
) )  e.  NN  /\  N  ||  ( ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 ) )  ->  sup ( { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) } ,  RR ,  `'  <  )  <_ 
( K  mod  (
( od Z `  N ) `  A
) ) )
2524ancoms 440 . . . . . . 7  |-  ( ( N  ||  ( ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 )  /\  ( K  mod  ( ( od Z `  N
) `  A )
)  e.  NN )  ->  sup ( { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) } ,  RR ,  `'  <  )  <_ 
( K  mod  (
( od Z `  N ) `  A
) ) )
26 odzval 13169 . . . . . . . . 9  |-  ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  ->  (
( od Z `  N ) `  A
)  =  sup ( { n  e.  NN  |  N  ||  ( ( A ^ n )  -  1 ) } ,  RR ,  `'  <  ) )
2726adantr 452 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  =  sup ( { n  e.  NN  |  N  ||  ( ( A ^ n )  -  1 ) } ,  RR ,  `'  <  ) )
2827breq1d 4214 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( od
Z `  N ) `  A )  <_  ( K  mod  ( ( od
Z `  N ) `  A ) )  <->  sup ( { n  e.  NN  |  N  ||  ( ( A ^ n )  -  1 ) } ,  RR ,  `'  <  )  <_  ( K  mod  ( ( od Z `  N ) `  A
) ) ) )
2925, 28syl5ibr 213 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( N  ||  ( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  - 
1 )  /\  ( K  mod  ( ( od
Z `  N ) `  A ) )  e.  NN )  ->  (
( od Z `  N ) `  A
)  <_  ( K  mod  ( ( od Z `  N ) `  A
) ) ) )
3014, 29mtod 170 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  -.  ( N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 )  /\  ( K  mod  ( ( od Z `  N
) `  A )
)  e.  NN ) )
31 imnan 412 . . . . 5  |-  ( ( N  ||  ( ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 )  ->  -.  ( K  mod  (
( od Z `  N ) `  A
) )  e.  NN ) 
<->  -.  ( N  ||  ( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  - 
1 )  /\  ( K  mod  ( ( od
Z `  N ) `  A ) )  e.  NN ) )
3230, 31sylibr 204 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 )  ->  -.  ( K  mod  (
( od Z `  N ) `  A
) )  e.  NN ) )
33 elnn0 10215 . . . . . 6  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  e.  NN0  <->  ( ( K  mod  ( ( od
Z `  N ) `  A ) )  e.  NN  \/  ( K  mod  ( ( od
Z `  N ) `  A ) )  =  0 ) )
3410, 33sylib 189 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( K  mod  ( ( od Z `  N ) `  A
) )  e.  NN  \/  ( K  mod  (
( od Z `  N ) `  A
) )  =  0 ) )
3534ord 367 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( -.  ( K  mod  ( ( od
Z `  N ) `  A ) )  e.  NN  ->  ( K  mod  ( ( od Z `  N ) `  A
) )  =  0 ) )
3632, 35syld 42 . . 3  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  =  0 ) )
37 simpl1 960 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  NN )
3837nnzd 10366 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  ZZ )
39 dvds0 12857 . . . . . 6  |-  ( N  e.  ZZ  ->  N  ||  0 )
4038, 39syl 16 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  0 )
41 simpl2 961 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  A  e.  ZZ )
4241zcnd 10368 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  A  e.  CC )
4342exp0d 11509 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ 0 )  =  1 )
4443oveq1d 6088 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  ( 1  -  1 ) )
45 1m1e0 10060 . . . . . 6  |-  ( 1  -  1 )  =  0
4644, 45syl6eq 2483 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  0 )
4740, 46breqtrrd 4230 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  ( ( A ^ 0 )  - 
1 ) )
48 oveq2 6081 . . . . . 6  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  =  ( A ^
0 ) )
4948oveq1d 6088 . . . . 5  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  - 
1 )  =  ( ( A ^ 0 )  -  1 ) )
5049breq2d 4216 . . . 4  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 )  <->  N  ||  (
( A ^ 0 )  -  1 ) ) )
5147, 50syl5ibrcom 214 . . 3  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( K  mod  ( ( od Z `  N ) `  A
) )  =  0  ->  N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 ) ) )
5236, 51impbid 184 . 2  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 )  <->  ( K  mod  ( ( od Z `  N ) `  A
) )  =  0 ) )
534nnnn0d 10266 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  NN0 )
542, 4nndivred 10040 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  /  (
( od Z `  N ) `  A
) )  e.  RR )
55 nn0ge0 10239 . . . . . . . . . . . 12  |-  ( K  e.  NN0  ->  0  <_  K )
5655adantl 453 . . . . . . . . . . 11  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <_  K )
574nngt0d 10035 . . . . . . . . . . . 12  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <  ( ( od Z `  N ) `
 A ) )
58 ge0div 9869 . . . . . . . . . . . 12  |-  ( ( K  e.  RR  /\  ( ( od Z `  N ) `  A
)  e.  RR  /\  0  <  ( ( od
Z `  N ) `  A ) )  -> 
( 0  <_  K  <->  0  <_  ( K  / 
( ( od Z `  N ) `  A
) ) ) )
592, 12, 57, 58syl3anc 1184 . . . . . . . . . . 11  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( 0  <_  K  <->  0  <_  ( K  / 
( ( od Z `  N ) `  A
) ) ) )
6056, 59mpbid 202 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <_  ( K  /  ( ( od
Z `  N ) `  A ) ) )
61 flge0nn0 11217 . . . . . . . . . 10  |-  ( ( ( K  /  (
( od Z `  N ) `  A
) )  e.  RR  /\  0  <_  ( K  /  ( ( od
Z `  N ) `  A ) ) )  ->  ( |_ `  ( K  /  (
( od Z `  N ) `  A
) ) )  e. 
NN0 )
6254, 60, 61syl2anc 643 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  NN0 )
6353, 62nn0mulcld 10271 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  e.  NN0 )
64 zexpcl 11388 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  ( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  e.  NN0 )  -> 
( A ^ (
( ( od Z `  N ) `  A
)  x.  ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  e.  ZZ )
6541, 63, 64syl2anc 643 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ (
( ( od Z `  N ) `  A
)  x.  ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  e.  ZZ )
6665zred 10367 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ (
( ( od Z `  N ) `  A
)  x.  ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  e.  RR )
67 1re 9082 . . . . . . 7  |-  1  e.  RR
6867a1i 11 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
1  e.  RR )
69 zexpcl 11388 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  ( K  mod  ( ( od Z `  N
) `  A )
)  e.  NN0 )  ->  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
7041, 10, 69syl2anc 643 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
7137nnrpd 10639 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  RR+ )
7242, 62, 53expmuld 11518 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ (
( ( od Z `  N ) `  A
)  x.  ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  =  ( ( A ^ ( ( od Z `  N
) `  A )
) ^ ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )
7372oveq1d 6088 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  mod  N )  =  ( ( ( A ^ ( ( od Z `  N
) `  A )
) ^ ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  mod  N ) )
74 zexpcl 11388 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  ( ( od Z `  N ) `  A
)  e.  NN0 )  ->  ( A ^ (
( od Z `  N ) `  A
) )  e.  ZZ )
7541, 53, 74syl2anc 643 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ (
( od Z `  N ) `  A
) )  e.  ZZ )
76 1z 10303 . . . . . . . . 9  |-  1  e.  ZZ
7776a1i 11 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
1  e.  ZZ )
78 odzid 13172 . . . . . . . . . 10  |-  ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  ->  N  ||  ( ( A ^
( ( od Z `  N ) `  A
) )  -  1 ) )
7978adantr 452 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  ( ( A ^ ( ( od
Z `  N ) `  A ) )  - 
1 ) )
80 moddvds 12851 . . . . . . . . . 10  |-  ( ( N  e.  NN  /\  ( A ^ ( ( od Z `  N
) `  A )
)  e.  ZZ  /\  1  e.  ZZ )  ->  ( ( ( A ^ ( ( od
Z `  N ) `  A ) )  mod 
N )  =  ( 1  mod  N )  <-> 
N  ||  ( ( A ^ ( ( od
Z `  N ) `  A ) )  - 
1 ) ) )
8137, 75, 77, 80syl3anc 1184 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( A ^ ( ( od
Z `  N ) `  A ) )  mod 
N )  =  ( 1  mod  N )  <-> 
N  ||  ( ( A ^ ( ( od
Z `  N ) `  A ) )  - 
1 ) ) )
8279, 81mpbird 224 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
( ( od Z `  N ) `  A
) )  mod  N
)  =  ( 1  mod  N ) )
83 modexp 11506 . . . . . . . 8  |-  ( ( ( ( A ^
( ( od Z `  N ) `  A
) )  e.  ZZ  /\  1  e.  ZZ )  /\  ( ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) )  e. 
NN0  /\  N  e.  RR+ )  /\  ( ( A ^ ( ( od Z `  N
) `  A )
)  mod  N )  =  ( 1  mod 
N ) )  -> 
( ( ( A ^ ( ( od
Z `  N ) `  A ) ) ^
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) )  mod  N )  =  ( ( 1 ^ ( |_ `  ( K  /  (
( od Z `  N ) `  A
) ) ) )  mod  N ) )
8475, 77, 62, 71, 82, 83syl221anc 1195 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( A ^ ( ( od
Z `  N ) `  A ) ) ^
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) )  mod  N )  =  ( ( 1 ^ ( |_ `  ( K  /  (
( od Z `  N ) `  A
) ) ) )  mod  N ) )
8554flcld 11199 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
86 1exp 11401 . . . . . . . . 9  |-  ( ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ  ->  (
1 ^ ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  =  1 )
8785, 86syl 16 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( 1 ^ ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  =  1 )
8887oveq1d 6088 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( 1 ^ ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) )  mod  N )  =  ( 1  mod 
N ) )
8973, 84, 883eqtrd 2471 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  mod  N )  =  ( 1  mod 
N ) )
90 modmul1 11271 . . . . . 6  |-  ( ( ( ( A ^
( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  e.  RR  /\  1  e.  RR )  /\  ( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  e.  ZZ  /\  N  e.  RR+ )  /\  (
( A ^ (
( ( od Z `  N ) `  A
)  x.  ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  mod  N )  =  ( 1  mod 
N ) )  -> 
( ( ( A ^ ( ( ( od Z `  N
) `  A )  x.  ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) ) )  x.  ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) ) )  mod  N )  =  ( ( 1  x.  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) ) )  mod  N ) )
9166, 68, 70, 71, 89, 90syl221anc 1195 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( A ^ ( ( ( od Z `  N
) `  A )  x.  ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) ) )  x.  ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) ) )  mod  N )  =  ( ( 1  x.  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) ) )  mod  N ) )
9242, 10, 63expaddd 11517 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ (
( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  +  ( K  mod  ( ( od Z `  N ) `  A
) ) ) )  =  ( ( A ^ ( ( ( od Z `  N
) `  A )  x.  ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) ) )  x.  ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) ) ) )
93 modval 11244 . . . . . . . . . . 11  |-  ( ( K  e.  RR  /\  ( ( od Z `  N ) `  A
)  e.  RR+ )  ->  ( K  mod  (
( od Z `  N ) `  A
) )  =  ( K  -  ( ( ( od Z `  N ) `  A
)  x.  ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) ) )
942, 5, 93syl2anc 643 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  =  ( K  -  ( ( ( od Z `  N ) `  A
)  x.  ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) ) )
9594oveq2d 6089 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( ( od Z `  N
) `  A )  x.  ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) )  +  ( K  mod  ( ( od
Z `  N ) `  A ) ) )  =  ( ( ( ( od Z `  N ) `  A
)  x.  ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  +  ( K  -  ( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) ) ) )
9663nn0cnd 10268 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  e.  CC )
972recnd 9106 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  CC )
9896, 97pncan3d 9406 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( ( od Z `  N
) `  A )  x.  ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) )  +  ( K  -  ( ( ( od Z `  N
) `  A )  x.  ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) ) ) )  =  K )
9995, 98eqtrd 2467 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( ( od Z `  N
) `  A )  x.  ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) )  +  ( K  mod  ( ( od
Z `  N ) `  A ) ) )  =  K )
10099oveq2d 6089 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ (
( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  +  ( K  mod  ( ( od Z `  N ) `  A
) ) ) )  =  ( A ^ K ) )
10192, 100eqtr3d 2469 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
( ( ( od
Z `  N ) `  A )  x.  ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) ) )  x.  ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) ) )  =  ( A ^ K ) )
102101oveq1d 6088 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( A ^ ( ( ( od Z `  N
) `  A )  x.  ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) ) ) )  x.  ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) ) )  mod  N )  =  ( ( A ^ K )  mod  N
) )
10370zcnd 10368 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  CC )
104103mulid2d 9098 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( 1  x.  ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) ) )  =  ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) ) )
105104oveq1d 6088 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( 1  x.  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) ) )  mod  N )  =  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  mod 
N ) )
10691, 102, 1053eqtr3d 2475 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^ K )  mod  N
)  =  ( ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  mod  N ) )
107106eqeq1d 2443 . . 3  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( A ^ K )  mod 
N )  =  ( 1  mod  N )  <-> 
( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  mod 
N )  =  ( 1  mod  N ) ) )
108 zexpcl 11388 . . . . 5  |-  ( ( A  e.  ZZ  /\  K  e.  NN0 )  -> 
( A ^ K
)  e.  ZZ )
10941, 108sylancom 649 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ K
)  e.  ZZ )
110 moddvds 12851 . . . 4  |-  ( ( N  e.  NN  /\  ( A ^ K )  e.  ZZ  /\  1  e.  ZZ )  ->  (
( ( A ^ K )  mod  N
)  =  ( 1  mod  N )  <->  N  ||  (
( A ^ K
)  -  1 ) ) )
11137, 109, 77, 110syl3anc 1184 . . 3  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( A ^ K )  mod 
N )  =  ( 1  mod  N )  <-> 
N  ||  ( ( A ^ K )  - 
1 ) ) )
112 moddvds 12851 . . . 4  |-  ( ( N  e.  NN  /\  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ  /\  1  e.  ZZ )  ->  (
( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  mod 
N )  =  ( 1  mod  N )  <-> 
N  ||  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  - 
1 ) ) )
11337, 70, 77, 112syl3anc 1184 . . 3  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  mod 
N )  =  ( 1  mod  N )  <-> 
N  ||  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  - 
1 ) ) )
114107, 111, 1133bitr3d 275 . 2  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( N  ||  (
( A ^ K
)  -  1 )  <-> 
N  ||  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  - 
1 ) ) )
115 dvdsval3 12848 . . 3  |-  ( ( ( ( od Z `  N ) `  A
)  e.  NN  /\  K  e.  ZZ )  ->  ( ( ( od
Z `  N ) `  A )  ||  K  <->  ( K  mod  ( ( od Z `  N
) `  A )
)  =  0 ) )
1164, 9, 115syl2anc 643 . 2  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( ( od
Z `  N ) `  A )  ||  K  <->  ( K  mod  ( ( od Z `  N
) `  A )
)  =  0 ) )
11752, 114, 1163bitr4d 277 1  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( N  ||  (
( A ^ K
)  -  1 )  <-> 
( ( od Z `  N ) `  A
)  ||  K )
)
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 177    \/ wo 358    /\ wa 359    /\ w3a 936    = wceq 1652    e. wcel 1725   {crab 2701    C_ wss 3312   class class class wbr 4204   `'ccnv 4869   ` cfv 5446  (class class class)co 6073   supcsup 7437   RRcr 8981   0cc0 8982   1c1 8983    + caddc 8985    x. cmul 8987    < clt 9112    <_ cle 9113    - cmin 9283    / cdiv 9669   NNcn 9992   NN0cn0 10213   ZZcz 10274   ZZ>=cuz 10480   RR+crp 10604   |_cfl 11193    mod cmo 11242   ^cexp 11374    || cdivides 12844    gcd cgcd 12998   od
Zcodz 13144
This theorem is referenced by:  odzphi  13174  pockthlem  13265
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1555  ax-5 1566  ax-17 1626  ax-9 1666  ax-8 1687  ax-13 1727  ax-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2416  ax-rep 4312  ax-sep 4322  ax-nul 4330  ax-pow 4369  ax-pr 4395  ax-un 4693  ax-cnex 9038  ax-resscn 9039  ax-1cn 9040  ax-icn 9041  ax-addcl 9042  ax-addrcl 9043  ax-mulcl 9044  ax-mulrcl 9045  ax-mulcom 9046  ax-addass 9047  ax-mulass 9048  ax-distr 9049  ax-i2m1 9050  ax-1ne0 9051  ax-1rid 9052  ax-rnegex 9053  ax-rrecex 9054  ax-cnre 9055  ax-pre-lttri 9056  ax-pre-lttrn 9057  ax-pre-ltadd 9058  ax-pre-mulgt0 9059  ax-pre-sup 9060
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1328  df-ex 1551  df-nf 1554  df-sb 1659  df-eu 2284  df-mo 2285  df-clab 2422  df-cleq 2428  df-clel 2431  df-nfc 2560  df-ne 2600  df-nel 2601  df-ral 2702  df-rex 2703  df-reu 2704  df-rmo 2705  df-rab 2706  df-v 2950  df-sbc 3154  df-csb 3244  df-dif 3315  df-un 3317  df-in 3319  df-ss 3326  df-pss 3328  df-nul 3621  df-if 3732  df-pw 3793  df-sn 3812  df-pr 3813  df-tp 3814  df-op 3815  df-uni 4008  df-int 4043  df-iun 4087  df-br 4205  df-opab 4259  df-mpt 4260  df-tr 4295  df-eprel 4486  df-id 4490  df-po 4495  df-so 4496  df-fr 4533  df-we 4535  df-ord 4576  df-on 4577  df-lim 4578  df-suc 4579  df-om 4838  df-xp 4876  df-rel 4877  df-cnv 4878  df-co 4879  df-dm 4880  df-rn 4881  df-res 4882  df-ima 4883  df-iota 5410  df-fun 5448  df-fn 5449  df-f 5450  df-f1 5451  df-fo 5452  df-f1o 5453  df-fv 5454  df-ov 6076  df-oprab 6077  df-mpt2 6078  df-1st 6341  df-2nd 6342  df-riota 6541  df-recs 6625  df-rdg 6660  df-1o 6716  df-oadd 6720  df-er 6897  df-map 7012  df-en 7102  df-dom 7103  df-sdom 7104  df-fin 7105  df-sup 7438  df-card 7818  df-pnf 9114  df-mnf 9115  df-xr 9116  df-ltxr 9117  df-le 9118  df-sub 9285  df-neg 9286  df-div 9670  df-nn 9993  df-2 10050  df-3 10051  df-n0 10214  df-z 10275  df-uz 10481  df-rp 10605  df-fz 11036  df-fzo 11128  df-fl 11194  df-mod 11243  df-seq 11316  df-exp 11375  df-hash 11611  df-cj 11896  df-re 11897  df-im 11898  df-sqr 12032  df-abs 12033  df-dvds 12845  df-gcd 12999  df-odz 13146  df-phi 13147
  Copyright terms: Public domain W3C validator