reserve D for non empty set,
  f for FinSequence of D,
  p, p1, p2, p3, q for Element of D,
  i, j, k, l, n for Nat;

theorem Th27:
  1 <= i & i < j & j <= len f implies Swap(f, i, j) = (f|(i-'1))^
  <*f/.j*>^(f/^i)|(j-'i-'1)^<*f/.i*>^(f/^j)
proof
  assume that
A1: 1 <= i and
A2: i < j and
A3: j <= len f;
A4: i <= len f & 1 <= j by A1,A2,A3,XXREAL_0:2;
  Swap(f,i,j) = Swap(f,j,i) by Th21
    .= Replace(Replace(f,j,f/.i),i,f/.j) by A1,A3,A4,Def2;
  hence thesis by A1,A2,A3,Th11;
end;
