Reference · The Applied Higher-Order Functions catalogue
rainbow.algorithms.proofs.ahof.dbscan
AHoF DBSCAN (Density-Based Spatial Clustering of Applications with Noise): find clusters of arbitrary shape as dense regions separated by sparse ones, labelling low-density points as noise -- without needing the number of clusters in advance. The engine is the CORE-POINT test: a point is a core point (the seed of a cluster) when its epsilon-neighborhood contains at least minPts points: is-core? neighbor-count min-pts = decide (min-pts <= neighbor-count) over exact-rational (integer) counts. Proved native and axiom-free: the core-point test; that a point in a dense region is a core point; the certificate that a core point really has at least minPts neighbors (native nnrat/at-most) -- the density criterion; and that a sparse point is not a core point (it is a border or noise point). The region queries and cluster expansion are executable; what is proved is the density core-point decision. Requires nnrat/at-most, audit/decide-nnrat-at-most, nnrat/decide-at-most-true-sound (all in the D63 checkpoint). Scope (measured by the kernel): this module has 3 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.dbscan` prints this classification.
dbscan/is-core?
dbscan/is-core? : (x₁ x₂ : ℚ≥0) → data/Bool
ℚ≥0 = nnrat/NonnegativeRational
dbscan/dense-point-is-core
dbscan/dense-point-is-core : → bo/is-safe 5 3 = data/true
= = equality/Eq
dbscan/core-meets-density
dbscan/core-meets-density : → 3 ≤ 5
≤ = nnrat/at-most
dbscan/sparse-point-not-core
dbscan/sparse-point-not-core : → bo/is-safe 2 3 = data/false
= = equality/Eq