Metamath Proof Explorer


Theorem cofulid

Description: The identity functor is a left identity for composition. (Contributed by Mario Carneiro, 3-Jan-2017)

Ref Expression
Hypotheses cofulid.g ⊢ φ → F ∈ C Func D
cofulid.1 ⊢ I = id func ⁡ D
Assertion cofulid ⊢ φ → I ∘ func F = F

Proof

Step Hyp Ref Expression
1 cofulid.g ⊢ φ → F ∈ C Func D
2 cofulid.1 ⊢ I = id func ⁡ D
3 eqid ⊢ Base D = Base D
4 funcrcl ⊢ F ∈ C Func D → C ∈ Cat ∧ D ∈ Cat
5 1 4 syl ⊢ φ → C ∈ Cat ∧ D ∈ Cat
6 5 simprd ⊢ φ → D ∈ Cat
7 2 3 6 idfu1st ⊢ φ → 1 st ⁡ I = I ↾ Base D
8 7 coeq1d ⊢ φ → 1 st ⁡ I ∘ 1 st ⁡ F = I ↾ Base D ∘ 1 st ⁡ F
9 eqid ⊢ Base C = Base C
10 relfunc ⊢ Rel ⁡ C Func D
11 1st2ndbr ⊢ Rel ⁡ C Func D ∧ F ∈ C Func D → 1 st ⁡ F C Func D 2 nd ⁡ F
12 10 1 11 sylancr ⊢ φ → 1 st ⁡ F C Func D 2 nd ⁡ F
13 9 3 12 funcf1 ⊢ φ → 1 st ⁡ F : Base C ⟶ Base D
14 fcoi2 ⊢ 1 st ⁡ F : Base C ⟶ Base D → I ↾ Base D ∘ 1 st ⁡ F = 1 st ⁡ F
15 13 14 syl ⊢ φ → I ↾ Base D ∘ 1 st ⁡ F = 1 st ⁡ F
16 8 15 eqtrd ⊢ φ → 1 st ⁡ I ∘ 1 st ⁡ F = 1 st ⁡ F
17 6 3ad2ant1 ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → D ∈ Cat
18 eqid ⊢ Hom ⁡ D = Hom ⁡ D
19 13 ffvelcdmda ⊢ φ ∧ x ∈ Base C → 1 st ⁡ F ⁡ x ∈ Base D
20 19 3adant3 ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → 1 st ⁡ F ⁡ x ∈ Base D
21 13 ffvelcdmda ⊢ φ ∧ y ∈ Base C → 1 st ⁡ F ⁡ y ∈ Base D
22 21 3adant2 ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → 1 st ⁡ F ⁡ y ∈ Base D
23 2 3 17 18 20 22 idfu2nd ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → 1 st ⁡ F ⁡ x 2 nd ⁡ I 1 st ⁡ F ⁡ y = I ↾ 1 st ⁡ F ⁡ x Hom ⁡ D 1 st ⁡ F ⁡ y
24 23 coeq1d ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → 1 st ⁡ F ⁡ x 2 nd ⁡ I 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y = I ↾ 1 st ⁡ F ⁡ x Hom ⁡ D 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y
25 eqid ⊢ Hom ⁡ C = Hom ⁡ C
26 12 3ad2ant1 ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → 1 st ⁡ F C Func D 2 nd ⁡ F
27 simp2 ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → x ∈ Base C
28 simp3 ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → y ∈ Base C
29 9 25 18 26 27 28 funcf2 ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → x 2 nd ⁡ F y : x Hom ⁡ C y ⟶ 1 st ⁡ F ⁡ x Hom ⁡ D 1 st ⁡ F ⁡ y
30 fcoi2 ⊢ x 2 nd ⁡ F y : x Hom ⁡ C y ⟶ 1 st ⁡ F ⁡ x Hom ⁡ D 1 st ⁡ F ⁡ y → I ↾ 1 st ⁡ F ⁡ x Hom ⁡ D 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y = x 2 nd ⁡ F y
31 29 30 syl ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → I ↾ 1 st ⁡ F ⁡ x Hom ⁡ D 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y = x 2 nd ⁡ F y
32 24 31 eqtrd ⊢ φ ∧ x ∈ Base C ∧ y ∈ Base C → 1 st ⁡ F ⁡ x 2 nd ⁡ I 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y = x 2 nd ⁡ F y
33 32 mpoeq3dva ⊢ φ → x ∈ Base C , y ∈ Base C ⟼ 1 st ⁡ F ⁡ x 2 nd ⁡ I 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y = x ∈ Base C , y ∈ Base C ⟼ x 2 nd ⁡ F y
34 9 12 funcfn2 ⊢ φ → 2 nd ⁡ F Fn Base C × Base C
35 fnov ⊢ 2 nd ⁡ F Fn Base C × Base C ↔ 2 nd ⁡ F = x ∈ Base C , y ∈ Base C ⟼ x 2 nd ⁡ F y
36 34 35 sylib ⊢ φ → 2 nd ⁡ F = x ∈ Base C , y ∈ Base C ⟼ x 2 nd ⁡ F y
37 33 36 eqtr4d ⊢ φ → x ∈ Base C , y ∈ Base C ⟼ 1 st ⁡ F ⁡ x 2 nd ⁡ I 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y = 2 nd ⁡ F
38 16 37 opeq12d ⊢ φ → 1 st ⁡ I ∘ 1 st ⁡ F x ∈ Base C , y ∈ Base C ⟼ 1 st ⁡ F ⁡ x 2 nd ⁡ I 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y = 1 st ⁡ F 2 nd ⁡ F
39 2 idfucl ⊢ D ∈ Cat → I ∈ D Func D
40 6 39 syl ⊢ φ → I ∈ D Func D
41 9 1 40 cofuval ⊢ φ → I ∘ func F = 1 st ⁡ I ∘ 1 st ⁡ F x ∈ Base C , y ∈ Base C ⟼ 1 st ⁡ F ⁡ x 2 nd ⁡ I 1 st ⁡ F ⁡ y ∘ x 2 nd ⁡ F y
42 1st2nd ⊢ Rel ⁡ C Func D ∧ F ∈ C Func D → F = 1 st ⁡ F 2 nd ⁡ F
43 10 1 42 sylancr ⊢ φ → F = 1 st ⁡ F 2 nd ⁡ F
44 38 41 43 3eqtr4d ⊢ φ → I ∘ func F = F