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

Theorem odzdvds 13136
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 10186 . . . . . . . . 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 13134 . . . . . . . . . 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 10603 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR+ )
6 modlt 11213 . . . . . . . 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 10260 . . . . . . . . . . 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 11222 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  NN0 )
1110nn0red 10231 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  RR )
124nnred 9971 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR )
1311, 12ltnled 9176 . . . . . . 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 6048 . . . . . . . . . . . 12  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( A ^ n )  =  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) ) )
1615oveq1d 6055 . . . . . . . . . . 11  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  (
( A ^ n
)  -  1 )  =  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  - 
1 ) )
1716breq2d 4184 . . . . . . . . . 10  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( N  ||  ( ( A ^ n )  - 
1 )  <->  N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 ) ) )
1817elrab 3052 . . . . . . . . 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 3388 . . . . . . . . . . 11  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  NN
20 nnuz 10477 . . . . . . . . . . 11  |-  NN  =  ( ZZ>= `  1 )
2119, 20sseqtri 3340 . . . . . . . . . 10  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  ( ZZ>=
`  1 )
22 infmssuzle 10514 . . . . . . . . . 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 13132 . . . . . . . . 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 4182 . . . . . . 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 10179 . . . . . 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 10330 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  ZZ )
39 dvds0 12820 . . . . . 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 10332 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  A  e.  CC )
4342exp0d 11472 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ 0 )  =  1 )
4443oveq1d 6055 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  ( 1  -  1 ) )
45 1m1e0 10024 . . . . . 6  |-  ( 1  -  1 )  =  0
4644, 45syl6eq 2452 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  0 )
4740, 46breqtrrd 4198 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  ( ( A ^ 0 )  - 
1 ) )
48 oveq2 6048 . . . . . 6  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  =  ( A ^
0 ) )
4948oveq1d 6055 . . . . 5  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  - 
1 )  =  ( ( A ^ 0 )  -  1 ) )
5049breq2d 4184 . . . 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 10230 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  NN0 )
542, 4nndivred 10004 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  /  (
( od Z `  N ) `  A
) )  e.  RR )
55 nn0ge0 10203 . . . . . . . . . . . 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 9999 . . . . . . . . . . . 12  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <  ( ( od Z `  N ) `
 A ) )
58 ge0div 9833 . . . . . . . . . . . 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 11180 . . . . . . . . . 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 10235 . . . . . . . 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 11351 . . . . . . . 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 10331 . . . . . 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 9046 . . . . . . 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 11351 . . . . . . 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 10603 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  RR+ )
7242, 62, 53expmuld 11481 . . . . . . . 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 6055 . . . . . . 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 11351 . . . . . . . . 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 10267 . . . . . . . . 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 13135 . . . . . . . . . 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 12814 . . . . . . . . . 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 11469 . . . . . . . 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 11162 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
86 1exp 11364 . . . . . . . . 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 6055 . . . . . . 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 2440 . . . . . 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 11234 . . . . . 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 11480 . . . . . . 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 11207 . . . . . . . . . . 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 6056 . . . . . . . . 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 10232 . . . . . . . . . 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 9070 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  CC )
9896, 97pncan3d 9370 . . . . . . . . 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 2436 . . . . . . . 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 6056 . . . . . . 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 2438 . . . . . 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 6055 . . . . 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 10332 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  CC )
104103mulid2d 9062 . . . . . 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 6055 . . . . 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 2444 . . . 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 2412 . . 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 11351 . . . . 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 12814 . . . 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 12814 . . . 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 12811 . . 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 1721   {crab 2670    C_ wss 3280   class class class wbr 4172   `'ccnv 4836   ` cfv 5413  (class class class)co 6040   supcsup 7403   RRcr 8945   0cc0 8946   1c1 8947    + caddc 8949    x. cmul 8951    < clt 9076    <_ cle 9077    - cmin 9247    / cdiv 9633   NNcn 9956   NN0cn0 10177   ZZcz 10238   ZZ>=cuz 10444   RR+crp 10568   |_cfl 11156    mod cmo 11205   ^cexp 11337    || cdivides 12807    gcd cgcd 12961   od
Zcodz 13107
This theorem is referenced by:  odzphi  13137  pockthlem  13228
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 1662  ax-8 1683  ax-13 1723  ax-14 1725  ax-6 1740  ax-7 1745  ax-11 1757  ax-12 1946  ax-ext 2385  ax-rep 4280  ax-sep 4290  ax-nul 4298  ax-pow 4337  ax-pr 4363  ax-un 4660  ax-cnex 9002  ax-resscn 9003  ax-1cn 9004  ax-icn 9005  ax-addcl 9006  ax-addrcl 9007  ax-mulcl 9008  ax-mulrcl 9009  ax-mulcom 9010  ax-addass 9011  ax-mulass 9012  ax-distr 9013  ax-i2m1 9014  ax-1ne0 9015  ax-1rid 9016  ax-rnegex 9017  ax-rrecex 9018  ax-cnre 9019  ax-pre-lttri 9020  ax-pre-lttrn 9021  ax-pre-ltadd 9022  ax-pre-mulgt0 9023  ax-pre-sup 9024
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 2258  df-mo 2259  df-clab 2391  df-cleq 2397  df-clel 2400  df-nfc 2529  df-ne 2569  df-nel 2570  df-ral 2671  df-rex 2672  df-reu 2673  df-rmo 2674  df-rab 2675  df-v 2918  df-sbc 3122  df-csb 3212  df-dif 3283  df-un 3285  df-in 3287  df-ss 3294  df-pss 3296  df-nul 3589  df-if 3700  df-pw 3761  df-sn 3780  df-pr 3781  df-tp 3782  df-op 3783  df-uni 3976  df-int 4011  df-iun 4055  df-br 4173  df-opab 4227  df-mpt 4228  df-tr 4263  df-eprel 4454  df-id 4458  df-po 4463  df-so 4464  df-fr 4501  df-we 4503  df-ord 4544  df-on 4545  df-lim 4546  df-suc 4547  df-om 4805  df-xp 4843  df-rel 4844  df-cnv 4845  df-co 4846  df-dm 4847  df-rn 4848  df-res 4849  df-ima 4850  df-iota 5377  df-fun 5415  df-fn 5416  df-f 5417  df-f1 5418  df-fo 5419  df-f1o 5420  df-fv 5421  df-ov 6043  df-oprab 6044  df-mpt2 6045  df-1st 6308  df-2nd 6309  df-riota 6508  df-recs 6592  df-rdg 6627  df-1o 6683  df-oadd 6687  df-er 6864  df-map 6979  df-en 7069  df-dom 7070  df-sdom 7071  df-fin 7072  df-sup 7404  df-card 7782  df-pnf 9078  df-mnf 9079  df-xr 9080  df-ltxr 9081  df-le 9082  df-sub 9249  df-neg 9250  df-div 9634  df-nn 9957  df-2 10014  df-3 10015  df-n0 10178  df-z 10239  df-uz 10445  df-rp 10569  df-fz 11000  df-fzo 11091  df-fl 11157  df-mod 11206  df-seq 11279  df-exp 11338  df-hash 11574  df-cj 11859  df-re 11860  df-im 11861  df-sqr 11995  df-abs 11996  df-dvds 12808  df-gcd 12962  df-odz 13109  df-phi 13110
  Copyright terms: Public domain W3C validator