Metamath Proof Explorer


Theorem fmptco

Description: Composition of two functions expressed as ordered-pair class abstractions. If F has the equation ( x + 2 ) and G the equation ( 3 * z ) then ( G o. F ) has the equation ( 3 * ( x + 2 ) ) . (Contributed by FL, 21-Jun-2012) (Revised by Mario Carneiro, 24-Jul-2014)

Ref Expression
Hypotheses fmptco.1 ( ( 𝜑𝑥𝐴 ) → 𝑅𝐵 )
fmptco.2 ( 𝜑𝐹 = ( 𝑥𝐴𝑅 ) )
fmptco.3 ( 𝜑𝐺 = ( 𝑦𝐵𝑆 ) )
fmptco.4 ( 𝑦 = 𝑅𝑆 = 𝑇 )
Assertion fmptco ( 𝜑 → ( 𝐺𝐹 ) = ( 𝑥𝐴𝑇 ) )

Proof

Step Hyp Ref Expression
1 fmptco.1 ( ( 𝜑𝑥𝐴 ) → 𝑅𝐵 )
2 fmptco.2 ( 𝜑𝐹 = ( 𝑥𝐴𝑅 ) )
3 fmptco.3 ( 𝜑𝐺 = ( 𝑦𝐵𝑆 ) )
4 fmptco.4 ( 𝑦 = 𝑅𝑆 = 𝑇 )
5 relco Rel ( 𝐺𝐹 )
6 mptrel Rel ( 𝑥𝐴𝑇 )
7 2 1 fmpt3d ( 𝜑𝐹 : 𝐴𝐵 )
8 7 ffund ( 𝜑 → Fun 𝐹 )
9 funbrfv ( Fun 𝐹 → ( 𝑧 𝐹 𝑢 → ( 𝐹𝑧 ) = 𝑢 ) )
10 9 imp ( ( Fun 𝐹𝑧 𝐹 𝑢 ) → ( 𝐹𝑧 ) = 𝑢 )
11 8 10 sylan ( ( 𝜑𝑧 𝐹 𝑢 ) → ( 𝐹𝑧 ) = 𝑢 )
12 11 eqcomd ( ( 𝜑𝑧 𝐹 𝑢 ) → 𝑢 = ( 𝐹𝑧 ) )
13 12 a1d ( ( 𝜑𝑧 𝐹 𝑢 ) → ( 𝑢 𝐺 𝑤𝑢 = ( 𝐹𝑧 ) ) )
14 13 expimpd ( 𝜑 → ( ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) → 𝑢 = ( 𝐹𝑧 ) ) )
15 14 pm4.71rd ( 𝜑 → ( ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) ↔ ( 𝑢 = ( 𝐹𝑧 ) ∧ ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) ) ) )
16 15 exbidv ( 𝜑 → ( ∃ 𝑢 ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) ↔ ∃ 𝑢 ( 𝑢 = ( 𝐹𝑧 ) ∧ ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) ) ) )
17 fvex ( 𝐹𝑧 ) ∈ V
18 breq2 ( 𝑢 = ( 𝐹𝑧 ) → ( 𝑧 𝐹 𝑢𝑧 𝐹 ( 𝐹𝑧 ) ) )
19 breq1 ( 𝑢 = ( 𝐹𝑧 ) → ( 𝑢 𝐺 𝑤 ↔ ( 𝐹𝑧 ) 𝐺 𝑤 ) )
20 18 19 anbi12d ( 𝑢 = ( 𝐹𝑧 ) → ( ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) ↔ ( 𝑧 𝐹 ( 𝐹𝑧 ) ∧ ( 𝐹𝑧 ) 𝐺 𝑤 ) ) )
21 17 20 ceqsexv ( ∃ 𝑢 ( 𝑢 = ( 𝐹𝑧 ) ∧ ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) ) ↔ ( 𝑧 𝐹 ( 𝐹𝑧 ) ∧ ( 𝐹𝑧 ) 𝐺 𝑤 ) )
22 funfvbrb ( Fun 𝐹 → ( 𝑧 ∈ dom 𝐹𝑧 𝐹 ( 𝐹𝑧 ) ) )
23 8 22 syl ( 𝜑 → ( 𝑧 ∈ dom 𝐹𝑧 𝐹 ( 𝐹𝑧 ) ) )
24 7 fdmd ( 𝜑 → dom 𝐹 = 𝐴 )
25 24 eleq2d ( 𝜑 → ( 𝑧 ∈ dom 𝐹𝑧𝐴 ) )
26 23 25 bitr3d ( 𝜑 → ( 𝑧 𝐹 ( 𝐹𝑧 ) ↔ 𝑧𝐴 ) )
27 2 fveq1d ( 𝜑 → ( 𝐹𝑧 ) = ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) )
28 eqidd ( 𝜑𝑤 = 𝑤 )
29 27 3 28 breq123d ( 𝜑 → ( ( 𝐹𝑧 ) 𝐺 𝑤 ↔ ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤 ) )
30 26 29 anbi12d ( 𝜑 → ( ( 𝑧 𝐹 ( 𝐹𝑧 ) ∧ ( 𝐹𝑧 ) 𝐺 𝑤 ) ↔ ( 𝑧𝐴 ∧ ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤 ) ) )
31 nfcv 𝑥 𝑧
32 nfv 𝑥 𝜑
33 nffvmpt1 𝑥 ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 )
34 nfcv 𝑥 ( 𝑦𝐵𝑆 )
35 nfcv 𝑥 𝑤
36 33 34 35 nfbr 𝑥 ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤
37 nfcsb1v 𝑥 𝑧 / 𝑥 𝑇
38 37 nfeq2 𝑥 𝑤 = 𝑧 / 𝑥 𝑇
39 36 38 nfbi 𝑥 ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑧 / 𝑥 𝑇 )
40 32 39 nfim 𝑥 ( 𝜑 → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑧 / 𝑥 𝑇 ) )
41 fveq2 ( 𝑥 = 𝑧 → ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) = ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) )
42 41 breq1d ( 𝑥 = 𝑧 → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) ( 𝑦𝐵𝑆 ) 𝑤 ↔ ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤 ) )
43 csbeq1a ( 𝑥 = 𝑧𝑇 = 𝑧 / 𝑥 𝑇 )
44 43 eqeq2d ( 𝑥 = 𝑧 → ( 𝑤 = 𝑇𝑤 = 𝑧 / 𝑥 𝑇 ) )
45 42 44 bibi12d ( 𝑥 = 𝑧 → ( ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑇 ) ↔ ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑧 / 𝑥 𝑇 ) ) )
46 45 imbi2d ( 𝑥 = 𝑧 → ( ( 𝜑 → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑇 ) ) ↔ ( 𝜑 → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑧 / 𝑥 𝑇 ) ) ) )
47 vex 𝑤 ∈ V
48 simpl ( ( 𝑦 = 𝑅𝑢 = 𝑤 ) → 𝑦 = 𝑅 )
49 48 eleq1d ( ( 𝑦 = 𝑅𝑢 = 𝑤 ) → ( 𝑦𝐵𝑅𝐵 ) )
50 id ( 𝑢 = 𝑤𝑢 = 𝑤 )
51 50 4 eqeqan12rd ( ( 𝑦 = 𝑅𝑢 = 𝑤 ) → ( 𝑢 = 𝑆𝑤 = 𝑇 ) )
52 49 51 anbi12d ( ( 𝑦 = 𝑅𝑢 = 𝑤 ) → ( ( 𝑦𝐵𝑢 = 𝑆 ) ↔ ( 𝑅𝐵𝑤 = 𝑇 ) ) )
53 df-mpt ( 𝑦𝐵𝑆 ) = { ⟨ 𝑦 , 𝑢 ⟩ ∣ ( 𝑦𝐵𝑢 = 𝑆 ) }
54 52 53 brabga ( ( 𝑅𝐵𝑤 ∈ V ) → ( 𝑅 ( 𝑦𝐵𝑆 ) 𝑤 ↔ ( 𝑅𝐵𝑤 = 𝑇 ) ) )
55 1 47 54 sylancl ( ( 𝜑𝑥𝐴 ) → ( 𝑅 ( 𝑦𝐵𝑆 ) 𝑤 ↔ ( 𝑅𝐵𝑤 = 𝑇 ) ) )
56 id ( 𝑥𝐴𝑥𝐴 )
57 eqid ( 𝑥𝐴𝑅 ) = ( 𝑥𝐴𝑅 )
58 57 fvmpt2 ( ( 𝑥𝐴𝑅𝐵 ) → ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) = 𝑅 )
59 56 1 58 syl2an2 ( ( 𝜑𝑥𝐴 ) → ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) = 𝑅 )
60 59 breq1d ( ( 𝜑𝑥𝐴 ) → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) ( 𝑦𝐵𝑆 ) 𝑤𝑅 ( 𝑦𝐵𝑆 ) 𝑤 ) )
61 1 biantrurd ( ( 𝜑𝑥𝐴 ) → ( 𝑤 = 𝑇 ↔ ( 𝑅𝐵𝑤 = 𝑇 ) ) )
62 55 60 61 3bitr4d ( ( 𝜑𝑥𝐴 ) → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑇 ) )
63 62 expcom ( 𝑥𝐴 → ( 𝜑 → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑥 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑇 ) ) )
64 31 40 46 63 vtoclgaf ( 𝑧𝐴 → ( 𝜑 → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑧 / 𝑥 𝑇 ) ) )
65 64 impcom ( ( 𝜑𝑧𝐴 ) → ( ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤𝑤 = 𝑧 / 𝑥 𝑇 ) )
66 65 pm5.32da ( 𝜑 → ( ( 𝑧𝐴 ∧ ( ( 𝑥𝐴𝑅 ) ‘ 𝑧 ) ( 𝑦𝐵𝑆 ) 𝑤 ) ↔ ( 𝑧𝐴𝑤 = 𝑧 / 𝑥 𝑇 ) ) )
67 30 66 bitrd ( 𝜑 → ( ( 𝑧 𝐹 ( 𝐹𝑧 ) ∧ ( 𝐹𝑧 ) 𝐺 𝑤 ) ↔ ( 𝑧𝐴𝑤 = 𝑧 / 𝑥 𝑇 ) ) )
68 21 67 bitrid ( 𝜑 → ( ∃ 𝑢 ( 𝑢 = ( 𝐹𝑧 ) ∧ ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) ) ↔ ( 𝑧𝐴𝑤 = 𝑧 / 𝑥 𝑇 ) ) )
69 16 68 bitrd ( 𝜑 → ( ∃ 𝑢 ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) ↔ ( 𝑧𝐴𝑤 = 𝑧 / 𝑥 𝑇 ) ) )
70 vex 𝑧 ∈ V
71 70 47 opelco ( ⟨ 𝑧 , 𝑤 ⟩ ∈ ( 𝐺𝐹 ) ↔ ∃ 𝑢 ( 𝑧 𝐹 𝑢𝑢 𝐺 𝑤 ) )
72 df-mpt ( 𝑥𝐴𝑇 ) = { ⟨ 𝑥 , 𝑣 ⟩ ∣ ( 𝑥𝐴𝑣 = 𝑇 ) }
73 72 eleq2i ( ⟨ 𝑧 , 𝑤 ⟩ ∈ ( 𝑥𝐴𝑇 ) ↔ ⟨ 𝑧 , 𝑤 ⟩ ∈ { ⟨ 𝑥 , 𝑣 ⟩ ∣ ( 𝑥𝐴𝑣 = 𝑇 ) } )
74 nfv 𝑥 𝑧𝐴
75 37 nfeq2 𝑥 𝑣 = 𝑧 / 𝑥 𝑇
76 74 75 nfan 𝑥 ( 𝑧𝐴𝑣 = 𝑧 / 𝑥 𝑇 )
77 nfv 𝑣 ( 𝑧𝐴𝑤 = 𝑧 / 𝑥 𝑇 )
78 eleq1w ( 𝑥 = 𝑧 → ( 𝑥𝐴𝑧𝐴 ) )
79 43 eqeq2d ( 𝑥 = 𝑧 → ( 𝑣 = 𝑇𝑣 = 𝑧 / 𝑥 𝑇 ) )
80 78 79 anbi12d ( 𝑥 = 𝑧 → ( ( 𝑥𝐴𝑣 = 𝑇 ) ↔ ( 𝑧𝐴𝑣 = 𝑧 / 𝑥 𝑇 ) ) )
81 eqeq1 ( 𝑣 = 𝑤 → ( 𝑣 = 𝑧 / 𝑥 𝑇𝑤 = 𝑧 / 𝑥 𝑇 ) )
82 81 anbi2d ( 𝑣 = 𝑤 → ( ( 𝑧𝐴𝑣 = 𝑧 / 𝑥 𝑇 ) ↔ ( 𝑧𝐴𝑤 = 𝑧 / 𝑥 𝑇 ) ) )
83 76 77 70 47 80 82 opelopabf ( ⟨ 𝑧 , 𝑤 ⟩ ∈ { ⟨ 𝑥 , 𝑣 ⟩ ∣ ( 𝑥𝐴𝑣 = 𝑇 ) } ↔ ( 𝑧𝐴𝑤 = 𝑧 / 𝑥 𝑇 ) )
84 73 83 bitri ( ⟨ 𝑧 , 𝑤 ⟩ ∈ ( 𝑥𝐴𝑇 ) ↔ ( 𝑧𝐴𝑤 = 𝑧 / 𝑥 𝑇 ) )
85 69 71 84 3bitr4g ( 𝜑 → ( ⟨ 𝑧 , 𝑤 ⟩ ∈ ( 𝐺𝐹 ) ↔ ⟨ 𝑧 , 𝑤 ⟩ ∈ ( 𝑥𝐴𝑇 ) ) )
86 5 6 85 eqrelrdv ( 𝜑 → ( 𝐺𝐹 ) = ( 𝑥𝐴𝑇 ) )