reserve A for set, x,y,z for object,
  k for Element of NAT;

theorem Th9:
  for X being set, A being finite Subset of X, R being Order of X
  st R linearly_orders A holds SgmX(R,A) is one-to-one
proof
  let X be set, A be finite Subset of X, R be Order of X;
  set f = (SgmX(R, A));
  assume
A1: R linearly_orders A;
  then rng f = A by Def2;
  then reconsider f as FinSequence of A by FINSEQ_1:def 4;
  f is one-to-one
  proof
    let k,l be object;
    assume that
A2: k in dom f and
A3: l in dom f and
A4: f.k = f.l;
    reconsider k,l as Element of NAT by A2,A3;
    reconsider fk = f.k as Element of A by A2,FINSEQ_2:11;
    reconsider fl = f.l as Element of A by A3,FINSEQ_2:11;
A5: fl = f/.l by A3,PARTFUN1:def 6;
A6: fk = f/.k by A2,PARTFUN1:def 6;
    now
A7:   f/.l = f.l by A3,PARTFUN1:def 6
        .= SgmX(R,A)/.l by A3,PARTFUN1:def 6;
A8:   f/.k = f.k by A2,PARTFUN1:def 6
        .= SgmX(R,A)/.k by A2,PARTFUN1:def 6;
      assume
A9:   k <> l;
      per cases by A9,XXREAL_0:1;
      suppose
        k < l;
        hence contradiction by A1,A2,A3,A4,A6,A5,A8,A7,Def2;
      end;
      suppose
        l < k;
        hence contradiction by A1,A2,A3,A4,A6,A5,A8,A7,Def2;
      end;
    end;
    hence thesis;
  end;
  hence thesis;
end;
