
theorem Th6:
  for p, q being FinSequence for j being Nat st j <= len maxPrefix(
  p,q) holds maxPrefix(p,q).j = p.j
proof
  let p, q be FinSequence;
  let j be Nat such that
A1: j <= len maxPrefix(p,q);
A2: maxPrefix(p,q) c= p by Def1;
  per cases;
  suppose
A3: j = 0;
    then
A4: not j in dom p by FINSEQ_3:24;
    not j in dom maxPrefix(p,q) by A3,FINSEQ_3:24;
    hence maxPrefix(p,q).j = 0 by FUNCT_1:def 2
      .= p.j by A4,FUNCT_1:def 2;
  end;
  suppose
    j <> 0;
    then 0+1 <= j by NAT_1:13;
    then j in dom maxPrefix(p,q) by A1,FINSEQ_3:25;
    hence thesis by A2,GRFUNC_1:2;
  end;
end;
