Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need inverse of LemmaCardinalityOfSetNoDuplicates #18

Closed
robin-aws opened this issue Oct 1, 2021 · 1 comment · Fixed by #19 · May be fixed by #20
Closed

Need inverse of LemmaCardinalityOfSetNoDuplicates #18

robin-aws opened this issue Oct 1, 2021 · 1 comment · Fixed by #19 · May be fixed by #20
Assignees

Comments

@robin-aws
Copy link
Member

This lemma proves this implication:

  lemma LemmaCardinalityOfSetNoDuplicates<T>(s: seq<T>)
    requires HasNoDuplicates(s)
    ensures |ToSet(s)| == |s|

But the opposite implication would also be very useful:

  lemma LemmaNoDuplicatesCardinalityOfSet<T>(s: seq<T>)
    requires |ToSet(s)| == |s|
    ensures HasNoDuplicates(s)

Especially because |ToSet(s)| == |s| is much cheaper to evaluate at runtime than HasNoDuplicates(s) would be (if it was a compiled function method)

@gancherj
Copy link
Contributor

gancherj commented Oct 3, 2021

Created pull request. Please let me know if any style fixes are needed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants