reserve x,y,z,x1,x2,y1,y2,z1,z2 for object,
  i,j,k,l,n,m for Nat,
  D for non empty set,
  K for Ring;

theorem Th29:
  for I, J being non empty set for F being BinOp of D for f being
Function of [:I,J:],D for g being Function of I,D for Y being Element of Fin J
  st F is having_a_unity commutative associative holds for x being Element of I
holds (for i being Element of I holds g.i=F$$(Y,(curry f).i)) implies F$$([:{.x
  .},Y:],f)=F$$({.x.},g)
proof
  let I, J be non empty set;
  let F be BinOp of D;
  let f be Function of [:I,J:],D;
  let g be Function of I,D;
  let Y be Element of Fin J;
  assume that
A1: F is having_a_unity and
A2: F is commutative & F is associative;
  now
    let x be Element of I;
    assume
A3: for i being Element of I holds g.i=F$$(Y,(curry f).i);
    deffunc F(object) = [x,$1];
    consider h being Function such that
A4: dom h = J &
for y being object st y in J holds h.y = F(y) from FUNCT_1:sch 3;
A5: dom ((curry f).x) = J & dom (f *h)=J & rng h c= [:I,J:]
    proof
A6:   dom f=[:I,J:] by FUNCT_2:def 1;
      then ex g being Function st g=(curry f).x & dom g= J &
      rng g c= rng f & for y st y in J holds g.y = f.(x,y)
        by FUNCT_5:29;
      hence dom ((curry f).x)=J;
      now
        let y be object;
        assume y in rng h;
        then consider z being object such that
A7:     z in dom h and
A8:     y = h.z by FUNCT_1:def 3;
        y=[x,z] by A4,A7,A8;
        hence y in dom f by A4,A6,A7,ZFMISC_1:87;
      end;
      then rng h c= dom f by TARSKI:def 3;
      hence thesis by A4,FUNCT_2:def 1,RELAT_1:27;
    end;
A9: for y being object st y in J holds ((curry f).x).y=(f*h).y
    proof
      let y be object;
      dom f=[:I,J:] by FUNCT_2:def 1;
      then
A10:  ex g being Function st g=(curry f).x & dom g= J & rng g c= rng f &
      for y st y in J holds g.y = f.(x,y) by FUNCT_5:29;
      assume
A11:  y in J;
      hence (f*h).y=f.(h.y) by A5,FUNCT_1:12
        .= f.(x,y) by A4,A11
        .=((curry f).x).y by A11,A10;
    end;
    for y being object holds y in [:{x},Y:] iff y in h.:(Y)
    proof
      let y be object;
      thus y in [:{x},Y:] implies y in h.:(Y)
      proof
        assume
A12:    y in [:{x},Y:];
        then consider y1,x1 being object such that
A13:    y=[y1,x1] by RELAT_1:def 1;
A14:    y1 in {x} by A12,A13,ZFMISC_1:87;
A15:    Y c= J & x1 in Y by A12,A13,FINSUB_1:def 5,ZFMISC_1:87;
        then h.x1=[x,x1] by A4
          .=y by A13,A14,TARSKI:def 1;
        hence thesis by A4,A15,FUNCT_1:def 6;
      end;
      assume y in h.:Y;
      then consider z being object such that
A16:  z in dom h and
A17:  z in Y and
A18:  y = h.z by FUNCT_1:def 6;
      y=[x,z] by A4,A16,A18;
      hence thesis by A17,ZFMISC_1:105;
    end;
    then
A19: h.:Y=[:{x},Y:] by TARSKI:2;
    now
      let x1,x2 be object;
      assume that
A20:  x1 in dom h and
A21:  x2 in dom h and
A22:  h.x1=h.x2;
      [x,x1]=h.x2 by A4,A20,A22
        .=[x,x2] by A4,A21;
      hence x1=x2 by XTUPLE_0:1;
    end;
    then
A23: h is one-to-one by FUNCT_1:def 4;
    reconsider h as Function of J,[:I,J:] by A4,A5,FUNCT_2:2;
    thus F$$([:{.x.},Y:],f)=F$$(Y,f*h) by A1,A2,A23,A19,SETWOP_2:6
      .=F $$ (Y,(curry f).x) by A5,A9,FUNCT_1:2
      .=g.x by A3
      .=F$$({.x.},g) by A2,SETWISEO:17;
  end;
  hence thesis;
end;
