Metamath Proof Explorer


Theorem coafval

Description: The value of the composition of arrows. (Contributed by Mario Carneiro, 11-Jan-2017)

Ref Expression
Hypotheses coafval.o · = ( compa𝐶 )
coafval.a 𝐴 = ( Arrow ‘ 𝐶 )
coafval.x = ( comp ‘ 𝐶 )
Assertion coafval · = ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ )

Proof

Step Hyp Ref Expression
1 coafval.o · = ( compa𝐶 )
2 coafval.a 𝐴 = ( Arrow ‘ 𝐶 )
3 coafval.x = ( comp ‘ 𝐶 )
4 fveq2 ( 𝑐 = 𝐶 → ( Arrow ‘ 𝑐 ) = ( Arrow ‘ 𝐶 ) )
5 4 2 eqtr4di ( 𝑐 = 𝐶 → ( Arrow ‘ 𝑐 ) = 𝐴 )
6 5 rabeqdv ( 𝑐 = 𝐶 → { ∈ ( Arrow ‘ 𝑐 ) ∣ ( coda ) = ( doma𝑔 ) } = { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } )
7 fveq2 ( 𝑐 = 𝐶 → ( comp ‘ 𝑐 ) = ( comp ‘ 𝐶 ) )
8 7 3 eqtr4di ( 𝑐 = 𝐶 → ( comp ‘ 𝑐 ) = )
9 8 oveqd ( 𝑐 = 𝐶 → ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( comp ‘ 𝑐 ) ( coda𝑔 ) ) = ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) )
10 9 oveqd ( 𝑐 = 𝐶 → ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( comp ‘ 𝑐 ) ( coda𝑔 ) ) ( 2nd𝑓 ) ) = ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) )
11 10 oteq3d ( 𝑐 = 𝐶 → ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( comp ‘ 𝑐 ) ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ = ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ )
12 5 6 11 mpoeq123dv ( 𝑐 = 𝐶 → ( 𝑔 ∈ ( Arrow ‘ 𝑐 ) , 𝑓 ∈ { ∈ ( Arrow ‘ 𝑐 ) ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( comp ‘ 𝑐 ) ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) = ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) )
13 df-coa compa = ( 𝑐 ∈ Cat ↦ ( 𝑔 ∈ ( Arrow ‘ 𝑐 ) , 𝑓 ∈ { ∈ ( Arrow ‘ 𝑐 ) ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( comp ‘ 𝑐 ) ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) )
14 2 fvexi 𝐴 ∈ V
15 14 rabex { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ∈ V
16 14 15 mpoex ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) ∈ V
17 12 13 16 fvmpt ( 𝐶 ∈ Cat → ( compa𝐶 ) = ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) )
18 13 fvmptndm ( ¬ 𝐶 ∈ Cat → ( compa𝐶 ) = ∅ )
19 2 arwrcl ( 𝑓𝐴𝐶 ∈ Cat )
20 19 con3i ( ¬ 𝐶 ∈ Cat → ¬ 𝑓𝐴 )
21 20 eq0rdv ( ¬ 𝐶 ∈ Cat → 𝐴 = ∅ )
22 eqidd ( ¬ 𝐶 ∈ Cat → { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } = { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } )
23 eqidd ( ¬ 𝐶 ∈ Cat → ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ = ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ )
24 21 22 23 mpoeq123dv ( ¬ 𝐶 ∈ Cat → ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) = ( 𝑔 ∈ ∅ , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) )
25 mpo0 ( 𝑔 ∈ ∅ , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) = ∅
26 24 25 eqtrdi ( ¬ 𝐶 ∈ Cat → ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) = ∅ )
27 18 26 eqtr4d ( ¬ 𝐶 ∈ Cat → ( compa𝐶 ) = ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ ) )
28 17 27 pm2.61i ( compa𝐶 ) = ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ )
29 1 28 eqtri · = ( 𝑔𝐴 , 𝑓 ∈ { 𝐴 ∣ ( coda ) = ( doma𝑔 ) } ↦ ⟨ ( doma𝑓 ) , ( coda𝑔 ) , ( ( 2nd𝑔 ) ( ⟨ ( doma𝑓 ) , ( doma𝑔 ) ⟩ ( coda𝑔 ) ) ( 2nd𝑓 ) ) ⟩ )