This is an ordinary defenum.
Function:
(defun bfr-mode-p (x) (declare (xargs :guard t)) (or (eql x '0) (eql x '1) (eql x '2)))
Theorem: type-when-bfr-mode-p
(defthm type-when-bfr-mode-p (implies (bfr-mode-p x) (if (integerp x) (not (< x '0)) 'nil)) :rule-classes :compound-recognizer)