-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndexedFamilies.v
129 lines (109 loc) · 2.5 KB
/
IndexedFamilies.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
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
Require Export Families.
Require Export Image.
Require Import ImageImplicit.
Set Implicit Arguments.
Section IndexedFamilies.
Variable A T:Type.
Definition IndexedFamily := A -> Ensemble T.
Variable F:IndexedFamily.
Inductive IndexedUnion : Ensemble T :=
| indexed_union_intro: forall (a:A) (x:T),
In (F a) x -> In IndexedUnion x.
Inductive IndexedIntersection : Ensemble T :=
| indexed_intersection_intro: forall (x:T),
(forall a:A, In (F a) x) -> In IndexedIntersection x.
End IndexedFamilies.
Section IndexedFamilyFacts.
(* unions and intersections over subsets of the index set *)
Lemma sub_indexed_union: forall {A B T:Type} (f:A->B)
(F:IndexedFamily B T),
let subF := (fun a:A => F (f a)) in
Included (IndexedUnion subF) (IndexedUnion F).
Proof.
unfold Included.
intros.
destruct H.
apply indexed_union_intro with (f a).
assumption.
Qed.
Lemma sub_indexed_intersection: forall {A B T:Type} (f:A->B)
(F:IndexedFamily B T),
let subF := (fun a:A => F (f a)) in
Included (IndexedIntersection F) (IndexedIntersection subF).
Proof.
unfold Included.
intros.
constructor.
destruct H.
intro.
apply H.
Qed.
Lemma empty_indexed_intersection: forall {T:Type}
(F:IndexedFamily False T),
IndexedIntersection F = Full_set.
Proof.
intros.
apply Extensionality_Ensembles; red; split; red; intros;
auto with sets.
constructor.
constructor.
destruct a.
Qed.
Lemma empty_indexed_union: forall {T:Type}
(F:IndexedFamily False T),
IndexedUnion F = Empty_set.
Proof.
intros.
apply Extensionality_Ensembles; red; split; red; intros.
destruct H.
destruct a.
destruct H.
Qed.
End IndexedFamilyFacts.
Section IndexedFamilyToFamily.
(* relation to families of subsets of T *)
Variable T:Type.
Variable A:Type.
Variable F:IndexedFamily A T.
Definition ImageFamily : Family T :=
Im Full_set F.
Lemma indexed_to_family_union: IndexedUnion F = FamilyUnion ImageFamily.
Proof.
apply Extensionality_Ensembles.
unfold Same_set.
unfold Included.
intuition.
destruct H.
apply family_union_intro with (F a).
apply Im_intro with a.
constructor.
reflexivity.
assumption.
destruct H.
destruct H.
apply indexed_union_intro with x0.
rewrite <- H1.
assumption.
Qed.
Lemma indexed_to_family_intersection:
IndexedIntersection F = FamilyIntersection ImageFamily.
Proof.
apply Extensionality_Ensembles.
unfold Same_set.
unfold Included.
intuition.
constructor.
intros.
destruct H.
destruct H0.
rewrite H1.
apply H.
constructor.
intro.
destruct H.
apply H.
apply Im_intro with a.
constructor.
reflexivity.
Qed.
End IndexedFamilyToFamily.