AFTD Auto-Formalizing Theoretical Domains

uniformDistribution

def

The uniform distribution $U_k$ on $\{1, \dots, k\}$, viewed as a function on $\mathbb{N}^+$, evaluates to $1/k$ for $n \le k$ and $0$ for $n > k$.

Statement

noncomputable def uniformDistribution (k : ℕ+) (n : ℕ+) : ℝ
Defined in
arXiv:2610.01563 Lemma 3
Verified
31 Oct 2026
Axioms
none listed
Built on 2
  • TotalPreorderA total preorder: a preorder where ≤ is total (complete). This is weaker than LinearOrder — it does NOT require antisymmetry or…
  • LinearOrder.toTotalPreorderEvery LinearOrder is a TotalPreorder.
Used by 1

Read back from the Lean

For positive integers $k$ and $n$, uniformDistribution k n is defined to be the real number $1 / k$ if $n \le k$, and $0$ otherwise.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- Uniform probability distribution on {1, ..., k} viewed as a function on ℕ+. -/
noncomputable def uniformDistribution (k : ℕ+) (n : ℕ+) : ℝ := if n ≤ k then 1 / (k : ℝ) else 0
See it in the graphDiscuss this resultChallenge it