reserve M,N for non empty multMagma,
  f for Function of M, N;
reserve M for multMagma;
reserve N,K for multSubmagma of M;
reserve M,N for non empty multMagma,
  A for Subset of M,
  f,g for Function of M,N,
  X for stable Subset of M,
  Y for stable Subset of N;
reserve X for set;
reserve x,y,Y for set;
reserve n,m,p for Nat;
reserve v,v1,v2,w,w1,w2 for Element of free_magma X;
reserve X,Y,Z for non empty set;
reserve M for non empty multMagma;

theorem Th40:
  for f being Function of X,M, h,g being Function of free_magma X, M
  st h is multiplicative & h extends f*(canon_image(X,1)") &
     g is multiplicative & g extends f*(canon_image(X,1)") holds h = g
proof
  let f be Function of X,M;
  let h,g be Function of free_magma X, M;
  assume A1: h is multiplicative;
  assume A2: h extends f*(canon_image(X,1)");
  assume A3: g is multiplicative;
  assume A4: g extends f*(canon_image(X,1)");
  defpred P[Nat] means for w being Element of free_magma X st length w = $1
  holds h.w=g.w;
  A5: for k being Nat st for n being Nat st n < k holds P[n] holds P[k]
  proof
    let k be Nat;
    assume A6: for n being Nat st n < k holds P[n];
    thus for w being Element of free_magma X st length w = k holds h.w=g.w
    proof
      let w be Element of free_magma X;
      assume A7: length w = k;
      A8: w = [w`1,w`2] & length w >= 1 by Th32; then
      length w = 1 or length w > 1 by XXREAL_0:1; then
      A9: length w = 1 or length w +1 > 1+1 by XREAL_1:8;
      per cases by A9,NAT_1:13;
      suppose A10: length w = 1;
        set x = w`1;
        x in {w9`1 where w9 is Element of free_magma X: length w9 = 1}
        by A10; then
        A11: x in X by Th30;
        A12: dom(f*(canon_image(X,1)")) c= dom h &
        h tolerates f*(canon_image(X,1)") by A2;
        A13: dom(f*(canon_image(X,1)")) c= dom g &
        g tolerates f*(canon_image(X,1)") by A4;
        A14: canon_image(X,1).x = [x,1] by A11,Lm3 .= w by Def18,A8,A10;
        x in dom canon_image(X,1) by A11,Lm3; then
        w in rng canon_image(X,1) by A14,FUNCT_1:3; then
        A15: w in dom(canon_image(X,1)") by FUNCT_1:33;
        X c= dom f by FUNCT_2:def 1; then
        dom canon_image(X,1) c= dom f by Lm3; then
        rng(canon_image(X,1)") c= dom f by FUNCT_1:33; then
        w in dom(f*(canon_image(X,1)")) by A15,RELAT_1:27; then
        w in dom h /\ dom(f*(canon_image(X,1)")) &
        w in dom g /\ dom(f*(canon_image(X,1)")) by A12,A13,XBOOLE_1:28; then
        h.w = (f*(canon_image(X,1)")).w & g.w = (f*(canon_image(X,1)")).w
        by A12,A13,PARTFUN1:def 4;
        hence thesis;
      end;
      suppose length w >= 2; then
        consider w1,w2 be Element of free_magma X such that
        A16: w = w1*w2 & length w1 < length w & length w2 < length w by Th34;
        h.w1 = g.w1 & h.w2 = g.w2 by A6,A7,A16; then
        h.(w1*w2) = g.w1*g.w2 by A1,GROUP_6:def 6;
        hence h.w=g.w by A16,A3,GROUP_6:def 6;
      end;
    end;
  end;
  A17: for k being Nat holds P[k] from NAT_1:sch 4(A5);
   for w being Element of free_magma X holds h.w=g.w
  proof
    let w be Element of free_magma X;
    reconsider k=length w as Nat;
    P[k] by A17;
    hence h.w=g.w;
  end;
  then for x being object st x in the carrier of free_magma X holds h.x = g.x;
  hence h = g by FUNCT_2:12;
end;
