reserve S for non void non empty ManySortedSign,
  U1, U2, U3 for non-empty MSAlgebra over S,
  I for set,
  A for ManySortedSet of I,
  B, C for non-empty ManySortedSet of I;

theorem Th13:
  for F be ManySortedFunction of A, B st A is non-empty holds F is
"1-1" iff for C be ManySortedSet of I for G, H be ManySortedFunction of C, A st
  F**G = F**H holds G = H
proof
  let F be ManySortedFunction of A, B such that
A1: A is non-empty;
  thus F is "1-1" implies for C be ManySortedSet of I for G, H be
  ManySortedFunction of C, A st F**G = F**H holds G = H
  proof
    assume
A2: F is "1-1";
    let C be ManySortedSet of I;
    let G, H be ManySortedFunction of C, A such that
A3: F**G = F**H;
    now
      let i be object;
      assume
A4:   i in I;
      then reconsider f = F.i as Function of A.i, B.i by PBOOLE:def 15;
      reconsider h = H.i as Function of C.i, A.i by A4,PBOOLE:def 15;
      reconsider g = G.i as Function of C.i, A.i by A4,PBOOLE:def 15;
A5:   f is one-to-one by A2,A4,MSUALG_3:1;
      f*g = (F**H).i by A3,A4,MSUALG_3:2
        .= f*h by A4,MSUALG_3:2;
      hence G.i = H.i by A1,A4,A5,FUNCT_2:21;
    end;
    hence thesis;
  end;
  assume that
A6: for C be ManySortedSet of I for G, H be ManySortedFunction of C, A
  st F**G = F**H holds G = H and
A7: not F is "1-1";
  consider j be set such that
A8: j in I and
A9: not (F.j) is one-to-one by A7,MSUALG_3:1;
  F.j is Function of A.j, B.j by A8,PBOOLE:def 15;
  then consider Z be set such that
A10: ex g, h be Function of Z, A.j st (F.j)*g = (F.j)*h & g <> h by A1,A8,A9,
FUNCT_2:21;
  consider g, h be Function of Z, A.j such that
A11: (F.j)*g = (F.j)*h and
A12: g <> h by A10;
  ex C be ManySortedSet of I st ex G, H be ManySortedFunction of C, A st
  F**G = F**H & G <> H
  proof
    deffunc F(object) = IFEQ($1, j, Z, A.$1);
    consider C be ManySortedSet of I such that
A13: for i be object st i in I holds C.i = F(i) from PBOOLE:sch 4;
    take C;
    deffunc F(object) = IFEQ($1, j, g, (id C).$1);
    consider G be ManySortedSet of I such that
A14: for i be object st i in I holds G.i = F(i) from PBOOLE:sch 4;
    deffunc F(object) = IFEQ($1, j, h, (id C).$1);
    consider H be ManySortedSet of I such that
A15: for i be object st i in I holds H.i = F(i) from PBOOLE:sch 4;
    now
      let G be ManySortedSet of I;
      let g, h be Function of Z, A.j such that
      (F.j)*g = (F.j)*h and
      g <> h and
A16:  for i be object st i in I holds G.i = IFEQ(i, j, g, (id C).i);
      thus G is Function-yielding
      proof
        let i be object;
        assume i in dom G;
        then
A17:    i in I;
        now
          per cases;
          case
            i = j;
            then IFEQ(i, j, g, (id C).i) = g by FUNCOP_1:def 8;
            hence thesis by A16,A17;
          end;
          case
            i <> j;
            then IFEQ(i, j, g, (id C).i) = (id C).i by FUNCOP_1:def 8;
            hence thesis by A16,A17;
          end;
        end;
        hence thesis;
      end;
    end;
    then reconsider G, H as ManySortedFunction of I by A11,A12,A14,A15;
    now
      let G be ManySortedFunction of I;
      let g, h be Function of Z, A.j such that
      (F.j)*g = (F.j)*h and
      g <> h and
A18:  for i be object st i in I holds G.i = IFEQ(i, j, g, (id C).i);
      thus G is ManySortedFunction of C, A
      proof
        let i be object such that
A19:    i in I;
        now
          per cases;
          case
A20:        i = j;
            then
A21:        IFEQ(i, j, g, (id C).i) = g & IFEQ(i, j, Z, A.i) = Z by
FUNCOP_1:def 8;
            C.i = IFEQ(i, j, Z, A.i) by A13,A19;
            hence thesis by A18,A19,A20,A21;
          end;
          case
A22:        i <> j;
            then IFEQ(i, j, Z, A.i) = A.i by FUNCOP_1:def 8;
            then
A23:        C.i = A.i by A13,A19;
            IFEQ(i, j, g, (id C).i) = (id C).i by A22,FUNCOP_1:def 8;
            then G.i = (id C).i by A18,A19;
            hence thesis by A19,A23,PBOOLE:def 15;
          end;
        end;
        hence thesis;
      end;
    end;
    then reconsider G, H as ManySortedFunction of C, A by A11,A12,A14,A15;
A24: now
      let i be object such that
A25:  i in I;
      now
        per cases;
        case
A26:      i = j;
          then IFEQ(i, j, h, (id C).i) = h by FUNCOP_1:def 8;
          then
A27:      h = H.i by A15,A25;
          IFEQ(i, j, g, (id C).i) = g by A26,FUNCOP_1:def 8;
          then g = G.i by A14,A25;
          hence (F**G).i = (F.j)*h by A8,A11,A26,MSUALG_3:2
            .= (F**H).i by A8,A26,A27,MSUALG_3:2;
        end;
        case
A28:      i <> j;
          reconsider g9 = G.i as Function of C.i, A.i by A25,PBOOLE:def 15;
          reconsider f9 = F.i as Function of A.i, B.i by A25,PBOOLE:def 15;
          reconsider h9 = H.i as Function of C.i, A.i by A25,PBOOLE:def 15;
A29:      IFEQ(i, j, h, (id C).i) = (id C).i by A28,FUNCOP_1:def 8;
          IFEQ(i, j, g, (id C).i) = (id C).i by A28,FUNCOP_1:def 8;
          then g9 = (id C).i by A14,A25
            .= h9 by A15,A25,A29;
          hence (F**G).i = f9*h9 by A25,MSUALG_3:2
            .= (F**H).i by A25,MSUALG_3:2;
        end;
      end;
      hence (F**G).i = (F**H).i;
    end;
    take G, H;
    F**G is ManySortedSet of I & F**H is ManySortedSet of I by Lm1;
    hence F**G = F**H by A24,PBOOLE:3;
    ex i be set st i in I & G.i <> H.i
    proof
      take i = j;
      thus i in I by A8;
A30:  h = IFEQ(i, j, h, (id C).i) by FUNCOP_1:def 8
        .= H.i by A8,A15;
      g = IFEQ(i, j, g, (id C).i) by FUNCOP_1:def 8
        .= G.i by A8,A14;
      hence thesis by A12,A30;
    end;
    hence thesis;
  end;
  hence contradiction by A6;
end;
