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 Th34:
 for f being Function-yielding Function
  st not {} in rng f
 holds (Frege f is one-to-one iff for g st g in
  rng f holds g is one-to-one)
proof let f be Function-yielding Function;
  set h0 = the Element of product doms f;
A1: dom doms f = dom f by Def1;
  assume
A2: not {} in rng f;
  now
    assume {} in rng doms f;
    then consider x being object such that
A3: x in dom doms f and
A4: {} = (doms f).x by FUNCT_1:def 3;
A5: x in dom f by A3,Def1;
    reconsider g = f.x as Function;
A6: x in dom f by A5;
    then
A7: g in rng f by FUNCT_1:def 3;
    {} = dom g by A4,A6,Th18;
    hence contradiction by A2,A7,RELAT_1:41;
  end;
  then product doms f <> {} by CARD_3:26;
  then consider h such that
  h0 = h and
  dom h = dom doms f and
A8: for x being object st x in dom doms f holds h.x in (doms f).x
by CARD_3:def 5;
A9: dom Frege f = product doms f by Def6;
  thus Frege f is one-to-one implies for g st g in rng f holds g is one-to-one
  proof
    deffunc G(object) = h.$1;
    assume
A10: for x,y being object
    st x in dom Frege f & y in dom Frege f & (Frege f).x = (
    Frege f).y holds x = y;
    let g;
    assume g in rng f;
    then consider z being object such that
A11: z in dom f & g = f.z by FUNCT_1:def 3;
    defpred P[object] means $1 = z;
    let x,y be object;
    deffunc F(object) = x;
    consider h1 being Function such that
A12: dom h1 = dom f & for a being object st a in dom f holds
(P[a] implies h1.a = F(a)) & (not P[a] implies h1.a = G(a)) from PARTFUN1:sch 1
    ;
    assume that
A13: x in dom g and
A14: y in dom g and
A15: g.x = g.y;
    now
      let a be object;
      assume
A16:  a in dom doms f;
      then
A17:  a <> z implies h1.a = h.a by A1,A12;
      a = z implies h1.a = x by A1,A12,A16;
      hence h1.a in (doms f).a by A8,A11,A13,A16,A17,Th18;
    end;
    then
A18: h1 in product doms f by A1,A12,CARD_3:def 5;
    then consider g1 being Function such that
A19: (Frege f).h1 = g1 and
A20: dom g1 = dom f and
A21: for x st x in dom g1 holds g1.x = (uncurry f).(x,h1.x) by Def6;
    defpred P[object] means $1 = z;
    deffunc G(object) = h.$1;
    deffunc F(object) = y;
    consider h2 being Function such that
A22: dom h2 = dom f & for a being object st a in dom f holds
(P[a] implies h2.a = F(a)) & (not P[a] implies h2.a = G(a))
from PARTFUN1:sch 1;
    now
      let a be object;
      assume
A23:  a in dom doms f;
      then
A24:  a <> z implies h2.a = h.a by A1,A22;
      a = z implies h2.a = y by A1,A22,A23;
      hence h2.a in (doms f).a by A8,A11,A14,A23,A24,Th18;
    end;
    then
A25: h2 in product doms f by A1,A22,CARD_3:def 5;
    then consider g2 being Function such that
A26: (Frege f).h2 = g2 and
A27: dom g2 = dom f and
A28: for x st x in dom g2 holds g2.x = (uncurry f).(x,h2.x) by Def6;
    now
      let a be object;
      assume
A29:  a in dom f;
      then
A30:  g2.a = (uncurry f).(a,h2.a) by A27,A28;
A31:  g1.a = (uncurry f).(a,h1.a) by A20,A21,A29;
      per cases;
      suppose
A32:    a <> z;
        then h1.a = h.a by A12,A29;
        hence g1.a = g2.a by A22,A29,A30,A31,A32;
      end;
      suppose
A33:    a = z;
        then h1.a = x by A12,A29;
        then
A34:    g1.a = g.x by A11,A13,A31,A33,FUNCT_5:38;
        h2.a = y by A22,A29,A33;
        hence g1.a = g2.a by A11,A14,A15,A30,A33,A34,FUNCT_5:38;
      end;
    end;
    then g1 = g2 by A20,A27;
    then
A35: h1 = h2 by A9,A10,A18,A19,A25,A26;
A36: z in dom f by A11;
    then h1.z = x by A12;
    hence thesis by A36,A22,A35;
  end;
  assume
A37: for g st g in rng f holds g is one-to-one;
  let x,y be object;
  assume that
A38: x in dom Frege f and
A39: y in dom Frege f and
A40: (Frege f).x = (Frege f).y;
  consider g2 being Function such that
A41: y = g2 and
A42: dom g2 = dom doms f and
A43: for x being object st x in dom doms f holds g2.x in (doms f).x
by A9,A39,CARD_3:def 5;
  consider g1 being Function such that
A44: x = g1 and
A45: dom g1 = dom doms f and
A46: for x being object st x in dom doms f holds g1.x in (doms f).x
by A9,A38,CARD_3:def 5;
  consider h2 being Function such that
A47: (Frege f).g2 = h2 and
A48: dom h2 = dom f & for x st x in dom h2 holds h2.x = (
  uncurry f).(x,g2.x) by A9,A39,A41,Def6;
  consider h1 being Function such that
A49: (Frege f).g1 = h1 and
A50: dom h1 = dom f & for x st x in dom h1 holds h1.x = (
  uncurry f).(x,g1.x) by A9,A38,A44,Def6;
  now
    let a be object;
    assume
A51: a in dom f;
    reconsider g = f.a as Function;
A52: a in dom f by A51;
    then
A53: dom g = (doms f).a by Th18;
    then
A54: g2.a in dom g by A1,A43,A51;
A55: g1.a in dom g by A1,A46,A51,A53;
    h2.a = (uncurry f).(a,g2.a) by A48,A51;
    then
A56: h2.a = g.(g2.a) by A52,A54,FUNCT_5:38;
    g in rng f by A52,FUNCT_1:def 3;
    then
A57: g is one-to-one by A37;
    h1.a = (uncurry f).(a,g1.a) by A50,A51;
    then h1.a = g.(g1.a) by A52,A55,FUNCT_5:38;
    hence g1.a = g2.a by A40,A44,A41,A49,A47,A55,A54,A56,A57;
  end;
  hence thesis by A1,A44,A45,A41,A42,FUNCT_1:2;
end;
