Documentation

HexPrimalityMathlib.Prime

The whole correspondence: the Mathlib-free predicate and Nat.Prime agree. Everything else transports along it.

Checker soundness, in Mathlib's vocabulary.

The single-Bool-slot wrapper, in Mathlib's vocabulary; what the Nat.Prime tactic handler emits.

The total decision is exact for Nat.Prime.

A Miller-Rabin witness refutes Nat.Prime.

theorem Hex.Nat.nextPrime?_natPrime {n : ℕ} {r : Rand} {fuel p : ℕ} {r' : Rand} (h : nextPrime? n r fuel = Except.ok (p, r')) :
n < p ∧ _root_.Nat.Prime p ∧ ∀ (q : ℕ), n < q → q < p → ¬_root_.Nat.Prime q

A successful next-prime search, in Mathlib's vocabulary.