Self-evaluation 3
- 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 -> RAdmitted.forall P Q R : Prop, (P -> R) -> (Q -> R) -> P \/ Q -> R
Exercise 3
What is the goal after the following script?
true <> falsetrue <> falsee: true = falseFalsee: true = falseif true then False else True(* HERE *) Abort.e: true = falseTrue
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 mforall n m : nat, n <= m -> S n <= S mn, m: nat
h: n <= mS n <= S mn: natS n <= S nn, m: nat
h: n <= m
ih: S n <= S mS n <= S (S m)constructor.n: natS n <= S nAbort.n, m: nat
h: n <= m
ih: S n <= S mS n <= S (S m)