Skip to content

chore(CategoryTheory/Limits/Shapes/Pullback): use to_dual - #46208

Open
JovanGerb wants to merge 8 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-to_dual-Pullback
Open

JovanGerb wants to merge 8 commits into
leanprover-community:masterfrom
JovanGerb:Jovan-to_dual-Pullback

Conversation

@JovanGerb

@JovanGerb JovanGerb commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

This PR uses to_dual for Pullback.

  • This requires putting (relevant_arg := _) on WidePullbackShape, because it needs to be translated no matter what the argument J is (in this case it is WalkingPair).
  • simps! is removed from pullback.congrHom and written out manually instead to make it easier to use to_dual.
  • The definition of pullback.congrHom/pushout.congrHom is modified so that both projections can be generated by simps.
  • hasPushouts_symmetry_of_hasPushoutsAlong was misnamed (it has an s too many). Instead of replacing it with the correct name, I've deprecated it and its dual entirely, as they can be directly replaced by hasPushout_symmetry/hasPullback_symmetry respectively. I also added a TODO at hasPullback_symmetry to consider making it a global instance (it would be a loopy instance, but lean4 should handle this perfectly fine).

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

PR summary 34aa7b8611

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ PullbackCone.pasteHorizFlip
+ _root_.CategoryTheory.Limits.PushoutCocone.ext
+ instance : HasPullback (f' ≫ f) g
+ instance : HasPullback f (g' ≫ g)
+-- Hom
- Cocone.ofPushoutCocone
- HasPushout
- HasPushouts
- HasPushoutsAlong
- Hom.fst
- Hom.id
- Hom.snd
- IsColimit.desc
- IsColimit.desc'
- IsColimit.hom_ext
- IsColimit.inl_desc
- IsColimit.inr_desc
- IsColimit.mk
- PushoutCocone
- PushoutCocone.inl_colimit_cocone
- PushoutCocone.inr_colimit_cocone
- PushoutCocone.isoMk
- PushoutCocone.ofCocone
- PushoutCocone.pasteHoriz
- PushoutCocone.pasteVert
- PushoutCocone.pasteVertFlip
- WalkingSpan
- WalkingSpan.left
- WalkingSpan.right
- WalkingSpan.zero
- botSquareIsPushout
- coequalizer_ext
- condition
- condition_zero
- diagramIsoSpan
- eta
- ext
- flip
- flipFlipIso
- flipIsColimit
- flip_inl
- flip_inr
- hasPullbackHorizPaste
- hasPullbackVertPaste
- hasPushoutVertPaste
- hasPushout_symmetry
- hasPushouts_of_hasColimit_span
- hasPushouts_symmetry_of_hasPushoutsAlong
- inl
- inl_comp_pushoutComparison
- inl_comp_pushoutSymmetry_hom
- inl_comp_pushoutSymmetry_inv
- inl_pushoutLeftPushoutInrIso_inv
- inl_pushoutRightPushoutInlIso_hom
- inl_pushoutRightPushoutInlIso_inv
- inr
- inr_comp_pushoutComparison
- inr_comp_pushoutSymmetry_hom
- inr_comp_pushoutSymmetry_inv
- inr_pushoutLeftPushoutInrIso_hom
- inr_pushoutLeftPushoutInrIso_inv
- inr_pushoutRightPushoutInlIso_inv
- instance (X Y : WalkingSpan) : Subsingleton (X ⟶ Y) := by
- instance (priority := 100) hasPushouts_of_hasWidePushouts (D : Type u) [Category.{v} D]
- instance : HasPushout f (g ≫ g')
- isColimitAux
- isColimitAux'
- isColimitOfFlip
- mk
- mkSelfIsColimit
- mk_inl
- mk_inr
- mk_ι_app_left
- mk_ι_app_right
- mk_ι_app_zero
- pasteHorizIsPushout
- pasteHorizIsPushoutEquiv
- pasteVertIsPushout
- pasteVertIsPushoutEquiv
- pullback.congrHom_inv
- pushout
- pushout.cocone
- pushout.condition
- pushout.congrHom
- pushout.congrHom_inv
- pushout.desc
- pushout.desc'
- pushout.desc_inl_inr
- pushout.exists_desc
- pushout.hom_ext
- pushout.inl
- pushout.inl_desc
- pushout.inr
- pushout.inr_desc
- pushout.isColimit
- pushout.map
- pushout.mapLift
- pushout.mapLift_comp
- pushout.map_comp
- pushout.map_id
- pushout.map_isIso
- pushoutComparison
- pushoutComparison_map_desc
- pushoutIsPushout
- pushoutLeftPushoutInrIso
- pushoutRightPushoutInlIso
- pushoutSymmetry
- rightSquareIsPushout
- span
- spanCompIso
- spanCompIso_app_left
- spanCompIso_app_right
- spanCompIso_app_zero
- spanCompIso_hom_app_left
- spanCompIso_hom_app_right
- spanCompIso_hom_app_zero
- spanCompIso_inv_app_left
- spanCompIso_inv_app_right
- spanCompIso_inv_app_zero
- span_left
- span_map_fst
- span_map_id
- span_map_snd
- span_right
- span_zero
- walkingCospanOpEquiv
- ι_app_left
- ι_app_right
-+- flip_pt

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

  • +7 new declarations
  • −3 removed declarations
+CategoryTheory.Limits.PullbackCone.pasteHorizFlip
+CategoryTheory.Limits.PushoutCocone.pasteHorizFlip
-CategoryTheory.Limits.hasPullbackHorizPaste
-CategoryTheory.Limits.hasPullbackVertPaste
-CategoryTheory.Limits.hasPushoutVertPaste
+CategoryTheory.Limits.instHasPullbackComp
+CategoryTheory.Limits.instHasPullbackComp_1
+CategoryTheory.Limits.instHasPushoutComp_1
+CategoryTheory.Limits.pushoutComparison_comp
+CategoryTheory.Limits.pushoutComparison_comp_assoc

No changes to strong technical debt.
No changes to weak technical debt.

Current commit 34aa7b8611
Reference commit 3eae40f5eb

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.py 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 added the t-category-theory Category theory label Nov 19, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 19, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@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 Nov 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-category-theory Category theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants