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);

theorem Th18:
  for X,x st not x in X for p1 be Permutation of X\/{x} st p1.x =
  x ex p be Permutation of X st p1|X = p
proof
  let X,x such that
A1: not x in X;
  let p1 be Permutation of X\/{x} such that
A2: p1.x=x;
A3: X c= X\/{x} by XBOOLE_1:7;
  set pX=p1|X;
A4: dom p1=X\/{x} by FUNCT_2:52;
  then
A5: dom pX=X by RELAT_1:62,XBOOLE_1:7;
A6: rng p1=X\/{x} by FUNCT_2:def 3;
  then
A7: rng pX c= X\/{x} by RELAT_1:70;
A8: rng pX c= X
  proof
    let y be object such that
A9: y in rng pX;
    consider x9 be object such that
A10: x9 in dom pX and
A11: pX.x9=y by A9,FUNCT_1:def 3;
    assume
A12: not y in X;
    y in rng pX by A10,A11,FUNCT_1:def 3;
    then y in {x} by A7,A12,XBOOLE_0:def 3;
    then
A13: y=x by TARSKI:def 1;
    pX.x9=p1.x9 by A10,FUNCT_1:47;
    hence thesis by A1,A2,A3,A4,A5,A7,A9,A10,A11,A13,FUNCT_1:def 4;
  end;
  X c= rng pX
  proof
    let y be object such that
A14: y in X;
    consider x9 be object such that
A15: x9 in dom p1 and
A16: p1.x9=y by A3,A6,A14,FUNCT_1:def 3;
A17: x9 in X
    proof
      assume not x9 in X;
      then x9 in {x} by A4,A15,XBOOLE_0:def 3;
      hence thesis by A1,A2,A14,A16,TARSKI:def 1;
    end;
    then pX.x9=p1.x9 by A5,FUNCT_1:47;
    hence thesis by A5,A16,A17,FUNCT_1:def 3;
  end;
  then
A18: rng pX=X by A8;
A19: pX is one-to-one by FUNCT_1:52;
  reconsider pX as Function of X,X by A5,A18,FUNCT_2:1;
  pX is onto by A18,FUNCT_2:def 3;
  hence thesis by A19;
end;
