feat(Data/Set): representing the equivalence classes of a Quot#21097
feat(Data/Set): representing the equivalence classes of a Quot#21097
Conversation
PR summary 19daea86d0Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
EtienneC30
left a comment
There was a problem hiding this comment.
Thank you for this! I left some suggestions for shortening / readability / mathlib-friendly.
Co-authored-by: Etienne <66847262+EtienneC30@users.noreply.github.com>
|
Adopted all suggestions by @EtienneC30, thanks! |
|
One last comment: after defining the structure, you use the variables |
Co-authored-by: Etienne <66847262+EtienneC30@users.noreply.github.com>
|
Thanks! |
|
🚀 Pull request has been placed on the maintainer queue by EtienneC30. |
Co-authored-by: Etienne <66847262+EtienneC30@users.noreply.github.com>
| /-- Convert an equivalence class to a `Set`. -/ | ||
| def Quot.toSet (c : Quot r) : Set α := {v | Quot.mk r v = c} | ||
|
|
||
| instance : SetLike (Quot r) α where |
There was a problem hiding this comment.
Can you add the other theorems that the module docstring for SetLike prescribes? For instance, that v ∈ c \iff Quot.mk r v = c?
There was a problem hiding this comment.
I added the mem and ext lemma's. If the copy lemma's also apply here I'm not really sure how to implement that, so if it does, I'd appreciate a pointer:)
There was a problem hiding this comment.
I think skipping copy is fine.
|
!bench |
Mathlib/Data/Set/Quot.lean
Outdated
| namespace Set | ||
|
|
||
| /-- A set represents a set of quotients if it contains exactly one element from each quotient. -/ | ||
| structure Represents (s : Set α) (C : Set (Quot r)) where |
There was a problem hiding this comment.
Is this the same as Set.BijOn Quot.mk s C?
There was a problem hiding this comment.
Yep. That seems very clean. I switched to that as the definition and proved the previous components as results
|
Here are the benchmark results for commit a5a94d1. |
|
…ib4 into PO_Quot_toSet
Co-authored-by: Eric Wieser <efw@google.com>
| /-- A set represents a set of quotients if it contains exactly one element from each quotient. -/ | ||
| def Represents (s : Set α) (C : Set (Quot r)) := Set.BijOn (Quot.mk r) s C | ||
|
|
||
| lemma out_image_represents (C : Set (Quot r)) : (Quot.out '' C).Represents C := |
There was a problem hiding this comment.
Is there a general result about BijOn and functions which satisfy mk (out x) = x (RightInverse) here?
| namespace Set | ||
|
|
||
| /-- A set represents a set of quotients if it contains exactly one element from each quotient. -/ | ||
| def Represents (s : Set α) (C : Set (Quot r)) := Set.BijOn (Quot.mk r) s C |
There was a problem hiding this comment.
| def Represents (s : Set α) (C : Set (Quot r)) := Set.BijOn (Quot.mk r) s C | |
| def Represents (s : Set α) (C : Set (Quot r)) : Prop := Set.BijOn (Quot.mk r) s C |
|
On hold, likely to be superseded by #20024 |
|
#20024 (the more specific version) was merged in favour of this one |
Adds the SetLike instance for Quot along with the notion of
Represents, which says that a Set represents a set of equivalence classes if it contains exactly one element of each class.This is the more generic version of #20024