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

theorem
  for A being with_const_op Universal_Algebra holds UnSubAlLattice the
  UAStr of A, MSSubAlLattice MSAlg the UAStr of A are_isomorphic
proof
  let Z be with_const_op Universal_Algebra;
  set A = the UAStr of Z;
  reconsider ff1 = (*-->0)*(signature A) as Function of dom signature A, {0}*
  by MSUALG_1:2;
A1: MSSign A = ManySortedSign (#{0},dom signature(A),ff1,dom signature(A)-->
    z#) by MSUALG_1:10;
  defpred P[set,set] means ex A1 be strict SubAlgebra of A st A1= $1 & $2=
  MSAlg A1;
A2: for x being Element of Sub A ex y being Element of MSSub MSAlg A st P[x, y]
  proof
    let x be Element of Sub A;
    reconsider B = x as strict SubAlgebra of A by UNIALG_2:def 14;
    MSSign A = MSSign B by Th7;
    then MSAlg B is strict non-empty MSSubAlgebra of MSAlg A by Th12;
    then reconsider y = MSAlg B as Element of MSSub MSAlg A by MSUALG_2:def 19;
    take y, B;
    thus thesis;
  end;
  consider f being Function of Sub A,MSSub MSAlg A such that
A3: for x being Element of Sub A holds P[x,f.x] from FUNCT_2:sch 3(A2);
  reconsider f as Function of the carrier of UnSubAlLattice A, the carrier of
  MSSubAlLattice MSAlg A;
  f is Homomorphism of UnSubAlLattice A, MSSubAlLattice MSAlg A
  proof
AA: f is "\/"-preserving
    proof
    let a1,b1 be Element of UnSubAlLattice A;
    reconsider a2=a1,b2=b1 as Element of Sub A;
    reconsider a3=a2,b3=b2 as strict non-empty SubAlgebra of A
    by UNIALG_2:def 14;
    reconsider s=a3"\/"b3 as Element of Sub A by UNIALG_2:def 14;
    reconsider m= a3 /\ b3 as Element of Sub A by UNIALG_2:def 14;
A4: ex A1 be strict non-empty SubAlgebra of A st A1= s & f.s = MSAlg A1 by A3;
    MSSign b3 = MSSign A by Th7;
    then reconsider
    g2 = MSAlg b3 as strict non-empty MSSubAlgebra of MSAlg A by Th12;
    consider A4 be strict non-empty SubAlgebra of A such that
A5: A4=b3 and
A6: f.b3= MSAlg A4 by A3;
    MSSign A4 = MSSign A by Th7;
    then reconsider
    g3= MSAlg A4 as strict non-empty MSSubAlgebra of MSAlg A by Th12;
    MSSign a3 = MSSign A by Th7;
    then reconsider
    g1 = MSAlg a3 as strict non-empty MSSubAlgebra of MSAlg A by Th12;
    consider A3 be strict non-empty SubAlgebra of A such that
A7: A3=a3 and
A8: f.a3= MSAlg A3 by A3;
    MSSign A3 = MSSign A by Th7;
    then reconsider
    g4= MSAlg A3 as strict non-empty MSSubAlgebra of MSAlg A by Th12;
    thus f.(a1 "\/" b1) = f.((UniAlg_join A).(a2,b2)) by LATTICES:def 1
      .= MSAlg (a3"\/"b3) by A4,UNIALG_2:def 15
      .= g4 "\/" g3 by A7,A5,Th30
      .= (the L_join of MSSubAlLattice MSAlg A).(f.a1,f.b1) by A8,A6,
MSUALG_2:def 20
      .= f.a1 "\/" f.b1 by LATTICES:def 1;
    end;  
    f is "/\"-preserving
    proof
    let a1,b1 be Element of UnSubAlLattice A;
    reconsider a2=a1,b2=b1 as Element of Sub A;
    reconsider a3=a2,b3=b2 as strict non-empty SubAlgebra of A
    by UNIALG_2:def 14;
    reconsider s=a3"\/"b3 as Element of Sub A by UNIALG_2:def 14;
    reconsider m= a3 /\ b3 as Element of Sub A by UNIALG_2:def 14;
    MSSign b3 = MSSign A by Th7;
    then reconsider
    g2 = MSAlg b3 as strict non-empty MSSubAlgebra of MSAlg A by Th12;
    consider A4 be strict non-empty SubAlgebra of A such that
A5: A4=b3 and
A6: f.b3= MSAlg A4 by A3;
    MSSign A4 = MSSign A by Th7;
    then reconsider
    g3= MSAlg A4 as strict non-empty MSSubAlgebra of MSAlg A by Th12;
    MSSign a3 = MSSign A by Th7;
    then reconsider
    g1 = MSAlg a3 as strict non-empty MSSubAlgebra of MSAlg A by Th12;
    consider A3 be strict non-empty SubAlgebra of A such that
A7: A3=a3 and
A8: f.a3= MSAlg A3 by A3;
    MSSign A3 = MSSign A by Th7;
    then reconsider
    g4= MSAlg A3 as strict non-empty MSSubAlgebra of MSAlg A by Th12;
A9: ex A1 be strict non-empty SubAlgebra of A st A1=m & f.m = MSAlg A1 by A3;
    thus f.(a1 "/\" b1) = f.((UniAlg_meet A).(a2,b2)) by LATTICES:def 2
      .= MSAlg (a3 /\ b3) by A9,UNIALG_2:def 16
      .= g1 /\ g2 by Th31
      .= (the L_meet of MSSubAlLattice MSAlg A).(f.a1,f.b1) by A7,A8,A5,A6,
MSUALG_2:def 21
      .= (f.a1) "/\" (f.b1) by LATTICES:def 2;
    end;
    hence thesis by AA;
    end;
  then reconsider
  f as Homomorphism of UnSubAlLattice A, MSSubAlLattice MSAlg A;
  take f;
  now
    let x1,x2 be object such that
A11: x1 in dom f & x2 in dom f and
A12: f.x1 = f.x2;
    reconsider y1 = x1, y2 = x2 as Element of Sub A by A11,FUNCT_2:def 1;
    consider A1 be strict SubAlgebra of A such that
A13: A1= y1 and
A14: f.y1= MSAlg A1 by A3;
    consider A2 be strict SubAlgebra of A such that
A15: A2= y2 & f.y2= MSAlg A2 by A3;
A16: MSSign A1 = MSSign A by Th7
      .= MSSign A2 by Th7;
    thus x1 = 1-Alg MSAlg A1 by A13,MSUALG_1:9
      .= x2 by A12,A14,A15,A16,MSUALG_1:9;
  end;
  hence f is one-to-one by FUNCT_1:def 4;
A17: dom f = Sub A by FUNCT_2:def 1;
  thus rng f = the carrier of MSSubAlLattice MSAlg A
  proof
    thus rng f c= the carrier of MSSubAlLattice MSAlg A by RELAT_1:def 19;
    let x be object;
    assume x in the carrier of MSSubAlLattice MSAlg A;
    then reconsider y = x as strict MSSubAlgebra of MSAlg A by MSUALG_2:def 19;
    reconsider C=Constants(MSAlg A) as MSSubset of y by MSUALG_2:10;
    C c= the Sorts of y by PBOOLE:def 18;
    then (the Sorts of y) is non-empty by PBOOLE:131;
    then reconsider y as strict non-empty MSSubAlgebra of MSAlg A by
MSUALG_1:def 3;
    1-Alg y is SubAlgebra of 1-Alg MSAlg A by Th20;
    then 1-Alg y is SubAlgebra of A by MSUALG_1:9;
    then reconsider y1=(1-Alg y) as Element of Sub A by UNIALG_2:def 14;
    ex A1 be strict SubAlgebra of A st A1= y1 & f.y1 = MSAlg A1 by A3;
    then
A18: f.(1-Alg y) = x by A1,Th26;
    y1 in dom f by A17;
    hence thesis by A18,FUNCT_1:def 3;
  end;
end;
