1
(************************************************************************)
2
(* v * The Coq Proof Assistant / The Coq Development Team *)
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
4
(* \VV/ **************************************************************)
5
(* // * This file is distributed under the terms of the *)
6
(* * GNU Lesser General Public License Version 2.1 *)
7
(************************************************************************)
8
(****************************************************************************)
10
(* Naive Set Theory in Coq *)
13
(* Rocquencourt Sophia-Antipolis *)
22
(* Acknowledgments: This work was started in July 1993 by F. Prost. Thanks *)
23
(* to the Newton Institute for providing an exceptional work environment *)
24
(* in Summer 1995. Several developments by E. Ledinot were an inspiration. *)
25
(****************************************************************************)
27
(*i $Id: Finite_sets.v 9245 2006-10-17 12:53:34Z notin $ i*)
29
Require Import Ensembles.
31
Section Ensembles_finis.
34
Inductive Finite : Ensemble U -> Prop :=
35
| Empty_is_finite : Finite (Empty_set U)
38
Finite A -> forall x:U, ~ In U A x -> Finite (Add U A x).
40
Inductive cardinal : Ensemble U -> nat -> Prop :=
41
| card_empty : cardinal (Empty_set U) 0
43
forall (A:Ensemble U) (n:nat),
44
cardinal A n -> forall x:U, ~ In U A x -> cardinal (Add U A x) (S n).
48
Hint Resolve Empty_is_finite Union_is_finite: sets v62.
49
Hint Resolve card_empty card_add: sets v62.
51
Require Import Constructive_sets.
53
Section Ensembles_finis_facts.
56
Lemma cardinal_invert :
57
forall (X:Ensemble U) (p:nat),
60
| O => X = Empty_set U
63
(exists x : _, X = Add U A x /\ ~ In U A x /\ cardinal U A n)
66
induction 1; simpl in |- *; auto.
67
exists A; exists x; auto.
71
forall (X:Ensemble U) (p:nat),
74
| O => X = Empty_set U
75
| S n => Inhabited U X
78
intros X p C; elim C; simpl in |- *; trivial with sets.
81
End Ensembles_finis_facts.