Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
||
Mirrors > Home > MPE Home > Th. List > addmodlteqALT | Structured version Visualization version GIF version |
Description: Two nonnegative integers less than the modulus are equal iff the sums of these integer with another integer are equal modulo the modulus. Shorter proof of addmodlteq 13780 based on the "divides" relation. (Contributed by AV, 14-Mar-2021.) (New usage is discouraged.) (Proof modification is discouraged.) |
Ref | Expression |
---|---|
addmodlteqALT | ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁) ∧ 𝑆 ∈ ℤ) → (((𝐼 + 𝑆) mod 𝑁) = ((𝐽 + 𝑆) mod 𝑁) ↔ 𝐼 = 𝐽)) |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | elfzo0 13542 | . . . . 5 ⊢ (𝐼 ∈ (0..^𝑁) ↔ (𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ ∧ 𝐼 < 𝑁)) | |
2 | elfzoelz 13501 | . . . . . . . 8 ⊢ (𝐽 ∈ (0..^𝑁) → 𝐽 ∈ ℤ) | |
3 | simplrr 777 | . . . . . . . . . 10 ⊢ (((𝐽 ∈ ℤ ∧ (𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ)) ∧ 𝑆 ∈ ℤ) → 𝑁 ∈ ℕ) | |
4 | nn0z 12457 | . . . . . . . . . . . 12 ⊢ (𝐼 ∈ ℕ0 → 𝐼 ∈ ℤ) | |
5 | 4 | ad2antrl 727 | . . . . . . . . . . 11 ⊢ ((𝐽 ∈ ℤ ∧ (𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ)) → 𝐼 ∈ ℤ) |
6 | zaddcl 12474 | . . . . . . . . . . 11 ⊢ ((𝐼 ∈ ℤ ∧ 𝑆 ∈ ℤ) → (𝐼 + 𝑆) ∈ ℤ) | |
7 | 5, 6 | sylan 581 | . . . . . . . . . 10 ⊢ (((𝐽 ∈ ℤ ∧ (𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ)) ∧ 𝑆 ∈ ℤ) → (𝐼 + 𝑆) ∈ ℤ) |
8 | zaddcl 12474 | . . . . . . . . . . 11 ⊢ ((𝐽 ∈ ℤ ∧ 𝑆 ∈ ℤ) → (𝐽 + 𝑆) ∈ ℤ) | |
9 | 8 | adantlr 714 | . . . . . . . . . 10 ⊢ (((𝐽 ∈ ℤ ∧ (𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ)) ∧ 𝑆 ∈ ℤ) → (𝐽 + 𝑆) ∈ ℤ) |
10 | 3, 7, 9 | 3jca 1129 | . . . . . . . . 9 ⊢ (((𝐽 ∈ ℤ ∧ (𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ)) ∧ 𝑆 ∈ ℤ) → (𝑁 ∈ ℕ ∧ (𝐼 + 𝑆) ∈ ℤ ∧ (𝐽 + 𝑆) ∈ ℤ)) |
11 | 10 | exp31 421 | . . . . . . . 8 ⊢ (𝐽 ∈ ℤ → ((𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ) → (𝑆 ∈ ℤ → (𝑁 ∈ ℕ ∧ (𝐼 + 𝑆) ∈ ℤ ∧ (𝐽 + 𝑆) ∈ ℤ)))) |
12 | 2, 11 | syl 17 | . . . . . . 7 ⊢ (𝐽 ∈ (0..^𝑁) → ((𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ) → (𝑆 ∈ ℤ → (𝑁 ∈ ℕ ∧ (𝐼 + 𝑆) ∈ ℤ ∧ (𝐽 + 𝑆) ∈ ℤ)))) |
13 | 12 | com12 32 | . . . . . 6 ⊢ ((𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ) → (𝐽 ∈ (0..^𝑁) → (𝑆 ∈ ℤ → (𝑁 ∈ ℕ ∧ (𝐼 + 𝑆) ∈ ℤ ∧ (𝐽 + 𝑆) ∈ ℤ)))) |
14 | 13 | 3adant3 1133 | . . . . 5 ⊢ ((𝐼 ∈ ℕ0 ∧ 𝑁 ∈ ℕ ∧ 𝐼 < 𝑁) → (𝐽 ∈ (0..^𝑁) → (𝑆 ∈ ℤ → (𝑁 ∈ ℕ ∧ (𝐼 + 𝑆) ∈ ℤ ∧ (𝐽 + 𝑆) ∈ ℤ)))) |
15 | 1, 14 | sylbi 216 | . . . 4 ⊢ (𝐼 ∈ (0..^𝑁) → (𝐽 ∈ (0..^𝑁) → (𝑆 ∈ ℤ → (𝑁 ∈ ℕ ∧ (𝐼 + 𝑆) ∈ ℤ ∧ (𝐽 + 𝑆) ∈ ℤ)))) |
16 | 15 | 3imp 1112 | . . 3 ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁) ∧ 𝑆 ∈ ℤ) → (𝑁 ∈ ℕ ∧ (𝐼 + 𝑆) ∈ ℤ ∧ (𝐽 + 𝑆) ∈ ℤ)) |
17 | moddvds 16082 | . . 3 ⊢ ((𝑁 ∈ ℕ ∧ (𝐼 + 𝑆) ∈ ℤ ∧ (𝐽 + 𝑆) ∈ ℤ) → (((𝐼 + 𝑆) mod 𝑁) = ((𝐽 + 𝑆) mod 𝑁) ↔ 𝑁 ∥ ((𝐼 + 𝑆) − (𝐽 + 𝑆)))) | |
18 | 16, 17 | syl 17 | . 2 ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁) ∧ 𝑆 ∈ ℤ) → (((𝐼 + 𝑆) mod 𝑁) = ((𝐽 + 𝑆) mod 𝑁) ↔ 𝑁 ∥ ((𝐼 + 𝑆) − (𝐽 + 𝑆)))) |
19 | elfzoel2 13500 | . . . . 5 ⊢ (𝐼 ∈ (0..^𝑁) → 𝑁 ∈ ℤ) | |
20 | zcn 12438 | . . . . . . 7 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℂ) | |
21 | 20 | subid1d 11435 | . . . . . 6 ⊢ (𝑁 ∈ ℤ → (𝑁 − 0) = 𝑁) |
22 | 21 | eqcomd 2744 | . . . . 5 ⊢ (𝑁 ∈ ℤ → 𝑁 = (𝑁 − 0)) |
23 | 19, 22 | syl 17 | . . . 4 ⊢ (𝐼 ∈ (0..^𝑁) → 𝑁 = (𝑁 − 0)) |
24 | 23 | 3ad2ant1 1134 | . . 3 ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁) ∧ 𝑆 ∈ ℤ) → 𝑁 = (𝑁 − 0)) |
25 | elfzoelz 13501 | . . . . 5 ⊢ (𝐼 ∈ (0..^𝑁) → 𝐼 ∈ ℤ) | |
26 | 25 | zcnd 12541 | . . . 4 ⊢ (𝐼 ∈ (0..^𝑁) → 𝐼 ∈ ℂ) |
27 | 2 | zcnd 12541 | . . . 4 ⊢ (𝐽 ∈ (0..^𝑁) → 𝐽 ∈ ℂ) |
28 | zcn 12438 | . . . 4 ⊢ (𝑆 ∈ ℤ → 𝑆 ∈ ℂ) | |
29 | pnpcan2 11375 | . . . 4 ⊢ ((𝐼 ∈ ℂ ∧ 𝐽 ∈ ℂ ∧ 𝑆 ∈ ℂ) → ((𝐼 + 𝑆) − (𝐽 + 𝑆)) = (𝐼 − 𝐽)) | |
30 | 26, 27, 28, 29 | syl3an 1161 | . . 3 ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁) ∧ 𝑆 ∈ ℤ) → ((𝐼 + 𝑆) − (𝐽 + 𝑆)) = (𝐼 − 𝐽)) |
31 | 24, 30 | breq12d 5117 | . 2 ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁) ∧ 𝑆 ∈ ℤ) → (𝑁 ∥ ((𝐼 + 𝑆) − (𝐽 + 𝑆)) ↔ (𝑁 − 0) ∥ (𝐼 − 𝐽))) |
32 | fzocongeq 16141 | . . 3 ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁)) → ((𝑁 − 0) ∥ (𝐼 − 𝐽) ↔ 𝐼 = 𝐽)) | |
33 | 32 | 3adant3 1133 | . 2 ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁) ∧ 𝑆 ∈ ℤ) → ((𝑁 − 0) ∥ (𝐼 − 𝐽) ↔ 𝐼 = 𝐽)) |
34 | 18, 31, 33 | 3bitrd 305 | 1 ⊢ ((𝐼 ∈ (0..^𝑁) ∧ 𝐽 ∈ (0..^𝑁) ∧ 𝑆 ∈ ℤ) → (((𝐼 + 𝑆) mod 𝑁) = ((𝐽 + 𝑆) mod 𝑁) ↔ 𝐼 = 𝐽)) |
Colors of variables: wff setvar class |
Syntax hints: → wi 4 ↔ wb 205 ∧ wa 397 ∧ w3a 1088 = wceq 1542 ∈ wcel 2107 class class class wbr 5104 (class class class)co 7350 ℂcc 10983 0cc0 10985 + caddc 10988 < clt 11123 − cmin 11319 ℕcn 12087 ℕ0cn0 12347 ℤcz 12433 ..^cfzo 13496 mod cmo 13703 ∥ cdvds 16071 |
This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1798 ax-4 1812 ax-5 1914 ax-6 1972 ax-7 2012 ax-8 2109 ax-9 2117 ax-10 2138 ax-11 2155 ax-12 2172 ax-ext 2709 ax-sep 5255 ax-nul 5262 ax-pow 5319 ax-pr 5383 ax-un 7663 ax-cnex 11041 ax-resscn 11042 ax-1cn 11043 ax-icn 11044 ax-addcl 11045 ax-addrcl 11046 ax-mulcl 11047 ax-mulrcl 11048 ax-mulcom 11049 ax-addass 11050 ax-mulass 11051 ax-distr 11052 ax-i2m1 11053 ax-1ne0 11054 ax-1rid 11055 ax-rnegex 11056 ax-rrecex 11057 ax-cnre 11058 ax-pre-lttri 11059 ax-pre-lttrn 11060 ax-pre-ltadd 11061 ax-pre-mulgt0 11062 ax-pre-sup 11063 |
This theorem depends on definitions: df-bi 206 df-an 398 df-or 847 df-3or 1089 df-3an 1090 df-tru 1545 df-fal 1555 df-ex 1783 df-nf 1787 df-sb 2069 df-mo 2540 df-eu 2569 df-clab 2716 df-cleq 2730 df-clel 2816 df-nfc 2888 df-ne 2943 df-nel 3049 df-ral 3064 df-rex 3073 df-rmo 3352 df-reu 3353 df-rab 3407 df-v 3446 df-sbc 3739 df-csb 3855 df-dif 3912 df-un 3914 df-in 3916 df-ss 3926 df-pss 3928 df-nul 4282 df-if 4486 df-pw 4561 df-sn 4586 df-pr 4588 df-op 4592 df-uni 4865 df-iun 4955 df-br 5105 df-opab 5167 df-mpt 5188 df-tr 5222 df-id 5529 df-eprel 5535 df-po 5543 df-so 5544 df-fr 5586 df-we 5588 df-xp 5637 df-rel 5638 df-cnv 5639 df-co 5640 df-dm 5641 df-rn 5642 df-res 5643 df-ima 5644 df-pred 6250 df-ord 6317 df-on 6318 df-lim 6319 df-suc 6320 df-iota 6444 df-fun 6494 df-fn 6495 df-f 6496 df-f1 6497 df-fo 6498 df-f1o 6499 df-fv 6500 df-riota 7306 df-ov 7353 df-oprab 7354 df-mpo 7355 df-om 7794 df-1st 7912 df-2nd 7913 df-frecs 8180 df-wrecs 8211 df-recs 8285 df-rdg 8324 df-er 8582 df-en 8818 df-dom 8819 df-sdom 8820 df-sup 9312 df-inf 9313 df-pnf 11125 df-mnf 11126 df-xr 11127 df-ltxr 11128 df-le 11129 df-sub 11321 df-neg 11322 df-div 11747 df-nn 12088 df-2 12150 df-3 12151 df-n0 12348 df-z 12434 df-uz 12697 df-rp 12845 df-fz 13354 df-fzo 13497 df-fl 13626 df-mod 13704 df-seq 13836 df-exp 13897 df-cj 14918 df-re 14919 df-im 14920 df-sqrt 15054 df-abs 15055 df-dvds 16072 |
This theorem is referenced by: (None) |
Copyright terms: Public domain | W3C validator |