Metamath Proof Explorer


Theorem precofval2

Description: Value of the pre-composition functor as a transposed curry of the functor composition bifunctor. (Contributed by Zhi Wang, 11-Oct-2025)

Ref Expression
Hypotheses precofval.q 𝑄 = ( 𝐶 FuncCat 𝐷 )
precofval.r 𝑅 = ( 𝐷 FuncCat 𝐸 )
precofval.o ( 𝜑 = ( ⟨ 𝑄 , 𝑅 ⟩ curryF ( ( ⟨ 𝐶 , 𝐷 ⟩ ∘F 𝐸 ) ∘func ( 𝑄 swapF 𝑅 ) ) ) )
precofval.f ( 𝜑𝐹 ∈ ( 𝐶 Func 𝐷 ) )
precofval.e ( 𝜑𝐸 ∈ Cat )
precofval.k ( 𝜑𝐾 = ( ( 1st ) ‘ 𝐹 ) )
Assertion precofval2 ( 𝜑𝐾 = ⟨ ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑔func 𝐹 ) ) , ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) , ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑎 ∘ ( 1st𝐹 ) ) ) ) ⟩ )

Proof

Step Hyp Ref Expression
1 precofval.q 𝑄 = ( 𝐶 FuncCat 𝐷 )
2 precofval.r 𝑅 = ( 𝐷 FuncCat 𝐸 )
3 precofval.o ( 𝜑 = ( ⟨ 𝑄 , 𝑅 ⟩ curryF ( ( ⟨ 𝐶 , 𝐷 ⟩ ∘F 𝐸 ) ∘func ( 𝑄 swapF 𝑅 ) ) ) )
4 precofval.f ( 𝜑𝐹 ∈ ( 𝐶 Func 𝐷 ) )
5 precofval.e ( 𝜑𝐸 ∈ Cat )
6 precofval.k ( 𝜑𝐾 = ( ( 1st ) ‘ 𝐹 ) )
7 1 2 3 4 5 6 precofval ( 𝜑𝐾 = ⟨ ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑔func 𝐹 ) ) , ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) , ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑥 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑎 ‘ ( ( 1st𝐹 ) ‘ 𝑥 ) ) ) ) ) ⟩ )
8 eqid ( 𝐷 Nat 𝐸 ) = ( 𝐷 Nat 𝐸 )
9 id ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) → 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) )
10 8 9 nat1st2nd ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) → 𝑎 ∈ ( ⟨ ( 1st𝑔 ) , ( 2nd𝑔 ) ⟩ ( 𝐷 Nat 𝐸 ) ⟨ ( 1st ) , ( 2nd ) ⟩ ) )
11 eqid ( Base ‘ 𝐷 ) = ( Base ‘ 𝐷 )
12 8 10 11 natfn ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) → 𝑎 Fn ( Base ‘ 𝐷 ) )
13 dffn2 ( 𝑎 Fn ( Base ‘ 𝐷 ) ↔ 𝑎 : ( Base ‘ 𝐷 ) ⟶ V )
14 12 13 sylib ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) → 𝑎 : ( Base ‘ 𝐷 ) ⟶ V )
15 eqid ( Base ‘ 𝐶 ) = ( Base ‘ 𝐶 )
16 relfunc Rel ( 𝐶 Func 𝐷 )
17 1st2ndbr ( ( Rel ( 𝐶 Func 𝐷 ) ∧ 𝐹 ∈ ( 𝐶 Func 𝐷 ) ) → ( 1st𝐹 ) ( 𝐶 Func 𝐷 ) ( 2nd𝐹 ) )
18 16 4 17 sylancr ( 𝜑 → ( 1st𝐹 ) ( 𝐶 Func 𝐷 ) ( 2nd𝐹 ) )
19 15 11 18 funcf1 ( 𝜑 → ( 1st𝐹 ) : ( Base ‘ 𝐶 ) ⟶ ( Base ‘ 𝐷 ) )
20 fcompt ( ( 𝑎 : ( Base ‘ 𝐷 ) ⟶ V ∧ ( 1st𝐹 ) : ( Base ‘ 𝐶 ) ⟶ ( Base ‘ 𝐷 ) ) → ( 𝑎 ∘ ( 1st𝐹 ) ) = ( 𝑥 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑎 ‘ ( ( 1st𝐹 ) ‘ 𝑥 ) ) ) )
21 14 19 20 syl2anr ( ( 𝜑𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ) → ( 𝑎 ∘ ( 1st𝐹 ) ) = ( 𝑥 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑎 ‘ ( ( 1st𝐹 ) ‘ 𝑥 ) ) ) )
22 21 mpteq2dva ( 𝜑 → ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑎 ∘ ( 1st𝐹 ) ) ) = ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑥 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑎 ‘ ( ( 1st𝐹 ) ‘ 𝑥 ) ) ) ) )
23 22 mpoeq3dv ( 𝜑 → ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) , ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑎 ∘ ( 1st𝐹 ) ) ) ) = ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) , ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑥 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑎 ‘ ( ( 1st𝐹 ) ‘ 𝑥 ) ) ) ) ) )
24 23 opeq2d ( 𝜑 → ⟨ ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑔func 𝐹 ) ) , ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) , ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑎 ∘ ( 1st𝐹 ) ) ) ) ⟩ = ⟨ ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑔func 𝐹 ) ) , ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) , ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑥 ∈ ( Base ‘ 𝐶 ) ↦ ( 𝑎 ‘ ( ( 1st𝐹 ) ‘ 𝑥 ) ) ) ) ) ⟩ )
25 7 24 eqtr4d ( 𝜑𝐾 = ⟨ ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑔func 𝐹 ) ) , ( 𝑔 ∈ ( 𝐷 Func 𝐸 ) , ∈ ( 𝐷 Func 𝐸 ) ↦ ( 𝑎 ∈ ( 𝑔 ( 𝐷 Nat 𝐸 ) ) ↦ ( 𝑎 ∘ ( 1st𝐹 ) ) ) ) ⟩ )