theorem Th157:
  Hom(T,x1,x2)**Hom(T,x1,x2) = id the Sorts of T
  proof
    set h = Hom(T,x1,x2);
    for s,x holds (h**h).s.(x-term) = x-term
    proof
      let s1,x11;
A2:   (FreeGen T).s1 c= (the Sorts of T).s1 by PBOOLE:def 2,def 18;
A3:   x11-term in FreeGen(s1,X) = (FreeGen T).s1 by MSAFREE:def 15,def 16;
A4:   ((h.s1)*(h.s1)).(x11-term) = (h.s1).((h.s1).(x11-term))
      by A2,A3,FUNCT_2:15;
      per cases;
      suppose s1 = s & x11 = x1;
        then h.s1.(x11-term) = x2-term & h.s1.(x2-term) = x11-term by HOM;
        hence thesis by A4,MSUALG_3:2;
      end;
      suppose s1 = s & x11 = x2;
        then h.s1.(x11-term) = x1-term & h.s1.(x1-term) = x11-term by HOM;
        hence thesis by A4,MSUALG_3:2;
      end;
      suppose s1 <> s or x11 <> x1 & x11 <> x2;
        then h.s1.(x11-term) = x11-term by HOM;
        hence thesis by A4,MSUALG_3:2;
      end;
    end;
    hence thesis by Th52;
  end;
