reserve n for Nat;

theorem
  for D be set for f be FinSequence of D holds f is poorly-one-to-one
iff (len f <> 2 implies for i be Nat st 1 <= i & i < len f holds f/.
  i <> f/.(i+1))
proof
  let D be set;
  let f be FinSequence of D;
  thus f is poorly-one-to-one & len f <> 2 implies for i be Nat st
  1 <= i & i < len f holds f/.i <> f/.(i+1)
  proof
    assume that
A1: f is poorly-one-to-one and
A2: len f <> 2;
    let i be Nat such that
A3: 1 <= i and
A4: i < len f;
A5: i+1 <= len f by A4,NAT_1:13;
    1 < i+1 by A3,NAT_1:13;
    then
A6: f.(i+1) = f/.(i+1) by A5,FINSEQ_4:15;
    f.i = f/.i by A3,A4,FINSEQ_4:15;
    hence thesis by A1,A2,A3,A4,A6,Def3;
  end;
  assume
A7: len f <> 2 implies for i be Nat st 1 <= i & i < len f
  holds f/.i <> f/.(i+1);
  per cases;
  suppose
A8: len f <> 2;
    now
      let i be Nat such that
A9:   1 <= i and
A10:  i < len f;
A11:  i+1 <= len f by A10,NAT_1:13;
      1 < i+1 by A9,NAT_1:13;
      then
A12:  f.(i+1) = f/.(i+1) by A11,FINSEQ_4:15;
      f.i = f/.i by A9,A10,FINSEQ_4:15;
      hence f.i <> f.(i+1) by A7,A8,A9,A10,A12;
    end;
    hence thesis by A8,Def3;
  end;
  suppose
    len f = 2;
    hence thesis by Def3;
  end;
end;
