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

Theorem nndifsnid 6043
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 3507 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 3507 . . 3 (𝐵𝐴 → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
21adantl 262 . 2 ((𝐴 ∈ ω ∧ 𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
3 simpr 103 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 = 𝐵)
4 velsn 3389 . . . . . . 7 (𝑥 ∈ {𝐵} ↔ 𝑥 = 𝐵)
53, 4sylibr 137 . . . . . 6 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 ∈ {𝐵})
6 elun2 3108 . . . . . 6 (𝑥 ∈ {𝐵} → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
75, 6syl 14 . . . . 5 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
8 simplr 482 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥𝐴)
9 simpr 103 . . . . . . . 8 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → ¬ 𝑥 = 𝐵)
109, 4sylnibr 602 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → ¬ 𝑥 ∈ {𝐵})
118, 10eldifd 2925 . . . . . 6 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥 ∈ (𝐴 ∖ {𝐵}))
12 elun1 3107 . . . . . 6 (𝑥 ∈ (𝐴 ∖ {𝐵}) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
1311, 12syl 14 . . . . 5 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
14 simpr 103 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥𝐴)
15 simpll 481 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐴 ∈ ω)
16 elnn 4291 . . . . . . . 8 ((𝑥𝐴𝐴 ∈ ω) → 𝑥 ∈ ω)
1714, 15, 16syl2anc 391 . . . . . . 7 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥 ∈ ω)
18 simplr 482 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐵𝐴)
19 elnn 4291 . . . . . . . 8 ((𝐵𝐴𝐴 ∈ ω) → 𝐵 ∈ ω)
2018, 15, 19syl2anc 391 . . . . . . 7 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐵 ∈ ω)
21 nndceq 6040 . . . . . . 7 ((𝑥 ∈ ω ∧ 𝐵 ∈ ω) → DECID 𝑥 = 𝐵)
2217, 20, 21syl2anc 391 . . . . . 6 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → DECID 𝑥 = 𝐵)
23 df-dc 743 . . . . . 6 (DECID 𝑥 = 𝐵 ↔ (𝑥 = 𝐵 ∨ ¬ 𝑥 = 𝐵))
2422, 23sylib 127 . . . . 5 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → (𝑥 = 𝐵 ∨ ¬ 𝑥 = 𝐵))
257, 13, 24mpjaodan 711 . . . 4 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
2625ex 108 . . 3 ((𝐴 ∈ ω ∧ 𝐵𝐴) → (𝑥𝐴𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵})))
2726ssrdv 2948 . 2 ((𝐴 ∈ ω ∧ 𝐵𝐴) → 𝐴 ⊆ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
282, 27eqssd 2959 1 ((𝐴 ∈ ω ∧ 𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) = 𝐴)
Colors of variables: wff set class
Syntax hints:  ¬ wn 3  wi 4  wa 97  wo 629  DECID wdc 742   = wceq 1243  wcel 1393  cdif 2911  cun 2912  wss 2914  {csn 3372  ωcom 4276
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 99  ax-ia2 100  ax-ia3 101  ax-in1 544  ax-in2 545  ax-io 630  ax-5 1336  ax-7 1337  ax-gen 1338  ax-ie1 1382  ax-ie2 1383  ax-8 1395  ax-10 1396  ax-11 1397  ax-i12 1398  ax-bndl 1399  ax-4 1400  ax-13 1404  ax-14 1405  ax-17 1419  ax-i9 1423  ax-ial 1427  ax-i5r 1428  ax-ext 2022  ax-sep 3872  ax-nul 3880  ax-pow 3924  ax-pr 3941  ax-un 4142  ax-setind 4232  ax-iinf 4274
This theorem depends on definitions:  df-bi 110  df-dc 743  df-3or 886  df-3an 887  df-tru 1246  df-nf 1350  df-sb 1646  df-clab 2027  df-cleq 2033  df-clel 2036  df-nfc 2167  df-ne 2206  df-ral 2308  df-rex 2309  df-v 2556  df-dif 2917  df-un 2919  df-in 2921  df-ss 2928  df-nul 3222  df-pw 3358  df-sn 3378  df-pr 3379  df-uni 3578  df-int 3613  df-tr 3852  df-iord 4075  df-on 4077  df-suc 4080  df-iom 4277
This theorem is referenced by:  phplem2  6279
  Copyright terms: Public domain W3C validator