ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  modqm1p1mod0 Unicode version

Theorem modqm1p1mod0 10162
Description: If a number modulo a modulus equals the modulus decreased by 1, the first number increased by 1 modulo the modulus equals 0. (Contributed by Jim Kingdon, 24-Oct-2021.)
Assertion
Ref Expression
modqm1p1mod0  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  (
( A  mod  M
)  =  ( M  -  1 )  -> 
( ( A  + 
1 )  mod  M
)  =  0 ) )

Proof of Theorem modqm1p1mod0
StepHypRef Expression
1 simpl1 984 . . . 4  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  ->  A  e.  QQ )
2 1z 9094 . . . . 5  |-  1  e.  ZZ
3 zq 9432 . . . . 5  |-  ( 1  e.  ZZ  ->  1  e.  QQ )
42, 3mp1i 10 . . . 4  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
1  e.  QQ )
5 simp2 982 . . . . 5  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  M  e.  QQ )
65adantr 274 . . . 4  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  ->  M  e.  QQ )
7 simpl3 986 . . . 4  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
0  <  M )
8 modqaddmod 10150 . . . 4  |-  ( ( ( A  e.  QQ  /\  1  e.  QQ )  /\  ( M  e.  QQ  /\  0  < 
M ) )  -> 
( ( ( A  mod  M )  +  1 )  mod  M
)  =  ( ( A  +  1 )  mod  M ) )
91, 4, 6, 7, 8syl22anc 1217 . . 3  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
( ( ( A  mod  M )  +  1 )  mod  M
)  =  ( ( A  +  1 )  mod  M ) )
10 oveq1 5781 . . . . . 6  |-  ( ( A  mod  M )  =  ( M  - 
1 )  ->  (
( A  mod  M
)  +  1 )  =  ( ( M  -  1 )  +  1 ) )
1110oveq1d 5789 . . . . 5  |-  ( ( A  mod  M )  =  ( M  - 
1 )  ->  (
( ( A  mod  M )  +  1 )  mod  M )  =  ( ( ( M  -  1 )  +  1 )  mod  M
) )
1211adantl 275 . . . 4  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
( ( ( A  mod  M )  +  1 )  mod  M
)  =  ( ( ( M  -  1 )  +  1 )  mod  M ) )
13 qcn 9440 . . . . . . . 8  |-  ( M  e.  QQ  ->  M  e.  CC )
145, 13syl 14 . . . . . . 7  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  M  e.  CC )
1514adantr 274 . . . . . 6  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  ->  M  e.  CC )
16 npcan1 8154 . . . . . 6  |-  ( M  e.  CC  ->  (
( M  -  1 )  +  1 )  =  M )
1715, 16syl 14 . . . . 5  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
( ( M  - 
1 )  +  1 )  =  M )
1817oveq1d 5789 . . . 4  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
( ( ( M  -  1 )  +  1 )  mod  M
)  =  ( M  mod  M ) )
19 modqid0 10137 . . . . 5  |-  ( ( M  e.  QQ  /\  0  <  M )  -> 
( M  mod  M
)  =  0 )
206, 7, 19syl2anc 408 . . . 4  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
( M  mod  M
)  =  0 )
2112, 18, 203eqtrd 2176 . . 3  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
( ( ( A  mod  M )  +  1 )  mod  M
)  =  0 )
229, 21eqtr3d 2174 . 2  |-  ( ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  /\  ( A  mod  M )  =  ( M  - 
1 ) )  -> 
( ( A  + 
1 )  mod  M
)  =  0 )
2322ex 114 1  |-  ( ( A  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  (
( A  mod  M
)  =  ( M  -  1 )  -> 
( ( A  + 
1 )  mod  M
)  =  0 ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 103    /\ w3a 962    = wceq 1331    e. wcel 1480   class class class wbr 3929  (class class class)co 5774   CCcc 7632   0cc0 7634   1c1 7635    + caddc 7637    < clt 7814    - cmin 7947   ZZcz 9068   QQcq 9425    mod cmo 10109
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 105  ax-ia2 106  ax-ia3 107  ax-in1 603  ax-in2 604  ax-io 698  ax-5 1423  ax-7 1424  ax-gen 1425  ax-ie1 1469  ax-ie2 1470  ax-8 1482  ax-10 1483  ax-11 1484  ax-i12 1485  ax-bndl 1486  ax-4 1487  ax-13 1491  ax-14 1492  ax-17 1506  ax-i9 1510  ax-ial 1514  ax-i5r 1515  ax-ext 2121  ax-sep 4046  ax-pow 4098  ax-pr 4131  ax-un 4355  ax-setind 4452  ax-cnex 7725  ax-resscn 7726  ax-1cn 7727  ax-1re 7728  ax-icn 7729  ax-addcl 7730  ax-addrcl 7731  ax-mulcl 7732  ax-mulrcl 7733  ax-addcom 7734  ax-mulcom 7735  ax-addass 7736  ax-mulass 7737  ax-distr 7738  ax-i2m1 7739  ax-0lt1 7740  ax-1rid 7741  ax-0id 7742  ax-rnegex 7743  ax-precex 7744  ax-cnre 7745  ax-pre-ltirr 7746  ax-pre-ltwlin 7747  ax-pre-lttrn 7748  ax-pre-apti 7749  ax-pre-ltadd 7750  ax-pre-mulgt0 7751  ax-pre-mulext 7752  ax-arch 7753
This theorem depends on definitions:  df-bi 116  df-3or 963  df-3an 964  df-tru 1334  df-fal 1337  df-nf 1437  df-sb 1736  df-eu 2002  df-mo 2003  df-clab 2126  df-cleq 2132  df-clel 2135  df-nfc 2270  df-ne 2309  df-nel 2404  df-ral 2421  df-rex 2422  df-reu 2423  df-rmo 2424  df-rab 2425  df-v 2688  df-sbc 2910  df-csb 3004  df-dif 3073  df-un 3075  df-in 3077  df-ss 3084  df-pw 3512  df-sn 3533  df-pr 3534  df-op 3536  df-uni 3737  df-int 3772  df-iun 3815  df-br 3930  df-opab 3990  df-mpt 3991  df-id 4215  df-po 4218  df-iso 4219  df-xp 4545  df-rel 4546  df-cnv 4547  df-co 4548  df-dm 4549  df-rn 4550  df-res 4551  df-ima 4552  df-iota 5088  df-fun 5125  df-fn 5126  df-f 5127  df-fv 5131  df-riota 5730  df-ov 5777  df-oprab 5778  df-mpo 5779  df-1st 6038  df-2nd 6039  df-pnf 7816  df-mnf 7817  df-xr 7818  df-ltxr 7819  df-le 7820  df-sub 7949  df-neg 7950  df-reap 8351  df-ap 8358  df-div 8447  df-inn 8735  df-n0 8992  df-z 9069  df-q 9426  df-rp 9456  df-fl 10057  df-mod 10110
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator