A repetition range is well-formed iff the minimum does not exceed the maximum.
(repeat-range-wfp range) → yes/no
This condition is reasonably justifiable because no number of repetitions exists in a range whose minimum exceeds the maximum.
Function:
(defun repeat-range-wfp (range) (declare (xargs :guard (repeat-rangep range))) (b* ((min (repeat-range->min range)) (max (repeat-range->max range))) (or (nati-case max :infinity) (<= min (nati-finite->get max)))))
Theorem:
(defthm booleanp-of-repeat-range-wfp (b* ((yes/no (repeat-range-wfp range))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm justification-for-repeat-range-wfp (implies (and (nati-case (repeat-range->max range) :finite) (> (repeat-range->min range) (nati-finite->get (repeat-range->max range)))) (not (numrep-match-repeat-range-p numrep range))))