Equations
- Chapter13.fib₀ 0 = 0
- Chapter13.fib₀ 1 = 1
- Chapter13.fib₀ n.succ.succ = Chapter13.fib₀ (n + 1) + Chapter13.fib₀ n
Instances For
Equations
- Chapter13.fib₁ n = (Chapter13.tab Chapter13.fib₁.a 0 n)[n]!
Instances For
@[irreducible]
Equations
- Chapter13.fib₁.a i = if i ≤ 1 then ↑i else Chapter13.fib₁.a (i - 1) + Chapter13.fib₁.a (i - 2)
Instances For
Equations
- Chapter13.fact n = List.foldl (fun (x1 x2 : Int) => x1 * x2) 1 (List.map Int.ofNat (List.drop 1 (List.range (n + 1))))
Instances For
Equations
- Chapter13.bin₀ n r = Chapter13.fact n / (Chapter13.fact r * Chapter13.fact (n - r))
Instances For
Equations
- Chapter13.bin₁ x✝ 0 = 1
- Chapter13.bin₁ 0 x✝ = 0
- Chapter13.bin₁ n.succ r.succ = if r + 1 = n + 1 then 1 else Chapter13.bin₁ n (r + 1) + Chapter13.bin₁ n r
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Chapter13.apl 0 x✝¹ x✝ = x✝
- Chapter13.apl n.succ x✝¹ x✝ = Chapter13.apl n x✝¹ (x✝¹ x✝)
Instances For
Equations
- Chapter13.bin₃ n r = (Chapter13.apl (n - r) (Chapter1.scanr₀ (fun (x1 x2 : Int) => x1 + x2) 0) (List.replicate (r + 1) 1)).headD 1