-
Notifications
You must be signed in to change notification settings - Fork 700
feat: add difference on DHashMap/HashMap/HashSet
#11212
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
base: master
Are you sure you want to change the base?
Conversation
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
TwoFX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lemma statements about diff look good! Don't forget to use the SDiff notation as the normal form once you implement the definition on the user-facing types.
DHashMap/HashMap/HashSet [Work in progress]DHashMap/HashMap/HashSet
TwoFX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly looking good now.
| case h_2 => rfl | ||
| exact dl₁ | ||
|
|
||
| theorem getValueCast?_filter_contains_eq_false [BEq α] [LawfulBEq α] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no false in the theorem statement, then there should be no false in the name. This lemma should be called getValueCast?_filter_not_contains. The same applies to many other lemmas in this file.
| {l₁ l₂ : List ((a : α) × β a)} {k : α} | ||
| (dl₁ : DistinctKeys l₁) : | ||
| getKey? k (List.filter (fun p => !List.contains (l₂.map Sigma.fst) p.fst) l₁) = | ||
| if containsKey k l₂ = true then none else getKey? k l₁ := by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if containsKey k l₂ = true then none else getKey? k l₁ := by | |
| if containsKey k l₂ = true then none else getKey? k l₁ := by |
This PR adds support for difference operation for
DHashMap/HashMap/HashSetand proves several lemmas about it.