let F be Subset of PL-WFF; :: thesis: ( F is consistent implies ex G being Subset of PL-WFF st
( F c= G & G is consistent & G is maximal ) )

assume Z0: F is consistent ; :: thesis: ex G being Subset of PL-WFF st
( F c= G & G is consistent & G is maximal )

set L = PL-WFF ;
consider R being Relation such that
A3: R well_orders PL-WFF by WELLORD2:17;
R /\ [:PL-WFF,PL-WFF:] c= [:PL-WFF,PL-WFF:] by XBOOLE_1:17;
then reconsider R2 = R |_2 PL-WFF as Relation of PL-WFF by WELLORD1:def 6;
R2 well_orders PL-WFF by A3, PCOMPS_2:1;
then A76: R2 is_connected_in PL-WFF by WELLORD1:def 5;
reconsider RS = RelStr(# PL-WFF,R2 #) as non empty RelStr ;
set cRS = the carrier of RS;
defpred S1[ object , object , object ] means for p being Element of PL-WFF
for f being PartFunc of the carrier of RS,(bool PL-WFF) st $1 = p & $2 = f holds
( ( ((union (rng f)) \/ F) \/ {p} is consistent implies $3 = ((union (rng f)) \/ F) \/ {p} ) & ( not ((union (rng f)) \/ F) \/ {p} is consistent implies $3 = (union (rng f)) \/ F ) );
A4: for x, y being object st x in the carrier of RS & y in PFuncs ( the carrier of RS,(bool PL-WFF)) holds
ex z being object st
( z in bool PL-WFF & S1[x,y,z] )
proof
let x, y be object ; :: thesis: ( x in the carrier of RS & y in PFuncs ( the carrier of RS,(bool PL-WFF)) implies ex z being object st
( z in bool PL-WFF & S1[x,y,z] ) )

assume A6: ( x in the carrier of RS & y in PFuncs ( the carrier of RS,(bool PL-WFF)) ) ; :: thesis: ex z being object st
( z in bool PL-WFF & S1[x,y,z] )

reconsider x1 = x as Element of PL-WFF by A6;
reconsider y1 = y as PartFunc of the carrier of RS,(bool PL-WFF) by A6, PARTFUN1:46;
per cases ( ((union (rng y1)) \/ F) \/ {x1} is consistent or not ((union (rng y1)) \/ F) \/ {x1} is consistent ) ;
suppose A7: ((union (rng y1)) \/ F) \/ {x1} is consistent ; :: thesis: ex z being object st
( z in bool PL-WFF & S1[x,y,z] )

take ((union (rng y1)) \/ F) \/ {x1} ; :: thesis: ( ((union (rng y1)) \/ F) \/ {x1} in bool PL-WFF & S1[x,y,((union (rng y1)) \/ F) \/ {x1}] )
thus ( ((union (rng y1)) \/ F) \/ {x1} in bool PL-WFF & S1[x,y,((union (rng y1)) \/ F) \/ {x1}] ) by A7; :: thesis: verum
end;
suppose A7a: not ((union (rng y1)) \/ F) \/ {x1} is consistent ; :: thesis: ex z being object st
( z in bool PL-WFF & S1[x,y,z] )

take (union (rng y1)) \/ F ; :: thesis: ( (union (rng y1)) \/ F in bool PL-WFF & S1[x,y,(union (rng y1)) \/ F] )
thus ( (union (rng y1)) \/ F in bool PL-WFF & S1[x,y,(union (rng y1)) \/ F] ) by A7a; :: thesis: verum
end;
end;
end;
consider h being Function of [: the carrier of RS,(PFuncs ( the carrier of RS,(bool PL-WFF))):],(bool PL-WFF) such that
A9: for x, y being object st x in the carrier of RS & y in PFuncs ( the carrier of RS,(bool PL-WFF)) holds
S1[x,y,h . (x,y)] from BINOP_1:sch 1(A4);
R2 well_orders PL-WFF by A3, PCOMPS_2:1;
then R2 is_well_founded_in PL-WFF by WELLORD1:def 5;
then A11: RS is well_founded by WELLFND1:def 2;
then consider f being Function of the carrier of RS,(bool PL-WFF) such that
A12: f is_recursively_expressed_by h by WELLFND1:11;
A73: dom f = the carrier of RS by FUNCT_2:def 1;
reconsider G = union (rng f) as Subset of PL-WFF ;
set iRS = the InternalRel of RS;
F6: field R2 = PL-WFF by A3, PCOMPS_2:1;
A17: for A, B being Element of PL-WFF st [A,B] in R2 holds
f . A c= f . B
proof
let A, B be Element of PL-WFF ; :: thesis: ( [A,B] in R2 implies f . A c= f . B )
assume F3: [A,B] in R2 ; :: thesis: f . A c= f . B
per cases ( A = B or A <> B ) ;
suppose A = B ; :: thesis: f . A c= f . B
hence f . A c= f . B ; :: thesis: verum
end;
suppose S2: A <> B ; :: thesis: f . A c= f . B
set frA = f | ( the InternalRel of RS -Seg A);
set frB = f | ( the InternalRel of RS -Seg B);
the InternalRel of RS is well-ordering by A3, PCOMPS_2:1, WELLORD1:4, F6;
then F12: the InternalRel of RS -Seg A c= the InternalRel of RS -Seg B by F3, WELLORD1:29, F6;
the InternalRel of RS -Seg B c= field the InternalRel of RS by WELLORD1:9;
then F21: f | ( the InternalRel of RS -Seg B) is Function of ( the InternalRel of RS -Seg B),(bool PL-WFF) by FUNCT_2:32, F6;
the InternalRel of RS -Seg A c= field the InternalRel of RS by WELLORD1:9;
then f | ( the InternalRel of RS -Seg A) is Function of ( the InternalRel of RS -Seg A),(bool PL-WFF) by FUNCT_2:32, F6;
then F11: dom (f | ( the InternalRel of RS -Seg A)) = the InternalRel of RS -Seg A by FUNCT_2:def 1;
F13: dom (f | ( the InternalRel of RS -Seg B)) = the InternalRel of RS -Seg B by FUNCT_2:def 1, F21;
F18: now :: thesis: for x being set st x in dom (f | ( the InternalRel of RS -Seg A)) holds
(f | ( the InternalRel of RS -Seg A)) . x = (f | ( the InternalRel of RS -Seg B)) . x
let x be set ; :: thesis: ( x in dom (f | ( the InternalRel of RS -Seg A)) implies (f | ( the InternalRel of RS -Seg A)) . x = (f | ( the InternalRel of RS -Seg B)) . x )
assume F19: x in dom (f | ( the InternalRel of RS -Seg A)) ; :: thesis: (f | ( the InternalRel of RS -Seg A)) . x = (f | ( the InternalRel of RS -Seg B)) . x
thus (f | ( the InternalRel of RS -Seg A)) . x = f . x by F19, FUNCT_1:47
.= (f | ( the InternalRel of RS -Seg B)) . x by F13, FUNCT_1:47, F12, F11, F19 ; :: thesis: verum
end;
E1: union (rng (f | ( the InternalRel of RS -Seg A))) c= union (rng (f | ( the InternalRel of RS -Seg B))) by ZFMISC_1:77, rnginc, F18, F11, F12, F13;
then F7: (union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F c= (union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F by XBOOLE_1:9;
F15: A in dom (f | ( the InternalRel of RS -Seg B)) by F13, S2, F3, WELLORD1:1;
(f | ( the InternalRel of RS -Seg B)) . A = f . A by FUNCT_1:47, F13, S2, F3, WELLORD1:1;
then F14: f . A c= union (rng (f | ( the InternalRel of RS -Seg B))) by ZFMISC_1:74, FUNCT_1:3, F15;
F18: dom (f | ( the InternalRel of RS -Seg A)) c= the carrier of RS ;
rng (f | ( the InternalRel of RS -Seg A)) c= bool PL-WFF ;
then E4: f | ( the InternalRel of RS -Seg A) in PFuncs ( the carrier of RS,(bool PL-WFF)) by PARTFUN1:def 3, F18;
F18a: dom (f | ( the InternalRel of RS -Seg B)) c= the carrier of RS ;
rng (f | ( the InternalRel of RS -Seg B)) c= bool PL-WFF ;
then E2: f | ( the InternalRel of RS -Seg B) in PFuncs ( the carrier of RS,(bool PL-WFF)) by PARTFUN1:def 3, F18a;
per cases ( ((union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F) \/ {A} is consistent or not ((union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F) \/ {A} is consistent ) ;
suppose ((union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F) \/ {A} is consistent ; :: thesis: f . A c= f . B
per cases ( ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} is consistent or not ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} is consistent ) ;
suppose F2a: ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} is consistent ; :: thesis: f . A c= f . B
F16: f . B = h . (B,(f | ( the InternalRel of RS -Seg B))) by WELLFND1:def 5, A12
.= ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} by A9, E2, F2a ;
thus f . A c= f . B :: thesis: verum
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in f . A or x in f . B )
assume x in f . A ; :: thesis: x in f . B
then x in (union (rng (f | ( the InternalRel of RS -Seg B)))) \/ (F \/ {B}) by XBOOLE_0:def 3, F14;
hence x in f . B by F16, XBOOLE_1:4; :: thesis: verum
end;
end;
suppose F2b: not ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} is consistent ; :: thesis: f . A c= f . B
F16b: f . B = h . (B,(f | ( the InternalRel of RS -Seg B))) by WELLFND1:def 5, A12
.= (union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F by A9, E2, F2b ;
thus f . A c= f . B by F16b, XBOOLE_0:def 3, F14; :: thesis: verum
end;
end;
end;
suppose F2: not ((union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F) \/ {A} is consistent ; :: thesis: f . A c= f . B
F8: f . A = h . (A,(f | ( the InternalRel of RS -Seg A))) by WELLFND1:def 5, A12
.= (union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F by A9, E4, F2 ;
per cases ( ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} is consistent or not ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} is consistent ) ;
suppose F2a: ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} is consistent ; :: thesis: f . A c= f . B
F9: f . B = h . (B,(f | ( the InternalRel of RS -Seg B))) by WELLFND1:def 5, A12
.= ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} by A9, E2, F2a ;
thus f . A c= f . B by F8, F9, XBOOLE_1:10, F7; :: thesis: verum
end;
suppose F2b: not ((union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F) \/ {B} is consistent ; :: thesis: f . A c= f . B
f . B = h . (B,(f | ( the InternalRel of RS -Seg B))) by WELLFND1:def 5, A12
.= (union (rng (f | ( the InternalRel of RS -Seg B)))) \/ F by A9, E2, F2b ;
hence f . A c= f . B by F8, XBOOLE_1:9, E1; :: thesis: verum
end;
end;
end;
end;
end;
end;
end;
A54: rng f is c=-linear
proof
let x be set ; :: according to ORDINAL1:def 8 :: thesis: for b1 being set holds
( not x in rng f or not b1 in rng f or x,b1 are_c=-comparable )

let y be set ; :: thesis: ( not x in rng f or not y in rng f or x,y are_c=-comparable )
assume B2: ( x in rng f & y in rng f ) ; :: thesis: x,y are_c=-comparable
then consider x1 being object such that
B3: ( x1 in dom f & f . x1 = x ) by FUNCT_1:def 3;
consider y1 being object such that
B4: ( y1 in dom f & f . y1 = y ) by FUNCT_1:def 3, B2;
reconsider x1 = x1, y1 = y1 as Element of PL-WFF by B3, B4;
per cases ( x1 = y1 or x1 <> y1 ) ;
end;
end;
defpred S2[ Element of RS] means f . $1 is consistent ;
A26: now :: thesis: for x being Element of RS holds S1[x,f | ( the InternalRel of RS -Seg x),f . x]
let x be Element of RS; :: thesis: S1[x,f | ( the InternalRel of RS -Seg x),f . x]
A20: f . x = h . (x,(f | ( the InternalRel of RS -Seg x))) by WELLFND1:def 5, A12;
f | ( the InternalRel of RS -Seg x) in PFuncs ( the carrier of RS,(bool PL-WFF)) by PARTFUN1:45;
hence S1[x,f | ( the InternalRel of RS -Seg x),f . x] by A20, A9; :: thesis: verum
end;
A27: now :: thesis: for x being Element of RS holds F c= f . x
let x be Element of RS; :: thesis: F c= f . b1
reconsider x1 = {x} as Subset of PL-WFF ;
set fr = f | ( the InternalRel of RS -Seg x);
per cases ( ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 is consistent or not ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 is consistent ) ;
suppose ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 is consistent ; :: thesis: F c= f . b1
then f . x = ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 by A26
.= F \/ ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ x1) by XBOOLE_1:4 ;
hence F c= f . x by XBOOLE_1:7; :: thesis: verum
end;
suppose not ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 is consistent ; :: thesis: F c= f . b1
then f . x = F \/ (union (rng (f | ( the InternalRel of RS -Seg x)))) by A26;
hence F c= f . x by XBOOLE_1:7; :: thesis: verum
end;
end;
end;
A21: for x being Element of RS st ( for y being Element of RS st y <> x & [y,x] in the InternalRel of RS holds
S2[y] ) holds
S2[x]
proof
let x be Element of RS; :: thesis: ( ( for y being Element of RS st y <> x & [y,x] in the InternalRel of RS holds
S2[y] ) implies S2[x] )

assume A41: for y being Element of RS st y <> x & [y,x] in the InternalRel of RS holds
S2[y] ; :: thesis: S2[x]
set fr = f | ( the InternalRel of RS -Seg x);
the InternalRel of RS -Seg x c= field the InternalRel of RS by WELLORD1:9;
then C2: f | ( the InternalRel of RS -Seg x) is Function of ( the InternalRel of RS -Seg x),(bool PL-WFF) by FUNCT_2:32, F6;
then A39a: dom (f | ( the InternalRel of RS -Seg x)) = the InternalRel of RS -Seg x by FUNCT_2:def 1;
reconsider x1 = {x} as Subset of PL-WFF ;
per cases ( ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 is consistent or not ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 is consistent ) ;
suppose ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 is consistent ; :: thesis: S2[x]
end;
suppose C1: not ((union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F) \/ x1 is consistent ; :: thesis: S2[x]
then A22: f . x = (union (rng (f | ( the InternalRel of RS -Seg x)))) \/ F by A26;
per cases ( for y being object holds
( not [y,x] in the InternalRel of RS or y = x ) or ex y being object st
( [y,x] in the InternalRel of RS & y <> x ) )
;
suppose S4: for y being object holds
( not [y,x] in the InternalRel of RS or y = x ) ; :: thesis: S2[x]
the InternalRel of RS -Seg x = {}
proof
assume the InternalRel of RS -Seg x <> {} ; :: thesis: contradiction
then consider y being object such that
F19: y in the InternalRel of RS -Seg x by XBOOLE_0:7;
( y <> x & [y,x] in the InternalRel of RS ) by WELLORD1:1, F19;
hence contradiction by S4; :: thesis: verum
end;
then dom (f | ( the InternalRel of RS -Seg x)) = {} by FUNCT_2:def 1, C2;
then rng (f | ( the InternalRel of RS -Seg x)) = {} by RELAT_1:42;
hence S2[x] by Z0, ZFMISC_1:2, A26, C1; :: thesis: verum
end;
suppose A39: ex y being object st
( [y,x] in the InternalRel of RS & y <> x ) ; :: thesis: S2[x]
assume A30: not S2[x] ; :: thesis: contradiction
consider y being object such that
A29: ( [y,x] in the InternalRel of RS & y <> x ) by A39;
y in dom the InternalRel of RS by A29, XTUPLE_0:def 12;
then reconsider y = y as Element of RS ;
(f | ( the InternalRel of RS -Seg x)) . y in rng (f | ( the InternalRel of RS -Seg x)) by FUNCT_1:3, A39a, WELLORD1:1, A29;
then A37: f . y in rng (f | ( the InternalRel of RS -Seg x)) by WELLORD1:1, A29, A39a, FUNCT_1:47;
A37b: rng (f | ( the InternalRel of RS -Seg x)) <> {} by WELLORD1:1, A29, A39a, FUNCT_1:3;
A37a: F c= f . y by A27;
F c= union (rng (f | ( the InternalRel of RS -Seg x))) by TARSKI:def 4, A37, A37a;
then A23: f . x = union (rng (f | ( the InternalRel of RS -Seg x))) by A22, XBOOLE_1:12;
consider F being Subset of PL-WFF such that
A31: ( F is finite & not F is consistent & F c= f . x ) by A30, finin;
rng (f | ( the InternalRel of RS -Seg x)) c= rng f by RELAT_1:70;
then consider z being set such that
A34: ( F c= z & z in rng (f | ( the InternalRel of RS -Seg x)) ) by uniolinf, A23, A31, A54, A37b;
consider y being object such that
A36: ( y in dom (f | ( the InternalRel of RS -Seg x)) & (f | ( the InternalRel of RS -Seg x)) . y = z ) by A34, FUNCT_1:def 3;
A42: [y,x] in the InternalRel of RS by WELLORD1:1, A39a, A36;
A44: y <> x by WELLORD1:1, A39a, A36;
y in dom the InternalRel of RS by A42, XTUPLE_0:def 12;
then reconsider y = y as Element of RS ;
f . y = (f | ( the InternalRel of RS -Seg x)) . y by A36, FUNCT_1:47;
hence contradiction by A36, A34, A31, incsub, A44, A42, A41; :: thesis: verum
end;
end;
end;
end;
end;
A13a: for A being Element of RS holds S2[A] from WELLFND1:sch 3(A21, A11);
take G ; :: thesis: ( F c= G & G is consistent & G is maximal )
thus F c= G :: thesis: ( G is consistent & G is maximal )
proof
let y be object ; :: according to TARSKI:def 3 :: thesis: ( not y in F or y in G )
assume A46: y in F ; :: thesis: y in G
set z = the Element of RS;
A47: F c= f . the Element of RS by A27;
f . the Element of RS in rng f by FUNCT_1:3, A73;
hence y in G by A46, A47, TARSKI:def 4; :: thesis: verum
end;
thus G is consistent :: thesis: G is maximal
proof
assume not G is consistent ; :: thesis: contradiction
then consider F being Subset of PL-WFF such that
A14: ( F is finite & not F is consistent & F c= G ) by finin;
consider z being set such that
A90: ( F c= z & z in rng f ) by uniolinf, A14, A54, RELAT_1:42, A73;
rng f c= bool PL-WFF ;
then reconsider z = z as Subset of PL-WFF by A90;
consider x being object such that
A92: ( x in dom f & f . x = z ) by A90, FUNCT_1:def 3;
thus contradiction by A92, A13a, A90, A14, incsub; :: thesis: verum
end;
thus G is maximal :: thesis: verum
proof
given A being Element of PL-WFF such that A71: ( not A in G & not 'not' A in G ) ; :: according to PL_AXIOM:def 28 :: thesis: contradiction
reconsider ARS = A as Element of RS ;
reconsider nA = 'not' A as Element of RS ;
set fA = f | ( the InternalRel of RS -Seg A);
set fnA = f | ( the InternalRel of RS -Seg ('not' A));
reconsider A1 = {A} as Subset of PL-WFF ;
reconsider A1n = {('not' A)} as Subset of PL-WFF ;
A74: not ((union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F) \/ A1 is consistent
proof
assume ((union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F) \/ A1 is consistent ; :: thesis: contradiction
then A70: f . ARS = ((union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F) \/ A1 by A26;
ARS in A1 by TARSKI:def 1;
then C1: ARS in ((union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F) \/ A1 by XBOOLE_0:def 3;
f . ARS in rng f by FUNCT_1:3, A73;
hence contradiction by TARSKI:def 4, A71, A70, C1; :: thesis: verum
end;
A78: not ((union (rng (f | ( the InternalRel of RS -Seg ('not' A))))) \/ F) \/ A1n is consistent
proof
assume ((union (rng (f | ( the InternalRel of RS -Seg ('not' A))))) \/ F) \/ A1n is consistent ; :: thesis: contradiction
then A70a: f . nA = ((union (rng (f | ( the InternalRel of RS -Seg ('not' A))))) \/ F) \/ A1n by A26;
nA in A1n by TARSKI:def 1;
then A72a: nA in f . nA by A70a, XBOOLE_0:def 3;
f . nA in rng f by FUNCT_1:3, A73;
hence contradiction by TARSKI:def 4, A71, A72a; :: thesis: verum
end;
then A80: f . nA = (union (rng (f | ( the InternalRel of RS -Seg ('not' A))))) \/ F by A26;
A79: f . A = (union (rng (f | ( the InternalRel of RS -Seg A)))) \/ F by A26, A74;
reconsider AAA = A as Element of HP-WFF by plhp;
reconsider fal = FaLSUM as Element of HP-WFF by plhp;
AAA => fal = A => FaLSUM ;
then len A <> len ('not' A) by HILBERT2:16;
per cases then ( [A,('not' A)] in R2 or [('not' A),A] in R2 ) by A76, RELAT_2:def 6;
end;
end;