reserve i,j,k,n for Nat;
reserve D for non empty set,
  p for Element of D,
  f,g for FinSequence of D;

theorem Th22:
  for f, g being FinSequence st i <= len f holds (f^g)|i = f|i
proof
  let f, g be FinSequence;
  assume
A1: i <= len f;
  then
A2: len(f|i) = i by FINSEQ_1:59;
  then
A3: dom(f|i) = Seg i by FINSEQ_1:def 3;
A4: now
    let j be Nat;
    assume
A5: j in dom(f|i);
    then j <= i by A3,FINSEQ_1:1;
    then
A6: j <= len f by A1,XXREAL_0:2;
    j in NAT & 1 <= j by A3,A5,FINSEQ_1:1;
    then j in Seg len f by A6;
    then
A7: j in dom f by FINSEQ_1:def 3;
    thus ((f^g)|i).j = (f^g).j by A3,A5,FUNCT_1:49
      .= f.j by A7,FINSEQ_1:def 7
      .= (f|i).j by A3,A5,FUNCT_1:49;
  end;
  i <= len f+len g by A1,NAT_1:12;
  then i <= len(f^g) by FINSEQ_1:22;
  then len((f^g)|i) = i by FINSEQ_1:59;
  hence thesis by A2,A4,FINSEQ_2:9;
end;
