Metamath Proof Explorer


Theorem fcompt

Description: Express composition of two functions as a maps-to applying both in sequence. (Contributed by Stefan O'Rear, 5-Oct-2014) (Proof shortened by Mario Carneiro, 27-Dec-2014)

Ref Expression
Assertion fcompt ( ( 𝐴 : 𝐷𝐸𝐵 : 𝐶𝐷 ) → ( 𝐴𝐵 ) = ( 𝑥𝐶 ↦ ( 𝐴 ‘ ( 𝐵𝑥 ) ) ) )

Proof

Step Hyp Ref Expression
1 ffvelrn ( ( 𝐵 : 𝐶𝐷𝑥𝐶 ) → ( 𝐵𝑥 ) ∈ 𝐷 )
2 1 adantll ( ( ( 𝐴 : 𝐷𝐸𝐵 : 𝐶𝐷 ) ∧ 𝑥𝐶 ) → ( 𝐵𝑥 ) ∈ 𝐷 )
3 ffn ( 𝐵 : 𝐶𝐷𝐵 Fn 𝐶 )
4 3 adantl ( ( 𝐴 : 𝐷𝐸𝐵 : 𝐶𝐷 ) → 𝐵 Fn 𝐶 )
5 dffn5 ( 𝐵 Fn 𝐶𝐵 = ( 𝑥𝐶 ↦ ( 𝐵𝑥 ) ) )
6 4 5 sylib ( ( 𝐴 : 𝐷𝐸𝐵 : 𝐶𝐷 ) → 𝐵 = ( 𝑥𝐶 ↦ ( 𝐵𝑥 ) ) )
7 ffn ( 𝐴 : 𝐷𝐸𝐴 Fn 𝐷 )
8 7 adantr ( ( 𝐴 : 𝐷𝐸𝐵 : 𝐶𝐷 ) → 𝐴 Fn 𝐷 )
9 dffn5 ( 𝐴 Fn 𝐷𝐴 = ( 𝑦𝐷 ↦ ( 𝐴𝑦 ) ) )
10 8 9 sylib ( ( 𝐴 : 𝐷𝐸𝐵 : 𝐶𝐷 ) → 𝐴 = ( 𝑦𝐷 ↦ ( 𝐴𝑦 ) ) )
11 fveq2 ( 𝑦 = ( 𝐵𝑥 ) → ( 𝐴𝑦 ) = ( 𝐴 ‘ ( 𝐵𝑥 ) ) )
12 2 6 10 11 fmptco ( ( 𝐴 : 𝐷𝐸𝐵 : 𝐶𝐷 ) → ( 𝐴𝐵 ) = ( 𝑥𝐶 ↦ ( 𝐴 ‘ ( 𝐵𝑥 ) ) ) )