4.3 Finite-type PMF
Lean: ProbabilityTheory.FintypePMF
For a fintype \(\alpha \), a FintypePMF \(\alpha \) is a pair \(\langle p, h_{\ge 0}, h_{\sum = 1} \rangle \) where \(p : \alpha \to \mathbb {R}\), \(p \ge 0\) pointwise, and \(\sum _{a : \alpha } p(a) = 1\). This is an \(\mathbb {R}\)-valued, linarith-compatible specialization of Mathlib’s \(\mathbb {R}_{\ge 0}^\infty \)-valued PMF [ 5 , § 4 ] .
Lean: ProbabilityTheory.FintypePMF.toPMF_apply
The map \(\mathrm{toPMF} : \mathrm{FintypePMF}\, \alpha \to \mathrm{PMF}\, \alpha \) satisfies \((\mathrm{toPMF}\, p)(a) = \mathrm{ENNReal.ofReal}(p.\mathrm{prob}\, a)\), which is lossless on valid FintypePMF inputs [ 5 , § 4.1 ] .
Lean: ProbabilityTheory.FintypePMF.tvDistance_nonneg
\(\mathrm{tvDistance}(p, q) \ge 0\) [ 5 , § 4.1 ] .
Lean: ProbabilityTheory.FintypePMF.tvDistance_comm
\(\mathrm{tvDistance}(p, q) = \mathrm{tvDistance}(q, p)\) [ 5 , § 4.1 ] .
Lean: ProbabilityTheory.FintypePMF.tvDistance_self
\(\mathrm{tvDistance}(p, p) = 0\) [ 5 , § 4.1 ] .
Lean: ProbabilityTheory.FintypePMF.expectation_approx_of_tv
For Boolean-valued \(f\), \(\bigl| \mathbb {E}_p[f] - \mathbb {E}_q[f] \bigr| \; \le \; \mathrm{tvDistance}(p, q)\). In the half-sup TV convention this would read \(\le 2 \cdot \mathrm{TV}(p, q)\) [ 5 , § 4.1 ] .