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

Theorem odzdvds 12860
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 9974 . . . . . . . . 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 12858 . . . . . . . . . 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 10389 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR+ )
6 modlt 10981 . . . . . . . 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 10046 . . . . . . . . . . 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 10990 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  NN0 )
1110nn0red 10019 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  mod  (
( od Z `  N ) `  A
) )  e.  RR )
124nnred 9761 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  RR )
1311, 12ltnled 8966 . . . . . . 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 5866 . . . . . . . . . . . 12  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( A ^ n )  =  ( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) ) )
1615oveq1d 5873 . . . . . . . . . . 11  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  (
( A ^ n
)  -  1 )  =  ( ( A ^ ( K  mod  ( ( od Z `  N ) `  A
) ) )  - 
1 ) )
1716breq2d 4035 . . . . . . . . . 10  |-  ( n  =  ( K  mod  ( ( od Z `  N ) `  A
) )  ->  ( N  ||  ( ( A ^ n )  - 
1 )  <->  N  ||  (
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  -  1 ) ) )
1817elrab 2923 . . . . . . . . 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 3258 . . . . . . . . . . 11  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  NN
20 nnuz 10263 . . . . . . . . . . 11  |-  NN  =  ( ZZ>= `  1 )
2119, 20sseqtri 3210 . . . . . . . . . 10  |-  { n  e.  NN  |  N  ||  ( ( A ^
n )  -  1 ) }  C_  ( ZZ>=
`  1 )
22 infmssuzle 10300 . . . . . . . . . 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 12856 . . . . . . . . 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 4033 . . . . . . 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 9967 . . . . . 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 10116 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  ZZ )
39 dvds0 12544 . . . . . 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 10118 . . . . . . . 8  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  A  e.  CC )
4342exp0d 11239 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ 0 )  =  1 )
4443oveq1d 5873 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  ( 1  -  1 ) )
45 1m1e0 9814 . . . . . 6  |-  ( 1  -  1 )  =  0
4644, 45syl6eq 2331 . . . . 5  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( A ^
0 )  -  1 )  =  0 )
4740, 46breqtrrd 4049 . . . 4  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  ||  ( ( A ^ 0 )  - 
1 ) )
48 oveq2 5866 . . . . . 6  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  =  ( A ^
0 ) )
4948oveq1d 5873 . . . . 5  |-  ( ( K  mod  ( ( od Z `  N
) `  A )
)  =  0  -> 
( ( A ^
( K  mod  (
( od Z `  N ) `  A
) ) )  - 
1 )  =  ( ( A ^ 0 )  -  1 ) )
5049breq2d 4035 . . . 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 10018 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( ( od Z `  N ) `  A
)  e.  NN0 )
542, 4nndivred 9794 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( K  /  (
( od Z `  N ) `  A
) )  e.  RR )
55 nn0ge0 9991 . . . . . . . . . . . 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 9789 . . . . . . . . . . . 12  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
0  <  ( ( od Z `  N ) `
 A ) )
58 ge0div 9623 . . . . . . . . . . . 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 10948 . . . . . . . . . 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 10023 . . . . . . . 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 11118 . . . . . . . 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 10117 . . . . . 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 8837 . . . . . . 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 11118 . . . . . . 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 10389 . . . . . 6  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  N  e.  RR+ )
7242, 62, 53expmuld 11248 . . . . . . . 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 5873 . . . . . . 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 11118 . . . . . . . . 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 10053 . . . . . . . . 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 12859 . . . . . . . . . 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 12538 . . . . . . . . . 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 11236 . . . . . . . 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 10930 . . . . . . . . 9  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( |_ `  ( K  /  ( ( od
Z `  N ) `  A ) ) )  e.  ZZ )
86 1exp 11131 . . . . . . . . 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 5873 . . . . . . 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 2319 . . . . . 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 11002 . . . . . 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 11247 . . . . . . 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 10975 . . . . . . . . . . 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 5874 . . . . . . . . 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 10020 . . . . . . . . . 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 8861 . . . . . . . . . 10  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  ->  K  e.  CC )
9896, 97pncan3d 9160 . . . . . . . . 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 2315 . . . . . . . 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 5874 . . . . . . 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 2317 . . . . . 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 5873 . . . . 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 10118 . . . . . . 7  |-  ( ( ( N  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  N )  =  1 )  /\  K  e.  NN0 )  -> 
( A ^ ( K  mod  ( ( od
Z `  N ) `  A ) ) )  e.  CC )
104103mulid2d 8853 . . . . . 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 5873 . . . . 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 2323 . . . 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 2291 . . 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 11118 . . . . 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 12538 . . . 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 12538 . . . 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 12535 . . 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 1623    e. wcel 1684   {crab 2547    C_ wss 3152   class class class wbr 4023   `'ccnv 4688   ` cfv 5255  (class class class)co 5858   supcsup 7193   RRcr 8736   0cc0 8737   1c1 8738    + caddc 8740    x. cmul 8742    < clt 8867    <_ cle 8868    - cmin 9037    / cdiv 9423   NNcn 9746   NN0cn0 9965   ZZcz 10024   ZZ>=cuz 10230   RR+crp 10354   |_cfl 10924    mod cmo 10973   ^cexp 11104    || cdivides 12531    gcd cgcd 12685   od
Zcodz 12831
This theorem is referenced by:  odzphi  12861  pockthlem  12952
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814  ax-pre-sup 8815
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 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rmo 2551  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-int 3863  df-iun 3907  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-1st 6122  df-2nd 6123  df-riota 6304  df-recs 6388  df-rdg 6423  df-1o 6479  df-oadd 6483  df-er 6660  df-map 6774  df-en 6864  df-dom 6865  df-sdom 6866  df-fin 6867  df-sup 7194  df-card 7572  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-div 9424  df-nn 9747  df-2 9804  df-3 9805  df-n0 9966  df-z 10025  df-uz 10231  df-rp 10355  df-fz 10783  df-fzo 10871  df-fl 10925  df-mod 10974  df-seq 11047  df-exp 11105  df-hash 11338  df-cj 11584  df-re 11585  df-im 11586  df-sqr 11720  df-abs 11721  df-dvds 12532  df-gcd 12686  df-odz 12833  df-phi 12834
  Copyright terms: Public domain W3C validator