Metamath Proof Explorer


Theorem cofu2nd

Description: Value of the morphism part of the functor composition. (Contributed by Mario Carneiro, 3-Jan-2017)

Ref Expression
Hypotheses cofuval.b 𝐵 = ( Base ‘ 𝐶 )
cofuval.f ( 𝜑𝐹 ∈ ( 𝐶 Func 𝐷 ) )
cofuval.g ( 𝜑𝐺 ∈ ( 𝐷 Func 𝐸 ) )
cofu2nd.x ( 𝜑𝑋𝐵 )
cofu2nd.y ( 𝜑𝑌𝐵 )
Assertion cofu2nd ( 𝜑 → ( 𝑋 ( 2nd ‘ ( 𝐺func 𝐹 ) ) 𝑌 ) = ( ( ( ( 1st𝐹 ) ‘ 𝑋 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑌 ) ) ∘ ( 𝑋 ( 2nd𝐹 ) 𝑌 ) ) )

Proof

Step Hyp Ref Expression
1 cofuval.b 𝐵 = ( Base ‘ 𝐶 )
2 cofuval.f ( 𝜑𝐹 ∈ ( 𝐶 Func 𝐷 ) )
3 cofuval.g ( 𝜑𝐺 ∈ ( 𝐷 Func 𝐸 ) )
4 cofu2nd.x ( 𝜑𝑋𝐵 )
5 cofu2nd.y ( 𝜑𝑌𝐵 )
6 1 2 3 cofuval ( 𝜑 → ( 𝐺func 𝐹 ) = ⟨ ( ( 1st𝐺 ) ∘ ( 1st𝐹 ) ) , ( 𝑥𝐵 , 𝑦𝐵 ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) ⟩ )
7 6 fveq2d ( 𝜑 → ( 2nd ‘ ( 𝐺func 𝐹 ) ) = ( 2nd ‘ ⟨ ( ( 1st𝐺 ) ∘ ( 1st𝐹 ) ) , ( 𝑥𝐵 , 𝑦𝐵 ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) ⟩ ) )
8 fvex ( 1st𝐺 ) ∈ V
9 fvex ( 1st𝐹 ) ∈ V
10 8 9 coex ( ( 1st𝐺 ) ∘ ( 1st𝐹 ) ) ∈ V
11 1 fvexi 𝐵 ∈ V
12 11 11 mpoex ( 𝑥𝐵 , 𝑦𝐵 ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) ∈ V
13 10 12 op2nd ( 2nd ‘ ⟨ ( ( 1st𝐺 ) ∘ ( 1st𝐹 ) ) , ( 𝑥𝐵 , 𝑦𝐵 ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) ⟩ ) = ( 𝑥𝐵 , 𝑦𝐵 ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) )
14 7 13 eqtrdi ( 𝜑 → ( 2nd ‘ ( 𝐺func 𝐹 ) ) = ( 𝑥𝐵 , 𝑦𝐵 ↦ ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) ) )
15 simprl ( ( 𝜑 ∧ ( 𝑥 = 𝑋𝑦 = 𝑌 ) ) → 𝑥 = 𝑋 )
16 15 fveq2d ( ( 𝜑 ∧ ( 𝑥 = 𝑋𝑦 = 𝑌 ) ) → ( ( 1st𝐹 ) ‘ 𝑥 ) = ( ( 1st𝐹 ) ‘ 𝑋 ) )
17 simprr ( ( 𝜑 ∧ ( 𝑥 = 𝑋𝑦 = 𝑌 ) ) → 𝑦 = 𝑌 )
18 17 fveq2d ( ( 𝜑 ∧ ( 𝑥 = 𝑋𝑦 = 𝑌 ) ) → ( ( 1st𝐹 ) ‘ 𝑦 ) = ( ( 1st𝐹 ) ‘ 𝑌 ) )
19 16 18 oveq12d ( ( 𝜑 ∧ ( 𝑥 = 𝑋𝑦 = 𝑌 ) ) → ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) = ( ( ( 1st𝐹 ) ‘ 𝑋 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑌 ) ) )
20 15 17 oveq12d ( ( 𝜑 ∧ ( 𝑥 = 𝑋𝑦 = 𝑌 ) ) → ( 𝑥 ( 2nd𝐹 ) 𝑦 ) = ( 𝑋 ( 2nd𝐹 ) 𝑌 ) )
21 19 20 coeq12d ( ( 𝜑 ∧ ( 𝑥 = 𝑋𝑦 = 𝑌 ) ) → ( ( ( ( 1st𝐹 ) ‘ 𝑥 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑦 ) ) ∘ ( 𝑥 ( 2nd𝐹 ) 𝑦 ) ) = ( ( ( ( 1st𝐹 ) ‘ 𝑋 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑌 ) ) ∘ ( 𝑋 ( 2nd𝐹 ) 𝑌 ) ) )
22 ovex ( ( ( 1st𝐹 ) ‘ 𝑋 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑌 ) ) ∈ V
23 ovex ( 𝑋 ( 2nd𝐹 ) 𝑌 ) ∈ V
24 22 23 coex ( ( ( ( 1st𝐹 ) ‘ 𝑋 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑌 ) ) ∘ ( 𝑋 ( 2nd𝐹 ) 𝑌 ) ) ∈ V
25 24 a1i ( 𝜑 → ( ( ( ( 1st𝐹 ) ‘ 𝑋 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑌 ) ) ∘ ( 𝑋 ( 2nd𝐹 ) 𝑌 ) ) ∈ V )
26 14 21 4 5 25 ovmpod ( 𝜑 → ( 𝑋 ( 2nd ‘ ( 𝐺func 𝐹 ) ) 𝑌 ) = ( ( ( ( 1st𝐹 ) ‘ 𝑋 ) ( 2nd𝐺 ) ( ( 1st𝐹 ) ‘ 𝑌 ) ) ∘ ( 𝑋 ( 2nd𝐹 ) 𝑌 ) ) )