Self-evaluation 4

Authors:

Yannick Forster

Théo Winterhalter

Files:

We define a product type prod' using a record.

Record prod' (A B : Type) := pair' {
  fst' : A ;
  snd' : B
}.

Exercise 1

What is the type of fst'?

Exercise 2

We give you the definition of the product type A * B as a reminder.

Inductive prod (A B : Type) : Type :=
| pair : A -> B -> A * B.

Notation "A * B" := (prod A B).
Notation "( a , b )" := (pair _ _ a b).

Prove the following two statements, using a proof script or a proof term.


forall A B : Type, prod' A B -> A * B

forall A B : Type, prod' A B -> A * B
Admitted.

forall A B : Type, A * B -> prod' A B

forall A B : Type, A * B -> prod' A B
Admitted.

Exercise 3

Rocq does not generate an induction principle for prod'. Give the type of an induction principle for prod'.

Definition prod'_ind : (* your answer *).

Exercise 4

Prove your induction principle, using a proof script or a proof term.

Exercise 5

For each of the following scripts, say whether it solves the goal. If it does not, give the remaining goal.

The try are only there so that the file compiles whatever the answer.


nat * bool

nat * bool
try (split ; constructor). Abort.

exists b : bool, (b && true)%bool = false

exists b : bool, (b && true)%bool = false
try (unshelve eexists ; constructor). Abort.

False \/ True

False \/ True
try (constructor ; constructor). Abort.

False \/ True

False \/ True

False

False
Abort.