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
feat(order/category/DecLinOrder): updates to concrete_category, and instances for order categories #1438
Conversation
Compile fails. I'll resolve actual conflicts later.
For some reason, it helps Lean find coercions from `Ring` category morphisms to functions.
…into concrete-categories
… into DecLinOrder
Yes, I'll have a look at the summary. I'm doing some experiments on making |
Okay, @urkud and @jcommelin, one more change (sorry this has been a constantly evolving PR...) We now only mark bundled types as |
@@ -26,19 +26,21 @@ section induced | |||
|
|||
-/ | |||
|
|||
variables {C : Type u₁} {D : Type u₂} [𝒟 : category.{v} D] | |||
variables {C : Type u₁} (D : Type u₂) [𝒟 : category.{v} D] |
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'm surprised you want to make D
an explicit argument. Shouldn't it normally be inferable from F
? Are there specific places where this change is needed?
open category_theory | ||
|
||
/-- The category of preorders and monotone maps. -/ | ||
@[reducible] |
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.
Are the categories defined in this file intended to be permanently [reducible]
? I'm not really sure what the ramifications are here, but this PR does go to the trouble of making a bunch of other categories not [reducible]
...
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.
No, this was just an oversight. After the discussion of Zulip I’m now second guessing this whole local attribute [reducible]
business. In particular I’m worried that it may be contributing to the problems in CommRing/adjunction.lean
.
@comm_semiring.to_comm_monoid | ||
(λ R₁ R₂ f, f.to_monoid_hom) | ||
(by intros; refl) | ||
has_forget₂.mk' |
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.
Was there any particular reason to change this one and the next, but not the one above?
-- The next two definitions are (unfortunate) "implementation details", helping the elaborator / typeclass search. | ||
|
||
/-- Version of `mv_polynomial.hom_equiv` for bundled commutative rings. -/ | ||
def hom_equiv (X : Type u) (R : CommRing) : (mv_polynomial X ℤ →+* R) ≃ (X → R) := hom_equiv R X |
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 clearly indicates that something is wrong. Do you understand the error in adj
that occurs without this definition?
I spent a while tracking down the cause of the failures in
|
Note to self: reopen #1439 if/when this gets merged. |
@rwbarton Thanks for this investigation! Sounds good. I hope that it works. |
… not [reducible] Adapted from part of #1438.
This PR became awkwardly large, so I've re-PRed the core bit as #1491; once that lands we should be able to split this into small, easy independent pieces. |
I'm going to close this in the meantime to reduce clutter. (I'm also not really sure there's anything worth salvaging post #1491.) |
… not [reducible] (#1491) * refactor(category_theory,algebra/category): make algebraic categories not [reducible] Adapted from part of #1438. * Update src/algebra/category/CommRing/basic.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * adding missing forget2 instances * Converting Reid's comment to a [Note] * adding examples testing coercions
Except for the actual content on |
…1588) * refactor(category_theory,algebra/category): make algebraic categories not [reducible] Adapted from part of #1438. * Update src/algebra/category/CommRing/basic.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * adding missing forget2 instances * Converting Reid's comment to a [Note] * adding examples testing coercions * chore(algebra/category/*/colimits): remove unnecessary projections
…isos (#1587) * refactor(category_theory,algebra/category): make algebraic categories not [reducible] Adapted from part of #1438. * Update src/algebra/category/CommRing/basic.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * adding missing forget2 instances * Converting Reid's comment to a [Note] * adding examples testing coercions * feat(data/equiv/algebra): equivalence of algebraic equivalences and categorical isomorphisms * more @[simps] * more @[simps]
… not [reducible] (leanprover-community#1491) * refactor(category_theory,algebra/category): make algebraic categories not [reducible] Adapted from part of leanprover-community#1438. * Update src/algebra/category/CommRing/basic.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * adding missing forget2 instances * Converting Reid's comment to a [Note] * adding examples testing coercions
…eanprover-community#1588) * refactor(category_theory,algebra/category): make algebraic categories not [reducible] Adapted from part of leanprover-community#1438. * Update src/algebra/category/CommRing/basic.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * adding missing forget2 instances * Converting Reid's comment to a [Note] * adding examples testing coercions * chore(algebra/category/*/colimits): remove unnecessary projections
…isos (leanprover-community#1587) * refactor(category_theory,algebra/category): make algebraic categories not [reducible] Adapted from part of leanprover-community#1438. * Update src/algebra/category/CommRing/basic.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * adding missing forget2 instances * Converting Reid's comment to a [Note] * adding examples testing coercions * feat(data/equiv/algebra): equivalence of algebraic equivalences and categorical isomorphisms * more @[simps] * more @[simps]
…isos (leanprover-community#1587) * refactor(category_theory,algebra/category): make algebraic categories not [reducible] Adapted from part of leanprover-community#1438. * Update src/algebra/category/CommRing/basic.lean Co-Authored-By: Scott Morrison <scott@tqft.net> * adding missing forget2 instances * Converting Reid's comment to a [Note] * adding examples testing coercions * feat(data/equiv/algebra): equivalence of algebraic equivalences and categorical isomorphisms * more @[simps] * more @[simps]
This is stacked on top of @urkud's #1380, refactoring concrete categories.
The only additional commit beyond that is 0107097.
I wanted to test that refactor out, by adding the categories
Preorder
,PartialOrder
,LinOrder
,DecLinOrder
, as an experiment with a (slightly) deep algebraic hierarchy.I did end up making one substantive change to Yury's work on concrete categories, in particular there are now two main sources of
has_coe_to_sort
instances. As well aswe have
Using this, I've switch to defining many concrete categories directly via
induced_category
, rather than providing additionalbundled_hom
instances. (A small change here -- I made the "origin category" argument ofinduced_category
explicit, as it's very often useful to be able to give it by hand.)There is also the more general
which would work too, but because it applies to any type is too expensive to have as a global instance.
Defining
DecLinOrder
worked very smoothly! I've also tweaked all the constructions of concrete categories.