reserve i, I for set,
  f, g, h for Function,
  s for ManySortedSet of I;

theorem
  for F being multMagma-Family of I, G being non empty multMagma st
  i in I & G = F.i & product F is commutative holds G is commutative
proof
  let F be multMagma-Family of I, G be non empty multMagma such that
A1: i in I and
A2: G = F.i and
A3: for x, y being Element of product F holds x*y = y*x;
  let x, y be Element of G;
  defpred Y[object,object] means
($1 = i implies $2 = y) & ($1 <> i implies ex H
  being non empty multMagma, a being Element of H st H = F.$1 & $2 = a);
A4: for j being object st j in I ex k being object st Y[j,k]
  proof
    let j be object such that
A5: j in I;
    per cases;
    suppose
      j = i;
      hence thesis;
    end;
    suppose
A6:   j <> i;
      j in dom F by A5,PARTFUN1:def 2;
      then F.j in rng F by FUNCT_1:def 3;
      then reconsider Fj = F.j as non empty multMagma by Def1;
      set a = the Element of Fj;
      take a;
      thus j = i implies a = y by A6;
      thus thesis;
    end;
  end;
  consider gy being ManySortedSet of I such that
A7: for j being object st j in I holds Y[j,gy.j] from PBOOLE:sch 3(A4);
  set GP = product F;
  defpred X[object,object] means
 ($1 = i implies $2 = x) & ($1 <> i implies ex H
  being non empty multMagma, a being Element of H st H = F.$1 & $2 = a);
A8: for j being object st j in I ex k being object st X[j,k]
  proof
    let j be object such that
A9: j in I;
    per cases;
    suppose
      j = i;
      hence thesis;
    end;
    suppose
A10:  j <> i;
      j in dom F by A9,PARTFUN1:def 2;
      then F.j in rng F by FUNCT_1:def 3;
      then reconsider Fj = F.j as non empty multMagma by Def1;
      set a = the Element of Fj;
      take a;
      thus j = i implies a = x by A10;
      thus thesis;
    end;
  end;
  consider gx being ManySortedSet of I such that
A11: for j being object st j in I holds X[j,gx.j] from PBOOLE:sch 3(A8);
A12: dom gy = I by PARTFUN1:def 2;
A13: now
    let j be object;
    assume
A14: j in dom gy;
    then
A15: ex R being 1-sorted st R = F.j & (Carrier F).j = the carrier of R
    by PRALG_1:def 15;
    per cases;
    suppose
A16:  i = j;
      then gy.j = y by A7,A14;
      hence gy.j in (Carrier F).j by A2,A15,A16;
    end;
    suppose
      j <> i;
      then ex H being non empty multMagma, a being Element of H st H = F.j &
      gy.j = a by A7,A14;
      hence gy.j in (Carrier F).j by A15;
    end;
  end;
A17: dom Carrier F = I by PARTFUN1:def 2;
  then reconsider gy as Element of product Carrier F by A12,A13,CARD_3:9;
A18: gy.i = y by A1,A7;
A19: dom gx = I by PARTFUN1:def 2;
  now
    let j be object;
    assume
A20: j in dom gx;
    then
A21: ex R being 1-sorted st R = F.j & (Carrier F).j = the carrier of R
    by PRALG_1:def 15;
    per cases;
    suppose
A22:  i = j;
      then gx.j = x by A11,A20;
      hence gx.j in (Carrier F).j by A2,A21,A22;
    end;
    suppose
      j <> i;
      then ex H being non empty multMagma, a being Element of H st H = F.j &
      gx.j = a by A11,A20;
      hence gx.j in (Carrier F).j by A21;
    end;
  end;
  then reconsider gx as Element of product Carrier F by A19,A17,CARD_3:9;
  reconsider x1 = gx, y1 = gy as Element of GP by Def2;
A23: x1 * y1 = y1 * x1 by A3;
  reconsider xy = x1*y1 as Element of product Carrier F by Def2;
A24: gx.i = x by A1,A11;
  then xy.i = x * y by A1,A2,A18,Th1;
  hence thesis by A1,A2,A23,A24,A18,Th1;
end;
