Introduce a commutativity theorem.
General form:
(defthm-commutative name op :hints ...)
More customization options may be added in the future.
The new theorem's variables are `
Macro:
(defmacro defthm-commutative (name op &key hints) (declare (xargs :guard (and (symbolp name) (symbolp op)))) (let* ((var-pkg (fix-pkg (symbol-package-name op))) (x (intern$ "X" var-pkg)) (y (intern$ "Y" var-pkg))) (cons 'defthm (cons name (cons (cons 'equal (cons (cons op (cons x (cons y 'nil))) (cons (cons op (cons y (cons x 'nil))) 'nil))) (cons ':hints (cons hints 'nil)))))))