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 ( 𝜑𝐹 ∈ ( 𝐶 Func 𝐷 ) )
cofulid.1 𝐼 = ( idfunc𝐷 )
Assertion cofulid ( 𝜑 → ( 𝐼func 𝐹 ) = 𝐹 )

Proof

Step Hyp Ref Expression
1 cofulid.g ( 𝜑𝐹 ∈ ( 𝐶 Func 𝐷 ) )
2 cofulid.1 𝐼 = ( idfunc𝐷 )
3 eqid ( Base ‘ 𝐷 ) = ( Base ‘ 𝐷 )
4 funcrcl ( 𝐹 ∈ ( 𝐶 Func 𝐷 ) → ( 𝐶 ∈ Cat ∧ 𝐷 ∈ Cat ) )
5 1 4 syl ( 𝜑 → ( 𝐶 ∈ Cat ∧ 𝐷 ∈ Cat ) )
6 5 simprd ( 𝜑𝐷 ∈ Cat )
7 2 3 6 idfu1st ( 𝜑 → ( 1st𝐼 ) = ( I ↾ ( Base ‘ 𝐷 ) ) )
8 7 coeq1d ( 𝜑 → ( ( 1st𝐼 ) ∘ ( 1st𝐹 ) ) = ( ( I ↾ ( Base ‘ 𝐷 ) ) ∘ ( 1st𝐹 ) ) )
9 eqid ( Base ‘ 𝐶 ) = ( Base ‘ 𝐶 )
10 relfunc Rel ( 𝐶 Func 𝐷 )
11 1st2ndbr ( ( Rel ( 𝐶 Func 𝐷 ) ∧ 𝐹 ∈ ( 𝐶 Func 𝐷 ) ) → ( 1st𝐹 ) ( 𝐶 Func 𝐷 ) ( 2nd𝐹 ) )
12 10 1 11 sylancr ( 𝜑 → ( 1st𝐹 ) ( 𝐶 Func 𝐷 ) ( 2nd𝐹 ) )
13 9 3 12 funcf1 ( 𝜑 → ( 1st𝐹 ) : ( Base ‘ 𝐶 ) ⟶ ( Base ‘ 𝐷 ) )
14 fcoi2 ( ( 1st𝐹 ) : ( Base ‘ 𝐶 ) ⟶ ( Base ‘ 𝐷 ) → ( ( I ↾ ( Base ‘ 𝐷 ) ) ∘ ( 1st𝐹 ) ) = ( 1st𝐹 ) )
15 13 14 syl ( 𝜑 → ( ( I ↾ ( Base ‘ 𝐷 ) ) ∘ ( 1st𝐹 ) ) = ( 1st𝐹 ) )
16 8 15 eqtrd ( 𝜑 → ( ( 1st𝐼 ) ∘ ( 1st𝐹 ) ) = ( 1st𝐹 ) )
17 6 3ad2ant1 ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → 𝐷 ∈ Cat )
18 eqid ( Hom ‘ 𝐷 ) = ( Hom ‘ 𝐷 )
19 13 ffvelrnda ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ) → ( ( 1st𝐹 ) ‘ 𝑥 ) ∈ ( Base ‘ 𝐷 ) )
20 19 3adant3 ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( ( 1st𝐹 ) ‘ 𝑥 ) ∈ ( Base ‘ 𝐷 ) )
21 13 ffvelrnda ( ( 𝜑𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( ( 1st𝐹 ) ‘ 𝑦 ) ∈ ( Base ‘ 𝐷 ) )
22 21 3adant2 ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( ( 1st𝐹 ) ‘ 𝑦 ) ∈ ( Base ‘ 𝐷 ) )
23 2 3 17 18 20 22 idfu2nd ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐼 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) = ( I ↾ ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( Hom ‘ 𝐷 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ) )
24 23 coeq1d ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐼 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) = ( ( I ↾ ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( Hom ‘ 𝐷 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) )
25 eqid ( Hom ‘ 𝐶 ) = ( Hom ‘ 𝐶 )
26 12 3ad2ant1 ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( 1st𝐹 ) ( 𝐶 Func 𝐷 ) ( 2nd𝐹 ) )
27 simp2 ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → 𝑥 ∈ ( Base ‘ 𝐶 ) )
28 simp3 ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → 𝑦 ∈ ( Base ‘ 𝐶 ) )
29 9 25 18 26 27 28 funcf2 ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( 𝑥 ( 2nd𝐹 ) 𝑦 ) : ( 𝑥 ( Hom ‘ 𝐶 ) 𝑦 ) ⟶ ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( Hom ‘ 𝐷 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) )
30 fcoi2 ( ( 𝑥 ( 2nd𝐹 ) 𝑦 ) : ( 𝑥 ( Hom ‘ 𝐶 ) 𝑦 ) ⟶ ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( Hom ‘ 𝐷 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) → ( ( I ↾ ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( Hom ‘ 𝐷 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) = ( 𝑥 ( 2nd𝐹 ) 𝑦 ) )
31 29 30 syl ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( ( I ↾ ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( Hom ‘ 𝐷 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) = ( 𝑥 ( 2nd𝐹 ) 𝑦 ) )
32 24 31 eqtrd ( ( 𝜑𝑥 ∈ ( Base ‘ 𝐶 ) ∧ 𝑦 ∈ ( Base ‘ 𝐶 ) ) → ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐼 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) = ( 𝑥 ( 2nd𝐹 ) 𝑦 ) )
33 32 mpoeq3dva ( 𝜑 → ( 𝑥 ∈ ( Base ‘ 𝐶 ) , 𝑦 ∈ ( Base ‘ 𝐶 ) ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐼 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) = ( 𝑥 ∈ ( Base ‘ 𝐶 ) , 𝑦 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) )
34 9 12 funcfn2 ( 𝜑 → ( 2nd𝐹 ) Fn ( ( Base ‘ 𝐶 ) × ( Base ‘ 𝐶 ) ) )
35 fnov ( ( 2nd𝐹 ) Fn ( ( Base ‘ 𝐶 ) × ( Base ‘ 𝐶 ) ) ↔ ( 2nd𝐹 ) = ( 𝑥 ∈ ( Base ‘ 𝐶 ) , 𝑦 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) )
36 34 35 sylib ( 𝜑 → ( 2nd𝐹 ) = ( 𝑥 ∈ ( Base ‘ 𝐶 ) , 𝑦 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) )
37 33 36 eqtr4d ( 𝜑 → ( 𝑥 ∈ ( Base ‘ 𝐶 ) , 𝑦 ∈ ( Base ‘ 𝐶 ) ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐼 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) = ( 2nd𝐹 ) )
38 16 37 opeq12d ( 𝜑 → ⟨ ( ( 1st𝐼 ) ∘ ( 1st𝐹 ) ) , ( 𝑥 ∈ ( Base ‘ 𝐶 ) , 𝑦 ∈ ( Base ‘ 𝐶 ) ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐼 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) ⟩ = ⟨ ( 1st𝐹 ) , ( 2nd𝐹 ) ⟩ )
39 2 idfucl ( 𝐷 ∈ Cat → 𝐼 ∈ ( 𝐷 Func 𝐷 ) )
40 6 39 syl ( 𝜑𝐼 ∈ ( 𝐷 Func 𝐷 ) )
41 9 1 40 cofuval ( 𝜑 → ( 𝐼func 𝐹 ) = ⟨ ( ( 1st𝐼 ) ∘ ( 1st𝐹 ) ) , ( 𝑥 ∈ ( Base ‘ 𝐶 ) , 𝑦 ∈ ( Base ‘ 𝐶 ) ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐼 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) ⟩ )
42 1st2nd ( ( Rel ( 𝐶 Func 𝐷 ) ∧ 𝐹 ∈ ( 𝐶 Func 𝐷 ) ) → 𝐹 = ⟨ ( 1st𝐹 ) , ( 2nd𝐹 ) ⟩ )
43 10 1 42 sylancr ( 𝜑𝐹 = ⟨ ( 1st𝐹 ) , ( 2nd𝐹 ) ⟩ )
44 38 41 43 3eqtr4d ( 𝜑 → ( 𝐼func 𝐹 ) = 𝐹 )