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);
reserve pD for FinSequence of D,
  M for Matrix of n,m,D,
  pK,qK for FinSequence of K,
  A for Matrix of n,K;

theorem Th37:
  Indices M = Indices (M*F) & for i,j st [i,j] in Indices M ex k
  st F.i = k & [k,j] in Indices M & (M*F)*(i,j) = M*(k,j)
proof
  set Mp=M*F;
A1: dom F=Seg n by FUNCT_2:52;
A2: width M=width Mp by Def4;
  len M=len Mp by Def4;
  hence Indices M=Indices Mp by A2,MATRIX_4:55;
  let i,j such that
A3: [i,j] in Indices M;
  Indices M=[:Seg n,Seg width M:] by MATRIX_0:25;
  then i in Seg n by A3,ZFMISC_1:87;
  then
A4: F.i in rng F by A1,FUNCT_1:def 3;
A5: rng F c= Seg n by RELAT_1:def 19;
  then (F.i) in Seg n by A4;
  then reconsider k=F.i as Element of NAT;
  j in Seg width M by A3,ZFMISC_1:87;
  then [k,j] in [:Seg n,Seg width M:] by A4,A5,ZFMISC_1:87;
  then
A6: [k,j] in Indices M by MATRIX_0:25;
  Mp*(i,j)=M*(k,j) by A3,Def4;
  hence thesis by A6;
end;
