(subsetp-of-pat-flatten x pat) is an optimized way to ask if
This just avoids flattening the pattern. Don't expect it to be super fast; it's still O(n^2).
Function:
(defun subsetp-of-pat-flatten (x pat) (declare (xargs :guard t)) (mbe :logic (subsetp-equal x (pat-flatten1 pat)) :exec (if (atom x) t (and (member-of-pat-flatten (car x) pat) (subsetp-of-pat-flatten (cdr x) pat)))))