Users' Mathboxes Mathbox for Alexander van der Vekens < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  mod2eq1n2dvds Structured version   Unicode version

Theorem mod2eq1n2dvds 37676
Description: An integer is 1 modulo 2 iff it is not divisible by 2. (Contributed by AV, 24-May-2020.) (Proof shortened by AV, 5-Jul-2020.)
Assertion
Ref Expression
mod2eq1n2dvds  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  1  <->  -.  2  ||  N ) )

Proof of Theorem mod2eq1n2dvds
Dummy variable  n is distinct from all other variables.
StepHypRef Expression
1 zeo 10989 . . . 4  |-  ( N  e.  ZZ  ->  (
( N  /  2
)  e.  ZZ  \/  ( ( N  + 
1 )  /  2
)  e.  ZZ ) )
2 zre 10909 . . . . . . . . 9  |-  ( N  e.  ZZ  ->  N  e.  RR )
3 2rp 11270 . . . . . . . . 9  |-  2  e.  RR+
4 mod0 12041 . . . . . . . . 9  |-  ( ( N  e.  RR  /\  2  e.  RR+ )  -> 
( ( N  mod  2 )  =  0  <-> 
( N  /  2
)  e.  ZZ ) )
52, 3, 4sylancl 660 . . . . . . . 8  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  0  <->  ( N  /  2 )  e.  ZZ ) )
65biimpar 483 . . . . . . 7  |-  ( ( N  e.  ZZ  /\  ( N  /  2
)  e.  ZZ )  ->  ( N  mod  2 )  =  0 )
7 eqeq1 2406 . . . . . . . 8  |-  ( ( N  mod  2 )  =  0  ->  (
( N  mod  2
)  =  1  <->  0  =  1 ) )
8 0ne1 10644 . . . . . . . . 9  |-  0  =/=  1
9 eqneqall 2610 . . . . . . . . 9  |-  ( 0  =  1  ->  (
0  =/=  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) )
108, 9mpi 20 . . . . . . . 8  |-  ( 0  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N )
117, 10syl6bi 228 . . . . . . 7  |-  ( ( N  mod  2 )  =  0  ->  (
( N  mod  2
)  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) )
126, 11syl 17 . . . . . 6  |-  ( ( N  e.  ZZ  /\  ( N  /  2
)  e.  ZZ )  ->  ( ( N  mod  2 )  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) )
1312expcom 433 . . . . 5  |-  ( ( N  /  2 )  e.  ZZ  ->  ( N  e.  ZZ  ->  ( ( N  mod  2
)  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) ) )
14 peano2zm 10948 . . . . . . . . 9  |-  ( ( ( N  +  1 )  /  2 )  e.  ZZ  ->  (
( ( N  + 
1 )  /  2
)  -  1 )  e.  ZZ )
15 zcn 10910 . . . . . . . . . . . 12  |-  ( N  e.  ZZ  ->  N  e.  CC )
16 xp1d2m1eqxm1d2 37662 . . . . . . . . . . . 12  |-  ( N  e.  CC  ->  (
( ( N  + 
1 )  /  2
)  -  1 )  =  ( ( N  -  1 )  / 
2 ) )
1715, 16syl 17 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  (
( ( N  + 
1 )  /  2
)  -  1 )  =  ( ( N  -  1 )  / 
2 ) )
1817eleq1d 2471 . . . . . . . . . 10  |-  ( N  e.  ZZ  ->  (
( ( ( N  +  1 )  / 
2 )  -  1 )  e.  ZZ  <->  ( ( N  -  1 )  /  2 )  e.  ZZ ) )
1918biimpd 207 . . . . . . . . 9  |-  ( N  e.  ZZ  ->  (
( ( ( N  +  1 )  / 
2 )  -  1 )  e.  ZZ  ->  ( ( N  -  1 )  /  2 )  e.  ZZ ) )
2014, 19mpan9 467 . . . . . . . 8  |-  ( ( ( ( N  + 
1 )  /  2
)  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( N  - 
1 )  /  2
)  e.  ZZ )
21 oveq2 6286 . . . . . . . . . . 11  |-  ( n  =  ( ( N  -  1 )  / 
2 )  ->  (
2  x.  n )  =  ( 2  x.  ( ( N  - 
1 )  /  2
) ) )
2221adantl 464 . . . . . . . . . 10  |-  ( ( ( ( ( N  +  1 )  / 
2 )  e.  ZZ  /\  N  e.  ZZ )  /\  n  =  ( ( N  -  1 )  /  2 ) )  ->  ( 2  x.  n )  =  ( 2  x.  (
( N  -  1 )  /  2 ) ) )
2322oveq1d 6293 . . . . . . . . 9  |-  ( ( ( ( ( N  +  1 )  / 
2 )  e.  ZZ  /\  N  e.  ZZ )  /\  n  =  ( ( N  -  1 )  /  2 ) )  ->  ( (
2  x.  n )  +  1 )  =  ( ( 2  x.  ( ( N  - 
1 )  /  2
) )  +  1 ) )
24 peano2zm 10948 . . . . . . . . . . . . . 14  |-  ( N  e.  ZZ  ->  ( N  -  1 )  e.  ZZ )
2524zcnd 11009 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  ( N  -  1 )  e.  CC )
26 2cnd 10649 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  2  e.  CC )
27 2ne0 10669 . . . . . . . . . . . . . 14  |-  2  =/=  0
2827a1i 11 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  2  =/=  0 )
2925, 26, 28divcan2d 10363 . . . . . . . . . . . 12  |-  ( N  e.  ZZ  ->  (
2  x.  ( ( N  -  1 )  /  2 ) )  =  ( N  - 
1 ) )
3029oveq1d 6293 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  (
( 2  x.  (
( N  -  1 )  /  2 ) )  +  1 )  =  ( ( N  -  1 )  +  1 ) )
31 npcan1 10025 . . . . . . . . . . . 12  |-  ( N  e.  CC  ->  (
( N  -  1 )  +  1 )  =  N )
3215, 31syl 17 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  (
( N  -  1 )  +  1 )  =  N )
3330, 32eqtrd 2443 . . . . . . . . . 10  |-  ( N  e.  ZZ  ->  (
( 2  x.  (
( N  -  1 )  /  2 ) )  +  1 )  =  N )
3433ad2antlr 725 . . . . . . . . 9  |-  ( ( ( ( ( N  +  1 )  / 
2 )  e.  ZZ  /\  N  e.  ZZ )  /\  n  =  ( ( N  -  1 )  /  2 ) )  ->  ( (
2  x.  ( ( N  -  1 )  /  2 ) )  +  1 )  =  N )
3523, 34eqtrd 2443 . . . . . . . 8  |-  ( ( ( ( ( N  +  1 )  / 
2 )  e.  ZZ  /\  N  e.  ZZ )  /\  n  =  ( ( N  -  1 )  /  2 ) )  ->  ( (
2  x.  n )  +  1 )  =  N )
3620, 35rspcedeq1vd 3166 . . . . . . 7  |-  ( ( ( ( N  + 
1 )  /  2
)  e.  ZZ  /\  N  e.  ZZ )  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N )
3736a1d 25 . . . . . 6  |-  ( ( ( ( N  + 
1 )  /  2
)  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( N  mod  2 )  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) )
3837ex 432 . . . . 5  |-  ( ( ( N  +  1 )  /  2 )  e.  ZZ  ->  ( N  e.  ZZ  ->  ( ( N  mod  2
)  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) ) )
3913, 38jaoi 377 . . . 4  |-  ( ( ( N  /  2
)  e.  ZZ  \/  ( ( N  + 
1 )  /  2
)  e.  ZZ )  ->  ( N  e.  ZZ  ->  ( ( N  mod  2 )  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) ) )
401, 39mpcom 34 . . 3  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) )
41 oveq1 6285 . . . . . . 7  |-  ( N  =  ( ( 2  x.  n )  +  1 )  ->  ( N  mod  2 )  =  ( ( ( 2  x.  n )  +  1 )  mod  2
) )
4241eqcoms 2414 . . . . . 6  |-  ( ( ( 2  x.  n
)  +  1 )  =  N  ->  ( N  mod  2 )  =  ( ( ( 2  x.  n )  +  1 )  mod  2
) )
43 2cnd 10649 . . . . . . . . . . . . . 14  |-  ( n  e.  ZZ  ->  2  e.  CC )
44 zcn 10910 . . . . . . . . . . . . . 14  |-  ( n  e.  ZZ  ->  n  e.  CC )
4543, 44mulcomd 9647 . . . . . . . . . . . . 13  |-  ( n  e.  ZZ  ->  (
2  x.  n )  =  ( n  x.  2 ) )
4645oveq1d 6293 . . . . . . . . . . . 12  |-  ( n  e.  ZZ  ->  (
( 2  x.  n
)  mod  2 )  =  ( ( n  x.  2 )  mod  2 ) )
47 mulmod0 12042 . . . . . . . . . . . . 13  |-  ( ( n  e.  ZZ  /\  2  e.  RR+ )  -> 
( ( n  x.  2 )  mod  2
)  =  0 )
483, 47mpan2 669 . . . . . . . . . . . 12  |-  ( n  e.  ZZ  ->  (
( n  x.  2 )  mod  2 )  =  0 )
4946, 48eqtrd 2443 . . . . . . . . . . 11  |-  ( n  e.  ZZ  ->  (
( 2  x.  n
)  mod  2 )  =  0 )
5049oveq1d 6293 . . . . . . . . . 10  |-  ( n  e.  ZZ  ->  (
( ( 2  x.  n )  mod  2
)  +  1 )  =  ( 0  +  1 ) )
51 0p1e1 10688 . . . . . . . . . 10  |-  ( 0  +  1 )  =  1
5250, 51syl6eq 2459 . . . . . . . . 9  |-  ( n  e.  ZZ  ->  (
( ( 2  x.  n )  mod  2
)  +  1 )  =  1 )
5352oveq1d 6293 . . . . . . . 8  |-  ( n  e.  ZZ  ->  (
( ( ( 2  x.  n )  mod  2 )  +  1 )  mod  2 )  =  ( 1  mod  2 ) )
54 2z 10937 . . . . . . . . . . . 12  |-  2  e.  ZZ
5554a1i 11 . . . . . . . . . . 11  |-  ( n  e.  ZZ  ->  2  e.  ZZ )
56 id 22 . . . . . . . . . . 11  |-  ( n  e.  ZZ  ->  n  e.  ZZ )
5755, 56zmulcld 11014 . . . . . . . . . 10  |-  ( n  e.  ZZ  ->  (
2  x.  n )  e.  ZZ )
5857zred 11008 . . . . . . . . 9  |-  ( n  e.  ZZ  ->  (
2  x.  n )  e.  RR )
59 1red 9641 . . . . . . . . 9  |-  ( n  e.  ZZ  ->  1  e.  RR )
603a1i 11 . . . . . . . . 9  |-  ( n  e.  ZZ  ->  2  e.  RR+ )
61 modaddmod 12074 . . . . . . . . 9  |-  ( ( ( 2  x.  n
)  e.  RR  /\  1  e.  RR  /\  2  e.  RR+ )  ->  (
( ( ( 2  x.  n )  mod  2 )  +  1 )  mod  2 )  =  ( ( ( 2  x.  n )  +  1 )  mod  2 ) )
6258, 59, 60, 61syl3anc 1230 . . . . . . . 8  |-  ( n  e.  ZZ  ->  (
( ( ( 2  x.  n )  mod  2 )  +  1 )  mod  2 )  =  ( ( ( 2  x.  n )  +  1 )  mod  2 ) )
63 2re 10646 . . . . . . . . . 10  |-  2  e.  RR
64 1lt2 10743 . . . . . . . . . 10  |-  1  <  2
6563, 64pm3.2i 453 . . . . . . . . 9  |-  ( 2  e.  RR  /\  1  <  2 )
66 1mod 12067 . . . . . . . . 9  |-  ( ( 2  e.  RR  /\  1  <  2 )  -> 
( 1  mod  2
)  =  1 )
6765, 66mp1i 13 . . . . . . . 8  |-  ( n  e.  ZZ  ->  (
1  mod  2 )  =  1 )
6853, 62, 673eqtr3d 2451 . . . . . . 7  |-  ( n  e.  ZZ  ->  (
( ( 2  x.  n )  +  1 )  mod  2 )  =  1 )
6968adantl 464 . . . . . 6  |-  ( ( N  e.  ZZ  /\  n  e.  ZZ )  ->  ( ( ( 2  x.  n )  +  1 )  mod  2
)  =  1 )
7042, 69sylan9eqr 2465 . . . . 5  |-  ( ( ( N  e.  ZZ  /\  n  e.  ZZ )  /\  ( ( 2  x.  n )  +  1 )  =  N )  ->  ( N  mod  2 )  =  1 )
7170ex 432 . . . 4  |-  ( ( N  e.  ZZ  /\  n  e.  ZZ )  ->  ( ( ( 2  x.  n )  +  1 )  =  N  ->  ( N  mod  2 )  =  1 ) )
7271rexlimdva 2896 . . 3  |-  ( N  e.  ZZ  ->  ( E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N  -> 
( N  mod  2
)  =  1 ) )
7340, 72impbid 190 . 2  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  1  <->  E. n  e.  ZZ  (
( 2  x.  n
)  +  1 )  =  N ) )
74 odd2np1 14255 . 2  |-  ( N  e.  ZZ  ->  ( -.  2  ||  N  <->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) )
7573, 74bitr4d 256 1  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  1  <->  -.  2  ||  N ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 184    \/ wo 366    /\ wa 367    = wceq 1405    e. wcel 1842    =/= wne 2598   E.wrex 2755   class class class wbr 4395  (class class class)co 6278   CCcc 9520   RRcr 9521   0cc0 9522   1c1 9523    + caddc 9525    x. cmul 9527    < clt 9658    - cmin 9841    / cdiv 10247   2c2 10626   ZZcz 10905   RR+crp 11265    mod cmo 12034    || cdvds 14195
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1639  ax-4 1652  ax-5 1725  ax-6 1771  ax-7 1814  ax-8 1844  ax-9 1846  ax-10 1861  ax-11 1866  ax-12 1878  ax-13 2026  ax-ext 2380  ax-sep 4517  ax-nul 4525  ax-pow 4572  ax-pr 4630  ax-un 6574  ax-cnex 9578  ax-resscn 9579  ax-1cn 9580  ax-icn 9581  ax-addcl 9582  ax-addrcl 9583  ax-mulcl 9584  ax-mulrcl 9585  ax-mulcom 9586  ax-addass 9587  ax-mulass 9588  ax-distr 9589  ax-i2m1 9590  ax-1ne0 9591  ax-1rid 9592  ax-rnegex 9593  ax-rrecex 9594  ax-cnre 9595  ax-pre-lttri 9596  ax-pre-lttrn 9597  ax-pre-ltadd 9598  ax-pre-mulgt0 9599  ax-pre-sup 9600
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 975  df-3an 976  df-tru 1408  df-ex 1634  df-nf 1638  df-sb 1764  df-eu 2242  df-mo 2243  df-clab 2388  df-cleq 2394  df-clel 2397  df-nfc 2552  df-ne 2600  df-nel 2601  df-ral 2759  df-rex 2760  df-reu 2761  df-rmo 2762  df-rab 2763  df-v 3061  df-sbc 3278  df-csb 3374  df-dif 3417  df-un 3419  df-in 3421  df-ss 3428  df-pss 3430  df-nul 3739  df-if 3886  df-pw 3957  df-sn 3973  df-pr 3975  df-tp 3977  df-op 3979  df-uni 4192  df-iun 4273  df-br 4396  df-opab 4454  df-mpt 4455  df-tr 4490  df-eprel 4734  df-id 4738  df-po 4744  df-so 4745  df-fr 4782  df-we 4784  df-xp 4829  df-rel 4830  df-cnv 4831  df-co 4832  df-dm 4833  df-rn 4834  df-res 4835  df-ima 4836  df-pred 5367  df-ord 5413  df-on 5414  df-lim 5415  df-suc 5416  df-iota 5533  df-fun 5571  df-fn 5572  df-f 5573  df-f1 5574  df-fo 5575  df-f1o 5576  df-fv 5577  df-riota 6240  df-ov 6281  df-oprab 6282  df-mpt2 6283  df-om 6684  df-wrecs 7013  df-recs 7075  df-rdg 7113  df-er 7348  df-en 7555  df-dom 7556  df-sdom 7557  df-sup 7935  df-pnf 9660  df-mnf 9661  df-xr 9662  df-ltxr 9663  df-le 9664  df-sub 9843  df-neg 9844  df-div 10248  df-nn 10577  df-2 10635  df-n0 10837  df-z 10906  df-uz 11128  df-rp 11266  df-fl 11966  df-mod 12035  df-dvds 14196
This theorem is referenced by:  elmod2OLD  37677  dig2nn1st  38736  0dig2nn0o  38744  dig2bits  38745
  Copyright terms: Public domain W3C validator