reconsider P9 = P as Subset of T by TREES_1:def 14;
A2: now
let x be set ; :: thesis: ( x in P9 implies x in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
)

assume A3: x in P9 ; :: thesis: x in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}

reconsider x9 = x as FinSequence by A3, TREES_1:def 13;
reconsider x9 = x9 as Element of T by A3;
A4: now end;
thus x in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
by A4; :: thesis: verum
end;
A9: P c= { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
by A2, TARSKI:def 3;
reconsider Y = { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
as non empty set by A1, A9, XBOOLE_1:3;
consider Z being set such that
A10: Z = { (p ^ s) where p is Element of T, s is Element of T1 : p in P } ;
reconsider X = Y \/ Z as non empty set ;
A11: for x being set st x in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
holds
( x is FinSequence of NAT & x in NAT * & x in T )
proof
let x be set ; :: thesis: ( x in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
implies ( x is FinSequence of NAT & x in NAT * & x in T ) )

assume A12: x in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
; :: thesis: ( x is FinSequence of NAT & x in NAT * & x in T )
A13: ex t being Element of T st
( x = t & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t ) ) by A12;
thus x is FinSequence of NAT by A13; :: thesis: ( x in NAT * & x in T )
thus ( x in NAT * & x in T ) by A13, FINSEQ_1:def 11; :: thesis: verum
end;
A14: X is Tree-like
proof
thus X c= NAT * :: according to TREES_1:def 5 :: thesis: ( ( for b1 being FinSequence of NAT holds
( not b1 in X or ProperPrefixes b1 c= X ) ) & ( for b1 being FinSequence of NAT
for b2, b3 being Element of NAT holds
( not b1 ^ <*b2*> in X or not b3 <= b2 or b1 ^ <*b3*> in X ) ) )
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in X or x in NAT * )
assume A15: x in X ; :: thesis: x in NAT *
A16: ( x in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
or x in { (p ^ s) where p is Element of T, s is Element of T1 : p in P } ) by A10, A15, XBOOLE_0:def 3;
A17: now
assume A18: x in { (p ^ s) where p is Element of T, s is Element of T1 : p in P } ; :: thesis: x is FinSequence of NAT
A19: ex p being Element of T ex s being Element of T1 st
( x = p ^ s & p in P ) by A18;
thus x is FinSequence of NAT by A19; :: thesis: verum
end;
thus x in NAT * by A11, A16, A17, FINSEQ_1:def 11; :: thesis: verum
end;
thus for q being FinSequence of NAT st q in X holds
ProperPrefixes q c= X :: thesis: for b1 being FinSequence of NAT
for b2, b3 being Element of NAT holds
( not b1 ^ <*b2*> in X or not b3 <= b2 or b1 ^ <*b3*> in X )
proof
let q be FinSequence of NAT ; :: thesis: ( q in X implies ProperPrefixes q c= X )
assume A20: q in X ; :: thesis: ProperPrefixes q c= X
A21: now
assume A22: q in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
; :: thesis: ProperPrefixes q c= X
A23: ex t being Element of T st
( q = t & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t ) ) by A22;
A24: ProperPrefixes q c= T by A23, TREES_1:def 5;
thus ProperPrefixes q c= X :: thesis: verum
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in ProperPrefixes q or x in X )
assume A25: x in ProperPrefixes q ; :: thesis: x in X
consider p1 being FinSequence such that
A26: x = p1 and
A27: p1 is_a_proper_prefix_of q by A25, TREES_1:def 4;
reconsider p1 = p1 as Element of T by A24, A25, A26;
A28: for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of p1
proof
let p be FinSequence of NAT ; :: thesis: ( p in P implies not p is_a_proper_prefix_of p1 )
assume A29: p in P ; :: thesis: not p is_a_proper_prefix_of p1
A30: ex t being Element of T st
( q = t & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t ) ) by A22;
thus not p is_a_proper_prefix_of p1 by A27, A29, A30, XBOOLE_1:56; :: thesis: verum
end;
A31: x in { s1 where s1 is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of s1
}
by A26, A28;
thus x in X by A31, XBOOLE_0:def 3; :: thesis: verum
end;
end;
A32: now
assume A33: q in Z ; :: thesis: ProperPrefixes q c= X
consider p being Element of T, s being Element of T1 such that
A34: q = p ^ s and
A35: p in P by A10, A33;
thus ProperPrefixes q c= X :: thesis: verum
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in ProperPrefixes q or x in X )
assume A36: x in ProperPrefixes q ; :: thesis: x in X
reconsider r = x as FinSequence by A36, TREES_1:35;
A37: r is_a_proper_prefix_of p ^ s by A34, A36, TREES_1:36;
A38: r is_a_prefix_of p ^ s by A37, XBOOLE_0:def 8;
consider r1 being FinSequence such that
A39: p ^ s = r ^ r1 by A38, TREES_1:8;
A40: now
assume A41: len p <= len r ; :: thesis: r in X
consider r2 being FinSequence such that
A42: p ^ r2 = r by A39, A41, FINSEQ_1:64;
A43: p ^ s = p ^ (r2 ^ r1) by A39, A42, FINSEQ_1:45;
A44: s = r2 ^ r1 by A43, FINSEQ_1:46;
A45: s | (dom r2) = r2 by A44, FINSEQ_1:33;
A46: s | (Seg (len r2)) = r2 by A45, FINSEQ_1:def 3;
reconsider r2 = r2 as FinSequence of NAT by A46, FINSEQ_1:23;
A47: r2 is_a_prefix_of s by A46, TREES_1:def 1;
reconsider r2 = r2 as Element of T1 by A47, TREES_1:45;
A48: r = p ^ r2 by A42;
A49: r in { (w ^ v) where w is Element of T, v is Element of T1 : w in P } by A35, A48;
thus r in X by A10, A49, XBOOLE_0:def 3; :: thesis: verum
end;
A50: now end;
thus x in X by A40, A50; :: thesis: verum
end;
end;
thus ProperPrefixes q c= X by A20, A21, A32, XBOOLE_0:def 3; :: thesis: verum
end;
let q be FinSequence of NAT ; :: thesis: for b1, b2 being Element of NAT holds
( not q ^ <*b1*> in X or not b2 <= b1 or q ^ <*b2*> in X )

let k, n be Element of NAT ; :: thesis: ( not q ^ <*k*> in X or not n <= k or q ^ <*n*> in X )
assume that
A65: q ^ <*k*> in X and
A66: n <= k ; :: thesis: q ^ <*n*> in X
A67: now
assume A68: q ^ <*k*> in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
; :: thesis: q ^ <*n*> in X
A69: ex s being Element of T st
( q ^ <*k*> = s & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of s ) ) by A68;
reconsider u = q ^ <*n*> as Element of T by A66, A69, TREES_1:def 5;
A70: now end;
A75: q ^ <*n*> in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
by A70;
thus q ^ <*n*> in X by A75, XBOOLE_0:def 3; :: thesis: verum
end;
A76: now
assume A77: q ^ <*k*> in Z ; :: thesis: q ^ <*n*> in X
consider p being Element of T, s being Element of T1 such that
A78: q ^ <*k*> = p ^ s and
A79: p in P by A10, A77;
A80: now
assume A81: len q <= len p ; :: thesis: q ^ <*n*> in X
consider r being FinSequence such that
A82: q ^ r = p by A78, A81, FINSEQ_1:64;
A83: q ^ <*k*> = q ^ (r ^ s) by A78, A82, FINSEQ_1:45;
A84: <*k*> = r ^ s by A83, FINSEQ_1:46;
A85: now
assume A86: r = <*k*> ; :: thesis: q ^ <*n*> in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}

reconsider s9 = q ^ <*n*> as Element of T by A66, A82, A86, TREES_1:def 5;
A87: now end;
thus q ^ <*n*> in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
by A87; :: thesis: verum
end;
A97: now
assume that
A98: s = <*k*> and
A99: r = {} ; :: thesis: q ^ <*n*> in Z
A100: s = (<*> NAT ) ^ s by FINSEQ_1:47;
A101: (<*> NAT ) ^ <*n*> in T1 by A66, A98, A100, TREES_1:def 5;
reconsider t = <*n*> as Element of T1 by A101, FINSEQ_1:47;
A102: q ^ <*n*> = p ^ t by A82, A99, FINSEQ_1:47;
thus q ^ <*n*> in Z by A10, A79, A102; :: thesis: verum
end;
thus q ^ <*n*> in X by A84, A85, A97, FINSEQ_1:109, XBOOLE_0:def 3; :: thesis: verum
end;
A103: now
assume A104: len p <= len q ; :: thesis: q ^ <*n*> in X
consider r being FinSequence such that
A105: p ^ r = q by A78, A104, FINSEQ_1:64;
A106: p ^ (r ^ <*k*>) = p ^ s by A78, A105, FINSEQ_1:45;
A107: r ^ <*k*> = s by A106, FINSEQ_1:46;
A108: s | (dom r) = r by A107, FINSEQ_1:33;
A109: s | (Seg (len r)) = r by A108, FINSEQ_1:def 3;
reconsider r = r as FinSequence of NAT by A109, FINSEQ_1:23;
reconsider t = r ^ <*n*> as Element of T1 by A66, A107, TREES_1:def 5;
A110: q ^ <*n*> = p ^ t by A105, FINSEQ_1:45;
A111: q ^ <*n*> in { (p9 ^ v) where p9 is Element of T, v is Element of T1 : p9 in P } by A79, A110;
thus q ^ <*n*> in X by A10, A111, XBOOLE_0:def 3; :: thesis: verum
end;
thus q ^ <*n*> in X by A80, A103; :: thesis: verum
end;
thus q ^ <*n*> in X by A65, A67, A76, XBOOLE_0:def 3; :: thesis: verum
end;
reconsider X = X as Tree by A14;
take X ; :: thesis: for q being FinSequence of NAT holds
( q in X iff ( ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) ) )

let q be FinSequence of NAT ; :: thesis: ( q in X iff ( ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) ) )

thus ( not q in X or ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) ) :: thesis: ( ( ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) ) implies q in X )
proof
assume A112: q in X ; :: thesis: ( ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) )

A113: now
assume A114: q in Y ; :: thesis: ( ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) )

A115: ex s being Element of T st
( q = s & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of s ) ) by A114;
thus ( ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) ) by A115; :: thesis: verum
end;
A116: now
assume A117: q in Z ; :: thesis: ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r )

A118: ex p being Element of T ex s being Element of T1 st
( q = p ^ s & p in P ) by A10, A117;
thus ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) by A118; :: thesis: verum
end;
thus ( ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) ) by A112, A113, A116, XBOOLE_0:def 3; :: thesis: verum
end;
assume A119: ( ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) ) or ex p, r being FinSequence of NAT st
( p in P & r in T1 & q = p ^ r ) ) ; :: thesis: q in X
A120: ( q in T & ( for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of q ) implies q in { t where t is Element of T : for p being FinSequence of NAT st p in P holds
not p is_a_proper_prefix_of t
}
) ;
A121: now
given p, r being FinSequence of NAT such that A122: ( p in P & r in T1 & q = p ^ r ) ; :: thesis: q in Z
A123: P c= T by TREES_1:def 14;
thus q in Z by A10, A122, A123; :: thesis: verum
end;
thus q in X by A119, A120, A121, XBOOLE_0:def 3; :: thesis: verum