Filtering...

num-list-thms

books/acl2s/defdata/num-list-thms
other
(in-package "DEFDATA")
other
(include-book "num-list-fns")
other
(defthm pos-list--first
  (implies (and (pos-listp l) (consp l))
    (< 0 (car l)))
  :rule-classes (:linear :rewrite))
other
(defthm sum-list-poses-type
  (implies (and (pos-listp l) (consp l))
    (< 0 (sum-list l)))
  :rule-classes (:linear :rewrite))
other
(defthm sum-list-nats-type
  (implies (nat-listp l)
    (<= 0 (sum-list l)))
  :rule-classes (:linear :rewrite))
other
(defthm sum-list-integers-type
  (implies (integer-listp l)
    (integerp (sum-list l)))
  :rule-classes (:rewrite :type-prescription))
other
(defthm sum-list-rationals-type
  (implies (rational-listp l)
    (rationalp (sum-list l)))
  :rule-classes (:rewrite :type-prescription))
other
(defthm sum-list>=element
  (implies (and (nat-listp l) (consp l))
    (>= (sum-list l) (car l)))
  :rule-classes (:rewrite :linear))
other
(defthm sum-list--append
  (equal (sum-list (append x y))
    (+ (sum-list x)
      (sum-list y))))
other
(encapsulate nil
  (local (include-book "arithmetic-5/top" :dir :system))
  (local (set-default-hints '((nonlinearp-default-hint stable-under-simplificationp
         hist
         pspv))))
  (defthm product-list-poses-type
    (implies (pos-listp l)
      (< 0 (product-list l)))
    :rule-classes (:linear :rewrite))
  (defthm product-list-nats-type
    (implies (nat-listp l)
      (<= 0 (product-list l)))
    :rule-classes (:linear :rewrite))
  (defthm product-list-integers-type
    (implies (integer-listp l)
      (integerp (product-list l)))
    :rule-classes (:rewrite :type-prescription))
  (defthm product-list-rationals-type
    (implies (rational-listp l)
      (rationalp (product-list l)))
    :rule-classes (:rewrite :type-prescription))
  (defthm product-list>=element
    (implies (and (pos-listp l) (consp l))
      (>= (product-list l) (car l)))
    :rule-classes (:rewrite :linear))
  (defthm product-list--append
    (equal (product-list (append x y))
      (* (product-list x)
        (product-list y)))))
other
(defthm max-nat-list<=sum-list
  (implies (nat-listp l)
    (<= (max-nat-list l)
      (sum-list l)))
  :rule-classes (:linear :rewrite))
other
(defthm max-nat-list>=element
  (implies (and (nat-listp l) (consp l))
    (>= (max-nat-list l) (car l)))
  :rule-classes (:linear :rewrite))
other
(defthm max-nat-list--nat-listp
  (implies (nat-listp l)
    (integerp (max-nat-list l)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm max-nat-list--nat-listp2
  (implies (nat-listp l)
    (<= 0 (max-nat-list l)))
  :rule-classes (:linear :rewrite))
other
(defthm len=0--not-consp
  (implies (equal (len x) 0)
    (not (consp x))))
other
(defthm scale--pos-list
  (implies (and (pos-listp l)
      (integerp x)
      (< 0 x))
    (pos-listp (scale l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm scale--nat-list
  (implies (and (nat-listp l)
      (integerp x)
      (<= 0 x))
    (nat-listp (scale l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm scale--integer-list
  (implies (and (integer-listp l)
      (integerp x))
    (integer-listp (scale l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm scale--rational-list
  (implies (and (rational-listp l)
      (rationalp x))
    (rational-listp (scale l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm scale--number-list
  (implies (and (acl2-number-listp l)
      (acl2-numberp x))
    (acl2-number-listp (scale l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm scale--consp
  (implies (consp l)
    (consp (scale l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm scale--len
  (equal (len (scale l x))
    (len l)))
other
(defthm shift--pos-list
  (implies (and (pos-listp l)
      (integerp x)
      (< 0 x))
    (pos-listp (shift l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm shift--nat-list
  (implies (and (nat-listp l)
      (integerp x)
      (<= 0 x))
    (nat-listp (shift l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm shift--integer-list
  (implies (and (integer-listp l)
      (integerp x))
    (integer-listp (shift l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm shift--rational-list
  (implies (and (rational-listp l)
      (rationalp x))
    (rational-listp (shift l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm shift--number-list
  (implies (and (acl2-number-listp l)
      (acl2-numberp x))
    (acl2-number-listp (shift l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm shift--consp
  (implies (consp l)
    (consp (shift l x)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm shift--len
  (equal (len (shift l x))
    (len l)))
other
(defthm list-expt--number-list
  (implies (and (acl2-number-listp l)
      (integerp x)
      (<= 0 x))
    (acl2-number-listp (list-expt x l)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm list-expt--consp
  (implies (consp l)
    (consp (list-expt x l)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm list-expt--len
  (equal (len (list-expt x l))
    (len l)))
other
(defthm expt--integer
  (implies (and (integerp x)
      (integerp y)
      (<= 0 y))
    (integerp (expt x y))))
other
(defthm expt-->=0
  (implies (and (integerp x)
      (< 0 x)
      (integerp y)
      (<= 0 y))
    (< 0 (expt x y)))
  :rule-classes (:rewrite :linear))
other
(defthm expt--2
  (implies (and (integerp x)
      (<= 0 x)
      (integerp y)
      (< 0 y))
    (<= 2 (expt 2 y))))
other
(defthm <=-lists--transitive
  (implies (and (<=-lists a b)
      (<=-lists b c))
    (<=-lists a c))
  :rule-classes ((:rewrite :match-free :all)))
other
(defthm <=-lists--reflexive
  (<=-lists x x))
other
(defthm all-<=--<=
  (implies (and (all-<= l a)
      (<= a b))
    (all-<= l b)))
other
(defthm all-<=--nth-<=
  (implies (and (all-<= l v)
      (integerp i)
      (<= 0 i)
      (< i (len l)))
    (<= (nth i l) v)))
other
(defthm all-<=--car-<=
  (implies (and (all-<= l v)
      (consp l))
    (<= (car l) v)))
other
(defthm <=-lists--all-<=
  (implies (and (all-<= b x)
      (<=-lists a b))
    (all-<= a x))
  :rule-classes (:rewrite :forward-chaining))
other
(defthm *-lists-poses-type
  (implies (and (pos-listp l1)
      (pos-listp l2))
    (pos-listp (*-lists l1 l2)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm *-lists-nats-type
  (implies (and (nat-listp l1)
      (nat-listp l2))
    (nat-listp (*-lists l1 l2)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm *-lists-integers-type
  (implies (and (integer-listp l1)
      (integer-listp l2))
    (integer-listp (*-lists l1 l2)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm *-lists-rationals-type
  (implies (and (rational-listp l1)
      (rational-listp l2))
    (rational-listp (*-lists l1 l2)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm *-lists--len
  (equal (len (*-lists l1 l2))
    (min (len l1) (len l2))))
other
(defthm +-lists-poses-type
  (implies (and (pos-listp l1)
      (pos-listp l2))
    (pos-listp (+-lists l1 l2)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm +-lists-nats-type
  (implies (and (nat-listp l1)
      (nat-listp l2))
    (nat-listp (+-lists l1 l2)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm +-lists-integers-type
  (implies (and (integer-listp l1)
      (integer-listp l2))
    (integer-listp (+-lists l1 l2)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm +-lists-rationals-type
  (implies (and (rational-listp l1)
      (rational-listp l2))
    (rational-listp (+-lists l1 l2)))
  :rule-classes (:type-prescription :rewrite))
other
(defthm +-lists--len
  (equal (len (+-lists l1 l2))
    (min (len l1) (len l2))))
other
(defthm make-list-ac=make-list-logic--lemma
  (equal (append (make-list-logic e n)
      (cons e l))
    (cons e
      (append (make-list-logic e n)
        l))))
other
(defthm make-list-ac=make-list-logic-append
  (equal (make-list-ac n e l)
    (append (make-list-logic e n)
      l)))
other
(defthm make-list-ac--to--make-list-logic
  (equal (make-list-ac n e nil)
    (make-list-logic e n)))
other
(defthm make-list--len
  (implies (and (integerp n) (<= 0 n))
    (equal (len (make-list-logic v n))
      n)))
other
(defthm make-list--consp
  (implies (and (integerp n) (< 0 n))
    (consp (make-list-logic v n)))
  :rule-classes (:rewrite :type-prescription)
  :hints (("Subgoal *1/3'" :expand ((make-list-logic v 1)))))
other
(defthm make-list--nats
  (implies (and (integerp v) (<= 0 v))
    (nat-listp (make-list-logic v n)))
  :rule-classes (:rewrite :type-prescription))
other
(defthm make-list--pos
  (implies (and (integerp v) (< 0 v))
    (pos-listp (make-list-logic v n)))
  :rule-classes (:rewrite :type-prescription))
other
(defthm car--make-list
  (implies (and (integerp n) (< 0 n))
    (equal (car (make-list-logic v n))
      v))
  :hints (("Subgoal *1/3'" :expand ((make-list-logic v 1)))))
other
(defthm cdr--make-list
  (implies (and (integerp n) (< 0 n))
    (equal (cdr (make-list-logic v n))
      (make-list-logic v (- n 1)))))
other
(defthm all-<=--make-list
  (equal (all-<= (make-list-logic x n)
      y)
    (or (zp n) (<= x y))))
other
(defthm pfix--integerp
  (integerp (pfix x))
  :rule-classes (:rewrite :type-prescription))
other
(defthm pfix>=1
  (<= 1 (pfix x))
  :rule-classes (:rewrite :linear))
other
(defthm pfix=
  (implies (and (integerp x) (< 0 x))
    (equal (pfix x) x)))
other
(in-theory (disable pfix))
other
(defthm pos-list-fix--pos-listp
  (pos-listp (pos-list-fix x)))
other
(defthm pos-list-fix--nat-listp
  (nat-listp (pos-list-fix x)))
other
(defthm pos-list-fix--integer-listp
  (integer-listp (pos-list-fix x)))
other
(defthm pos-list-fix--rational-listp
  (rational-listp (pos-list-fix x)))
other
(defthm pos-list-fix--pos-list
  (implies (pos-listp x)
    (equal (pos-list-fix x) x)))
other
(defthm pos-list-fix--len
  (equal (len (pos-list-fix x))
    (len x)))
other
(defthm pos-list-fix--cons
  (implies (consp x)
    (equal (car (pos-list-fix x))
      (pfix (car x)))))
other
(defthm pos-list-fix--cdr
  (equal (cdr (pos-list-fix x))
    (pos-list-fix (cdr x))))
other
(defthm pos-list-fix--consp
  (equal (consp (pos-list-fix x))
    (consp x)))
other
(in-theory (disable pos-list-fix))