reserve x,y for object,
  N for Element of NAT,
  c,i,j,k,m,n for Nat,
  D for non empty set,
  s for Element of 2Set Seg (n+2),
  p for Element of Permutations(n) ,
  p1, q1 for Element of Permutations(n+1),
  p2 for Element of Permutations(n +2),
  K for Field,
  a for Element of K,
  f for FinSequence of K,
  A for (Matrix of K),
  AD for Matrix of n,m,D,
  pD for FinSequence of D,
  M for Matrix of n,K;

theorem
  for i st i in Seg width AD holds (i = c & len pD = len AD implies Col(
  RCol(AD,c,pD),i) = pD) & (i <> c implies Col(RCol(AD,c,pD),i) = Col(AD,i))
proof
  let i such that
A1: i in Seg width AD;
  set R=RCol(AD,c,pD);
  set CR=Col(R,i);
  thus i = c & len pD = len AD implies CR = pD
  proof
    assume that
A2: i = c and
A3: len pD = len AD;
A4: len R = len pD by A3,Def2;
A5: now
      let J be Nat such that
A6:   1<=J and
A7:   J<=len pD;
      J in Seg len pD by A6,A7;
      then
A8:   J in dom R by A4,FINSEQ_1:def 3;
      i in Seg width R by A1,A3,Def2;
      then
A9:   [J,c] in Indices R by A2,A8,ZFMISC_1:87;
A10:  Indices R=Indices AD by MATRIX_0:26;
      CR.J=R*(J,c) by A2,A8,MATRIX_0:def 8;
      hence CR.J=pD.J by A3,A9,A10,Def2;
    end;
    len CR=len pD by A4,MATRIX_0:def 8;
    hence thesis by A5;
  end;
  set CA=Col(AD,i);
A11: len AD=n by MATRIX_0:def 2;
A12: len R=n by MATRIX_0:def 2;
A13: len AD=len CA by MATRIX_0:def 8;
  assume
A14: i <> c;
A15: now
    let j be Nat such that
A16: 1 <=j and
A17: j <= len CA;
A18: j in Seg len AD by A13,A16,A17;
    then
A19: j in dom AD by FINSEQ_1:def 3;
    then
A20: CA.j=AD*(j,i) by MATRIX_0:def 8;
    j in dom R by A11,A12,A18,FINSEQ_1:def 3;
    then
A21: CR.j=R*(j,i) by MATRIX_0:def 8;
A22: [j,i] in Indices AD by A1,A19,ZFMISC_1:87;
    per cases;
    suppose
      len pD=len AD;
      hence CA.j=CR.j by A14,A20,A21,A22,Def2;
    end;
    suppose
      len pD<>len AD;
      hence CA.j=CR.j by Def2;
    end;
  end;
  len CR=len R by MATRIX_0:def 8;
  hence thesis by A11,A12,A13,A15;
end;
