feat(CategoryTheory/Bicategory): a retract of an equivalence is an equivalence - #42589
feat(CategoryTheory/Bicategory): a retract of an equivalence is an equivalence#42589joelriou wants to merge 7 commits into
Conversation
joelriou
commented
Aug 9, 2026
PR summary d15e7d5b79Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type (weak) |
|---|---|---|
| 5051 | 1 | exposed public sections |
Current commit d15e7d5b79
Reference commit 239cf0d8f3
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
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).
| def equivalence {f' : X' ⟶ Y'} {f : Equivalence X Y} (r : RetractArrow₁ f' f.hom) : | ||
| Equivalence X' Y' where | ||
| hom := f' | ||
| inv := r.i₂ ≫ f.inv ≫ r.r₁ | ||
| unit := | ||
| r.id₁.symm ≪≫ _ ◁ᵢ (λ_ _).symm ≪≫ r.i₁ ◁ᵢ f.unit ▷ᵢ r.r₁ ≪≫ | ||
| _ ◁ᵢ (α_ _ _ _) ≪≫ (α_ _ _ _).symm ≪≫ (r.commi.symm ▷ᵢ (f.inv ≫ r.r₁)) ≪≫ α_ _ _ _ | ||
| counit := | ||
| α_ _ _ _ ≪≫ _ ◁ᵢ (α_ _ _ _ ≪≫ _ ◁ᵢ r.commr.symm ≪≫ (α_ _ _ _).symm) ≪≫ | ||
| r.i₂ ◁ᵢ f.counit ▷ᵢ r.r₂ ≪≫ _ ◁ᵢ λ_ _ ≪≫ r.id₂ | ||
| left_triangle := by | ||
| ext : 1 | ||
| calc | ||
| _ = r.id₁.inv ▷ f' ⊗≫ ((r.i₁ ◁ f.unit.hom ⊗≫ r.commi.inv ▷ f.inv) ▷ (r.r₁ ≫ f') ≫ | ||
| ((f' ≫ r.i₂) ≫ f.inv) ◁ r.commr.inv) ⊗≫ | ||
| f' ◁ r.i₂ ◁ f.counit.hom ▷ r.r₂ ⊗≫ f' ◁ r.id₂.hom := by | ||
| simp only [leftZigzagIso_hom, Iso.trans_hom, Iso.symm_hom, whiskerLeftIso_hom, | ||
| whiskerRightIso_hom] | ||
| bicategory | ||
| _ = r.id₁.inv ▷ f' ⊗≫ r.i₁ ◁ r.commr.inv ⊗≫ | ||
| (r.i₁ ◁ f.unit.hom) ▷ (f.hom ≫ r.r₂) ⊗≫ | ||
| ((r.commi.inv ▷ (f.inv ≫ f.hom) ≫ ((f' ≫ r.i₂) ◁ f.counit.hom)) ▷ r.r₂) ⊗≫ | ||
| f' ◁ r.id₂.hom := by | ||
| rw [← whisker_exchange] | ||
| bicategory | ||
| _ = r.id₁.inv ▷ f' ⊗≫ r.i₁ ◁ r.commr.inv ⊗≫ | ||
| r.i₁ ◁ (leftZigzag f.unit.hom f.counit.hom) ▷ r.r₂ ⊗≫ | ||
| (r.commi.inv ▷ r.r₂) ⊗≫ f' ◁ r.id₂.hom := by | ||
| rw [← whisker_exchange] | ||
| bicategory | ||
| _ = r.id₁.inv ▷ f' ⊗≫ r.i₁ ◁ r.commr.inv ⊗≫ | ||
| (r.commi.inv ▷ r.r₂) ⊗≫ f' ◁ r.id₂.hom := by | ||
| rw [f.left_triangle_hom] | ||
| bicategory | ||
| _ = _ := by | ||
| simp [bicategoricalComp, r.comm'_assoc] |
There was a problem hiding this comment.
I didn’t test if it works, but from what I see of the proof you only need unit.hom and counit.hom and their left triangle identity from the equivalence, which says that you should probably first define the structure for an Adjunction first (i.e construct f' ⊣ r.i₂ ≫ g ≫ r.r₁ from f ⊣ g) and then specialize the proof here to the adjunction induced between f and f.inv.
There was a problem hiding this comment.
Thanks for the reviews! It seems it should work, apart from the fact that I now need to prove also the right triangle identity...
There was a problem hiding this comment.
I have tried, but I failed to prove the right triangle compatibility, so that I reverted to doing only the case of equivalences.