Metamath Proof Explorer


Theorem cgsex4g

Description: An implicit substitution inference for 4 general classes. (Contributed by NM, 5-Aug-1995) Avoid ax-10 , ax-11 . (Revised by Gino Giotto, 28-Jun-2024) Avoid ax-9 , ax-ext . (Revised by Wolf Lammen, 21-Mar-2025)

Ref Expression
Hypotheses cgsex4g.1 ( ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) → 𝜒 )
cgsex4g.2 ( 𝜒 → ( 𝜑𝜓 ) )
Assertion cgsex4g ( ( ( 𝐴𝑅𝐵𝑆 ) ∧ ( 𝐶𝑅𝐷𝑆 ) ) → ( ∃ 𝑥𝑦𝑧𝑤 ( 𝜒𝜑 ) ↔ 𝜓 ) )

Proof

Step Hyp Ref Expression
1 cgsex4g.1 ( ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) → 𝜒 )
2 cgsex4g.2 ( 𝜒 → ( 𝜑𝜓 ) )
3 2 biimpa ( ( 𝜒𝜑 ) → 𝜓 )
4 3 exlimivv ( ∃ 𝑧𝑤 ( 𝜒𝜑 ) → 𝜓 )
5 4 exlimivv ( ∃ 𝑥𝑦𝑧𝑤 ( 𝜒𝜑 ) → 𝜓 )
6 elisset ( 𝐴𝑅 → ∃ 𝑥 𝑥 = 𝐴 )
7 elisset ( 𝐵𝑆 → ∃ 𝑦 𝑦 = 𝐵 )
8 6 7 anim12i ( ( 𝐴𝑅𝐵𝑆 ) → ( ∃ 𝑥 𝑥 = 𝐴 ∧ ∃ 𝑦 𝑦 = 𝐵 ) )
9 elisset ( 𝐶𝑅 → ∃ 𝑧 𝑧 = 𝐶 )
10 elisset ( 𝐷𝑆 → ∃ 𝑤 𝑤 = 𝐷 )
11 9 10 anim12i ( ( 𝐶𝑅𝐷𝑆 ) → ( ∃ 𝑧 𝑧 = 𝐶 ∧ ∃ 𝑤 𝑤 = 𝐷 ) )
12 8 11 anim12i ( ( ( 𝐴𝑅𝐵𝑆 ) ∧ ( 𝐶𝑅𝐷𝑆 ) ) → ( ( ∃ 𝑥 𝑥 = 𝐴 ∧ ∃ 𝑦 𝑦 = 𝐵 ) ∧ ( ∃ 𝑧 𝑧 = 𝐶 ∧ ∃ 𝑤 𝑤 = 𝐷 ) ) )
13 19.42vv ( ∃ 𝑧𝑤 ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) ↔ ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ∃ 𝑧𝑤 ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) )
14 13 2exbii ( ∃ 𝑥𝑦𝑧𝑤 ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) ↔ ∃ 𝑥𝑦 ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ∃ 𝑧𝑤 ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) )
15 19.41vv ( ∃ 𝑥𝑦 ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ∃ 𝑧𝑤 ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) ↔ ( ∃ 𝑥𝑦 ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ∃ 𝑧𝑤 ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) )
16 exdistrv ( ∃ 𝑥𝑦 ( 𝑥 = 𝐴𝑦 = 𝐵 ) ↔ ( ∃ 𝑥 𝑥 = 𝐴 ∧ ∃ 𝑦 𝑦 = 𝐵 ) )
17 exdistrv ( ∃ 𝑧𝑤 ( 𝑧 = 𝐶𝑤 = 𝐷 ) ↔ ( ∃ 𝑧 𝑧 = 𝐶 ∧ ∃ 𝑤 𝑤 = 𝐷 ) )
18 16 17 anbi12i ( ( ∃ 𝑥𝑦 ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ∃ 𝑧𝑤 ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) ↔ ( ( ∃ 𝑥 𝑥 = 𝐴 ∧ ∃ 𝑦 𝑦 = 𝐵 ) ∧ ( ∃ 𝑧 𝑧 = 𝐶 ∧ ∃ 𝑤 𝑤 = 𝐷 ) ) )
19 14 15 18 3bitri ( ∃ 𝑥𝑦𝑧𝑤 ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) ↔ ( ( ∃ 𝑥 𝑥 = 𝐴 ∧ ∃ 𝑦 𝑦 = 𝐵 ) ∧ ( ∃ 𝑧 𝑧 = 𝐶 ∧ ∃ 𝑤 𝑤 = 𝐷 ) ) )
20 12 19 sylibr ( ( ( 𝐴𝑅𝐵𝑆 ) ∧ ( 𝐶𝑅𝐷𝑆 ) ) → ∃ 𝑥𝑦𝑧𝑤 ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) )
21 1 2eximi ( ∃ 𝑧𝑤 ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) → ∃ 𝑧𝑤 𝜒 )
22 21 2eximi ( ∃ 𝑥𝑦𝑧𝑤 ( ( 𝑥 = 𝐴𝑦 = 𝐵 ) ∧ ( 𝑧 = 𝐶𝑤 = 𝐷 ) ) → ∃ 𝑥𝑦𝑧𝑤 𝜒 )
23 20 22 syl ( ( ( 𝐴𝑅𝐵𝑆 ) ∧ ( 𝐶𝑅𝐷𝑆 ) ) → ∃ 𝑥𝑦𝑧𝑤 𝜒 )
24 2 biimprcd ( 𝜓 → ( 𝜒𝜑 ) )
25 24 ancld ( 𝜓 → ( 𝜒 → ( 𝜒𝜑 ) ) )
26 25 2eximdv ( 𝜓 → ( ∃ 𝑧𝑤 𝜒 → ∃ 𝑧𝑤 ( 𝜒𝜑 ) ) )
27 26 2eximdv ( 𝜓 → ( ∃ 𝑥𝑦𝑧𝑤 𝜒 → ∃ 𝑥𝑦𝑧𝑤 ( 𝜒𝜑 ) ) )
28 23 27 syl5com ( ( ( 𝐴𝑅𝐵𝑆 ) ∧ ( 𝐶𝑅𝐷𝑆 ) ) → ( 𝜓 → ∃ 𝑥𝑦𝑧𝑤 ( 𝜒𝜑 ) ) )
29 5 28 impbid2 ( ( ( 𝐴𝑅𝐵𝑆 ) ∧ ( 𝐶𝑅𝐷𝑆 ) ) → ( ∃ 𝑥𝑦𝑧𝑤 ( 𝜒𝜑 ) ↔ 𝜓 ) )