-
Notifications
You must be signed in to change notification settings - Fork 362
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(CategoryTheory): define unbundled ConcreteCategory
class
#20810
Conversation
PR summary 5f65e81a6bImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
They are specified that order, to avoid unnecessary universe annotations. | ||
-/ | ||
class ConcreteCategory (C : Type u) [Category.{v} C] | ||
(FC : outParam <| C → C → Type*) {CC : outParam <| C → Type w} |
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 noticed that CC
can always be inferred through unification in the FunLike
instance. So for conciseness I made it implicit. I was not expecting that to be possible!
/-- `ToType X` converts the object `X` of the concrete category `C` to a type. | ||
This is an `abbrev` so that instances on `X` (e.g. `Ring`) do not need to be redeclared. | ||
-/ | ||
abbrev ToType [ConcreteCategory C FC] := CC | ||
|
||
/-- `ToHom X Y` is the type of (bundled) functions between objects `X Y : C`. | ||
This is an `abbrev` so that instances (e.g. `RingHomClass`) do not need to be redeclared. | ||
-/ | ||
abbrev ToHom [ConcreteCategory C FC] := FC |
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.
We could also leave out ToType
and ToHom
and write CC
/FC
everywhere. I think this is neater, making things look like coercions. By defining this as abbrev
, we don't commit (on the elaboration/tactic side) to a specific notation.
hom_bijective.injective | ||
|
||
/-- In any concrete category, we can test equality of morphisms by pointwise evaluations. -/ | ||
@[ext] lemma ext {X Y : C} {f g : X ⟶ Y} (h : hom f = hom g) : f = g := |
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 is a replacement for hom_ext
, that currently is defined in terms of HasForget
. (Similarly for congr_fun
, congr_arg
, hom_id
and hom_comp
below.) Since we have no ConcreteCategory
instances yet, we'll unfortunately need to keep both spellings for a while. At some point we'll also have to decide which name is nicer :)
This PR/issue depends on: |
This is a step towards a concrete category redesign, as outlined in this Zulip post: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign/near/493903980 This PR defines a new class `ConcreteCategory` that unbundles the coercion of morphisms to functions and objects to types, in order to allow `ConcreteCategory` to coexist alongisde existing coercions to functions/sorts. No instances are included yet, since those can be declared in parallel. See e.g. `CommRingCat` on the `redesign-ConcreteCategory` branch for examples of what a concrete category instance will end up looking like.
7b4be55
to
dff99eb
Compare
Co-authored-by: Matthew Robert Ballard <[email protected]>
bors merge |
This is a step towards a concrete category redesign, as outlined in this Zulip post: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign/near/493903980 This PR defines a new class `ConcreteCategory` that unbundles the coercion of morphisms to functions and objects to types, in order to allow `ConcreteCategory` to coexist alongisde existing coercions to functions/sorts. No instances are included yet, since those can be declared in parallel. See e.g. `CommRingCat` on the `redesign-ConcreteCategory` branch for examples of what a concrete category instance will end up looking like. Co-authored-by: Anne Baanen <[email protected]>
Pull request successfully merged into master. Build succeeded: |
ConcreteCategory
class ConcreteCategory
class
This is a step towards a concrete category redesign, as outlined in this Zulip post: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign/near/493903980
This PR defines a new class
ConcreteCategory
that unbundles the coercion of morphisms to functions and objects to types, in order to allowConcreteCategory
to coexist alongisde existing coercions to functions/sorts. No instances are included yet, since those can be declared in parallel. See e.g.CommRingCat
on theredesign-ConcreteCategory
branch for examples of what a concrete category instance will end up looking like.ConcreteCategory
toHasForget
#20809