-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MapThenSumSet and several theorems for it. (#99)
FiniteSetsExt!MapThenSumSet including and support TLAPS theorems. [Feature] Signed-off-by: Karolis Petrauskas <karolis.petrauskas@erisata.lt>
- Loading branch information
Showing
4 changed files
with
468 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
---- MODULE FiniteSetsExt_theorems ---- | ||
EXTENDS FiniteSetsExt, FiniteSets, Naturals | ||
|
||
LEMMA MapThenSumSetEmpty == | ||
ASSUME NEW op(_) | ||
PROVE MapThenSumSet(op, {}) = 0 | ||
PROOF OMITTED \* Proof in FiniteSetsExt_theorems_proofs.tla | ||
|
||
|
||
LEMMA MapThenSumSetType == | ||
ASSUME NEW S, IsFiniteSet(S), NEW op(_), \A e \in S : op(e) \in Nat | ||
PROVE MapThenSumSet(op, S) \in Nat | ||
PROOF OMITTED \* Proof in FiniteSetsExt_theorems_proofs.tla | ||
|
||
|
||
THEOREM MapThenSumSetAddElem == | ||
ASSUME | ||
NEW S, IsFiniteSet(S), | ||
NEW op(_), \A s \in S : op(s) \in Nat, | ||
NEW e, e \notin S, op(e) \in Nat | ||
PROVE MapThenSumSet(op, S \cup {e}) = MapThenSumSet(op, S) + op(e) | ||
PROOF OMITTED \* Proof in FiniteSetsExt_theorems_proofs.tla | ||
|
||
LEMMA MapThenSumSetRemElem == | ||
ASSUME | ||
NEW S, IsFiniteSet(S), | ||
NEW op(_), \A s \in S : op(s) \in Nat, | ||
NEW e \in S | ||
PROVE MapThenSumSet(op, S) = MapThenSumSet(op, S \ {e}) + op(e) | ||
PROOF OMITTED \* Proof in FiniteSetsExt_theorems_proofs.tla | ||
|
||
LEMMA MapThenSumSetMonotonic == | ||
ASSUME | ||
NEW S, IsFiniteSet(S), | ||
NEW op(_), \A s \in S : op(s) \in Nat, | ||
NEW e, e \notin S, op(e) \in Nat | ||
PROVE MapThenSumSet(op, S \cup {e}) >= MapThenSumSet(op, S) | ||
PROOF OMITTED \* Proof in FiniteSetsExt_theorems_proofs.tla | ||
|
||
LEMMA MapThenSumSetZero == | ||
ASSUME NEW S, IsFiniteSet(S), | ||
NEW op(_), \A e \in S: op(e) \in Nat, | ||
MapThenSumSet(op, S) = 0 | ||
PROVE \A e \in S: op(e) = 0 | ||
PROOF OMITTED \* Proof in FiniteSetsExt_theorems_proofs.tla | ||
|
||
LEMMA MapThenSumSetZeros == | ||
ASSUME NEW S, IsFiniteSet(S), | ||
NEW op(_), \A e \in S: op(e) = 0 | ||
PROVE MapThenSumSet(op, S) = 0 | ||
PROOF OMITTED \* Proof in FiniteSetsExt_theorems_proofs.tla | ||
|
||
==== |
Oops, something went wrong.