
theorem Th5: :: SumDivision:
  for f being FinSequence of NAT, i being Element of NAT
  st for j being Element of NAT st j in dom f
  holds i divides f/.j holds i divides Sum f
proof
  defpred P[Nat] means
    for f being FinSequence of NAT st len f = $1
  for i being Element of NAT st for j being Element of NAT st j in dom f
  holds i divides f/.j holds i divides Sum f;
A1: P[0]
  proof
    let f be FinSequence of NAT;
    assume len f = 0;
    then
A2: f = <*>NAT;
    let i be Element of NAT such that
    for j being Element of NAT st j in dom f holds i divides f/.j;
    Sum f = 0 by A2,RVSUM_1:72;
    hence thesis by NAT_D:6;
  end;
A3: for k being Nat st P[k] holds P[k+1]
  proof
    let k be Nat such that
A4: P[k];
    let f be FinSequence of NAT such that
A5: len f = k+1;
    let i be Element of NAT such that
A6: for j being Element of NAT st j in dom f holds i divides f/.j;
    f <> {} by A5;
    then consider q being FinSequence, x being object such that
A7: f=q^<*x*> by FINSEQ_1:46;
    reconsider f1=q as FinSequence of NAT by A7,FINSEQ_1:36;
    reconsider f2=<*x*> as FinSequence of NAT by A7,FINSEQ_1:36;
    k + 1 = len f1 + len f2 by A5,A7,FINSEQ_1:22;
    then
A8: k + 1 = len f1 + 1 by FINSEQ_1:39;
    for j being Element of NAT st j in dom f1 holds i divides f1/.j
    proof
      let j be Element of NAT such that
A9:   j in dom f1;
A10:  dom f1 c= dom f by A7,FINSEQ_1:26;
      then f/.j = f.j by A9,PARTFUN1:def 6
        .= f1.j by A7,A9,FINSEQ_1:def 7
        .= f1/.j by A9,PARTFUN1:def 6;
      hence thesis by A6,A9,A10;
    end;
    then
A11: i divides Sum f1 by A4,A8;
    rng f2 c= NAT by FINSEQ_1:def 4;
    then {x} c= NAT by FINSEQ_1:38;
    then reconsider m=x as Element of NAT by ZFMISC_1:31;
A12: f.(len f) = m by A5,A7,A8,FINSEQ_1:42;
    len f in Seg len f by A5,FINSEQ_1:3;
    then
A13: len f in dom f by FINSEQ_1:def 3;
    then f/.(len f) = f.(len f) by PARTFUN1:def 6;
    then
A14: i divides m by A6,A12,A13;
    Sum f = Sum f1 + m by A7,RVSUM_1:74;
    hence thesis by A11,A14,NAT_D:8;
  end;
A15: for k being Nat holds P[k] from NAT_1:sch 2(A1,A3);
  let f be FinSequence of NAT, i be Element of NAT such that
A16: for j being Element of NAT st j in dom f holds i divides f/.j;
  len f = len f;
  hence thesis by A15,A16;
end;
