fix(category_theory/opposites): make op irreducible#510
fix(category_theory/opposites): make op irreducible#510kim-em wants to merge 2 commits intoleanprover-community:masterfrom
op irreducible#510Conversation
adbd17c to
9ce7be9
Compare
|
I did some renaming per @jcommelin's suggestions, making things slightly less ugly. |
|
This looks generally clearer. Another op-tion is the Haskell-style structure op_cat (C : Type u₁) : Type u₁ := op :: (unop : C)which will make C and its opposite category distinct things in the kernel as well as in the elaborator. I'm not sure whether that is a good thing or a bad thing though. |
|
The choice might affect the pretty-printer for example--Lean just asked me for a |
41f2067 to
1f576ce
Compare
jcommelin
left a comment
There was a problem hiding this comment.
Looks good to me! Let's get this merged.
fa6d776 to
c69f526
Compare
c69f526 to
f4002b9
Compare
|
@digama0 Is there anything controversial left in this PR? (Note that the title is now misleading... see the latest commit.) |
| (op g) ≫ (op f) = op (f ≫ g) := rfl | ||
| @[simp] lemma comp_unop {X Y Z : Cᵒᵖ} (f : X ⟶ Y) (g : Y ⟶ Z) : | ||
| unop (f ≫ g) = (unop g) ≫ (unop f) := rfl | ||
|
|
There was a problem hiding this comment.
One of these simp lemmas seems to be backwards, though I'm not sure which one. There are three with op or unop applied to an identity or composition on the left hand side, but presumably there should be an even number of them...
| @[simp] lemma op_unop {X Y : C} (f : X ⟶ Y) : f.op.unop = f := rfl | ||
| @[simp] lemma unop_op {X Y : Cᵒᵖ} (f : X ⟶ Y) : f.unop.op = f := rfl | ||
|
|
||
| attribute [irreducible] op unop |
There was a problem hiding this comment.
I don't think it can be correct to set these here and then locally mark them as semireducible in other files.
|
I'd like to continue to advocate for using irreducible type synonyms for both the objects and the morphisms of the opposite category. In outline:
Concretely, I suggest 89379bc, which is basically a cleaned-up implementation of the original version of this PR. Of note:
I was originally intending to also prepare a version which uses a structure in place of the irreducible type synonym, but in view of the complications which arose already with the |
|
Okay, go ahead. Get this PR working or make a replacement and I'll merge it. |
|
@rwbarton Thanks a lot for this thorough review of the options! I'm glad we're converging towards a solution. |
|
+1
…On Fri, Jan 25, 2019, 11:11 AM Johan Commelin ***@***.*** wrote:
@rwbarton <https://github.com/rwbarton> Thanks a lot for this thorough
review of the options! I'm glad we're converging towards a solution.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#510 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAdLBGl2ssCnxBlQ6AI09F0JGOGahQTYks5vG1bTgaJpZM4ZAdED>
.
|
|
New PR at #627. It contains only the minimum changes to |
|
@ReidBarton, sorry I've been slow here. I'm at conferences this week and
next (and am trying to put in a grant application), so it's unlikely I'll
get to this for two weeks. If you'd like to keep moving on this, that would
be wonderful, and much appreciated.
…On Tue, Jan 29, 2019 at 6:25 AM Reid Barton ***@***.***> wrote:
@semorrison <https://github.com/semorrison>, would you like me to make
new PRs for the parts of this not covered by #627
<#627> and #633
<#633>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#510 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAdLBAkITLBiHsouPh3nMteLU1LWIFacks5vIFnfgaJpZM4ZAdED>
.
|
|
I'm closing this; everything has been divided up into smaller PRs. |
This makes it harder to accidentally (... or intentionally!) move back and forth between a category and its opposite.
Unfortunately, broken proofs were too hard to diagnose, when the wrong (opposite) category was inferred.
This commit also adds constructions in
equivalence.leanshowing that the functorsop_hom : (C ⥤ D)ᵒᵖ ⥤ (Cᵒᵖ ⥤ Dᵒᵖ)andop_inv : (Cᵒᵖ ⥤ Dᵒᵖ) ⥤ (C ⥤ D)ᵒᵖform an equivalence.