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

[Merged by Bors] - feat(category_theory/groupoid/subgroupoid): subgroupoids and basic properties #16742

Closed
wants to merge 42 commits into from

Conversation

bottine
Copy link
Collaborator

@bottine bottine commented Oct 1, 2022

Add a definition of (bundled) subgroupoid and prove some of their basic properties.


Open in Gitpod

@bottine bottine added awaiting-review The author would like community review of the PR t-algebra Algebra (groups, rings, fields etc) labels Oct 1, 2022
Copy link
Collaborator

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for now; will continue tomorrow.

src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
@bottine
Copy link
Collaborator Author

bottine commented Oct 6, 2022

Thanks a lot! I corrected the stuff I was OK with and commented on the rest. I've also added a few definitions (mostly about how subgroupoid_le gives rise to morphisms of subgroupoid.coe and everything behaves well).

Copy link
Collaborator

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think I completed the review but I'll try to golf some proofs later.

src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Show resolved Hide resolved

/-- `S` is a subgroupoid of `T` if it is contained in it -/
def is_subgroupoid (S T : subgroupoid C) : Prop :=
∀ {c d}, S.arrws c d ⊆ T.arrws c d
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you automatically get (≤) and everything down to the partial order instance. Instead of intros c d p you would do rintro ⟨c, d, p⟩ (or λ ⟨c, d, p⟩) which is almost as convenient as it's now. You can't write p ∈ S but should be able to write ⟨_, _, p⟩ ∈ S, and you may def mk {c d} (p : c ⟶ d) : Σ c d, c ⟶ d := ⟨c, d, p⟩ (or declare a notation) so that you can write mk p ∈ S. (A notation is better since mk isn't a good name, and sigma_hom_mk is too long ...)

@bottine
Copy link
Collaborator Author

bottine commented Oct 6, 2022

Wow, thanks for all these suggestions! I will look at everything in detail tomorrow, but in the meantime:

  • Re. eq_to_hom, I was actually just a bit scared of using it, but changed it already in my dirty branch here and forgot to bring the changes here too. It's indeed way better.
  • Is there a way to accept all the suggestions in one go?

@alreadydone
Copy link
Collaborator

alreadydone commented Oct 6, 2022

Is there a way to accept all the suggestions in one go?

image

You should see an "add suggestion to batch" button, and you may commit them together.

bottine and others added 2 commits October 7, 2022 05:11
@alreadydone
Copy link
Collaborator

Hi @bottine I've simplified some proofs over in my fork and pointed out most notable changes as comments here. Notice that I haven't merged your latest commit. Mostly I golf the proofs by simplifying just enough for defeq to work. I'm unable to prove map is a subgroupoid without using map.mem_arrows_iff, but I only need to use it once.

@alreadydone: OK, corrected following your requests/proposals! I was reluctant to drop the .coe because it's the "canonical" name as far as I'm aware, but anyway.

Well, after some more thought, I want to push back against removing .objs : Now, if S is a subgroupoid, and say I want to say that S is disconnected as a groupoid, it's going to look like S.objs.is_disconnected which just looks like it shouldn't even typecheck.
What's the point of getting rid of .coe ?

By analogy with simple_graph.subgraph.coe, it's coe_subgroupoid that should be called coe. If you have groupoid.is_disconnected you should be able to write S.coe_subgroupoid.is_disconnected without problem.

src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
Copy link
Collaborator

@alreadydone alreadydone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some final edits and then it's ready to go!

src/category_theory/groupoid/vertex_group.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
Comment on lines 137 to 141
@[simp] lemma mem_iff (S : subgroupoid C) (F : Σ c d, c ⟶ d) :
F ∈ S ↔ F.2.2 ∈ S.arrows F.1 F.2.1 := iff.rfl

@[simp] lemma le_iff (S T : subgroupoid C) : (S ≤ T) ↔ (∀ {c d}, (S.arrows c d) ⊆ (T.arrows c d)) :=
by { rw [set_like.le_def, sigma.forall], exact forall_congr (λ c, sigma.forall) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually lemmas that unfold definitions like mem_iff usually shouldn't be simp lemmas. For le_iff, it's not clear the RHS is simpler than the LHS, so I suggest removing the @[simp] as well.

src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/subgroupoid.lean Outdated Show resolved Hide resolved
src/category_theory/groupoid/vertex_group.lean Outdated Show resolved Hide resolved
bottine and others added 6 commits October 14, 2022 05:25
Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
@bottine
Copy link
Collaborator Author

bottine commented Oct 14, 2022

OK, applied your suggestions. Thanks a lot!

@alreadydone
Copy link
Collaborator

Thanks!

maintainer merge

(or delegate and wait for CI, but note that queue is empty now)

@github-actions
Copy link

🚀 Pull request has been placed on the maintainer queue by alreadydone.

@semorrison
Copy link
Collaborator

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Oct 14, 2022
bors bot pushed a commit that referenced this pull request Oct 14, 2022
…operties (#16742)

Add a definition of (bundled) subgroupoid and prove some of their basic properties.



Co-authored-by: Rémi Bottinelli <remi.bottinelli@bluewin.ch>
Co-authored-by: bottine <bottine@users.noreply.github.com>
@bors
Copy link

bors bot commented Oct 14, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(category_theory/groupoid/subgroupoid): subgroupoids and basic properties [Merged by Bors] - feat(category_theory/groupoid/subgroupoid): subgroupoids and basic properties Oct 14, 2022
@bors bors bot closed this Oct 14, 2022
@bors bors bot deleted the bottine/subgroupoid branch October 14, 2022 08:49
@eric-wieser eric-wieser added the hacktoberfest-accepted Without this label hacktoberfest is scared off by bors label Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Without this label hacktoberfest is scared off by bors ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants