ACL2 versions of (some of) the Top 100 Theorems List
This page collects those theorems from the Formalizing 100 Theorems page that have been proved in ACL2.
Note that ACL2 has largely focused on proving theorems that are rather different from these (e.g., the correctness of large and complex hardware designs).
Theorem:
(defthm irrational-sqrt-2 (implies (equal (* x x) 2) (and (real/rationalp x) (not (rationalp x)))))
By Ruben Gamboa, in books/nonstd/nsa/sqrt-2.lisp.
Theorems
By Ruben Gamboa and John Cowles, in books/workshops/2018/gamboa-cowles/complex-polynomials.lisp.
Note: These theorems require ACL2(r).
Theorem:
(defthm dm::q2z-bi-z2q (implies (integerp n) (and (rationalp (dm::z2q-bi n)) (equal (dm::q2z-bi (dm::z2q-bi n)) n))))
Theorem:
(defthm dm::z2q-q2z-bi (implies (rationalp x) (and (integerp (dm::q2z-bi x)) (equal (dm::z2q-bi (dm::q2z-bi x)) x))))
By David Russinoff, in books/projects/numbers/z2q.lisp.
By Natarajan Shankar, using Nqthm, a predecessor to ACL2.
See this file. See also this book.
Theorem:
(defthm dm::quadratic-reciprocity (implies (and (dm::primep p) (not (= p 2)) (dm::primep q) (not (= q 2)) (not (= p q))) (iff (equal (dm::residue q p) (dm::residue p q)) (evenp (* (/ (1- p) 2) (/ (1- q) 2))))))
By David Russinoff, in books/projects/numbers/eisenstein.lisp.
Theorem
By Jagadish Bapanapally, in books/nonstd/circles/area-of-a-circle/area-of-a-circle-2.lisp.
Note: This theorem requires ACL2(r).
Theorem:
(defthm dm::euler-totient (implies (and (posp n) (> n 1) (posp x) (< x n) (equal (dm::gcd x n) 1)) (equal (mod (expt x (dm::totient n)) n) 1)))
By David Russinoff, in books/projects/groups/abelian.lisp.
Theorem:
(defthm dm::infinitude-of-primes (implies (integerp n) (and (dm::primep (dm::greater-prime n)) (> (dm::greater-prime n) n))) :rule-classes nil)
By David Russinoff, in books/projects/numbers/euclid.lisp.
Theorem
By Matt Kaufmann, in books/nonstd/workshops/1999/calculus/book/fundamental-theorem-of-calculus.lisp.
Note: This theorem requires ACL2(r).
Theorem
By Ruben Gamboa, in books/workshops/2018/gamboa-cowles/de-moivre.lisp.
Note: This theorem requires ACL2(r).
Theorem:
(defthm dm::nat-sum-of-4-squares (implies (natp n) (and (dm::int4p (dm::int4-nat n)) (equal (dm::sum-squares (dm::int4-nat n)) n))))
By David Russinoff, in books/projects/numbers/sum4squares.lisp.
Theorem:
(defthm dm::prime-sum-squares (implies (and (dm::primep p) (natp a) (natp b) (equal (+ (* a a) (* b b)) p)) (or (equal p 2) (equal (mod p 4) 1))) :rule-classes nil)
Theorem:
(defthm dm::prime-sum-squares-converse (implies (and (dm::primep p) (equal (mod p 4) 1)) (let* ((pair (dm::square-pair p)) (a (car pair)) (b (cdr pair))) (and (natp a) (natp b) (equal (+ (* a a) (* b b)) p)))))
By David Russinoff, in books/projects/numbers/girard.lisp.
Theorem
By Ruben Gamboa and John Cowles, in books/nonstd/transcendentals/reals-are-uncountable-1.lisp.
Note: This theorem requires ACL2(r).
Theorem:
(defthm dm::pyth-trip-sufficiency (implies (and (posp m) (posp n) (> m n)) (let ((a (- (* m m) (* n n))) (b (* 2 m n)) (c (+ (* m m) (* n n)))) (equal (+ (* a a) (* b b)) (* c c)))))
Theorem:
(defthm dm::pyth-trip-necessity (implies (and (posp a) (posp b) (posp c) (= (dm::gcd a b) 1) (= (+ (* a a) (* b b)) (* c c))) (if (oddp a) (mv-let (m n) (dm::pyth-trip-generators a b c) (and (posp m) (posp n) (equal a (- (* m m) (* n n))) (equal b (* 2 m n)) (equal c (+ (* m m) (* n n))))) (mv-let (m n) (dm::pyth-trip-generators b a c) (and (posp m) (posp n) (equal b (- (* m m) (* n n))) (equal a (* 2 m n)) (equal c (+ (* m m) (* n n))))))) :rule-classes nil)
By David Russinoff, in books/projects/numbers/triples.lisp.
Theorem:
(defthm sbt::injectivity-of-sb (implies (and (sbt::p sbt::x) (sbt::p sbt::y) (equal (sbt::sb sbt::x) (sbt::sb sbt::y))) (equal sbt::x sbt::y)) :rule-classes nil)
Theorem:
(defthm sbt::surjectivity-of-sb (implies (sbt::q sbt::x) (sbt::exists-sb-inverse sbt::x)))
By Grant Jurgensen, in books/projects/schroder-bernstein/schroder-bernstein.lisp.
Theorem:
(defthm dm::ballot-theorem (let ((a (dm::a-count p e)) (b (dm::b-count p e))) (implies (and (dm::dlistp p) (> a b)) (equal (dm::prob p e) (/ (- a b) (+ a b))))))
By David Russinoff, in books/projects/numbers/ballot.lisp.
By Matt Kaufmann, using PC-Nqthm, a predecessor to ACL2.
Note: Only the exponent-2 Ramsey Theorem for two partitions.
Theorem:
(defthm harmonic-series-diverges (implies (and (natp m) (natp n) (>= n (expt 2 (* m 2)))) (> (harmonic-sum n) m)))
By David Russinoff, in books/projects/numbers/harmonic.lisp.
By Ruben Gamboa and Brittany Middleton.
By Matt Kaufmann, using Nqthm, a predecessor to ACL2.
See: this paper.
Theorem:
(defthm tri-recip-sum-limit (implies (and (rationalp e) (> e 0) (posp n) (> n (/ 2 e))) (< (abs (- (tri-recip-sum n) 2)) e)))
By David Russinoff, in books/projects/numbers/triangular.lisp.
Theorem:
(defthm binomial-theorem (implies (and (integerp n) (<= 0 n)) (equal (expt (+ x y) n) (sumlist (binomial-expansion x y 0 n)))))
By Ruben Gamboa, in books/arithmetic/binomial.lisp.
Theorem:
(defthm dm::dlistp-odd-parts (implies (posp n) (dm::dlistp (dm::odd-parts n))))
Theorem:
(defthm dm::odd-partp-odd-parts (implies (and (posp n) (member-equal l (dm::odd-parts n))) (dm::odd-partp l n)))
Theorem:
(defthm dm::odd-parts-perm-equal (implies (and (posp n) (member-equal l (dm::odd-parts n)) (member-equal m (dm::odd-parts n)) (dm::permutationp l m)) (equal l m)) :rule-classes nil)
Theorem:
(defthm dm::perm-odd-parts (implies (and (posp n) (dm::odd-partp l n)) (and (member-equal (dm::sort l) (dm::odd-parts n)) (dm::permutationp (dm::sort l) l))))
Theorem:
(defthm dm::dlistp-dis-parts (implies (posp n) (dm::dlistp (dm::dis-parts n))))
Theorem:
(defthm dm::dis-partp-dis-parts (implies (and (posp n) (member-equal l (dm::dis-parts n))) (dm::dis-partp l n)))
Theorem:
(defthm dm::dis-parts-perm-equal (implies (and (posp n) (member-equal l (dm::dis-parts n)) (member-equal m (dm::dis-parts n)) (dm::permutationp l m)) (equal l m)) :rule-classes nil)
Theorem:
(defthm dm::dis-partp-dis-parts (implies (and (posp n) (member-equal l (dm::dis-parts n))) (dm::dis-partp l n)))
Theorem:
(defthm dm::perm-dis-parts (implies (and (posp n) (dm::dis-partp l n)) (and (member-equal (dm::dsort l) (dm::dis-parts n)) (dm::permutationp (dm::dsort l) l))))
Theorem:
(defthm dm::len-dis-parts (equal (len (dm::dis-parts n)) (len (dm::odd-parts n))))
By David Russinoff, in books/projects/numbers/partitions.lisp.
Theorem:
(defthm dm::wilson (implies (dm::primep p) (equal (mod (dm::fact (1- p)) p) (1- p))) :rule-classes nil)
By David Russinoff, in books/projects/numbers/euler.lisp.
Theorem:
(defthm dm::len-subsets (equal (len (dm::subsets l)) (expt 2 (len l))))
By David Russinoff, in books/projects/numbers/subsets.lisp.
Theorem:
(defthm dm::konigsberg (implies (and (member-equal dm::r (dm::regions)) (dm::pathp p dm::r)) (not (dm::permutationp p (dm::bridges)))))
By David Russinoff, in books/projects/numbers/konigsberg.lisp.
Theorem:
(defthm dm::len-subsets-of-order (implies (and (dm::dlistp l) (natp k)) (equal (len (dm::subsets-of-order k l)) (dm::choose (len l) k))))
By David Russinoff, in books/projects/numbers/subsets.lisp.
Theorem
By Ruben Gamboa, in books/nonstd/nsa/exp.lisp.
Note: This theorem requires ACL2(r).
Theorem:
(defthm dm::gcd-divides (implies (and (integerp x) (integerp y)) (and (or (= x 0) (dm::divides (dm::gcd x y) x)) (or (= y 0) (dm::divides (dm::gcd x y) y)))) :rule-classes nil)
Theorem:
(defthm dm::divides-gcd (implies (and (integerp x) (integerp y) (integerp d) (not (= d 0)) (dm::divides d x) (dm::divides d y)) (dm::divides d (dm::gcd x y))))
By David Russinoff, in books/projects/numbers/euclid.lisp.
Theorem:
(defthm dm::perfectp-sufficiency (implies (and (posp k) (dm::primep (1- (expt 2 (1+ k))))) (dm::perfectp (* (expt 2 k) (1- (expt 2 (1+ k)))))))
Theorem:
(defthm dm::perfectp-necessity (implies (and (posp n) (evenp n) (dm::perfectp n)) (let ((k (dm::log n 2))) (and (dm::primep (1- (expt 2 (1+ k)))) (equal (* (expt 2 k) (1- (expt 2 (1+ k)))) n)))))
By David Russinoff, in books/projects/numbers/divisors.lisp.
Theorem:
(defthm dm::lagrange (implies (dm::subgroupp h dm::g) (equal (* (dm::order h) (dm::subgroup-index h dm::g)) (dm::order dm::g))))
By David Russinoff, in books/projects/groups/quotients.lisp.
By David Russinoff, in books/projects/groups/sylow.lisp.
Theorem:
(defthm dm::asc-desc-subseqp (implies (and (dm::rat-listp l) (dm::dlistp l) (posp a) (posp b) (> (len l) (* (1- a) (1- b)))) (let ((dm::asc (dm::longest-ascending-subseq l)) (dm::desc (dm::longest-descending-subseq l))) (and (dm::subseqp dm::asc l) (dm::ascendingp dm::asc) (dm::subseqp dm::desc l) (dm::descendingp dm::desc) (or (>= (len dm::asc) a) (>= (len dm::desc) b))))))
By David Russinoff, in books/projects/numbers/subseq.lisp.
(encapsulate (((p *) => *)) (local (defun p (n) n)) (defthm p-0 (p 0)) (defthm p-recurrence (implies (and (natp n) (p n)) (p (1+ n))))) (defun n-induction (n) (if (posp n) (list (n-induction (1- n))) (list n))) (defthm mathematical-induction (implies (natp n) (p n)) :hints (("Goal" :induct (n-induction n)) ("Subgoal *1/1" :use ((:instance p-recurrence (n (1- n)))))))
By David Russinoff.
Theorems
By Ruben Gamboa, in books/nonstd/nsa/derivatives.lisp.
Note: These theorems require ACL2(r).
Theorems
By Carl Kwan and Mark R. Greenstreet, in books/workshops/2018/kwan-greenstreet/cauchy-schwarz.lisp.
Note: These theorems require ACL2(r).
Theorems
By Carl Kwan, Yan Peng, and Mark R. Greenstreet, in books/workshops/2020/kwan-peng-greenstreet/abstract-cs.lisp.
Note: These theorems require ACL2(r).
Theorems
By Ruben Gamboa, in books/nonstd/nsa/continuity.lisp.
Note: These theorems require ACL2(r).
Theorem:
(defthm pos::product-lst-prime-factors (implies (and (integerp pos::x) (> pos::x 0)) (equal (pos::product-lst (pos::prime-factors pos::x)) pos::x)))
Theorem:
(defthm pos::prime-factorization-uniqueness (implies (and (pos::prime-listp pos::lst1) (pos::prime-listp pos::lst2) (equal (pos::product-lst pos::lst1) (pos::product-lst pos::lst2))) (pos::bag-equal pos::lst1 pos::lst2)))
By Ruben Gamboa and John Cowles, in books/workshops/2006/cowles-gamboa-euclid/Euclid/prime-fac.lisp.
Theorem:
(defthm dm::prime-fact-existence (implies (posp n) (let ((l (dm::prime-fact n))) (and (dm::prime-pow-list-p l) (equal (dm::pow-prod l) n)))))
Theorem:
(defthm dm::prime-fact-uniqueness (implies (and (posp n) (dm::prime-pow-list-p l) (equal (dm::pow-prod l) n)) (equal (dm::prime-fact n) l)))
By David Russinoff, in books/projects/numbers/euclid.lisp.
Theorems
By Ruben Gamboa.
Theorem:
(defthm dm::divides-3-sum-list-digits (implies (natp n) (iff (dm::divides 3 (dm::sum-list (dm::digits n))) (dm::divides 3 n))))
By David Russinoff, in books/projects/numbers/div3.lisp.
Theorem:
(defthm dm::derangements-formula (implies (posp n) (equal (len (dm::derangements n)) (dm::num-derangements n))))
By David Russinoff, in books/projects/numbers/derangements.lisp.
Theorem:
(defthm dm::probability-of-repetition-value (implies (and (natp k) (<= k 365)) (equal (dm::probability-of-repetition k) (- 1 (/ (dm::fact 365) (* (dm::fact (- 365 k)) (expt 365 k)))))))
Theorem:
(defthm dm::probability-of-repetition-22 (< (dm::probability-of-repetition 22) 1/2))
Theorem:
(defthm dm::probability-of-repetition-23 (> (dm::probability-of-repetition 23) 1/2))
By David Russinoff, in books/projects/numbers/birthday.lisp.
Theorem:
(defthm dm::inclusion-exclusion-principle (implies (and (dm::dlistp u) (dm::dlistp l) (dm::sublistp l (dm::subsets u))) (equal (dm::inc-exc l) (len (dm::union-list l)))))
By David Russinoff, in books/projects/numbers/sylvester.lisp.
Theorem:
(defthm dm::cramer (implies (and (dm::fmatp a n n) (natp n) (> n 1) (dm::invertiblep a n) (dm::flistnp b n) (dm::flistnp x n) (dm::solutionp x a b) (natp i) (< i n)) (equal (nth i x) (dm::f* (dm::f/ (dm::fdet a n)) (dm::fdet (dm::replace-col a i b) n)))))
By David Russinoff, in projects/linear/reduction.lisp.