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;
reserve M,N for non empty multMagma,
      f for Function of M, N,
      H for non empty multSubmagma of N,
      R for compatible Equivalence_Relation of M;
reserve f for Function of X,Y;
reserve g for Function of Y,Z;

theorem Th45:
  for g being Function of X,Z st Y c= Z & f=g
  holds free_magmaF f = free_magmaF g
proof
  let g be Function of X,Z;
  assume A1: Y c= Z;
  assume A2: f = g;
  A3: the carrier of free_magma Y c= the carrier of free_magma Z
  by A1,Th27; then
  reconsider f9=free_magmaF f as Function of free_magma X, free_magma Z
  by FUNCT_2:7;
  for a, b being Element of free_magma X holds f9.(a * b) = (f9.a) * (f9.b)
  proof
    let a, b be Element of free_magma X;
    set v = (free_magmaF f).a;
    set w = (free_magmaF f).b;
    reconsider v9=v, w9=w as Element of free_magma Z by A3;
    A4: length v = v`2 by Def18 .= length v9 by Def18;
    A5: length w = w`2 by Def18 .= length w9 by Def18;
    thus f9.(a * b) = (free_magmaF f).a * (free_magmaF f).b by GROUP_6:def 6
    .= [[[v9`1,w9`1],v9`2],(length v9) + (length w9)] by Th31,A4,A5
    .= (f9.a) * (f9.b) by Th31;
  end; then
  A6: f9 is multiplicative by GROUP_6:def 6;
  rng g c= Z; then
  rng g c= dom canon_image(Z,1) by Lm3; then
  A7: dom (canon_image(Z,1)*g) = dom g by RELAT_1:27;
  X c= dom g by FUNCT_2:def 1; then
  dom canon_image(X,1) c= dom (canon_image(Z,1)*g) by Lm3,A7; then
  rng (canon_image(X,1)") c= dom (canon_image(Z,1)*g) by FUNCT_1:33; then
  A8: dom((canon_image(Z,1)*g)*(canon_image(X,1)")) =
  dom (canon_image(X,1)") by RELAT_1:27;
  rng canon_image(X,1) c= the carrier of free_magma X; then
  dom((canon_image(Z,1)*g)*(canon_image(X,1)")) c=
  the carrier of free_magma X by A8,FUNCT_1:33; then
  A9: dom((canon_image(Z,1)*g)*(canon_image(X,1)")) c= dom f9
  by FUNCT_2:def 1;
  for x being object st x in dom((canon_image(Z,1)*g)*(canon_image(X,1)"))
  holds f9.x = ((canon_image(Z,1)*g)*(canon_image(X,1)")).x
  proof
    let x be object;
    assume A10: x in dom((canon_image(Z,1)*g)*(canon_image(X,1)"));
    free_magmaF(f) extends (canon_image(Y,1)*f)*(canon_image(X,1)")
    by Def21; then
    A11: dom((canon_image(Y,1)*f)*(canon_image(X,1)")) c= dom(free_magmaF f) &
    (canon_image(Y,1)*f)*(canon_image(X,1)") tolerates free_magmaF f;
    rng f c= Y; then
    A12: rng f c= dom canon_image(Y,1) by Lm3;
    rng f c= Z by A1; then
    A13: rng f c= dom canon_image(Z,1) by Lm3;
    A14: dom(canon_image(Y,1)*f) = dom f by A12,RELAT_1:27
    .= dom(canon_image(Z,1)*f) by A13,RELAT_1:27;
    for x being object st x in dom(canon_image(Y,1)*f)
    holds (canon_image(Y,1)*f).x = (canon_image(Z,1)*f).x
    proof
      let x be object;
      assume A15: x in dom(canon_image(Y,1)*f); then
      A16: f.x in dom canon_image(Y,1) by FUNCT_1:11; then
      A17: f.x in Y by Lm3;
      thus (canon_image(Y,1)*f).x = canon_image(Y,1).(f.x) by A15,FUNCT_1:12
      .= [f.x,1] by A16,Def19
      .= canon_image(Z,1).(f.x) by A1,A17,Lm3
      .= (canon_image(Z,1)*f).x by A14,A15,FUNCT_1:12;
    end; then
     canon_image(Y,1)*f = canon_image(Z,1)*g by A2,A14,FUNCT_1:2;
    hence f9.x = ((canon_image(Z,1)*g)*(canon_image(X,1)")).x
    by A10,A11,PARTFUN1:53;
  end; then
  f9 tolerates (canon_image(Z,1)*g)*(canon_image(X,1)")
  by A9,PARTFUN1:53; then
  f9 extends (canon_image(Z,1)*g)*(canon_image(X,1)") by A9;
  hence free_magmaF f = free_magmaF g by A6,Def21;
end;
