English
The binomial coefficient choose(n,k) counts the number of k-element subsets of an n-element set; it satisfies the standard recursion and base cases.
Русский
Биномиальный коэффициент choose(n,k) подсчитывает число k-элментов подмножеств множества размера n; удовлетворяет стандартной рекурсии и базовым случаям.
LaTeX
$$$\mathrm{choose}: \mathbb{N} \to \mathbb{N} \to \mathbb{N},\;\text{defined by }\begin{cases} {\ 0 \\ 1} & \text{линии}, \text{etc.} \end{cases}$$$
Lean4
/-- `choose n k` is the number of `k`-element subsets in an `n`-element set. Also known as binomial
coefficients. For the fact that this is the number of `k`-element-subsets of an `n`-element
set, see `Fintype.card_powersetCard`. -/
def choose : ℕ → ℕ → ℕ
| _, 0 => 1
| 0, _ + 1 => 0
| n + 1, k + 1 => choose n k + choose n (k + 1)