-
Notifications
You must be signed in to change notification settings - Fork 298
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(data/*set): some finite sets lemmas #7037
Conversation
src/logic/embedding.lean
Outdated
@@ -34,6 +34,16 @@ end function | |||
protected def equiv.to_embedding {α : Sort u} {β : Sort v} (f : α ≃ β) : α ↪ β := | |||
⟨f, f.injective⟩ | |||
|
|||
/-- Given an equivalence to a coerced set `↥s`, produce an embedding to the elements of that set. -/ | |||
@[simps] | |||
def equiv.as_embedding {α β : Sort*} {s : set β} (e : α ≃ ↥s) : α ↪ β := |
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 name is a little similar to equiv.to_embedding
.
Also, perhaps we should generalize ↥s
to subtype p
.
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.
That is,
/-- Given an equivalence to a subtype, produce an embedding to the elements of enclosing type. -/
@[simps]
def equiv.embedding_of_subtype {α β : Type*} {p : β → Prop} (e : α ≃ subtype p) : α ↪ β :=
e.to_embedding.trans $ function.embedding.subtype p
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 know the name is similar, but I don't have a better idea. equiv.to_embedding
has the right to use this name, and I didn't want to use a very long name. Suggestions are welcome.
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.
You're not a fan of the name equiv.embedding_of_subtype
then?
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.
It should be embedding_of_equiv_subtype
then, right? I think equiv.as_embbeding
is fine.
Also, sorry for kicking this on the queue. I missed that this conversation hadn't come to a conclusion yet.
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 figured the word equiv
was redundant, hence dropping it from embedding_of_equiv_subtype
.
Getting subtype
in the name will probably make this more discoverable.
Following an idea by Eric
53bdf09
to
967581e
Compare
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.
Thanks 🎉
bors merge
bors r- (Still a conversation ongoing.) |
Canceled. |
/-- Given an equivalence to a subtype, produce an embedding to the elements of the corresponding | ||
set. -/ | ||
@[simps] | ||
def equiv.as_embedding {α β : Sort*} {p : β → Prop} (e : α ≃ subtype p) : α ↪ β := | ||
⟨coe ∘ e, subtype.coe_injective.comp e.injective⟩ |
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.
Github marked #7037 (comment) as outdated, which discusses this name.
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.
Unrelated to the name conversation, we have some API to construct this:
/-- Given an equivalence to a subtype, produce an embedding to the elements of the corresponding | |
set. -/ | |
@[simps] | |
def equiv.as_embedding {α β : Sort*} {p : β → Prop} (e : α ≃ subtype p) : α ↪ β := | |
⟨coe ∘ e, subtype.coe_injective.comp e.injective⟩ | |
/-- Given an equivalence to a subtype, produce an embedding to the elements of the corresponding | |
set. -/ | |
@[simps] | |
def equiv.as_embedding {α β : Sort*} {p : β → Prop} (e : α ≃ subtype p) : α ↪ β := | |
e.to_embedding.trans $ function.embedding.subtype p |
which may or may not break the proof below.
I think it would be much faster if @eric-wieser could directly push to this branch. I really don't care at all, I simply want this in order to do interesting linear algebra with them. Any variation will be good enough for me. |
I didn't want to tread on your toes, and was waiting for a second opinion on the name. @jcommelin, if you pick a name I'll happily push to the branch |
I understand the benefit of having |
Thanks 🎉 bors merge |
Co-authored-by: Bhavik Mehta, Kevin Buzzard, Anne Baanen, Eric Rodriguez
Build failed (retrying...): |
Co-authored-by: Bhavik Mehta, Kevin Buzzard, Anne Baanen, Eric Rodriguez
Pull request successfully merged into master. Build succeeded: |
Co-authored-by: Bhavik Mehta, Kevin Buzzard, Anne Baanen, Eric Rodriguez
See Zulip at https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/maximal.20independent.20family and
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/finite.20stuff