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

Theorem nndifsnid 6146
 Description: If we remove a single element from a natural number then put it back in, we end up with the original natural number. This strengthens difsnss 3539 from subset to equality but the proof relies on equality being decidable. (Contributed by Jim Kingdon, 31-Aug-2021.)
Assertion
Ref Expression
nndifsnid ((𝐴 ∈ ω ∧ 𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) = 𝐴)

Proof of Theorem nndifsnid
Dummy variable 𝑥 is distinct from all other variables.
StepHypRef Expression
1 difsnss 3539 . . 3 (𝐵𝐴 → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
21adantl 271 . 2 ((𝐴 ∈ ω ∧ 𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
3 simpr 108 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 = 𝐵)
4 velsn 3423 . . . . . . 7 (𝑥 ∈ {𝐵} ↔ 𝑥 = 𝐵)
53, 4sylibr 132 . . . . . 6 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 ∈ {𝐵})
6 elun2 3141 . . . . . 6 (𝑥 ∈ {𝐵} → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
75, 6syl 14 . . . . 5 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
8 simplr 497 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥𝐴)
9 simpr 108 . . . . . . . 8 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → ¬ 𝑥 = 𝐵)
109, 4sylnibr 635 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → ¬ 𝑥 ∈ {𝐵})
118, 10eldifd 2984 . . . . . 6 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥 ∈ (𝐴 ∖ {𝐵}))
12 elun1 3140 . . . . . 6 (𝑥 ∈ (𝐴 ∖ {𝐵}) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
1311, 12syl 14 . . . . 5 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
14 simpr 108 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥𝐴)
15 simpll 496 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐴 ∈ ω)
16 elnn 4354 . . . . . . . 8 ((𝑥𝐴𝐴 ∈ ω) → 𝑥 ∈ ω)
1714, 15, 16syl2anc 403 . . . . . . 7 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥 ∈ ω)
18 simplr 497 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐵𝐴)
19 elnn 4354 . . . . . . . 8 ((𝐵𝐴𝐴 ∈ ω) → 𝐵 ∈ ω)
2018, 15, 19syl2anc 403 . . . . . . 7 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐵 ∈ ω)
21 nndceq 6143 . . . . . . 7 ((𝑥 ∈ ω ∧ 𝐵 ∈ ω) → DECID 𝑥 = 𝐵)
2217, 20, 21syl2anc 403 . . . . . 6 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → DECID 𝑥 = 𝐵)
23 df-dc 777 . . . . . 6 (DECID 𝑥 = 𝐵 ↔ (𝑥 = 𝐵 ∨ ¬ 𝑥 = 𝐵))
2422, 23sylib 120 . . . . 5 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → (𝑥 = 𝐵 ∨ ¬ 𝑥 = 𝐵))
257, 13, 24mpjaodan 745 . . . 4 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
2625ex 113 . . 3 ((𝐴 ∈ ω ∧ 𝐵𝐴) → (𝑥𝐴𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵})))
2726ssrdv 3006 . 2 ((𝐴 ∈ ω ∧ 𝐵𝐴) → 𝐴 ⊆ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
282, 27eqssd 3017 1 ((𝐴 ∈ ω ∧ 𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) = 𝐴)
 Colors of variables: wff set class Syntax hints:  ¬ wn 3   → wi 4   ∧ wa 102   ∨ wo 662  DECID wdc 776   = wceq 1285   ∈ wcel 1434   ∖ cdif 2971   ∪ cun 2972   ⊆ wss 2974  {csn 3406  ωcom 4339 This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 104  ax-ia2 105  ax-ia3 106  ax-in1 577  ax-in2 578  ax-io 663  ax-5 1377  ax-7 1378  ax-gen 1379  ax-ie1 1423  ax-ie2 1424  ax-8 1436  ax-10 1437  ax-11 1438  ax-i12 1439  ax-bndl 1440  ax-4 1441  ax-13 1445  ax-14 1446  ax-17 1460  ax-i9 1464  ax-ial 1468  ax-i5r 1469  ax-ext 2064  ax-sep 3904  ax-nul 3912  ax-pow 3956  ax-pr 3972  ax-un 4196  ax-setind 4288  ax-iinf 4337 This theorem depends on definitions:  df-bi 115  df-dc 777  df-3or 921  df-3an 922  df-tru 1288  df-nf 1391  df-sb 1687  df-clab 2069  df-cleq 2075  df-clel 2078  df-nfc 2209  df-ne 2247  df-ral 2354  df-rex 2355  df-v 2604  df-dif 2976  df-un 2978  df-in 2980  df-ss 2987  df-nul 3259  df-pw 3392  df-sn 3412  df-pr 3413  df-uni 3610  df-int 3645  df-tr 3884  df-iord 4129  df-on 4131  df-suc 4134  df-iom 4340 This theorem is referenced by:  phplem2  6388
 Copyright terms: Public domain W3C validator