| 1 |
Section test. |
| 2 |
Variable n:nat. |
| 3 |
Lemma foo: 0 <= n. |
| 4 |
Proof. |
| 5 |
(* declaring an Axiom during a proof makes it immediately |
| 6 |
usable, juste as a full Definition. *) |
| 7 |
Axiom bar : n = 1. |
| 8 |
rewrite bar. |
| 9 |
now apply le_S. |
| 10 |
Qed. |
| 11 |
|
| 12 |
Lemma foo' : 0 <= n. |
| 13 |
Proof. |
| 14 |
(* Declaring an Hypothesis during a proof is ok, |
| 15 |
but this hypothesis won't be usable by the current proof(s), |
| 16 |
only by later ones. *) |
| 17 |
Hypothesis bar' : n = 1. |
| 18 |
Fail rewrite bar'. |
| 19 |
Abort. |
| 20 |
|
| 21 |
Lemma foo'' : 0 <= n. |
| 22 |
Proof. |
| 23 |
rewrite bar'. |
| 24 |
now apply le_S. |
| 25 |
Qed. |
| 26 |
|
| 27 |
End test. |