def factorial
import bend-collections-laws-math@1.0.0.0/spec/math/natural.bend as Naturalimport Base
51# Mathlib/Data/Nat/Factorial/Basic (Nat.factorial_succ)
52def factorial(n: Nat) -> Nat:
53 match n:
54 case 0n:
55 1n
56 case 1n+ +p:
57 Nat.mul(1n+p, factorial(p))
Uses (2)
Used by (23)
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/natfuel:fmono
- bend-collections-laws-math@1.0.0.0/proofs/math/natural/fact:factorial_ok
- bend-collections-laws-math@1.0.0.0/proofs/math/typed/natfuel:fbig
- bend-collections-laws-math@1.0.0.0/proofs/math/natural/fact:choose_mul_factorial
- bend-collections-laws-math@1.0.0.0/proofs/math/natural/fact:choose_mul_facts
- …