@@ -11,96 +11,92 @@ section
11
11
variables (C : Type u₁) [category.{u₁ v₁} C] (D : Type u₂) [category.{u₂ v₂} D]
12
12
13
13
/--
14
- `product_category C D` gives the cartesian product of two categories.
14
+ `prod.category C D` gives the cartesian product of two categories.
15
15
-/
16
- instance product_category : category.{(max u₁ u₂) (max v₁ v₂)} (C × D) :=
16
+ instance prod.category : category.{(max u₁ u₂) (max v₁ v₂)} (C × D) :=
17
17
{ Hom := λ X Y, ((X.1 ) ⟶ (Y.1 )) × ((X.2 ) ⟶ (Y.2 )),
18
18
id := λ X, ⟨ 𝟙 (X.1 ), 𝟙 (X.2 ) ⟩,
19
19
comp := λ _ _ _ f g, (f.1 ≫ g.1 , f.2 ≫ g.2 ),
20
20
id_comp := begin /- `obviously'` says: -/ intros, cases X, cases Y, cases f, dsimp at *, simp end ,
21
21
comp_id := begin /- `obviously'` says: -/ intros, cases X, cases Y, cases f, dsimp at *, simp end ,
22
- assoc := begin /- `obviously'` says: -/ intros, cases W, cases X, cases Y, cases Z, cases f, cases g, cases h, dsimp at *, simp end }
23
- end
22
+ assoc := begin /- `obviously'` says: -/ intros, cases W, cases X, cases Y, cases Z, cases f, cases g, cases h, dsimp at *, simp end }
23
+ end
24
24
25
- namespace product_category
25
+ namespace prod.category
26
26
27
- section -- rfl lemmas for product_category
27
+ section -- rfl lemmas for prod.category
28
28
variables {C : Type u₁} [𝒞 : category.{u₁ v₁} C] {D : Type u₂} [𝒟 : category.{u₂ v₂} D]
29
29
include 𝒞 𝒟
30
30
31
- @[simp,ematch] lemma id (X : C) (Y : D) : 𝟙 (X, Y) = (𝟙 X, 𝟙 Y) := rfl
32
- @[simp,ematch] lemma comp {P Q R : C} {S T U : D} (f : (P, S) ⟶ (Q, T)) (g : (Q, T) ⟶ (R, U)) : f ≫ g = (f.1 ≫ g.1 , f.2 ≫ g.2 ) := rfl
31
+ @[simp, ematch] lemma id (X : C) (Y : D) : 𝟙 (X, Y) = (𝟙 X, 𝟙 Y) := rfl
32
+ @[simp, ematch] lemma comp {P Q R : C} {S T U : D} (f : (P, S) ⟶ (Q, T)) (g : (Q, T) ⟶ (R, U)) : f ≫ g = (f.1 ≫ g.1 , f.2 ≫ g.2 ) := rfl
33
33
end
34
34
35
- section
35
+ section
36
36
variables (C : Type u₁) [𝒞 : category.{u₁ v₁} C] (D : Type u₁) [𝒟 : category.{u₁ v₁} D]
37
37
include 𝒞 𝒟
38
38
39
- /--
40
- `product_category .uniform C D` is an additional instance specialised so both factors have the same universe levels. This helps typeclass resolution.
39
+ /--
40
+ `prod.category .uniform C D` is an additional instance specialised so both factors have the same universe levels. This helps typeclass resolution.
41
41
-/
42
- instance uniform : category.{u₁ v₁} (C × D) := category_theory.product_category C D
42
+ instance uniform : category (C × D) := prod.category C D
43
43
end
44
44
45
45
-- Next we define the natural functors into and out of product categories. For now this doesn't address the universal properties.
46
46
47
- /-- `right_injection_at C Z` is the functor `X ↦ (X, Z)`. -/
48
- definition right_injection_at (C : Type u₁) [category.{u₁ v₁} C] {D : Type u₁} [category.{u₁ v₁} D] (Z : D) : C ↝ (C × D) :=
47
+ /-- `inl C Z` is the functor `X ↦ (X, Z)`. -/
48
+ def inl (C : Type u₁) [category.{u₁ v₁} C] {D : Type u₁} [category.{u₁ v₁} D] (Z : D) : C ↝ (C × D) :=
49
49
{ obj := λ X, (X, Z),
50
50
map := λ X Y f, (f, 𝟙 Z),
51
51
map_id := begin /- `obviously'` says: -/ intros, refl end ,
52
52
map_comp := begin /- `obviously'` says: -/ intros, dsimp, simp end }
53
53
54
- /-- `left_injection_at Z D ` is the functor `X ↦ (Z, X)`. -/
55
- definition left_injection_at {C : Type u₁} [category.{u₁ v₁} C] (Z : C) ( D : Type u₁) [category.{u₁ v₁} D] : D ↝ (C × D) :=
54
+ /-- `inr D Z ` is the functor `X ↦ (Z, X)`. -/
55
+ def inr {C : Type u₁} [category.{u₁ v₁} C] (D : Type u₁) [category.{u₁ v₁} D] (Z : C) : D ↝ (C × D) :=
56
56
{ obj := λ X, (Z, X),
57
57
map := λ X Y f, (𝟙 Z, f),
58
58
map_id := begin /- `obviously'` says: -/ intros, refl end ,
59
59
map_comp := begin /- `obviously'` says: -/ intros, dsimp, simp end }
60
60
61
- /-- `left_projection ` is the functor `(X, Y) ↦ X`. -/
62
- definition left_projection (C : Type u₁) [category.{u₁ v₁} C] (Z : C) (D : Type u₁) [category.{u₁ v₁} D] : (C × D) ↝ C :=
61
+ /-- `fst ` is the functor `(X, Y) ↦ X`. -/
62
+ def fst (C : Type u₁) [category.{u₁ v₁} C] (Z : C) (D : Type u₁) [category.{u₁ v₁} D] : (C × D) ↝ C :=
63
63
{ obj := λ X, X.1 ,
64
64
map := λ X Y f, f.1 ,
65
65
map_id := begin /- `obviously'` says: -/ intros, refl end ,
66
66
map_comp := begin /- `obviously'` says: -/ intros, refl end }
67
67
68
- /-- `right_projection ` is the functor `(X, Y) ↦ Y`. -/
69
- definition right_projection (C : Type u₁) [category.{u₁ v₁} C] (Z : C) (D : Type u₁) [category.{u₁ v₁} D] : (C × D) ↝ D :=
68
+ /-- `snd ` is the functor `(X, Y) ↦ Y`. -/
69
+ def snd (C : Type u₁) [category.{u₁ v₁} C] (Z : C) (D : Type u₁) [category.{u₁ v₁} D] : (C × D) ↝ D :=
70
70
{ obj := λ X, X.2 ,
71
71
map := λ X Y f, f.2 ,
72
72
map_id := begin /- `obviously'` says: -/ intros, refl end ,
73
73
map_comp := begin /- `obviously'` says: -/ intros, refl end }
74
74
75
- end product_category
75
+ end prod.category
76
76
77
77
variables {A : Type u₁} [𝒜 : category.{u₁ v₁} A] {B : Type u₂} [ℬ : category.{u₂ v₂} B] {C : Type u₃} [𝒞 : category.{u₃ v₃} C] {D : Type u₄} [𝒟 : category.{u₄ v₄} D]
78
78
include 𝒜 ℬ 𝒞 𝒟
79
79
80
80
namespace functor
81
81
/-- The cartesion product of two functors. -/
82
- definition product (F : A ↝ B) (G : C ↝ D) : (A × C) ↝ (B × D) :=
82
+ def prod (F : A ↝ B) (G : C ↝ D) : (A × C) ↝ (B × D) :=
83
83
{ obj := λ X, (F X.1 , G X.2 ),
84
84
map := λ _ _ f, (F.map f.1 , G.map f.2 ),
85
85
map_id := begin /- `obviously'` says: -/ intros, cases X, dsimp, rw map_id_lemma, rw map_id_lemma end ,
86
86
map_comp := begin /- `obviously'` says: -/ intros, cases Z, cases Y, cases X, cases f, cases g, dsimp at *, rw map_comp_lemma, rw map_comp_lemma end }
87
87
88
- notation F `×` G := product F G
89
-
90
- @[simp,ematch] lemma product_obj (F : A ↝ B) (G : C ↝ D) (a : A) (c : C) : (F × G) (a, c) = (F a, G c) := rfl
91
- @[simp,ematch] lemma product_map (F : A ↝ B) (G : C ↝ D) {a a' : A} {c c' : C} (f : (a, c) ⟶ (a', c')) : (F × G).map f = (F.map f.1 , G.map f.2 ) := rfl
88
+ @[simp, ematch] lemma prod_obj (F : A ↝ B) (G : C ↝ D) (a : A) (c : C) : F.prod G (a, c) = (F a, G c) := rfl
89
+ @[simp, ematch] lemma prod_map (F : A ↝ B) (G : C ↝ D) {a a' : A} {c c' : C} (f : (a, c) ⟶ (a', c')) : (F.prod G).map f = (F.map f.1 , G.map f.2 ) := rfl
92
90
end functor
93
91
94
92
namespace nat_trans
95
93
96
94
/-- The cartesian product of two natural transformations. -/
97
- definition product {F G : A ↝ B} {H I : C ↝ D} (α : F ⟹ G) (β : H ⟹ I) : (F × H) ⟹ (G × I) :=
95
+ def prod {F G : A ↝ B} {H I : C ↝ D} (α : F ⟹ G) (β : H ⟹ I) : F.prod H ⟹ G.prod I :=
98
96
{ app := λ X, (α X.1 , β X.2 ),
99
97
naturality := begin /- `obviously'` says: -/ intros, cases f, cases Y, cases X, dsimp at *, simp, split, rw naturality_lemma, rw naturality_lemma end }
100
98
101
- notation α `×` β := product α β
102
-
103
- @[simp,ematch] lemma product_app {F G : A ↝ B} {H I : C ↝ D} (α : F ⟹ G) (β : H ⟹ I) (a : A) (c : C) : (α × β) (a, c) = (α a, β c) := rfl
99
+ @[simp, ematch] lemma prod_app {F G : A ↝ B} {H I : C ↝ D} (α : F ⟹ G) (β : H ⟹ I) (a : A) (c : C) : α.prod β (a, c) = (α a, β c) := rfl
104
100
end nat_trans
105
101
106
102
end category_theory
0 commit comments