Users' Mathboxes Mathbox for Alexander van der Vekens < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  clwwlknclwwlkdifs Structured version   Visualization version   GIF version

Theorem clwwlknclwwlkdifs 41176
Description: The set of walks of length n starting with a fixed vertex and ending not at this vertex is the difference between the set of walks of length n starting with this vertex and the set of walks of length n starting with this vertex and ending at this vertex. (Contributed by Alexander van der Vekens, 30-Sep-2018.) (Revised by AV, 7-May-2021.)
Hypotheses
Ref Expression
clwwlknclwwlkdif.a 𝐴 = {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)}
clwwlknclwwlkdif.b 𝐵 = {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}
Assertion
Ref Expression
clwwlknclwwlkdifs 𝐴 = ({𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (𝑤‘0) = 𝑋} ∖ 𝐵)

Proof of Theorem clwwlknclwwlkdifs
StepHypRef Expression
1 clwwlknclwwlkdif.a . 2 𝐴 = {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)}
2 clwwlknclwwlkdif.b . . . 4 𝐵 = {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}
32difeq2i 3686 . . 3 ({𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (𝑤‘0) = 𝑋} ∖ 𝐵) = ({𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (𝑤‘0) = 𝑋} ∖ {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)})
4 difrab 3859 . . 3 ({𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (𝑤‘0) = 𝑋} ∖ {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)}) = {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ ¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋))}
5 ianor 507 . . . . . . . 8 (¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋) ↔ (¬ ( lastS ‘𝑤) = (𝑤‘0) ∨ ¬ (𝑤‘0) = 𝑋))
6 eqeq2 2620 . . . . . . . . . . . 12 ((𝑤‘0) = 𝑋 → (( lastS ‘𝑤) = (𝑤‘0) ↔ ( lastS ‘𝑤) = 𝑋))
76notbid 306 . . . . . . . . . . 11 ((𝑤‘0) = 𝑋 → (¬ ( lastS ‘𝑤) = (𝑤‘0) ↔ ¬ ( lastS ‘𝑤) = 𝑋))
8 neqne 2789 . . . . . . . . . . . . 13 (¬ ( lastS ‘𝑤) = 𝑋 → ( lastS ‘𝑤) ≠ 𝑋)
98anim2i 590 . . . . . . . . . . . 12 (((𝑤‘0) = 𝑋 ∧ ¬ ( lastS ‘𝑤) = 𝑋) → ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋))
109ex 448 . . . . . . . . . . 11 ((𝑤‘0) = 𝑋 → (¬ ( lastS ‘𝑤) = 𝑋 → ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)))
117, 10sylbid 228 . . . . . . . . . 10 ((𝑤‘0) = 𝑋 → (¬ ( lastS ‘𝑤) = (𝑤‘0) → ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)))
1211com12 32 . . . . . . . . 9 (¬ ( lastS ‘𝑤) = (𝑤‘0) → ((𝑤‘0) = 𝑋 → ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)))
13 pm2.21 118 . . . . . . . . 9 (¬ (𝑤‘0) = 𝑋 → ((𝑤‘0) = 𝑋 → ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)))
1412, 13jaoi 392 . . . . . . . 8 ((¬ ( lastS ‘𝑤) = (𝑤‘0) ∨ ¬ (𝑤‘0) = 𝑋) → ((𝑤‘0) = 𝑋 → ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)))
155, 14sylbi 205 . . . . . . 7 (¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋) → ((𝑤‘0) = 𝑋 → ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)))
1615impcom 444 . . . . . 6 (((𝑤‘0) = 𝑋 ∧ ¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)) → ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋))
17 simpl 471 . . . . . . 7 (((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋) → (𝑤‘0) = 𝑋)
18 neeq2 2844 . . . . . . . . . . 11 (𝑋 = (𝑤‘0) → (( lastS ‘𝑤) ≠ 𝑋 ↔ ( lastS ‘𝑤) ≠ (𝑤‘0)))
1918eqcoms 2617 . . . . . . . . . 10 ((𝑤‘0) = 𝑋 → (( lastS ‘𝑤) ≠ 𝑋 ↔ ( lastS ‘𝑤) ≠ (𝑤‘0)))
20 neneq 2787 . . . . . . . . . 10 (( lastS ‘𝑤) ≠ (𝑤‘0) → ¬ ( lastS ‘𝑤) = (𝑤‘0))
2119, 20syl6bi 241 . . . . . . . . 9 ((𝑤‘0) = 𝑋 → (( lastS ‘𝑤) ≠ 𝑋 → ¬ ( lastS ‘𝑤) = (𝑤‘0)))
2221imp 443 . . . . . . . 8 (((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋) → ¬ ( lastS ‘𝑤) = (𝑤‘0))
2322intnanrd 953 . . . . . . 7 (((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋) → ¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋))
2417, 23jca 552 . . . . . 6 (((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋) → ((𝑤‘0) = 𝑋 ∧ ¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)))
2516, 24impbii 197 . . . . 5 (((𝑤‘0) = 𝑋 ∧ ¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)) ↔ ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋))
2625a1i 11 . . . 4 (𝑤 ∈ (𝑁 WWalkSN 𝐺) → (((𝑤‘0) = 𝑋 ∧ ¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋)) ↔ ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)))
2726rabbiia 3160 . . 3 {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ ¬ (( lastS ‘𝑤) = (𝑤‘0) ∧ (𝑤‘0) = 𝑋))} = {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)}
283, 4, 273eqtrri 2636 . 2 {𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ ((𝑤‘0) = 𝑋 ∧ ( lastS ‘𝑤) ≠ 𝑋)} = ({𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (𝑤‘0) = 𝑋} ∖ 𝐵)
291, 28eqtri 2631 1 𝐴 = ({𝑤 ∈ (𝑁 WWalkSN 𝐺) ∣ (𝑤‘0) = 𝑋} ∖ 𝐵)
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 194  wo 381  wa 382   = wceq 1474  wcel 1976  wne 2779  {crab 2899  cdif 3536  cfv 5790  (class class class)co 6527  0cc0 9792   lastS clsw 13093   WWalkSN cwwlksn 41024
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1712  ax-4 1727  ax-5 1826  ax-6 1874  ax-7 1921  ax-10 2005  ax-11 2020  ax-12 2033  ax-13 2233  ax-ext 2589
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-tru 1477  df-ex 1695  df-nf 1700  df-sb 1867  df-clab 2596  df-cleq 2602  df-clel 2605  df-nfc 2739  df-ne 2781  df-ral 2900  df-rab 2904  df-v 3174  df-dif 3542
This theorem is referenced by:  clwwlknclwwlkdifnum  41177
  Copyright terms: Public domain W3C validator