• 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
            • Std/lists/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
            • 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
    • Len

    Std/lists/len

    Lemmas about len available in the std/lists library.

    Definitions and Theorems

    Theorem: len-when-atom

    (defthm len-when-atom
      (implies (atom x) (equal (len x) 0)))

    Theorem: len-of-cons

    (defthm len-of-cons
      (equal (len (cons a x)) (+ 1 (len x))))

    Theorem: (equal 0 (len x))

    (defthm |(equal 0 (len x))|
      (equal (equal 0 (len x)) (atom x)))

    Theorem: (< 0 (len x))

    (defthm |(< 0 (len x))|
      (equal (< 0 (len x)) (consp x)))

    Theorem: consp-by-len

    (defthm consp-by-len
      (implies (and (equal (len x) n)
                    (syntaxp (quotep n)))
               (equal (consp x) (< 0 n))))

    Theorem: consp-of-cdr-by-len

    (defthm consp-of-cdr-by-len
      (implies (and (equal (len x) n)
                    (syntaxp (quotep n)))
               (equal (consp (cdr x)) (< 1 n))))

    Theorem: consp-of-cddr-by-len

    (defthm consp-of-cddr-by-len
      (implies (and (equal (len x) n)
                    (syntaxp (quotep n)))
               (equal (consp (cddr x)) (< 2 n))))

    Theorem: consp-of-cdddr-by-len

    (defthm consp-of-cdddr-by-len
      (implies (and (equal (len x) n)
                    (syntaxp (quotep n)))
               (equal (consp (cdddr x)) (< 3 n))))