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 Th31:
  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 J,D for X being Element of Fin I
st F is having_a_unity & F is commutative & F is associative holds for y being
  Element of J holds (for j being Element of J holds g.j=F$$(X,(curry' f).j))
  implies F$$([:X,{.y.}:],f)=F$$({.y.},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 J,D;
  let X be Element of Fin I;
  assume that
A1: F is having_a_unity and
A2: F is commutative & F is associative;
  now
    let y be Element of J;
    assume
A3: for j being Element of J holds g.j=F$$(X,(curry' f).j);
    deffunc F(object) = [$1,y];
    consider h being Function such that
A4: dom h = I &
for x being object st x in I holds h.x = F(x) from FUNCT_1:sch 3;
A5: dom ((curry' f).y) =I & dom (f *h)=I & 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).y & dom g= I & rng g c= rng f &
      for x st x in I holds g.x = f.(x,y) by FUNCT_5:32;
      hence dom ((curry' f).y)=I;
      now
        let x be object;
        assume x in rng h;
        then consider z being object such that
A7:     z in dom h and
A8:     x = h.z by FUNCT_1:def 3;
        x=[z,y] by A4,A7,A8;
        hence x 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 x being object st x in I holds ((curry' f).y).x=(f*h).x
    proof
      let x be object;
      dom f=[:I,J:] by FUNCT_2:def 1;
      then
A10:  ex g being Function st g=(curry' f).y & dom g= I & rng g c= rng f &
      for x st x in I holds g.x = f.(x,y) by FUNCT_5:32;
      assume
A11:  x in I;
      hence (f*h).x=f.(h.x) by A5,FUNCT_1:12
        .= f.(x,y) by A4,A11
        .=((curry' f).y).x by A11,A10;
    end;
    for x being object holds x in [:X,{y}:] iff x in h.:(X)
    proof
      let x be object;
      thus x in [:X,{y}:] implies x in h.:(X)
      proof
        assume
A12:    x in [:X,{y}:];
        then consider x1,y1 being object such that
A13:    x=[x1,y1] by RELAT_1:def 1;
A14:    y1 in {y} by A12,A13,ZFMISC_1:87;
A15:    X c= I & x1 in X by A12,A13,FINSUB_1:def 5,ZFMISC_1:87;
        then h.x1=[x1,y] by A4
          .=x by A13,A14,TARSKI:def 1;
        hence thesis by A4,A15,FUNCT_1:def 6;
      end;
      assume x in h.:(X);
      then consider z being object such that
A16:  z in dom h and
A17:  z in X and
A18:  x = h.z by FUNCT_1:def 6;
      x=[z,y] by A4,A16,A18;
      hence thesis by A17,ZFMISC_1:106;
    end;
    then
A19: h.:X=[: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;
      [x1,y]=h.x2 by A4,A20,A22
        .=[x2,y] 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 I,[:I,J:] by A4,A5,FUNCT_2:2;
    thus F$$([:X,{.y.}:],f)=F$$(X,f*h) by A1,A2,A23,A19,SETWOP_2:6
      .=F $$ (X,(curry' f).y) by A5,A9,FUNCT_1:2
      .=g.y by A3
      .=F$$({.y.},g) by A2,SETWISEO:17;
  end;
  hence thesis;
end;
