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 that applies to the DAGs in the system. Here we just define the predicate.
The rule
The theorem
The theorem
The previous theorem is used to prove
The previous theorem is used to prove
The theorem
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-of-nil (certificate-set-unequivocalp nil))
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-of-insert (implies (certificate-setp certs) (equal (certificate-set-unequivocalp (insert cert certs)) (and (certificate-set-unequivocalp certs) (or (in cert certs) (not (cert-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-certs-with-authors+round-when-subset (implies (and (certificate-setp certs) (certificate-set-unequivocalp certs) (subset (address-set-fix authors) (certificate-set->author-set (certs-with-round round certs)))) (equal (cardinality (certs-with-authors+round authors round certs)) (cardinality (address-set-fix authors)))))
Theorem:
(defthm certs-same-round-unequiv-intersect-when-authors-intersect (implies (and (certificate-setp certs1) (certificate-setp certs2) (certificate-set-unequivocalp (union certs1 certs2)) (<= (cardinality (certificate-set->round-set (union certs1 certs2))) 1) (not (emptyp (intersect (certificate-set->author-set certs1) (certificate-set->author-set certs2))))) (not (emptyp (intersect certs1 certs2)))))