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

Theorem odzdvds 13108
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 10162 . . . . . . . . 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 13106 . . . . . . . . . 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 10579 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR+ )
6 modlt 11185 . . . . . . . 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 10236 . . . . . . . . . . 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 11194 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  NN0 )
1110nn0red 10207 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  RR )
124nnred 9947 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR )
1311, 12ltnled 9152 . . . . . . 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 6028 . . . . . . . . . . . 12  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( A ^ n )  =  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) ) )
1615oveq1d 6035 . . . . . . . . . . 11  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  (
( A ^ n
)  -  1 )  =  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  - 
1 ) )
1716breq2d 4165 . . . . . . . . . 10  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( N  ||  ( ( A ^ n )  - 
1 )  <->  N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 ) ) )
1817elrab 3035 . . . . . . . . 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 3371 . . . . . . . . . . 11  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  NN
20 nnuz 10453 . . . . . . . . . . 11  |-  NN  =  ( ZZ>= `  1 )
2119, 20sseqtri 3323 . . . . . . . . . 10  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  ( ZZ>=
`  1 )
22 infmssuzle 10490 . . . . . . . . . 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 13104 . . . . . . . . 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 4163 . . . . . . 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 10155 . . . . . 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 10306 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  ZZ )
39 dvds0 12792 . . . . . 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 10308 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  A  e.  CC )
4342exp0d 11444 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ 0 )  =  1 )
4443oveq1d 6035 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  ( 1  -  1 ) )
45 1m1e0 10000 . . . . . 6  |-  ( 1  -  1 )  =  0
4644, 45syl6eq 2435 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  0 )
4740, 46breqtrrd 4179 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  ( ( A ^ 0 )  - 
1 ) )
48 oveq2 6028 . . . . . 6  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  =  ( A ^
0 ) )
4948oveq1d 6035 . . . . 5  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  - 
1 )  =  ( ( A ^ 0 )  -  1 ) )
5049breq2d 4165 . . . 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 10206 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  NN0 )
542, 4nndivred 9980 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  /  (
( od Z `  N ) `  A
) )  e.  RR )
55 nn0ge0 10179 . . . . . . . . . . . 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 9975 . . . . . . . . . . . 12  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <  ( ( od Z `  N ) `
 A ) )
58 ge0div 9809 . . . . . . . . . . . 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 11152 . . . . . . . . . 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 10211 . . . . . . . 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 11323 . . . . . . . 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 10307 . . . . . 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 9023 . . . . . . 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 11323 . . . . . . 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 10579 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  RR+ )
7242, 62, 53expmuld 11453 . . . . . . . 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 6035 . . . . . . 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 11323 . . . . . . . . 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 10243 . . . . . . . . 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 13107 . . . . . . . . . 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 12786 . . . . . . . . . 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 11441 . . . . . . . 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 11134 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
86 1exp 11336 . . . . . . . . 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 6035 . . . . . . 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 2423 . . . . . 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 11206 . . . . . 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 11452 . . . . . . 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 11179 . . . . . . . . . . 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 6036 . . . . . . . . 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 10208 . . . . . . . . . 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 9047 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  CC )
9896, 97pncan3d 9346 . . . . . . . . 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 2419 . . . . . . . 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 6036 . . . . . . 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 2421 . . . . . 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 6035 . . . . 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 10308 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  CC )
104103mulid2d 9039 . . . . . 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 6035 . . . . 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 2427 . . . 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 2395 . . 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 11323 . . . . 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 12786 . . . 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 12786 . . . 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 12783 . . 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 1649    e. wcel 1717   {crab 2653    C_ wss 3263   class class class wbr 4153   `'ccnv 4817   ` cfv 5394  (class class class)co 6020   supcsup 7380   RRcr 8922   0cc0 8923   1c1 8924    + caddc 8926    x. cmul 8928    < clt 9053    <_ cle 9054    - cmin 9223    / cdiv 9609   NNcn 9932   NN0cn0 10153   ZZcz 10214   ZZ>=cuz 10420   RR+crp 10544   |_cfl 11128    mod cmo 11177   ^cexp 11309    || cdivides 12779    gcd cgcd 12933   od
Zcodz 13079
This theorem is referenced by:  odzphi  13109  pockthlem  13200
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1661  ax-8 1682  ax-13 1719  ax-14 1721  ax-6 1736  ax-7 1741  ax-11 1753  ax-12 1939  ax-ext 2368  ax-rep 4261  ax-sep 4271  ax-nul 4279  ax-pow 4318  ax-pr 4344  ax-un 4641  ax-cnex 8979  ax-resscn 8980  ax-1cn 8981  ax-icn 8982  ax-addcl 8983  ax-addrcl 8984  ax-mulcl 8985  ax-mulrcl 8986  ax-mulcom 8987  ax-addass 8988  ax-mulass 8989  ax-distr 8990  ax-i2m1 8991  ax-1ne0 8992  ax-1rid 8993  ax-rnegex 8994  ax-rrecex 8995  ax-cnre 8996  ax-pre-lttri 8997  ax-pre-lttrn 8998  ax-pre-ltadd 8999  ax-pre-mulgt0 9000  ax-pre-sup 9001
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2242  df-mo 2243  df-clab 2374  df-cleq 2380  df-clel 2383  df-nfc 2512  df-ne 2552  df-nel 2553  df-ral 2654  df-rex 2655  df-reu 2656  df-rmo 2657  df-rab 2658  df-v 2901  df-sbc 3105  df-csb 3195  df-dif 3266  df-un 3268  df-in 3270  df-ss 3277  df-pss 3279  df-nul 3572  df-if 3683  df-pw 3744  df-sn 3763  df-pr 3764  df-tp 3765  df-op 3766  df-uni 3958  df-int 3993  df-iun 4037  df-br 4154  df-opab 4208  df-mpt 4209  df-tr 4244  df-eprel 4435  df-id 4439  df-po 4444  df-so 4445  df-fr 4482  df-we 4484  df-ord 4525  df-on 4526  df-lim 4527  df-suc 4528  df-om 4786  df-xp 4824  df-rel 4825  df-cnv 4826  df-co 4827  df-dm 4828  df-rn 4829  df-res 4830  df-ima 4831  df-iota 5358  df-fun 5396  df-fn 5397  df-f 5398  df-f1 5399  df-fo 5400  df-f1o 5401  df-fv 5402  df-ov 6023  df-oprab 6024  df-mpt2 6025  df-1st 6288  df-2nd 6289  df-riota 6485  df-recs 6569  df-rdg 6604  df-1o 6660  df-oadd 6664  df-er 6841  df-map 6956  df-en 7046  df-dom 7047  df-sdom 7048  df-fin 7049  df-sup 7381  df-card 7759  df-pnf 9055  df-mnf 9056  df-xr 9057  df-ltxr 9058  df-le 9059  df-sub 9225  df-neg 9226  df-div 9610  df-nn 9933  df-2 9990  df-3 9991  df-n0 10154  df-z 10215  df-uz 10421  df-rp 10545  df-fz 10976  df-fzo 11066  df-fl 11129  df-mod 11178  df-seq 11251  df-exp 11310  df-hash 11546  df-cj 11831  df-re 11832  df-im 11833  df-sqr 11967  df-abs 11968  df-dvds 12780  df-gcd 12934  df-odz 13081  df-phi 13082
  Copyright terms: Public domain W3C validator