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

Commit a708f85

Browse files
committed
feat(category/limits/shapes): fix biproducts (#3175)
This is a second attempt at #3102. Previously the definition of a (binary) biproduct in a category with zero morphisms (but not necessarily) preadditive was just wrong. The definition for a "bicone" was just something that was simultaneously a cone and a cocone, with the same cone points. It was a "biproduct bicone" if the cone was a limit cone and the cocone was a colimit cocone. However, this definition was not particularly useful. In particular, there was no way to prove that the two different `map` constructions providing a morphism `W ⊞ X ⟶ Y ⊞ Z` (i.e. by treating the biproducts either as cones, or as cocones) were actually equal. Blech. So, I've added the axioms `inl ≫ fst = 𝟙 P`, `inl ≫ snd = 0`, `inr ≫ fst = 0`, and `inr ≫ snd = 𝟙 Q` to `bicone P Q`. (Note these only require the exist of zero morphisms, not preadditivity.) Now the two map constructions are equal. I've then entirely removed the `has_preadditive_biproduct` typeclass. Instead we have 1. additional theorems providing `total`, when `preadditive C` is available 2. alternative constructors for `has_biproduct` that use `total` rather than `is_limit` and `is_colimit`. This PR also introduces some abbreviations along the lines of `abbreviation has_binary_product (X Y : C) := has_limit (pair X Y)`, just to improve readability. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 78beab4 commit a708f85

File tree

5 files changed

+694
-241
lines changed

5 files changed

+694
-241
lines changed

src/algebra/category/Group/biproducts.lean

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ instance has_limit_pair (G H : AddCommGroup.{u}) : has_limit.{u} (pair G H) :=
3333
ext; [rw ← w walking_pair.left, rw ← w walking_pair.right]; refl,
3434
end, } }
3535

36-
instance (G H : AddCommGroup.{u}) : has_preadditive_binary_biproduct.{u} G H :=
37-
has_preadditive_binary_biproduct.of_has_limit_pair _ _
36+
instance (G H : AddCommGroup.{u}) : has_binary_biproduct.{u} G H :=
37+
has_binary_biproduct.of_has_binary_product _ _
3838

3939
-- We verify that the underlying type of the biproduct we've just defined is definitionally
4040
-- the cartesian product of the underlying types:
@@ -140,13 +140,19 @@ open has_limit has_colimit
140140

141141
variables [decidable_eq J] [fintype J]
142142

143-
instance : has_bilimit F :=
143+
instance (f : J → AddCommGroup.{u}) : has_biproduct f :=
144144
{ bicone :=
145-
{ X := AddCommGroup.of (Π j, F.obj j),
146-
ι := discrete.nat_trans (λ j, add_monoid_hom.single (λ j, F.obj j) j),
147-
π := discrete.nat_trans (λ j, add_monoid_hom.apply (λ j, F.obj j) j), },
148-
is_limit := limit.is_limit F,
149-
is_colimit := colimit.is_colimit F, }.
145+
{ X := AddCommGroup.of (Π j, f j),
146+
ι := λ j, add_monoid_hom.single (λ j, f j) j,
147+
π := λ j, add_monoid_hom.apply (λ j, f j) j,
148+
ι_π := λ j j',
149+
begin
150+
ext, split_ifs,
151+
{ subst h, simp, },
152+
{ rw [eq_comm] at h, simp [h], },
153+
end, },
154+
is_limit := limit.is_limit (discrete.functor f),
155+
is_colimit := colimit.is_colimit (discrete.functor f), }.
150156

151157
-- We verify that the underlying type of the biproduct we've just defined is definitionally
152158
-- the dependent function type:

src/category_theory/abelian/basic.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ end
326326

327327
section
328328
local attribute [instance] preadditive.has_coequalizers_of_has_cokernels
329-
local attribute [instance] has_preadditive_binary_biproducts_of_has_binary_products
329+
local attribute [instance] has_binary_biproducts.of_has_binary_products
330330

331331
/-- Any abelian category has pushouts -/
332332
def has_pushouts : has_pushouts.{v} C :=
@@ -337,7 +337,7 @@ end
337337
namespace pullback_to_biproduct_is_kernel
338338
variables [limits.has_pullbacks.{v} C] {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z)
339339

340-
local attribute [instance] has_preadditive_binary_biproducts_of_has_binary_products
340+
local attribute [instance] has_binary_biproducts.of_has_binary_products
341341

342342
/-! This section contains a slightly technical result about pullbacks and biproducts.
343343
We will need it in the proof that the pullback of an epimorphism is an epimorpism. -/
@@ -362,7 +362,7 @@ def is_limit_pullback_to_biproduct : is_limit (pullback_to_biproduct_fork f g) :
362362
fork.is_limit.mk _
363363
(λ s, pullback.lift (fork.ι s ≫ biprod.fst) (fork.ι s ≫ biprod.snd) $
364364
sub_eq_zero.1 $ by rw [category.assoc, category.assoc, ←comp_sub, sub_eq_add_neg, ←comp_neg,
365-
biprod.fst_add_snd, kernel_fork.condition s])
365+
biprod.desc_eq, kernel_fork.condition s])
366366
(λ s,
367367
begin
368368
ext; rw [fork.ι_of_ι, category.assoc],
@@ -376,7 +376,7 @@ end pullback_to_biproduct_is_kernel
376376
namespace biproduct_to_pushout_is_cokernel
377377
variables [limits.has_pushouts.{v} C] {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z)
378378

379-
local attribute [instance] has_preadditive_binary_biproducts_of_has_binary_products
379+
local attribute [instance] has_binary_biproducts.of_has_binary_products
380380

381381
/-- The canonical map `Y ⊞ Z ⟶ pushout f g` -/
382382
abbreviation biproduct_to_pushout : Y ⊞ Z ⟶ pushout f g :=
@@ -394,7 +394,7 @@ def is_colimit_biproduct_to_pushout : is_colimit (biproduct_to_pushout_cofork f
394394
cofork.is_colimit.mk _
395395
(λ s, pushout.desc (biprod.inl ≫ cofork.π s) (biprod.inr ≫ cofork.π s) $
396396
sub_eq_zero.1 $ by rw [←category.assoc, ←category.assoc, ←sub_comp, sub_eq_add_neg, ←neg_comp,
397-
biprod.inl_add_inr, cofork.condition s, has_zero_morphisms.zero_comp])
397+
biprod.lift_eq, cofork.condition s, has_zero_morphisms.zero_comp])
398398
(λ s, by ext; simp)
399399
(λ s m h, by ext; simp [cofork.π_eq_app_one, ←h walking_parallel_pair.one] )
400400

@@ -403,7 +403,7 @@ end biproduct_to_pushout_is_cokernel
403403
section epi_pullback
404404
variables [limits.has_pullbacks.{v} C] {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z)
405405

406-
local attribute [instance] has_preadditive_binary_biproducts_of_has_binary_products
406+
local attribute [instance] has_binary_biproducts.of_has_binary_products
407407

408408
/-- In an abelian category, the pullback of an epimorphism is an epimorphism.
409409
Proof from [aluffi2016, IX.2.3], cf. [borceux-vol2, 1.7.6] -/
@@ -479,7 +479,7 @@ end epi_pullback
479479
section mono_pushout
480480
variables [limits.has_pushouts.{v} C] {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z)
481481

482-
local attribute [instance] has_preadditive_binary_biproducts_of_has_binary_products
482+
local attribute [instance] has_binary_biproducts.of_has_binary_products
483483

484484
instance mono_pushout_of_mono_f [mono f] : mono (pushout.inr : Z ⟶ pushout f g) :=
485485
mono_of_cancel_zero _ $ λ R e h,

src/category_theory/limits/shapes/binary_products.lean

Lines changed: 84 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,34 @@ instance fintype_walking_pair : fintype walking_pair :=
3838
{ elems := {left, right},
3939
complete := λ x, by { cases x; simp } }
4040

41+
/--
42+
The equivalence swapping left and right.
43+
-/
44+
def walking_pair.swap : walking_pair ≃ walking_pair :=
45+
{ to_fun := λ j, walking_pair.rec_on j right left,
46+
inv_fun := λ j, walking_pair.rec_on j right left,
47+
left_inv := λ j, by { cases j; refl, },
48+
right_inv := λ j, by { cases j; refl, }, }
49+
50+
@[simp] lemma walking_pair.swap_apply_left : walking_pair.swap left = right := rfl
51+
@[simp] lemma walking_pair.swap_apply_right : walking_pair.swap right = left := rfl
52+
@[simp] lemma walking_pair.swap_symm_apply_tt : walking_pair.swap.symm left = right := rfl
53+
@[simp] lemma walking_pair.swap_symm_apply_ff : walking_pair.swap.symm right = left := rfl
54+
55+
/--
56+
An equivalence from `walking_pair` to `bool`, sometimes useful when reindexing limits.
57+
-/
58+
def walking_pair.equiv_bool : walking_pair ≃ bool :=
59+
{ to_fun := λ j, walking_pair.rec_on j tt ff, -- to match equiv.sum_equiv_sigma_bool
60+
inv_fun := λ b, bool.rec_on b right left,
61+
left_inv := λ j, by { cases j; refl, },
62+
right_inv := λ b, by { cases b; refl, }, }
63+
64+
@[simp] lemma walking_pair.equiv_bool_apply_left : walking_pair.equiv_bool left = tt := rfl
65+
@[simp] lemma walking_pair.equiv_bool_apply_right : walking_pair.equiv_bool right = ff := rfl
66+
@[simp] lemma walking_pair.equiv_bool_symm_apply_tt : walking_pair.equiv_bool.symm tt = left := rfl
67+
@[simp] lemma walking_pair.equiv_bool_symm_apply_ff : walking_pair.equiv_bool.symm ff = right := rfl
68+
4169
variables {C : Type u} [category.{v} C]
4270

4371
/-- The diagram on the walking pair, sending the two points to `X` and `Y`. -/
@@ -143,109 +171,114 @@ def binary_cofan.is_colimit.desc' {W X Y : C} {s : binary_cofan X Y} (h : is_col
143171
(g : Y ⟶ W) : {l : s.X ⟶ W // s.inl ≫ l = f ∧ s.inr ≫ l = g} :=
144172
⟨h.desc $ binary_cofan.mk f g, h.fac _ _, h.fac _ _⟩
145173

174+
/-- An abbreviation for `has_limit (pair X Y)`. -/
175+
abbreviation has_binary_product (X Y : C) := has_limit (pair X Y)
176+
/-- An abbreviation for `has_colimit (pair X Y)`. -/
177+
abbreviation has_binary_coproduct (X Y : C) := has_colimit (pair X Y)
178+
146179
/-- If we have chosen a product of `X` and `Y`, we can access it using `prod X Y` or
147180
`X ⨯ Y`. -/
148-
abbreviation prod (X Y : C) [has_limit (pair X Y)] := limit (pair X Y)
181+
abbreviation prod (X Y : C) [has_binary_product X Y] := limit (pair X Y)
149182

150183
/-- If we have chosen a coproduct of `X` and `Y`, we can access it using `coprod X Y ` or
151184
`X ⨿ Y`. -/
152-
abbreviation coprod (X Y : C) [has_colimit (pair X Y)] := colimit (pair X Y)
185+
abbreviation coprod (X Y : C) [has_binary_coproduct X Y] := colimit (pair X Y)
153186

154187
notation X ` ⨯ `:20 Y:20 := prod X Y
155188
notation X ` ⨿ `:20 Y:20 := coprod X Y
156189

157190
/-- The projection map to the first component of the product. -/
158-
abbreviation prod.fst {X Y : C} [has_limit (pair X Y)] : X ⨯ Y ⟶ X :=
191+
abbreviation prod.fst {X Y : C} [has_binary_product X Y] : X ⨯ Y ⟶ X :=
159192
limit.π (pair X Y) walking_pair.left
160193

161194
/-- The projecton map to the second component of the product. -/
162-
abbreviation prod.snd {X Y : C} [has_limit (pair X Y)] : X ⨯ Y ⟶ Y :=
195+
abbreviation prod.snd {X Y : C} [has_binary_product X Y] : X ⨯ Y ⟶ Y :=
163196
limit.π (pair X Y) walking_pair.right
164197

165198
/-- The inclusion map from the first component of the coproduct. -/
166-
abbreviation coprod.inl {X Y : C} [has_colimit (pair X Y)] : X ⟶ X ⨿ Y :=
199+
abbreviation coprod.inl {X Y : C} [has_binary_coproduct X Y] : X ⟶ X ⨿ Y :=
167200
colimit.ι (pair X Y) walking_pair.left
168201

169202
/-- The inclusion map from the second component of the coproduct. -/
170-
abbreviation coprod.inr {X Y : C} [has_colimit (pair X Y)] : Y ⟶ X ⨿ Y :=
203+
abbreviation coprod.inr {X Y : C} [has_binary_coproduct X Y] : Y ⟶ X ⨿ Y :=
171204
colimit.ι (pair X Y) walking_pair.right
172205

173-
@[ext] lemma prod.hom_ext {W X Y : C} [has_limit (pair X Y)] {f g : W ⟶ X ⨯ Y}
206+
@[ext] lemma prod.hom_ext {W X Y : C} [has_binary_product X Y] {f g : W ⟶ X ⨯ Y}
174207
(h₁ : f ≫ prod.fst = g ≫ prod.fst) (h₂ : f ≫ prod.snd = g ≫ prod.snd) : f = g :=
175208
binary_fan.is_limit.hom_ext (limit.is_limit _) h₁ h₂
176209

177-
@[ext] lemma coprod.hom_ext {W X Y : C} [has_colimit (pair X Y)] {f g : X ⨿ Y ⟶ W}
210+
@[ext] lemma coprod.hom_ext {W X Y : C} [has_binary_coproduct X Y] {f g : X ⨿ Y ⟶ W}
178211
(h₁ : coprod.inl ≫ f = coprod.inl ≫ g) (h₂ : coprod.inr ≫ f = coprod.inr ≫ g) : f = g :=
179212
binary_cofan.is_colimit.hom_ext (colimit.is_colimit _) h₁ h₂
180213

181214
/-- If the product of `X` and `Y` exists, then every pair of morphisms `f : W ⟶ X` and `g : W ⟶ Y`
182215
induces a morphism `prod.lift f g : W ⟶ X ⨯ Y`. -/
183-
abbreviation prod.lift {W X Y : C} [has_limit (pair X Y)] (f : W ⟶ X) (g : W ⟶ Y) : W ⟶ X ⨯ Y :=
216+
abbreviation prod.lift {W X Y : C} [has_binary_product X Y] (f : W ⟶ X) (g : W ⟶ Y) : W ⟶ X ⨯ Y :=
184217
limit.lift _ (binary_fan.mk f g)
185218

186219
/-- If the coproduct of `X` and `Y` exists, then every pair of morphisms `f : X ⟶ W` and
187220
`g : Y ⟶ W` induces a morphism `coprod.desc f g : X ⨿ Y ⟶ W`. -/
188-
abbreviation coprod.desc {W X Y : C} [has_colimit (pair X Y)] (f : X ⟶ W) (g : Y ⟶ W) : X ⨿ Y ⟶ W :=
221+
abbreviation coprod.desc {W X Y : C} [has_binary_coproduct X Y] (f : X ⟶ W) (g : Y ⟶ W) : X ⨿ Y ⟶ W :=
189222
colimit.desc _ (binary_cofan.mk f g)
190223

191224
@[simp, reassoc]
192-
lemma prod.lift_fst {W X Y : C} [has_limit (pair X Y)] (f : W ⟶ X) (g : W ⟶ Y) :
225+
lemma prod.lift_fst {W X Y : C} [has_binary_product X Y] (f : W ⟶ X) (g : W ⟶ Y) :
193226
prod.lift f g ≫ prod.fst = f :=
194227
limit.lift_π _ _
195228

196229
@[simp, reassoc]
197-
lemma prod.lift_snd {W X Y : C} [has_limit (pair X Y)] (f : W ⟶ X) (g : W ⟶ Y) :
230+
lemma prod.lift_snd {W X Y : C} [has_binary_product X Y] (f : W ⟶ X) (g : W ⟶ Y) :
198231
prod.lift f g ≫ prod.snd = g :=
199232
limit.lift_π _ _
200233

201234
/- The redundant simp lemma linter says that simp can prove the reassoc version of this lemma. -/
202235
@[reassoc, simp]
203-
lemma prod.lift_comp_comp {V W X Y : C} [has_limit (pair X Y)] (f : V ⟶ W) (g : W ⟶ X) (h : W ⟶ Y) :
236+
lemma prod.lift_comp_comp {V W X Y : C} [has_binary_product X Y] (f : V ⟶ W) (g : W ⟶ X) (h : W ⟶ Y) :
204237
prod.lift (f ≫ g) (f ≫ h) = f ≫ prod.lift g h :=
205238
by tidy
206239

207240
@[simp, reassoc]
208-
lemma coprod.inl_desc {W X Y : C} [has_colimit (pair X Y)] (f : X ⟶ W) (g : Y ⟶ W) :
241+
lemma coprod.inl_desc {W X Y : C} [has_binary_coproduct X Y] (f : X ⟶ W) (g : Y ⟶ W) :
209242
coprod.inl ≫ coprod.desc f g = f :=
210243
colimit.ι_desc _ _
211244

212245
@[simp, reassoc]
213-
lemma coprod.inr_desc {W X Y : C} [has_colimit (pair X Y)] (f : X ⟶ W) (g : Y ⟶ W) :
246+
lemma coprod.inr_desc {W X Y : C} [has_binary_coproduct X Y] (f : X ⟶ W) (g : Y ⟶ W) :
214247
coprod.inr ≫ coprod.desc f g = g :=
215248
colimit.ι_desc _ _
216249

217250
/- The redundant simp lemma linter says that simp can prove the reassoc version of this lemma. -/
218251
@[reassoc, simp]
219-
lemma coprod.desc_comp_comp {V W X Y : C} [has_colimit (pair X Y)] (f : V ⟶ W) (g : X ⟶ V)
252+
lemma coprod.desc_comp_comp {V W X Y : C} [has_binary_coproduct X Y] (f : V ⟶ W) (g : X ⟶ V)
220253
(h : Y ⟶ V) : coprod.desc (g ≫ f) (h ≫ f) = coprod.desc g h ≫ f :=
221254
by tidy
222255

223-
instance prod.mono_lift_of_mono_left {W X Y : C} [has_limit (pair X Y)] (f : W ⟶ X) (g : W ⟶ Y)
256+
instance prod.mono_lift_of_mono_left {W X Y : C} [has_binary_product X Y] (f : W ⟶ X) (g : W ⟶ Y)
224257
[mono f] : mono (prod.lift f g) :=
225258
mono_of_mono_fac $ prod.lift_fst _ _
226259

227-
instance prod.mono_lift_of_mono_right {W X Y : C} [has_limit (pair X Y)] (f : W ⟶ X) (g : W ⟶ Y)
260+
instance prod.mono_lift_of_mono_right {W X Y : C} [has_binary_product X Y] (f : W ⟶ X) (g : W ⟶ Y)
228261
[mono g] : mono (prod.lift f g) :=
229262
mono_of_mono_fac $ prod.lift_snd _ _
230263

231-
instance coprod.epi_desc_of_epi_left {W X Y : C} [has_colimit (pair X Y)] (f : X ⟶ W) (g : Y ⟶ W)
264+
instance coprod.epi_desc_of_epi_left {W X Y : C} [has_binary_coproduct X Y] (f : X ⟶ W) (g : Y ⟶ W)
232265
[epi f] : epi (coprod.desc f g) :=
233266
epi_of_epi_fac $ coprod.inl_desc _ _
234267

235-
instance coprod.epi_desc_of_epi_right {W X Y : C} [has_colimit (pair X Y)] (f : X ⟶ W) (g : Y ⟶ W)
268+
instance coprod.epi_desc_of_epi_right {W X Y : C} [has_binary_coproduct X Y] (f : X ⟶ W) (g : Y ⟶ W)
236269
[epi g] : epi (coprod.desc f g) :=
237270
epi_of_epi_fac $ coprod.inr_desc _ _
238271

239272
/-- If the product of `X` and `Y` exists, then every pair of morphisms `f : W ⟶ X` and `g : W ⟶ Y`
240273
induces a morphism `l : W ⟶ X ⨯ Y` satisfying `l ≫ prod.fst = f` and `l ≫ prod.snd = g`. -/
241-
def prod.lift' {W X Y : C} [has_limit (pair X Y)] (f : W ⟶ X) (g : W ⟶ Y) :
274+
def prod.lift' {W X Y : C} [has_binary_product X Y] (f : W ⟶ X) (g : W ⟶ Y) :
242275
{l : W ⟶ X ⨯ Y // l ≫ prod.fst = f ∧ l ≫ prod.snd = g} :=
243276
⟨prod.lift f g, prod.lift_fst _ _, prod.lift_snd _ _⟩
244277

245278
/-- If the coproduct of `X` and `Y` exists, then every pair of morphisms `f : X ⟶ W` and
246279
`g : Y ⟶ W` induces a morphism `l : X ⨿ Y ⟶ W` satisfying `coprod.inl ≫ l = f` and
247280
`coprod.inr ≫ l = g`. -/
248-
def coprod.desc' {W X Y : C} [has_colimit (pair X Y)] (f : X ⟶ W) (g : Y ⟶ W) :
281+
def coprod.desc' {W X Y : C} [has_binary_coproduct X Y] (f : X ⟶ W) (g : Y ⟶ W) :
249282
{l : X ⨿ Y ⟶ W // coprod.inl ≫ l = f ∧ coprod.inr ≫ l = g} :=
250283
⟨coprod.desc f g, coprod.inl_desc _ _, coprod.inr_desc _ _⟩
251284

@@ -255,12 +288,41 @@ abbreviation prod.map {W X Y Z : C} [has_limits_of_shape.{v} (discrete walking_p
255288
(f : W ⟶ Y) (g : X ⟶ Z) : W ⨯ X ⟶ Y ⨯ Z :=
256289
lim.map (map_pair f g)
257290

291+
/-- If the products `W ⨯ X` and `Y ⨯ Z` exist, then every pair of isomorphisms `f : W ≅ Y` and
292+
`g : X ≅ Z` induces a isomorphism `prod.map_iso f g : W ⨯ X ≅ Y ⨯ Z`. -/
293+
abbreviation prod.map_iso {W X Y Z : C} [has_limits_of_shape.{v} (discrete walking_pair) C]
294+
(f : W ≅ Y) (g : X ≅ Z) : W ⨯ X ≅ Y ⨯ Z :=
295+
lim.map_iso (map_pair_iso f g)
296+
297+
-- Note that the next two `simp` lemmas are proved by `simp`,
298+
-- but nevertheless are useful,
299+
-- because they state the right hand side in terms of `prod.map`
300+
-- rather than `lim.map`.
301+
@[simp] lemma prod.map_iso_hom {W X Y Z : C} [has_limits_of_shape.{v} (discrete walking_pair) C]
302+
(f : W ≅ Y) (g : X ≅ Z) : (prod.map_iso f g).hom = prod.map f.hom g.hom := by simp
303+
304+
@[simp] lemma prod.map_iso_inv {W X Y Z : C} [has_limits_of_shape.{v} (discrete walking_pair) C]
305+
(f : W ≅ Y) (g : X ≅ Z) : (prod.map_iso f g).inv = prod.map f.inv g.inv := by simp
306+
258307
/-- If the coproducts `W ⨿ X` and `Y ⨿ Z` exist, then every pair of morphisms `f : W ⟶ Y` and
259308
`g : W ⟶ Z` induces a morphism `coprod.map f g : W ⨿ X ⟶ Y ⨿ Z`. -/
260309
abbreviation coprod.map {W X Y Z : C} [has_colimits_of_shape.{v} (discrete walking_pair) C]
261310
(f : W ⟶ Y) (g : X ⟶ Z) : W ⨿ X ⟶ Y ⨿ Z :=
262311
colim.map (map_pair f g)
263312

313+
/-- If the coproducts `W ⨿ X` and `Y ⨿ Z` exist, then every pair of isomorphisms `f : W ≅ Y` and
314+
`g : W ≅ Z` induces a isomorphism `coprod.map_iso f g : W ⨿ X ≅ Y ⨿ Z`. -/
315+
abbreviation coprod.map_iso {W X Y Z : C} [has_colimits_of_shape.{v} (discrete walking_pair) C]
316+
(f : W ≅ Y) (g : X ≅ Z) : W ⨿ X ≅ Y ⨿ Z :=
317+
colim.map_iso (map_pair_iso f g)
318+
319+
@[simp] lemma coprod.map_iso_hom {W X Y Z : C} [has_colimits_of_shape.{v} (discrete walking_pair) C]
320+
(f : W ≅ Y) (g : X ≅ Z) : (coprod.map_iso f g).hom = coprod.map f.hom g.hom := by simp
321+
322+
@[simp] lemma coprod.map_iso_inv {W X Y Z : C} [has_colimits_of_shape.{v} (discrete walking_pair) C]
323+
(f : W ≅ Y) (g : X ≅ Z) : (coprod.map_iso f g).inv = coprod.map f.inv g.inv := by simp
324+
325+
264326
section prod_lemmas
265327
variable [has_limits_of_shape.{v} (discrete walking_pair) C]
266328

0 commit comments

Comments
 (0)