Metamath Proof Explorer


Theorem fmptcof2

Description: Composition of two functions expressed as ordered-pair class abstractions. (Contributed by FL, 21-Jun-2012) (Revised by Mario Carneiro, 24-Jul-2014) (Revised by Thierry Arnoux, 10-May-2017)

Ref Expression
Hypotheses fmptcof2.x 𝑥 𝑆
fmptcof2.y 𝑦 𝑇
fmptcof2.1 𝑥 𝐴
fmptcof2.2 𝑥 𝐵
fmptcof2.3 𝑥 𝜑
fmptcof2.4 ( 𝜑 → ∀ 𝑥𝐴 𝑅𝐵 )
fmptcof2.5 ( 𝜑𝐹 = ( 𝑥𝐴𝑅 ) )
fmptcof2.6 ( 𝜑𝐺 = ( 𝑦𝐵𝑆 ) )
fmptcof2.7 ( 𝑦 = 𝑅𝑆 = 𝑇 )
Assertion fmptcof2 ( 𝜑 → ( 𝐺𝐹 ) = ( 𝑥𝐴𝑇 ) )

Proof

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