-
Notifications
You must be signed in to change notification settings - Fork 331
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
[Merged by Bors] - feat: more lemmas about List.dedup
and other lattice operations
#14282
Changes from all commits
9a9ca48
a1c93ed
105f1d2
cd7fb1e
6fbd2fb
0f985e4
d1bcfa9
3a10a05
e07e06d
880b343
271accf
6372dff
e5a59c8
fdbd259
d1662a5
179ad54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,6 +205,15 @@ theorem dedup_add (s t : Multiset α) : dedup (s + t) = ndunion s (dedup t) := | |
Quot.induction_on₂ s t fun _ _ => congr_arg ((↑) : List α → Multiset α) <| dedup_append _ _ | ||
#align multiset.dedup_add Multiset.dedup_add | ||
|
||
theorem Disjoint.ndunion_eq {s t : Multiset α} (h : Disjoint s t) : | ||
s.ndunion t = s.dedup + t := by | ||
induction s, t using Quot.induction_on₂ | ||
exact congr_arg ((↑) : List α → Multiset α) <| List.Disjoint.union_eq h | ||
|
||
theorem Subset.ndunion_eq_right {s t : Multiset α} (h : s ⊆ t) : s.ndunion t = t := by | ||
induction s, t using Quot.induction_on₂ | ||
exact congr_arg ((↑) : List α → Multiset α) <| List.Subset.union_eq_right h | ||
|
||
/-! ### finset inter -/ | ||
|
||
|
||
|
@@ -280,6 +289,12 @@ theorem ndinter_eq_zero_iff_disjoint {s t : Multiset α} : ndinter s t = 0 ↔ D | |
rw [← subset_zero]; simp [subset_iff, Disjoint] | ||
#align multiset.ndinter_eq_zero_iff_disjoint Multiset.ndinter_eq_zero_iff_disjoint | ||
|
||
alias ⟨_, Disjoint.ndinter_eq_zero⟩ := ndinter_eq_zero_iff_disjoint | ||
|
||
theorem Subset.ndinter_eq_left {s t : Multiset α} (h : s ⊆ t) : s.ndinter t = s := by | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, can we have the right verSion? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the right version is meaningfully true? What statement do you want? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah indeed. But then this lemma is something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It exists for |
||
induction s, t using Quot.induction_on₂ | ||
rw [quot_mk_to_coe'', quot_mk_to_coe'', coe_ndinter, List.Subset.inter_eq_left h] | ||
|
||
end Multiset | ||
|
||
-- Assert that we define `Finset` without the material on the set lattice. | ||
|
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.
@Timeroot had this lemma somewhere. Did it ever land? What is the PR?
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.
I assume we don't need to wait for an answer here? Of course, if @Timeroot comes along with a shorter proof after this is merged, we can always make a golf PR.