Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) (* <O___,, * (see CREDITS file for the list of authors) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************) (****************************************************************************) (* *) (* Naive Set Theory in Coq *) (* *) (* INRIA INRIA *) (* Rocquencourt Sophia-Antipolis *) (* *) (* Coq V6.1 *) (* *) (* Gilles Kahn *) (* Gerard Huet *) (* *) (* *) (* *) (* Acknowledgments: This work was started in July 1993 by F. Prost. Thanks *) (* to the Newton Institute for providing an exceptional work environment *) (* in Summer 1995. Several developments by E. Ledinot were an inspiration. *) (****************************************************************************) Require Import Ensembles. Section Ensembles_finis. Variable U : Type. Inductive Finite : Ensemble U -> Prop := | Empty_is_finite : Finite (Empty_set U) | Union_is_finite : forall A:Ensemble U, Finite A -> forall x:U, ~ In U A x -> Finite (Add U A x). Inductive cardinal : Ensemble U -> nat -> Prop := | card_empty : cardinal (Empty_set U) 0 | card_add : forall (A:Ensemble U) (n:nat), cardinal A n -> forall x:U, ~ In U A x -> cardinal (Add U A x) (S n). End Ensembles_finis. Hint Resolve Empty_is_finite Union_is_finite: sets. Hint Resolve card_empty card_add: sets. Require Import Constructive_sets. Section Ensembles_finis_facts. Variable U : Type.U:Typeforall (X : Ensemble U) (p : nat), cardinal U X p -> match p with | 0 => X = Empty_set U | S n => exists (A : Ensemble U) (x : U), X = Add U A x /\ ~ In U A x /\ cardinal U A n endU:Typeforall (X : Ensemble U) (p : nat), cardinal U X p -> match p with | 0 => X = Empty_set U | S n => exists (A : Ensemble U) (x : U), X = Add U A x /\ ~ In U A x /\ cardinal U A n endexists A; exists x; auto. Qed.U:TypeA:Ensemble Un:natH:cardinal U A nx:UH0:~ In U A xIHcardinal:match n with | 0 => A = Empty_set U | S n0 => exists (A0 : Ensemble U) (x0 : U), A = Add U A0 x0 /\ ~ In U A0 x0 /\ cardinal U A0 n0 endexists (A0 : Ensemble U) (x0 : U), Add U A x = Add U A0 x0 /\ ~ In U A0 x0 /\ cardinal U A0 nU:Typeforall (X : Ensemble U) (p : nat), cardinal U X p -> match p with | 0 => X = Empty_set U | S _ => Inhabited U X endintros X p C; elim C; simpl; trivial with sets. Qed. End Ensembles_finis_facts.U:Typeforall (X : Ensemble U) (p : nat), cardinal U X p -> match p with | 0 => X = Empty_set U | S _ => Inhabited U X end