reserve x, y for object, X for set,
  i, j, k, l, n, m for Nat,
  D for non empty set,
  K for commutative Ring,
  a,b for Element of K,
  perm, p, q for Element of Permutations(n),
  Perm,P for Permutation of Seg n,
  F for Function of Seg n,Seg n,
  perm2, p2, q2, pq2 for Element of Permutations(n+2),
  Perm2 for Permutation of Seg (n+2);
reserve s for Element of 2Set Seg (n+2);
reserve pD for FinSequence of D,
  M for Matrix of n,m,D,
  pK,qK for FinSequence of K,
  A for Matrix of n,K;

theorem Th58:
  for X being finite set, Y being non empty finite set, x st not x
  in X for F being BinOp of D st F is having_a_unity & F is commutative & F is
associative for f being Function of Funcs(X,Y),D for g being Function of Funcs(
  X\/{x},Y),D st for H be Function of X,Y, SF be Element of Fin Funcs(X\/{x},Y)
st SF={h where h is Function of X\/{x},Y: h|X = H} holds F $$ (SF,g)=f.H holds
  F $$ (In(Funcs(X,Y),Fin Funcs(X,Y)),f) =
    F $$ (In(Funcs(X\/{x},Y),Fin Funcs(X\/{x},Y)),g)
proof
  let X be finite set,Y be non empty finite set, x such that
A1: not x in X;
  set Xx=X\/{x};
  set FXY=Funcs(X,Y);
  set FXxY=Funcs(Xx,Y);
  consider B be Function of [:FXY,Y:],FXxY such that
A2: B is bijective and
A3: for f be Function of X,Y,F be Function of Xx,Y st F|X=f holds B.(f,F
  .x)=F by A1,Th57;
  dom B=[:FXY,Y:] by FUNCT_2:def 1;
  then reconsider domB=dom B as Element of Fin [:FXY,Y:] by FINSUB_1:def 5;
  reconsider FXY9=FXY as Element of Fin FXY by FINSUB_1:def 5;
  FXxY in Fin FXxY by FINSUB_1:def 5; then
A5: In(FXxY,Fin FXxY)=FXxY by SUBSET_1:def 8;
  reconsider Y9=Y as Element of Fin Y by FINSUB_1:def 5;
  let F be BinOp of D such that
A6: F is having_a_unity and
A7: F is commutative and
A8: F is associative;
  let f be Function of FXY,D;
  let g be Function of FXxY,D such that
A9: for H be Function of X,Y, SF be Element of Fin FXxY st SF={h where h
  is Function of Xx,Y: h|X = H} holds F $$ (SF,g)=f.H;
  reconsider gB=g*B as Function of [:FXY,Y:],D;
  for z be Element of FXY holds f.z=F$$(Y9,(curry (gB)).z)
  proof
    let z be Element of FXY;
    reconsider Z=z as Function of X,Y;
    set SF={h where h is Function of Xx,Y: h|X = Z};
    deffunc Q(object) = [z,$1];
    consider q be Function such that
A10: dom q = Y &
for x being object st x in Y holds q.x = Q(x) from FUNCT_1:sch 3;
A11: {z} c= FXY by ZFMISC_1:31;
    then [:{Z},Y:] c= [:FXY,Y:] by ZFMISC_1:95;
    then reconsider ZY=[:{Z},Y:]as Element of Fin [:FXY,Y:] by FINSUB_1:def 5;
    for x9 be object holds x9 in ZY iff x9 in q.:(Y)
    proof
      let x9 be object;
      thus x9 in ZY implies x9 in q.:(Y)
      proof
        assume x9 in ZY;
        then consider z9,y9 be object such that
A12:    z9 in {Z} and
A13:    y9 in Y and
A14:    x9=[z9,y9] by ZFMISC_1:def 2;
A15:    z=z9 by A12,TARSKI:def 1;
        q.y9=[z,y9] by A10,A13;
        hence thesis by A10,A13,A14,A15,FUNCT_1:def 6;
      end;
      assume x9 in q.:Y;
      then consider y9 be object such that
A16:  y9 in dom q and
A17:  y9 in Y and
A18:  x9 = q.y9 by FUNCT_1:def 6;
      x9=[z,y9] by A10,A16,A18;
      hence thesis by A17,ZFMISC_1:105;
    end;
    then
A19: q.:Y=ZY by TARSKI:2;
    then
A20: rng q=ZY by A10,RELAT_1:113;
    now
      let x1,x2 be object such that
A21:  x1 in dom q and
A22:  x2 in dom q and
A23:  q.x1=q.x2;
A24:  q.x2=[z,x2] by A10,A22;
      [z,x1]=q.x1 by A10,A21;
      hence x1=x2 by A23,A24,XTUPLE_0:1;
    end;
    then
A25: q is one-to-one by FUNCT_1:def 4;
    ZY c= [:FXY,Y:] by A11,ZFMISC_1:95;
    then reconsider q as Function of Y,[:FXY,Y:] by A10,A20,FUNCT_2:2;
    reconsider gBq=gB*q as Function of Y,D;
    dom gB=[:FXY,Y:] by FUNCT_2:def 1;
    then consider C be Function such that
A26: (curry (gB)).z =C and
    dom C=Y and
    rng C c= rng gB and
A27: for y9 be object st y9 in Y holds C.y9=gB.(z,y9) by FUNCT_5:29;
    reconsider C as Function of Y,D by A26;
    now
      let x9 be object such that
A28:  x9 in Y;
A29:  q.x9=[z,x9] by A10,A28;
      C.x9=gB.(z,x9) by A27,A28;
      hence C.x9 = gBq.x9 by A28,A29,FUNCT_2:15;
    end;
    then
A30: C=gBq by FUNCT_2:12;
A31: B.:ZY c= SF
    proof
      let b be object;
      assume b in B.:ZY;
      then consider zy be object such that
      zy in dom B and
A32:  zy in ZY and
A33:  b=B.zy by FUNCT_1:def 6;
      consider z9,y9 be object such that
A34:  z9 in {Z} and
A35:  y9 in Y and
A36:  zy = [z9,y9] by A32,ZFMISC_1:def 2;
      Y\/{y9}=Y by A35,ZFMISC_1:40;
      then consider F1 be Function of Xx,Y such that
A37:  F1|X = Z and
A38:  F1.x=y9 by A1,STIRL2_1:57;
      z9=Z by A34,TARSKI:def 1;
      then B.(z9,y9)=F1 by A3,A37,A38;
      hence thesis by A33,A36,A37;
    end;
A39: SF c= B.:ZY
    proof
      x in {x} by TARSKI:def 1;
      then
A40:  x in Xx by XBOOLE_0:def 3;
      let sf be object;
      assume sf in SF;
      then consider h be Function of Xx,Y such that
A41:  h=sf and
A42:  h|X = Z;
A43:  [:FXY,Y:]=dom B by FUNCT_2:def 1;
      dom h =Xx by FUNCT_2:def 1;
      then
A44:  h.x in rng h by A40,FUNCT_1:def 3;
A45:  rng h c= Y by RELAT_1:def 19;
      then
A46:  [z,h.x] in [:FXY,Y:] by A44,ZFMISC_1:87;
      z in {Z} by TARSKI:def 1;
      then [z,h.x] in ZY by A44,A45,ZFMISC_1:87;
      then B.(z,h.x) in B.:ZY by A46,A43,FUNCT_1:def 6;
      hence thesis by A3,A41,A42;
    end;
    then reconsider SF as Element of Fin FXxY by A31,XBOOLE_0:def 10;
    B.:ZY = SF by A31,A39;
    then
A47: F $$(B.:ZY,g)=f.Z by A9;
    F $$(B.:ZY,g)=F $$(ZY,gB) by A7,A8,A2,SETWOP_2:6;
    hence thesis by A7,A8,A47,A25,A19,A26,A30,SETWOP_2:6;
  end;
  then F$$([:FXY9,Y9:],gB)=F$$(FXY9,f) by A6,A7,A8,MATRIX_3:30;
  then
A48: F$$(domB,gB)=F$$(FXY9,f) by FUNCT_2:def 1;
A49: rng B=FXxY by A2,FUNCT_2:def 3;
  F $$(B.:domB,g)=F $$ (domB, g*B) by A7,A8,A2,SETWOP_2:6;
  then F $$(In(FXxY,Fin FXxY),g)=F $$ (domB, g*B) by A49,A5,RELAT_1:113;
  hence thesis by A48;
end;
