Self-evaluation 3

Authors:

Yannick Forster

Théo Winterhalter

Files:

Exercise 1

Write down the induction principle for even.

Inductive even : nat -> Prop :=
| evenO : even 0
| evenS n : even n -> even (S (S n)).

Exercise 2

We give you the definition of disjunction as a reminder.

Inductive or (A B : Prop) : Prop :=
| or_introl : A -> A \/ B
| or_intror : B -> A \/ B.

Notation "A \/ B" := (or A B).

Complete the following definition with a proof term.


forall P Q R : Prop, (P -> R) -> (Q -> R) -> P \/ Q -> R

forall P Q R : Prop, (P -> R) -> (Q -> R) -> P \/ Q -> R
Admitted.

Exercise 3

What is the goal after the following script?


true <> false

true <> false
e: true = false

False
e: true = false

if true then False else True
e: true = false

True
(* HERE *) Abort.

Exercise 4

Inductive le (n : nat) : nat -> Prop :=
| le_n : n <= n
| le_S : forall m, n <= m -> n <= S m.

What is the goal after the following script?


forall n m : nat, n <= m -> S n <= S m

forall n m : nat, n <= m -> S n <= S m
n, m: nat
h: n <= m

S n <= S m
n: nat

S n <= S n
n, m: nat
h: n <= m
ih: S n <= S m
S n <= S (S m)
n: nat

S n <= S n
constructor.
n, m: nat
h: n <= m
ih: S n <= S m

S n <= S (S m)
Abort.