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 Th57:
  for X being set,Y being non empty set, x st not x in X ex BIJECT
be Function of [:Funcs(X,Y),Y:],Funcs(X\/{x},Y) st BIJECT is bijective & for f
  be Function of X,Y,F be Function of X\/{x},Y st F|X=f holds BIJECT.(f,F.x)=F
proof
  let X be set, Y be non empty set, x such that
A1: not x in X;
  set Xx=X\/{x};
  set FXY=Funcs(X,Y);
  set FXxY=Funcs(Xx,Y);
  defpred P[set,set] means for f be Function of X,Y,F be Function of Xx,Y, y
  be set st [f,y]=$1 & F.x=y & F|X=f holds F=$2;
A2: for x be Element of [:FXY,Y:] ex y be Element of FXxY st P[x,y]
  proof
    let x9 be Element of [:FXY,Y:];
    consider f,y be object such that
A3: f in FXY and
A4: y in Y and
A5: x9=[f,y] by ZFMISC_1:def 2;
    reconsider f as Function of X,Y by A3,FUNCT_2:66;
    Y\/{y}=Y by A4,ZFMISC_1:40;
    then consider F be Function of X\/{x},Y such that
A6: F|X = f and
A7: F.x=y by A1,STIRL2_1:57;
    reconsider F9=F as Element of FXxY by FUNCT_2:8;
    take F9;
    let g be Function of X,Y,G be Function of Xx,Y, y9 be set such that
A8: [g,y9]=x9 and
A9: G.x=y9 and
A10: G|X=g;
    now
      let xx be object;
      assume xx in Xx;
      then
A11:  xx in X or xx in {x} by XBOOLE_0:def 3;
A12:  dom f=X by FUNCT_2:def 1;
      dom g= X by FUNCT_2:def 1;
      then G.xx=g.xx & F.xx=f.xx or xx = x by A6,A10,A11,A12,FUNCT_1:47
,TARSKI:def 1;
      hence G.xx=F.xx by A5,A7,A8,A9,XTUPLE_0:1;
    end;
    hence thesis by FUNCT_2:12;
  end;
  consider H be Function of [:FXY,Y:],FXxY such that
A13: for x be Element of [:FXY,Y:] holds P[x,H.x] from FUNCT_2:sch 3(A2);
A14: now
    let x1,x2 be object such that
A15: x1 in [:FXY,Y:] and
A16: x2 in [:FXY,Y:] and
A17: H.x1 = H.x2;
    consider f2,y2 be object such that
A18: f2 in FXY and
A19: y2 in Y and
A20: x2=[f2,y2] by A16,ZFMISC_1:def 2;
    consider f1,y1 be object such that
A21: f1 in FXY and
A22: y1 in Y and
A23: x1=[f1,y1] by A15,ZFMISC_1:def 2;
    reconsider f1,f2 as Function of X,Y by A21,A18,FUNCT_2:66;
    Y\/{y2}=Y by A19,ZFMISC_1:40;
    then consider F2 be Function of X\/{x},Y such that
A24: F2|X = f2 and
A25: F2.x=y2 by A1,STIRL2_1:57;
A26: H.x2=F2 by A13,A16,A20,A24,A25;
    Y\/{y1}=Y by A22,ZFMISC_1:40;
    then consider F1 be Function of X\/{x},Y such that
A27: F1|X = f1 and
A28: F1.x=y1 by A1,STIRL2_1:57;
    H.x1=F1 by A13,A15,A23,A27,A28;
    hence x1=x2 by A17,A23,A20,A27,A28,A24,A25,A26;
  end;
  take H;
  x in {x} by TARSKI:def 1;
  then
A29: x in Xx by XBOOLE_0:def 3;
A30: FXxY c= rng H
  proof
    let f9 be object;
    assume f9 in FXxY;
    then reconsider f=f9 as Function of Xx,Y by FUNCT_2:66;
    dom f=Xx by FUNCT_2:def 1;
    then
A31: dom (f|X)=X by RELAT_1:62,XBOOLE_1:7;
    rng (f|X) c= Y by RELAT_1:def 19;
    then reconsider fX=f|X as Function of X,Y by A31,FUNCT_2:2;
A32: fX in FXY by FUNCT_2:8;
    x in {x} by TARSKI:def 1;
    then
A33: x in Xx by XBOOLE_0:def 3;
    Xx=dom f by FUNCT_2:def 1;
    then
A34: f.x in rng f by A33,FUNCT_1:def 3;
    rng f c= Y by RELAT_1:def 19;
    then
A35: [fX,f.x] in [:FXY,Y:] by A34,A32,ZFMISC_1:87;
    [:FXY,Y:]=dom H by FUNCT_2:def 1;
    then H.[fX,f.x] in rng H by A35,FUNCT_1:def 3;
    hence thesis by A13,A35;
  end;
  rng H c= FXxY by RELAT_1:def 19;
  then FXxY = rng H by A30;
  then H is one-to-one onto by A14,FUNCT_2:19,def 3;
  hence H is bijective;
  let f be Function of X,Y,F be Function of X\/{x},Y such that
A36: F|X=f;
  Xx=dom F by FUNCT_2:def 1;
  then
A37: F.x in rng F by A29,FUNCT_1:def 3;
A38: f in FXY by FUNCT_2:8;
  rng F c= Y by RELAT_1:def 19;
  then [f,F.x] in [:FXY,Y:] by A37,A38,ZFMISC_1:87;
  hence thesis by A13,A36;
end;
