def is_prime_value

bend-collections-laws-math@1.0.0.0 · proofs/math/number/prime.bend:200

import bend-collections-laws-math@1.0.0.0/proofs/math/number/prime.bend as Prime
import Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/nat.bend as N
import bend-collections-laws-math@1.0.0.0/src/math/number.bend as NB
import bend-collections-laws-math@1.0.0.0/spec/math/number.bend as SN

200def is_prime_value(+n: Nat) -> SN.IsPrime.value(n):
201  match n:
202    case 0n:
203      {==}
204    case 1n:
205      {==}
206    case 2n+ +p:
207      %N.sub_zero(p) : {NB.is_prime(2n+p) == SN.nodiv(_, 2n+p, 2n) : Bool}
208      loop(2n+p, 2n+p, 0n, Nat.is_lt(2n+p, 4n), {==}, Nat.is_eq(Nat.mod(2n+p, 2n), 0n), {==}, {==}, {==})

Uses (10)

Used by (3)