let S be locally_directed OrderSortedSign; :: thesis: for X being V5() ManySortedSet of
for x, y being Element of TS (DTConOSA X)
for s1, s2 being Element of S st s1 <= s2 & x in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds
( [y,s1] in (PTClasses X) . x iff [y,s2] in (PTClasses X) . x )

let X be V5() ManySortedSet of ; :: thesis: for x, y being Element of TS (DTConOSA X)
for s1, s2 being Element of S st s1 <= s2 & x in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds
( [y,s1] in (PTClasses X) . x iff [y,s2] in (PTClasses X) . x )

set D = DTConOSA X;
set PTA = ParsedTermsOSA X;
set C = bool [:(TS (DTConOSA X)),the carrier of S:];
set SPTA = the Sorts of (ParsedTermsOSA X);
set F = PTClasses X;
defpred S1[ set ] means for s1, s2 being Element of S
for y being Element of TS (DTConOSA X) st s1 <= s2 & $1 in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds
( [y,s1] in (PTClasses X) . $1 iff [y,s2] in (PTClasses X) . $1 );
A1: for s being Symbol of (DTConOSA X) st s in Terminals (DTConOSA X) holds
S1[ root-tree s]
proof
let sy be Symbol of (DTConOSA X); :: thesis: ( sy in Terminals (DTConOSA X) implies S1[ root-tree sy] )
assume A2: sy in Terminals (DTConOSA X) ; :: thesis: S1[ root-tree sy]
reconsider sy1 = sy as Terminal of (DTConOSA X) by A2;
A3: (PTClasses X) . (root-tree sy) = @ sy by A2, Def22
.= { [(root-tree sy),s1] where s1 is Element of S : ex s2 being Element of S ex x being set st
( x in X . s2 & sy = [x,s2] & s2 <= s1 )
}
;
let s1, s2 be Element of S; :: thesis: for y being Element of TS (DTConOSA X) st s1 <= s2 & root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds
( [y,s1] in (PTClasses X) . (root-tree sy) iff [y,s2] in (PTClasses X) . (root-tree sy) )

let y be Element of TS (DTConOSA X); :: thesis: ( s1 <= s2 & root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 implies ( [y,s1] in (PTClasses X) . (root-tree sy) iff [y,s2] in (PTClasses X) . (root-tree sy) ) )
assume A4: ( s1 <= s2 & root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 ) ; :: thesis: ( [y,s1] in (PTClasses X) . (root-tree sy) iff [y,s2] in (PTClasses X) . (root-tree sy) )
A5: [(root-tree sy1),s1] in (PTClasses X) . (root-tree sy) by A4, Th20;
the Sorts of (ParsedTermsOSA X) . s1 c= the Sorts of (ParsedTermsOSA X) . s2 by A4, OSALG_1:def 18;
then A6: [(root-tree sy1),s2] in (PTClasses X) . (root-tree sy) by A4, Th20;
hereby :: thesis: ( [y,s2] in (PTClasses X) . (root-tree sy) implies [y,s1] in (PTClasses X) . (root-tree sy) )
assume [y,s1] in (PTClasses X) . (root-tree sy) ; :: thesis: [y,s2] in (PTClasses X) . (root-tree sy)
then consider s3 being Element of S such that
A7: [y,s1] = [(root-tree sy),s3] and
ex s2 being Element of S ex x being set st
( x in X . s2 & sy = [x,s2] & s2 <= s3 ) by A3;
thus [y,s2] in (PTClasses X) . (root-tree sy) by A6, A7, ZFMISC_1:33; :: thesis: verum
end;
assume [y,s2] in (PTClasses X) . (root-tree sy) ; :: thesis: [y,s1] in (PTClasses X) . (root-tree sy)
then consider s3 being Element of S such that
A8: [y,s2] = [(root-tree sy),s3] and
ex s4 being Element of S ex x being set st
( x in X . s4 & sy = [x,s4] & s4 <= s3 ) by A3;
thus [y,s1] in (PTClasses X) . (root-tree sy) by A5, A8, ZFMISC_1:33; :: thesis: verum
end;
A9: for nt being Symbol of (DTConOSA X)
for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of st t in rng ts holds
S1[t] ) holds
S1[nt -tree ts]
proof
let nt be Symbol of (DTConOSA X); :: thesis: for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of st t in rng ts holds
S1[t] ) holds
S1[nt -tree ts]

let ts be FinSequence of TS (DTConOSA X); :: thesis: ( nt ==> roots ts & ( for t being DecoratedTree of st t in rng ts holds
S1[t] ) implies S1[nt -tree ts] )

assume that
A10: nt ==> roots ts and
for t being DecoratedTree of st t in rng ts holds
S1[t] ; :: thesis: S1[nt -tree ts]
consider o being OperSymbol of S such that
A11: ( nt = [o,the carrier of S] & ts in Args o,(ParsedTermsOSA X) & nt -tree ts = (Den o,(ParsedTermsOSA X)) . ts & ( for s1 being Element of S holds
( nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) ) ) by A10, Th12;
reconsider x = (PTClasses X) * ts as FinSequence of bool [:(TS (DTConOSA X)),the carrier of S:] ;
A12: (PTClasses X) . (nt -tree ts) = @ nt,x by A10, Def22
.= { [((Den o2,(ParsedTermsOSA X)) . x2),s3] where o2 is OperSymbol of S, x2 is Element of Args o2,(ParsedTermsOSA X), s3 is Element of S : ( ex o1 being OperSymbol of S st
( nt = [o1,the carrier of S] & o1 ~= o2 & len (the_arity_of o1) = len (the_arity_of o2) & the_result_sort_of o1 <= s3 & the_result_sort_of o2 <= s3 ) & ex w3 being Element of the carrier of S * st
( dom w3 = dom x & ( for y being Nat st y in dom x holds
[(x2 . y),(w3 /. y)] in x . y ) ) )
}
;
let s1, s2 be Element of S; :: thesis: for y being Element of TS (DTConOSA X) st s1 <= s2 & nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds
( [y,s1] in (PTClasses X) . (nt -tree ts) iff [y,s2] in (PTClasses X) . (nt -tree ts) )

let y be Element of TS (DTConOSA X); :: thesis: ( s1 <= s2 & nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 implies ( [y,s1] in (PTClasses X) . (nt -tree ts) iff [y,s2] in (PTClasses X) . (nt -tree ts) ) )
assume A13: ( s1 <= s2 & nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 ) ; :: thesis: ( [y,s1] in (PTClasses X) . (nt -tree ts) iff [y,s2] in (PTClasses X) . (nt -tree ts) )
A14: the_result_sort_of o <= s1 by A11, A13;
hereby :: thesis: ( [y,s2] in (PTClasses X) . (nt -tree ts) implies [y,s1] in (PTClasses X) . (nt -tree ts) )
assume [y,s1] in (PTClasses X) . (nt -tree ts) ; :: thesis: [y,s2] in (PTClasses X) . (nt -tree ts)
then consider o2 being OperSymbol of S, x2 being Element of Args o2,(ParsedTermsOSA X), s3 being Element of S such that
A15: [y,s1] = [((Den o2,(ParsedTermsOSA X)) . x2),s3] and
A16: ( ex o1 being OperSymbol of S st
( nt = [o1,the carrier of S] & o1 ~= o2 & len (the_arity_of o1) = len (the_arity_of o2) & the_result_sort_of o1 <= s3 & the_result_sort_of o2 <= s3 ) & ex w3 being Element of the carrier of S * st
( dom w3 = dom x & ( for y being Nat st y in dom x holds
[(x2 . y),(w3 /. y)] in x . y ) ) ) by A12;
A17: ( y = (Den o2,(ParsedTermsOSA X)) . x2 & s1 = s3 ) by A15, ZFMISC_1:33;
consider o1 being OperSymbol of S such that
A18: ( nt = [o1,the carrier of S] & o1 ~= o2 & len (the_arity_of o1) = len (the_arity_of o2) & the_result_sort_of o1 <= s3 & the_result_sort_of o2 <= s3 ) by A16;
reconsider s21 = s2 as Element of S ;
( the_result_sort_of o1 <= s21 & the_result_sort_of o2 <= s21 ) by A13, A17, A18, ORDERS_2:26;
hence [y,s2] in (PTClasses X) . (nt -tree ts) by A12, A16, A17, A18; :: thesis: verum
end;
assume [y,s2] in (PTClasses X) . (nt -tree ts) ; :: thesis: [y,s1] in (PTClasses X) . (nt -tree ts)
then consider o2 being OperSymbol of S, x2 being Element of Args o2,(ParsedTermsOSA X), s3 being Element of S such that
A19: [y,s2] = [((Den o2,(ParsedTermsOSA X)) . x2),s3] and
A20: ( ex o1 being OperSymbol of S st
( nt = [o1,the carrier of S] & o1 ~= o2 & len (the_arity_of o1) = len (the_arity_of o2) & the_result_sort_of o1 <= s3 & the_result_sort_of o2 <= s3 ) & ex w3 being Element of the carrier of S * st
( dom w3 = dom x & ( for y being Nat st y in dom x holds
[(x2 . y),(w3 /. y)] in x . y ) ) ) by A12;
A21: ( y = (Den o2,(ParsedTermsOSA X)) . x2 & s2 = s3 ) by A19, ZFMISC_1:33;
consider o1 being OperSymbol of S such that
A22: ( nt = [o1,the carrier of S] & o1 ~= o2 & len (the_arity_of o1) = len (the_arity_of o2) & the_result_sort_of o1 <= s3 & the_result_sort_of o2 <= s3 ) by A20;
A23: the_result_sort_of o1 <= s1 by A11, A14, A22, ZFMISC_1:33;
A24: ( x2 is FinSequence of TS (DTConOSA X) & OSSym o2,X ==> roots x2 ) by Th13;
reconsider x3 = x2 as FinSequence of TS (DTConOSA X) by Th13;
consider o3 being OperSymbol of S such that
A25: ( OSSym o2,X = [o3,the carrier of S] & x3 in Args o3,(ParsedTermsOSA X) & (OSSym o2,X) -tree x3 = (Den o3,(ParsedTermsOSA X)) . x3 & ( for s2 being Element of S holds
( (OSSym o2,X) -tree x3 in the Sorts of (ParsedTermsOSA X) . s2 iff the_result_sort_of o3 <= s2 ) ) ) by A24, Th12;
o2 = o3 by A25, ZFMISC_1:33;
then the_result_sort_of o2 <= s1 by A13, A21, A25;
hence [y,s1] in (PTClasses X) . (nt -tree ts) by A12, A20, A21, A22, A23; :: thesis: verum
end;
for t being DecoratedTree of st t in TS (DTConOSA X) holds
S1[t] from DTCONSTR:sch 7(A1, A9);
hence for x, y being Element of TS (DTConOSA X)
for s1, s2 being Element of S st s1 <= s2 & x in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds
( [y,s1] in (PTClasses X) . x iff [y,s2] in (PTClasses X) . x ) ; :: thesis: verum