let n be Nat; :: thesis: for p being Prime st ( for r being Nat holds n <> p |^ r ) holds
ex s being Element of NAT st
( s is prime & s divides n & s <> p )

let p be Prime; :: thesis: ( ( for r being Nat holds n <> p |^ r ) implies ex s being Element of NAT st
( s is prime & s divides n & s <> p ) )

assume A1: for r being Nat holds n <> p |^ r ; :: thesis: ex s being Element of NAT st
( s is prime & s divides n & s <> p )

per cases ( n = 0 or n <> 0 ) ;
suppose A2: n = 0 ; :: thesis: ex s being Element of NAT st
( s is prime & s divides n & s <> p )

per cases ( p = 2 or p <> 2 ) ;
suppose A3: p = 2 ; :: thesis: ex s being Element of NAT st
( s is prime & s divides n & s <> p )

take s = 3; :: thesis: ( s is prime & s divides n & s <> p )
thus s is prime by PEPIN:41; :: thesis: ( s divides n & s <> p )
thus s divides n by A2, INT_2:12; :: thesis: s <> p
thus s <> p by A3; :: thesis: verum
end;
suppose A4: p <> 2 ; :: thesis: ex s being Element of NAT st
( s is prime & s divides n & s <> p )

take s = 2; :: thesis: ( s is prime & s divides n & s <> p )
thus s is prime by INT_2:28; :: thesis: ( s divides n & s <> p )
thus s divides n by A2, INT_2:12; :: thesis: s <> p
thus s <> p by A4; :: thesis: verum
end;
end;
end;
suppose A5: n <> 0 ; :: thesis: ex s being Element of NAT st
( s is prime & s divides n & s <> p )

A6: p > 1 by INT_2:def 4;
reconsider r1 = p |-count n as Element of NAT ;
A7: p |^ r1 divides n by A5, A6, NAT_3:def 7;
A8: not p |^ (r1 + 1) divides n by A5, A6, NAT_3:def 7;
consider s1 being Nat such that
A9: n = (p |^ r1) * s1 by A7, NAT_D:def 3;
s1 >= 2
proof
assume not s1 >= 2 ; :: thesis: contradiction
then s1 < 1 + 1 ;
then s1 <= 1 by NAT_1:13;
then ( s1 = 0 or s1 = 1 ) by NAT_1:25;
hence contradiction by A5, A1, A9; :: thesis: verum
end;
then consider s being Element of NAT such that
A10: s is prime and
A11: s divides s1 by INT_2:31;
A12: s1 divides n by A9, NAT_D:def 3;
take s ; :: thesis: ( s is prime & s divides n & s <> p )
s <> p
proof
assume s = p ; :: thesis: contradiction
then consider s2 being Nat such that
A13: s1 = p * s2 by A11, NAT_D:def 3;
n = ((p |^ r1) * p) * s2 by A9, A13
.= (p |^ (r1 + 1)) * s2 by NEWTON:6 ;
hence contradiction by A8, NAT_D:def 3; :: thesis: verum
end;
hence ( s is prime & s divides n & s <> p ) by A10, A11, A12, NAT_D:4; :: thesis: verum
end;
end;