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

Theorem mod2eq1n2dvds 38870
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 11044 . . . 4  |-  ( N  e.  ZZ  ->  (
( N  /  2
)  e.  ZZ  \/  ( ( N  + 
1 )  /  2
)  e.  ZZ ) )
2 zre 10965 . . . . . . . . 9  |-  ( N  e.  ZZ  ->  N  e.  RR )
3 2rp 11330 . . . . . . . . 9  |-  2  e.  RR+
4 mod0 12136 . . . . . . . . 9  |-  ( ( N  e.  RR  /\  2  e.  RR+ )  -> 
( ( N  mod  2 )  =  0  <-> 
( N  /  2
)  e.  ZZ ) )
52, 3, 4sylancl 675 . . . . . . . 8  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  0  <->  ( N  /  2 )  e.  ZZ ) )
65biimpar 493 . . . . . . 7  |-  ( ( N  e.  ZZ  /\  ( N  /  2
)  e.  ZZ )  ->  ( N  mod  2 )  =  0 )
7 eqeq1 2475 . . . . . . . 8  |-  ( ( N  mod  2 )  =  0  ->  (
( N  mod  2
)  =  1  <->  0  =  1 ) )
8 0ne1 10699 . . . . . . . . 9  |-  0  =/=  1
9 eqneqall 2654 . . . . . . . . 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 236 . . . . . . 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 442 . . . . 5  |-  ( ( N  /  2 )  e.  ZZ  ->  ( N  e.  ZZ  ->  ( ( N  mod  2
)  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) ) )
14 peano2zm 11004 . . . . . . . . 9  |-  ( ( ( N  +  1 )  /  2 )  e.  ZZ  ->  (
( ( N  + 
1 )  /  2
)  -  1 )  e.  ZZ )
15 zcn 10966 . . . . . . . . . . . 12  |-  ( N  e.  ZZ  ->  N  e.  CC )
16 xp1d2m1eqxm1d2 38856 . . . . . . . . . . . 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 2533 . . . . . . . . . 10  |-  ( N  e.  ZZ  ->  (
( ( ( N  +  1 )  / 
2 )  -  1 )  e.  ZZ  <->  ( ( N  -  1 )  /  2 )  e.  ZZ ) )
1918biimpd 212 . . . . . . . . 9  |-  ( N  e.  ZZ  ->  (
( ( ( N  +  1 )  / 
2 )  -  1 )  e.  ZZ  ->  ( ( N  -  1 )  /  2 )  e.  ZZ ) )
2014, 19mpan9 477 . . . . . . . 8  |-  ( ( ( ( N  + 
1 )  /  2
)  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( N  - 
1 )  /  2
)  e.  ZZ )
21 oveq2 6316 . . . . . . . . . . 11  |-  ( n  =  ( ( N  -  1 )  / 
2 )  ->  (
2  x.  n )  =  ( 2  x.  ( ( N  - 
1 )  /  2
) ) )
2221adantl 473 . . . . . . . . . 10  |-  ( ( ( ( ( N  +  1 )  / 
2 )  e.  ZZ  /\  N  e.  ZZ )  /\  n  =  ( ( N  -  1 )  /  2 ) )  ->  ( 2  x.  n )  =  ( 2  x.  (
( N  -  1 )  /  2 ) ) )
2322oveq1d 6323 . . . . . . . . 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 11004 . . . . . . . . . . . . . 14  |-  ( N  e.  ZZ  ->  ( N  -  1 )  e.  ZZ )
2524zcnd 11064 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  ( N  -  1 )  e.  CC )
26 2cnd 10704 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  2  e.  CC )
27 2ne0 10724 . . . . . . . . . . . . . 14  |-  2  =/=  0
2827a1i 11 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  2  =/=  0 )
2925, 26, 28divcan2d 10407 . . . . . . . . . . . 12  |-  ( N  e.  ZZ  ->  (
2  x.  ( ( N  -  1 )  /  2 ) )  =  ( N  - 
1 ) )
3029oveq1d 6323 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  (
( 2  x.  (
( N  -  1 )  /  2 ) )  +  1 )  =  ( ( N  -  1 )  +  1 ) )
31 npcan1 10065 . . . . . . . . . . . 12  |-  ( N  e.  CC  ->  (
( N  -  1 )  +  1 )  =  N )
3215, 31syl 17 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  (
( N  -  1 )  +  1 )  =  N )
3330, 32eqtrd 2505 . . . . . . . . . 10  |-  ( N  e.  ZZ  ->  (
( 2  x.  (
( N  -  1 )  /  2 ) )  +  1 )  =  N )
3433ad2antlr 741 . . . . . . . . 9  |-  ( ( ( ( ( N  +  1 )  / 
2 )  e.  ZZ  /\  N  e.  ZZ )  /\  n  =  ( ( N  -  1 )  /  2 ) )  ->  ( (
2  x.  ( ( N  -  1 )  /  2 ) )  +  1 )  =  N )
3523, 34eqtrd 2505 . . . . . . . 8  |-  ( ( ( ( ( N  +  1 )  / 
2 )  e.  ZZ  /\  N  e.  ZZ )  /\  n  =  ( ( N  -  1 )  /  2 ) )  ->  ( (
2  x.  n )  +  1 )  =  N )
3620, 35rspcedeq1vd 3144 . . . . . . 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 441 . . . . 5  |-  ( ( ( N  +  1 )  /  2 )  e.  ZZ  ->  ( N  e.  ZZ  ->  ( ( N  mod  2
)  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) ) )
3913, 38jaoi 386 . . . 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 36 . . 3  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  1  ->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) )
41 oveq1 6315 . . . . . . 7  |-  ( N  =  ( ( 2  x.  n )  +  1 )  ->  ( N  mod  2 )  =  ( ( ( 2  x.  n )  +  1 )  mod  2
) )
4241eqcoms 2479 . . . . . 6  |-  ( ( ( 2  x.  n
)  +  1 )  =  N  ->  ( N  mod  2 )  =  ( ( ( 2  x.  n )  +  1 )  mod  2
) )
43 2cnd 10704 . . . . . . . . . . . . . 14  |-  ( n  e.  ZZ  ->  2  e.  CC )
44 zcn 10966 . . . . . . . . . . . . . 14  |-  ( n  e.  ZZ  ->  n  e.  CC )
4543, 44mulcomd 9682 . . . . . . . . . . . . 13  |-  ( n  e.  ZZ  ->  (
2  x.  n )  =  ( n  x.  2 ) )
4645oveq1d 6323 . . . . . . . . . . . 12  |-  ( n  e.  ZZ  ->  (
( 2  x.  n
)  mod  2 )  =  ( ( n  x.  2 )  mod  2 ) )
47 mulmod0 12137 . . . . . . . . . . . . 13  |-  ( ( n  e.  ZZ  /\  2  e.  RR+ )  -> 
( ( n  x.  2 )  mod  2
)  =  0 )
483, 47mpan2 685 . . . . . . . . . . . 12  |-  ( n  e.  ZZ  ->  (
( n  x.  2 )  mod  2 )  =  0 )
4946, 48eqtrd 2505 . . . . . . . . . . 11  |-  ( n  e.  ZZ  ->  (
( 2  x.  n
)  mod  2 )  =  0 )
5049oveq1d 6323 . . . . . . . . . 10  |-  ( n  e.  ZZ  ->  (
( ( 2  x.  n )  mod  2
)  +  1 )  =  ( 0  +  1 ) )
51 0p1e1 10743 . . . . . . . . . 10  |-  ( 0  +  1 )  =  1
5250, 51syl6eq 2521 . . . . . . . . 9  |-  ( n  e.  ZZ  ->  (
( ( 2  x.  n )  mod  2
)  +  1 )  =  1 )
5352oveq1d 6323 . . . . . . . 8  |-  ( n  e.  ZZ  ->  (
( ( ( 2  x.  n )  mod  2 )  +  1 )  mod  2 )  =  ( 1  mod  2 ) )
54 2z 10993 . . . . . . . . . . . 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 11069 . . . . . . . . . 10  |-  ( n  e.  ZZ  ->  (
2  x.  n )  e.  ZZ )
5857zred 11063 . . . . . . . . 9  |-  ( n  e.  ZZ  ->  (
2  x.  n )  e.  RR )
59 1red 9676 . . . . . . . . 9  |-  ( n  e.  ZZ  ->  1  e.  RR )
603a1i 11 . . . . . . . . 9  |-  ( n  e.  ZZ  ->  2  e.  RR+ )
61 modaddmod 12169 . . . . . . . . 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 1292 . . . . . . . 8  |-  ( n  e.  ZZ  ->  (
( ( ( 2  x.  n )  mod  2 )  +  1 )  mod  2 )  =  ( ( ( 2  x.  n )  +  1 )  mod  2 ) )
63 2re 10701 . . . . . . . . . 10  |-  2  e.  RR
64 1lt2 10799 . . . . . . . . . 10  |-  1  <  2
6563, 64pm3.2i 462 . . . . . . . . 9  |-  ( 2  e.  RR  /\  1  <  2 )
66 1mod 12162 . . . . . . . . 9  |-  ( ( 2  e.  RR  /\  1  <  2 )  -> 
( 1  mod  2
)  =  1 )
6765, 66mp1i 13 . . . . . . . 8  |-  ( n  e.  ZZ  ->  (
1  mod  2 )  =  1 )
6853, 62, 673eqtr3d 2513 . . . . . . 7  |-  ( n  e.  ZZ  ->  (
( ( 2  x.  n )  +  1 )  mod  2 )  =  1 )
6968adantl 473 . . . . . 6  |-  ( ( N  e.  ZZ  /\  n  e.  ZZ )  ->  ( ( ( 2  x.  n )  +  1 )  mod  2
)  =  1 )
7042, 69sylan9eqr 2527 . . . . 5  |-  ( ( ( N  e.  ZZ  /\  n  e.  ZZ )  /\  ( ( 2  x.  n )  +  1 )  =  N )  ->  ( N  mod  2 )  =  1 )
7170ex 441 . . . 4  |-  ( ( N  e.  ZZ  /\  n  e.  ZZ )  ->  ( ( ( 2  x.  n )  +  1 )  =  N  ->  ( N  mod  2 )  =  1 ) )
7271rexlimdva 2871 . . 3  |-  ( N  e.  ZZ  ->  ( E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N  -> 
( N  mod  2
)  =  1 ) )
7340, 72impbid 195 . 2  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  1  <->  E. n  e.  ZZ  (
( 2  x.  n
)  +  1 )  =  N ) )
74 odd2np1 14443 . 2  |-  ( N  e.  ZZ  ->  ( -.  2  ||  N  <->  E. n  e.  ZZ  ( ( 2  x.  n )  +  1 )  =  N ) )
7573, 74bitr4d 264 1  |-  ( N  e.  ZZ  ->  (
( N  mod  2
)  =  1  <->  -.  2  ||  N ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 189    \/ wo 375    /\ wa 376    = wceq 1452    e. wcel 1904    =/= wne 2641   E.wrex 2757   class class class wbr 4395  (class class class)co 6308   CCcc 9555   RRcr 9556   0cc0 9557   1c1 9558    + caddc 9560    x. cmul 9562    < clt 9693    - cmin 9880    / cdiv 10291   2c2 10681   ZZcz 10961   RR+crp 11325    mod cmo 12129    || cdvds 14382
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1677  ax-4 1690  ax-5 1766  ax-6 1813  ax-7 1859  ax-8 1906  ax-9 1913  ax-10 1932  ax-11 1937  ax-12 1950  ax-13 2104  ax-ext 2451  ax-sep 4518  ax-nul 4527  ax-pow 4579  ax-pr 4639  ax-un 6602  ax-cnex 9613  ax-resscn 9614  ax-1cn 9615  ax-icn 9616  ax-addcl 9617  ax-addrcl 9618  ax-mulcl 9619  ax-mulrcl 9620  ax-mulcom 9621  ax-addass 9622  ax-mulass 9623  ax-distr 9624  ax-i2m1 9625  ax-1ne0 9626  ax-1rid 9627  ax-rnegex 9628  ax-rrecex 9629  ax-cnre 9630  ax-pre-lttri 9631  ax-pre-lttrn 9632  ax-pre-ltadd 9633  ax-pre-mulgt0 9634  ax-pre-sup 9635
This theorem depends on definitions:  df-bi 190  df-or 377  df-an 378  df-3or 1008  df-3an 1009  df-tru 1455  df-ex 1672  df-nf 1676  df-sb 1806  df-eu 2323  df-mo 2324  df-clab 2458  df-cleq 2464  df-clel 2467  df-nfc 2601  df-ne 2643  df-nel 2644  df-ral 2761  df-rex 2762  df-reu 2763  df-rmo 2764  df-rab 2765  df-v 3033  df-sbc 3256  df-csb 3350  df-dif 3393  df-un 3395  df-in 3397  df-ss 3404  df-pss 3406  df-nul 3723  df-if 3873  df-pw 3944  df-sn 3960  df-pr 3962  df-tp 3964  df-op 3966  df-uni 4191  df-iun 4271  df-br 4396  df-opab 4455  df-mpt 4456  df-tr 4491  df-eprel 4750  df-id 4754  df-po 4760  df-so 4761  df-fr 4798  df-we 4800  df-xp 4845  df-rel 4846  df-cnv 4847  df-co 4848  df-dm 4849  df-rn 4850  df-res 4851  df-ima 4852  df-pred 5387  df-ord 5433  df-on 5434  df-lim 5435  df-suc 5436  df-iota 5553  df-fun 5591  df-fn 5592  df-f 5593  df-f1 5594  df-fo 5595  df-f1o 5596  df-fv 5597  df-riota 6270  df-ov 6311  df-oprab 6312  df-mpt2 6313  df-om 6712  df-wrecs 7046  df-recs 7108  df-rdg 7146  df-er 7381  df-en 7588  df-dom 7589  df-sdom 7590  df-sup 7974  df-inf 7975  df-pnf 9695  df-mnf 9696  df-xr 9697  df-ltxr 9698  df-le 9699  df-sub 9882  df-neg 9883  df-div 10292  df-nn 10632  df-2 10690  df-n0 10894  df-z 10962  df-uz 11183  df-rp 11326  df-fl 12061  df-mod 12130  df-dvds 14383
This theorem is referenced by:  elmod2OLD  38871  dig2nn1st  40924  0dig2nn0o  40932  dig2bits  40933
  Copyright terms: Public domain W3C validator