summaryrefslogtreecommitdiff
path: root/theories7/Sets/Powerset.v
blob: b1fa892c6f7f87b018d0e4c0f7292795a5e9c6f7 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)
(****************************************************************************)
(*                                                                          *)
(*                         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.  *)
(****************************************************************************)

(*i $Id: Powerset.v,v 1.1.2.1 2004/07/16 19:31:39 herbelin Exp $ i*)

Require Export Ensembles.
Require Export Relations_1.
Require Export Relations_1_facts.
Require Export Partial_Order.
Require Export Cpo.

Section The_power_set_partial_order.
Variable U: Type.

Inductive Power_set [A:(Ensemble U)]: (Ensemble (Ensemble U)) :=
    Definition_of_Power_set:
     (X: (Ensemble U)) (Included U X A) -> (In (Ensemble U) (Power_set A) X).
Hints Resolve Definition_of_Power_set.

Theorem Empty_set_minimal: (X: (Ensemble U)) (Included U (Empty_set U) X).
Intro X; Red.
Intros x H'; Elim H'.
Qed.
Hints Resolve Empty_set_minimal.

Theorem Power_set_Inhabited:
  (X: (Ensemble U)) (Inhabited (Ensemble U) (Power_set X)).
Intro X.
Apply Inhabited_intro with (Empty_set U); Auto with sets.
Qed.
Hints Resolve Power_set_Inhabited.

Theorem Inclusion_is_an_order: (Order (Ensemble U) (Included U)).
Auto 6 with sets.
Qed.
Hints Resolve Inclusion_is_an_order.

Theorem Inclusion_is_transitive: (Transitive (Ensemble U) (Included U)).
Elim Inclusion_is_an_order; Auto with sets.
Qed.
Hints Resolve Inclusion_is_transitive.

Definition Power_set_PO: (Ensemble U) -> (PO (Ensemble U)).
Intro A; Try Assumption.
Apply Definition_of_PO with (Power_set A) (Included U); Auto with sets.
Defined.
Hints Unfold  Power_set_PO.

Theorem Strict_Rel_is_Strict_Included:
  (same_relation
     (Ensemble U) (Strict_Included U)
     (Strict_Rel_of (Ensemble U) (Power_set_PO (Full_set U)))).
Auto with sets.
Qed.
Hints Resolve Strict_Rel_Transitive Strict_Rel_is_Strict_Included.

Lemma Strict_inclusion_is_transitive_with_inclusion:
  (x, y, z:(Ensemble U)) (Strict_Included U x y) -> (Included U y z) ->
  (Strict_Included U x z).
Intros x y z H' H'0; Try Assumption.
Elim Strict_Rel_is_Strict_Included.
Unfold contains.
Intros H'1 H'2; Try Assumption.
Apply H'1.
Apply Strict_Rel_Transitive_with_Rel with y := y; Auto with sets.
Qed.

Lemma Strict_inclusion_is_transitive_with_inclusion_left:
  (x, y, z:(Ensemble U)) (Included U x y) -> (Strict_Included U y z) ->
  (Strict_Included U x z).
Intros x y z H' H'0; Try Assumption.
Elim Strict_Rel_is_Strict_Included.
Unfold contains.
Intros H'1 H'2; Try Assumption.
Apply H'1.
Apply Strict_Rel_Transitive_with_Rel_left with y := y; Auto with sets.
Qed.

Lemma Strict_inclusion_is_transitive:
  (Transitive (Ensemble U) (Strict_Included U)).
Apply cong_transitive_same_relation
     with R := (Strict_Rel_of (Ensemble U) (Power_set_PO (Full_set U))); Auto with sets.
Qed.

Theorem Empty_set_is_Bottom:
  (A: (Ensemble U)) (Bottom (Ensemble U) (Power_set_PO A) (Empty_set U)).
Intro A; Apply Bottom_definition; Simpl; Auto with sets.
Qed.
Hints Resolve Empty_set_is_Bottom.

Theorem Union_minimal:
  (a, b, X: (Ensemble U)) (Included U a X) -> (Included U b X) ->
   (Included U (Union U a b) X).
Intros a b X H' H'0; Red.
Intros x H'1; Elim H'1; Auto with sets.
Qed.
Hints Resolve Union_minimal.

Theorem Intersection_maximal:
  (a, b, X: (Ensemble U)) (Included U X a) -> (Included U X b) ->
   (Included U X (Intersection U a b)).
Auto with sets.
Qed.

Theorem Union_increases_l: (a, b: (Ensemble U)) (Included U a (Union U a b)).
Auto with sets.
Qed.

Theorem Union_increases_r: (a, b: (Ensemble U)) (Included U b (Union U a b)).
Auto with sets.
Qed.

Theorem Intersection_decreases_l:
  (a, b: (Ensemble U)) (Included U (Intersection U a b) a).
Intros a b; Red.
Intros x H'; Elim H'; Auto with sets.
Qed.

Theorem Intersection_decreases_r:
  (a, b: (Ensemble U)) (Included U (Intersection U a b) b).
Intros a b; Red.
Intros x H'; Elim H'; Auto with sets.
Qed.
Hints Resolve Union_increases_l Union_increases_r Intersection_decreases_l
     Intersection_decreases_r.

Theorem Union_is_Lub:
  (A: (Ensemble U)) (a, b: (Ensemble U)) (Included U a A) -> (Included U b A) ->
   (Lub (Ensemble U) (Power_set_PO A) (Couple (Ensemble U) a b) (Union U a b)).
Intros A a b H' H'0.
Apply Lub_definition; Simpl.
Apply Upper_Bound_definition; Simpl; Auto with sets.
Intros y H'1; Elim H'1; Auto with sets.
Intros y H'1; Elim H'1; Simpl; Auto with sets.
Qed.

Theorem Intersection_is_Glb:
  (A: (Ensemble U)) (a, b: (Ensemble U)) (Included U a A) -> (Included U b A) ->
   (Glb
      (Ensemble U)
      (Power_set_PO A)
      (Couple (Ensemble U) a b)
      (Intersection U a b)).
Intros A a b H' H'0.
Apply Glb_definition; Simpl.
Apply Lower_Bound_definition; Simpl; Auto with sets.
Apply Definition_of_Power_set.
Generalize Inclusion_is_transitive; Intro IT; Red in IT; Apply IT with a; Auto with sets.
Intros y H'1; Elim H'1; Auto with sets.
Intros y H'1; Elim H'1; Simpl; Auto with sets.
Qed.

End The_power_set_partial_order.

Hints Resolve Empty_set_minimal : sets v62.
Hints Resolve Power_set_Inhabited : sets v62.
Hints Resolve Inclusion_is_an_order : sets v62.
Hints Resolve Inclusion_is_transitive : sets v62.
Hints Resolve Union_minimal : sets v62.
Hints Resolve Union_increases_l : sets v62.
Hints Resolve Union_increases_r : sets v62.
Hints Resolve Intersection_decreases_l : sets v62.
Hints Resolve Intersection_decreases_r : sets v62.
Hints Resolve Empty_set_is_Bottom : sets v62.
Hints Resolve Strict_inclusion_is_transitive : sets v62.