Definition of the invariant: every pair in the endorsed set of a correct validator does not have the validator's address.
We express this by saying that retrieving, from the set of endorsed pairs of a validator, the ones with the validator's address yields the empty set.
Theorem:
(defthm no-self-endorsed-p-necc (implies (no-self-endorsed-p systate) (implies (in val (correct-addresses systate)) (equal (address+pos-pairs-with-address val (validator-state->endorsed (get-validator-state val systate))) nil))))
Theorem:
(defthm booleanp-of-no-self-endorsed-p (b* ((yes/no (no-self-endorsed-p systate))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm no-self-endorsed-p-of-system-state-fix-systate (equal (no-self-endorsed-p (system-state-fix systate)) (no-self-endorsed-p systate)))
Theorem:
(defthm no-self-endorsed-p-system-state-equiv-congruence-on-systate (implies (system-state-equiv systate systate-equiv) (equal (no-self-endorsed-p systate) (no-self-endorsed-p systate-equiv))) :rule-classes :congruence)
Theorem:
(defthm no-self-endorsed-p-necc-fixing (implies (and (no-self-endorsed-p systate) (in (address-fix val) (correct-addresses systate))) (equal (address+pos-pairs-with-address val (validator-state->endorsed (get-validator-state val systate))) nil)))