Metamath Proof Explorer


Theorem fundcmpsurinj

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

Ref Expression
Assertion fundcmpsurinj ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ∃ 𝑔𝑝 ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1𝐵𝐹 = ( 𝑔 ) ) )

Proof

Step Hyp Ref Expression
1 abrexexg ( 𝐴𝑉 → { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } ∈ V )
2 1 adantl ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } ∈ V )
3 fveq2 ( 𝑥 = 𝑦 → ( 𝐹𝑥 ) = ( 𝐹𝑦 ) )
4 3 sneqd ( 𝑥 = 𝑦 → { ( 𝐹𝑥 ) } = { ( 𝐹𝑦 ) } )
5 4 imaeq2d ( 𝑥 = 𝑦 → ( 𝐹 “ { ( 𝐹𝑥 ) } ) = ( 𝐹 “ { ( 𝐹𝑦 ) } ) )
6 5 eqeq2d ( 𝑥 = 𝑦 → ( 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) ↔ 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) ) )
7 6 cbvrexvw ( ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) ↔ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) )
8 7 abbii { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } = { 𝑧 ∣ ∃ 𝑦𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑦 ) } ) }
9 8 fundcmpsurinjpreimafv ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ∃ 𝑔 ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } –1-1𝐵𝐹 = ( 𝑔 ) ) )
10 foeq3 ( 𝑝 = { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } → ( 𝑔 : 𝐴onto𝑝𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } ) )
11 f1eq2 ( 𝑝 = { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } → ( : 𝑝1-1𝐵 : { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } –1-1𝐵 ) )
12 10 11 3anbi12d ( 𝑝 = { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } → ( ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1𝐵𝐹 = ( 𝑔 ) ) ↔ ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } –1-1𝐵𝐹 = ( 𝑔 ) ) ) )
13 12 2exbidv ( 𝑝 = { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } → ( ∃ 𝑔 ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1𝐵𝐹 = ( 𝑔 ) ) ↔ ∃ 𝑔 ( 𝑔 : 𝐴onto→ { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } ∧ : { 𝑧 ∣ ∃ 𝑥𝐴 𝑧 = ( 𝐹 “ { ( 𝐹𝑥 ) } ) } –1-1𝐵𝐹 = ( 𝑔 ) ) ) )
14 2 9 13 spcedv ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ∃ 𝑝𝑔 ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1𝐵𝐹 = ( 𝑔 ) ) )
15 exrot3 ( ∃ 𝑝𝑔 ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1𝐵𝐹 = ( 𝑔 ) ) ↔ ∃ 𝑔𝑝 ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1𝐵𝐹 = ( 𝑔 ) ) )
16 14 15 sylib ( ( 𝐹 : 𝐴𝐵𝐴𝑉 ) → ∃ 𝑔𝑝 ( 𝑔 : 𝐴onto𝑝 : 𝑝1-1𝐵𝐹 = ( 𝑔 ) ) )