reserve k,m,n for Nat, kk,mm,nn for Element of NAT,
 U,U1,U2 for non empty set,
 A,B,X,Y,Z, x,x1,x2,y,z for set,
 S for Language, s, s1, s2 for Element of S,
f,g for Function, w for string of S, tt,tt1,tt2 for Element of AllTermsOf S,
psi,psi1,psi2,phi,phi1,phi2 for wff string of S, u,u1,u2 for Element of U,
Phi,Phi1,Phi2 for Subset of AllFormulasOf S, t,t1,t2,t3 for termal string of
S,
r for relational Element of S, a for ofAtomicFormula Element of S,
l, l1, l2 for literal Element of S, p for FinSequence,
m1, n1 for non zero Nat, S1, S2 for Language;
reserve D,D1,D2,D3 for RuleSet of S, R for Rule of S,
Seqts,Seqts1,Seqts2 for Subset of S-sequents,
seqt,seqt1,seqt2 for Element of S-sequents,
SQ,SQ1,SQ2 for S-sequents-like set, Sq,Sq1,Sq2 for S-sequent-like object;
reserve H,H1,H2,H3 for S-premises-like set;
reserve M,K,K1,K2 for isotone RuleSet of S;
 reserve D,E,F for (RuleSet of S), D1 for 1-ranked 0-ranked RuleSet of S;

theorem Th18: for X being functional set,
num being sequence of  ExFormulasOf S st D is isotone &
R#1(S) in D & R#8(S) in D & R#2(S) in D & R#5(S) in D &
LettersOf S\SymbolsOf (X/\((AllSymbolsOf S)*\{{}})) is infinite &
X addw (D,num) c= Z & Z is D-consistent & rng num = ExFormulasOf S
holds Z is S-witnessed
proof
let X be functional set;set L=LettersOf S,F=S-firstChar,EF=ExFormulasOf S;
let num be sequence of  EF; set f=(D,num) addw X, Y=X addw (D,num),
SS=AllSymbolsOf S; X\Y ={}; then
A1: X c= Y by XBOOLE_1:37; assume
A2: D is isotone & R#1(S) in D & R#8(S) in D & R#2(S) in D & R#5(S) in D &
LettersOf S\SymbolsOf (X/\((AllSymbolsOf S)*\{{}})) is infinite; assume
A3: Y c= Z & Z is D-consistent; then X c= Z & Z is D-consistent
by A1, XBOOLE_1:1; then
A4: X is D-consistent; assume
A5: rng num = EF; set strings=SS*\{{}};
for l1, phi1 st <*l1*>^phi1 in Z ex l2 st (
(l1,l2)-SymbolSubstIn phi1 in Z & not l2 in rng phi1)
proof
let l1, phi1; set phi=<*l1*>^phi1;
phi=<*l1*>^phi1^{} & not phi is 0wff; then
A6: l1=F.phi & phi1=head phi by FOMODEL2:23;
phi in EF; then
reconsider phii=phi as Element of EF; consider x being object such that
A7: x in dom num & num.x=phii by A5, FUNCT_1:def 3;
reconsider mm=x as Element of NAT by A7;
::#this works because of redefine func dom in relset_1
reconsider MM=mm+1 as Element of NAT by ORDINAL1:def 12;
reconsider Xm=f.mm as functional set;
set no=SymbolsOf (strings/\(f.mm\/{phi1})); reconsider T=strings/\{phi1}
as FinSequence-membered finite Subset of {phi1};
reconsider t=SymbolsOf T as finite set;
reconsider i=L\SymbolsOf (f.mm/\strings) as infinite Subset of L
by Th17, A2, A4;
A8: no= SymbolsOf ((strings/\f.mm)\/(strings/\{phi1})) by XBOOLE_1:23 .=
SymbolsOf (strings/\f.mm) \/ SymbolsOf T by FOMODEL0:47; then
L\no=i\t by XBOOLE_1:41;
then reconsider yes=L\no as non empty Subset of L;
set ll2=the Element of yes;
reconsider l2=ll2 as literal Element of S by TARSKI:def 3;
set psi1=(l1,l2)-SymbolSubstIn phi1;
dom f=NAT by FUNCT_2:def 1; then
A9: f.mm in rng f & f.MM in rng f by FUNCT_1:def 3; then
f.mm c= Y by ZFMISC_1:74; then
A10: f.mm c= Z by A3, XBOOLE_1:1;
assume phi in Z; then {phi} c= Z by ZFMISC_1:31; then
f.mm \/ {phi} c= Z by A10, XBOOLE_1:8;
then f.mm \/ {phi} is D-consistent by A3; then
f.mm \/ {(l1,l2)-SymbolSubstIn phi1}  =
(D,phii) AddAsWitnessTo f.mm by Def66, A6 .=
f.(mm+1) by Def71, A7; then {psi1} null (f.mm) c= f.MM; then
psi1 in f.MM by ZFMISC_1:31; then
A11: psi1 in Y by TARSKI:def 4, A9; take l2;
thus (l1,l2)-SymbolSubstIn phi1 in Z by A3, A11;
not l2 in no by XBOOLE_0:def 5; then
not l2 in SymbolsOf {phi1} by A8, XBOOLE_0:def 3;
hence thesis by FOMODEL0:45;
end; hence Z is S-witnessed;
end;
