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

Theorem odzdvds 12876
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 9990 . . . . . . . . 9  |-  ( K  e.  NN0  ->  K  e.  RR )
21adantl 452 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  RR )
3 odzcl 12874 . . . . . . . . . 10  |-  ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  ->  (
( od Z `  N ) `  A
)  e.  NN )
43adantr 451 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  NN )
54nnrpd 10405 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR+ )
6 modlt 10997 . . . . . . . 8  |-  ( ( K  e.  RR  /\  ( ( od Z `  N ) `  A
)  e.  RR+ )  ->  ( K  mod  (
( od Z `  N ) `  A
) )  <  (
( od Z `  N ) `  A
) )
72, 5, 6syl2anc 642 . . . . . . 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 10062 . . . . . . . . . . 11  |-  ( K  e.  NN0  ->  K  e.  ZZ )
98adantl 452 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  ZZ )
109, 4zmodcld 11006 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  NN0 )
1110nn0red 10035 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  RR )
124nnred 9777 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR )
1311, 12ltnled 8982 . . . . . . 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 201 . . . . . 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 5882 . . . . . . . . . . . 12  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( A ^ n )  =  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) ) )
1615oveq1d 5889 . . . . . . . . . . 11  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  (
( A ^ n
)  -  1 )  =  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  - 
1 ) )
1716breq2d 4051 . . . . . . . . . 10  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( N  ||  ( ( A ^ n )  - 
1 )  <->  N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 ) ) )
1817elrab 2936 . . . . . . . . 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 3271 . . . . . . . . . . 11  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  NN
20 nnuz 10279 . . . . . . . . . . 11  |-  NN  =  ( ZZ>= `  1 )
2119, 20sseqtri 3223 . . . . . . . . . 10  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  ( ZZ>=
`  1 )
22 infmssuzle 10316 . . . . . . . . . 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 651 . . . . . . . . 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 204 . . . . . . . 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 439 . . . . . . 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 12872 . . . . . . . . 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 451 . . . . . . . 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 4049 . . . . . . 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 212 . . . . . 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 168 . . . . 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 411 . . . . 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 203 . . . 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 9983 . . . . . 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 188 . . . . 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 366 . . . 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 40 . . 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 958 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  NN )
3837nnzd 10132 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  ZZ )
39 dvds0 12560 . . . . . 6  |-  ( N  e.  ZZ  ->  N  ||  0 )
4038, 39syl 15 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  0 )
41 simpl2 959 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  A  e.  ZZ )
4241zcnd 10134 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  A  e.  CC )
4342exp0d 11255 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ 0 )  =  1 )
4443oveq1d 5889 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  ( 1  -  1 ) )
45 1m1e0 9830 . . . . . 6  |-  ( 1  -  1 )  =  0
4644, 45syl6eq 2344 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  0 )
4740, 46breqtrrd 4065 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  ( ( A ^ 0 )  - 
1 ) )
48 oveq2 5882 . . . . . 6  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  =  ( A ^
0 ) )
4948oveq1d 5889 . . . . 5  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  - 
1 )  =  ( ( A ^ 0 )  -  1 ) )
5049breq2d 4051 . . . 4  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 )  <->  N  ||  (
( A ^ 0 )  -  1 ) ) )
5147, 50syl5ibrcom 213 . . 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 183 . 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 10034 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  NN0 )
542, 4nndivred 9810 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  /  (
( od Z `  N ) `  A
) )  e.  RR )
55 nn0ge0 10007 . . . . . . . . . . . 12  |-  ( K  e.  NN0  ->  0  <_  K )
5655adantl 452 . . . . . . . . . . 11  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <_  K )
574nngt0d 9805 . . . . . . . . . . . 12  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <  ( ( od Z `  N ) `
 A ) )
58 ge0div 9639 . . . . . . . . . . . 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 1182 . . . . . . . . . . 11  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( 0  <_  K  <->  0  <_  ( K  / 
( ( od Z `  N ) `  A
) ) ) )
6056, 59mpbid 201 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <_  ( K  /  ( ( od
Z `  N ) `  A ) ) )
61 flge0nn0 10964 . . . . . . . . . 10  |-  ( ( ( K  /  (
( od Z `  N ) `  A
) )  e.  RR  /\  0  <_  ( K  /  ( ( od
Z `  N ) `  A ) ) )  ->  ( |_ `  ( K  /  (
( od Z `  N ) `  A
) ) )  e. 
NN0 )
6254, 60, 61syl2anc 642 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  NN0 )
6353, 62nn0mulcld 10039 . . . . . . . 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 11134 . . . . . . . 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 642 . . . . . . 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 10133 . . . . . 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 8853 . . . . . . 7  |-  1  e.  RR
6867a1i 10 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
1  e.  RR )
69 zexpcl 11134 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  ( K  mod  ( ( od Z `  N
) `  A )
)  e.  NN0 )  ->  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
7041, 10, 69syl2anc 642 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
7137nnrpd 10405 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  RR+ )
7242, 62, 53expmuld 11264 . . . . . . . 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 5889 . . . . . . 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 11134 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  ( ( od Z `  N ) `  A
)  e.  NN0 )  ->  ( A ^ (
( od Z `  N ) `  A
) )  e.  ZZ )
7541, 53, 74syl2anc 642 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ (
( od Z `  N ) `  A
) )  e.  ZZ )
76 1z 10069 . . . . . . . . 9  |-  1  e.  ZZ
7776a1i 10 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
1  e.  ZZ )
78 odzid 12875 . . . . . . . . . 10  |-  ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  ->  N  ||  ( ( A ^
( ( od Z `  N ) `  A
) )  -  1 ) )
7978adantr 451 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  ( ( A ^ ( ( od
Z `  N ) `  A ) )  - 
1 ) )
80 moddvds 12554 . . . . . . . . . 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 1182 . . . . . . . . 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 223 . . . . . . . 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 11252 . . . . . . . 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 1193 . . . . . . 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 10946 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
86 1exp 11147 . . . . . . . . 9  |-  ( ( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ  ->  (
1 ^ ( |_
`  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  =  1 )
8785, 86syl 15 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( 1 ^ ( |_ `  ( K  / 
( ( od Z `  N ) `  A
) ) ) )  =  1 )
8887oveq1d 5889 . . . . . . 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 2332 . . . . . 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 11018 . . . . . 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 1193 . . . . 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 11263 . . . . . . 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 10991 . . . . . . . . . . 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 642 . . . . . . . . . 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 5890 . . . . . . . . 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 10036 . . . . . . . . . 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 8877 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  CC )
9896, 97pncan3d 9176 . . . . . . . . 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 2328 . . . . . . . 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 5890 . . . . . . 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 2330 . . . . . 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 5889 . . . . 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 10134 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  CC )
104103mulid2d 8869 . . . . . 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 5889 . . . . 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 2336 . . . 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 2304 . . 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 11134 . . . . 5  |-  ( ( A  e.  ZZ  /\  K  e.  NN0 )  -> 
( A ^ K
)  e.  ZZ )
10941, 108sylancom 648 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ K
)  e.  ZZ )
110 moddvds 12554 . . . 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 1182 . . 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 12554 . . . 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 1182 . . 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 274 . 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 12551 . . 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 642 . 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 276 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 176    \/ wo 357    /\ wa 358    /\ w3a 934    = wceq 1632    e. wcel 1696   {crab 2560    C_ wss 3165   class class class wbr 4039   `'ccnv 4704   ` cfv 5271  (class class class)co 5874   supcsup 7209   RRcr 8752   0cc0 8753   1c1 8754    + caddc 8756    x. cmul 8758    < clt 8883    <_ cle 8884    - cmin 9053    / cdiv 9439   NNcn 9762   NN0cn0 9981   ZZcz 10040   ZZ>=cuz 10246   RR+crp 10370   |_cfl 10940    mod cmo 10989   ^cexp 11120    || cdivides 12547    gcd cgcd 12701   od
Zcodz 12847
This theorem is referenced by:  odzphi  12877  pockthlem  12968
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-13 1698  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-rep 4147  ax-sep 4157  ax-nul 4165  ax-pow 4204  ax-pr 4230  ax-un 4528  ax-cnex 8809  ax-resscn 8810  ax-1cn 8811  ax-icn 8812  ax-addcl 8813  ax-addrcl 8814  ax-mulcl 8815  ax-mulrcl 8816  ax-mulcom 8817  ax-addass 8818  ax-mulass 8819  ax-distr 8820  ax-i2m1 8821  ax-1ne0 8822  ax-1rid 8823  ax-rnegex 8824  ax-rrecex 8825  ax-cnre 8826  ax-pre-lttri 8827  ax-pre-lttrn 8828  ax-pre-ltadd 8829  ax-pre-mulgt0 8830  ax-pre-sup 8831
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-nel 2462  df-ral 2561  df-rex 2562  df-reu 2563  df-rmo 2564  df-rab 2565  df-v 2803  df-sbc 3005  df-csb 3095  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-pss 3181  df-nul 3469  df-if 3579  df-pw 3640  df-sn 3659  df-pr 3660  df-tp 3661  df-op 3662  df-uni 3844  df-int 3879  df-iun 3923  df-br 4040  df-opab 4094  df-mpt 4095  df-tr 4130  df-eprel 4321  df-id 4325  df-po 4330  df-so 4331  df-fr 4368  df-we 4370  df-ord 4411  df-on 4412  df-lim 4413  df-suc 4414  df-om 4673  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-rn 4716  df-res 4717  df-ima 4718  df-iota 5235  df-fun 5273  df-fn 5274  df-f 5275  df-f1 5276  df-fo 5277  df-f1o 5278  df-fv 5279  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-1st 6138  df-2nd 6139  df-riota 6320  df-recs 6404  df-rdg 6439  df-1o 6495  df-oadd 6499  df-er 6676  df-map 6790  df-en 6880  df-dom 6881  df-sdom 6882  df-fin 6883  df-sup 7210  df-card 7588  df-pnf 8885  df-mnf 8886  df-xr 8887  df-ltxr 8888  df-le 8889  df-sub 9055  df-neg 9056  df-div 9440  df-nn 9763  df-2 9820  df-3 9821  df-n0 9982  df-z 10041  df-uz 10247  df-rp 10371  df-fz 10799  df-fzo 10887  df-fl 10941  df-mod 10990  df-seq 11063  df-exp 11121  df-hash 11354  df-cj 11600  df-re 11601  df-im 11602  df-sqr 11736  df-abs 11737  df-dvds 12548  df-gcd 12702  df-odz 12849  df-phi 12850
  Copyright terms: Public domain W3C validator