reserve a,a1,a2,b,c,d for Ordinal,
  n,m,k for Nat,
  x,y,z,t,X,Y,Z for set;
reserve f,g for Function;
reserve A,B,C for array;
reserve O for connected non empty Poset;
reserve R,Q for array of O;

theorem Th52:
  x in dom R & y in dom R & z <> x & z <> y & t <> x & t <> y
  implies
  ([z,t] in inversions R iff [z,t] in inversions Swap(R,x,y))
  proof set s = Swap(R,x,y);
    assume
    x in dom R & y in dom R & z <> x & z <> y & t <> x & t <> y; then
A1: (z in dom R implies s/.z = R/.z) & (t in dom R implies s/.t = R/.t) &
    dom s = dom R by Th34,FUNCT_7:99;
    hereby
      assume [z,t] in inversions R; then
      z in dom R & t in dom R & z in t & R/.z > R/.t by Th46;
      hence [z,t] in inversions Swap(R,x,y) by A1;
    end;
    assume [z,t] in inversions Swap(R,x,y); then
    z in dom R & t in dom R & z in t & s/.z > s/.t by A1,Th46;
    hence thesis by A1;
  end;
