Recognize upper- and lower-case letters.
Function:
(defun letter-char-p (x) (declare (xargs :guard t)) (and (characterp x) (let ((code (char-code x))) (or (and (<= (char-code #\a) code) (<= code (char-code #\z))) (and (<= (char-code #\A) code) (<= code (char-code #\Z)))))))
Theorem:
(defthm booleanp-of-letter-char-p (booleanp (letter-char-p x)) :rule-classes :type-prescription)
Theorem:
(defthm characterp-when-letter-char-p (implies (letter-char-p x) (characterp x)) :rule-classes :compound-recognizer)