reserve x,y,y1,y2,z,a,b for object, X,Y,Z,V1,V2 for set,
  f,g,h,h9,f1,f2 for Function,
  i for Nat,
  P for Permutation of X,
  D,D1,D2,D3 for non empty set,
  d1 for Element of D1,
  d2 for Element of D2,
  d3 for Element of D3;

theorem Th38:
  dom f = X & dom g = X & (for x st x in X holds f.x,g.x
  are_equipotent) implies product f,product g are_equipotent
proof
  assume that
A1: dom f = X and
A2: dom g = X and
A3: for x st x in X holds f.x,g.x are_equipotent;
  defpred P[object,object] means
  ex f1 st $2 = f1 & f1 is one-to-one & dom f1 = f.$1
  & rng f1 = g.$1;
A4: for x being object st x in X ex y being object st P[x,y]
  proof
    let x be object;
    assume x in X;
    then f.x,g.x are_equipotent by A3;
    then ex h st h is one-to-one & dom h = f.x & rng h = g.x;
    hence thesis;
  end;
  consider h such that
A5: dom h = X &
   for x being object st x in X holds P[x,h.x] from CLASSES1:sch 1(A4);
   h is Function-yielding
    proof let x be object;
     assume x in dom h;
      then P[x,h.x] by A5;
     hence h.x is Function;
    end;
   then reconsider h as Function-yielding Function;
A6: now
    let x be object;
    assume
A7: x in X;
    then
    ex f1 st h.x = f1 & f1 is one-to-one & dom f1 = f.x & rng f1 = g.x by A5;
    hence (rngs h).x = g.x by A5,A7,Th18;
  end;
A8: dom h = X by A5;
  then dom rngs h = X by Def2;
  then
A9: rngs h = g by A2,A6;
A10: now
    let x be object;
    assume
A11: x in X;
    then
    ex f1 st h.x = f1 & f1 is one-to-one & dom f1 = f.x & rng f1 = g.x by A5;
    hence (doms h).x = f.x by A5,A11,Th18;
  end;
  dom doms h = X by A8,Def1;
  then
A12: doms h = f by A1,A10;
  now
    per cases;
    suppose
      {} in rng h;
      then consider x being object such that
A13:  x in X and
A14:  {} = h.x by A5,FUNCT_1:def 3;
A15:  ex f1 st {} = f1 & f1 is one-to-one & dom f1 = f.x & rng f1 = g.x
      by A5,A13,A14;
      then {} in rng f by A1,A13,FUNCT_1:def 3;
      then
A16:  product f = {} by CARD_3:26;
      {} in rng g by A2,A13,A15,FUNCT_1:def 3,RELAT_1:38;
      hence thesis by A16,CARD_3:26;
    end;
    suppose
A17:  not {} in rng h;
A18:  now
        let f1;
        assume f1 in rng h;
        then consider x being object such that
A19:    x in X and
A20:    f1 = h.x by A5,FUNCT_1:def 3;
        ex f1 st h.x = f1 & f1 is one-to-one & dom f1 = f.x & rng f1 = g.
        x by A5,A19;
        hence f1 is one-to-one by A20;
      end;
      thus thesis
      proof
        take Frege h;
        thus thesis by A12,A9,A17,A18,Def6,Th33,Th34;
      end;
    end;
  end;
  hence thesis;
end;
