Skip to content
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

refactor(CategoryTheory/SmallObject): generalization of the definitions #20256

Open
wants to merge 43 commits into
base: master
Choose a base branch
from

Conversation

joelriou
Copy link
Collaborator

@joelriou joelriou commented Dec 26, 2024

The ongoing definition of the iteration of a natural transformation ε : 𝟭 C ⟶ F (with F : C ⥤ C) is generalized to "successor structures" (which shall become a mathlibism), i.e. in a category D, this consists of a zeroth object X₀, a successor application succ : D → D and a map toSucc X : X → succ X (which does not have to be natural: it is not always so in some applications). For such a Φ : SuccStruct D, if J is a well-ordered type, we define the J-th iteration of Φ. (In the case J := ℕ, this is the colimit of succ (succ (succ (succ ... X₀))).)

The iteration of a functor is a particular case of this constructor with D := C ⥤ C.

As toSucc does not have to be natural in X, the caveat is that the proofs make extensive use of equalities of objects in C, while my previous construction used comparison isomorphisms. Nevertheless, the proofs look much more clean now. One of the reasons is that in the inductive construction (file Iteration.Nonempty), in the terms of data, we only need to provide a functor, and then all the fields are in Prop.

This PR supersedes #19264, and overlaps a little bit over the content of #20142.


Open in Gitpod

joelriou and others added 30 commits October 23, 2024 15:50
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>
@joelriou joelriou added the WIP Work in progress label Dec 26, 2024
@github-actions github-actions bot added large-import Automatically added label for PRs with a significant increase in transitive imports t-category-theory Category theory labels Dec 26, 2024
Copy link

github-actions bot commented Dec 26, 2024

PR summary 6e71693232

Import changes exceeding 2%

% File
+3.04% Mathlib.CategoryTheory.SmallObject.Iteration.Basic
+3.04% Mathlib.CategoryTheory.SmallObject.Iteration.ExtendToSucc
+3.04% Mathlib.CategoryTheory.SmallObject.Iteration.FunctorOfCocone
+3.26% Mathlib.CategoryTheory.SmallObject.Iteration.Nonempty

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.CategoryTheory.SmallObject.Iteration.UniqueHom 428 0 -428 (-100.00%)
Mathlib.CategoryTheory.SmallObject.Iteration.Nonempty 429 443 +14 (+3.26%)
Mathlib.CategoryTheory.SmallObject.Iteration.Basic 427 440 +13 (+3.04%)
Mathlib.CategoryTheory.SmallObject.Iteration.ExtendToSucc 428 441 +13 (+3.04%)
Mathlib.CategoryTheory.SmallObject.Iteration.FunctorOfCocone 428 441 +13 (+3.04%)
Import changes for all files
Files Import difference
Mathlib.CategoryTheory.SmallObject.Iteration.UniqueHom -428
3 files Mathlib.CategoryTheory.SmallObject.Iteration.ExtendToSucc Mathlib.CategoryTheory.SmallObject.Iteration.FunctorOfCocone Mathlib.CategoryTheory.SmallObject.Iteration.Basic
13
Mathlib.CategoryTheory.SmallObject.Iteration.Nonempty 14
Mathlib.CategoryTheory.SmallObject.Iteration.Iteration (new file) 444

Declarations diff

+ HasIterationOfShape
+ MapEq
+ SuccStruct
+ congr_colimit_ι
+ congr_map
+ congr_obj
+ congr_toSucc
+ contains
+ extendToSucc_map
+ extendToSucc_obj_eq
+ extendToSucc_obj_succ_eq
+ functor
+ functor_eq
+ functor_map
+ functor_map_to_top
+ functor_obj
+ functor_obj_eq_colimit
+ hasColimitOfShape_of_isSuccLimit
+ inductiveSystem
+ isColimit
+ isColimitIterationCocone
+ isoBot
+ isoSucc
+ iter
+ iteration
+ iterationCocone
+ iterationCocone_pt
+ iterationFunctor
+ mapEq_of_eq
+ mapEq_rfl
+ mapEq_trans
+ mapObj
+ mapObj_refl
+ mapObj_trans
+ map_succ'
+ nonempty
+ obj_eq
+ obj_succ_eq
+ ofCocone_obj_eq
+ ofCocone_obj_eq_pt
+ ofNatTrans
+ restrictionLT_functor
+ restrictionLT_functor_of_lt
+ subsingleton
- Hom
- comp
- congr_app
- eval
- ext'
- extentToSucc_map
- id
- instance : Category (Iteration ε j)
- instance : Nonempty (iter₁ ⟶ iter₂) := by
- instance : Unique (iter₁ ⟶ iter₂)
- instance {J} {j : J} [PartialOrder J] [OrderBot J] [WellFoundedLT J] [SuccOrder J]
- iso
- iso_refl
- iso_trans
- mapSucc
- mapSucc'
- mapSucc_eq
- mkOfLimitNatTrans
- mkOfLimitNatTransApp
- mkOfLimitNatTransApp_eq_of_lt
- mkOfLimitNatTransApp_naturality_top
- mkOfSuccNatTrans
- mkOfSuccNatTransApp
- mkOfSuccNatTransApp_eq_of_le
- mkOfSuccNatTransApp_succ_eq
- natTrans_comp
- natTrans_id
- natTrans_naturality
- truncFunctor
- truncFunctor_map_natTrans_app
-+- mkOfSucc
--+ mkOfBot

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) = (4.00, 0.00)
Current number Change Type
1510 -4 erw

Current commit 6e71693232
Reference commit 5f24fc48e5

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).

@joelriou joelriou added WIP Work in progress and removed WIP Work in progress labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large-import Automatically added label for PRs with a significant increase in transitive imports t-category-theory Category theory WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant