• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • 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
        • Duplicity
        • Prefixp
        • Std/lists/take
        • Std/lists/intersection$
        • Nats-equiv
        • Repeat
        • Index-of
        • All-equalp
        • Sublistp
        • Std/lists/nthcdr
        • Std/lists/append
        • Listpos
        • List-equiv
        • Final-cdr
        • Std/lists/remove
        • Subseq-list
        • Rcons
        • Std/lists/revappend
        • Std/lists/remove-duplicates-equal
        • Std/lists/last
        • Std/lists/reverse
        • Std/lists/resize-list
        • Flatten
        • Suffixp
        • Std/lists/set-difference
        • Std/lists/butlast
        • 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
          • Append-without-guard
          • Std/lists/subsetp
          • Std/lists/member
        • Std/alists
        • Obags
        • Std/util
        • Std/strings
        • Std/io
        • Std/osets
        • Std/system
        • Std/basic
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Std/lists
    • Remove1

    Std/lists/remove1-equal

    Lemmas about remove1 available in the std/lists library.

    Definitions and Theorems

    Theorem: len-of-remove1-equal

    (defthm len-of-remove1-equal
            (equal (len (remove1-equal x l))
                   (if (member-equal x l)
                       (- (len l) 1)
                       (len l))))

    Theorem: assoc-equal-of-remove1-equal

    (defthm
      assoc-equal-of-remove1-equal
      (implies (and (not (equal key1 nil))
                    (not (consp (assoc-equal key1 alist))))
               (not (consp (assoc-equal key1 (remove1-equal x alist)))))
      :rule-classes (:rewrite :type-prescription))

    Theorem: member-equal-of-remove1-equal

    (defthm member-equal-of-remove1-equal
            (implies (not (equal x1 x2))
                     (iff (member-equal x1 (remove1-equal x2 l))
                          (member-equal x1 l))))

    Theorem: subsetp-equal-of-remove1-equal-left

    (defthm subsetp-equal-of-remove1-equal-left
            (implies (subsetp-equal x y)
                     (subsetp-equal (remove1-equal a x) y)))