Metamath Proof Explorer


Theorem sbcrext

Description: Interchange class substitution and restricted existential quantifier. (Contributed by NM, 1-Mar-2008) (Proof shortened by Mario Carneiro, 13-Oct-2016) (Revised by NM, 18-Aug-2018) (Proof shortened by JJ, 7-Jul-2021)

Ref Expression
Assertion sbcrext ( 𝑦 𝐴 → ( [ 𝐴 / 𝑥 ]𝑦𝐵 𝜑 ↔ ∃ 𝑦𝐵 [ 𝐴 / 𝑥 ] 𝜑 ) )

Proof

Step Hyp Ref Expression
1 sbcex ( [ 𝐴 / 𝑥 ]𝑦𝐵 𝜑𝐴 ∈ V )
2 1 a1i ( 𝑦 𝐴 → ( [ 𝐴 / 𝑥 ]𝑦𝐵 𝜑𝐴 ∈ V ) )
3 nfnfc1 𝑦 𝑦 𝐴
4 id ( 𝑦 𝐴 𝑦 𝐴 )
5 nfcvd ( 𝑦 𝐴 𝑦 V )
6 4 5 nfeld ( 𝑦 𝐴 → Ⅎ 𝑦 𝐴 ∈ V )
7 sbcex ( [ 𝐴 / 𝑥 ] 𝜑𝐴 ∈ V )
8 7 2a1i ( 𝑦 𝐴 → ( 𝑦𝐵 → ( [ 𝐴 / 𝑥 ] 𝜑𝐴 ∈ V ) ) )
9 3 6 8 rexlimd2 ( 𝑦 𝐴 → ( ∃ 𝑦𝐵 [ 𝐴 / 𝑥 ] 𝜑𝐴 ∈ V ) )
10 sbcng ( 𝐴 ∈ V → ( [ 𝐴 / 𝑥 ] ¬ ∀ 𝑦𝐵 ¬ 𝜑 ↔ ¬ [ 𝐴 / 𝑥 ]𝑦𝐵 ¬ 𝜑 ) )
11 10 adantl ( ( 𝑦 𝐴𝐴 ∈ V ) → ( [ 𝐴 / 𝑥 ] ¬ ∀ 𝑦𝐵 ¬ 𝜑 ↔ ¬ [ 𝐴 / 𝑥 ]𝑦𝐵 ¬ 𝜑 ) )
12 sbcralt ( ( 𝐴 ∈ V ∧ 𝑦 𝐴 ) → ( [ 𝐴 / 𝑥 ]𝑦𝐵 ¬ 𝜑 ↔ ∀ 𝑦𝐵 [ 𝐴 / 𝑥 ] ¬ 𝜑 ) )
13 12 ancoms ( ( 𝑦 𝐴𝐴 ∈ V ) → ( [ 𝐴 / 𝑥 ]𝑦𝐵 ¬ 𝜑 ↔ ∀ 𝑦𝐵 [ 𝐴 / 𝑥 ] ¬ 𝜑 ) )
14 3 6 nfan1 𝑦 ( 𝑦 𝐴𝐴 ∈ V )
15 sbcng ( 𝐴 ∈ V → ( [ 𝐴 / 𝑥 ] ¬ 𝜑 ↔ ¬ [ 𝐴 / 𝑥 ] 𝜑 ) )
16 15 adantl ( ( 𝑦 𝐴𝐴 ∈ V ) → ( [ 𝐴 / 𝑥 ] ¬ 𝜑 ↔ ¬ [ 𝐴 / 𝑥 ] 𝜑 ) )
17 14 16 ralbid ( ( 𝑦 𝐴𝐴 ∈ V ) → ( ∀ 𝑦𝐵 [ 𝐴 / 𝑥 ] ¬ 𝜑 ↔ ∀ 𝑦𝐵 ¬ [ 𝐴 / 𝑥 ] 𝜑 ) )
18 13 17 bitrd ( ( 𝑦 𝐴𝐴 ∈ V ) → ( [ 𝐴 / 𝑥 ]𝑦𝐵 ¬ 𝜑 ↔ ∀ 𝑦𝐵 ¬ [ 𝐴 / 𝑥 ] 𝜑 ) )
19 18 notbid ( ( 𝑦 𝐴𝐴 ∈ V ) → ( ¬ [ 𝐴 / 𝑥 ]𝑦𝐵 ¬ 𝜑 ↔ ¬ ∀ 𝑦𝐵 ¬ [ 𝐴 / 𝑥 ] 𝜑 ) )
20 11 19 bitrd ( ( 𝑦 𝐴𝐴 ∈ V ) → ( [ 𝐴 / 𝑥 ] ¬ ∀ 𝑦𝐵 ¬ 𝜑 ↔ ¬ ∀ 𝑦𝐵 ¬ [ 𝐴 / 𝑥 ] 𝜑 ) )
21 dfrex2 ( ∃ 𝑦𝐵 𝜑 ↔ ¬ ∀ 𝑦𝐵 ¬ 𝜑 )
22 21 sbcbii ( [ 𝐴 / 𝑥 ]𝑦𝐵 𝜑[ 𝐴 / 𝑥 ] ¬ ∀ 𝑦𝐵 ¬ 𝜑 )
23 dfrex2 ( ∃ 𝑦𝐵 [ 𝐴 / 𝑥 ] 𝜑 ↔ ¬ ∀ 𝑦𝐵 ¬ [ 𝐴 / 𝑥 ] 𝜑 )
24 20 22 23 3bitr4g ( ( 𝑦 𝐴𝐴 ∈ V ) → ( [ 𝐴 / 𝑥 ]𝑦𝐵 𝜑 ↔ ∃ 𝑦𝐵 [ 𝐴 / 𝑥 ] 𝜑 ) )
25 24 ex ( 𝑦 𝐴 → ( 𝐴 ∈ V → ( [ 𝐴 / 𝑥 ]𝑦𝐵 𝜑 ↔ ∃ 𝑦𝐵 [ 𝐴 / 𝑥 ] 𝜑 ) ) )
26 2 9 25 pm5.21ndd ( 𝑦 𝐴 → ( [ 𝐴 / 𝑥 ]𝑦𝐵 𝜑 ↔ ∃ 𝑦𝐵 [ 𝐴 / 𝑥 ] 𝜑 ) )