-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnsemblesSpec.v
43 lines (37 loc) · 970 Bytes
/
EnsemblesSpec.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Require Export Ensembles.
Require Import EnsemblesImplicit.
Inductive characteristic_function_abstraction {X:Type} (P:X->Prop) (x:X) : Prop :=
| intro_characteristic_sat: P x ->
In (characteristic_function_abstraction P) x.
Definition characteristic_function_to_ensemble {X:Type} (P:X->Prop) : Ensemble X :=
characteristic_function_abstraction P.
Notation "[ x : X | P ]" :=
(characteristic_function_to_ensemble (fun x:X => P))
(x ident).
Lemma characteristic_function_to_ensemble_is_identity:
forall {X:Type} (P:X->Prop),
[ x:X | P x ] = P.
Proof.
intros.
apply Extensionality_Ensembles; split; red; intros.
destruct H.
exact H.
constructor.
exact H.
Qed.
(*
Definition even_example : Ensemble nat :=
[ n:nat | exists m:nat, n=2*m ].
Lemma even_example_result: forall n:nat, In even_example n ->
In even_example (n+2).
Proof.
intros.
destruct H.
constructor.
destruct H as [m].
exists (m + 1).
rewrite H.
Require Import Arith.
ring.
Qed.
*)