Lemmas about inferring
Theorem:
(defthm logbitp-to-lower-bound (implies (and (logbitp n x) (natp n) (natp x)) (<= (expt 2 n) x)) :rule-classes (:linear :rewrite))
Theorem:
(defthm expt-2-n-to-logbitp (implies (natp n) (logbitp n (expt 2 n))))
Theorem:
(defthm bounds-to-logbitp-lemma (implies (and (< (expt 2 n) x) (< x (expt 2 (+ 1 n))) (natp n) (natp x)) (logbitp n x)))
Theorem:
(defthm bounds-to-logbitp (implies (and (<= (expt 2 n) x) (< x (expt 2 (+ 1 n))) (natp n) (natp x)) (and (logbitp n x) (not (logbitp (+ 1 n) x)))))