Skip to content

Commit d249a60

Browse files
committed
feat(CategoryTheory/ComposableArrows): compositions of 1 or 2 morphisms (#31588)
1 parent 7f8e724 commit d249a60

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed

Mathlib.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,6 +2286,8 @@ public import Mathlib.CategoryTheory.Comma.StructuredArrow.Final
22862286
public import Mathlib.CategoryTheory.Comma.StructuredArrow.Functor
22872287
public import Mathlib.CategoryTheory.Comma.StructuredArrow.Small
22882288
public import Mathlib.CategoryTheory.ComposableArrows.Basic
2289+
public import Mathlib.CategoryTheory.ComposableArrows.One
2290+
public import Mathlib.CategoryTheory.ComposableArrows.Two
22892291
public import Mathlib.CategoryTheory.ConcreteCategory.Basic
22902292
public import Mathlib.CategoryTheory.ConcreteCategory.Bundled
22912293
public import Mathlib.CategoryTheory.ConcreteCategory.BundledHom
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/-
2+
Copyright (c) 2025 Joël Riou. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Joël Riou
5+
-/
6+
module
7+
8+
public import Mathlib.CategoryTheory.ComposableArrows.Basic
9+
10+
/-!
11+
# Functors to `ComposableArrows C 1`
12+
13+
-/
14+
15+
@[expose] public section
16+
17+
universe v u
18+
19+
namespace CategoryTheory
20+
21+
namespace ComposableArrows
22+
23+
variable (C : Type u) [Category.{v} C]
24+
25+
/-- The functor `ComposableArrows C n ⥤ ComposableArrows C 1`
26+
which sends `S` to `mk₁ (S.map' i j)` when `i`, `j` and `n`
27+
are such that `i ≤ j` and `j ≤ n`. -/
28+
@[simps]
29+
noncomputable def functorArrows (i j n : ℕ) (hij : i ≤ j := by cutsat)
30+
(hj : j ≤ n := by cutsat) :
31+
ComposableArrows C n ⥤ ComposableArrows C 1 where
32+
obj S := mk₁ (S.map' i j)
33+
map {S S'} φ := homMk₁ (φ.app _) (φ.app _) (φ.naturality _)
34+
35+
/-- The natural transformation `functorArrows C i j n ⟶ functorArrows C i' j' n`
36+
when `i ≤ i'` and `j ≤ j'`. -/
37+
@[simps]
38+
noncomputable def mapFunctorArrows (i j i' j' n : ℕ)
39+
(_ : i ≤ j := by cutsat) (_ : i' ≤ j' := by cutsat)
40+
(_ : i ≤ i' := by cutsat) (_ : j ≤ j' := by cutsat)
41+
(_ : j' ≤ n := by cutsat) :
42+
functorArrows C i j n ⟶ functorArrows C i' j' n where
43+
app S := homMk₁ (S.map' i i') (S.map' j j')
44+
(by simp [← Functor.map_comp])
45+
46+
end ComposableArrows
47+
48+
end CategoryTheory
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/-
2+
Copyright (c) 2025 Joël Riou. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Joël Riou
5+
-/
6+
module
7+
8+
public import Mathlib.CategoryTheory.ComposableArrows.Basic
9+
10+
/-!
11+
# API for compositions of two arrows
12+
13+
Given morphisms `f : i ⟶ j`, `g : j ⟶ k`, and `fg : i ⟶ k` in a category `C`
14+
such that `f ≫ g = fg`, we define maps `twoδ₂Toδ₁ : mk₁ f ⟶ mk₁ fg` and
15+
`twoδ₁Toδ₀ : mk₁ fg ⟶ mk₁ g` in the category `ComposableArrows C 1`.
16+
The names are justified by the fact that `ComposableArrow.mk₂ f g`
17+
can be thought of as a `2`-simplex in the simplicial set `nerve C`,
18+
and its faces (numbered from `0` to `2`) are respectively `mk₁ g`,
19+
`mk₁ fg` and `mk₁ f`.
20+
21+
-/
22+
23+
@[expose] public section
24+
25+
universe v u
26+
27+
namespace CategoryTheory
28+
29+
namespace ComposableArrows
30+
31+
variable {C : Type u} [Category.{v} C]
32+
{i j k : C} (f : i ⟶ j) (g : j ⟶ k) (fg : i ⟶ k) (h : f ≫ g = fg)
33+
34+
/-- The morphism `mk₁ f ⟶ mk₁ fg` when `f ≫ g = fg` for some morphism `g`. -/
35+
def twoδ₂Toδ₁ :
36+
mk₁ f ⟶ mk₁ fg :=
37+
homMk₁ (𝟙 _) g
38+
39+
@[simp]
40+
lemma twoδ₂Toδ₁_app_zero :
41+
(twoδ₂Toδ₁ f g fg h).app 0 = 𝟙 _ := rfl
42+
43+
@[simp]
44+
lemma twoδ₂Toδ₁_app_one :
45+
(twoδ₂Toδ₁ f g fg h).app 1 = g := rfl
46+
47+
/-- The morphism `mk₁ fg ⟶ mk₁ g` when `f ≫ g = fg` for some morphism `f`. -/
48+
def twoδ₁Toδ₀ :
49+
mk₁ fg ⟶ mk₁ g :=
50+
homMk₁ f (𝟙 _)
51+
52+
@[simp]
53+
lemma twoδ₁Toδ₀_app_zero :
54+
(twoδ₁Toδ₀ f g fg h).app 0 = f := rfl
55+
56+
@[simp]
57+
lemma twoδ₁Toδ₀_app_one :
58+
(twoδ₁Toδ₀ f g fg h).app 1 = 𝟙 _ := rfl
59+
60+
end ComposableArrows
61+
62+
end CategoryTheory

0 commit comments

Comments
 (0)