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 Th31:
  1 <= i & i <= len f & 1 <= j & j <= len f implies Swap(f, i, j)
  /.i = f/.j & Swap(f, i, j)/.j = f/.i
proof
  assume that
A1: 1 <= i and
A2: i <= len f and
A3: 1 <= j and
A4: j <= len f;
A5: i in dom f by A1,A2,FINSEQ_3:25;
  set F = Swap(f,i,j);
  j <= len F by A4,Th18;
  then j in dom F by A3,FINSEQ_3:25;
  then
A6: F/.j = F.j by PARTFUN1:def 6
    .= f.i by A1,A2,A3,A4,Lm3
    .= f/.i by A5,PARTFUN1:def 6;
A7: j in dom f by A3,A4,FINSEQ_3:25;
  i <= len F by A2,Th18;
  then i in dom F by A1,FINSEQ_3:25;
  then F/.i = F.i by PARTFUN1:def 6
    .= f.j by A1,A2,A3,A4,Lm3
    .= f/.j by A7,PARTFUN1:def 6;
  hence thesis by A6;
end;
