`(maybe-nat-list-fix x)` is a usual fty list fixing function.

- Signature
(maybe-nat-list-fix x) → fty::newx

- Arguments
`x`—Guard (maybe-nat-list-p x) .- Returns
`fty::newx`—Type (maybe-nat-list-p fty::newx) .

In the logic, we apply maybe-natp-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 maybe-nat-list-fix$inline (x) (declare (xargs :guard (maybe-nat-list-p x))) (let ((__function__ 'maybe-nat-list-fix)) (declare (ignorable __function__)) (mbe :logic (if (atom x) x (cons (maybe-natp-fix (car x)) (maybe-nat-list-fix (cdr x)))) :exec x)))

**Theorem: **

(defthm maybe-nat-list-p-of-maybe-nat-list-fix (b* ((fty::newx (maybe-nat-list-fix$inline x))) (maybe-nat-list-p fty::newx)) :rule-classes :rewrite)

**Theorem: **

(defthm maybe-nat-list-fix-when-maybe-nat-list-p (implies (maybe-nat-list-p x) (equal (maybe-nat-list-fix x) x)))

**Function: **

(defun maybe-nat-list-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (maybe-nat-list-p acl2::x) (maybe-nat-list-p acl2::y)))) (equal (maybe-nat-list-fix acl2::x) (maybe-nat-list-fix acl2::y)))

**Theorem: **

(defthm maybe-nat-list-equiv-is-an-equivalence (and (booleanp (maybe-nat-list-equiv x y)) (maybe-nat-list-equiv x x) (implies (maybe-nat-list-equiv x y) (maybe-nat-list-equiv y x)) (implies (and (maybe-nat-list-equiv x y) (maybe-nat-list-equiv y z)) (maybe-nat-list-equiv x z))) :rule-classes (:equivalence))

**Theorem: **

(defthm maybe-nat-list-equiv-implies-equal-maybe-nat-list-fix-1 (implies (maybe-nat-list-equiv acl2::x x-equiv) (equal (maybe-nat-list-fix acl2::x) (maybe-nat-list-fix x-equiv))) :rule-classes (:congruence))

**Theorem: **

(defthm maybe-nat-list-fix-under-maybe-nat-list-equiv (maybe-nat-list-equiv (maybe-nat-list-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))

**Theorem: **

(defthm equal-of-maybe-nat-list-fix-1-forward-to-maybe-nat-list-equiv (implies (equal (maybe-nat-list-fix acl2::x) acl2::y) (maybe-nat-list-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)

**Theorem: **

(defthm equal-of-maybe-nat-list-fix-2-forward-to-maybe-nat-list-equiv (implies (equal acl2::x (maybe-nat-list-fix acl2::y)) (maybe-nat-list-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)

**Theorem: **

(defthm maybe-nat-list-equiv-of-maybe-nat-list-fix-1-forward (implies (maybe-nat-list-equiv (maybe-nat-list-fix acl2::x) acl2::y) (maybe-nat-list-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)

**Theorem: **

(defthm maybe-nat-list-equiv-of-maybe-nat-list-fix-2-forward (implies (maybe-nat-list-equiv acl2::x (maybe-nat-list-fix acl2::y)) (maybe-nat-list-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)

**Theorem: **

(defthm car-of-maybe-nat-list-fix-x-under-maybe-nat-equiv (acl2::maybe-nat-equiv (car (maybe-nat-list-fix acl2::x)) (car acl2::x)))

**Theorem: **

(defthm car-maybe-nat-list-equiv-congruence-on-x-under-maybe-nat-equiv (implies (maybe-nat-list-equiv acl2::x x-equiv) (acl2::maybe-nat-equiv (car acl2::x) (car x-equiv))) :rule-classes :congruence)

**Theorem: **

(defthm cdr-of-maybe-nat-list-fix-x-under-maybe-nat-list-equiv (maybe-nat-list-equiv (cdr (maybe-nat-list-fix acl2::x)) (cdr acl2::x)))

**Theorem: **

(defthm cdr-maybe-nat-list-equiv-congruence-on-x-under-maybe-nat-list-equiv (implies (maybe-nat-list-equiv acl2::x x-equiv) (maybe-nat-list-equiv (cdr acl2::x) (cdr x-equiv))) :rule-classes :congruence)

**Theorem: **

(defthm cons-of-maybe-natp-fix-x-under-maybe-nat-list-equiv (maybe-nat-list-equiv (cons (maybe-natp-fix acl2::x) acl2::y) (cons acl2::x acl2::y)))

**Theorem: **

(defthm cons-maybe-nat-equiv-congruence-on-x-under-maybe-nat-list-equiv (implies (acl2::maybe-nat-equiv acl2::x x-equiv) (maybe-nat-list-equiv (cons acl2::x acl2::y) (cons x-equiv acl2::y))) :rule-classes :congruence)

**Theorem: **

(defthm cons-of-maybe-nat-list-fix-y-under-maybe-nat-list-equiv (maybe-nat-list-equiv (cons acl2::x (maybe-nat-list-fix acl2::y)) (cons acl2::x acl2::y)))

**Theorem: **

(defthm cons-maybe-nat-list-equiv-congruence-on-y-under-maybe-nat-list-equiv (implies (maybe-nat-list-equiv acl2::y y-equiv) (maybe-nat-list-equiv (cons acl2::x acl2::y) (cons acl2::x y-equiv))) :rule-classes :congruence)

**Theorem: **

(defthm consp-of-maybe-nat-list-fix (equal (consp (maybe-nat-list-fix acl2::x)) (consp acl2::x)))

**Theorem: **

(defthm maybe-nat-list-fix-of-cons (equal (maybe-nat-list-fix (cons a x)) (cons (maybe-natp-fix a) (maybe-nat-list-fix x))))

**Theorem: **

(defthm len-of-maybe-nat-list-fix (equal (len (maybe-nat-list-fix acl2::x)) (len acl2::x)))

**Theorem: **

(defthm maybe-nat-list-fix-of-append (equal (maybe-nat-list-fix (append std::a std::b)) (append (maybe-nat-list-fix std::a) (maybe-nat-list-fix std::b))))

**Theorem: **

(defthm maybe-nat-list-fix-of-repeat (equal (maybe-nat-list-fix (repeat acl2::n acl2::x)) (repeat acl2::n (maybe-natp-fix acl2::x))))

**Theorem: **

(defthm nth-of-maybe-nat-list-fix (equal (nth acl2::n (maybe-nat-list-fix acl2::x)) (if (< (nfix acl2::n) (len acl2::x)) (maybe-natp-fix (nth acl2::n acl2::x)) nil)))

**Theorem: **

(defthm maybe-nat-list-equiv-implies-maybe-nat-list-equiv-append-1 (implies (maybe-nat-list-equiv acl2::x fty::x-equiv) (maybe-nat-list-equiv (append acl2::x acl2::y) (append fty::x-equiv acl2::y))) :rule-classes (:congruence))

**Theorem: **

(defthm maybe-nat-list-equiv-implies-maybe-nat-list-equiv-append-2 (implies (maybe-nat-list-equiv acl2::y fty::y-equiv) (maybe-nat-list-equiv (append acl2::x acl2::y) (append acl2::x fty::y-equiv))) :rule-classes (:congruence))

**Theorem: **

(defthm maybe-nat-list-equiv-implies-maybe-nat-list-equiv-nthcdr-2 (implies (maybe-nat-list-equiv acl2::l l-equiv) (maybe-nat-list-equiv (nthcdr acl2::n acl2::l) (nthcdr acl2::n l-equiv))) :rule-classes (:congruence))

**Theorem: **

(defthm maybe-nat-list-equiv-implies-maybe-nat-list-equiv-take-2 (implies (maybe-nat-list-equiv acl2::l l-equiv) (maybe-nat-list-equiv (take acl2::n acl2::l) (take acl2::n l-equiv))) :rule-classes (:congruence))