| 1 |
(************************************************************************) |
| 2 |
(* * The Rocq Prover / The Rocq Development Team *) |
| 3 |
(* v * Copyright INRIA, CNRS and contributors *) |
| 4 |
(* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 |
(* \VV/ **************************************************************) |
| 6 |
(* // * This file is distributed under the terms of the *) |
| 7 |
(* * GNU Lesser General Public License Version 2.1 *) |
| 8 |
(* * (see LICENSE file for the text of the license) *) |
| 9 |
(************************************************************************) |
| 10 |
|
| 11 |
Require Import ssreflect ssrbool. |
| 12 |
|
| 13 |
Set Implicit Arguments. |
| 14 |
|
| 15 |
Inductive wf T : bool -> option T -> Type := |
| 16 |
| wf_f : wf false None |
| 17 |
| wf_t : forall x, wf true (Some x). |
| 18 |
|
| 19 |
Derive Inversion wf_inv with (forall T b (o : option T), wf b o) Sort Prop. |
| 20 |
|
| 21 |
Lemma Problem T b (o : option T) : |
| 22 |
wf b o -> |
| 23 |
match b with |
| 24 |
| true => exists x, o = Some x |
| 25 |
| false => o = None |
| 26 |
end. |
| 27 |
Proof. |
| 28 |
by case: b; elim/wf_inv=> //; case: o=> // a *; exists a. |
| 29 |
Qed. |