reserve U0,U1,U2,U3 for Universal_Algebra,
  n for Nat,
  x,y for set;
reserve A for non empty Subset of U0,
  o for operation of U0,
  x1,y1 for FinSequence of A;

theorem
  U1 is SubAlgebra of U2 implies U1,U2 are_similar
proof
  set s1 = signature(U1), s2 = signature(U2);
  set X = dom s1;
  len s1 = len the charact of(U1) by UNIALG_1:def 4;
  then
A1: dom s1 = dom the charact of(U1) by FINSEQ_3:29;
  assume
A2: U1 is SubAlgebra of U2;
  then reconsider A = the carrier of U1 as non empty Subset of U2 by Def7;
  len s2 = len the charact of(U2) by UNIALG_1:def 4;
  then
A3: dom s2 = dom the charact of(U2) by FINSEQ_3:29;
  dom the charact of (U1)= dom Opers(U2,A) by A2,Def7;
  then
A4: dom s1 = dom s2 by A1,A3,Def6;
  the charact of(U1)=Opers(U2,A) by A2,Def7;
  then
A5: dom s1 c= dom s2 by A1,A3,Def6;
  for n being Nat st n in X holds s1.n = s2.n
  proof
    let n be Nat;
    assume
A6: n in X;
    then reconsider o1=(the charact of(U1)).n as operation of U1 by A1,
FUNCT_1:def 3;
    reconsider o2=(the charact of U2).n as operation of U2 by A3,A4,A6,
FUNCT_1:def 3;
    s1.n = arity(o1) & s2.n = arity(o2) by A5,A6,UNIALG_1:def 4;
    hence thesis by A2,A1,A6,Th6;
  end;
  then s1 = s2 by A4,FINSEQ_1:13;
  hence thesis;
end;
