reserve X for set;
reserve x,y,z for set;

theorem Th28:
  for X be set, Y be RelStr holds Funcs (X, the carrier of Y) =
  the carrier of Y|^X
proof
  let X be set;
  let Y be RelStr;
  set YY = the carrier of Y, f = Carrier (X --> Y);
A1: dom f = X by PARTFUN1:def 2;
A2: for x be set st x in X holds f.x = YY
  proof
    let x be set;
    assume
A3: x in X;
    then ex R being 1-sorted st R = (X --> Y).x & f.x = the carrier of R by
PRALG_1:def 15;
    hence thesis by A3,FUNCOP_1:7;
  end;
  Funcs(X,YY) = product f
  proof
    thus Funcs(X,YY) c= product f
    proof
      let x be object;
      assume x in Funcs(X,YY);
      then consider g be Function such that
A4:   x = g and
A5:   dom g = X and
A6:   rng g c= YY by FUNCT_2:def 2;
      now
        let y be object;
        assume y in dom f;
        then f.y = YY & g.y in rng g by A2,A5,FUNCT_1:def 3;
        hence g.y in f.y by A6;
      end;
      hence thesis by A1,A4,A5,CARD_3:def 5;
    end;
    let x be object;
    assume x in product f;
    then consider g be Function such that
A7: x = g and
A8: dom g = dom f and
A9: for x being object st x in dom f holds g.x in f.x by CARD_3:def 5;
    rng g c= YY
    proof
      let y be object;
      assume y in rng g;
      then consider z being object such that
A10:  z in dom g and
A11:  y = g.z by FUNCT_1:def 3;
      f.z = YY by A2,A8,A10;
      hence thesis by A8,A9,A10,A11;
    end;
    hence thesis by A1,A7,A8,FUNCT_2:def 2;
  end;
  hence thesis by Def4;
end;
