aboutsummaryrefslogtreecommitdiff
path: root/theories
diff options
context:
space:
mode:
authorherbelin2003-05-13 22:40:41 +0000
committerherbelin2003-05-13 22:40:41 +0000
commitf3bdc124043e9d2ce40f1d44cbc22b351e977d01 (patch)
treeeb93d3e4db32d4fcaaea4f3fbc86c851afaec4fb /theories
parentf6ef45b99330719391111df5d51dfb55d853d962 (diff)
Nouveaux lemmes (sur proposition de Nijmegen)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4012 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories')
-rwxr-xr-xtheories/Arith/Arith.v1
-rw-r--r--theories/Arith/Factorial.v34
2 files changed, 35 insertions, 0 deletions
diff --git a/theories/Arith/Arith.v b/theories/Arith/Arith.v
index 13c17aabb5..832ea7a427 100755
--- a/theories/Arith/Arith.v
+++ b/theories/Arith/Arith.v
@@ -18,3 +18,4 @@ Require Export Between.
Require Export Minus.
Require Export Peano_dec.
Require Export Compare_dec.
+Require Export Factorial.
diff --git a/theories/Arith/Factorial.v b/theories/Arith/Factorial.v
new file mode 100644
index 0000000000..4963379e68
--- /dev/null
+++ b/theories/Arith/Factorial.v
@@ -0,0 +1,34 @@
+(***********************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA-Rocquencourt & LRI-CNRS-Orsay *)
+(* \VV/ *************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(***********************************************************************)
+
+(*i $Id$ i*)
+
+Require Plus.
+Require Lt.
+
+(** Factorial *)
+
+Fixpoint fact [n:nat]:nat:=
+ Cases n of
+ O => (S O)
+ |(S n) => (mult (S n) (fact n))
+ end.
+
+Lemma lt_O_fact : (n:nat)(lt O (fact n)).
+Proof.
+Induction n; Unfold lt; Simpl; Auto with arith.
+Qed.
+
+Lemma fact_neq_0:(n:nat)~(fact n)=O.
+Proof.
+Intro.
+Apply sym_not_eq.
+Apply lt_O_neq.
+Apply lt_O_fact.
+Qed.
+