Skip to content
Exercises · Assignment 1

FCPLCD Assignment 1Download PDF

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.

Intuitionistic Natural Deduction

RECAP 1.1

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.

  1. What is a sequent, and what is a formula?
  2. When is a formula provable?
  3. Why do we say that proofs are “defined inductively” in intuitionistic logic?

Rules of the NJ System

For reference, these are the rules of NJ from the lecture, the elimination rules on the left and the introduction rules on the right.

EXERCISE 1.2
Constructing Proof Trees

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:

  1. Hint: You need to find the right instantiation of for 5.
EXTRA

First Steps in Rocq

Getting Started

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.

EXERCISE 1.3
Natural Deduction in Rocq

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.

EXTRA

Try to find a lemma in the Rocq standard library for each of the statements of this exercise, for instance with the Search command.

Defining Types

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.

EXERCISE 1.4
Define a Type

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.

EXERCISE 1.5
Define a Function on it

Hint: look up Definition Define a function as_kelvin : temperature -> nat that converts any temperature to degree Kelvin.