• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
        • Std/lists/abstract
        • Rev
        • Defsort
        • List-fix
        • Std/lists/nth
        • Hons-remove-duplicates
        • Std/lists/update-nth
        • Set-equiv
          • Set-equiv-congruences
          • Set-unequal-witness
          • Duplicity
          • Prefixp
          • Std/lists/take
          • Std/lists/intersection$
          • Nats-equiv
          • Repeat
          • Index-of
          • All-equalp
          • Sublistp
          • Std/lists/nthcdr
          • Listpos
          • List-equiv
          • Final-cdr
          • Std/lists/append
          • Std/lists/remove
          • Subseq-list
          • Rcons
          • Std/lists/revappend
          • Std/lists/remove-duplicates-equal
          • Std/lists/reverse
          • Std/lists/last
          • Std/lists/resize-list
          • Flatten
          • Suffixp
          • Std/lists/butlast
          • Std/lists/set-difference
          • Std/lists/len
          • Std/lists/intersectp
          • Std/lists/true-listp
          • Intersectp-witness
          • Subsetp-witness
          • Std/lists/remove1-equal
          • Rest-n
          • First-n
          • Std/lists/union
          • Std/lists/add-to-set
          • Append-without-guard
          • Std/lists/subsetp
          • Std/lists/member
        • Std/alists
        • Obags
        • Std/util
        • Std/strings
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Set-equiv

    Set-unequal-witness

    (set-unequal-witness x y) finds a member of x that is not a member of y, or vice versa.

    This function is useful for basic pick-a-point style reasoning about set equivalence.

    Definitions and Theorems

    Function: set-unequal-witness

    (defun set-unequal-witness (x y)
      (cond ((not (subsetp x y))
             (subsetp-witness x y))
            ((not (subsetp y x))
             (subsetp-witness y x))))

    Theorem: set-unequal-witness-correct

    (defthm set-unequal-witness-correct
      (equal (set-equiv x y)
             (iff (member (set-unequal-witness x y) x)
                  (member (set-unequal-witness x y) y))))

    Theorem: set-unequal-witness-rw

    (defthm set-unequal-witness-rw
     (implies (rewriting-positive-literal (cons 'set-equiv
                                                (cons x (cons y 'nil))))
              (equal (set-equiv x y)
                     (iff (member (set-unequal-witness x y) x)
                          (member (set-unequal-witness x y) y)))))