Skip to content

feat(CategoryTheory): kan extensions from isos#41484

Open
FernandoChu wants to merge 2 commits into
leanprover-community:masterfrom
FernandoChu:LiftOfIso
Open

feat(CategoryTheory): kan extensions from isos#41484
FernandoChu wants to merge 2 commits into
leanprover-community:masterfrom
FernandoChu:LiftOfIso

Conversation

@FernandoChu

@FernandoChu FernandoChu commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This PR constructs lifts out of isomorphisms of 1-cells, and shows that being (abs) Kan is preserved by this. This is done for all four notions of left/right lifts/extensions.

This is needed for the oo-cosmos project.


AI disclosure. Claude was used in defining the API for the left extension case. After manually fixing its bad proofs/definitions/docstrings, Claude was later asked to replicate this for the other three cases, which I again finetuned.

@FernandoChu FernandoChu requested a review from dagurtomas July 8, 2026 08:47
@FernandoChu FernandoChu added t-category-theory Category theory LLM-generated PRs with substantial input from LLMs - review accordingly labels Jul 8, 2026
@github-actions github-actions Bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

PR summary aa1a23fc0d

Import changes exceeding 2%

% File
+3.56% Mathlib.CategoryTheory.Bicategory.Kan.IsKan

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.CategoryTheory.Bicategory.Kan.IsKan 449 465 +16 (+3.56%)
Import changes for all files
Files Import difference
Mathlib.CategoryTheory.Bicategory.Kan.Adjunction Mathlib.CategoryTheory.Bicategory.Kan.HasKan 4
Mathlib.CategoryTheory.Bicategory.Kan.IsKan 16

Declarations diff (regex)

+ IsAbsKan
+ fac
+ hom_ext
+ isKan
+ mk
+ ofIsoAbsKan
+ ofIsoKan
+ uniqueUpToIso
+ uniqueUpToIso_hom_left
+ uniqueUpToIso_inv_left
+ whisker
+ whiskerHom
+ whiskerIdCancel
+ whiskerIso
+ whiskerOfCommute
+ whiskerOfCompIdIsoSelf
+ whisker_counit
+ whisker_extension
+ whiskering
++ desc
++ ofCompId
++ ofIso_counit
++ ofIso_extension
++ ofIso_lift
++ ofIso_unit
++++ mapIso
++++ whiskerOfIso
++++++++++++ ofIso

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit aa1a23f).

  • +62 new declarations
  • −0 removed declarations
+CategoryTheory.Bicategory.LeftExtension.IsAbsKan.ofIso
+CategoryTheory.Bicategory.LeftExtension.IsKan.ofIso
+CategoryTheory.Bicategory.LeftExtension.mapIso
+CategoryTheory.Bicategory.LeftExtension.ofIso
+CategoryTheory.Bicategory.LeftExtension.ofIso_extension
+CategoryTheory.Bicategory.LeftExtension.ofIso_unit
+CategoryTheory.Bicategory.LeftExtension.whiskerOfIso
+CategoryTheory.Bicategory.LeftLift.IsAbsKan.ofIso
+CategoryTheory.Bicategory.LeftLift.IsKan.ofIso
+CategoryTheory.Bicategory.LeftLift.mapIso
+CategoryTheory.Bicategory.LeftLift.ofIso
+CategoryTheory.Bicategory.LeftLift.ofIso_lift
+CategoryTheory.Bicategory.LeftLift.ofIso_unit
+CategoryTheory.Bicategory.LeftLift.whiskerOfIso
+CategoryTheory.Bicategory.RightExtension.IsAbsKan
+CategoryTheory.Bicategory.RightExtension.IsAbsKan.desc
+CategoryTheory.Bicategory.RightExtension.IsAbsKan.isKan
+CategoryTheory.Bicategory.RightExtension.IsAbsKan.ofIso
+CategoryTheory.Bicategory.RightExtension.IsAbsKan.ofIsoAbsKan
+CategoryTheory.Bicategory.RightExtension.IsKan.desc
+CategoryTheory.Bicategory.RightExtension.IsKan.fac
+CategoryTheory.Bicategory.RightExtension.IsKan.fac_assoc
+CategoryTheory.Bicategory.RightExtension.IsKan.hom_ext
+CategoryTheory.Bicategory.RightExtension.IsKan.mk
+CategoryTheory.Bicategory.RightExtension.IsKan.ofCompId
+CategoryTheory.Bicategory.RightExtension.IsKan.ofIso
+CategoryTheory.Bicategory.RightExtension.IsKan.ofIsoKan
+CategoryTheory.Bicategory.RightExtension.IsKan.uniqueUpToIso
+CategoryTheory.Bicategory.RightExtension.IsKan.uniqueUpToIso_hom_left
+CategoryTheory.Bicategory.RightExtension.IsKan.uniqueUpToIso_inv_left
+CategoryTheory.Bicategory.RightExtension.IsKan.whiskerOfCommute
+CategoryTheory.Bicategory.RightExtension.homMk.congr_simp
+CategoryTheory.Bicategory.RightExtension.mapIso
+CategoryTheory.Bicategory.RightExtension.ofCompId
+CategoryTheory.Bicategory.RightExtension.ofCompId_hom
+CategoryTheory.Bicategory.RightExtension.ofCompId_left
+CategoryTheory.Bicategory.RightExtension.ofCompId_right_as
+CategoryTheory.Bicategory.RightExtension.ofIso
+CategoryTheory.Bicategory.RightExtension.ofIso_counit
+CategoryTheory.Bicategory.RightExtension.ofIso_extension
+CategoryTheory.Bicategory.RightExtension.whisker
+CategoryTheory.Bicategory.RightExtension.whiskerHom
+CategoryTheory.Bicategory.RightExtension.whiskerHom_left
+CategoryTheory.Bicategory.RightExtension.whiskerIdCancel
+CategoryTheory.Bicategory.RightExtension.whiskerIdCancel_left
+CategoryTheory.Bicategory.RightExtension.whiskerIso
+CategoryTheory.Bicategory.RightExtension.whiskerOfCompIdIsoSelf
+CategoryTheory.Bicategory.RightExtension.whiskerOfCompIdIsoSelf_hom_left
+CategoryTheory.Bicategory.RightExtension.whiskerOfCompIdIsoSelf_inv_left
+CategoryTheory.Bicategory.RightExtension.whiskerOfIso
+CategoryTheory.Bicategory.RightExtension.whisker_counit
+CategoryTheory.Bicategory.RightExtension.whisker_extension
+CategoryTheory.Bicategory.RightExtension.whiskering
+CategoryTheory.Bicategory.RightExtension.whiskering_map
+CategoryTheory.Bicategory.RightExtension.whiskering_obj
+CategoryTheory.Bicategory.RightLift.IsAbsKan.ofIso
+CategoryTheory.Bicategory.RightLift.IsKan.ofIso
+CategoryTheory.Bicategory.RightLift.mapIso
+CategoryTheory.Bicategory.RightLift.ofIso
+CategoryTheory.Bicategory.RightLift.ofIso_counit
+CategoryTheory.Bicategory.RightLift.ofIso_lift
+CategoryTheory.Bicategory.RightLift.whiskerOfIso

Increase in strong tech debt: (relative, absolute) = (1.89, 0.00)
Current number Change Type (strong)
4516 1 backward.defeqAttrib.useBackward
5661 3 backward.isDefEq.respectTransparency
No changes to weak technical debt.

Current commit aa1a23fc0d
Reference commit f0630767e5

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/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).

@grunweg

grunweg commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Can you please elaborate on the AI use for this PR? You have labelled it already, but right now we cannot tell if this is a fully autonomous agent or asking an LLM to review for typos.

@FernandoChu

Copy link
Copy Markdown
Collaborator Author

Hi @grunweg. I've added a description of the AI use. Is there any place containing what the best practices for disclosure are? I personally just always do this loop of AI generation > fixing/finetuning > repeat.

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 LLM-generated PRs with substantial input from LLMs - review accordingly t-category-theory Category theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants