def choose
import bend-collections-laws-crypto@1.0.0.0/spec/math/natural.bend as Naturalimport Base
67# Mathlib/Data/Nat/Choose/Basic (Pascal's rule, Nat.choose_succ_succ)
68def choose(n: Nat, k: Nat) -> Nat:
69 match n k:
70 case 0n 0n:
71 1n
72 case 0n 1n+j:
73 0n
74 case 1n+m 0n:
75 1n
76 case 1n+ +m 1n+ +j:
77 Nat.add(choose(m, j), choose(m, 1n+j))
Uses (2)
Used by (17)
- bend-collections-laws-crypto@1.0.0.0/proofs/math/natural/fact:choose_zero_right
- bend-collections-laws-crypto@1.0.0.0/proofs/math/natural/fact:comb_ok
- bend-collections-laws-crypto@1.0.0.0/proofs/math/natural/fact:choose_eq_zero
- bend-collections-laws-crypto@1.0.0.0/proofs/math/natural/fact:choose_mul_factorial
- bend-collections-laws-crypto@1.0.0.0/proofs/math/natural/fact:choose_mul_facts
- …