| 1 |
(* This script shows, in two different ways, the inconsistency of the |
| 2 |
propositional extensionality axiom with the guard condition for cofixpoints. It |
| 3 |
is the dual of the problem on fixpoints (cf subterm.v, subterm2.v, |
| 4 |
subterm3.v). Posted on Coq-club by Maxime Dénès (02/26/2014). *) |
| 5 |
|
| 6 |
(* First example *) |
| 7 |
|
| 8 |
CoInductive CoFalse : Prop := CF : CoFalse -> False -> CoFalse. |
| 9 |
|
| 10 |
CoInductive Pandora : Prop := C : CoFalse -> Pandora. |
| 11 |
|
| 12 |
Axiom prop_ext : forall P Q : Prop, (P<->Q) -> P = Q. |
| 13 |
|
| 14 |
Lemma foo : Pandora = CoFalse. |
| 15 |
apply prop_ext. |
| 16 |
constructor. |
| 17 |
intro x; destruct x; assumption. |
| 18 |
exact C. |
| 19 |
Qed. |
| 20 |
|
| 21 |
Fail CoFixpoint loop : CoFalse := |
| 22 |
match foo in (_ = T) return T with eq_refl => C loop end. |
| 23 |
|
| 24 |
Fail Definition ff : False := match loop with CF _ t => t end. |
| 25 |
|
| 26 |
(* Second example *) |
| 27 |
|
| 28 |
Inductive omega : Prop := Omega : omega -> omega. |
| 29 |
|
| 30 |
Lemma H : omega = CoFalse. |
| 31 |
Proof. |
| 32 |
apply prop_ext; constructor. |
| 33 |
induction 1; assumption. |
| 34 |
destruct 1; destruct H0. |
| 35 |
Qed. |
| 36 |
|
| 37 |
Fail CoFixpoint loop' : CoFalse := |
| 38 |
match H in _ = T return T with |
| 39 |
eq_refl => |
| 40 |
Omega match eq_sym H in _ = T return T with eq_refl => loop' end |
| 41 |
end. |
| 42 |
|
| 43 |
Fail Definition ff' : False := match loop' with CF _ t => t end. |