theorem
  q = p|Seg n implies len q<=len p & for i st 1<=i & i<=len q holds p.i = q.i
proof
  assume
A1: q = p|Seg n;
  per cases;
  suppose
A2: n<=len p;
    hence len q<=len p by A1,FINSEQ_1:17;
    let i be Nat;
    assume that
A3: 1<=i and
A4: i<=len q;
    len q = n by A1,A2,FINSEQ_1:17;
    then i in Seg n by A3,A4;
    hence thesis by A1,FUNCT_1:49;
  end;
  suppose
A5: len p<=n;
    hence len q<=len p by A1,FINSEQ_2:20;
    let i be Nat;
    assume that
    1<=i and
    i<=len q;
    thus thesis by A1,A5,FINSEQ_2:20;
  end;
end;
