• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Defconst
        • Fast-alists
        • Defmacro
        • Loop$-primer
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Efficiency
        • Irrelevant-formals
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
          • Member
          • Append
          • List
          • Nth
          • Len
          • True-listp
          • String-listp
          • Nat-listp
          • Character-listp
          • Symbol-listp
          • True-list-listp
          • Length
          • Search
          • Intersection$
          • Union$
          • Remove-duplicates
          • Position
          • Update-nth
          • Take
          • Set-difference$
          • Nthcdr
          • Subsetp
          • No-duplicatesp
          • Concatenate
          • Remove
            • Std/lists/remove
            • Remove1
            • Intersectp
            • Endp
            • Keyword-value-listp
            • Integer-listp
            • Reverse
            • Add-to-set
            • List-utilities
            • Set-size
            • Revappend
            • Subseq
            • Make-list
            • Lists-light
            • Boolean-listp
            • Butlast
            • Pairlis$
            • Substitute
            • Count
            • Keyword-listp
            • List*
            • Last
            • Eqlable-listp
            • Integer-range-listp
            • Rational-listp
            • Pos-listp
            • Evens
            • Atom-listp
            • ACL2-number-listp
            • Typed-list-utilities
            • Odds
            • List$
            • Listp
            • Standard-char-listp
            • Last-cdr
            • Pairlis
            • Proper-consp
            • Improper-consp
            • Pairlis-x2
            • Pairlis-x1
            • Merge-sort-lexorder
            • Fix-true-list
            • Real-listp
          • Invariant-risk
          • Errors
          • Defabbrev
          • Conses
          • Alists
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
        • Installation
        • Mailing-lists
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Std/lists
    • Remove

    Std/lists/remove

    Lemmas about remove available in the std/lists library.

    Definitions and Theorems

    Theorem: remove-when-atom

    (defthm remove-when-atom
      (implies (atom x)
               (equal (remove a x) nil)))

    Theorem: remove-of-cons

    (defthm remove-of-cons
      (equal (remove a (cons b x))
             (if (equal a b)
                 (remove a x)
               (cons b (remove a x)))))

    Theorem: consp-of-remove

    (defthm consp-of-remove
      (equal (consp (remove a x))
             (not (subsetp x (list a)))))

    Theorem: remove-under-iff

    (defthm remove-under-iff
      (iff (remove a x)
           (not (subsetp x (list a)))))

    Theorem: remove-when-non-member

    (defthm remove-when-non-member
      (implies (not (member a x))
               (equal (remove a x) (list-fix x))))

    Theorem: upper-bound-of-len-of-remove-weak

    (defthm upper-bound-of-len-of-remove-weak
      (<= (len (remove a x)) (len x))
      :rule-classes ((:rewrite) (:linear)))

    Theorem: upper-bound-of-len-of-remove-strong

    (defthm upper-bound-of-len-of-remove-strong
      (implies (member a x)
               (< (len (remove a x)) (len x)))
      :rule-classes :linear)

    Theorem: len-of-remove-exact

    (defthm len-of-remove-exact
      (equal (len (remove a x))
             (- (len x) (duplicity a x))))

    Theorem: remove-is-commutative

    (defthm remove-is-commutative
      (equal (remove b (remove a x))
             (remove a (remove b x))))

    Theorem: remove-is-idempotent

    (defthm remove-is-idempotent
      (equal (remove a (remove a x))
             (remove a x)))

    Theorem: duplicity-of-remove

    (defthm duplicity-of-remove
      (equal (duplicity a (remove b x))
             (if (equal a b) 0 (duplicity a x))))

    Theorem: remove-of-append

    (defthm remove-of-append
      (equal (remove a (append x y))
             (append (remove a x) (remove a y))))

    Theorem: remove-of-revappend

    (defthm remove-of-revappend
      (equal (remove a (revappend x y))
             (revappend (remove a x) (remove a y))))

    Theorem: remove-of-rev

    (defthm remove-of-rev
      (equal (remove a (rev x))
             (rev (remove a x))))

    Theorem: remove-of-union-equal

    (defthm remove-of-union-equal
      (equal (remove a (union-equal x y))
             (union-equal (remove a x)
                          (remove a y))))

    Theorem: remove-of-intersection-equal

    (defthm remove-of-intersection-equal
      (equal (remove a (intersection-equal x y))
             (intersection-equal (remove a x)
                                 (remove a y))))

    Theorem: remove-of-set-difference-equal

    (defthm remove-of-set-difference-equal
      (equal (remove a (set-difference-equal x y))
             (set-difference-equal (remove a x) y)))

    Theorem: element-list-p-of-remove

    (defthm element-list-p-of-remove
      (implies (element-list-p x)
               (element-list-p (remove a x)))
      :rule-classes :rewrite)