• 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
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
        • Set-register-invariant-risk
        • Strings
          • Std/strings
          • String-listp
          • Stringp
          • Length
          • Search
          • Remove-duplicates
            • Nat-list-remove-duplicates
            • Hons-remove-duplicates
            • Std/lists/remove-duplicates-equal
            • Position
            • Coerce
            • Concatenate
            • Reverse
            • String
            • Subseq
            • Substitute
            • String-upcase
            • String-downcase
            • Count
            • Char
            • String<
            • String-equal
            • String-utilities
            • String-append
            • String>=
            • String<=
            • String>
            • Hex-digit-char-theorems
            • String-downcase-gen
            • String-upcase-gen
          • 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-duplicates

    Std/lists/remove-duplicates-equal

    Lemmas about remove-duplicates-equal available in the std/lists library.

    Definitions and Theorems

    Theorem: remove-duplicates-equal-when-atom

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

    Theorem: remove-duplicates-equal-of-cons

    (defthm remove-duplicates-equal-of-cons
      (equal (remove-duplicates-equal (cons a x))
             (if (member a x)
                 (remove-duplicates-equal x)
               (cons a (remove-duplicates-equal x)))))

    Theorem: consp-of-remove-duplicates-equal

    (defthm consp-of-remove-duplicates-equal
      (equal (consp (remove-duplicates-equal x))
             (consp x)))

    Theorem: len-of-remove-duplicates-equal

    (defthm len-of-remove-duplicates-equal
      (<= (len (remove-duplicates-equal x))
          (len x))
      :rule-classes ((:rewrite) (:linear)))

    Theorem: remove-duplicates-equal-of-list-fix

    (defthm remove-duplicates-equal-of-list-fix
      (equal (remove-duplicates-equal (list-fix x))
             (remove-duplicates-equal x)))

    Theorem: list-equiv-implies-equal-remove-duplicates-equal-1

    (defthm list-equiv-implies-equal-remove-duplicates-equal-1
      (implies (list-equiv x x-equiv)
               (equal (remove-duplicates-equal x)
                      (remove-duplicates-equal x-equiv)))
      :rule-classes (:congruence))

    Theorem: set-equiv-implies-set-equiv-remove-duplicates-equal-1

    (defthm set-equiv-implies-set-equiv-remove-duplicates-equal-1
      (implies (set-equiv x x-equiv)
               (set-equiv (remove-duplicates-equal x)
                          (remove-duplicates-equal x-equiv)))
      :rule-classes (:congruence))

    Theorem: no-duplicatesp-equal-of-remove-duplicates-equal

    (defthm no-duplicatesp-equal-of-remove-duplicates-equal
      (no-duplicatesp-equal (remove-duplicates-equal x)))

    Theorem: duplicity-in-of-remove-duplicates-equal

    (defthm duplicity-in-of-remove-duplicates-equal
      (equal (duplicity a (remove-duplicates-equal x))
             (if (member a x) 1 0)))

    Theorem: remove-duplicates-equal-of-remove

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