-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathVertices.v
162 lines (95 loc) · 4.63 KB
/
Vertices.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
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
(* This program is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1 *)
(* of the License, or (at your option) any later version. *)
(* *)
(* This program is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU General Public License for more details. *)
(* *)
(* You should have received a copy of the GNU Lesser General Public *)
(* License along with this program; if not, write to the Free *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA *)
(* The set of vertices -Vertex- is defined as an indexed set; *)
(* so it is separable. *)
(* The following notions are defined : *)
(* - Vertex : set of vertices, *)
(* constructor : index. *)
(* Definitions and properties are inherited from the previous sections. *)
Require Export Enumerated.
Section VERTEX.
Inductive Vertex : Set :=
index : nat -> Vertex.
Lemma V_eq_dec : forall x y : Vertex, {x = y} + {x <> y}.
Proof.
simple destruct x; simple destruct y; intros.
case (eq_nat_dec n n0); intros H.
left; rewrite H; trivial.
right; injection; trivial.
Qed.
Definition V_list := list Vertex.
Definition V_nil := nil (A:=Vertex).
Definition V_in_dec := U_in_dec Vertex V_eq_dec.
Definition V_canon := U_canon Vertex.
Definition V_sum := U_sum Vertex.
Definition V_set := U_set Vertex.
Definition V_set_eq := U_set_eq Vertex.
Definition V_set_diff := U_set_diff Vertex.
Definition V_eq_set := U_eq_set Vertex.
Definition V_set_eq_commut := U_set_eq_commut Vertex.
Definition V_set_diff_commut := U_set_diff_commut Vertex.
Definition V_empty := Empty Vertex.
Definition V_empty_nothing := Empty_nothing Vertex.
Definition V_single := Single Vertex.
Definition V_in_single := In_single Vertex.
Definition V_single_equal := Single_equal Vertex.
Definition V_single_equal_single := Single_equal_single Vertex.
Definition V_included := Included Vertex.
Definition V_included_single := Included_single Vertex.
Definition V_enumerable := U_enumerable Vertex.
Definition V_enumerable_sum := U_enumerable_sum Vertex.
Definition V_union := Union Vertex.
Definition V_in_left := In_left Vertex.
Definition V_in_right := In_right Vertex.
Definition V_union_eq := Union_eq Vertex.
Definition V_union_neutral := Union_neutral Vertex.
Definition V_union_commut := Union_commut Vertex.
Definition V_union_assoc := Union_assoc Vertex.
Definition V_not_union := Not_union Vertex.
Definition V_union_dec := Union_dec Vertex.
Definition V_included_union := Included_union Vertex.
Definition V_union_absorb := Union_absorb Vertex.
Definition V_inter := Inter Vertex.
Definition V_in_inter := In_inter Vertex.
Definition V_inter_eq := Inter_eq Vertex.
Definition V_inter_neutral := Inter_neutral Vertex.
Definition V_inter_empty := Inter_empty Vertex.
Definition V_inter_commut := Inter_commut Vertex.
Definition V_inter_assoc := Inter_assoc Vertex.
Definition V_not_inter := Not_inter Vertex.
Definition V_included_inter := Included_inter Vertex.
Definition V_inter_absorb := Inter_absorb Vertex.
Definition V_differ := Differ Vertex.
Definition V_differ_E_E := Differ_E_E Vertex.
Definition V_differ_empty := Differ_empty Vertex.
Definition V_union_differ_inter := Union_differ_inter Vertex.
Definition V_distributivity_inter_union := Distributivity_inter_union Vertex.
Definition V_distributivity_union_inter := Distributivity_union_inter Vertex.
Definition V_union_inversion := Union_inversion Vertex.
Definition V_union_inversion2 := Union_inversion2 Vertex.
Definition V_single_disjoint := Single_disjoint Vertex.
Definition V_single_single_disjoint := Single_single_disjoint Vertex.
Definition V_union_single_single := Union_single_single Vertex.
Lemma V_union_single_dec :
forall (x y : Vertex) (v : V_set),
~ v x -> V_union (V_single x) v y -> {x = y} + {v y}.
Proof.
intros; case (V_eq_dec x y); intros H1.
left; trivial.
right; inversion H0.
elim H1; inversion H2; trivial.
trivial.
Qed.
End VERTEX.