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

Theorem divalgb 11463
Description: Express the division algorithm as stated in divalg 11462 in terms of . (Contributed by Paul Chapman, 31-Mar-2011.)
Assertion
Ref Expression
divalgb ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ ∧ 𝐷 ≠ 0) → (∃!𝑟 ∈ ℤ ∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ∃!𝑟 ∈ ℕ0 (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))))
Distinct variable groups:   𝐷,𝑞,𝑟   𝑁,𝑞,𝑟

Proof of Theorem divalgb
StepHypRef Expression
1 zsubcl 8992 . . . . . . . . . . . 12 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (𝑁𝑟) ∈ ℤ)
2 divides 11336 . . . . . . . . . . . 12 ((𝐷 ∈ ℤ ∧ (𝑁𝑟) ∈ ℤ) → (𝐷 ∥ (𝑁𝑟) ↔ ∃𝑞 ∈ ℤ (𝑞 · 𝐷) = (𝑁𝑟)))
31, 2sylan2 282 . . . . . . . . . . 11 ((𝐷 ∈ ℤ ∧ (𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ)) → (𝐷 ∥ (𝑁𝑟) ↔ ∃𝑞 ∈ ℤ (𝑞 · 𝐷) = (𝑁𝑟)))
433impb 1158 . . . . . . . . . 10 ((𝐷 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (𝐷 ∥ (𝑁𝑟) ↔ ∃𝑞 ∈ ℤ (𝑞 · 𝐷) = (𝑁𝑟)))
543com12 1166 . . . . . . . . 9 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (𝐷 ∥ (𝑁𝑟) ↔ ∃𝑞 ∈ ℤ (𝑞 · 𝐷) = (𝑁𝑟)))
6 zcn 8956 . . . . . . . . . . . . . . . . . 18 (𝑁 ∈ ℤ → 𝑁 ∈ ℂ)
7 zcn 8956 . . . . . . . . . . . . . . . . . 18 (𝑟 ∈ ℤ → 𝑟 ∈ ℂ)
8 zmulcl 9004 . . . . . . . . . . . . . . . . . . 19 ((𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ) → (𝑞 · 𝐷) ∈ ℤ)
98zcnd 9071 . . . . . . . . . . . . . . . . . 18 ((𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ) → (𝑞 · 𝐷) ∈ ℂ)
10 subadd 7881 . . . . . . . . . . . . . . . . . 18 ((𝑁 ∈ ℂ ∧ 𝑟 ∈ ℂ ∧ (𝑞 · 𝐷) ∈ ℂ) → ((𝑁𝑟) = (𝑞 · 𝐷) ↔ (𝑟 + (𝑞 · 𝐷)) = 𝑁))
116, 7, 9, 10syl3an 1239 . . . . . . . . . . . . . . . . 17 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ ∧ (𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ)) → ((𝑁𝑟) = (𝑞 · 𝐷) ↔ (𝑟 + (𝑞 · 𝐷)) = 𝑁))
12 addcom 7815 . . . . . . . . . . . . . . . . . . . 20 ((𝑟 ∈ ℂ ∧ (𝑞 · 𝐷) ∈ ℂ) → (𝑟 + (𝑞 · 𝐷)) = ((𝑞 · 𝐷) + 𝑟))
137, 9, 12syl2an 285 . . . . . . . . . . . . . . . . . . 19 ((𝑟 ∈ ℤ ∧ (𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ)) → (𝑟 + (𝑞 · 𝐷)) = ((𝑞 · 𝐷) + 𝑟))
14133adant1 980 . . . . . . . . . . . . . . . . . 18 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ ∧ (𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ)) → (𝑟 + (𝑞 · 𝐷)) = ((𝑞 · 𝐷) + 𝑟))
1514eqeq1d 2121 . . . . . . . . . . . . . . . . 17 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ ∧ (𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ)) → ((𝑟 + (𝑞 · 𝐷)) = 𝑁 ↔ ((𝑞 · 𝐷) + 𝑟) = 𝑁))
1611, 15bitrd 187 . . . . . . . . . . . . . . . 16 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ ∧ (𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ)) → ((𝑁𝑟) = (𝑞 · 𝐷) ↔ ((𝑞 · 𝐷) + 𝑟) = 𝑁))
17 eqcom 2115 . . . . . . . . . . . . . . . 16 ((𝑁𝑟) = (𝑞 · 𝐷) ↔ (𝑞 · 𝐷) = (𝑁𝑟))
18 eqcom 2115 . . . . . . . . . . . . . . . 16 (((𝑞 · 𝐷) + 𝑟) = 𝑁𝑁 = ((𝑞 · 𝐷) + 𝑟))
1916, 17, 183bitr3g 221 . . . . . . . . . . . . . . 15 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ ∧ (𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ)) → ((𝑞 · 𝐷) = (𝑁𝑟) ↔ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
20193expia 1164 . . . . . . . . . . . . . 14 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ) → ((𝑞 ∈ ℤ ∧ 𝐷 ∈ ℤ) → ((𝑞 · 𝐷) = (𝑁𝑟) ↔ 𝑁 = ((𝑞 · 𝐷) + 𝑟))))
2120expcomd 1398 . . . . . . . . . . . . 13 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (𝐷 ∈ ℤ → (𝑞 ∈ ℤ → ((𝑞 · 𝐷) = (𝑁𝑟) ↔ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))))
22213impia 1159 . . . . . . . . . . . 12 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ ∧ 𝐷 ∈ ℤ) → (𝑞 ∈ ℤ → ((𝑞 · 𝐷) = (𝑁𝑟) ↔ 𝑁 = ((𝑞 · 𝐷) + 𝑟))))
2322imp 123 . . . . . . . . . . 11 (((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ ∧ 𝐷 ∈ ℤ) ∧ 𝑞 ∈ ℤ) → ((𝑞 · 𝐷) = (𝑁𝑟) ↔ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
2423rexbidva 2406 . . . . . . . . . 10 ((𝑁 ∈ ℤ ∧ 𝑟 ∈ ℤ ∧ 𝐷 ∈ ℤ) → (∃𝑞 ∈ ℤ (𝑞 · 𝐷) = (𝑁𝑟) ↔ ∃𝑞 ∈ ℤ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
25243com23 1168 . . . . . . . . 9 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (∃𝑞 ∈ ℤ (𝑞 · 𝐷) = (𝑁𝑟) ↔ ∃𝑞 ∈ ℤ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
265, 25bitrd 187 . . . . . . . 8 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (𝐷 ∥ (𝑁𝑟) ↔ ∃𝑞 ∈ ℤ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
2726anbi2d 457 . . . . . . 7 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ 𝐷 ∥ (𝑁𝑟)) ↔ ((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ ∃𝑞 ∈ ℤ 𝑁 = ((𝑞 · 𝐷) + 𝑟))))
28 df-3an 945 . . . . . . . . 9 ((0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
2928rexbii 2414 . . . . . . . 8 (∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ∃𝑞 ∈ ℤ ((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
30 r19.42v 2560 . . . . . . . 8 (∃𝑞 ∈ ℤ ((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ ∃𝑞 ∈ ℤ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
3129, 30bitri 183 . . . . . . 7 (∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ ∃𝑞 ∈ ℤ 𝑁 = ((𝑞 · 𝐷) + 𝑟)))
3227, 31syl6rbbr 198 . . . . . 6 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ 𝐷 ∥ (𝑁𝑟))))
33 anass 396 . . . . . 6 (((0 ≤ 𝑟𝑟 < (abs‘𝐷)) ∧ 𝐷 ∥ (𝑁𝑟)) ↔ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))))
3432, 33syl6bb 195 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ ∧ 𝑟 ∈ ℤ) → (∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)))))
35343expa 1162 . . . 4 (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ) ∧ 𝑟 ∈ ℤ) → (∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)))))
3635reubidva 2585 . . 3 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ) → (∃!𝑟 ∈ ℤ ∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ∃!𝑟 ∈ ℤ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)))))
37 elnn0z 8964 . . . . . . 7 (𝑟 ∈ ℕ0 ↔ (𝑟 ∈ ℤ ∧ 0 ≤ 𝑟))
3837anbi1i 451 . . . . . 6 ((𝑟 ∈ ℕ0 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))) ↔ ((𝑟 ∈ ℤ ∧ 0 ≤ 𝑟) ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))))
39 anass 396 . . . . . 6 (((𝑟 ∈ ℤ ∧ 0 ≤ 𝑟) ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))) ↔ (𝑟 ∈ ℤ ∧ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)))))
4038, 39bitri 183 . . . . 5 ((𝑟 ∈ ℕ0 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))) ↔ (𝑟 ∈ ℤ ∧ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)))))
4140eubii 1982 . . . 4 (∃!𝑟(𝑟 ∈ ℕ0 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))) ↔ ∃!𝑟(𝑟 ∈ ℤ ∧ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)))))
42 df-reu 2395 . . . 4 (∃!𝑟 ∈ ℕ0 (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)) ↔ ∃!𝑟(𝑟 ∈ ℕ0 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))))
43 df-reu 2395 . . . 4 (∃!𝑟 ∈ ℤ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))) ↔ ∃!𝑟(𝑟 ∈ ℤ ∧ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)))))
4441, 42, 433bitr4ri 212 . . 3 (∃!𝑟 ∈ ℤ (0 ≤ 𝑟 ∧ (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))) ↔ ∃!𝑟 ∈ ℕ0 (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟)))
4536, 44syl6bb 195 . 2 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ) → (∃!𝑟 ∈ ℤ ∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ∃!𝑟 ∈ ℕ0 (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))))
46453adant3 982 1 ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℤ ∧ 𝐷 ≠ 0) → (∃!𝑟 ∈ ℤ ∃𝑞 ∈ ℤ (0 ≤ 𝑟𝑟 < (abs‘𝐷) ∧ 𝑁 = ((𝑞 · 𝐷) + 𝑟)) ↔ ∃!𝑟 ∈ ℕ0 (𝑟 < (abs‘𝐷) ∧ 𝐷 ∥ (𝑁𝑟))))
Colors of variables: wff set class
Syntax hints:  wi 4  wa 103  wb 104  w3a 943   = wceq 1312  wcel 1461  ∃!weu 1973  wne 2280  wrex 2389  ∃!wreu 2390   class class class wbr 3893  cfv 5079  (class class class)co 5726  cc 7538  0cc0 7540   + caddc 7543   · cmul 7545   < clt 7717  cle 7718  cmin 7849  0cn0 8874  cz 8951  abscabs 10654  cdvds 11334
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 105  ax-ia2 106  ax-ia3 107  ax-in1 586  ax-in2 587  ax-io 681  ax-5 1404  ax-7 1405  ax-gen 1406  ax-ie1 1450  ax-ie2 1451  ax-8 1463  ax-10 1464  ax-11 1465  ax-i12 1466  ax-bndl 1467  ax-4 1468  ax-13 1472  ax-14 1473  ax-17 1487  ax-i9 1491  ax-ial 1495  ax-i5r 1496  ax-ext 2095  ax-sep 4004  ax-pow 4056  ax-pr 4089  ax-un 4313  ax-setind 4410  ax-cnex 7629  ax-resscn 7630  ax-1cn 7631  ax-1re 7632  ax-icn 7633  ax-addcl 7634  ax-addrcl 7635  ax-mulcl 7636  ax-mulrcl 7637  ax-addcom 7638  ax-mulcom 7639  ax-addass 7640  ax-mulass 7641  ax-distr 7642  ax-i2m1 7643  ax-0lt1 7644  ax-1rid 7645  ax-0id 7646  ax-rnegex 7647  ax-cnre 7649  ax-pre-ltirr 7650  ax-pre-ltwlin 7651  ax-pre-lttrn 7652  ax-pre-ltadd 7654
This theorem depends on definitions:  df-bi 116  df-3or 944  df-3an 945  df-tru 1315  df-fal 1318  df-nf 1418  df-sb 1717  df-eu 1976  df-mo 1977  df-clab 2100  df-cleq 2106  df-clel 2109  df-nfc 2242  df-ne 2281  df-nel 2376  df-ral 2393  df-rex 2394  df-reu 2395  df-rab 2397  df-v 2657  df-sbc 2877  df-dif 3037  df-un 3039  df-in 3041  df-ss 3048  df-pw 3476  df-sn 3497  df-pr 3498  df-op 3500  df-uni 3701  df-int 3736  df-br 3894  df-opab 3948  df-id 4173  df-xp 4503  df-rel 4504  df-cnv 4505  df-co 4506  df-dm 4507  df-iota 5044  df-fun 5081  df-fv 5087  df-riota 5682  df-ov 5729  df-oprab 5730  df-mpo 5731  df-pnf 7719  df-mnf 7720  df-xr 7721  df-ltxr 7722  df-le 7723  df-sub 7851  df-neg 7852  df-inn 8624  df-n0 8875  df-z 8952  df-dvds 11335
This theorem is referenced by:  divalg2  11464
  Copyright terms: Public domain W3C validator