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

theorem Th30:
  for A being strict Universal_Algebra, a1,b1 be strict non-empty
  SubAlgebra of A, a2,b2 being strict non-empty MSSubAlgebra of MSAlg A st a2 =
  MSAlg a1 & b2 = MSAlg b1 holds MSAlg (a1 "\/" b1) = a2 "\/" b2
proof
  let A be strict Universal_Algebra;
  let a1,b1 be strict non-empty SubAlgebra of A;
  reconsider MSA = MSAlg (a1"\/"b1) as MSSubAlgebra of MSAlg A by Th12;
  let a2,b2 be strict non-empty MSSubAlgebra of MSAlg A such that
A1: a2 = MSAlg a1 and
A2: b2 = MSAlg b1;
  MSSign (a1"\/"b1) = MSSign A by Th7;
  then reconsider MSA as strict non-empty MSSubAlgebra of MSAlg A;
  for B be MSSubset of MSAlg A st B = (the Sorts of a2) (\/) (the Sorts of
  b2) holds MSA = GenMSAlg(B)
  proof
    the carrier of a1 is Subset of A & the carrier of b1 is Subset of A by
UNIALG_2:def 7;
    then reconsider
    K = (the carrier of a1) \/ (the carrier of b1) as non empty
    Subset of A by XBOOLE_1:8;
    reconsider ff1 = (*-->0)*(signature A) as Function of dom signature A, {0}
    * by MSUALG_1:2;
    set X = MSA;
    reconsider M1 = the Sorts of X as ManySortedSet of the carrier of MSSign A;
A3: MSSign A = ManySortedSign (#{0},dom signature(A),ff1,dom signature(A)
      -->z#) by MSUALG_1:10;
    then reconsider x = 0 as Element of MSSign A;
    let B be MSSubset of MSAlg A such that
A4: B = (the Sorts of a2) (\/) (the Sorts of b2);
A5: for U1 be MSSubAlgebra of MSAlg A st B is MSSubset of U1 holds X is
    MSSubAlgebra of U1
    proof
      let U1 be MSSubAlgebra of MSAlg A;
      assume
A6:   B is MSSubset of U1;
      per cases;
      suppose
        U1 is non-empty;
        then reconsider U11=U1 as non-empty MSSubAlgebra of MSAlg A;
A7:     1-Alg U11 is SubAlgebra of 1-Alg MSAlg A by Th20;
        then reconsider A1 = 1-Alg U11 as strict SubAlgebra of A by MSUALG_1:9;
        B c= the Sorts of U11 by A6,PBOOLE:def 18;
        then
A8:     B.x c= (the Sorts of U11).x;
        the MSAlgebra of U11 = MSAlg (1-Alg U11) & MSAlg (1-Alg U11) =
MSAlgebra(# MSSorts (1-Alg U11),MSCharact (1-Alg U11)#) by A3,Th26,
MSUALG_1:def 11;
        then
A9:     (the Sorts of U11).0 = (0 .--> the carrier of 1-Alg U11).0 by
MSUALG_1:def 9;
        B.0 = (0.--> K).0 by A1,A2,A4,Th28
          .= K by FUNCOP_1:72;
        then (the carrier of a1) \/ the carrier of b1 c= the carrier of A1 by
A8,A9,FUNCOP_1:72;
        then GenUnivAlg K is SubAlgebra of 1-Alg U11 by UNIALG_2:def 12;
        then a1"\/"b1 is SubAlgebra of 1-Alg U11 by UNIALG_2:def 13;
        then
A10:    MSA is MSSubAlgebra of MSAlg(1-Alg U11) by Th12;
        1-Alg U11 is SubAlgebra of A by A7,MSUALG_1:9;
        then MSSign A = MSSign 1-Alg U11 by Th7;
        then X is MSSubAlgebra of the MSAlgebra of U11 by A3,A10,Th26;
        hence thesis by Th21;
      end;
      suppose
        not U1 is non-empty;
        then the Sorts of U1 is non non-empty by MSUALG_1:def 3;
        then
A11:    ex i be object st i in the carrier of MSSign A & (the Sorts of U1).i
        is empty;
        reconsider
        0a1=0.-->the carrier of a1 as ManySortedSet of the carrier
        of MSSign A by A3;
        set e = the Element of a1;
        B c= the Sorts of U1 by A6,PBOOLE:def 18;
        then
A12:    B.x c= (the Sorts of U1).x;
        a2=MSAlgebra(#MSSorts a1,MSCharact a1#) by A1,MSUALG_1:def 11;
        then B = 0a1 (\/) (the Sorts of b2) by A4,MSUALG_1:def 9;
        then
A13:    B.x = 0a1.x \/ (the Sorts of b2).x by PBOOLE:def 4;
        x in {0} by TARSKI:def 1;
        then 0a1.x = the carrier of a1 by FUNCOP_1:7;
        then e in B.x by A13,XBOOLE_0:def 3;
        hence thesis by A3,A11,A12,TARSKI:def 1;
      end;
    end;
    X = MSAlgebra(#MSSorts (a1"\/"b1),MSCharact (a1"\/"b1)#) by MSUALG_1:def 11
;
    then
A14: the Sorts of X = 0 .--> the carrier of a1"\/"b1 by MSUALG_1:def 9;
    (the Sorts of a2) (\/) (the Sorts of b2) c= M1
    proof
      let x be object;
A15:  a1"\/"b1 = GenUnivAlg K by UNIALG_2:def 13;
      assume
A16:  x in the carrier of MSSign A;
      then
A17:  M1.x = (0 .--> the carrier of a1"\/"b1).0 by A14,A3,TARSKI:def 1
        .= the carrier of a1"\/"b1 by FUNCOP_1:72;
      ((the Sorts of a2) (\/) (the Sorts of b2)).x = ((the Sorts of a2) (\/)
      (the Sorts of b2)).0 by A3,A16,TARSKI:def 1
        .= (0 .--> ((the carrier of a1) \/ (the carrier of b1))).0 by A1,A2
,Th28
        .= (the carrier of a1) \/ (the carrier of b1) by FUNCOP_1:72;
      hence thesis by A17,A15,UNIALG_2:def 12;
    end;
    then B is MSSubset of X by A4,PBOOLE:def 18;
    hence thesis by A5,MSUALG_2:def 17;
  end;
  hence thesis by MSUALG_2:def 18;
end;
