Conversation
PR summary 4f13c899e4
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.CategoryTheory.Limits.Shapes.Preorder.Basic | 408 | 413 | +5 (+1.23%) |
Import changes for all files
| Files | Import difference |
|---|---|
Mathlib.CategoryTheory.Limits.Shapes.Preorder.Basic |
5 |
Mathlib.CategoryTheory.Limits.Preorder (new file) |
412 |
Mathlib.CategoryTheory.ChosenFiniteProducts.InfSemilattice (new file) |
578 |
Declarations diff
+ instance : HasInitial C := hasInitial_of_unique ⊥
+ instance : HasTerminal C := hasTerminal_of_unique ⊤
+ isColimitBinaryCofan
+ isLimitBinaryFan
+ isTerminalTop
+ tensorObj
+ tensorUnit
- instance : HasInitial J := hasInitial_of_unique ⊥
- instance : HasTerminal J := hasTerminal_of_unique ⊤
- isTerminalBot
You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for script/declarations_diff.sh contains some details about this script.
No changes to technical debt.
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
| end | ||
|
|
||
| /-- Chosen finite products for the preorder category of a meet-semilattice with a greatest element-/ | ||
| noncomputable instance : ChosenFiniteProducts C where |
There was a problem hiding this comment.
I am not sure we should make this an instance. It may be safer to make it a local or scoped instance.
There was a problem hiding this comment.
made it scoped in the namespace CategoryTheory.SemilatticeInf.
| abbrev chosenTerminal : C := ⊤ | ||
|
|
||
| /-- The chosen terminal object in the preoder category of `C` is terminal. -/ | ||
| def chosenTerminalIsTerminal : IsTerminal (chosenTerminal C) where |
There was a problem hiding this comment.
This already appears in the file CategoryTheory.Limits.Shapes.Preorder.Basic since #20335.
I would suggest you create a new file/directory CategoryTheory.Limits.Preorder where you would put results about colimits in a preordered type. There, you could move my definitions isInitialBot, isTerminalTop, HasInitial, HasTerminal (and keep the rest in Shapes.Preorder.Basic which is about the existence of (co)limits indexed by a preordered type).
In CategoryTheory.Limits.Preorder, you could add results about max, min (and more...) as definitions saying that certain (co)cones are (co)limits.
Then, in CategoryTheory.ChosenFiniteProducts.SemiLatticeInf, you could define chosen finite products out of these definitions.
There was a problem hiding this comment.
sounds like a good idea! just did that.
| def isLimit : IsLimit (BinaryFan.mk (fst X Y) (snd X Y)) where | ||
| lift s := homOfLE <| le_inf (leOfHom <| s.π.app <| | ||
| ⟨WalkingPair.left⟩) (leOfHom <| s.π.app <| ⟨WalkingPair.right⟩) |
There was a problem hiding this comment.
I do not think we need the separate definitions chosenProd, fst and snd:
def isLimitBinaryFan :
IsLimit (BinaryFan.mk (P := X ⊓ Y) (homOfLE inf_le_left) (homOfLE inf_le_right)) :=
BinaryFan.isLimitMk (fun s ↦ homOfLE (le_inf (leOfHom s.fst) (leOfHom s.snd)))
(by intros; rfl) (by intros; rfl) (by intros; rfl)There was a problem hiding this comment.
I also removed chosenTerminal, etc and imported stuff from Limits.Preorder. All that is left is
noncomputable scoped instance chosenFiniteProducts : ChosenFiniteProducts C where
terminal := ⟨_, Preorder.isTerminalTop C⟩
product X Y := ⟨_, Preorder.isLimitBinaryFan X Y⟩
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
| lemma tensorObj {C : Type u} [Lattice C] [OrderTop C] {X Y : C} : X ⊗ Y = X ⊓ Y := rfl | ||
|
|
||
| lemma tensorUnit {C : Type u} [Lattice C] [OrderTop C] : |
There was a problem hiding this comment.
Do not you want to assume SemilatticeInf instead of Lattice?
There was a problem hiding this comment.
🤦 indeed, thanks for spotting that! just fixed it!
Incidentally, it seems we do not have ChosenFiniteCoProducts in Mathlib, and I was wondering why that is? would it be worth it to add it and then prove join-semilattices have a monoidal structure. This is not directly relevant to the project about distributive categories, but maybe in a separate branch/PR it can be done if you think it'd be useful. If at some point in future one wants to define rig-categories (i.e. distributive bimonoidal) then we need both conoidal structures coming from meet and join to show that distributive lattices are example of rig-categories.
There was a problem hiding this comment.
At this stage, I do not think it is necessary to develop ChosenFiniteCoproducts.
| /-- A monoidal structure on the preorder category of a meet-semilattice with a greatest element | ||
| is provided by the instance `monoidalOfChosenFiniteProducts`. -/ | ||
| noncomputable scoped instance monoidalCategory : MonoidalCategory C := by | ||
| infer_instance | ||
|
|
||
| /-- The symmetric monoidal structure on the preorder category of a | ||
| meet-semilattice with a greatest element. -/ | ||
| noncomputable scoped instance symmetricCategory : SymmetricCategory C := by | ||
| infer_instance | ||
|
|
There was a problem hiding this comment.
There is no need to declare these as they can already be infered automatically. You may add a comment in docstring of the file saying C is automatically endowed with a symmetric category structure.
There was a problem hiding this comment.
sounds good. added a sentence in the preamble doc-string.
| namespace Monoidal | ||
|
|
There was a problem hiding this comment.
| namespace Monoidal |
I am not sure we need to put the two lemmas in a subnamespace.
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
|
Thanks! bors merge |
…eorder category of a meet-semilattice with a top element (#21094) The preorder category of a meet-semilattice `C` with a top element has chosen finite products. Motivation: I plan to use the induced monoidal structure to show that the preorder category of a distributive lattice is distributive. See this PR on Monoidal and cartesian distributive categories: #20182
|
Pull request successfully merged into master. Build succeeded: |
The preorder category of a meet-semilattice
Cwith a top element has chosen finite products.Motivation: I plan to use the induced monoidal structure to show that the preorder category of a distributive lattice is distributive. See this PR on Monoidal and cartesian distributive categories: #20182