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

Theorem nndifsnid 6103
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 3531 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 3531 . . 3 (𝐵𝐴 → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
21adantl 271 . 2 ((𝐴 ∈ ω ∧ 𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
3 simpr 108 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 = 𝐵)
4 velsn 3415 . . . . . . 7 (𝑥 ∈ {𝐵} ↔ 𝑥 = 𝐵)
53, 4sylibr 132 . . . . . 6 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 ∈ {𝐵})
6 elun2 3140 . . . . . 6 (𝑥 ∈ {𝐵} → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
75, 6syl 14 . . . . 5 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ 𝑥 = 𝐵) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
8 simplr 496 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥𝐴)
9 simpr 108 . . . . . . . 8 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → ¬ 𝑥 = 𝐵)
109, 4sylnibr 634 . . . . . . 7 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → ¬ 𝑥 ∈ {𝐵})
118, 10eldifd 2983 . . . . . 6 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥 ∈ (𝐴 ∖ {𝐵}))
12 elun1 3139 . . . . . 6 (𝑥 ∈ (𝐴 ∖ {𝐵}) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
1311, 12syl 14 . . . . 5 ((((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) ∧ ¬ 𝑥 = 𝐵) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
14 simpr 108 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥𝐴)
15 simpll 495 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐴 ∈ ω)
16 elnn 4346 . . . . . . . 8 ((𝑥𝐴𝐴 ∈ ω) → 𝑥 ∈ ω)
1714, 15, 16syl2anc 403 . . . . . . 7 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥 ∈ ω)
18 simplr 496 . . . . . . . 8 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐵𝐴)
19 elnn 4346 . . . . . . . 8 ((𝐵𝐴𝐴 ∈ ω) → 𝐵 ∈ ω)
2018, 15, 19syl2anc 403 . . . . . . 7 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝐵 ∈ ω)
21 nndceq 6100 . . . . . . 7 ((𝑥 ∈ ω ∧ 𝐵 ∈ ω) → DECID 𝑥 = 𝐵)
2217, 20, 21syl2anc 403 . . . . . 6 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → DECID 𝑥 = 𝐵)
23 df-dc 776 . . . . . 6 (DECID 𝑥 = 𝐵 ↔ (𝑥 = 𝐵 ∨ ¬ 𝑥 = 𝐵))
2422, 23sylib 120 . . . . 5 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → (𝑥 = 𝐵 ∨ ¬ 𝑥 = 𝐵))
257, 13, 24mpjaodan 744 . . . 4 (((𝐴 ∈ ω ∧ 𝐵𝐴) ∧ 𝑥𝐴) → 𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
2625ex 113 . . 3 ((𝐴 ∈ ω ∧ 𝐵𝐴) → (𝑥𝐴𝑥 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵})))
2726ssrdv 3005 . 2 ((𝐴 ∈ ω ∧ 𝐵𝐴) → 𝐴 ⊆ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
282, 27eqssd 3016 1 ((𝐴 ∈ ω ∧ 𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) = 𝐴)
Colors of variables: wff set class
Syntax hints:  ¬ wn 3  wi 4  wa 102  wo 661  DECID wdc 775   = wceq 1284  wcel 1433  cdif 2970  cun 2971  wss 2973  {csn 3398  ωcom 4331
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 576  ax-in2 577  ax-io 662  ax-5 1376  ax-7 1377  ax-gen 1378  ax-ie1 1422  ax-ie2 1423  ax-8 1435  ax-10 1436  ax-11 1437  ax-i12 1438  ax-bndl 1439  ax-4 1440  ax-13 1444  ax-14 1445  ax-17 1459  ax-i9 1463  ax-ial 1467  ax-i5r 1468  ax-ext 2063  ax-sep 3896  ax-nul 3904  ax-pow 3948  ax-pr 3964  ax-un 4188  ax-setind 4280  ax-iinf 4329
This theorem depends on definitions:  df-bi 115  df-dc 776  df-3or 920  df-3an 921  df-tru 1287  df-nf 1390  df-sb 1686  df-clab 2068  df-cleq 2074  df-clel 2077  df-nfc 2208  df-ne 2246  df-ral 2353  df-rex 2354  df-v 2603  df-dif 2975  df-un 2977  df-in 2979  df-ss 2986  df-nul 3252  df-pw 3384  df-sn 3404  df-pr 3405  df-uni 3602  df-int 3637  df-tr 3876  df-iord 4121  df-on 4123  df-suc 4126  df-iom 4332
This theorem is referenced by:  phplem2  6339
  Copyright terms: Public domain W3C validator