Filtering...

factorial

books/arithmetic/factorial
other
(in-package "ACL2")
factorialfunction
(defun factorial
  (n)
  (if (zp n)
    1
    (* n (factorial (1- n)))))
factorial-positive-integertheorem
(defthm factorial-positive-integer
  (and (integerp (factorial n)) (< 0 (factorial n)))
  :rule-classes (:rewrite :type-prescription))
factorial-non-negativetheorem
(defthm factorial-non-negative
  (<= 1 (factorial n))
  :rule-classes (:rewrite :linear))
abs-factorialtheorem
(defthm abs-factorial
  (equal (abs (factorial x)) (factorial x)))
in-theory
(in-theory (disable factorial))