Metamath Proof Explorer


Theorem msubvrs

Description: The set of variables in a substitution is the union, indexed by the variables in the original expression, of the variables in the substitution to that variable. (Contributed by Mario Carneiro, 18-Jul-2016)

Ref Expression
Hypotheses msubvrs.s S=mSubstT
msubvrs.e E=mExT
msubvrs.v V=mVarsT
msubvrs.h H=mVHT
Assertion msubvrs TmFSFranSXEVFX=xVXVFHx

Proof

Step Hyp Ref Expression
1 msubvrs.s S=mSubstT
2 msubvrs.e E=mExT
3 msubvrs.v V=mVarsT
4 msubvrs.h H=mVHT
5 eqid mRSubstT=mRSubstT
6 2 5 1 elmsubrn ranS=ranfranmRSubstTeE1stef2nde
7 6 eleq2i FranSFranfranmRSubstTeE1stef2nde
8 eqid franmRSubstTeE1stef2nde=franmRSubstTeE1stef2nde
9 2 fvexi EV
10 9 mptex eE1stef2ndeV
11 8 10 elrnmpti FranfranmRSubstTeE1stef2ndefranmRSubstTF=eE1stef2nde
12 7 11 bitri FranSfranmRSubstTF=eE1stef2nde
13 simp2 TmFSfranmRSubstTXEfranmRSubstT
14 simp3 TmFSfranmRSubstTXEXE
15 eqid mTCT=mTCT
16 eqid mRExT=mRExT
17 15 2 16 mexval E=mTCT×mRExT
18 14 17 eleqtrdi TmFSfranmRSubstTXEXmTCT×mRExT
19 xp2nd XmTCT×mRExT2ndXmRExT
20 18 19 syl TmFSfranmRSubstTXE2ndXmRExT
21 eqid mVRT=mVRT
22 5 21 16 mrsubvrs franmRSubstT2ndXmRExTranf2ndXmVRT=xran2ndXmVRTranf⟨“x”⟩mVRT
23 13 20 22 syl2anc TmFSfranmRSubstTXEranf2ndXmVRT=xran2ndXmVRTranf⟨“x”⟩mVRT
24 fveq2 e=X1ste=1stX
25 2fveq3 e=Xf2nde=f2ndX
26 24 25 opeq12d e=X1stef2nde=1stXf2ndX
27 eqid eE1stef2nde=eE1stef2nde
28 opex 1stef2ndeV
29 26 27 28 fvmpt3i XEeE1stef2ndeX=1stXf2ndX
30 14 29 syl TmFSfranmRSubstTXEeE1stef2ndeX=1stXf2ndX
31 30 fveq2d TmFSfranmRSubstTXEVeE1stef2ndeX=V1stXf2ndX
32 xp1st XmTCT×mRExT1stXmTCT
33 18 32 syl TmFSfranmRSubstTXE1stXmTCT
34 5 16 mrsubf franmRSubstTf:mRExTmRExT
35 13 34 syl TmFSfranmRSubstTXEf:mRExTmRExT
36 19 17 eleq2s XE2ndXmRExT
37 14 36 syl TmFSfranmRSubstTXE2ndXmRExT
38 35 37 ffvelcdmd TmFSfranmRSubstTXEf2ndXmRExT
39 opelxpi 1stXmTCTf2ndXmRExT1stXf2ndXmTCT×mRExT
40 33 38 39 syl2anc TmFSfranmRSubstTXE1stXf2ndXmTCT×mRExT
41 40 17 eleqtrrdi TmFSfranmRSubstTXE1stXf2ndXE
42 21 2 3 mvrsval 1stXf2ndXEV1stXf2ndX=ran2nd1stXf2ndXmVRT
43 41 42 syl TmFSfranmRSubstTXEV1stXf2ndX=ran2nd1stXf2ndXmVRT
44 fvex 1stXV
45 fvex f2ndXV
46 44 45 op2nd 2nd1stXf2ndX=f2ndX
47 46 a1i TmFSfranmRSubstTXE2nd1stXf2ndX=f2ndX
48 47 rneqd TmFSfranmRSubstTXEran2nd1stXf2ndX=ranf2ndX
49 48 ineq1d TmFSfranmRSubstTXEran2nd1stXf2ndXmVRT=ranf2ndXmVRT
50 31 43 49 3eqtrd TmFSfranmRSubstTXEVeE1stef2ndeX=ranf2ndXmVRT
51 21 2 3 mvrsval XEVX=ran2ndXmVRT
52 14 51 syl TmFSfranmRSubstTXEVX=ran2ndXmVRT
53 52 iuneq1d TmFSfranmRSubstTXExVXVeE1stef2ndeHx=xran2ndXmVRTVeE1stef2ndeHx
54 21 2 4 mvhf TmFSH:mVRTE
55 54 3ad2ant1 TmFSfranmRSubstTXEH:mVRTE
56 inss2 ran2ndXmVRTmVRT
57 56 sseli xran2ndXmVRTxmVRT
58 ffvelcdm H:mVRTExmVRTHxE
59 55 57 58 syl2an TmFSfranmRSubstTXExran2ndXmVRTHxE
60 fveq2 e=Hx1ste=1stHx
61 2fveq3 e=Hxf2nde=f2ndHx
62 60 61 opeq12d e=Hx1stef2nde=1stHxf2ndHx
63 62 27 28 fvmpt3i HxEeE1stef2ndeHx=1stHxf2ndHx
64 59 63 syl TmFSfranmRSubstTXExran2ndXmVRTeE1stef2ndeHx=1stHxf2ndHx
65 57 adantl TmFSfranmRSubstTXExran2ndXmVRTxmVRT
66 eqid mTypeT=mTypeT
67 21 66 4 mvhval xmVRTHx=mTypeTx⟨“x”⟩
68 65 67 syl TmFSfranmRSubstTXExran2ndXmVRTHx=mTypeTx⟨“x”⟩
69 fvex mTypeTxV
70 s1cli ⟨“x”⟩WordV
71 70 elexi ⟨“x”⟩V
72 69 71 op1std Hx=mTypeTx⟨“x”⟩1stHx=mTypeTx
73 68 72 syl TmFSfranmRSubstTXExran2ndXmVRT1stHx=mTypeTx
74 69 71 op2ndd Hx=mTypeTx⟨“x”⟩2ndHx=⟨“x”⟩
75 68 74 syl TmFSfranmRSubstTXExran2ndXmVRT2ndHx=⟨“x”⟩
76 75 fveq2d TmFSfranmRSubstTXExran2ndXmVRTf2ndHx=f⟨“x”⟩
77 73 76 opeq12d TmFSfranmRSubstTXExran2ndXmVRT1stHxf2ndHx=mTypeTxf⟨“x”⟩
78 64 77 eqtrd TmFSfranmRSubstTXExran2ndXmVRTeE1stef2ndeHx=mTypeTxf⟨“x”⟩
79 78 fveq2d TmFSfranmRSubstTXExran2ndXmVRTVeE1stef2ndeHx=VmTypeTxf⟨“x”⟩
80 simpl1 TmFSfranmRSubstTXExran2ndXmVRTTmFS
81 21 15 66 mtyf2 TmFSmTypeT:mVRTmTCT
82 80 81 syl TmFSfranmRSubstTXExran2ndXmVRTmTypeT:mVRTmTCT
83 82 65 ffvelcdmd TmFSfranmRSubstTXExran2ndXmVRTmTypeTxmTCT
84 35 adantr TmFSfranmRSubstTXExran2ndXmVRTf:mRExTmRExT
85 elun2 xmVRTxmCNTmVRT
86 65 85 syl TmFSfranmRSubstTXExran2ndXmVRTxmCNTmVRT
87 86 s1cld TmFSfranmRSubstTXExran2ndXmVRT⟨“x”⟩WordmCNTmVRT
88 eqid mCNT=mCNT
89 88 21 16 mrexval TmFSmRExT=WordmCNTmVRT
90 80 89 syl TmFSfranmRSubstTXExran2ndXmVRTmRExT=WordmCNTmVRT
91 87 90 eleqtrrd TmFSfranmRSubstTXExran2ndXmVRT⟨“x”⟩mRExT
92 84 91 ffvelcdmd TmFSfranmRSubstTXExran2ndXmVRTf⟨“x”⟩mRExT
93 opelxpi mTypeTxmTCTf⟨“x”⟩mRExTmTypeTxf⟨“x”⟩mTCT×mRExT
94 83 92 93 syl2anc TmFSfranmRSubstTXExran2ndXmVRTmTypeTxf⟨“x”⟩mTCT×mRExT
95 94 17 eleqtrrdi TmFSfranmRSubstTXExran2ndXmVRTmTypeTxf⟨“x”⟩E
96 21 2 3 mvrsval mTypeTxf⟨“x”⟩EVmTypeTxf⟨“x”⟩=ran2ndmTypeTxf⟨“x”⟩mVRT
97 95 96 syl TmFSfranmRSubstTXExran2ndXmVRTVmTypeTxf⟨“x”⟩=ran2ndmTypeTxf⟨“x”⟩mVRT
98 fvex f⟨“x”⟩V
99 69 98 op2nd 2ndmTypeTxf⟨“x”⟩=f⟨“x”⟩
100 99 a1i TmFSfranmRSubstTXExran2ndXmVRT2ndmTypeTxf⟨“x”⟩=f⟨“x”⟩
101 100 rneqd TmFSfranmRSubstTXExran2ndXmVRTran2ndmTypeTxf⟨“x”⟩=ranf⟨“x”⟩
102 101 ineq1d TmFSfranmRSubstTXExran2ndXmVRTran2ndmTypeTxf⟨“x”⟩mVRT=ranf⟨“x”⟩mVRT
103 79 97 102 3eqtrd TmFSfranmRSubstTXExran2ndXmVRTVeE1stef2ndeHx=ranf⟨“x”⟩mVRT
104 103 iuneq2dv TmFSfranmRSubstTXExran2ndXmVRTVeE1stef2ndeHx=xran2ndXmVRTranf⟨“x”⟩mVRT
105 53 104 eqtrd TmFSfranmRSubstTXExVXVeE1stef2ndeHx=xran2ndXmVRTranf⟨“x”⟩mVRT
106 23 50 105 3eqtr4d TmFSfranmRSubstTXEVeE1stef2ndeX=xVXVeE1stef2ndeHx
107 fveq1 F=eE1stef2ndeFX=eE1stef2ndeX
108 107 fveq2d F=eE1stef2ndeVFX=VeE1stef2ndeX
109 fveq1 F=eE1stef2ndeFHx=eE1stef2ndeHx
110 109 fveq2d F=eE1stef2ndeVFHx=VeE1stef2ndeHx
111 110 iuneq2d F=eE1stef2ndexVXVFHx=xVXVeE1stef2ndeHx
112 108 111 eqeq12d F=eE1stef2ndeVFX=xVXVFHxVeE1stef2ndeX=xVXVeE1stef2ndeHx
113 106 112 syl5ibrcom TmFSfranmRSubstTXEF=eE1stef2ndeVFX=xVXVFHx
114 113 3expia TmFSfranmRSubstTXEF=eE1stef2ndeVFX=xVXVFHx
115 114 com23 TmFSfranmRSubstTF=eE1stef2ndeXEVFX=xVXVFHx
116 115 rexlimdva TmFSfranmRSubstTF=eE1stef2ndeXEVFX=xVXVFHx
117 12 116 biimtrid TmFSFranSXEVFX=xVXVFHx
118 117 3imp TmFSFranSXEVFX=xVXVFHx