Metamath Proof Explorer


Theorem ofpreima2

Description: Express the preimage of a function operation as a union of preimages. This version of ofpreima iterates the union over a smaller set. (Contributed by Thierry Arnoux, 8-Mar-2018)

Ref Expression
Hypotheses ofpreima.1 ( 𝜑𝐹 : 𝐴𝐵 )
ofpreima.2 ( 𝜑𝐺 : 𝐴𝐶 )
ofpreima.3 ( 𝜑𝐴𝑉 )
ofpreima.4 ( 𝜑𝑅 Fn ( 𝐵 × 𝐶 ) )
Assertion ofpreima2 ( 𝜑 → ( ( 𝐹f 𝑅 𝐺 ) “ 𝐷 ) = 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) )

Proof

Step Hyp Ref Expression
1 ofpreima.1 ( 𝜑𝐹 : 𝐴𝐵 )
2 ofpreima.2 ( 𝜑𝐺 : 𝐴𝐶 )
3 ofpreima.3 ( 𝜑𝐴𝑉 )
4 ofpreima.4 ( 𝜑𝑅 Fn ( 𝐵 × 𝐶 ) )
5 1 2 3 4 ofpreima ( 𝜑 → ( ( 𝐹f 𝑅 𝐺 ) “ 𝐷 ) = 𝑝 ∈ ( 𝑅𝐷 ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) )
6 inundif ( ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ∪ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) = ( 𝑅𝐷 )
7 iuneq1 ( ( ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ∪ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) = ( 𝑅𝐷 ) → 𝑝 ∈ ( ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ∪ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = 𝑝 ∈ ( 𝑅𝐷 ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) )
8 6 7 ax-mp 𝑝 ∈ ( ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ∪ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = 𝑝 ∈ ( 𝑅𝐷 ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) )
9 iunxun 𝑝 ∈ ( ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ∪ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ( 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ∪ 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) )
10 8 9 eqtr3i 𝑝 ∈ ( 𝑅𝐷 ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ( 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ∪ 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) )
11 5 10 eqtrdi ( 𝜑 → ( ( 𝐹f 𝑅 𝐺 ) “ 𝐷 ) = ( 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ∪ 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ) )
12 simpr ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) )
13 12 eldifbd ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → ¬ 𝑝 ∈ ( ran 𝐹 × ran 𝐺 ) )
14 cnvimass ( 𝑅𝐷 ) ⊆ dom 𝑅
15 4 fndmd ( 𝜑 → dom 𝑅 = ( 𝐵 × 𝐶 ) )
16 14 15 sseqtrid ( 𝜑 → ( 𝑅𝐷 ) ⊆ ( 𝐵 × 𝐶 ) )
17 16 ssdifssd ( 𝜑 → ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ⊆ ( 𝐵 × 𝐶 ) )
18 17 sselda ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → 𝑝 ∈ ( 𝐵 × 𝐶 ) )
19 1st2nd2 ( 𝑝 ∈ ( 𝐵 × 𝐶 ) → 𝑝 = ⟨ ( 1st𝑝 ) , ( 2nd𝑝 ) ⟩ )
20 elxp6 ( 𝑝 ∈ ( ran 𝐹 × ran 𝐺 ) ↔ ( 𝑝 = ⟨ ( 1st𝑝 ) , ( 2nd𝑝 ) ⟩ ∧ ( ( 1st𝑝 ) ∈ ran 𝐹 ∧ ( 2nd𝑝 ) ∈ ran 𝐺 ) ) )
21 20 simplbi2 ( 𝑝 = ⟨ ( 1st𝑝 ) , ( 2nd𝑝 ) ⟩ → ( ( ( 1st𝑝 ) ∈ ran 𝐹 ∧ ( 2nd𝑝 ) ∈ ran 𝐺 ) → 𝑝 ∈ ( ran 𝐹 × ran 𝐺 ) ) )
22 18 19 21 3syl ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → ( ( ( 1st𝑝 ) ∈ ran 𝐹 ∧ ( 2nd𝑝 ) ∈ ran 𝐺 ) → 𝑝 ∈ ( ran 𝐹 × ran 𝐺 ) ) )
23 13 22 mtod ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → ¬ ( ( 1st𝑝 ) ∈ ran 𝐹 ∧ ( 2nd𝑝 ) ∈ ran 𝐺 ) )
24 ianor ( ¬ ( ( 1st𝑝 ) ∈ ran 𝐹 ∧ ( 2nd𝑝 ) ∈ ran 𝐺 ) ↔ ( ¬ ( 1st𝑝 ) ∈ ran 𝐹 ∨ ¬ ( 2nd𝑝 ) ∈ ran 𝐺 ) )
25 23 24 sylib ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → ( ¬ ( 1st𝑝 ) ∈ ran 𝐹 ∨ ¬ ( 2nd𝑝 ) ∈ ran 𝐺 ) )
26 disjsn ( ( ran 𝐹 ∩ { ( 1st𝑝 ) } ) = ∅ ↔ ¬ ( 1st𝑝 ) ∈ ran 𝐹 )
27 disjsn ( ( ran 𝐺 ∩ { ( 2nd𝑝 ) } ) = ∅ ↔ ¬ ( 2nd𝑝 ) ∈ ran 𝐺 )
28 26 27 orbi12i ( ( ( ran 𝐹 ∩ { ( 1st𝑝 ) } ) = ∅ ∨ ( ran 𝐺 ∩ { ( 2nd𝑝 ) } ) = ∅ ) ↔ ( ¬ ( 1st𝑝 ) ∈ ran 𝐹 ∨ ¬ ( 2nd𝑝 ) ∈ ran 𝐺 ) )
29 25 28 sylibr ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → ( ( ran 𝐹 ∩ { ( 1st𝑝 ) } ) = ∅ ∨ ( ran 𝐺 ∩ { ( 2nd𝑝 ) } ) = ∅ ) )
30 1 ffnd ( 𝜑𝐹 Fn 𝐴 )
31 dffn3 ( 𝐹 Fn 𝐴𝐹 : 𝐴 ⟶ ran 𝐹 )
32 30 31 sylib ( 𝜑𝐹 : 𝐴 ⟶ ran 𝐹 )
33 2 ffnd ( 𝜑𝐺 Fn 𝐴 )
34 dffn3 ( 𝐺 Fn 𝐴𝐺 : 𝐴 ⟶ ran 𝐺 )
35 33 34 sylib ( 𝜑𝐺 : 𝐴 ⟶ ran 𝐺 )
36 35 adantr ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → 𝐺 : 𝐴 ⟶ ran 𝐺 )
37 fimacnvdisj ( ( 𝐹 : 𝐴 ⟶ ran 𝐹 ∧ ( ran 𝐹 ∩ { ( 1st𝑝 ) } ) = ∅ ) → ( 𝐹 “ { ( 1st𝑝 ) } ) = ∅ )
38 ineq1 ( ( 𝐹 “ { ( 1st𝑝 ) } ) = ∅ → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ( ∅ ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) )
39 0in ( ∅ ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅
40 38 39 eqtrdi ( ( 𝐹 “ { ( 1st𝑝 ) } ) = ∅ → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ )
41 37 40 syl ( ( 𝐹 : 𝐴 ⟶ ran 𝐹 ∧ ( ran 𝐹 ∩ { ( 1st𝑝 ) } ) = ∅ ) → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ )
42 41 ex ( 𝐹 : 𝐴 ⟶ ran 𝐹 → ( ( ran 𝐹 ∩ { ( 1st𝑝 ) } ) = ∅ → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ ) )
43 fimacnvdisj ( ( 𝐺 : 𝐴 ⟶ ran 𝐺 ∧ ( ran 𝐺 ∩ { ( 2nd𝑝 ) } ) = ∅ ) → ( 𝐺 “ { ( 2nd𝑝 ) } ) = ∅ )
44 ineq2 ( ( 𝐺 “ { ( 2nd𝑝 ) } ) = ∅ → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ∅ ) )
45 in0 ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ∅ ) = ∅
46 44 45 eqtrdi ( ( 𝐺 “ { ( 2nd𝑝 ) } ) = ∅ → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ )
47 43 46 syl ( ( 𝐺 : 𝐴 ⟶ ran 𝐺 ∧ ( ran 𝐺 ∩ { ( 2nd𝑝 ) } ) = ∅ ) → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ )
48 47 ex ( 𝐺 : 𝐴 ⟶ ran 𝐺 → ( ( ran 𝐺 ∩ { ( 2nd𝑝 ) } ) = ∅ → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ ) )
49 42 48 jaao ( ( 𝐹 : 𝐴 ⟶ ran 𝐹𝐺 : 𝐴 ⟶ ran 𝐺 ) → ( ( ( ran 𝐹 ∩ { ( 1st𝑝 ) } ) = ∅ ∨ ( ran 𝐺 ∩ { ( 2nd𝑝 ) } ) = ∅ ) → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ ) )
50 32 36 49 syl2an2r ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → ( ( ( ran 𝐹 ∩ { ( 1st𝑝 ) } ) = ∅ ∨ ( ran 𝐺 ∩ { ( 2nd𝑝 ) } ) = ∅ ) → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ ) )
51 29 50 mpd ( ( 𝜑𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ) → ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ )
52 51 iuneq2dv ( 𝜑 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ∅ )
53 iun0 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ∅ = ∅
54 52 53 eqtrdi ( 𝜑 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) = ∅ )
55 54 uneq2d ( 𝜑 → ( 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ∪ 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ) = ( 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ∪ ∅ ) )
56 un0 ( 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ∪ ∅ ) = 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) )
57 55 56 eqtrdi ( 𝜑 → ( 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ∪ 𝑝 ∈ ( ( 𝑅𝐷 ) ∖ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) ) = 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) )
58 11 57 eqtrd ( 𝜑 → ( ( 𝐹f 𝑅 𝐺 ) “ 𝐷 ) = 𝑝 ∈ ( ( 𝑅𝐷 ) ∩ ( ran 𝐹 × ran 𝐺 ) ) ( ( 𝐹 “ { ( 1st𝑝 ) } ) ∩ ( 𝐺 “ { ( 2nd𝑝 ) } ) ) )