reserve i, i1, i2, j, k for Nat,
  r, s for Real;
reserve D for non empty set,
  f1 for FinSequence of D;

theorem Th36:
  for g being FinSequence of D holds g is one-to-one iff for i1,i2
st 1<=i1 & i1<=len g & 1<=i2 & i2<=len g & (g.i1=g.i2 or g/.i1=g/.i2) holds
  i1 = i2
proof
  let g be FinSequence of D;
A1: (for i1,i2 st 1<=i1 & i1<=len g & 1<=i2 & i2<=len g & (g.i1=g.i2 or g/.
  i1=g/.i2) holds i1=i2) implies g is one-to-one
  proof
    assume
A2: for i1,i2 st 1<=i1 & i1<=len g & 1<=i2 & i2<=len g & (g.i1=g.i2
    or g/.i1=g/.i2) holds i1=i2;
    for x1,x2 being object st x1 in dom g & x2 in dom g & g.x1=g.x2
     holds x1 = x2
    proof
      let x1,x2 be object;
      assume that
A3:   x1 in dom g and
A4:   x2 in dom g and
A5:   g.x1=g.x2;
      reconsider n2=x2 as Nat by A4;
A6:   1<=n2 by A4,FINSEQ_3:25;
      reconsider n1=x1 as Nat by A3;
A7:   n1<=len g by A3,FINSEQ_3:25;
A8:   n2<=len g by A4,FINSEQ_3:25;
      1<=n1 by A3,FINSEQ_3:25;
      hence thesis by A2,A5,A7,A6,A8;
    end;
    hence thesis by FUNCT_1:def 4;
  end;
  g is one-to-one implies for i1,i2 st 1<=i1<=len g & 1<=i2<=len
  g & (g.i1=g.i2 or g/.i1=g/.i2) holds i1=i2
  proof
    assume
A9: g is one-to-one;
    thus for i1,i2 st 1<=i1 & i1<=len g & 1<=i2 & i2<=len g & (g.i1=g.i2 or g
    /.i1=g/.i2) holds i1=i2
    proof
      let i1,i2;
      assume that
A10:  1<=i1 and
A11:  i1<=len g and
A12:  1<=i2 and
A13:  i2<=len g and
A14:  g.i1=g.i2 or g/.i1=g/.i2;
A15:  i2 in dom g by A12,A13,FINSEQ_3:25;
A16:  g/.i2=g.i2 by A12,A13,FINSEQ_4:15;
A17:  g/.i1=g.i1 by A10,A11,FINSEQ_4:15;
      i1 in dom g by A10,A11,FINSEQ_3:25;
      hence thesis by A9,A14,A15,A17,A16,FUNCT_1:def 4;
    end;
  end;
  hence thesis by A1;
end;
