def prime
import bend-collections-laws-math@1.0.0.0/spec/math/number.bend as Numberimport Base
73# n is prime: 2 <= n and no d in [2, n) divides n
74def prime(+n: Nat) -> Bool:
75 match n:
76 case 0n:
77 False{}
78 case 1n:
79 False{}
80 case 2n+ +p:
81 nodiv(p, 2n+p, 2n)
Uses (3)
Used by (13)
- bend-collections-laws-math@1.0.0.0/spec/math/fixed:no_prime
- bend-collections-laws-math@1.0.0.0/proofs/math/number/fixprime:prime_of
- bend-collections-laws-math@1.0.0.0/spec/math/fixed:IsPrime.value
- bend-collections-laws-math@1.0.0.0/spec/math/fixed:NextPrime.found
- bend-collections-laws-math@1.0.0.0/spec/math/fixed:NextPrime.none
- …