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 thanLinearOrder— it does NOT require antisymmetry or… - LinearOrder.toTotalPreorderEvery
LinearOrderis aTotalPreorder.
- TotalPreorderA total preorder: a preorder where
- Used by 1
- mixture_representation_monotone_distributionLet $P : \mathbb{N}^+ \to \mathbb{R}$ be a nonincreasing probability distribution on the positive integers, so that $P(k) \ge 0$ for all…
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