Skip to content

Commit 9eecc5f

Browse files
committed
chore(CategoryTheory/Idempotents): fix simp direction in Karoubi (#24848)
1 parent 87a5046 commit 9eecc5f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Mathlib/CategoryTheory/Idempotents/FunctorExtension.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def map {F G : C ⥤ Karoubi D} (φ : F ⟶ G) : obj F ⟶ obj G where
5959
have h' := F.congr_map P.idem
6060
simp only [hom_ext_iff, Karoubi.comp_f, F.map_comp] at h h'
6161
simp only [obj_obj_p, assoc, ← h]
62-
slice_rhs 1 3 => rw [h', h'] }
62+
slice_lhs 1 3 => rw [h', h'] }
6363
naturality _ _ f := by
6464
ext
6565
dsimp [obj]
@@ -117,7 +117,7 @@ def KaroubiUniversal₁.counitIso :
117117
comm := by
118118
simpa only [hom_ext_iff, G.map_comp, G.map_id] using
119119
G.congr_map
120-
(show P.decompId_p = (toKaroubi C).map P.p ≫ P.decompId_p ≫ 𝟙 _ by simp) }
120+
(show (toKaroubi C).map P.p ≫ P.decompId_p ≫ 𝟙 _ = P.decompId_p by simp) }
121121
naturality := fun P Q f => by
122122
simpa only [hom_ext_iff, G.map_comp]
123123
using (G.congr_map (decompId_p_naturality f)).symm }
@@ -127,7 +127,7 @@ def KaroubiUniversal₁.counitIso :
127127
comm := by
128128
simpa only [hom_ext_iff, G.map_comp, G.map_id] using
129129
G.congr_map
130-
(show P.decompId_i = 𝟙 _ ≫ P.decompId_i ≫ (toKaroubi C).map P.p by simp) }
130+
(show 𝟙 _ ≫ P.decompId_i ≫ (toKaroubi C).map P.p = P.decompId_i by simp) }
131131
naturality := fun P Q f => by
132132
simpa only [hom_ext_iff, G.map_comp] using G.congr_map (decompId_i_naturality f) }
133133
hom_inv_id := by

Mathlib/CategoryTheory/Idempotents/Karoubi.lean

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,24 @@ structure Hom (P Q : Karoubi C) where
6969
/-- a morphism between the underlying objects -/
7070
f : P.X ⟶ Q.X
7171
/-- compatibility of the given morphism with the given idempotents -/
72-
comm : f = P.p ≫ f ≫ Q.p := by aesop_cat
72+
comm : P.p ≫ f ≫ Q.p = f := by aesop_cat
7373

7474
instance [Preadditive C] (P Q : Karoubi C) : Inhabited (Hom P Q) :=
7575
⟨⟨0, by rw [zero_comp, comp_zero]⟩⟩
7676

7777
@[reassoc (attr := simp)]
78-
theorem p_comp {P Q : Karoubi C} (f : Hom P Q) : P.p ≫ f.f = f.f := by rw [f.comm, ← assoc, P.idem]
78+
theorem p_comp {P Q : Karoubi C} (f : Hom P Q) : P.p ≫ f.f = f.f := by
79+
rw [← f.comm, ← assoc, P.idem]
7980

8081
@[reassoc (attr := simp)]
8182
theorem comp_p {P Q : Karoubi C} (f : Hom P Q) : f.f ≫ Q.p = f.f := by
82-
rw [f.comm, assoc, assoc, Q.idem]
83+
rw [f.comm, assoc, assoc, Q.idem]
8384

8485
@[reassoc]
8586
theorem p_comm {P Q : Karoubi C} (f : Hom P Q) : P.p ≫ f.f = f.f ≫ Q.p := by rw [p_comp, comp_p]
8687

8788
theorem comp_proof {P Q R : Karoubi C} (g : Hom Q R) (f : Hom P Q) :
88-
f.f ≫ g.f = P.p ≫ (f.f ≫ g.f) ≫ R.p := by rw [assoc, comp_p, ← assoc, p_comp]
89+
P.p ≫ (f.f ≫ g.f) ≫ R.p = f.f ≫ g.f := by simp
8990

9091
/-- The category structure on the karoubi envelope of a category. -/
9192
instance : Category (Karoubi C) where
@@ -144,7 +145,7 @@ variable {C}
144145

145146
@[simps add]
146147
instance instAdd [Preadditive C] {P Q : Karoubi C} : Add (P ⟶ Q) where
147-
add f g := ⟨f.f + g.f, by rw [add_comp, comp_add, f.comm, g.comm]⟩
148+
add f g := ⟨f.f + g.f, by rw [add_comp, comp_add, f.comm, g.comm]⟩
148149

149150
@[simps neg]
150151
instance instNeg [Preadditive C] {P Q : Karoubi C} : Neg (P ⟶ Q) where

0 commit comments

Comments
 (0)