Skip to content

[Merged by Bors] - refactor(Order/Category): concrete category refactor for basic orders - #21409

Closed
Vierkantor wants to merge 14 commits into
masterfrom
concreteify-PartOrd
Closed

Vierkantor wants to merge 14 commits into
masterfrom
concreteify-PartOrd

Conversation

@Vierkantor

@Vierkantor Vierkantor commented Feb 4, 2025 •

Copy link
Copy Markdown
Contributor

This PR implements Hom classes and ConcreteCategory instances for the following categories of orders:

  • Preord
  • PartOrd, FinPartOrd
  • Lat
  • DistLat
  • LinOrd, NonemptyFinLinOrd
  • BddOrd
  • Frm
  • BddLat
  • BddDistLat, FinBddDistLat
  • BoolAlg, FinBoolAlg
  • HeytAlg

It also replaces HasForget instances with ConcreteCategory instances for the following categories of orders:

  • SemilatSupCat, SemilatInfCat
  • SimplexCategory

The following order categories still need to be refactored:

  • CompleteLat
  • ωCPO

Zulip thread: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign


Open in Gitpod

@Vierkantor Vierkantor added awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. t-category-theory Category theory t-order Order theory awaiting-bench This PR needs to be benchmarked before merging labels Feb 4, 2025
@github-actions

github-actions Bot commented Feb 4, 2025 •

Copy link
Copy Markdown

PR summary 603727a8ca

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Order.Category.Preord 406 405 -1 (-0.25%)
Mathlib.Order.Category.PartOrd 411 410 -1 (-0.24%)
Mathlib.Order.Category.Lat 414 413 -1 (-0.24%)
Mathlib.Order.Category.Semilat 414 413 -1 (-0.24%)
Mathlib.Order.Category.BddOrd 415 414 -1 (-0.24%)
Mathlib.Order.Category.DistLat 415 414 -1 (-0.24%)
Mathlib.Order.Category.LinOrd 415 414 -1 (-0.24%)
Mathlib.Order.Category.Frm 418 417 -1 (-0.24%)
Mathlib.Order.Category.BddLat 423 422 -1 (-0.24%)
Mathlib.Order.Category.BddDistLat 425 424 -1 (-0.24%)
Mathlib.Order.Category.HeytAlg 427 426 -1 (-0.23%)
Mathlib.Order.Category.BoolAlg 431 430 -1 (-0.23%)
Mathlib.Order.Category.FinPartOrd 544 543 -1 (-0.18%)
Mathlib.Order.Category.FinBddDistLat 588 587 -1 (-0.17%)
Mathlib.Order.Category.FinBoolAlg 601 600 -1 (-0.17%)
Mathlib.Algebra.Category.BoolRing 635 634 -1 (-0.16%)
Mathlib.Order.Category.NonemptyFinLinOrd 643 642 -1 (-0.16%)
Mathlib.Topology.Specialization 774 773 -1 (-0.13%)
Mathlib.Topology.Order.Category.AlexDisc 775 774 -1 (-0.13%)
Mathlib.AlgebraicTopology.SimplexCategory 822 821 -1 (-0.12%)
Mathlib.AlgebraicTopology.SimplicialSet.Nerve 843 842 -1 (-0.12%)
Mathlib.AlgebraicTopology.TopologicalSimplex 1257 1256 -1 (-0.08%)
Mathlib.Topology.Category.CompHaus.Frm 1504 1503 -1 (-0.07%)
Mathlib.Topology.Category.Locale 1505 1504 -1 (-0.07%)
Mathlib.Topology.Order.Category.FrameAdjunction 1506 1505 -1 (-0.07%)
Import changes for all files
Files Import difference
72 files Mathlib.Algebra.Category.BoolRing Mathlib.AlgebraicTopology.AlternatingFaceMapComplex Mathlib.AlgebraicTopology.CechNerve Mathlib.AlgebraicTopology.DoldKan.Decomposition Mathlib.AlgebraicTopology.DoldKan.Degeneracies Mathlib.AlgebraicTopology.DoldKan.EquivalenceAdditive Mathlib.AlgebraicTopology.DoldKan.EquivalencePseudoabelian Mathlib.AlgebraicTopology.DoldKan.Equivalence Mathlib.AlgebraicTopology.DoldKan.Faces Mathlib.AlgebraicTopology.DoldKan.FunctorGamma Mathlib.AlgebraicTopology.DoldKan.FunctorN Mathlib.AlgebraicTopology.DoldKan.GammaCompN Mathlib.AlgebraicTopology.DoldKan.Homotopies Mathlib.AlgebraicTopology.DoldKan.HomotopyEquivalence Mathlib.AlgebraicTopology.DoldKan.NCompGamma Mathlib.AlgebraicTopology.DoldKan.NReflectsIso Mathlib.AlgebraicTopology.DoldKan.Normalized Mathlib.AlgebraicTopology.DoldKan.Notations Mathlib.AlgebraicTopology.DoldKan.PInfty Mathlib.AlgebraicTopology.DoldKan.Projections Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject Mathlib.AlgebraicTopology.ExtraDegeneracy Mathlib.AlgebraicTopology.MooreComplex Mathlib.AlgebraicTopology.Quasicategory.Basic Mathlib.AlgebraicTopology.Quasicategory.Nerve Mathlib.AlgebraicTopology.Quasicategory.StrictSegal Mathlib.AlgebraicTopology.SimplexCategory Mathlib.AlgebraicTopology.SimplicialCategory.Basic Mathlib.AlgebraicTopology.SimplicialCategory.SimplicialObject Mathlib.AlgebraicTopology.SimplicialNerve Mathlib.AlgebraicTopology.SimplicialObject.Basic Mathlib.AlgebraicTopology.SimplicialObject.Coskeletal Mathlib.AlgebraicTopology.SimplicialObject.Split Mathlib.AlgebraicTopology.SimplicialSet.Basic Mathlib.AlgebraicTopology.SimplicialSet.Boundary Mathlib.AlgebraicTopology.SimplicialSet.Coskeletal Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat Mathlib.AlgebraicTopology.SimplicialSet.Horn Mathlib.AlgebraicTopology.SimplicialSet.KanComplex Mathlib.AlgebraicTopology.SimplicialSet.Monoidal Mathlib.AlgebraicTopology.SimplicialSet.Nerve Mathlib.AlgebraicTopology.SimplicialSet.Path Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex Mathlib.AlgebraicTopology.SimplicialSet.StrictSegal Mathlib.AlgebraicTopology.SingularSet Mathlib.AlgebraicTopology.TopologicalSimplex Mathlib.CategoryTheory.Idempotents.SimplicialObject Mathlib.Order.Category.BddDistLat Mathlib.Order.Category.BddLat Mathlib.Order.Category.BddOrd Mathlib.Order.Category.BoolAlg Mathlib.Order.Category.DistLat Mathlib.Order.Category.FinBddDistLat Mathlib.Order.Category.FinBoolAlg Mathlib.Order.Category.FinPartOrd Mathlib.Order.Category.Frm Mathlib.Order.Category.HeytAlg Mathlib.Order.Category.Lat Mathlib.Order.Category.LinOrd Mathlib.Order.Category.NonemptyFinLinOrd Mathlib.Order.Category.PartOrd Mathlib.Order.Category.Preord Mathlib.Order.Category.Semilat Mathlib.RepresentationTheory.GroupCohomology.Basic Mathlib.RepresentationTheory.GroupCohomology.Hilbert90 Mathlib.RepresentationTheory.GroupCohomology.LowDegree Mathlib.RepresentationTheory.GroupCohomology.Resolution Mathlib.Topology.Category.CompHaus.Frm Mathlib.Topology.Category.Locale Mathlib.Topology.Order.Category.AlexDisc Mathlib.Topology.Order.Category.FrameAdjunction Mathlib.Topology.Specialization
-1

Declarations diff

+ instance (X : NonemptyFinLinOrd) : BoundedOrder X
+ instance (x : SimplexCategory) (n : ℕ) : OfNat (ToType x) n
+ instance (x : SimplexCategory) : CoeFun x.toTopObj fun _ => ToType x → ℝ≥0
+ instance (x : SimplexCategory) : Fintype (ToType x)
+ instance : Category BddDistLat.{u}
+ instance : Category BddOrd.{u}
+ instance : Category BoolAlg.{u}
+ instance : Category DistLat.{u}
+ instance : Category FinBddDistLat.{u}
+ instance : Category Frm.{u}
+ instance : Category HeytAlg.{u}
+ instance : Category Lat.{u}
+ instance : Category LinOrd.{u}
+ instance : Category PartOrd.{u}
+ instance : Category Preord.{u}
+ instance : CoeSort BoolAlg (Type _)
+ instance : CoeSort DistLat.{u} (Type u)
+ instance : CoeSort Frm (Type _)
+ instance : CoeSort HeytAlg (Type _)
+ instance : CoeSort Lat (Type _)
+ instance : CoeSort LinOrd (Type _)
+ instance : CoeSort NonemptyFinLinOrd (Type _)
+ instance : CoeSort PartOrd (Type _)
+ instance : CoeSort Preord (Type u)
+ instance : ConcreteCategory BddDistLat (BoundedLatticeHom · ·)
+ instance : ConcreteCategory BddLat (BoundedLatticeHom · ·)
+ instance : ConcreteCategory BddOrd (BoundedOrderHom · ·)
+ instance : ConcreteCategory BoolAlg (BoundedLatticeHom · ·)
+ instance : ConcreteCategory DistLat (LatticeHom · ·)
+ instance : ConcreteCategory FinBddDistLat (BoundedLatticeHom · ·)
+ instance : ConcreteCategory Frm (FrameHom · ·)
+ instance : ConcreteCategory HeytAlg (HeytingHom · ·)
+ instance : ConcreteCategory Lat (LatticeHom · ·)
+ instance : ConcreteCategory LinOrd (· →o ·)
+ instance : ConcreteCategory NonemptyFinLinOrd (· →o ·)
+ instance : ConcreteCategory PartOrd (· →o ·)
+ instance : ConcreteCategory Preord (· →o ·)
+ instance : ConcreteCategory SemilatInfCat (InfTopHom · ·)
+ instance : ConcreteCategory SemilatSupCat (SupBotHom · ·)
+ instance : ConcreteCategory SimplexCategory (fun i j => Fin (i.len + 1) →o Fin (j.len + 1))
+ instance : LargeCategory NonemptyFinLinOrd
+ toType_apply
++ concreteCategory
+++++++++++ coe_comp
+++++++++++ coe_id
+++++++++++ forget_map
+++++++++++ hom_inv_apply
+++++++++++ inv_hom_apply
+++++++++++ ofHom_apply
+++++++++++ ofHom_comp
+++++++++++ ofHom_id
++++++++++++ Hom.hom
++++++++++++ ext
+++++++++++++ hom_ofHom
+++++++++++++ ofHom_hom
++++++++++++++ Hom.Simps.hom
++++++++++++++ comp_apply
++++++++++++++ hom_comp
++++++++++++++ hom_ext
++++++++++++++ hom_id
++++++++++++++ id_apply
++++++++++++++ ofHom
+++++++++++++++++----------------- of
+++++++++------+----- coe_of
- Fin.nonemptyFiniteLinearOrder
- NonemptyFiniteLinearOrder
- PUnit.nonemptyFiniteLinearOrder
- ULift.nonemptyFiniteLinearOrder
- forget_map_apply
- instBooleanAlgebra
- instBoundedLatticeHomClass
- instance (X : BddLat) : Lattice X
- instance (X : BddOrd) : PartialOrder X
- instance (X : DistLat) : DistribLattice X
- instance (X : FinBoolAlg) : BooleanAlgebra X
- instance (X : Frm) : Frame X
- instance (X : HeytAlg) : HeytingAlgebra X
- instance (X : Lat) : Lattice X
- instance (priority := 100) NonemptyFiniteLinearOrder.toBoundedOrder (α : Type*)
- instance (x : SimplexCategory) (n : ℕ) : OfNat (HasForget.forget.obj x) n
- instance (x : SimplexCategory) : CoeFun x.toTopObj fun _ => x → ℝ≥0
- instance (x : SimplexCategory) : Fintype (HasForget.forget.obj x)
- instance (α : LinOrd) : LinearOrder α
- instance (α : NonemptyFinLinOrd) : NonemptyFiniteLinearOrder α
- instance (α : PartOrd) : PartialOrder α
- instance (α : Preord) : Preorder α
- instance (α : Type*) [NonemptyFiniteLinearOrder α] : NonemptyFiniteLinearOrder αᵒᵈ
- instance : BundledHom @LatticeHom
- instance : BundledHom @OrderHom
- instance : BundledHom.ParentProjection @DistribLattice.toLattice
- instance : BundledHom.ParentProjection @LinearOrder.toPartialOrder
- instance : BundledHom.ParentProjection @NonemptyFiniteLinearOrder.toLinearOrder
- instance : BundledHom.ParentProjection @PartialOrder.toPreorder
- instance : CoeSort BoolAlg Type*
- instance : CoeSort DistLat Type*
- instance : CoeSort Frm Type*
- instance : CoeSort HeytAlg Type*
- instance : CoeSort Lat Type*
- instance : CoeSort LinOrd Type*
- instance : CoeSort NonemptyFinLinOrd Type*
- instance : CoeSort PartOrd Type*
- instance : CoeSort Preord Type*
- instance : HasForget BddDistLat
- instance : HasForget BddLat
- instance : HasForget BoolAlg
- instance : HasForget DistLat
- instance : HasForget Frm := by
- instance : HasForget HeytAlg := by
- instance : HasForget Lat
- instance : HasForget LinOrd
- instance : HasForget NonemptyFinLinOrd
- instance : HasForget PartOrd
- instance : HasForget Preord
- instance : HasForget SemilatInfCat
- instance : HasForget SemilatSupCat
- instance : HasForget.{0} SimplexCategory
- instance : Inhabited DistLat
- instance : Inhabited Lat
- instance : Inhabited PartOrd
- instance : LargeCategory.{u} BddDistLat
- instance : LargeCategory.{u} BoolAlg
- instance : LargeCategory.{u} Lat
- instance {A B : NonemptyFinLinOrd.{u}} : FunLike (A ⟶ B) A B
- instance {A B : NonemptyFinLinOrd.{u}} : OrderHomClass (A ⟶ B) A B
- instance {X Y : HeytAlg.{u}} : FunLike (X ⟶ Y) ↑X ↑Y
- instance {X Y : HeytAlg.{u}} : HeytingHomClass (X ⟶ Y) ↑X ↑Y
-++++++++++++ Hom
-+-+ hasForgetToBddDistLat
-- bundledHom
-- largeCategory
---- hasForget
----- instFunLike

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.


Decrease in tech debt: (relative, absolute) = (28.00, 0.01)
Current number Change Type
4030 -28 porting notes

Current commit 603727a8ca
Reference commit e05e225065

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Feb 4, 2025
@Vierkantor

Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-bot

Copy link
Copy Markdown

Here are the benchmark results for commit e187402.
There were significant changes against commit 2dd5bb2:

  Benchmark                                        Metric         Change
  ======================================================================
- ~Mathlib.AlgebraicTopology.SimplicialSet.Nerve   instructions   137.4%
- ~Mathlib.Order.Category.DistLat                  instructions   270.8%
- ~Mathlib.Order.Category.Lat                      instructions   172.3%
- ~Mathlib.Order.Category.LinOrd                   instructions    77.8%
- ~Mathlib.Order.Category.NonemptyFinLinOrd        instructions    96.7%

@github-actions

github-actions Bot commented Feb 4, 2025

Copy link
Copy Markdown
File Instructions %
build +144.114⬝10⁹ (+0.09%)
lint -22.227⬝10⁹ (-0.29%)
Mathlib.Order.Category.NonemptyFinLinOrd +30.73⬝10⁹ (+96.73%)
Mathlib.Order.Category.DistLat +26.274⬝10⁹ (+270.77%)
Mathlib.AlgebraicTopology.SimplicialSet.Nerve +25.669⬝10⁹ (+137.44%)
Mathlib.Order.Category.Lat +21.163⬝10⁹ (+172.25%)
Mathlib.Order.Category.LinOrd +10.848⬝10⁹ (+77.77%)
Mathlib.Order.Category.PartOrd +9.470⬝10⁹ (+78.00%)
Mathlib.Order.Category.BddOrd +6.193⬝10⁹ (+36.63%)
Mathlib.Order.Category.Frm +5.768⬝10⁹ (+121.26%)
Mathlib.Order.Category.Preord +4.626⬝10⁹ (+45.86%)
Mathlib.Order.Category.FinPartOrd +3.959⬝10⁹ (+28.83%)
Mathlib.Topology.Order.Category.AlexDisc +2.322⬝10⁹ (+9.27%)
3 files, Instructions +1.0⬝10⁹
File Instructions %
Mathlib.AlgebraicTopology.SimplexCategory +1.561⬝10⁹ (+2.98%)
Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat +1.456⬝10⁹ (+2.89%)
Mathlib.Topology.Order.Category.FrameAdjunction +1.300⬝10⁹ (+5.07%)
2 files, Instructions -2.0⬝10⁹
File Instructions %
Mathlib.Order.Category.FinBoolAlg -1.36⬝10⁹ (-2.88%)
Mathlib.Order.Category.BddLat -1.340⬝10⁹ (-4.30%)
File Instructions %
Mathlib.Order.Category.BddDistLat -2.426⬝10⁹ (-12.52%)
Mathlib.Order.Category.FinBddDistLat -3.452⬝10⁹ (-13.57%)
CI run

@Vierkantor

Copy link
Copy Markdown
Contributor Author

Most of those slowdowns are in files that grew quite a bit. Looks like AlgebraicTopology.SimplicialSet.Nerve got slower due to the aesop calls in nerve being slow. They can be replaced with rfl and become fast, but I think I'll try and figure out if I can make aesop faster.

theorem coe_of (α : Type*) [PartialOrder α] [BoundedOrder α] : ↥(of α) = α :=
lemma hom_id {X : BddOrd} : (𝟙 X : X ⟶ X).hom = BoundedOrderHom.id _ := rfl

/- Provided for rewriting. -/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this meant to be a docstring?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's more of a comment explaining why this isn't marked as @[simp]. But we can docstringify all of these comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm just surprised you're using single-line multi-line comments

Comment thread Mathlib/Order/Category/DistLat.lean Resolved
Comment thread Mathlib/Order/Category/DistLat.lean Resolved
Comment thread Mathlib/Order/Category/FinBoolAlg.lean Resolved
unfold Frm
infer_instance
@[simp]
lemma hom_comp {X Y Z : Frm} (f : X ⟶ Y) (g : Y ⟶ Z) :

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't you feel like there should be automation for this now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mhm, it would be helpful although I don't quite know what form that would take. It's hard to state this inside the type theory itself, since for each base morphism (that is FrameHom, not Frm.Hom) the type of comp can take a different shape. Maybe a metaprogram generating all the boilerplate?

X.str
variable {R} in
/-- Use the `ConcreteCategory.hom` projection for `@[simps]` lemmas. -/
def Hom.Simps.hom (X Y : Lat.{u}) (f : Hom X Y) :=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similarly automation here would help

@Vierkantor

Copy link
Copy Markdown
Contributor Author

Most of those slowdowns are in files that grew quite a bit. Looks like AlgebraicTopology.SimplicialSet.Nerve got slower due to the aesop calls in nerve being slow. They can be replaced with rfl and become fast, but I think I'll try and figure out if I can make aesop faster.

Adding a Hom structure for SimplexCategory did not seem to help, and I still don't know how to figure out where simp spends all its time. I'll just do the proofs by hand then.

@Vierkantor

Copy link
Copy Markdown
Contributor Author

I've been looking at BoolAlg and come to the conclusion that Hom structures for BddLat and BddDistLat would be helpful. One moment please...

@Vierkantor Vierkantor added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Feb 4, 2025
@Vierkantor

Copy link
Copy Markdown
Contributor Author

Oh, interesting. Looking at a timeout in FinBddDistLat suggests that I might actually be going down the wrong way with bundling instances. Namely, previously we implemented NonemptyFinLinOrd as a class NonemptyFiniteLinearOrder plus a structure bundling a type X with an instance NonemptyFiniteLinearOrder X. But now I'm getting slow equality checks on (dual.obj (dual.obj X)).carrier = X.carrierᵒᵈᵒᵈ. Even though these should be exactly the same thing, it ends up checking that each order class on dual.obj X is the same as Xᵒᵈ...

@YaelDillies

Copy link
Copy Markdown
Contributor

(by the way, this is a refactor PR, not a feat PR, right?)

@Vierkantor Vierkantor changed the title feat(Order/Category): concrete category refactor for basic orders refactor(Order/Category): concrete category refactor for basic orders Feb 4, 2025
@Vierkantor

Copy link
Copy Markdown
Contributor Author

Oh, interesting. Looking at a timeout in FinBddDistLat suggests that I might actually be going down the wrong way with bundling instances. Namely, previously we implemented NonemptyFinLinOrd as a class NonemptyFiniteLinearOrder plus a structure bundling a type X with an instance NonemptyFiniteLinearOrder X. But now I'm getting slow equality checks on (dual.obj (dual.obj X)).carrier = X.carrierᵒᵈᵒᵈ. Even though these should be exactly the same thing, it ends up checking that each order class on dual.obj X is the same as Xᵒᵈ...

Nope, changing this doesn't seem to help much...

@Vierkantor

Copy link
Copy Markdown
Contributor Author

Huh, if I turn @[simps] on dual into @[simps map], it looks like aesop gets 2x faster for quite a few of the categories. (In general I think we should be more careful with @[simps] lemmas on Functor.objs.)

@Vierkantor Vierkantor removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Feb 4, 2025
@Vierkantor

Copy link
Copy Markdown
Contributor Author

In the process of investigation I ended up adding Hom structures for most of the order categories anyway. Seems like a shame to waste that effort, so now they're part of the PR. Should I just include CompleteLattice and ωCPO to be complete? :)

@Vierkantor

Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-bot

Copy link
Copy Markdown

Here are the benchmark results for commit 98ccd36.
There were significant changes against commit 2dd5bb2:

  Benchmark                                        Metric         Change
  ======================================================================
+ ~Mathlib.AlgebraicTopology.SimplicialSet.Nerve   instructions   -62.8%
- ~Mathlib.Order.Category.BddDistLat               instructions    52.6%
- ~Mathlib.Order.Category.BoolAlg                  instructions    64.0%
- ~Mathlib.Order.Category.DistLat                  instructions   268.7%
- ~Mathlib.Order.Category.NonemptyFinLinOrd        instructions    86.0%

@github-actions

github-actions Bot commented Feb 4, 2025

Copy link
Copy Markdown
File Instructions %
build +137.918⬝10⁹ (+0.09%)
lint -19.659⬝10⁹ (-0.25%)
2 files, Instructions +26.0⬝10⁹
File Instructions %
Mathlib.Order.Category.NonemptyFinLinOrd +26.734⬝10⁹ (+85.99%)
Mathlib.Order.Category.DistLat +26.71⬝10⁹ (+268.67%)
File Instructions %
Mathlib.Order.Category.BoolAlg +17.60⬝10⁹ (+64.02%)
Mathlib.Order.Category.BddDistLat +10.192⬝10⁹ (+52.62%)
Mathlib.Order.Category.PartOrd +8.271⬝10⁹ (+68.12%)
4 files, Instructions +7.0⬝10⁹
File Instructions %
Mathlib.Order.Category.LinOrd +7.928⬝10⁹ (+56.83%)
Mathlib.Order.Category.BddLat +7.796⬝10⁹ (+25.02%)
Mathlib.Order.Category.FinBddDistLat +7.426⬝10⁹ (+29.21%)
Mathlib.Order.Category.FinBoolAlg +7.146⬝10⁹ (+19.89%)
2 files, Instructions +5.0⬝10⁹
File Instructions %
Mathlib.Order.Category.Frm +5.768⬝10⁹ (+121.26%)
Mathlib.Order.Category.Lat +5.699⬝10⁹ (+46.38%)
3 files, Instructions +3.0⬝10⁹
File Instructions %
Mathlib.Order.Category.Preord +3.810⬝10⁹ (+37.77%)
Mathlib.Order.Category.HeytAlg +3.807⬝10⁹ (+55.34%)
Mathlib.Order.Category.BddOrd +3.549⬝10⁹ (+20.99%)
2 files, Instructions +2.0⬝10⁹
File Instructions %
Mathlib.Order.Category.FinPartOrd +2.401⬝10⁹ (+17.48%)
Mathlib.Topology.Order.Category.AlexDisc +2.321⬝10⁹ (+9.27%)
3 files, Instructions +1.0⬝10⁹
File Instructions %
Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat +1.576⬝10⁹ (+3.13%)
Mathlib.AlgebraicTopology.SimplexCategory +1.553⬝10⁹ (+2.97%)
Mathlib.Topology.Order.Category.FrameAdjunction +1.303⬝10⁹ (+5.08%)
File Instructions %
Mathlib.Algebra.Category.BoolRing -1.493⬝10⁹ (-6.44%)
Mathlib.AlgebraicTopology.SimplicialSet.Nerve -11.726⬝10⁹ (-62.78%)
CI run

@Vierkantor

Copy link
Copy Markdown
Contributor Author

The extra slowdown in DistLat was because I forgot a @[simps map] there. Otherwise it seems to be just files getting bigger and therefore slower. (Assuming I am debugging the profiler trace / simp trace correctly...)

@Vierkantor Vierkantor removed the awaiting-bench This PR needs to be benchmarked before merging label Feb 4, 2025
@kim-em

kim-em commented Feb 4, 2025

Copy link
Copy Markdown
Contributor

!bench

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 6, 2025
@Vierkantor Vierkantor removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Feb 6, 2025
@kim-em

kim-em commented Feb 9, 2025

Copy link
Copy Markdown
Contributor

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Feb 9, 2025
mathlib-bors Bot pushed a commit that referenced this pull request Feb 9, 2025
…#21409)

This PR implements `Hom` classes and `ConcreteCategory` instances for the following categories of orders:
* `Preord`
* `PartOrd`, `FinPartOrd`
* `Lat`
* `DistLat`
* `LinOrd`, `NonemptyFinLinOrd`
* `BddOrd`
* `Frm`
* `BddLat`
* `BddDistLat`, `FinBddDistLat`
* `BoolAlg`, `FinBoolAlg`
* `HeytAlg`

It also replaces `HasForget` instances with `ConcreteCategory` instances for the following categories of orders:
* `SemilatSupCat`, `SemilatInfCat`
* `SimplexCategory`

The following order categories still need to be refactored:
* `CompleteLat`
* `ωCPO`

Zulip thread: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign




Co-authored-by: Anne Baanen <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Feb 9, 2025

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

mathlib-bors Bot pushed a commit that referenced this pull request Feb 9, 2025
…#21409)

This PR implements `Hom` classes and `ConcreteCategory` instances for the following categories of orders:
* `Preord`
* `PartOrd`, `FinPartOrd`
* `Lat`
* `DistLat`
* `LinOrd`, `NonemptyFinLinOrd`
* `BddOrd`
* `Frm`
* `BddLat`
* `BddDistLat`, `FinBddDistLat`
* `BoolAlg`, `FinBoolAlg`
* `HeytAlg`

It also replaces `HasForget` instances with `ConcreteCategory` instances for the following categories of orders:
* `SemilatSupCat`, `SemilatInfCat`
* `SimplexCategory`

The following order categories still need to be refactored:
* `CompleteLat`
* `ωCPO`

Zulip thread: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign




Co-authored-by: Anne Baanen <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Feb 9, 2025

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

  • Build

mathlib-bors Bot pushed a commit that referenced this pull request Feb 9, 2025
…#21409)

This PR implements `Hom` classes and `ConcreteCategory` instances for the following categories of orders:
* `Preord`
* `PartOrd`, `FinPartOrd`
* `Lat`
* `DistLat`
* `LinOrd`, `NonemptyFinLinOrd`
* `BddOrd`
* `Frm`
* `BddLat`
* `BddDistLat`, `FinBddDistLat`
* `BoolAlg`, `FinBoolAlg`
* `HeytAlg`

It also replaces `HasForget` instances with `ConcreteCategory` instances for the following categories of orders:
* `SemilatSupCat`, `SemilatInfCat`
* `SimplexCategory`

The following order categories still need to be refactored:
* `CompleteLat`
* `ωCPO`

Zulip thread: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign




Co-authored-by: Anne Baanen <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Feb 9, 2025

Copy link
Copy Markdown
Contributor

Build failed:

@Vierkantor

Copy link
Copy Markdown
Contributor Author

Looks like the build failure was caused by relying on the definition of the HasForget instance in SimplexCategory. I've upgraded the usage to ConcreteCategory.

@PatrickMassot

Copy link
Copy Markdown
Member

bors merge

mathlib-bors Bot pushed a commit that referenced this pull request Feb 10, 2025
…#21409)

This PR implements `Hom` classes and `ConcreteCategory` instances for the following categories of orders:
* `Preord`
* `PartOrd`, `FinPartOrd`
* `Lat`
* `DistLat`
* `LinOrd`, `NonemptyFinLinOrd`
* `BddOrd`
* `Frm`
* `BddLat`
* `BddDistLat`, `FinBddDistLat`
* `BoolAlg`, `FinBoolAlg`
* `HeytAlg`

It also replaces `HasForget` instances with `ConcreteCategory` instances for the following categories of orders:
* `SemilatSupCat`, `SemilatInfCat`
* `SimplexCategory`

The following order categories still need to be refactored:
* `CompleteLat`
* `ωCPO`

Zulip thread: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Concrete.20category.20class.20redesign




Co-authored-by: Anne Baanen <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Feb 10, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title refactor(Order/Category): concrete category refactor for basic orders [Merged by Bors] - refactor(Order/Category): concrete category refactor for basic orders Feb 10, 2025
@mathlib-bors mathlib-bors Bot closed this Feb 10, 2025
@mathlib-bors
mathlib-bors Bot deleted the concreteify-PartOrd branch February 10, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-category-theory Category theory t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants