reserve a for set,
  i for Nat;
reserve MS for segmental non void 1-element ManySortedSign,
  A for non-empty MSAlgebra over MS;

theorem Th21:
  for S being non empty non void ManySortedSign, A,B being
  MSAlgebra over S holds A is MSSubAlgebra of B iff A is MSSubAlgebra of the
  MSAlgebra of B
proof
  let S be non empty non void ManySortedSign, A,B be MSAlgebra over S;
  thus A is MSSubAlgebra of B implies A is MSSubAlgebra of the MSAlgebra of B
  proof
    assume
A1: A is MSSubAlgebra of B;
    hence the Sorts of A is MSSubset of the MSAlgebra of B by MSUALG_2:def 9;
    thus for BB be MSSubset of the MSAlgebra of B st BB = the Sorts of A holds
    BB is opers_closed & the Charact of A = Opers(the MSAlgebra of B,BB)
    proof
      let BB be MSSubset of the MSAlgebra of B such that
A2:   BB = the Sorts of A;
      reconsider bb = BB as MSSubset of B;
A3:   bb is opers_closed by A1,A2,MSUALG_2:def 9;
A4:   BB is opers_closed
      proof
        let o be OperSymbol of S;
A5:     Den(o,B) = (the Charact of the MSAlgebra of B).o by MSUALG_1:def 6
          .= Den(o,the MSAlgebra of B) by MSUALG_1:def 6;
        bb is_closed_on o by A3;
        then
        rng ((Den(o,the MSAlgebra of B))|((BB# * the Arity of S).o) ) c= (
        BB * the ResultSort of S).o by A5;
        hence thesis;
      end;
      for o be object st o in the carrier' of S holds (the Charact of A).o =
      (Opers(the MSAlgebra of B,BB)).o
      proof
        let o be object;
        assume o in the carrier' of S;
        then reconsider o as OperSymbol of S;
A6:     Den(o,B) = (the Charact of the MSAlgebra of B).o by MSUALG_1:def 6
          .= Den(o,the MSAlgebra of B) by MSUALG_1:def 6;
A7:     bb is_closed_on o by A3;
A8:     BB is_closed_on o by A4;
        (Opers(B,bb)).o = o/.bb by MSUALG_2:def 8
          .= (Den(o,the MSAlgebra of B))|((BB# * the Arity of S).o) by A6,A7,
MSUALG_2:def 7
          .= o/.BB by A8,MSUALG_2:def 7
          .= (Opers(the MSAlgebra of B,BB)).o by MSUALG_2:def 8;
        hence thesis by A1,A2,MSUALG_2:def 9;
      end;
      hence thesis by A4;
    end;
  end;
  assume
A9: A is MSSubAlgebra of the MSAlgebra of B;
  hence the Sorts of A is MSSubset of B by MSUALG_2:def 9;
  let C be MSSubset of B such that
A10: C = the Sorts of A;
  reconsider CC = C as MSSubset of the MSAlgebra of B;
A11: CC is opers_closed by A9,A10,MSUALG_2:def 9;
A12: C is opers_closed
  proof
    let o be OperSymbol of S;
A13: Den(o,B) = (the Charact of the MSAlgebra of B).o by MSUALG_1:def 6
      .= Den(o,the MSAlgebra of B) by MSUALG_1:def 6;
    CC is_closed_on o by A11;
    then rng ((Den(o,B))|((C# * the Arity of S).o)) c= (C * the ResultSort of
    S).o by A13;
    hence thesis;
  end;
  for o be object st o in the carrier' of S holds (the Charact of A).o = (
  Opers(B,C)).o
  proof
    let o be object;
    assume o in the carrier' of S;
    then reconsider o as OperSymbol of S;
A14: Den(o,B) = (the Charact of the MSAlgebra of B).o by MSUALG_1:def 6
      .= Den(o,the MSAlgebra of B) by MSUALG_1:def 6;
A15: CC is_closed_on o by A11;
A16: C is_closed_on o by A12;
    (Opers(the MSAlgebra of B,CC)).o = o/.CC by MSUALG_2:def 8
      .= (Den(o,B))|((C# * the Arity of S).o) by A14,A15,MSUALG_2:def 7
      .= o/.C by A16,MSUALG_2:def 7
      .= (Opers(B,C)).o by MSUALG_2:def 8;
    hence thesis by A9,A10,MSUALG_2:def 9;
  end;
  hence thesis by A12;
end;
