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): simplify groupoid.inv to category_theory.inv #16624

Closed
wants to merge 4 commits into from

Conversation

alreadydone
Copy link
Collaborator

@alreadydone alreadydone commented Sep 25, 2022

Add simp lemma groupoid.inv_eq_inv to simplify groupoid.inv to category_theory.inv (which uses the is_iso instance) to gain access to the developed API around category_theory.inv. This isn't a defeq though so I can imagine sometimes we may want to simp [-groupoid.inv_eq_inv], but most of the times this simp lemma makes things smoother.


Allows to solve the following lemmas needed for #16611 by simp:

@[simp] lemma groupoid.inv_id  [G : groupoid.{v} C] (X : C) :
  G.inv (𝟙 X) = 𝟙 X := by simp

@[simp] lemma groupoid.inv_of_comp  [G : groupoid.{v} C]
  {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : G.inv (f ≫ g) = (G.inv g) ≫ (G.inv f) := by simp

@[simp] lemma groupoid.inv_inv  [G : groupoid.{v} C] (X Y : C) (f : X ⟶ Y) :
  G.inv (G.inv f) = f := by simp

@[simp]
lemma groupoid.functor_map_inv  [G : groupoid.{v} C] {D : Type u₂} [H : groupoid.{v₂} D]
  (φ : C ⥤ D) {c d : C} (f : c ⟶ d) :
  φ.map (G.inv f) = H.inv (φ.map f) := by simp

Open in Gitpod

@alreadydone alreadydone added RFC Request for comment easy < 20s of review time. See the lifecycle page for guidelines. awaiting-review The author would like community review of the PR awaiting-CI The author would like to see what CI has to say before doing more work. labels Sep 25, 2022
@alreadydone alreadydone added t-category-theory Category theory and removed RFC Request for comment awaiting-CI The author would like to see what CI has to say before doing more work. labels Sep 25, 2022
⟨⟨groupoid.inv f, groupoid.comp_inv f, groupoid.inv_comp f⟩⟩

@[simp] lemma groupoid.inv_eq_inv (f : X ⟶ Y) : groupoid.inv f = inv f :=
is_iso.eq_inv_of_hom_inv_id $ groupoid.comp_inv f
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rwbarton, @semorrison, or @dwarn: This seems like a reasonable simp normal form to me, but I'd like to run this design decision by at least one of you.

@kmill kmill removed the easy < 20s of review time. See the lifecycle page for guidelines. label Sep 28, 2022
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

I suggest that we try this out. If it causes trouble, we remove it from the simp set.

bors merge

@leanprover-community-bot-assistant leanprover-community-bot-assistant 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 Sep 30, 2022
bors bot pushed a commit that referenced this pull request Sep 30, 2022
…ory.inv (#16624)

Add simp lemma `groupoid.inv_eq_inv` to simplify `groupoid.inv` to `category_theory.inv` (which uses the `is_iso` instance) to gain access to the developed API around `category_theory.inv`. This isn't a defeq though so I can imagine sometimes we may want to `simp [-groupoid.inv_eq_inv]`, but most of the times this simp lemma makes things smoother.
@bors
Copy link

bors bot commented Sep 30, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(category_theory/groupoid): simplify groupoid.inv to category_theory.inv [Merged by Bors] - feat(category_theory/groupoid): simplify groupoid.inv to category_theory.inv Sep 30, 2022
@bors bors bot closed this Sep 30, 2022
@bors bors bot deleted the groupoid_inv branch September 30, 2022 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-category-theory Category theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants