reserve I for non empty set;
reserve M for ManySortedSet of I;
reserve Y,x,y,y1,i,j for set;
reserve k for Element of NAT;
reserve p for FinSequence;
reserve S for non void non empty ManySortedSign;
reserve A for non-empty MSAlgebra over S;

theorem Th1:
  for n be Nat, p be FinSequence holds 1 <= n & n <
  len p iff n in dom p & n+1 in dom p
proof
  let n be Nat;
  let p be FinSequence;
  thus 1 <= n & n < len p implies n in dom p & n+1 in dom p
  proof
    assume that
A1: 1 <= n and
A2: n < len p;
    1 <= n + 1 & n + 1 <= len p by A2,NAT_1:11,13;
    then
A3: n + 1 in Seg len p by FINSEQ_1:1;
    n in Seg len p by A1,A2,FINSEQ_1:1;
    hence thesis by A3,FINSEQ_1:def 3;
  end;
  thus n in dom p & n+1 in dom p implies 1 <= n & n < len p
  proof
    assume that
A4: n in dom p and
A5: n+1 in dom p;
    n+1 in Seg len p by A5,FINSEQ_1:def 3;
    then
A6: n+1 <= len p by FINSEQ_1:1;
    n in Seg len p by A4,FINSEQ_1:def 3;
    hence thesis by A6,FINSEQ_1:1,NAT_1:13;
  end;
end;
