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

Theorem dcdifsnid 6483
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 3726 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 3726 . . 3 (𝐵𝐴 → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
21adantl 275 . 2 ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) ⊆ 𝐴)
3 simpr 109 . . . . . . 7 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ 𝑧 = 𝐵) → 𝑧 = 𝐵)
4 velsn 3600 . . . . . . 7 (𝑧 ∈ {𝐵} ↔ 𝑧 = 𝐵)
53, 4sylibr 133 . . . . . 6 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ 𝑧 = 𝐵) → 𝑧 ∈ {𝐵})
6 elun2 3295 . . . . . 6 (𝑧 ∈ {𝐵} → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
75, 6syl 14 . . . . 5 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ 𝑧 = 𝐵) → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
8 simplr 525 . . . . . . 7 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → 𝑧𝐴)
9 simpr 109 . . . . . . . 8 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → ¬ 𝑧 = 𝐵)
109, 4sylnibr 672 . . . . . . 7 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → ¬ 𝑧 ∈ {𝐵})
118, 10eldifd 3131 . . . . . 6 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → 𝑧 ∈ (𝐴 ∖ {𝐵}))
12 elun1 3294 . . . . . 6 (𝑧 ∈ (𝐴 ∖ {𝐵}) → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
1311, 12syl 14 . . . . 5 ((((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) ∧ ¬ 𝑧 = 𝐵) → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
14 simpll 524 . . . . . . 7 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → ∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦)
15 simpr 109 . . . . . . . 8 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → 𝑧𝐴)
16 simplr 525 . . . . . . . 8 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → 𝐵𝐴)
17 equequ1 1705 . . . . . . . . . 10 (𝑥 = 𝑧 → (𝑥 = 𝑦𝑧 = 𝑦))
1817dcbid 833 . . . . . . . . 9 (𝑥 = 𝑧 → (DECID 𝑥 = 𝑦DECID 𝑧 = 𝑦))
19 eqeq2 2180 . . . . . . . . . 10 (𝑦 = 𝐵 → (𝑧 = 𝑦𝑧 = 𝐵))
2019dcbid 833 . . . . . . . . 9 (𝑦 = 𝐵 → (DECID 𝑧 = 𝑦DECID 𝑧 = 𝐵))
2118, 20rspc2v 2847 . . . . . . . 8 ((𝑧𝐴𝐵𝐴) → (∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦DECID 𝑧 = 𝐵))
2215, 16, 21syl2anc 409 . . . . . . 7 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → (∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦DECID 𝑧 = 𝐵))
2314, 22mpd 13 . . . . . 6 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → DECID 𝑧 = 𝐵)
24 exmiddc 831 . . . . . 6 (DECID 𝑧 = 𝐵 → (𝑧 = 𝐵 ∨ ¬ 𝑧 = 𝐵))
2523, 24syl 14 . . . . 5 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → (𝑧 = 𝐵 ∨ ¬ 𝑧 = 𝐵))
267, 13, 25mpjaodan 793 . . . 4 (((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) ∧ 𝑧𝐴) → 𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
2726ex 114 . . 3 ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → (𝑧𝐴𝑧 ∈ ((𝐴 ∖ {𝐵}) ∪ {𝐵})))
2827ssrdv 3153 . 2 ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → 𝐴 ⊆ ((𝐴 ∖ {𝐵}) ∪ {𝐵}))
292, 28eqssd 3164 1 ((∀𝑥𝐴𝑦𝐴 DECID 𝑥 = 𝑦𝐵𝐴) → ((𝐴 ∖ {𝐵}) ∪ {𝐵}) = 𝐴)
Colors of variables: wff set class
Syntax hints:  ¬ wn 3  wi 4  wa 103  wo 703  DECID wdc 829   = wceq 1348  wcel 2141  wral 2448  cdif 3118  cun 3119  wss 3121  {csn 3583
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 609  ax-in2 610  ax-io 704  ax-5 1440  ax-7 1441  ax-gen 1442  ax-ie1 1486  ax-ie2 1487  ax-8 1497  ax-10 1498  ax-11 1499  ax-i12 1500  ax-bndl 1502  ax-4 1503  ax-17 1519  ax-i9 1523  ax-ial 1527  ax-i5r 1528  ax-ext 2152
This theorem depends on definitions:  df-bi 116  df-dc 830  df-tru 1351  df-nf 1454  df-sb 1756  df-clab 2157  df-cleq 2163  df-clel 2166  df-nfc 2301  df-ral 2453  df-v 2732  df-dif 3123  df-un 3125  df-in 3127  df-ss 3134  df-sn 3589
This theorem is referenced by:  fnsnsplitdc  6484  nndifsnid  6486  fidifsnid  6849  undifdc  6901
  Copyright terms: Public domain W3C validator