reserve X for set;
reserve a,b,c,k,m,n for Nat;
reserve i for Integer;
reserve r for Real;
reserve p for Prime;

theorem Th10:
  n <> 0 implies for f being integer-valued FinSequence holds
  Sum f, Sum (f mod n) are_congruent_mod n
  proof
    assume
A1: n <> 0;
    let f be integer-valued FinSequence;
A2: f is FinSequence of INT by FINSEQ_1:102;
    defpred P[FinSequence of INT] means
    Sum $1, Sum ($1 mod n) are_congruent_mod n;
A3: P[<*>INT] by INT_1:11;
A4: for p being FinSequence of INT for x being Element of INT st
    P[p] holds P[p^<*x*>]
    proof
      let p be FinSequence of INT;
      let x be Element of INT such that
A5:   P[p];
A6:   Sum (p^<*x*>) = (Sum p) + x by RVSUM_1:74;
A7:   <*x*> mod n = <*x mod n*> by Th9;
A8:   Sum <*x mod n*> = x mod n by RVSUM_1:73;
      p^<*x*> mod n = (p mod n) ^ (<*x*> mod n) by EULER_2:15;
      then
A9:   Sum((p^<*x*>) mod n) = (Sum (p mod n)) + (x mod n) by A7,A8,RVSUM_1:75;
      x,x mod n are_congruent_mod n by A1,NAT_6:10;
      hence thesis by A5,A6,A9,INT_1:16;
    end;
    for p being FinSequence of INT holds P[p] from FINSEQ_2:sch 2(A3,A4);
    hence thesis by A2;
  end;
