2020-05-19 12:57:09 +02:00
|
|
|
input: n -> integer.
|
|
|
|
output: prime/1.
|
|
|
|
|
2020-05-28 07:06:19 +02:00
|
|
|
# TODO: not necessary if using the lemma below in both directions
|
2020-05-19 12:57:09 +02:00
|
|
|
assume: n >= 1.
|
|
|
|
|
2020-05-28 07:06:19 +02:00
|
|
|
spec: forall X (prime(X) -> exists N (X = N)).
|
|
|
|
spec: forall N (prime(N) <-> N > 1 and N <= n and not exists I, J (I > 1 and J > 1 and I * J = N)).
|
2020-05-19 12:57:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 07:06:19 +02:00
|
|
|
lemma(backward): forall N (composite(N) <-> N > 1 and N <= n and exists I, J (I > 1 and J > 1 and I * J = N)).
|