:: ALGSTR_4 semantic presentation begin registration let X be set ; let f be Function of NAT,X; let n be Nat; clusterf | n -> T-Sequence-like ; correctness coherence f | n is T-Sequence-like ; proof percases ( X <> {} or X = {} ) ; supposeA1: X <> {} ; ::_thesis: f | n is T-Sequence-like n c= NAT ; then n c= dom f by A1, FUNCT_2:def_1; then dom (f | n) is ordinal by RELAT_1:62; hence f | n is T-Sequence-like by ORDINAL1:def_7; ::_thesis: verum end; suppose X = {} ; ::_thesis: f | n is T-Sequence-like then f = {} ; hence f | n is T-Sequence-like ; ::_thesis: verum end; end; end; end; definition let X, x be set ; func IFXFinSequence (x,X) -> XFinSequence of equals :Def1: :: ALGSTR_4:def 1 x if x is XFinSequence of otherwise <%> X; correctness coherence ( ( x is XFinSequence of implies x is XFinSequence of ) & ( x is not XFinSequence of implies <%> X is XFinSequence of ) ); consistency for b1 being XFinSequence of holds verum; ; end; :: deftheorem Def1 defines IFXFinSequence ALGSTR_4:def_1_:_ for X, x being set holds ( ( x is XFinSequence of implies IFXFinSequence (x,X) = x ) & ( x is not XFinSequence of implies IFXFinSequence (x,X) = <%> X ) ); definition let X be non empty set ; let f be Function of (X ^omega),X; let c be XFinSequence of ; :: original: . redefine funcf . c -> Element of X; correctness coherence f . c is Element of X; proof c in X ^omega by AFINSQ_1:def_7; hence f . c is Element of X by FUNCT_2:5; ::_thesis: verum end; end; theorem Th1: :: ALGSTR_4:1 for X, Y, Z being set st Y c= the_universe_of X & Z c= the_universe_of X holds [:Y,Z:] c= the_universe_of X proof let X, Y, Z be set ; ::_thesis: ( Y c= the_universe_of X & Z c= the_universe_of X implies [:Y,Z:] c= the_universe_of X ) assume Y c= the_universe_of X ; ::_thesis: ( not Z c= the_universe_of X or [:Y,Z:] c= the_universe_of X ) then A1: Y c= Tarski-Class (the_transitive-closure_of X) by YELLOW_6:def_1; assume Z c= the_universe_of X ; ::_thesis: [:Y,Z:] c= the_universe_of X then Z c= Tarski-Class (the_transitive-closure_of X) by YELLOW_6:def_1; then [:Y,Z:] c= Tarski-Class (the_transitive-closure_of X) by A1, CLASSES1:28; hence [:Y,Z:] c= the_universe_of X by YELLOW_6:def_1; ::_thesis: verum end; scheme :: ALGSTR_4:sch 1 FuncRecursiveUniq{ F1( set ) -> set , F2() -> Function, F3() -> Function } : F2() = F3() provided A1: ( dom F2() = NAT & ( for n being Nat holds F2() . n = F1((F2() | n)) ) ) and A2: ( dom F3() = NAT & ( for n being Nat holds F3() . n = F1((F3() | n)) ) ) proof reconsider L1 = F2() as T-Sequence by A1, ORDINAL1:def_7; reconsider L2 = F3() as T-Sequence by A2, ORDINAL1:def_7; A3: ( dom L1 = NAT & ( for B being Ordinal for T1 being T-Sequence st B in NAT & T1 = L1 | B holds L1 . B = F1(T1) ) ) by A1; A4: ( dom L2 = NAT & ( for B being Ordinal for T2 being T-Sequence st B in NAT & T2 = L2 | B holds L2 . B = F1(T2) ) ) by A2; L1 = L2 from ORDINAL1:sch_3(A3, A4); hence F2() = F3() ; ::_thesis: verum end; scheme :: ALGSTR_4:sch 2 FuncRecursiveExist{ F1( set ) -> set } : ex f being Function st ( dom f = NAT & ( for n being Nat holds f . n = F1((f | n)) ) ) proof consider L being T-Sequence such that A1: dom L = NAT and A2: for B being Ordinal for L1 being T-Sequence st B in NAT & L1 = L | B holds L . B = F1(L1) from ORDINAL1:sch_4(); take L ; ::_thesis: ( dom L = NAT & ( for n being Nat holds L . n = F1((L | n)) ) ) thus dom L = NAT by A1; ::_thesis: for n being Nat holds L . n = F1((L | n)) let n be Nat; ::_thesis: L . n = F1((L | n)) reconsider B = n as Ordinal ; B in NAT by ORDINAL1:def_12; then L . B = F1((L | B)) by A2; hence L . n = F1((L | n)) ; ::_thesis: verum end; scheme :: ALGSTR_4:sch 3 FuncRecursiveUniqu2{ F1() -> non empty set , F2( XFinSequence of ) -> Element of F1(), F3() -> Function of NAT,F1(), F4() -> Function of NAT,F1() } : F3() = F4() provided A1: for n being Nat holds F3() . n = F2((F3() | n)) and A2: for n being Nat holds F4() . n = F2((F4() | n)) proof deffunc H1( set ) -> Element of F1() = F2((IFXFinSequence (\$1,F1()))); reconsider f1 = F3() as Function ; reconsider f2 = F4() as Function ; A3: ( dom f1 = NAT & ( for n being Nat holds f1 . n = H1(f1 | n) ) ) proof thus dom f1 = NAT by FUNCT_2:def_1; ::_thesis: for n being Nat holds f1 . n = H1(f1 | n) let n be Nat; ::_thesis: f1 . n = H1(f1 | n) thus f1 . n = F2((F3() | n)) by A1 .= H1(f1 | n) by Def1 ; ::_thesis: verum end; A4: ( dom f2 = NAT & ( for n being Nat holds f2 . n = H1(f2 | n) ) ) proof thus dom f2 = NAT by FUNCT_2:def_1; ::_thesis: for n being Nat holds f2 . n = H1(f2 | n) let n be Nat; ::_thesis: f2 . n = H1(f2 | n) thus f2 . n = F2((F4() | n)) by A2 .= H1(f2 | n) by Def1 ; ::_thesis: verum end; f1 = f2 from ALGSTR_4:sch_1(A3, A4); hence F3() = F4() ; ::_thesis: verum end; scheme :: ALGSTR_4:sch 4 FuncRecursiveExist2{ F1() -> non empty set , F2( XFinSequence of ) -> Element of F1() } : ex f being Function of NAT,F1() st for n being Nat holds f . n = F2((f | n)) proof deffunc H1( set ) -> Element of F1() = F2((IFXFinSequence (\$1,F1()))); consider f being Function such that A1: dom f = NAT and A2: for n being Nat holds f . n = H1(f | n) from ALGSTR_4:sch_2(); for y being set st y in rng f holds y in F1() proof let y be set ; ::_thesis: ( y in rng f implies y in F1() ) assume y in rng f ; ::_thesis: y in F1() then consider x being set such that A3: ( x in dom f & y = f . x ) by FUNCT_1:def_3; reconsider x = x as Nat by A1, A3; y = F2((IFXFinSequence ((f | x),F1()))) by A3, A2; hence y in F1() ; ::_thesis: verum end; then rng f c= F1() by TARSKI:def_3; then reconsider f9 = f as Function of NAT,F1() by A1, FUNCT_2:2; take f9 ; ::_thesis: for n being Nat holds f9 . n = F2((f9 | n)) let n be Nat; ::_thesis: f9 . n = F2((f9 | n)) f . n = F2((IFXFinSequence ((f9 | n),F1()))) by A2 .= F2((f9 | n)) by Def1 ; hence f9 . n = F2((f9 | n)) ; ::_thesis: verum end; definition let f, g be Function; predf extends g means :Def2: :: ALGSTR_4:def 2 ( dom g c= dom f & f tolerates g ); end; :: deftheorem Def2 defines extends ALGSTR_4:def_2_:_ for f, g being Function holds ( f extends g iff ( dom g c= dom f & f tolerates g ) ); registration cluster empty for multMagma ; existence ex b1 being multMagma st b1 is empty proof take multMagma(# {}, the BinOp of {} #) ; ::_thesis: multMagma(# {}, the BinOp of {} #) is empty thus multMagma(# {}, the BinOp of {} #) is empty ; ::_thesis: verum end; end; begin definition let M be multMagma ; let R be Equivalence_Relation of M; attrR is compatible means :Def3: :: ALGSTR_4:def 3 for v, v9, w, w9 being Element of M st v in Class (R,v9) & w in Class (R,w9) holds v * w in Class (R,(v9 * w9)); end; :: deftheorem Def3 defines compatible ALGSTR_4:def_3_:_ for M being multMagma for R being Equivalence_Relation of M holds ( R is compatible iff for v, v9, w, w9 being Element of M st v in Class (R,v9) & w in Class (R,w9) holds v * w in Class (R,(v9 * w9)) ); registration let M be multMagma ; cluster nabla the carrier of M -> compatible ; correctness coherence nabla the carrier of M is compatible ; proof set R = nabla the carrier of M; let v, v9, w, w9 be Element of M; :: according to ALGSTR_4:def_3 ::_thesis: ( v in Class ((nabla the carrier of M),v9) & w in Class ((nabla the carrier of M),w9) implies v * w in Class ((nabla the carrier of M),(v9 * w9)) ) assume ( v in Class ((nabla the carrier of M),v9) & w in Class ((nabla the carrier of M),w9) ) ; ::_thesis: v * w in Class ((nabla the carrier of M),(v9 * w9)) then A1: not M is empty ; then Class ((nabla the carrier of M),(v9 * w9)) = the carrier of M by EQREL_1:26; hence v * w in Class ((nabla the carrier of M),(v9 * w9)) by A1, SUBSET_1:def_1; ::_thesis: verum end; end; registration let M be multMagma ; cluster Relation-like the carrier of M -defined the carrier of M -valued total quasi_total V260() V265() compatible for Element of bool [: the carrier of M, the carrier of M:]; correctness existence ex b1 being Equivalence_Relation of M st b1 is compatible ; proof take nabla the carrier of M ; ::_thesis: nabla the carrier of M is compatible thus nabla the carrier of M is compatible ; ::_thesis: verum end; end; theorem Th2: :: ALGSTR_4:2 for M being multMagma for R being Equivalence_Relation of M holds ( R is compatible iff for v, v9, w, w9 being Element of M st Class (R,v) = Class (R,v9) & Class (R,w) = Class (R,w9) holds Class (R,(v * w)) = Class (R,(v9 * w9)) ) proof let M be multMagma ; ::_thesis: for R being Equivalence_Relation of M holds ( R is compatible iff for v, v9, w, w9 being Element of M st Class (R,v) = Class (R,v9) & Class (R,w) = Class (R,w9) holds Class (R,(v * w)) = Class (R,(v9 * w9)) ) let R be Equivalence_Relation of M; ::_thesis: ( R is compatible iff for v, v9, w, w9 being Element of M st Class (R,v) = Class (R,v9) & Class (R,w) = Class (R,w9) holds Class (R,(v * w)) = Class (R,(v9 * w9)) ) hereby ::_thesis: ( ( for v, v9, w, w9 being Element of M st Class (R,v) = Class (R,v9) & Class (R,w) = Class (R,w9) holds Class (R,(v * w)) = Class (R,(v9 * w9)) ) implies R is compatible ) assume A1: R is compatible ; ::_thesis: for v, v9, w, w9 being Element of M st Class (R,v) = Class (R,v9) & Class (R,w) = Class (R,w9) holds Class (R,(b5 * b7)) = Class (R,(b6 * b8)) let v, v9, w, w9 be Element of M; ::_thesis: ( Class (R,v) = Class (R,v9) & Class (R,w) = Class (R,w9) implies Class (R,(b1 * b3)) = Class (R,(b2 * b4)) ) assume A2: ( Class (R,v) = Class (R,v9) & Class (R,w) = Class (R,w9) ) ; ::_thesis: Class (R,(b1 * b3)) = Class (R,(b2 * b4)) percases ( M is empty or not M is empty ) ; supposeA3: M is empty ; ::_thesis: Class (R,(b1 * b3)) = Class (R,(b2 * b4)) hence Class (R,(v * w)) = {} .= Class (R,(v9 * w9)) by A3 ; ::_thesis: verum end; suppose not M is empty ; ::_thesis: Class (R,(b1 * b3)) = Class (R,(b2 * b4)) then ( v in Class (R,v9) & w in Class (R,w9) ) by A2, EQREL_1:23; then v * w in Class (R,(v9 * w9)) by A1, Def3; hence Class (R,(v * w)) = Class (R,(v9 * w9)) by EQREL_1:23; ::_thesis: verum end; end; end; assume A4: for v, v9, w, w9 being Element of M st Class (R,v) = Class (R,v9) & Class (R,w) = Class (R,w9) holds Class (R,(v * w)) = Class (R,(v9 * w9)) ; ::_thesis: R is compatible for v, v9, w, w9 being Element of M st v in Class (R,v9) & w in Class (R,w9) holds v * w in Class (R,(v9 * w9)) proof let v, v9, w, w9 be Element of M; ::_thesis: ( v in Class (R,v9) & w in Class (R,w9) implies v * w in Class (R,(v9 * w9)) ) assume A5: ( v in Class (R,v9) & w in Class (R,w9) ) ; ::_thesis: v * w in Class (R,(v9 * w9)) percases ( M is empty or not M is empty ) ; suppose M is empty ; ::_thesis: v * w in Class (R,(v9 * w9)) hence v * w in Class (R,(v9 * w9)) by A5; ::_thesis: verum end; supposeA6: not M is empty ; ::_thesis: v * w in Class (R,(v9 * w9)) ( Class (R,v9) = Class (R,v) & Class (R,w9) = Class (R,w) ) by A5, EQREL_1:23; then Class (R,(v * w)) = Class (R,(v9 * w9)) by A4; hence v * w in Class (R,(v9 * w9)) by A6, EQREL_1:23; ::_thesis: verum end; end; end; hence R is compatible by Def3; ::_thesis: verum end; definition let M be multMagma ; let R be compatible Equivalence_Relation of M; func ClassOp R -> BinOp of (Class R) means :Def4: :: ALGSTR_4:def 4 for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds it . (x,y) = Class (R,(v * w)) if not M is empty otherwise it = {} ; correctness consistency for b1 being BinOp of (Class R) holds verum; existence ( ( for b1 being BinOp of (Class R) holds verum ) & ( not M is empty implies ex b1 being BinOp of (Class R) st for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b1 . (x,y) = Class (R,(v * w)) ) & ( M is empty implies ex b1 being BinOp of (Class R) st b1 = {} ) ); uniqueness for b1, b2 being BinOp of (Class R) holds ( ( not M is empty & ( for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b1 . (x,y) = Class (R,(v * w)) ) & ( for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b2 . (x,y) = Class (R,(v * w)) ) implies b1 = b2 ) & ( M is empty & b1 = {} & b2 = {} implies b1 = b2 ) ); proof A1: ( not M is empty implies ex b being BinOp of (Class R) st for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b . (x,y) = Class (R,(v * w)) ) proof assume A2: not M is empty ; ::_thesis: ex b being BinOp of (Class R) st for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b . (x,y) = Class (R,(v * w)) then reconsider X = Class R as non empty set ; defpred S1[ set , set , set ] means for x, y being Element of Class R for v, w being Element of M st x = \$1 & y = \$2 & x = Class (R,v) & y = Class (R,w) holds \$3 = Class (R,(v * w)); A3: for x, y being Element of X ex z being Element of X st S1[x,y,z] proof let x, y be Element of X; ::_thesis: ex z being Element of X st S1[x,y,z] x in Class R ; then consider v being set such that A4: ( v in the carrier of M & x = Class (R,v) ) by EQREL_1:def_3; reconsider v = v as Element of M by A4; y in Class R ; then consider w being set such that A5: ( w in the carrier of M & y = Class (R,w) ) by EQREL_1:def_3; reconsider w = w as Element of M by A5; reconsider z = Class (R,(v * w)) as Element of X by A2, EQREL_1:def_3; take z ; ::_thesis: S1[x,y,z] thus S1[x,y,z] by A4, A5, Th2; ::_thesis: verum end; consider b being Function of [:X,X:],X such that A6: for x, y being Element of X holds S1[x,y,b . (x,y)] from BINOP_1:sch_3(A3); reconsider b = b as BinOp of (Class R) ; take b ; ::_thesis: for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b . (x,y) = Class (R,(v * w)) thus for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b . (x,y) = Class (R,(v * w)) by A6; ::_thesis: verum end; A7: ( M is empty implies ex b being BinOp of (Class R) st b = {} ) proof assume M is empty ; ::_thesis: ex b being BinOp of (Class R) st b = {} then the carrier of M is empty ; then A8: Class R is empty by EQREL_1:31; set b = the BinOp of (Class R); take the BinOp of (Class R) ; ::_thesis: the BinOp of (Class R) = {} thus the BinOp of (Class R) = {} by A8; ::_thesis: verum end; for b1, b2 being BinOp of (Class R) st not M is empty & ( for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b1 . (x,y) = Class (R,(v * w)) ) & ( for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b2 . (x,y) = Class (R,(v * w)) ) holds b1 = b2 proof let b1, b2 be BinOp of (Class R); ::_thesis: ( not M is empty & ( for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b1 . (x,y) = Class (R,(v * w)) ) & ( for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b2 . (x,y) = Class (R,(v * w)) ) implies b1 = b2 ) assume not M is empty ; ::_thesis: ( ex x, y being Element of Class R ex v, w being Element of M st ( x = Class (R,v) & y = Class (R,w) & not b1 . (x,y) = Class (R,(v * w)) ) or ex x, y being Element of Class R ex v, w being Element of M st ( x = Class (R,v) & y = Class (R,w) & not b2 . (x,y) = Class (R,(v * w)) ) or b1 = b2 ) assume A9: for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b1 . (x,y) = Class (R,(v * w)) ; ::_thesis: ( ex x, y being Element of Class R ex v, w being Element of M st ( x = Class (R,v) & y = Class (R,w) & not b2 . (x,y) = Class (R,(v * w)) ) or b1 = b2 ) assume A10: for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b2 . (x,y) = Class (R,(v * w)) ; ::_thesis: b1 = b2 for x, y being set st x in Class R & y in Class R holds b1 . (x,y) = b2 . (x,y) proof let x, y be set ; ::_thesis: ( x in Class R & y in Class R implies b1 . (x,y) = b2 . (x,y) ) assume A11: x in Class R ; ::_thesis: ( not y in Class R or b1 . (x,y) = b2 . (x,y) ) then reconsider x9 = x as Element of Class R ; assume A12: y in Class R ; ::_thesis: b1 . (x,y) = b2 . (x,y) then reconsider y9 = y as Element of Class R ; consider v being set such that A13: ( v in the carrier of M & x9 = Class (R,v) ) by A11, EQREL_1:def_3; consider w being set such that A14: ( w in the carrier of M & y9 = Class (R,w) ) by A12, EQREL_1:def_3; reconsider v = v, w = w as Element of M by A13, A14; b1 . (x9,y9) = Class (R,(v * w)) by A13, A14, A9; hence b1 . (x,y) = b2 . (x,y) by A13, A14, A10; ::_thesis: verum end; hence b1 = b2 by BINOP_1:1; ::_thesis: verum end; hence ( ( for b1 being BinOp of (Class R) holds verum ) & ( not M is empty implies ex b1 being BinOp of (Class R) st for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b1 . (x,y) = Class (R,(v * w)) ) & ( M is empty implies ex b1 being BinOp of (Class R) st b1 = {} ) & ( for b1, b2 being BinOp of (Class R) holds ( ( not M is empty & ( for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b1 . (x,y) = Class (R,(v * w)) ) & ( for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b2 . (x,y) = Class (R,(v * w)) ) implies b1 = b2 ) & ( M is empty & b1 = {} & b2 = {} implies b1 = b2 ) ) ) ) by A1, A7; ::_thesis: verum end; end; :: deftheorem Def4 defines ClassOp ALGSTR_4:def_4_:_ for M being multMagma for R being compatible Equivalence_Relation of M for b3 being BinOp of (Class R) holds ( ( not M is empty implies ( b3 = ClassOp R iff for x, y being Element of Class R for v, w being Element of M st x = Class (R,v) & y = Class (R,w) holds b3 . (x,y) = Class (R,(v * w)) ) ) & ( M is empty implies ( b3 = ClassOp R iff b3 = {} ) ) ); definition let M be multMagma ; let R be compatible Equivalence_Relation of M; funcM ./. R -> multMagma equals :: ALGSTR_4:def 5 multMagma(# (Class R),(ClassOp R) #); correctness coherence multMagma(# (Class R),(ClassOp R) #) is multMagma ; ; end; :: deftheorem defines ./. ALGSTR_4:def_5_:_ for M being multMagma for R being compatible Equivalence_Relation of M holds M ./. R = multMagma(# (Class R),(ClassOp R) #); registration let M be multMagma ; let R be compatible Equivalence_Relation of M; clusterM ./. R -> strict ; correctness coherence M ./. R is strict ; ; end; registration let M be non empty multMagma ; let R be compatible Equivalence_Relation of M; clusterM ./. R -> non empty ; correctness coherence not M ./. R is empty ; ; end; definition let M be non empty multMagma ; let R be compatible Equivalence_Relation of M; func nat_hom R -> Function of M,(M ./. R) means :Def6: :: ALGSTR_4:def 6 for v being Element of M holds it . v = Class (R,v); existence ex b1 being Function of M,(M ./. R) st for v being Element of M holds b1 . v = Class (R,v) proof defpred S1[ set , set ] means ex v being Element of M st ( \$1 = v & \$2 = Class (R,v) ); A1: for x being set st x in the carrier of M holds ex y being set st S1[x,y] proof let x be set ; ::_thesis: ( x in the carrier of M implies ex y being set st S1[x,y] ) assume x in the carrier of M ; ::_thesis: ex y being set st S1[x,y] then reconsider v = x as Element of M ; reconsider y = Class (R,v) as set ; take y ; ::_thesis: S1[x,y] take v ; ::_thesis: ( x = v & y = Class (R,v) ) thus ( x = v & y = Class (R,v) ) ; ::_thesis: verum end; consider f being Function such that A2: dom f = the carrier of M and A3: for x being set st x in the carrier of M holds S1[x,f . x] from CLASSES1:sch_1(A1); rng f c= the carrier of (M ./. R) proof let x be set ; :: according to TARSKI:def_3 ::_thesis: ( not x in rng f or x in the carrier of (M ./. R) ) assume x in rng f ; ::_thesis: x in the carrier of (M ./. R) then consider y being set such that A4: y in dom f and A5: f . y = x by FUNCT_1:def_3; consider v being Element of M such that A6: ( y = v & f . y = Class (R,v) ) by A2, A3, A4; thus x in the carrier of (M ./. R) by A5, A6, EQREL_1:def_3; ::_thesis: verum end; then reconsider f = f as Function of M,(M ./. R) by A2, FUNCT_2:def_1, RELSET_1:4; take f ; ::_thesis: for v being Element of M holds f . v = Class (R,v) let v be Element of M; ::_thesis: f . v = Class (R,v) ex w being Element of M st ( v = w & f . v = Class (R,w) ) by A3; hence f . v = Class (R,v) ; ::_thesis: verum end; uniqueness for b1, b2 being Function of M,(M ./. R) st ( for v being Element of M holds b1 . v = Class (R,v) ) & ( for v being Element of M holds b2 . v = Class (R,v) ) holds b1 = b2 proof let f1, f2 be Function of M,(M ./. R); ::_thesis: ( ( for v being Element of M holds f1 . v = Class (R,v) ) & ( for v being Element of M holds f2 . v = Class (R,v) ) implies f1 = f2 ) assume that A7: for v being Element of M holds f1 . v = Class (R,v) and A8: for v being Element of M holds f2 . v = Class (R,v) ; ::_thesis: f1 = f2 now__::_thesis:_for_v_being_Element_of_M_holds_f1_._v_=_f2_._v let v be Element of M; ::_thesis: f1 . v = f2 . v ( f1 . v = Class (R,v) & f2 . v = Class (R,v) ) by A7, A8; hence f1 . v = f2 . v ; ::_thesis: verum end; hence f1 = f2 by FUNCT_2:63; ::_thesis: verum end; end; :: deftheorem Def6 defines nat_hom ALGSTR_4:def_6_:_ for M being non empty multMagma for R being compatible Equivalence_Relation of M for b3 being Function of M,(M ./. R) holds ( b3 = nat_hom R iff for v being Element of M holds b3 . v = Class (R,v) ); registration let M be non empty multMagma ; let R be compatible Equivalence_Relation of M; cluster nat_hom R -> multiplicative ; correctness coherence nat_hom R is multiplicative ; proof for v, w being Element of M holds (nat_hom R) . (v * w) = ((nat_hom R) . v) * ((nat_hom R) . w) proof let v, w be Element of M; ::_thesis: (nat_hom R) . (v * w) = ((nat_hom R) . v) * ((nat_hom R) . w) ( (nat_hom R) . v = Class (R,v) & (nat_hom R) . w = Class (R,w) ) by Def6; then (ClassOp R) . (((nat_hom R) . v),((nat_hom R) . w)) = Class (R,(v * w)) by Def4; hence (nat_hom R) . (v * w) = ((nat_hom R) . v) * ((nat_hom R) . w) by Def6; ::_thesis: verum end; hence nat_hom R is multiplicative by GROUP_6:def_6; ::_thesis: verum end; end; registration let M be non empty multMagma ; let R be compatible Equivalence_Relation of M; cluster nat_hom R -> onto ; correctness coherence nat_hom R is onto ; proof for y being set st y in the carrier of (M ./. R) holds y in rng (nat_hom R) proof let y be set ; ::_thesis: ( y in the carrier of (M ./. R) implies y in rng (nat_hom R) ) assume y in the carrier of (M ./. R) ; ::_thesis: y in rng (nat_hom R) then consider x being set such that A1: ( x in the carrier of M & y = Class (R,x) ) by EQREL_1:def_3; reconsider x = x as Element of M by A1; the carrier of M = dom (nat_hom R) by FUNCT_2:def_1; then ( x in dom (nat_hom R) & (nat_hom R) . x = Class (R,x) ) by Def6; hence y in rng (nat_hom R) by A1, FUNCT_1:def_3; ::_thesis: verum end; then the carrier of (M ./. R) c= rng (nat_hom R) by TARSKI:def_3; then rng (nat_hom R) = the carrier of (M ./. R) by XBOOLE_0:def_10; hence nat_hom R is onto by FUNCT_2:def_3; ::_thesis: verum end; end; definition let M be multMagma ; mode Relators of M is [: the carrier of M, the carrier of M:] -valued Function; end; definition let M be multMagma ; let r be Relators of M; func equ_rel r -> Equivalence_Relation of M equals :: ALGSTR_4:def 7 meet { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } ; correctness coherence meet { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } is Equivalence_Relation of M; proof set X = { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } ; percases ( M is empty or not M is empty ) ; suppose M is empty ; ::_thesis: meet { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } is Equivalence_Relation of M then A1: the carrier of M = {} ; for x being set st x in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } holds x in {{}} proof let x be set ; ::_thesis: ( x in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } implies x in {{}} ) assume x in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } ; ::_thesis: x in {{}} then consider R being compatible Equivalence_Relation of M such that A2: ( x = R & ( for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) ) ) ; x is Subset of {} by A2, A1, ZFMISC_1:90; hence x in {{}} by TARSKI:def_1; ::_thesis: verum end; then { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } c= {{}} by TARSKI:def_3; then ( { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } = {} or { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } = {{}} ) by ZFMISC_1:33; hence meet { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } is Equivalence_Relation of M by A1, OSALG_4:9, SETFAM_1:10, SETFAM_1:def_1; ::_thesis: verum end; supposeA3: not M is empty ; ::_thesis: meet { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } is Equivalence_Relation of M for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class ((nabla the carrier of M),w) proof let i be set ; ::_thesis: for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class ((nabla the carrier of M),w) let v, w be Element of M; ::_thesis: ( i in dom r & r . i = [v,w] implies v in Class ((nabla the carrier of M),w) ) assume ( i in dom r & r . i = [v,w] ) ; ::_thesis: v in Class ((nabla the carrier of M),w) Class ((nabla the carrier of M),w) = the carrier of M by A3, EQREL_1:26; hence v in Class ((nabla the carrier of M),w) by A3, SUBSET_1:def_1; ::_thesis: verum end; then A4: nabla the carrier of M in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } ; for x being set st x in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } holds x in bool [: the carrier of M, the carrier of M:] proof let x be set ; ::_thesis: ( x in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } implies x in bool [: the carrier of M, the carrier of M:] ) assume x in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } ; ::_thesis: x in bool [: the carrier of M, the carrier of M:] then consider R being compatible Equivalence_Relation of M such that A5: ( x = R & ( for i being set for x, y being Element of M st i in dom r & r . i = [x,y] holds x in Class (R,y) ) ) ; thus x in bool [: the carrier of M, the carrier of M:] by A5; ::_thesis: verum end; then reconsider X = { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } as Subset-Family of [: the carrier of M, the carrier of M:] by TARSKI:def_3; for Y being set st Y in X holds Y is Equivalence_Relation of M proof let Y be set ; ::_thesis: ( Y in X implies Y is Equivalence_Relation of M ) assume Y in X ; ::_thesis: Y is Equivalence_Relation of M then consider R being compatible Equivalence_Relation of M such that A6: ( Y = R & ( for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) ) ) ; thus Y is Equivalence_Relation of M by A6; ::_thesis: verum end; hence meet { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } is Equivalence_Relation of M by A4, EQREL_1:11; ::_thesis: verum end; end; end; end; :: deftheorem defines equ_rel ALGSTR_4:def_7_:_ for M being multMagma for r being Relators of M holds equ_rel r = meet { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } ; theorem Th3: :: ALGSTR_4:3 for M being multMagma for r being Relators of M for R being compatible Equivalence_Relation of M st ( for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) ) holds equ_rel r c= R proof let M be multMagma ; ::_thesis: for r being Relators of M for R being compatible Equivalence_Relation of M st ( for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) ) holds equ_rel r c= R let r be Relators of M; ::_thesis: for R being compatible Equivalence_Relation of M st ( for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) ) holds equ_rel r c= R let R be compatible Equivalence_Relation of M; ::_thesis: ( ( for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) ) implies equ_rel r c= R ) assume A1: for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) ; ::_thesis: equ_rel r c= R for X being set st X in equ_rel r holds X in R proof let X be set ; ::_thesis: ( X in equ_rel r implies X in R ) R in { R9 where R9 is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R9,w) } by A1; hence ( X in equ_rel r implies X in R ) by SETFAM_1:def_1; ::_thesis: verum end; hence equ_rel r c= R by TARSKI:def_3; ::_thesis: verum end; registration let M be multMagma ; let r be Relators of M; cluster equ_rel r -> compatible ; coherence equ_rel r is compatible proof set X = { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } ; for v, v9, w, w9 being Element of M st v in Class ((equ_rel r),v9) & w in Class ((equ_rel r),w9) holds v * w in Class ((equ_rel r),(v9 * w9)) proof let v, v9, w, w9 be Element of M; ::_thesis: ( v in Class ((equ_rel r),v9) & w in Class ((equ_rel r),w9) implies v * w in Class ((equ_rel r),(v9 * w9)) ) assume v in Class ((equ_rel r),v9) ; ::_thesis: ( not w in Class ((equ_rel r),w9) or v * w in Class ((equ_rel r),(v9 * w9)) ) then A1: [v9,v] in equ_rel r by EQREL_1:18; assume w in Class ((equ_rel r),w9) ; ::_thesis: v * w in Class ((equ_rel r),(v9 * w9)) then A2: [w9,w] in equ_rel r by EQREL_1:18; percases ( { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } = {} or { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } <> {} ) ; suppose { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } = {} ; ::_thesis: v * w in Class ((equ_rel r),(v9 * w9)) hence v * w in Class ((equ_rel r),(v9 * w9)) by A1, SETFAM_1:def_1; ::_thesis: verum end; supposeA3: { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } <> {} ; ::_thesis: v * w in Class ((equ_rel r),(v9 * w9)) for Y being set st Y in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } holds [(v9 * w9),(v * w)] in Y proof let Y be set ; ::_thesis: ( Y in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } implies [(v9 * w9),(v * w)] in Y ) assume A4: Y in { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } ; ::_thesis: [(v9 * w9),(v * w)] in Y then consider R being compatible Equivalence_Relation of M such that A5: ( Y = R & ( for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) ) ) ; [v9,v] in Y by A1, A4, SETFAM_1:def_1; then A6: v in Class (R,v9) by A5, EQREL_1:18; [w9,w] in Y by A2, A4, SETFAM_1:def_1; then w in Class (R,w9) by A5, EQREL_1:18; then v * w in Class (R,(v9 * w9)) by A6, Def3; hence [(v9 * w9),(v * w)] in Y by A5, EQREL_1:18; ::_thesis: verum end; then [(v9 * w9),(v * w)] in meet { R where R is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) } by A3, SETFAM_1:def_1; hence v * w in Class ((equ_rel r),(v9 * w9)) by EQREL_1:18; ::_thesis: verum end; end; end; hence equ_rel r is compatible by Def3; ::_thesis: verum end; end; definition let X, Y be set ; let f be Function of X,Y; func equ_kernel f -> Equivalence_Relation of X means :Def8: :: ALGSTR_4:def 8 for x, y being set holds ( [x,y] in it iff ( x in X & y in X & f . x = f . y ) ); existence ex b1 being Equivalence_Relation of X st for x, y being set holds ( [x,y] in b1 iff ( x in X & y in X & f . x = f . y ) ) proof defpred S1[ set , set ] means f . \$1 = f . \$2; A1: for x being set st x in X holds S1[x,x] ; A2: for x, y being set st S1[x,y] holds S1[y,x] ; A3: for x, y, z being set st S1[x,y] & S1[y,z] holds S1[x,z] ; ex EqR being Equivalence_Relation of X st for x, y being set holds ( [x,y] in EqR iff ( x in X & y in X & S1[x,y] ) ) from EQREL_1:sch_1(A1, A2, A3); hence ex b1 being Equivalence_Relation of X st for x, y being set holds ( [x,y] in b1 iff ( x in X & y in X & f . x = f . y ) ) ; ::_thesis: verum end; uniqueness for b1, b2 being Equivalence_Relation of X st ( for x, y being set holds ( [x,y] in b1 iff ( x in X & y in X & f . x = f . y ) ) ) & ( for x, y being set holds ( [x,y] in b2 iff ( x in X & y in X & f . x = f . y ) ) ) holds b1 = b2 proof let R1, R2 be Equivalence_Relation of X; ::_thesis: ( ( for x, y being set holds ( [x,y] in R1 iff ( x in X & y in X & f . x = f . y ) ) ) & ( for x, y being set holds ( [x,y] in R2 iff ( x in X & y in X & f . x = f . y ) ) ) implies R1 = R2 ) defpred S1[ set , set ] means ( \$1 in X & \$2 in X & f . \$1 = f . \$2 ); assume for x, y being set holds ( [x,y] in R1 iff ( x in X & y in X & f . x = f . y ) ) ; ::_thesis: ( ex x, y being set st ( ( [x,y] in R2 implies ( x in X & y in X & f . x = f . y ) ) implies ( x in X & y in X & f . x = f . y & not [x,y] in R2 ) ) or R1 = R2 ) then A4: for x, y being set holds ( [x,y] in R1 iff S1[x,y] ) ; assume for x, y being set holds ( [x,y] in R2 iff ( x in X & y in X & f . x = f . y ) ) ; ::_thesis: R1 = R2 then A5: for x, y being set holds ( [x,y] in R2 iff S1[x,y] ) ; thus R1 = R2 from RELAT_1:sch_2(A4, A5); ::_thesis: verum end; end; :: deftheorem Def8 defines equ_kernel ALGSTR_4:def_8_:_ for X, Y being set for f being Function of X,Y for b4 being Equivalence_Relation of X holds ( b4 = equ_kernel f iff for x, y being set holds ( [x,y] in b4 iff ( x in X & y in X & f . x = f . y ) ) ); theorem Th4: :: ALGSTR_4:4 for M, N being non empty multMagma for f being Function of M,N st f is multiplicative holds equ_kernel f is compatible proof let M, N be non empty multMagma ; ::_thesis: for f being Function of M,N st f is multiplicative holds equ_kernel f is compatible let f be Function of M,N; ::_thesis: ( f is multiplicative implies equ_kernel f is compatible ) assume A1: f is multiplicative ; ::_thesis: equ_kernel f is compatible set R = equ_kernel f; for v, v9, w, w9 being Element of M st v in Class ((equ_kernel f),v9) & w in Class ((equ_kernel f),w9) holds v * w in Class ((equ_kernel f),(v9 * w9)) proof let v, v9, w, w9 be Element of M; ::_thesis: ( v in Class ((equ_kernel f),v9) & w in Class ((equ_kernel f),w9) implies v * w in Class ((equ_kernel f),(v9 * w9)) ) assume v in Class ((equ_kernel f),v9) ; ::_thesis: ( not w in Class ((equ_kernel f),w9) or v * w in Class ((equ_kernel f),(v9 * w9)) ) then A2: [v9,v] in equ_kernel f by EQREL_1:18; assume w in Class ((equ_kernel f),w9) ; ::_thesis: v * w in Class ((equ_kernel f),(v9 * w9)) then [w9,w] in equ_kernel f by EQREL_1:18; then A3: f . w9 = f . w by Def8; f . (v9 * w9) = (f . v9) * (f . w9) by A1, GROUP_6:def_6 .= (f . v) * (f . w) by A2, A3, Def8 .= f . (v * w) by A1, GROUP_6:def_6 ; then [(v9 * w9),(v * w)] in equ_kernel f by Def8; hence v * w in Class ((equ_kernel f),(v9 * w9)) by EQREL_1:18; ::_thesis: verum end; hence equ_kernel f is compatible by Def3; ::_thesis: verum end; theorem Th5: :: ALGSTR_4:5 for N, M being non empty multMagma for f being Function of M,N st f is multiplicative holds ex r being Relators of M st equ_kernel f = equ_rel r proof let N, M be non empty multMagma ; ::_thesis: for f being Function of M,N st f is multiplicative holds ex r being Relators of M st equ_kernel f = equ_rel r let f be Function of M,N; ::_thesis: ( f is multiplicative implies ex r being Relators of M st equ_kernel f = equ_rel r ) assume A1: f is multiplicative ; ::_thesis: ex r being Relators of M st equ_kernel f = equ_rel r set I = { [v,w] where v, w is Element of M : f . v = f . w } ; set r = id { [v,w] where v, w is Element of M : f . v = f . w } ; A2: dom (id { [v,w] where v, w is Element of M : f . v = f . w } ) = { [v,w] where v, w is Element of M : f . v = f . w } ; for y being set st y in rng (id { [v,w] where v, w is Element of M : f . v = f . w } ) holds y in [: the carrier of M, the carrier of M:] proof let y be set ; ::_thesis: ( y in rng (id { [v,w] where v, w is Element of M : f . v = f . w } ) implies y in [: the carrier of M, the carrier of M:] ) assume y in rng (id { [v,w] where v, w is Element of M : f . v = f . w } ) ; ::_thesis: y in [: the carrier of M, the carrier of M:] then consider x being set such that A3: ( x in dom (id { [v,w] where v, w is Element of M : f . v = f . w } ) & y = (id { [v,w] where v, w is Element of M : f . v = f . w } ) . x ) by FUNCT_1:def_3; y = x by A3, FUNCT_1:17; then y in { [v,w] where v, w is Element of M : f . v = f . w } by A3; then consider v9, w9 being Element of M such that A4: ( y = [v9,w9] & f . v9 = f . w9 ) ; thus y in [: the carrier of M, the carrier of M:] by A4, ZFMISC_1:def_2; ::_thesis: verum end; then rng (id { [v,w] where v, w is Element of M : f . v = f . w } ) c= [: the carrier of M, the carrier of M:] by TARSKI:def_3; then reconsider r = id { [v,w] where v, w is Element of M : f . v = f . w } as Relators of M by FUNCT_2:2; take r ; ::_thesis: equ_kernel f = equ_rel r reconsider R = equ_kernel f as compatible Equivalence_Relation of M by A1, Th4; A5: for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) proof let i be set ; ::_thesis: for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R,w) let v, w be Element of M; ::_thesis: ( i in dom r & r . i = [v,w] implies v in Class (R,w) ) assume A6: ( i in dom r & r . i = [v,w] ) ; ::_thesis: v in Class (R,w) then A7: r . i = i by A2, FUNCT_1:17; consider v9, w9 being Element of M such that A8: ( i = [v9,w9] & f . v9 = f . w9 ) by A2, A6; [v,w] in equ_kernel f by A8, Def8, A6, A7; hence v in Class (R,w) by EQREL_1:19; ::_thesis: verum end; then A9: equ_rel r c= R by Th3; for z being set st z in R holds z in equ_rel r proof let z be set ; ::_thesis: ( z in R implies z in equ_rel r ) assume A10: z in R ; ::_thesis: z in equ_rel r then consider x, y being set such that A11: ( x in the carrier of M & y in the carrier of M & z = [x,y] ) by ZFMISC_1:def_2; A12: f . x = f . y by A10, A11, Def8; reconsider x = x, y = y as Element of M by A11; set X9 = { R9 where R9 is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R9,w) } ; A13: R in { R9 where R9 is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R9,w) } by A5; for Y being set st Y in { R9 where R9 is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R9,w) } holds z in Y proof let Y be set ; ::_thesis: ( Y in { R9 where R9 is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R9,w) } implies z in Y ) assume Y in { R9 where R9 is compatible Equivalence_Relation of M : for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R9,w) } ; ::_thesis: z in Y then consider R9 being compatible Equivalence_Relation of M such that A14: ( R9 = Y & ( for i being set for v, w being Element of M st i in dom r & r . i = [v,w] holds v in Class (R9,w) ) ) ; set i = [x,y]; A15: [x,y] in { [v,w] where v, w is Element of M : f . v = f . w } by A12; then r . [x,y] = [x,y] by FUNCT_1:17; then x in Class (R9,y) by A2, A15, A14; hence z in Y by A11, A14, EQREL_1:19; ::_thesis: verum end; hence z in equ_rel r by A13, SETFAM_1:def_1; ::_thesis: verum end; then R c= equ_rel r by TARSKI:def_3; hence equ_kernel f = equ_rel r by A9, XBOOLE_0:def_10; ::_thesis: verum end; begin definition let M be multMagma ; mode multSubmagma of M -> multMagma means :Def9: :: ALGSTR_4:def 9 ( the carrier of it c= the carrier of M & the multF of it = the multF of M || the carrier of it ); existence ex b1 being multMagma st ( the carrier of b1 c= the carrier of M & the multF of b1 = the multF of M || the carrier of b1 ) proof set S = the empty multMagma ; reconsider A = the carrier of the empty multMagma as set ; reconsider X = [:A,A:] as set ; the multF of the empty multMagma = the multF of M | {} .= the multF of M | X by ZFMISC_1:90 .= the multF of M || the carrier of the empty multMagma by REALSET1:def_2 ; hence ex b1 being multMagma st ( the carrier of b1 c= the carrier of M & the multF of b1 = the multF of M || the carrier of b1 ) by XBOOLE_1:2; ::_thesis: verum end; end; :: deftheorem Def9 defines multSubmagma ALGSTR_4:def_9_:_ for M, b2 being multMagma holds ( b2 is multSubmagma of M iff ( the carrier of b2 c= the carrier of M & the multF of b2 = the multF of M || the carrier of b2 ) ); registration let M be multMagma ; cluster strict for multSubmagma of M; existence ex b1 being multSubmagma of M st b1 is strict proof set N = multMagma(# the carrier of M, the multF of M #); the multF of multMagma(# the carrier of M, the multF of M #) = the multF of multMagma(# the carrier of M, the multF of M #) | [: the carrier of multMagma(# the carrier of M, the multF of M #), the carrier of multMagma(# the carrier of M, the multF of M #):] .= the multF of M || the carrier of multMagma(# the carrier of M, the multF of M #) by REALSET1:def_2 ; then reconsider N = multMagma(# the carrier of M, the multF of M #) as multSubmagma of M by Def9; take N ; ::_thesis: N is strict thus N is strict ; ::_thesis: verum end; end; registration let M be non empty multMagma ; cluster non empty for multSubmagma of M; existence not for b1 being multSubmagma of M holds b1 is empty proof set N = multMagma(# the carrier of M, the multF of M #); the multF of multMagma(# the carrier of M, the multF of M #) = the multF of multMagma(# the carrier of M, the multF of M #) | [: the carrier of multMagma(# the carrier of M, the multF of M #), the carrier of multMagma(# the carrier of M, the multF of M #):] .= the multF of M || the carrier of multMagma(# the carrier of M, the multF of M #) by REALSET1:def_2 ; then reconsider N = multMagma(# the carrier of M, the multF of M #) as multSubmagma of M by Def9; take N ; ::_thesis: not N is empty thus not N is empty ; ::_thesis: verum end; end; theorem Th6: :: ALGSTR_4:6 for M being multMagma for N, K being multSubmagma of M st N is multSubmagma of K & K is multSubmagma of N holds multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of K, the multF of K #) proof let M be multMagma ; ::_thesis: for N, K being multSubmagma of M st N is multSubmagma of K & K is multSubmagma of N holds multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of K, the multF of K #) let N, K be multSubmagma of M; ::_thesis: ( N is multSubmagma of K & K is multSubmagma of N implies multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of K, the multF of K #) ) assume that A1: N is multSubmagma of K and A2: K is multSubmagma of N ; ::_thesis: multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of K, the multF of K #) set A = the carrier of N; set B = the carrier of K; set f = the multF of N; set g = the multF of K; A3: ( the carrier of N c= the carrier of K & the carrier of K c= the carrier of N ) by A1, A2, Def9; the multF of N = the multF of K || the carrier of N by A1, Def9 .= ( the multF of N || the carrier of K) || the carrier of N by A2, Def9 .= ( the multF of N | [: the carrier of K, the carrier of K:]) || the carrier of N by REALSET1:def_2 .= ( the multF of N | [: the carrier of K, the carrier of K:]) | [: the carrier of N, the carrier of N:] by REALSET1:def_2 .= the multF of N | [: the carrier of K, the carrier of K:] .= the multF of N || the carrier of K by REALSET1:def_2 .= the multF of K by A2, Def9 ; hence multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of K, the multF of K #) by A3, XBOOLE_0:def_10; ::_thesis: verum end; theorem Th7: :: ALGSTR_4:7 for M being multMagma for N being multSubmagma of M st the carrier of N = the carrier of M holds multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of M, the multF of M #) proof let M be multMagma ; ::_thesis: for N being multSubmagma of M st the carrier of N = the carrier of M holds multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of M, the multF of M #) let N be multSubmagma of M; ::_thesis: ( the carrier of N = the carrier of M implies multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of M, the multF of M #) ) assume A1: the carrier of N = the carrier of M ; ::_thesis: multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of M, the multF of M #) percases ( the carrier of M = {} or the carrier of M <> {} ) ; suppose the carrier of M = {} ; ::_thesis: multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of M, the multF of M #) hence multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of M, the multF of M #) by A1; ::_thesis: verum end; suppose the carrier of M <> {} ; ::_thesis: multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of M, the multF of M #) A2: the multF of M = the multF of M | [: the carrier of M, the carrier of M:] .= the multF of M || the carrier of M by REALSET1:def_2 ; then reconsider M9 = M as multSubmagma of M by Def9; the multF of M9 = the multF of N || the carrier of M9 by A1, A2, Def9; then M9 is multSubmagma of N by A1, Def9; hence multMagma(# the carrier of N, the multF of N #) = multMagma(# the carrier of M, the multF of M #) by Th6; ::_thesis: verum end; end; end; definition let M be multMagma ; let A be Subset of M; attrA is stable means :Def10: :: ALGSTR_4:def 10 for v, w being Element of M st v in A & w in A holds v * w in A; end; :: deftheorem Def10 defines stable ALGSTR_4:def_10_:_ for M being multMagma for A being Subset of M holds ( A is stable iff for v, w being Element of M st v in A & w in A holds v * w in A ); registration let M be multMagma ; cluster stable for Element of bool the carrier of M; correctness existence ex b1 being Subset of M st b1 is stable ; proof reconsider A = the carrier of M as Subset of M by ZFMISC_1:def_1; take A ; ::_thesis: A is stable for v, w being Element of M st v in A & w in A holds v * w in A ; hence A is stable by Def10; ::_thesis: verum end; end; theorem Th8: :: ALGSTR_4:8 for M being multMagma for N being multSubmagma of M holds the carrier of N is stable Subset of M proof let M be multMagma ; ::_thesis: for N being multSubmagma of M holds the carrier of N is stable Subset of M let N be multSubmagma of M; ::_thesis: the carrier of N is stable Subset of M for v, w being Element of M st v in the carrier of N & w in the carrier of N holds v * w in the carrier of N proof let v, w be Element of M; ::_thesis: ( v in the carrier of N & w in the carrier of N implies v * w in the carrier of N ) assume A1: ( v in the carrier of N & w in the carrier of N ) ; ::_thesis: v * w in the carrier of N then reconsider v9 = v, w9 = w as Element of N ; A2: [v,w] in [: the carrier of N, the carrier of N:] by A1, ZFMISC_1:def_2; v9 * w9 = the multF of N . [v9,w9] by BINOP_1:def_1 .= ( the multF of M || the carrier of N) . [v9,w9] by Def9 .= ( the multF of M | [: the carrier of N, the carrier of N:]) . [v,w] by REALSET1:def_2 .= the multF of M . [v,w] by A2, FUNCT_1:49 .= v * w by BINOP_1:def_1 ; hence v * w in the carrier of N by A1; ::_thesis: verum end; hence the carrier of N is stable Subset of M by Def9, Def10; ::_thesis: verum end; registration let M be multMagma ; let N be multSubmagma of M; cluster the carrier of N -> stable for Subset of M; correctness coherence for b1 being Subset of M st b1 = the carrier of N holds b1 is stable ; by Th8; end; theorem Th9: :: ALGSTR_4:9 for M being multMagma for F being Function st ( for i being set st i in dom F holds F . i is stable Subset of M ) holds meet F is stable Subset of M proof let M be multMagma ; ::_thesis: for F being Function st ( for i being set st i in dom F holds F . i is stable Subset of M ) holds meet F is stable Subset of M let F be Function; ::_thesis: ( ( for i being set st i in dom F holds F . i is stable Subset of M ) implies meet F is stable Subset of M ) assume A1: for i being set st i in dom F holds F . i is stable Subset of M ; ::_thesis: meet F is stable Subset of M A2: for x being set st x in meet F holds x in the carrier of M proof let x be set ; ::_thesis: ( x in meet F implies x in the carrier of M ) assume x in meet F ; ::_thesis: x in the carrier of M then A3: x in meet (rng F) by FUNCT_6:def_4; percases ( dom F is empty or not dom F is empty ) ; suppose dom F is empty ; ::_thesis: x in the carrier of M then F = {} ; hence x in the carrier of M by A3, SETFAM_1:1; ::_thesis: verum end; suppose not dom F is empty ; ::_thesis: x in the carrier of M then consider i being set such that A4: i in dom F by XBOOLE_0:def_1; meet (rng F) c= F . i by A4, FUNCT_1:3, SETFAM_1:3; then A5: x in F . i by A3; F . i is stable Subset of M by A1, A4; hence x in the carrier of M by A5; ::_thesis: verum end; end; end; for v, w being Element of M st v in meet F & w in meet F holds v * w in meet F proof let v, w be Element of M; ::_thesis: ( v in meet F & w in meet F implies v * w in meet F ) assume A6: ( v in meet F & w in meet F ) ; ::_thesis: v * w in meet F percases ( F = {} or F <> {} ) ; suppose F = {} ; ::_thesis: v * w in meet F then meet (rng F) = {} by SETFAM_1:1; hence v * w in meet F by A6, FUNCT_6:def_4; ::_thesis: verum end; supposeA7: F <> {} ; ::_thesis: v * w in meet F A8: ( v in meet (rng F) & w in meet (rng F) ) by A6, FUNCT_6:def_4; for Y being set st Y in rng F holds v * w in Y proof let Y be set ; ::_thesis: ( Y in rng F implies v * w in Y ) assume A9: Y in rng F ; ::_thesis: v * w in Y then A10: ( v in Y & w in Y ) by A8, SETFAM_1:def_1; consider i being set such that A11: ( i in dom F & Y = F . i ) by A9, FUNCT_1:def_3; Y is stable Subset of M by A1, A11; hence v * w in Y by A10, Def10; ::_thesis: verum end; then v * w in meet (rng F) by A7, SETFAM_1:def_1; hence v * w in meet F by FUNCT_6:def_4; ::_thesis: verum end; end; end; hence meet F is stable Subset of M by A2, Def10, TARSKI:def_3; ::_thesis: verum end; theorem :: ALGSTR_4:10 for M being non empty multMagma for A being Subset of M holds ( A is stable iff A * A c= A ) proof let M be non empty multMagma ; ::_thesis: for A being Subset of M holds ( A is stable iff A * A c= A ) let A be Subset of M; ::_thesis: ( A is stable iff A * A c= A ) hereby ::_thesis: ( A * A c= A implies A is stable ) assume A1: A is stable ; ::_thesis: A * A c= A for x being set st x in A * A holds x in A proof let x be set ; ::_thesis: ( x in A * A implies x in A ) assume x in A * A ; ::_thesis: x in A then consider v, w being Element of M such that A2: ( x = v * w & v in A & w in A ) by GROUP_2:8; thus x in A by A1, A2, Def10; ::_thesis: verum end; hence A * A c= A by TARSKI:def_3; ::_thesis: verum end; assume A3: A * A c= A ; ::_thesis: A is stable for v, w being Element of M st v in A & w in A holds v * w in A proof let v, w be Element of M; ::_thesis: ( v in A & w in A implies v * w in A ) assume ( v in A & w in A ) ; ::_thesis: v * w in A then v * w in A * A by GROUP_2:8; hence v * w in A by A3; ::_thesis: verum end; hence A is stable by Def10; ::_thesis: verum end; theorem Th11: :: ALGSTR_4:11 for M, N being non empty multMagma for f being Function of M,N for X being stable Subset of M st f is multiplicative holds f .: X is stable Subset of N proof let M, N be non empty multMagma ; ::_thesis: for f being Function of M,N for X being stable Subset of M st f is multiplicative holds f .: X is stable Subset of N let f be Function of M,N; ::_thesis: for X being stable Subset of M st f is multiplicative holds f .: X is stable Subset of N let X be stable Subset of M; ::_thesis: ( f is multiplicative implies f .: X is stable Subset of N ) assume A1: f is multiplicative ; ::_thesis: f .: X is stable Subset of N for v, w being Element of N st v in f .: X & w in f .: X holds v * w in f .: X proof let v, w be Element of N; ::_thesis: ( v in f .: X & w in f .: X implies v * w in f .: X ) assume v in f .: X ; ::_thesis: ( not w in f .: X or v * w in f .: X ) then consider v9 being set such that A2: ( v9 in dom f & v9 in X & v = f . v9 ) by FUNCT_1:def_6; assume w in f .: X ; ::_thesis: v * w in f .: X then consider w9 being set such that A3: ( w9 in dom f & w9 in X & w = f . w9 ) by FUNCT_1:def_6; reconsider v9 = v9, w9 = w9 as Element of M by A2, A3; v9 * w9 in the carrier of M ; then A4: v9 * w9 in dom f by FUNCT_2:def_1; v9 * w9 in X by A2, A3, Def10; then f . (v9 * w9) in f .: X by A4, FUNCT_1:def_6; hence v * w in f .: X by A2, A3, A1, GROUP_6:def_6; ::_thesis: verum end; hence f .: X is stable Subset of N by Def10; ::_thesis: verum end; theorem Th12: :: ALGSTR_4:12 for N, M being non empty multMagma for f being Function of M,N for Y being stable Subset of N st f is multiplicative holds f " Y is stable Subset of M proof let N, M be non empty multMagma ; ::_thesis: for f being Function of M,N for Y being stable Subset of N st f is multiplicative holds f " Y is stable Subset of M let f be Function of M,N; ::_thesis: for Y being stable Subset of N st f is multiplicative holds f " Y is stable Subset of M let Y be stable Subset of N; ::_thesis: ( f is multiplicative implies f " Y is stable Subset of M ) assume A1: f is multiplicative ; ::_thesis: f " Y is stable Subset of M for v, w being Element of M st v in f " Y & w in f " Y holds v * w in f " Y proof let v, w be Element of M; ::_thesis: ( v in f " Y & w in f " Y implies v * w in f " Y ) assume v in f " Y ; ::_thesis: ( not w in f " Y or v * w in f " Y ) then A2: ( v in dom f & f . v in Y ) by FUNCT_1:def_7; assume w in f " Y ; ::_thesis: v * w in f " Y then A3: ( w in dom f & f . w in Y ) by FUNCT_1:def_7; v * w in the carrier of M ; then A4: v * w in dom f by FUNCT_2:def_1; (f . v) * (f . w) in Y by A2, A3, Def10; then f . (v * w) in Y by A1, GROUP_6:def_6; hence v * w in f " Y by A4, FUNCT_1:def_7; ::_thesis: verum end; hence f " Y is stable Subset of M by Def10; ::_thesis: verum end; theorem :: ALGSTR_4:13 for N, M being non empty multMagma for f, g being Function of M,N st f is multiplicative & g is multiplicative holds { v where v is Element of M : f . v = g . v } is stable Subset of M proof let N, M be non empty multMagma ; ::_thesis: for f, g being Function of M,N st f is multiplicative & g is multiplicative holds { v where v is Element of M : f . v = g . v } is stable Subset of M let f, g be Function of M,N; ::_thesis: ( f is multiplicative & g is multiplicative implies { v where v is Element of M : f . v = g . v } is stable Subset of M ) assume A1: f is multiplicative ; ::_thesis: ( not g is multiplicative or { v where v is Element of M : f . v = g . v } is stable Subset of M ) assume A2: g is multiplicative ; ::_thesis: { v where v is Element of M : f . v = g . v } is stable Subset of M set X = { v where v is Element of M : f . v = g . v } ; for x being set st x in { v where v is Element of M : f . v = g . v } holds x in the carrier of M proof let x be set ; ::_thesis: ( x in { v where v is Element of M : f . v = g . v } implies x in the carrier of M ) assume x in { v where v is Element of M : f . v = g . v } ; ::_thesis: x in the carrier of M then consider v being Element of M such that A3: ( x = v & f . v = g . v ) ; thus x in the carrier of M by A3; ::_thesis: verum end; then reconsider X = { v where v is Element of M : f . v = g . v } as Subset of M by TARSKI:def_3; for v, w being Element of M st v in X & w in X holds v * w in X proof let v, w be Element of M; ::_thesis: ( v in X & w in X implies v * w in X ) assume v in X ; ::_thesis: ( not w in X or v * w in X ) then consider v9 being Element of M such that A4: ( v = v9 & f . v9 = g . v9 ) ; assume w in X ; ::_thesis: v * w in X then consider w9 being Element of M such that A5: ( w = w9 & f . w9 = g . w9 ) ; f . (v * w) = (g . v) * (g . w) by A4, A5, A1, GROUP_6:def_6 .= g . (v * w) by A2, GROUP_6:def_6 ; hence v * w in X ; ::_thesis: verum end; hence { v where v is Element of M : f . v = g . v } is stable Subset of M by Def10; ::_thesis: verum end; definition let M be multMagma ; let A be stable Subset of M; func the_mult_induced_by A -> BinOp of A equals :: ALGSTR_4:def 11 the multF of M || A; correctness coherence the multF of M || A is BinOp of A; proof for x being set st x in [:A,A:] holds the multF of M . x in A proof let x be set ; ::_thesis: ( x in [:A,A:] implies the multF of M . x in A ) assume x in [:A,A:] ; ::_thesis: the multF of M . x in A then consider v, w being set such that A1: ( v in A & w in A & x = [v,w] ) by ZFMISC_1:def_2; reconsider v = v, w = w as Element of M by A1; v * w in A by A1, Def10; hence the multF of M . x in A by A1, BINOP_1:def_1; ::_thesis: verum end; then A is Preserv of the multF of M by REALSET1:def_1; hence the multF of M || A is BinOp of A by REALSET1:2; ::_thesis: verum end; end; :: deftheorem defines the_mult_induced_by ALGSTR_4:def_11_:_ for M being multMagma for A being stable Subset of M holds the_mult_induced_by A = the multF of M || A; definition let M be multMagma ; let A be Subset of M; func the_submagma_generated_by A -> strict multSubmagma of M means :Def12: :: ALGSTR_4:def 12 ( A c= the carrier of it & ( for N being strict multSubmagma of M st A c= the carrier of N holds it is multSubmagma of N ) ); existence ex b1 being strict multSubmagma of M st ( A c= the carrier of b1 & ( for N being strict multSubmagma of M st A c= the carrier of N holds b1 is multSubmagma of N ) ) proof defpred S1[ set ] means ex H being strict multSubmagma of M st ( \$1 = the carrier of H & A c= \$1 ); consider X being set such that A1: for Y being set holds ( Y in X iff ( Y in bool the carrier of M & S1[Y] ) ) from XBOOLE_0:sch_1(); set F = id X; set A1 = meet (id X); for x being set st x in dom (id X) holds (id X) . x is stable Subset of M proof let x be set ; ::_thesis: ( x in dom (id X) implies (id X) . x is stable Subset of M ) assume A2: x in dom (id X) ; ::_thesis: (id X) . x is stable Subset of M then ( x in bool the carrier of M & S1[x] ) by A1; hence (id X) . x is stable Subset of M by A2, FUNCT_1:18; ::_thesis: verum end; then reconsider A1 = meet (id X) as stable Subset of M by Th9; set N1 = multMagma(# A1,(the_mult_induced_by A1) #); take multMagma(# A1,(the_mult_induced_by A1) #) ; ::_thesis: ( multMagma(# A1,(the_mult_induced_by A1) #) is strict multSubmagma of M & A c= the carrier of multMagma(# A1,(the_mult_induced_by A1) #) & ( for N being strict multSubmagma of M st A c= the carrier of N holds multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N ) ) percases ( X = {} or X <> {} ) ; supposeA3: X = {} ; ::_thesis: ( multMagma(# A1,(the_mult_induced_by A1) #) is strict multSubmagma of M & A c= the carrier of multMagma(# A1,(the_mult_induced_by A1) #) & ( for N being strict multSubmagma of M st A c= the carrier of N holds multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N ) ) A4: the carrier of M in bool the carrier of M by ZFMISC_1:def_1; ex H being strict multSubmagma of M st ( the carrier of M = the carrier of H & A c= the carrier of M ) proof the multF of M = the multF of M | [: the carrier of M, the carrier of M:] ; then the multF of M = the multF of M || the carrier of M by REALSET1:def_2; then reconsider H = multMagma(# the carrier of M, the multF of M #) as strict multSubmagma of M by Def9; take H ; ::_thesis: ( the carrier of M = the carrier of H & A c= the carrier of M ) thus the carrier of M = the carrier of H ; ::_thesis: A c= the carrier of M thus A c= the carrier of M ; ::_thesis: verum end; hence ( multMagma(# A1,(the_mult_induced_by A1) #) is strict multSubmagma of M & A c= the carrier of multMagma(# A1,(the_mult_induced_by A1) #) & ( for N being strict multSubmagma of M st A c= the carrier of N holds multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N ) ) by A3, A4, A1; ::_thesis: verum end; supposeA5: X <> {} ; ::_thesis: ( multMagma(# A1,(the_mult_induced_by A1) #) is strict multSubmagma of M & A c= the carrier of multMagma(# A1,(the_mult_induced_by A1) #) & ( for N being strict multSubmagma of M st A c= the carrier of N holds multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N ) ) A6: for x being set st x in A holds x in A1 proof let x be set ; ::_thesis: ( x in A implies x in A1 ) assume A7: x in A ; ::_thesis: x in A1 for Y being set st Y in X holds x in Y proof let Y be set ; ::_thesis: ( Y in X implies x in Y ) assume Y in X ; ::_thesis: x in Y then consider H being strict multSubmagma of M such that A8: ( Y = the carrier of H & A c= Y ) by A1; thus x in Y by A8, A7; ::_thesis: verum end; then x in meet X by A5, SETFAM_1:def_1; then x in meet (rng (id X)) ; hence x in A1 by FUNCT_6:def_4; ::_thesis: verum end; for N being strict multSubmagma of M st A c= the carrier of N holds multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N proof let N be strict multSubmagma of M; ::_thesis: ( A c= the carrier of N implies multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N ) assume A9: A c= the carrier of N ; ::_thesis: multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N for x being set st x in the carrier of multMagma(# A1,(the_mult_induced_by A1) #) holds x in the carrier of N proof let x be set ; ::_thesis: ( x in the carrier of multMagma(# A1,(the_mult_induced_by A1) #) implies x in the carrier of N ) assume x in the carrier of multMagma(# A1,(the_mult_induced_by A1) #) ; ::_thesis: x in the carrier of N then x in meet (rng (id X)) by FUNCT_6:def_4; then A10: x in meet X ; the carrier of N c= the carrier of M by Def9; then the carrier of N in X by A1, A9; hence x in the carrier of N by A10, SETFAM_1:def_1; ::_thesis: verum end; then A11: the carrier of multMagma(# A1,(the_mult_induced_by A1) #) c= the carrier of N by TARSKI:def_3; A12: the multF of M | [: the carrier of N, the carrier of N:] = the multF of M || the carrier of N by REALSET1:def_2 .= the multF of N by Def9 ; the multF of multMagma(# A1,(the_mult_induced_by A1) #) = the multF of M | [: the carrier of multMagma(# A1,(the_mult_induced_by A1) #), the carrier of multMagma(# A1,(the_mult_induced_by A1) #):] by REALSET1:def_2 .= ( the multF of M | [: the carrier of N, the carrier of N:]) | [: the carrier of multMagma(# A1,(the_mult_induced_by A1) #), the carrier of multMagma(# A1,(the_mult_induced_by A1) #):] by A11, RELAT_1:74, ZFMISC_1:96 .= the multF of N || the carrier of multMagma(# A1,(the_mult_induced_by A1) #) by A12, REALSET1:def_2 ; hence multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N by A11, Def9; ::_thesis: verum end; hence ( multMagma(# A1,(the_mult_induced_by A1) #) is strict multSubmagma of M & A c= the carrier of multMagma(# A1,(the_mult_induced_by A1) #) & ( for N being strict multSubmagma of M st A c= the carrier of N holds multMagma(# A1,(the_mult_induced_by A1) #) is multSubmagma of N ) ) by A6, Def9, TARSKI:def_3; ::_thesis: verum end; end; end; uniqueness for b1, b2 being strict multSubmagma of M st A c= the carrier of b1 & ( for N being strict multSubmagma of M st A c= the carrier of N holds b1 is multSubmagma of N ) & A c= the carrier of b2 & ( for N being strict multSubmagma of M st A c= the carrier of N holds b2 is multSubmagma of N ) holds b1 = b2 proof let H1, H2 be strict multSubmagma of M; ::_thesis: ( A c= the carrier of H1 & ( for N being strict multSubmagma of M st A c= the carrier of N holds H1 is multSubmagma of N ) & A c= the carrier of H2 & ( for N being strict multSubmagma of M st A c= the carrier of N holds H2 is multSubmagma of N ) implies H1 = H2 ) assume ( A c= the carrier of H1 & ( for N being strict multSubmagma of M st A c= the carrier of N holds H1 is multSubmagma of N ) & A c= the carrier of H2 & ( for N being strict multSubmagma of M st A c= the carrier of N holds H2 is multSubmagma of N ) ) ; ::_thesis: H1 = H2 then ( H1 is multSubmagma of H2 & H2 is multSubmagma of H1 ) ; hence H1 = H2 by Th6; ::_thesis: verum end; end; :: deftheorem Def12 defines the_submagma_generated_by ALGSTR_4:def_12_:_ for M being multMagma for A being Subset of M for b3 being strict multSubmagma of M holds ( b3 = the_submagma_generated_by A iff ( A c= the carrier of b3 & ( for N being strict multSubmagma of M st A c= the carrier of N holds b3 is multSubmagma of N ) ) ); theorem Th14: :: ALGSTR_4:14 for M being multMagma for A being Subset of M holds ( A is empty iff the_submagma_generated_by A is empty ) proof let M be multMagma ; ::_thesis: for A being Subset of M holds ( A is empty iff the_submagma_generated_by A is empty ) let A be Subset of M; ::_thesis: ( A is empty iff the_submagma_generated_by A is empty ) hereby ::_thesis: ( the_submagma_generated_by A is empty implies A is empty ) assume A1: A is empty ; ::_thesis: the_submagma_generated_by A is empty then for v, w being Element of M st v in A & w in A holds v * w in A ; then reconsider A9 = A as stable Subset of M by Def10; reconsider N = multMagma(# A9,(the_mult_induced_by A9) #) as strict multSubmagma of M by Def9; the_submagma_generated_by A is multSubmagma of N by Def12; then the carrier of (the_submagma_generated_by A) c= the carrier of N by Def9; hence the_submagma_generated_by A is empty by A1; ::_thesis: verum end; assume the_submagma_generated_by A is empty ; ::_thesis: A is empty then the carrier of (the_submagma_generated_by A) = {} ; then A c= {} by Def12; hence A is empty ; ::_thesis: verum end; registration let M be multMagma ; let A be empty Subset of M; cluster the_submagma_generated_by A -> empty strict ; correctness coherence the_submagma_generated_by A is empty ; by Th14; end; theorem Th15: :: ALGSTR_4:15 for M, N being non empty multMagma for f being Function of M,N for X being Subset of M st f is multiplicative holds f .: the carrier of (the_submagma_generated_by X) = the carrier of (the_submagma_generated_by (f .: X)) proof let M, N be non empty multMagma ; ::_thesis: for f being Function of M,N for X being Subset of M st f is multiplicative holds f .: the carrier of (the_submagma_generated_by X) = the carrier of (the_submagma_generated_by (f .: X)) let f be Function of M,N; ::_thesis: for X being Subset of M st f is multiplicative holds f .: the carrier of (the_submagma_generated_by X) = the carrier of (the_submagma_generated_by (f .: X)) let X be Subset of M; ::_thesis: ( f is multiplicative implies f .: the carrier of (the_submagma_generated_by X) = the carrier of (the_submagma_generated_by (f .: X)) ) assume A1: f is multiplicative ; ::_thesis: f .: the carrier of (the_submagma_generated_by X) = the carrier of (the_submagma_generated_by (f .: X)) set X9 = the_submagma_generated_by X; set A = f .: the carrier of (the_submagma_generated_by X); the carrier of (the_submagma_generated_by X) is stable Subset of M by Th8; then reconsider A = f .: the carrier of (the_submagma_generated_by X) as stable Subset of N by A1, Th11; set Y9 = the_submagma_generated_by (f .: X); set B = f " the carrier of (the_submagma_generated_by (f .: X)); the carrier of (the_submagma_generated_by (f .: X)) is stable Subset of N by Th8; then reconsider B = f " the carrier of (the_submagma_generated_by (f .: X)) as stable Subset of M by A1, Th12; A2: ( f .: X c= the carrier of (the_submagma_generated_by (f .: X)) & ( for N1 being strict multSubmagma of N st f .: X c= the carrier of N1 holds the_submagma_generated_by (f .: X) is multSubmagma of N1 ) ) by Def12; reconsider N1 = multMagma(# A,(the_mult_induced_by A) #) as strict multSubmagma of N by Def9; X c= the carrier of (the_submagma_generated_by X) by Def12; then the_submagma_generated_by (f .: X) is multSubmagma of N1 by A2, RELAT_1:123; then A3: the carrier of (the_submagma_generated_by (f .: X)) c= A by Def9; A4: ( X c= the carrier of (the_submagma_generated_by X) & ( for M1 being strict multSubmagma of M st X c= the carrier of M1 holds the_submagma_generated_by X is multSubmagma of M1 ) ) by Def12; reconsider M1 = multMagma(# B,(the_mult_induced_by B) #) as strict multSubmagma of M by Def9; A5: f .: (f " the carrier of (the_submagma_generated_by (f .: X))) c= the carrier of (the_submagma_generated_by (f .: X)) by FUNCT_1:75; f .: X c= the carrier of (the_submagma_generated_by (f .: X)) by Def12; then A6: f " (f .: X) c= f " the carrier of (the_submagma_generated_by (f .: X)) by RELAT_1:143; X c= the carrier of M ; then X c= dom f by FUNCT_2:def_1; then X c= f " (f .: X) by FUNCT_1:76; then the_submagma_generated_by X is multSubmagma of M1 by A4, A6, XBOOLE_1:1; then the carrier of (the_submagma_generated_by X) c= B by Def9; then A c= f .: (f " the carrier of (the_submagma_generated_by (f .: X))) by RELAT_1:123; then A c= the carrier of (the_submagma_generated_by (f .: X)) by A5, XBOOLE_1:1; hence f .: the carrier of (the_submagma_generated_by X) = the carrier of (the_submagma_generated_by (f .: X)) by A3, XBOOLE_0:def_10; ::_thesis: verum end; begin definition let X be set ; defpred S1[ set , set ] means for fs being XFinSequence of st \$1 = fs holds ( ( dom fs = 0 implies \$2 = {} ) & ( dom fs = 1 implies \$2 = X ) & ( for n being Nat st n >= 2 & dom fs = n holds ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:(fs . p),(fs . (n - p)):] ) & \$2 = Union (disjoin fs1) ) ) ); A1: for e being set st e in (bool (the_universe_of (X \/ NAT))) ^omega holds ex u being set st S1[e,u] proof let e be set ; ::_thesis: ( e in (bool (the_universe_of (X \/ NAT))) ^omega implies ex u being set st S1[e,u] ) assume e in (bool (the_universe_of (X \/ NAT))) ^omega ; ::_thesis: ex u being set st S1[e,u] then reconsider fs = e as XFinSequence of by AFINSQ_1:def_7; ( dom fs = 0 or (dom fs) + 1 > 0 + 1 ) by XREAL_1:6; then ( dom fs = 0 or dom fs >= 1 ) by NAT_1:13; then ( dom fs = 0 or dom fs = 1 or dom fs > 1 ) by XXREAL_0:1; then A2: ( dom fs = 0 or dom fs = 1 or (dom fs) + 1 > 1 + 1 ) by XREAL_1:6; percases ( dom fs = 0 or dom fs = 1 or dom fs >= 2 ) by A2, NAT_1:13; supposeA3: dom fs = 0 ; ::_thesis: ex u being set st S1[e,u] set u = {} ; take {} ; ::_thesis: S1[e, {} ] thus S1[e, {} ] by A3; ::_thesis: verum end; supposeA4: dom fs = 1 ; ::_thesis: ex u being set st S1[e,u] set u = X; take X ; ::_thesis: S1[e,X] thus S1[e,X] by A4; ::_thesis: verum end; supposeA5: dom fs >= 2 ; ::_thesis: ex u being set st S1[e,u] reconsider n = dom fs as Nat ; reconsider n9 = n -' 1 as Nat ; n - 1 >= 2 - 1 by A5, XREAL_1:9; then A6: n9 = n - 1 by XREAL_0:def_2; defpred S2[ set , set ] means for p being Nat st p >= 1 & p <= n - 1 & \$1 = p holds \$2 = [:(fs . p),(fs . (n - p)):]; A7: for k being Nat st k in Seg n9 holds ex x being set st S2[k,x] proof let k be Nat; ::_thesis: ( k in Seg n9 implies ex x being set st S2[k,x] ) assume k in Seg n9 ; ::_thesis: ex x being set st S2[k,x] set x = [:(fs . k),(fs . (n - k)):]; take [:(fs . k),(fs . (n - k)):] ; ::_thesis: S2[k,[:(fs . k),(fs . (n - k)):]] thus S2[k,[:(fs . k),(fs . (n - k)):]] ; ::_thesis: verum end; consider fs1 being FinSequence such that A8: ( dom fs1 = Seg n9 & ( for k being Nat st k in Seg n9 holds S2[k,fs1 . k] ) ) from FINSEQ_1:sch_1(A7); set u = Union (disjoin fs1); take Union (disjoin fs1) ; ::_thesis: S1[e, Union (disjoin fs1)] A9: len fs1 = n - 1 by A6, A8, FINSEQ_1:def_3; for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:(fs . p),(fs . (n - p)):] proof let p be Nat; ::_thesis: ( p >= 1 & p <= n - 1 implies fs1 . p = [:(fs . p),(fs . (n - p)):] ) assume A10: ( p >= 1 & p <= n - 1 ) ; ::_thesis: fs1 . p = [:(fs . p),(fs . (n - p)):] then p in Seg n9 by A6, FINSEQ_1:1; hence fs1 . p = [:(fs . p),(fs . (n - p)):] by A8, A10; ::_thesis: verum end; hence S1[e, Union (disjoin fs1)] by A5, A9; ::_thesis: verum end; end; end; consider F being Function such that A11: ( dom F = (bool (the_universe_of (X \/ NAT))) ^omega & ( for e being set st e in (bool (the_universe_of (X \/ NAT))) ^omega holds S1[e,F . e] ) ) from CLASSES1:sch_1(A1); A12: for e being set st e in (bool (the_universe_of (X \/ NAT))) ^omega holds F . e in bool (the_universe_of (X \/ NAT)) proof let e be set ; ::_thesis: ( e in (bool (the_universe_of (X \/ NAT))) ^omega implies F . e in bool (the_universe_of (X \/ NAT)) ) assume A13: e in (bool (the_universe_of (X \/ NAT))) ^omega ; ::_thesis: F . e in bool (the_universe_of (X \/ NAT)) then reconsider fs = e as XFinSequence of by AFINSQ_1:def_7; A14: ( ( dom fs = 0 implies F . e = {} ) & ( dom fs = 1 implies F . e = X ) & ( for n being Nat st n >= 2 & dom fs = n holds ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:(fs . p),(fs . (n - p)):] ) & F . e = Union (disjoin fs1) ) ) ) by A13, A11; ( dom fs = 0 or (dom fs) + 1 > 0 + 1 ) by XREAL_1:6; then ( dom fs = 0 or dom fs >= 1 ) by NAT_1:13; then ( dom fs = 0 or dom fs = 1 or dom fs > 1 ) by XXREAL_0:1; then A15: ( dom fs = 0 or dom fs = 1 or (dom fs) + 1 > 1 + 1 ) by XREAL_1:6; percases ( dom fs = 0 or dom fs = 1 or dom fs >= 2 ) by A15, NAT_1:13; supposeA16: dom fs = 0 ; ::_thesis: F . e in bool (the_universe_of (X \/ NAT)) {} c= the_universe_of (X \/ NAT) by XBOOLE_1:2; hence F . e in bool (the_universe_of (X \/ NAT)) by A16, A14; ::_thesis: verum end; suppose dom fs = 1 ; ::_thesis: F . e in bool (the_universe_of (X \/ NAT)) then A17: F . e = X by A13, A11; for x being set st x in X holds x in Tarski-Class (the_transitive-closure_of (X \/ NAT)) proof let x be set ; ::_thesis: ( x in X implies x in Tarski-Class (the_transitive-closure_of (X \/ NAT)) ) assume x in X ; ::_thesis: x in Tarski-Class (the_transitive-closure_of (X \/ NAT)) then x c= (union X) \/ (union NAT) by XBOOLE_1:10, ZFMISC_1:74; then A18: x c= union (X \/ NAT) by ZFMISC_1:78; A19: the_transitive-closure_of (X \/ NAT) in Tarski-Class (the_transitive-closure_of (X \/ NAT)) by CLASSES1:2; A20: union (X \/ NAT) c= union (the_transitive-closure_of (X \/ NAT)) by CLASSES1:52, ZFMISC_1:77; union (the_transitive-closure_of (X \/ NAT)) c= the_transitive-closure_of (X \/ NAT) by CLASSES1:48, CLASSES1:51; then union (X \/ NAT) c= the_transitive-closure_of (X \/ NAT) by A20, XBOOLE_1:1; hence x in Tarski-Class (the_transitive-closure_of (X \/ NAT)) by A19, A18, CLASSES1:3, XBOOLE_1:1; ::_thesis: verum end; then X c= Tarski-Class (the_transitive-closure_of (X \/ NAT)) by TARSKI:def_3; then X c= the_universe_of (X \/ NAT) by YELLOW_6:def_1; hence F . e in bool (the_universe_of (X \/ NAT)) by A17; ::_thesis: verum end; supposeA21: dom fs >= 2 ; ::_thesis: F . e in bool (the_universe_of (X \/ NAT)) set n = dom fs; consider fs1 being FinSequence such that A22: ( len fs1 = (dom fs) - 1 & ( for p being Nat st p >= 1 & p <= (dom fs) - 1 holds fs1 . p = [:(fs . p),(fs . ((dom fs) - p)):] ) & F . e = Union (disjoin fs1) ) by A21, A13, A11; reconsider n9 = (dom fs) -' 1 as Nat ; (dom fs) - 1 >= 2 - 1 by A21, XREAL_1:9; then A23: n9 = (dom fs) - 1 by XREAL_0:def_2; A24: for p being Nat st p >= 1 & p <= (dom fs) - 1 holds fs1 . p c= the_universe_of (X \/ NAT) proof let p be Nat; ::_thesis: ( p >= 1 & p <= (dom fs) - 1 implies fs1 . p c= the_universe_of (X \/ NAT) ) assume A25: ( p >= 1 & p <= (dom fs) - 1 ) ; ::_thesis: fs1 . p c= the_universe_of (X \/ NAT) then A26: fs1 . p = [:(fs . p),(fs . ((dom fs) - p)):] by A22; A27: p in Seg n9 by A23, A25, FINSEQ_1:1; ( - p <= - 1 & - p >= - ((dom fs) - 1) ) by A25, XREAL_1:24; then A28: ( (- p) + (dom fs) <= (- 1) + (dom fs) & (- p) + (dom fs) >= (- ((dom fs) - 1)) + (dom fs) ) by XREAL_1:6; then A29: ( (dom fs) - p <= (dom fs) -' 1 & (dom fs) - p >= 1 ) by XREAL_0:def_2; A30: (dom fs) - p = (dom fs) -' p by A28, XREAL_0:def_2; then A31: (dom fs) -' p in Seg n9 by A29, FINSEQ_1:1; A32: Seg n9 c= n9 + 1 by AFINSQ_1:3; then A33: fs . p in rng fs by A27, A23, FUNCT_1:3; fs . ((dom fs) - p) in rng fs by A30, A32, A23, A31, FUNCT_1:3; hence fs1 . p c= the_universe_of (X \/ NAT) by A26, A33, Th1; ::_thesis: verum end; for x being set st x in rng (disjoin fs1) holds x c= the_universe_of (X \/ NAT) proof let x be set ; ::_thesis: ( x in rng (disjoin fs1) implies x c= the_universe_of (X \/ NAT) ) assume x in rng (disjoin fs1) ; ::_thesis: x c= the_universe_of (X \/ NAT) then consider p being set such that A34: ( p in dom (disjoin fs1) & x = (disjoin fs1) . p ) by FUNCT_1:def_3; A35: p in dom fs1 by A34, CARD_3:def_3; then A36: x = [:(fs1 . p),{p}:] by A34, CARD_3:def_3; A37: p in Seg n9 by A22, A23, A35, FINSEQ_1:def_3; reconsider p = p as Nat by A35; ( p >= 1 & p <= (dom fs) - 1 ) by A23, A37, FINSEQ_1:1; then A38: fs1 . p c= the_universe_of (X \/ NAT) by A24; A39: for y being set st y in {p} holds y in NAT proof let y be set ; ::_thesis: ( y in {p} implies y in NAT ) assume y in {p} ; ::_thesis: y in NAT then y = p by TARSKI:def_1; hence y in NAT by ORDINAL1:def_12; ::_thesis: verum end; for x being set st x in {p} holds x in Tarski-Class (the_transitive-closure_of (X \/ NAT)) proof let x be set ; ::_thesis: ( x in {p} implies x in Tarski-Class (the_transitive-closure_of (X \/ NAT)) ) assume x in {p} ; ::_thesis: x in Tarski-Class (the_transitive-closure_of (X \/ NAT)) then x in NAT by A39; then x c= (union X) \/ (union NAT) by XBOOLE_1:10, ZFMISC_1:74; then A40: x c= union (X \/ NAT) by ZFMISC_1:78; A41: the_transitive-closure_of (X \/ NAT) in Tarski-Class (the_transitive-closure_of (X \/ NAT)) by CLASSES1:2; A42: union (X \/ NAT) c= union (the_transitive-closure_of (X \/ NAT)) by CLASSES1:52, ZFMISC_1:77; union (the_transitive-closure_of (X \/ NAT)) c= the_transitive-closure_of (X \/ NAT) by CLASSES1:48, CLASSES1:51; then union (X \/ NAT) c= the_transitive-closure_of (X \/ NAT) by A42, XBOOLE_1:1; hence x in Tarski-Class (the_transitive-closure_of (X \/ NAT)) by A41, A40, CLASSES1:3, XBOOLE_1:1; ::_thesis: verum end; then {p} c= Tarski-Class (the_transitive-closure_of (X \/ NAT)) by TARSKI:def_3; then {p} c= the_universe_of (X \/ NAT) by YELLOW_6:def_1; hence x c= the_universe_of (X \/ NAT) by A36, A38, Th1; ::_thesis: verum end; then union (rng (disjoin fs1)) c= the_universe_of (X \/ NAT) by ZFMISC_1:76; then union (rng (disjoin fs1)) in bool (the_universe_of (X \/ NAT)) ; hence F . e in bool (the_universe_of (X \/ NAT)) by A22, CARD_3:def_4; ::_thesis: verum end; end; end; func free_magma_seq X -> Function of NAT,(bool (the_universe_of (X \/ NAT))) means :Def13: :: ALGSTR_4:def 13 ( it . 0 = {} & it . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(it . p),(it . (n - p)):] ) & it . n = Union (disjoin fs) ) ) ); existence ex b1 being Function of NAT,(bool (the_universe_of (X \/ NAT))) st ( b1 . 0 = {} & b1 . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(b1 . p),(b1 . (n - p)):] ) & b1 . n = Union (disjoin fs) ) ) ) proof reconsider F = F as Function of ((bool (the_universe_of (X \/ NAT))) ^omega),(bool (the_universe_of (X \/ NAT))) by A12, A11, FUNCT_2:3; deffunc H1( XFinSequence of ) -> Element of bool (the_universe_of (X \/ NAT)) = F . \$1; consider f being Function of NAT,(bool (the_universe_of (X \/ NAT))) such that A43: for n being Nat holds f . n = H1(f | n) from ALGSTR_4:sch_4(); take f ; ::_thesis: ( f . 0 = {} & f . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f . p),(f . (n - p)):] ) & f . n = Union (disjoin fs) ) ) ) A44: {} in (bool (the_universe_of (X \/ NAT))) ^omega by AFINSQ_1:43; A45: dom {} = {} ; thus f . 0 = F . (f | 0) by A43 .= {} by A44, A45, A11 ; ::_thesis: ( f . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f . p),(f . (n - p)):] ) & f . n = Union (disjoin fs) ) ) ) 1 c= NAT ; then 1 c= dom f by FUNCT_2:def_1; then A46: dom (f | 1) = 1 by RELAT_1:62; A47: f | 1 in (bool (the_universe_of (X \/ NAT))) ^omega by AFINSQ_1:42; thus f . 1 = F . (f | 1) by A43 .= X by A46, A47, A11 ; ::_thesis: for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f . p),(f . (n - p)):] ) & f . n = Union (disjoin fs) ) let n be Nat; ::_thesis: ( n >= 2 implies ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f . p),(f . (n - p)):] ) & f . n = Union (disjoin fs) ) ) assume A48: n >= 2 ; ::_thesis: ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f . p),(f . (n - p)):] ) & f . n = Union (disjoin fs) ) n c= NAT ; then n c= dom f by FUNCT_2:def_1; then A49: dom (f | n) = n by RELAT_1:62; f | n in (bool (the_universe_of (X \/ NAT))) ^omega by AFINSQ_1:42; then consider fs1 being FinSequence such that A50: ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:((f | n) . p),((f | n) . (n - p)):] ) & F . (f | n) = Union (disjoin fs1) ) by A48, A49, A11; take fs1 ; ::_thesis: ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:(f . p),(f . (n - p)):] ) & f . n = Union (disjoin fs1) ) thus len fs1 = n - 1 by A50; ::_thesis: ( ( for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:(f . p),(f . (n - p)):] ) & f . n = Union (disjoin fs1) ) thus for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:(f . p),(f . (n - p)):] ::_thesis: f . n = Union (disjoin fs1) proof let p be Nat; ::_thesis: ( p >= 1 & p <= n - 1 implies fs1 . p = [:(f . p),(f . (n - p)):] ) assume A51: ( p >= 1 & p <= n - 1 ) ; ::_thesis: fs1 . p = [:(f . p),(f . (n - p)):] set n9 = n -' 1; n - 1 >= 2 - 1 by A48, XREAL_1:9; then A52: n -' 1 = n - 1 by XREAL_0:def_2; then A53: p in Seg (n -' 1) by A51, FINSEQ_1:1; Seg (n -' 1) c= (n -' 1) + 1 by AFINSQ_1:3; then A54: (f | n) . p = f . p by A52, A53, FUNCT_1:49; ( - p <= - 1 & - p >= - (n - 1) ) by A51, XREAL_1:24; then A55: ( (- p) + n <= (- 1) + n & (- p) + n >= (- (n - 1)) + n ) by XREAL_1:6; then A56: ( n - p <= n -' 1 & n - p >= 1 ) by XREAL_0:def_2; A57: n - p = n -' p by A55, XREAL_0:def_2; then A58: n -' p in Seg (n -' 1) by A56, FINSEQ_1:1; A59: Seg (n -' 1) c= (n -' 1) + 1 by AFINSQ_1:3; thus fs1 . p = [:((f | n) . p),((f | n) . (n - p)):] by A51, A50 .= [:(f . p),(f . (n - p)):] by A54, A59, A57, A52, A58, FUNCT_1:49 ; ::_thesis: verum end; thus f . n = Union (disjoin fs1) by A50, A43; ::_thesis: verum end; uniqueness for b1, b2 being Function of NAT,(bool (the_universe_of (X \/ NAT))) st b1 . 0 = {} & b1 . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(b1 . p),(b1 . (n - p)):] ) & b1 . n = Union (disjoin fs) ) ) & b2 . 0 = {} & b2 . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(b2 . p),(b2 . (n - p)):] ) & b2 . n = Union (disjoin fs) ) ) holds b1 = b2 proof let f1, f2 be Function of NAT,(bool (the_universe_of (X \/ NAT))); ::_thesis: ( f1 . 0 = {} & f1 . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f1 . p),(f1 . (n - p)):] ) & f1 . n = Union (disjoin fs) ) ) & f2 . 0 = {} & f2 . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f2 . p),(f2 . (n - p)):] ) & f2 . n = Union (disjoin fs) ) ) implies f1 = f2 ) assume A60: f1 . 0 = {} ; ::_thesis: ( not f1 . 1 = X or ex n being Nat st ( n >= 2 & ( for fs being FinSequence holds ( not len fs = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & not fs . p = [:(f1 . p),(f1 . (n - p)):] ) or not f1 . n = Union (disjoin fs) ) ) ) or not f2 . 0 = {} or not f2 . 1 = X or ex n being Nat st ( n >= 2 & ( for fs being FinSequence holds ( not len fs = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & not fs . p = [:(f2 . p),(f2 . (n - p)):] ) or not f2 . n = Union (disjoin fs) ) ) ) or f1 = f2 ) assume A61: f1 . 1 = X ; ::_thesis: ( ex n being Nat st ( n >= 2 & ( for fs being FinSequence holds ( not len fs = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & not fs . p = [:(f1 . p),(f1 . (n - p)):] ) or not f1 . n = Union (disjoin fs) ) ) ) or not f2 . 0 = {} or not f2 . 1 = X or ex n being Nat st ( n >= 2 & ( for fs being FinSequence holds ( not len fs = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & not fs . p = [:(f2 . p),(f2 . (n - p)):] ) or not f2 . n = Union (disjoin fs) ) ) ) or f1 = f2 ) assume A62: for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f1 . p),(f1 . (n - p)):] ) & f1 . n = Union (disjoin fs) ) ; ::_thesis: ( not f2 . 0 = {} or not f2 . 1 = X or ex n being Nat st ( n >= 2 & ( for fs being FinSequence holds ( not len fs = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & not fs . p = [:(f2 . p),(f2 . (n - p)):] ) or not f2 . n = Union (disjoin fs) ) ) ) or f1 = f2 ) assume A63: f2 . 0 = {} ; ::_thesis: ( not f2 . 1 = X or ex n being Nat st ( n >= 2 & ( for fs being FinSequence holds ( not len fs = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & not fs . p = [:(f2 . p),(f2 . (n - p)):] ) or not f2 . n = Union (disjoin fs) ) ) ) or f1 = f2 ) assume A64: f2 . 1 = X ; ::_thesis: ( ex n being Nat st ( n >= 2 & ( for fs being FinSequence holds ( not len fs = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & not fs . p = [:(f2 . p),(f2 . (n - p)):] ) or not f2 . n = Union (disjoin fs) ) ) ) or f1 = f2 ) assume A65: for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(f2 . p),(f2 . (n - p)):] ) & f2 . n = Union (disjoin fs) ) ; ::_thesis: f1 = f2 {} in (bool (the_universe_of (X \/ NAT))) ^omega by AFINSQ_1:43; then A66: ( S1[ {} ,F . {}] & {} is XFinSequence of ) by A11, AFINSQ_1:42; A67: dom {} = {} ; reconsider F = F as Function of ((bool (the_universe_of (X \/ NAT))) ^omega),(bool (the_universe_of (X \/ NAT))) by A12, A11, FUNCT_2:3; deffunc H1( XFinSequence of ) -> Element of bool (the_universe_of (X \/ NAT)) = F . \$1; A68: for n being Nat holds f1 . n = H1(f1 | n) proof let n be Nat; ::_thesis: f1 . n = H1(f1 | n) ( n = 0 or n + 1 > 0 + 1 ) by XREAL_1:6; then ( n = 0 or n >= 1 ) by NAT_1:13; then ( n = 0 or n = 1 or n > 1 ) by XXREAL_0:1; then A69: ( n = 0 or n = 1 or n + 1 > 1 + 1 ) by XREAL_1:6; percases ( n = 0 or n = 1 or n >= 2 ) by A69, NAT_1:13; supposeA70: n = 0 ; ::_thesis: f1 . n = H1(f1 | n) hence f1 . n = F . {} by A66, A67, A60 .= H1(f1 | n) by A70 ; ::_thesis: verum end; supposeA71: n = 1 ; ::_thesis: f1 . n = H1(f1 | n) 1 c= NAT ; then 1 c= dom f1 by FUNCT_2:def_1; then A72: dom (f1 | 1) = 1 by RELAT_1:62; f1 | 1 in (bool (the_universe_of (X \/ NAT))) ^omega by AFINSQ_1:42; hence f1 . n = H1(f1 | n) by A71, A72, A11, A61; ::_thesis: verum end; supposeA73: n >= 2 ; ::_thesis: f1 . n = H1(f1 | n) n c= NAT ; then n c= dom f1 by FUNCT_2:def_1; then A74: dom (f1 | n) = n by RELAT_1:62; f1 | n in (bool (the_universe_of (X \/ NAT))) ^omega by AFINSQ_1:42; then consider fs1 being FinSequence such that A75: ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:((f1 | n) . p),((f1 | n) . (n - p)):] ) & F . (f1 | n) = Union (disjoin fs1) ) by A73, A74, A11; consider fs2 being FinSequence such that A76: ( len fs2 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs2 . p = [:(f1 . p),(f1 . (n - p)):] ) & f1 . n = Union (disjoin fs2) ) by A73, A62; for p being Nat st 1 <= p & p <= len fs1 holds fs1 . p = fs2 . p proof let p be Nat; ::_thesis: ( 1 <= p & p <= len fs1 implies fs1 . p = fs2 . p ) assume A77: ( 1 <= p & p <= len fs1 ) ; ::_thesis: fs1 . p = fs2 . p then A78: fs1 . p = [:((f1 | n) . p),((f1 | n) . (n - p)):] by A75; A79: fs2 . p = [:(f1 . p),(f1 . (n - p)):] by A77, A75, A76; set n9 = n -' 1; n - 1 >= 2 - 1 by A73, XREAL_1:9; then A80: n -' 1 = n - 1 by XREAL_0:def_2; then A81: p in Seg (n -' 1) by A77, A75, FINSEQ_1:1; A82: Seg (n -' 1) c= (n -' 1) + 1 by AFINSQ_1:3; ( - p <= - 1 & - p >= - (n - 1) ) by A77, A75, XREAL_1:24; then A83: ( (- p) + n <= (- 1) + n & (- p) + n >= (- (n - 1)) + n ) by XREAL_1:6; then A84: ( n - p <= n -' 1 & n - p >= 1 ) by XREAL_0:def_2; A85: n - p = n -' p by A83, XREAL_0:def_2; then A86: n -' p in Seg (n -' 1) by A84, FINSEQ_1:1; Seg (n -' 1) c= (n -' 1) + 1 by AFINSQ_1:3; then (f1 | n) . (n - p) = f1 . (n - p) by A85, A80, A86, FUNCT_1:49; hence fs1 . p = fs2 . p by A82, A78, A79, A80, A81, FUNCT_1:49; ::_thesis: verum end; hence f1 . n = H1(f1 | n) by A75, A76, FINSEQ_1:14; ::_thesis: verum end; end; end; A87: for n being Nat holds f2 . n = H1(f2 | n) proof let n be Nat; ::_thesis: f2 . n = H1(f2 | n) ( n = 0 or n + 1 > 0 + 1 ) by XREAL_1:6; then ( n = 0 or n >= 1 ) by NAT_1:13; then ( n = 0 or n = 1 or n > 1 ) by XXREAL_0:1; then A88: ( n = 0 or n = 1 or n + 1 > 1 + 1 ) by XREAL_1:6; percases ( n = 0 or n = 1 or n >= 2 ) by A88, NAT_1:13; supposeA89: n = 0 ; ::_thesis: f2 . n = H1(f2 | n) hence f2 . n = F . {} by A66, A67, A63 .= H1(f2 | n) by A89 ; ::_thesis: verum end; supposeA90: n = 1 ; ::_thesis: f2 . n = H1(f2 | n) 1 c= NAT ; then 1 c= dom f2 by FUNCT_2:def_1; then A91: dom (f2 | 1) = 1 by RELAT_1:62; f2 | 1 in (bool (the_universe_of (X \/ NAT))) ^omega by AFINSQ_1:42; hence f2 . n = H1(f2 | n) by A91, A11, A90, A64; ::_thesis: verum end; supposeA92: n >= 2 ; ::_thesis: f2 . n = H1(f2 | n) n c= NAT ; then n c= dom f2 by FUNCT_2:def_1; then A93: dom (f2 | n) = n by RELAT_1:62; f2 | n in (bool (the_universe_of (X \/ NAT))) ^omega by AFINSQ_1:42; then consider fs1 being FinSequence such that A94: ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs1 . p = [:((f2 | n) . p),((f2 | n) . (n - p)):] ) & F . (f2 | n) = Union (disjoin fs1) ) by A92, A93, A11; consider fs2 being FinSequence such that A95: ( len fs2 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs2 . p = [:(f2 . p),(f2 . (n - p)):] ) & f2 . n = Union (disjoin fs2) ) by A92, A65; for p being Nat st 1 <= p & p <= len fs1 holds fs1 . p = fs2 . p proof let p be Nat; ::_thesis: ( 1 <= p & p <= len fs1 implies fs1 . p = fs2 . p ) assume A96: ( 1 <= p & p <= len fs1 ) ; ::_thesis: fs1 . p = fs2 . p then A97: fs1 . p = [:((f2 | n) . p),((f2 | n) . (n - p)):] by A94; A98: fs2 . p = [:(f2 . p),(f2 . (n - p)):] by A96, A94, A95; set n9 = n -' 1; n - 1 >= 2 - 1 by A92, XREAL_1:9; then A99: n -' 1 = n - 1 by XREAL_0:def_2; then A100: p in Seg (n -' 1) by A96, A94, FINSEQ_1:1; A101: Seg (n -' 1) c= (n -' 1) + 1 by AFINSQ_1:3; ( - p <= - 1 & - p >= - (n - 1) ) by A96, A94, XREAL_1:24; then A102: ( (- p) + n <= (- 1) + n & (- p) + n >= (- (n - 1)) + n ) by XREAL_1:6; then A103: ( n - p <= n -' 1 & n - p >= 1 ) by XREAL_0:def_2; A104: n - p = n -' p by A102, XREAL_0:def_2; then A105: n -' p in Seg (n -' 1) by A103, FINSEQ_1:1; Seg (n -' 1) c= (n -' 1) + 1 by AFINSQ_1:3; then (f2 | n) . (n - p) = f2 . (n - p) by A105, A104, A99, FUNCT_1:49; hence fs1 . p = fs2 . p by A101, A97, A98, A99, A100, FUNCT_1:49; ::_thesis: verum end; hence f2 . n = H1(f2 | n) by A95, A94, FINSEQ_1:14; ::_thesis: verum end; end; end; f1 = f2 from ALGSTR_4:sch_3(A68, A87); hence f1 = f2 ; ::_thesis: verum end; end; :: deftheorem Def13 defines free_magma_seq ALGSTR_4:def_13_:_ for X being set for b2 being Function of NAT,(bool (the_universe_of (X \/ NAT))) holds ( b2 = free_magma_seq X iff ( b2 . 0 = {} & b2 . 1 = X & ( for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(b2 . p),(b2 . (n - p)):] ) & b2 . n = Union (disjoin fs) ) ) ) ); definition let X be set ; let n be Nat; func free_magma (X,n) -> set equals :: ALGSTR_4:def 14 (free_magma_seq X) . n; correctness coherence (free_magma_seq X) . n is set ; ; end; :: deftheorem defines free_magma ALGSTR_4:def_14_:_ for X being set for n being Nat holds free_magma (X,n) = (free_magma_seq X) . n; registration let X be non empty set ; let n be non zero Nat; cluster free_magma (X,n) -> non empty ; correctness coherence not free_magma (X,n) is empty ; proof defpred S1[ Nat] means ( X = 0 or (free_magma_seq X) . X <> {} ); A1: for k being Nat st ( for n being Nat st n < k holds S1[n] ) holds S1[k] proof let k be Nat; ::_thesis: ( ( for n being Nat st n < k holds S1[n] ) implies S1[k] ) assume A2: for n being Nat st n < k holds S1[n] ; ::_thesis: S1[k] ( k = 0 or k + 1 > 0 + 1 ) by XREAL_1:6; then ( k = 0 or k >= 1 ) by NAT_1:13; then ( k = 0 or k = 1 or k > 1 ) by XXREAL_0:1; then A3: ( k = 0 or k = 1 or k + 1 > 1 + 1 ) by XREAL_1:6; percases ( k = 0 or k = 1 or k >= 2 ) by A3, NAT_1:13; suppose k = 0 ; ::_thesis: S1[k] hence S1[k] ; ::_thesis: verum end; suppose k = 1 ; ::_thesis: S1[k] hence S1[k] by Def13; ::_thesis: verum end; supposeA4: k >= 2 ; ::_thesis: S1[k] then consider fs being FinSequence such that A5: ( len fs = k - 1 & ( for p being Nat st p >= 1 & p <= k - 1 holds fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . (k - p)):] ) & (free_magma_seq X) . k = Union (disjoin fs) ) by Def13; A6: 2 - 1 <= k - 1 by A4, XREAL_1:9; then 1 in Seg (len fs) by A5, FINSEQ_1:1; then A7: 1 in dom fs by FINSEQ_1:def_3; then A8: 1 in dom (disjoin fs) by CARD_3:def_3; A9: (disjoin fs) . 1 = [:(fs . 1),{1}:] by A7, CARD_3:def_3; A10: fs . 1 = [:((free_magma_seq X) . 1),((free_magma_seq X) . (k - 1)):] by A5, A6; 1 + 1 <= (k - 1) + 1 by A4; then 1 < k by NAT_1:13; then A11: (free_magma_seq X) . 1 <> {} by A2; A12: (- 1) + k < 0 + k by XREAL_1:8; k - 1 in NAT by A6, INT_1:3; then reconsider k9 = k - 1 as Nat ; (free_magma_seq X) . k9 <> {} by A12, A6, A2; then consider x being set such that A13: x in [:(fs . 1),{1}:] by A11, A10, XBOOLE_0:def_1; [:(fs . 1),{1}:] c= union (rng (disjoin fs)) by A9, A8, FUNCT_1:3, ZFMISC_1:74; hence S1[k] by A13, A5, CARD_3:def_4; ::_thesis: verum end; end; end; for n being Nat holds S1[n] from NAT_1:sch_4(A1); hence not free_magma (X,n) is empty ; ::_thesis: verum end; end; theorem :: ALGSTR_4:16 for X being set holds free_magma (X,0) = {} by Def13; theorem :: ALGSTR_4:17 for X being set holds free_magma (X,1) = X by Def13; theorem Th18: :: ALGSTR_4:18 for X being set holds free_magma (X,2) = [:[:X,X:],{1}:] proof let X be set ; ::_thesis: free_magma (X,2) = [:[:X,X:],{1}:] consider fs being FinSequence such that A1: ( len fs = 2 - 1 & ( for p being Nat st p >= 1 & p <= 2 - 1 holds fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . (2 - p)):] ) & (free_magma_seq X) . 2 = Union (disjoin fs) ) by Def13; A2: fs . 1 = [:((free_magma_seq X) . 1),((free_magma_seq X) . (2 - 1)):] by A1 .= [:(free_magma (X,1)),X:] by Def13 .= [:X,X:] by Def13 ; then A3: fs = <*[:X,X:]*> by A1, FINSEQ_1:40; A4: for y being set holds ( y in union (rng (disjoin fs)) iff y in [:[:X,X:],{1}:] ) proof let y be set ; ::_thesis: ( y in union (rng (disjoin fs)) iff y in [:[:X,X:],{1}:] ) hereby ::_thesis: ( y in [:[:X,X:],{1}:] implies y in union (rng (disjoin fs)) ) assume y in union (rng (disjoin fs)) ; ::_thesis: y in [:[:X,X:],{1}:] then consider Y being set such that A5: ( y in Y & Y in rng (disjoin fs) ) by TARSKI:def_4; consider x being set such that A6: ( x in dom (disjoin fs) & Y = (disjoin fs) . x ) by A5, FUNCT_1:def_3; A7: x in dom fs by A6, CARD_3:def_3; then x in Seg 1 by A3, FINSEQ_1:38; then x = 1 by FINSEQ_1:2, TARSKI:def_1; hence y in [:[:X,X:],{1}:] by A5, A2, A6, A7, CARD_3:def_3; ::_thesis: verum end; assume A8: y in [:[:X,X:],{1}:] ; ::_thesis: y in union (rng (disjoin fs)) 1 in Seg 1 by FINSEQ_1:1; then A9: 1 in dom fs by A3, FINSEQ_1:38; then A10: 1 in dom (disjoin fs) by CARD_3:def_3; [:[:X,X:],{1}:] = (disjoin fs) . 1 by A2, A9, CARD_3:def_3; then [:[:X,X:],{1}:] in rng (disjoin fs) by A10, FUNCT_1:def_3; hence y in union (rng (disjoin fs)) by A8, TARSKI:def_4; ::_thesis: verum end; thus free_magma (X,2) = union (rng (disjoin fs)) by A1, CARD_3:def_4 .= [:[:X,X:],{1}:] by A4, TARSKI:1 ; ::_thesis: verum end; theorem :: ALGSTR_4:19 for X being set holds free_magma (X,3) = [:[:X,[:[:X,X:],{1}:]:],{1}:] \/ [:[:[:[:X,X:],{1}:],X:],{2}:] proof let X be set ; ::_thesis: free_magma (X,3) = [:[:X,[:[:X,X:],{1}:]:],{1}:] \/ [:[:[:[:X,X:],{1}:],X:],{2}:] set X1 = [:[:X,[:[:X,X:],{1}:]:],{1}:]; set X2 = [:[:[:[:X,X:],{1}:],X:],{2}:]; consider fs being FinSequence such that A1: ( len fs = 3 - 1 & ( for p being Nat st p >= 1 & p <= 3 - 1 holds fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . (3 - p)):] ) & (free_magma_seq X) . 3 = Union (disjoin fs) ) by Def13; A2: fs . 1 = [:(free_magma (X,1)),(free_magma (X,2)):] by A1 .= [:(free_magma (X,1)),[:[:X,X:],{1}:]:] by Th18 .= [:X,[:[:X,X:],{1}:]:] by Def13 ; A3: fs . 2 = [:((free_magma_seq X) . 2),((free_magma_seq X) . (3 - 2)):] by A1 .= [:(free_magma (X,2)),X:] by Def13 .= [:[:[:X,X:],{1}:],X:] by Th18 ; A4: for y being set holds ( y in union (rng (disjoin fs)) iff ( y in [:[:X,[:[:X,X:],{1}:]:],{1}:] or y in [:[:[:[:X,X:],{1}:],X:],{2}:] ) ) proof let y be set ; ::_thesis: ( y in union (rng (disjoin fs)) iff ( y in [:[:X,[:[:X,X:],{1}:]:],{1}:] or y in [:[:[:[:X,X:],{1}:],X:],{2}:] ) ) hereby ::_thesis: ( ( y in [:[:X,[:[:X,X:],{1}:]:],{1}:] or y in [:[:[:[:X,X:],{1}:],X:],{2}:] ) implies y in union (rng (disjoin fs)) ) assume y in union (rng (disjoin fs)) ; ::_thesis: ( y in [:[:X,[:[:X,X:],{1}:]:],{1}:] or y in [:[:[:[:X,X:],{1}:],X:],{2}:] ) then consider Y being set such that A5: ( y in Y & Y in rng (disjoin fs) ) by TARSKI:def_4; consider x being set such that A6: ( x in dom (disjoin fs) & Y = (disjoin fs) . x ) by A5, FUNCT_1:def_3; A7: x in dom fs by A6, CARD_3:def_3; then x in {1,2} by A1, FINSEQ_1:2, FINSEQ_1:def_3; then ( x = 1 or x = 2 ) by TARSKI:def_2; hence ( y in [:[:X,[:[:X,X:],{1}:]:],{1}:] or y in [:[:[:[:X,X:],{1}:],X:],{2}:] ) by A2, A3, A5, A6, A7, CARD_3:def_3; ::_thesis: verum end; assume A8: ( y in [:[:X,[:[:X,X:],{1}:]:],{1}:] or y in [:[:[:[:X,X:],{1}:],X:],{2}:] ) ; ::_thesis: y in union (rng (disjoin fs)) ( 1 in Seg 2 & 2 in Seg 2 ) by FINSEQ_1:1; then A9: ( 1 in dom fs & 2 in dom fs ) by A1, FINSEQ_1:def_3; then A10: ( 1 in dom (disjoin fs) & 2 in dom (disjoin fs) ) by CARD_3:def_3; ( [:[:X,[:[:X,X:],{1}:]:],{1}:] = (disjoin fs) . 1 & [:[:[:[:X,X:],{1}:],X:],{2}:] = (disjoin fs) . 2 ) by A2, A3, A9, CARD_3:def_3; then ( [:[:X,[:[:X,X:],{1}:]:],{1}:] in rng (disjoin fs) & [:[:[:[:X,X:],{1}:],X:],{2}:] in rng (disjoin fs) ) by A10, FUNCT_1:def_3; hence y in union (rng (disjoin fs)) by A8, TARSKI:def_4; ::_thesis: verum end; thus free_magma (X,3) = union (rng (disjoin fs)) by A1, CARD_3:def_4 .= [:[:X,[:[:X,X:],{1}:]:],{1}:] \/ [:[:[:[:X,X:],{1}:],X:],{2}:] by A4, XBOOLE_0:def_3 ; ::_thesis: verum end; theorem Th20: :: ALGSTR_4:20 for X being set for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] ) & free_magma (X,n) = Union (disjoin fs) ) proof let X be set ; ::_thesis: for n being Nat st n >= 2 holds ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] ) & free_magma (X,n) = Union (disjoin fs) ) let n be Nat; ::_thesis: ( n >= 2 implies ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] ) & free_magma (X,n) = Union (disjoin fs) ) ) assume n >= 2 ; ::_thesis: ex fs being FinSequence st ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] ) & free_magma (X,n) = Union (disjoin fs) ) then consider fs being FinSequence such that A1: ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . (n - p)):] ) & (free_magma_seq X) . n = Union (disjoin fs) ) by Def13; take fs ; ::_thesis: ( len fs = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] ) & free_magma (X,n) = Union (disjoin fs) ) thus len fs = n - 1 by A1; ::_thesis: ( ( for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] ) & free_magma (X,n) = Union (disjoin fs) ) thus for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] ::_thesis: free_magma (X,n) = Union (disjoin fs) proof let p be Nat; ::_thesis: ( p >= 1 & p <= n - 1 implies fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] ) assume A2: ( p >= 1 & p <= n - 1 ) ; ::_thesis: fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] then ( - p <= - 1 & - p >= - (n - 1) ) by XREAL_1:24; then ( (- p) + n <= (- 1) + n & (- p) + n >= (- (n - 1)) + n ) by XREAL_1:6; then n - p = n -' p by XREAL_0:def_2; hence fs . p = [:(free_magma (X,p)),(free_magma (X,(n -' p))):] by A2, A1; ::_thesis: verum end; thus free_magma (X,n) = Union (disjoin fs) by A1; ::_thesis: verum end; theorem Th21: :: ALGSTR_4:21 for X, x being set for n being Nat st n >= 2 & x in free_magma (X,n) holds ex p, m being Nat st ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) proof let X, x be set ; ::_thesis: for n being Nat st n >= 2 & x in free_magma (X,n) holds ex p, m being Nat st ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) let n be Nat; ::_thesis: ( n >= 2 & x in free_magma (X,n) implies ex p, m being Nat st ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) ) assume A1: n >= 2 ; ::_thesis: ( not x in free_magma (X,n) or ex p, m being Nat st ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) ) assume A2: x in free_magma (X,n) ; ::_thesis: ex p, m being Nat st ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) consider fs being FinSequence such that A3: len fs = n - 1 and A4: for p being Nat st p >= 1 & p <= n - 1 holds fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . (n - p)):] and A5: (free_magma_seq X) . n = Union (disjoin fs) by A1, Def13; x in union (rng (disjoin fs)) by A2, A5, CARD_3:def_4; then consider Y being set such that A6: ( x in Y & Y in rng (disjoin fs) ) by TARSKI:def_4; consider p being set such that A7: ( p in dom (disjoin fs) & Y = (disjoin fs) . p ) by A6, FUNCT_1:def_3; A8: p in dom fs by A7, CARD_3:def_3; then reconsider p = p as Nat ; A9: p in Seg (len fs) by A8, FINSEQ_1:def_3; then A10: ( 1 <= p & p <= len fs ) by FINSEQ_1:1; then A11: fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . (n - p)):] by A3, A4; then x in [:[:((free_magma_seq X) . p),((free_magma_seq X) . (n - p)):],{p}:] by A6, A7, A8, CARD_3:def_3; then A12: ( x `1 in [:((free_magma_seq X) . p),((free_magma_seq X) . (n - p)):] & x `2 in {p} ) by MCART_1:10; - p >= - (n - 1) by A10, A3, XREAL_1:24; then (- p) + n >= (- (n - 1)) + n by XREAL_1:7; then n - p in NAT by INT_1:3; then reconsider m = n - p as Nat ; take p ; ::_thesis: ex m being Nat st ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) take m ; ::_thesis: ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) thus ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) by A3, A9, A6, A11, A7, A8, A12, CARD_3:def_3, FINSEQ_1:1, MCART_1:10, TARSKI:def_1; ::_thesis: verum end; theorem Th22: :: ALGSTR_4:22 for X, x, y being set for n, m being Nat st x in free_magma (X,n) & y in free_magma (X,m) holds [[x,y],n] in free_magma (X,(n + m)) proof let X, x, y be set ; ::_thesis: for n, m being Nat st x in free_magma (X,n) & y in free_magma (X,m) holds [[x,y],n] in free_magma (X,(n + m)) let n, m be Nat; ::_thesis: ( x in free_magma (X,n) & y in free_magma (X,m) implies [[x,y],n] in free_magma (X,(n + m)) ) assume A1: x in free_magma (X,n) ; ::_thesis: ( not y in free_magma (X,m) or [[x,y],n] in free_magma (X,(n + m)) ) assume A2: y in free_magma (X,m) ; ::_thesis: [[x,y],n] in free_magma (X,(n + m)) percases ( n = 0 or m = 0 or ( n <> 0 & m <> 0 ) ) ; suppose ( n = 0 or m = 0 ) ; ::_thesis: [[x,y],n] in free_magma (X,(n + m)) hence [[x,y],n] in free_magma (X,(n + m)) by Def13, A1, A2; ::_thesis: verum end; suppose ( n <> 0 & m <> 0 ) ; ::_thesis: [[x,y],n] in free_magma (X,(n + m)) then A3: ( n >= 0 + 1 & m >= 0 + 1 ) by NAT_1:13; then n + m >= 1 + 1 by XREAL_1:7; then consider fs being FinSequence such that A4: ( len fs = (n + m) - 1 & ( for p being Nat st p >= 1 & p <= (n + m) - 1 holds fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . ((n + m) - p)):] ) & (free_magma_seq X) . (n + m) = Union (disjoin fs) ) by Def13; 1 - 1 <= m - 1 by A3, XREAL_1:9; then A5: 0 + n <= (m - 1) + n by XREAL_1:7; then fs . n = [:((free_magma_seq X) . n),((free_magma_seq X) . ((n + m) - n)):] by A4, A3 .= [:((free_magma_seq X) . n),((free_magma_seq X) . m):] ; then A6: [x,y] in fs . n by A1, A2, ZFMISC_1:def_2; n in {n} by TARSKI:def_1; then A7: [[x,y],n] in [:(fs . n),{n}:] by A6, ZFMISC_1:def_2; n in Seg (len fs) by A4, A3, A5, FINSEQ_1:1; then A8: n in dom fs by FINSEQ_1:def_3; then A9: (disjoin fs) . n = [:(fs . n),{n}:] by CARD_3:def_3; n in dom (disjoin fs) by A8, CARD_3:def_3; then [:(fs . n),{n}:] in rng (disjoin fs) by A9, FUNCT_1:3; then [[x,y],n] in union (rng (disjoin fs)) by A7, TARSKI:def_4; hence [[x,y],n] in free_magma (X,(n + m)) by A4, CARD_3:def_4; ::_thesis: verum end; end; end; theorem Th23: :: ALGSTR_4:23 for X, Y being set for n being Nat st X c= Y holds free_magma (X,n) c= free_magma (Y,n) proof let X, Y be set ; ::_thesis: for n being Nat st X c= Y holds free_magma (X,n) c= free_magma (Y,n) let n be Nat; ::_thesis: ( X c= Y implies free_magma (X,n) c= free_magma (Y,n) ) defpred S1[ Nat] means ( X c= Y implies free_magma (X,\$1) c= free_magma (Y,\$1) ); A1: for k being Nat st ( for n being Nat st n < k holds S1[n] ) holds S1[k] proof let k be Nat; ::_thesis: ( ( for n being Nat st n < k holds S1[n] ) implies S1[k] ) assume A2: for n being Nat st n < k holds S1[n] ; ::_thesis: S1[k] thus ( X c= Y implies free_magma (X,k) c= free_magma (Y,k) ) ::_thesis: verum proof assume A3: X c= Y ; ::_thesis: free_magma (X,k) c= free_magma (Y,k) ( k = 0 or k + 1 > 0 + 1 ) by XREAL_1:6; then ( k = 0 or k >= 1 ) by NAT_1:13; then ( k = 0 or k = 1 or k > 1 ) by XXREAL_0:1; then A4: ( k = 0 or k = 1 or k + 1 > 1 + 1 ) by XREAL_1:6; percases ( k = 0 or k = 1 or k >= 2 ) by A4, NAT_1:13; suppose k = 0 ; ::_thesis: free_magma (X,k) c= free_magma (Y,k) then ( free_magma (X,k) = {} & free_magma (Y,k) = {} ) by Def13; hence free_magma (X,k) c= free_magma (Y,k) ; ::_thesis: verum end; suppose k = 1 ; ::_thesis: free_magma (X,k) c= free_magma (Y,k) then ( free_magma (X,k) = X & free_magma (Y,k) = Y ) by Def13; hence free_magma (X,k) c= free_magma (Y,k) by A3; ::_thesis: verum end; supposeA5: k >= 2 ; ::_thesis: free_magma (X,k) c= free_magma (Y,k) for x being set st x in free_magma (X,k) holds x in free_magma (Y,k) proof let x be set ; ::_thesis: ( x in free_magma (X,k) implies x in free_magma (Y,k) ) assume x in free_magma (X,k) ; ::_thesis: x in free_magma (Y,k) then consider p, m being Nat such that A6: ( x `2 = p & 1 <= p & p <= k - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & k = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) by A5, Th21; consider fs being FinSequence such that A7: ( len fs = k - 1 & ( for p being Nat st p >= 1 & p <= k - 1 holds fs . p = [:(free_magma (Y,p)),(free_magma (Y,(k -' p))):] ) & free_magma (Y,k) = Union (disjoin fs) ) by A5, Th20; A8: fs . p = [:(free_magma (Y,p)),(free_magma (Y,(k -' p))):] by A6, A7; A9: ( x `1 in [:(free_magma (X,p)),(free_magma (X,m)):] & x `2 in {p} ) by A6, MCART_1:10; A10: x = [(x `1),(x `2)] by A6, MCART_1:21; A11: x `1 = [((x `1) `1),((x `1) `2)] by A9, MCART_1:21; p + 1 <= (k - 1) + 1 by A6, XREAL_1:7; then A12: p < k by NAT_1:13; then A13: free_magma (X,p) c= free_magma (Y,p) by A2, A3; p - p < k - p by A12, XREAL_1:14; then A14: k -' p = m by A6, XREAL_0:def_2; p + m > 0 + m by A6, XREAL_1:8; then free_magma (X,m) c= free_magma (Y,(k -' p)) by A6, A2, A3, A14; then x `1 in [:(free_magma (Y,p)),(free_magma (Y,(k -' p))):] by A6, A11, A13, MCART_1:11; then A15: x in [:(fs . p),{p}:] by A8, A10, A9, MCART_1:11; p in Seg (len fs) by A6, A7, FINSEQ_1:1; then A16: p in dom fs by FINSEQ_1:def_3; then A17: (disjoin fs) . p = [:(fs . p),{p}:] by CARD_3:def_3; p in dom (disjoin fs) by A16, CARD_3:def_3; then [:(fs . p),{p}:] in rng (disjoin fs) by A17, FUNCT_1:3; then x in union (rng (disjoin fs)) by A15, TARSKI:def_4; hence x in free_magma (Y,k) by A7, CARD_3:def_4; ::_thesis: verum end; hence free_magma (X,k) c= free_magma (Y,k) by TARSKI:def_3; ::_thesis: verum end; end; end; end; for k being Nat holds S1[k] from NAT_1:sch_4(A1); hence ( X c= Y implies free_magma (X,n) c= free_magma (Y,n) ) ; ::_thesis: verum end; definition let X be set ; func free_magma_carrier X -> set equals :: ALGSTR_4:def 15 Union (disjoin ((free_magma_seq X) | NATPLUS)); correctness coherence Union (disjoin ((free_magma_seq X) | NATPLUS)) is set ; ; end; :: deftheorem defines free_magma_carrier ALGSTR_4:def_15_:_ for X being set holds free_magma_carrier X = Union (disjoin ((free_magma_seq X) | NATPLUS)); Lm1: for X being set for n being Nat st n > 0 holds [:(free_magma (X,n)),{n}:] c= free_magma_carrier X proof let X be set ; ::_thesis: for n being Nat st n > 0 holds [:(free_magma (X,n)),{n}:] c= free_magma_carrier X let n be Nat; ::_thesis: ( n > 0 implies [:(free_magma (X,n)),{n}:] c= free_magma_carrier X ) assume A1: n > 0 ; ::_thesis: [:(free_magma (X,n)),{n}:] c= free_magma_carrier X for x being set st x in [:(free_magma (X,n)),{n}:] holds x in free_magma_carrier X proof let x be set ; ::_thesis: ( x in [:(free_magma (X,n)),{n}:] implies x in free_magma_carrier X ) assume A2: x in [:(free_magma (X,n)),{n}:] ; ::_thesis: x in free_magma_carrier X n in NAT by ORDINAL1:def_12; then A3: n in dom (free_magma_seq X) by FUNCT_2:def_1; n in NATPLUS by A1, NAT_LAT:def_6; then A4: n in dom ((free_magma_seq X) | NATPLUS) by A3, RELAT_1:57; then A5: (disjoin ((free_magma_seq X) | NATPLUS)) . n = [:(((free_magma_seq X) | NATPLUS) . n),{n}:] by CARD_3:def_3 .= [:((free_magma_seq X) . n),{n}:] by A4, FUNCT_1:47 ; n in dom (disjoin ((free_magma_seq X) | NATPLUS)) by A4, CARD_3:def_3; then [:(free_magma (X,n)),{n}:] in rng (disjoin ((free_magma_seq X) | NATPLUS)) by A5, FUNCT_1:3; then x in union (rng (disjoin ((free_magma_seq X) | NATPLUS))) by A2, TARSKI:def_4; hence x in free_magma_carrier X by CARD_3:def_4; ::_thesis: verum end; hence [:(free_magma (X,n)),{n}:] c= free_magma_carrier X by TARSKI:def_3; ::_thesis: verum end; theorem Th24: :: ALGSTR_4:24 for X being set holds ( X = {} iff free_magma_carrier X = {} ) proof let X be set ; ::_thesis: ( X = {} iff free_magma_carrier X = {} ) hereby ::_thesis: ( free_magma_carrier X = {} implies X = {} ) assume A1: X = {} ; ::_thesis: free_magma_carrier X = {} defpred S1[ Nat] means (free_magma_seq X) . \$1 = {} ; A2: for k being Nat st ( for n being Nat st n < k holds S1[n] ) holds S1[k] proof let k be Nat; ::_thesis: ( ( for n being Nat st n < k holds S1[n] ) implies S1[k] ) assume A3: for n being Nat st n < k holds S1[n] ; ::_thesis: S1[k] ( k = 0 or k + 1 > 0 + 1 ) by XREAL_1:6; then ( k = 0 or k >= 1 ) by NAT_1:13; then ( k = 0 or k = 1 or k > 1 ) by XXREAL_0:1; then A4: ( k = 0 or k = 1 or k + 1 > 1 + 1 ) by XREAL_1:6; percases ( k = 0 or k = 1 or k >= 2 ) by A4, NAT_1:13; suppose k = 0 ; ::_thesis: S1[k] hence S1[k] by Def13; ::_thesis: verum end; suppose k = 1 ; ::_thesis: S1[k] hence S1[k] by A1, Def13; ::_thesis: verum end; suppose k >= 2 ; ::_thesis: S1[k] then consider fs being FinSequence such that A5: ( len fs = k - 1 & ( for p being Nat st p >= 1 & p <= k - 1 holds fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . (k - p)):] ) & (free_magma_seq X) . k = Union (disjoin fs) ) by Def13; for y being set st y in rng (disjoin fs) holds y c= {} proof let y be set ; ::_thesis: ( y in rng (disjoin fs) implies y c= {} ) assume y in rng (disjoin fs) ; ::_thesis: y c= {} then consider p being set such that A6: ( p in dom (disjoin fs) & y = (disjoin fs) . p ) by FUNCT_1:def_3; A7: p in dom fs by A6, CARD_3:def_3; then A8: p in Seg (len fs) by FINSEQ_1:def_3; reconsider p = p as Nat by A7; A9: ( p >= 1 & p <= k - 1 ) by A5, A8, FINSEQ_1:1; then p + 1 <= (k - 1) + 1 by XREAL_1:7; then p < k by NAT_1:13; then A10: (free_magma_seq X) . p = {} by A3; A11: fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . (k - p)):] by A5, A9 .= {} by A10, ZFMISC_1:90 ; (disjoin fs) . p = [:(fs . p),{p}:] by A7, CARD_3:def_3 .= {} by A11, ZFMISC_1:90 ; hence y c= {} by A6; ::_thesis: verum end; then union (rng (disjoin fs)) c= {} by ZFMISC_1:76; hence S1[k] by A5, CARD_3:def_4; ::_thesis: verum end; end; end; A12: for n being Nat holds S1[n] from NAT_1:sch_4(A2); for Y being set st Y in rng (disjoin ((free_magma_seq X) | NATPLUS)) holds Y c= {} proof let Y be set ; ::_thesis: ( Y in rng (disjoin ((free_magma_seq X) | NATPLUS)) implies Y c= {} ) assume Y in rng (disjoin ((free_magma_seq X) | NATPLUS)) ; ::_thesis: Y c= {} then consider n being set such that A13: ( n in dom (disjoin ((free_magma_seq X) | NATPLUS)) & Y = (disjoin ((free_magma_seq X) | NATPLUS)) . n ) by FUNCT_1:def_3; A14: n in dom ((free_magma_seq X) | NATPLUS) by A13, CARD_3:def_3; then reconsider n = n as Nat ; A15: n in dom ((free_magma_seq X) | NATPLUS) by A13, CARD_3:def_3; (disjoin ((free_magma_seq X) | NATPLUS)) . n = [:(((free_magma_seq X) | NATPLUS) . n),{n}:] by A14, CARD_3:def_3 .= [:((free_magma_seq X) . n),{n}:] by A15, FUNCT_1:47 .= [:{},{n}:] by A12 .= {} by ZFMISC_1:90 ; hence Y c= {} by A13; ::_thesis: verum end; then union (rng (disjoin ((free_magma_seq X) | NATPLUS))) c= {} by ZFMISC_1:76; hence free_magma_carrier X = {} by CARD_3:def_4; ::_thesis: verum end; assume A16: free_magma_carrier X = {} ; ::_thesis: X = {} [:(free_magma (X,1)),{1}:] c= free_magma_carrier X by Lm1; hence X = {} by A16; ::_thesis: verum end; registration let X be empty set ; cluster free_magma_carrier X -> empty ; correctness coherence free_magma_carrier X is empty ; by Th24; end; registration let X be non empty set ; cluster free_magma_carrier X -> non empty ; correctness coherence not free_magma_carrier X is empty ; by Th24; let w be Element of free_magma_carrier X; clusterw `2 -> non zero natural for number ; correctness coherence for b1 being number st b1 = w `2 holds ( not b1 is empty & b1 is natural ); proof w in free_magma_carrier X ; then w in union (rng (disjoin ((free_magma_seq X) | NATPLUS))) by CARD_3:def_4; then consider Y being set such that A1: ( w in Y & Y in rng (disjoin ((free_magma_seq X) | NATPLUS)) ) by TARSKI:def_4; consider n being set such that A2: ( n in dom (disjoin ((free_magma_seq X) | NATPLUS)) & Y = (disjoin ((free_magma_seq X) | NATPLUS)) . n ) by A1, FUNCT_1:def_3; A3: n in dom ((free_magma_seq X) | NATPLUS) by A2, CARD_3:def_3; then n in NATPLUS by RELAT_1:57; then reconsider n = n as non zero Nat ; w in [:(((free_magma_seq X) | NATPLUS) . n),{n}:] by A2, A1, A3, CARD_3:def_3; then w `2 in {n} by MCART_1:10; hence for b1 being number st b1 = w `2 holds ( not b1 is empty & b1 is natural ) by TARSKI:def_1; ::_thesis: verum end; end; theorem Th25: :: ALGSTR_4:25 for X being non empty set for w being Element of free_magma_carrier X holds w in [:(free_magma (X,(w `2))),{(w `2)}:] proof let X be non empty set ; ::_thesis: for w being Element of free_magma_carrier X holds w in [:(free_magma (X,(w `2))),{(w `2)}:] let w be Element of free_magma_carrier X; ::_thesis: w in [:(free_magma (X,(w `2))),{(w `2)}:] w in free_magma_carrier X ; then w in union (rng (disjoin ((free_magma_seq X) | NATPLUS))) by CARD_3:def_4; then consider Y being set such that A1: ( w in Y & Y in rng (disjoin ((free_magma_seq X) | NATPLUS)) ) by TARSKI:def_4; consider n being set such that A2: ( n in dom (disjoin ((free_magma_seq X) | NATPLUS)) & Y = (disjoin ((free_magma_seq X) | NATPLUS)) . n ) by A1, FUNCT_1:def_3; A3: n in dom ((free_magma_seq X) | NATPLUS) by A2, CARD_3:def_3; then A4: ((free_magma_seq X) | NATPLUS) . n = (free_magma_seq X) . n by FUNCT_1:47; reconsider n = n as Nat by A3; w in [:(((free_magma_seq X) | NATPLUS) . n),{n}:] by A2, A1, A3, CARD_3:def_3; then w `2 in {n} by MCART_1:10; then w `2 = n by TARSKI:def_1; hence w in [:(free_magma (X,(w `2))),{(w `2)}:] by A4, A2, A1, A3, CARD_3:def_3; ::_thesis: verum end; theorem Th26: :: ALGSTR_4:26 for X being non empty set for v, w being Element of free_magma_carrier X holds [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))] is Element of free_magma_carrier X proof let X be non empty set ; ::_thesis: for v, w being Element of free_magma_carrier X holds [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))] is Element of free_magma_carrier X let v, w be Element of free_magma_carrier X; ::_thesis: [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))] is Element of free_magma_carrier X v in [:(free_magma (X,(v `2))),{(v `2)}:] by Th25; then A1: v `1 in free_magma (X,(v `2)) by MCART_1:10; w in [:(free_magma (X,(w `2))),{(w `2)}:] by Th25; then w `1 in free_magma (X,(w `2)) by MCART_1:10; then A2: [[(v `1),(w `1)],(v `2)] in free_magma (X,((v `2) + (w `2))) by A1, Th22; A3: (v `2) + (w `2) in {((v `2) + (w `2))} by TARSKI:def_1; set z = [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))]; A4: [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))] `1 in free_magma (X,((v `2) + (w `2))) by A2; [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))] `2 in {((v `2) + (w `2))} by A3; then A5: [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))] in [:(free_magma (X,((v `2) + (w `2)))),{((v `2) + (w `2))}:] by A4, MCART_1:11; [:(free_magma (X,((v `2) + (w `2)))),{((v `2) + (w `2))}:] c= free_magma_carrier X by Lm1; hence [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))] is Element of free_magma_carrier X by A5; ::_thesis: verum end; theorem Th27: :: ALGSTR_4:27 for X, Y being set st X c= Y holds free_magma_carrier X c= free_magma_carrier Y proof let X, Y be set ; ::_thesis: ( X c= Y implies free_magma_carrier X c= free_magma_carrier Y ) assume A1: X c= Y ; ::_thesis: free_magma_carrier X c= free_magma_carrier Y percases ( X = {} or X <> {} ) ; suppose X = {} ; ::_thesis: free_magma_carrier X c= free_magma_carrier Y then free_magma_carrier X = {} ; hence free_magma_carrier X c= free_magma_carrier Y by XBOOLE_1:2; ::_thesis: verum end; supposeA2: X <> {} ; ::_thesis: free_magma_carrier X c= free_magma_carrier Y for x being set st x in free_magma_carrier X holds x in free_magma_carrier Y proof let x be set ; ::_thesis: ( x in free_magma_carrier X implies x in free_magma_carrier Y ) assume A3: x in free_magma_carrier X ; ::_thesis: x in free_magma_carrier Y reconsider X9 = X as non empty set by A2; reconsider w = x as Element of free_magma_carrier X9 by A3; A4: w in [:(free_magma (X9,(w `2))),{(w `2)}:] by Th25; then A5: ( w `1 in free_magma (X9,(w `2)) & w `2 in {(w `2)} ) by MCART_1:10; reconsider Y9 = Y as non empty set by A2, A1; A6: free_magma (X9,(w `2)) c= free_magma (Y9,(w `2)) by A1, Th23; w = [(w `1),(w `2)] by A4, MCART_1:21; then A7: w in [:(free_magma (Y9,(w `2))),{(w `2)}:] by A6, A5, ZFMISC_1:def_2; [:(free_magma (Y9,(w `2))),{(w `2)}:] c= free_magma_carrier Y9 by Lm1; hence x in free_magma_carrier Y by A7; ::_thesis: verum end; hence free_magma_carrier X c= free_magma_carrier Y by TARSKI:def_3; ::_thesis: verum end; end; end; theorem :: ALGSTR_4:28 for X being set for n being Nat st n > 0 holds [:(free_magma (X,n)),{n}:] c= free_magma_carrier X by Lm1; definition let X be set ; func free_magma_mult X -> BinOp of (free_magma_carrier X) means :Def16: :: ALGSTR_4:def 16 for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds it . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] if not X is empty otherwise it = {} ; correctness consistency for b1 being BinOp of (free_magma_carrier X) holds verum; existence ( ( for b1 being BinOp of (free_magma_carrier X) holds verum ) & ( not X is empty implies ex b1 being BinOp of (free_magma_carrier X) st for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( X is empty implies ex b1 being BinOp of (free_magma_carrier X) st b1 = {} ) ); uniqueness for b1, b2 being BinOp of (free_magma_carrier X) holds ( ( not X is empty & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) implies b1 = b2 ) & ( X is empty & b1 = {} & b2 = {} implies b1 = b2 ) ); proof A1: ( not X is empty implies ex f being BinOp of (free_magma_carrier X) st for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) proof assume A2: not X is empty ; ::_thesis: ex f being BinOp of (free_magma_carrier X) st for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] defpred S1[ set , set , set ] means for n, m being Nat st n = \$1 `2 & m = \$2 `2 holds \$3 = [[[(\$1 `1),(\$2 `1)],(\$1 `2)],(n + m)]; reconsider Y = free_magma_carrier X as non empty set by A2; A3: for x, y being Element of Y ex z being Element of Y st S1[x,y,z] proof let x, y be Element of Y; ::_thesis: ex z being Element of Y st S1[x,y,z] reconsider X9 = X as non empty set by A2; reconsider v = x as Element of free_magma_carrier X9 ; reconsider w = y as Element of free_magma_carrier X9 ; reconsider z = [[[(v `1),(w `1)],(v `2)],((v `2) + (w `2))] as Element of Y by Th26; take z ; ::_thesis: S1[x,y,z] thus S1[x,y,z] ; ::_thesis: verum end; consider f being Function of [:Y,Y:],Y such that A4: for x, y being Element of Y holds S1[x,y,f . (x,y)] from BINOP_1:sch_3(A3); reconsider f = f as BinOp of (free_magma_carrier X) ; take f ; ::_thesis: for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] thus for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] by A4; ::_thesis: verum end; A5: ( X is empty implies ex f being BinOp of (free_magma_carrier X) st f = {} ) proof assume A6: X is empty ; ::_thesis: ex f being BinOp of (free_magma_carrier X) st f = {} then A7: free_magma_carrier X = {} ; {} c= [:{},{}:] by ZFMISC_1:90; then reconsider f = {} as Relation of [:{},{}:],{} by ZFMISC_1:90; ( ( [:{},{}:] = {} implies {} = {} ) & dom f = [:{},{}:] ) by ZFMISC_1:90; then reconsider f = {} as BinOp of {} by FUNCT_2:def_1; for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 & v in free_magma_carrier X & w in free_magma_carrier X holds f . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] by A6; hence ex f being BinOp of (free_magma_carrier X) st f = {} by A7; ::_thesis: verum end; now__::_thesis:_for_f1,_f2_being_BinOp_of_(free_magma_carrier_X)_holds_ (_(_not_X_is_empty_&_(_for_v,_w_being_Element_of_free_magma_carrier_X for_n,_m_being_Nat_st_n_=_v_`2_&_m_=_w_`2_holds_ f1_._(v,w)_=_[[[(v_`1),(w_`1)],(v_`2)],(n_+_m)]_)_&_(_for_v,_w_being_Element_of_free_magma_carrier_X for_n,_m_being_Nat_st_n_=_v_`2_&_m_=_w_`2_holds_ f2_._(v,w)_=_[[[(v_`1),(w_`1)],(v_`2)],(n_+_m)]_)_implies_f1_=_f2_)_&_(_X_is_empty_&_f1_=_{}_&_f2_=_{}_implies_(_(_for_b3_being_BinOp_of_(free_magma_carrier_X)_holds_verum_)_&_(_not_X_is_empty_implies_ex_b3_being_BinOp_of_(free_magma_carrier_X)_st_ for_v,_w_being_Element_of_free_magma_carrier_X for_n,_m_being_Nat_st_n_=_v_`2_&_m_=_w_`2_holds_ b3_._(v,w)_=_[[[(v_`1),(w_`1)],(v_`2)],(n_+_m)]_)_&_(_X_is_empty_implies_ex_b3_being_BinOp_of_(free_magma_carrier_X)_st_b3_=_{}_)_&_(_for_b3,_b4_being_BinOp_of_(free_magma_carrier_X)_holds_ (_(_not_X_is_empty_&_(_for_v,_w_being_Element_of_free_magma_carrier_X for_n,_m_being_Nat_st_n_=_v_`2_&_m_=_w_`2_holds_ b3_._(v,w)_=_[[[(v_`1),(w_`1)],(v_`2)],(n_+_m)]_)_&_(_for_v,_w_being_Element_of_free_magma_carrier_X for_n,_m_being_Nat_st_n_=_v_`2_&_m_=_w_`2_holds_ b4_._(v,w)_=_[[[(v_`1),(w_`1)],(v_`2)],(n_+_m)]_)_implies_b3_=_b4_)_&_(_X_is_empty_&_b3_=_{}_&_b4_=_{}_implies_b3_=_b4_)_)_)_)_)_) let f1, f2 be BinOp of (free_magma_carrier X); ::_thesis: ( ( not X is empty & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) implies f1 = f2 ) & ( X is empty & f1 = {} & f2 = {} implies ( ( for b1 being BinOp of (free_magma_carrier X) holds verum ) & ( not X is empty implies ex b1 being BinOp of (free_magma_carrier X) st for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( X is empty implies ex b1 being BinOp of (free_magma_carrier X) st b1 = {} ) & ( for b1, b2 being BinOp of (free_magma_carrier X) holds ( ( not X is empty & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) implies b1 = b2 ) & ( X is empty & b1 = {} & b2 = {} implies b1 = b2 ) ) ) ) ) ) thus ( not X is empty & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) implies f1 = f2 ) ::_thesis: ( X is empty & f1 = {} & f2 = {} implies ( ( for b1 being BinOp of (free_magma_carrier X) holds verum ) & ( not X is empty implies ex b1 being BinOp of (free_magma_carrier X) st for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( X is empty implies ex b1 being BinOp of (free_magma_carrier X) st b1 = {} ) & ( for b1, b2 being BinOp of (free_magma_carrier X) holds ( ( not X is empty & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) implies b1 = b2 ) & ( X is empty & b1 = {} & b2 = {} implies b1 = b2 ) ) ) ) ) proof assume A8: not X is empty ; ::_thesis: ( ex v, w being Element of free_magma_carrier X ex n, m being Nat st ( n = v `2 & m = w `2 & not f1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) or ex v, w being Element of free_magma_carrier X ex n, m being Nat st ( n = v `2 & m = w `2 & not f2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) or f1 = f2 ) assume A9: for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ; ::_thesis: ( ex v, w being Element of free_magma_carrier X ex n, m being Nat st ( n = v `2 & m = w `2 & not f2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) or f1 = f2 ) assume A10: for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds f2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ; ::_thesis: f1 = f2 for v, w being Element of free_magma_carrier X holds f1 . (v,w) = f2 . (v,w) proof let v, w be Element of free_magma_carrier X; ::_thesis: f1 . (v,w) = f2 . (v,w) set n = v `2 ; set m = w `2 ; reconsider n = v `2 , m = w `2 as Nat by A8; thus f1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] by A9 .= f2 . (v,w) by A10 ; ::_thesis: verum end; hence f1 = f2 by BINOP_1:2; ::_thesis: verum end; assume ( X is empty & f1 = {} & f2 = {} ) ; ::_thesis: ( ( for b1 being BinOp of (free_magma_carrier X) holds verum ) & ( not X is empty implies ex b1 being BinOp of (free_magma_carrier X) st for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( X is empty implies ex b1 being BinOp of (free_magma_carrier X) st b1 = {} ) & ( for b1, b2 being BinOp of (free_magma_carrier X) holds ( ( not X is empty & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) implies b1 = b2 ) & ( X is empty & b1 = {} & b2 = {} implies b1 = b2 ) ) ) ) hence ( ( for b1 being BinOp of (free_magma_carrier X) holds verum ) & ( not X is empty implies ex b1 being BinOp of (free_magma_carrier X) st for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( X is empty implies ex b1 being BinOp of (free_magma_carrier X) st b1 = {} ) & ( for b1, b2 being BinOp of (free_magma_carrier X) holds ( ( not X is empty & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) implies b1 = b2 ) & ( X is empty & b1 = {} & b2 = {} implies b1 = b2 ) ) ) ) ; ::_thesis: verum end; hence ( ( for b1 being BinOp of (free_magma_carrier X) holds verum ) & ( not X is empty implies ex b1 being BinOp of (free_magma_carrier X) st for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( X is empty implies ex b1 being BinOp of (free_magma_carrier X) st b1 = {} ) & ( for b1, b2 being BinOp of (free_magma_carrier X) holds ( ( not X is empty & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b1 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) & ( for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) implies b1 = b2 ) & ( X is empty & b1 = {} & b2 = {} implies b1 = b2 ) ) ) ) by A1, A5; ::_thesis: verum end; end; :: deftheorem Def16 defines free_magma_mult ALGSTR_4:def_16_:_ for X being set for b2 being BinOp of (free_magma_carrier X) holds ( ( not X is empty implies ( b2 = free_magma_mult X iff for v, w being Element of free_magma_carrier X for n, m being Nat st n = v `2 & m = w `2 holds b2 . (v,w) = [[[(v `1),(w `1)],(v `2)],(n + m)] ) ) & ( X is empty implies ( b2 = free_magma_mult X iff b2 = {} ) ) ); definition let X be set ; func free_magma X -> multMagma equals :: ALGSTR_4:def 17 multMagma(# (free_magma_carrier X),(free_magma_mult X) #); correctness coherence multMagma(# (free_magma_carrier X),(free_magma_mult X) #) is multMagma ; ; end; :: deftheorem defines free_magma ALGSTR_4:def_17_:_ for X being set holds free_magma X = multMagma(# (free_magma_carrier X),(free_magma_mult X) #); registration let X be set ; cluster free_magma X -> strict ; correctness coherence free_magma X is strict ; ; end; registration let X be empty set ; cluster free_magma X -> empty ; correctness coherence free_magma X is empty ; ; end; registration let X be non empty set ; cluster free_magma X -> non empty ; correctness coherence not free_magma X is empty ; ; let w be Element of (free_magma X); clusterw `2 -> non zero natural for number ; correctness coherence for b1 being number st b1 = w `2 holds ( not b1 is empty & b1 is natural ); ; end; theorem :: ALGSTR_4:29 for X being set for S being Subset of X holds free_magma S is multSubmagma of free_magma X proof let X be set ; ::_thesis: for S being Subset of X holds free_magma S is multSubmagma of free_magma X let S be Subset of X; ::_thesis: free_magma S is multSubmagma of free_magma X A1: the carrier of (free_magma S) c= the carrier of (free_magma X) by Th27; reconsider A = the carrier of (free_magma S) as set ; A2: the multF of (free_magma X) | [:A,A:] = the multF of (free_magma X) || the carrier of (free_magma S) by REALSET1:def_2; percases ( S is empty or not S is empty ) ; supposeA3: S is empty ; ::_thesis: free_magma S is multSubmagma of free_magma X then A4: the carrier of (free_magma S) = {} ; the multF of (free_magma S) = the multF of (free_magma X) | {} by A3 .= the multF of (free_magma X) | [:A,A:] by A4, ZFMISC_1:90 ; hence free_magma S is multSubmagma of free_magma X by A2, A1, Def9; ::_thesis: verum end; supposeA5: not S is empty ; ::_thesis: free_magma S is multSubmagma of free_magma X then A6: dom the multF of (free_magma S) = [:A,A:] by FUNCT_2:def_1; A7: not X is empty by A5; [:A,A:] c= [:(free_magma_carrier X),(free_magma_carrier X):] by A1, ZFMISC_1:96; then [:A,A:] c= dom the multF of (free_magma X) by A7, FUNCT_2:def_1; then A8: dom the multF of (free_magma S) = dom ( the multF of (free_magma X) || the carrier of (free_magma S)) by A6, A2, RELAT_1:62; for z being set st z in dom the multF of (free_magma S) holds the multF of (free_magma S) . z = ( the multF of (free_magma X) || the carrier of (free_magma S)) . z proof let z be set ; ::_thesis: ( z in dom the multF of (free_magma S) implies the multF of (free_magma S) . z = ( the multF of (free_magma X) || the carrier of (free_magma S)) . z ) assume A9: z in dom the multF of (free_magma S) ; ::_thesis: the multF of (free_magma S) . z = ( the multF of (free_magma X) || the carrier of (free_magma S)) . z then consider x, y being set such that A10: ( x in A & y in A & z = [x,y] ) by ZFMISC_1:def_2; reconsider x = x, y = y as Element of free_magma_carrier S by A10; reconsider n = x `2 , m = y `2 as Nat by A5; reconsider x9 = x, y9 = y as Element of free_magma_carrier X by A10, A1; the multF of (free_magma S) . z = the multF of (free_magma S) . (x,y) by A10, BINOP_1:def_1 .= [[[(x `1),(y `1)],(x `2)],(n + m)] by A5, Def16 .= (free_magma_mult X) . (x9,y9) by A7, Def16 .= the multF of (free_magma X) . z by A10, BINOP_1:def_1 .= ( the multF of (free_magma X) | [:A,A:]) . z by A9, FUNCT_1:49 ; hence the multF of (free_magma S) . z = ( the multF of (free_magma X) || the carrier of (free_magma S)) . z by REALSET1:def_2; ::_thesis: verum end; then the multF of (free_magma S) = the multF of (free_magma X) || the carrier of (free_magma S) by A8, FUNCT_1:2; hence free_magma S is multSubmagma of free_magma X by A1, Def9; ::_thesis: verum end; end; end; definition let X be set ; let w be Element of (free_magma X); func length w -> Nat equals :Def18: :: ALGSTR_4:def 18 w `2 if not X is empty otherwise 0 ; correctness coherence ( ( not X is empty implies w `2 is Nat ) & ( X is empty implies 0 is Nat ) ); consistency for b1 being Nat holds verum; ; end; :: deftheorem Def18 defines length ALGSTR_4:def_18_:_ for X being set for w being Element of (free_magma X) holds ( ( not X is empty implies length w = w `2 ) & ( X is empty implies length w = 0 ) ); theorem Th30: :: ALGSTR_4:30 for X being set holds X = { (w `1) where w is Element of (free_magma X) : length w = 1 } proof let X be set ; ::_thesis: X = { (w `1) where w is Element of (free_magma X) : length w = 1 } for x being set holds ( x in X iff x in { (w `1) where w is Element of (free_magma X) : length w = 1 } ) proof let x be set ; ::_thesis: ( x in X iff x in { (w `1) where w is Element of (free_magma X) : length w = 1 } ) hereby ::_thesis: ( x in { (w `1) where w is Element of (free_magma X) : length w = 1 } implies x in X ) assume A1: x in X ; ::_thesis: x in { (w `1) where w is Element of (free_magma X) : length w = 1 } then A2: x in free_magma (X,1) by Def13; 1 in {1} by TARSKI:def_1; then A3: [x,1] in [:(free_magma (X,1)),{1}:] by A2, ZFMISC_1:def_2; [:(free_magma (X,1)),{1}:] c= free_magma_carrier X by Lm1; then reconsider w9 = [x,1] as Element of (free_magma X) by A3; 1 = [x,1] `2 ; then A4: length w9 = 1 by A1, Def18; x = [x,1] `1 ; hence x in { (w `1) where w is Element of (free_magma X) : length w = 1 } by A4; ::_thesis: verum end; assume x in { (w `1) where w is Element of (free_magma X) : length w = 1 } ; ::_thesis: x in X then consider w being Element of (free_magma X) such that A5: ( x = w `1 & length w = 1 ) ; A6: w `2 = 1 by A5, Def18; percases ( not X is empty or X is empty ) ; suppose not X is empty ; ::_thesis: x in X then w in [:(free_magma (X,1)),{1}:] by A6, Th25; then w in [:X,{1}:] by Def13; hence x in X by A5, MCART_1:10; ::_thesis: verum end; suppose X is empty ; ::_thesis: x in X hence x in X by A5, Def18; ::_thesis: verum end; end; end; hence X = { (w `1) where w is Element of (free_magma X) : length w = 1 } by TARSKI:1; ::_thesis: verum end; theorem Th31: :: ALGSTR_4:31 for X being set for v, w being Element of (free_magma X) st not X is empty holds v * w = [[[(v `1),(w `1)],(v `2)],((length v) + (length w))] proof let X be set ; ::_thesis: for v, w being Element of (free_magma X) st not X is empty holds v * w = [[[(v `1),(w `1)],(v `2)],((length v) + (length w))] let v, w be Element of (free_magma X); ::_thesis: ( not X is empty implies v * w = [[[(v `1),(w `1)],(v `2)],((length v) + (length w))] ) assume A1: not X is empty ; ::_thesis: v * w = [[[(v `1),(w `1)],(v `2)],((length v) + (length w))] then ( length v = v `2 & length w = w `2 ) by Def18; hence v * w = [[[(v `1),(w `1)],(v `2)],((length v) + (length w))] by A1, Def16; ::_thesis: verum end; theorem Th32: :: ALGSTR_4:32 for X being set for v being Element of (free_magma X) st not X is empty holds ( v = [(v `1),(v `2)] & length v >= 1 ) proof let X be set ; ::_thesis: for v being Element of (free_magma X) st not X is empty holds ( v = [(v `1),(v `2)] & length v >= 1 ) let v be Element of (free_magma X); ::_thesis: ( not X is empty implies ( v = [(v `1),(v `2)] & length v >= 1 ) ) assume not X is empty ; ::_thesis: ( v = [(v `1),(v `2)] & length v >= 1 ) then reconsider X9 = X as non empty set ; reconsider v9 = v as Element of (free_magma X9) ; v9 in [:(free_magma (X,(v9 `2))),{(v9 `2)}:] by Th25; then ex x, y being set st ( x in free_magma (X,(v9 `2)) & y in {(v9 `2)} & v9 = [x,y] ) by ZFMISC_1:def_2; hence v = [(v `1),(v `2)] by MCART_1:8; ::_thesis: length v >= 1 reconsider v99 = v9 as Element of free_magma_carrier X9 ; v99 `2 > 0 ; then length v9 > 0 by Def18; then (length v9) + 1 > 0 + 1 by XREAL_1:6; hence length v >= 1 by NAT_1:13; ::_thesis: verum end; theorem :: ALGSTR_4:33 for X being set for v, w being Element of (free_magma X) holds length (v * w) = (length v) + (length w) proof let X be set ; ::_thesis: for v, w being Element of (free_magma X) holds length (v * w) = (length v) + (length w) let v, w be Element of (free_magma X); ::_thesis: length (v * w) = (length v) + (length w) set vw = v * w; percases ( not X is empty or X is empty ) ; supposeA1: not X is empty ; ::_thesis: length (v * w) = (length v) + (length w) then v * w = [[[(v `1),(w `1)],(v `2)],((length v) + (length w))] by Th31; hence length (v * w) = [[[(v `1),(w `1)],(v `2)],((length v) + (length w))] `2 by A1, Def18 .= (length v) + (length w) ; ::_thesis: verum end; supposeA2: X is empty ; ::_thesis: length (v * w) = (length v) + (length w) hence length (v * w) = 0 by Def18 .= (length v) + 0 by A2, Def18 .= (length v) + (length w) by A2, Def18 ; ::_thesis: verum end; end; end; theorem Th34: :: ALGSTR_4:34 for X being set for w being Element of (free_magma X) st length w >= 2 holds ex w1, w2 being Element of (free_magma X) st ( w = w1 * w2 & length w1 < length w & length w2 < length w ) proof let X be set ; ::_thesis: for w being Element of (free_magma X) st length w >= 2 holds ex w1, w2 being Element of (free_magma X) st ( w = w1 * w2 & length w1 < length w & length w2 < length w ) let w be Element of (free_magma X); ::_thesis: ( length w >= 2 implies ex w1, w2 being Element of (free_magma X) st ( w = w1 * w2 & length w1 < length w & length w2 < length w ) ) assume A1: length w >= 2 ; ::_thesis: ex w1, w2 being Element of (free_magma X) st ( w = w1 * w2 & length w1 < length w & length w2 < length w ) then reconsider X9 = X as non empty set by Def18; reconsider w9 = w as Element of (free_magma X9) ; A2: w9 in [:(free_magma (X,(w9 `2))),{(w9 `2)}:] by Th25; set n = length w; A3: length w = w9 `2 by Def18; consider fs being FinSequence such that A4: len fs = (length w) - 1 and A5: for p being Nat st p >= 1 & p <= (length w) - 1 holds fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . ((length w) - p)):] and A6: (free_magma_seq X) . (length w) = Union (disjoin fs) by A1, Def13; w9 `1 in (free_magma_seq X) . (length w) by A3, A2, MCART_1:10; then w9 `1 in union (rng (disjoin fs)) by A6, CARD_3:def_4; then consider Y being set such that A7: ( w9 `1 in Y & Y in rng (disjoin fs) ) by TARSKI:def_4; consider p being set such that A8: ( p in dom (disjoin fs) & Y = (disjoin fs) . p ) by A7, FUNCT_1:def_3; A9: p in dom fs by A8, CARD_3:def_3; then reconsider p = p as Nat ; A10: p in Seg (len fs) by A9, FINSEQ_1:def_3; then A11: ( 1 <= p & p <= len fs ) by FINSEQ_1:1; then fs . p = [:((free_magma_seq X) . p),((free_magma_seq X) . ((length w) - p)):] by A4, A5; then A12: w9 `1 in [:[:((free_magma_seq X) . p),((free_magma_seq X) . ((length w) - p)):],{p}:] by A7, A8, A9, CARD_3:def_3; then A13: ( (w9 `1) `1 in [:((free_magma_seq X) . p),((free_magma_seq X) . ((length w) - p)):] & (w9 `1) `2 in {p} ) by MCART_1:10; then A14: ( ((w9 `1) `1) `1 in (free_magma_seq X) . p & ((w9 `1) `1) `2 in (free_magma_seq X) . ((length w) - p) ) by MCART_1:10; - p >= - ((length w) - 1) by A11, A4, XREAL_1:24; then A15: (- p) + (length w) >= (- ((length w) - 1)) + (length w) by XREAL_1:7; then (length w) - p in NAT by INT_1:3; then reconsider m = (length w) - p as Nat ; set w19 = [(((w9 `1) `1) `1),p]; set w29 = [(((w9 `1) `1) `2),m]; p in {p} by TARSKI:def_1; then A16: [(((w9 `1) `1) `1),p] in [:(free_magma (X,p)),{p}:] by A14, ZFMISC_1:def_2; m in {m} by TARSKI:def_1; then A17: [(((w9 `1) `1) `2),m] in [:(free_magma (X,m)),{m}:] by A14, ZFMISC_1:def_2; [:(free_magma (X,p)),{p}:] c= free_magma_carrier X by A11, Lm1; then reconsider w19 = [(((w9 `1) `1) `1),p] as Element of free_magma_carrier X by A16; [:(free_magma (X,m)),{m}:] c= free_magma_carrier X by A15, Lm1; then reconsider w29 = [(((w9 `1) `1) `2),m] as Element of free_magma_carrier X by A17; reconsider w1 = w19, w2 = w29 as Element of (free_magma X) ; A18: [(((w9 `1) `1) `1),p] `2 = p ; A19: length w1 = [(((w9 `1) `1) `1),p] `2 by Def18 .= p ; A20: length w2 = [(((w9 `1) `1) `2),m] `2 by Def18 .= m ; A21: [(((w9 `1) `1) `1),p] `1 = ((w9 `1) `1) `1 ; A22: [(((w9 `1) `1) `2),m] `1 = ((w9 `1) `1) `2 ; ex x, y being set st ( x in [:((free_magma_seq X) . p),((free_magma_seq X) . ((length w) - p)):] & y in {p} & w9 `1 = [x,y] ) by A12, ZFMISC_1:def_2; then A23: w9 `1 = [((w9 `1) `1),((w9 `1) `2)] by MCART_1:8 .= [((w9 `1) `1),p] by A13, TARSKI:def_1 ; A24: ex x, y being set st ( x in (free_magma_seq X) . p & y in (free_magma_seq X) . ((length w) - p) & (w9 `1) `1 = [x,y] ) by A13, ZFMISC_1:def_2; take w1 ; ::_thesis: ex w2 being Element of (free_magma X) st ( w = w1 * w2 & length w1 < length w & length w2 < length w ) take w2 ; ::_thesis: ( w = w1 * w2 & length w1 < length w & length w2 < length w ) ex x, y being set st ( x in free_magma (X,(w9 `2)) & y in {(w9 `2)} & w9 = [x,y] ) by A2, ZFMISC_1:def_2; hence w = [(w9 `1),(w9 `2)] by MCART_1:8 .= [[((w9 `1) `1),p],(length w)] by A23, Def18 .= [[((w9 `1) `1),(w1 `2)],((length w1) + (length w2))] by A19, A20, A18 .= [[[(((w9 `1) `1) `1),(((w9 `1) `1) `2)],(w1 `2)],((length w1) + (length w2))] by A24, MCART_1:8 .= [[[(((w9 `1) `1) `1),(w2 `1)],(w1 `2)],((length w1) + (length w2))] by A22 .= [[[(w1 `1),(w2 `1)],(w1 `2)],((length w1) + (length w2))] by A21 .= w1 * w2 by Th31 ; ::_thesis: ( length w1 < length w & length w2 < length w ) p <= (length w) - 1 by A10, A4, FINSEQ_1:1; then p + 1 <= ((length w) - 1) + 1 by XREAL_1:7; hence length w1 < length w by A19, NAT_1:13; ::_thesis: length w2 < length w - 1 >= - p by A11, XREAL_1:24; then (- 1) + ((length w) + 1) >= (- p) + ((length w) + 1) by XREAL_1:7; then length w >= m + 1 ; hence length w2 < length w by A20, NAT_1:13; ::_thesis: verum end; theorem :: ALGSTR_4:35 for X being set for v1, v2, w1, w2 being Element of (free_magma X) st v1 * v2 = w1 * w2 holds ( v1 = w1 & v2 = w2 ) proof let X be set ; ::_thesis: for v1, v2, w1, w2 being Element of (free_magma X) st v1 * v2 = w1 * w2 holds ( v1 = w1 & v2 = w2 ) let v1, v2, w1, w2 be Element of (free_magma X); ::_thesis: ( v1 * v2 = w1 * w2 implies ( v1 = w1 & v2 = w2 ) ) assume A1: v1 * v2 = w1 * w2 ; ::_thesis: ( v1 = w1 & v2 = w2 ) percases ( not X is empty or X is empty ) ; supposeA2: not X is empty ; ::_thesis: ( v1 = w1 & v2 = w2 ) then ( v1 * v2 = [[[(v1 `1),(v2 `1)],(v1 `2)],((length v1) + (length v2))] & w1 * w2 = [[[(w1 `1),(w2 `1)],(w1 `2)],((length w1) + (length w2))] ) by Th31; then A3: ( [[(v1 `1),(v2 `1)],(v1 `2)] = [[(w1 `1),(w2 `1)],(w1 `2)] & (length v1) + (length v2) = (length w1) + (length w2) ) by A1, XTUPLE_0:1; then A4: ( [(v1 `1),(v2 `1)] = [(w1 `1),(w2 `1)] & v1 `2 = w1 `2 ) by XTUPLE_0:1; length v1 = v1 `2 by A2, Def18 .= length w1 by A2, A4, Def18 ; then v2 `2 = length w2 by A2, A3, Def18; then A5: v2 `2 = w2 `2 by A2, Def18; thus v1 = [(v1 `1),(v1 `2)] by A2, Th32 .= [(w1 `1),(w1 `2)] by A4, XTUPLE_0:1 .= w1 by A2, Th32 ; ::_thesis: v2 = w2 thus v2 = [(v2 `1),(v2 `2)] by A2, Th32 .= [(w2 `1),(w2 `2)] by A5, A4, XTUPLE_0:1 .= w2 by A2, Th32 ; ::_thesis: verum end; suppose X is empty ; ::_thesis: ( v1 = w1 & v2 = w2 ) then ( v1 = {} & w1 = {} & v2 = {} & w2 = {} ) by SUBSET_1:def_1; hence ( v1 = w1 & v2 = w2 ) ; ::_thesis: verum end; end; end; definition let X be set ; let n be Nat; func canon_image (X,n) -> Function of (free_magma (X,n)),(free_magma X) means :Def19: :: ALGSTR_4:def 19 for x being set st x in dom it holds it . x = [x,n] if n > 0 otherwise it = {} ; correctness consistency for b1 being Function of (free_magma (X,n)),(free_magma X) holds verum; existence ( ( for b1 being Function of (free_magma (X,n)),(free_magma X) holds verum ) & ( n > 0 implies ex b1 being Function of (free_magma (X,n)),(free_magma X) st for x being set st x in dom b1 holds b1 . x = [x,n] ) & ( not n > 0 implies ex b1 being Function of (free_magma (X,n)),(free_magma X) st b1 = {} ) ); uniqueness for b1, b2 being Function of (free_magma (X,n)),(free_magma X) holds ( ( n > 0 & ( for x being set st x in dom b1 holds b1 . x = [x,n] ) & ( for x being set st x in dom b2 holds b2 . x = [x,n] ) implies b1 = b2 ) & ( not n > 0 & b1 = {} & b2 = {} implies b1 = b2 ) ); proof A1: ( n > 0 implies ex f being Function of (free_magma (X,n)),(free_magma X) st for x being set st x in dom f holds f . x = [x,n] ) proof assume A2: n > 0 ; ::_thesis: ex f being Function of (free_magma (X,n)),(free_magma X) st for x being set st x in dom f holds f . x = [x,n] deffunc H1( set ) -> set = [\$1,n]; A3: for x being set st x in free_magma (X,n) holds H1(x) in the carrier of (free_magma X) proof let x be set ; ::_thesis: ( x in free_magma (X,n) implies H1(x) in the carrier of (free_magma X) ) assume A4: x in free_magma (X,n) ; ::_thesis: H1(x) in the carrier of (free_magma X) n in {n} by TARSKI:def_1; then A5: H1(x) in [:(free_magma (X,n)),{n}:] by A4, ZFMISC_1:def_2; [:(free_magma (X,n)),{n}:] c= free_magma_carrier X by A2, Lm1; hence H1(x) in the carrier of (free_magma X) by A5; ::_thesis: verum end; consider f being Function of (free_magma (X,n)), the carrier of (free_magma X) such that A6: for x being set st x in free_magma (X,n) holds f . x = H1(x) from FUNCT_2:sch_2(A3); take f ; ::_thesis: for x being set st x in dom f holds f . x = [x,n] let x be set ; ::_thesis: ( x in dom f implies f . x = [x,n] ) assume x in dom f ; ::_thesis: f . x = [x,n] hence f . x = [x,n] by A6; ::_thesis: verum end; A7: ( not n > 0 implies ex f being Function of (free_magma (X,n)),(free_magma X) st f = {} ) proof assume not n > 0 ; ::_thesis: ex f being Function of (free_magma (X,n)),(free_magma X) st f = {} then n = 0 ; then A8: free_magma (X,n) = {} by Def13; set f = {} ; A9: dom {} = {} ; rng {} c= the carrier of (free_magma X) by XBOOLE_1:2; then reconsider f = {} as Function of (free_magma (X,n)),(free_magma X) by A8, A9, FUNCT_2:2; take f ; ::_thesis: f = {} thus f = {} ; ::_thesis: verum end; for f1, f2 being Function of (free_magma (X,n)),(free_magma X) st n > 0 & ( for x being set st x in dom f1 holds f1 . x = [x,n] ) & ( for x being set st x in dom f2 holds f2 . x = [x,n] ) holds f1 = f2 proof let f1, f2 be Function of (free_magma (X,n)),(free_magma X); ::_thesis: ( n > 0 & ( for x being set st x in dom f1 holds f1 . x = [x,n] ) & ( for x being set st x in dom f2 holds f2 . x = [x,n] ) implies f1 = f2 ) assume n > 0 ; ::_thesis: ( ex x being set st ( x in dom f1 & not f1 . x = [x,n] ) or ex x being set st ( x in dom f2 & not f2 . x = [x,n] ) or f1 = f2 ) assume A10: for x being set st x in dom f1 holds f1 . x = [x,n] ; ::_thesis: ( ex x being set st ( x in dom f2 & not f2 . x = [x,n] ) or f1 = f2 ) assume A11: for x being set st x in dom f2 holds f2 . x = [x,n] ; ::_thesis: f1 = f2 percases ( X is empty or not X is empty ) ; suppose X is empty ; ::_thesis: f1 = f2 hence f1 = f2 ; ::_thesis: verum end; supposeA12: not X is empty ; ::_thesis: f1 = f2 then A13: dom f1 = free_magma (X,n) by FUNCT_2:def_1 .= dom f2 by A12, FUNCT_2:def_1 ; for x being set st x in dom f1 holds f1 . x = f2 . x proof let x be set ; ::_thesis: ( x in dom f1 implies f1 . x = f2 . x ) assume A14: x in dom f1 ; ::_thesis: f1 . x = f2 . x hence f1 . x = [x,n] by A10 .= f2 . x by A11, A13, A14 ; ::_thesis: verum end; hence f1 = f2 by A13, FUNCT_1:2; ::_thesis: verum end; end; end; hence ( ( for b1 being Function of (free_magma (X,n)),(free_magma X) holds verum ) & ( n > 0 implies ex b1 being Function of (free_magma (X,n)),(free_magma X) st for x being set st x in dom b1 holds b1 . x = [x,n] ) & ( not n > 0 implies ex b1 being Function of (free_magma (X,n)),(free_magma X) st b1 = {} ) & ( for b1, b2 being Function of (free_magma (X,n)),(free_magma X) holds ( ( n > 0 & ( for x being set st x in dom b1 holds b1 . x = [x,n] ) & ( for x being set st x in dom b2 holds b2 . x = [x,n] ) implies b1 = b2 ) & ( not n > 0 & b1 = {} & b2 = {} implies b1 = b2 ) ) ) ) by A1, A7; ::_thesis: verum end; end; :: deftheorem Def19 defines canon_image ALGSTR_4:def_19_:_ for X being set for n being Nat for b3 being Function of (free_magma (X,n)),(free_magma X) holds ( ( n > 0 implies ( b3 = canon_image (X,n) iff for x being set st x in dom b3 holds b3 . x = [x,n] ) ) & ( not n > 0 implies ( b3 = canon_image (X,n) iff b3 = {} ) ) ); Lm2: for X being set for n being Nat holds canon_image (X,n) is one-to-one proof let X be set ; ::_thesis: for n being Nat holds canon_image (X,n) is one-to-one let n be Nat; ::_thesis: canon_image (X,n) is one-to-one for x1, x2 being set st x1 in dom (canon_image (X,n)) & x2 in dom (canon_image (X,n)) & (canon_image (X,n)) . x1 = (canon_image (X,n)) . x2 holds x1 = x2 proof let x1, x2 be set ; ::_thesis: ( x1 in dom (canon_image (X,n)) & x2 in dom (canon_image (X,n)) & (canon_image (X,n)) . x1 = (canon_image (X,n)) . x2 implies x1 = x2 ) assume A1: ( x1 in dom (canon_image (X,n)) & x2 in dom (canon_image (X,n)) ) ; ::_thesis: ( not (canon_image (X,n)) . x1 = (canon_image (X,n)) . x2 or x1 = x2 ) assume A2: (canon_image (X,n)) . x1 = (canon_image (X,n)) . x2 ; ::_thesis: x1 = x2 percases ( n > 0 or not n > 0 ) ; suppose n > 0 ; ::_thesis: x1 = x2 then ( (canon_image (X,n)) . x1 = [x1,n] & (canon_image (X,n)) . x2 = [x2,n] ) by A1, Def19; hence x1 = x2 by A2, XTUPLE_0:1; ::_thesis: verum end; suppose not n > 0 ; ::_thesis: x1 = x2 then canon_image (X,n) = {} by Def19; hence x1 = x2 by A1; ::_thesis: verum end; end; end; hence canon_image (X,n) is one-to-one by FUNCT_1:def_4; ::_thesis: verum end; registration let X be set ; let n be Nat; cluster canon_image (X,n) -> one-to-one ; correctness coherence canon_image (X,n) is one-to-one ; by Lm2; end; Lm3: for X being non empty set holds ( dom (canon_image (X,1)) = X & ( for x being set st x in X holds (canon_image (X,1)) . x = [x,1] ) ) proof let X be non empty set ; ::_thesis: ( dom (canon_image (X,1)) = X & ( for x being set st x in X holds (canon_image (X,1)) . x = [x,1] ) ) dom (canon_image (X,1)) = free_magma (X,1) by FUNCT_2:def_1; hence dom (canon_image (X,1)) = X by Def13; ::_thesis: for x being set st x in X holds (canon_image (X,1)) . x = [x,1] hence for x being set st x in X holds (canon_image (X,1)) . x = [x,1] by Def19; ::_thesis: verum end; theorem Th36: :: ALGSTR_4:36 for X being non empty set for A being Subset of (free_magma X) st A = (canon_image (X,1)) .: X holds free_magma X = the_submagma_generated_by A proof let X be non empty set ; ::_thesis: for A being Subset of (free_magma X) st A = (canon_image (X,1)) .: X holds free_magma X = the_submagma_generated_by A let A be Subset of (free_magma X); ::_thesis: ( A = (canon_image (X,1)) .: X implies free_magma X = the_submagma_generated_by A ) set N = the_submagma_generated_by A; assume A1: A = (canon_image (X,1)) .: X ; ::_thesis: free_magma X = the_submagma_generated_by A percases ( A is empty or not A is empty ) ; supposeA2: A is empty ; ::_thesis: free_magma X = the_submagma_generated_by A X is empty proof assume not X is empty ; ::_thesis: contradiction consider x being set such that A3: x in X by XBOOLE_0:def_1; x in dom (canon_image (X,1)) by Lm3, A3; then (canon_image (X,1)) . x in (canon_image (X,1)) .: X by A3, FUNCT_1:def_6; hence contradiction by A2, A1; ::_thesis: verum end; hence free_magma X = the_submagma_generated_by A ; ::_thesis: verum end; supposeA4: not A is empty ; ::_thesis: free_magma X = the_submagma_generated_by A A5: the carrier of (the_submagma_generated_by A) c= the carrier of (free_magma X) by Def9; for x being set st x in the carrier of (free_magma X) holds x in the carrier of (the_submagma_generated_by A) proof let x be set ; ::_thesis: ( x in the carrier of (free_magma X) implies x in the carrier of (the_submagma_generated_by A) ) assume A6: x in the carrier of (free_magma X) ; ::_thesis: x in the carrier of (the_submagma_generated_by A) defpred S1[ Nat] means for v being Element of (free_magma X) st length v = \$1 holds v in the carrier of (the_submagma_generated_by A); A7: for k being Nat st ( for n being Nat st n < k holds S1[n] ) holds S1[k] proof let k be Nat; ::_thesis: ( ( for n being Nat st n < k holds S1[n] ) implies S1[k] ) assume A8: for n being Nat st n < k holds S1[n] ; ::_thesis: S1[k] ( k = 0 or k + 1 > 0 + 1 ) by XREAL_1:6; then ( k = 0 or k >= 1 ) by NAT_1:13; then ( k = 0 or k = 1 or k > 1 ) by XXREAL_0:1; then A9: ( k = 0 or k = 1 or k + 1 > 1 + 1 ) by XREAL_1:6; percases ( k = 0 or k = 1 or k >= 2 ) by A9, NAT_1:13; suppose k = 0 ; ::_thesis: S1[k] hence S1[k] by Th32; ::_thesis: verum end; supposeA10: k = 1 ; ::_thesis: S1[k] for v being Element of (free_magma X) st length v = 1 holds v in the carrier of (the_submagma_generated_by A) proof let v be Element of (free_magma X); ::_thesis: ( length v = 1 implies v in the carrier of (the_submagma_generated_by A) ) assume A11: length v = 1 ; ::_thesis: v in the carrier of (the_submagma_generated_by A) A12: v = [(v `1),(v `2)] by Th32 .= [(v `1),1] by A11, Def18 ; v `1 in { (w `1) where w is Element of (free_magma X) : length w = 1 } by A11; then v `1 in X by Th30; then ( v `1 in dom (canon_image (X,1)) & v `1 in X & v = (canon_image (X,1)) . (v `1) ) by A12, Lm3; then A13: v in A by A1, FUNCT_1:def_6; A c= the carrier of (the_submagma_generated_by A) by Def12; hence v in the carrier of (the_submagma_generated_by A) by A13; ::_thesis: verum end; hence S1[k] by A10; ::_thesis: verum end; supposeA14: k >= 2 ; ::_thesis: S1[k] for v being Element of (free_magma X) st length v = k holds v in the carrier of (the_submagma_generated_by A) proof let v be Element of (free_magma X); ::_thesis: ( length v = k implies v in the carrier of (the_submagma_generated_by A) ) assume A15: length v = k ; ::_thesis: v in the carrier of (the_submagma_generated_by A) then consider v1, v2 being Element of (free_magma X) such that A16: ( v = v1 * v2 & length v1 < length v & length v2 < length v ) by A14, Th34; A17: v1 in the carrier of (the_submagma_generated_by A) by A8, A15, A16; reconsider v19 = v1 as Element of (the_submagma_generated_by A) by A8, A15, A16; A18: v2 in the carrier of (the_submagma_generated_by A) by A8, A15, A16; reconsider v29 = v2 as Element of (the_submagma_generated_by A) by A8, A15, A16; not the_submagma_generated_by A is empty by A4, Th14; then A19: the carrier of (the_submagma_generated_by A) <> {} ; A20: [v1,v2] in [: the carrier of (the_submagma_generated_by A), the carrier of (the_submagma_generated_by A):] by A17, A18, ZFMISC_1:87; v19 * v29 = the multF of (the_submagma_generated_by A) . [v19,v29] by BINOP_1:def_1 .= ( the multF of (free_magma X) || the carrier of (the_submagma_generated_by A)) . [v1,v2] by Def9 .= ( the multF of (free_magma X) | [: the carrier of (the_submagma_generated_by A), the carrier of (the_submagma_generated_by A):]) . [v1,v2] by REALSET1:def_2 .= the multF of (free_magma X) . [v1,v2] by A20, FUNCT_1:49 .= v1 * v2 by BINOP_1:def_1 ; hence v in the carrier of (the_submagma_generated_by A) by A16, A19; ::_thesis: verum end; hence S1[k] ; ::_thesis: verum end; end; end; A21: for n being Nat holds S1[n] from NAT_1:sch_4(A7); reconsider v = x as Element of (free_magma X) by A6; reconsider k = length v as Nat ; S1[k] by A21; hence x in the carrier of (the_submagma_generated_by A) ; ::_thesis: verum end; then the carrier of (free_magma X) c= the carrier of (the_submagma_generated_by A) by TARSKI:def_3; then the carrier of (free_magma X) = the carrier of (the_submagma_generated_by A) by A5, XBOOLE_0:def_10; hence free_magma X = the_submagma_generated_by A by Th7; ::_thesis: verum end; end; end; theorem :: ALGSTR_4:37 for X being non empty set for R being compatible Equivalence_Relation of (free_magma X) holds (free_magma X) ./. R = the_submagma_generated_by ((nat_hom R) .: ((canon_image (X,1)) .: X)) proof let X be non empty set ; ::_thesis: for R being compatible Equivalence_Relation of (free_magma X) holds (free_magma X) ./. R = the_submagma_generated_by ((nat_hom R) .: ((canon_image (X,1)) .: X)) let R be compatible Equivalence_Relation of (free_magma X); ::_thesis: (free_magma X) ./. R = the_submagma_generated_by ((nat_hom R) .: ((canon_image (X,1)) .: X)) set A = (canon_image (X,1)) .: X; reconsider A = (canon_image (X,1)) .: X as Subset of (free_magma X) ; A1: the carrier of (the_submagma_generated_by A) = the carrier of (free_magma X) by Th36; the carrier of ((free_magma X) ./. R) = rng (nat_hom R) by FUNCT_2:def_3; then the carrier of ((free_magma X) ./. R) = (nat_hom R) .: (dom (nat_hom R)) by RELAT_1:113; then the carrier of ((free_magma X) ./. R) = (nat_hom R) .: the carrier of (the_submagma_generated_by A) by A1, FUNCT_2:def_1; then the carrier of ((free_magma X) ./. R) = the carrier of (the_submagma_generated_by ((nat_hom R) .: A)) by Th15; hence (free_magma X) ./. R = the_submagma_generated_by ((nat_hom R) .: ((canon_image (X,1)) .: X)) by Th7; ::_thesis: verum end; theorem Th38: :: ALGSTR_4:38 for X, Y being non empty set for f being Function of X,Y holds (canon_image (Y,1)) * f is Function of X,(free_magma Y) proof let X, Y be non empty set ; ::_thesis: for f being Function of X,Y holds (canon_image (Y,1)) * f is Function of X,(free_magma Y) let f be Function of X,Y; ::_thesis: (canon_image (Y,1)) * f is Function of X,(free_magma Y) A1: dom f = X by FUNCT_2:def_1; dom (canon_image (Y,1)) = Y by Lm3; then rng f c= dom (canon_image (Y,1)) ; then A2: dom ((canon_image (Y,1)) * f) = X by A1, RELAT_1:27; rng ((canon_image (Y,1)) * f) c= rng (canon_image (Y,1)) by RELAT_1:26; hence (canon_image (Y,1)) * f is Function of X,(free_magma Y) by A2, FUNCT_2:2; ::_thesis: verum end; definition let X be non empty set ; let M be non empty multMagma ; let n, m be non zero Nat; let f be Function of (free_magma (X,n)),M; let g be Function of (free_magma (X,m)),M; func[:f,g:] -> Function of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:],M means :Def20: :: ALGSTR_4:def 20 for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds it . x = (f . y) * (g . z); existence ex b1 being Function of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:],M st for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds b1 . x = (f . y) * (g . z) proof set X1 = [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:]; defpred S1[ set , set ] means for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st \$1 = x & y = (x `1) `1 & z = (x `1) `2 holds \$2 = (f . y) * (g . z); A1: for x being set st x in [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] holds ex y being set st ( y in the carrier of M & S1[x,y] ) proof let x be set ; ::_thesis: ( x in [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] implies ex y being set st ( y in the carrier of M & S1[x,y] ) ) assume x in [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] ; ::_thesis: ex y being set st ( y in the carrier of M & S1[x,y] ) then A2: x `1 in [:(free_magma (X,n)),(free_magma (X,m)):] by MCART_1:10; then reconsider x1 = (x `1) `1 as Element of free_magma (X,n) by MCART_1:10; reconsider x2 = (x `1) `2 as Element of free_magma (X,m) by A2, MCART_1:10; set y = (f . x1) * (g . x2); take (f . x1) * (g . x2) ; ::_thesis: ( (f . x1) * (g . x2) in the carrier of M & S1[x,(f . x1) * (g . x2)] ) thus (f . x1) * (g . x2) in the carrier of M ; ::_thesis: S1[x,(f . x1) * (g . x2)] thus S1[x,(f . x1) * (g . x2)] ; ::_thesis: verum end; consider h being Function of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:], the carrier of M such that A3: for x being set st x in [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] holds S1[x,h . x] from FUNCT_2:sch_1(A1); take h ; ::_thesis: for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds h . x = (f . y) * (g . z) thus for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds h . x = (f . y) * (g . z) by A3; ::_thesis: verum end; uniqueness for b1, b2 being Function of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:],M st ( for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds b1 . x = (f . y) * (g . z) ) & ( for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds b2 . x = (f . y) * (g . z) ) holds b1 = b2 proof let f1, f2 be Function of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:],M; ::_thesis: ( ( for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds f1 . x = (f . y) * (g . z) ) & ( for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds f2 . x = (f . y) * (g . z) ) implies f1 = f2 ) assume A4: for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds f1 . x = (f . y) * (g . z) ; ::_thesis: ( ex x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] ex y being Element of free_magma (X,n) ex z being Element of free_magma (X,m) st ( y = (x `1) `1 & z = (x `1) `2 & not f2 . x = (f . y) * (g . z) ) or f1 = f2 ) assume A5: for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds f2 . x = (f . y) * (g . z) ; ::_thesis: f1 = f2 for x being set st x in [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] holds f1 . x = f2 . x proof let x be set ; ::_thesis: ( x in [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] implies f1 . x = f2 . x ) assume x in [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] ; ::_thesis: f1 . x = f2 . x then reconsider x9 = x as Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] ; A6: x9 `1 in [:(free_magma (X,n)),(free_magma (X,m)):] by MCART_1:10; then reconsider x1 = (x9 `1) `1 as Element of free_magma (X,n) by MCART_1:10; reconsider x2 = (x9 `1) `2 as Element of free_magma (X,m) by A6, MCART_1:10; thus f1 . x = (f . x1) * (g . x2) by A4 .= f2 . x by A5 ; ::_thesis: verum end; hence f1 = f2 by FUNCT_2:12; ::_thesis: verum end; end; :: deftheorem Def20 defines [: ALGSTR_4:def_20_:_ for X being non empty set for M being non empty multMagma for n, m being non zero Nat for f being Function of (free_magma (X,n)),M for g being Function of (free_magma (X,m)),M for b7 being Function of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:],M holds ( b7 = [:f,g:] iff for x being Element of [:[:(free_magma (X,n)),(free_magma (X,m)):],{n}:] for y being Element of free_magma (X,n) for z being Element of free_magma (X,m) st y = (x `1) `1 & z = (x `1) `2 holds b7 . x = (f . y) * (g . z) ); theorem Th39: :: ALGSTR_4:39 for X being non empty set for M being non empty multMagma for f being Function of X,M ex h being Function of (free_magma X),M st ( h is multiplicative & h extends f * ((canon_image (X,1)) ") ) proof let X be non empty set ; ::_thesis: for M being non empty multMagma for f being Function of X,M ex h being Function of (free_magma X),M st ( h is multiplicative & h extends f * ((canon_image (X,1)) ") ) let M be non empty multMagma ; ::_thesis: for f being Function of X,M ex h being Function of (free_magma X),M st ( h is multiplicative & h extends f * ((canon_image (X,1)) ") ) let f be Function of X,M; ::_thesis: ex h being Function of (free_magma X),M st ( h is multiplicative & h extends f * ((canon_image (X,1)) ") ) defpred S1[ set , set ] means ex n being Nat st ( n = \$1 & \$2 = Funcs ((free_magma (X,n)), the carrier of M) ); A1: for x being set st x in NAT holds ex y being set st S1[x,y] proof let x be set ; ::_thesis: ( x in NAT implies ex y being set st S1[x,y] ) assume x in NAT ; ::_thesis: ex y being set st S1[x,y] then reconsider n = x as Nat ; set y = Funcs ((free_magma (X,n)), the carrier of M); take Funcs ((free_magma (X,n)), the carrier of M) ; ::_thesis: S1[x, Funcs ((free_magma (X,n)), the carrier of M)] thus S1[x, Funcs ((free_magma (X,n)), the carrier of M)] ; ::_thesis: verum end; consider F1 being Function such that A2: ( dom F1 = NAT & ( for x being set st x in NAT holds S1[x,F1 . x] ) ) from CLASSES1:sch_1(A1); A3: f in Funcs (X, the carrier of M) by FUNCT_2:8; S1[1,F1 . 1] by A2; then F1 . 1 = Funcs (X, the carrier of M) by Def13; then Funcs (X, the carrier of M) in rng F1 by A2, FUNCT_1:3; then A4: f in union (rng F1) by A3, TARSKI:def_4; then A5: f in Union F1 by CARD_3:def_4; reconsider X1 = Union F1 as non empty set by A4, CARD_3:def_4; defpred S2[ set , set ] means for fs being XFinSequence of st \$1 = fs holds ( ( ( for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M ) implies ( ( dom fs = 0 implies \$2 = {} ) & ( dom fs = 1 implies \$2 = f ) & ( for n being Nat st n >= 2 & dom fs = n holds ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & \$2 = Union fs1 ) ) ) ) & ( ex m being non zero Nat st ( m in dom fs & fs . m is not Function of (free_magma (X,m)),M ) implies \$2 = f ) ); A6: for e being set st e in X1 ^omega holds ex u being set st S2[e,u] proof let e be set ; ::_thesis: ( e in X1 ^omega implies ex u being set st S2[e,u] ) assume e in X1 ^omega ; ::_thesis: ex u being set st S2[e,u] then reconsider fs = e as XFinSequence of by AFINSQ_1:def_7; percases ( for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M or ex m being non zero Nat st ( m in dom fs & fs . m is not Function of (free_magma (X,m)),M ) ) ; supposeA7: for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M ; ::_thesis: ex u being set st S2[e,u] ( dom fs = 0 or (dom fs) + 1 > 0 + 1 ) by XREAL_1:6; then ( dom fs = 0 or dom fs >= 1 ) by NAT_1:13; then ( dom fs = 0 or dom fs = 1 or dom fs > 1 ) by XXREAL_0:1; then A8: ( dom fs = 0 or dom fs = 1 or (dom fs) + 1 > 1 + 1 ) by XREAL_1:6; percases ( dom fs = 0 or dom fs = 1 or dom fs >= 2 ) by A8, NAT_1:13; supposeA9: dom fs = 0 ; ::_thesis: ex u being set st S2[e,u] set u = {} ; take {} ; ::_thesis: S2[e, {} ] thus S2[e, {} ] by A9; ::_thesis: verum end; supposeA10: dom fs = 1 ; ::_thesis: ex u being set st S2[e,u] set u = f; take f ; ::_thesis: S2[e,f] thus S2[e,f] by A10; ::_thesis: verum end; supposeA11: dom fs >= 2 ; ::_thesis: ex u being set st S2[e,u] reconsider n = dom fs as Nat ; reconsider n9 = n -' 1 as Nat ; n - 1 >= 2 - 1 by A11, XREAL_1:9; then A12: n9 = n - 1 by XREAL_0:def_2; A13: Seg n9 c= n9 + 1 by AFINSQ_1:3; defpred S3[ set , set ] means for p being Nat st p >= 1 & p <= n - 1 & \$1 = p holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & \$2 = [:f1,f2:] ); A14: for k being Nat st k in Seg n9 holds ex x being set st S3[k,x] proof let k be Nat; ::_thesis: ( k in Seg n9 implies ex x being set st S3[k,x] ) assume A15: k in Seg n9 ; ::_thesis: ex x being set st S3[k,x] then A16: ( 1 <= k & k <= n9 ) by FINSEQ_1:1; then k + 1 <= (n - 1) + 1 by A12, XREAL_1:7; then A17: (k + 1) - k <= n - k by XREAL_1:9; then A18: n -' k = n - k by XREAL_0:def_2; reconsider m1 = k as non zero Nat by A15, FINSEQ_1:1; reconsider m2 = n - k as non zero Nat by A17, A18; reconsider f1 = fs . m1 as Function of (free_magma (X,m1)),M by A7, A15, A13, A12; - 1 >= - k by A16, XREAL_1:24; then (- 1) + n >= (- k) + n by XREAL_1:7; then m2 in Seg n9 by A12, A17, FINSEQ_1:1; then reconsider f2 = fs . m2 as Function of (free_magma (X,m2)),M by A7, A13, A12; set x = [:f1,f2:]; take [:f1,f2:] ; ::_thesis: S3[k,[:f1,f2:]] thus S3[k,[:f1,f2:]] ; ::_thesis: verum end; consider fs1 being FinSequence such that A19: ( dom fs1 = Seg n9 & ( for k being Nat st k in Seg n9 holds S3[k,fs1 . k] ) ) from FINSEQ_1:sch_1(A14); set u = Union fs1; take Union fs1 ; ::_thesis: S2[e, Union fs1] now__::_thesis:_(_(_for_m_being_non_zero_Nat_st_m_in_dom_fs_holds_ fs_._m_is_Function_of_(free_magma_(X,m)),M_)_implies_(_(_dom_fs_=_0_implies_Union_fs1_=_{}_)_&_(_dom_fs_=_1_implies_Union_fs1_=_f_)_&_(_for_n_being_Nat_st_n_>=_2_&_dom_fs_=_n_holds_ ex_fs1_being_FinSequence_st_ (_len_fs1_=_n_-_1_&_(_for_p_being_Nat_st_p_>=_1_&_p_<=_n_-_1_holds_ ex_m1,_m2_being_non_zero_Nat_ex_f1_being_Function_of_(free_magma_(X,m1)),M_ex_f2_being_Function_of_(free_magma_(X,m2)),M_st_ (_m1_=_p_&_m2_=_n_-_p_&_f1_=_fs_._m1_&_f2_=_fs_._m2_&_fs1_._p_=_[:f1,f2:]_)_)_&_Union_fs1_=_Union_fs1_)_)_)_) assume for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M ; ::_thesis: ( ( dom fs = 0 implies Union fs1 = {} ) & ( dom fs = 1 implies Union fs1 = f ) & ( for n being Nat st n >= 2 & dom fs = n holds ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & Union fs1 = Union fs1 ) ) ) thus ( ( dom fs = 0 implies Union fs1 = {} ) & ( dom fs = 1 implies Union fs1 = f ) ) by A11; ::_thesis: for n being Nat st n >= 2 & dom fs = n holds ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & Union fs1 = Union fs1 ) thus for n being Nat st n >= 2 & dom fs = n holds ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & Union fs1 = Union fs1 ) ::_thesis: verum proof let n99 be Nat; ::_thesis: ( n99 >= 2 & dom fs = n99 implies ex fs1 being FinSequence st ( len fs1 = n99 - 1 & ( for p being Nat st p >= 1 & p <= n99 - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & Union fs1 = Union fs1 ) ) assume n99 >= 2 ; ::_thesis: ( not dom fs = n99 or ex fs1 being FinSequence st ( len fs1 = n99 - 1 & ( for p being Nat st p >= 1 & p <= n99 - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & Union fs1 = Union fs1 ) ) assume A20: dom fs = n99 ; ::_thesis: ex fs1 being FinSequence st ( len fs1 = n99 - 1 & ( for p being Nat st p >= 1 & p <= n99 - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & Union fs1 = Union fs1 ) take fs1 ; ::_thesis: ( len fs1 = n99 - 1 & ( for p being Nat st p >= 1 & p <= n99 - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & Union fs1 = Union fs1 ) thus len fs1 = n99 - 1 by A12, A20, A19, FINSEQ_1:def_3; ::_thesis: ( ( for p being Nat st p >= 1 & p <= n99 - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & Union fs1 = Union fs1 ) thus for p being Nat st p >= 1 & p <= n99 - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ::_thesis: Union fs1 = Union fs1 proof let p be Nat; ::_thesis: ( p >= 1 & p <= n99 - 1 implies ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) assume A21: p >= 1 ; ::_thesis: ( not p <= n99 - 1 or ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) assume A22: p <= n99 - 1 ; ::_thesis: ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) then A23: p <= n9 by A20, XREAL_0:def_2; p + 1 <= (n - 1) + 1 by A20, A22, XREAL_1:7; then A24: (p + 1) - p <= n - p by XREAL_1:9; then A25: n -' p = n - p by XREAL_0:def_2; reconsider m1 = p as non zero Nat by A21; reconsider m2 = n - p as non zero Nat by A24, A25; p in Seg n9 by A21, A23, FINSEQ_1:1; then reconsider f1 = fs . m1 as Function of (free_magma (X,m1)),M by A7, A13, A12; - 1 >= - p by A21, XREAL_1:24; then (- 1) + n >= (- p) + n by XREAL_1:7; then m2 in Seg n9 by A12, A24, FINSEQ_1:1; then reconsider f2 = fs . m2 as Function of (free_magma (X,m2)),M by A13, A7, A12; take m1 ; ::_thesis: ex m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) take m2 ; ::_thesis: ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) take f1 ; ::_thesis: ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) take f2 ; ::_thesis: ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) p in Seg n9 by A21, A23, FINSEQ_1:1; then A26: ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) by A19, A20, A21, A22; thus ( m1 = p & m2 = n99 - p & f1 = fs . m1 & f2 = fs . m2 ) by A20; ::_thesis: fs1 . p = [:f1,f2:] thus fs1 . p = [:f1,f2:] by A26; ::_thesis: verum end; thus Union fs1 = Union fs1 ; ::_thesis: verum end; end; hence S2[e, Union fs1] by A7; ::_thesis: verum end; end; end; supposeA27: ex m being non zero Nat st ( m in dom fs & fs . m is not Function of (free_magma (X,m)),M ) ; ::_thesis: ex u being set st S2[e,u] take f ; ::_thesis: S2[e,f] thus S2[e,f] by A27; ::_thesis: verum end; end; end; consider F2 being Function such that A28: ( dom F2 = X1 ^omega & ( for e being set st e in X1 ^omega holds S2[e,F2 . e] ) ) from CLASSES1:sch_1(A6); A29: for n being Nat for fs being XFinSequence of st n >= 2 & dom fs = n & ( for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M ) & ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & F2 . fs = Union fs1 ) holds F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) proof let n be Nat; ::_thesis: for fs being XFinSequence of st n >= 2 & dom fs = n & ( for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M ) & ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & F2 . fs = Union fs1 ) holds F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) let fs be XFinSequence of ; ::_thesis: ( n >= 2 & dom fs = n & ( for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M ) & ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & F2 . fs = Union fs1 ) implies F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) ) assume A30: n >= 2 ; ::_thesis: ( not dom fs = n or ex m being non zero Nat st ( m in dom fs & fs . m is not Function of (free_magma (X,m)),M ) or for fs1 being FinSequence holds ( not len fs1 = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & ( for m1, m2 being non zero Nat for f1 being Function of (free_magma (X,m1)),M for f2 being Function of (free_magma (X,m2)),M holds ( not m1 = p or not m2 = n - p or not f1 = fs . m1 or not f2 = fs . m2 or not fs1 . p = [:f1,f2:] ) ) ) or not F2 . fs = Union fs1 ) or F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) ) assume dom fs = n ; ::_thesis: ( ex m being non zero Nat st ( m in dom fs & fs . m is not Function of (free_magma (X,m)),M ) or for fs1 being FinSequence holds ( not len fs1 = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & ( for m1, m2 being non zero Nat for f1 being Function of (free_magma (X,m1)),M for f2 being Function of (free_magma (X,m2)),M holds ( not m1 = p or not m2 = n - p or not f1 = fs . m1 or not f2 = fs . m2 or not fs1 . p = [:f1,f2:] ) ) ) or not F2 . fs = Union fs1 ) or F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) ) assume for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M ; ::_thesis: ( for fs1 being FinSequence holds ( not len fs1 = n - 1 or ex p being Nat st ( p >= 1 & p <= n - 1 & ( for m1, m2 being non zero Nat for f1 being Function of (free_magma (X,m1)),M for f2 being Function of (free_magma (X,m2)),M holds ( not m1 = p or not m2 = n - p or not f1 = fs . m1 or not f2 = fs . m2 or not fs1 . p = [:f1,f2:] ) ) ) or not F2 . fs = Union fs1 ) or F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) ) assume ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & F2 . fs = Union fs1 ) ; ::_thesis: F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) then consider fs1 being FinSequence such that A31: len fs1 = n - 1 and A32: for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) and A33: F2 . fs = Union fs1 ; A34: for x being set st x in F2 . fs holds ex y, z being set st x = [y,z] proof let x be set ; ::_thesis: ( x in F2 . fs implies ex y, z being set st x = [y,z] ) assume x in F2 . fs ; ::_thesis: ex y, z being set st x = [y,z] then x in union (rng fs1) by A33, CARD_3:def_4; then consider Y being set such that A35: ( x in Y & Y in rng fs1 ) by TARSKI:def_4; consider p being set such that A36: ( p in dom fs1 & Y = fs1 . p ) by A35, FUNCT_1:def_3; reconsider p = p as Nat by A36; p in Seg (len fs1) by A36, FINSEQ_1:def_3; then ( 1 <= p & p <= n - 1 ) by A31, FINSEQ_1:1; then consider m1, m2 being non zero Nat, f1 being Function of (free_magma (X,m1)),M, f2 being Function of (free_magma (X,m2)),M such that A37: ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) by A32; consider y, z being set such that A38: x = [y,z] by A35, A36, A37, RELAT_1:def_1; take y ; ::_thesis: ex z being set st x = [y,z] take z ; ::_thesis: x = [y,z] thus x = [y,z] by A38; ::_thesis: verum end; for x, y1, y2 being set st [x,y1] in F2 . fs & [x,y2] in F2 . fs holds y1 = y2 proof let x, y1, y2 be set ; ::_thesis: ( [x,y1] in F2 . fs & [x,y2] in F2 . fs implies y1 = y2 ) assume [x,y1] in F2 . fs ; ::_thesis: ( not [x,y2] in F2 . fs or y1 = y2 ) then [x,y1] in union (rng fs1) by A33, CARD_3:def_4; then consider Y1 being set such that A39: ( [x,y1] in Y1 & Y1 in rng fs1 ) by TARSKI:def_4; consider p1 being set such that A40: ( p1 in dom fs1 & Y1 = fs1 . p1 ) by A39, FUNCT_1:def_3; reconsider p1 = p1 as Nat by A40; p1 in Seg (len fs1) by A40, FINSEQ_1:def_3; then ( 1 <= p1 & p1 <= n - 1 ) by A31, FINSEQ_1:1; then consider m19, m29 being non zero Nat, f19 being Function of (free_magma (X,m19)),M, f29 being Function of (free_magma (X,m29)),M such that A41: ( m19 = p1 & m29 = n - p1 & f19 = fs . m19 & f29 = fs . m29 & fs1 . p1 = [:f19,f29:] ) by A32; A42: x in dom [:f19,f29:] by A39, A40, A41, FUNCT_1:1; then x `2 in {m19} by MCART_1:10; then A43: x `2 = m19 by TARSKI:def_1; assume [x,y2] in F2 . fs ; ::_thesis: y1 = y2 then [x,y2] in union (rng fs1) by A33, CARD_3:def_4; then consider Y2 being set such that A44: ( [x,y2] in Y2 & Y2 in rng fs1 ) by TARSKI:def_4; consider p2 being set such that A45: ( p2 in dom fs1 & Y2 = fs1 . p2 ) by A44, FUNCT_1:def_3; reconsider p2 = p2 as Nat by A45; p2 in Seg (len fs1) by A45, FINSEQ_1:def_3; then ( 1 <= p2 & p2 <= n - 1 ) by A31, FINSEQ_1:1; then consider m199, m299 being non zero Nat, f199 being Function of (free_magma (X,m199)),M, f299 being Function of (free_magma (X,m299)),M such that A46: ( m199 = p2 & m299 = n - p2 & f199 = fs . m199 & f299 = fs . m299 & fs1 . p2 = [:f199,f299:] ) by A32; A47: x in dom [:f199,f299:] by A44, A45, A46, FUNCT_1:1; then x `2 in {m199} by MCART_1:10; then A48: ( f19 = f199 & f29 = f299 ) by A41, A46, A43, TARSKI:def_1; A49: x `1 in [:(free_magma (X,m19)),(free_magma (X,m29)):] by A42, MCART_1:10; reconsider x1 = x as Element of [:[:(free_magma (X,m19)),(free_magma (X,m29)):],{m19}:] by A42; reconsider y19 = (x `1) `1 as Element of free_magma (X,m19) by A49, MCART_1:10; reconsider z1 = (x `1) `2 as Element of free_magma (X,m29) by A49, MCART_1:10; A50: x `1 in [:(free_magma (X,m199)),(free_magma (X,m299)):] by A47, MCART_1:10; reconsider x2 = x as Element of [:[:(free_magma (X,m199)),(free_magma (X,m299)):],{m199}:] by A47; reconsider y29 = (x `1) `1 as Element of free_magma (X,m199) by A50, MCART_1:10; reconsider z2 = (x `1) `2 as Element of free_magma (X,m299) by A50, MCART_1:10; thus y1 = [:f19,f29:] . x1 by A39, A40, A41, FUNCT_1:1 .= (f19 . y19) * (f29 . z1) by Def20 .= (f199 . y29) * (f299 . z2) by A48 .= [:f199,f299:] . x2 by Def20 .= y2 by A44, A45, A46, FUNCT_1:1 ; ::_thesis: verum end; then reconsider f9 = F2 . fs as Function by A34, FUNCT_1:def_1, RELAT_1:def_1; for x being set holds ( x in free_magma (X,n) iff ex y being set st [x,y] in f9 ) proof let x be set ; ::_thesis: ( x in free_magma (X,n) iff ex y being set st [x,y] in f9 ) hereby ::_thesis: ( ex y being set st [x,y] in f9 implies x in free_magma (X,n) ) assume x in free_magma (X,n) ; ::_thesis: ex y being set st [x,y] in f9 then consider p, m being Nat such that A51: ( x `2 = p & 1 <= p & p <= n - 1 & (x `1) `1 in free_magma (X,p) & (x `1) `2 in free_magma (X,m) & n = p + m & x in [:[:(free_magma (X,p)),(free_magma (X,m)):],{p}:] ) by A30, Th21; consider m1, m2 being non zero Nat, f1 being Function of (free_magma (X,m1)),M, f2 being Function of (free_magma (X,m2)),M such that A52: ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) by A32, A51; reconsider x9 = x as Element of [:[:(free_magma (X,m1)),(free_magma (X,m2)):],{m1}:] by A51, A52; reconsider y9 = (x `1) `1 as Element of free_magma (X,m1) by A51, A52; reconsider z9 = (x `1) `2 as Element of free_magma (X,m2) by A51, A52; reconsider y = (f1 . y9) * (f2 . z9) as set ; A53: dom [:f1,f2:] = [:[:(free_magma (X,m1)),(free_magma (X,m2)):],{m1}:] by FUNCT_2:def_1; A54: [:f1,f2:] . x9 = y by Def20; take y = y; ::_thesis: [x,y] in f9 A55: [x,y] in fs1 . p by A52, A53, A54, FUNCT_1:1; p in Seg (len fs1) by A51, A31, FINSEQ_1:1; then p in dom fs1 by FINSEQ_1:def_3; then fs1 . p in rng fs1 by FUNCT_1:3; then [x,y] in union (rng fs1) by A55, TARSKI:def_4; hence [x,y] in f9 by A33, CARD_3:def_4; ::_thesis: verum end; given y being set such that A56: [x,y] in f9 ; ::_thesis: x in free_magma (X,n) [x,y] in union (rng fs1) by A33, A56, CARD_3:def_4; then consider Y being set such that A57: ( [x,y] in Y & Y in rng fs1 ) by TARSKI:def_4; consider p being set such that A58: ( p in dom fs1 & Y = fs1 . p ) by A57, FUNCT_1:def_3; A59: p in Seg (len fs1) by A58, FINSEQ_1:def_3; reconsider p = p as Nat by A58; ( p >= 1 & p <= n - 1 ) by A59, A31, FINSEQ_1:1; then consider m1, m2 being non zero Nat, f1 being Function of (free_magma (X,m1)),M, f2 being Function of (free_magma (X,m2)),M such that A60: ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) by A32; A61: x in dom [:f1,f2:] by A57, A58, A60, FUNCT_1:1; then A62: ( x `1 in [:(free_magma (X,m1)),(free_magma (X,m2)):] & x `2 in {m1} ) by MCART_1:10; then A63: ( (x `1) `1 in free_magma (X,m1) & (x `1) `2 in free_magma (X,m2) ) by MCART_1:10; x = [(x `1),(x `2)] by A61, MCART_1:21; then A64: x = [[((x `1) `1),((x `1) `2)],(x `2)] by A62, MCART_1:21; x `2 = m1 by A62, TARSKI:def_1; then x in free_magma (X,(m1 + m2)) by A64, Th22, A63; hence x in free_magma (X,n) by A60; ::_thesis: verum end; then A65: dom f9 = free_magma (X,n) by XTUPLE_0:def_12; for y being set st y in rng f9 holds y in the carrier of M proof let y be set ; ::_thesis: ( y in rng f9 implies y in the carrier of M ) assume y in rng f9 ; ::_thesis: y in the carrier of M then consider x being set such that A66: ( x in dom f9 & y = f9 . x ) by FUNCT_1:def_3; [x,y] in Union fs1 by A33, A66, FUNCT_1:1; then [x,y] in union (rng fs1) by CARD_3:def_4; then consider Y being set such that A67: ( [x,y] in Y & Y in rng fs1 ) by TARSKI:def_4; consider p being set such that A68: ( p in dom fs1 & Y = fs1 . p ) by A67, FUNCT_1:def_3; A69: p in Seg (len fs1) by A68, FINSEQ_1:def_3; reconsider p = p as Nat by A68; ( p >= 1 & p <= n - 1 ) by A69, A31, FINSEQ_1:1; then consider m1, m2 being non zero Nat, f1 being Function of (free_magma (X,m1)),M, f2 being Function of (free_magma (X,m2)),M such that A70: ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) by A32; y in rng [:f1,f2:] by A67, A68, A70, XTUPLE_0:def_13; hence y in the carrier of M ; ::_thesis: verum end; then rng f9 c= the carrier of M by TARSKI:def_3; hence F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) by A65, FUNCT_2:def_2; ::_thesis: verum end; for e being set st e in X1 ^omega holds F2 . e in X1 proof let e be set ; ::_thesis: ( e in X1 ^omega implies F2 . e in X1 ) assume A71: e in X1 ^omega ; ::_thesis: F2 . e in X1 then reconsider fs = e as XFinSequence of by AFINSQ_1:def_7; percases ( for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M or ex m being non zero Nat st ( m in dom fs & fs . m is not Function of (free_magma (X,m)),M ) ) ; supposeA72: for m being non zero Nat st m in dom fs holds fs . m is Function of (free_magma (X,m)),M ; ::_thesis: F2 . e in X1 then A73: ( ( dom fs = 0 implies F2 . e = {} ) & ( dom fs = 1 implies F2 . e = f ) & ( for n being Nat st n >= 2 & dom fs = n holds ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & F2 . e = Union fs1 ) ) ) by A71, A28; ( dom fs = 0 or (dom fs) + 1 > 0 + 1 ) by XREAL_1:6; then ( dom fs = 0 or dom fs >= 1 ) by NAT_1:13; then ( dom fs = 0 or dom fs = 1 or dom fs > 1 ) by XXREAL_0:1; then A74: ( dom fs = 0 or dom fs = 1 or (dom fs) + 1 > 1 + 1 ) by XREAL_1:6; percases ( dom fs = 0 or dom fs = 1 or dom fs >= 2 ) by A74, NAT_1:13; supposeA75: dom fs = 0 ; ::_thesis: F2 . e in X1 Funcs ({}, the carrier of M) = {{}} by FUNCT_5:57; then A76: {} in Funcs ({}, the carrier of M) by TARSKI:def_1; S1[ 0 ,F1 . 0] by A2; then F1 . 0 = Funcs ({}, the carrier of M) by Def13; then Funcs ({}, the carrier of M) in rng F1 by A2, FUNCT_1:3; then {} in union (rng F1) by A76, TARSKI:def_4; hence F2 . e in X1 by A75, A73, CARD_3:def_4; ::_thesis: verum end; suppose dom fs = 1 ; ::_thesis: F2 . e in X1 hence F2 . e in X1 by A5, A72, A71, A28; ::_thesis: verum end; supposeA77: dom fs >= 2 ; ::_thesis: F2 . e in X1 set n = dom fs; ex fs1 being FinSequence st ( len fs1 = (dom fs) - 1 & ( for p being Nat st p >= 1 & p <= (dom fs) - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = (dom fs) - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & F2 . e = Union fs1 ) by A72, A77, A71, A28; then A78: F2 . e in Funcs ((free_magma (X,(dom fs))), the carrier of M) by A29, A77, A72; A79: dom fs in dom F1 by A2, ORDINAL1:def_12; then S1[ dom fs,F1 . (dom fs)] by A2; then Funcs ((free_magma (X,(dom fs))), the carrier of M) in rng F1 by A79, FUNCT_1:3; then F2 . e in union (rng F1) by A78, TARSKI:def_4; hence F2 . e in X1 by CARD_3:def_4; ::_thesis: verum end; end; end; suppose ex m being non zero Nat st ( m in dom fs & fs . m is not Function of (free_magma (X,m)),M ) ; ::_thesis: F2 . e in X1 hence F2 . e in X1 by A5, A71, A28; ::_thesis: verum end; end; end; then reconsider F2 = F2 as Function of (X1 ^omega),X1 by A28, FUNCT_2:3; deffunc H1( XFinSequence of ) -> Element of X1 = F2 . \$1; consider F3 being Function of NAT,X1 such that A80: for n being Nat holds F3 . n = H1(F3 | n) from ALGSTR_4:sch_4(); A81: for n being Nat st n > 0 holds F3 . n is Function of (free_magma (X,n)),M proof defpred S3[ Nat] means for n being Nat st \$1 = n & n > 0 holds F3 . n is Function of (free_magma (X,n)),M; A82: for k being Nat st ( for n being Nat st n < k holds S3[n] ) holds S3[k] proof let k be Nat; ::_thesis: ( ( for n being Nat st n < k holds S3[n] ) implies S3[k] ) assume A83: for n being Nat st n < k holds S3[n] ; ::_thesis: S3[k] thus S3[k] ::_thesis: verum proof let n be Nat; ::_thesis: ( k = n & n > 0 implies F3 . n is Function of (free_magma (X,n)),M ) assume A84: k = n ; ::_thesis: ( not n > 0 or F3 . n is Function of (free_magma (X,n)),M ) assume n > 0 ; ::_thesis: F3 . n is Function of (free_magma (X,n)),M A85: for m being non zero Nat st m in dom (F3 | n) holds (F3 | n) . m is Function of (free_magma (X,m)),M proof let m be non zero Nat; ::_thesis: ( m in dom (F3 | n) implies (F3 | n) . m is Function of (free_magma (X,m)),M ) assume A86: m in dom (F3 | n) ; ::_thesis: (F3 | n) . m is Function of (free_magma (X,m)),M then A87: (F3 | n) . m = F3 . m by FUNCT_1:47; m in k by A84, A86; then m < k by NAT_1:44; hence (F3 | n) . m is Function of (free_magma (X,m)),M by A87, A83; ::_thesis: verum end; A88: F3 | n in X1 ^omega by AFINSQ_1:def_7; reconsider fs = F3 | n as XFinSequence of ; A89: ( ( dom fs = 0 implies F2 . fs = {} ) & ( dom fs = 1 implies F2 . fs = f ) & ( for n being Nat st n >= 2 & dom fs = n holds ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & F2 . fs = Union fs1 ) ) ) by A85, A88, A28; A90: n in NAT by ORDINAL1:def_12; dom F3 = NAT by FUNCT_2:def_1; then A91: n c= dom F3 by A90, ORDINAL1:def_2; A92: dom fs = (dom F3) /\ n by RELAT_1:61 .= n by A91, XBOOLE_1:28 ; F2 . fs is Function of (free_magma (X,n)),M proof ( n = 0 or n + 1 > 0 + 1 ) by XREAL_1:6; then ( n = 0 or n >= 1 ) by NAT_1:13; then ( n = 0 or n = 1 or n > 1 ) by XXREAL_0:1; then A93: ( n = 0 or n = 1 or n + 1 > 1 + 1 ) by XREAL_1:6; percases ( n = 0 or n = 1 or n >= 2 ) by A93, NAT_1:13; supposeA94: n = 0 ; ::_thesis: F2 . fs is Function of (free_magma (X,n)),M Funcs ({}, the carrier of M) = {{}} by FUNCT_5:57; then F2 . fs in Funcs ({}, the carrier of M) by A94, A89, TARSKI:def_1; then F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) by A94, Def13; then ex f being Function st ( F2 . fs = f & dom f = free_magma (X,n) & rng f c= the carrier of M ) by FUNCT_2:def_2; hence F2 . fs is Function of (free_magma (X,n)),M by FUNCT_2:2; ::_thesis: verum end; supposeA95: n = 1 ; ::_thesis: F2 . fs is Function of (free_magma (X,n)),M free_magma (X,1) = X by Def13; hence F2 . fs is Function of (free_magma (X,n)),M by A85, A88, A28, A95, A92; ::_thesis: verum end; supposeA96: n >= 2 ; ::_thesis: F2 . fs is Function of (free_magma (X,n)),M then ex fs1 being FinSequence st ( len fs1 = n - 1 & ( for p being Nat st p >= 1 & p <= n - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = n - p & f1 = fs . m1 & f2 = fs . m2 & fs1 . p = [:f1,f2:] ) ) & F2 . fs = Union fs1 ) by A85, A88, A28, A92; then F2 . fs in Funcs ((free_magma (X,n)), the carrier of M) by A29, A96, A92, A85; then ex f being Function st ( F2 . fs = f & dom f = free_magma (X,n) & rng f c= the carrier of M ) by FUNCT_2:def_2; hence F2 . fs is Function of (free_magma (X,n)),M by FUNCT_2:2; ::_thesis: verum end; end; end; hence F3 . n is Function of (free_magma (X,n)),M by A80; ::_thesis: verum end; end; for k being Nat holds S3[k] from NAT_1:sch_4(A82); hence for n being Nat st n > 0 holds F3 . n is Function of (free_magma (X,n)),M ; ::_thesis: verum end; reconsider X9 = the carrier of (free_magma X) as set ; defpred S3[ set , set ] means for w being Element of (free_magma X) for f9 being Function of (free_magma (X,(w `2))),M st w = \$1 & f9 = F3 . (w `2) holds \$2 = f9 . (w `1); A97: for x being set st x in X9 holds ex y being set st ( y in the carrier of M & S3[x,y] ) proof let x be set ; ::_thesis: ( x in X9 implies ex y being set st ( y in the carrier of M & S3[x,y] ) ) assume x in X9 ; ::_thesis: ex y being set st ( y in the carrier of M & S3[x,y] ) then reconsider w = x as Element of (free_magma X) ; reconsider f9 = F3 . (w `2) as Function of (free_magma (X,(w `2))),M by A81; set y = f9 . (w `1); take f9 . (w `1) ; ::_thesis: ( f9 . (w `1) in the carrier of M & S3[x,f9 . (w `1)] ) w in [:(free_magma (X,(w `2))),{(w `2)}:] by Th25; then w `1 in free_magma (X,(w `2)) by MCART_1:10; hence f9 . (w `1) in the carrier of M by FUNCT_2:5; ::_thesis: S3[x,f9 . (w `1)] thus S3[x,f9 . (w `1)] ; ::_thesis: verum end; consider h being Function of X9, the carrier of M such that A98: for x being set st x in X9 holds S3[x,h . x] from FUNCT_2:sch_1(A97); reconsider h = h as Function of (free_magma X),M ; take h ; ::_thesis: ( h is multiplicative & h extends f * ((canon_image (X,1)) ") ) for a, b being Element of (free_magma X) holds h . (a * b) = (h . a) * (h . b) proof let a, b be Element of (free_magma X); ::_thesis: h . (a * b) = (h . a) * (h . b) reconsider fab = F3 . ((a * b) `2) as Function of (free_magma (X,((a * b) `2))),M by A81; a * b = [[[(a `1),(b `1)],(a `2)],((length a) + (length b))] by Th31; then A99: ( (a * b) `1 = [[(a `1),(b `1)],(a `2)] & (a * b) `2 = (length a) + (length b) ) by MCART_1:7; then A100: fab = F2 . (F3 | ((length a) + (length b))) by A80; A101: F3 | ((length a) + (length b)) in X1 ^omega by AFINSQ_1:def_7; A102: for m being non zero Nat st m in dom (F3 | ((length a) + (length b))) holds (F3 | ((length a) + (length b))) . m is Function of (free_magma (X,m)),M proof let m be non zero Nat; ::_thesis: ( m in dom (F3 | ((length a) + (length b))) implies (F3 | ((length a) + (length b))) . m is Function of (free_magma (X,m)),M ) assume A103: m in dom (F3 | ((length a) + (length b))) ; ::_thesis: (F3 | ((length a) + (length b))) . m is Function of (free_magma (X,m)),M F3 . m is Function of (free_magma (X,m)),M by A81; hence (F3 | ((length a) + (length b))) . m is Function of (free_magma (X,m)),M by A103, FUNCT_1:47; ::_thesis: verum end; set n = (length a) + (length b); ( length a >= 1 & length b >= 1 ) by Th32; then A104: (length a) + (length b) >= 1 + 1 by XREAL_1:7; A105: (length a) + (length b) in NAT by ORDINAL1:def_12; dom F3 = NAT by FUNCT_2:def_1; then A106: (length a) + (length b) c= dom F3 by A105, ORDINAL1:def_2; dom (F3 | ((length a) + (length b))) = (dom F3) /\ ((length a) + (length b)) by RELAT_1:61 .= (length a) + (length b) by A106, XBOOLE_1:28 ; then consider fs1 being FinSequence such that A107: len fs1 = ((length a) + (length b)) - 1 and A108: for p being Nat st p >= 1 & p <= ((length a) + (length b)) - 1 holds ex m1, m2 being non zero Nat ex f1 being Function of (free_magma (X,m1)),M ex f2 being Function of (free_magma (X,m2)),M st ( m1 = p & m2 = ((length a) + (length b)) - p & f1 = (F3 | ((length a) + (length b))) . m1 & f2 = (F3 | ((length a) + (length b))) . m2 & fs1 . p = [:f1,f2:] ) and A109: fab = Union fs1 by A102, A104, A101, A28, A100; a * b in [:(free_magma (X,((a * b) `2))),{((a * b) `2)}:] by Th25; then (a * b) `1 in free_magma (X,((a * b) `2)) by MCART_1:10; then (a * b) `1 in dom fab by FUNCT_2:def_1; then [((a * b) `1),(fab . ((a * b) `1))] in Union fs1 by A109, FUNCT_1:1; then [((a * b) `1),(fab . ((a * b) `1))] in union (rng fs1) by CARD_3:def_4; then consider Y being set such that A110: ( [((a * b) `1),(fab . ((a * b) `1))] in Y & Y in rng fs1 ) by TARSKI:def_4; consider p being set such that A111: ( p in dom fs1 & Y = fs1 . p ) by A110, FUNCT_1:def_3; A112: p in Seg (len fs1) by A111, FINSEQ_1:def_3; reconsider p = p as Nat by A111; ( p >= 1 & p <= ((length a) + (length b)) - 1 ) by A112, A107, FINSEQ_1:1; then consider m1, m2 being non zero Nat, f1 being Function of (free_magma (X,m1)),M, f2 being Function of (free_magma (X,m2)),M such that A113: ( m1 = p & m2 = ((length a) + (length b)) - p & f1 = (F3 | ((length a) + (length b))) . m1 & f2 = (F3 | ((length a) + (length b))) . m2 & fs1 . p = [:f1,f2:] ) by A108; A114: (a * b) `1 in dom [:f1,f2:] by A113, A110, A111, FUNCT_1:1; then ( ((a * b) `1) `1 in [:(free_magma (X,m1)),(free_magma (X,m2)):] & ((a * b) `1) `2 in {m1} ) by MCART_1:10; then A115: ( [(a `1),(b `1)] in [:(free_magma (X,m1)),(free_magma (X,m2)):] & a `2 in {m1} ) by A99, MCART_1:7; then m1 = a `2 by TARSKI:def_1; then A116: m1 = length a by Def18; length b >= 0 + 1 by Th32; then (length b) + (length a) > 0 + (length a) by XREAL_1:6; then A117: m1 in (length a) + (length b) by A116, NAT_1:44; length a >= 0 + 1 by Th32; then (length a) + (length b) > 0 + (length b) by XREAL_1:6; then A118: m2 in (length a) + (length b) by A116, A113, NAT_1:44; reconsider x = (a * b) `1 as Element of [:[:(free_magma (X,m1)),(free_magma (X,m2)):],{m1}:] by A114; A119: x `1 in [:(free_magma (X,m1)),(free_magma (X,m2)):] by MCART_1:10; then reconsider y = (x `1) `1 as Element of free_magma (X,m1) by MCART_1:10; reconsider z = (x `1) `2 as Element of free_magma (X,m2) by A119, MCART_1:10; A120: x `1 = [(a `1),(b `1)] by A99, MCART_1:7; A121: [:f1,f2:] . x = (f1 . y) * (f2 . z) by Def20; A122: h . (a * b) = fab . ((a * b) `1) by A98; A123: fab . ((a * b) `1) = [:f1,f2:] . x by A113, A110, A111, FUNCT_1:1; reconsider fa = F3 . (a `2) as Function of (free_magma (X,(a `2))),M by A81; reconsider fb = F3 . (b `2) as Function of (free_magma (X,(b `2))),M by A81; f1 = F3 . m1 by A113, A117, FUNCT_1:49 .= fa by A115, TARSKI:def_1 ; then A124: fa . (a `1) = f1 . y by A120, MCART_1:7; f2 = F3 . m2 by A113, A118, FUNCT_1:49 .= fb by Def18, A116, A113 ; then A125: fb . (b `1) = f2 . z by A120, MCART_1:7; h . b = fb . (b `1) by A98; hence h . (a * b) = (h . a) * (h . b) by A121, A122, A124, A125, A98, A123; ::_thesis: verum end; hence h is multiplicative by GROUP_6:def_6; ::_thesis: h extends f * ((canon_image (X,1)) ") set fX = canon_image (X,1); for x being set st x in dom (f * ((canon_image (X,1)) ")) holds x in dom h proof let x be set ; ::_thesis: ( x in dom (f * ((canon_image (X,1)) ")) implies x in dom h ) assume A126: x in dom (f * ((canon_image (X,1)) ")) ; ::_thesis: x in dom h dom (f * ((canon_image (X,1)) ")) c= dom ((canon_image (X,1)) ") by RELAT_1:25; then x in dom ((canon_image (X,1)) ") by A126; then x in rng (canon_image (X,1)) by FUNCT_1:33; then x in the carrier of (free_magma X) ; hence x in dom h by FUNCT_2:def_1; ::_thesis: verum end; then A127: dom (f * ((canon_image (X,1)) ")) c= dom h by TARSKI:def_3; for x being set st x in (dom h) /\ (dom (f * ((canon_image (X,1)) "))) holds h . x = (f * ((canon_image (X,1)) ")) . x proof let x be set ; ::_thesis: ( x in (dom h) /\ (dom (f * ((canon_image (X,1)) "))) implies h . x = (f * ((canon_image (X,1)) ")) . x ) assume x in (dom h) /\ (dom (f * ((canon_image (X,1)) "))) ; ::_thesis: h . x = (f * ((canon_image (X,1)) ")) . x then A128: x in dom (f * ((canon_image (X,1)) ")) by A127, XBOOLE_1:28; A129: dom (f * ((canon_image (X,1)) ")) c= dom ((canon_image (X,1)) ") by RELAT_1:25; then x in dom ((canon_image (X,1)) ") by A128; then x in rng (canon_image (X,1)) by FUNCT_1:33; then consider x9 being set such that A130: ( x9 in dom (canon_image (X,1)) & x = (canon_image (X,1)) . x9 ) by FUNCT_1:def_3; A131: 1 in {1} by TARSKI:def_1; [:(free_magma (X,1)),{1}:] c= free_magma_carrier X by Lm1; then A132: [:X,{1}:] c= free_magma_carrier X by Def13; A133: x9 in X by A130, Lm3; A134: x = [x9,1] by A130, Def19; then x in [:X,{1}:] by A131, A133, ZFMISC_1:def_2; then reconsider w = x as Element of (free_magma X) by A132; A135: ((canon_image (X,1)) ") . x = x9 by A130, FUNCT_1:34; set f9 = F3 . (w `2); reconsider f9 = F3 . (w `2) as Function of (free_magma (X,(w `2))),M by A81; A136: f9 = F3 . 1 by A134, MCART_1:7 .= H1(F3 | 1) by A80 ; A137: for m being non zero Nat st m in dom (F3 | 1) holds (F3 | 1) . m is Function of (free_magma (X,m)),M proof let m be non zero Nat; ::_thesis: ( m in dom (F3 | 1) implies (F3 | 1) . m is Function of (free_magma (X,m)),M ) assume m in dom (F3 | 1) ; ::_thesis: (F3 | 1) . m is Function of (free_magma (X,m)),M then (F3 | 1) . m = F3 . m by FUNCT_1:47; hence (F3 | 1) . m is Function of (free_magma (X,m)),M by A81; ::_thesis: verum end; A138: F3 | 1 in X1 ^omega by AFINSQ_1:def_7; reconsider fs = F3 | 1 as XFinSequence of ; dom F3 = NAT by FUNCT_2:def_1; then A139: 1 c= dom F3 by ORDINAL1:def_2; A140: dom fs = (dom F3) /\ 1 by RELAT_1:61 .= 1 by A139, XBOOLE_1:28 ; thus h . x = f9 . (w `1) by A98 .= f9 . x9 by A134, MCART_1:7 .= f . (((canon_image (X,1)) ") . x) by A135, A136, A140, A137, A138, A28 .= (f * ((canon_image (X,1)) ")) . x by A129, A128, FUNCT_1:13 ; ::_thesis: verum end; then h tolerates f * ((canon_image (X,1)) ") by PARTFUN1:def_4; hence h extends f * ((canon_image (X,1)) ") by A127, Def2; ::_thesis: verum end; theorem Th40: :: ALGSTR_4:40 for X being non empty set for M being non empty multMagma for f being Function of X,M for h, g being Function of (free_magma X),M st h is multiplicative & h extends f * ((canon_image (X,1)) ") & g is multiplicative & g extends f * ((canon_image (X,1)) ") holds h = g proof let X be non empty set ; ::_thesis: for M being non empty multMagma for f being Function of X,M for h, g being Function of (free_magma X),M st h is multiplicative & h extends f * ((canon_image (X,1)) ") & g is multiplicative & g extends f * ((canon_image (X,1)) ") holds h = g let M be non empty multMagma ; ::_thesis: for f being Function of X,M for h, g being Function of (free_magma X),M st h is multiplicative & h extends f * ((canon_image (X,1)) ") & g is multiplicative & g extends f * ((canon_image (X,1)) ") holds h = g let f be Function of X,M; ::_thesis: for h, g being Function of (free_magma X),M st h is multiplicative & h extends f * ((canon_image (X,1)) ") & g is multiplicative & g extends f * ((canon_image (X,1)) ") holds h = g let h, g be Function of (free_magma X),M; ::_thesis: ( h is multiplicative & h extends f * ((canon_image (X,1)) ") & g is multiplicative & g extends f * ((canon_image (X,1)) ") implies h = g ) assume A1: h is multiplicative ; ::_thesis: ( not h extends f * ((canon_image (X,1)) ") or not g is multiplicative or not g extends f * ((canon_image (X,1)) ") or h = g ) assume A2: h extends f * ((canon_image (X,1)) ") ; ::_thesis: ( not g is multiplicative or not g extends f * ((canon_image (X,1)) ") or h = g ) assume A3: g is multiplicative ; ::_thesis: ( not g extends f * ((canon_image (X,1)) ") or h = g ) assume A4: g extends f * ((canon_image (X,1)) ") ; ::_thesis: h = g defpred S1[ Nat] means for w being Element of (free_magma X) st length w = \$1 holds h . w = g . w; A5: for k being Nat st ( for n being Nat st n < k holds S1[n] ) holds S1[k] proof let k be Nat; ::_thesis: ( ( for n being Nat st n < k holds S1[n] ) implies S1[k] ) assume A6: for n being Nat st n < k holds S1[n] ; ::_thesis: S1[k] thus for w being Element of (free_magma X) st length w = k holds h . w = g . w ::_thesis: verum proof let w be Element of (free_magma X); ::_thesis: ( length w = k implies h . w = g . w ) assume A7: length w = k ; ::_thesis: h . w = g . w A8: ( w = [(w `1),(w `2)] & length w >= 1 ) by Th32; then ( length w = 1 or length w > 1 ) by XXREAL_0:1; then A9: ( length w = 1 or (length w) + 1 > 1 + 1 ) by XREAL_1:8; percases ( length w = 1 or length w >= 2 ) by A9, NAT_1:13; supposeA10: length w = 1 ; ::_thesis: h . w = g . w set x = w `1 ; w `1 in { (w9 `1) where w9 is Element of (free_magma X) : length w9 = 1 } by A10; then A11: w `1 in X by Th30; A12: ( dom (f * ((canon_image (X,1)) ")) c= dom h & h tolerates f * ((canon_image (X,1)) ") ) by Def2, A2; A13: ( dom (f * ((canon_image (X,1)) ")) c= dom g & g tolerates f * ((canon_image (X,1)) ") ) by Def2, A4; A14: (canon_image (X,1)) . (w `1) = [(w `1),1] by A11, Lm3 .= w by Def18, A8, A10 ; w `1 in dom (canon_image (X,1)) by A11, Lm3; then w in rng (canon_image (X,1)) by A14, FUNCT_1:3; then A15: w in dom ((canon_image (X,1)) ") by FUNCT_1:33; X c= dom f by FUNCT_2:def_1; then dom (canon_image (X,1)) c= dom f by Lm3; then rng ((canon_image (X,1)) ") c= dom f by FUNCT_1:33; then w in dom (f * ((canon_image (X,1)) ")) by A15, RELAT_1:27; then ( w in (dom h) /\ (dom (f * ((canon_image (X,1)) "))) & w in (dom g) /\ (dom (f * ((canon_image (X,1)) "))) ) by A12, A13, XBOOLE_1:28; then ( h . w = (f * ((canon_image (X,1)) ")) . w & g . w = (f * ((canon_image (X,1)) ")) . w ) by A12, A13, PARTFUN1:def_4; hence h . w = g . w ; ::_thesis: verum end; suppose length w >= 2 ; ::_thesis: h . w = g . w then consider w1, w2 being Element of (free_magma X) such that A16: ( w = w1 * w2 & length w1 < length w & length w2 < length w ) by Th34; ( h . w1 = g . w1 & h . w2 = g . w2 ) by A6, A7, A16; then h . (w1 * w2) = (g . w1) * (g . w2) by A1, GROUP_6:def_6; hence h . w = g . w by A16, A3, GROUP_6:def_6; ::_thesis: verum end; end; end; end; A17: for k being Nat holds S1[k] from NAT_1:sch_4(A5); for w being Element of (free_magma X) holds h . w = g . w proof let w be Element of (free_magma X); ::_thesis: h . w = g . w reconsider k = length w as Nat ; S1[k] by A17; hence h . w = g . w ; ::_thesis: verum end; then for x being set st x in the carrier of (free_magma X) holds h . x = g . x ; hence h = g by FUNCT_2:12; ::_thesis: verum end; theorem Th41: :: ALGSTR_4:41 for N, M being non empty multMagma for f being Function of M,N for H being non empty multSubmagma of N for R being compatible Equivalence_Relation of M st f is multiplicative & the carrier of H = rng f & R = equ_kernel f holds ex g being Function of (M ./. R),H st ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) proof let N, M be non empty multMagma ; ::_thesis: for f being Function of M,N for H being non empty multSubmagma of N for R being compatible Equivalence_Relation of M st f is multiplicative & the carrier of H = rng f & R = equ_kernel f holds ex g being Function of (M ./. R),H st ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) let f be Function of M,N; ::_thesis: for H being non empty multSubmagma of N for R being compatible Equivalence_Relation of M st f is multiplicative & the carrier of H = rng f & R = equ_kernel f holds ex g being Function of (M ./. R),H st ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) let H be non empty multSubmagma of N; ::_thesis: for R being compatible Equivalence_Relation of M st f is multiplicative & the carrier of H = rng f & R = equ_kernel f holds ex g being Function of (M ./. R),H st ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) let R be compatible Equivalence_Relation of M; ::_thesis: ( f is multiplicative & the carrier of H = rng f & R = equ_kernel f implies ex g being Function of (M ./. R),H st ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) ) assume A1: f is multiplicative ; ::_thesis: ( not the carrier of H = rng f or not R = equ_kernel f or ex g being Function of (M ./. R),H st ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) ) assume A2: the carrier of H = rng f ; ::_thesis: ( not R = equ_kernel f or ex g being Function of (M ./. R),H st ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) ) assume A3: R = equ_kernel f ; ::_thesis: ex g being Function of (M ./. R),H st ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) set g = ((nat_hom R) ~) * f; for x, y1, y2 being set st [x,y1] in ((nat_hom R) ~) * f & [x,y2] in ((nat_hom R) ~) * f holds y1 = y2 proof let x, y1, y2 be set ; ::_thesis: ( [x,y1] in ((nat_hom R) ~) * f & [x,y2] in ((nat_hom R) ~) * f implies y1 = y2 ) assume [x,y1] in ((nat_hom R) ~) * f ; ::_thesis: ( not [x,y2] in ((nat_hom R) ~) * f or y1 = y2 ) then consider z1 being set such that A4: ( [x,z1] in (nat_hom R) ~ & [z1,y1] in f ) by RELAT_1:def_8; assume [x,y2] in ((nat_hom R) ~) * f ; ::_thesis: y1 = y2 then consider z2 being set such that A5: ( [x,z2] in (nat_hom R) ~ & [z2,y2] in f ) by RELAT_1:def_8; A6: ( [z1,x] in nat_hom R & [z2,x] in nat_hom R ) by A4, A5, RELAT_1:def_7; then ( z1 in dom (nat_hom R) & z2 in dom (nat_hom R) ) by XTUPLE_0:def_12; then reconsider z1 = z1, z2 = z2 as Element of M ; A7: ( x = (nat_hom R) . z1 & x = (nat_hom R) . z2 ) by A6, FUNCT_1:1; A8: ( f . z1 = y1 & f . z2 = y2 ) by A4, A5, FUNCT_1:1; ( (nat_hom R) . z1 = Class (R,z1) & (nat_hom R) . z2 = Class (R,z2) ) by Def6; then z2 in Class (R,z1) by A7, EQREL_1:23; then [z1,z2] in equ_kernel f by A3, EQREL_1:18; hence y1 = y2 by A8, Def8; ::_thesis: verum end; then reconsider g = ((nat_hom R) ~) * f as Function by FUNCT_1:def_1; rng (nat_hom R) = the carrier of (M ./. R) by FUNCT_2:def_3; then A9: dom ((nat_hom R) ~) = the carrier of (M ./. R) by RELAT_1:20; the carrier of M c= dom f by FUNCT_2:def_1; then dom (nat_hom R) c= dom f by FUNCT_2:def_1; then rng ((nat_hom R) ~) c= dom f by RELAT_1:20; then A10: dom g = the carrier of (M ./. R) by A9, RELAT_1:27; dom f c= the carrier of M ; then dom f c= dom (nat_hom R) by FUNCT_2:def_1; then dom f c= rng ((nat_hom R) ~) by RELAT_1:20; then A11: rng g = the carrier of H by A2, RELAT_1:28; then reconsider g = g as Function of (M ./. R),H by A10, FUNCT_2:1; take g ; ::_thesis: ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) for x1, x2 being set st x1 in dom g & x2 in dom g & g . x1 = g . x2 holds x1 = x2 proof let x1, x2 be set ; ::_thesis: ( x1 in dom g & x2 in dom g & g . x1 = g . x2 implies x1 = x2 ) assume A12: x1 in dom g ; ::_thesis: ( not x2 in dom g or not g . x1 = g . x2 or x1 = x2 ) assume A13: x2 in dom g ; ::_thesis: ( not g . x1 = g . x2 or x1 = x2 ) assume A14: g . x1 = g . x2 ; ::_thesis: x1 = x2 set y = g . x1; [x1,(g . x1)] in g by A12, FUNCT_1:1; then consider z1 being set such that A15: ( [x1,z1] in (nat_hom R) ~ & [z1,(g . x1)] in f ) by RELAT_1:def_8; [x2,(g . x1)] in g by A14, A13, FUNCT_1:1; then consider z2 being set such that A16: ( [x2,z2] in (nat_hom R) ~ & [z2,(g . x1)] in f ) by RELAT_1:def_8; A17: ( [z1,x1] in nat_hom R & [z2,x2] in nat_hom R ) by A15, A16, RELAT_1:def_7; then ( z1 in dom (nat_hom R) & z2 in dom (nat_hom R) ) by XTUPLE_0:def_12; then reconsider z1 = z1, z2 = z2 as Element of M ; ( z1 in dom f & z2 in dom f & f . z1 = g . x1 & f . z2 = g . x1 ) by A15, A16, FUNCT_1:1; then [z1,z2] in equ_kernel f by Def8; then A18: z2 in Class (R,z1) by A3, EQREL_1:18; A19: ( (nat_hom R) . z1 = Class (R,z1) & (nat_hom R) . z2 = Class (R,z2) ) by Def6; ( x1 = (nat_hom R) . z1 & x2 = (nat_hom R) . z2 ) by A17, FUNCT_1:1; hence x1 = x2 by A19, A18, EQREL_1:23; ::_thesis: verum end; then A20: g is one-to-one by FUNCT_1:def_4; A21: for x being set holds ( x in dom f iff ( x in dom (nat_hom R) & (nat_hom R) . x in dom g ) ) proof let x be set ; ::_thesis: ( x in dom f iff ( x in dom (nat_hom R) & (nat_hom R) . x in dom g ) ) hereby ::_thesis: ( x in dom (nat_hom R) & (nat_hom R) . x in dom g implies x in dom f ) assume x in dom f ; ::_thesis: ( x in dom (nat_hom R) & (nat_hom R) . x in dom g ) then x in the carrier of M ; hence x in dom (nat_hom R) by FUNCT_2:def_1; ::_thesis: (nat_hom R) . x in dom g then (nat_hom R) . x in rng (nat_hom R) by FUNCT_1:3; then (nat_hom R) . x in the carrier of (M ./. R) ; hence (nat_hom R) . x in dom g by FUNCT_2:def_1; ::_thesis: verum end; assume ( x in dom (nat_hom R) & (nat_hom R) . x in dom g ) ; ::_thesis: x in dom f then x in the carrier of M ; hence x in dom f by FUNCT_2:def_1; ::_thesis: verum end; for x being set st x in dom f holds f . x = g . ((nat_hom R) . x) proof let x be set ; ::_thesis: ( x in dom f implies f . x = g . ((nat_hom R) . x) ) assume A22: x in dom f ; ::_thesis: f . x = g . ((nat_hom R) . x) set y = (nat_hom R) . x; (nat_hom R) . x in dom g by A22, A21; then [((nat_hom R) . x),(g . ((nat_hom R) . x))] in g by FUNCT_1:1; then consider z being set such that A23: ( [((nat_hom R) . x),z] in (nat_hom R) ~ & [z,(g . ((nat_hom R) . x))] in f ) by RELAT_1:def_8; [z,((nat_hom R) . x)] in nat_hom R by A23, RELAT_1:def_7; then A24: ( z in dom (nat_hom R) & (nat_hom R) . x = (nat_hom R) . z ) by FUNCT_1:1; A25: ( z in dom f & g . ((nat_hom R) . x) = f . z ) by A23, FUNCT_1:1; then reconsider z9 = z, x9 = x as Element of M by A22; ( (nat_hom R) . z9 = Class (R,z9) & (nat_hom R) . x9 = Class (R,x9) ) by Def6; then z9 in Class (R,x9) by A24, EQREL_1:23; then [x,z] in R by EQREL_1:18; hence f . x = g . ((nat_hom R) . x) by A25, A3, Def8; ::_thesis: verum end; hence f = g * (nat_hom R) by A21, FUNCT_1:10; ::_thesis: ( g is bijective & g is multiplicative ) g is onto by A11, FUNCT_2:def_3; hence g is bijective by A20; ::_thesis: g is multiplicative for v, w being Element of (M ./. R) holds g . (v * w) = (g . v) * (g . w) proof let v, w be Element of (M ./. R); ::_thesis: g . (v * w) = (g . v) * (g . w) v * w in the carrier of (M ./. R) ; then v * w in dom g by FUNCT_2:def_1; then [(v * w),(g . (v * w))] in g by FUNCT_1:1; then consider z being set such that A26: ( [(v * w),z] in (nat_hom R) ~ & [z,(g . (v * w))] in f ) by RELAT_1:def_8; [z,(v * w)] in nat_hom R by A26, RELAT_1:def_7; then A27: ( z in dom (nat_hom R) & (nat_hom R) . z = v * w ) by FUNCT_1:1; A28: f . z = g . (v * w) by A26, FUNCT_1:1; v in the carrier of (M ./. R) ; then v in dom g by FUNCT_2:def_1; then [v,(g . v)] in g by FUNCT_1:1; then consider z1 being set such that A29: ( [v,z1] in (nat_hom R) ~ & [z1,(g . v)] in f ) by RELAT_1:def_8; [z1,v] in nat_hom R by A29, RELAT_1:def_7; then A30: ( z1 in dom (nat_hom R) & (nat_hom R) . z1 = v ) by FUNCT_1:1; A31: f . z1 = g . v by A29, FUNCT_1:1; w in the carrier of (M ./. R) ; then w in dom g by FUNCT_2:def_1; then [w,(g . w)] in g by FUNCT_1:1; then consider z2 being set such that A32: ( [w,z2] in (nat_hom R) ~ & [z2,(g . w)] in f ) by RELAT_1:def_8; [z2,w] in nat_hom R by A32, RELAT_1:def_7; then A33: ( z2 in dom (nat_hom R) & (nat_hom R) . z2 = w ) by FUNCT_1:1; A34: f . z2 = g . w by A32, FUNCT_1:1; reconsider z1 = z1, z2 = z2, z = z as Element of M by A30, A33, A27; A35: (nat_hom R) . z = (nat_hom R) . (z1 * z2) by A30, A33, A27, GROUP_6:def_6; ( (nat_hom R) . (z1 * z2) = Class (R,(z1 * z2)) & (nat_hom R) . z = Class (R,z) ) by Def6; then z1 * z2 in Class (R,z) by A35, EQREL_1:23; then [z,(z1 * z2)] in R by EQREL_1:18; then A36: f . z = f . (z1 * z2) by A3, Def8 .= (f . z1) * (f . z2) by A1, GROUP_6:def_6 ; A37: [(g . v),(g . w)] in [: the carrier of H, the carrier of H:] by ZFMISC_1:def_2; thus g . (v * w) = the multF of N . [(g . v),(g . w)] by A31, A34, A36, A28, BINOP_1:def_1 .= ( the multF of N | [: the carrier of H, the carrier of H:]) . [(g . v),(g . w)] by A37, FUNCT_1:49 .= ( the multF of N | [: the carrier of H, the carrier of H:]) . ((g . v),(g . w)) by BINOP_1:def_1 .= ( the multF of N || the carrier of H) . ((g . v),(g . w)) by REALSET1:def_2 .= (g . v) * (g . w) by Def9 ; ::_thesis: verum end; hence g is multiplicative by GROUP_6:def_6; ::_thesis: verum end; theorem :: ALGSTR_4:42 for M, N being non empty multMagma for R being compatible Equivalence_Relation of M for g1, g2 being Function of (M ./. R),N st g1 * (nat_hom R) = g2 * (nat_hom R) holds g1 = g2 proof let M, N be non empty multMagma ; ::_thesis: for R being compatible Equivalence_Relation of M for g1, g2 being Function of (M ./. R),N st g1 * (nat_hom R) = g2 * (nat_hom R) holds g1 = g2 let R be compatible Equivalence_Relation of M; ::_thesis: for g1, g2 being Function of (M ./. R),N st g1 * (nat_hom R) = g2 * (nat_hom R) holds g1 = g2 let g1, g2 be Function of (M ./. R),N; ::_thesis: ( g1 * (nat_hom R) = g2 * (nat_hom R) implies g1 = g2 ) assume A1: g1 * (nat_hom R) = g2 * (nat_hom R) ; ::_thesis: g1 = g2 set Y = rng (nat_hom R); rng (nat_hom R) = the carrier of (M ./. R) by FUNCT_2:def_3; then ( dom g1 = rng (nat_hom R) & dom g2 = rng (nat_hom R) ) by FUNCT_2:def_1; hence g1 = g2 by A1, FUNCT_1:86; ::_thesis: verum end; theorem :: ALGSTR_4:43 for M being non empty multMagma ex X being non empty set ex r being Relators of (free_magma X) ex g being Function of ((free_magma X) ./. (equ_rel r)),M st ( g is bijective & g is multiplicative ) proof let M be non empty multMagma ; ::_thesis: ex X being non empty set ex r being Relators of (free_magma X) ex g being Function of ((free_magma X) ./. (equ_rel r)),M st ( g is bijective & g is multiplicative ) set X = the carrier of M; consider f being Function of (free_magma the carrier of M),M such that A1: ( f is multiplicative & f extends (id the carrier of M) * ((canon_image ( the carrier of M,1)) ") ) by Th39; consider r being Relators of (free_magma the carrier of M) such that A2: equ_kernel f = equ_rel r by A1, Th5; reconsider R = equ_kernel f as compatible Equivalence_Relation of (free_magma the carrier of M) by A1, Th4; the multF of M = the multF of M | [: the carrier of M, the carrier of M:] ; then the multF of M = the multF of M || the carrier of M by REALSET1:def_2; then reconsider H = M as non empty multSubmagma of M by Def9; for y being set st y in the carrier of M holds ex x being set st ( x in dom f & y = f . x ) proof let y be set ; ::_thesis: ( y in the carrier of M implies ex x being set st ( x in dom f & y = f . x ) ) assume A3: y in the carrier of M ; ::_thesis: ex x being set st ( x in dom f & y = f . x ) set x = [y,1]; take [y,1] ; ::_thesis: ( [y,1] in dom f & y = f . [y,1] ) [:(free_magma ( the carrier of M,1)),{1}:] c= the carrier of (free_magma the carrier of M) by Lm1; then A4: [: the carrier of M,{1}:] c= the carrier of (free_magma the carrier of M) by Def13; 1 in {1} by TARSKI:def_1; then [y,1] in [: the carrier of M,{1}:] by A3, ZFMISC_1:def_2; then [y,1] in the carrier of (free_magma the carrier of M) by A4; hence [y,1] in dom f by FUNCT_2:def_1; ::_thesis: y = f . [y,1] A5: ( dom ((id the carrier of M) * ((canon_image ( the carrier of M,1)) ")) c= dom f & f tolerates (id the carrier of M) * ((canon_image ( the carrier of M,1)) ") ) by A1, Def2; A6: (canon_image ( the carrier of M,1)) . y = [y,1] by A3, Lm3; y in dom (canon_image ( the carrier of M,1)) by A3, Lm3; then [y,1] in rng (canon_image ( the carrier of M,1)) by A6, FUNCT_1:3; then A7: [y,1] in dom ((canon_image ( the carrier of M,1)) ") by FUNCT_1:33; dom (canon_image ( the carrier of M,1)) c= dom (id the carrier of M) by Lm3; then rng ((canon_image ( the carrier of M,1)) ") c= dom (id the carrier of M) by FUNCT_1:33; then A8: [y,1] in dom ((id the carrier of M) * ((canon_image ( the carrier of M,1)) ")) by A7, RELAT_1:27; A9: y in dom (canon_image ( the carrier of M,1)) by A3, Lm3; thus y = (id the carrier of M) . y by A3, FUNCT_1:18 .= (id the carrier of M) . (((canon_image ( the carrier of M,1)) ") . [y,1]) by A9, A6, FUNCT_1:34 .= ((id the carrier of M) * ((canon_image ( the carrier of M,1)) ")) . [y,1] by A8, FUNCT_1:12 .= f . [y,1] by A8, A5, PARTFUN1:53 ; ::_thesis: verum end; then the carrier of M c= rng f by FUNCT_1:9; then the carrier of H = rng f by XBOOLE_0:def_10; then consider g being Function of ((free_magma the carrier of M) ./. R),H such that A10: ( f = g * (nat_hom R) & g is bijective & g is multiplicative ) by A1, Th41; reconsider g = g as Function of ((free_magma the carrier of M) ./. (equ_rel r)),M by A2; take the carrier of M ; ::_thesis: ex r being Relators of (free_magma the carrier of M) ex g being Function of ((free_magma the carrier of M) ./. (equ_rel r)),M st ( g is bijective & g is multiplicative ) take r ; ::_thesis: ex g being Function of ((free_magma the carrier of M) ./. (equ_rel r)),M st ( g is bijective & g is multiplicative ) take g ; ::_thesis: ( g is bijective & g is multiplicative ) thus ( g is bijective & g is multiplicative ) by A10, A2; ::_thesis: verum end; definition let X, Y be non empty set ; let f be Function of X,Y; func free_magmaF f -> Function of (free_magma X),(free_magma Y) means :Def21: :: ALGSTR_4:def 21 ( it is multiplicative & it extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") ); existence ex b1 being Function of (free_magma X),(free_magma Y) st ( b1 is multiplicative & b1 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") ) proof reconsider f9 = (canon_image (Y,1)) * f as Function of X,(free_magma Y) by Th38; ex h being Function of (free_magma X),(free_magma Y) st ( h is multiplicative & h extends f9 * ((canon_image (X,1)) ") ) by Th39; hence ex b1 being Function of (free_magma X),(free_magma Y) st ( b1 is multiplicative & b1 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") ) ; ::_thesis: verum end; uniqueness for b1, b2 being Function of (free_magma X),(free_magma Y) st b1 is multiplicative & b1 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") & b2 is multiplicative & b2 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") holds b1 = b2 proof let f1, f2 be Function of (free_magma X),(free_magma Y); ::_thesis: ( f1 is multiplicative & f1 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") & f2 is multiplicative & f2 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") implies f1 = f2 ) assume A1: ( f1 is multiplicative & f1 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") ) ; ::_thesis: ( not f2 is multiplicative or not f2 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") or f1 = f2 ) assume A2: ( f2 is multiplicative & f2 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") ) ; ::_thesis: f1 = f2 reconsider f9 = (canon_image (Y,1)) * f as Function of X,(free_magma Y) by Th38; ( f1 extends f9 * ((canon_image (X,1)) ") & f2 extends f9 * ((canon_image (X,1)) ") ) by A1, A2; hence f1 = f2 by A1, A2, Th40; ::_thesis: verum end; end; :: deftheorem Def21 defines free_magmaF ALGSTR_4:def_21_:_ for X, Y being non empty set for f being Function of X,Y for b4 being Function of (free_magma X),(free_magma Y) holds ( b4 = free_magmaF f iff ( b4 is multiplicative & b4 extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") ) ); registration let X, Y be non empty set ; let f be Function of X,Y; cluster free_magmaF f -> multiplicative ; coherence free_magmaF f is multiplicative by Def21; end; theorem Th44: :: ALGSTR_4:44 for X, Y, Z being non empty set for f being Function of X,Y for g being Function of Y,Z holds free_magmaF (g * f) = (free_magmaF g) * (free_magmaF f) proof let X, Y, Z be non empty set ; ::_thesis: for f being Function of X,Y for g being Function of Y,Z holds free_magmaF (g * f) = (free_magmaF g) * (free_magmaF f) let f be Function of X,Y; ::_thesis: for g being Function of Y,Z holds free_magmaF (g * f) = (free_magmaF g) * (free_magmaF f) let g be Function of Y,Z; ::_thesis: free_magmaF (g * f) = (free_magmaF g) * (free_magmaF f) set f2 = (free_magmaF g) * (free_magmaF f); reconsider f9 = (canon_image (Z,1)) * (g * f) as Function of X,(free_magma Z) by Th38; for a, b being Element of (free_magma X) holds ((free_magmaF g) * (free_magmaF f)) . (a * b) = (((free_magmaF g) * (free_magmaF f)) . a) * (((free_magmaF g) * (free_magmaF f)) . b) proof let a, b be Element of (free_magma X); ::_thesis: ((free_magmaF g) * (free_magmaF f)) . (a * b) = (((free_magmaF g) * (free_magmaF f)) . a) * (((free_magmaF g) * (free_magmaF f)) . b) a * b in the carrier of (free_magma X) ; then A1: a * b in dom ((free_magmaF g) * (free_magmaF f)) by FUNCT_2:def_1; ( a in the carrier of (free_magma X) & b in the carrier of (free_magma X) ) ; then A2: ( a in dom (free_magmaF f) & b in dom (free_magmaF f) ) by FUNCT_2:def_1; thus ((free_magmaF g) * (free_magmaF f)) . (a * b) = (free_magmaF g) . ((free_magmaF f) . (a * b)) by A1, FUNCT_1:12 .= (free_magmaF g) . (((free_magmaF f) . a) * ((free_magmaF f) . b)) by GROUP_6:def_6 .= ((free_magmaF g) . ((free_magmaF f) . a)) * ((free_magmaF g) . ((free_magmaF f) . b)) by GROUP_6:def_6 .= (((free_magmaF g) * (free_magmaF f)) . a) * ((free_magmaF g) . ((free_magmaF f) . b)) by A2, FUNCT_1:13 .= (((free_magmaF g) * (free_magmaF f)) . a) * (((free_magmaF g) * (free_magmaF f)) . b) by A2, FUNCT_1:13 ; ::_thesis: verum end; then A3: (free_magmaF g) * (free_magmaF f) is multiplicative by GROUP_6:def_6; A4: dom (f9 * ((canon_image (X,1)) ")) c= dom ((canon_image (X,1)) ") by RELAT_1:25; rng (canon_image (X,1)) c= the carrier of (free_magma X) ; then dom ((canon_image (X,1)) ") c= the carrier of (free_magma X) by FUNCT_1:33; then dom (f9 * ((canon_image (X,1)) ")) c= the carrier of (free_magma X) by A4, XBOOLE_1:1; then A5: dom (f9 * ((canon_image (X,1)) ")) c= dom ((free_magmaF g) * (free_magmaF f)) by FUNCT_2:def_1; for x being set st x in dom (f9 * ((canon_image (X,1)) ")) holds ((free_magmaF g) * (free_magmaF f)) . x = (f9 * ((canon_image (X,1)) ")) . x proof let x be set ; ::_thesis: ( x in dom (f9 * ((canon_image (X,1)) ")) implies ((free_magmaF g) * (free_magmaF f)) . x = (f9 * ((canon_image (X,1)) ")) . x ) assume A6: x in dom (f9 * ((canon_image (X,1)) ")) ; ::_thesis: ((free_magmaF g) * (free_magmaF f)) . x = (f9 * ((canon_image (X,1)) ")) . x free_magmaF f extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") by Def21; then A7: ( dom (((canon_image (Y,1)) * f) * ((canon_image (X,1)) ")) c= dom (free_magmaF f) & ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") tolerates free_magmaF f ) by Def2; A8: x in dom ((canon_image (X,1)) ") by A6, FUNCT_1:11; X c= dom f by FUNCT_2:def_1; then dom (canon_image (X,1)) c= dom f by Lm3; then rng ((canon_image (X,1)) ") c= dom f by FUNCT_1:33; then A9: x in dom (f * ((canon_image (X,1)) ")) by A8, RELAT_1:27; rng (f * ((canon_image (X,1)) ")) c= Y ; then rng (f * ((canon_image (X,1)) ")) c= dom (canon_image (Y,1)) by Lm3; then x in dom ((canon_image (Y,1)) * (f * ((canon_image (X,1)) "))) by A9, RELAT_1:27; then A10: x in dom (((canon_image (Y,1)) * f) * ((canon_image (X,1)) ")) by RELAT_1:36; set y = (f * ((canon_image (X,1)) ")) . x; free_magmaF g extends ((canon_image (Z,1)) * g) * ((canon_image (Y,1)) ") by Def21; then A11: ( dom (((canon_image (Z,1)) * g) * ((canon_image (Y,1)) ")) c= dom (free_magmaF g) & ((canon_image (Z,1)) * g) * ((canon_image (Y,1)) ") tolerates free_magmaF g ) by Def2; (f * ((canon_image (X,1)) ")) . x in rng (f * ((canon_image (X,1)) ")) by A9, FUNCT_1:3; then A12: (f * ((canon_image (X,1)) ")) . x in Y ; then A13: (f * ((canon_image (X,1)) ")) . x in dom (canon_image (Y,1)) by Lm3; then A14: (canon_image (Y,1)) . ((f * ((canon_image (X,1)) ")) . x) in rng (canon_image (Y,1)) by FUNCT_1:3; Y c= dom g by FUNCT_2:def_1; then A15: dom (canon_image (Y,1)) c= dom g by Lm3; rng g c= Z ; then rng g c= dom (canon_image (Z,1)) by Lm3; then dom (canon_image (Y,1)) c= dom ((canon_image (Z,1)) * g) by A15, RELAT_1:27; then A16: rng ((canon_image (Y,1)) ") c= dom ((canon_image (Z,1)) * g) by FUNCT_1:33; rng (canon_image (Y,1)) c= dom ((canon_image (Y,1)) ") by FUNCT_1:33; then A17: rng (canon_image (Y,1)) c= dom (((canon_image (Z,1)) * g) * ((canon_image (Y,1)) ")) by A16, RELAT_1:27; A18: rng (canon_image (Y,1)) c= dom ((canon_image (Y,1)) ") by FUNCT_1:33; dom (canon_image (Y,1)) = Y by Lm3; then A19: (f * ((canon_image (X,1)) ")) . x in dom (((canon_image (Y,1)) ") * (canon_image (Y,1))) by A12, A18, RELAT_1:27; A20: ((canon_image (Z,1)) * g) * (f * ((canon_image (X,1)) ")) = (canon_image (Z,1)) * (g * (f * ((canon_image (X,1)) "))) by RELAT_1:36 .= (canon_image (Z,1)) * ((g * f) * ((canon_image (X,1)) ")) by RELAT_1:36 .= ((canon_image (Z,1)) * (g * f)) * ((canon_image (X,1)) ") by RELAT_1:36 ; thus ((free_magmaF g) * (free_magmaF f)) . x = (free_magmaF g) . ((free_magmaF f) . x) by A6, A5, FUNCT_1:12 .= (free_magmaF g) . ((((canon_image (Y,1)) * f) * ((canon_image (X,1)) ")) . x) by A10, A7, PARTFUN1:53 .= (free_magmaF g) . (((canon_image (Y,1)) * (f * ((canon_image (X,1)) "))) . x) by RELAT_1:36 .= (free_magmaF g) . ((canon_image (Y,1)) . ((f * ((canon_image (X,1)) ")) . x)) by A9, FUNCT_1:13 .= (((canon_image (Z,1)) * g) * ((canon_image (Y,1)) ")) . ((canon_image (Y,1)) . ((f * ((canon_image (X,1)) ")) . x)) by A17, A14, A11, PARTFUN1:53 .= ((((canon_image (Z,1)) * g) * ((canon_image (Y,1)) ")) * (canon_image (Y,1))) . ((f * ((canon_image (X,1)) ")) . x) by A13, FUNCT_1:13 .= (((canon_image (Z,1)) * g) * (((canon_image (Y,1)) ") * (canon_image (Y,1)))) . ((f * ((canon_image (X,1)) ")) . x) by RELAT_1:36 .= ((canon_image (Z,1)) * g) . ((((canon_image (Y,1)) ") * (canon_image (Y,1))) . ((f * ((canon_image (X,1)) ")) . x)) by A19, FUNCT_1:13 .= ((canon_image (Z,1)) * g) . ((f * ((canon_image (X,1)) ")) . x) by A13, FUNCT_1:34 .= (f9 * ((canon_image (X,1)) ")) . x by A20, A9, FUNCT_1:13 ; ::_thesis: verum end; then (free_magmaF g) * (free_magmaF f) tolerates f9 * ((canon_image (X,1)) ") by A5, PARTFUN1:53; then (free_magmaF g) * (free_magmaF f) extends f9 * ((canon_image (X,1)) ") by A5, Def2; hence free_magmaF (g * f) = (free_magmaF g) * (free_magmaF f) by Def21, A3; ::_thesis: verum end; theorem Th45: :: ALGSTR_4:45 for X, Z, Y being non empty set for f being Function of X,Y for g being Function of X,Z st Y c= Z & f = g holds free_magmaF f = free_magmaF g proof let X, Z, Y be non empty set ; ::_thesis: for f being Function of X,Y for g being Function of X,Z st Y c= Z & f = g holds free_magmaF f = free_magmaF g let f be Function of X,Y; ::_thesis: for g being Function of X,Z st Y c= Z & f = g holds free_magmaF f = free_magmaF g let g be Function of X,Z; ::_thesis: ( Y c= Z & f = g implies free_magmaF f = free_magmaF g ) assume A1: Y c= Z ; ::_thesis: ( not f = g or free_magmaF f = free_magmaF g ) assume A2: f = g ; ::_thesis: free_magmaF f = free_magmaF g A3: the carrier of (free_magma Y) c= the carrier of (free_magma Z) by A1, Th27; then reconsider f9 = free_magmaF f as Function of (free_magma X),(free_magma Z) by FUNCT_2:7; for a, b being Element of (free_magma X) holds f9 . (a * b) = (f9 . a) * (f9 . b) proof let a, b be Element of (free_magma X); ::_thesis: f9 . (a * b) = (f9 . a) * (f9 . b) set v = (free_magmaF f) . a; set w = (free_magmaF f) . b; ( (free_magmaF f) . a in the carrier of (free_magma Y) & (free_magmaF f) . b in the carrier of (free_magma Y) ) ; then reconsider v9 = (free_magmaF f) . a, w9 = (free_magmaF f) . b as Element of (free_magma Z) by A3; A4: length ((free_magmaF f) . a) = ((free_magmaF f) . a) `2 by Def18 .= length v9 by Def18 ; A5: length ((free_magmaF f) . b) = ((free_magmaF f) . b) `2 by Def18 .= length w9 by Def18 ; thus f9 . (a * b) = ((free_magmaF f) . a) * ((free_magmaF f) . b) by GROUP_6:def_6 .= [[[(v9 `1),(w9 `1)],(v9 `2)],((length v9) + (length w9))] by Th31, A4, A5 .= (f9 . a) * (f9 . b) by Th31 ; ::_thesis: verum end; then A6: f9 is multiplicative by GROUP_6:def_6; rng g c= Z ; then rng g c= dom (canon_image (Z,1)) by Lm3; then A7: dom ((canon_image (Z,1)) * g) = dom g by RELAT_1:27; X c= dom g by FUNCT_2:def_1; then dom (canon_image (X,1)) c= dom ((canon_image (Z,1)) * g) by Lm3, A7; then rng ((canon_image (X,1)) ") c= dom ((canon_image (Z,1)) * g) by FUNCT_1:33; then A8: dom (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) = dom ((canon_image (X,1)) ") by RELAT_1:27; rng (canon_image (X,1)) c= the carrier of (free_magma X) ; then dom (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) c= the carrier of (free_magma X) by A8, FUNCT_1:33; then A9: dom (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) c= dom f9 by FUNCT_2:def_1; for x being set st x in dom (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) holds f9 . x = (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) . x proof let x be set ; ::_thesis: ( x in dom (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) implies f9 . x = (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) . x ) assume A10: x in dom (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) ; ::_thesis: f9 . x = (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) . x free_magmaF f extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") by Def21; then A11: ( dom (((canon_image (Y,1)) * f) * ((canon_image (X,1)) ")) c= dom (free_magmaF f) & ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") tolerates free_magmaF f ) by Def2; rng f c= Y ; then A12: rng f c= dom (canon_image (Y,1)) by Lm3; rng f c= Z by A1, XBOOLE_1:1; then A13: rng f c= dom (canon_image (Z,1)) by Lm3; A14: dom ((canon_image (Y,1)) * f) = dom f by A12, RELAT_1:27 .= dom ((canon_image (Z,1)) * f) by A13, RELAT_1:27 ; for x being set st x in dom ((canon_image (Y,1)) * f) holds ((canon_image (Y,1)) * f) . x = ((canon_image (Z,1)) * f) . x proof let x be set ; ::_thesis: ( x in dom ((canon_image (Y,1)) * f) implies ((canon_image (Y,1)) * f) . x = ((canon_image (Z,1)) * f) . x ) assume A15: x in dom ((canon_image (Y,1)) * f) ; ::_thesis: ((canon_image (Y,1)) * f) . x = ((canon_image (Z,1)) * f) . x then A16: f . x in dom (canon_image (Y,1)) by FUNCT_1:11; then A17: f . x in Y by Lm3; thus ((canon_image (Y,1)) * f) . x = (canon_image (Y,1)) . (f . x) by A15, FUNCT_1:12 .= [(f . x),1] by A16, Def19 .= (canon_image (Z,1)) . (f . x) by A1, A17, Lm3 .= ((canon_image (Z,1)) * f) . x by A14, A15, FUNCT_1:12 ; ::_thesis: verum end; then (canon_image (Y,1)) * f = (canon_image (Z,1)) * g by A2, A14, FUNCT_1:2; hence f9 . x = (((canon_image (Z,1)) * g) * ((canon_image (X,1)) ")) . x by A10, A11, PARTFUN1:53; ::_thesis: verum end; then f9 tolerates ((canon_image (Z,1)) * g) * ((canon_image (X,1)) ") by A9, PARTFUN1:53; then f9 extends ((canon_image (Z,1)) * g) * ((canon_image (X,1)) ") by A9, Def2; hence free_magmaF f = free_magmaF g by A6, Def21; ::_thesis: verum end; theorem Th46: :: ALGSTR_4:46 for Y, X being non empty set for f being Function of X,Y holds free_magmaF (id X) = id (dom (free_magmaF f)) proof let Y, X be non empty set ; ::_thesis: for f being Function of X,Y holds free_magmaF (id X) = id (dom (free_magmaF f)) let f be Function of X,Y; ::_thesis: free_magmaF (id X) = id (dom (free_magmaF f)) dom (free_magmaF (id X)) = the carrier of (free_magma X) by FUNCT_2:def_1; then A1: dom (free_magmaF (id X)) = dom (free_magmaF f) by FUNCT_2:def_1; for x being set st x in dom (free_magmaF f) holds (free_magmaF (id X)) . x = x proof let x be set ; ::_thesis: ( x in dom (free_magmaF f) implies (free_magmaF (id X)) . x = x ) assume A2: x in dom (free_magmaF f) ; ::_thesis: (free_magmaF (id X)) . x = x defpred S1[ Nat] means for w being Element of (free_magma X) st length w = \$1 holds (free_magmaF (id X)) . w = w; A3: for k being Nat st ( for n being Nat st n < k holds S1[n] ) holds S1[k] proof let k be Nat; ::_thesis: ( ( for n being Nat st n < k holds S1[n] ) implies S1[k] ) assume A4: for n being Nat st n < k holds S1[n] ; ::_thesis: S1[k] thus for w being Element of (free_magma X) st length w = k holds (free_magmaF (id X)) . w = w ::_thesis: verum proof let w be Element of (free_magma X); ::_thesis: ( length w = k implies (free_magmaF (id X)) . w = w ) assume A5: length w = k ; ::_thesis: (free_magmaF (id X)) . w = w A6: ( w = [(w `1),(w `2)] & length w >= 1 ) by Th32; then ( length w = 1 or length w > 1 ) by XXREAL_0:1; then A7: ( length w = 1 or (length w) + 1 > 1 + 1 ) by XREAL_1:8; percases ( length w = 1 or length w >= 2 ) by A7, NAT_1:13; supposeA8: length w = 1 ; ::_thesis: (free_magmaF (id X)) . w = w set y = w `1 ; w `1 in { (w9 `1) where w9 is Element of (free_magma X) : length w9 = 1 } by A8; then A9: w `1 in X by Th30; then A10: w `1 in dom (id X) ; free_magmaF (id X) extends ((canon_image (X,1)) * (id X)) * ((canon_image (X,1)) ") by Def21; then A11: ( dom (((canon_image (X,1)) * (id X)) * ((canon_image (X,1)) ")) c= dom (free_magmaF (id X)) & ((canon_image (X,1)) * (id X)) * ((canon_image (X,1)) ") tolerates free_magmaF (id X) ) by Def2; A12: (canon_image (X,1)) . (w `1) = [(w `1),1] by A9, Lm3 .= w by Def18, A6, A8 ; A13: w `1 in dom (canon_image (X,1)) by A9, Lm3; then w in rng (canon_image (X,1)) by A12, FUNCT_1:3; then A14: w in dom ((canon_image (X,1)) ") by FUNCT_1:33; rng (id X) = X .= dom (canon_image (X,1)) by Lm3 ; then dom ((canon_image (X,1)) * (id X)) = dom (id X) by RELAT_1:27; then X = dom ((canon_image (X,1)) * (id X)) ; then dom (canon_image (X,1)) c= dom ((canon_image (X,1)) * (id X)) by Lm3; then rng ((canon_image (X,1)) ") c= dom ((canon_image (X,1)) * (id X)) by FUNCT_1:33; then A15: w in dom (((canon_image (X,1)) * (id X)) * ((canon_image (X,1)) ")) by A14, RELAT_1:27; ((canon_image (X,1)) ") . w = w `1 by A13, A12, FUNCT_1:34; then (((canon_image (X,1)) * (id X)) * ((canon_image (X,1)) ")) . w = ((canon_image (X,1)) * (id X)) . (w `1) by A15, FUNCT_1:12 .= (canon_image (X,1)) . ((id X) . (w `1)) by A10, FUNCT_1:13 .= w by A12, A9, FUNCT_1:18 ; hence (free_magmaF (id X)) . w = w by A15, A11, PARTFUN1:53; ::_thesis: verum end; suppose length w >= 2 ; ::_thesis: (free_magmaF (id X)) . w = w then consider w1, w2 being Element of (free_magma X) such that A16: ( w = w1 * w2 & length w1 < length w & length w2 < length w ) by Th34; thus (free_magmaF (id X)) . w = ((free_magmaF (id X)) . w1) * ((free_magmaF (id X)) . w2) by A16, GROUP_6:def_6 .= w1 * ((free_magmaF (id X)) . w2) by A4, A5, A16 .= w by A4, A5, A16 ; ::_thesis: verum end; end; end; end; A17: for k being Nat holds S1[k] from NAT_1:sch_4(A3); for w being Element of (free_magma X) holds (free_magmaF (id X)) . w = w proof let w be Element of (free_magma X); ::_thesis: (free_magmaF (id X)) . w = w reconsider k = length w as Nat ; S1[k] by A17; hence (free_magmaF (id X)) . w = w ; ::_thesis: verum end; hence (free_magmaF (id X)) . x = x by A2; ::_thesis: verum end; hence free_magmaF (id X) = id (dom (free_magmaF f)) by A1, FUNCT_1:17; ::_thesis: verum end; theorem :: ALGSTR_4:47 for X, Y being non empty set for f being Function of X,Y st f is one-to-one holds free_magmaF f is one-to-one proof let X, Y be non empty set ; ::_thesis: for f being Function of X,Y st f is one-to-one holds free_magmaF f is one-to-one let f be Function of X,Y; ::_thesis: ( f is one-to-one implies free_magmaF f is one-to-one ) assume A1: f is one-to-one ; ::_thesis: free_magmaF f is one-to-one then A2: (f ") * f = id (dom f) by FUNCT_1:39; set Y9 = rng f; dom f = X by FUNCT_2:def_1; then reconsider f1 = f as Function of X,(rng f) by FUNCT_2:1; reconsider f2 = f1 " as Function of (rng f),X by A1, FUNCT_2:25; f2 * f1 = id X by A2, FUNCT_2:def_1; then (free_magmaF f2) * (free_magmaF f1) = free_magmaF (id X) by Th44; then (free_magmaF f2) * (free_magmaF f) = free_magmaF (id X) by Th45; then (free_magmaF f2) * (free_magmaF f) = id (dom (free_magmaF f)) by Th46; hence free_magmaF f is one-to-one by FUNCT_1:31; ::_thesis: verum end; theorem :: ALGSTR_4:48 for X, Y being non empty set for f being Function of X,Y st f is onto holds free_magmaF f is onto proof let X, Y be non empty set ; ::_thesis: for f being Function of X,Y st f is onto holds free_magmaF f is onto let f be Function of X,Y; ::_thesis: ( f is onto implies free_magmaF f is onto ) assume A1: f is onto ; ::_thesis: free_magmaF f is onto for y being set st y in the carrier of (free_magma Y) holds y in rng (free_magmaF f) proof let y be set ; ::_thesis: ( y in the carrier of (free_magma Y) implies y in rng (free_magmaF f) ) assume A2: y in the carrier of (free_magma Y) ; ::_thesis: y in rng (free_magmaF f) defpred S1[ Nat] means for w being Element of (free_magma Y) st length w = \$1 holds ex v being Element of (free_magma X) st w = (free_magmaF f) . v; A3: for k being Nat st ( for n being Nat st n < k holds S1[n] ) holds S1[k] proof let k be Nat; ::_thesis: ( ( for n being Nat st n < k holds S1[n] ) implies S1[k] ) assume A4: for n being Nat st n < k holds S1[n] ; ::_thesis: S1[k] thus for w being Element of (free_magma Y) st length w = k holds ex v being Element of (free_magma X) st w = (free_magmaF f) . v ::_thesis: verum proof let w be Element of (free_magma Y); ::_thesis: ( length w = k implies ex v being Element of (free_magma X) st w = (free_magmaF f) . v ) assume A5: length w = k ; ::_thesis: ex v being Element of (free_magma X) st w = (free_magmaF f) . v A6: ( w = [(w `1),(w `2)] & length w >= 1 ) by Th32; then ( length w = 1 or length w > 1 ) by XXREAL_0:1; then A7: ( length w = 1 or (length w) + 1 > 1 + 1 ) by XREAL_1:8; percases ( length w = 1 or length w >= 2 ) by A7, NAT_1:13; supposeA8: length w = 1 ; ::_thesis: ex v being Element of (free_magma X) st w = (free_magmaF f) . v set y = w `1 ; w `1 in { (w9 `1) where w9 is Element of (free_magma Y) : length w9 = 1 } by A8; then A9: w `1 in Y by Th30; free_magmaF f extends ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") by Def21; then A10: ( dom (((canon_image (Y,1)) * f) * ((canon_image (X,1)) ")) c= dom (free_magmaF f) & ((canon_image (Y,1)) * f) * ((canon_image (X,1)) ") tolerates free_magmaF f ) by Def2; A11: (canon_image (Y,1)) . (w `1) = [(w `1),1] by A9, Lm3 .= w by Def18, A6, A8 ; A12: rng f = Y by A1, FUNCT_2:def_3; then consider x being set such that A13: ( x in dom f & w `1 = f . x ) by A9, FUNCT_1:def_3; A14: 1 in {1} by TARSKI:def_1; A15: x in X by A13; then x in free_magma (X,1) by Def13; then A16: [x,1] in [:(free_magma (X,1)),{1}:] by A14, ZFMISC_1:def_2; [:(free_magma (X,1)),{1}:] c= free_magma_carrier X by Lm1; then reconsider v = [x,1] as Element of (free_magma X) by A16; take v ; ::_thesis: w = (free_magmaF f) . v A17: x in dom (canon_image (X,1)) by Lm3, A15; A18: v = (canon_image (X,1)) . x by Lm3, A13; then v in rng (canon_image (X,1)) by A17, FUNCT_1:3; then A19: v in dom ((canon_image (X,1)) ") by FUNCT_1:33; rng f = dom (canon_image (Y,1)) by Lm3, A12; then dom f = dom ((canon_image (Y,1)) * f) by RELAT_1:27; then X c= dom ((canon_image (Y,1)) * f) by FUNCT_2:def_1; then dom (canon_image (X,1)) c= dom ((canon_image (Y,1)) * f) by Lm3; then rng ((canon_image (X,1)) ") c= dom ((canon_image (Y,1)) * f) by FUNCT_1:33; then A20: v in dom (((canon_image (Y,1)) * f) * ((canon_image (X,1)) ")) by A19, RELAT_1:27; then A21: (free_magmaF f) . v = (((canon_image (Y,1)) * f) * ((canon_image (X,1)) ")) . v by A10, PARTFUN1:53 .= ((canon_image (Y,1)) * f) . (((canon_image (X,1)) ") . v) by A20, FUNCT_1:12 ; x in dom (canon_image (X,1)) by A15, Lm3; then ((canon_image (X,1)) ") . v = x by A18, FUNCT_1:34; hence w = (free_magmaF f) . v by A11, A13, A21, FUNCT_1:13; ::_thesis: verum end; suppose length w >= 2 ; ::_thesis: ex v being Element of (free_magma X) st w = (free_magmaF f) . v then consider w1, w2 being Element of (free_magma Y) such that A22: ( w = w1 * w2 & length w1 < length w & length w2 < length w ) by Th34; consider v1 being Element of (free_magma X) such that A23: w1 = (free_magmaF f) . v1 by A22, A4, A5; consider v2 being Element of (free_magma X) such that A24: w2 = (free_magmaF f) . v2 by A22, A4, A5; take v1 * v2 ; ::_thesis: w = (free_magmaF f) . (v1 * v2) thus w = (free_magmaF f) . (v1 * v2) by A23, A24, A22, GROUP_6:def_6; ::_thesis: verum end; end; end; end; A25: for k being Nat holds S1[k] from NAT_1:sch_4(A3); A26: for w being Element of (free_magma Y) ex v being Element of (free_magma X) st w = (free_magmaF f) . v proof let w be Element of (free_magma Y); ::_thesis: ex v being Element of (free_magma X) st w = (free_magmaF f) . v reconsider k = length w as Nat ; S1[k] by A25; hence ex v being Element of (free_magma X) st w = (free_magmaF f) . v ; ::_thesis: verum end; ex x being set st ( x in dom (free_magmaF f) & y = (free_magmaF f) . x ) proof consider x being Element of (free_magma X) such that A27: y = (free_magmaF f) . x by A2, A26; take x ; ::_thesis: ( x in dom (free_magmaF f) & y = (free_magmaF f) . x ) x in the carrier of (free_magma X) ; hence x in dom (free_magmaF f) by FUNCT_2:def_1; ::_thesis: y = (free_magmaF f) . x thus y = (free_magmaF f) . x by A27; ::_thesis: verum end; hence y in rng (free_magmaF f) by FUNCT_1:def_3; ::_thesis: verum end; then the carrier of (free_magma Y) c= rng (free_magmaF f) by TARSKI:def_3; then rng (free_magmaF f) = the carrier of (free_magma Y) by XBOOLE_0:def_10; hence free_magmaF f is onto by FUNCT_2:def_3; ::_thesis: verum end;