reserve x for set,
  i,j,k,n for Nat,
  K for Field;
reserve a,b,c,d for Element of K;
reserve D for non empty set;

theorem Th28:
  <*2,3,1*>" = <*3,1,2*>
proof
  set f = <*2,3,1*>, g = <*3,1,2*>;
  rng f = {2,3,1} by FINSEQ_2:128
    .= {1,2,3} by ENUMSET1:59;
  then
A1: dom f = {1,2,3} & rng f = dom g by FINSEQ_1:89,FINSEQ_3:1;
  then
A2: dom (g * f) = {1,2,3} by RELAT_1:27;
A3: for x being object st x in dom (g * f) holds (g * f).x = (id {1,2,3}).x
  proof
    let x be object;
    assume
A4: x in dom (g * f);
    per cases by A2,A4,ENUMSET1:def 1;
    suppose
A5:   x = 1;
      then g.(f.x) = g.2
        .= 1
        .= (id {1,2,3}).x by A2,A4,A5,FUNCT_1:18;
      hence thesis by A4,FUNCT_1:12;
    end;
    suppose
A6:   x = 2;
      then g.(f.x) = g.3
        .= 2
        .= (id {1,2,3}).x by A2,A4,A6,FUNCT_1:18;
      hence thesis by A4,FUNCT_1:12;
    end;
    suppose
A7:   x = 3;
      then g.(f.x) = g.1
        .= 3
        .= (id {1,2,3}).x by A2,A4,A7,FUNCT_1:18;
      hence thesis by A4,FUNCT_1:12;
    end;
  end;
  f is one-to-one & dom (g * f) = dom id {1,2,3} by A2,FINSEQ_3:95,RELAT_1:45;
  hence thesis by A1,A3,FUNCT_1:2,41;
end;
