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

Theorem dcdifsnid 6440
Description: If we remove a single element from a set with decidable equality then put it back in, we end up with the original set. This strengthens difsnss 3698 from subset to equality but the proof relies on equality being decidable. (Contributed by Jim Kingdon, 17-Jun-2022.)
Assertion
Ref Expression
dcdifsnid ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) = 𝐴)
Distinct variable groups:   𝑥,𝐴,𝑦   𝑥,𝐵,𝑦

Proof of Theorem dcdifsnid
Dummy variable 𝑧 is distinct from all other variables.
StepHypRef Expression
1 difsnss 3698 . . 3 (𝐵𝐴 → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
21adantl 275 . 2 ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
3 simpr 109 . . . . . . 7 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ 𝑧 = 𝐵) → 𝑧 = 𝐵)
4 velsn 3573 . . . . . . 7 (𝑧 ∈ {𝐵} ↔ 𝑧 = 𝐵)
53, 4sylibr 133 . . . . . 6 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ 𝑧 = 𝐵) → 𝑧 ∈ {𝐵})
6 elun2 3271 . . . . . 6 (𝑧 ∈ {𝐵} → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
75, 6syl 14 . . . . 5 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ 𝑧 = 𝐵) → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
8 simplr 520 . . . . . . 7 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → 𝑧𝐴)
9 simpr 109 . . . . . . . 8 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → ¬ 𝑧 = 𝐵)
109, 4sylnibr 667 . . . . . . 7 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → ¬ 𝑧 ∈ {𝐵})
118, 10eldifd 3108 . . . . . 6 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → 𝑧 ∈ (𝐴 ∖ {𝐵}))
12 elun1 3270 . . . . . 6 (𝑧 ∈ (𝐴 ∖ {𝐵}) → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
1311, 12syl 14 . . . . 5 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
14 simpll 519 . . . . . . 7 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → ∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦)
15 simpr 109 . . . . . . . 8 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → 𝑧𝐴)
16 simplr 520 . . . . . . . 8 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → 𝐵𝐴)
17 equequ1 1689 . . . . . . . . . 10 (𝑥 = 𝑧 → (𝑥 = 𝑦𝑧 = 𝑦))
1817dcbid 824 . . . . . . . . 9 (𝑥 = 𝑧 → (DECID 𝑥 = 𝑦DECID 𝑧 = 𝑦))
19 eqeq2 2164 . . . . . . . . . 10 (𝑦 = 𝐵 → (𝑧 = 𝑦𝑧 = 𝐵))
2019dcbid 824 . . . . . . . . 9 (𝑦 = 𝐵 → (DECID 𝑧 = 𝑦DECID 𝑧 = 𝐵))
2118, 20rspc2v 2826 . . . . . . . 8 ((𝑧𝐴𝐵𝐴) → (∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦DECID 𝑧 = 𝐵))
2215, 16, 21syl2anc 409 . . . . . . 7 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → (∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦DECID 𝑧 = 𝐵))
2314, 22mpd 13 . . . . . 6 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → DECID 𝑧 = 𝐵)
24 exmiddc 822 . . . . . 6 (DECID 𝑧 = 𝐵 → (𝑧 = 𝐵 ∨ ¬ 𝑧 = 𝐵))
2523, 24syl 14 . . . . 5 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → (𝑧 = 𝐵 ∨ ¬ 𝑧 = 𝐵))
267, 13, 25mpjaodan 788 . . . 4 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
2726ex 114 . . 3 ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → (𝑧𝐴𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵})))
2827ssrdv 3130 . 2 ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → 𝐴 ⊆ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
292, 28eqssd 3141 1 ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) = 𝐴)
Colors of variables: wff set class
Syntax hints:  ¬ wn 3  wi 4  wa 103  wo 698  DECID wdc 820   = wceq 1332  wcel 2125  wral 2432  cdif 3095  cun 3096  wss 3098  {csn 3556
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 105  ax-ia2 106  ax-ia3 107  ax-in1 604  ax-in2 605  ax-io 699  ax-5 1424  ax-7 1425  ax-gen 1426  ax-ie1 1470  ax-ie2 1471  ax-8 1481  ax-10 1482  ax-11 1483  ax-i12 1484  ax-bndl 1486  ax-4 1487  ax-17 1503  ax-i9 1507  ax-ial 1511  ax-i5r 1512  ax-ext 2136
This theorem depends on definitions:  df-bi 116  df-dc 821  df-tru 1335  df-nf 1438  df-sb 1740  df-clab 2141  df-cleq 2147  df-clel 2150  df-nfc 2285  df-ral 2437  df-v 2711  df-dif 3100  df-un 3102  df-in 3104  df-ss 3111  df-sn 3562
This theorem is referenced by:  fnsnsplitdc  6441  nndifsnid  6443  fidifsnid  6805  undifdc  6857
  Copyright terms: Public domain W3C validator