Appearance
This is the first exercise sheet for the FCPLCD course. It is a practice primer on natural deduction and the use of inference rules for definitions and proofs.
In the last lecture, you have seen how in Natural Deduction, specifically in the NJ system, inference rules can be used to derive proof trees and proof sequents and formulas.Exercises marked in yellow do not need to be handed in, but make sure you can answer them.
For reference, these are the rules of NJ from the lecture, the elimination rules on the left and the introduction rules on the right.
Exercises marked in blue are mandatory and need to be handed in. Use the introduction and elimination rules of NJ to derive proof trees for the following statements:
You can also set up Rocq differently, see the Rocq project page. On the FCPLCD course website, you can find a description of how to set up a Rocq development environment with the nix package manager. There is no need to rush, though: for the first couple of assignments, it is perfectly fine to work in the jsCoq web editor instead, which runs Rocq directly in your browser. In the following, we have listed some general resources that you can consult whenever you find them helpful.
In this exercise you will learn how the inference you have done before looks in the Rocq theorem prover. We have already set up the lemmata for you in the file exercise1.v. Replace every Admitted in the code with a proof of the lemma.
Try to find a lemma in the Rocq standard library for each of the statements of this exercise, for instance with the Search command.
The lemmata we have seen so far worked without defining a specific type for the variable terms. But later we will obviously want to reason about (witnesses of) concrete types, such as natural numbers, lists, programming language terms etc. So this task is a little primer on defining our own data types.
Hint: look up Inductive Define a type temperature. It should have two constructors: Celsius and Kelvin, each of which has a natural number as a parameter.
Hint: look up Definition Define a function as_kelvin : temperature -> nat that converts any temperature to degree Kelvin.