Check if a set of certificates is unequivocal.
That is, check whether the certificates in the set have unique combinations of author and round. We check that any two certificates in the set with the same author and round are in fact the same certificates. This means that the certificates in the set are uniquely identified by their author and round.
This is an invariant on DAGs, and in fact on all the certificates in the system, enforced by the protocol under suitable fault tolerance conditions. Here we formulate the invariant.
The rule
The theorem
The theorem
The previous theorem is used to prove
The previous theorem is used to prove
Theorem:
(defthm certificate-set-unequivocalp-necc (implies (not (if (and (in cert1 certs) (in cert2 certs) (equal (certificate->author cert1) (certificate->author cert2)) (equal (certificate->round cert1) (certificate->round cert2))) (if (equal cert1 cert2) t nil) t)) (not (certificate-set-unequivocalp certs))))
Theorem:
(defthm booleanp-of-certificate-set-unequivocalp (b* ((yes/no (certificate-set-unequivocalp certs))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm certificate-set-unequivocalp-when-subset (implies (and (certificate-set-unequivocalp certs) (subset certs0 certs)) (certificate-set-unequivocalp certs0)))
Theorem:
(defthm certificate-set-unequivocalp-when-emptyp (implies (emptyp certs) (certificate-set-unequivocalp certs)))
Theorem:
(defthm certificate-set-unequivocalp-of-insert (implies (certificate-setp certs) (equal (certificate-set-unequivocalp (insert cert certs)) (and (certificate-set-unequivocalp certs) (or (in cert certs) (not (certificate-with-author+round (certificate->author cert) (certificate->round cert) certs)))))))
Theorem:
(defthm equal-certificate-authors-when-unequiv-and-same-round (implies (and (certificate-set-unequivocalp certs) (<= (cardinality (certificate-set->round-set certs)) 1) (in cert1 certs) (in cert2 certs)) (equal (equal (certificate->author cert1) (certificate->author cert2)) (equal cert1 cert2))))
Theorem:
(defthm head-author-not-in-tail-authors-when-unequiv-and-all-same-round (implies (and (certificate-setp certs) (certificate-set-unequivocalp certs) (<= (cardinality (certificate-set->round-set certs)) 1) (not (emptyp certs))) (not (in (certificate->author (head certs)) (certificate-set->author-set (tail certs))))))
Theorem:
(defthm cardinality-of-authors-when-unequiv-and-all-same-rounds (implies (and (certificate-setp certs) (certificate-set-unequivocalp certs) (<= (cardinality (certificate-set->round-set certs)) 1)) (equal (cardinality (certificate-set->author-set certs)) (cardinality certs))))
Theorem:
(defthm cardinality-of-certificates-with-authors+round-when-subset (implies (and (certificate-setp certs) (certificate-set-unequivocalp certs) (subset (address-set-fix authors) (certificate-set->author-set (certificates-with-round round certs)))) (equal (cardinality (certificates-with-authors+round authors round certs)) (cardinality (address-set-fix authors)))))