Skip to content

Commit e9d46c6

Browse files
committed
feat(CategoryTheory): description of products and pullbacks in concrete categories (#8507)
Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
1 parent a785b32 commit e9d46c6

File tree

8 files changed

+300
-143
lines changed

8 files changed

+300
-143
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ import Mathlib.CategoryTheory.Limits.Presheaf
10831083
import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts
10841084
import Mathlib.CategoryTheory.Limits.Shapes.Biproducts
10851085
import Mathlib.CategoryTheory.Limits.Shapes.CommSq
1086+
import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory
10861087
import Mathlib.CategoryTheory.Limits.Shapes.Diagonal
10871088
import Mathlib.CategoryTheory.Limits.Shapes.DisjointCoproduct
10881089
import Mathlib.CategoryTheory.Limits.Shapes.Equalizers

Mathlib/Algebra/Homology/ModuleCat.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Authors: Scott Morrison
66
import Mathlib.Algebra.Homology.Homotopy
77
import Mathlib.Algebra.Category.ModuleCat.Abelian
88
import Mathlib.Algebra.Category.ModuleCat.Subobject
9-
import Mathlib.CategoryTheory.Limits.ConcreteCategory
9+
import Mathlib.CategoryTheory.Limits.Shapes.ConcreteCategory
1010

1111
#align_import algebra.homology.Module from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a"
1212

@@ -42,7 +42,7 @@ theorem homology'_ext {L M N K : ModuleCat R} {f : L ⟶ M} {g : M ⟶ N} (w : f
4242
h (cokernel.π (imageToKernel _ _ w) (toKernelSubobject x)) =
4343
k (cokernel.π (imageToKernel _ _ w) (toKernelSubobject x))) :
4444
h = k := by
45-
refine' cokernel_funext fun n => _
45+
refine' Concrete.cokernel_funext fun n => _
4646
-- porting note: as `equiv_rw` was not ported, it was replaced by `Equiv.surjective`
4747
-- Gosh it would be nice if `equiv_rw` could directly use an isomorphism, or an enriched `≃`.
4848
obtain ⟨n, rfl⟩ := (kernelSubobjectIso g ≪≫

Mathlib/CategoryTheory/Limits/ConcreteCategory.lean

Lines changed: 1 addition & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ Copyright (c) 2017 Scott Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Scott Morrison, Adam Topaz
55
-/
6+
import Mathlib.CategoryTheory.ConcreteCategory.Basic
67
import Mathlib.CategoryTheory.Limits.Preserves.Basic
78
import Mathlib.CategoryTheory.Limits.Types
8-
import Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks
9-
import Mathlib.CategoryTheory.Limits.Shapes.Multiequalizer
10-
import Mathlib.CategoryTheory.ConcreteCategory.Basic
11-
import Mathlib.CategoryTheory.Limits.Shapes.Kernels
129
import Mathlib.Tactic.ApplyFun
1310

1411
#align_import category_theory.limits.concrete_category from "leanprover-community/mathlib"@"c3019c79074b0619edb4b27553a91b2e82242395"
@@ -57,112 +54,10 @@ theorem Concrete.limit_ext [HasLimit F] (x y : ↑(limit F)) :
5754
Concrete.isLimit_ext F (limit.isLimit _) _ _
5855
#align category_theory.limits.concrete.limit_ext CategoryTheory.Limits.Concrete.limit_ext
5956

60-
section WidePullback
61-
62-
open WidePullback
63-
64-
open WidePullbackShape
65-
66-
theorem Concrete.widePullback_ext {B : C} {ι : Type w} {X : ι → C} (f : ∀ j : ι, X j ⟶ B)
67-
[HasWidePullback B X f] [PreservesLimit (wideCospan B X f) (forget C)]
68-
(x y : ↑(widePullback B X f)) (h₀ : base f x = base f y) (h : ∀ j, π f j x = π f j y) :
69-
x = y := by
70-
apply Concrete.limit_ext
71-
rintro (_ | j)
72-
· exact h₀
73-
· apply h
74-
#align category_theory.limits.concrete.wide_pullback_ext CategoryTheory.Limits.Concrete.widePullback_ext
75-
76-
theorem Concrete.widePullback_ext' {B : C} {ι : Type w} [Nonempty ι] {X : ι → C}
77-
(f : ∀ j : ι, X j ⟶ B) [HasWidePullback.{w} B X f]
78-
[PreservesLimit (wideCospan B X f) (forget C)] (x y : ↑(widePullback B X f))
79-
(h : ∀ j, π f j x = π f j y) : x = y := by
80-
apply Concrete.widePullback_ext _ _ _ _ h
81-
inhabit ι
82-
simp only [← π_arrow f default, comp_apply, h]
83-
#align category_theory.limits.concrete.wide_pullback_ext' CategoryTheory.Limits.Concrete.widePullback_ext'
84-
85-
end WidePullback
86-
87-
section Multiequalizer
88-
89-
theorem Concrete.multiequalizer_ext {I : MulticospanIndex.{w} C} [HasMultiequalizer I]
90-
[PreservesLimit I.multicospan (forget C)] (x y : ↑(multiequalizer I))
91-
(h : ∀ t : I.L, Multiequalizer.ι I t x = Multiequalizer.ι I t y) : x = y := by
92-
apply Concrete.limit_ext
93-
rintro (a | b)
94-
· apply h
95-
· rw [← limit.w I.multicospan (WalkingMulticospan.Hom.fst b), comp_apply, comp_apply]
96-
simp [h]
97-
#align category_theory.limits.concrete.multiequalizer_ext CategoryTheory.Limits.Concrete.multiequalizer_ext
98-
99-
/-- An auxiliary equivalence to be used in `multiequalizerEquiv` below.-/
100-
def Concrete.multiequalizerEquivAux (I : MulticospanIndex C) :
101-
(I.multicospan ⋙ forget C).sections ≃
102-
{ x : ∀ i : I.L, I.left i // ∀ i : I.R, I.fst i (x _) = I.snd i (x _) } where
103-
toFun x :=
104-
fun i => x.1 (WalkingMulticospan.left _), fun i => by
105-
have a := x.2 (WalkingMulticospan.Hom.fst i)
106-
have b := x.2 (WalkingMulticospan.Hom.snd i)
107-
rw [← b] at a
108-
exact a⟩
109-
invFun x :=
110-
{ val := fun j =>
111-
match j with
112-
| WalkingMulticospan.left a => x.1 _
113-
| WalkingMulticospan.right b => I.fst b (x.1 _)
114-
property := by
115-
rintro (a | b) (a' | b') (f | f | f)
116-
· simp
117-
· rfl
118-
· dsimp
119-
exact (x.2 b').symm
120-
· simp }
121-
left_inv := by
122-
intro x; ext (a | b)
123-
· rfl
124-
· rw [← x.2 (WalkingMulticospan.Hom.fst b)]
125-
rfl
126-
right_inv := by
127-
intro x
128-
ext i
129-
rfl
130-
#align category_theory.limits.concrete.multiequalizer_equiv_aux CategoryTheory.Limits.Concrete.multiequalizerEquivAux
131-
132-
/-- The equivalence between the noncomputable multiequalizer and
133-
the concrete multiequalizer. -/
134-
noncomputable def Concrete.multiequalizerEquiv (I : MulticospanIndex.{w} C) [HasMultiequalizer I]
135-
[PreservesLimit I.multicospan (forget C)] :
136-
(multiequalizer I : C) ≃
137-
{ x : ∀ i : I.L, I.left i // ∀ i : I.R, I.fst i (x _) = I.snd i (x _) } := by
138-
let h1 := limit.isLimit I.multicospan
139-
let h2 := isLimitOfPreserves (forget C) h1
140-
let E := h2.conePointUniqueUpToIso (Types.limitConeIsLimit.{w, v} _)
141-
exact Equiv.trans E.toEquiv (Concrete.multiequalizerEquivAux.{w, v} I)
142-
#align category_theory.limits.concrete.multiequalizer_equiv CategoryTheory.Limits.Concrete.multiequalizerEquiv
143-
144-
@[simp]
145-
theorem Concrete.multiequalizerEquiv_apply (I : MulticospanIndex.{w} C) [HasMultiequalizer I]
146-
[PreservesLimit I.multicospan (forget C)] (x : ↑(multiequalizer I)) (i : I.L) :
147-
((Concrete.multiequalizerEquiv I) x : ∀ i : I.L, I.left i) i = Multiequalizer.ι I i x :=
148-
rfl
149-
#align category_theory.limits.concrete.multiequalizer_equiv_apply CategoryTheory.Limits.Concrete.multiequalizerEquiv_apply
150-
151-
end Multiequalizer
152-
153-
-- TODO: Add analogous lemmas about products and equalizers.
15457
end Limits
15558

15659
section Colimits
15760

158-
-- We don't mark this as an `@[ext]` lemma as we don't always want to work elementwise.
159-
theorem cokernel_funext {C : Type*} [Category C] [HasZeroMorphisms C] [ConcreteCategory C]
160-
{M N K : C} {f : M ⟶ N} [HasCokernel f] {g h : cokernel f ⟶ K}
161-
(w : ∀ n : N, g (cokernel.π f n) = h (cokernel.π f n)) : g = h := by
162-
ext x
163-
simpa using w x
164-
#align category_theory.limits.cokernel_funext CategoryTheory.Limits.cokernel_funext
165-
16661
variable {C : Type u} [Category.{v} C] [ConcreteCategory.{v} C] {J : Type v} [SmallCategory J]
16762
(F : J ⥤ C) [PreservesColimit F (forget C)]
16863

@@ -293,37 +188,6 @@ theorem Concrete.colimit_rep_eq_iff_exists [HasColimit F] {i j : J} (x : F.obj i
293188

294189
end FilteredColimits
295190

296-
section WidePushout
297-
298-
open WidePushout
299-
300-
open WidePushoutShape
301-
302-
theorem Concrete.widePushout_exists_rep {B : C} {α : Type _} {X : α → C} (f : ∀ j : α, B ⟶ X j)
303-
[HasWidePushout.{v} B X f] [PreservesColimit (wideSpan B X f) (forget C)]
304-
(x : ↑(widePushout B X f)) : (∃ y : B, head f y = x) ∨ ∃ (i : α) (y : X i), ι f i y = x := by
305-
obtain ⟨_ | j, y, rfl⟩ := Concrete.colimit_exists_rep _ x
306-
· left
307-
use y
308-
rfl
309-
· right
310-
use j, y
311-
rfl
312-
#align category_theory.limits.concrete.wide_pushout_exists_rep CategoryTheory.Limits.Concrete.widePushout_exists_rep
313-
314-
theorem Concrete.widePushout_exists_rep' {B : C} {α : Type _} [Nonempty α] {X : α → C}
315-
(f : ∀ j : α, B ⟶ X j) [HasWidePushout.{v} B X f] [PreservesColimit (wideSpan B X f) (forget C)]
316-
(x : ↑(widePushout B X f)) : ∃ (i : α) (y : X i), ι f i y = x := by
317-
rcases Concrete.widePushout_exists_rep f x with (⟨y, rfl⟩ | ⟨i, y, rfl⟩)
318-
· inhabit α
319-
use default, f _ y
320-
simp only [← arrow_ι _ default, comp_apply]
321-
· use i, y
322-
#align category_theory.limits.concrete.wide_pushout_exists_rep' CategoryTheory.Limits.Concrete.widePushout_exists_rep'
323-
324-
end WidePushout
325-
326-
-- TODO: Add analogous lemmas about coproducts and coequalizers.
327191
end Colimits
328192

329193
end CategoryTheory.Limits

Mathlib/CategoryTheory/Limits/Shapes/BinaryProducts.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,8 @@ def prodComparison (F : C ⥤ D) (A B : C) [HasBinaryProduct A B]
12601260
prod.lift (F.map prod.fst) (F.map prod.snd)
12611261
#align category_theory.limits.prod_comparison CategoryTheory.Limits.prodComparison
12621262

1263+
variable (A B)
1264+
12631265
@[reassoc (attr := simp)]
12641266
theorem prodComparison_fst : prodComparison F A B ≫ prod.fst = F.map prod.fst :=
12651267
prod.lift_fst _ _
@@ -1272,6 +1274,8 @@ theorem prodComparison_snd : prodComparison F A B ≫ prod.snd = F.map prod.snd
12721274
#align category_theory.limits.prod_comparison_snd CategoryTheory.Limits.prodComparison_snd
12731275
#align category_theory.limits.prod_comparison_snd_assoc CategoryTheory.Limits.prodComparison_snd_assoc
12741276

1277+
variable {A B}
1278+
12751279
/-- Naturality of the `prodComparison` morphism in both arguments. -/
12761280
@[reassoc]
12771281
theorem prodComparison_natural (f : A ⟶ A') (g : B ⟶ B') :

0 commit comments

Comments
 (0)