(partsum-elt-fix x) is a usual fty list fixing function.
(partsum-elt-fix x) → fty::newx
In the logic, we apply partsum-comp-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.
Function:
(defun partsum-elt-fix$inline (x) (declare (xargs :guard (partsum-elt-p x))) (let ((__function__ 'partsum-elt-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) nil (cons (partsum-comp-fix (car x)) (partsum-elt-fix (cdr x)))) :exec x)))
Theorem:
(defthm partsum-elt-p-of-partsum-elt-fix (b* ((fty::newx (partsum-elt-fix$inline x))) (partsum-elt-p fty::newx)) :rule-classes :rewrite)
Theorem:
(defthm partsum-elt-fix-when-partsum-elt-p (implies (partsum-elt-p x) (equal (partsum-elt-fix x) x)))
Function:
(defun partsum-elt-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (partsum-elt-p acl2::x) (partsum-elt-p acl2::y)))) (equal (partsum-elt-fix acl2::x) (partsum-elt-fix acl2::y)))
Theorem:
(defthm partsum-elt-equiv-is-an-equivalence (and (booleanp (partsum-elt-equiv x y)) (partsum-elt-equiv x x) (implies (partsum-elt-equiv x y) (partsum-elt-equiv y x)) (implies (and (partsum-elt-equiv x y) (partsum-elt-equiv y z)) (partsum-elt-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm partsum-elt-equiv-implies-equal-partsum-elt-fix-1 (implies (partsum-elt-equiv acl2::x x-equiv) (equal (partsum-elt-fix acl2::x) (partsum-elt-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm partsum-elt-fix-under-partsum-elt-equiv (partsum-elt-equiv (partsum-elt-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-partsum-elt-fix-1-forward-to-partsum-elt-equiv (implies (equal (partsum-elt-fix acl2::x) acl2::y) (partsum-elt-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-partsum-elt-fix-2-forward-to-partsum-elt-equiv (implies (equal acl2::x (partsum-elt-fix acl2::y)) (partsum-elt-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm partsum-elt-equiv-of-partsum-elt-fix-1-forward (implies (partsum-elt-equiv (partsum-elt-fix acl2::x) acl2::y) (partsum-elt-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm partsum-elt-equiv-of-partsum-elt-fix-2-forward (implies (partsum-elt-equiv acl2::x (partsum-elt-fix acl2::y)) (partsum-elt-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm car-of-partsum-elt-fix-x-under-partsum-comp-equiv (partsum-comp-equiv (car (partsum-elt-fix acl2::x)) (car acl2::x)))
Theorem:
(defthm car-partsum-elt-equiv-congruence-on-x-under-partsum-comp-equiv (implies (partsum-elt-equiv acl2::x x-equiv) (partsum-comp-equiv (car acl2::x) (car x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cdr-of-partsum-elt-fix-x-under-partsum-elt-equiv (partsum-elt-equiv (cdr (partsum-elt-fix acl2::x)) (cdr acl2::x)))
Theorem:
(defthm cdr-partsum-elt-equiv-congruence-on-x-under-partsum-elt-equiv (implies (partsum-elt-equiv acl2::x x-equiv) (partsum-elt-equiv (cdr acl2::x) (cdr x-equiv))) :rule-classes :congruence)
Theorem:
(defthm cons-of-partsum-comp-fix-x-under-partsum-elt-equiv (partsum-elt-equiv (cons (partsum-comp-fix acl2::x) acl2::y) (cons acl2::x acl2::y)))
Theorem:
(defthm cons-partsum-comp-equiv-congruence-on-x-under-partsum-elt-equiv (implies (partsum-comp-equiv acl2::x x-equiv) (partsum-elt-equiv (cons acl2::x acl2::y) (cons x-equiv acl2::y))) :rule-classes :congruence)
Theorem:
(defthm cons-of-partsum-elt-fix-y-under-partsum-elt-equiv (partsum-elt-equiv (cons acl2::x (partsum-elt-fix acl2::y)) (cons acl2::x acl2::y)))
Theorem:
(defthm cons-partsum-elt-equiv-congruence-on-y-under-partsum-elt-equiv (implies (partsum-elt-equiv acl2::y y-equiv) (partsum-elt-equiv (cons acl2::x acl2::y) (cons acl2::x y-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-partsum-elt-fix (equal (consp (partsum-elt-fix acl2::x)) (consp acl2::x)))
Theorem:
(defthm partsum-elt-fix-under-iff (iff (partsum-elt-fix acl2::x) (consp acl2::x)))
Theorem:
(defthm partsum-elt-fix-of-cons (equal (partsum-elt-fix (cons a x)) (cons (partsum-comp-fix a) (partsum-elt-fix x))))
Theorem:
(defthm len-of-partsum-elt-fix (equal (len (partsum-elt-fix acl2::x)) (len acl2::x)))
Theorem:
(defthm partsum-elt-fix-of-append (equal (partsum-elt-fix (append std::a std::b)) (append (partsum-elt-fix std::a) (partsum-elt-fix std::b))))
Theorem:
(defthm partsum-elt-fix-of-repeat (equal (partsum-elt-fix (repeat acl2::n acl2::x)) (repeat acl2::n (partsum-comp-fix acl2::x))))
Theorem:
(defthm list-equiv-refines-partsum-elt-equiv (implies (list-equiv acl2::x acl2::y) (partsum-elt-equiv acl2::x acl2::y)) :rule-classes :refinement)
Theorem:
(defthm nth-of-partsum-elt-fix (equal (nth acl2::n (partsum-elt-fix acl2::x)) (if (< (nfix acl2::n) (len acl2::x)) (partsum-comp-fix (nth acl2::n acl2::x)) nil)))
Theorem:
(defthm partsum-elt-equiv-implies-partsum-elt-equiv-append-1 (implies (partsum-elt-equiv acl2::x fty::x-equiv) (partsum-elt-equiv (append acl2::x acl2::y) (append fty::x-equiv acl2::y))) :rule-classes (:congruence))
Theorem:
(defthm partsum-elt-equiv-implies-partsum-elt-equiv-append-2 (implies (partsum-elt-equiv acl2::y fty::y-equiv) (partsum-elt-equiv (append acl2::x acl2::y) (append acl2::x fty::y-equiv))) :rule-classes (:congruence))
Theorem:
(defthm partsum-elt-equiv-implies-partsum-elt-equiv-nthcdr-2 (implies (partsum-elt-equiv acl2::l l-equiv) (partsum-elt-equiv (nthcdr acl2::n acl2::l) (nthcdr acl2::n l-equiv))) :rule-classes (:congruence))
Theorem:
(defthm partsum-elt-equiv-implies-partsum-elt-equiv-take-2 (implies (partsum-elt-equiv acl2::l l-equiv) (partsum-elt-equiv (take acl2::n acl2::l) (take acl2::n l-equiv))) :rule-classes (:congruence))