Metamath Proof Explorer


Theorem rexcomf

Description: Commutation of restricted existential quantifiers. (Contributed by Mario Carneiro, 14-Oct-2016)

Ref Expression
Hypotheses ralcomf.1 𝑦 𝐴
ralcomf.2 𝑥 𝐵
Assertion rexcomf ( ∃ 𝑥𝐴𝑦𝐵 𝜑 ↔ ∃ 𝑦𝐵𝑥𝐴 𝜑 )

Proof

Step Hyp Ref Expression
1 ralcomf.1 𝑦 𝐴
2 ralcomf.2 𝑥 𝐵
3 ancom ( ( 𝑥𝐴𝑦𝐵 ) ↔ ( 𝑦𝐵𝑥𝐴 ) )
4 3 anbi1i ( ( ( 𝑥𝐴𝑦𝐵 ) ∧ 𝜑 ) ↔ ( ( 𝑦𝐵𝑥𝐴 ) ∧ 𝜑 ) )
5 4 2exbii ( ∃ 𝑥𝑦 ( ( 𝑥𝐴𝑦𝐵 ) ∧ 𝜑 ) ↔ ∃ 𝑥𝑦 ( ( 𝑦𝐵𝑥𝐴 ) ∧ 𝜑 ) )
6 excom ( ∃ 𝑥𝑦 ( ( 𝑦𝐵𝑥𝐴 ) ∧ 𝜑 ) ↔ ∃ 𝑦𝑥 ( ( 𝑦𝐵𝑥𝐴 ) ∧ 𝜑 ) )
7 5 6 bitri ( ∃ 𝑥𝑦 ( ( 𝑥𝐴𝑦𝐵 ) ∧ 𝜑 ) ↔ ∃ 𝑦𝑥 ( ( 𝑦𝐵𝑥𝐴 ) ∧ 𝜑 ) )
8 1 r2exf ( ∃ 𝑥𝐴𝑦𝐵 𝜑 ↔ ∃ 𝑥𝑦 ( ( 𝑥𝐴𝑦𝐵 ) ∧ 𝜑 ) )
9 2 r2exf ( ∃ 𝑦𝐵𝑥𝐴 𝜑 ↔ ∃ 𝑦𝑥 ( ( 𝑦𝐵𝑥𝐴 ) ∧ 𝜑 ) )
10 7 8 9 3bitr4i ( ∃ 𝑥𝐴𝑦𝐵 𝜑 ↔ ∃ 𝑦𝐵𝑥𝐴 𝜑 )