• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Memoize
        • Mbe
        • Io
        • Apply$
        • Defpkg
        • Mutual-recursion
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Loop$-primer
        • Fast-alists
        • Defmacro
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
          • Natp
          • Unsigned-byte-p
          • Posp
          • +
          • Bitp
          • Zero-test-idioms
          • Nat-listp
          • Integerp
          • <
          • *
          • Zp
          • -
          • Signed-byte-p
          • Logbitp
          • Expt
          • Ash
          • Rationalp
          • Sharp-f-reader
          • Logand
          • =
          • <=
          • Floor
          • Random$
          • Nfix
          • Truncate
          • Complex
          • Numbers-introduction
          • Code-char
          • Integer-length
          • Zip
          • Logior
          • Sharp-u-reader
          • Char-code
          • Unary--
          • Integer-listp
          • Boole$
          • /
          • Mod
          • Logxor
          • Lognot
          • Integer-range-p
          • Ifix
          • ACL2-numberp
          • Ceiling
          • Mod-expt
          • Round
          • Logeqv
          • Explode-nonnegative-integer
          • Max
          • Evenp
          • Nonnegative-integer-quotient
          • Zerop
          • Abs
          • Fix
          • Allocate-fixnum-range
          • Rem
          • 1+
          • Pos-listp
          • Signum
          • Real/rationalp
          • Rational-listp
            • Std/typed-lists/rational-listp
              • Rational-listp-basics
              • Arithmetic/rational-listp
            • Rfix
            • >=
            • >
            • Logcount
            • ACL2-number-listp
            • /=
            • Unary-/
            • Complex/complex-rationalp
            • Logtest
            • Logandc1
            • Logorc1
            • Logandc2
            • 1-
            • Numerator
            • Logorc2
            • Denominator
            • The-number
            • Realfix
            • Complex-rationalp
            • Min
            • Lognor
            • Zpf
            • Oddp
            • Minusp
            • Lognand
            • Imagpart
            • Conjugate
            • Int=
            • Realpart
            • Plusp
          • Irrelevant-formals
          • Efficiency
          • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
          • Redefining-programs
          • Lists
          • Invariant-risk
          • Errors
          • Defabbrev
          • Conses
          • Alists
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Defmacro-untouchable
          • Primitive
          • <<
          • Revert-world
          • Set-duplicate-keys-action
          • Unmemoize
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Defopen
          • Sleep
        • Start-here
        • Real
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Rational-listp

    Std/typed-lists/rational-listp

    Lemmas about rational-listp available in the std/typed-lists library.

    Most of these are generated automatically with std::deflist.

    Definitions and Theorems

    Theorem: rational-listp-of-cons

    (defthm rational-listp-of-cons
            (equal (rational-listp (cons a x))
                   (and (rationalp a) (rational-listp x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-cdr-when-rational-listp

    (defthm rational-listp-of-cdr-when-rational-listp
            (implies (rational-listp (double-rewrite x))
                     (rational-listp (cdr x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-when-not-consp

    (defthm rational-listp-when-not-consp
            (implies (not (consp x))
                     (equal (rational-listp x) (not x)))
            :rule-classes ((:rewrite)))

    Theorem: rationalp-of-car-when-rational-listp

    (defthm rationalp-of-car-when-rational-listp
            (implies (rational-listp x)
                     (iff (rationalp (car x)) (consp x)))
            :rule-classes ((:rewrite)))

    Theorem: true-listp-when-rational-listp-compound-recognizer

    (defthm true-listp-when-rational-listp-compound-recognizer
            (implies (rational-listp x)
                     (true-listp x))
            :rule-classes :compound-recognizer)

    Theorem: rational-listp-of-list-fix

    (defthm rational-listp-of-list-fix
            (implies (rational-listp x)
                     (rational-listp (list-fix x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-sfix

    (defthm rational-listp-of-sfix
            (iff (rational-listp (set::sfix x))
                 (or (rational-listp x)
                     (not (set::setp x))))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-insert

    (defthm rational-listp-of-insert
            (iff (rational-listp (set::insert a x))
                 (and (rational-listp (set::sfix x))
                      (rationalp a)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-delete

    (defthm rational-listp-of-delete
            (implies (rational-listp x)
                     (rational-listp (set::delete k x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-mergesort

    (defthm rational-listp-of-mergesort
            (iff (rational-listp (set::mergesort x))
                 (rational-listp (list-fix x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-union

    (defthm rational-listp-of-union
            (iff (rational-listp (set::union x y))
                 (and (rational-listp (set::sfix x))
                      (rational-listp (set::sfix y))))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-intersect-1

    (defthm rational-listp-of-intersect-1
            (implies (rational-listp x)
                     (rational-listp (set::intersect x y)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-intersect-2

    (defthm rational-listp-of-intersect-2
            (implies (rational-listp y)
                     (rational-listp (set::intersect x y)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-difference

    (defthm rational-listp-of-difference
            (implies (rational-listp x)
                     (rational-listp (set::difference x y)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-duplicated-members

    (defthm rational-listp-of-duplicated-members
            (implies (rational-listp x)
                     (rational-listp (duplicated-members x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-rev

    (defthm rational-listp-of-rev
            (equal (rational-listp (rev x))
                   (rational-listp (list-fix x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-append

    (defthm rational-listp-of-append
            (equal (rational-listp (append a b))
                   (and (rational-listp (list-fix a))
                        (rational-listp b)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-rcons

    (defthm rational-listp-of-rcons
            (iff (rational-listp (rcons a x))
                 (and (rationalp a)
                      (rational-listp (list-fix x))))
            :rule-classes ((:rewrite)))

    Theorem: rationalp-when-member-equal-of-rational-listp

    (defthm rationalp-when-member-equal-of-rational-listp
            (and (implies (and (member-equal a x)
                               (rational-listp x))
                          (rationalp a))
                 (implies (and (rational-listp x)
                               (member-equal a x))
                          (rationalp a)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-when-subsetp-equal

    (defthm rational-listp-when-subsetp-equal
            (and (implies (and (subsetp-equal x y)
                               (rational-listp y))
                          (equal (rational-listp x)
                                 (true-listp x)))
                 (implies (and (rational-listp y)
                               (subsetp-equal x y))
                          (equal (rational-listp x)
                                 (true-listp x))))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-set-difference-equal

    (defthm rational-listp-of-set-difference-equal
            (implies (rational-listp x)
                     (rational-listp (set-difference-equal x y)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-intersection-equal-1

    (defthm rational-listp-of-intersection-equal-1
            (implies (rational-listp (double-rewrite x))
                     (rational-listp (intersection-equal x y)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-intersection-equal-2

    (defthm rational-listp-of-intersection-equal-2
            (implies (rational-listp (double-rewrite y))
                     (rational-listp (intersection-equal x y)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-union-equal

    (defthm rational-listp-of-union-equal
            (equal (rational-listp (union-equal x y))
                   (and (rational-listp (list-fix x))
                        (rational-listp (double-rewrite y))))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-take

    (defthm rational-listp-of-take
            (implies (rational-listp (double-rewrite x))
                     (iff (rational-listp (take n x))
                          (or (rationalp nil)
                              (<= (nfix n) (len x)))))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-repeat

    (defthm rational-listp-of-repeat
            (iff (rational-listp (repeat n x))
                 (or (rationalp x) (zp n)))
            :rule-classes ((:rewrite)))

    Theorem: rationalp-of-nth-when-rational-listp

    (defthm rationalp-of-nth-when-rational-listp
            (implies (rational-listp x)
                     (iff (rationalp (nth n x))
                          (< (nfix n) (len x))))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-update-nth

    (defthm rational-listp-of-update-nth
            (implies (rational-listp (double-rewrite x))
                     (iff (rational-listp (update-nth n y x))
                          (and (rationalp y)
                               (or (<= (nfix n) (len x))
                                   (rationalp nil)))))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-butlast

    (defthm rational-listp-of-butlast
            (implies (rational-listp (double-rewrite x))
                     (rational-listp (butlast x n)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-nthcdr

    (defthm rational-listp-of-nthcdr
            (implies (rational-listp (double-rewrite x))
                     (rational-listp (nthcdr n x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-last

    (defthm rational-listp-of-last
            (implies (rational-listp (double-rewrite x))
                     (rational-listp (last x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-remove

    (defthm rational-listp-of-remove
            (implies (rational-listp x)
                     (rational-listp (remove a x)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-revappend

    (defthm rational-listp-of-revappend
            (equal (rational-listp (revappend x y))
                   (and (rational-listp (list-fix x))
                        (rational-listp y)))
            :rule-classes ((:rewrite)))

    Theorem: rational-listp-of-remove-equal

    (defthm rational-listp-of-remove-equal
            (implies (rational-listp x)
                     (rational-listp (remove-equal a x))))

    Theorem: rational-listp-of-make-list-ac

    (defthm rational-listp-of-make-list-ac
            (equal (rational-listp (make-list-ac n x ac))
                   (and (rational-listp ac)
                        (or (rationalp x) (zp n)))))

    Theorem: eqlable-listp-when-rational-listp

    (defthm eqlable-listp-when-rational-listp
            (implies (rational-listp x)
                     (eqlable-listp x)))