Metamath Proof Explorer


Theorem fundcmpsurbijinj

Description: Every function F : A --> B can be decomposed into a surjective, a bijective and an injective function. (Contributed by AV, 23-Mar-2024)

Ref Expression
Assertion fundcmpsurbijinj ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ∃ 𝑔𝑖𝑝𝑞 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )

Proof

Step Hyp Ref Expression
1 ffun ( 𝐹 : 𝐴𝐵 → Fun 𝐹 )
2 funimaexg ( ( Fun 𝐹𝐴𝑉 ) → ( 𝐹𝐴 ) ∈ V )
3 1 2 sylan ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ( 𝐹𝐴 ) ∈ V )
4 abrexexg ( 𝐴𝑉 → { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∈ V )
5 4 adantl ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∈ V )
6 fveq2 ( 𝑦 = 𝑥 → ( 𝐹𝑦 ) = ( 𝐹𝑥 ) )
7 6 sneqd ( 𝑦 = 𝑥 → { ( 𝐹𝑦 ) } = { ( 𝐹𝑥 ) } )
8 7 imaeq2d ( 𝑦 = 𝑥 → ( 𝐹 “ { ( 𝐹𝑦 ) } ) = ( 𝐹 “ { ( 𝐹𝑥 ) } ) )
9 8 eqeq2d ( 𝑦 = 𝑥 → ( 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) ↔ 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) ) )
10 9 cbvrexvw ( ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) ↔ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) )
11 10 abbii { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } = { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) }
12 11 fundcmpsurbijinjpreimafv ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ∃ 𝑔𝑖 ( ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } –1-1-onto→ ( 𝐹𝐴 ) ∧ 𝑖 : ( 𝐹𝐴 ) –1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )
13 foeq3 ( 𝑝 = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } → ( 𝑔 : 𝐴onto𝑝𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ) )
14 13 adantl ( ( 𝑞 = ( 𝐹𝐴 ) ∧ 𝑝 = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ) → ( 𝑔 : 𝐴onto𝑝𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ) )
15 f1oeq23 ( ( 𝑝 = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∧ 𝑞 = ( 𝐹𝐴 ) ) → ( : 𝑝1-1-onto𝑞 : { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } –1-1-onto→ ( 𝐹𝐴 ) ) )
16 15 ancoms ( ( 𝑞 = ( 𝐹𝐴 ) ∧ 𝑝 = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ) → ( : 𝑝1-1-onto𝑞 : { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } –1-1-onto→ ( 𝐹𝐴 ) ) )
17 f1eq2 ( 𝑞 = ( 𝐹𝐴 ) → ( 𝑖 : 𝑞1-1𝐵𝑖 : ( 𝐹𝐴 ) –1-1𝐵 ) )
18 17 adantr ( ( 𝑞 = ( 𝐹𝐴 ) ∧ 𝑝 = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ) → ( 𝑖 : 𝑞1-1𝐵𝑖 : ( 𝐹𝐴 ) –1-1𝐵 ) )
19 14 16 18 3anbi123d ( ( 𝑞 = ( 𝐹𝐴 ) ∧ 𝑝 = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ) → ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ↔ ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } –1-1-onto→ ( 𝐹𝐴 ) ∧ 𝑖 : ( 𝐹𝐴 ) –1-1𝐵 ) ) )
20 19 anbi1d ( ( 𝑞 = ( 𝐹𝐴 ) ∧ 𝑝 = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ) → ( ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ↔ ( ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } –1-1-onto→ ( 𝐹𝐴 ) ∧ 𝑖 : ( 𝐹𝐴 ) –1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ) )
21 20 3exbidv ( ( 𝑞 = ( 𝐹𝐴 ) ∧ 𝑝 = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ) → ( ∃ 𝑔𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ↔ ∃ 𝑔𝑖 ( ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } –1-1-onto→ ( 𝐹𝐴 ) ∧ 𝑖 : ( 𝐹𝐴 ) –1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ) )
22 21 spc2egv ( ( ( 𝐹𝐴 ) ∈ V ∧ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∈ V ) → ( ∃ 𝑔𝑖 ( ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } –1-1-onto→ ( 𝐹𝐴 ) ∧ 𝑖 : ( 𝐹𝐴 ) –1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) → ∃ 𝑞𝑝𝑔𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ) )
23 22 imp ( ( ( ( 𝐹𝐴 ) ∈ V ∧ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∈ V ) ∧ ∃ 𝑔𝑖 ( ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) } –1-1-onto→ ( 𝐹𝐴 ) ∧ 𝑖 : ( 𝐹𝐴 ) –1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ) → ∃ 𝑞𝑝𝑔𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )
24 3 5 12 23 syl21anc ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ∃ 𝑞𝑝𝑔𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )
25 exrot4 ( ∃ 𝑞𝑝𝑔𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ↔ ∃ 𝑔𝑞𝑝𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )
26 excom13 ( ∃ 𝑞𝑝𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ↔ ∃ 𝑖𝑝𝑞 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )
27 26 2exbii ( ∃ 𝑔𝑞𝑝𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ↔ ∃ 𝑔𝑖𝑝𝑞 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )
28 25 27 bitri ( ∃ 𝑞𝑝𝑔𝑖 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) ↔ ∃ 𝑔𝑖𝑝𝑞 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )
29 24 28 sylib ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ∃ 𝑔𝑖𝑝𝑞 ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1-onto𝑞𝑖 : 𝑞1-1𝐵 ) ∧ 𝐹 = ( ( 𝑖 ) ∘ 𝑔 ) ) )