reserve x,y for object;
reserve S for non void non empty ManySortedSign,
  o for OperSymbol of S,
  U0,U1, U2 for MSAlgebra over S;
reserve U0 for non-empty MSAlgebra over S;

theorem Th30:
  MSAlg_join(U0) is associative
proof
  set o = MSAlg_join(U0);
  for x,y,z be Element of MSSub(U0) holds o.(x,o.(y,z))=o.(o.(x,y),z)
  proof
    let x,y,z be Element of MSSub(U0);
    reconsider U1=x,U2=y,U3=z as strict MSSubAlgebra of U0 by Def19;
    set B=(the Sorts of U1) (\/) ((the Sorts of U2) (\/) (the Sorts of U3));
A1: o.(x,y)=U1"\/"U2 by Def20;
    the Sorts of U2 is MSSubset of U0 by Def9;
    then
A2: the Sorts of U2 c=the Sorts of U0 by PBOOLE:def 18;
    the Sorts of U3 is MSSubset of U0 by Def9;
    then the Sorts of U3 c=the Sorts of U0 by PBOOLE:def 18;
    then
A3: (the Sorts of U2) (\/) (the Sorts of U3) c= the Sorts of U0
     by A2,PBOOLE:16;
    then reconsider
    C =(the Sorts of U2) (\/) (the Sorts of U3) as MSSubset of U0 by
PBOOLE:def 18;
    the Sorts of U1 is MSSubset of U0 by Def9;
    then
A4: the Sorts of U1 c=the Sorts of U0 by PBOOLE:def 18;
    then
A5: B c= the Sorts of U0 by A3,PBOOLE:16;
    (the Sorts of U1) (\/) (the Sorts of U2) c= the Sorts of U0 by A4,A2,
PBOOLE:16;
    then reconsider D = (the Sorts of U1) (\/) (the Sorts of U2)
       as MSSubset of U0 by PBOOLE:def 18;
    reconsider B as MSSubset of U0 by A5,PBOOLE:def 18;
A6: B= D (\/) (the Sorts of U3) by PBOOLE:28;
A7: (U1"\/"U2)"\/"U3 = GenMSAlg(D)"\/" U3 by Def18
      .= GenMSAlg(B) by A6,Th24;
    o.(y,z)=U2"\/"U3 by Def20;
    then
A8: o.(x,o.(y,z)) = U1 "\/" (U2"\/"U3) by Def20;
    U1"\/" (U2"\/"U3) = U1 "\/"(GenMSAlg(C)) by Def18
      .=(GenMSAlg(C)) "\/" U1 by Th26
      .= GenMSAlg(B) by Th24;
    hence thesis by A1,A8,A7,Def20;
  end;
  hence thesis by BINOP_1:def 3;
end;
