Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 00e7ca5

Browse files
committed
feat(category_theory/limits/shapes/comm_sq): opposites of is_pullback and is_pushout (#15269)
This PR shows that the dual of a pushout commutative square is a pullback square, and similar other results. The most basic `comm_sq` API is also moved to a separate file with fewer dependencies so as to prepare for a refactor of lifting properties which shall be based on `comm_sq`.
1 parent cd7b23d commit 00e7ca5

File tree

2 files changed

+129
-26
lines changed

2 files changed

+129
-26
lines changed

src/category_theory/comm_sq.lean

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/-
2+
Copyright (c) 2022 Scott Morrison. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Scott Morrison
5+
-/
6+
import category_theory.arrow
7+
8+
9+
/-!
10+
# Commutative squares
11+
12+
This file provide an API for commutative squares in categories.
13+
If `top`, `left`, `right` and `bottom` are four morphisms which are the edges
14+
of a square, `comm_sq top left right bottom` is the predicate that this
15+
square is commutative.
16+
17+
The structure `comm_sq` is extended in `category_theory/shapes/limits/comm_sq.lean`
18+
as `is_pullback` and `is_pushout` in order to define pullback and pushout squares.
19+
20+
## Future work
21+
22+
Refactor `lift_struct` from `arrow.lean` and lifting properties using `comm_sq.lean`.
23+
24+
-/
25+
26+
namespace category_theory
27+
28+
variables {C : Type*} [category C]
29+
30+
/-- The proposition that a square
31+
```
32+
W ---f---> X
33+
| |
34+
g h
35+
| |
36+
v v
37+
Y ---i---> Z
38+
39+
```
40+
is a commuting square.
41+
-/
42+
structure comm_sq {W X Y Z : C} (f : W ⟶ X) (g : W ⟶ Y) (h : X ⟶ Z) (i : Y ⟶ Z) : Prop :=
43+
(w : f ≫ h = g ≫ i)
44+
45+
attribute [reassoc] comm_sq.w
46+
47+
namespace comm_sq
48+
49+
variables {W X Y Z : C} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z}
50+
51+
lemma flip (p : comm_sq f g h i) : comm_sq g f i h := ⟨p.w.symm⟩
52+
53+
lemma of_arrow {f g : arrow C} (h : f ⟶ g) : comm_sq f.hom h.left h.right g.hom := ⟨h.w.symm⟩
54+
55+
/-- The commutative square in the opposite category associated to a commutative square. -/
56+
lemma op (p : comm_sq f g h i) : comm_sq i.op h.op g.op f.op :=
57+
by simp only [← op_comp, p.w]⟩
58+
59+
/-- The commutative square associated to a commutative square in the opposite category. -/
60+
lemma unop {W X Y Z : Cᵒᵖ} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z}
61+
(p : comm_sq f g h i) : comm_sq i.unop h.unop g.unop f.unop :=
62+
by simp only [← unop_comp, p.w]⟩
63+
64+
end comm_sq
65+
66+
namespace functor
67+
68+
variables {D : Type*} [category D]
69+
variables (F : C ⥤ D) {W X Y Z : C} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z}
70+
71+
lemma map_comm_sq (s : comm_sq f g h i) : comm_sq (F.map f) (F.map g) (F.map h) (F.map i) :=
72+
by simpa using congr_arg (λ k : W ⟶ Z, F.map k) s.w⟩
73+
74+
end functor
75+
76+
alias functor.map_comm_sq ← comm_sq.map
77+
78+
end category_theory

src/category_theory/limits/shapes/comm_sq.lean

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/-
22
Copyright (c) 2022 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Scott Morrison
4+
Authors: Scott Morrison, Joël Riou
55
-/
6+
import category_theory.comm_sq
67
import category_theory.limits.preserves.shapes.pullbacks
78
import category_theory.limits.shapes.zero_morphisms
89
import category_theory.limits.constructions.binary_products
10+
import category_theory.limits.opposites
911

1012
/-!
1113
# Pullback and pushout squares
@@ -49,31 +51,10 @@ namespace category_theory
4951

5052
variables {C : Type u₁} [category.{v₁} C]
5153

52-
/-- The proposition that a square
53-
```
54-
W ---f---> X
55-
| |
56-
g h
57-
| |
58-
v v
59-
Y ---i---> Z
60-
61-
```
62-
is a commuting square.
63-
-/
64-
structure comm_sq {W X Y Z : C} (f : W ⟶ X) (g : W ⟶ Y) (h : X ⟶ Z) (i : Y ⟶ Z) : Prop :=
65-
(w : f ≫ h = g ≫ i)
66-
67-
attribute [reassoc] comm_sq.w
68-
6954
namespace comm_sq
7055

7156
variables {W X Y Z : C} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z}
7257

73-
lemma flip (p : comm_sq f g h i) : comm_sq g f i h := ⟨p.w.symm⟩
74-
75-
lemma of_arrow {f g : arrow C} (h : f ⟶ g) : comm_sq f.hom h.left h.right g.hom := ⟨h.w.symm⟩
76-
7758
/--
7859
The (not necessarily limiting) `pullback_cone h i` implicit in the statement
7960
that we have `comm_sq f g h i`.
@@ -86,6 +67,32 @@ that we have `comm_sq f g h i`.
8667
-/
8768
def cocone (s : comm_sq f g h i) : pushout_cocone f g := pushout_cocone.mk _ _ s.w
8869

70+
/-- The pushout cocone in the opposite category associated to the cone of
71+
a commutative square identifies to the cocone of the flipped commutative square in
72+
the opposite category -/
73+
def cone_op (p : comm_sq f g h i) : p.cone.op ≅ p.flip.op.cocone :=
74+
pushout_cocone.ext (iso.refl _) (by tidy) (by tidy)
75+
76+
/-- The pullback cone in the opposite category associated to the cocone of
77+
a commutative square identifies to the cone of the flipped commutative square in
78+
the opposite category -/
79+
def cocone_op (p : comm_sq f g h i) : p.cocone.op ≅ p.flip.op.cone :=
80+
pullback_cone.ext (iso.refl _) (by tidy) (by tidy)
81+
82+
/-- The pushout cocone obtained from the pullback cone associated to a
83+
commutative square in the opposite category identifies to the cocone associated
84+
to the flipped square. -/
85+
def cone_unop {W X Y Z : Cᵒᵖ} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z}
86+
(p : comm_sq f g h i) : p.cone.unop ≅ p.flip.unop.cocone :=
87+
pushout_cocone.ext (iso.refl _) (by tidy) (by tidy)
88+
89+
/-- The pullback cone obtained from the pushout cone associated to a
90+
commutative square in the opposite category identifies to the cone associated
91+
to the flipped square. -/
92+
def cocone_unop {W X Y Z : Cᵒᵖ} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z}
93+
(p : comm_sq f g h i) : p.cocone.unop ≅ p.flip.unop.cone :=
94+
pullback_cone.ext (iso.refl _) (by tidy) (by tidy)
95+
8996
end comm_sq
9097

9198
/-- The proposition that a square
@@ -357,6 +364,17 @@ lemma of_right {X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C}
357364
is_pullback h₁₁ v₁₁ v₁₂ h₂₁ :=
358365
(of_bot s.flip p.symm t.flip).flip
359366

367+
lemma op (h : is_pullback fst snd f g) : is_pushout g.op f.op snd.op fst.op :=
368+
is_pushout.of_is_colimit (is_colimit.of_iso_colimit
369+
(limits.pullback_cone.is_limit_equiv_is_colimit_op h.flip.cone h.flip.is_limit)
370+
h.to_comm_sq.flip.cone_op)
371+
372+
lemma unop {P X Y Z : Cᵒᵖ} {fst : P ⟶ X} {snd : P ⟶ Y} {f : X ⟶ Z} {g : Y ⟶ Z}
373+
(h : is_pullback fst snd f g) : is_pushout g.unop f.unop snd.unop fst.unop :=
374+
is_pushout.of_is_colimit (is_colimit.of_iso_colimit
375+
(limits.pullback_cone.is_limit_equiv_is_colimit_unop h.flip.cone h.flip.is_limit)
376+
h.to_comm_sq.flip.cone_unop)
377+
360378
end is_pullback
361379

362380
namespace is_pushout
@@ -429,16 +447,24 @@ lemma of_right {X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C}
429447
is_pushout h₁₂ v₁₂ v₁₃ h₂₂ :=
430448
(of_bot s.flip p.symm t.flip).flip
431449

450+
lemma op (h : is_pushout f g inl inr) : is_pullback inr.op inl.op g.op f.op :=
451+
is_pullback.of_is_limit (is_limit.of_iso_limit
452+
(limits.pushout_cocone.is_colimit_equiv_is_limit_op h.flip.cocone h.flip.is_colimit)
453+
h.to_comm_sq.flip.cocone_op)
454+
455+
lemma unop {Z X Y P : Cᵒᵖ} {f : Z ⟶ X} {g : Z ⟶ Y} {inl : X ⟶ P} {inr : Y ⟶ P}
456+
(h : is_pushout f g inl inr) : is_pullback inr.unop inl.unop g.unop f.unop :=
457+
is_pullback.of_is_limit (is_limit.of_iso_limit
458+
(limits.pushout_cocone.is_colimit_equiv_is_limit_unop h.flip.cocone h.flip.is_colimit)
459+
h.to_comm_sq.flip.cocone_unop)
460+
432461
end is_pushout
433462

434463
namespace functor
435464

436465
variables {D : Type u₂} [category.{v₂} D]
437466
variables (F : C ⥤ D) {W X Y Z : C} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z}
438467

439-
lemma map_comm_sq (s : comm_sq f g h i) : comm_sq (F.map f) (F.map g) (F.map h) (F.map i) :=
440-
by simpa using congr_arg (λ k : W ⟶ Z, F.map k) s.w⟩
441-
442468
lemma map_is_pullback [preserves_limit (cospan h i) F] (s : is_pullback f g h i) :
443469
is_pullback (F.map f) (F.map g) (F.map h) (F.map i) :=
444470
-- This is made slightly awkward because `C` and `D` have different universes,
@@ -465,7 +491,6 @@ end
465491

466492
end functor
467493

468-
alias functor.map_comm_sq ← comm_sq.map
469494
alias functor.map_is_pullback ← is_pullback.map
470495
alias functor.map_is_pushout ← is_pushout.map
471496

0 commit comments

Comments
 (0)