reserve i,j,n,n1,n2,m,k,l,u for Nat,
        i1,i2,i3,i4,i5,i6 for Element of n,
        p,q for n-element XFinSequence of NAT,
        a,b,c,d,e,f for Integer;

theorem Th12:
  for p being Prime
    for f being FinSequence of NAT st
      f is positive-yielding & p divides Product f
  ex i st i in dom f & p divides f.i
proof
  let p be Prime;
  defpred P[Nat] means for f be FinSequence of NAT st len f=$1
     & f is positive-yielding & p divides Product f
     ex i st i in dom f & p divides f.i;
A1:   P[0]
    proof
      let f be FinSequence of NAT such that
A2:     len f=0 & f is positive-yielding & p divides Product f;
      f=<*>REAL by A2;
      hence thesis by INT_2:def 4,A2,INT_2:27,RVSUM_1:94;
    end;
A3:   P[n] implies P[n+1]
    proof set n1=n+1;
      assume
A4:     P[n];
      let f be FinSequence of NAT such that
A5:     len f=n1 & f is positive-yielding & p divides Product f;
      f = (f|n)^ <*f.n1*> by A5,FINSEQ_3:55;
      then Product f = Product (f|n) * (f.n1) by RVSUM_1:96;
      then per cases by NEWTON:80,A5;
      suppose
A6:       p divides f.n1;
        1<= n1 by NAT_1:11;
        hence thesis by A6,A5,FINSEQ_3:25;
      end;
      suppose
A7:     p divides Product (f|n);
        len (f|n) = n by A5,FINSEQ_1:59,NAT_1:11;
        then consider i such that
A8:     i in dom (f|n) & p divides (f|n).i by A7,A4,A5;
        i in dom f & (f|n).i = f.i by A8,FUNCT_1:47,RELAT_1:57;
        hence thesis by A8;
      end;
    end;
    let f be FinSequence of NAT;
    P[n] from NAT_1:sch 2(A1,A3);
    then P[len f];
    hence thesis;
end;
