:: OSAFREE semantic presentation begin definition let S be OrderSortedSign; let U0 be OSAlgebra of S; mode OSGeneratorSet of U0 -> MSSubset of U0 means :Def1: :: OSAFREE:def 1 for O being OSSubset of U0 st O = OSCl it holds the Sorts of (GenOSAlg O) = the Sorts of U0; existence ex b1 being MSSubset of U0 st for O being OSSubset of U0 st O = OSCl b1 holds the Sorts of (GenOSAlg O) = the Sorts of U0 proof set A = the Sorts of U0; reconsider A = the Sorts of U0 as MSSubset of U0 by PBOOLE:def_18; A1: A is OrderSortedSet of S by OSALG_1:17; then reconsider A = A as OSSubset of U0 by OSALG_2:def_2; take A ; ::_thesis: for O being OSSubset of U0 st O = OSCl A holds the Sorts of (GenOSAlg O) = the Sorts of U0 set G = GenOSAlg A; A is OSSubset of GenOSAlg A by OSALG_2:def_12; then A2: A c= the Sorts of (GenOSAlg A) by PBOOLE:def_18; the Sorts of (GenOSAlg A) is MSSubset of U0 by MSUALG_2:def_9; then A3: the Sorts of (GenOSAlg A) c= A by PBOOLE:def_18; A = OSCl A by A1, OSALG_2:9; hence for O being OSSubset of U0 st O = OSCl A holds the Sorts of (GenOSAlg O) = the Sorts of U0 by A2, A3, PBOOLE:146; ::_thesis: verum end; end; :: deftheorem Def1 defines OSGeneratorSet OSAFREE:def_1_:_ for S being OrderSortedSign for U0 being OSAlgebra of S for b3 being MSSubset of U0 holds ( b3 is OSGeneratorSet of U0 iff for O being OSSubset of U0 st O = OSCl b3 holds the Sorts of (GenOSAlg O) = the Sorts of U0 ); theorem :: OSAFREE:1 for S being OrderSortedSign for U0 being strict non-empty OSAlgebra of S for A being MSSubset of U0 holds ( A is OSGeneratorSet of U0 iff for O being OSSubset of U0 st O = OSCl A holds GenOSAlg O = U0 ) proof let S be OrderSortedSign; ::_thesis: for U0 being strict non-empty OSAlgebra of S for A being MSSubset of U0 holds ( A is OSGeneratorSet of U0 iff for O being OSSubset of U0 st O = OSCl A holds GenOSAlg O = U0 ) let U0 be strict non-empty OSAlgebra of S; ::_thesis: for A being MSSubset of U0 holds ( A is OSGeneratorSet of U0 iff for O being OSSubset of U0 st O = OSCl A holds GenOSAlg O = U0 ) let A be MSSubset of U0; ::_thesis: ( A is OSGeneratorSet of U0 iff for O being OSSubset of U0 st O = OSCl A holds GenOSAlg O = U0 ) thus ( A is OSGeneratorSet of U0 implies for O being OSSubset of U0 st O = OSCl A holds GenOSAlg O = U0 ) ::_thesis: ( ( for O being OSSubset of U0 st O = OSCl A holds GenOSAlg O = U0 ) implies A is OSGeneratorSet of U0 ) proof reconsider U1 = U0 as MSSubAlgebra of U0 by MSUALG_2:5; assume A1: A is OSGeneratorSet of U0 ; ::_thesis: for O being OSSubset of U0 st O = OSCl A holds GenOSAlg O = U0 let O be OSSubset of U0; ::_thesis: ( O = OSCl A implies GenOSAlg O = U0 ) assume O = OSCl A ; ::_thesis: GenOSAlg O = U0 then the Sorts of (GenOSAlg O) = the Sorts of U1 by A1, Def1; hence GenOSAlg O = U0 by MSUALG_2:9; ::_thesis: verum end; assume A2: for O being OSSubset of U0 st O = OSCl A holds GenOSAlg O = U0 ; ::_thesis: A is OSGeneratorSet of U0 let O be OSSubset of U0; :: according to OSAFREE:def_1 ::_thesis: ( O = OSCl A implies the Sorts of (GenOSAlg O) = the Sorts of U0 ) assume O = OSCl A ; ::_thesis: the Sorts of (GenOSAlg O) = the Sorts of U0 hence the Sorts of (GenOSAlg O) = the Sorts of U0 by A2; ::_thesis: verum end; definition let S be OrderSortedSign; let U0 be monotone OSAlgebra of S; let IT be OSGeneratorSet of U0; attrIT is osfree means :: OSAFREE:def 2 for U1 being non-empty monotone OSAlgebra of S for f being ManySortedFunction of IT, the Sorts of U1 ex h being ManySortedFunction of U0,U1 st ( h is_homomorphism U0,U1 & h is order-sorted & h || IT = f ); end; :: deftheorem defines osfree OSAFREE:def_2_:_ for S being OrderSortedSign for U0 being monotone OSAlgebra of S for IT being OSGeneratorSet of U0 holds ( IT is osfree iff for U1 being non-empty monotone OSAlgebra of S for f being ManySortedFunction of IT, the Sorts of U1 ex h being ManySortedFunction of U0,U1 st ( h is_homomorphism U0,U1 & h is order-sorted & h || IT = f ) ); definition let S be OrderSortedSign; let IT be monotone OSAlgebra of S; attrIT is osfree means :: OSAFREE:def 3 ex G being OSGeneratorSet of IT st G is osfree ; end; :: deftheorem defines osfree OSAFREE:def_3_:_ for S being OrderSortedSign for IT being monotone OSAlgebra of S holds ( IT is osfree iff ex G being OSGeneratorSet of IT st G is osfree ); begin definition let S be OrderSortedSign; let X be ManySortedSet of S; func OSREL X -> Relation of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) *) means :Def4: :: OSAFREE:def 4 for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in it iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ); existence ex b1 being Relation of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) *) st for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in b1 iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) proof set O = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); defpred S1[ Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)), Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * ] means ( $1 in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = $1 holds ( len $2 = len (the_arity_of o) & ( for x being set st x in dom $2 holds ( ( $2 . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = $2 . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( $2 . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & $2 . x in coprod (i,X) ) ) ) ) ) ) ); consider R being Relation of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) *) such that A1: for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in R iff S1[a,b] ) from RELSET_1:sch_2(); take R ; ::_thesis: for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in R iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) let a be Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); ::_thesis: for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in R iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) let b be Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * ; ::_thesis: ( [a,b] in R iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) thus ( [a,b] in R implies ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) by A1; ::_thesis: ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) implies [a,b] in R ) assume that A2: a in [: the carrier' of S,{ the carrier of S}:] and A3: for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ; ::_thesis: [a,b] in R thus [a,b] in R by A1, A2, A3; ::_thesis: verum end; uniqueness for b1, b2 being Relation of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) *) st ( for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in b1 iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) ) & ( for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in b2 iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) ) holds b1 = b2 proof set O = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); let R, P be Relation of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) *); ::_thesis: ( ( for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in R iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) ) & ( for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in P iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) ) implies R = P ) assume that A4: for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in R iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) and A5: for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in P iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) ; ::_thesis: R = P for x, y being set holds ( [x,y] in R iff [x,y] in P ) proof let x, y be set ; ::_thesis: ( [x,y] in R iff [x,y] in P ) thus ( [x,y] in R implies [x,y] in P ) ::_thesis: ( [x,y] in P implies [x,y] in R ) proof assume A6: [x,y] in R ; ::_thesis: [x,y] in P then reconsider a = x as Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by ZFMISC_1:87; reconsider b = y as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by A6, ZFMISC_1:87; [a,b] in R by A6; then A7: a in [: the carrier' of S,{ the carrier of S}:] by A4; for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) by A4, A6; hence [x,y] in P by A5, A7; ::_thesis: verum end; assume A8: [x,y] in P ; ::_thesis: [x,y] in R then reconsider a = x as Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by ZFMISC_1:87; reconsider b = y as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by A8, ZFMISC_1:87; [a,b] in P by A8; then A9: a in [: the carrier' of S,{ the carrier of S}:] by A5; for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) by A5, A8; hence [x,y] in R by A4, A9; ::_thesis: verum end; hence R = P by RELAT_1:def_2; ::_thesis: verum end; end; :: deftheorem Def4 defines OSREL OSAFREE:def_4_:_ for S being OrderSortedSign for X being ManySortedSet of S for b3 being Relation of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) *) holds ( b3 = OSREL X iff for a being Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [a,b] in b3 iff ( a in [: the carrier' of S,{ the carrier of S}:] & ( for o being OperSymbol of S st [o, the carrier of S] = a holds ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) ) ) ); theorem Th2: :: OSAFREE:2 for S being OrderSortedSign for X being ManySortedSet of S for o being OperSymbol of S for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [[o, the carrier of S],b] in OSREL X iff ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) proof let S be OrderSortedSign; ::_thesis: for X being ManySortedSet of S for o being OperSymbol of S for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [[o, the carrier of S],b] in OSREL X iff ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) let X be ManySortedSet of S; ::_thesis: for o being OperSymbol of S for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [[o, the carrier of S],b] in OSREL X iff ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) let o be OperSymbol of S; ::_thesis: for b being Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * holds ( [[o, the carrier of S],b] in OSREL X iff ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) let b be Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * ; ::_thesis: ( [[o, the carrier of S],b] in OSREL X iff ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) ) ) defpred S1[ OperSymbol of S, Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * ] means ( len $2 = len (the_arity_of $1) & ( for x being set st x in dom $2 holds ( ( $2 . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = $2 . x holds the_result_sort_of o1 <= (the_arity_of $1) /. x ) & ( $2 . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of $1) /. x & b . x in coprod (i,X) ) ) ) ) ); set a = [o, the carrier of S]; the carrier of S in { the carrier of S} by TARSKI:def_1; then A1: [o, the carrier of S] in [: the carrier' of S,{ the carrier of S}:] by ZFMISC_1:87; then reconsider a = [o, the carrier of S] as Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by XBOOLE_0:def_3; thus ( [[o, the carrier of S],b] in OSREL X implies S1[o,b] ) ::_thesis: ( len b = len (the_arity_of o) & ( for x being set st x in dom b holds ( ( b . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( b . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & b . x in coprod (i,X) ) ) ) ) implies [[o, the carrier of S],b] in OSREL X ) proof assume [[o, the carrier of S],b] in OSREL X ; ::_thesis: S1[o,b] then for o1 being OperSymbol of S st [o1, the carrier of S] = a holds S1[o1,b] by Def4; hence S1[o,b] ; ::_thesis: verum end; assume A2: S1[o,b] ; ::_thesis: [[o, the carrier of S],b] in OSREL X now__::_thesis:_for_o1_being_OperSymbol_of_S_st_[o1,_the_carrier_of_S]_=_a_holds_ S1[o1,b] let o1 be OperSymbol of S; ::_thesis: ( [o1, the carrier of S] = a implies S1[o1,b] ) assume [o1, the carrier of S] = a ; ::_thesis: S1[o1,b] then o1 = o by XTUPLE_0:1; hence S1[o1,b] by A2; ::_thesis: verum end; hence [[o, the carrier of S],b] in OSREL X by A1, Def4; ::_thesis: verum end; definition let S be OrderSortedSign; let X be ManySortedSet of S; func DTConOSA X -> DTConstrStr equals :: OSAFREE:def 5 DTConstrStr(# ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(OSREL X) #); correctness coherence DTConstrStr(# ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(OSREL X) #) is DTConstrStr ; ; end; :: deftheorem defines DTConOSA OSAFREE:def_5_:_ for S being OrderSortedSign for X being ManySortedSet of S holds DTConOSA X = DTConstrStr(# ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))),(OSREL X) #); registration let S be OrderSortedSign; let X be ManySortedSet of S; cluster DTConOSA X -> non empty strict ; coherence ( DTConOSA X is strict & not DTConOSA X is empty ) ; end; theorem Th3: :: OSAFREE:3 for S being OrderSortedSign for X being V16() ManySortedSet of S holds ( NonTerminals (DTConOSA X) = [: the carrier' of S,{ the carrier of S}:] & Terminals (DTConOSA X) = Union (coprod X) ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S holds ( NonTerminals (DTConOSA X) = [: the carrier' of S,{ the carrier of S}:] & Terminals (DTConOSA X) = Union (coprod X) ) let X be V16() ManySortedSet of S; ::_thesis: ( NonTerminals (DTConOSA X) = [: the carrier' of S,{ the carrier of S}:] & Terminals (DTConOSA X) = Union (coprod X) ) set D = DTConOSA X; set A = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); A1: the carrier of (DTConOSA X) = (Terminals (DTConOSA X)) \/ (NonTerminals (DTConOSA X)) by LANG1:1; thus A2: NonTerminals (DTConOSA X) c= [: the carrier' of S,{ the carrier of S}:] :: according to XBOOLE_0:def_10 ::_thesis: ( [: the carrier' of S,{ the carrier of S}:] c= NonTerminals (DTConOSA X) & Terminals (DTConOSA X) = Union (coprod X) ) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in NonTerminals (DTConOSA X) or x in [: the carrier' of S,{ the carrier of S}:] ) assume x in NonTerminals (DTConOSA X) ; ::_thesis: x in [: the carrier' of S,{ the carrier of S}:] then x in { s where s is Symbol of (DTConOSA X) : ex n being FinSequence st s ==> n } by LANG1:def_3; then consider s being Symbol of (DTConOSA X) such that A3: s = x and A4: ex n being FinSequence st s ==> n ; consider n being FinSequence such that A5: s ==> n by A4; [s,n] in the Rules of (DTConOSA X) by A5, LANG1:def_1; then reconsider n = n as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by ZFMISC_1:87; reconsider s = s as Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) ; [s,n] in OSREL X by A5, LANG1:def_1; hence x in [: the carrier' of S,{ the carrier of S}:] by A3, Def4; ::_thesis: verum end; A6: Union (coprod X) misses [: the carrier' of S,{ the carrier of S}:] by MSAFREE:4; thus A7: [: the carrier' of S,{ the carrier of S}:] c= NonTerminals (DTConOSA X) ::_thesis: Terminals (DTConOSA X) = Union (coprod X) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in [: the carrier' of S,{ the carrier of S}:] or x in NonTerminals (DTConOSA X) ) assume A8: x in [: the carrier' of S,{ the carrier of S}:] ; ::_thesis: x in NonTerminals (DTConOSA X) then consider o being Element of the carrier' of S, x2 being Element of { the carrier of S} such that A9: x = [o,x2] by DOMAIN_1:1; set O = the_arity_of o; defpred S1[ set , set ] means ex i being Element of S st ( i <= (the_arity_of o) /. $1 & $2 in coprod (i,X) ); A10: for a being set st a in Seg (len (the_arity_of o)) holds ex b being set st S1[a,b] proof let a be set ; ::_thesis: ( a in Seg (len (the_arity_of o)) implies ex b being set st S1[a,b] ) assume a in Seg (len (the_arity_of o)) ; ::_thesis: ex b being set st S1[a,b] then A11: a in dom (the_arity_of o) by FINSEQ_1:def_3; then A12: (the_arity_of o) . a in rng (the_arity_of o) by FUNCT_1:def_3; A13: rng (the_arity_of o) c= the carrier of S by FINSEQ_1:def_4; then consider x being set such that A14: x in X . ((the_arity_of o) . a) by A12, XBOOLE_0:def_1; take y = [x,((the_arity_of o) . a)]; ::_thesis: S1[a,y] take (the_arity_of o) /. a ; ::_thesis: ( (the_arity_of o) /. a <= (the_arity_of o) /. a & y in coprod (((the_arity_of o) /. a),X) ) y in coprod (((the_arity_of o) . a),X) by A12, A13, A14, MSAFREE:def_2; hence ( (the_arity_of o) /. a <= (the_arity_of o) /. a & y in coprod (((the_arity_of o) /. a),X) ) by A11, PARTFUN1:def_6; ::_thesis: verum end; consider b being Function such that A15: ( dom b = Seg (len (the_arity_of o)) & ( for a being set st a in Seg (len (the_arity_of o)) holds S1[a,b . a] ) ) from CLASSES1:sch_1(A10); reconsider b = b as FinSequence by A15, FINSEQ_1:def_2; rng b c= [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in rng b or a in [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) ) assume a in rng b ; ::_thesis: a in [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) then consider c being set such that A16: c in dom b and A17: b . c = a by FUNCT_1:def_3; consider i being Element of S such that i <= (the_arity_of o) /. c and A18: a in coprod (i,X) by A15, A16, A17; dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . i in rng (coprod X) by FUNCT_1:def_3; then coprod (i,X) in rng (coprod X) by MSAFREE:def_3; then a in union (rng (coprod X)) by A18, TARSKI:def_4; then a in Union (coprod X) by CARD_3:def_4; hence a in [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by XBOOLE_0:def_3; ::_thesis: verum end; then reconsider b = b as FinSequence of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by FINSEQ_1:def_4; reconsider b = b as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by FINSEQ_1:def_11; A19: now__::_thesis:_for_c_being_set_st_c_in_dom_b_holds_ (_(_b_._c_in_[:_the_carrier'_of_S,{_the_carrier_of_S}:]_implies_for_o1_being_OperSymbol_of_S_st_[o1,_the_carrier_of_S]_=_b_._c_holds_ the_result_sort_of_o1_<=_(the_arity_of_o)_/._c_)_&_(_b_._c_in_Union_(coprod_X)_implies_ex_i_being_Element_of_S_st_ (_i_<=_(the_arity_of_o)_/._c_&_b_._c_in_coprod_(i,X)_)_)_) let c be set ; ::_thesis: ( c in dom b implies ( ( b . c in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . c holds the_result_sort_of o1 <= (the_arity_of o) /. c ) & ( b . c in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) ) ) ) assume c in dom b ; ::_thesis: ( ( b . c in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . c holds the_result_sort_of o1 <= (the_arity_of o) /. c ) & ( b . c in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) ) ) then consider i being Element of S such that A20: i <= (the_arity_of o) /. c and A21: b . c in coprod (i,X) by A15; dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . i in rng (coprod X) by FUNCT_1:def_3; then coprod (i,X) in rng (coprod X) by MSAFREE:def_3; then b . c in union (rng (coprod X)) by A21, TARSKI:def_4; then b . c in Union (coprod X) by CARD_3:def_4; hence ( b . c in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . c holds the_result_sort_of o1 <= (the_arity_of o) /. c ) by A6, XBOOLE_0:3; ::_thesis: ( b . c in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) ) assume b . c in Union (coprod X) ; ::_thesis: ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) thus ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) by A20, A21; ::_thesis: verum end; A22: the carrier of S = x2 by TARSKI:def_1; then reconsider xa = [o, the carrier of S] as Element of the carrier of (DTConOSA X) by A8, A9, XBOOLE_0:def_3; len b = len (the_arity_of o) by A15, FINSEQ_1:def_3; then [xa,b] in OSREL X by A19, Th2; then xa ==> b by LANG1:def_1; then xa in { t where t is Symbol of (DTConOSA X) : ex n being FinSequence st t ==> n } ; hence x in NonTerminals (DTConOSA X) by A9, A22, LANG1:def_3; ::_thesis: verum end; A23: Terminals (DTConOSA X) misses NonTerminals (DTConOSA X) by DTCONSTR:8; thus Terminals (DTConOSA X) c= Union (coprod X) :: according to XBOOLE_0:def_10 ::_thesis: Union (coprod X) c= Terminals (DTConOSA X) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Terminals (DTConOSA X) or x in Union (coprod X) ) assume A24: x in Terminals (DTConOSA X) ; ::_thesis: x in Union (coprod X) then A25: x in [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by A1, XBOOLE_0:def_3; not x in [: the carrier' of S,{ the carrier of S}:] by A23, A7, A24, XBOOLE_0:3; hence x in Union (coprod X) by A25, XBOOLE_0:def_3; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in Union (coprod X) or x in Terminals (DTConOSA X) ) assume A26: x in Union (coprod X) ; ::_thesis: x in Terminals (DTConOSA X) then x in [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by XBOOLE_0:def_3; then ( x in Terminals (DTConOSA X) or x in NonTerminals (DTConOSA X) ) by A1, XBOOLE_0:def_3; hence x in Terminals (DTConOSA X) by A6, A2, A26, XBOOLE_0:3; ::_thesis: verum end; registration let S be OrderSortedSign; let X be V16() ManySortedSet of S; cluster DTConOSA X -> with_terminals with_nonterminals with_useful_nonterminals ; coherence ( DTConOSA X is with_terminals & DTConOSA X is with_nonterminals & DTConOSA X is with_useful_nonterminals ) proof set D = DTConOSA X; set A = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); A1: Terminals (DTConOSA X) = Union (coprod X) by Th3; A2: NonTerminals (DTConOSA X) = [: the carrier' of S,{ the carrier of S}:] by Th3; A3: Union (coprod X) misses [: the carrier' of S,{ the carrier of S}:] by MSAFREE:4; for nt being Symbol of (DTConOSA X) st nt in NonTerminals (DTConOSA X) holds ex p being FinSequence of TS (DTConOSA X) st nt ==> roots p proof let nt be Symbol of (DTConOSA X); ::_thesis: ( nt in NonTerminals (DTConOSA X) implies ex p being FinSequence of TS (DTConOSA X) st nt ==> roots p ) assume nt in NonTerminals (DTConOSA X) ; ::_thesis: ex p being FinSequence of TS (DTConOSA X) st nt ==> roots p then consider o being Element of the carrier' of S, x2 being Element of { the carrier of S} such that A4: nt = [o,x2] by A2, DOMAIN_1:1; set O = the_arity_of o; A5: the carrier of S = x2 by TARSKI:def_1; defpred S1[ set , set ] means ex i being Element of S st ( i <= (the_arity_of o) /. S & X in coprod (i,X) ); A6: for a being set st a in Seg (len (the_arity_of o)) holds ex b being set st S1[a,b] proof let a be set ; ::_thesis: ( a in Seg (len (the_arity_of o)) implies ex b being set st S1[a,b] ) assume a in Seg (len (the_arity_of o)) ; ::_thesis: ex b being set st S1[a,b] then A7: a in dom (the_arity_of o) by FINSEQ_1:def_3; then A8: (the_arity_of o) . a in rng (the_arity_of o) by FUNCT_1:def_3; A9: rng (the_arity_of o) c= the carrier of S by FINSEQ_1:def_4; then consider x being set such that A10: x in X . ((the_arity_of o) . a) by A8, XBOOLE_0:def_1; take y = [x,((the_arity_of o) . a)]; ::_thesis: S1[a,y] take (the_arity_of o) /. a ; ::_thesis: ( (the_arity_of o) /. a <= (the_arity_of o) /. a & y in coprod (((the_arity_of o) /. a),X) ) y in coprod (((the_arity_of o) . a),X) by A8, A9, A10, MSAFREE:def_2; hence ( (the_arity_of o) /. a <= (the_arity_of o) /. a & y in coprod (((the_arity_of o) /. a),X) ) by A7, PARTFUN1:def_6; ::_thesis: verum end; consider b being Function such that A11: ( dom b = Seg (len (the_arity_of o)) & ( for a being set st a in Seg (len (the_arity_of o)) holds S1[a,b . a] ) ) from CLASSES1:sch_1(A6); reconsider b = b as FinSequence by A11, FINSEQ_1:def_2; A12: rng b c= [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in rng b or a in [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) ) assume a in rng b ; ::_thesis: a in [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) then consider c being set such that A13: c in dom b and A14: b . c = a by FUNCT_1:def_3; consider i being Element of S such that i <= (the_arity_of o) /. c and A15: a in coprod (i,X) by A11, A13, A14; dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . i in rng (coprod X) by FUNCT_1:def_3; then coprod (i,X) in rng (coprod X) by MSAFREE:def_3; then a in union (rng (coprod X)) by A15, TARSKI:def_4; then a in Union (coprod X) by CARD_3:def_4; hence a in [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by XBOOLE_0:def_3; ::_thesis: verum end; then reconsider b = b as FinSequence of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by FINSEQ_1:def_4; reconsider b = b as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by FINSEQ_1:def_11; deffunc H1( set ) -> set = root-tree (b . S); consider f being Function such that A16: ( dom f = dom b & ( for x being set st x in dom b holds f . x = H1(x) ) ) from FUNCT_1:sch_3(); reconsider f = f as FinSequence by A11, A16, FINSEQ_1:def_2; rng f c= TS (DTConOSA X) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng f or x in TS (DTConOSA X) ) assume x in rng f ; ::_thesis: x in TS (DTConOSA X) then consider y being set such that A17: y in dom f and A18: f . y = x by FUNCT_1:def_3; b . y in rng b by A16, A17, FUNCT_1:def_3; then reconsider a = b . y as Symbol of (DTConOSA X) by A12; consider i being Element of S such that i <= (the_arity_of o) /. y and A19: b . y in coprod (i,X) by A11, A16, A17; dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . i in rng (coprod X) by FUNCT_1:def_3; then coprod (i,X) in rng (coprod X) by MSAFREE:def_3; then b . y in union (rng (coprod X)) by A19, TARSKI:def_4; then A20: a in Terminals (DTConOSA X) by A1, CARD_3:def_4; x = root-tree (b . y) by A16, A17, A18; hence x in TS (DTConOSA X) by A20, DTCONSTR:def_1; ::_thesis: verum end; then reconsider f = f as FinSequence of TS (DTConOSA X) by FINSEQ_1:def_4; A21: for x being set st x in dom b holds (roots f) . x = b . x proof let x be set ; ::_thesis: ( x in dom b implies (roots f) . x = b . x ) assume A22: x in dom b ; ::_thesis: (roots f) . x = b . x then reconsider i = x as Nat ; A23: ex T being DecoratedTree st ( T = f . i & (roots f) . i = T . {} ) by A16, A22, TREES_3:def_18; f . x = root-tree (b . x) by A16, A22; hence (roots f) . x = b . x by A23, TREES_4:3; ::_thesis: verum end; A24: now__::_thesis:_for_c_being_set_st_c_in_dom_b_holds_ (_(_b_._c_in_[:_the_carrier'_of_S,{_the_carrier_of_S}:]_implies_for_o1_being_OperSymbol_of_S_st_[o1,_the_carrier_of_S]_=_b_._c_holds_ the_result_sort_of_o1_<=_(the_arity_of_o)_/._c_)_&_(_b_._c_in_Union_(coprod_X)_implies_ex_i_being_Element_of_S_st_ (_i_<=_(the_arity_of_o)_/._c_&_b_._c_in_coprod_(i,X)_)_)_) let c be set ; ::_thesis: ( c in dom b implies ( ( b . c in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . c holds the_result_sort_of o1 <= (the_arity_of o) /. c ) & ( b . c in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) ) ) ) assume c in dom b ; ::_thesis: ( ( b . c in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . c holds the_result_sort_of o1 <= (the_arity_of o) /. c ) & ( b . c in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) ) ) then consider i being Element of S such that A25: i <= (the_arity_of o) /. c and A26: b . c in coprod (i,X) by A11; dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . i in rng (coprod X) by FUNCT_1:def_3; then coprod (i,X) in rng (coprod X) by MSAFREE:def_3; then b . c in union (rng (coprod X)) by A26, TARSKI:def_4; then b . c in Union (coprod X) by CARD_3:def_4; hence ( b . c in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = b . c holds the_result_sort_of o1 <= (the_arity_of o) /. c ) by A3, XBOOLE_0:3; ::_thesis: ( b . c in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) ) assume b . c in Union (coprod X) ; ::_thesis: ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) thus ex i being Element of S st ( i <= (the_arity_of o) /. c & b . c in coprod (i,X) ) by A25, A26; ::_thesis: verum end; len b = len (the_arity_of o) by A11, FINSEQ_1:def_3; then [nt,b] in OSREL X by A4, A5, A24, Th2; then A27: nt ==> b by LANG1:def_1; take f ; ::_thesis: nt ==> roots f dom (roots f) = dom f by TREES_3:def_18; hence nt ==> roots f by A27, A16, A21, FUNCT_1:2; ::_thesis: verum end; hence ( DTConOSA X is with_terminals & DTConOSA X is with_nonterminals & DTConOSA X is with_useful_nonterminals ) by A1, A2, DTCONSTR:def_3, DTCONSTR:def_4, DTCONSTR:def_5; ::_thesis: verum end; end; theorem Th4: :: OSAFREE:4 for S being OrderSortedSign for X being V16() ManySortedSet of S for t being set holds ( t in Terminals (DTConOSA X) iff ex s being Element of S ex x being set st ( x in X . s & t = [x,s] ) ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for t being set holds ( t in Terminals (DTConOSA X) iff ex s being Element of S ex x being set st ( x in X . s & t = [x,s] ) ) let X be V16() ManySortedSet of S; ::_thesis: for t being set holds ( t in Terminals (DTConOSA X) iff ex s being Element of S ex x being set st ( x in X . s & t = [x,s] ) ) let t be set ; ::_thesis: ( t in Terminals (DTConOSA X) iff ex s being Element of S ex x being set st ( x in X . s & t = [x,s] ) ) set D = DTConOSA X; A1: Terminals (DTConOSA X) = Union (coprod X) by Th3 .= union (rng (coprod X)) by CARD_3:def_4 ; thus ( t in Terminals (DTConOSA X) implies ex s being Element of S ex x being set st ( x in X . s & t = [x,s] ) ) ::_thesis: ( ex s being Element of S ex x being set st ( x in X . s & t = [x,s] ) implies t in Terminals (DTConOSA X) ) proof assume t in Terminals (DTConOSA X) ; ::_thesis: ex s being Element of S ex x being set st ( x in X . s & t = [x,s] ) then consider A being set such that A2: t in A and A3: A in rng (coprod X) by A1, TARSKI:def_4; consider s being set such that A4: s in dom (coprod X) and A5: (coprod X) . s = A by A3, FUNCT_1:def_3; reconsider s = s as Element of S by A4; (coprod X) . s = coprod (s,X) by MSAFREE:def_3; then consider x being set such that A6: x in X . s and A7: t = [x,s] by A2, A5, MSAFREE:def_2; take s ; ::_thesis: ex x being set st ( x in X . s & t = [x,s] ) take x ; ::_thesis: ( x in X . s & t = [x,s] ) thus ( x in X . s & t = [x,s] ) by A6, A7; ::_thesis: verum end; given s being Element of S, x being set such that A8: x in X . s and A9: t = [x,s] ; ::_thesis: t in Terminals (DTConOSA X) t in coprod (s,X) by A8, A9, MSAFREE:def_2; then A10: t in (coprod X) . s by MSAFREE:def_3; dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . s in rng (coprod X) by FUNCT_1:def_3; hence t in Terminals (DTConOSA X) by A1, A10, TARSKI:def_4; ::_thesis: verum end; definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; let o be OperSymbol of S; func OSSym (o,X) -> Symbol of (DTConOSA X) equals :: OSAFREE:def 6 [o, the carrier of S]; coherence [o, the carrier of S] is Symbol of (DTConOSA X) proof the carrier of S in { the carrier of S} by TARSKI:def_1; then [o, the carrier of S] in [: the carrier' of S,{ the carrier of S}:] by ZFMISC_1:87; then [o, the carrier of S] in NonTerminals (DTConOSA X) by Th3; hence [o, the carrier of S] is Symbol of (DTConOSA X) ; ::_thesis: verum end; end; :: deftheorem defines OSSym OSAFREE:def_6_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S holds OSSym (o,X) = [o, the carrier of S]; definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; let s be Element of S; func ParsedTerms (X,s) -> Subset of (TS (DTConOSA X)) equals :: OSAFREE:def 7 { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } ; coherence { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } is Subset of (TS (DTConOSA X)) proof set A = { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } ; { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } c= TS (DTConOSA X) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } or x in TS (DTConOSA X) ) assume x in { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } ; ::_thesis: x in TS (DTConOSA X) then ex a being Element of TS (DTConOSA X) st ( x = a & ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) ) ; hence x in TS (DTConOSA X) ; ::_thesis: verum end; hence { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } is Subset of (TS (DTConOSA X)) ; ::_thesis: verum end; end; :: deftheorem defines ParsedTerms OSAFREE:def_7_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S holds ParsedTerms (X,s) = { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } ; registration let S be OrderSortedSign; let X be V16() ManySortedSet of S; let s be Element of S; cluster ParsedTerms (X,s) -> non empty ; coherence not ParsedTerms (X,s) is empty proof dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . s in rng (coprod X) by FUNCT_1:def_3; then A1: coprod (s,X) in rng (coprod X) by MSAFREE:def_3; set A = { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } ; consider x being set such that A2: x in X . s by XBOOLE_0:def_1; set a = [x,s]; A3: Terminals (DTConOSA X) = Union (coprod X) by Th3; [x,s] in coprod (s,X) by A2, MSAFREE:def_2; then [x,s] in union (rng (coprod X)) by A1, TARSKI:def_4; then A4: [x,s] in Terminals (DTConOSA X) by A3, CARD_3:def_4; then reconsider a = [x,s] as Symbol of (DTConOSA X) ; reconsider b = root-tree a as Element of TS (DTConOSA X) by A4, DTCONSTR:def_1; b in { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } by A2; hence not ParsedTerms (X,s) is empty ; ::_thesis: verum end; end; definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; func ParsedTerms X -> OrderSortedSet of S means :Def8: :: OSAFREE:def 8 for s being Element of S holds it . s = ParsedTerms (X,s); existence ex b1 being OrderSortedSet of S st for s being Element of S holds b1 . s = ParsedTerms (X,s) proof deffunc H1( Element of S) -> Subset of (TS (DTConOSA X)) = ParsedTerms (X,$1); consider f being Function such that A1: ( dom f = the carrier of S & ( for d being Element of S holds f . d = H1(d) ) ) from FUNCT_1:sch_4(); reconsider f = f as ManySortedSet of S by A1, PARTFUN1:def_2, RELAT_1:def_18; f is order-sorted proof let s1, s2 be Element of S; :: according to OSALG_1:def_16 ::_thesis: ( not s1 <= s2 or f . s1 c= f . s2 ) assume A2: s1 <= s2 ; ::_thesis: f . s1 c= f . s2 thus f . s1 c= f . s2 ::_thesis: verum proof let x1 be set ; :: according to TARSKI:def_3 ::_thesis: ( not x1 in f . s1 or x1 in f . s2 ) assume x1 in f . s1 ; ::_thesis: x1 in f . s2 then x1 in ParsedTerms (X,s1) by A1; then consider a being Element of TS (DTConOSA X) such that A3: x1 = a and A4: ( ex s3 being Element of S ex x being set st ( s3 <= s1 & x in X . s3 & a = root-tree [x,s3] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s1 ) ) ; ( ex s3 being Element of S ex x being set st ( s3 <= s2 & x in X . s3 & a = root-tree [x,s3] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s2 ) ) proof percases ( ex s3 being Element of S ex x being set st ( s3 <= s1 & x in X . s3 & a = root-tree [x,s3] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s1 ) ) by A4; suppose ex s3 being Element of S ex x being set st ( s3 <= s1 & x in X . s3 & a = root-tree [x,s3] ) ; ::_thesis: ( ex s3 being Element of S ex x being set st ( s3 <= s2 & x in X . s3 & a = root-tree [x,s3] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s2 ) ) then consider s3 being Element of S, x being set such that A5: s3 <= s1 and A6: x in X . s3 and A7: a = root-tree [x,s3] ; thus ( ex s3 being Element of S ex x being set st ( s3 <= s2 & x in X . s3 & a = root-tree [x,s3] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s2 ) ) by A2, A5, A6, A7, ORDERS_2:3; ::_thesis: verum end; supposeA8: ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s1 ) ; ::_thesis: ( ex s3 being Element of S ex x being set st ( s3 <= s2 & x in X . s3 & a = root-tree [x,s3] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s2 ) ) reconsider s21 = s2 as Element of S ; consider o being OperSymbol of S such that A9: [o, the carrier of S] = a . {} and A10: the_result_sort_of o <= s1 by A8; the_result_sort_of o <= s21 by A2, A10, ORDERS_2:3; hence ( ex s3 being Element of S ex x being set st ( s3 <= s2 & x in X . s3 & a = root-tree [x,s3] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s2 ) ) by A9; ::_thesis: verum end; end; end; then x1 in ParsedTerms (X,s2) by A3; hence x1 in f . s2 by A1; ::_thesis: verum end; end; then reconsider f = f as OrderSortedSet of S ; take f ; ::_thesis: for s being Element of S holds f . s = ParsedTerms (X,s) thus for s being Element of S holds f . s = ParsedTerms (X,s) by A1; ::_thesis: verum end; uniqueness for b1, b2 being OrderSortedSet of S st ( for s being Element of S holds b1 . s = ParsedTerms (X,s) ) & ( for s being Element of S holds b2 . s = ParsedTerms (X,s) ) holds b1 = b2 proof let A, B be OrderSortedSet of S; ::_thesis: ( ( for s being Element of S holds A . s = ParsedTerms (X,s) ) & ( for s being Element of S holds B . s = ParsedTerms (X,s) ) implies A = B ) assume that A11: for s being Element of S holds A . s = ParsedTerms (X,s) and A12: for s being Element of S holds B . s = ParsedTerms (X,s) ; ::_thesis: A = B for i being set st i in the carrier of S holds A . i = B . i proof let i be set ; ::_thesis: ( i in the carrier of S implies A . i = B . i ) assume i in the carrier of S ; ::_thesis: A . i = B . i then reconsider s = i as Element of S ; A . s = ParsedTerms (X,s) by A11; hence A . i = B . i by A12; ::_thesis: verum end; hence A = B by PBOOLE:3; ::_thesis: verum end; end; :: deftheorem Def8 defines ParsedTerms OSAFREE:def_8_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for b3 being OrderSortedSet of S holds ( b3 = ParsedTerms X iff for s being Element of S holds b3 . s = ParsedTerms (X,s) ); registration let S be OrderSortedSign; let X be V16() ManySortedSet of S; cluster ParsedTerms X -> V16() ; coherence ParsedTerms X is non-empty proof let i be set ; :: according to PBOOLE:def_13 ::_thesis: ( not i in the carrier of S or not (ParsedTerms X) . i is empty ) assume i in the carrier of S ; ::_thesis: not (ParsedTerms X) . i is empty then reconsider s = i as Element of S ; (ParsedTerms X) . s = ParsedTerms (X,s) by Def8; hence not (ParsedTerms X) . i is empty ; ::_thesis: verum end; end; theorem Th5: :: OSAFREE:5 for S being OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S for x being set st x in (((ParsedTerms X) #) * the Arity of S) . o holds x is FinSequence of TS (DTConOSA X) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for o being OperSymbol of S for x being set st x in (((ParsedTerms X) #) * the Arity of S) . o holds x is FinSequence of TS (DTConOSA X) let X be V16() ManySortedSet of S; ::_thesis: for o being OperSymbol of S for x being set st x in (((ParsedTerms X) #) * the Arity of S) . o holds x is FinSequence of TS (DTConOSA X) let o be OperSymbol of S; ::_thesis: for x being set st x in (((ParsedTerms X) #) * the Arity of S) . o holds x is FinSequence of TS (DTConOSA X) let x be set ; ::_thesis: ( x in (((ParsedTerms X) #) * the Arity of S) . o implies x is FinSequence of TS (DTConOSA X) ) set D = DTConOSA X; set ar = the_arity_of o; A1: the Arity of S . o = the_arity_of o by MSUALG_1:def_1; assume x in (((ParsedTerms X) #) * the Arity of S) . o ; ::_thesis: x is FinSequence of TS (DTConOSA X) then x in product ((ParsedTerms X) * (the_arity_of o)) by A1, MSAFREE:1; then consider f being Function such that A2: x = f and A3: dom f = dom ((ParsedTerms X) * (the_arity_of o)) and A4: for y being set st y in dom ((ParsedTerms X) * (the_arity_of o)) holds f . y in ((ParsedTerms X) * (the_arity_of o)) . y by CARD_3:def_5; A5: dom ((ParsedTerms X) * (the_arity_of o)) = dom (the_arity_of o) by PARTFUN1:def_2; dom (the_arity_of o) = Seg (len (the_arity_of o)) by FINSEQ_1:def_3; then reconsider f = f as FinSequence by A3, A5, FINSEQ_1:def_2; rng f c= TS (DTConOSA X) proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in rng f or a in TS (DTConOSA X) ) assume a in rng f ; ::_thesis: a in TS (DTConOSA X) then consider b being set such that A6: b in dom f and A7: f . b = a by FUNCT_1:def_3; A8: a in ((ParsedTerms X) * (the_arity_of o)) . b by A3, A4, A6, A7; reconsider b = b as Nat by A6; ((ParsedTerms X) * (the_arity_of o)) . b = (ParsedTerms X) . ((the_arity_of o) . b) by A3, A6, FUNCT_1:12 .= (ParsedTerms X) . ((the_arity_of o) /. b) by A3, A5, A6, PARTFUN1:def_6 .= ParsedTerms (X,((the_arity_of o) /. b)) by Def8 .= { s where s is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= (the_arity_of o) /. b & x in X . s1 & s = root-tree [x,s1] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = s . {} & the_result_sort_of o1 <= (the_arity_of o) /. b ) ) } ; then ex e being Element of TS (DTConOSA X) st ( a = e & ( ex s1 being Element of S ex x being set st ( s1 <= (the_arity_of o) /. b & x in X . s1 & e = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = e . {} & the_result_sort_of o <= (the_arity_of o) /. b ) ) ) by A8; hence a in TS (DTConOSA X) ; ::_thesis: verum end; then reconsider f = f as FinSequence of TS (DTConOSA X) by FINSEQ_1:def_4; f = x by A2; hence x is FinSequence of TS (DTConOSA X) ; ::_thesis: verum end; theorem Th6: :: OSAFREE:6 for S being OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S for p being FinSequence of TS (DTConOSA X) holds ( p in (((ParsedTerms X) #) * the Arity of S) . o iff ( dom p = dom (the_arity_of o) & ( for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) ) ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for o being OperSymbol of S for p being FinSequence of TS (DTConOSA X) holds ( p in (((ParsedTerms X) #) * the Arity of S) . o iff ( dom p = dom (the_arity_of o) & ( for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) ) ) let X be V16() ManySortedSet of S; ::_thesis: for o being OperSymbol of S for p being FinSequence of TS (DTConOSA X) holds ( p in (((ParsedTerms X) #) * the Arity of S) . o iff ( dom p = dom (the_arity_of o) & ( for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) ) ) let o be OperSymbol of S; ::_thesis: for p being FinSequence of TS (DTConOSA X) holds ( p in (((ParsedTerms X) #) * the Arity of S) . o iff ( dom p = dom (the_arity_of o) & ( for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) ) ) let p be FinSequence of TS (DTConOSA X); ::_thesis: ( p in (((ParsedTerms X) #) * the Arity of S) . o iff ( dom p = dom (the_arity_of o) & ( for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) ) ) set AR = the Arity of S; set ar = the_arity_of o; thus ( p in (((ParsedTerms X) #) * the Arity of S) . o implies ( dom p = dom (the_arity_of o) & ( for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) ) ) ::_thesis: ( dom p = dom (the_arity_of o) & ( for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) implies p in (((ParsedTerms X) #) * the Arity of S) . o ) proof A1: the Arity of S . o = the_arity_of o by MSUALG_1:def_1; assume p in (((ParsedTerms X) #) * the Arity of S) . o ; ::_thesis: ( dom p = dom (the_arity_of o) & ( for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) ) then A2: p in product ((ParsedTerms X) * (the_arity_of o)) by A1, MSAFREE:1; then A3: dom p = dom ((ParsedTerms X) * (the_arity_of o)) by CARD_3:9; hence dom p = dom (the_arity_of o) by PARTFUN1:def_2; ::_thesis: for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) A4: dom ((ParsedTerms X) * (the_arity_of o)) = dom (the_arity_of o) by PARTFUN1:def_2; let n be Nat; ::_thesis: ( n in dom p implies p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) assume A5: n in dom p ; ::_thesis: p . n in ParsedTerms (X,((the_arity_of o) /. n)) then ((ParsedTerms X) * (the_arity_of o)) . n = (ParsedTerms X) . ((the_arity_of o) . n) by A3, FUNCT_1:12 .= (ParsedTerms X) . ((the_arity_of o) /. n) by A3, A4, A5, PARTFUN1:def_6 .= ParsedTerms (X,((the_arity_of o) /. n)) by Def8 ; hence p . n in ParsedTerms (X,((the_arity_of o) /. n)) by A2, A3, A5, CARD_3:9; ::_thesis: verum end; assume that A6: dom p = dom (the_arity_of o) and A7: for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) ; ::_thesis: p in (((ParsedTerms X) #) * the Arity of S) . o A8: dom p = dom ((ParsedTerms X) * (the_arity_of o)) by A6, PARTFUN1:def_2; A9: for x being set st x in dom ((ParsedTerms X) * (the_arity_of o)) holds p . x in ((ParsedTerms X) * (the_arity_of o)) . x proof let x be set ; ::_thesis: ( x in dom ((ParsedTerms X) * (the_arity_of o)) implies p . x in ((ParsedTerms X) * (the_arity_of o)) . x ) assume A10: x in dom ((ParsedTerms X) * (the_arity_of o)) ; ::_thesis: p . x in ((ParsedTerms X) * (the_arity_of o)) . x then reconsider n = x as Nat ; ParsedTerms (X,((the_arity_of o) /. n)) = (ParsedTerms X) . ((the_arity_of o) /. n) by Def8 .= (ParsedTerms X) . ((the_arity_of o) . n) by A6, A8, A10, PARTFUN1:def_6 .= ((ParsedTerms X) * (the_arity_of o)) . x by A10, FUNCT_1:12 ; hence p . x in ((ParsedTerms X) * (the_arity_of o)) . x by A7, A8, A10; ::_thesis: verum end; the Arity of S . o = the_arity_of o by MSUALG_1:def_1; then (((ParsedTerms X) #) * the Arity of S) . o = product ((ParsedTerms X) * (the_arity_of o)) by MSAFREE:1; hence p in (((ParsedTerms X) #) * the Arity of S) . o by A8, A9, CARD_3:9; ::_thesis: verum end; theorem Th7: :: OSAFREE:7 for S being OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S for p being FinSequence of TS (DTConOSA X) holds ( OSSym (o,X) ==> roots p iff p in (((ParsedTerms X) #) * the Arity of S) . o ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for o being OperSymbol of S for p being FinSequence of TS (DTConOSA X) holds ( OSSym (o,X) ==> roots p iff p in (((ParsedTerms X) #) * the Arity of S) . o ) let X be V16() ManySortedSet of S; ::_thesis: for o being OperSymbol of S for p being FinSequence of TS (DTConOSA X) holds ( OSSym (o,X) ==> roots p iff p in (((ParsedTerms X) #) * the Arity of S) . o ) let o be OperSymbol of S; ::_thesis: for p being FinSequence of TS (DTConOSA X) holds ( OSSym (o,X) ==> roots p iff p in (((ParsedTerms X) #) * the Arity of S) . o ) let p be FinSequence of TS (DTConOSA X); ::_thesis: ( OSSym (o,X) ==> roots p iff p in (((ParsedTerms X) #) * the Arity of S) . o ) set D = DTConOSA X; set ar = the_arity_of o; set r = roots p; set OU = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); A1: dom p = dom (roots p) by TREES_3:def_18; thus ( OSSym (o,X) ==> roots p implies p in (((ParsedTerms X) #) * the Arity of S) . o ) ::_thesis: ( p in (((ParsedTerms X) #) * the Arity of S) . o implies OSSym (o,X) ==> roots p ) proof assume OSSym (o,X) ==> roots p ; ::_thesis: p in (((ParsedTerms X) #) * the Arity of S) . o then A2: [[o, the carrier of S],(roots p)] in OSREL X by LANG1:def_1; then reconsider r = roots p as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by ZFMISC_1:87; A3: dom p = dom r by TREES_3:def_18; A4: for n being Nat st n in dom p holds p . n in ParsedTerms (X,((the_arity_of o) /. n)) proof let n be Nat; ::_thesis: ( n in dom p implies p . n in ParsedTerms (X,((the_arity_of o) /. n)) ) set s = (the_arity_of o) /. n; A5: rng r c= [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) by FINSEQ_1:def_4; A6: rng p c= TS (DTConOSA X) by FINSEQ_1:def_4; assume A7: n in dom p ; ::_thesis: p . n in ParsedTerms (X,((the_arity_of o) /. n)) then consider T being DecoratedTree such that A8: T = p . n and A9: r . n = T . {} by TREES_3:def_18; p . n in rng p by A7, FUNCT_1:def_3; then reconsider T = T as Element of TS (DTConOSA X) by A8, A6; A10: r . n in rng r by A3, A7, FUNCT_1:def_3; percases ( r . n in [: the carrier' of S,{ the carrier of S}:] or r . n in Union (coprod X) ) by A5, A10, XBOOLE_0:def_3; supposeA11: r . n in [: the carrier' of S,{ the carrier of S}:] ; ::_thesis: p . n in ParsedTerms (X,((the_arity_of o) /. n)) then consider o1 being Element of the carrier' of S, x2 being Element of { the carrier of S} such that A12: r . n = [o1,x2] by DOMAIN_1:1; A13: x2 = the carrier of S by TARSKI:def_1; then the_result_sort_of o1 <= (the_arity_of o) /. n by A2, A3, A7, A11, A12, Th2; then ex o being OperSymbol of S st ( [o, the carrier of S] = T . {} & the_result_sort_of o <= (the_arity_of o) /. n ) by A9, A12, A13; hence p . n in ParsedTerms (X,((the_arity_of o) /. n)) by A8; ::_thesis: verum end; supposeA14: r . n in Union (coprod X) ; ::_thesis: p . n in ParsedTerms (X,((the_arity_of o) /. n)) then reconsider t = r . n as Terminal of (DTConOSA X) by Th3; A15: T = root-tree t by A9, DTCONSTR:9; consider i being Element of S such that A16: i <= (the_arity_of o) /. n and A17: r . n in coprod (i,X) by A2, A3, A7, A14, Th2; ex a being set st ( a in X . i & r . n = [a,i] ) by A17, MSAFREE:def_2; hence p . n in ParsedTerms (X,((the_arity_of o) /. n)) by A8, A16, A15; ::_thesis: verum end; end; end; A18: Seg (len (the_arity_of o)) = dom (the_arity_of o) by FINSEQ_1:def_3; A19: dom r = Seg (len r) by FINSEQ_1:def_3; len r = len (the_arity_of o) by A2, Th2; hence p in (((ParsedTerms X) #) * the Arity of S) . o by A3, A19, A18, A4, Th6; ::_thesis: verum end; assume A20: p in (((ParsedTerms X) #) * the Arity of S) . o ; ::_thesis: OSSym (o,X) ==> roots p A21: dom (roots p) = Seg (len (roots p)) by FINSEQ_1:def_3; reconsider r = roots p as FinSequence of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) ; reconsider r = r as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by FINSEQ_1:def_11; A22: Union (coprod X) misses [: the carrier' of S,{ the carrier of S}:] by MSAFREE:4; A23: for x being set st x in dom r holds ( ( r . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = r . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( r . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & r . x in coprod (i,X) ) ) ) proof let x be set ; ::_thesis: ( x in dom r implies ( ( r . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = r . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( r . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & r . x in coprod (i,X) ) ) ) ) assume A24: x in dom r ; ::_thesis: ( ( r . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = r . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) & ( r . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & r . x in coprod (i,X) ) ) ) then reconsider n = x as Nat ; set s = (the_arity_of o) /. n; p . n in ParsedTerms (X,((the_arity_of o) /. n)) by A20, A1, A24, Th6; then consider a being Element of TS (DTConOSA X) such that A25: a = p . n and A26: ( ex s1 being Element of S ex x being set st ( s1 <= (the_arity_of o) /. n & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= (the_arity_of o) /. n ) ) ; A27: ex T being DecoratedTree st ( T = p . n & r . n = T . {} ) by A1, A24, TREES_3:def_18; thus ( r . x in [: the carrier' of S,{ the carrier of S}:] implies for o1 being OperSymbol of S st [o1, the carrier of S] = r . x holds the_result_sort_of o1 <= (the_arity_of o) /. x ) ::_thesis: ( r . x in Union (coprod X) implies ex i being Element of S st ( i <= (the_arity_of o) /. x & r . x in coprod (i,X) ) ) proof assume A28: r . x in [: the carrier' of S,{ the carrier of S}:] ; ::_thesis: for o1 being OperSymbol of S st [o1, the carrier of S] = r . x holds the_result_sort_of o1 <= (the_arity_of o) /. x A29: now__::_thesis:_for_s1_being_Element_of_S for_y_being_set_holds_ (_not_s1_<=_(the_arity_of_o)_/._n_or_not_y_in_X_._s1_or_not_a_=_root-tree_[y,s1]_) given s1 being Element of S, y being set such that s1 <= (the_arity_of o) /. n and A30: y in X . s1 and A31: a = root-tree [y,s1] ; ::_thesis: contradiction A32: [y,s1] in coprod (s1,X) by A30, MSAFREE:def_2; dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . s1 in rng (coprod X) by FUNCT_1:def_3; then A33: coprod (s1,X) in rng (coprod X) by MSAFREE:def_3; r . x = [y,s1] by A25, A27, A31, TREES_4:3; then r . x in union (rng (coprod X)) by A32, A33, TARSKI:def_4; then r . x in Union (coprod X) by CARD_3:def_4; hence contradiction by A22, A28, XBOOLE_0:3; ::_thesis: verum end; let o1 be OperSymbol of S; ::_thesis: ( [o1, the carrier of S] = r . x implies the_result_sort_of o1 <= (the_arity_of o) /. x ) assume [o1, the carrier of S] = r . x ; ::_thesis: the_result_sort_of o1 <= (the_arity_of o) /. x hence the_result_sort_of o1 <= (the_arity_of o) /. x by A25, A26, A27, A29, XTUPLE_0:1; ::_thesis: verum end; assume A34: r . x in Union (coprod X) ; ::_thesis: ex i being Element of S st ( i <= (the_arity_of o) /. x & r . x in coprod (i,X) ) now__::_thesis:_for_o1_being_OperSymbol_of_S_holds_ (_not_[o1,_the_carrier_of_S]_=_a_._{}_or_not_the_result_sort_of_o1_<=_(the_arity_of_o)_/._n_) given o1 being OperSymbol of S such that A35: [o1, the carrier of S] = a . {} and the_result_sort_of o1 <= (the_arity_of o) /. n ; ::_thesis: contradiction the carrier of S in { the carrier of S} by TARSKI:def_1; then [o1, the carrier of S] in [: the carrier' of S,{ the carrier of S}:] by ZFMISC_1:87; hence contradiction by A22, A25, A27, A34, A35, XBOOLE_0:3; ::_thesis: verum end; then consider s1 being Element of S, y being set such that A36: s1 <= (the_arity_of o) /. n and A37: y in X . s1 and A38: a = root-tree [y,s1] by A26; take s1 ; ::_thesis: ( s1 <= (the_arity_of o) /. x & r . x in coprod (s1,X) ) r . x = [y,s1] by A25, A27, A38, TREES_4:3; hence ( s1 <= (the_arity_of o) /. x & r . x in coprod (s1,X) ) by A36, A37, MSAFREE:def_2; ::_thesis: verum end; dom p = dom (the_arity_of o) by A20, Th6; then len r = len (the_arity_of o) by A1, A21, FINSEQ_1:def_3; then [[o, the carrier of S],r] in OSREL X by A23, Th2; hence OSSym (o,X) ==> roots p by LANG1:def_1; ::_thesis: verum end; theorem Th8: :: OSAFREE:8 for S being OrderSortedSign for X being V16() ManySortedSet of S holds union (rng (ParsedTerms X)) = TS (DTConOSA X) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S holds union (rng (ParsedTerms X)) = TS (DTConOSA X) let X be V16() ManySortedSet of S; ::_thesis: union (rng (ParsedTerms X)) = TS (DTConOSA X) set D = DTConOSA X; A1: dom (ParsedTerms X) = the carrier of S by PARTFUN1:def_2; thus union (rng (ParsedTerms X)) c= TS (DTConOSA X) :: according to XBOOLE_0:def_10 ::_thesis: TS (DTConOSA X) c= union (rng (ParsedTerms X)) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in union (rng (ParsedTerms X)) or x in TS (DTConOSA X) ) assume x in union (rng (ParsedTerms X)) ; ::_thesis: x in TS (DTConOSA X) then consider A being set such that A2: x in A and A3: A in rng (ParsedTerms X) by TARSKI:def_4; consider s being set such that A4: s in dom (ParsedTerms X) and A5: (ParsedTerms X) . s = A by A3, FUNCT_1:def_3; reconsider s = s as Element of S by A4; A = ParsedTerms (X,s) by A5, Def8 .= { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = a . {} & the_result_sort_of o1 <= s ) ) } ; then ex a being Element of TS (DTConOSA X) st ( a = x & ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = a . {} & the_result_sort_of o1 <= s ) ) ) by A2; hence x in TS (DTConOSA X) ; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in TS (DTConOSA X) or x in union (rng (ParsedTerms X)) ) A6: the carrier of (DTConOSA X) = (Terminals (DTConOSA X)) \/ (NonTerminals (DTConOSA X)) by LANG1:1; assume x in TS (DTConOSA X) ; ::_thesis: x in union (rng (ParsedTerms X)) then reconsider t = x as Element of TS (DTConOSA X) ; A7: rng t c= the carrier of (DTConOSA X) by RELAT_1:def_19; A8: NonTerminals (DTConOSA X) = [: the carrier' of S,{ the carrier of S}:] by Th3; A9: Terminals (DTConOSA X) = Union (coprod X) by Th3; {} in dom t by TREES_1:22; then A10: t . {} in rng t by FUNCT_1:def_3; percases ( t . {} in Terminals (DTConOSA X) or t . {} in NonTerminals (DTConOSA X) ) by A7, A10, A6, XBOOLE_0:def_3; supposeA11: t . {} in Terminals (DTConOSA X) ; ::_thesis: x in union (rng (ParsedTerms X)) then reconsider a = t . {} as Terminal of (DTConOSA X) ; a in union (rng (coprod X)) by A9, A11, CARD_3:def_4; then consider A being set such that A12: a in A and A13: A in rng (coprod X) by TARSKI:def_4; consider s being set such that A14: s in dom (coprod X) and A15: (coprod X) . s = A by A13, FUNCT_1:def_3; reconsider s = s as Element of S by A14; A = coprod (s,X) by A15, MSAFREE:def_3; then A16: ex b being set st ( b in X . s & a = [b,s] ) by A12, MSAFREE:def_2; t = root-tree a by DTCONSTR:9; then t in ParsedTerms (X,s) by A16; then A17: t in (ParsedTerms X) . s by Def8; (ParsedTerms X) . s in rng (ParsedTerms X) by A1, FUNCT_1:def_3; hence x in union (rng (ParsedTerms X)) by A17, TARSKI:def_4; ::_thesis: verum end; suppose t . {} in NonTerminals (DTConOSA X) ; ::_thesis: x in union (rng (ParsedTerms X)) then reconsider a = t . {} as NonTerminal of (DTConOSA X) ; consider o being Element of the carrier' of S, x2 being Element of { the carrier of S} such that A18: a = [o,x2] by A8, DOMAIN_1:1; set rs = the_result_sort_of o; x2 = the carrier of S by TARSKI:def_1; then t in ParsedTerms (X,(the_result_sort_of o)) by A18; then A19: t in (ParsedTerms X) . (the_result_sort_of o) by Def8; (ParsedTerms X) . (the_result_sort_of o) in rng (ParsedTerms X) by A1, FUNCT_1:def_3; hence x in union (rng (ParsedTerms X)) by A19, TARSKI:def_4; ::_thesis: verum end; end; end; definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; let o be OperSymbol of S; func PTDenOp (o,X) -> Function of ((((ParsedTerms X) #) * the Arity of S) . o),(((ParsedTerms X) * the ResultSort of S) . o) means :Def9: :: OSAFREE:def 9 for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds it . p = (OSSym (o,X)) -tree p; existence ex b1 being Function of ((((ParsedTerms X) #) * the Arity of S) . o),(((ParsedTerms X) * the ResultSort of S) . o) st for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds b1 . p = (OSSym (o,X)) -tree p proof set AL = (((ParsedTerms X) #) * the Arity of S) . o; set AX = ((ParsedTerms X) * the ResultSort of S) . o; set D = DTConOSA X; set O = the carrier' of S; set rs = the_result_sort_of o; set RS = the ResultSort of S; defpred S1[ set , set ] means for p being FinSequence of TS (DTConOSA X) st p = $1 holds $2 = (OSSym (o,X)) -tree p; A1: for x being set st x in (((ParsedTerms X) #) * the Arity of S) . o holds ex y being set st ( y in ((ParsedTerms X) * the ResultSort of S) . o & S1[x,y] ) proof let x be set ; ::_thesis: ( x in (((ParsedTerms X) #) * the Arity of S) . o implies ex y being set st ( y in ((ParsedTerms X) * the ResultSort of S) . o & S1[x,y] ) ) assume A2: x in (((ParsedTerms X) #) * the Arity of S) . o ; ::_thesis: ex y being set st ( y in ((ParsedTerms X) * the ResultSort of S) . o & S1[x,y] ) then reconsider p = x as FinSequence of TS (DTConOSA X) by Th5; OSSym (o,X) ==> roots p by A2, Th7; then reconsider a = (OSSym (o,X)) -tree p as Element of TS (DTConOSA X) by DTCONSTR:def_1; take y = (OSSym (o,X)) -tree p; ::_thesis: ( y in ((ParsedTerms X) * the ResultSort of S) . o & S1[x,y] ) o in the carrier' of S ; then o in dom ((ParsedTerms X) * the ResultSort of S) by PARTFUN1:def_2; then A3: ((ParsedTerms X) * the ResultSort of S) . o = (ParsedTerms X) . ( the ResultSort of S . o) by FUNCT_1:12 .= (ParsedTerms X) . (the_result_sort_of o) by MSUALG_1:def_2 .= ParsedTerms (X,(the_result_sort_of o)) by Def8 ; a . {} = OSSym (o,X) by TREES_4:def_4; hence y in ((ParsedTerms X) * the ResultSort of S) . o by A3; ::_thesis: S1[x,y] thus S1[x,y] ; ::_thesis: verum end; consider f being Function such that A4: ( dom f = (((ParsedTerms X) #) * the Arity of S) . o & rng f c= ((ParsedTerms X) * the ResultSort of S) . o & ( for x being set st x in (((ParsedTerms X) #) * the Arity of S) . o holds S1[x,f . x] ) ) from FUNCT_1:sch_5(A1); reconsider g = f as Function of ((((ParsedTerms X) #) * the Arity of S) . o),(rng f) by A4, FUNCT_2:1; reconsider g = g as Function of ((((ParsedTerms X) #) * the Arity of S) . o),(((ParsedTerms X) * the ResultSort of S) . o) by A4, FUNCT_2:2; take g ; ::_thesis: for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds g . p = (OSSym (o,X)) -tree p let p be FinSequence of TS (DTConOSA X); ::_thesis: ( OSSym (o,X) ==> roots p implies g . p = (OSSym (o,X)) -tree p ) assume OSSym (o,X) ==> roots p ; ::_thesis: g . p = (OSSym (o,X)) -tree p then p in (((ParsedTerms X) #) * the Arity of S) . o by Th7; hence g . p = (OSSym (o,X)) -tree p by A4; ::_thesis: verum end; uniqueness for b1, b2 being Function of ((((ParsedTerms X) #) * the Arity of S) . o),(((ParsedTerms X) * the ResultSort of S) . o) st ( for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds b1 . p = (OSSym (o,X)) -tree p ) & ( for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds b2 . p = (OSSym (o,X)) -tree p ) holds b1 = b2 proof set AL = (((ParsedTerms X) #) * the Arity of S) . o; set AX = ((ParsedTerms X) * the ResultSort of S) . o; set D = DTConOSA X; let f, g be Function of ((((ParsedTerms X) #) * the Arity of S) . o),(((ParsedTerms X) * the ResultSort of S) . o); ::_thesis: ( ( for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds f . p = (OSSym (o,X)) -tree p ) & ( for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds g . p = (OSSym (o,X)) -tree p ) implies f = g ) assume that A5: for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds f . p = (OSSym (o,X)) -tree p and A6: for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds g . p = (OSSym (o,X)) -tree p ; ::_thesis: f = g A7: for x being set st x in (((ParsedTerms X) #) * the Arity of S) . o holds f . x = g . x proof let x be set ; ::_thesis: ( x in (((ParsedTerms X) #) * the Arity of S) . o implies f . x = g . x ) assume A8: x in (((ParsedTerms X) #) * the Arity of S) . o ; ::_thesis: f . x = g . x then reconsider p = x as FinSequence of TS (DTConOSA X) by Th5; A9: OSSym (o,X) ==> roots p by A8, Th7; then f . p = (OSSym (o,X)) -tree p by A5; hence f . x = g . x by A6, A9; ::_thesis: verum end; A10: dom g = (((ParsedTerms X) #) * the Arity of S) . o by FUNCT_2:def_1; dom f = (((ParsedTerms X) #) * the Arity of S) . o by FUNCT_2:def_1; hence f = g by A10, A7, FUNCT_1:2; ::_thesis: verum end; end; :: deftheorem Def9 defines PTDenOp OSAFREE:def_9_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S for b4 being Function of ((((ParsedTerms X) #) * the Arity of S) . o),(((ParsedTerms X) * the ResultSort of S) . o) holds ( b4 = PTDenOp (o,X) iff for p being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots p holds b4 . p = (OSSym (o,X)) -tree p ); definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; func PTOper X -> ManySortedFunction of ((ParsedTerms X) #) * the Arity of S,(ParsedTerms X) * the ResultSort of S means :Def10: :: OSAFREE:def 10 for o being OperSymbol of S holds it . o = PTDenOp (o,X); existence ex b1 being ManySortedFunction of ((ParsedTerms X) #) * the Arity of S,(ParsedTerms X) * the ResultSort of S st for o being OperSymbol of S holds b1 . o = PTDenOp (o,X) proof defpred S1[ set , set ] means for o being OperSymbol of S st $1 = o holds $2 = PTDenOp (o,X); set Y = the carrier' of S; A1: for x being set st x in the carrier' of S holds ex y being set st S1[x,y] proof let x be set ; ::_thesis: ( x in the carrier' of S implies ex y being set st S1[x,y] ) assume x in the carrier' of S ; ::_thesis: ex y being set st S1[x,y] then reconsider o = x as OperSymbol of S ; take PTDenOp (o,X) ; ::_thesis: S1[x, PTDenOp (o,X)] thus S1[x, PTDenOp (o,X)] ; ::_thesis: verum end; consider f being Function such that A2: ( dom f = the carrier' of S & ( for x being set st x in the carrier' of S holds S1[x,f . x] ) ) from CLASSES1:sch_1(A1); reconsider f = f as ManySortedSet of the carrier' of S by A2, PARTFUN1:def_2, RELAT_1:def_18; for x being set st x in dom f holds f . x is Function proof let x be set ; ::_thesis: ( x in dom f implies f . x is Function ) assume x in dom f ; ::_thesis: f . x is Function then reconsider o = x as OperSymbol of S ; f . o = PTDenOp (o,X) by A2; hence f . x is Function ; ::_thesis: verum end; then reconsider f = f as ManySortedFunction of the carrier' of S by FUNCOP_1:def_6; for x being set st x in the carrier' of S holds f . x is Function of ((((ParsedTerms X) #) * the Arity of S) . x),(((ParsedTerms X) * the ResultSort of S) . x) proof let x be set ; ::_thesis: ( x in the carrier' of S implies f . x is Function of ((((ParsedTerms X) #) * the Arity of S) . x),(((ParsedTerms X) * the ResultSort of S) . x) ) assume x in the carrier' of S ; ::_thesis: f . x is Function of ((((ParsedTerms X) #) * the Arity of S) . x),(((ParsedTerms X) * the ResultSort of S) . x) then reconsider o = x as OperSymbol of S ; f . o = PTDenOp (o,X) by A2; hence f . x is Function of ((((ParsedTerms X) #) * the Arity of S) . x),(((ParsedTerms X) * the ResultSort of S) . x) ; ::_thesis: verum end; then reconsider f = f as ManySortedFunction of ((ParsedTerms X) #) * the Arity of S,(ParsedTerms X) * the ResultSort of S by PBOOLE:def_15; take f ; ::_thesis: for o being OperSymbol of S holds f . o = PTDenOp (o,X) let o be OperSymbol of S; ::_thesis: f . o = PTDenOp (o,X) thus f . o = PTDenOp (o,X) by A2; ::_thesis: verum end; uniqueness for b1, b2 being ManySortedFunction of ((ParsedTerms X) #) * the Arity of S,(ParsedTerms X) * the ResultSort of S st ( for o being OperSymbol of S holds b1 . o = PTDenOp (o,X) ) & ( for o being OperSymbol of S holds b2 . o = PTDenOp (o,X) ) holds b1 = b2 proof let A, B be ManySortedFunction of ((ParsedTerms X) #) * the Arity of S,(ParsedTerms X) * the ResultSort of S; ::_thesis: ( ( for o being OperSymbol of S holds A . o = PTDenOp (o,X) ) & ( for o being OperSymbol of S holds B . o = PTDenOp (o,X) ) implies A = B ) assume that A3: for o being OperSymbol of S holds A . o = PTDenOp (o,X) and A4: for o being OperSymbol of S holds B . o = PTDenOp (o,X) ; ::_thesis: A = B for i being set st i in the carrier' of S holds A . i = B . i proof let i be set ; ::_thesis: ( i in the carrier' of S implies A . i = B . i ) assume i in the carrier' of S ; ::_thesis: A . i = B . i then reconsider s = i as OperSymbol of S ; A . s = PTDenOp (s,X) by A3; hence A . i = B . i by A4; ::_thesis: verum end; hence A = B by PBOOLE:3; ::_thesis: verum end; end; :: deftheorem Def10 defines PTOper OSAFREE:def_10_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for b3 being ManySortedFunction of ((ParsedTerms X) #) * the Arity of S,(ParsedTerms X) * the ResultSort of S holds ( b3 = PTOper X iff for o being OperSymbol of S holds b3 . o = PTDenOp (o,X) ); definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; func ParsedTermsOSA X -> OSAlgebra of S equals :: OSAFREE:def 11 MSAlgebra(# (ParsedTerms X),(PTOper X) #); coherence MSAlgebra(# (ParsedTerms X),(PTOper X) #) is OSAlgebra of S by OSALG_1:17; end; :: deftheorem defines ParsedTermsOSA OSAFREE:def_11_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S holds ParsedTermsOSA X = MSAlgebra(# (ParsedTerms X),(PTOper X) #); registration let S be OrderSortedSign; let X be V16() ManySortedSet of S; cluster ParsedTermsOSA X -> strict non-empty ; coherence ( ParsedTermsOSA X is strict & ParsedTermsOSA X is non-empty ) by MSUALG_1:def_3; end; definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; let o be OperSymbol of S; :: original: OSSym redefine func OSSym (o,X) -> NonTerminal of (DTConOSA X); coherence OSSym (o,X) is NonTerminal of (DTConOSA X) proof A1: the carrier of S in { the carrier of S} by TARSKI:def_1; NonTerminals (DTConOSA X) = [: the carrier' of S,{ the carrier of S}:] by Th3; hence OSSym (o,X) is NonTerminal of (DTConOSA X) by A1, ZFMISC_1:87; ::_thesis: verum end; end; theorem Th9: :: OSAFREE:9 for S being OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S holds the Sorts of (ParsedTermsOSA X) . s = { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s being Element of S holds the Sorts of (ParsedTermsOSA X) . s = { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } let X be V16() ManySortedSet of S; ::_thesis: for s being Element of S holds the Sorts of (ParsedTermsOSA X) . s = { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } let s be Element of S; ::_thesis: the Sorts of (ParsedTermsOSA X) . s = { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } set PTA = ParsedTermsOSA X; { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } = ParsedTerms (X,s) .= the Sorts of (ParsedTermsOSA X) . s by Def8 ; hence the Sorts of (ParsedTermsOSA X) . s = { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } ; ::_thesis: verum end; theorem Th10: :: OSAFREE:10 for S being OrderSortedSign for X being V16() ManySortedSet of S for s, s1 being Element of S for x being set st x in X . s holds ( root-tree [x,s] is Element of TS (DTConOSA X) & ( for z being set holds [z, the carrier of S] <> (root-tree [x,s]) . {} ) & ( root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 implies s <= s1 ) & ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s, s1 being Element of S for x being set st x in X . s holds ( root-tree [x,s] is Element of TS (DTConOSA X) & ( for z being set holds [z, the carrier of S] <> (root-tree [x,s]) . {} ) & ( root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 implies s <= s1 ) & ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) ) let X be V16() ManySortedSet of S; ::_thesis: for s, s1 being Element of S for x being set st x in X . s holds ( root-tree [x,s] is Element of TS (DTConOSA X) & ( for z being set holds [z, the carrier of S] <> (root-tree [x,s]) . {} ) & ( root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 implies s <= s1 ) & ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) ) let s, s1 be Element of S; ::_thesis: for x being set st x in X . s holds ( root-tree [x,s] is Element of TS (DTConOSA X) & ( for z being set holds [z, the carrier of S] <> (root-tree [x,s]) . {} ) & ( root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 implies s <= s1 ) & ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) ) let x be set ; ::_thesis: ( x in X . s implies ( root-tree [x,s] is Element of TS (DTConOSA X) & ( for z being set holds [z, the carrier of S] <> (root-tree [x,s]) . {} ) & ( root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 implies s <= s1 ) & ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) ) ) assume A1: x in X . s ; ::_thesis: ( root-tree [x,s] is Element of TS (DTConOSA X) & ( for z being set holds [z, the carrier of S] <> (root-tree [x,s]) . {} ) & ( root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 implies s <= s1 ) & ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) ) set PTA = ParsedTermsOSA X; set D = DTConOSA X; reconsider t = [x,s] as Terminal of (DTConOSA X) by A1, Th4; reconsider s0 = s, s11 = s1 as Element of S ; reconsider SPTA = the Sorts of (ParsedTermsOSA X) as OrderSortedSet of S ; root-tree t is Element of TS (DTConOSA X) ; hence root-tree [x,s] is Element of TS (DTConOSA X) ; ::_thesis: ( ( for z being set holds [z, the carrier of S] <> (root-tree [x,s]) . {} ) & ( root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 implies s <= s1 ) & ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) ) thus A2: for z being set holds [z, the carrier of S] <> (root-tree [x,s]) . {} ::_thesis: ( ( root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 implies s <= s1 ) & ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) ) proof let z be set ; ::_thesis: [z, the carrier of S] <> (root-tree [x,s]) . {} assume A3: [z, the carrier of S] = (root-tree [x,s]) . {} ; ::_thesis: contradiction (root-tree [x,s]) . {} = [x,s] by TREES_4:3; then s = the carrier of S by A3, XTUPLE_0:1; then s in s ; hence contradiction ; ::_thesis: verum end; hereby ::_thesis: ( s <= s1 implies root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ) assume root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 ; ::_thesis: s <= s1 then root-tree [x,s] in { a where a is Element of TS (DTConOSA X) : ( ex s2 being Element of S ex x being set st ( s2 <= s1 & x in X . s2 & a = root-tree [x,s2] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s1 ) ) } by Th9; then consider a being Element of TS (DTConOSA X) such that A4: a = root-tree [x,s] and A5: ( ex s2 being Element of S ex x being set st ( s2 <= s1 & x in X . s2 & a = root-tree [x,s2] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s1 ) ) ; consider s2 being Element of S, x1 being set such that A6: s2 <= s1 and x1 in X . s2 and A7: a = root-tree [x1,s2] by A2, A4, A5; [x1,s2] = [x,s] by A4, A7, TREES_4:4; hence s <= s1 by A6, XTUPLE_0:1; ::_thesis: verum end; assume s <= s1 ; ::_thesis: root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 then A8: SPTA . s0 c= SPTA . s11 by OSALG_1:def_16; root-tree t in { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } by A1; then root-tree [x,s] in SPTA . s0 by Th9; hence root-tree [x,s] in the Sorts of (ParsedTermsOSA X) . s1 by A8; ::_thesis: verum end; theorem Th11: :: OSAFREE:11 for S being OrderSortedSign for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) for o being OperSymbol of S st t . {} = [o, the carrier of S] holds ( ex p being SubtreeSeq of OSSym (o,X) st ( t = (OSSym (o,X)) -tree p & OSSym (o,X) ==> roots p & p in Args (o,(ParsedTermsOSA X)) & t = (Den (o,(ParsedTermsOSA X))) . p ) & ( for s2 being Element of S for x being set holds t <> root-tree [x,s2] ) & ( for s1 being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) ) ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) for o being OperSymbol of S st t . {} = [o, the carrier of S] holds ( ex p being SubtreeSeq of OSSym (o,X) st ( t = (OSSym (o,X)) -tree p & OSSym (o,X) ==> roots p & p in Args (o,(ParsedTermsOSA X)) & t = (Den (o,(ParsedTermsOSA X))) . p ) & ( for s2 being Element of S for x being set holds t <> root-tree [x,s2] ) & ( for s1 being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) ) ) let X be V16() ManySortedSet of S; ::_thesis: for t being Element of TS (DTConOSA X) for o being OperSymbol of S st t . {} = [o, the carrier of S] holds ( ex p being SubtreeSeq of OSSym (o,X) st ( t = (OSSym (o,X)) -tree p & OSSym (o,X) ==> roots p & p in Args (o,(ParsedTermsOSA X)) & t = (Den (o,(ParsedTermsOSA X))) . p ) & ( for s2 being Element of S for x being set holds t <> root-tree [x,s2] ) & ( for s1 being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) ) ) let t be Element of TS (DTConOSA X); ::_thesis: for o being OperSymbol of S st t . {} = [o, the carrier of S] holds ( ex p being SubtreeSeq of OSSym (o,X) st ( t = (OSSym (o,X)) -tree p & OSSym (o,X) ==> roots p & p in Args (o,(ParsedTermsOSA X)) & t = (Den (o,(ParsedTermsOSA X))) . p ) & ( for s2 being Element of S for x being set holds t <> root-tree [x,s2] ) & ( for s1 being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) ) ) let o be OperSymbol of S; ::_thesis: ( t . {} = [o, the carrier of S] implies ( ex p being SubtreeSeq of OSSym (o,X) st ( t = (OSSym (o,X)) -tree p & OSSym (o,X) ==> roots p & p in Args (o,(ParsedTermsOSA X)) & t = (Den (o,(ParsedTermsOSA X))) . p ) & ( for s2 being Element of S for x being set holds t <> root-tree [x,s2] ) & ( for s1 being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) ) ) ) assume A1: t . {} = [o, the carrier of S] ; ::_thesis: ( ex p being SubtreeSeq of OSSym (o,X) st ( t = (OSSym (o,X)) -tree p & OSSym (o,X) ==> roots p & p in Args (o,(ParsedTermsOSA X)) & t = (Den (o,(ParsedTermsOSA X))) . p ) & ( for s2 being Element of S for x being set holds t <> root-tree [x,s2] ) & ( for s1 being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) ) ) set G = DTConOSA X; set PTA = ParsedTermsOSA X; consider p being FinSequence of TS (DTConOSA X) such that A2: t = (OSSym (o,X)) -tree p and A3: OSSym (o,X) ==> roots p by A1, DTCONSTR:10; reconsider p = p as SubtreeSeq of OSSym (o,X) by A3, DTCONSTR:def_6; p in (((ParsedTerms X) #) * the Arity of S) . o by A3, Th7; then A4: p in Args (o,(ParsedTermsOSA X)) by MSUALG_1:def_4; (Den (o,(ParsedTermsOSA X))) . p = ( the Charact of (ParsedTermsOSA X) . o) . p by MSUALG_1:def_6 .= (PTDenOp (o,X)) . p by Def10 .= t by A2, A3, Def9 ; hence ex p being SubtreeSeq of OSSym (o,X) st ( t = (OSSym (o,X)) -tree p & OSSym (o,X) ==> roots p & p in Args (o,(ParsedTermsOSA X)) & t = (Den (o,(ParsedTermsOSA X))) . p ) by A2, A3, A4; ::_thesis: ( ( for s2 being Element of S for x being set holds t <> root-tree [x,s2] ) & ( for s1 being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) ) ) thus A5: for s2 being Element of S for x being set holds t <> root-tree [x,s2] ::_thesis: for s1 being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) proof let s2 be Element of S; ::_thesis: for x being set holds t <> root-tree [x,s2] let x be set ; ::_thesis: t <> root-tree [x,s2] assume t = root-tree [x,s2] ; ::_thesis: contradiction then [x,s2] = [o, the carrier of S] by A1, TREES_4:3; then s2 = the carrier of S by XTUPLE_0:1; then s2 in s2 ; hence contradiction ; ::_thesis: verum end; set s = the_result_sort_of o; let s1 be Element of S; ::_thesis: ( t in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) hereby ::_thesis: ( the_result_sort_of o <= s1 implies t in the Sorts of (ParsedTermsOSA X) . s1 ) assume t in the Sorts of (ParsedTermsOSA X) . s1 ; ::_thesis: the_result_sort_of o <= s1 then t in { a where a is Element of TS (DTConOSA X) : ( ex s2 being Element of S ex x being set st ( s2 <= s1 & x in X . s2 & a = root-tree [x,s2] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s1 ) ) } by Th9; then consider a being Element of TS (DTConOSA X) such that A6: a = t and A7: ( ex s2 being Element of S ex x being set st ( s2 <= s1 & x in X . s2 & a = root-tree [x,s2] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s1 ) ) ; thus the_result_sort_of o <= s1 by A1, A5, A6, A7, XTUPLE_0:1; ::_thesis: verum end; reconsider s0 = the_result_sort_of o, s11 = s1 as Element of S ; reconsider SPTA = the Sorts of (ParsedTermsOSA X) as OrderSortedSet of S ; assume the_result_sort_of o <= s1 ; ::_thesis: t in the Sorts of (ParsedTermsOSA X) . s1 then A8: SPTA . s0 c= SPTA . s11 by OSALG_1:def_16; t in { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= the_result_sort_of o & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= the_result_sort_of o ) ) } by A1; then t in SPTA . (the_result_sort_of o) by Th9; hence t in the Sorts of (ParsedTermsOSA X) . s1 by A8; ::_thesis: verum end; theorem Th12: :: OSAFREE:12 for S being OrderSortedSign for X being V16() ManySortedSet of S for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds ( nt in NonTerminals (DTConOSA X) & nt -tree ts in TS (DTConOSA X) & ex o being OperSymbol of S st ( 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 ) ) ) ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds ( nt in NonTerminals (DTConOSA X) & nt -tree ts in TS (DTConOSA X) & ex o being OperSymbol of S st ( 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 ) ) ) ) let X be V16() ManySortedSet of S; ::_thesis: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds ( nt in NonTerminals (DTConOSA X) & nt -tree ts in TS (DTConOSA X) & ex o being OperSymbol of S st ( 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 ) ) ) ) let nt be Symbol of (DTConOSA X); ::_thesis: for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds ( nt in NonTerminals (DTConOSA X) & nt -tree ts in TS (DTConOSA X) & ex o being OperSymbol of S st ( 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 ) ) ) ) let ts be FinSequence of TS (DTConOSA X); ::_thesis: ( nt ==> roots ts implies ( nt in NonTerminals (DTConOSA X) & nt -tree ts in TS (DTConOSA X) & ex o being OperSymbol of S st ( 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 ) ) ) ) ) assume A1: nt ==> roots ts ; ::_thesis: ( nt in NonTerminals (DTConOSA X) & nt -tree ts in TS (DTConOSA X) & ex o being OperSymbol of S st ( 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 ) ) ) ) set D = DTConOSA X; set PTA = ParsedTermsOSA X; A2: nt in { s where s is Symbol of (DTConOSA X) : ex n being FinSequence st s ==> n } by A1; then reconsider nt1 = nt as NonTerminal of (DTConOSA X) by LANG1:def_3; reconsider ts1 = ts as SubtreeSeq of nt1 by A1, DTCONSTR:def_6; thus nt in NonTerminals (DTConOSA X) by A2, LANG1:def_3; ::_thesis: ( nt -tree ts in TS (DTConOSA X) & ex o being OperSymbol of S st ( 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 ) ) ) ) then nt in [: the carrier' of S,{ the carrier of S}:] by Th3; then consider o1, b1 being set such that A3: o1 in the carrier' of S and A4: b1 in { the carrier of S} and A5: nt = [o1,b1] by ZFMISC_1:def_2; nt1 -tree ts1 in TS (DTConOSA X) ; hence nt -tree ts in TS (DTConOSA X) ; ::_thesis: ex o being OperSymbol of S st ( 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 ) ) ) reconsider o1 = o1 as OperSymbol of S by A3; take o1 ; ::_thesis: ( nt = [o1, the carrier of S] & ts in Args (o1,(ParsedTermsOSA X)) & nt -tree ts = (Den (o1,(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 o1 <= s1 ) ) ) thus nt = [o1, the carrier of S] by A4, A5, TARSKI:def_1; ::_thesis: ( ts in Args (o1,(ParsedTermsOSA X)) & nt -tree ts = (Den (o1,(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 o1 <= s1 ) ) ) b1 = the carrier of S by A4, TARSKI:def_1; then A6: (nt1 -tree ts) . {} = [o1, the carrier of S] by A5, TREES_4:def_4; then ex p being SubtreeSeq of OSSym (o1,X) st ( nt1 -tree ts1 = (OSSym (o1,X)) -tree p & OSSym (o1,X) ==> roots p & p in Args (o1,(ParsedTermsOSA X)) & nt1 -tree ts1 = (Den (o1,(ParsedTermsOSA X))) . p ) by Th11; hence ( ts in Args (o1,(ParsedTermsOSA X)) & nt -tree ts = (Den (o1,(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 o1 <= s1 ) ) ) by A6, Th11, TREES_4:15; ::_thesis: verum end; theorem Th13: :: OSAFREE:13 for S being OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S for x being FinSequence holds ( x in Args (o,(ParsedTermsOSA X)) iff ( x is FinSequence of TS (DTConOSA X) & OSSym (o,X) ==> roots x ) ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for o being OperSymbol of S for x being FinSequence holds ( x in Args (o,(ParsedTermsOSA X)) iff ( x is FinSequence of TS (DTConOSA X) & OSSym (o,X) ==> roots x ) ) let X be V16() ManySortedSet of S; ::_thesis: for o being OperSymbol of S for x being FinSequence holds ( x in Args (o,(ParsedTermsOSA X)) iff ( x is FinSequence of TS (DTConOSA X) & OSSym (o,X) ==> roots x ) ) let o be OperSymbol of S; ::_thesis: for x being FinSequence holds ( x in Args (o,(ParsedTermsOSA X)) iff ( x is FinSequence of TS (DTConOSA X) & OSSym (o,X) ==> roots x ) ) let x be FinSequence; ::_thesis: ( x in Args (o,(ParsedTermsOSA X)) iff ( x is FinSequence of TS (DTConOSA X) & OSSym (o,X) ==> roots x ) ) set PTA = ParsedTermsOSA X; hereby ::_thesis: ( x is FinSequence of TS (DTConOSA X) & OSSym (o,X) ==> roots x implies x in Args (o,(ParsedTermsOSA X)) ) assume A1: x in Args (o,(ParsedTermsOSA X)) ; ::_thesis: ( x is FinSequence of TS (DTConOSA X) & OSSym (o,X) ==> roots x ) then A2: x in (( the Sorts of (ParsedTermsOSA X) #) * the Arity of S) . o by MSUALG_1:def_4; hence x is FinSequence of TS (DTConOSA X) by Th5; ::_thesis: OSSym (o,X) ==> roots x x in (((ParsedTerms X) #) * the Arity of S) . o by A1, MSUALG_1:def_4; then reconsider x1 = x as FinSequence of TS (DTConOSA X) by Th5; OSSym (o,X) ==> roots x1 by A2, Th7; hence OSSym (o,X) ==> roots x ; ::_thesis: verum end; assume that A3: x is FinSequence of TS (DTConOSA X) and A4: OSSym (o,X) ==> roots x ; ::_thesis: x in Args (o,(ParsedTermsOSA X)) reconsider x1 = x as FinSequence of TS (DTConOSA X) by A3; x1 in (((ParsedTerms X) #) * the Arity of S) . o by A4, Th7; hence x in Args (o,(ParsedTermsOSA X)) by MSUALG_1:def_4; ::_thesis: verum end; definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; let t be Element of TS (DTConOSA X); func LeastSort t -> SortSymbol of S means :Def12: :: OSAFREE:def 12 ( t in the Sorts of (ParsedTermsOSA X) . it & ( for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds it <= s1 ) ); existence ex b1 being SortSymbol of S st ( t in the Sorts of (ParsedTermsOSA X) . b1 & ( for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds b1 <= s1 ) ) proof set D = DTConOSA X; defpred S1[ set ] means ex s being SortSymbol of S st ( $1 in the Sorts of (ParsedTermsOSA X) . s & ( for s1 being Element of S st $1 in the Sorts of (ParsedTermsOSA X) . s1 holds s <= s1 ) ); A1: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) st t in rng ts holds S1[t] ) implies S1[nt -tree ts] ) assume that A2: nt ==> roots ts and for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S1[t] ; ::_thesis: S1[nt -tree ts] consider o being OperSymbol of S such that nt = [o, the carrier of S] and ts in Args (o,(ParsedTermsOSA X)) and nt -tree ts = (Den (o,(ParsedTermsOSA X))) . ts and A3: 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 A2, Th12; reconsider s = the_result_sort_of o as SortSymbol of S ; take s ; ::_thesis: ( nt -tree ts in the Sorts of (ParsedTermsOSA X) . s & ( for s1 being Element of S st nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 holds s <= s1 ) ) thus ( nt -tree ts in the Sorts of (ParsedTermsOSA X) . s & ( for s1 being Element of S st nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 holds s <= s1 ) ) by A3; ::_thesis: verum end; A4: 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 sy in Terminals (DTConOSA X) ; ::_thesis: S1[ root-tree sy] then consider s being Element of S, x being set such that A5: x in X . s and A6: sy = [x,s] by Th4; reconsider s = s as SortSymbol of S ; take s ; ::_thesis: ( root-tree sy in the Sorts of (ParsedTermsOSA X) . s & ( for s1 being Element of S st root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 holds s <= s1 ) ) thus ( root-tree sy in the Sorts of (ParsedTermsOSA X) . s & ( for s1 being Element of S st root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 holds s <= s1 ) ) by A5, A6, Th10; ::_thesis: verum end; for t being DecoratedTree of the carrier of (DTConOSA X) st t in TS (DTConOSA X) holds S1[t] from DTCONSTR:sch_7(A4, A1); hence ex b1 being SortSymbol of S st ( t in the Sorts of (ParsedTermsOSA X) . b1 & ( for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds b1 <= s1 ) ) ; ::_thesis: verum end; uniqueness for b1, b2 being SortSymbol of S st t in the Sorts of (ParsedTermsOSA X) . b1 & ( for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds b1 <= s1 ) & t in the Sorts of (ParsedTermsOSA X) . b2 & ( for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds b2 <= s1 ) holds b1 = b2 proof let s2, s3 be SortSymbol of S; ::_thesis: ( t in the Sorts of (ParsedTermsOSA X) . s2 & ( for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds s2 <= s1 ) & t in the Sorts of (ParsedTermsOSA X) . s3 & ( for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds s3 <= s1 ) implies s2 = s3 ) assume that A7: t in the Sorts of (ParsedTermsOSA X) . s2 and A8: for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds s2 <= s1 and A9: t in the Sorts of (ParsedTermsOSA X) . s3 and A10: for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds s3 <= s1 ; ::_thesis: s2 = s3 A11: s2 <= s3 by A8, A9; s3 <= s2 by A7, A10; hence s2 = s3 by A11, ORDERS_2:2; ::_thesis: verum end; end; :: deftheorem Def12 defines LeastSort OSAFREE:def_12_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) for b4 being SortSymbol of S holds ( b4 = LeastSort t iff ( t in the Sorts of (ParsedTermsOSA X) . b4 & ( for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds b4 <= s1 ) ) ); definition let S be non empty non void ManySortedSign ; let A be non-empty MSAlgebra over S; mode Element of A is Element of Union the Sorts of A; end; theorem Th14: :: OSAFREE:14 for S being OrderSortedSign for X being V16() ManySortedSet of S for x being set holds ( x is Element of (ParsedTermsOSA X) iff x is Element of TS (DTConOSA X) ) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for x being set holds ( x is Element of (ParsedTermsOSA X) iff x is Element of TS (DTConOSA X) ) let X be V16() ManySortedSet of S; ::_thesis: for x being set holds ( x is Element of (ParsedTermsOSA X) iff x is Element of TS (DTConOSA X) ) let x be set ; ::_thesis: ( x is Element of (ParsedTermsOSA X) iff x is Element of TS (DTConOSA X) ) TS (DTConOSA X) = union (rng (ParsedTerms X)) by Th8 .= Union the Sorts of (ParsedTermsOSA X) by CARD_3:def_4 ; hence ( x is Element of (ParsedTermsOSA X) iff x is Element of TS (DTConOSA X) ) ; ::_thesis: verum end; theorem Th15: :: OSAFREE:15 for S being OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S for x being set st x in the Sorts of (ParsedTermsOSA X) . s holds x is Element of TS (DTConOSA X) proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s being Element of S for x being set st x in the Sorts of (ParsedTermsOSA X) . s holds x is Element of TS (DTConOSA X) let X be V16() ManySortedSet of S; ::_thesis: for s being Element of S for x being set st x in the Sorts of (ParsedTermsOSA X) . s holds x is Element of TS (DTConOSA X) let s be Element of S; ::_thesis: for x being set st x in the Sorts of (ParsedTermsOSA X) . s holds x is Element of TS (DTConOSA X) let x be set ; ::_thesis: ( x in the Sorts of (ParsedTermsOSA X) . s implies x is Element of TS (DTConOSA X) ) assume A1: x in the Sorts of (ParsedTermsOSA X) . s ; ::_thesis: x is Element of TS (DTConOSA X) set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); s in the carrier of S ; then s in dom the Sorts of (ParsedTermsOSA X) by PARTFUN1:def_2; then the Sorts of (ParsedTermsOSA X) . s in rng the Sorts of (ParsedTermsOSA X) by FUNCT_1:def_3; then x in union (rng the Sorts of (ParsedTermsOSA X)) by A1, TARSKI:def_4; then reconsider x1 = x as Element of Union the Sorts of (ParsedTermsOSA X) by CARD_3:def_4; x1 is Element of (ParsedTermsOSA X) ; hence x is Element of TS (DTConOSA X) by Th14; ::_thesis: verum end; theorem :: OSAFREE:16 for S being OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S for x being set st x in X . s holds for t being Element of TS (DTConOSA X) st t = root-tree [x,s] holds LeastSort t = s proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s being Element of S for x being set st x in X . s holds for t being Element of TS (DTConOSA X) st t = root-tree [x,s] holds LeastSort t = s let X be V16() ManySortedSet of S; ::_thesis: for s being Element of S for x being set st x in X . s holds for t being Element of TS (DTConOSA X) st t = root-tree [x,s] holds LeastSort t = s let s be Element of S; ::_thesis: for x being set st x in X . s holds for t being Element of TS (DTConOSA X) st t = root-tree [x,s] holds LeastSort t = s let x be set ; ::_thesis: ( x in X . s implies for t being Element of TS (DTConOSA X) st t = root-tree [x,s] holds LeastSort t = s ) assume A1: x in X . s ; ::_thesis: for t being Element of TS (DTConOSA X) st t = root-tree [x,s] holds LeastSort t = s reconsider s2 = s as Element of S ; let t be Element of TS (DTConOSA X); ::_thesis: ( t = root-tree [x,s] implies LeastSort t = s ) assume A2: t = root-tree [x,s] ; ::_thesis: LeastSort t = s A3: for s1 being Element of S st t in the Sorts of (ParsedTermsOSA X) . s1 holds s2 <= s1 by A1, A2, Th10; t in the Sorts of (ParsedTermsOSA X) . s2 by A1, A2, Th10; hence LeastSort t = s by A3, Def12; ::_thesis: verum end; theorem Th17: :: OSAFREE:17 for S being OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S for x being Element of Args (o,(ParsedTermsOSA X)) for t being Element of TS (DTConOSA X) st t = (Den (o,(ParsedTermsOSA X))) . x holds LeastSort t = the_result_sort_of o proof let S be OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for o being OperSymbol of S for x being Element of Args (o,(ParsedTermsOSA X)) for t being Element of TS (DTConOSA X) st t = (Den (o,(ParsedTermsOSA X))) . x holds LeastSort t = the_result_sort_of o let X be V16() ManySortedSet of S; ::_thesis: for o being OperSymbol of S for x being Element of Args (o,(ParsedTermsOSA X)) for t being Element of TS (DTConOSA X) st t = (Den (o,(ParsedTermsOSA X))) . x holds LeastSort t = the_result_sort_of o let o be OperSymbol of S; ::_thesis: for x being Element of Args (o,(ParsedTermsOSA X)) for t being Element of TS (DTConOSA X) st t = (Den (o,(ParsedTermsOSA X))) . x holds LeastSort t = the_result_sort_of o let x be Element of Args (o,(ParsedTermsOSA X)); ::_thesis: for t being Element of TS (DTConOSA X) st t = (Den (o,(ParsedTermsOSA X))) . x holds LeastSort t = the_result_sort_of o reconsider x1 = x as FinSequence of TS (DTConOSA X) by Th13; set PTA = ParsedTermsOSA X; let t be Element of TS (DTConOSA X); ::_thesis: ( t = (Den (o,(ParsedTermsOSA X))) . x implies LeastSort t = the_result_sort_of o ) assume A1: t = (Den (o,(ParsedTermsOSA X))) . x ; ::_thesis: LeastSort t = the_result_sort_of o OSSym (o,X) ==> roots x by Th13; then consider o1 being OperSymbol of S such that A2: OSSym (o,X) = [o1, the carrier of S] and x1 in Args (o1,(ParsedTermsOSA X)) and A3: (OSSym (o,X)) -tree x1 = (Den (o1,(ParsedTermsOSA X))) . x1 and A4: for s1 being Element of S holds ( (OSSym (o,X)) -tree x1 in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o1 <= s1 ) by Th12; A5: o = o1 by A2, XTUPLE_0:1; then t in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) by A1, A3, A4; hence LeastSort t = the_result_sort_of o by A1, A3, A4, A5, Def12; ::_thesis: verum end; registration let S be OrderSortedSign; let X be V16() ManySortedSet of S; let o2 be OperSymbol of S; cluster Args (o2,(ParsedTermsOSA X)) -> non empty ; coherence not Args (o2,(ParsedTermsOSA X)) is empty ; end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let x be FinSequence of TS (DTConOSA X); func LeastSorts x -> Element of the carrier of S * means :Def13: :: OSAFREE:def 13 ( dom it = dom x & ( for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & it . y = LeastSort t ) ) ); existence ex b1 being Element of the carrier of S * st ( dom b1 = dom x & ( for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & b1 . y = LeastSort t ) ) ) proof set D = DTConOSA X; defpred S1[ set , set ] means ex t being Element of TS (DTConOSA X) st ( t = $1 & LeastSort t = $2 ); A1: rng x c= TS (DTConOSA X) by FINSEQ_1:def_4; A2: for x being set st x in TS (DTConOSA X) holds ex y being set st ( y in the carrier of S & S1[x,y] ) proof let x be set ; ::_thesis: ( x in TS (DTConOSA X) implies ex y being set st ( y in the carrier of S & S1[x,y] ) ) assume x in TS (DTConOSA X) ; ::_thesis: ex y being set st ( y in the carrier of S & S1[x,y] ) then reconsider t = x as Element of TS (DTConOSA X) ; take LeastSort t ; ::_thesis: ( LeastSort t in the carrier of S & S1[x, LeastSort t] ) thus LeastSort t in the carrier of S ; ::_thesis: S1[x, LeastSort t] take t ; ::_thesis: ( t = x & LeastSort t = LeastSort t ) thus ( t = x & LeastSort t = LeastSort t ) ; ::_thesis: verum end; consider f being Function of (TS (DTConOSA X)), the carrier of S such that A3: for x being set st x in TS (DTConOSA X) holds S1[x,f . x] from FUNCT_2:sch_1(A2); take f * x ; ::_thesis: ( dom (f * x) = dom x & ( for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & (f * x) . y = LeastSort t ) ) ) thus dom (f * x) = dom x by FINSEQ_3:120; ::_thesis: for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & (f * x) . y = LeastSort t ) let y be Nat; ::_thesis: ( y in dom x implies ex t being Element of TS (DTConOSA X) st ( t = x . y & (f * x) . y = LeastSort t ) ) assume A4: y in dom x ; ::_thesis: ex t being Element of TS (DTConOSA X) st ( t = x . y & (f * x) . y = LeastSort t ) x . y in rng x by A4, FUNCT_1:3; then reconsider t1 = x . y as Element of TS (DTConOSA X) by A1; take t1 ; ::_thesis: ( t1 = x . y & (f * x) . y = LeastSort t1 ) thus t1 = x . y ; ::_thesis: (f * x) . y = LeastSort t1 A5: ex t2 being Element of TS (DTConOSA X) st ( t2 = t1 & LeastSort t2 = f . t1 ) by A3; y in dom (f * x) by A4, FINSEQ_3:120; hence (f * x) . y = LeastSort t1 by A5, FINSEQ_3:120; ::_thesis: verum end; uniqueness for b1, b2 being Element of the carrier of S * st dom b1 = dom x & ( for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & b1 . y = LeastSort t ) ) & dom b2 = dom x & ( for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & b2 . y = LeastSort t ) ) holds b1 = b2 proof set D = DTConOSA X; let f1, f2 be Element of the carrier of S * ; ::_thesis: ( dom f1 = dom x & ( for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & f1 . y = LeastSort t ) ) & dom f2 = dom x & ( for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & f2 . y = LeastSort t ) ) implies f1 = f2 ) assume that A6: dom f1 = dom x and A7: for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & f1 . y = LeastSort t ) and A8: dom f2 = dom x and A9: for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & f2 . y = LeastSort t ) ; ::_thesis: f1 = f2 for k being Nat st k in dom f1 holds f1 . k = f2 . k proof let k be Nat; ::_thesis: ( k in dom f1 implies f1 . k = f2 . k ) assume A10: k in dom f1 ; ::_thesis: f1 . k = f2 . k A11: ex t2 being Element of TS (DTConOSA X) st ( t2 = x . k & f2 . k = LeastSort t2 ) by A6, A9, A10; ex t1 being Element of TS (DTConOSA X) st ( t1 = x . k & f1 . k = LeastSort t1 ) by A6, A7, A10; hence f1 . k = f2 . k by A11; ::_thesis: verum end; hence f1 = f2 by A6, A8, FINSEQ_1:13; ::_thesis: verum end; end; :: deftheorem Def13 defines LeastSorts OSAFREE:def_13_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for x being FinSequence of TS (DTConOSA X) for b4 being Element of the carrier of S * holds ( b4 = LeastSorts x iff ( dom b4 = dom x & ( for y being Nat st y in dom x holds ex t being Element of TS (DTConOSA X) st ( t = x . y & b4 . y = LeastSort t ) ) ) ); theorem Th18: :: OSAFREE:18 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S for x being FinSequence of TS (DTConOSA X) holds ( LeastSorts x <= the_arity_of o iff x in Args (o,(ParsedTermsOSA X)) ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for o being OperSymbol of S for x being FinSequence of TS (DTConOSA X) holds ( LeastSorts x <= the_arity_of o iff x in Args (o,(ParsedTermsOSA X)) ) let X be V16() ManySortedSet of S; ::_thesis: for o being OperSymbol of S for x being FinSequence of TS (DTConOSA X) holds ( LeastSorts x <= the_arity_of o iff x in Args (o,(ParsedTermsOSA X)) ) let o be OperSymbol of S; ::_thesis: for x being FinSequence of TS (DTConOSA X) holds ( LeastSorts x <= the_arity_of o iff x in Args (o,(ParsedTermsOSA X)) ) let x be FinSequence of TS (DTConOSA X); ::_thesis: ( LeastSorts x <= the_arity_of o iff x in Args (o,(ParsedTermsOSA X)) ) set PTA = ParsedTermsOSA X; set D = DTConOSA X; set w = the_arity_of o; set LSx = LeastSorts x; reconsider SPTA = the Sorts of (ParsedTermsOSA X) as OrderSortedSet of S ; A1: dom (LeastSorts x) = dom x by Def13; hereby ::_thesis: ( x in Args (o,(ParsedTermsOSA X)) implies LeastSorts x <= the_arity_of o ) assume A2: LeastSorts x <= the_arity_of o ; ::_thesis: x in Args (o,(ParsedTermsOSA X)) then A3: len (LeastSorts x) = len (the_arity_of o) by OSALG_1:def_6; then A4: dom (LeastSorts x) = dom (the_arity_of o) by FINSEQ_3:29; A5: for k being Nat st k in dom x holds x . k in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. k) proof let k be Nat; ::_thesis: ( k in dom x implies x . k in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. k) ) assume A6: k in dom x ; ::_thesis: x . k in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. k) consider t2 being Element of TS (DTConOSA X) such that A7: t2 = x . k and A8: (LeastSorts x) . k = LeastSort t2 by A6, Def13; reconsider wk = (the_arity_of o) /. k as Element of S ; (the_arity_of o) /. k = (the_arity_of o) . k by A1, A4, A6, PARTFUN1:def_6; then LeastSort t2 <= wk by A1, A2, A6, A8, OSALG_1:def_6; then A9: SPTA . (LeastSort t2) c= SPTA . wk by OSALG_1:def_16; t2 in the Sorts of (ParsedTermsOSA X) . (LeastSort t2) by Def12; hence x . k in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. k) by A7, A9; ::_thesis: verum end; len x = len (the_arity_of o) by A1, A3, FINSEQ_3:29; hence x in Args (o,(ParsedTermsOSA X)) by A5, MSAFREE2:5; ::_thesis: verum end; assume A10: x in Args (o,(ParsedTermsOSA X)) ; ::_thesis: LeastSorts x <= the_arity_of o then A11: dom x = dom (the_arity_of o) by MSUALG_6:2; hence len (LeastSorts x) = len (the_arity_of o) by A1, FINSEQ_3:29; :: according to OSALG_1:def_6 ::_thesis: for b1 being set holds ( not b1 in dom (LeastSorts x) or for b2, b3 being Element of the carrier of S holds ( not b2 = (LeastSorts x) . b1 or not b3 = (the_arity_of o) . b1 or b2 <= b3 ) ) let i be set ; ::_thesis: ( not i in dom (LeastSorts x) or for b1, b2 being Element of the carrier of S holds ( not b1 = (LeastSorts x) . i or not b2 = (the_arity_of o) . i or b1 <= b2 ) ) assume A12: i in dom (LeastSorts x) ; ::_thesis: for b1, b2 being Element of the carrier of S holds ( not b1 = (LeastSorts x) . i or not b2 = (the_arity_of o) . i or b1 <= b2 ) reconsider k = i as Nat by A12; i in dom (the_arity_of o) by A11, A12, Def13; then A13: x . k in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. k) by A10, MSUALG_6:2; i in dom x by A12, Def13; then A14: ex t2 being Element of TS (DTConOSA X) st ( t2 = x . k & (LeastSorts x) . k = LeastSort t2 ) by Def13; let s1, s2 be Element of S; ::_thesis: ( not s1 = (LeastSorts x) . i or not s2 = (the_arity_of o) . i or s1 <= s2 ) assume that A15: s1 = (LeastSorts x) . i and A16: s2 = (the_arity_of o) . i ; ::_thesis: s1 <= s2 (the_arity_of o) /. k = (the_arity_of o) . k by A1, A11, A12, PARTFUN1:def_6; hence s1 <= s2 by A15, A16, A14, A13, Def12; ::_thesis: verum end; registration cluster non empty non void V60() reflexive transitive antisymmetric order-sorted discernable monotone regular locally_directed for OverloadedRSSign ; existence ex b1 being monotone OrderSortedSign st ( b1 is locally_directed & b1 is regular ) proof set S1 = the discrete op-discrete OrderSortedSign; take the discrete op-discrete OrderSortedSign ; ::_thesis: ( the discrete op-discrete OrderSortedSign is locally_directed & the discrete op-discrete OrderSortedSign is regular ) thus ( the discrete op-discrete OrderSortedSign is locally_directed & the discrete op-discrete OrderSortedSign is regular ) ; ::_thesis: verum end; end; definition let S be monotone regular locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let o be OperSymbol of S; let x be FinSequence of TS (DTConOSA X); assume A1: OSSym ((LBound (o,(LeastSorts x))),X) ==> roots x ; func pi (o,x) -> Element of TS (DTConOSA X) equals :Def14: :: OSAFREE:def 14 (OSSym ((LBound (o,(LeastSorts x))),X)) -tree x; correctness coherence (OSSym ((LBound (o,(LeastSorts x))),X)) -tree x is Element of TS (DTConOSA X); by A1, Th12; end; :: deftheorem Def14 defines pi OSAFREE:def_14_:_ for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for o being OperSymbol of S for x being FinSequence of TS (DTConOSA X) st OSSym ((LBound (o,(LeastSorts x))),X) ==> roots x holds pi (o,x) = (OSSym ((LBound (o,(LeastSorts x))),X)) -tree x; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let t be Symbol of (DTConOSA X); assume A1: ex p being FinSequence st t ==> p ; func @ (X,t) -> OperSymbol of S means :Def15: :: OSAFREE:def 15 [it, the carrier of S] = t; existence ex b1 being OperSymbol of S st [b1, the carrier of S] = t proof set D = DTConOSA X; set OU = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); reconsider a = t as Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) ; consider p being FinSequence such that A2: t ==> p by A1; [t,p] in the Rules of (DTConOSA X) by A2, LANG1:def_1; then reconsider p = p as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by ZFMISC_1:87; [a,p] in OSREL X by A2, LANG1:def_1; then a in [: the carrier' of S,{ the carrier of S}:] by Def4; then consider o being Element of the carrier' of S, x2 being Element of { the carrier of S} such that A3: a = [o,x2] by DOMAIN_1:1; take o ; ::_thesis: [o, the carrier of S] = t thus [o, the carrier of S] = t by A3, TARSKI:def_1; ::_thesis: verum end; uniqueness for b1, b2 being OperSymbol of S st [b1, the carrier of S] = t & [b2, the carrier of S] = t holds b1 = b2 by XTUPLE_0:1; end; :: deftheorem Def15 defines @ OSAFREE:def_15_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for t being Symbol of (DTConOSA X) st ex p being FinSequence st t ==> p holds for b4 being OperSymbol of S holds ( b4 = @ (X,t) iff [b4, the carrier of S] = t ); definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; let t be Symbol of (DTConOSA X); assume A1: t in Terminals (DTConOSA X) ; func pi t -> Element of TS (DTConOSA X) equals :Def16: :: OSAFREE:def 16 root-tree t; correctness coherence root-tree t is Element of TS (DTConOSA X); by A1, DTCONSTR:def_1; end; :: deftheorem Def16 defines pi OSAFREE:def_16_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds pi t = root-tree t; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func LCongruence X -> monotone OSCongruence of ParsedTermsOSA X means :Def17: :: OSAFREE:def 17 for R being monotone OSCongruence of ParsedTermsOSA X holds it c= R; existence ex b1 being monotone OSCongruence of ParsedTermsOSA X st for R being monotone OSCongruence of ParsedTermsOSA X holds b1 c= R proof set PTA = ParsedTermsOSA X; set D = DTConOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); defpred S1[ set , set , set ] means for R being monotone OSCongruence of ParsedTermsOSA X holds [$1,$2] in R . $3; deffunc H1( set ) -> set = { [x,y] where x, y is Element of TS (DTConOSA X) : ( x in the Sorts of (ParsedTermsOSA X) . $1 & y in the Sorts of (ParsedTermsOSA X) . $1 & ( for R being monotone OSCongruence of ParsedTermsOSA X holds [x,y] in R . $1 ) ) } ; consider f being ManySortedSet of the carrier of S such that A1: for i being set st i in the carrier of S holds f . i = H1(i) from PBOOLE:sch_4(); A2: for i being set st i in the carrier of S holds f . i is Equivalence_Relation of ( the Sorts of (ParsedTermsOSA X) . i) proof let i be set ; ::_thesis: ( i in the carrier of S implies f . i is Equivalence_Relation of ( the Sorts of (ParsedTermsOSA X) . i) ) assume A3: i in the carrier of S ; ::_thesis: f . i is Equivalence_Relation of ( the Sorts of (ParsedTermsOSA X) . i) reconsider s = i as Element of S by A3; A4: f . i = { [x,y] where x, y is Element of TS (DTConOSA X) : ( x in the Sorts of (ParsedTermsOSA X) . i & y in the Sorts of (ParsedTermsOSA X) . i & ( for R being monotone OSCongruence of ParsedTermsOSA X holds [x,y] in R . i ) ) } by A1, A3; now__::_thesis:_for_z_being_set_st_z_in_f_._i_holds_ z_in_[:(_the_Sorts_of_(ParsedTermsOSA_X)_._i),(_the_Sorts_of_(ParsedTermsOSA_X)_._i):] let z be set ; ::_thesis: ( z in f . i implies z in [:( the Sorts of (ParsedTermsOSA X) . i),( the Sorts of (ParsedTermsOSA X) . i):] ) assume z in f . i ; ::_thesis: z in [:( the Sorts of (ParsedTermsOSA X) . i),( the Sorts of (ParsedTermsOSA X) . i):] then ex x, y being Element of TS (DTConOSA X) st ( z = [x,y] & x in the Sorts of (ParsedTermsOSA X) . i & y in the Sorts of (ParsedTermsOSA X) . i & S1[x,y,i] ) by A4; hence z in [:( the Sorts of (ParsedTermsOSA X) . i),( the Sorts of (ParsedTermsOSA X) . i):] by ZFMISC_1:87; ::_thesis: verum end; then reconsider fi = f . i as Relation of ( the Sorts of (ParsedTermsOSA X) . i) by TARSKI:def_3; now__::_thesis:_for_x,_y,_z_being_set_st_x_in_the_Sorts_of_(ParsedTermsOSA_X)_._s_&_y_in_the_Sorts_of_(ParsedTermsOSA_X)_._s_&_z_in_the_Sorts_of_(ParsedTermsOSA_X)_._s_&_[x,y]_in_fi_&_[y,z]_in_fi_holds_ [x,z]_in_fi let x, y, z be set ; ::_thesis: ( x in the Sorts of (ParsedTermsOSA X) . s & y in the Sorts of (ParsedTermsOSA X) . s & z in the Sorts of (ParsedTermsOSA X) . s & [x,y] in fi & [y,z] in fi implies [x,z] in fi ) assume that A5: x in the Sorts of (ParsedTermsOSA X) . s and A6: y in the Sorts of (ParsedTermsOSA X) . s and A7: z in the Sorts of (ParsedTermsOSA X) . s and A8: [x,y] in fi and A9: [y,z] in fi ; ::_thesis: [x,z] in fi thus [x,z] in fi ::_thesis: verum proof reconsider t1 = x, t2 = y, t3 = z as Element of TS (DTConOSA X) by A5, A6, A7, Th15; A10: ex t6, t7 being Element of TS (DTConOSA X) st ( [t2,t3] = [t6,t7] & t6 in the Sorts of (ParsedTermsOSA X) . i & t7 in the Sorts of (ParsedTermsOSA X) . i & S1[t6,t7,i] ) by A4, A9; A11: ex t4, t5 being Element of TS (DTConOSA X) st ( [t1,t2] = [t4,t5] & t4 in the Sorts of (ParsedTermsOSA X) . i & t5 in the Sorts of (ParsedTermsOSA X) . i & S1[t4,t5,i] ) by A4, A8; now__::_thesis:_for_R_being_monotone_OSCongruence_of_ParsedTermsOSA_X_holds_[t1,t3]_in_R_._s let R be monotone OSCongruence of ParsedTermsOSA X; ::_thesis: [t1,t3] in R . s A12: [t2,t3] in R . s by A10; field (R . s) = the Sorts of (ParsedTermsOSA X) . s by ORDERS_1:12; then A13: R . s is_transitive_in the Sorts of (ParsedTermsOSA X) . s by RELAT_2:def_16; [t1,t2] in R . s by A11; hence [t1,t3] in R . s by A5, A6, A7, A12, A13, RELAT_2:def_8; ::_thesis: verum end; hence [x,z] in fi by A4, A5, A7; ::_thesis: verum end; end; then A14: fi is_transitive_in the Sorts of (ParsedTermsOSA X) . s by RELAT_2:def_8; now__::_thesis:_for_x,_y_being_set_st_x_in_the_Sorts_of_(ParsedTermsOSA_X)_._s_&_y_in_the_Sorts_of_(ParsedTermsOSA_X)_._s_&_[x,y]_in_fi_holds_ [y,x]_in_fi let x, y be set ; ::_thesis: ( x in the Sorts of (ParsedTermsOSA X) . s & y in the Sorts of (ParsedTermsOSA X) . s & [x,y] in fi implies [y,x] in fi ) assume that A15: x in the Sorts of (ParsedTermsOSA X) . s and A16: y in the Sorts of (ParsedTermsOSA X) . s and A17: [x,y] in fi ; ::_thesis: [y,x] in fi thus [y,x] in fi ::_thesis: verum proof reconsider t1 = x, t2 = y as Element of TS (DTConOSA X) by A15, A16, Th15; A18: ex t3, t4 being Element of TS (DTConOSA X) st ( [t1,t2] = [t3,t4] & t3 in the Sorts of (ParsedTermsOSA X) . i & t4 in the Sorts of (ParsedTermsOSA X) . i & S1[t3,t4,i] ) by A4, A17; now__::_thesis:_for_R_being_monotone_OSCongruence_of_ParsedTermsOSA_X_holds_[t2,t1]_in_R_._s let R be monotone OSCongruence of ParsedTermsOSA X; ::_thesis: [t2,t1] in R . s field (R . s) = the Sorts of (ParsedTermsOSA X) . s by ORDERS_1:12; then A19: R . s is_symmetric_in the Sorts of (ParsedTermsOSA X) . s by RELAT_2:def_11; [t1,t2] in R . s by A18; hence [t2,t1] in R . s by A15, A16, A19, RELAT_2:def_3; ::_thesis: verum end; hence [y,x] in fi by A4, A15, A16; ::_thesis: verum end; end; then A20: fi is_symmetric_in the Sorts of (ParsedTermsOSA X) . s by RELAT_2:def_3; now__::_thesis:_for_x_being_set_st_x_in_the_Sorts_of_(ParsedTermsOSA_X)_._s_holds_ [x,x]_in_fi let x be set ; ::_thesis: ( x in the Sorts of (ParsedTermsOSA X) . s implies [x,x] in fi ) assume A21: x in the Sorts of (ParsedTermsOSA X) . s ; ::_thesis: [x,x] in fi thus [x,x] in fi ::_thesis: verum proof reconsider t1 = x as Element of TS (DTConOSA X) by A21, Th15; now__::_thesis:_for_R_being_monotone_OSCongruence_of_ParsedTermsOSA_X_holds_[t1,t1]_in_R_._s let R be monotone OSCongruence of ParsedTermsOSA X; ::_thesis: [t1,t1] in R . s field (R . s) = the Sorts of (ParsedTermsOSA X) . s by ORDERS_1:12; then R . s is_reflexive_in the Sorts of (ParsedTermsOSA X) . s by RELAT_2:def_9; hence [t1,t1] in R . s by A21, RELAT_2:def_1; ::_thesis: verum end; hence [x,x] in fi by A4, A21; ::_thesis: verum end; end; then A22: fi is_reflexive_in the Sorts of (ParsedTermsOSA X) . s by RELAT_2:def_1; then A23: field fi = the Sorts of (ParsedTermsOSA X) . s by ORDERS_1:13; dom fi = the Sorts of (ParsedTermsOSA X) . s by A22, ORDERS_1:13; hence f . i is Equivalence_Relation of ( the Sorts of (ParsedTermsOSA X) . i) by A23, A20, A14, PARTFUN1:def_2, RELAT_2:def_11, RELAT_2:def_16; ::_thesis: verum end; then for i being set st i in the carrier of S holds f . i is Relation of ( the Sorts of (ParsedTermsOSA X) . i),( the Sorts of (ParsedTermsOSA X) . i) ; then reconsider f = f as ManySortedRelation of the Sorts of (ParsedTermsOSA X) by MSUALG_4:def_1; reconsider f = f as ManySortedRelation of (ParsedTermsOSA X) ; for i being set for R being Relation of ( the Sorts of (ParsedTermsOSA X) . i) st i in the carrier of S & f . i = R holds R is Equivalence_Relation of ( the Sorts of (ParsedTermsOSA X) . i) by A2; then f is MSEquivalence_Relation-like by MSUALG_4:def_2; then reconsider f = f as MSEquivalence-like ManySortedRelation of (ParsedTermsOSA X) by MSUALG_4:def_3; f is os-compatible proof let s1, s2 be Element of S; :: according to OSALG_4:def_1 ::_thesis: ( not s1 <= s2 or for b1, b2 being set holds ( not b1 in the Sorts of (ParsedTermsOSA X) . s1 or not b2 in the Sorts of (ParsedTermsOSA X) . s1 or ( ( not [b1,b2] in f . s1 or [b1,b2] in f . s2 ) & ( not [b1,b2] in f . s2 or [b1,b2] in f . s1 ) ) ) ) assume A24: s1 <= s2 ; ::_thesis: for b1, b2 being set holds ( not b1 in the Sorts of (ParsedTermsOSA X) . s1 or not b2 in the Sorts of (ParsedTermsOSA X) . s1 or ( ( not [b1,b2] in f . s1 or [b1,b2] in f . s2 ) & ( not [b1,b2] in f . s2 or [b1,b2] in f . s1 ) ) ) A25: f . s1 = { [x,y] where x, y is Element of TS (DTConOSA X) : ( x in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 & S1[x,y,s1] ) } by A1; A26: f . s2 = { [x,y] where x, y is Element of TS (DTConOSA X) : ( x in the Sorts of (ParsedTermsOSA X) . s2 & y in the Sorts of (ParsedTermsOSA X) . s2 & S1[x,y,s2] ) } by A1; let x, y be set ; ::_thesis: ( not x in the Sorts of (ParsedTermsOSA X) . s1 or not y in the Sorts of (ParsedTermsOSA X) . s1 or ( ( not [x,y] in f . s1 or [x,y] in f . s2 ) & ( not [x,y] in f . s2 or [x,y] in f . s1 ) ) ) assume that A27: x in the Sorts of (ParsedTermsOSA X) . s1 and A28: y in the Sorts of (ParsedTermsOSA X) . s1 ; ::_thesis: ( ( not [x,y] in f . s1 or [x,y] in f . s2 ) & ( not [x,y] in f . s2 or [x,y] in f . s1 ) ) hereby ::_thesis: ( not [x,y] in f . s2 or [x,y] in f . s1 ) assume [x,y] in f . s1 ; ::_thesis: [x,y] in f . s2 then consider t1, t2 being Element of TS (DTConOSA X) such that A29: [x,y] = [t1,t2] and A30: t1 in the Sorts of (ParsedTermsOSA X) . s1 and A31: t2 in the Sorts of (ParsedTermsOSA X) . s1 and A32: S1[t1,t2,s1] by A25; now__::_thesis:_for_R_being_monotone_OSCongruence_of_ParsedTermsOSA_X_holds_ (_t1_in_the_Sorts_of_(ParsedTermsOSA_X)_._s2_&_t2_in_the_Sorts_of_(ParsedTermsOSA_X)_._s2_&_[t1,t2]_in_R_._s2_) let R be monotone OSCongruence of ParsedTermsOSA X; ::_thesis: ( t1 in the Sorts of (ParsedTermsOSA X) . s2 & t2 in the Sorts of (ParsedTermsOSA X) . s2 & [t1,t2] in R . s2 ) A33: R is os-compatible by OSALG_4:def_2; [t1,t2] in R . s1 by A32; then [t1,t2] in R . s2 by A24, A30, A31, A33, OSALG_4:def_1; hence ( t1 in the Sorts of (ParsedTermsOSA X) . s2 & t2 in the Sorts of (ParsedTermsOSA X) . s2 & [t1,t2] in R . s2 ) by ZFMISC_1:87; ::_thesis: verum end; hence [x,y] in f . s2 by A26, A29; ::_thesis: verum end; assume [x,y] in f . s2 ; ::_thesis: [x,y] in f . s1 then consider t1, t2 being Element of TS (DTConOSA X) such that A34: [x,y] = [t1,t2] and t1 in the Sorts of (ParsedTermsOSA X) . s2 and t2 in the Sorts of (ParsedTermsOSA X) . s2 and A35: S1[t1,t2,s2] by A26; A36: y = t2 by A34, XTUPLE_0:1; A37: now__::_thesis:_for_R_being_monotone_OSCongruence_of_ParsedTermsOSA_X_holds_[t1,t2]_in_R_._s1 let R be monotone OSCongruence of ParsedTermsOSA X; ::_thesis: [t1,t2] in R . s1 A38: R is os-compatible by OSALG_4:def_2; [t1,t2] in R . s2 by A35; hence [t1,t2] in R . s1 by A24, A27, A28, A34, A38, OSALG_4:def_1; ::_thesis: verum end; x = t1 by A34, XTUPLE_0:1; hence [x,y] in f . s1 by A25, A27, A28, A36, A37; ::_thesis: verum end; then reconsider f = f as MSEquivalence-like OrderSortedRelation of ParsedTermsOSA X by OSALG_4:def_2; f is monotone proof let o1, o2 be OperSymbol of S; :: according to OSALG_4:def_26 ::_thesis: ( not o1 <= o2 or for b1 being Element of Args (o1,(ParsedTermsOSA X)) for b2 being Element of Args (o2,(ParsedTermsOSA X)) holds ( ex b3 being set st ( b3 in proj1 b1 & not [(b1 . b3),(b2 . b3)] in f . ((the_arity_of o2) /. b3) ) or [((Den (o1,(ParsedTermsOSA X))) . b1),((Den (o2,(ParsedTermsOSA X))) . b2)] in f . (the_result_sort_of o2) ) ) assume A39: o1 <= o2 ; ::_thesis: for b1 being Element of Args (o1,(ParsedTermsOSA X)) for b2 being Element of Args (o2,(ParsedTermsOSA X)) holds ( ex b3 being set st ( b3 in proj1 b1 & not [(b1 . b3),(b2 . b3)] in f . ((the_arity_of o2) /. b3) ) or [((Den (o1,(ParsedTermsOSA X))) . b1),((Den (o2,(ParsedTermsOSA X))) . b2)] in f . (the_result_sort_of o2) ) set w2 = the_arity_of o2; set rs2 = the_result_sort_of o2; let x1 be Element of Args (o1,(ParsedTermsOSA X)); ::_thesis: for b1 being Element of Args (o2,(ParsedTermsOSA X)) holds ( ex b2 being set st ( b2 in proj1 x1 & not [(x1 . b2),(b1 . b2)] in f . ((the_arity_of o2) /. b2) ) or [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . b1)] in f . (the_result_sort_of o2) ) let x2 be Element of Args (o2,(ParsedTermsOSA X)); ::_thesis: ( ex b1 being set st ( b1 in proj1 x1 & not [(x1 . b1),(x2 . b1)] in f . ((the_arity_of o2) /. b1) ) or [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in f . (the_result_sort_of o2) ) assume A40: for y being Nat st y in dom x1 holds [(x1 . y),(x2 . y)] in f . ((the_arity_of o2) /. y) ; ::_thesis: [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in f . (the_result_sort_of o2) set D1 = (Den (o1,(ParsedTermsOSA X))) . x1; set D2 = (Den (o2,(ParsedTermsOSA X))) . x2; A41: now__::_thesis:_for_R_being_monotone_OSCongruence_of_ParsedTermsOSA_X_holds_ (_(Den_(o1,(ParsedTermsOSA_X)))_._x1_in_the_Sorts_of_(ParsedTermsOSA_X)_._(the_result_sort_of_o2)_&_(Den_(o2,(ParsedTermsOSA_X)))_._x2_in_the_Sorts_of_(ParsedTermsOSA_X)_._(the_result_sort_of_o2)_&_[((Den_(o1,(ParsedTermsOSA_X)))_._x1),((Den_(o2,(ParsedTermsOSA_X)))_._x2)]_in_R_._(the_result_sort_of_o2)_&_(Den_(o1,(ParsedTermsOSA_X)))_._x1_is_Element_of_TS_(DTConOSA_X)_&_(Den_(o2,(ParsedTermsOSA_X)))_._x2_is_Element_of_TS_(DTConOSA_X)_) let R be monotone OSCongruence of ParsedTermsOSA X; ::_thesis: ( (Den (o1,(ParsedTermsOSA X))) . x1 in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) & (Den (o2,(ParsedTermsOSA X))) . x2 in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) & [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in R . (the_result_sort_of o2) & (Den (o1,(ParsedTermsOSA X))) . x1 is Element of TS (DTConOSA X) & (Den (o2,(ParsedTermsOSA X))) . x2 is Element of TS (DTConOSA X) ) A42: now__::_thesis:_for_y_being_Nat_st_y_in_dom_x1_holds_ [(x1_._y),(x2_._y)]_in_R_._((the_arity_of_o2)_/._y) let y be Nat; ::_thesis: ( y in dom x1 implies [(x1 . y),(x2 . y)] in R . ((the_arity_of o2) /. y) ) assume y in dom x1 ; ::_thesis: [(x1 . y),(x2 . y)] in R . ((the_arity_of o2) /. y) then A43: [(x1 . y),(x2 . y)] in f . ((the_arity_of o2) /. y) by A40; f . ((the_arity_of o2) /. y) = { [x,z] where x, z is Element of TS (DTConOSA X) : ( x in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o2) /. y) & z in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o2) /. y) & S1[x,z,(the_arity_of o2) /. y] ) } by A1; then ex x, z being Element of TS (DTConOSA X) st ( [(x1 . y),(x2 . y)] = [x,z] & x in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o2) /. y) & z in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o2) /. y) & S1[x,z,(the_arity_of o2) /. y] ) by A43; hence [(x1 . y),(x2 . y)] in R . ((the_arity_of o2) /. y) ; ::_thesis: verum end; then A44: [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in R . (the_result_sort_of o2) by A39, OSALG_4:def_26; then A45: (Den (o2,(ParsedTermsOSA X))) . x2 in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) by ZFMISC_1:87; (Den (o1,(ParsedTermsOSA X))) . x1 in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) by A44, ZFMISC_1:87; hence ( (Den (o1,(ParsedTermsOSA X))) . x1 in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) & (Den (o2,(ParsedTermsOSA X))) . x2 in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) & [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in R . (the_result_sort_of o2) & (Den (o1,(ParsedTermsOSA X))) . x1 is Element of TS (DTConOSA X) & (Den (o2,(ParsedTermsOSA X))) . x2 is Element of TS (DTConOSA X) ) by A39, A42, A45, Th15, OSALG_4:def_26; ::_thesis: verum end; f . (the_result_sort_of o2) = { [x,y] where x, y is Element of TS (DTConOSA X) : ( x in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) & y in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) & S1[x,y, the_result_sort_of o2] ) } by A1; hence [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in f . (the_result_sort_of o2) by A41; ::_thesis: verum end; then reconsider f = f as MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X ; take f ; ::_thesis: for R being monotone OSCongruence of ParsedTermsOSA X holds f c= R let R be monotone OSCongruence of ParsedTermsOSA X; ::_thesis: f c= R let i be set ; :: according to PBOOLE:def_2 ::_thesis: ( not i in the carrier of S or f . i c= R . i ) assume i in the carrier of S ; ::_thesis: f . i c= R . i then reconsider s = i as Element of S ; A46: f . s = { [x,y] where x, y is Element of TS (DTConOSA X) : ( x in the Sorts of (ParsedTermsOSA X) . s & y in the Sorts of (ParsedTermsOSA X) . s & S1[x,y,s] ) } by A1; let z be set ; :: according to TARSKI:def_3 ::_thesis: ( not z in f . i or z in R . i ) assume z in f . i ; ::_thesis: z in R . i then ex x, y being Element of TS (DTConOSA X) st ( z = [x,y] & x in the Sorts of (ParsedTermsOSA X) . s & y in the Sorts of (ParsedTermsOSA X) . s & S1[x,y,s] ) by A46; hence z in R . i ; ::_thesis: verum end; uniqueness for b1, b2 being monotone OSCongruence of ParsedTermsOSA X st ( for R being monotone OSCongruence of ParsedTermsOSA X holds b1 c= R ) & ( for R being monotone OSCongruence of ParsedTermsOSA X holds b2 c= R ) holds b1 = b2 proof set PTA = ParsedTermsOSA X; let L1, L2 be monotone OSCongruence of ParsedTermsOSA X; ::_thesis: ( ( for R being monotone OSCongruence of ParsedTermsOSA X holds L1 c= R ) & ( for R being monotone OSCongruence of ParsedTermsOSA X holds L2 c= R ) implies L1 = L2 ) assume that A47: for R being monotone OSCongruence of ParsedTermsOSA X holds L1 c= R and A48: for R being monotone OSCongruence of ParsedTermsOSA X holds L2 c= R ; ::_thesis: L1 = L2 A49: L2 c= L1 by A48; L1 c= L2 by A47; hence L1 = L2 by A49, PBOOLE:146; ::_thesis: verum end; end; :: deftheorem Def17 defines LCongruence OSAFREE:def_17_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for b3 being monotone OSCongruence of ParsedTermsOSA X holds ( b3 = LCongruence X iff for R being monotone OSCongruence of ParsedTermsOSA X holds b3 c= R ); definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func FreeOSA X -> strict non-empty monotone OSAlgebra of S equals :: OSAFREE:def 18 QuotOSAlg ((ParsedTermsOSA X),(LCongruence X)); correctness coherence QuotOSAlg ((ParsedTermsOSA X),(LCongruence X)) is strict non-empty monotone OSAlgebra of S; ; end; :: deftheorem defines FreeOSA OSAFREE:def_18_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S holds FreeOSA X = QuotOSAlg ((ParsedTermsOSA X),(LCongruence X)); definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; let t be Symbol of (DTConOSA X); func @ t -> Subset of [:(TS (DTConOSA X)), the carrier of S:] equals :: OSAFREE:def 19 { [(root-tree t),s1] where s1 is Element of S : ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) } ; correctness coherence { [(root-tree t),s1] where s1 is Element of S : ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) } is Subset of [:(TS (DTConOSA X)), the carrier of S:]; proof set RT = { [(root-tree t),s1] where s1 is Element of S : ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) } ; { [(root-tree t),s1] where s1 is Element of S : ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) } c= [:(TS (DTConOSA X)), the carrier of S:] proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in { [(root-tree t),s1] where s1 is Element of S : ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) } or y in [:(TS (DTConOSA X)), the carrier of S:] ) assume y in { [(root-tree t),s1] where s1 is Element of S : ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) } ; ::_thesis: y in [:(TS (DTConOSA X)), the carrier of S:] then consider s1 being Element of S such that A1: y = [(root-tree t),s1] and A2: ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) ; consider s being Element of S, x being set such that A3: x in X . s and A4: t = [x,s] and s <= s1 by A2; root-tree [x,s] is Element of TS (DTConOSA X) by A3, Th10; hence y in [:(TS (DTConOSA X)), the carrier of S:] by A1, A4, ZFMISC_1:def_2; ::_thesis: verum end; hence { [(root-tree t),s1] where s1 is Element of S : ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) } is Subset of [:(TS (DTConOSA X)), the carrier of S:] ; ::_thesis: verum end; end; :: deftheorem defines @ OSAFREE:def_19_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for t being Symbol of (DTConOSA X) holds @ t = { [(root-tree t),s1] where s1 is Element of S : ex s being Element of S ex x being set st ( x in X . s & t = [x,s] & s <= s1 ) } ; definition let S be OrderSortedSign; let X be V16() ManySortedSet of S; let nt be Symbol of (DTConOSA X); let x be FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:]; func @ (nt,x) -> Subset of [:(TS (DTConOSA X)), the carrier of S:] equals :: OSAFREE:def 20 { [((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 ) ) ) } ; correctness coherence { [((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 ) ) ) } is Subset of [:(TS (DTConOSA X)), the carrier of S:]; proof set NT = { [((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 ) ) ) } ; { [((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 ) ) ) } c= [:(TS (DTConOSA X)), the carrier of S:] proof let y be set ; :: according to TARSKI:def_3 ::_thesis: ( not y in { [((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 ) ) ) } or y in [:(TS (DTConOSA X)), the carrier of S:] ) assume y in { [((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 ) ) ) } ; ::_thesis: y in [:(TS (DTConOSA X)), the carrier of S:] then consider o2 being OperSymbol of S, x2 being Element of Args (o2,(ParsedTermsOSA X)), s3 being Element of S such that A1: y = [((Den (o2,(ParsedTermsOSA X))) . x2),s3] and 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 ) and 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 ) ) ; A2: OSSym (o2,X) ==> roots x2 by Th13; A3: x2 is FinSequence of TS (DTConOSA X) by Th13; then A4: (OSSym (o2,X)) -tree x2 in TS (DTConOSA X) by A2, Th12; consider o being OperSymbol of S such that A5: OSSym (o2,X) = [o, the carrier of S] and x2 in Args (o,(ParsedTermsOSA X)) and A6: (OSSym (o2,X)) -tree x2 = (Den (o,(ParsedTermsOSA X))) . x2 and for s1 being Element of S holds ( (OSSym (o2,X)) -tree x2 in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) by A3, A2, Th12; o2 = o by A5, XTUPLE_0:1; hence y in [:(TS (DTConOSA X)), the carrier of S:] by A1, A4, A6, ZFMISC_1:def_2; ::_thesis: verum end; hence { [((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 ) ) ) } is Subset of [:(TS (DTConOSA X)), the carrier of S:] ; ::_thesis: verum end; end; :: deftheorem defines @ OSAFREE:def_20_:_ for S being OrderSortedSign for X being V16() ManySortedSet of S for nt being Symbol of (DTConOSA X) for x being FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] holds @ (nt,x) = { [((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 ) ) ) } ; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func PTClasses X -> Function of (TS (DTConOSA X)),(bool [:(TS (DTConOSA X)), the carrier of S:]) means :Def21: :: OSAFREE:def 21 ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds it . (root-tree t) = @ t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds it . (nt -tree ts) = @ (nt,(it * ts)) ) ); existence ex b1 being Function of (TS (DTConOSA X)),(bool [:(TS (DTConOSA X)), the carrier of S:]) st ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds b1 . (root-tree t) = @ t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds b1 . (nt -tree ts) = @ (nt,(b1 * ts)) ) ) proof set G = DTConOSA X; set D = bool [:(TS (DTConOSA X)), the carrier of S:]; deffunc H1( Symbol of (DTConOSA X)) -> Subset of [:(TS (DTConOSA X)), the carrier of S:] = @ $1; deffunc H2( Symbol of (DTConOSA X), set , FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:]) -> Subset of [:(TS (DTConOSA X)), the carrier of S:] = @ ($1,$3); thus ex f being Function of (TS (DTConOSA X)),(bool [:(TS (DTConOSA X)), the carrier of S:]) st ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds f . (root-tree t) = H1(t) ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f . (nt -tree ts) = H2(nt, roots ts,f * ts) ) ) from DTCONSTR:sch_8(); ::_thesis: verum end; uniqueness for b1, b2 being Function of (TS (DTConOSA X)),(bool [:(TS (DTConOSA X)), the carrier of S:]) st ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds b1 . (root-tree t) = @ t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds b1 . (nt -tree ts) = @ (nt,(b1 * ts)) ) & ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds b2 . (root-tree t) = @ t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds b2 . (nt -tree ts) = @ (nt,(b2 * ts)) ) holds b1 = b2 proof set G = DTConOSA X; set D = bool [:(TS (DTConOSA X)), the carrier of S:]; deffunc H1( Symbol of (DTConOSA X)) -> Subset of [:(TS (DTConOSA X)), the carrier of S:] = @ $1; deffunc H2( Symbol of (DTConOSA X), set , FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:]) -> Subset of [:(TS (DTConOSA X)), the carrier of S:] = @ ($1,$3); let f1, f2 be Function of (TS (DTConOSA X)),(bool [:(TS (DTConOSA X)), the carrier of S:]); ::_thesis: ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds f1 . (root-tree t) = @ t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f1 . (nt -tree ts) = @ (nt,(f1 * ts)) ) & ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds f2 . (root-tree t) = @ t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f2 . (nt -tree ts) = @ (nt,(f2 * ts)) ) implies f1 = f2 ) assume that A1: ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds f1 . (root-tree t) = H1(t) ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f1 . (nt -tree ts) = H2(nt, roots ts,f1 * ts) ) ) and A2: ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds f2 . (root-tree t) = H1(t) ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f2 . (nt -tree ts) = H2(nt, roots ts,f2 * ts) ) ) ; ::_thesis: f1 = f2 thus f1 = f2 from DTCONSTR:sch_9(A1, A2); ::_thesis: verum end; end; :: deftheorem Def21 defines PTClasses OSAFREE:def_21_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for b3 being Function of (TS (DTConOSA X)),(bool [:(TS (DTConOSA X)), the carrier of S:]) holds ( b3 = PTClasses X iff ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds b3 . (root-tree t) = @ t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds b3 . (nt -tree ts) = @ (nt,(b3 * ts)) ) ) ); theorem Th19: :: OSAFREE:19 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) holds ( ( for s being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s iff [t,s] in (PTClasses X) . t ) ) & ( for s being Element of S for y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . y ) ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) holds ( ( for s being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s iff [t,s] in (PTClasses X) . t ) ) & ( for s being Element of S for y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . y ) ) let X be V16() ManySortedSet of S; ::_thesis: for t being Element of TS (DTConOSA X) holds ( ( for s being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s iff [t,s] in (PTClasses X) . t ) ) & ( for s being Element of S for y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . y ) ) let t be Element of TS (DTConOSA X); ::_thesis: ( ( for s being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s iff [t,s] in (PTClasses X) . t ) ) & ( for s being Element of S for y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . y ) ) set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); set D = DTConOSA X; set C = bool [:(TS (DTConOSA X)), the carrier of S:]; set F = PTClasses X; defpred S1[ set ] means for s being Element of S holds ( $1 in the Sorts of (ParsedTermsOSA X) . s iff [$1,s] in (PTClasses X) . $1 ); defpred S2[ set ] means for s being Element of S for y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . $1 holds [$1,s] in (PTClasses X) . y; defpred S3[ DecoratedTree of the carrier of (DTConOSA X)] means ( S1[$1] & S2[$1] ); A1: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S3[t] ) holds S3[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 the carrier of (DTConOSA X) st t in rng ts holds S3[t] ) holds S3[nt -tree ts] let ts be FinSequence of TS (DTConOSA X); ::_thesis: ( nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S3[t] ) implies S3[nt -tree ts] ) assume that A2: nt ==> roots ts and A3: for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds ( S1[t] & S2[t] ) ; ::_thesis: S3[nt -tree ts] consider o being OperSymbol of S such that A4: nt = [o, the carrier of S] and A5: ts in Args (o,(ParsedTermsOSA X)) and A6: nt -tree ts = (Den (o,(ParsedTermsOSA X))) . ts and A7: 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 A2, Th12; reconsider x = (PTClasses X) * ts as FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] ; A8: (PTClasses X) . (nt -tree ts) = @ (nt,x) by A2, Def21 .= { [((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 ) ) ) } ; reconsider ts1 = ts as Element of Args (o,(ParsedTermsOSA X)) by A5; set w = the_arity_of o; A9: rng ts c= TS (DTConOSA X) by FINSEQ_1:def_4; dom (PTClasses X) = TS (DTConOSA X) by FUNCT_2:def_1; then len x = len ts by A9, FINSEQ_2:29; then A10: dom x = dom ts by FINSEQ_3:29; A11: dom (the_arity_of o) = dom ts by A5, MSUALG_3:6; A12: for y being Nat st y in dom x holds [(ts1 . y),((the_arity_of o) /. y)] in x . y proof let y be Nat; ::_thesis: ( y in dom x implies [(ts1 . y),((the_arity_of o) /. y)] in x . y ) assume A13: y in dom x ; ::_thesis: [(ts1 . y),((the_arity_of o) /. y)] in x . y A14: ts1 . y in rng ts1 by A10, A13, FUNCT_1:3; then reconsider t1 = ts1 . y as Element of TS (DTConOSA X) by A9; ts1 . y in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. y) by A10, A11, A13, MSUALG_6:2; then [t1,((the_arity_of o) /. y)] in (PTClasses X) . t1 by A3, A14; hence [(ts1 . y),((the_arity_of o) /. y)] in x . y by A10, A13, FUNCT_1:13; ::_thesis: verum end; thus S1[nt -tree ts] ::_thesis: S2[nt -tree ts] proof let s1 be Element of S; ::_thesis: ( nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 iff [(nt -tree ts),s1] in (PTClasses X) . (nt -tree ts) ) hereby ::_thesis: ( [(nt -tree ts),s1] in (PTClasses X) . (nt -tree ts) implies nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 ) assume nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 ; ::_thesis: [(nt -tree ts),s1] in (PTClasses X) . (nt -tree ts) then A15: the_result_sort_of o <= s1 by A7; len (the_arity_of o) = len (the_arity_of o) ; hence [(nt -tree ts),s1] in (PTClasses X) . (nt -tree ts) by A4, A6, A10, A11, A12, A8, A15; ::_thesis: verum end; assume [(nt -tree ts),s1] in (PTClasses X) . (nt -tree ts) ; ::_thesis: nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 then consider o2 being OperSymbol of S, x2 being Element of Args (o2,(ParsedTermsOSA X)), s3 being Element of S such that A16: [(nt -tree ts),s1] = [((Den (o2,(ParsedTermsOSA X))) . x2),s3] and A17: 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 ) and 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 A8; s1 = s3 by A16, XTUPLE_0:1; then A18: the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) c= the Sorts of (ParsedTermsOSA X) . s1 by A17, OSALG_1:def_16; A19: (Den (o2,(ParsedTermsOSA X))) . x2 in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o2) by MSUALG_9:18; nt -tree ts = (Den (o2,(ParsedTermsOSA X))) . x2 by A16, XTUPLE_0:1; hence nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 by A19, A18; ::_thesis: verum end; thus S2[nt -tree ts] ::_thesis: verum proof let s1 be Element of S; ::_thesis: for y being Element of TS (DTConOSA X) st [y,s1] in (PTClasses X) . (nt -tree ts) holds [(nt -tree ts),s1] in (PTClasses X) . y let y be Element of TS (DTConOSA X); ::_thesis: ( [y,s1] in (PTClasses X) . (nt -tree ts) implies [(nt -tree ts),s1] in (PTClasses X) . y ) assume [y,s1] in (PTClasses X) . (nt -tree ts) ; ::_thesis: [(nt -tree ts),s1] in (PTClasses X) . y then consider o2 being OperSymbol of S, x2 being Element of Args (o2,(ParsedTermsOSA X)), s3 being Element of S such that A20: [y,s1] = [((Den (o2,(ParsedTermsOSA X))) . x2),s3] and A21: 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 ) and A22: 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 A8; consider w3 being Element of the carrier of S * such that A23: dom w3 = dom x and A24: for y being Nat st y in dom x holds [(x2 . y),(w3 /. y)] in x . y by A22; consider o1 being OperSymbol of S such that A25: nt = [o1, the carrier of S] and A26: o1 ~= o2 and A27: len (the_arity_of o1) = len (the_arity_of o2) and A28: the_result_sort_of o1 <= s3 and A29: the_result_sort_of o2 <= s3 by A21; A30: y = (Den (o2,(ParsedTermsOSA X))) . x2 by A20, XTUPLE_0:1; reconsider x3 = x2 as FinSequence of TS (DTConOSA X) by Th13; reconsider xy = (PTClasses X) * x3 as FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] ; A31: OSSym (o2,X) ==> roots x2 by Th13; then consider o3 being OperSymbol of S such that A32: OSSym (o2,X) = [o3, the carrier of S] and x3 in Args (o3,(ParsedTermsOSA X)) and A33: (OSSym (o2,X)) -tree x3 = (Den (o3,(ParsedTermsOSA X))) . x3 and 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 Th12; o2 = o3 by A32, XTUPLE_0:1; then A34: (PTClasses X) . y = @ ((OSSym (o2,X)),xy) by A30, A31, A33, Def21 .= { [((Den (o4,(ParsedTermsOSA X))) . x4),s4] where o4 is OperSymbol of S, x4 is Element of Args (o4,(ParsedTermsOSA X)), s4 is Element of S : ( ex o1 being OperSymbol of S st ( OSSym (o2,X) = [o1, the carrier of S] & o1 ~= o4 & len (the_arity_of o1) = len (the_arity_of o4) & the_result_sort_of o1 <= s4 & the_result_sort_of o4 <= s4 ) & ex w4 being Element of the carrier of S * st ( dom w4 = dom xy & ( for y being Nat st y in dom xy holds [(x4 . y),(w4 /. y)] in xy . y ) ) ) } ; A35: rng x3 c= TS (DTConOSA X) by FINSEQ_1:def_4; then rng x3 c= dom (PTClasses X) by FUNCT_2:def_1; then len xy = len x3 by FINSEQ_2:29; then A36: dom x3 = dom xy by FINSEQ_3:29; A37: o1 = o by A4, A25, XTUPLE_0:1; then A38: dom (the_arity_of o2) = dom (the_arity_of o) by A27, FINSEQ_3:29; then A39: dom w3 = dom xy by A10, A11, A23, A36, MSUALG_3:6; A40: dom x2 = dom x by A10, A11, A38, MSUALG_3:6; A41: for y being Nat st y in dom xy holds [(ts1 . y),(w3 /. y)] in xy . y proof let y be Nat; ::_thesis: ( y in dom xy implies [(ts1 . y),(w3 /. y)] in xy . y ) assume A42: y in dom xy ; ::_thesis: [(ts1 . y),(w3 /. y)] in xy . y A43: ts1 . y in rng ts1 by A10, A23, A39, A42, FUNCT_1:3; x2 . y in rng x3 by A36, A42, FUNCT_1:3; then reconsider t1 = ts1 . y, t2 = x2 . y as Element of TS (DTConOSA X) by A9, A35, A43; [(x2 . y),(w3 /. y)] in x . y by A24, A36, A40, A42; then [(x2 . y),(w3 /. y)] in (PTClasses X) . (ts1 . y) by A10, A23, A39, A42, FUNCT_1:13; then [t1,(w3 /. y)] in (PTClasses X) . t2 by A3, A43; hence [(ts1 . y),(w3 /. y)] in xy . y by A42, FUNCT_1:12; ::_thesis: verum end; A44: the_result_sort_of o2 <= s1 by A20, A29, XTUPLE_0:1; the_result_sort_of o <= s1 by A20, A28, A37, XTUPLE_0:1; hence [(nt -tree ts),s1] in (PTClasses X) . y by A6, A26, A27, A37, A39, A41, A34, A44; ::_thesis: verum end; end; A45: for s being Symbol of (DTConOSA X) st s in Terminals (DTConOSA X) holds S3[ root-tree s] proof let sy be Symbol of (DTConOSA X); ::_thesis: ( sy in Terminals (DTConOSA X) implies S3[ root-tree sy] ) assume A46: sy in Terminals (DTConOSA X) ; ::_thesis: S3[ root-tree sy] reconsider sy1 = sy as Terminal of (DTConOSA X) by A46; consider s being Element of S, x being set such that A47: x in X . s and A48: sy = [x,s] by A46, Th4; A49: (PTClasses X) . (root-tree sy) = @ sy by A46, Def21 .= { [(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 ) } ; root-tree sy1 in { a where a is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s ) ) } by A47, A48; then A50: root-tree sy1 in the Sorts of (ParsedTermsOSA X) . s by Th9; thus S1[ root-tree sy] ::_thesis: S2[ root-tree sy] proof let s1 be Element of S; ::_thesis: ( root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 iff [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) ) hereby ::_thesis: ( [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) implies root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 ) assume root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 ; ::_thesis: [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) then s <= s1 by A47, A48, Th10; hence [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) by A47, A48, A49; ::_thesis: verum end; assume [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) ; ::_thesis: root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 then consider s3 being Element of S such that A51: [(root-tree sy),s1] = [(root-tree sy),s3] and A52: ex s2 being Element of S ex x being set st ( x in X . s2 & sy = [x,s2] & s2 <= s3 ) by A49; A53: s1 = s3 by A51, XTUPLE_0:1; consider s2 being Element of S, x2 being set such that x2 in X . s2 and A54: sy = [x2,s2] and A55: s2 <= s3 by A52; s2 = s by A48, A54, XTUPLE_0:1; then the Sorts of (ParsedTermsOSA X) . s c= the Sorts of (ParsedTermsOSA X) . s1 by A53, A55, OSALG_1:def_16; hence root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 by A50; ::_thesis: verum end; thus S2[ root-tree sy] ::_thesis: verum proof let s1 be Element of S; ::_thesis: for y being Element of TS (DTConOSA X) st [y,s1] in (PTClasses X) . (root-tree sy) holds [(root-tree sy),s1] in (PTClasses X) . y let y be Element of TS (DTConOSA X); ::_thesis: ( [y,s1] in (PTClasses X) . (root-tree sy) implies [(root-tree sy),s1] in (PTClasses X) . y ) assume A56: [y,s1] in (PTClasses X) . (root-tree sy) ; ::_thesis: [(root-tree sy),s1] in (PTClasses X) . y then ex s2 being Element of S st ( [y,s1] = [(root-tree sy),s2] & ex s3 being Element of S ex x being set st ( x in X . s3 & sy = [x,s3] & s3 <= s2 ) ) by A49; then y = root-tree sy by XTUPLE_0:1; hence [(root-tree sy),s1] in (PTClasses X) . y by A56; ::_thesis: verum end; end; for t being DecoratedTree of the carrier of (DTConOSA X) st t in TS (DTConOSA X) holds S3[t] from DTCONSTR:sch_7(A45, A1); hence ( ( for s being Element of S holds ( t in the Sorts of (ParsedTermsOSA X) . s iff [t,s] in (PTClasses X) . t ) ) & ( for s being Element of S for y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . y ) ) ; ::_thesis: verum end; theorem Th20: :: OSAFREE:20 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) for s being Element of S st ex y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . t proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) for s being Element of S st ex y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . t let X be V16() ManySortedSet of S; ::_thesis: for t being Element of TS (DTConOSA X) for s being Element of S st ex y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . t 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 s being Element of S st ex y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . $1 holds [$1,s] in (PTClasses X) . $1; A1: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) st t in rng ts holds S1[t] ) implies S1[nt -tree ts] ) assume that A2: nt ==> roots ts and for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S1[t] ; ::_thesis: S1[nt -tree ts] consider o being OperSymbol of S such that A3: nt = [o, the carrier of S] and A4: ts in Args (o,(ParsedTermsOSA X)) and A5: nt -tree ts = (Den (o,(ParsedTermsOSA X))) . ts and 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 A2, Th12; reconsider x = (PTClasses X) * ts as FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] ; A6: (PTClasses X) . (nt -tree ts) = @ (nt,x) by A2, Def21 .= { [((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 ) ) ) } ; reconsider ts1 = ts as Element of Args (o,(ParsedTermsOSA X)) by A4; set w = the_arity_of o; A7: len (the_arity_of o) = len (the_arity_of o) ; let s1 be Element of S; ::_thesis: ( ex y being Element of TS (DTConOSA X) st [y,s1] in (PTClasses X) . (nt -tree ts) implies [(nt -tree ts),s1] in (PTClasses X) . (nt -tree ts) ) A8: rng ts c= TS (DTConOSA X) by FINSEQ_1:def_4; dom (PTClasses X) = TS (DTConOSA X) by FUNCT_2:def_1; then len x = len ts by A8, FINSEQ_2:29; then A9: dom x = dom ts by FINSEQ_3:29; A10: dom (the_arity_of o) = dom ts by A4, MSUALG_3:6; A11: for y being Nat st y in dom x holds [(ts1 . y),((the_arity_of o) /. y)] in x . y proof let y be Nat; ::_thesis: ( y in dom x implies [(ts1 . y),((the_arity_of o) /. y)] in x . y ) assume A12: y in dom x ; ::_thesis: [(ts1 . y),((the_arity_of o) /. y)] in x . y ts1 . y in rng ts1 by A9, A12, FUNCT_1:3; then reconsider t1 = ts1 . y as Element of TS (DTConOSA X) by A8; ts1 . y in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. y) by A9, A10, A12, MSUALG_6:2; then [t1,((the_arity_of o) /. y)] in (PTClasses X) . t1 by Th19; hence [(ts1 . y),((the_arity_of o) /. y)] in x . y by A9, A12, FUNCT_1:13; ::_thesis: verum end; assume ex y being Element of TS (DTConOSA X) st [y,s1] in (PTClasses X) . (nt -tree ts) ; ::_thesis: [(nt -tree ts),s1] in (PTClasses X) . (nt -tree ts) then consider y being Element of TS (DTConOSA X) such that A13: [y,s1] in (PTClasses X) . (nt -tree ts) ; consider o2 being OperSymbol of S, x2 being Element of Args (o2,(ParsedTermsOSA X)), s3 being Element of S such that A14: [y,s1] = [((Den (o2,(ParsedTermsOSA X))) . x2),s3] and A15: 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 ) and 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 A6, A13; A16: s1 = s3 by A14, XTUPLE_0:1; the_result_sort_of o <= s3 by A3, A15, XTUPLE_0:1; hence [(nt -tree ts),s1] in (PTClasses X) . (nt -tree ts) by A3, A5, A9, A10, A11, A6, A16, A7; ::_thesis: verum end; A17: 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 sy in Terminals (DTConOSA X) ; ::_thesis: S1[ root-tree sy] then A18: (PTClasses X) . (root-tree sy) = @ sy by Def21 .= { [(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 be Element of S; ::_thesis: ( ex y being Element of TS (DTConOSA X) st [y,s1] in (PTClasses X) . (root-tree sy) implies [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) ) assume ex y being Element of TS (DTConOSA X) st [y,s1] in (PTClasses X) . (root-tree sy) ; ::_thesis: [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) then consider y being Element of TS (DTConOSA X) such that A19: [y,s1] in (PTClasses X) . (root-tree sy) ; ex s3 being Element of S st ( [y,s1] = [(root-tree sy),s3] & ex s2 being Element of S ex x being set st ( x in X . s2 & sy = [x,s2] & s2 <= s3 ) ) by A18, A19; hence [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) by A19, XTUPLE_0:1; ::_thesis: verum end; for t being DecoratedTree of the carrier of (DTConOSA X) st t in TS (DTConOSA X) holds S1[t] from DTCONSTR:sch_7(A17, A1); hence for t being Element of TS (DTConOSA X) for s being Element of S st ex y being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . t holds [t,s] in (PTClasses X) . t ; ::_thesis: verum end; theorem Th21: :: OSAFREE:21 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S 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 ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S 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 V16() ManySortedSet of S; ::_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 nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) st t in rng ts holds S1[t] ) implies S1[nt -tree ts] ) assume that A2: nt ==> roots ts and for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S1[t] ; ::_thesis: S1[nt -tree ts] consider o being OperSymbol of S such that A3: nt = [o, the carrier of S] and ts in Args (o,(ParsedTermsOSA X)) and nt -tree ts = (Den (o,(ParsedTermsOSA X))) . ts and A4: 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 A2, Th12; reconsider x = (PTClasses X) * ts as FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] ; 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 that A5: s1 <= s2 and A6: nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 and A7: 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) ) A8: (PTClasses X) . (nt -tree ts) = @ (nt,x) by A2, Def21 .= { [((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 ) ) ) } ; hereby ::_thesis: ( [y,s2] in (PTClasses X) . (nt -tree ts) implies [y,s1] in (PTClasses X) . (nt -tree ts) ) reconsider s21 = s2 as Element of S ; 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 A9: [y,s1] = [((Den (o2,(ParsedTermsOSA X))) . x2),s3] and A10: 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 ) and A11: 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 A8; consider o1 being OperSymbol of S such that A12: nt = [o1, the carrier of S] and A13: o1 ~= o2 and A14: len (the_arity_of o1) = len (the_arity_of o2) and A15: the_result_sort_of o1 <= s3 and A16: the_result_sort_of o2 <= s3 by A10; A17: y = (Den (o2,(ParsedTermsOSA X))) . x2 by A9, XTUPLE_0:1; A18: s1 = s3 by A9, XTUPLE_0:1; then A19: the_result_sort_of o2 <= s21 by A5, A16, ORDERS_2:3; the_result_sort_of o1 <= s21 by A5, A18, A15, ORDERS_2:3; hence [y,s2] in (PTClasses X) . (nt -tree ts) by A8, A11, A17, A12, A13, A14, A19; ::_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 A20: [y,s2] = [((Den (o2,(ParsedTermsOSA X))) . x2),s3] and A21: 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 ) and A22: 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 A8; reconsider x3 = x2 as FinSequence of TS (DTConOSA X) by Th13; OSSym (o2,X) ==> roots x2 by Th13; then consider o3 being OperSymbol of S such that A23: OSSym (o2,X) = [o3, the carrier of S] and x3 in Args (o3,(ParsedTermsOSA X)) and A24: (OSSym (o2,X)) -tree x3 = (Den (o3,(ParsedTermsOSA X))) . x3 and A25: 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 Th12; A26: y = (Den (o2,(ParsedTermsOSA X))) . x2 by A20, XTUPLE_0:1; o2 = o3 by A23, XTUPLE_0:1; then A27: the_result_sort_of o2 <= s1 by A7, A26, A24, A25; consider o1 being OperSymbol of S such that A28: nt = [o1, the carrier of S] and A29: o1 ~= o2 and A30: len (the_arity_of o1) = len (the_arity_of o2) and the_result_sort_of o1 <= s3 and the_result_sort_of o2 <= s3 by A21; the_result_sort_of o <= s1 by A4, A6; then the_result_sort_of o1 <= s1 by A3, A28, XTUPLE_0:1; hence [y,s1] in (PTClasses X) . (nt -tree ts) by A8, A22, A26, A28, A29, A30, A27; ::_thesis: verum end; A31: 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 A32: sy in Terminals (DTConOSA X) ; ::_thesis: S1[ root-tree sy] reconsider sy1 = sy as Terminal of (DTConOSA X) by A32; A33: (PTClasses X) . (root-tree sy) = @ sy by A32, Def21 .= { [(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 that A34: s1 <= s2 and A35: root-tree sy in the Sorts of (ParsedTermsOSA X) . s1 and 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) ) the Sorts of (ParsedTermsOSA X) . s1 c= the Sorts of (ParsedTermsOSA X) . s2 by A34, OSALG_1:def_16; then A36: [(root-tree sy1),s2] in (PTClasses X) . (root-tree sy) by A35, Th19; 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 ex s3 being Element of S st ( [y,s1] = [(root-tree sy),s3] & ex s2 being Element of S ex x being set st ( x in X . s2 & sy = [x,s2] & s2 <= s3 ) ) by A33; hence [y,s2] in (PTClasses X) . (root-tree sy) by A36, XTUPLE_0:1; ::_thesis: verum end; assume [y,s2] in (PTClasses X) . (root-tree sy) ; ::_thesis: [y,s1] in (PTClasses X) . (root-tree sy) then A37: ex s3 being Element of S st ( [y,s2] = [(root-tree sy),s3] & ex s4 being Element of S ex x being set st ( x in X . s4 & sy = [x,s4] & s4 <= s3 ) ) by A33; [(root-tree sy1),s1] in (PTClasses X) . (root-tree sy) by A35, Th19; hence [y,s1] in (PTClasses X) . (root-tree sy) by A37, XTUPLE_0:1; ::_thesis: verum end; for t being DecoratedTree of the carrier of (DTConOSA X) st t in TS (DTConOSA X) holds S1[t] from DTCONSTR:sch_7(A31, A1); 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 end; theorem Th22: :: OSAFREE:22 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for x, y, z being Element of TS (DTConOSA X) for s being Element of S st [y,s] in (PTClasses X) . x & [z,s] in (PTClasses X) . y holds [x,s] in (PTClasses X) . z proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for x, y, z being Element of TS (DTConOSA X) for s being Element of S st [y,s] in (PTClasses X) . x & [z,s] in (PTClasses X) . y holds [x,s] in (PTClasses X) . z let X be V16() ManySortedSet of S; ::_thesis: for x, y, z being Element of TS (DTConOSA X) for s being Element of S st [y,s] in (PTClasses X) . x & [z,s] in (PTClasses X) . y holds [x,s] in (PTClasses X) . z 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 s being Element of S for y, z being Element of TS (DTConOSA X) st [y,s] in (PTClasses X) . $1 & [z,s] in (PTClasses X) . y holds [$1,s] in (PTClasses X) . z; A1: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) st t in rng ts holds S1[t] ) implies S1[nt -tree ts] ) assume that A2: nt ==> roots ts and A3: for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S1[t] ; ::_thesis: S1[nt -tree ts] consider o being OperSymbol of S such that A4: nt = [o, the carrier of S] and A5: ts in Args (o,(ParsedTermsOSA X)) and A6: nt -tree ts = (Den (o,(ParsedTermsOSA X))) . ts and 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 A2, Th12; reconsider ts1 = ts as Element of Args (o,(ParsedTermsOSA X)) by A5; set w = the_arity_of o; A7: dom (the_arity_of o) = dom ts by A5, MSUALG_3:6; reconsider x = (PTClasses X) * ts as FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] ; A8: rng ts c= TS (DTConOSA X) by FINSEQ_1:def_4; dom (PTClasses X) = TS (DTConOSA X) by FUNCT_2:def_1; then len x = len ts by A8, FINSEQ_2:29; then A9: dom x = dom ts by FINSEQ_3:29; A10: (PTClasses X) . (nt -tree ts) = @ (nt,x) by A2, Def21 .= { [((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 ) ) ) } ; thus S1[nt -tree ts] ::_thesis: verum proof let s1 be Element of S; ::_thesis: for y, z being Element of TS (DTConOSA X) st [y,s1] in (PTClasses X) . (nt -tree ts) & [z,s1] in (PTClasses X) . y holds [(nt -tree ts),s1] in (PTClasses X) . z let y, z be Element of TS (DTConOSA X); ::_thesis: ( [y,s1] in (PTClasses X) . (nt -tree ts) & [z,s1] in (PTClasses X) . y implies [(nt -tree ts),s1] in (PTClasses X) . z ) assume that A11: [y,s1] in (PTClasses X) . (nt -tree ts) and A12: [z,s1] in (PTClasses X) . y ; ::_thesis: [(nt -tree ts),s1] in (PTClasses X) . z consider o2 being OperSymbol of S, x2 being Element of Args (o2,(ParsedTermsOSA X)), s3 being Element of S such that A13: [y,s1] = [((Den (o2,(ParsedTermsOSA X))) . x2),s3] and A14: 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 ) and A15: 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 A10, A11; A16: y = (Den (o2,(ParsedTermsOSA X))) . x2 by A13, XTUPLE_0:1; reconsider x3 = x2 as FinSequence of TS (DTConOSA X) by Th13; reconsider xy = (PTClasses X) * x3 as FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] ; A17: OSSym (o2,X) ==> roots x2 by Th13; then consider o3 being OperSymbol of S such that A18: OSSym (o2,X) = [o3, the carrier of S] and x3 in Args (o3,(ParsedTermsOSA X)) and A19: (OSSym (o2,X)) -tree x3 = (Den (o3,(ParsedTermsOSA X))) . x3 and 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 Th12; o2 = o3 by A18, XTUPLE_0:1; then (PTClasses X) . y = @ ((OSSym (o2,X)),xy) by A16, A17, A19, Def21 .= { [((Den (o4,(ParsedTermsOSA X))) . x4),s4] where o4 is OperSymbol of S, x4 is Element of Args (o4,(ParsedTermsOSA X)), s4 is Element of S : ( ex o1 being OperSymbol of S st ( OSSym (o2,X) = [o1, the carrier of S] & o1 ~= o4 & len (the_arity_of o1) = len (the_arity_of o4) & the_result_sort_of o1 <= s4 & the_result_sort_of o4 <= s4 ) & ex w4 being Element of the carrier of S * st ( dom w4 = dom xy & ( for y being Nat st y in dom xy holds [(x4 . y),(w4 /. y)] in xy . y ) ) ) } ; then consider o5 being OperSymbol of S, x5 being Element of Args (o5,(ParsedTermsOSA X)), s5 being Element of S such that A20: [z,s1] = [((Den (o5,(ParsedTermsOSA X))) . x5),s5] and A21: ex o1 being OperSymbol of S st ( OSSym (o2,X) = [o1, the carrier of S] & o1 ~= o5 & len (the_arity_of o1) = len (the_arity_of o5) & the_result_sort_of o1 <= s5 & the_result_sort_of o5 <= s5 ) and A22: ex w3 being Element of the carrier of S * st ( dom w3 = dom xy & ( for y being Nat st y in dom xy holds [(x5 . y),(w3 /. y)] in xy . y ) ) by A12; consider o6 being OperSymbol of S such that A23: OSSym (o2,X) = [o6, the carrier of S] and A24: o6 ~= o5 and A25: len (the_arity_of o6) = len (the_arity_of o5) and the_result_sort_of o6 <= s5 and A26: the_result_sort_of o5 <= s5 by A21; A27: the_result_sort_of o5 <= s1 by A20, A26, XTUPLE_0:1; reconsider x6 = x5 as FinSequence of TS (DTConOSA X) by Th13; reconsider xz = (PTClasses X) * x6 as FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] ; defpred S2[ set , set ] means [(ts1 . $1),$2] in xz . $1; rng x3 c= TS (DTConOSA X) by FINSEQ_1:def_4; then rng x3 c= dom (PTClasses X) by FUNCT_2:def_1; then len xy = len x3 by FINSEQ_2:29; then A28: dom x3 = dom xy by FINSEQ_3:29; consider w5 being Element of the carrier of S * such that dom w5 = dom xy and A29: for y being Nat st y in dom xy holds [(x5 . y),(w5 /. y)] in xy . y by A22; consider w3 being Element of the carrier of S * such that dom w3 = dom x and A30: for y being Nat st y in dom x holds [(x2 . y),(w3 /. y)] in x . y by A15; A31: z = (Den (o5,(ParsedTermsOSA X))) . x5 by A20, XTUPLE_0:1; A32: OSSym (o5,X) ==> roots x5 by Th13; then consider o7 being OperSymbol of S such that A33: OSSym (o5,X) = [o7, the carrier of S] and x6 in Args (o7,(ParsedTermsOSA X)) and A34: (OSSym (o5,X)) -tree x6 = (Den (o7,(ParsedTermsOSA X))) . x6 and for s2 being Element of S holds ( (OSSym (o5,X)) -tree x6 in the Sorts of (ParsedTermsOSA X) . s2 iff the_result_sort_of o7 <= s2 ) by Th12; o5 = o7 by A33, XTUPLE_0:1; then A35: (PTClasses X) . z = @ ((OSSym (o5,X)),xz) by A31, A32, A34, Def21 .= { [((Den (o4,(ParsedTermsOSA X))) . x4),s4] where o4 is OperSymbol of S, x4 is Element of Args (o4,(ParsedTermsOSA X)), s4 is Element of S : ( ex o1 being OperSymbol of S st ( OSSym (o5,X) = [o1, the carrier of S] & o1 ~= o4 & len (the_arity_of o1) = len (the_arity_of o4) & the_result_sort_of o1 <= s4 & the_result_sort_of o4 <= s4 ) & ex w4 being Element of the carrier of S * st ( dom w4 = dom xz & ( for y being Nat st y in dom xz holds [(x4 . y),(w4 /. y)] in xz . y ) ) ) } ; consider o1 being OperSymbol of S such that A36: nt = [o1, the carrier of S] and A37: o1 ~= o2 and A38: len (the_arity_of o1) = len (the_arity_of o2) and A39: the_result_sort_of o1 <= s3 and the_result_sort_of o2 <= s3 by A14; A40: o1 = o by A4, A36, XTUPLE_0:1; then A41: the_result_sort_of o <= s1 by A13, A39, XTUPLE_0:1; A42: dom (the_arity_of o2) = dom (the_arity_of o) by A38, A40, FINSEQ_3:29; then A43: dom x2 = dom x by A9, A7, MSUALG_3:6; A44: rng x6 c= TS (DTConOSA X) by FINSEQ_1:def_4; then rng x6 c= dom (PTClasses X) by FUNCT_2:def_1; then len xz = len x6 by FINSEQ_2:29; then A45: dom x6 = dom xz by FINSEQ_3:29; A46: o6 = o2 by A23, XTUPLE_0:1; then dom (the_arity_of o5) = dom (the_arity_of o2) by A25, FINSEQ_3:29; then A47: dom x5 = dom (the_arity_of o2) by MSUALG_3:6 .= dom xy by A28, MSUALG_3:6 ; A48: rng x3 c= TS (DTConOSA X) by FINSEQ_1:def_4; A49: for y being set st y in dom xz holds ex sy being set st ( sy in the carrier of S & S2[y,sy] ) proof let y be set ; ::_thesis: ( y in dom xz implies ex sy being set st ( sy in the carrier of S & S2[y,sy] ) ) assume A50: y in dom xz ; ::_thesis: ex sy being set st ( sy in the carrier of S & S2[y,sy] ) A51: x5 . y in rng x6 by A45, A50, FUNCT_1:3; A52: x2 . y in rng x3 by A28, A45, A47, A50, FUNCT_1:3; ts1 . y in rng ts1 by A9, A28, A43, A45, A47, A50, FUNCT_1:3; then reconsider t1 = ts1 . y, t2 = x3 . y, t3 = x5 . y as Element of TS (DTConOSA X) by A8, A44, A48, A51, A52; A53: [(x2 . y),(w3 /. y)] in x . y by A30, A28, A43, A45, A47, A50; y in dom ts1 by A7, A42, A28, A45, A47, A50, MSUALG_3:6; then A54: [t2,(w3 /. y)] in (PTClasses X) . t1 by A53, FUNCT_1:13; then [t1,(w3 /. y)] in (PTClasses X) . t1 by Th20; then A55: t1 in the Sorts of (ParsedTermsOSA X) . (w3 /. y) by Th19; [t1,(w3 /. y)] in (PTClasses X) . t2 by A54, Th19; then [t2,(w3 /. y)] in (PTClasses X) . t2 by Th20; then A56: t2 in the Sorts of (ParsedTermsOSA X) . (w3 /. y) by Th19; then A57: LeastSort t2 <= w3 /. y by Def12; [(x5 . y),(w5 /. y)] in xy . y by A29, A45, A47, A50; then A58: [t3,(w5 /. y)] in (PTClasses X) . t2 by A28, A45, A47, A50, FUNCT_1:13; then [t2,(w5 /. y)] in (PTClasses X) . t2 by Th20; then A59: t2 in the Sorts of (ParsedTermsOSA X) . (w5 /. y) by Th19; then LeastSort t2 <= w5 /. y by Def12; then consider s7 being Element of S such that A60: w5 /. y <= s7 and A61: w3 /. y <= s7 by A57, OSALG_4:11; [t2,(w5 /. y)] in (PTClasses X) . t3 by A58, Th19; then [t3,(w5 /. y)] in (PTClasses X) . t3 by Th20; then t3 in the Sorts of (ParsedTermsOSA X) . (w5 /. y) by Th19; then A62: [t3,s7] in (PTClasses X) . t2 by A58, A59, A60, Th21; take s7 ; ::_thesis: ( s7 in the carrier of S & S2[y,s7] ) thus s7 in the carrier of S ; ::_thesis: S2[y,s7] [(x2 . y),(w3 /. y)] in (PTClasses X) . (ts1 . y) by A9, A28, A43, A45, A47, A50, A53, FUNCT_1:13; then [t2,s7] in (PTClasses X) . t1 by A56, A55, A61, Th21; then [t1,s7] in (PTClasses X) . t3 by A3, A9, A28, A43, A45, A47, A50, A62, FUNCT_1:3; hence S2[y,s7] by A50, FUNCT_1:12; ::_thesis: verum end; consider f being Function of (dom xz), the carrier of S such that A63: for y being set st y in dom xz holds S2[y,f . y] from FUNCT_2:sch_1(A49); A64: dom f = dom xz by FUNCT_2:def_1; then ex n being Nat st dom f = Seg n by FINSEQ_1:def_2; then reconsider f1 = f as FinSequence by FINSEQ_1:def_2; rng f c= the carrier of S by RELAT_1:def_19; then f1 is FinSequence of the carrier of S by FINSEQ_1:def_4; then reconsider f = f as Element of the carrier of S * by FINSEQ_1:def_11; A65: ( dom f = dom xz & ( for y being Nat st y in dom xz holds [(ts1 . y),(f /. y)] in xz . y ) ) proof thus dom f = dom xz by FUNCT_2:def_1; ::_thesis: for y being Nat st y in dom xz holds [(ts1 . y),(f /. y)] in xz . y let y be Nat; ::_thesis: ( y in dom xz implies [(ts1 . y),(f /. y)] in xz . y ) assume A66: y in dom xz ; ::_thesis: [(ts1 . y),(f /. y)] in xz . y [(ts1 . y),(f . y)] in xz . y by A63, A66; hence [(ts1 . y),(f /. y)] in xz . y by A64, A66, PARTFUN1:def_6; ::_thesis: verum end; o5 ~= o by A37, A40, A24, A46, OSALG_1:2; hence [(nt -tree ts),s1] in (PTClasses X) . z by A6, A38, A40, A25, A46, A65, A35, A27, A41; ::_thesis: verum end; end; A67: 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 sy in Terminals (DTConOSA X) ; ::_thesis: S1[ root-tree sy] then A68: (PTClasses X) . (root-tree sy) = @ sy by Def21 .= { [(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 ) } ; thus S1[ root-tree sy] ::_thesis: verum proof let s1 be Element of S; ::_thesis: for y, z being Element of TS (DTConOSA X) st [y,s1] in (PTClasses X) . (root-tree sy) & [z,s1] in (PTClasses X) . y holds [(root-tree sy),s1] in (PTClasses X) . z let y, z be Element of TS (DTConOSA X); ::_thesis: ( [y,s1] in (PTClasses X) . (root-tree sy) & [z,s1] in (PTClasses X) . y implies [(root-tree sy),s1] in (PTClasses X) . z ) assume that A69: [y,s1] in (PTClasses X) . (root-tree sy) and A70: [z,s1] in (PTClasses X) . y ; ::_thesis: [(root-tree sy),s1] in (PTClasses X) . z ex s2 being Element of S st ( [y,s1] = [(root-tree sy),s2] & ex s0 being Element of S ex x being set st ( x in X . s0 & sy = [x,s0] & s0 <= s2 ) ) by A68, A69; then A71: y = root-tree sy by XTUPLE_0:1; then ex s3 being Element of S st ( [z,s1] = [(root-tree sy),s3] & ex s0 being Element of S ex x being set st ( x in X . s0 & sy = [x,s0] & s0 <= s3 ) ) by A68, A70; hence [(root-tree sy),s1] in (PTClasses X) . z by A69, A71, XTUPLE_0:1; ::_thesis: verum end; end; for t being DecoratedTree of the carrier of (DTConOSA X) st t in TS (DTConOSA X) holds S1[t] from DTCONSTR:sch_7(A67, A1); hence for x, y, z being Element of TS (DTConOSA X) for s being Element of S st [y,s] in (PTClasses X) . x & [z,s] in (PTClasses X) . y holds [x,s] in (PTClasses X) . z ; ::_thesis: verum end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func PTCongruence X -> MSEquivalence-like OrderSortedRelation of ParsedTermsOSA X means :Def22: :: OSAFREE:def 22 for i being set st i in the carrier of S holds it . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } ; existence ex b1 being MSEquivalence-like OrderSortedRelation of ParsedTermsOSA X st for i being set st i in the carrier of S holds b1 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } proof set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); set D = DTConOSA X; set F = PTClasses X; deffunc H1( set ) -> set = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,$1] in (PTClasses X) . y } ; consider R being ManySortedSet of the carrier of S such that A1: for i being set st i in the carrier of S holds R . i = H1(i) from PBOOLE:sch_4(); for i being set st i in the carrier of S holds R . i is Relation of ( the Sorts of (ParsedTermsOSA X) . i) proof let i be set ; ::_thesis: ( i in the carrier of S implies R . i is Relation of ( the Sorts of (ParsedTermsOSA X) . i) ) assume A2: i in the carrier of S ; ::_thesis: R . i is Relation of ( the Sorts of (ParsedTermsOSA X) . i) reconsider s = i as Element of S by A2; A3: R . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } by A1, A2; R . s c= [:( the Sorts of (ParsedTermsOSA X) . s),( the Sorts of (ParsedTermsOSA X) . s):] proof let z be set ; :: according to TARSKI:def_3 ::_thesis: ( not z in R . s or z in [:( the Sorts of (ParsedTermsOSA X) . s),( the Sorts of (ParsedTermsOSA X) . s):] ) assume z in R . s ; ::_thesis: z in [:( the Sorts of (ParsedTermsOSA X) . s),( the Sorts of (ParsedTermsOSA X) . s):] then consider x, y being Element of TS (DTConOSA X) such that A4: z = [x,y] and A5: [x,s] in (PTClasses X) . y by A3; [y,s] in (PTClasses X) . x by A5, Th19; then [x,s] in (PTClasses X) . x by Th20; then A6: x in the Sorts of (ParsedTermsOSA X) . s by Th19; [y,s] in (PTClasses X) . y by A5, Th20; then y in the Sorts of (ParsedTermsOSA X) . s by Th19; hence z in [:( the Sorts of (ParsedTermsOSA X) . s),( the Sorts of (ParsedTermsOSA X) . s):] by A4, A6, ZFMISC_1:87; ::_thesis: verum end; hence R . i is Relation of ( the Sorts of (ParsedTermsOSA X) . i) ; ::_thesis: verum end; then reconsider R = R as ManySortedRelation of (ParsedTermsOSA X) by MSUALG_4:def_1; for s1, s2 being Element of S st s1 <= s2 holds for x, y being set st x in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds ( [x,y] in R . s1 iff [x,y] in R . s2 ) proof let s1, s2 be Element of S; ::_thesis: ( s1 <= s2 implies for x, y being set st x in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds ( [x,y] in R . s1 iff [x,y] in R . s2 ) ) assume A7: s1 <= s2 ; ::_thesis: for x, y being set st x in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 holds ( [x,y] in R . s1 iff [x,y] in R . s2 ) A8: R . s1 = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,s1] in (PTClasses X) . y } by A1; A9: R . s2 = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,s2] in (PTClasses X) . y } by A1; let x, y be set ; ::_thesis: ( x in the Sorts of (ParsedTermsOSA X) . s1 & y in the Sorts of (ParsedTermsOSA X) . s1 implies ( [x,y] in R . s1 iff [x,y] in R . s2 ) ) assume that A10: x in the Sorts of (ParsedTermsOSA X) . s1 and A11: y in the Sorts of (ParsedTermsOSA X) . s1 ; ::_thesis: ( [x,y] in R . s1 iff [x,y] in R . s2 ) hereby ::_thesis: ( [x,y] in R . s2 implies [x,y] in R . s1 ) assume [x,y] in R . s1 ; ::_thesis: [x,y] in R . s2 then consider t1, t2 being Element of TS (DTConOSA X) such that A12: [x,y] = [t1,t2] and A13: [t1,s1] in (PTClasses X) . t2 by A8; A14: y = t2 by A12, XTUPLE_0:1; x = t1 by A12, XTUPLE_0:1; then [t1,s2] in (PTClasses X) . t2 by A7, A10, A11, A13, A14, Th21; hence [x,y] in R . s2 by A9, A12; ::_thesis: verum end; assume [x,y] in R . s2 ; ::_thesis: [x,y] in R . s1 then consider t1, t2 being Element of TS (DTConOSA X) such that A15: [x,y] = [t1,t2] and A16: [t1,s2] in (PTClasses X) . t2 by A9; A17: y = t2 by A15, XTUPLE_0:1; x = t1 by A15, XTUPLE_0:1; then [t1,s1] in (PTClasses X) . t2 by A7, A10, A11, A16, A17, Th21; hence [x,y] in R . s1 by A8, A15; ::_thesis: verum end; then A18: R is os-compatible by OSALG_4:def_1; defpred S1[ Element of TS (DTConOSA X), Element of S] means ( ex s1 being Element of S ex x being set st ( s1 <= $2 & x in X . s1 & $1 = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = $1 . {} & the_result_sort_of o <= $2 ) ); reconsider R = R as OrderSortedRelation of ParsedTermsOSA X by A18, OSALG_4:def_2; for i being set for Ri being Relation of ( the Sorts of (ParsedTermsOSA X) . i) st i in the carrier of S & R . i = Ri holds Ri is total symmetric transitive Relation of ( the Sorts of (ParsedTermsOSA X) . i) proof let i be set ; ::_thesis: for Ri being Relation of ( the Sorts of (ParsedTermsOSA X) . i) st i in the carrier of S & R . i = Ri holds Ri is total symmetric transitive Relation of ( the Sorts of (ParsedTermsOSA X) . i) let Ri be Relation of ( the Sorts of (ParsedTermsOSA X) . i); ::_thesis: ( i in the carrier of S & R . i = Ri implies Ri is total symmetric transitive Relation of ( the Sorts of (ParsedTermsOSA X) . i) ) assume that A19: i in the carrier of S and A20: R . i = Ri ; ::_thesis: Ri is total symmetric transitive Relation of ( the Sorts of (ParsedTermsOSA X) . i) reconsider s = i as Element of S by A19; A21: Ri = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } by A1, A19, A20; for x, y being set st x in the Sorts of (ParsedTermsOSA X) . i & y in the Sorts of (ParsedTermsOSA X) . i & [x,y] in Ri holds [y,x] in Ri proof let x, y be set ; ::_thesis: ( x in the Sorts of (ParsedTermsOSA X) . i & y in the Sorts of (ParsedTermsOSA X) . i & [x,y] in Ri implies [y,x] in Ri ) assume that x in the Sorts of (ParsedTermsOSA X) . i and y in the Sorts of (ParsedTermsOSA X) . i and A22: [x,y] in Ri ; ::_thesis: [y,x] in Ri consider t1, t2 being Element of TS (DTConOSA X) such that A23: [x,y] = [t1,t2] and A24: [t1,s] in (PTClasses X) . t2 by A21, A22; A25: x = t1 by A23, XTUPLE_0:1; A26: y = t2 by A23, XTUPLE_0:1; [t2,s] in (PTClasses X) . t1 by A24, Th19; hence [y,x] in Ri by A21, A25, A26; ::_thesis: verum end; then A27: Ri is_symmetric_in the Sorts of (ParsedTermsOSA X) . i by RELAT_2:def_3; now__::_thesis:_for_x,_y,_z_being_set_st_x_in_the_Sorts_of_(ParsedTermsOSA_X)_._i_&_y_in_the_Sorts_of_(ParsedTermsOSA_X)_._i_&_z_in_the_Sorts_of_(ParsedTermsOSA_X)_._i_&_[x,y]_in_Ri_&_[y,z]_in_Ri_holds_ [x,z]_in_Ri let x, y, z be set ; ::_thesis: ( x in the Sorts of (ParsedTermsOSA X) . i & y in the Sorts of (ParsedTermsOSA X) . i & z in the Sorts of (ParsedTermsOSA X) . i & [x,y] in Ri & [y,z] in Ri implies [x,z] in Ri ) assume that x in the Sorts of (ParsedTermsOSA X) . i and y in the Sorts of (ParsedTermsOSA X) . i and z in the Sorts of (ParsedTermsOSA X) . i and A28: [x,y] in Ri and A29: [y,z] in Ri ; ::_thesis: [x,z] in Ri consider t1, t2 being Element of TS (DTConOSA X) such that A30: [x,y] = [t1,t2] and A31: [t1,s] in (PTClasses X) . t2 by A21, A28; A32: [t2,s] in (PTClasses X) . t1 by A31, Th19; consider t22, t3 being Element of TS (DTConOSA X) such that A33: [y,z] = [t22,t3] and A34: [t22,s] in (PTClasses X) . t3 by A21, A29; A35: y = t22 by A33, XTUPLE_0:1; y = t2 by A30, XTUPLE_0:1; then [t3,s] in (PTClasses X) . t2 by A34, A35, Th19; then A36: [t1,s] in (PTClasses X) . t3 by A32, Th22; A37: z = t3 by A33, XTUPLE_0:1; x = t1 by A30, XTUPLE_0:1; hence [x,z] in Ri by A21, A37, A36; ::_thesis: verum end; then A38: Ri is_transitive_in the Sorts of (ParsedTermsOSA X) . i by RELAT_2:def_8; A39: the Sorts of (ParsedTermsOSA X) . s = { a where a is Element of TS (DTConOSA X) : S1[a,s] } by Th9; now__::_thesis:_for_x_being_set_st_x_in_the_Sorts_of_(ParsedTermsOSA_X)_._i_holds_ [x,x]_in_Ri let x be set ; ::_thesis: ( x in the Sorts of (ParsedTermsOSA X) . i implies [x,x] in Ri ) assume A40: x in the Sorts of (ParsedTermsOSA X) . i ; ::_thesis: [x,x] in Ri consider t being Element of TS (DTConOSA X) such that A41: x = t and S1[t,s] by A39, A40; [t,s] in (PTClasses X) . t by A40, A41, Th19; hence [x,x] in Ri by A21, A41; ::_thesis: verum end; then A42: Ri is_reflexive_in the Sorts of (ParsedTermsOSA X) . i by RELAT_2:def_1; then A43: field Ri = the Sorts of (ParsedTermsOSA X) . i by ORDERS_1:13; dom Ri = the Sorts of (ParsedTermsOSA X) . i by A42, ORDERS_1:13; hence Ri is total symmetric transitive Relation of ( the Sorts of (ParsedTermsOSA X) . i) by A43, A27, A38, PARTFUN1:def_2, RELAT_2:def_11, RELAT_2:def_16; ::_thesis: verum end; then R is MSEquivalence_Relation-like by MSUALG_4:def_2; then reconsider R = R as MSEquivalence-like OrderSortedRelation of ParsedTermsOSA X by MSUALG_4:def_3; take R ; ::_thesis: for i being set st i in the carrier of S holds R . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } thus for i being set st i in the carrier of S holds R . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } by A1; ::_thesis: verum end; uniqueness for b1, b2 being MSEquivalence-like OrderSortedRelation of ParsedTermsOSA X st ( for i being set st i in the carrier of S holds b1 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } ) & ( for i being set st i in the carrier of S holds b2 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } ) holds b1 = b2 proof set D = DTConOSA X; set F = PTClasses X; let R1, R2 be MSEquivalence-like OrderSortedRelation of ParsedTermsOSA X; ::_thesis: ( ( for i being set st i in the carrier of S holds R1 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } ) & ( for i being set st i in the carrier of S holds R2 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } ) implies R1 = R2 ) assume that A44: for i being set st i in the carrier of S holds R1 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } and A45: for i being set st i in the carrier of S holds R2 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } ; ::_thesis: R1 = R2 now__::_thesis:_for_i_being_set_st_i_in_the_carrier_of_S_holds_ R1_._i_=_R2_._i let i be set ; ::_thesis: ( i in the carrier of S implies R1 . i = R2 . i ) assume A46: i in the carrier of S ; ::_thesis: R1 . i = R2 . i R1 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } by A44, A46; hence R1 . i = R2 . i by A45, A46; ::_thesis: verum end; hence R1 = R2 by PBOOLE:3; ::_thesis: verum end; end; :: deftheorem Def22 defines PTCongruence OSAFREE:def_22_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for b3 being MSEquivalence-like OrderSortedRelation of ParsedTermsOSA X holds ( b3 = PTCongruence X iff for i being set st i in the carrier of S holds b3 . i = { [x,y] where x, y is Element of TS (DTConOSA X) : [x,i] in (PTClasses X) . y } ); theorem Th23: :: OSAFREE:23 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for x, y, s being set st [x,s] in (PTClasses X) . y holds ( x in TS (DTConOSA X) & y in TS (DTConOSA X) & s in the carrier of S ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for x, y, s being set st [x,s] in (PTClasses X) . y holds ( x in TS (DTConOSA X) & y in TS (DTConOSA X) & s in the carrier of S ) let X be V16() ManySortedSet of S; ::_thesis: for x, y, s being set st [x,s] in (PTClasses X) . y holds ( x in TS (DTConOSA X) & y in TS (DTConOSA X) & s in the carrier of S ) set D = DTConOSA X; set F = PTClasses X; A1: rng (PTClasses X) c= bool [:(TS (DTConOSA X)), the carrier of S:] by RELAT_1:def_19; let x, y, s be set ; ::_thesis: ( [x,s] in (PTClasses X) . y implies ( x in TS (DTConOSA X) & y in TS (DTConOSA X) & s in the carrier of S ) ) assume A2: [x,s] in (PTClasses X) . y ; ::_thesis: ( x in TS (DTConOSA X) & y in TS (DTConOSA X) & s in the carrier of S ) A3: y in TS (DTConOSA X) proof assume not y in TS (DTConOSA X) ; ::_thesis: contradiction then not y in dom (PTClasses X) ; hence contradiction by A2, FUNCT_1:def_2; ::_thesis: verum end; dom (PTClasses X) = TS (DTConOSA X) by FUNCT_2:def_1; then (PTClasses X) . y in rng (PTClasses X) by A3, FUNCT_1:3; hence ( x in TS (DTConOSA X) & y in TS (DTConOSA X) & s in the carrier of S ) by A2, A1, A3, ZFMISC_1:87; ::_thesis: verum end; theorem Th24: :: OSAFREE:24 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for C being Component of S for x, y being set holds ( [x,y] in CompClass ((PTCongruence X),C) iff ex s1 being Element of S st ( s1 in C & [x,s1] in (PTClasses X) . y ) ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for C being Component of S for x, y being set holds ( [x,y] in CompClass ((PTCongruence X),C) iff ex s1 being Element of S st ( s1 in C & [x,s1] in (PTClasses X) . y ) ) let X be V16() ManySortedSet of S; ::_thesis: for C being Component of S for x, y being set holds ( [x,y] in CompClass ((PTCongruence X),C) iff ex s1 being Element of S st ( s1 in C & [x,s1] in (PTClasses X) . y ) ) let C be Component of S; ::_thesis: for x, y being set holds ( [x,y] in CompClass ((PTCongruence X),C) iff ex s1 being Element of S st ( s1 in C & [x,s1] in (PTClasses X) . y ) ) let x, y be set ; ::_thesis: ( [x,y] in CompClass ((PTCongruence X),C) iff ex s1 being Element of S st ( s1 in C & [x,s1] in (PTClasses X) . y ) ) hereby ::_thesis: ( ex s1 being Element of S st ( s1 in C & [x,s1] in (PTClasses X) . y ) implies [x,y] in CompClass ((PTCongruence X),C) ) assume [x,y] in CompClass ((PTCongruence X),C) ; ::_thesis: ex s1 being Element of S st ( s1 in C & [x,s1] in (PTClasses X) . y ) then consider s1 being Element of S such that A1: s1 in C and A2: [x,y] in (PTCongruence X) . s1 by OSALG_4:def_9; A3: [x,y] in { [x1,y1] where x1, y1 is Element of TS (DTConOSA X) : [x1,s1] in (PTClasses X) . y1 } by A2, Def22; take s1 = s1; ::_thesis: ( s1 in C & [x,s1] in (PTClasses X) . y ) consider x1, y1 being Element of TS (DTConOSA X) such that A4: [x,y] = [x1,y1] and A5: [x1,s1] in (PTClasses X) . y1 by A3; x = x1 by A4, XTUPLE_0:1; hence ( s1 in C & [x,s1] in (PTClasses X) . y ) by A1, A4, A5, XTUPLE_0:1; ::_thesis: verum end; given s1 being Element of S such that A6: s1 in C and A7: [x,s1] in (PTClasses X) . y ; ::_thesis: [x,y] in CompClass ((PTCongruence X),C) reconsider x2 = x, y2 = y as Element of TS (DTConOSA X) by A7, Th23; [x2,y2] in { [x1,y1] where x1, y1 is Element of TS (DTConOSA X) : [x1,s1] in (PTClasses X) . y1 } by A7; then [x2,y2] in (PTCongruence X) . s1 by Def22; hence [x,y] in CompClass ((PTCongruence X),C) by A6, OSALG_4:def_9; ::_thesis: verum end; theorem Th25: :: OSAFREE:25 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s holds OSClass ((PTCongruence X),x) = proj1 ((PTClasses X) . x) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s holds OSClass ((PTCongruence X),x) = proj1 ((PTClasses X) . x) let X be V16() ManySortedSet of S; ::_thesis: for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s holds OSClass ((PTCongruence X),x) = proj1 ((PTClasses X) . x) let s be Element of S; ::_thesis: for x being Element of the Sorts of (ParsedTermsOSA X) . s holds OSClass ((PTCongruence X),x) = proj1 ((PTClasses X) . x) let x be Element of the Sorts of (ParsedTermsOSA X) . s; ::_thesis: OSClass ((PTCongruence X),x) = proj1 ((PTClasses X) . x) set R = PTCongruence X; set PTA = ParsedTermsOSA X; set D = DTConOSA X; for z being set holds ( z in OSClass ((PTCongruence X),x) iff z in proj1 ((PTClasses X) . x) ) proof let z be set ; ::_thesis: ( z in OSClass ((PTCongruence X),x) iff z in proj1 ((PTClasses X) . x) ) hereby ::_thesis: ( z in proj1 ((PTClasses X) . x) implies z in OSClass ((PTCongruence X),x) ) assume z in OSClass ((PTCongruence X),x) ; ::_thesis: z in proj1 ((PTClasses X) . x) then [z,x] in CompClass ((PTCongruence X),(CComp s)) by EQREL_1:19; then ex s1 being Element of S st ( s1 in CComp s & [z,s1] in (PTClasses X) . x ) by Th24; hence z in proj1 ((PTClasses X) . x) by XTUPLE_0:def_12; ::_thesis: verum end; assume z in proj1 ((PTClasses X) . x) ; ::_thesis: z in OSClass ((PTCongruence X),x) then consider s1 being set such that A1: [z,s1] in (PTClasses X) . x by XTUPLE_0:def_12; reconsider s2 = s1 as Element of S by A1, Th23; reconsider x1 = x, z1 = z as Element of TS (DTConOSA X) by A1, Th23; A2: LeastSort x1 <= s by Def12; [z1,s2] in (PTClasses X) . x1 by A1; then [x1,s2] in (PTClasses X) . x1 by Th20; then x in the Sorts of (ParsedTermsOSA X) . s1 by Th19; then LeastSort x1 <= s2 by Def12; then CComp s2 = CComp (LeastSort x1) by OSALG_4:4 .= CComp s by A2, OSALG_4:4 ; then s2 in CComp s by EQREL_1:20; then [z,x] in CompClass ((PTCongruence X),(CComp s)) by A1, Th24; hence z in OSClass ((PTCongruence X),x) by EQREL_1:19; ::_thesis: verum end; hence OSClass ((PTCongruence X),x) = proj1 ((PTClasses X) . x) by TARSKI:1; ::_thesis: verum end; theorem Th26: :: OSAFREE:26 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for R being ManySortedRelation of (ParsedTermsOSA X) holds ( R = PTCongruence X iff ( ( for s1, s2 being Element of S for x being set st x in X . s1 holds ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in R . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in R . s2 or [y,(root-tree [x,s1])] in R . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ) ) & ( for o1, o2 being OperSymbol of S for x1 being Element of Args (o1,(ParsedTermsOSA X)) for x2 being Element of Args (o2,(ParsedTermsOSA X)) for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in R . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in R . (w3 /. y) ) ) ) ) ) ) ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for R being ManySortedRelation of (ParsedTermsOSA X) holds ( R = PTCongruence X iff ( ( for s1, s2 being Element of S for x being set st x in X . s1 holds ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in R . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in R . s2 or [y,(root-tree [x,s1])] in R . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ) ) & ( for o1, o2 being OperSymbol of S for x1 being Element of Args (o1,(ParsedTermsOSA X)) for x2 being Element of Args (o2,(ParsedTermsOSA X)) for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in R . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in R . (w3 /. y) ) ) ) ) ) ) ) let X be V16() ManySortedSet of S; ::_thesis: for R being ManySortedRelation of (ParsedTermsOSA X) holds ( R = PTCongruence X iff ( ( for s1, s2 being Element of S for x being set st x in X . s1 holds ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in R . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in R . s2 or [y,(root-tree [x,s1])] in R . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ) ) & ( for o1, o2 being OperSymbol of S for x1 being Element of Args (o1,(ParsedTermsOSA X)) for x2 being Element of Args (o2,(ParsedTermsOSA X)) for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in R . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in R . (w3 /. y) ) ) ) ) ) ) ) let R be ManySortedRelation of (ParsedTermsOSA X); ::_thesis: ( R = PTCongruence X iff ( ( for s1, s2 being Element of S for x being set st x in X . s1 holds ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in R . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in R . s2 or [y,(root-tree [x,s1])] in R . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ) ) & ( for o1, o2 being OperSymbol of S for x1 being Element of Args (o1,(ParsedTermsOSA X)) for x2 being Element of Args (o2,(ParsedTermsOSA X)) for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in R . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in R . (w3 /. y) ) ) ) ) ) ) ) set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); set D = DTConOSA X; set OU = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); set C = bool [:(TS (DTConOSA X)), the carrier of S:]; set F = PTClasses X; defpred S1[ ManySortedSet of the carrier of S] means for s1, s2 being Element of S for x being set st x in X . s1 holds ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in $1 . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in $1 . s2 or [y,(root-tree [x,s1])] in $1 . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ); defpred S2[ ManySortedSet of the carrier of S] means for o1, o2 being OperSymbol of S for x1 being Element of Args (o1,(ParsedTermsOSA X)) for x2 being Element of Args (o2,(ParsedTermsOSA X)) for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in $1 . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in $1 . (w3 /. y) ) ) ) ); set P = PTCongruence X; A1: for R1, R2 being ManySortedRelation of (ParsedTermsOSA X) st S1[R1] & S2[R1] & S1[R2] & S2[R2] holds R1 = R2 proof let R1, R2 be ManySortedRelation of (ParsedTermsOSA X); ::_thesis: ( S1[R1] & S2[R1] & S1[R2] & S2[R2] implies R1 = R2 ) assume that A2: S1[R1] and A3: S2[R1] and A4: S1[R2] and A5: S2[R2] ; ::_thesis: R1 = R2 defpred S3[ set ] means for x being set for s being Element of S holds ( [$1,x] in R1 . s iff [$1,x] in R2 . s ); A6: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S3[t] ) holds S3[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 the carrier of (DTConOSA X) st t in rng ts holds S3[t] ) holds S3[nt -tree ts] let ts be FinSequence of TS (DTConOSA X); ::_thesis: ( nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S3[t] ) implies S3[nt -tree ts] ) assume that A7: nt ==> roots ts and A8: for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S3[t] ; ::_thesis: S3[nt -tree ts] nt in { s where s is Symbol of (DTConOSA X) : ex n being FinSequence st s ==> n } by A7; then reconsider nt1 = nt as NonTerminal of (DTConOSA X) by LANG1:def_3; reconsider tss = ts as SubtreeSeq of nt1 by A7, DTCONSTR:def_6; let x be set ; ::_thesis: for s being Element of S holds ( [(nt -tree ts),x] in R1 . s iff [(nt -tree ts),x] in R2 . s ) let s be Element of S; ::_thesis: ( [(nt -tree ts),x] in R1 . s iff [(nt -tree ts),x] in R2 . s ) A9: rng ts c= TS (DTConOSA X) by FINSEQ_1:def_4; [nt,(roots ts)] in the Rules of (DTConOSA X) by A7, LANG1:def_1; then reconsider rt = roots ts as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by ZFMISC_1:87; reconsider sy = nt as Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) ; [sy,rt] in OSREL X by A7, LANG1:def_1; then sy in [: the carrier' of S,{ the carrier of S}:] by Def4; then consider o being Element of the carrier' of S, x2 being Element of { the carrier of S} such that A10: sy = [o,x2] by DOMAIN_1:1; A11: x2 = the carrier of S by TARSKI:def_1; then A12: (nt -tree tss) . {} = [o, the carrier of S] by A10, TREES_4:def_4; then consider ts2 being SubtreeSeq of OSSym (o,X) such that A13: nt1 -tree tss = (OSSym (o,X)) -tree ts2 and OSSym (o,X) ==> roots ts2 and A14: ts2 in Args (o,(ParsedTermsOSA X)) and A15: nt1 -tree tss = (Den (o,(ParsedTermsOSA X))) . ts2 by Th11; A16: the Sorts of (ParsedTermsOSA X) . s = ParsedTerms (X,s) by Def8 .= { a1 where a1 is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a1 = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a1 . {} & the_result_sort_of o <= s ) ) } ; hereby ::_thesis: ( [(nt -tree ts),x] in R2 . s implies [(nt -tree ts),x] in R1 . s ) assume A17: [(nt -tree ts),x] in R1 . s ; ::_thesis: [(nt -tree ts),x] in R2 . s then x in the Sorts of (ParsedTermsOSA X) . s by ZFMISC_1:87; then consider a1 being Element of TS (DTConOSA X) such that A18: x = a1 and A19: ( ex s1 being Element of S ex y being set st ( s1 <= s & y in X . s1 & a1 = root-tree [y,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a1 . {} & the_result_sort_of o <= s ) ) by A16; for s1 being Element of S for y being set holds ( not s1 <= s or not y in X . s1 or not a1 = root-tree [y,s1] ) proof given s1 being Element of S, y being set such that s1 <= s and A20: y in X . s1 and A21: a1 = root-tree [y,s1] ; ::_thesis: contradiction nt -tree ts = root-tree [y,s1] by A2, A17, A18, A20, A21; then [y,s1] = nt by TREES_4:17; then the carrier of S = s1 by A10, A11, XTUPLE_0:1; then s1 in s1 ; hence contradiction ; ::_thesis: verum end; then consider o1 being OperSymbol of S such that A22: [o1, the carrier of S] = a1 . {} and the_result_sort_of o1 <= s by A19; consider ts1 being SubtreeSeq of OSSym (o1,X) such that a1 = (OSSym (o1,X)) -tree ts1 and OSSym (o1,X) ==> roots ts1 and A23: ts1 in Args (o1,(ParsedTermsOSA X)) and A24: a1 = (Den (o1,(ParsedTermsOSA X))) . ts1 by A22, Th11; consider ts2 being SubtreeSeq of OSSym (o,X) such that A25: nt1 -tree tss = (OSSym (o,X)) -tree ts2 and OSSym (o,X) ==> roots ts2 and A26: ts2 in Args (o,(ParsedTermsOSA X)) and A27: nt1 -tree tss = (Den (o,(ParsedTermsOSA X))) . ts2 by A12, Th11; A28: len (the_arity_of o) = len (the_arity_of o1) by A3, A17, A18, A23, A24, A26, A27; reconsider tsb = ts2 as Element of Args (o,(ParsedTermsOSA X)) by A26; reconsider tsa = ts1 as Element of Args (o1,(ParsedTermsOSA X)) by A23; consider w3 being Element of the carrier of S * such that A29: dom w3 = dom tsb and A30: for y being Nat st y in dom w3 holds [(tsb . y),(tsa . y)] in R1 . (w3 /. y) by A3, A17, A18, A24, A27; A31: ts2 = tss by A25, TREES_4:15; A32: for y being Nat st y in dom w3 holds [(tsb . y),(tsa . y)] in R2 . (w3 /. y) proof let y be Nat; ::_thesis: ( y in dom w3 implies [(tsb . y),(tsa . y)] in R2 . (w3 /. y) ) assume A33: y in dom w3 ; ::_thesis: [(tsb . y),(tsa . y)] in R2 . (w3 /. y) A34: tsb . y in rng ts by A31, A29, A33, FUNCT_1:3; then reconsider t = tsb . y as Element of TS (DTConOSA X) by A9; [t,(tsa . y)] in R1 . (w3 /. y) by A30, A33; hence [(tsb . y),(tsa . y)] in R2 . (w3 /. y) by A8, A34; ::_thesis: verum end; A35: the_result_sort_of o1 <= s by A3, A17, A18, A23, A24, A26, A27; A36: the_result_sort_of o <= s by A3, A17, A18, A23, A24, A26, A27; o ~= o1 by A3, A17, A18, A23, A24, A26, A27; hence [(nt -tree ts),x] in R2 . s by A5, A18, A24, A27, A28, A36, A35, A29, A32; ::_thesis: verum end; reconsider tsb = ts2 as Element of Args (o,(ParsedTermsOSA X)) by A14; assume A37: [(nt -tree ts),x] in R2 . s ; ::_thesis: [(nt -tree ts),x] in R1 . s then x in the Sorts of (ParsedTermsOSA X) . s by ZFMISC_1:87; then consider a1 being Element of TS (DTConOSA X) such that A38: x = a1 and A39: ( ex s1 being Element of S ex y being set st ( s1 <= s & y in X . s1 & a1 = root-tree [y,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a1 . {} & the_result_sort_of o <= s ) ) by A16; for s1 being Element of S for y being set holds ( not s1 <= s or not y in X . s1 or not a1 = root-tree [y,s1] ) proof given s1 being Element of S, y being set such that s1 <= s and A40: y in X . s1 and A41: a1 = root-tree [y,s1] ; ::_thesis: contradiction nt -tree ts = root-tree [y,s1] by A4, A37, A38, A40, A41; then [y,s1] = nt by TREES_4:17; then the carrier of S = s1 by A10, A11, XTUPLE_0:1; then s1 in s1 ; hence contradiction ; ::_thesis: verum end; then consider o1 being OperSymbol of S such that A42: [o1, the carrier of S] = a1 . {} and the_result_sort_of o1 <= s by A39; consider ts1 being SubtreeSeq of OSSym (o1,X) such that a1 = (OSSym (o1,X)) -tree ts1 and OSSym (o1,X) ==> roots ts1 and A43: ts1 in Args (o1,(ParsedTermsOSA X)) and A44: a1 = (Den (o1,(ParsedTermsOSA X))) . ts1 by A42, Th11; A45: len (the_arity_of o) = len (the_arity_of o1) by A5, A37, A38, A43, A44, A14, A15; reconsider tsa = ts1 as Element of Args (o1,(ParsedTermsOSA X)) by A43; consider w3 being Element of the carrier of S * such that A46: dom w3 = dom tsb and A47: for y being Nat st y in dom w3 holds [(tsb . y),(tsa . y)] in R2 . (w3 /. y) by A5, A37, A38, A44, A15; A48: ts2 = tss by A13, TREES_4:15; A49: for y being Nat st y in dom w3 holds [(tsb . y),(tsa . y)] in R1 . (w3 /. y) proof let y be Nat; ::_thesis: ( y in dom w3 implies [(tsb . y),(tsa . y)] in R1 . (w3 /. y) ) assume A50: y in dom w3 ; ::_thesis: [(tsb . y),(tsa . y)] in R1 . (w3 /. y) A51: tsb . y in rng ts by A48, A46, A50, FUNCT_1:3; then reconsider t = tsb . y as Element of TS (DTConOSA X) by A9; [t,(tsa . y)] in R2 . (w3 /. y) by A47, A50; hence [(tsb . y),(tsa . y)] in R1 . (w3 /. y) by A8, A51; ::_thesis: verum end; A52: the_result_sort_of o1 <= s by A5, A37, A38, A43, A44, A14, A15; A53: the_result_sort_of o <= s by A5, A37, A38, A43, A44, A14, A15; o ~= o1 by A5, A37, A38, A43, A44, A14, A15; hence [(nt -tree ts),x] in R1 . s by A3, A38, A44, A15, A45, A53, A52, A46, A49; ::_thesis: verum end; A54: for s being Symbol of (DTConOSA X) st s in Terminals (DTConOSA X) holds S3[ root-tree s] proof let sy be Symbol of (DTConOSA X); ::_thesis: ( sy in Terminals (DTConOSA X) implies S3[ root-tree sy] ) assume sy in Terminals (DTConOSA X) ; ::_thesis: S3[ root-tree sy] then consider s being Element of S, x being set such that A55: x in X . s and A56: sy = [x,s] by Th4; let y be set ; ::_thesis: for s being Element of S holds ( [(root-tree sy),y] in R1 . s iff [(root-tree sy),y] in R2 . s ) let s1 be Element of S; ::_thesis: ( [(root-tree sy),y] in R1 . s1 iff [(root-tree sy),y] in R2 . s1 ) hereby ::_thesis: ( [(root-tree sy),y] in R2 . s1 implies [(root-tree sy),y] in R1 . s1 ) assume A57: [(root-tree sy),y] in R1 . s1 ; ::_thesis: [(root-tree sy),y] in R2 . s1 then A58: y = root-tree [x,s] by A2, A55, A56; s <= s1 by A2, A55, A56, A57; hence [(root-tree sy),y] in R2 . s1 by A4, A55, A56, A58; ::_thesis: verum end; assume A59: [(root-tree sy),y] in R2 . s1 ; ::_thesis: [(root-tree sy),y] in R1 . s1 then A60: y = root-tree [x,s] by A4, A55, A56; s <= s1 by A4, A55, A56, A59; hence [(root-tree sy),y] in R1 . s1 by A2, A55, A56, A60; ::_thesis: verum end; A61: for t being DecoratedTree of the carrier of (DTConOSA X) st t in TS (DTConOSA X) holds S3[t] from DTCONSTR:sch_7(A54, A6); for i being set st i in the carrier of S holds R1 . i = R2 . i proof let i be set ; ::_thesis: ( i in the carrier of S implies R1 . i = R2 . i ) assume i in the carrier of S ; ::_thesis: R1 . i = R2 . i then reconsider s = i as Element of S ; for a, b being set holds ( [a,b] in R1 . s iff [a,b] in R2 . s ) proof let a, b be set ; ::_thesis: ( [a,b] in R1 . s iff [a,b] in R2 . s ) A62: the Sorts of (ParsedTermsOSA X) . s = ParsedTerms (X,s) by Def8 .= { a1 where a1 is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a1 = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a1 . {} & the_result_sort_of o <= s ) ) } ; hereby ::_thesis: ( [a,b] in R2 . s implies [a,b] in R1 . s ) assume A63: [a,b] in R1 . s ; ::_thesis: [a,b] in R2 . s then a in the Sorts of (ParsedTermsOSA X) . s by ZFMISC_1:87; then ex a1 being Element of TS (DTConOSA X) st ( a = a1 & ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a1 = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a1 . {} & the_result_sort_of o <= s ) ) ) by A62; hence [a,b] in R2 . s by A61, A63; ::_thesis: verum end; assume A64: [a,b] in R2 . s ; ::_thesis: [a,b] in R1 . s then a in the Sorts of (ParsedTermsOSA X) . s by ZFMISC_1:87; then ex a1 being Element of TS (DTConOSA X) st ( a = a1 & ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & a1 = root-tree [x,s1] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a1 . {} & the_result_sort_of o <= s ) ) ) by A62; hence [a,b] in R1 . s by A61, A64; ::_thesis: verum end; hence R1 . i = R2 . i by RELAT_1:def_2; ::_thesis: verum end; hence R1 = R2 by PBOOLE:3; ::_thesis: verum end; A65: S2[ PTCongruence X] proof let o1, o2 be OperSymbol of S; ::_thesis: for x1 being Element of Args (o1,(ParsedTermsOSA X)) for x2 being Element of Args (o2,(ParsedTermsOSA X)) for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) ) ) let x1 be Element of Args (o1,(ParsedTermsOSA X)); ::_thesis: for x2 being Element of Args (o2,(ParsedTermsOSA X)) for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) ) ) let x2 be Element of Args (o2,(ParsedTermsOSA X)); ::_thesis: for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) ) ) let s3 be Element of S; ::_thesis: ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) ) ) A66: dom (the_arity_of o2) = dom x2 by MSUALG_3:6; A67: (PTCongruence X) . s3 = { [x3,y] where x3, y is Element of TS (DTConOSA X) : [x3,s3] in (PTClasses X) . y } by Def22; reconsider ts2 = x2 as FinSequence of TS (DTConOSA X) by Th13; A68: dom (the_arity_of o1) = dom x1 by MSUALG_3:6; reconsider ts1 = x1 as FinSequence of TS (DTConOSA X) by Th13; A69: rng ts1 c= TS (DTConOSA X) by FINSEQ_1:def_4; reconsider x = (PTClasses X) * ts1 as FinSequence of bool [:(TS (DTConOSA X)), the carrier of S:] ; dom (PTClasses X) = TS (DTConOSA X) by FUNCT_2:def_1; then A70: len x = len ts1 by A69, FINSEQ_2:29; then A71: dom x = dom ts1 by FINSEQ_3:29; A72: OSSym (o1,X) ==> roots x1 by Th13; then A73: (PTClasses X) . ((OSSym (o1,X)) -tree ts1) = @ ((OSSym (o1,X)),x) by Def21 .= { [((Den (o3,(ParsedTermsOSA X))) . x3),s4] where o3 is OperSymbol of S, x3 is Element of Args (o3,(ParsedTermsOSA X)), s4 is Element of S : ( ex o4 being OperSymbol of S st ( OSSym (o1,X) = [o4, the carrier of S] & o4 ~= o3 & len (the_arity_of o4) = len (the_arity_of o3) & the_result_sort_of o4 <= s4 & the_result_sort_of o3 <= s4 ) & ex w3 being Element of the carrier of S * st ( dom w3 = dom x & ( for y being Nat st y in dom x holds [(x3 . y),(w3 /. y)] in x . y ) ) ) } ; A74: OSSym (o2,X) ==> roots x2 by Th13; then reconsider tx = (OSSym (o1,X)) -tree ts1, ty = (OSSym (o2,X)) -tree ts2 as Element of TS (DTConOSA X) by A72, Th12; A75: (Den (o2,(ParsedTermsOSA X))) . x2 = ((PTOper X) . o2) . x2 by MSUALG_1:def_6 .= (PTDenOp (o2,X)) . ts2 by Def10 .= (OSSym (o2,X)) -tree ts2 by A74, Def9 ; A76: (Den (o1,(ParsedTermsOSA X))) . x1 = ((PTOper X) . o1) . x1 by MSUALG_1:def_6 .= (PTDenOp (o1,X)) . ts1 by Def10 .= (OSSym (o1,X)) -tree ts1 by A72, Def9 ; A77: rng ts2 c= TS (DTConOSA X) by FINSEQ_1:def_4; hereby ::_thesis: ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) implies [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . s3 ) assume [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . s3 ; ::_thesis: ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) ) then consider t1, t2 being Element of TS (DTConOSA X) such that A78: [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] = [t1,t2] and A79: [t1,s3] in (PTClasses X) . t2 by A67; A80: (Den (o1,(ParsedTermsOSA X))) . x1 = t1 by A78, XTUPLE_0:1; A81: (Den (o2,(ParsedTermsOSA X))) . x2 = t2 by A78, XTUPLE_0:1; [t2,s3] in (PTClasses X) . t1 by A79, Th19; then consider o3 being OperSymbol of S, x3 being Element of Args (o3,(ParsedTermsOSA X)), s4 being Element of S such that A82: [t2,s3] = [((Den (o3,(ParsedTermsOSA X))) . x3),s4] and A83: ex o4 being OperSymbol of S st ( OSSym (o1,X) = [o4, the carrier of S] & o4 ~= o3 & len (the_arity_of o4) = len (the_arity_of o3) & the_result_sort_of o4 <= s4 & the_result_sort_of o3 <= s4 ) and A84: ex w3 being Element of the carrier of S * st ( dom w3 = dom x & ( for y being Nat st y in dom x holds [(x3 . y),(w3 /. y)] in x . y ) ) by A76, A73, A80; consider o4 being OperSymbol of S such that A85: OSSym (o1,X) = [o4, the carrier of S] and A86: o4 ~= o3 and A87: len (the_arity_of o4) = len (the_arity_of o3) and A88: the_result_sort_of o4 <= s4 and A89: the_result_sort_of o3 <= s4 by A83; A90: o1 = o4 by A85, XTUPLE_0:1; reconsider ts3 = x3 as FinSequence of TS (DTConOSA X) by Th13; A91: OSSym (o3,X) ==> roots x3 by Th13; A92: t2 = (Den (o3,(ParsedTermsOSA X))) . x3 by A82, XTUPLE_0:1; A93: (Den (o3,(ParsedTermsOSA X))) . x3 = ((PTOper X) . o3) . x3 by MSUALG_1:def_6 .= (PTDenOp (o3,X)) . ts3 by Def10 .= (OSSym (o3,X)) -tree ts3 by A91, Def9 ; then A94: OSSym (o3,X) = OSSym (o2,X) by A75, A81, A92, TREES_4:15; s3 = s4 by A82, XTUPLE_0:1; hence ( 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 A86, A87, A88, A89, A90, A94, XTUPLE_0:1; ::_thesis: ex w3 being Element of the carrier of S * st ( dom w3 = dom x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) consider w3 being Element of the carrier of S * such that A95: dom w3 = dom x and A96: for y being Nat st y in dom x holds [(x3 . y),(w3 /. y)] in x . y by A84; take w3 = w3; ::_thesis: ( dom w3 = dom x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) thus dom w3 = dom x1 by A70, A95, FINSEQ_3:29; ::_thesis: for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) let y be Nat; ::_thesis: ( y in dom w3 implies [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) assume A97: y in dom w3 ; ::_thesis: [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) A98: ts1 . y in rng ts1 by A71, A95, A97, FUNCT_1:3; A99: ts3 = ts2 by A75, A81, A92, A93, TREES_4:15; o3 = o2 by A94, XTUPLE_0:1; then dom (the_arity_of o1) = dom (the_arity_of o2) by A87, A90, FINSEQ_3:29; then ts2 . y in rng ts2 by A71, A68, A66, A95, A97, FUNCT_1:3; then reconsider t22 = ts2 . y, t11 = ts1 . y as Element of TS (DTConOSA X) by A69, A77, A98; [(x3 . y),(w3 /. y)] in x . y by A95, A96, A97; then [(ts2 . y),(w3 /. y)] in (PTClasses X) . (ts1 . y) by A99, A95, A97, FUNCT_1:12; then A100: [t11,(w3 /. y)] in (PTClasses X) . t22 by Th19; (PTCongruence X) . (w3 /. y) = { [x5,y5] where x5, y5 is Element of TS (DTConOSA X) : [x5,(w3 /. y)] in (PTClasses X) . y5 } by Def22; hence [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) by A100; ::_thesis: verum end; assume that A101: o1 ~= o2 and A102: len (the_arity_of o1) = len (the_arity_of o2) and A103: the_result_sort_of o1 <= s3 and A104: the_result_sort_of o2 <= s3 and A105: ex w3 being Element of the carrier of S * st ( dom w3 = dom x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) ) ) ; ::_thesis: [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . s3 consider w3 being Element of the carrier of S * such that A106: dom w3 = dom x1 and A107: for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) by A105; for y being Nat st y in dom x holds [(x2 . y),(w3 /. y)] in x . y proof let y be Nat; ::_thesis: ( y in dom x implies [(x2 . y),(w3 /. y)] in x . y ) assume A108: y in dom x ; ::_thesis: [(x2 . y),(w3 /. y)] in x . y A109: (PTCongruence X) . (w3 /. y) = { [x5,y5] where x5, y5 is Element of TS (DTConOSA X) : [x5,(w3 /. y)] in (PTClasses X) . y5 } by Def22; [(x1 . y),(x2 . y)] in (PTCongruence X) . (w3 /. y) by A71, A106, A107, A108; then consider x5, y5 being Element of TS (DTConOSA X) such that A110: [(x1 . y),(x2 . y)] = [x5,y5] and A111: [x5,(w3 /. y)] in (PTClasses X) . y5 by A109; A112: x1 . y = x5 by A110, XTUPLE_0:1; A113: x2 . y = y5 by A110, XTUPLE_0:1; [y5,(w3 /. y)] in (PTClasses X) . x5 by A111, Th19; hence [(x2 . y),(w3 /. y)] in x . y by A108, A112, A113, FUNCT_1:12; ::_thesis: verum end; then [((Den (o2,(ParsedTermsOSA X))) . x2),s3] in (PTClasses X) . ((OSSym (o1,X)) -tree ts1) by A71, A73, A101, A102, A103, A104, A106; then [tx,s3] in (PTClasses X) . ty by A75, Th19; hence [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . s3 by A67, A76, A75; ::_thesis: verum end; S1[ PTCongruence X] proof let s1, s2 be Element of S; ::_thesis: for x being set st x in X . s1 holds ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in (PTCongruence X) . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in (PTCongruence X) . s2 or [y,(root-tree [x,s1])] in (PTCongruence X) . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ) let x be set ; ::_thesis: ( x in X . s1 implies ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in (PTCongruence X) . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in (PTCongruence X) . s2 or [y,(root-tree [x,s1])] in (PTCongruence X) . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ) ) assume A114: x in X . s1 ; ::_thesis: ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in (PTCongruence X) . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in (PTCongruence X) . s2 or [y,(root-tree [x,s1])] in (PTCongruence X) . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ) reconsider sy = [x,s1] as Terminal of (DTConOSA X) by A114, Th4; A115: (PTCongruence X) . s2 = { [x1,y] where x1, y is Element of TS (DTConOSA X) : [x1,s2] in (PTClasses X) . y } by Def22; A116: root-tree [x,s1] in the Sorts of (ParsedTermsOSA X) . s1 by A114, Th10; hereby ::_thesis: for y being set st ( [(root-tree [x,s1]),y] in (PTCongruence X) . s2 or [y,(root-tree [x,s1])] in (PTCongruence X) . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) assume A117: s1 <= s2 ; ::_thesis: [(root-tree [x,s1]),(root-tree [x,s1])] in (PTCongruence X) . s2 [(root-tree sy),s1] in (PTClasses X) . (root-tree sy) by A116, Th19; then [(root-tree sy),s2] in (PTClasses X) . (root-tree sy) by A116, A117, Th21; hence [(root-tree [x,s1]),(root-tree [x,s1])] in (PTCongruence X) . s2 by A115; ::_thesis: verum end; let y be set ; ::_thesis: ( ( [(root-tree [x,s1]),y] in (PTCongruence X) . s2 or [y,(root-tree [x,s1])] in (PTCongruence X) . s2 ) implies ( s1 <= s2 & y = root-tree [x,s1] ) ) assume A118: ( [(root-tree [x,s1]),y] in (PTCongruence X) . s2 or [y,(root-tree [x,s1])] in (PTCongruence X) . s2 ) ; ::_thesis: ( s1 <= s2 & y = root-tree [x,s1] ) then A119: root-tree [x,s1] in the Sorts of (ParsedTermsOSA X) . s2 by ZFMISC_1:87; field ((PTCongruence X) . s2) = the Sorts of (ParsedTermsOSA X) . s2 by ORDERS_1:12; then A120: (PTCongruence X) . s2 is_symmetric_in the Sorts of (ParsedTermsOSA X) . s2 by RELAT_2:def_11; A121: (PTClasses X) . (root-tree sy) = @ sy by Def21 .= { [(root-tree sy),s3] where s3 is Element of S : ex s4 being Element of S ex x being set st ( x in X . s4 & sy = [x,s4] & s4 <= s3 ) } ; y in the Sorts of (ParsedTermsOSA X) . s2 by A118, ZFMISC_1:87; then [y,(root-tree sy)] in (PTCongruence X) . s2 by A120, A118, A119, RELAT_2:def_3; then consider y1, r1 being Element of TS (DTConOSA X) such that A122: [y,(root-tree sy)] = [y1,r1] and A123: [y1,s2] in (PTClasses X) . r1 by A115; A124: y = y1 by A122, XTUPLE_0:1; root-tree sy = r1 by A122, XTUPLE_0:1; then consider s3 being Element of S such that A125: [y1,s2] = [(root-tree sy),s3] and A126: ex s4 being Element of S ex x being set st ( x in X . s4 & sy = [x,s4] & s4 <= s3 ) by A121, A123; s2 = s3 by A125, XTUPLE_0:1; hence ( s1 <= s2 & y = root-tree [x,s1] ) by A124, A125, A126, XTUPLE_0:1; ::_thesis: verum end; hence ( R = PTCongruence X iff ( ( for s1, s2 being Element of S for x being set st x in X . s1 holds ( ( s1 <= s2 implies [(root-tree [x,s1]),(root-tree [x,s1])] in R . s2 ) & ( for y being set st ( [(root-tree [x,s1]),y] in R . s2 or [y,(root-tree [x,s1])] in R . s2 ) holds ( s1 <= s2 & y = root-tree [x,s1] ) ) ) ) & ( for o1, o2 being OperSymbol of S for x1 being Element of Args (o1,(ParsedTermsOSA X)) for x2 being Element of Args (o2,(ParsedTermsOSA X)) for s3 being Element of S holds ( [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in R . s3 iff ( 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 x1 & ( for y being Nat st y in dom w3 holds [(x1 . y),(x2 . y)] in R . (w3 /. y) ) ) ) ) ) ) ) by A1, A65; ::_thesis: verum end; theorem Th27: :: OSAFREE:27 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S holds PTCongruence X is monotone proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S holds PTCongruence X is monotone let X be V16() ManySortedSet of S; ::_thesis: PTCongruence X is monotone set PTA = ParsedTermsOSA X; set P = PTCongruence X; thus PTCongruence X is monotone ::_thesis: verum proof let o1, o2 be OperSymbol of S; :: according to OSALG_4:def_26 ::_thesis: ( not o1 <= o2 or for b1 being Element of Args (o1,(ParsedTermsOSA X)) for b2 being Element of Args (o2,(ParsedTermsOSA X)) holds ( ex b3 being set st ( b3 in proj1 b1 & not [(b1 . b3),(b2 . b3)] in (PTCongruence X) . ((the_arity_of o2) /. b3) ) or [((Den (o1,(ParsedTermsOSA X))) . b1),((Den (o2,(ParsedTermsOSA X))) . b2)] in (PTCongruence X) . (the_result_sort_of o2) ) ) assume A1: o1 <= o2 ; ::_thesis: for b1 being Element of Args (o1,(ParsedTermsOSA X)) for b2 being Element of Args (o2,(ParsedTermsOSA X)) holds ( ex b3 being set st ( b3 in proj1 b1 & not [(b1 . b3),(b2 . b3)] in (PTCongruence X) . ((the_arity_of o2) /. b3) ) or [((Den (o1,(ParsedTermsOSA X))) . b1),((Den (o2,(ParsedTermsOSA X))) . b2)] in (PTCongruence X) . (the_result_sort_of o2) ) A2: o1 ~= o2 by A1, OSALG_1:def_20; A3: the_result_sort_of o1 <= the_result_sort_of o2 by A1, OSALG_1:def_20; let x1 be Element of Args (o1,(ParsedTermsOSA X)); ::_thesis: for b1 being Element of Args (o2,(ParsedTermsOSA X)) holds ( ex b2 being set st ( b2 in proj1 x1 & not [(x1 . b2),(b1 . b2)] in (PTCongruence X) . ((the_arity_of o2) /. b2) ) or [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . b1)] in (PTCongruence X) . (the_result_sort_of o2) ) let x2 be Element of Args (o2,(ParsedTermsOSA X)); ::_thesis: ( ex b1 being set st ( b1 in proj1 x1 & not [(x1 . b1),(x2 . b1)] in (PTCongruence X) . ((the_arity_of o2) /. b1) ) or [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . (the_result_sort_of o2) ) assume A4: for y being Nat st y in dom x1 holds [(x1 . y),(x2 . y)] in (PTCongruence X) . ((the_arity_of o2) /. y) ; ::_thesis: [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . (the_result_sort_of o2) the_arity_of o1 <= the_arity_of o2 by A1, OSALG_1:def_20; then A5: len (the_arity_of o1) = len (the_arity_of o2) by OSALG_1:def_6; then dom (the_arity_of o2) = dom (the_arity_of o1) by FINSEQ_3:29; then dom (the_arity_of o2) = dom x1 by MSUALG_3:6; hence [((Den (o1,(ParsedTermsOSA X))) . x1),((Den (o2,(ParsedTermsOSA X))) . x2)] in (PTCongruence X) . (the_result_sort_of o2) by A4, A2, A3, A5, Th26; ::_thesis: verum end; end; registration let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; cluster PTCongruence X -> MSEquivalence-like monotone ; coherence PTCongruence X is monotone by Th27; end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let s be Element of S; func PTVars (s,X) -> Subset of ( the Sorts of (ParsedTermsOSA X) . s) means :Def23: :: OSAFREE:def 23 for x being set holds ( x in it iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ); existence ex b1 being Subset of ( the Sorts of (ParsedTermsOSA X) . s) st for x being set holds ( x in b1 iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) proof defpred S1[ set ] means ex a being set st ( a in X . s & $1 = root-tree [a,s] ); set D = DTConOSA X; set PTA = ParsedTermsOSA X; set SO = the Sorts of (ParsedTermsOSA X); consider A being set such that A1: for x being set holds ( x in A iff ( x in the Sorts of (ParsedTermsOSA X) . s & S1[x] ) ) from XBOOLE_0:sch_1(); A c= the Sorts of (ParsedTermsOSA X) . s proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in A or x in the Sorts of (ParsedTermsOSA X) . s ) assume x in A ; ::_thesis: x in the Sorts of (ParsedTermsOSA X) . s hence x in the Sorts of (ParsedTermsOSA X) . s by A1; ::_thesis: verum end; then reconsider A = A as Subset of ( the Sorts of (ParsedTermsOSA X) . s) ; for x being set holds ( x in A iff S1[x] ) proof dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . s in rng (coprod X) by FUNCT_1:def_3; then A2: coprod (s,X) in rng (coprod X) by MSAFREE:def_3; A3: Terminals (DTConOSA X) = Union (coprod X) by Th3; set A1 = { aa where aa is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & aa = root-tree [x,s1] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = aa . {} & the_result_sort_of o1 <= s ) ) } ; let x be set ; ::_thesis: ( x in A iff S1[x] ) thus ( x in A implies S1[x] ) by A1; ::_thesis: ( S1[x] implies x in A ) assume A4: S1[x] ; ::_thesis: x in A then consider a being set such that A5: a in X . s and A6: x = root-tree [a,s] ; A7: (ParsedTerms X) . s = ParsedTerms (X,s) by Def8; set sa = [a,s]; [a,s] in coprod (s,X) by A5, MSAFREE:def_2; then [a,s] in union (rng (coprod X)) by A2, TARSKI:def_4; then A8: [a,s] in Terminals (DTConOSA X) by A3, CARD_3:def_4; then reconsider sa = [a,s] as Symbol of (DTConOSA X) ; reconsider b = root-tree sa as Element of TS (DTConOSA X) by A8, DTCONSTR:def_1; b in { aa where aa is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & aa = root-tree [x,s1] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = aa . {} & the_result_sort_of o1 <= s ) ) } by A5; hence x in A by A1, A4, A6, A7; ::_thesis: verum end; hence ex b1 being Subset of ( the Sorts of (ParsedTermsOSA X) . s) st for x being set holds ( x in b1 iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) ; ::_thesis: verum end; uniqueness for b1, b2 being Subset of ( the Sorts of (ParsedTermsOSA X) . s) st ( for x being set holds ( x in b1 iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) ) & ( for x being set holds ( x in b2 iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) ) holds b1 = b2 proof set PTA = ParsedTermsOSA X; set SO = the Sorts of (ParsedTermsOSA X); let A, B be Subset of ( the Sorts of (ParsedTermsOSA X) . s); ::_thesis: ( ( for x being set holds ( x in A iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) ) & ( for x being set holds ( x in B iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) ) implies A = B ) assume that A9: for x being set holds ( x in A iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) and A10: for x being set holds ( x in B iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) ; ::_thesis: A = B thus A c= B :: according to XBOOLE_0:def_10 ::_thesis: B c= A proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in A or x in B ) assume x in A ; ::_thesis: x in B then ex a being set st ( a in X . s & x = root-tree [a,s] ) by A9; hence x in B by A10; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in B or x in A ) assume x in B ; ::_thesis: x in A then ex a being set st ( a in X . s & x = root-tree [a,s] ) by A10; hence x in A by A9; ::_thesis: verum end; end; :: deftheorem Def23 defines PTVars OSAFREE:def_23_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S for b4 being Subset of ( the Sorts of (ParsedTermsOSA X) . s) holds ( b4 = PTVars (s,X) iff for x being set holds ( x in b4 iff ex a being set st ( a in X . s & x = root-tree [a,s] ) ) ); registration let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let s be Element of S; cluster PTVars (s,X) -> non empty ; coherence not PTVars (s,X) is empty proof consider x being set such that A1: x in X . s by XBOOLE_0:def_1; ex a being set st ( a in X . s & root-tree [x,s] = root-tree [a,s] ) by A1; hence not PTVars (s,X) is empty by Def23; ::_thesis: verum end; end; theorem Th28: :: OSAFREE:28 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S holds PTVars (s,X) = { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s being Element of S holds PTVars (s,X) = { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } let X be V16() ManySortedSet of S; ::_thesis: for s being Element of S holds PTVars (s,X) = { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } let s be Element of S; ::_thesis: PTVars (s,X) = { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } set D = DTConOSA X; set A = { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } ; thus PTVars (s,X) c= { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } :: according to XBOOLE_0:def_10 ::_thesis: { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } c= PTVars (s,X) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in PTVars (s,X) or x in { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } ) assume x in PTVars (s,X) ; ::_thesis: x in { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } then consider a being set such that A1: a in X . s and A2: x = root-tree [a,s] by Def23; A3: [a,s] in Terminals (DTConOSA X) by A1, Th4; then reconsider t = [a,s] as Symbol of (DTConOSA X) ; t `2 = s by MCART_1:7; hence x in { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } by A2, A3; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } or x in PTVars (s,X) ) assume x in { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } ; ::_thesis: x in PTVars (s,X) then consider t being Symbol of (DTConOSA X) such that A4: x = root-tree t and A5: t in Terminals (DTConOSA X) and A6: t `2 = s ; consider s1 being Element of S, a being set such that A7: a in X . s1 and A8: t = [a,s1] by A5, Th4; s = s1 by A6, A8, MCART_1:7; hence x in PTVars (s,X) by A4, A7, A8, Def23; ::_thesis: verum end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func PTVars X -> MSSubset of (ParsedTermsOSA X) means :Def24: :: OSAFREE:def 24 for s being Element of S holds it . s = PTVars (s,X); existence ex b1 being MSSubset of (ParsedTermsOSA X) st for s being Element of S holds b1 . s = PTVars (s,X) proof deffunc H1( Element of S) -> Subset of ( the Sorts of (ParsedTermsOSA X) . $1) = PTVars ($1,X); set PTA = ParsedTermsOSA X; consider f being Function such that A1: ( dom f = the carrier of S & ( for s being Element of S holds f . s = H1(s) ) ) from FUNCT_1:sch_4(); reconsider f = f as ManySortedSet of the carrier of S by A1, PARTFUN1:def_2, RELAT_1:def_18; f c= the Sorts of (ParsedTermsOSA X) proof let x be set ; :: according to PBOOLE:def_2 ::_thesis: ( not x in the carrier of S or f . x c= the Sorts of (ParsedTermsOSA X) . x ) assume x in the carrier of S ; ::_thesis: f . x c= the Sorts of (ParsedTermsOSA X) . x then reconsider s = x as Element of S ; f . s = PTVars (s,X) by A1; hence f . x c= the Sorts of (ParsedTermsOSA X) . x ; ::_thesis: verum end; then reconsider f = f as MSSubset of (ParsedTermsOSA X) by PBOOLE:def_18; take f ; ::_thesis: for s being Element of S holds f . s = PTVars (s,X) thus for s being Element of S holds f . s = PTVars (s,X) by A1; ::_thesis: verum end; uniqueness for b1, b2 being MSSubset of (ParsedTermsOSA X) st ( for s being Element of S holds b1 . s = PTVars (s,X) ) & ( for s being Element of S holds b2 . s = PTVars (s,X) ) holds b1 = b2 proof let A, B be MSSubset of (ParsedTermsOSA X); ::_thesis: ( ( for s being Element of S holds A . s = PTVars (s,X) ) & ( for s being Element of S holds B . s = PTVars (s,X) ) implies A = B ) assume that A2: for s being Element of S holds A . s = PTVars (s,X) and A3: for s being Element of S holds B . s = PTVars (s,X) ; ::_thesis: A = B for i being set st i in the carrier of S holds A . i = B . i proof let i be set ; ::_thesis: ( i in the carrier of S implies A . i = B . i ) assume i in the carrier of S ; ::_thesis: A . i = B . i then reconsider s = i as SortSymbol of S ; A . s = PTVars (s,X) by A2; hence A . i = B . i by A3; ::_thesis: verum end; hence A = B by PBOOLE:3; ::_thesis: verum end; end; :: deftheorem Def24 defines PTVars OSAFREE:def_24_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for b3 being MSSubset of (ParsedTermsOSA X) holds ( b3 = PTVars X iff for s being Element of S holds b3 . s = PTVars (s,X) ); theorem :: OSAFREE:29 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S holds PTVars X is V16() proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S holds PTVars X is V16() let X be V16() ManySortedSet of S; ::_thesis: PTVars X is V16() let x be set ; :: according to PBOOLE:def_13 ::_thesis: ( not x in the carrier of S or not (PTVars X) . x is empty ) assume x in the carrier of S ; ::_thesis: not (PTVars X) . x is empty then reconsider s = x as Element of S ; (PTVars X) . s = PTVars (s,X) by Def24; hence not (PTVars X) . x is empty ; ::_thesis: verum end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let s be Element of S; func OSFreeGen (s,X) -> Subset of ( the Sorts of (FreeOSA X) . s) means :Def25: :: OSAFREE:def 25 for x being set holds ( x in it iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ); existence ex b1 being Subset of ( the Sorts of (FreeOSA X) . s) st for x being set holds ( x in b1 iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) proof set D = DTConOSA X; set PTA = ParsedTermsOSA X; set PTC = LCongruence X; set SO = the Sorts of (FreeOSA X); set NH = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)); defpred S1[ set ] means ex a being set st ( a in X . s & $1 = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ); consider A being set such that A1: for x being set holds ( x in A iff ( x in the Sorts of (FreeOSA X) . s & S1[x] ) ) from XBOOLE_0:sch_1(); A c= the Sorts of (FreeOSA X) . s proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in A or x in the Sorts of (FreeOSA X) . s ) assume x in A ; ::_thesis: x in the Sorts of (FreeOSA X) . s hence x in the Sorts of (FreeOSA X) . s by A1; ::_thesis: verum end; then reconsider A = A as Subset of ( the Sorts of (FreeOSA X) . s) ; for x being set holds ( x in A iff S1[x] ) proof dom (coprod X) = the carrier of S by PARTFUN1:def_2; then (coprod X) . s in rng (coprod X) by FUNCT_1:def_3; then A2: coprod (s,X) in rng (coprod X) by MSAFREE:def_3; A3: Terminals (DTConOSA X) = Union (coprod X) by Th3; set A1 = { aa where aa is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & aa = root-tree [x,s1] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = aa . {} & the_result_sort_of o1 <= s ) ) } ; let x be set ; ::_thesis: ( x in A iff S1[x] ) thus ( x in A implies S1[x] ) by A1; ::_thesis: ( S1[x] implies x in A ) assume S1[x] ; ::_thesis: x in A then consider a being set such that A4: a in X . s and A5: x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ; A6: (ParsedTerms X) . s = ParsedTerms (X,s) by Def8; set sa = [a,s]; [a,s] in coprod (s,X) by A4, MSAFREE:def_2; then [a,s] in union (rng (coprod X)) by A2, TARSKI:def_4; then A7: [a,s] in Terminals (DTConOSA X) by A3, CARD_3:def_4; then reconsider sa = [a,s] as Symbol of (DTConOSA X) ; reconsider b = root-tree sa as Element of TS (DTConOSA X) by A7, DTCONSTR:def_1; b in { aa where aa is Element of TS (DTConOSA X) : ( ex s1 being Element of S ex x being set st ( s1 <= s & x in X . s1 & aa = root-tree [x,s1] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = aa . {} & the_result_sort_of o1 <= s ) ) } by A4; then ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . b in the Sorts of (QuotOSAlg ((ParsedTermsOSA X),(LCongruence X))) . s by A6, FUNCT_2:5; hence x in A by A1, A4, A5; ::_thesis: verum end; hence ex b1 being Subset of ( the Sorts of (FreeOSA X) . s) st for x being set holds ( x in b1 iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) ; ::_thesis: verum end; uniqueness for b1, b2 being Subset of ( the Sorts of (FreeOSA X) . s) st ( for x being set holds ( x in b1 iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) ) & ( for x being set holds ( x in b2 iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) ) holds b1 = b2 proof set SO = the Sorts of (FreeOSA X); set NH = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)); let A, B be Subset of ( the Sorts of (FreeOSA X) . s); ::_thesis: ( ( for x being set holds ( x in A iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) ) & ( for x being set holds ( x in B iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) ) implies A = B ) assume that A8: for x being set holds ( x in A iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) and A9: for x being set holds ( x in B iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) ; ::_thesis: A = B thus A c= B :: according to XBOOLE_0:def_10 ::_thesis: B c= A proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in A or x in B ) assume x in A ; ::_thesis: x in B then ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) by A8; hence x in B by A9; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in B or x in A ) assume x in B ; ::_thesis: x in A then ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) by A9; hence x in A by A8; ::_thesis: verum end; end; :: deftheorem Def25 defines OSFreeGen OSAFREE:def_25_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S for b4 being Subset of ( the Sorts of (FreeOSA X) . s) holds ( b4 = OSFreeGen (s,X) iff for x being set holds ( x in b4 iff ex a being set st ( a in X . s & x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ) ) ); registration let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let s be Element of S; cluster OSFreeGen (s,X) -> non empty ; coherence not OSFreeGen (s,X) is empty proof set NH = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)); defpred S1[ set ] means ex a being set st ( a in X . s & S = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) ); consider x being set such that A1: x in X . s by XBOOLE_0:def_1; S1[((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [x,s])] by A1; hence not OSFreeGen (s,X) is empty by Def25; ::_thesis: verum end; end; theorem Th30: :: OSAFREE:30 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S holds OSFreeGen (s,X) = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s being Element of S holds OSFreeGen (s,X) = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } let X be V16() ManySortedSet of S; ::_thesis: for s being Element of S holds OSFreeGen (s,X) = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } let s be Element of S; ::_thesis: OSFreeGen (s,X) = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } set D = DTConOSA X; set NH = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)); set A = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } ; thus OSFreeGen (s,X) c= { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } :: according to XBOOLE_0:def_10 ::_thesis: { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } c= OSFreeGen (s,X) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in OSFreeGen (s,X) or x in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } ) assume x in OSFreeGen (s,X) ; ::_thesis: x in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } then consider a being set such that A1: a in X . s and A2: x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) by Def25; A3: [a,s] in Terminals (DTConOSA X) by A1, Th4; then reconsider t = [a,s] as Symbol of (DTConOSA X) ; t `2 = s by MCART_1:7; hence x in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } by A2, A3; ::_thesis: verum end; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } or x in OSFreeGen (s,X) ) assume x in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } ; ::_thesis: x in OSFreeGen (s,X) then consider t being Symbol of (DTConOSA X) such that A4: x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) and A5: t in Terminals (DTConOSA X) and A6: t `2 = s ; consider s1 being Element of S, a being set such that A7: a in X . s1 and A8: t = [a,s1] by A5, Th4; s = s1 by A6, A8, MCART_1:7; hence x in OSFreeGen (s,X) by A4, A7, A8, Def25; ::_thesis: verum end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func OSFreeGen X -> OSGeneratorSet of FreeOSA X means :Def26: :: OSAFREE:def 26 for s being Element of S holds it . s = OSFreeGen (s,X); existence ex b1 being OSGeneratorSet of FreeOSA X st for s being Element of S holds b1 . s = OSFreeGen (s,X) proof deffunc H1( Element of S) -> Subset of ( the Sorts of (FreeOSA X) . $1) = OSFreeGen ($1,X); set FM = FreeOSA X; set D = DTConOSA X; set PTA = ParsedTermsOSA X; set SO = the Sorts of (FreeOSA X); set NH = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)); reconsider NH1 = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)) as ManySortedFunction of (ParsedTermsOSA X),(FreeOSA X) ; A1: NH1 is order-sorted by OSALG_4:15; reconsider SOS = the Sorts of (FreeOSA X) as OrderSortedSet of S ; consider f being Function such that A2: ( dom f = the carrier of S & ( for s being Element of S holds f . s = H1(s) ) ) from FUNCT_1:sch_4(); reconsider f = f as ManySortedSet of the carrier of S by A2, PARTFUN1:def_2, RELAT_1:def_18; A3: f c= the Sorts of (FreeOSA X) proof let x be set ; :: according to PBOOLE:def_2 ::_thesis: ( not x in the carrier of S or f . x c= the Sorts of (FreeOSA X) . x ) assume x in the carrier of S ; ::_thesis: f . x c= the Sorts of (FreeOSA X) . x then reconsider s = x as SortSymbol of S ; f . s = OSFreeGen (s,X) by A2; hence f . x c= the Sorts of (FreeOSA X) . x ; ::_thesis: verum end; then reconsider f = f as MSSubset of (FreeOSA X) by PBOOLE:def_18; OSCl f c= SOS by A3, OSALG_2:8; then OSCl f is ManySortedSubset of the Sorts of (FreeOSA X) by PBOOLE:def_18; then reconsider O = OSCl f as OSSubset of FreeOSA X by OSALG_2:def_2; O is OSSubset of GenOSAlg O by OSALG_2:def_12; then A4: O c= the Sorts of (GenOSAlg O) by PBOOLE:def_18; f c= O by OSALG_2:7; then A5: f c= the Sorts of (GenOSAlg O) by A4, PBOOLE:13; A6: NH1 is_epimorphism ParsedTermsOSA X, FreeOSA X by OSALG_4:15; then A7: NH1 is "onto" by MSUALG_3:def_8; A8: NH1 is_homomorphism ParsedTermsOSA X, FreeOSA X by A6, MSUALG_3:def_8; A9: the Sorts of (GenOSAlg O) = the Sorts of (FreeOSA X) proof defpred S1[ set ] means for s1 being Element of S st $1 in dom (NH1 . s1) holds (NH1 . s1) . $1 in the Sorts of (GenOSAlg O) . s1; reconsider O2 = the Sorts of (GenOSAlg O) as OrderSortedSet of S by OSALG_1:17; the Sorts of (GenOSAlg O) is MSSubset of (FreeOSA X) by MSUALG_2:def_9; then A10: the Sorts of (GenOSAlg O) c= the Sorts of (FreeOSA X) by PBOOLE:def_18; A11: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S1[t] ) holds S1[nt -tree ts] proof set G = GenOSAlg O; set OU = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); 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 the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) st t in rng ts holds S1[t] ) implies S1[nt -tree ts] ) assume that A12: nt ==> roots ts and A13: for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S1[t] ; ::_thesis: S1[nt -tree ts] [nt,(roots ts)] in the Rules of (DTConOSA X) by A12, LANG1:def_1; then reconsider rt = roots ts as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by ZFMISC_1:87; reconsider sy = nt as Element of [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)) ; [sy,rt] in OSREL X by A12, LANG1:def_1; then sy in [: the carrier' of S,{ the carrier of S}:] by Def4; then consider o being Element of the carrier' of S, x2 being Element of { the carrier of S} such that A14: sy = [o,x2] by DOMAIN_1:1; let s1 be Element of S; ::_thesis: ( nt -tree ts in dom (NH1 . s1) implies (NH1 . s1) . (nt -tree ts) in the Sorts of (GenOSAlg O) . s1 ) assume nt -tree ts in dom (NH1 . s1) ; ::_thesis: (NH1 . s1) . (nt -tree ts) in the Sorts of (GenOSAlg O) . s1 then nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 ; then nt -tree ts in ParsedTerms (X,s1) by Def8; then consider a1 being Element of TS (DTConOSA X) such that A15: nt -tree ts = a1 and A16: ( ex s2 being Element of S ex x being set st ( s2 <= s1 & x in X . s2 & a1 = root-tree [x,s2] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a1 . {} & the_result_sort_of o <= s1 ) ) ; A17: Seg (len rt) = dom rt by FINSEQ_1:def_3; A18: x2 = the carrier of S by TARSKI:def_1; for s2 being Element of S for x being set holds ( not s2 <= s1 or not x in X . s2 or not a1 = root-tree [x,s2] ) proof given s2 being Element of S, x being set such that s2 <= s1 and x in X . s2 and A19: a1 = root-tree [x,s2] ; ::_thesis: contradiction [x,s2] = (nt -tree ts) . {} by A15, A19, TREES_4:3 .= [o,x2] by A14, TREES_4:def_4 ; then s2 = the carrier of S by A18, XTUPLE_0:1; then s2 in s2 ; hence contradiction ; ::_thesis: verum end; then consider o1 being OperSymbol of S such that A20: [o1, the carrier of S] = a1 . {} and A21: the_result_sort_of o1 <= s1 by A16; set ar = the_arity_of o; set rs = the_result_sort_of o; A22: dom (roots ts) = dom ts by TREES_3:def_18; [nt,(roots ts)] in OSREL X by A12, LANG1:def_1; then A23: len rt = len (the_arity_of o) by A14, A18, Th2; A24: Seg (len (the_arity_of o)) = dom (the_arity_of o) by FINSEQ_1:def_3; reconsider B = the Sorts of (GenOSAlg O) as MSSubset of (FreeOSA X) by MSUALG_2:def_9; A25: dom (B * (the_arity_of o)) = dom (the_arity_of o) by PARTFUN1:def_2; set AR = the Arity of S; set RS = the ResultSort of S; set BH = (B #) * the Arity of S; the Arity of S . o = the_arity_of o by MSUALG_1:def_1; then A26: ((B #) * the Arity of S) . o = product (B * (the_arity_of o)) by MSAFREE:1; reconsider rs1 = the_result_sort_of o, s11 = s1 as Element of S ; reconsider B1 = B as OrderSortedSet of S by OSALG_1:17; A27: the ResultSort of S . o = the_result_sort_of o by MSUALG_1:def_2; B is opers_closed by MSUALG_2:def_9; then B is_closed_on o by MSUALG_2:def_6; then A28: rng ((Den (o,(FreeOSA X))) | (((B #) * the Arity of S) . o)) c= (B * the ResultSort of S) . o by MSUALG_2:def_5; A29: OSSym (o,X) = [o, the carrier of S] ; A30: nt = [o, the carrier of S] by A14, TARSKI:def_1; then A31: ts in (((ParsedTerms X) #) * the Arity of S) . o by A12, A29, Th7; then reconsider ts1 = ts as Element of Args (o,(ParsedTermsOSA X)) by MSUALG_1:def_4; Den (o,(ParsedTermsOSA X)) = (PTOper X) . o by MSUALG_1:def_6 .= PTDenOp (o,X) by Def10 ; then A32: (Den (o,(ParsedTermsOSA X))) . ts = nt -tree ts by A12, A29, A30, Def9; A33: dom ( the Sorts of (ParsedTermsOSA X) * (the_arity_of o)) = dom (the_arity_of o) by PARTFUN1:def_2; A34: for x being set st x in dom (B * (the_arity_of o)) holds (NH1 # ts1) . x in (B * (the_arity_of o)) . x proof let x be set ; ::_thesis: ( x in dom (B * (the_arity_of o)) implies (NH1 # ts1) . x in (B * (the_arity_of o)) . x ) assume A35: x in dom (B * (the_arity_of o)) ; ::_thesis: (NH1 # ts1) . x in (B * (the_arity_of o)) . x reconsider x1 = x as Nat by A35; A36: ts . x1 in rng ts by A25, A22, A23, A17, A24, A35, FUNCT_1:def_3; rng ts c= TS (DTConOSA X) by FINSEQ_1:def_4; then reconsider t = ts . x as Element of TS (DTConOSA X) by A36; ts1 . x in ( the Sorts of (ParsedTermsOSA X) * (the_arity_of o)) . x by A25, A33, A35, MSUALG_3:6; then ts1 . x in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) . x) by A25, A33, A35, FUNCT_1:12; then ts1 . x in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. x) by A25, A35, PARTFUN1:def_6; then ts1 . x1 in dom (NH1 . ((the_arity_of o) /. x1)) by FUNCT_2:def_1; then (NH1 . ((the_arity_of o) /. x1)) . t in the Sorts of (GenOSAlg O) . ((the_arity_of o) /. x1) by A13, A36; then A37: (NH1 . ((the_arity_of o) /. x1)) . (ts1 . x1) in B . ((the_arity_of o) . x) by A25, A35, PARTFUN1:def_6; (NH1 # ts1) . x1 = (NH1 . ((the_arity_of o) /. x1)) . (ts1 . x1) by A25, A22, A23, A17, A24, A35, MSUALG_3:def_6; hence (NH1 # ts1) . x in (B * (the_arity_of o)) . x by A35, A37, FUNCT_1:12; ::_thesis: verum end; NH1 # ts1 in Args (o,(FreeOSA X)) ; then A38: NH1 # ts1 in dom (Den (o,(FreeOSA X))) by FUNCT_2:def_1; [o1, the carrier of S] = [o,x2] by A14, A15, A20, TREES_4:def_4; then A39: o1 = o by XTUPLE_0:1; then A40: B1 . rs1 c= B1 . s11 by A21, OSALG_1:def_16; dom (NH1 # ts1) = dom (the_arity_of o) by MSUALG_3:6; then NH1 # ts1 in ((B #) * the Arity of S) . o by A26, A25, A34, CARD_3:9; then (Den (o,(FreeOSA X))) . (NH1 # ts1) in rng ((Den (o,(FreeOSA X))) | (((B #) * the Arity of S) . o)) by A38, FUNCT_1:50; then A41: (Den (o,(FreeOSA X))) . (NH1 # ts1) in (B * the ResultSort of S) . o by A28; ts in Args (o,(ParsedTermsOSA X)) by A31, MSUALG_1:def_4; then (Den (o,(ParsedTermsOSA X))) . ts in Result (o,(ParsedTermsOSA X)) by FUNCT_2:5; then (Den (o,(ParsedTermsOSA X))) . ts in ( the Sorts of (ParsedTermsOSA X) * the ResultSort of S) . o by MSUALG_1:def_5; then (Den (o,(ParsedTermsOSA X))) . ts in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) by A27, FUNCT_2:15; then nt -tree ts in dom (NH1 . (the_result_sort_of o)) by A32, FUNCT_2:def_1; then A42: (NH1 . s11) . (nt -tree ts) = (NH1 . rs1) . (nt -tree ts) by A1, A21, A39, OSALG_3:def_1; (NH1 . (the_result_sort_of o)) . ((Den (o,(ParsedTermsOSA X))) . ts1) = (Den (o,(FreeOSA X))) . (NH1 # ts1) by A8, MSUALG_3:def_7; then (NH1 . (the_result_sort_of o)) . (nt -tree ts) in B . (the_result_sort_of o) by A27, A32, A41, FUNCT_2:15; hence (NH1 . s1) . (nt -tree ts) in the Sorts of (GenOSAlg O) . s1 by A40, A42; ::_thesis: verum end; let x be Element of S; :: according to PBOOLE:def_21 ::_thesis: the Sorts of (GenOSAlg O) . x = the Sorts of (FreeOSA X) . x set s = x; A43: for s being Symbol of (DTConOSA X) st s in Terminals (DTConOSA X) holds S1[ root-tree s] proof let t be Symbol of (DTConOSA X); ::_thesis: ( t in Terminals (DTConOSA X) implies S1[ root-tree t] ) assume A44: t in Terminals (DTConOSA X) ; ::_thesis: S1[ root-tree t] let s1 be Element of S; ::_thesis: ( root-tree t in dom (NH1 . s1) implies (NH1 . s1) . (root-tree t) in the Sorts of (GenOSAlg O) . s1 ) assume root-tree t in dom (NH1 . s1) ; ::_thesis: (NH1 . s1) . (root-tree t) in the Sorts of (GenOSAlg O) . s1 then root-tree t in the Sorts of (ParsedTermsOSA X) . s1 ; then root-tree t in ParsedTerms (X,s1) by Def8; then consider a being Element of TS (DTConOSA X) such that A45: root-tree t = a and A46: ( ex s2 being Element of S ex x being set st ( s2 <= s1 & x in X . s2 & a = root-tree [x,s2] ) or ex o being OperSymbol of S st ( [o, the carrier of S] = a . {} & the_result_sort_of o <= s1 ) ) ; for o being OperSymbol of S holds ( not [o, the carrier of S] = a . {} or not the_result_sort_of o <= s1 ) proof consider s3 being Element of S, x3 being set such that x3 in X . s3 and A47: t = [x3,s3] by A44, Th4; given o being OperSymbol of S such that A48: [o, the carrier of S] = a . {} and the_result_sort_of o <= s1 ; ::_thesis: contradiction [o, the carrier of S] = t by A45, A48, TREES_4:3; then the carrier of S = s3 by A47, XTUPLE_0:1; then s3 in s3 ; hence contradiction ; ::_thesis: verum end; then consider s2 being Element of S, x being set such that A49: s2 <= s1 and A50: x in X . s2 and A51: a = root-tree [x,s2] by A46; reconsider s11 = s1, s21 = s2 as Element of S ; a in ParsedTerms (X,s2) by A50, A51; then a in (ParsedTerms X) . s2 by Def8; then root-tree [x,s2] in dom (NH1 . s2) by A51, FUNCT_2:def_1; then A52: (NH1 . s21) . (root-tree [x,s2]) = (NH1 . s11) . (root-tree [x,s2]) by A1, A49, OSALG_3:def_1; f . s2 c= the Sorts of (GenOSAlg O) . s2 by A5, PBOOLE:def_2; then A53: OSFreeGen (s2,X) c= the Sorts of (GenOSAlg O) . s2 by A2; O2 . s21 c= O2 . s11 by A49, OSALG_1:def_16; then A54: OSFreeGen (s2,X) c= the Sorts of (GenOSAlg O) . s1 by A53, XBOOLE_1:1; (NH1 . s2) . (root-tree [x,s2]) in OSFreeGen (s2,X) by A50, Def25; hence (NH1 . s1) . (root-tree t) in the Sorts of (GenOSAlg O) . s1 by A45, A51, A52, A54; ::_thesis: verum end; A55: for t being DecoratedTree of the carrier of (DTConOSA X) st t in TS (DTConOSA X) holds S1[t] from DTCONSTR:sch_7(A43, A11); thus the Sorts of (GenOSAlg O) . x c= the Sorts of (FreeOSA X) . x by A10, PBOOLE:def_2; :: according to XBOOLE_0:def_10 ::_thesis: the Sorts of (FreeOSA X) . x c= the Sorts of (GenOSAlg O) . x let x1 be set ; :: according to TARSKI:def_3 ::_thesis: ( not x1 in the Sorts of (FreeOSA X) . x or x1 in the Sorts of (GenOSAlg O) . x ) assume A56: x1 in the Sorts of (FreeOSA X) . x ; ::_thesis: x1 in the Sorts of (GenOSAlg O) . x A57: the Sorts of (ParsedTermsOSA X) . x = ParsedTerms (X,x) by Def8 .= { a where a is Element of TS (DTConOSA X) : ( ex s2 being Element of S ex x being set st ( s2 <= x & x in X . s2 & a = root-tree [x,s2] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = a . {} & the_result_sort_of o1 <= x ) ) } ; rng (NH1 . x) = the Sorts of (FreeOSA X) . x by A7, MSUALG_3:def_3; then consider x2 being set such that A58: x2 in dom (NH1 . x) and A59: x1 = (NH1 . x) . x2 by A56, FUNCT_1:def_3; x2 in the Sorts of (ParsedTermsOSA X) . x by A58; then ex a being Element of TS (DTConOSA X) st ( a = x2 & ( ex s2 being Element of S ex x being set st ( s2 <= x & x in X . s2 & a = root-tree [x,s2] ) or ex o1 being OperSymbol of S st ( [o1, the carrier of S] = a . {} & the_result_sort_of o1 <= x ) ) ) by A57; hence x1 in the Sorts of (GenOSAlg O) . x by A55, A58, A59; ::_thesis: verum end; f is OSGeneratorSet of FreeOSA X proof let O1 be OSSubset of FreeOSA X; :: according to OSAFREE:def_1 ::_thesis: ( O1 = OSCl f implies the Sorts of (GenOSAlg O1) = the Sorts of (FreeOSA X) ) assume O1 = OSCl f ; ::_thesis: the Sorts of (GenOSAlg O1) = the Sorts of (FreeOSA X) hence the Sorts of (GenOSAlg O1) = the Sorts of (FreeOSA X) by A9; ::_thesis: verum end; then reconsider f = f as OSGeneratorSet of FreeOSA X ; take f ; ::_thesis: for s being Element of S holds f . s = OSFreeGen (s,X) thus for s being Element of S holds f . s = OSFreeGen (s,X) by A2; ::_thesis: verum end; uniqueness for b1, b2 being OSGeneratorSet of FreeOSA X st ( for s being Element of S holds b1 . s = OSFreeGen (s,X) ) & ( for s being Element of S holds b2 . s = OSFreeGen (s,X) ) holds b1 = b2 proof let A, B be OSGeneratorSet of FreeOSA X; ::_thesis: ( ( for s being Element of S holds A . s = OSFreeGen (s,X) ) & ( for s being Element of S holds B . s = OSFreeGen (s,X) ) implies A = B ) assume that A60: for s being Element of S holds A . s = OSFreeGen (s,X) and A61: for s being Element of S holds B . s = OSFreeGen (s,X) ; ::_thesis: A = B for i being set st i in the carrier of S holds A . i = B . i proof let i be set ; ::_thesis: ( i in the carrier of S implies A . i = B . i ) assume i in the carrier of S ; ::_thesis: A . i = B . i then reconsider s = i as SortSymbol of S ; A . s = OSFreeGen (s,X) by A60; hence A . i = B . i by A61; ::_thesis: verum end; hence A = B by PBOOLE:3; ::_thesis: verum end; end; :: deftheorem Def26 defines OSFreeGen OSAFREE:def_26_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for b3 being OSGeneratorSet of FreeOSA X holds ( b3 = OSFreeGen X iff for s being Element of S holds b3 . s = OSFreeGen (s,X) ); theorem Th31: :: OSAFREE:31 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S holds OSFreeGen X is V16() proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S holds OSFreeGen X is V16() let X be V16() ManySortedSet of S; ::_thesis: OSFreeGen X is V16() let x be set ; :: according to PBOOLE:def_13 ::_thesis: ( not x in the carrier of S or not (OSFreeGen X) . x is empty ) assume x in the carrier of S ; ::_thesis: not (OSFreeGen X) . x is empty then reconsider s = x as Element of S ; (OSFreeGen X) . s = OSFreeGen (s,X) by Def26; hence not (OSFreeGen X) . x is empty ; ::_thesis: verum end; registration let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; cluster OSFreeGen X -> V16() ; coherence OSFreeGen X is non-empty by Th31; end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let R be OSCongruence of ParsedTermsOSA X; let t be Element of TS (DTConOSA X); func OSClass (R,t) -> Element of OSClass (R,(LeastSort t)) means :Def27: :: OSAFREE:def 27 for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds it = OSClass (R,x); existence ex b1 being Element of OSClass (R,(LeastSort t)) st for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds b1 = OSClass (R,x) proof set LS = LeastSort t; set PTA = ParsedTermsOSA X; reconsider x1 = t as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort t) by Def12; take OSClass (R,x1) ; ::_thesis: for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds OSClass (R,x1) = OSClass (R,x) let s be Element of S; ::_thesis: for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds OSClass (R,x1) = OSClass (R,x) let x be Element of the Sorts of (ParsedTermsOSA X) . s; ::_thesis: ( t = x implies OSClass (R,x1) = OSClass (R,x) ) assume A1: t = x ; ::_thesis: OSClass (R,x1) = OSClass (R,x) LeastSort t <= s by A1, Def12; hence OSClass (R,x1) = OSClass (R,x) by A1, OSALG_4:13; ::_thesis: verum end; uniqueness for b1, b2 being Element of OSClass (R,(LeastSort t)) st ( for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds b1 = OSClass (R,x) ) & ( for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds b2 = OSClass (R,x) ) holds b1 = b2 proof set LS = LeastSort t; set PTA = ParsedTermsOSA X; reconsider x1 = t as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort t) by Def12; let O1, O2 be Element of OSClass (R,(LeastSort t)); ::_thesis: ( ( for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds O1 = OSClass (R,x) ) & ( for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds O2 = OSClass (R,x) ) implies O1 = O2 ) assume that A2: for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds O1 = OSClass (R,x) and A3: for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds O2 = OSClass (R,x) ; ::_thesis: O1 = O2 thus O1 = OSClass (R,x1) by A2 .= O2 by A3 ; ::_thesis: verum end; end; :: deftheorem Def27 defines OSClass OSAFREE:def_27_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for R being OSCongruence of ParsedTermsOSA X for t being Element of TS (DTConOSA X) for b5 being Element of OSClass (R,(LeastSort t)) holds ( b5 = OSClass (R,t) iff for s being Element of S for x being Element of the Sorts of (ParsedTermsOSA X) . s st t = x holds b5 = OSClass (R,x) ); theorem Th32: :: OSAFREE:32 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for R being OSCongruence of ParsedTermsOSA X for t being Element of TS (DTConOSA X) holds t in OSClass (R,t) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for R being OSCongruence of ParsedTermsOSA X for t being Element of TS (DTConOSA X) holds t in OSClass (R,t) let X be V16() ManySortedSet of S; ::_thesis: for R being OSCongruence of ParsedTermsOSA X for t being Element of TS (DTConOSA X) holds t in OSClass (R,t) let R be OSCongruence of ParsedTermsOSA X; ::_thesis: for t being Element of TS (DTConOSA X) holds t in OSClass (R,t) let t be Element of TS (DTConOSA X); ::_thesis: t in OSClass (R,t) set PTA = ParsedTermsOSA X; reconsider x = t as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort t) by Def12; OSClass (R,t) = OSClass (R,x) by Def27 .= Class ((CompClass (R,(CComp (LeastSort t)))),x) ; hence t in OSClass (R,t) by EQREL_1:20, OSALG_4:5; ::_thesis: verum end; theorem Th33: :: OSAFREE:33 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S for t being Element of TS (DTConOSA X) for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((PTCongruence X),t) iff x1 = t ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s being Element of S for t being Element of TS (DTConOSA X) for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((PTCongruence X),t) iff x1 = t ) let X be V16() ManySortedSet of S; ::_thesis: for s being Element of S for t being Element of TS (DTConOSA X) for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((PTCongruence X),t) iff x1 = t ) let s be Element of S; ::_thesis: for t being Element of TS (DTConOSA X) for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((PTCongruence X),t) iff x1 = t ) let t be Element of TS (DTConOSA X); ::_thesis: for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((PTCongruence X),t) iff x1 = t ) set PTA = ParsedTermsOSA X; set D = DTConOSA X; set R = PTCongruence X; reconsider y = t as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort t) by Def12; let x, x1 be set ; ::_thesis: ( x in X . s & t = root-tree [x,s] implies ( x1 in OSClass ((PTCongruence X),t) iff x1 = t ) ) assume that A1: x in X . s and A2: t = root-tree [x,s] ; ::_thesis: ( x1 in OSClass ((PTCongruence X),t) iff x1 = t ) A3: [x,s] in Terminals (DTConOSA X) by A1, Th4; then reconsider sy = [x,s] as Symbol of (DTConOSA X) ; A4: OSClass ((PTCongruence X),t) = OSClass ((PTCongruence X),y) by Def27 .= proj1 ((PTClasses X) . y) by Th25 ; A5: (PTClasses X) . (root-tree sy) = @ sy by A3, Def21 .= { [(root-tree sy),s1] where s1 is Element of S : ex s2 being Element of S ex x2 being set st ( x2 in X . s2 & sy = [x2,s2] & s2 <= s1 ) } ; hereby ::_thesis: ( x1 = t implies x1 in OSClass ((PTCongruence X),t) ) assume x1 in OSClass ((PTCongruence X),t) ; ::_thesis: x1 = t then consider z being set such that A6: [x1,z] in (PTClasses X) . y by A4, XTUPLE_0:def_12; ex s1 being Element of S st ( [x1,z] = [(root-tree sy),s1] & ex s2 being Element of S ex x2 being set st ( x2 in X . s2 & sy = [x2,s2] & s2 <= s1 ) ) by A2, A5, A6; hence x1 = t by A2, XTUPLE_0:1; ::_thesis: verum end; assume x1 = t ; ::_thesis: x1 in OSClass ((PTCongruence X),t) then [x1,s] in (PTClasses X) . y by A1, A2, A5; hence x1 in OSClass ((PTCongruence X),t) by A4, XTUPLE_0:def_12; ::_thesis: verum end; theorem Th34: :: OSAFREE:34 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for R being OSCongruence of ParsedTermsOSA X for t1, t2 being Element of TS (DTConOSA X) holds ( t2 in OSClass (R,t1) iff OSClass (R,t1) = OSClass (R,t2) ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for R being OSCongruence of ParsedTermsOSA X for t1, t2 being Element of TS (DTConOSA X) holds ( t2 in OSClass (R,t1) iff OSClass (R,t1) = OSClass (R,t2) ) let X be V16() ManySortedSet of S; ::_thesis: for R being OSCongruence of ParsedTermsOSA X for t1, t2 being Element of TS (DTConOSA X) holds ( t2 in OSClass (R,t1) iff OSClass (R,t1) = OSClass (R,t2) ) let R be OSCongruence of ParsedTermsOSA X; ::_thesis: for t1, t2 being Element of TS (DTConOSA X) holds ( t2 in OSClass (R,t1) iff OSClass (R,t1) = OSClass (R,t2) ) let t1, t2 be Element of TS (DTConOSA X); ::_thesis: ( t2 in OSClass (R,t1) iff OSClass (R,t1) = OSClass (R,t2) ) set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); reconsider x1 = t1 as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort t1) by Def12; set CC1 = CComp (LeastSort t1); set CR1 = CompClass (R,(CComp (LeastSort t1))); A1: OSClass (R,t1) = OSClass (R,x1) by Def27 .= Class ((CompClass (R,(CComp (LeastSort t1)))),x1) ; hereby ::_thesis: ( OSClass (R,t1) = OSClass (R,t2) implies t2 in OSClass (R,t1) ) assume t2 in OSClass (R,t1) ; ::_thesis: OSClass (R,t1) = OSClass (R,t2) then [t2,x1] in CompClass (R,(CComp (LeastSort t1))) by A1, EQREL_1:19; then consider s2 being Element of S such that s2 in CComp (LeastSort t1) and A2: [t2,x1] in R . s2 by OSALG_4:def_9; reconsider x11 = x1, x22 = t2 as Element of the Sorts of (ParsedTermsOSA X) . s2 by A2, ZFMISC_1:87; thus OSClass (R,t1) = OSClass (R,x11) by Def27 .= OSClass (R,x22) by A2, OSALG_4:12 .= OSClass (R,t2) by Def27 ; ::_thesis: verum end; assume OSClass (R,t1) = OSClass (R,t2) ; ::_thesis: t2 in OSClass (R,t1) hence t2 in OSClass (R,t1) by Th32; ::_thesis: verum end; theorem Th35: :: OSAFREE:35 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for R1, R2 being OSCongruence of ParsedTermsOSA X for t being Element of TS (DTConOSA X) st R1 c= R2 holds OSClass (R1,t) c= OSClass (R2,t) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for R1, R2 being OSCongruence of ParsedTermsOSA X for t being Element of TS (DTConOSA X) st R1 c= R2 holds OSClass (R1,t) c= OSClass (R2,t) let X be V16() ManySortedSet of S; ::_thesis: for R1, R2 being OSCongruence of ParsedTermsOSA X for t being Element of TS (DTConOSA X) st R1 c= R2 holds OSClass (R1,t) c= OSClass (R2,t) let R1, R2 be OSCongruence of ParsedTermsOSA X; ::_thesis: for t being Element of TS (DTConOSA X) st R1 c= R2 holds OSClass (R1,t) c= OSClass (R2,t) let t be Element of TS (DTConOSA X); ::_thesis: ( R1 c= R2 implies OSClass (R1,t) c= OSClass (R2,t) ) set s = LeastSort t; set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); set D = DTConOSA X; set CC1 = CComp (LeastSort t); set CR1 = CompClass (R1,(CComp (LeastSort t))); reconsider xa = t as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort t) by Def12; assume A1: R1 c= R2 ; ::_thesis: OSClass (R1,t) c= OSClass (R2,t) A2: OSClass (R1,t) = OSClass (R1,xa) by Def27 .= Class ((CompClass (R1,(CComp (LeastSort t)))),xa) ; let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in OSClass (R1,t) or x in OSClass (R2,t) ) assume x in OSClass (R1,t) ; ::_thesis: x in OSClass (R2,t) then [x,xa] in CompClass (R1,(CComp (LeastSort t))) by A2, EQREL_1:19; then consider s1 being Element of S such that s1 in CComp (LeastSort t) and A3: [x,xa] in R1 . s1 by OSALG_4:def_9; reconsider xa = t, xb = x as Element of the Sorts of (ParsedTermsOSA X) . s1 by A3, ZFMISC_1:87; A4: R1 . s1 c= R2 . s1 by A1, PBOOLE:def_2; x in the Sorts of (ParsedTermsOSA X) . s1 by A3, ZFMISC_1:87; then reconsider t1 = x as Element of TS (DTConOSA X) by Th15; OSClass (R2,t1) = OSClass (R2,xb) by Def27 .= OSClass (R2,xa) by A3, A4, OSALG_4:12 .= OSClass (R2,t) by Def27 ; hence x in OSClass (R2,t) by Th34; ::_thesis: verum end; theorem Th36: :: OSAFREE:36 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S for t being Element of TS (DTConOSA X) for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((LCongruence X),t) iff x1 = t ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for s being Element of S for t being Element of TS (DTConOSA X) for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((LCongruence X),t) iff x1 = t ) let X be V16() ManySortedSet of S; ::_thesis: for s being Element of S for t being Element of TS (DTConOSA X) for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((LCongruence X),t) iff x1 = t ) let s be Element of S; ::_thesis: for t being Element of TS (DTConOSA X) for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((LCongruence X),t) iff x1 = t ) let t be Element of TS (DTConOSA X); ::_thesis: for x, x1 being set st x in X . s & t = root-tree [x,s] holds ( x1 in OSClass ((LCongruence X),t) iff x1 = t ) set R = LCongruence X; set R1 = PTCongruence X; let x, x1 be set ; ::_thesis: ( x in X . s & t = root-tree [x,s] implies ( x1 in OSClass ((LCongruence X),t) iff x1 = t ) ) assume that A1: x in X . s and A2: t = root-tree [x,s] ; ::_thesis: ( x1 in OSClass ((LCongruence X),t) iff x1 = t ) LCongruence X c= PTCongruence X by Def17; then OSClass ((LCongruence X),t) c= OSClass ((PTCongruence X),t) by Th35; hence ( x1 in OSClass ((LCongruence X),t) implies x1 = t ) by A1, A2, Th33; ::_thesis: ( x1 = t implies x1 in OSClass ((LCongruence X),t) ) assume x1 = t ; ::_thesis: x1 in OSClass ((LCongruence X),t) hence x1 in OSClass ((LCongruence X),t) by Th32; ::_thesis: verum end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let A be V16() ManySortedSet of the carrier of S; let F be ManySortedFunction of PTVars X,A; let t be Symbol of (DTConOSA X); assume A1: t in Terminals (DTConOSA X) ; func pi (F,A,t) -> Element of Union A means :Def28: :: OSAFREE:def 28 for f being Function st f = F . (t `2) holds it = f . (root-tree t); existence ex b1 being Element of Union A st for f being Function st f = F . (t `2) holds b1 = f . (root-tree t) proof set FG = PTVars X; set D = DTConOSA X; consider s being Element of S, x being set such that x in X . s and A2: t = [x,s] by A1, Th4; (PTVars X) . s = PTVars (s,X) by Def24; then A3: dom (F . s) = PTVars (s,X) by FUNCT_2:def_1 .= { (root-tree tt) where tt is Symbol of (DTConOSA X) : ( tt in Terminals (DTConOSA X) & tt `2 = s ) } by Th28 ; t `2 = s by A2, MCART_1:7; then root-tree t in dom (F . s) by A1, A3; then A4: (F . s) . (root-tree t) in rng (F . s) by FUNCT_1:def_3; dom A = the carrier of S by PARTFUN1:def_2; then A5: A . s in rng A by FUNCT_1:def_3; rng (F . s) c= A . s by RELAT_1:def_19; then (F . s) . (root-tree t) in union (rng A) by A4, A5, TARSKI:def_4; then reconsider eu = (F . s) . (root-tree t) as Element of Union A by CARD_3:def_4; take eu ; ::_thesis: for f being Function st f = F . (t `2) holds eu = f . (root-tree t) let f be Function; ::_thesis: ( f = F . (t `2) implies eu = f . (root-tree t) ) assume f = F . (t `2) ; ::_thesis: eu = f . (root-tree t) hence eu = f . (root-tree t) by A2, MCART_1:7; ::_thesis: verum end; uniqueness for b1, b2 being Element of Union A st ( for f being Function st f = F . (t `2) holds b1 = f . (root-tree t) ) & ( for f being Function st f = F . (t `2) holds b2 = f . (root-tree t) ) holds b1 = b2 proof consider s being Element of S, x being set such that x in X . s and A6: t = [x,s] by A1, Th4; reconsider f = F . s as Function ; let a, b be Element of Union A; ::_thesis: ( ( for f being Function st f = F . (t `2) holds a = f . (root-tree t) ) & ( for f being Function st f = F . (t `2) holds b = f . (root-tree t) ) implies a = b ) assume that A7: for f being Function st f = F . (t `2) holds a = f . (root-tree t) and A8: for f being Function st f = F . (t `2) holds b = f . (root-tree t) ; ::_thesis: a = b A9: f = F . (t `2) by A6, MCART_1:7; then a = f . (root-tree t) by A7; hence a = b by A8, A9; ::_thesis: verum end; end; :: deftheorem Def28 defines pi OSAFREE:def_28_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for A being V16() ManySortedSet of the carrier of S for F being ManySortedFunction of PTVars X,A for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds for b6 being Element of Union A holds ( b6 = pi (F,A,t) iff for f being Function st f = F . (t `2) holds b6 = f . (root-tree t) ); theorem Th37: :: OSAFREE:37 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for U1 being non-empty monotone OSAlgebra of S for f being ManySortedFunction of PTVars X, the Sorts of U1 ex h being ManySortedFunction of (ParsedTermsOSA X),U1 st ( h is_homomorphism ParsedTermsOSA X,U1 & h is order-sorted & h || (PTVars X) = f ) proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for U1 being non-empty monotone OSAlgebra of S for f being ManySortedFunction of PTVars X, the Sorts of U1 ex h being ManySortedFunction of (ParsedTermsOSA X),U1 st ( h is_homomorphism ParsedTermsOSA X,U1 & h is order-sorted & h || (PTVars X) = f ) let X be V16() ManySortedSet of S; ::_thesis: for U1 being non-empty monotone OSAlgebra of S for f being ManySortedFunction of PTVars X, the Sorts of U1 ex h being ManySortedFunction of (ParsedTermsOSA X),U1 st ( h is_homomorphism ParsedTermsOSA X,U1 & h is order-sorted & h || (PTVars X) = f ) set D = DTConOSA X; set PTA = ParsedTermsOSA X; set PV = PTVars X; set SPTA = the Sorts of (ParsedTermsOSA X); let U1 be non-empty monotone OSAlgebra of S; ::_thesis: for f being ManySortedFunction of PTVars X, the Sorts of U1 ex h being ManySortedFunction of (ParsedTermsOSA X),U1 st ( h is_homomorphism ParsedTermsOSA X,U1 & h is order-sorted & h || (PTVars X) = f ) let F be ManySortedFunction of PTVars X, the Sorts of U1; ::_thesis: ex h being ManySortedFunction of (ParsedTermsOSA X),U1 st ( h is_homomorphism ParsedTermsOSA X,U1 & h is order-sorted & h || (PTVars X) = F ) set SA = the Sorts of (ParsedTermsOSA X); set AR = the Arity of S; set S1 = the Sorts of U1; set O = the carrier' of S; set RS = the ResultSort of S; reconsider SAO = the Sorts of (ParsedTermsOSA X), S1O = the Sorts of U1 as OrderSortedSet of S by OSALG_1:17; deffunc H1( Symbol of (DTConOSA X)) -> Element of Union the Sorts of U1 = pi (F, the Sorts of U1,$1); deffunc H2( Symbol of (DTConOSA X), set , FinSequence) -> Element of Union the Sorts of U1 = pi ((@ (X,$1)),U1,$3); consider G being Function of (TS (DTConOSA X)),(Union the Sorts of U1) such that A1: for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds G . (root-tree t) = H1(t) and A2: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds G . (nt -tree ts) = H2(nt, roots ts,G * ts) from DTCONSTR:sch_8(); deffunc H3( set ) -> Element of bool [:(TS (DTConOSA X)),(Union the Sorts of U1):] = G | ( the Sorts of (ParsedTermsOSA X) . $1); consider h being Function such that A3: ( dom h = the carrier of S & ( for s being set st s in the carrier of S holds h . s = H3(s) ) ) from FUNCT_1:sch_3(); reconsider h = h as ManySortedSet of the carrier of S by A3, PARTFUN1:def_2, RELAT_1:def_18; for s being set st s in dom h holds h . s is Function proof let s be set ; ::_thesis: ( s in dom h implies h . s is Function ) assume s in dom h ; ::_thesis: h . s is Function then h . s = G | ( the Sorts of (ParsedTermsOSA X) . s) by A3; hence h . s is Function ; ::_thesis: verum end; then reconsider h = h as ManySortedFunction of the carrier of S by FUNCOP_1:def_6; defpred S1[ set ] means for s being Element of S st $1 in the Sorts of (ParsedTermsOSA X) . s holds (h . s) . $1 in the Sorts of U1 . s; A4: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts & ( for t being DecoratedTree of the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) 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 the carrier of (DTConOSA X) st t in rng ts holds S1[t] ) implies S1[nt -tree ts] ) assume that A5: nt ==> roots ts and A6: for t being DecoratedTree of the carrier of (DTConOSA X) st t in rng ts holds S1[t] ; ::_thesis: S1[nt -tree ts] set p = G * ts; set o = @ (X,nt); set ar = the_arity_of (@ (X,nt)); set rs = the_result_sort_of (@ (X,nt)); set OU = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); set rt = roots ts; A7: [(@ (X,nt)), the carrier of S] = nt by A5, Def15; then A8: [[(@ (X,nt)), the carrier of S],(roots ts)] in the Rules of (DTConOSA X) by A5, LANG1:def_1; let s be Element of S; ::_thesis: ( nt -tree ts in the Sorts of (ParsedTermsOSA X) . s implies (h . s) . (nt -tree ts) in the Sorts of U1 . s ) reconsider s2 = s as Element of S ; assume A9: nt -tree ts in the Sorts of (ParsedTermsOSA X) . s ; ::_thesis: (h . s) . (nt -tree ts) in the Sorts of U1 . s consider op being OperSymbol of S such that A10: nt = [op, the carrier of S] and ts in Args (op,(ParsedTermsOSA X)) and nt -tree ts = (Den (op,(ParsedTermsOSA X))) . ts and A11: for s1 being Element of S holds ( nt -tree ts in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of op <= s1 ) by A5, Th12; op = @ (X,nt) by A5, A10, Def15; then the_result_sort_of (@ (X,nt)) <= s by A9, A11; then A12: S1O . (the_result_sort_of (@ (X,nt))) c= S1O . s2 by OSALG_1:def_16; A13: rng (Den ((@ (X,nt)),U1)) c= Result ((@ (X,nt)),U1) by RELAT_1:def_19; A14: dom ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) = dom (the_arity_of (@ (X,nt))) by PARTFUN1:def_2; A15: [(@ (X,nt)), the carrier of S] = OSSym ((@ (X,nt)),X) ; then A16: (PTDenOp ((@ (X,nt)),X)) . ts = nt -tree ts by A5, A7, Def9; A17: dom ( the Sorts of (ParsedTermsOSA X) * (the_arity_of (@ (X,nt)))) = dom (the_arity_of (@ (X,nt))) by PARTFUN1:def_2; dom (PTDenOp ((@ (X,nt)),X)) = (((ParsedTerms X) #) * the Arity of S) . (@ (X,nt)) by FUNCT_2:def_1; then ts in dom (PTDenOp ((@ (X,nt)),X)) by A5, A7, A15, Th7; then A18: nt -tree ts in rng (PTDenOp ((@ (X,nt)),X)) by A16, FUNCT_1:def_3; A19: h . (the_result_sort_of (@ (X,nt))) = G | ( the Sorts of (ParsedTermsOSA X) . (the_result_sort_of (@ (X,nt)))) by A3; A20: Seg (len (the_arity_of (@ (X,nt)))) = dom (the_arity_of (@ (X,nt))) by FINSEQ_1:def_3; A21: rng (the_arity_of (@ (X,nt))) c= the carrier of S by FINSEQ_1:def_4; A22: the_arity_of (@ (X,nt)) = the Arity of S . (@ (X,nt)) by MSUALG_1:def_1; A23: dom (roots ts) = dom ts by TREES_3:def_18; reconsider rt = roots ts as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by A8, ZFMISC_1:87; A24: len rt = len (the_arity_of (@ (X,nt))) by A8, Th2; A25: dom rt = Seg (len rt) by FINSEQ_1:def_3; A26: dom (G * ts) = dom ts by FINSEQ_3:120; then A27: dom (G * ts) = dom ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) by A23, A14, A8, A25, A20, Th2; A28: for x being set st x in dom ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) holds (G * ts) . x in ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) . x proof let x be set ; ::_thesis: ( x in dom ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) implies (G * ts) . x in ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) . x ) assume A29: x in dom ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) ; ::_thesis: (G * ts) . x in ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) . x then reconsider n = x as Nat ; A30: ts . n in rng ts by A23, A14, A24, A25, A20, A29, FUNCT_1:def_3; rng ts c= TS (DTConOSA X) by FINSEQ_1:def_4; then reconsider t = ts . n as Element of TS (DTConOSA X) by A30; A31: (G * ts) . n = G . (ts . n) by A27, A29, FINSEQ_3:120; (the_arity_of (@ (X,nt))) . x in rng (the_arity_of (@ (X,nt))) by A14, A29, FUNCT_1:def_3; then reconsider s = (the_arity_of (@ (X,nt))) . x as Element of S by A21; A32: h . s = G | ( the Sorts of (ParsedTermsOSA X) . s) by A3; dom the Sorts of (ParsedTermsOSA X) = the carrier of S by PARTFUN1:def_2; then A33: the Sorts of (ParsedTermsOSA X) . s in rng the Sorts of (ParsedTermsOSA X) by FUNCT_1:def_3; dom G = TS (DTConOSA X) by FUNCT_2:def_1 .= union (rng the Sorts of (ParsedTermsOSA X)) by Th8 ; then A34: dom (h . s) = the Sorts of (ParsedTermsOSA X) . s by A32, A33, RELAT_1:62, ZFMISC_1:74; ts in (((ParsedTerms X) #) * the Arity of S) . (@ (X,nt)) by A5, A7, A15, Th7; then ts in product ((ParsedTerms X) * (the_arity_of (@ (X,nt)))) by A22, MSAFREE:1; then ts . x in ((ParsedTerms X) * (the_arity_of (@ (X,nt)))) . x by A14, A17, A29, CARD_3:9; then A35: ts . x in (ParsedTerms X) . ((the_arity_of (@ (X,nt))) . x) by A14, A17, A29, FUNCT_1:12; then (h . s) . t in the Sorts of U1 . s by A6, A30; then G . t in the Sorts of U1 . s by A35, A32, A34, FUNCT_1:47; hence (G * ts) . x in ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) . x by A29, A31, FUNCT_1:12; ::_thesis: verum end; set ppi = pi ((@ (X,nt)),U1,(G * ts)); A36: dom (Den ((@ (X,nt)),U1)) = Args ((@ (X,nt)),U1) by FUNCT_2:def_1; A37: dom the ResultSort of S = the carrier' of S by FUNCT_2:def_1; Args ((@ (X,nt)),U1) = (( the Sorts of U1 #) * the Arity of S) . (@ (X,nt)) by MSUALG_1:def_4 .= product ( the Sorts of U1 * (the_arity_of (@ (X,nt)))) by A22, MSAFREE:1 ; then A38: G * ts in Args ((@ (X,nt)),U1) by A26, A23, A14, A24, A25, A20, A28, CARD_3:9; then pi ((@ (X,nt)),U1,(G * ts)) = (Den ((@ (X,nt)),U1)) . (G * ts) by MSAFREE:def_21; then pi ((@ (X,nt)),U1,(G * ts)) in rng (Den ((@ (X,nt)),U1)) by A38, A36, FUNCT_1:def_3; then A39: pi ((@ (X,nt)),U1,(G * ts)) in Result ((@ (X,nt)),U1) by A13; h . s = G | ( the Sorts of (ParsedTermsOSA X) . s) by A3; then A40: (h . s) . (nt -tree ts) = G . (nt -tree ts) by A9, FUNCT_1:49; A41: rng the ResultSort of S c= the carrier of S by RELAT_1:def_19; dom the Sorts of (ParsedTermsOSA X) = the carrier of S by PARTFUN1:def_2; then A42: dom ( the Sorts of (ParsedTermsOSA X) * the ResultSort of S) = dom the ResultSort of S by A41, RELAT_1:27; dom the Sorts of U1 = the carrier of S by PARTFUN1:def_2; then A43: dom ( the Sorts of U1 * the ResultSort of S) = dom the ResultSort of S by A41, RELAT_1:27; rng (PTDenOp ((@ (X,nt)),X)) c= ((ParsedTerms X) * the ResultSort of S) . (@ (X,nt)) by RELAT_1:def_19; then nt -tree ts in ( the Sorts of (ParsedTermsOSA X) * the ResultSort of S) . (@ (X,nt)) by A18; then nt -tree ts in the Sorts of (ParsedTermsOSA X) . ( the ResultSort of S . (@ (X,nt))) by A37, A42, FUNCT_1:12; then A44: nt -tree ts in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of (@ (X,nt))) by MSUALG_1:def_2; G . (nt -tree ts) = pi ((@ (X,nt)),U1,(G * ts)) by A2, A5; then A45: pi ((@ (X,nt)),U1,(G * ts)) = (G | ( the Sorts of (ParsedTermsOSA X) . (the_result_sort_of (@ (X,nt))))) . (nt -tree ts) by A44, FUNCT_1:49; Result ((@ (X,nt)),U1) = ( the Sorts of U1 * the ResultSort of S) . (@ (X,nt)) by MSUALG_1:def_5 .= the Sorts of U1 . ( the ResultSort of S . (@ (X,nt))) by A43, A37, FUNCT_1:12 .= the Sorts of U1 . (the_result_sort_of (@ (X,nt))) by MSUALG_1:def_2 ; then (h . (the_result_sort_of (@ (X,nt)))) . (nt -tree ts) in the Sorts of U1 . s by A39, A45, A19, A12; hence (h . s) . (nt -tree ts) in the Sorts of U1 . s by A44, A19, A40, FUNCT_1:49; ::_thesis: verum end; A46: for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds S1[ root-tree t] proof let t be Symbol of (DTConOSA X); ::_thesis: ( t in Terminals (DTConOSA X) implies S1[ root-tree t] ) assume A47: t in Terminals (DTConOSA X) ; ::_thesis: S1[ root-tree t] then consider s being Element of S, x being set such that A48: x in X . s and A49: t = [x,s] by Th4; reconsider s = s as SortSymbol of S ; set E = { (root-tree tt) where tt is Symbol of (DTConOSA X) : ( tt in Terminals (DTConOSA X) & tt `2 = s ) } ; set a = root-tree t; A50: t `2 = s by A49, MCART_1:7; then A51: root-tree t in { (root-tree tt) where tt is Symbol of (DTConOSA X) : ( tt in Terminals (DTConOSA X) & tt `2 = s ) } by A47; reconsider f = F . s as Function of ((PTVars X) . s),( the Sorts of U1 . s) ; A52: dom f = (PTVars X) . s by FUNCT_2:def_1; A53: rng f c= the Sorts of U1 . s by RELAT_1:def_19; A54: { (root-tree tt) where tt is Symbol of (DTConOSA X) : ( tt in Terminals (DTConOSA X) & tt `2 = s ) } = PTVars (s,X) by Th28; then (PTVars X) . s = { (root-tree tt) where tt is Symbol of (DTConOSA X) : ( tt in Terminals (DTConOSA X) & tt `2 = s ) } by Def24; then f . (root-tree t) in rng f by A51, A52, FUNCT_1:def_3; then A55: f . (root-tree t) in the Sorts of U1 . s by A53; let s1 be Element of S; ::_thesis: ( root-tree t in the Sorts of (ParsedTermsOSA X) . s1 implies (h . s1) . (root-tree t) in the Sorts of U1 . s1 ) reconsider s0 = s, s11 = s1 as Element of S ; assume A56: root-tree t in the Sorts of (ParsedTermsOSA X) . s1 ; ::_thesis: (h . s1) . (root-tree t) in the Sorts of U1 . s1 then s <= s1 by A48, A49, Th10; then A57: S1O . s0 c= S1O . s11 by OSALG_1:def_16; A58: h . s = G | ( the Sorts of (ParsedTermsOSA X) . s) by A3; then A59: (h . s) . (root-tree t) = G . (root-tree t) by A51, A54, FUNCT_1:49 .= pi (F, the Sorts of U1,t) by A1, A47 .= f . (root-tree t) by A47, A50, Def28 ; h . s1 = G | ( the Sorts of (ParsedTermsOSA X) . s1) by A3; then (h . s1) . (root-tree t) = G . (root-tree t) by A56, FUNCT_1:49 .= f . (root-tree t) by A51, A54, A58, A59, FUNCT_1:49 ; hence (h . s1) . (root-tree t) in the Sorts of U1 . s1 by A55, A57; ::_thesis: verum end; A60: for t being DecoratedTree of the carrier of (DTConOSA X) st t in TS (DTConOSA X) holds S1[t] from DTCONSTR:sch_7(A46, A4); for s being set st s in the carrier of S holds h . s is Function of ( the Sorts of (ParsedTermsOSA X) . s),( the Sorts of U1 . s) proof let x be set ; ::_thesis: ( x in the carrier of S implies h . x is Function of ( the Sorts of (ParsedTermsOSA X) . x),( the Sorts of U1 . x) ) assume x in the carrier of S ; ::_thesis: h . x is Function of ( the Sorts of (ParsedTermsOSA X) . x),( the Sorts of U1 . x) then reconsider s = x as Element of S ; A61: dom G = TS (DTConOSA X) by FUNCT_2:def_1 .= union (rng the Sorts of (ParsedTermsOSA X)) by Th8 ; dom the Sorts of (ParsedTermsOSA X) = the carrier of S by PARTFUN1:def_2; then A62: the Sorts of (ParsedTermsOSA X) . s in rng the Sorts of (ParsedTermsOSA X) by FUNCT_1:def_3; A63: h . s = G | ( the Sorts of (ParsedTermsOSA X) . s) by A3; then A64: dom (h . s) = the Sorts of (ParsedTermsOSA X) . s by A61, A62, RELAT_1:62, ZFMISC_1:74; A65: the Sorts of (ParsedTermsOSA X) . s c= dom G by A61, A62, ZFMISC_1:74; rng (h . s) c= the Sorts of U1 . s proof let a be set ; :: according to TARSKI:def_3 ::_thesis: ( not a in rng (h . s) or a in the Sorts of U1 . s ) assume a in rng (h . s) ; ::_thesis: a in the Sorts of U1 . s then consider T being set such that A66: T in dom (h . s) and A67: (h . s) . T = a by FUNCT_1:def_3; reconsider T = T as Element of TS (DTConOSA X) by A65, A64, A66, FUNCT_2:def_1; T in the Sorts of (ParsedTermsOSA X) . s by A63, A61, A62, A66, RELAT_1:62, ZFMISC_1:74; hence a in the Sorts of U1 . s by A60, A67; ::_thesis: verum end; hence h . x is Function of ( the Sorts of (ParsedTermsOSA X) . x),( the Sorts of U1 . x) by A64, FUNCT_2:def_1, RELSET_1:4; ::_thesis: verum end; then reconsider h = h as ManySortedFunction of (ParsedTermsOSA X),U1 by PBOOLE:def_15; take h ; ::_thesis: ( h is_homomorphism ParsedTermsOSA X,U1 & h is order-sorted & h || (PTVars X) = F ) thus h is_homomorphism ParsedTermsOSA X,U1 ::_thesis: ( h is order-sorted & h || (PTVars X) = F ) proof A68: dom the Sorts of (ParsedTermsOSA X) = the carrier of S by PARTFUN1:def_2; rng the ResultSort of S c= the carrier of S by RELAT_1:def_19; then A69: dom ( the Sorts of (ParsedTermsOSA X) * the ResultSort of S) = dom the ResultSort of S by A68, RELAT_1:27; let op be Element of the carrier' of S; :: according to MSUALG_3:def_7 ::_thesis: ( Args (op,(ParsedTermsOSA X)) = {} or for b1 being Element of Args (op,(ParsedTermsOSA X)) holds (h . (the_result_sort_of op)) . ((Den (op,(ParsedTermsOSA X))) . b1) = (Den (op,U1)) . (h # b1) ) assume Args (op,(ParsedTermsOSA X)) <> {} ; ::_thesis: for b1 being Element of Args (op,(ParsedTermsOSA X)) holds (h . (the_result_sort_of op)) . ((Den (op,(ParsedTermsOSA X))) . b1) = (Den (op,U1)) . (h # b1) reconsider o = op as OperSymbol of S ; let x be Element of Args (op,(ParsedTermsOSA X)); ::_thesis: (h . (the_result_sort_of op)) . ((Den (op,(ParsedTermsOSA X))) . x) = (Den (op,U1)) . (h # x) set rs = the_result_sort_of o; set DA = Den (o,(ParsedTermsOSA X)); set D1 = Den (o,U1); set OU = [: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X)); set ar = the_arity_of o; A70: the_arity_of o = the Arity of S . o by MSUALG_1:def_1; A71: Args (o,(ParsedTermsOSA X)) = (((ParsedTerms X) #) * the Arity of S) . o by MSUALG_1:def_4; then reconsider p = x as FinSequence of TS (DTConOSA X) by Th5; A72: OSSym (o,X) ==> roots p by A71, Th7; then A73: @ (X,(OSSym (o,X))) = o by Def15; A74: dom (G * p) = dom p by FINSEQ_3:120; A75: x in (((ParsedTerms X) #) * the Arity of S) . o by A71; A76: for a being set st a in dom p holds (G * p) . a = (h # x) . a proof set rt = roots p; let a be set ; ::_thesis: ( a in dom p implies (G * p) . a = (h # x) . a ) A77: dom ( the Sorts of (ParsedTermsOSA X) * (the_arity_of o)) = dom (the_arity_of o) by PARTFUN1:def_2; A78: [[o, the carrier of S],(roots p)] in the Rules of (DTConOSA X) by A72, LANG1:def_1; assume A79: a in dom p ; ::_thesis: (G * p) . a = (h # x) . a then reconsider n = a as Nat ; A80: (h # x) . n = (h . ((the_arity_of o) /. n)) . (x . n) by A79, MSUALG_3:def_6; A81: (G * p) . n = G . (x . n) by A74, A79, FINSEQ_3:120; A82: h . ((the_arity_of o) /. n) = G | ( the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. n)) by A3; A83: dom (roots p) = dom p by TREES_3:def_18; reconsider rt = roots p as Element of ([: the carrier' of S,{ the carrier of S}:] \/ (Union (coprod X))) * by A78, ZFMISC_1:87; A84: len rt = len (the_arity_of o) by A78, Th2; A85: Seg (len rt) = dom rt by FINSEQ_1:def_3; A86: Seg (len (the_arity_of o)) = dom (the_arity_of o) by FINSEQ_1:def_3; p in product ((ParsedTerms X) * (the_arity_of o)) by A75, A70, MSAFREE:1; then A87: p . n in ((ParsedTerms X) * (the_arity_of o)) . n by A79, A77, A83, A84, A85, A86, CARD_3:9; ((ParsedTerms X) * (the_arity_of o)) . n = the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) . n) by A79, A77, A83, A84, A85, A86, FUNCT_1:12 .= the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. n) by A79, A83, A84, A85, A86, PARTFUN1:def_6 ; hence (G * p) . a = (h # x) . a by A81, A80, A82, A87, FUNCT_1:49; ::_thesis: verum end; dom (h # x) = dom (the_arity_of o) by MSUALG_3:6; then A88: G * p = h # x by A74, A76, FUNCT_1:2, MSUALG_3:6; A89: h . (the_result_sort_of o) = G | ( the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o)) by A3; A90: rng (PTDenOp (o,X)) c= ((ParsedTerms X) * the ResultSort of S) . o by RELAT_1:def_19; A91: dom (PTDenOp (o,X)) = (((ParsedTerms X) #) * the Arity of S) . o by FUNCT_2:def_1; (PTDenOp (o,X)) . p = (OSSym (o,X)) -tree p by A72, Def9; then (OSSym (o,X)) -tree p in rng (PTDenOp (o,X)) by A71, A91, FUNCT_1:def_3; then A92: (OSSym (o,X)) -tree p in ( the Sorts of (ParsedTermsOSA X) * the ResultSort of S) . o by A90; dom the Sorts of (ParsedTermsOSA X) = the carrier of S by PARTFUN1:def_2; then A93: the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) in rng the Sorts of (ParsedTermsOSA X) by FUNCT_1:def_3; dom the ResultSort of S = the carrier' of S by FUNCT_2:def_1; then (OSSym (o,X)) -tree p in the Sorts of (ParsedTermsOSA X) . ( the ResultSort of S . o) by A69, A92, FUNCT_1:12; then A94: (OSSym (o,X)) -tree p in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) by MSUALG_1:def_2; dom G = TS (DTConOSA X) by FUNCT_2:def_1 .= union (rng the Sorts of (ParsedTermsOSA X)) by Th8 ; then A95: dom (h . (the_result_sort_of o)) = the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) by A89, A93, RELAT_1:62, ZFMISC_1:74; Den (o,(ParsedTermsOSA X)) = (PTOper X) . o by MSUALG_1:def_6 .= PTDenOp (o,X) by Def10 ; then (Den (o,(ParsedTermsOSA X))) . x = (OSSym (o,X)) -tree p by A72, Def9; then (h . (the_result_sort_of o)) . ((Den (o,(ParsedTermsOSA X))) . x) = G . ((OSSym (o,X)) -tree p) by A94, A89, A95, FUNCT_1:47 .= pi ((@ (X,(OSSym (o,X)))),U1,(G * p)) by A2, A72 .= (Den (o,U1)) . (h # x) by A73, A88, MSAFREE:def_21 ; hence (h . (the_result_sort_of op)) . ((Den (op,(ParsedTermsOSA X))) . x) = (Den (op,U1)) . (h # x) ; ::_thesis: verum end; thus h is order-sorted ::_thesis: h || (PTVars X) = F proof let s1, s2 be Element of S; :: according to OSALG_3:def_1 ::_thesis: ( not s1 <= s2 or for b1 being set holds ( not b1 in proj1 (h . s1) or ( b1 in proj1 (h . s2) & (h . s1) . b1 = (h . s2) . b1 ) ) ) assume s1 <= s2 ; ::_thesis: for b1 being set holds ( not b1 in proj1 (h . s1) or ( b1 in proj1 (h . s2) & (h . s1) . b1 = (h . s2) . b1 ) ) then A96: SAO . s1 c= SAO . s2 by OSALG_1:def_16; let a1 be set ; ::_thesis: ( not a1 in proj1 (h . s1) or ( a1 in proj1 (h . s2) & (h . s1) . a1 = (h . s2) . a1 ) ) assume A97: a1 in dom (h . s1) ; ::_thesis: ( a1 in proj1 (h . s2) & (h . s1) . a1 = (h . s2) . a1 ) A98: a1 in SAO . s1 by A97; then a1 in the Sorts of (ParsedTermsOSA X) . s2 by A96; hence a1 in dom (h . s2) by FUNCT_2:def_1; ::_thesis: (h . s1) . a1 = (h . s2) . a1 A99: h . s2 = G | ( the Sorts of (ParsedTermsOSA X) . s2) by A3; h . s1 = G | ( the Sorts of (ParsedTermsOSA X) . s1) by A3; hence (h . s1) . a1 = G . a1 by A97, FUNCT_1:49 .= (h . s2) . a1 by A96, A98, A99, FUNCT_1:49 ; ::_thesis: verum end; for x being set st x in the carrier of S holds (h || (PTVars X)) . x = F . x proof set hf = h || (PTVars X); let x be set ; ::_thesis: ( x in the carrier of S implies (h || (PTVars X)) . x = F . x ) assume x in the carrier of S ; ::_thesis: (h || (PTVars X)) . x = F . x then reconsider s = x as Element of S ; A100: dom (h . s) = the Sorts of (ParsedTermsOSA X) . s by FUNCT_2:def_1; A101: dom ((h || (PTVars X)) . s) = (PTVars X) . s by FUNCT_2:def_1; A102: (PTVars X) . s = PTVars (s,X) by Def24; A103: (h || (PTVars X)) . s = (h . s) | ((PTVars X) . s) by MSAFREE:def_1; A104: for a being set st a in (PTVars X) . s holds ((h || (PTVars X)) . s) . a = (F . s) . a proof let a be set ; ::_thesis: ( a in (PTVars X) . s implies ((h || (PTVars X)) . s) . a = (F . s) . a ) A105: h . s = G | ( the Sorts of (ParsedTermsOSA X) . s) by A3; assume A106: a in (PTVars X) . s ; ::_thesis: ((h || (PTVars X)) . s) . a = (F . s) . a then a in { (root-tree t) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } by A102, Th28; then consider t being Symbol of (DTConOSA X) such that A107: a = root-tree t and A108: t in Terminals (DTConOSA X) and A109: t `2 = s ; thus ((h || (PTVars X)) . s) . a = (h . s) . a by A103, A101, A106, FUNCT_1:47 .= G . a by A100, A102, A106, A105, FUNCT_1:47 .= pi (F, the Sorts of U1,t) by A1, A107, A108 .= (F . s) . a by A107, A108, A109, Def28 ; ::_thesis: verum end; dom (F . s) = (PTVars X) . s by FUNCT_2:def_1; hence (h || (PTVars X)) . x = F . x by A101, A104, FUNCT_1:2; ::_thesis: verum end; hence h || (PTVars X) = F by PBOOLE:3; ::_thesis: verum end; definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; let s be Element of S; func NHReverse (s,X) -> Function of (OSFreeGen (s,X)),(PTVars (s,X)) means :: OSAFREE:def 29 for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds it . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t; existence ex b1 being Function of (OSFreeGen (s,X)),(PTVars (s,X)) st for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds b1 . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t proof set A = OSFreeGen (s,X); set R = LCongruence X; set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); set NHs = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X),s); set D = DTConOSA X; set NH = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)); defpred S1[ set , set ] means for t being Symbol of (DTConOSA X) st $1 = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) holds $2 = root-tree t; A1: (OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X),s) by OSALG_4:def_22; A2: for x being set st x in OSFreeGen (s,X) holds ex a being set st ( a in PTVars (s,X) & S1[x,a] ) proof let x be set ; ::_thesis: ( x in OSFreeGen (s,X) implies ex a being set st ( a in PTVars (s,X) & S1[x,a] ) ) assume x in OSFreeGen (s,X) ; ::_thesis: ex a being set st ( a in PTVars (s,X) & S1[x,a] ) then x in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } by Th30; then consider t being Symbol of (DTConOSA X) such that A3: x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) and A4: t in Terminals (DTConOSA X) and A5: t `2 = s ; A6: x = (OSNat_Hom ((ParsedTermsOSA X),(LCongruence X),s)) . (root-tree t) by A3, OSALG_4:def_22; take root-tree t ; ::_thesis: ( root-tree t in PTVars (s,X) & S1[x, root-tree t] ) consider s1 being Element of S, a being set such that A7: a in X . s1 and A8: t = [a,s1] by A4, Th4; A9: s = s1 by A5, A8, MCART_1:7; hence root-tree t in PTVars (s,X) by A7, A8, Def23; ::_thesis: S1[x, root-tree t] reconsider rt = root-tree t as Element of the Sorts of (ParsedTermsOSA X) . s by A7, A8, A9, Th10; A10: (OSNat_Hom ((ParsedTermsOSA X),(LCongruence X),s)) . rt = OSClass ((LCongruence X),rt) by OSALG_4:def_21; reconsider tt = root-tree t as Element of TS (DTConOSA X) by A7, A8, Th10; let t1 be Symbol of (DTConOSA X); ::_thesis: ( x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t1) implies root-tree t = root-tree t1 ) assume A11: x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t1) ; ::_thesis: root-tree t = root-tree t1 A12: OSClass ((LCongruence X),tt) = OSClass ((LCongruence X),rt) by Def27; OSClass ((LCongruence X),tt) <> {} by Th32; then x <> {} by A12, A6, OSALG_4:def_21; then root-tree t1 in dom (OSNat_Hom ((ParsedTermsOSA X),(LCongruence X),s)) by A1, A11, FUNCT_1:def_2; then reconsider rt1 = root-tree t1 as Element of the Sorts of (ParsedTermsOSA X) . s ; reconsider tt2 = rt1 as Element of TS (DTConOSA X) by Th15; A13: OSClass ((LCongruence X),tt2) = OSClass ((LCongruence X),rt1) by Def27; x = (OSNat_Hom ((ParsedTermsOSA X),(LCongruence X),s)) . (root-tree t1) by A11, OSALG_4:def_22; then OSClass ((LCongruence X),rt1) = OSClass ((LCongruence X),rt) by A6, A10, OSALG_4:def_21; then tt2 in OSClass ((LCongruence X),tt) by A12, A13, Th34; hence root-tree t = root-tree t1 by A7, A8, Th36; ::_thesis: verum end; consider f being Function such that A14: ( dom f = OSFreeGen (s,X) & rng f c= PTVars (s,X) & ( for x being set st x in OSFreeGen (s,X) holds S1[x,f . x] ) ) from FUNCT_1:sch_5(A2); reconsider f = f as Function of (OSFreeGen (s,X)),(PTVars (s,X)) by A14, FUNCT_2:2; take f ; ::_thesis: for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds f . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t let t be Symbol of (DTConOSA X); ::_thesis: ( ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) implies f . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t ) assume ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) ; ::_thesis: f . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t hence f . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t by A14; ::_thesis: verum end; uniqueness for b1, b2 being Function of (OSFreeGen (s,X)),(PTVars (s,X)) st ( for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds b1 . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t ) & ( for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds b2 . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t ) holds b1 = b2 proof let A, B be Function of (OSFreeGen (s,X)),(PTVars (s,X)); ::_thesis: ( ( for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds A . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t ) & ( for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds B . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t ) implies A = B ) set NH = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)); assume that A15: for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds A . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t and A16: for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds B . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t ; ::_thesis: A = B set D = DTConOSA X; set C = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } ; A17: OSFreeGen (s,X) = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } by Th30; then A18: dom B = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } by FUNCT_2:def_1; A19: for i being set st i in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } holds A . i = B . i proof let i be set ; ::_thesis: ( i in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } implies A . i = B . i ) assume A20: i in { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } ; ::_thesis: A . i = B . i then consider t being Symbol of (DTConOSA X) such that A21: i = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) and t in Terminals (DTConOSA X) and t `2 = s ; A . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t by A15, A17, A20, A21; hence A . i = B . i by A16, A17, A20, A21; ::_thesis: verum end; dom A = { (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) where t is Symbol of (DTConOSA X) : ( t in Terminals (DTConOSA X) & t `2 = s ) } by A17, FUNCT_2:def_1; hence A = B by A18, A19, FUNCT_1:2; ::_thesis: verum end; end; :: deftheorem defines NHReverse OSAFREE:def_29_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for s being Element of S for b4 being Function of (OSFreeGen (s,X)),(PTVars (s,X)) holds ( b4 = NHReverse (s,X) iff for t being Symbol of (DTConOSA X) st ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t) in OSFreeGen (s,X) holds b4 . (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree t)) = root-tree t ); definition let S be locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func NHReverse X -> ManySortedFunction of OSFreeGen X, PTVars X means :: OSAFREE:def 30 for s being Element of S holds it . s = NHReverse (s,X); existence ex b1 being ManySortedFunction of OSFreeGen X, PTVars X st for s being Element of S holds b1 . s = NHReverse (s,X) proof defpred S1[ set , set ] means for s being Element of S st s = $1 holds $2 = NHReverse (s,X); set I = the carrier of S; set FG = OSFreeGen X; A1: for i being set st i in the carrier of S holds ex u being set st S1[i,u] proof let i be set ; ::_thesis: ( i in the carrier of S implies ex u being set st S1[i,u] ) assume i in the carrier of S ; ::_thesis: ex u being set st S1[i,u] then reconsider s = i as SortSymbol of S ; take NHReverse (s,X) ; ::_thesis: S1[i, NHReverse (s,X)] let s1 be Element of S; ::_thesis: ( s1 = i implies NHReverse (s,X) = NHReverse (s1,X) ) assume s1 = i ; ::_thesis: NHReverse (s,X) = NHReverse (s1,X) hence NHReverse (s,X) = NHReverse (s1,X) ; ::_thesis: verum end; consider H being Function such that A2: ( dom H = the carrier of S & ( for i being set st i in the carrier of S holds S1[i,H . i] ) ) from CLASSES1:sch_1(A1); reconsider H = H as ManySortedSet of the carrier of S by A2, PARTFUN1:def_2, RELAT_1:def_18; for x being set st x in dom H holds H . x is Function proof let i be set ; ::_thesis: ( i in dom H implies H . i is Function ) assume i in dom H ; ::_thesis: H . i is Function then reconsider s = i as SortSymbol of S ; H . s = NHReverse (s,X) by A2; hence H . i is Function ; ::_thesis: verum end; then reconsider H = H as ManySortedFunction of the carrier of S by FUNCOP_1:def_6; for i being set st i in the carrier of S holds H . i is Function of ((OSFreeGen X) . i),((PTVars X) . i) proof let i be set ; ::_thesis: ( i in the carrier of S implies H . i is Function of ((OSFreeGen X) . i),((PTVars X) . i) ) assume i in the carrier of S ; ::_thesis: H . i is Function of ((OSFreeGen X) . i),((PTVars X) . i) then reconsider s = i as SortSymbol of S ; A3: (PTVars X) . s = PTVars (s,X) by Def24; A4: H . i = NHReverse (s,X) by A2; (OSFreeGen X) . s = OSFreeGen (s,X) by Def26; hence H . i is Function of ((OSFreeGen X) . i),((PTVars X) . i) by A3, A4; ::_thesis: verum end; then reconsider H = H as ManySortedFunction of OSFreeGen X, PTVars X by PBOOLE:def_15; take H ; ::_thesis: for s being Element of S holds H . s = NHReverse (s,X) let s be Element of S; ::_thesis: H . s = NHReverse (s,X) thus H . s = NHReverse (s,X) by A2; ::_thesis: verum end; uniqueness for b1, b2 being ManySortedFunction of OSFreeGen X, PTVars X st ( for s being Element of S holds b1 . s = NHReverse (s,X) ) & ( for s being Element of S holds b2 . s = NHReverse (s,X) ) holds b1 = b2 proof let A, B be ManySortedFunction of OSFreeGen X, PTVars X; ::_thesis: ( ( for s being Element of S holds A . s = NHReverse (s,X) ) & ( for s being Element of S holds B . s = NHReverse (s,X) ) implies A = B ) assume that A5: for s being Element of S holds A . s = NHReverse (s,X) and A6: for s being Element of S holds B . s = NHReverse (s,X) ; ::_thesis: A = B for i being set st i in the carrier of S holds A . i = B . i proof let i be set ; ::_thesis: ( i in the carrier of S implies A . i = B . i ) assume i in the carrier of S ; ::_thesis: A . i = B . i then reconsider s = i as SortSymbol of S ; A . s = NHReverse (s,X) by A5; hence A . i = B . i by A6; ::_thesis: verum end; hence A = B by PBOOLE:3; ::_thesis: verum end; end; :: deftheorem defines NHReverse OSAFREE:def_30_:_ for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S for b3 being ManySortedFunction of OSFreeGen X, PTVars X holds ( b3 = NHReverse X iff for s being Element of S holds b3 . s = NHReverse (s,X) ); theorem Th38: :: OSAFREE:38 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S holds OSFreeGen X is osfree proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S holds OSFreeGen X is osfree let X be V16() ManySortedSet of S; ::_thesis: OSFreeGen X is osfree set FA = FreeOSA X; set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); set FG = OSFreeGen X; let U1 be non-empty monotone OSAlgebra of S; :: according to OSAFREE:def_2 ::_thesis: for f being ManySortedFunction of OSFreeGen X, the Sorts of U1 ex h being ManySortedFunction of (FreeOSA X),U1 st ( h is_homomorphism FreeOSA X,U1 & h is order-sorted & h || (OSFreeGen X) = f ) let F be ManySortedFunction of OSFreeGen X, the Sorts of U1; ::_thesis: ex h being ManySortedFunction of (FreeOSA X),U1 st ( h is_homomorphism FreeOSA X,U1 & h is order-sorted & h || (OSFreeGen X) = F ) set SA = the Sorts of (FreeOSA X); set S1 = the Sorts of U1; set R = LCongruence X; set NH = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)); reconsider NH1 = OSNat_Hom ((ParsedTermsOSA X),(LCongruence X)) as ManySortedFunction of (ParsedTermsOSA X),(FreeOSA X) ; set NHP = NH1 || (PTVars X); A1: now__::_thesis:_for_s_being_Element_of_S_holds_ (_(NH1_||_(PTVars_X))_._s_=_(NH1_._s)_|_(PTVars_(s,X))_&_PTVars_(s,X)_c=_the_Sorts_of_(ParsedTermsOSA_X)_._s_&_dom_(NH1_._s)_=_the_Sorts_of_(ParsedTermsOSA_X)_._s_&_rng_(NH1_._s)_c=_the_Sorts_of_(FreeOSA_X)_._s_&_dom_((NH1_||_(PTVars_X))_._s)_=_PTVars_(s,X)_&_rng_((NH1_||_(PTVars_X))_._s)_=_(OSFreeGen_X)_._s_&_(NH1_||_(PTVars_X))_._s_is_Function_of_(PTVars_(s,X)),((OSFreeGen_X)_._s)_&_(NH1_||_(PTVars_X))_._s_is_Function_of_((PTVars_X)_._s),((OSFreeGen_X)_._s)_) let s be Element of S; ::_thesis: ( (NH1 || (PTVars X)) . s = (NH1 . s) | (PTVars (s,X)) & PTVars (s,X) c= the Sorts of (ParsedTermsOSA X) . s & dom (NH1 . s) = the Sorts of (ParsedTermsOSA X) . s & rng (NH1 . s) c= the Sorts of (FreeOSA X) . s & dom ((NH1 || (PTVars X)) . s) = PTVars (s,X) & rng ((NH1 || (PTVars X)) . s) = (OSFreeGen X) . s & (NH1 || (PTVars X)) . s is Function of (PTVars (s,X)),((OSFreeGen X) . s) & (NH1 || (PTVars X)) . s is Function of ((PTVars X) . s),((OSFreeGen X) . s) ) A2: (NH1 || (PTVars X)) . s = (NH1 . s) | ((PTVars X) . s) by MSAFREE:def_1; hence (NH1 || (PTVars X)) . s = (NH1 . s) | (PTVars (s,X)) by Def24; ::_thesis: ( PTVars (s,X) c= the Sorts of (ParsedTermsOSA X) . s & dom (NH1 . s) = the Sorts of (ParsedTermsOSA X) . s & rng (NH1 . s) c= the Sorts of (FreeOSA X) . s & dom ((NH1 || (PTVars X)) . s) = PTVars (s,X) & rng ((NH1 || (PTVars X)) . s) = (OSFreeGen X) . s & (NH1 || (PTVars X)) . s is Function of (PTVars (s,X)),((OSFreeGen X) . s) & (NH1 || (PTVars X)) . s is Function of ((PTVars X) . s),((OSFreeGen X) . s) ) thus PTVars (s,X) c= the Sorts of (ParsedTermsOSA X) . s ; ::_thesis: ( dom (NH1 . s) = the Sorts of (ParsedTermsOSA X) . s & rng (NH1 . s) c= the Sorts of (FreeOSA X) . s & dom ((NH1 || (PTVars X)) . s) = PTVars (s,X) & rng ((NH1 || (PTVars X)) . s) = (OSFreeGen X) . s & (NH1 || (PTVars X)) . s is Function of (PTVars (s,X)),((OSFreeGen X) . s) & (NH1 || (PTVars X)) . s is Function of ((PTVars X) . s),((OSFreeGen X) . s) ) thus ( dom (NH1 . s) = the Sorts of (ParsedTermsOSA X) . s & rng (NH1 . s) c= the Sorts of (FreeOSA X) . s ) by FUNCT_2:def_1, RELAT_1:def_19; ::_thesis: ( dom ((NH1 || (PTVars X)) . s) = PTVars (s,X) & rng ((NH1 || (PTVars X)) . s) = (OSFreeGen X) . s & (NH1 || (PTVars X)) . s is Function of (PTVars (s,X)),((OSFreeGen X) . s) & (NH1 || (PTVars X)) . s is Function of ((PTVars X) . s),((OSFreeGen X) . s) ) A3: (PTVars X) . s = PTVars (s,X) by Def24; hence A4: dom ((NH1 || (PTVars X)) . s) = PTVars (s,X) by FUNCT_2:def_1; ::_thesis: ( rng ((NH1 || (PTVars X)) . s) = (OSFreeGen X) . s & (NH1 || (PTVars X)) . s is Function of (PTVars (s,X)),((OSFreeGen X) . s) & (NH1 || (PTVars X)) . s is Function of ((PTVars X) . s),((OSFreeGen X) . s) ) for y being set holds ( y in (OSFreeGen X) . s iff ex x being set st ( x in dom ((NH1 || (PTVars X)) . s) & y = ((NH1 || (PTVars X)) . s) . x ) ) proof let y be set ; ::_thesis: ( y in (OSFreeGen X) . s iff ex x being set st ( x in dom ((NH1 || (PTVars X)) . s) & y = ((NH1 || (PTVars X)) . s) . x ) ) thus ( y in (OSFreeGen X) . s implies ex x being set st ( x in dom ((NH1 || (PTVars X)) . s) & y = ((NH1 || (PTVars X)) . s) . x ) ) ::_thesis: ( ex x being set st ( x in dom ((NH1 || (PTVars X)) . s) & y = ((NH1 || (PTVars X)) . s) . x ) implies y in (OSFreeGen X) . s ) proof assume y in (OSFreeGen X) . s ; ::_thesis: ex x being set st ( x in dom ((NH1 || (PTVars X)) . s) & y = ((NH1 || (PTVars X)) . s) . x ) then y in OSFreeGen (s,X) by Def26; then consider a being set such that A5: a in X . s and A6: y = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) by Def25; take x = root-tree [a,s]; ::_thesis: ( x in dom ((NH1 || (PTVars X)) . s) & y = ((NH1 || (PTVars X)) . s) . x ) root-tree [a,s] in dom ((NH1 || (PTVars X)) . s) by A4, A5, Def23; hence ( x in dom ((NH1 || (PTVars X)) . s) & y = ((NH1 || (PTVars X)) . s) . x ) by A2, A6, FUNCT_1:47; ::_thesis: verum end; given x being set such that A7: x in dom ((NH1 || (PTVars X)) . s) and A8: y = ((NH1 || (PTVars X)) . s) . x ; ::_thesis: y in (OSFreeGen X) . s consider a being set such that A9: a in X . s and A10: x = root-tree [a,s] by A3, A7, Def23; y = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) by A2, A7, A8, A10, FUNCT_1:47; then y in OSFreeGen (s,X) by A9, Def25; hence y in (OSFreeGen X) . s by Def26; ::_thesis: verum end; hence A11: rng ((NH1 || (PTVars X)) . s) = (OSFreeGen X) . s by FUNCT_1:def_3; ::_thesis: ( (NH1 || (PTVars X)) . s is Function of (PTVars (s,X)),((OSFreeGen X) . s) & (NH1 || (PTVars X)) . s is Function of ((PTVars X) . s),((OSFreeGen X) . s) ) hence (NH1 || (PTVars X)) . s is Function of (PTVars (s,X)),((OSFreeGen X) . s) by A4, FUNCT_2:1; ::_thesis: (NH1 || (PTVars X)) . s is Function of ((PTVars X) . s),((OSFreeGen X) . s) thus (NH1 || (PTVars X)) . s is Function of ((PTVars X) . s),((OSFreeGen X) . s) by A3, A4, A11, FUNCT_2:1; ::_thesis: verum end; then for i being set st i in the carrier of S holds (NH1 || (PTVars X)) . i is Function of ((PTVars X) . i),((OSFreeGen X) . i) ; then reconsider NHP = NH1 || (PTVars X) as ManySortedFunction of PTVars X, OSFreeGen X by PBOOLE:def_15; consider h being ManySortedFunction of (ParsedTermsOSA X),U1 such that A12: h is_homomorphism ParsedTermsOSA X,U1 and A13: h is order-sorted and A14: h || (PTVars X) = F ** NHP by Th37; reconsider hCng = OSCng h as monotone OSCongruence of ParsedTermsOSA X by A12, A13, OSALG_4:24; reconsider H = OSHomQuot (h,(LCongruence X)) as ManySortedFunction of (FreeOSA X),U1 ; take H ; ::_thesis: ( H is_homomorphism FreeOSA X,U1 & H is order-sorted & H || (OSFreeGen X) = F ) A15: LCongruence X c= hCng by Def17; hence ( H is_homomorphism FreeOSA X,U1 & H is order-sorted ) by A12, A13, OSALG_4:25; ::_thesis: H || (OSFreeGen X) = F for s being Element of S for f being Function of ( the Sorts of (FreeOSA X) . s),( the Sorts of U1 . s) st f = H . s holds F . s = f | ((OSFreeGen X) . s) proof let s be Element of S; ::_thesis: for f being Function of ( the Sorts of (FreeOSA X) . s),( the Sorts of U1 . s) st f = H . s holds F . s = f | ((OSFreeGen X) . s) A16: (OSFreeGen X) . s = OSFreeGen (s,X) by Def26; then (OSFreeGen X) . s c= the Sorts of (FreeOSA X) . s ; then (OSFreeGen X) . s c= dom (OSHomQuot (h,(LCongruence X),s)) by FUNCT_2:def_1; then A17: dom ((OSHomQuot (h,(LCongruence X),s)) | ((OSFreeGen X) . s)) = (OSFreeGen X) . s by RELAT_1:62; rng ((OSHomQuot (h,(LCongruence X),s)) | ((OSFreeGen X) . s)) c= the Sorts of U1 . s by RELAT_1:def_19; then reconsider OSF = (OSHomQuot (h,(LCongruence X),s)) | ((OSFreeGen X) . s) as Function of ((OSFreeGen X) . s),( the Sorts of U1 . s) by A17, FUNCT_2:2; now__::_thesis:_for_x_being_set_st_x_in_(OSFreeGen_X)_._s_holds_ (F_._s)_._x_=_((OSHomQuot_(h,(LCongruence_X),s))_|_((OSFreeGen_X)_._s))_._x A18: dom (NHP . s) = PTVars (s,X) by A1; A19: (h . s) | ((PTVars X) . s) = (F ** NHP) . s by A14, MSAFREE:def_1 .= (F . s) * (NHP . s) by MSUALG_3:2 ; let x be set ; ::_thesis: ( x in (OSFreeGen X) . s implies (F . s) . x = ((OSHomQuot (h,(LCongruence X),s)) | ((OSFreeGen X) . s)) . x ) assume A20: x in (OSFreeGen X) . s ; ::_thesis: (F . s) . x = ((OSHomQuot (h,(LCongruence X),s)) | ((OSFreeGen X) . s)) . x consider a being set such that A21: a in X . s and A22: x = ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . (root-tree [a,s]) by A16, A20, Def25; reconsider xa = root-tree [a,s] as Element of the Sorts of (ParsedTermsOSA X) . s by A21, Th10; A23: OSClass ((LCongruence X),xa) = (OSNat_Hom ((ParsedTermsOSA X),(LCongruence X),s)) . xa by OSALG_4:def_21 .= x by A22, OSALG_4:def_22 ; A24: root-tree [a,s] in PTVars (s,X) by A21, Def23; then xa in (PTVars X) . s by Def24; then A25: (h . s) . xa = ((h . s) | ((PTVars X) . s)) . xa by FUNCT_1:49; A26: (OSHomQuot (h,(LCongruence X),s)) . (OSClass ((LCongruence X),xa)) = (h . s) . xa by A12, A13, A15, OSALG_4:def_27; (NHP . s) . xa = (((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) | (PTVars (s,X))) . xa by A1 .= ((OSNat_Hom ((ParsedTermsOSA X),(LCongruence X))) . s) . xa by A24, FUNCT_1:49 ; then (h . s) . xa = (F . s) . x by A22, A24, A19, A25, A18, FUNCT_1:13; hence (F . s) . x = ((OSHomQuot (h,(LCongruence X),s)) | ((OSFreeGen X) . s)) . x by A20, A23, A26, FUNCT_1:49; ::_thesis: verum end; then A27: F . s = OSF by FUNCT_2:12; let f be Function of ( the Sorts of (FreeOSA X) . s),( the Sorts of U1 . s); ::_thesis: ( f = H . s implies F . s = f | ((OSFreeGen X) . s) ) assume f = H . s ; ::_thesis: F . s = f | ((OSFreeGen X) . s) hence F . s = f | ((OSFreeGen X) . s) by A27, OSALG_4:def_28; ::_thesis: verum end; then for i being set st i in the carrier of S holds for f being Function of ( the Sorts of (FreeOSA X) . i),( the Sorts of U1 . i) st f = H . i holds F . i = f | ((OSFreeGen X) . i) ; hence H || (OSFreeGen X) = F by MSAFREE:def_1; ::_thesis: verum end; theorem Th39: :: OSAFREE:39 for S being locally_directed OrderSortedSign for X being V16() ManySortedSet of S holds FreeOSA X is osfree proof let S be locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S holds FreeOSA X is osfree let X be V16() ManySortedSet of S; ::_thesis: FreeOSA X is osfree take OSFreeGen X ; :: according to OSAFREE:def_3 ::_thesis: OSFreeGen X is osfree thus OSFreeGen X is osfree by Th38; ::_thesis: verum end; registration let S be locally_directed OrderSortedSign; cluster strict non-empty order-sorted monotone osfree for MSAlgebra over S; existence ex b1 being non-empty monotone OSAlgebra of S st ( b1 is osfree & b1 is strict ) proof set U1 = the non-empty OSAlgebra of S; reconsider X = the Sorts of the non-empty OSAlgebra of S as V16() ManySortedSet of S ; take FreeOSA X ; ::_thesis: ( FreeOSA X is osfree & FreeOSA X is strict ) thus ( FreeOSA X is osfree & FreeOSA X is strict ) by Th39; ::_thesis: verum end; end; begin definition let S be monotone regular locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func PTMin X -> Function of (TS (DTConOSA X)),(TS (DTConOSA X)) means :Def31: :: OSAFREE:def 31 ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds it . (root-tree t) = pi t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds it . (nt -tree ts) = pi ((@ (X,nt)),(it * ts)) ) ); existence ex b1 being Function of (TS (DTConOSA X)),(TS (DTConOSA X)) st ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds b1 . (root-tree t) = pi t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds b1 . (nt -tree ts) = pi ((@ (X,nt)),(b1 * ts)) ) ) proof set G = DTConOSA X; set D = TS (DTConOSA X); deffunc H1( Symbol of (DTConOSA X)) -> Element of TS (DTConOSA X) = pi $1; deffunc H2( Symbol of (DTConOSA X), set , FinSequence of TS (DTConOSA X)) -> Element of TS (DTConOSA X) = In ((pi ((@ (X,$1)),$3)),(TS (DTConOSA X))); consider f being Function of (TS (DTConOSA X)),(TS (DTConOSA X)) such that A1: ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds f . (root-tree t) = H1(t) ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f . (nt -tree ts) = H2(nt, roots ts,f * ts) ) ) from DTCONSTR:sch_8(); take f ; ::_thesis: ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds f . (root-tree t) = pi t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f . (nt -tree ts) = pi ((@ (X,nt)),(f * ts)) ) ) thus for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds f . (root-tree t) = H1(t) by A1; ::_thesis: for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f . (nt -tree ts) = pi ((@ (X,nt)),(f * ts)) let nt be Symbol of (DTConOSA X); ::_thesis: for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds f . (nt -tree ts) = pi ((@ (X,nt)),(f * ts)) let ts be FinSequence of TS (DTConOSA X); ::_thesis: ( nt ==> roots ts implies f . (nt -tree ts) = pi ((@ (X,nt)),(f * ts)) ) reconsider fts = f * ts as FinSequence of TS (DTConOSA X) ; assume nt ==> roots ts ; ::_thesis: f . (nt -tree ts) = pi ((@ (X,nt)),(f * ts)) then f . (nt -tree ts) = In ((pi ((@ (X,nt)),fts)),(TS (DTConOSA X))) by A1; hence f . (nt -tree ts) = pi ((@ (X,nt)),(f * ts)) by FUNCT_7:def_1; ::_thesis: verum end; uniqueness for b1, b2 being Function of (TS (DTConOSA X)),(TS (DTConOSA X)) st ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds b1 . (root-tree t) = pi t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds b1 . (nt -tree ts) = pi ((@ (X,nt)),(b1 * ts)) ) & ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds b2 . (root-tree t) = pi t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds b2 . (nt -tree ts) = pi ((@ (X,nt)),(b2 * ts)) ) holds b1 = b2 proof set G = DTConOSA X; set D = TS (DTConOSA X); deffunc H1( Symbol of (DTConOSA X)) -> Element of TS (DTConOSA X) = pi $1; deffunc H2( Symbol of (DTConOSA X), set , FinSequence of TS (DTConOSA X)) -> Element of TS (DTConOSA X) = pi ((@ (X,$1)),$3); let M1, M2 be Function of (TS (DTConOSA X)),(TS (DTConOSA X)); ::_thesis: ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds M1 . (root-tree t) = pi t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds M1 . (nt -tree ts) = pi ((@ (X,nt)),(M1 * ts)) ) & ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds M2 . (root-tree t) = pi t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds M2 . (nt -tree ts) = pi ((@ (X,nt)),(M2 * ts)) ) implies M1 = M2 ) assume that A2: ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds M1 . (root-tree t) = H1(t) ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds M1 . (nt -tree ts) = H2(nt, roots ts,M1 * ts) ) ) and A3: ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds M2 . (root-tree t) = H1(t) ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds M2 . (nt -tree ts) = H2(nt, roots ts,M2 * ts) ) ) ; ::_thesis: M1 = M2 thus M1 = M2 from DTCONSTR:sch_9(A2, A3); ::_thesis: verum end; end; :: deftheorem Def31 defines PTMin OSAFREE:def_31_:_ for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for b3 being Function of (TS (DTConOSA X)),(TS (DTConOSA X)) holds ( b3 = PTMin X iff ( ( for t being Symbol of (DTConOSA X) st t in Terminals (DTConOSA X) holds b3 . (root-tree t) = pi t ) & ( for nt being Symbol of (DTConOSA X) for ts being FinSequence of TS (DTConOSA X) st nt ==> roots ts holds b3 . (nt -tree ts) = pi ((@ (X,nt)),(b3 * ts)) ) ) ); theorem Th40: :: OSAFREE:40 for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) holds ( (PTMin X) . t in OSClass ((PTCongruence X),t) & LeastSort ((PTMin X) . t) <= LeastSort t & ( for s being Element of S for x being set st x in X . s & t = root-tree [x,s] holds (PTMin X) . t = t ) & ( for o being OperSymbol of S for ts being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots ts & t = (OSSym (o,X)) -tree ts holds ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) ) ) proof let S be monotone regular locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for t being Element of TS (DTConOSA X) holds ( (PTMin X) . t in OSClass ((PTCongruence X),t) & LeastSort ((PTMin X) . t) <= LeastSort t & ( for s being Element of S for x being set st x in X . s & t = root-tree [x,s] holds (PTMin X) . t = t ) & ( for o being OperSymbol of S for ts being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots ts & t = (OSSym (o,X)) -tree ts holds ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) ) ) let X be V16() ManySortedSet of S; ::_thesis: for t being Element of TS (DTConOSA X) holds ( (PTMin X) . t in OSClass ((PTCongruence X),t) & LeastSort ((PTMin X) . t) <= LeastSort t & ( for s being Element of S for x being set st x in X . s & t = root-tree [x,s] holds (PTMin X) . t = t ) & ( for o being OperSymbol of S for ts being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots ts & t = (OSSym (o,X)) -tree ts holds ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) ) ) let t be Element of TS (DTConOSA X); ::_thesis: ( (PTMin X) . t in OSClass ((PTCongruence X),t) & LeastSort ((PTMin X) . t) <= LeastSort t & ( for s being Element of S for x being set st x in X . s & t = root-tree [x,s] holds (PTMin X) . t = t ) & ( for o being OperSymbol of S for ts being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots ts & t = (OSSym (o,X)) -tree ts holds ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) ) ) set PTA = ParsedTermsOSA X; set D = DTConOSA X; set R = PTCongruence X; set SPTA = the Sorts of (ParsedTermsOSA X); set M = PTMin X; set F = PTClasses X; defpred S1[ Element of TS (DTConOSA X)] means (PTMin X) . $1 in OSClass ((PTCongruence X),$1); defpred S2[ Element of TS (DTConOSA X)] means LeastSort ((PTMin X) . $1) <= LeastSort $1; defpred S3[ Element of TS (DTConOSA X)] means for s being Element of S for x being set st x in X . s & $1 = root-tree [x,s] holds (PTMin X) . $1 = $1; defpred S4[ Element of TS (DTConOSA X)] means for o being OperSymbol of S for ts being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots ts & $1 = (OSSym (o,X)) -tree ts holds ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . $1 = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ); defpred S5[ DecoratedTree of the carrier of (DTConOSA X)] means ex t1 being Element of TS (DTConOSA X) st ( t1 = $1 & S1[t1] & S2[t1] & S3[t1] & S4[t1] ); A1: for nt being Symbol of (DTConOSA X) for ts1 being FinSequence of TS (DTConOSA X) st nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S5[dt1] ) holds S5[nt -tree ts1] proof let nt be Symbol of (DTConOSA X); ::_thesis: for ts1 being FinSequence of TS (DTConOSA X) st nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S5[dt1] ) holds S5[nt -tree ts1] let ts1 be FinSequence of TS (DTConOSA X); ::_thesis: ( nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S5[dt1] ) implies S5[nt -tree ts1] ) assume that A2: nt ==> roots ts1 and A3: for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds ex t2 being Element of TS (DTConOSA X) st ( t2 = dt1 & S1[t2] & S2[t2] & S3[t2] & S4[t2] ) ; ::_thesis: S5[nt -tree ts1] reconsider t1 = nt -tree ts1 as Element of TS (DTConOSA X) by A2, Th12; A4: rng ts1 c= TS (DTConOSA X) by FINSEQ_1:def_4; consider o being OperSymbol of S such that A5: nt = [o, the carrier of S] and A6: ts1 in Args (o,(ParsedTermsOSA X)) and A7: nt -tree ts1 = (Den (o,(ParsedTermsOSA X))) . ts1 and for s1 being Element of S holds ( nt -tree ts1 in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) by A2, Th12; set Ms = (PTMin X) * ts1; set LSMs = LeastSorts ((PTMin X) * ts1); set w = the_arity_of o; set so = the_result_sort_of o; set Lo = LBound (o,(LeastSorts ((PTMin X) * ts1))); A8: dom ts1 = dom (the_arity_of o) by A6, MSUALG_3:6; A9: dom ((PTMin X) * ts1) = dom ts1 by FINSEQ_3:120; then A10: dom (LeastSorts ((PTMin X) * ts1)) = dom ts1 by Def13; @ (X,nt) = o by A2, A5, Def15; then A11: (PTMin X) . (nt -tree ts1) = pi (o,((PTMin X) * ts1)) by A2, Def31; A12: S4[t1] proof let o2 be OperSymbol of S; ::_thesis: for ts being FinSequence of TS (DTConOSA X) st OSSym (o2,X) ==> roots ts & t1 = (OSSym (o2,X)) -tree ts holds ( LeastSorts ((PTMin X) * ts) <= the_arity_of o2 & OSSym (o2,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t1 = (OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) let ts be FinSequence of TS (DTConOSA X); ::_thesis: ( OSSym (o2,X) ==> roots ts & t1 = (OSSym (o2,X)) -tree ts implies ( LeastSorts ((PTMin X) * ts) <= the_arity_of o2 & OSSym (o2,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t1 = (OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) ) assume that OSSym (o2,X) ==> roots ts and A13: t1 = (OSSym (o2,X)) -tree ts ; ::_thesis: ( LeastSorts ((PTMin X) * ts) <= the_arity_of o2 & OSSym (o2,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t1 = (OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) set Ms1 = (PTMin X) * ts; set LSMs1 = LeastSorts ((PTMin X) * ts); set Lo2 = LBound (o2,(LeastSorts ((PTMin X) * ts))); A14: ts = ts1 by A13, TREES_4:15; A15: OSSym (o2,X) = nt by A13, TREES_4:15; then A16: o2 = o by A5, XTUPLE_0:1; A17: LeastSorts ((PTMin X) * ts1) <= the_arity_of o proof thus len (LeastSorts ((PTMin X) * ts1)) = len (the_arity_of o) by A8, A10, FINSEQ_3:29; :: according to OSALG_1:def_6 ::_thesis: for b1 being set holds ( not b1 in dom (LeastSorts ((PTMin X) * ts1)) or for b2, b3 being Element of the carrier of S holds ( not b2 = (LeastSorts ((PTMin X) * ts1)) . b1 or not b3 = (the_arity_of o) . b1 or b2 <= b3 ) ) let i be set ; ::_thesis: ( not i in dom (LeastSorts ((PTMin X) * ts1)) or for b1, b2 being Element of the carrier of S holds ( not b1 = (LeastSorts ((PTMin X) * ts1)) . i or not b2 = (the_arity_of o) . i or b1 <= b2 ) ) assume A18: i in dom (LeastSorts ((PTMin X) * ts1)) ; ::_thesis: for b1, b2 being Element of the carrier of S holds ( not b1 = (LeastSorts ((PTMin X) * ts1)) . i or not b2 = (the_arity_of o) . i or b1 <= b2 ) reconsider k = i as Nat by A18; ts1 . k in rng ts1 by A10, A18, FUNCT_1:3; then reconsider tr = ts1 . k as Element of TS (DTConOSA X) by A4; A19: ex tr1 being Element of TS (DTConOSA X) st ( tr1 = tr & S1[tr1] & S2[tr1] & S3[tr1] & S4[tr1] ) by A3, A10, A18, FUNCT_1:3; A20: (the_arity_of o) /. k = (the_arity_of o) . i by A8, A10, A18, PARTFUN1:def_6; A21: ((PTMin X) * ts1) . k = (PTMin X) . tr by A9, A10, A18, FINSEQ_3:120; ts1 . k in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. k) by A6, A8, A10, A18, MSUALG_6:2; then A22: LeastSort tr <= (the_arity_of o) /. k by Def12; let s1, s2 be Element of S; ::_thesis: ( not s1 = (LeastSorts ((PTMin X) * ts1)) . i or not s2 = (the_arity_of o) . i or s1 <= s2 ) assume that A23: s1 = (LeastSorts ((PTMin X) * ts1)) . i and A24: s2 = (the_arity_of o) . i ; ::_thesis: s1 <= s2 ex t3 being Element of TS (DTConOSA X) st ( t3 = ((PTMin X) * ts1) . k & (LeastSorts ((PTMin X) * ts1)) . k = LeastSort t3 ) by A9, A10, A18, Def13; hence s1 <= s2 by A19, A23, A24, A21, A22, A20, ORDERS_2:3; ::_thesis: verum end; hence LeastSorts ((PTMin X) * ts) <= the_arity_of o2 by A5, A15, A14, XTUPLE_0:1; ::_thesis: ( OSSym (o2,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t1 = (OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) LBound (o2,(LeastSorts ((PTMin X) * ts))) has_least_rank_for o2, LeastSorts ((PTMin X) * ts) by A14, A16, A17, OSALG_1:14; then LBound (o2,(LeastSorts ((PTMin X) * ts))) has_least_args_for o2, LeastSorts ((PTMin X) * ts) by OSALG_1:def_11; then LeastSorts ((PTMin X) * ts) <= the_arity_of (LBound (o2,(LeastSorts ((PTMin X) * ts)))) by OSALG_1:def_9; then A25: (PTMin X) * ts in Args ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),(ParsedTermsOSA X)) by Th18; (PTMin X) * ts in Args (o2,(ParsedTermsOSA X)) by A14, A16, A17, Th18; hence ( OSSym (o2,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) ) by A25, Th13; ::_thesis: (PTMin X) . t1 = (OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) hence (PTMin X) . t1 = (OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) by A11, A14, A16, Def14; ::_thesis: verum end; A26: for s being Element of S for x being set st x in X . s & t1 = root-tree [x,s] holds (PTMin X) . t1 = t1 proof let s be Element of S; ::_thesis: for x being set st x in X . s & t1 = root-tree [x,s] holds (PTMin X) . t1 = t1 let x be set ; ::_thesis: ( x in X . s & t1 = root-tree [x,s] implies (PTMin X) . t1 = t1 ) assume that A27: x in X . s and A28: t1 = root-tree [x,s] ; ::_thesis: (PTMin X) . t1 = t1 t1 . {} = [o, the carrier of S] by A5, TREES_4:def_4; hence (PTMin X) . t1 = t1 by A27, A28, Th10; ::_thesis: verum end; A29: (PTClasses X) . t1 = @ (nt,((PTClasses X) * ts1)) by A2, Def21 .= { [((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 ((PTClasses X) * ts1) & ( for y being Nat st y in dom ((PTClasses X) * ts1) holds [(x2 . y),(w3 /. y)] in ((PTClasses X) * ts1) . y ) ) ) } ; take t1 ; ::_thesis: ( t1 = nt -tree ts1 & S1[t1] & S2[t1] & S3[t1] & S4[t1] ) thus t1 = nt -tree ts1 ; ::_thesis: ( S1[t1] & S2[t1] & S3[t1] & S4[t1] ) A30: ex l being Nat st dom ts1 = Seg l by FINSEQ_1:def_2; reconsider ta1 = t1 as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort t1) by Def12; A31: dom ((PTClasses X) * ts1) = dom ts1 by FINSEQ_3:120; A32: nt = OSSym (o,X) by A5; then OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X) ==> roots ((PTMin X) * ts1) by A2, A12; then consider o3 being OperSymbol of S such that A33: OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X) = [o3, the carrier of S] and A34: (PTMin X) * ts1 in Args (o3,(ParsedTermsOSA X)) and A35: (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X)) -tree ((PTMin X) * ts1) = (Den (o3,(ParsedTermsOSA X))) . ((PTMin X) * ts1) and for s1 being Element of S holds ( (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X)) -tree ((PTMin X) * ts1) in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o3 <= s1 ) by Th12; reconsider Msr = (PTMin X) * ts1 as Element of Args ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),(ParsedTermsOSA X)) by A33, A34, XTUPLE_0:1; A36: LBound (o,(LeastSorts ((PTMin X) * ts1))) = o3 by A33, XTUPLE_0:1; then A37: (PTMin X) . t1 = (Den ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),(ParsedTermsOSA X))) . Msr by A2, A32, A12, A35; A38: LeastSorts ((PTMin X) * ts1) <= the_arity_of o by A2, A32, A12; then A39: LBound (o,(LeastSorts ((PTMin X) * ts1))) has_least_rank_for o, LeastSorts ((PTMin X) * ts1) by OSALG_1:14; then A40: LBound (o,(LeastSorts ((PTMin X) * ts1))) has_least_sort_for o, LeastSorts ((PTMin X) * ts1) by OSALG_1:def_11; then A41: o ~= LBound (o,(LeastSorts ((PTMin X) * ts1))) by OSALG_1:def_10; LBound (o,(LeastSorts ((PTMin X) * ts1))) has_least_args_for o, LeastSorts ((PTMin X) * ts1) by A39, OSALG_1:def_11; then the_arity_of (LBound (o,(LeastSorts ((PTMin X) * ts1)))) <= the_arity_of o by A38, OSALG_1:def_9; then A42: len (the_arity_of (LBound (o,(LeastSorts ((PTMin X) * ts1))))) = len (the_arity_of o) by OSALG_1:def_6; A43: OSClass ((PTCongruence X),t1) = OSClass ((PTCongruence X),ta1) by Def27 .= proj1 ((PTClasses X) . t1) by Th25 ; A44: the_result_sort_of (LBound (o,(LeastSorts ((PTMin X) * ts1)))) <= the_result_sort_of o by A38, A40, OSALG_1:def_10; A45: (PTMin X) . t1 in OSClass ((PTCongruence X),t1) proof defpred S6[ set , set ] means [(((PTMin X) * ts1) . $1),$2] in ((PTClasses X) * ts1) . $1; A46: for i being set st i in dom ((PTClasses X) * ts1) holds ex s4 being set st ( s4 in the carrier of S & S6[i,s4] ) proof let i be set ; ::_thesis: ( i in dom ((PTClasses X) * ts1) implies ex s4 being set st ( s4 in the carrier of S & S6[i,s4] ) ) assume A47: i in dom ((PTClasses X) * ts1) ; ::_thesis: ex s4 being set st ( s4 in the carrier of S & S6[i,s4] ) A48: ((PTClasses X) * ts1) . i = (PTClasses X) . (ts1 . i) by A47, FINSEQ_3:120; ts1 . i in rng ts1 by A31, A47, FUNCT_1:3; then reconsider td1 = ts1 . i as Element of TS (DTConOSA X) by A4; A49: ex td2 being Element of TS (DTConOSA X) st ( td2 = td1 & (PTMin X) . td2 in OSClass ((PTCongruence X),td2) & S2[td2] & S3[td2] & S4[td2] ) by A3, A31, A47, FUNCT_1:3; A50: ((PTMin X) * ts1) . i = (PTMin X) . (ts1 . i) by A31, A47, FUNCT_1:13; reconsider tda = td1 as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort td1) by Def12; OSClass ((PTCongruence X),td1) = OSClass ((PTCongruence X),tda) by Def27 .= proj1 (((PTClasses X) * ts1) . i) by A48, Th25 ; then ex s4 being set st [(((PTMin X) * ts1) . i),s4] in ((PTClasses X) * ts1) . i by A50, A49, XTUPLE_0:def_12; hence ex s4 being set st ( s4 in the carrier of S & S6[i,s4] ) by A48, Th23; ::_thesis: verum end; consider f being Function such that A51: ( dom f = dom ((PTClasses X) * ts1) & rng f c= the carrier of S & ( for z being set st z in dom ((PTClasses X) * ts1) holds S6[z,f . z] ) ) from FUNCT_1:sch_5(A46); reconsider wa = f as FinSequence by A31, A30, A51, FINSEQ_1:def_2; reconsider wa = wa as FinSequence of the carrier of S by A51, FINSEQ_1:def_4; reconsider wa = wa as Element of the carrier of S * by FINSEQ_1:def_11; for y being Nat st y in dom ((PTClasses X) * ts1) holds [(Msr . y),(wa /. y)] in ((PTClasses X) * ts1) . y proof let y be Nat; ::_thesis: ( y in dom ((PTClasses X) * ts1) implies [(Msr . y),(wa /. y)] in ((PTClasses X) * ts1) . y ) assume A52: y in dom ((PTClasses X) * ts1) ; ::_thesis: [(Msr . y),(wa /. y)] in ((PTClasses X) * ts1) . y wa /. y = wa . y by A51, A52, PARTFUN1:def_6; hence [(Msr . y),(wa /. y)] in ((PTClasses X) * ts1) . y by A51, A52; ::_thesis: verum end; then [((Den ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),(ParsedTermsOSA X))) . Msr),(the_result_sort_of o)] in (PTClasses X) . t1 by A5, A29, A41, A44, A42, A51; hence (PTMin X) . t1 in OSClass ((PTCongruence X),t1) by A43, A37, XTUPLE_0:def_12; ::_thesis: verum end; (PTMin X) . t1 = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X)) -tree ((PTMin X) * ts1) by A2, A32, A12; then A53: LeastSort ((PTMin X) . t1) = the_result_sort_of (LBound (o,(LeastSorts ((PTMin X) * ts1)))) by A34, A35, A36, Th17; LeastSort t1 = the_result_sort_of o by A6, A7, Th17; hence ( S1[t1] & S2[t1] & S3[t1] & S4[t1] ) by A12, A38, A53, A40, A45, A26, OSALG_1:def_10; ::_thesis: verum end; A54: for s being Symbol of (DTConOSA X) st s in Terminals (DTConOSA X) holds S5[ root-tree s] proof let sy be Symbol of (DTConOSA X); ::_thesis: ( sy in Terminals (DTConOSA X) implies S5[ root-tree sy] ) assume A55: sy in Terminals (DTConOSA X) ; ::_thesis: S5[ root-tree sy] reconsider t1 = root-tree sy as Element of TS (DTConOSA X) by A55, DTCONSTR:def_1; take t1 ; ::_thesis: ( t1 = root-tree sy & S1[t1] & S2[t1] & S3[t1] & S4[t1] ) thus t1 = root-tree sy ; ::_thesis: ( S1[t1] & S2[t1] & S3[t1] & S4[t1] ) A56: (PTMin X) . (root-tree sy) = pi sy by A55, Def31 .= root-tree sy by A55, Def16 ; hence (PTMin X) . t1 in OSClass ((PTCongruence X),t1) by Th32; ::_thesis: ( S2[t1] & S3[t1] & S4[t1] ) thus LeastSort ((PTMin X) . t1) <= LeastSort t1 by A56; ::_thesis: ( S3[t1] & S4[t1] ) thus for s1 being Element of S for x1 being set st x1 in X . s1 & t1 = root-tree [x1,s1] holds (PTMin X) . t1 = t1 by A56; ::_thesis: S4[t1] A57: ex s being Element of S ex x being set st ( x in X . s & sy = [x,s] ) by A55, Th4; hereby ::_thesis: verum let o be OperSymbol of S; ::_thesis: for ts being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots ts & t1 = (OSSym (o,X)) -tree ts holds ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t1 = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) let ts be FinSequence of TS (DTConOSA X); ::_thesis: ( OSSym (o,X) ==> roots ts & t1 = (OSSym (o,X)) -tree ts implies ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t1 = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) ) assume that OSSym (o,X) ==> roots ts and A58: t1 = (OSSym (o,X)) -tree ts ; ::_thesis: ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t1 = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) t1 . {} = [o, the carrier of S] by A58, TREES_4:def_4; hence ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t1 = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) by A57, Th10; ::_thesis: verum end; end; for dt being DecoratedTree of the carrier of (DTConOSA X) st dt in TS (DTConOSA X) holds S5[dt] from DTCONSTR:sch_7(A54, A1); then ex t1 being Element of TS (DTConOSA X) st ( t1 = t & S1[t1] & S2[t1] & S3[t1] & S4[t1] ) ; hence ( (PTMin X) . t in OSClass ((PTCongruence X),t) & LeastSort ((PTMin X) . t) <= LeastSort t & ( for s being Element of S for x being set st x in X . s & t = root-tree [x,s] holds (PTMin X) . t = t ) & ( for o being OperSymbol of S for ts being FinSequence of TS (DTConOSA X) st OSSym (o,X) ==> roots ts & t = (OSSym (o,X)) -tree ts holds ( LeastSorts ((PTMin X) * ts) <= the_arity_of o & OSSym (o,X) ==> roots ((PTMin X) * ts) & OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X) ==> roots ((PTMin X) * ts) & (PTMin X) . t = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts)))),X)) -tree ((PTMin X) * ts) ) ) ) ; ::_thesis: verum end; theorem Th41: :: OSAFREE:41 for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for t, t1 being Element of TS (DTConOSA X) st t1 in OSClass ((PTCongruence X),t) holds (PTMin X) . t1 = (PTMin X) . t proof let S be monotone regular locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for t, t1 being Element of TS (DTConOSA X) st t1 in OSClass ((PTCongruence X),t) holds (PTMin X) . t1 = (PTMin X) . t let X be V16() ManySortedSet of S; ::_thesis: for t, t1 being Element of TS (DTConOSA X) st t1 in OSClass ((PTCongruence X),t) holds (PTMin X) . t1 = (PTMin X) . t let t be Element of TS (DTConOSA X); ::_thesis: for t1 being Element of TS (DTConOSA X) st t1 in OSClass ((PTCongruence X),t) holds (PTMin X) . t1 = (PTMin X) . t set PTA = ParsedTermsOSA X; set D = DTConOSA X; set R = PTCongruence X; set SPTA = the Sorts of (ParsedTermsOSA X); set M = PTMin X; set F = PTClasses X; defpred S1[ Element of TS (DTConOSA X)] means for t1 being Element of TS (DTConOSA X) st t1 in OSClass ((PTCongruence X),$1) holds (PTMin X) . t1 = (PTMin X) . $1; defpred S2[ DecoratedTree of the carrier of (DTConOSA X)] means ex t1 being Element of TS (DTConOSA X) st ( t1 = $1 & S1[t1] ); A1: for nt being Symbol of (DTConOSA X) for ts1 being FinSequence of TS (DTConOSA X) st nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S2[dt1] ) holds S2[nt -tree ts1] proof let nt be Symbol of (DTConOSA X); ::_thesis: for ts1 being FinSequence of TS (DTConOSA X) st nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S2[dt1] ) holds S2[nt -tree ts1] let ts1 be FinSequence of TS (DTConOSA X); ::_thesis: ( nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S2[dt1] ) implies S2[nt -tree ts1] ) assume that A2: nt ==> roots ts1 and A3: for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds ex t2 being Element of TS (DTConOSA X) st ( t2 = dt1 & S1[t2] ) ; ::_thesis: S2[nt -tree ts1] reconsider t1 = nt -tree ts1 as Element of TS (DTConOSA X) by A2, Th12; A4: (PTClasses X) . t1 = @ (nt,((PTClasses X) * ts1)) by A2, Def21 .= { [((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 ((PTClasses X) * ts1) & ( for y being Nat st y in dom ((PTClasses X) * ts1) holds [(x2 . y),(w3 /. y)] in ((PTClasses X) * ts1) . y ) ) ) } ; consider o being OperSymbol of S such that A5: nt = [o, the carrier of S] and A6: ts1 in Args (o,(ParsedTermsOSA X)) and nt -tree ts1 = (Den (o,(ParsedTermsOSA X))) . ts1 and for s1 being Element of S holds ( nt -tree ts1 in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) by A2, Th12; A7: t1 = (OSSym (o,X)) -tree ts1 by A5; then A8: LeastSorts ((PTMin X) * ts1) <= the_arity_of o by A2, A5, Th40; set Ms = (PTMin X) * ts1; set w = the_arity_of o; A9: dom ts1 = dom (the_arity_of o) by A6, MSUALG_3:6; reconsider ta1 = t1 as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort t1) by Def12; take t1 ; ::_thesis: ( t1 = nt -tree ts1 & S1[t1] ) thus t1 = nt -tree ts1 ; ::_thesis: S1[t1] A10: dom ((PTClasses X) * ts1) = dom ts1 by FINSEQ_3:120; A11: OSClass ((PTCongruence X),t1) = OSClass ((PTCongruence X),ta1) by Def27 .= proj1 ((PTClasses X) . t1) by Th25 ; A12: rng ts1 c= TS (DTConOSA X) by FINSEQ_1:def_4; A13: dom ((PTMin X) * ts1) = dom ts1 by FINSEQ_3:120; A14: (PTMin X) . t1 = (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X)) -tree ((PTMin X) * ts1) by A2, A5, A7, Th40; thus for t3 being Element of TS (DTConOSA X) st t3 in OSClass ((PTCongruence X),t1) holds (PTMin X) . t3 = (PTMin X) . t1 ::_thesis: verum proof let t3 be Element of TS (DTConOSA X); ::_thesis: ( t3 in OSClass ((PTCongruence X),t1) implies (PTMin X) . t3 = (PTMin X) . t1 ) assume t3 in OSClass ((PTCongruence X),t1) ; ::_thesis: (PTMin X) . t3 = (PTMin X) . t1 then consider s4 being set such that A15: [t3,s4] in (PTClasses X) . t1 by A11, XTUPLE_0:def_12; consider o2 being OperSymbol of S, x2 being Element of Args (o2,(ParsedTermsOSA X)), s3 being Element of S such that A16: [t3,s4] = [((Den (o2,(ParsedTermsOSA X))) . x2),s3] and A17: 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 ) and A18: ex w3 being Element of the carrier of S * st ( dom w3 = dom ((PTClasses X) * ts1) & ( for y being Nat st y in dom ((PTClasses X) * ts1) holds [(x2 . y),(w3 /. y)] in ((PTClasses X) * ts1) . y ) ) by A4, A15; consider o1 being OperSymbol of S such that A19: nt = [o1, the carrier of S] and A20: o1 ~= o2 and A21: len (the_arity_of o1) = len (the_arity_of o2) and the_result_sort_of o1 <= s3 and the_result_sort_of o2 <= s3 by A17; A22: o1 = o by A5, A19, XTUPLE_0:1; then A23: dom (the_arity_of o) = dom (the_arity_of o2) by A21, FINSEQ_3:29; reconsider ts3 = x2 as FinSequence of TS (DTConOSA X) by Th13; A24: dom ts3 = dom (the_arity_of o2) by MSUALG_3:6; A25: dom ((PTMin X) * ts3) = dom ts3 by FINSEQ_3:120; A26: rng ts3 c= TS (DTConOSA X) by FINSEQ_1:def_4; for k being Nat st k in dom ((PTMin X) * ts3) holds ((PTMin X) * ts3) . k = ((PTMin X) * ts1) . k proof consider w3 being Element of the carrier of S * such that dom w3 = dom ((PTClasses X) * ts1) and A27: for y being Nat st y in dom ((PTClasses X) * ts1) holds [(x2 . y),(w3 /. y)] in ((PTClasses X) * ts1) . y by A18; let k be Nat; ::_thesis: ( k in dom ((PTMin X) * ts3) implies ((PTMin X) * ts3) . k = ((PTMin X) * ts1) . k ) assume A28: k in dom ((PTMin X) * ts3) ; ::_thesis: ((PTMin X) * ts3) . k = ((PTMin X) * ts1) . k A29: ts3 . k in rng ts3 by A25, A28, FUNCT_1:3; ts1 . k in rng ts1 by A9, A23, A24, A25, A28, FUNCT_1:3; then reconsider tk1 = ts1 . k, tk3 = ts3 . k as Element of TS (DTConOSA X) by A12, A26, A29; reconsider tak = tk1 as Element of the Sorts of (ParsedTermsOSA X) . (LeastSort tk1) by Def12; consider tk2 being Element of TS (DTConOSA X) such that A30: tk2 = tk1 and A31: for t4 being Element of TS (DTConOSA X) st t4 in OSClass ((PTCongruence X),tk2) holds (PTMin X) . t4 = (PTMin X) . tk2 by A3, A9, A23, A24, A25, A28, FUNCT_1:3; [tk3,(w3 /. k)] in ((PTClasses X) * ts1) . k by A10, A9, A23, A24, A25, A28, A27; then A32: [tk3,(w3 /. k)] in (PTClasses X) . tk1 by A10, A9, A23, A24, A25, A28, FINSEQ_3:120; OSClass ((PTCongruence X),tk1) = OSClass ((PTCongruence X),tak) by Def27 .= proj1 ((PTClasses X) . tk1) by Th25 ; then tk3 in OSClass ((PTCongruence X),tk1) by A32, XTUPLE_0:def_12; then (PTMin X) . tk3 = (PTMin X) . tk1 by A30, A31; then (PTMin X) . tk3 = ((PTMin X) * ts1) . k by A13, A9, A23, A24, A25, A28, FINSEQ_3:120; hence ((PTMin X) * ts3) . k = ((PTMin X) * ts1) . k by A28, FINSEQ_3:120; ::_thesis: verum end; then A33: (PTMin X) * ts3 = (PTMin X) * ts1 by A13, A9, A23, A25, FINSEQ_1:13, MSUALG_3:6; A34: OSSym (o2,X) ==> roots x2 by Th13; then ex o3 being OperSymbol of S st ( OSSym (o2,X) = [o3, the carrier of S] & ts3 in Args (o3,(ParsedTermsOSA X)) & (OSSym (o2,X)) -tree ts3 = (Den (o3,(ParsedTermsOSA X))) . ts3 & ( for s1 being Element of S holds ( (OSSym (o2,X)) -tree ts3 in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o3 <= s1 ) ) ) by Th12; then consider o3 being OperSymbol of S such that A35: OSSym (o2,X) = [o3, the carrier of S] and ts3 in Args (o3,(ParsedTermsOSA X)) and A36: (OSSym (o2,X)) -tree ts3 = (Den (o3,(ParsedTermsOSA X))) . ts3 ; o2 = o3 by A35, XTUPLE_0:1; then A37: t3 = (OSSym (o2,X)) -tree ts3 by A16, A36, XTUPLE_0:1; then A38: LeastSorts ((PTMin X) * ts3) <= the_arity_of o2 by A34, Th40; (PTMin X) . t3 = (OSSym ((LBound (o2,(LeastSorts ((PTMin X) * ts3)))),X)) -tree ((PTMin X) * ts3) by A34, A37, Th40; hence (PTMin X) . t3 = (PTMin X) . t1 by A14, A8, A20, A22, A33, A38, OSALG_1:34; ::_thesis: verum end; end; A39: for s being Symbol of (DTConOSA X) st s in Terminals (DTConOSA X) holds S2[ root-tree s] proof let sy be Symbol of (DTConOSA X); ::_thesis: ( sy in Terminals (DTConOSA X) implies S2[ root-tree sy] ) assume A40: sy in Terminals (DTConOSA X) ; ::_thesis: S2[ root-tree sy] reconsider t1 = root-tree sy as Element of TS (DTConOSA X) by A40, DTCONSTR:def_1; take t1 ; ::_thesis: ( t1 = root-tree sy & S1[t1] ) thus t1 = root-tree sy ; ::_thesis: S1[t1] A41: ex s being Element of S ex x being set st ( x in X . s & sy = [x,s] ) by A40, Th4; let t2 be Element of TS (DTConOSA X); ::_thesis: ( t2 in OSClass ((PTCongruence X),t1) implies (PTMin X) . t2 = (PTMin X) . t1 ) assume t2 in OSClass ((PTCongruence X),t1) ; ::_thesis: (PTMin X) . t2 = (PTMin X) . t1 hence (PTMin X) . t2 = (PTMin X) . t1 by A41, Th33; ::_thesis: verum end; for dt being DecoratedTree of the carrier of (DTConOSA X) st dt in TS (DTConOSA X) holds S2[dt] from DTCONSTR:sch_7(A39, A1); then ex t1 being Element of TS (DTConOSA X) st ( t1 = t & S1[t1] ) ; hence for t1 being Element of TS (DTConOSA X) st t1 in OSClass ((PTCongruence X),t) holds (PTMin X) . t1 = (PTMin X) . t ; ::_thesis: verum end; theorem Th42: :: OSAFREE:42 for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for t1, t2 being Element of TS (DTConOSA X) holds ( t2 in OSClass ((PTCongruence X),t1) iff (PTMin X) . t2 = (PTMin X) . t1 ) proof let S be monotone regular locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for t1, t2 being Element of TS (DTConOSA X) holds ( t2 in OSClass ((PTCongruence X),t1) iff (PTMin X) . t2 = (PTMin X) . t1 ) let X be V16() ManySortedSet of S; ::_thesis: for t1, t2 being Element of TS (DTConOSA X) holds ( t2 in OSClass ((PTCongruence X),t1) iff (PTMin X) . t2 = (PTMin X) . t1 ) let t1, t2 be Element of TS (DTConOSA X); ::_thesis: ( t2 in OSClass ((PTCongruence X),t1) iff (PTMin X) . t2 = (PTMin X) . t1 ) set R = PTCongruence X; set M = PTMin X; thus ( t2 in OSClass ((PTCongruence X),t1) implies (PTMin X) . t2 = (PTMin X) . t1 ) by Th41; ::_thesis: ( (PTMin X) . t2 = (PTMin X) . t1 implies t2 in OSClass ((PTCongruence X),t1) ) (PTMin X) . t2 in OSClass ((PTCongruence X),t2) by Th40; then A1: OSClass ((PTCongruence X),t2) = OSClass ((PTCongruence X),((PTMin X) . t2)) by Th34; (PTMin X) . t1 in OSClass ((PTCongruence X),t1) by Th40; then A2: OSClass ((PTCongruence X),t1) = OSClass ((PTCongruence X),((PTMin X) . t1)) by Th34; assume (PTMin X) . t2 = (PTMin X) . t1 ; ::_thesis: t2 in OSClass ((PTCongruence X),t1) hence t2 in OSClass ((PTCongruence X),t1) by A2, A1, Th32; ::_thesis: verum end; theorem Th43: :: OSAFREE:43 for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for t1 being Element of TS (DTConOSA X) holds (PTMin X) . ((PTMin X) . t1) = (PTMin X) . t1 proof let S be monotone regular locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for t1 being Element of TS (DTConOSA X) holds (PTMin X) . ((PTMin X) . t1) = (PTMin X) . t1 let X be V16() ManySortedSet of S; ::_thesis: for t1 being Element of TS (DTConOSA X) holds (PTMin X) . ((PTMin X) . t1) = (PTMin X) . t1 let t1 be Element of TS (DTConOSA X); ::_thesis: (PTMin X) . ((PTMin X) . t1) = (PTMin X) . t1 (PTMin X) . t1 in OSClass ((PTCongruence X),t1) by Th40; hence (PTMin X) . ((PTMin X) . t1) = (PTMin X) . t1 by Th42; ::_thesis: verum end; theorem Th44: :: OSAFREE:44 for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for R being MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X for t being Element of TS (DTConOSA X) holds [t,((PTMin X) . t)] in R . (LeastSort t) proof let S be monotone regular locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for R being MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X for t being Element of TS (DTConOSA X) holds [t,((PTMin X) . t)] in R . (LeastSort t) let X be V16() ManySortedSet of S; ::_thesis: for R being MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X for t being Element of TS (DTConOSA X) holds [t,((PTMin X) . t)] in R . (LeastSort t) set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); set D = DTConOSA X; set M = PTMin X; let R be MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X; ::_thesis: for t being Element of TS (DTConOSA X) holds [t,((PTMin X) . t)] in R . (LeastSort t) defpred S1[ set ] means ex t1 being Element of TS (DTConOSA X) st ( t1 = $1 & [t1,((PTMin X) . t1)] in R . (LeastSort t1) ); let t be Element of TS (DTConOSA X); ::_thesis: [t,((PTMin X) . t)] in R . (LeastSort t) A1: R is os-compatible by OSALG_4:def_2; A2: for nt being Symbol of (DTConOSA X) for ts1 being FinSequence of TS (DTConOSA X) st nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S1[dt1] ) holds S1[nt -tree ts1] proof let nt be Symbol of (DTConOSA X); ::_thesis: for ts1 being FinSequence of TS (DTConOSA X) st nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S1[dt1] ) holds S1[nt -tree ts1] let ts1 be FinSequence of TS (DTConOSA X); ::_thesis: ( nt ==> roots ts1 & ( for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S1[dt1] ) implies S1[nt -tree ts1] ) assume that A3: nt ==> roots ts1 and A4: for dt1 being DecoratedTree of the carrier of (DTConOSA X) st dt1 in rng ts1 holds S1[dt1] ; ::_thesis: S1[nt -tree ts1] consider o being OperSymbol of S such that A5: nt = [o, the carrier of S] and A6: ts1 in Args (o,(ParsedTermsOSA X)) and A7: nt -tree ts1 = (Den (o,(ParsedTermsOSA X))) . ts1 and for s1 being Element of S holds ( nt -tree ts1 in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o <= s1 ) by A3, Th12; reconsider t1 = nt -tree ts1 as Element of TS (DTConOSA X) by A3, Th12; A8: dom ((PTMin X) * ts1) = dom ts1 by FINSEQ_3:120; reconsider tsa = ts1 as Element of Args (o,(ParsedTermsOSA X)) by A6; set w = the_arity_of o; A9: rng ts1 c= TS (DTConOSA X) by FINSEQ_1:def_4; set lo = LBound (o,(LeastSorts ((PTMin X) * ts1))); set rs1 = the_result_sort_of o; A10: t1 = (OSSym (o,X)) -tree ts1 by A5; then A11: OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X) ==> roots ((PTMin X) * ts1) by A3, A5, Th40; then reconsider tsm = (PTMin X) * ts1 as Element of Args ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),(ParsedTermsOSA X)) by Th13; A12: dom ts1 = dom (the_arity_of o) by A6, MSUALG_3:6; A13: for y being Nat st y in dom tsm holds [(tsm . y),(tsa . y)] in R . ((the_arity_of o) /. y) proof let y be Nat; ::_thesis: ( y in dom tsm implies [(tsm . y),(tsa . y)] in R . ((the_arity_of o) /. y) ) assume A14: y in dom tsm ; ::_thesis: [(tsm . y),(tsa . y)] in R . ((the_arity_of o) /. y) ts1 . y in rng ts1 by A8, A14, FUNCT_1:3; then reconsider td1 = ts1 . y as Element of TS (DTConOSA X) by A9; consider t2 being Element of TS (DTConOSA X) such that A15: t2 = td1 and A16: [t2,((PTMin X) . t2)] in R . (LeastSort t2) by A4, A8, A14, FUNCT_1:3; A17: (PTMin X) . t2 = tsm . y by A14, A15, FINSEQ_3:120; A18: (PTMin X) . t2 in the Sorts of (ParsedTermsOSA X) . (LeastSort t2) by A16, ZFMISC_1:87; tsa . y in the Sorts of (ParsedTermsOSA X) . ((the_arity_of o) /. y) by A8, A12, A14, MSUALG_6:2; then A19: LeastSort t2 <= (the_arity_of o) /. y by A15, Def12; A20: t2 in the Sorts of (ParsedTermsOSA X) . (LeastSort t2) by A16, ZFMISC_1:87; field (R . (LeastSort t2)) = the Sorts of (ParsedTermsOSA X) . (LeastSort t2) by ORDERS_1:12; then R . (LeastSort t2) is_symmetric_in the Sorts of (ParsedTermsOSA X) . (LeastSort t2) by RELAT_2:def_11; then [((PTMin X) . t2),t2] in R . (LeastSort t2) by A16, A20, A18, RELAT_2:def_3; hence [(tsm . y),(tsa . y)] in R . ((the_arity_of o) /. y) by A1, A15, A20, A18, A17, A19, OSALG_4:def_1; ::_thesis: verum end; LeastSorts ((PTMin X) * ts1) <= the_arity_of o by A3, A5, A10, Th40; then LBound (o,(LeastSorts ((PTMin X) * ts1))) <= o by OSALG_1:35; then A21: [((Den ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),(ParsedTermsOSA X))) . tsm),((Den (o,(ParsedTermsOSA X))) . tsa)] in R . (the_result_sort_of o) by A13, OSALG_4:def_26; then A22: (Den (o,(ParsedTermsOSA X))) . tsa in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) by ZFMISC_1:87; A23: LeastSort t1 = the_result_sort_of o by A6, A7, Th17; A24: OSSym (o,X) ==> roots ts1 by A3, A5; take t1 ; ::_thesis: ( t1 = nt -tree ts1 & [t1,((PTMin X) . t1)] in R . (LeastSort t1) ) thus t1 = nt -tree ts1 ; ::_thesis: [t1,((PTMin X) . t1)] in R . (LeastSort t1) field (R . (the_result_sort_of o)) = the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) by ORDERS_1:12; then A25: R . (the_result_sort_of o) is_symmetric_in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) by RELAT_2:def_11; (Den ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),(ParsedTermsOSA X))) . tsm in the Sorts of (ParsedTermsOSA X) . (the_result_sort_of o) by A21, ZFMISC_1:87; then A26: [((Den (o,(ParsedTermsOSA X))) . tsa),((Den ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),(ParsedTermsOSA X))) . tsm)] in R . (the_result_sort_of o) by A21, A22, A25, RELAT_2:def_3; consider o4 being OperSymbol of S such that A27: OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X) = [o4, the carrier of S] and (PTMin X) * ts1 in Args (o4,(ParsedTermsOSA X)) and A28: (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X)) -tree ((PTMin X) * ts1) = (Den (o4,(ParsedTermsOSA X))) . ((PTMin X) * ts1) and for s1 being Element of S holds ( (OSSym ((LBound (o,(LeastSorts ((PTMin X) * ts1)))),X)) -tree ((PTMin X) * ts1) in the Sorts of (ParsedTermsOSA X) . s1 iff the_result_sort_of o4 <= s1 ) by A11, Th12; LBound (o,(LeastSorts ((PTMin X) * ts1))) = o4 by A27, XTUPLE_0:1; hence [t1,((PTMin X) . t1)] in R . (LeastSort t1) by A5, A7, A24, A26, A23, A28, Th40; ::_thesis: verum end; A29: 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 sy in Terminals (DTConOSA X) ; ::_thesis: S1[ root-tree sy] then A30: ex s being Element of S ex x being set st ( x in X . s & sy = [x,s] ) by Th4; then reconsider t1 = root-tree sy as Element of TS (DTConOSA X) by Th10; take t1 ; ::_thesis: ( t1 = root-tree sy & [t1,((PTMin X) . t1)] in R . (LeastSort t1) ) A31: t1 in the Sorts of (ParsedTermsOSA X) . (LeastSort t1) by Def12; field (R . (LeastSort t1)) = the Sorts of (ParsedTermsOSA X) . (LeastSort t1) by ORDERS_1:12; then A32: R . (LeastSort t1) is_reflexive_in the Sorts of (ParsedTermsOSA X) . (LeastSort t1) by RELAT_2:def_9; t1 = (PTMin X) . t1 by A30, Th40; hence ( t1 = root-tree sy & [t1,((PTMin X) . t1)] in R . (LeastSort t1) ) by A31, A32, RELAT_2:def_1; ::_thesis: verum end; for dt being DecoratedTree of the carrier of (DTConOSA X) st dt in TS (DTConOSA X) holds S1[dt] from DTCONSTR:sch_7(A29, A2); then ex t1 being Element of TS (DTConOSA X) st ( t = t1 & [t1,((PTMin X) . t1)] in R . (LeastSort t1) ) ; hence [t,((PTMin X) . t)] in R . (LeastSort t) ; ::_thesis: verum end; theorem Th45: :: OSAFREE:45 for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for R being MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X holds PTCongruence X c= R proof let S be monotone regular locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for R being MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X holds PTCongruence X c= R let X be V16() ManySortedSet of S; ::_thesis: for R being MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X holds PTCongruence X c= R set PTA = ParsedTermsOSA X; set SPTA = the Sorts of (ParsedTermsOSA X); set D = DTConOSA X; set M = PTMin X; set P = PTCongruence X; reconsider O1 = the Sorts of (ParsedTermsOSA X) as OrderSortedSet of S ; let R be MSEquivalence-like monotone OrderSortedRelation of ParsedTermsOSA X; ::_thesis: PTCongruence X c= R let i be set ; :: according to PBOOLE:def_2 ::_thesis: ( not i in the carrier of S or (PTCongruence X) . i c= R . i ) assume A1: i in the carrier of S ; ::_thesis: (PTCongruence X) . i c= R . i reconsider s = i as Element of S by A1; A2: R is os-compatible by OSALG_4:def_2; for a, b being set st [a,b] in (PTCongruence X) . s holds [a,b] in R . s proof A3: field (R . s) = the Sorts of (ParsedTermsOSA X) . s by ORDERS_1:12; then A4: R . s is_transitive_in the Sorts of (ParsedTermsOSA X) . s by RELAT_2:def_16; A5: R . s is_symmetric_in the Sorts of (ParsedTermsOSA X) . s by A3, RELAT_2:def_11; let a, b be set ; ::_thesis: ( [a,b] in (PTCongruence X) . s implies [a,b] in R . s ) assume A6: [a,b] in (PTCongruence X) . s ; ::_thesis: [a,b] in R . s reconsider ta = a, tb = b as Element of the Sorts of (ParsedTermsOSA X) . s by A6, ZFMISC_1:87; A7: a in the Sorts of (ParsedTermsOSA X) . i by A6, ZFMISC_1:87; A8: OSClass ((PTCongruence X),ta) = OSClass ((PTCongruence X),tb) by A6, OSALG_4:12; A9: b in the Sorts of (ParsedTermsOSA X) . i by A6, ZFMISC_1:87; dom the Sorts of (ParsedTermsOSA X) = the carrier of S by PARTFUN1:def_2; then reconsider t1 = a, t2 = b as Element of (ParsedTermsOSA X) by A1, A7, A9, CARD_5:2; reconsider t1 = t1, t2 = t2 as Element of TS (DTConOSA X) by Th14; A10: t2 in the Sorts of (ParsedTermsOSA X) . (LeastSort t2) by Def12; A11: (PTMin X) . t2 in the Sorts of (ParsedTermsOSA X) . (LeastSort ((PTMin X) . t2)) by Def12; LeastSort ((PTMin X) . t2) <= LeastSort t2 by Th40; then A12: O1 . (LeastSort ((PTMin X) . t2)) c= O1 . (LeastSort t2) by OSALG_1:def_16; A13: [t2,((PTMin X) . t2)] in R . (LeastSort t2) by Th44; LeastSort t2 <= s by A9, Def12; then A14: [t2,((PTMin X) . t2)] in R . s by A2, A10, A11, A12, A13, OSALG_4:def_1; then (PTMin X) . t2 in the Sorts of (ParsedTermsOSA X) . s by ZFMISC_1:87; then A15: [((PTMin X) . t2),t2] in R . s by A9, A14, A5, RELAT_2:def_3; LeastSort ((PTMin X) . t1) <= LeastSort t1 by Th40; then A16: O1 . (LeastSort ((PTMin X) . t1)) c= O1 . (LeastSort t1) by OSALG_1:def_16; A17: (PTMin X) . t1 in the Sorts of (ParsedTermsOSA X) . (LeastSort ((PTMin X) . t1)) by Def12; A18: [t1,((PTMin X) . t1)] in R . (LeastSort t1) by Th44; A19: OSClass ((PTCongruence X),t2) = OSClass ((PTCongruence X),tb) by Def27; OSClass ((PTCongruence X),t1) = OSClass ((PTCongruence X),ta) by Def27; then t1 in OSClass ((PTCongruence X),t2) by A8, A19, Th34; then A20: (PTMin X) . t1 = (PTMin X) . t2 by Th42; A21: t1 in the Sorts of (ParsedTermsOSA X) . (LeastSort t1) by Def12; LeastSort t1 <= s by A7, Def12; then A22: [t1,((PTMin X) . t1)] in R . s by A2, A21, A17, A16, A18, OSALG_4:def_1; then (PTMin X) . t1 in the Sorts of (ParsedTermsOSA X) . s by ZFMISC_1:87; hence [a,b] in R . s by A7, A9, A20, A22, A4, A15, RELAT_2:def_8; ::_thesis: verum end; hence (PTCongruence X) . i c= R . i by RELAT_1:def_3; ::_thesis: verum end; theorem :: OSAFREE:46 for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S holds LCongruence X = PTCongruence X proof let S be monotone regular locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S holds LCongruence X = PTCongruence X let X be V16() ManySortedSet of S; ::_thesis: LCongruence X = PTCongruence X A1: PTCongruence X c= LCongruence X by Th45; LCongruence X c= PTCongruence X by Def17; hence LCongruence X = PTCongruence X by A1, PBOOLE:146; ::_thesis: verum end; definition let S be monotone regular locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; mode MinTerm of S,X -> Element of TS (DTConOSA X) means :Def32: :: OSAFREE:def 32 (PTMin X) . it = it; existence ex b1 being Element of TS (DTConOSA X) st (PTMin X) . b1 = b1 proof set t = the Element of TS (DTConOSA X); take (PTMin X) . the Element of TS (DTConOSA X) ; ::_thesis: (PTMin X) . ((PTMin X) . the Element of TS (DTConOSA X)) = (PTMin X) . the Element of TS (DTConOSA X) thus (PTMin X) . ((PTMin X) . the Element of TS (DTConOSA X)) = (PTMin X) . the Element of TS (DTConOSA X) by Th43; ::_thesis: verum end; end; :: deftheorem Def32 defines MinTerm OSAFREE:def_32_:_ for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for b3 being Element of TS (DTConOSA X) holds ( b3 is MinTerm of S,X iff (PTMin X) . b3 = b3 ); definition let S be monotone regular locally_directed OrderSortedSign; let X be V16() ManySortedSet of S; func MinTerms X -> Subset of (TS (DTConOSA X)) equals :: OSAFREE:def 33 rng (PTMin X); correctness coherence rng (PTMin X) is Subset of (TS (DTConOSA X)); by RELAT_1:def_19; end; :: deftheorem defines MinTerms OSAFREE:def_33_:_ for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S holds MinTerms X = rng (PTMin X); theorem :: OSAFREE:47 for S being monotone regular locally_directed OrderSortedSign for X being V16() ManySortedSet of S for x being set holds ( x is MinTerm of S,X iff x in MinTerms X ) proof let S be monotone regular locally_directed OrderSortedSign; ::_thesis: for X being V16() ManySortedSet of S for x being set holds ( x is MinTerm of S,X iff x in MinTerms X ) let X be V16() ManySortedSet of S; ::_thesis: for x being set holds ( x is MinTerm of S,X iff x in MinTerms X ) let x be set ; ::_thesis: ( x is MinTerm of S,X iff x in MinTerms X ) hereby ::_thesis: ( x in MinTerms X implies x is MinTerm of S,X ) assume x is MinTerm of S,X ; ::_thesis: x in MinTerms X then reconsider t = x as MinTerm of S,X ; (PTMin X) . t = t by Def32; hence x in MinTerms X by FUNCT_2:4; ::_thesis: verum end; assume x in MinTerms X ; ::_thesis: x is MinTerm of S,X then consider y being set such that A1: y in dom (PTMin X) and A2: x = (PTMin X) . y by FUNCT_1:def_3; reconsider t = y as Element of TS (DTConOSA X) by A1; (PTMin X) . t is Element of TS (DTConOSA X) ; then reconsider tx = x as Element of TS (DTConOSA X) by A2; (PTMin X) . tx = tx by A1, A2, Th43; hence x is MinTerm of S,X by Def32; ::_thesis: verum end;