← Back to Lean 4: Proofs a Computer Can Check

Module: Programming in Lean

Practice Test: Programming in Lean

Write functions, define your own types, and use recursion that Lean accepts.

9 questions. 15 minutes. You need at least 7 right to pass. This test is optional. It does not mark any lesson complete and it does not count towards your certificate.

Time left: 15:00

1. What do curly braces like {α : Type} make an argument?

2. What does the @ in @identity do?

3. What happens if a match does not cover every input?

4. What are the two constructors of Lean's Nat?

5. What is [1, 2, 3] shorthand for?

6. What is a structure in Lean?

7. Why does Lean require ordinary functions to terminate?

8. Why is factorial with patterns 0 and n + 1 accepted automatically?

9. What is the cost of marking a function partial?