Metamath Proof Explorer


Theorem br4

Description: Substitution for a four-place predicate. (Contributed by Scott Fenton, 9-Oct-2013) (Revised by Mario Carneiro, 14-Oct-2013)

Ref Expression
Hypotheses br4.1 a = A φ ψ
br4.2 b = B ψ χ
br4.3 c = C χ θ
br4.4 d = D θ τ
br4.5 x = X P = Q
br4.6 R = p q | x S a P b P c P d P p = a b q = c d φ
Assertion br4 X S A Q B Q C Q D Q A B R C D τ

Proof

Step Hyp Ref Expression
1 br4.1 a = A φ ψ
2 br4.2 b = B ψ χ
3 br4.3 c = C χ θ
4 br4.4 d = D θ τ
5 br4.5 x = X P = Q
6 br4.6 R = p q | x S a P b P c P d P p = a b q = c d φ
7 opex A B V
8 opex C D V
9 eqeq1 p = A B p = a b A B = a b
10 9 3anbi1d p = A B p = a b q = c d φ A B = a b q = c d φ
11 10 rexbidv p = A B d P p = a b q = c d φ d P A B = a b q = c d φ
12 11 2rexbidv p = A B b P c P d P p = a b q = c d φ b P c P d P A B = a b q = c d φ
13 12 2rexbidv p = A B x S a P b P c P d P p = a b q = c d φ x S a P b P c P d P A B = a b q = c d φ
14 eqeq1 q = C D q = c d C D = c d
15 14 3anbi2d q = C D A B = a b q = c d φ A B = a b C D = c d φ
16 15 rexbidv q = C D d P A B = a b q = c d φ d P A B = a b C D = c d φ
17 16 2rexbidv q = C D b P c P d P A B = a b q = c d φ b P c P d P A B = a b C D = c d φ
18 17 2rexbidv q = C D x S a P b P c P d P A B = a b q = c d φ x S a P b P c P d P A B = a b C D = c d φ
19 7 8 13 18 6 brab A B R C D x S a P b P c P d P A B = a b C D = c d φ
20 vex a V
21 vex b V
22 20 21 opth a b = A B a = A b = B
23 1 2 sylan9bb a = A b = B φ χ
24 22 23 sylbi a b = A B φ χ
25 24 eqcoms A B = a b φ χ
26 vex c V
27 vex d V
28 26 27 opth c d = C D c = C d = D
29 3 4 sylan9bb c = C d = D χ τ
30 28 29 sylbi c d = C D χ τ
31 30 eqcoms C D = c d χ τ
32 25 31 sylan9bb A B = a b C D = c d φ τ
33 32 biimp3a A B = a b C D = c d φ τ
34 33 a1i X S A Q B Q C Q D Q x S a P b P c P d P A B = a b C D = c d φ τ
35 34 rexlimdva X S A Q B Q C Q D Q x S a P b P c P d P A B = a b C D = c d φ τ
36 35 rexlimdvva X S A Q B Q C Q D Q x S a P b P c P d P A B = a b C D = c d φ τ
37 36 rexlimdvva X S A Q B Q C Q D Q x S a P b P c P d P A B = a b C D = c d φ τ
38 simpl1 X S A Q B Q C Q D Q τ X S
39 simpl2l X S A Q B Q C Q D Q τ A Q
40 simpl2r X S A Q B Q C Q D Q τ B Q
41 simpl3l X S A Q B Q C Q D Q τ C Q
42 simpl3r X S A Q B Q C Q D Q τ D Q
43 eqidd X S A Q B Q C Q D Q τ A B = A B
44 eqidd X S A Q B Q C Q D Q τ C D = C D
45 simpr X S A Q B Q C Q D Q τ τ
46 opeq1 c = C c d = C d
47 46 eqeq2d c = C C D = c d C D = C d
48 47 3 3anbi23d c = C A B = A B C D = c d χ A B = A B C D = C d θ
49 opeq2 d = D C d = C D
50 49 eqeq2d d = D C D = C d C D = C D
51 50 4 3anbi23d d = D A B = A B C D = C d θ A B = A B C D = C D τ
52 48 51 rspc2ev C Q D Q A B = A B C D = C D τ c Q d Q A B = A B C D = c d χ
53 41 42 43 44 45 52 syl113anc X S A Q B Q C Q D Q τ c Q d Q A B = A B C D = c d χ
54 opeq1 a = A a b = A b
55 54 eqeq2d a = A A B = a b A B = A b
56 55 1 3anbi13d a = A A B = a b C D = c d φ A B = A b C D = c d ψ
57 56 2rexbidv a = A c Q d Q A B = a b C D = c d φ c Q d Q A B = A b C D = c d ψ
58 opeq2 b = B A b = A B
59 58 eqeq2d b = B A B = A b A B = A B
60 59 2 3anbi13d b = B A B = A b C D = c d ψ A B = A B C D = c d χ
61 60 2rexbidv b = B c Q d Q A B = A b C D = c d ψ c Q d Q A B = A B C D = c d χ
62 57 61 rspc2ev A Q B Q c Q d Q A B = A B C D = c d χ a Q b Q c Q d Q A B = a b C D = c d φ
63 39 40 53 62 syl3anc X S A Q B Q C Q D Q τ a Q b Q c Q d Q A B = a b C D = c d φ
64 5 rexeqdv x = X d P A B = a b C D = c d φ d Q A B = a b C D = c d φ
65 5 64 rexeqbidv x = X c P d P A B = a b C D = c d φ c Q d Q A B = a b C D = c d φ
66 5 65 rexeqbidv x = X b P c P d P A B = a b C D = c d φ b Q c Q d Q A B = a b C D = c d φ
67 5 66 rexeqbidv x = X a P b P c P d P A B = a b C D = c d φ a Q b Q c Q d Q A B = a b C D = c d φ
68 67 rspcev X S a Q b Q c Q d Q A B = a b C D = c d φ x S a P b P c P d P A B = a b C D = c d φ
69 38 63 68 syl2anc X S A Q B Q C Q D Q τ x S a P b P c P d P A B = a b C D = c d φ
70 69 ex X S A Q B Q C Q D Q τ x S a P b P c P d P A B = a b C D = c d φ
71 37 70 impbid X S A Q B Q C Q D Q x S a P b P c P d P A B = a b C D = c d φ τ
72 19 71 syl5bb X S A Q B Q C Q D Q A B R C D τ