]> matita.cs.unibo.it Git - helm.git/blob - matita/contribs/CoRN-Decl/algebra/CSetoidFun.ma
new CoRN development, generated by transcript
[helm.git] / matita / contribs / CoRN-Decl / algebra / CSetoidFun.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* This file was automatically generated: do not edit *********************)
16
17 set "baseuri" "cic:/matita/CoRN-Decl/algebra/CSetoidFun".
18
19 (* $Id: CSetoidFun.v,v 1.10 2004/04/23 10:00:53 lcf Exp $ *)
20
21 (* INCLUDE
22 CSetoids
23 *)
24
25 (* UNEXPORTED
26 Section unary_function_composition.
27 *)
28
29 (*#* ** Composition of Setoid functions
30
31 Let [S1],  [S2] and [S3] be setoids, [f] a
32 setoid function from [S1] to [S2], and [g] from [S2]
33 to [S3] in the following definition of composition.  *)
34
35 inline cic:/CoRN/algebra/CSetoidFun/S1.var.
36
37 inline cic:/CoRN/algebra/CSetoidFun/S2.var.
38
39 inline cic:/CoRN/algebra/CSetoidFun/S3.var.
40
41 inline cic:/CoRN/algebra/CSetoidFun/f.var.
42
43 inline cic:/CoRN/algebra/CSetoidFun/g.var.
44
45 inline cic:/CoRN/algebra/CSetoidFun/compose_CSetoid_fun.con.
46
47 (* UNEXPORTED
48 End unary_function_composition.
49 *)
50
51 (* UNEXPORTED
52 Section unary_and_binary_function_composition.
53 *)
54
55 inline cic:/CoRN/algebra/CSetoidFun/compose_CSetoid_bin_un_fun.con.
56
57 inline cic:/CoRN/algebra/CSetoidFun/compose_CSetoid_bin_fun.con.
58
59 inline cic:/CoRN/algebra/CSetoidFun/compose_CSetoid_un_bin_fun.con.
60
61 (* UNEXPORTED
62 End unary_and_binary_function_composition.
63 *)
64
65 (*#* ***Projections
66 *)
67
68 (* UNEXPORTED
69 Section function_projection.
70 *)
71
72 inline cic:/CoRN/algebra/CSetoidFun/proj_bin_fun.con.
73
74 inline cic:/CoRN/algebra/CSetoidFun/projected_bin_fun.con.
75
76 (* UNEXPORTED
77 End function_projection.
78 *)
79
80 (* UNEXPORTED
81 Section BinProj.
82 *)
83
84 inline cic:/CoRN/algebra/CSetoidFun/S.var.
85
86 inline cic:/CoRN/algebra/CSetoidFun/binproj1.con.
87
88 inline cic:/CoRN/algebra/CSetoidFun/binproj1_strext.con.
89
90 inline cic:/CoRN/algebra/CSetoidFun/cs_binproj1.con.
91
92 (* UNEXPORTED
93 End BinProj.
94 *)
95
96 (*#* **Combining operations
97 %\begin{convention}% Let [S1], [S2] and [S3] be setoids.
98 %\end{convention}%
99 *)
100
101 (* UNEXPORTED
102 Section CombiningOperations.
103 *)
104
105 inline cic:/CoRN/algebra/CSetoidFun/S1.var.
106
107 inline cic:/CoRN/algebra/CSetoidFun/S2.var.
108
109 inline cic:/CoRN/algebra/CSetoidFun/S3.var.
110
111 (*#*
112 In the following definition, we assume [f] is a setoid function from
113 [S1] to [S2], and [op] is an unary operation on [S2].
114 Then [opOnFun] is the composition [op] after [f].
115 *)
116
117 (* UNEXPORTED
118 Section CombiningUnaryOperations.
119 *)
120
121 inline cic:/CoRN/algebra/CSetoidFun/f.var.
122
123 inline cic:/CoRN/algebra/CSetoidFun/op.var.
124
125 inline cic:/CoRN/algebra/CSetoidFun/opOnFun.con.
126
127 (* UNEXPORTED
128 End CombiningUnaryOperations.
129 *)
130
131 (* UNEXPORTED
132 End CombiningOperations.
133 *)
134
135 (*#* **Partial Functions
136
137 In this section we define a concept of partial function for an
138 arbitrary setoid.  Essentially, a partial function is what would be
139 expected---a predicate on the setoid in question and a total function
140 from the set of points satisfying that predicate to the setoid.  There
141 is one important limitations to this approach: first, the record we
142 obtain has type [Type], meaning that we can't use, for instance,
143 elimination of existential quantifiers.
144
145 Furthermore, for reasons we will explain ahead, partial functions will
146 not be defined via the [CSetoid_fun] record, but the whole structure
147 will be incorporated in a new record.
148
149 Finally, notice that to be completely general the domains of the
150 functions have to be characterized by a [CProp]-valued predicate;
151 otherwise, the use you can make of a function will be %\emph{%#<i>#a
152 priori#</i>#%}% restricted at the moment it is defined.
153
154 Before we state our definitions we need to do some work on domains.
155 *)
156
157 (* UNEXPORTED
158 Section SubSets_of_G.
159 *)
160
161 (*#* ***Subsets of Setoids
162
163 Subsets of a setoid will be identified with predicates from the
164 carrier set of the setoid into [CProp].  At this stage, we do not make
165 any assumptions about these predicates.
166
167 We will begin by defining elementary operations on predicates, along
168 with their basic properties.  In particular, we will work with well
169 defined predicates, so we will prove that these operations preserve
170 welldefinedness.
171
172 %\begin{convention}% Let [S:CSetoid] and [P,Q:S->CProp].
173 %\end{convention}%
174 *)
175
176 inline cic:/CoRN/algebra/CSetoidFun/S.var.
177
178 (* UNEXPORTED
179 Section Conjunction.
180 *)
181
182 inline cic:/CoRN/algebra/CSetoidFun/P.var.
183
184 inline cic:/CoRN/algebra/CSetoidFun/Q.var.
185
186 inline cic:/CoRN/algebra/CSetoidFun/conjP.con.
187
188 inline cic:/CoRN/algebra/CSetoidFun/prj1.con.
189
190 inline cic:/CoRN/algebra/CSetoidFun/prj2.con.
191
192 inline cic:/CoRN/algebra/CSetoidFun/conj_wd.con.
193
194 (* UNEXPORTED
195 End Conjunction.
196 *)
197
198 (* UNEXPORTED
199 Section Disjunction.
200 *)
201
202 inline cic:/CoRN/algebra/CSetoidFun/P.var.
203
204 inline cic:/CoRN/algebra/CSetoidFun/Q.var.
205
206 (*#*
207 Although at this stage we never use it, for completeness's sake we also treat disjunction (corresponding to union of subsets).
208 *)
209
210 inline cic:/CoRN/algebra/CSetoidFun/disj.con.
211
212 inline cic:/CoRN/algebra/CSetoidFun/inj1.con.
213
214 inline cic:/CoRN/algebra/CSetoidFun/inj2.con.
215
216 inline cic:/CoRN/algebra/CSetoidFun/disj_wd.con.
217
218 (* UNEXPORTED
219 End Disjunction.
220 *)
221
222 (* UNEXPORTED
223 Section Extension.
224 *)
225
226 (*#*
227 The next definition is a bit tricky, and is useful for choosing among the elements that satisfy a predicate [P] those that also satisfy [R] in the case where [R] is only defined for elements satisfying [P]---consider [R] to be a condition on the image of an object via a function with domain [P].  We chose to call this operation [extension].
228 *)
229
230 inline cic:/CoRN/algebra/CSetoidFun/P.var.
231
232 inline cic:/CoRN/algebra/CSetoidFun/R.var.
233
234 inline cic:/CoRN/algebra/CSetoidFun/extend.con.
235
236 inline cic:/CoRN/algebra/CSetoidFun/ext1.con.
237
238 inline cic:/CoRN/algebra/CSetoidFun/ext2_a.con.
239
240 inline cic:/CoRN/algebra/CSetoidFun/ext2.con.
241
242 inline cic:/CoRN/algebra/CSetoidFun/extension_wd.con.
243
244 (* UNEXPORTED
245 End Extension.
246 *)
247
248 (* UNEXPORTED
249 End SubSets_of_G.
250 *)
251
252 (* UNEXPORTED
253 Implicit Arguments disj [S].
254 *)
255
256 (* UNEXPORTED
257 Implicit Arguments extend [S].
258 *)
259
260 (* UNEXPORTED
261 Implicit Arguments ext1 [S P R x].
262 *)
263
264 (* UNEXPORTED
265 Implicit Arguments ext2 [S P R x].
266 *)
267
268 (*#* ***Operations
269
270 We are now ready to define the concept of partial function between arbitrary setoids.
271 *)
272
273 inline cic:/CoRN/algebra/CSetoidFun/BinPartFunct.ind.
274
275 (* UNEXPORTED
276 Implicit Arguments bpfpfun [S1 S2].
277 *)
278
279 (*#*
280 The next lemma states that every partial function is well defined.
281 *)
282
283 inline cic:/CoRN/algebra/CSetoidFun/bpfwdef.con.
284
285 (*#* Similar for automorphisms. *)
286
287 inline cic:/CoRN/algebra/CSetoidFun/PartFunct.ind.
288
289 (* UNEXPORTED
290 Implicit Arguments pfpfun [S].
291 *)
292
293 (*#*
294 The next lemma states that every partial function is well defined.
295 *)
296
297 inline cic:/CoRN/algebra/CSetoidFun/pfwdef.con.
298
299 (*#*
300 A few characteristics of this definition should be explained:
301  - The domain of the partial function is characterized by a predicate
302 that is required to be well defined but not strongly extensional.  The
303 motivation for this choice comes from two facts: first, one very
304 important subset of real numbers is the compact interval
305 [[a,b]]---characterized by the predicate [ fun x : IR => a [<=] x /\ x
306 [<=] b], which is not strongly extensional; on the other hand, if we
307 can apply a function to an element [s] of a setoid [S] it seems
308 reasonable (and at some point we do have to do it) to apply that same
309 function to any element [s'] which is equal to [s] from the point of
310 view of the setoid equality.
311  - The last two conditions state that [pfpfun] is really a subsetoid
312 function.  The reason why we do not write it that way is the
313 following: when applying a partial function [f] to an element [s] of
314 [S] we also need a proof object [H]; with this definition the object
315 we get is [f(s,H)], where the proof is kept separate from the object.
316 Using subsetoid notation, we would get $f(\langle
317 s,H\rangle)$#f(&lang;s,H&rang;)#; from this we need to apply two
318 projections to get either the original object or the proof, and we
319 need to apply an extra constructor to get $f(\langle
320 s,H\rangle)$#f(&lang;s,H&rang;)# from [s] and [H].  This amounts
321 to spending more resources when actually working with these objects.
322  - This record has type [Type], which is very unfortunate, because it
323 means in particular that we cannot use the well behaved set
324 existential quantification over partial functions; however, later on
325 we will manage to avoid this problem in a way that also justifies that
326 we don't really need to use that kind of quantification.  Another
327 approach to this definition that completely avoid this complication
328 would be to make [PartFunct] a dependent type, receiving the predicate
329 as an argument.  This does work in that it allows us to give
330 [PartFunct] type [Set] and do some useful stuff with it; however, we
331 are not able to define something as simple as an operator that gets a
332 function and returns its domain (because of the restrictions in the
333 type elimination rules).  This sounds very unnatural, and soon gets us
334 into strange problems that yield very unlikely definitions, which is
335 why we chose to altogether do away with this approach.
336
337 %\begin{convention}% All partial functions will henceforth be denoted by capital letters.
338 %\end{convention}%
339
340 We now present some methods for defining partial functions.
341 *)
342
343 (* UNEXPORTED
344 Hint Resolve CI: core.
345 *)
346
347 (* UNEXPORTED
348 Section CSetoid_Ops.
349 *)
350
351 inline cic:/CoRN/algebra/CSetoidFun/S.var.
352
353 (*#*
354 To begin with, we want to be able to ``see'' each total function as a partial function.
355 *)
356
357 inline cic:/CoRN/algebra/CSetoidFun/total_eq_part.con.
358
359 (* UNEXPORTED
360 Section Part_Function_Const.
361 *)
362
363 (*#*
364 In any setoid we can also define constant functions (one for each element of the setoid) and an identity function:
365
366 %\begin{convention}% Let [c:S].
367 %\end{convention}%
368 *)
369
370 inline cic:/CoRN/algebra/CSetoidFun/c.var.
371
372 inline cic:/CoRN/algebra/CSetoidFun/Fconst.con.
373
374 (* UNEXPORTED
375 End Part_Function_Const.
376 *)
377
378 (* UNEXPORTED
379 Section Part_Function_Id.
380 *)
381
382 inline cic:/CoRN/algebra/CSetoidFun/Fid.con.
383
384 (* UNEXPORTED
385 End Part_Function_Id.
386 *)
387
388 (*#*
389 (These happen to be always total functions, but that is more or less obvious, as we have no information on the setoid; however, we will be able to define partial functions just applying other operators to these ones.)
390
391 If we have two setoid functions [F] and [G] we can always compose them.  The domain of our new function will be the set of points [s] in the domain of [F] for which [F(s)] is in the domain of [G]#. #%\footnote{%Notice that the use of extension here is essential.%}.%  The inversion in the order of the variables is done to maintain uniformity with the usual mathematical notation.
392
393 %\begin{convention}% Let [G,F:(PartFunct S)] and denote by [Q] and [P], respectively, the predicates characterizing their domains.
394 %\end{convention}%
395 *)
396
397 (* UNEXPORTED
398 Section Part_Function_Composition.
399 *)
400
401 inline cic:/CoRN/algebra/CSetoidFun/G.var.
402
403 inline cic:/CoRN/algebra/CSetoidFun/F.var.
404
405 (* begin hide *)
406
407 inline cic:/CoRN/algebra/CSetoidFun/P.con.
408
409 inline cic:/CoRN/algebra/CSetoidFun/Q.con.
410
411 (* end hide *)
412
413 inline cic:/CoRN/algebra/CSetoidFun/R.con.
414
415 inline cic:/CoRN/algebra/CSetoidFun/part_function_comp_strext.con.
416
417 inline cic:/CoRN/algebra/CSetoidFun/part_function_comp_dom_wd.con.
418
419 inline cic:/CoRN/algebra/CSetoidFun/Fcomp.con.
420
421 (* UNEXPORTED
422 End Part_Function_Composition.
423 *)
424
425 (* UNEXPORTED
426 End CSetoid_Ops.
427 *)
428
429 (*#*
430 %\begin{convention}% Let [F:(BinPartFunct S1 S2)] and [G:(PartFunct S2 S3)], and denote by [Q] and [P], respectively, the predicates characterizing their domains.
431 %\end{convention}%
432 *)
433
434 (* UNEXPORTED
435 Section BinPart_Function_Composition.
436 *)
437
438 inline cic:/CoRN/algebra/CSetoidFun/S1.var.
439
440 inline cic:/CoRN/algebra/CSetoidFun/S2.var.
441
442 inline cic:/CoRN/algebra/CSetoidFun/S3.var.
443
444 inline cic:/CoRN/algebra/CSetoidFun/G.var.
445
446 inline cic:/CoRN/algebra/CSetoidFun/F.var.
447
448 (* begin hide *)
449
450 inline cic:/CoRN/algebra/CSetoidFun/P.con.
451
452 inline cic:/CoRN/algebra/CSetoidFun/Q.con.
453
454 (* end hide *)
455
456 inline cic:/CoRN/algebra/CSetoidFun/R.con.
457
458 inline cic:/CoRN/algebra/CSetoidFun/bin_part_function_comp_strext.con.
459
460 inline cic:/CoRN/algebra/CSetoidFun/bin_part_function_comp_dom_wd.con.
461
462 inline cic:/CoRN/algebra/CSetoidFun/BinFcomp.con.
463
464 (* UNEXPORTED
465 End BinPart_Function_Composition.
466 *)
467
468 (* Different tokens for compatibility with coqdoc *)
469
470 (* UNEXPORTED
471 Implicit Arguments Fconst [S].
472 *)
473
474 (* UNEXPORTED
475 Implicit Arguments Fcomp [S].
476 *)
477
478 (* UNEXPORTED
479 Hint Resolve pfwdef bpfwdef: algebra.
480 *)
481
482 (* UNEXPORTED
483 Section bijections.
484 *)
485
486 (*#* **Bijections *)
487
488 inline cic:/CoRN/algebra/CSetoidFun/injective.con.
489
490 inline cic:/CoRN/algebra/CSetoidFun/injective_weak.con.
491
492 inline cic:/CoRN/algebra/CSetoidFun/surjective.con.
493
494 (* UNEXPORTED
495 Implicit Arguments injective [A B].
496 *)
497
498 (* UNEXPORTED
499 Implicit Arguments injective_weak [A B].
500 *)
501
502 (* UNEXPORTED
503 Implicit Arguments surjective [A B].
504 *)
505
506 inline cic:/CoRN/algebra/CSetoidFun/injective_imp_injective_weak.con.
507
508 inline cic:/CoRN/algebra/CSetoidFun/bijective.con.
509
510 (* UNEXPORTED
511 Implicit Arguments bijective [A B].
512 *)
513
514 inline cic:/CoRN/algebra/CSetoidFun/id_is_bij.con.
515
516 inline cic:/CoRN/algebra/CSetoidFun/comp_resp_bij.con.
517
518 inline cic:/CoRN/algebra/CSetoidFun/inv.con.
519
520 (* UNEXPORTED
521 Implicit Arguments inv [A B].
522 *)
523
524 inline cic:/CoRN/algebra/CSetoidFun/invfun.con.
525
526 (* UNEXPORTED
527 Implicit Arguments invfun [A B].
528 *)
529
530 inline cic:/CoRN/algebra/CSetoidFun/inv1.con.
531
532 inline cic:/CoRN/algebra/CSetoidFun/inv2.con.
533
534 inline cic:/CoRN/algebra/CSetoidFun/inv_strext.con.
535
536 inline cic:/CoRN/algebra/CSetoidFun/Inv.con.
537
538 (* UNEXPORTED
539 Implicit Arguments Inv [A B].
540 *)
541
542 inline cic:/CoRN/algebra/CSetoidFun/Inv_bij.con.
543
544 (* UNEXPORTED
545 End bijections.
546 *)
547
548 (* UNEXPORTED
549 Implicit Arguments bijective [A B].
550 *)
551
552 (* UNEXPORTED
553 Implicit Arguments injective [A B].
554 *)
555
556 (* UNEXPORTED
557 Implicit Arguments injective_weak [A B].
558 *)
559
560 (* UNEXPORTED
561 Implicit Arguments surjective [A B].
562 *)
563
564 (* UNEXPORTED
565 Implicit Arguments inv [A B].
566 *)
567
568 (* UNEXPORTED
569 Implicit Arguments invfun [A B].
570 *)
571
572 (* UNEXPORTED
573 Implicit Arguments Inv [A B].
574 *)
575
576 (* UNEXPORTED
577 Implicit Arguments conj_wd [S P Q].
578 *)
579