This is an ordinary defenum.
Function:
(defun vl-casekey-p (x) (declare (xargs :guard t)) (or (eq x ':inside) (eq x ':matches) (eq x 'nil)))
Theorem: type-when-vl-casekey-p
(defthm type-when-vl-casekey-p (implies (vl-casekey-p x) (if (if (symbolp x) (if (not (equal x 't)) (not (equal x 'nil)) 'nil) 'nil) 't (equal x 'nil))) :rule-classes :compound-recognizer)