In the last chapter of the first part of this document, we studied equivalence relations, that were reflexive, symmetric and transitive. If we replace symmetric by antisymmetric, we get an order relation. Remember that transitive means that if and then , and symmetric means that if then . If a relation is symmetric and transitive, then implies and . The support of a relation is of the set of all and that are related by the relation. A relation is reflexive on a set if is equivalent to .
We say that a relation (denoted here ) is antisymmetric if and imply . We say that it is reflexive if implies and (this means that the relation is reflexive on the support). An order relation on is an order relation whose support is (or equivalently, that is reflexive on ). Bourbaki defines preorder relations later; giving the definition right now reduces a little bit the code. A preorder relation is reflexive and transitive. The opposite relation of , denoted by , is such that and are equivalent.
245 Definition antisymmetric_r (r:EEP) := 246 forall x y, r x y -> r y x -> x = y. 247 Definition is_antisymmetric (r:Set) := 248 is_graph r & forall x y, related r x y -> related r y x -> x = y. 249 Definition reflexive_rr (r:EEP) := 250 forall x y, r x y -> (r x x & r y y). 251 Definition order_r(r:EEP) := 252 transitive_r r & antisymmetric_r r & reflexive_rr r. 253 Definition order_re (r:EEP) x := 254 order_r r & reflexive_r r x. 255 Definition preorder_r (r:EEP) := 256 transitive_r r & reflexive_rr r. 257 Definition opposite_relation (r:EEP) := 258 fun x y => r y x.
Equality and inclusion are order relations. The opposite of an order relation is an order relation.
259 Lemma equality_is_order: order_r(fun x y => x = y). 260 Lemma sub_is_order: order_r sub. 261 Lemma opposite_is_preorder_r: forall r, 262 preorder_r r -> preorder_r (opposite_relation r). 263 Lemma opposite_is_order_r: forall r, 264 order_r r -> order_r (opposite_relation r).
An order on a set is a graph(note: ➳) such that the relation is an order relation between and with substrate . A preorder is similarly defined. The opposite order relation corresponds to the inverse graph, which is thus called the opposite order.
265 Definition order (r: Set) := 266 is_reflexive r & is_transitive r & is_antisymmetric r. 267 Definition preorder (r: Set) := 268 is_graph r & is_reflexive r & is_transitive r. 269 Definition opposite_order := inverse_graph. 270 Lemma order_is_graph: forall r, order r -> is_graph r.
If we have an order relation on , we can take its graph, and this gives an order (this is the same construction as for equivalence relations).
271 Lemma order_has_graph0: forall r x, 272 order_re r x -> is_graph_of (graph_on r x) r. 273 Lemma order_has_graph: forall r x, 274 order_re r x -> exists g, is_graph_of g r. 275 Lemma order_if_has_graph: forall r g, 276 is_graph g -> is_graph_of g r -> 277 order_r r -> order_re r (domain g). 278 Lemma order_if_has_graph2: forall r g, 279 is_graph g -> is_graph_of g r -> 280 order_r r -> order g. 281 Lemma order_has_graph2: forall r x, 282 order_re r x -> exists g, 283 g = graph_on r x & 284 order g & (forall u v, r u v = related g u v).
The next two lemmas are more often used. They say that an order can be obtained from an order relation by taking its graph on a set.
285 Lemma preorder_from_rel: forall r x, 286 preorder_r r -> preorder (graph_on r x). 287 Lemma order_from_rel: forall r x, 288 order_r r -> order (graph_on r x).
The traditional notation for an order relation is , or , we shall use gle and gge in our code; if the elements are distinct, we shall use the notations and . This last relation is not reflexive. It satisfies some transitivity properties. We give here some simple properties of orders.
289 Definition gle (r x y:Set) := related r x y. 290 Definition gge (r x y:Set) := related r y x. 291 Definition glt (r x y:Set) := gle r x y & x <> y. 292 Definition ggt (r x y:Set) := gge r x y & x <> y. 293 294 Lemma order_reflexivity_pr: forall r x u v, 295 order_re r x -> r u v -> (inc u x & inc v x). 296 Lemma order_symmetricity_pr: forall r x u v, 297 order_re r x -> (r u v & r v u) = (inc u x & inc v x & u = v). 298 Lemma order_reflexivity: forall r a, 299 order r -> inc a (substrate r) = related r a a. 300 Lemma order_antisymmetry: forall r a b, 301 order r -> related r a b -> related r b a -> a = b. 302 Lemma order_transitivity: forall r a b c, 303 order r -> related r a b -> related r b c -> related r a c. 304 Lemma lt_leq_trans : forall r x y z, 305 order r -> glt r x y -> gle r y z -> glt r x z. 306 Lemma leq_lt_trans : forall r x y z, 307 order r -> gle r x y -> glt r y z -> glt r x z. 308 Lemma lt_lt_trans: forall r a b c, order r -> 309 glt r a b -> glt r b c -> glt r a c. 310 Lemma not_le_gt: forall r x y, order r -> gle r x y -> glt r y x -> False.
311 Lemma order_is_order: forall r, 312 order r -> order_r (related r). 313 Lemma order_is_graph: forall r, order r -> is_graph r. 314 Lemma substrate_domain_order: forall f, 315 order f -> substrate f = domain f. 316 Lemma substrate_opposite_order: forall r, 317 order r-> substrate(opposite_order r) = substrate r. 318 Lemma opposite_is_order: forall r, 319 order r -> order (opposite_order r).
Remember that the diagonal of is the graph of the equality relation on . We know that it is an equivalence. It is also an order.
320 Lemma diagonal_order : forall x, order(diagonal x).
¶ Given a relation and a set , we can consider the relation “ and and ”. If we assume for all , this gives an order relation on . This is for instance the case of inclusion, since is always true. The set can be , or any other set.
321 Definition induced_order_r (r:EEP) x := 322 fun u v => inc u x & inc v x & r u v. 323 Definition inclusion_order (a:Set) := 324 graph_on (fun u v => sub u a & sub v a & sub u v) (powerset a). 325 Definition inclusion_suborder (b:Set) := 326 graph_on (fun u v => inc u b & inc v b & sub u v) b. 327 328 Lemma induced_order_order_r: forall r x, 329 order_r r -> (forall u, inc u x -> r u u) -> order_re (induced_order_r r x) x. 330 Lemma order_sub_on_set: forall a, 331 order_re (fun u v => sub u a & sub v a & sub u v) (powerset a). 332 Lemma order_sub_on_subset: forall a, 333 order_re (fun u v => inc u a & inc v a & sub u v) a. 334 Lemma inclusion_is_order: forall a, 335 order (inclusion_order a). 336 Lemma inclusion_order_rw: forall a u v , 337 related (inclusion_order a) u v = (sub u a & sub v a & sub u v). 338 Lemma substrate_inclusion_order: forall a, 339 substrate (inclusion_order a) = powerset a. 340 Lemma subinclusion_is_order: forall a, 341 order (inclusion_suborder a). 342 Lemma subinclusion_order_rw: forall a u v , 343 related (inclusion_suborder a) u v = (inc u a & inc v a & sub u v). 344 Lemma substrate_subinclusion_order: forall a, 345 substrate (inclusion_suborder a) = a.
¶ Second example. We consider the set of functions from a subset of to and the extension relation. Remember that if an only if there is a function whose source is a subset of , its target is and its value as correspondence is . We say that extends if and are functions, the graph of is a part of the graph of , the target of is a part of the target of . If and are associated to two elements of , they have the same target, namely .
We can now define extends_in on the set , and simplify the definition: extends if and only if . This is an order; the only non trivial point is antisymmetry. If , we have since the source of a function depends only on its graph . We then define extension_order. This is an order on . Note that Bourbaki considers “ extends ” as a relation between and . In our definition comes before .
346 Definition extends_in x y:= 347 fun g f=> inc f (set_of_sub_functions x y) & inc g (set_of_sub_functions x y) 348 & extends (inv_corr_value g) (inv_corr_value f). 349 Definition extension_order x y := 350 graph_on (extends_in x y) (set_of_sub_functions x y). 351 352 Lemma extends_in_pr: forall x y g f, 353 extends_in x y g f = 354 (inc f (set_of_sub_functions x y) & inc g (set_of_sub_functions x y) & 355 sub (P f) (P g)). 356 Lemma extends_refl: forall f, 357 is_function f -> extends f f. 358 Lemma extends_antisymmetric: forall x y f g, 359 inc f (set_of_sub_functions x y) -> 360 inc g (set_of_sub_functions x y) -> 361 P f = P g -> f = g. 362 Lemma extends_order: forall x y, 363 order_re(extends_in x y) (set_of_sub_functions x y). 364 Lemma extension_is_order: forall x y, 365 order (extension_order x y). 366 Lemma extension_order_rw: forall x y u v , 367 related (extension_order x y) u v = (extends_in x y u v). 368 Lemma substrate_extension_order:forall x y, 369 substrate (extension_order x y) = (set_of_sub_functions x y).
¶ Third example. Let be a set, and the subset of formed of all partitions of . Recall that a partition of is a set of sets whose union is , so that . Additional conditions are: the empty set is not in , the elements of are mutually disjoint. We say that is coarser (or sometimes not finer) than if for every there exists such that . We shall show that it is an order. But we start with another property: assume that is a partition of ; if then is a subset of hence . We can consider the canonical injection from to . The graph of this function is a family of sets; this family is a partition of .
370 Definition set_of_partition_set x := 371 Zo(powerset(powerset x)) (fun z => partition z x). 372 373 Definition partition_fun_of_set y x:= 374 canonical_injection y (powerset x). 375 376 Lemma partition_set_in_double_powerset: forall y x, 377 partition y x -> inc y (powerset (powerset x)). 378 Lemma set_of_partition_pr: forall x y, 379 inc y (set_of_partition_set x) = partition y x. 380 Lemma function_pfs: forall y x, 381 partition y x -> is_function (partition_fun_of_set y x). 382 Lemma W_pfs: forall y x a, 383 partition y x -> inc a y -> W a (partition_fun_of_set y x) = a. 384 Lemma partition_pfs: forall y x, 385 partition y x -> partition_fam (graph (partition_fun_of_set y x)) x.
We now define coarser and show that it is an order on W.
386 Definition coarser x := graph_on coarser_c (set_of_partition_set x). 387 388 Lemma coarser_reflexive : forall y, coarser_c y y. 389 Lemma coarser_antisymmetricc : forall y y' x, 390 partition y x -> partition y' x -> 391 coarser_c y y' -> coarser_c y' y -> sub y y'. 392 Lemma coarser_antisymmetric : forall y y' x, 393 partition y x -> partition y' x -> 394 coarser_c y y' -> coarser_c y' y -> y = y'. 395 Lemma related_coarser: forall x y y', 396 related (coarser x) y y' = 397 (partition y x & partition y' x & coarser_c y y'). 398 Lemma related_coarser_bis: forall x y y', 399 related (coarser x) y y' = 400 (partition y x & partition y' x & 401 forall a, inc a y' -> exists b, inc b y & sub a b). 402 Lemma substrate_coarser : forall x, 403 substrate (coarser x) = set_of_partition_set x. 404 Lemma coarser_order : forall x, order (coarser x). 405 Lemma smallest_partition_is_smallest: forall x y, 406 nonempty x -> 407 partition y x -> related (coarser x) (smallest_partition x) y. 408 Lemma largest_partition_is_largest: forall x y, 409 partition y x -> related (coarser x) y (largest_partition x).
Let be a partition; consider the set formed of all with ; let be the union of all these sets. We pretend that this set is the graph of the equivalence associated to the partition. The relation “ coarser than ” is equivalent to . Bourbaki says that this shows that coarser is an order. The nontrivial point is antisymmetry: we must show that implies . This is a consequence of the fact that the sets are mutually disjoint. If and are in the same element of and in and for , the pair is in , hence in , hence in and , so that the intersection of and is not empty, and .
410 Definition partition_relation_set_aux y x := 411 Zo (powerset (coarse x)) (fun z => exists a, inc a y & z = coarse a). 412 Definition partition_relation_set y x := 413 partition_relation (partition_fun_of_set y x) x. 414 415 Lemma prs_is_equivalence: forall y x, 416 partition y x -> is_equivalence (partition_relation_set y x). 417 Lemma partition_relation_set_pr1: forall y x a, 418 partition y x -> 419 inc a y -> inc (coarse a) (partition_relation_set_aux y x). 420 Lemma partition_relation_set_pr: forall y x, 421 partition y x -> 422 partition_relation_set y x = 423 union (partition_relation_set_aux y x). (* 16 *) 424 Lemma sub_partition_relation_set_coarse: forall y x, 425 partition y x -> sub (partition_relation_set y x) (coarse x). 426 Lemma nondisjoint :forall a b c, inc a b -> inc a c -> disjoint b c -> False. 427 Lemma partition_relation_set_order: forall x y y', 428 partition_set y x -> partition_set y' x -> 429 sub (partition_relation_set y' x)(partition_relation_set y x) = 430 related (coarser x) y y'. (* 20 *) 431 Lemma partition_relation_set_order_anti: forall x y y', 432 partition y x -> partition y' x -> 433 (partition_relation_set y' x = partition_relation_set y x) -> 434 sub y y'. (* 34 *) 435 Lemma partition_relation_set_order_antisymmetric: forall x y y', 436 partition y x -> partition y' x -> 437 (partition_relation_set y' x = partition_relation_set y x) -> 438 y = y'.
Let be a graph, be the diagonal of the substrate of . If and then . The two assumptions say that is reflexive and transitive, this a preorder. Antisymmetry is . Since is symmetric (i.e., it is its inverse), reflexivity is also , so that is an order if and only , and (we know that is an equivalence if and only and ). Proposition 1 of Bourbaki [2, p. 132] considers the case of a correspondence (moved to the list of removed theorems).
439 Lemma preorder_prop1: forall g, 440 is_graph g -> 441 sub (diagonal (substrate g)) g -> sub (compose_graph g g) g -> 442 compose_graph g g = g. 443 Theorem order_pr: forall r, 444 order r = 445 (compose_graph r r = r & 446 intersection2 r (opposite_order r) = diagonal (substrate r)). (* 28 *) 447 Theorem order_cor_pr: forall f, 448 is_correspondence f -> 449 order_c f = 450 (source f = target f & source f = (domain (graph f)) & 451 compose_graph (graph f)(graph f) = graph f & 452 intersection2 (graph f) (opposite_order (graph f)) 453 = diagonal (substrate (graph f))).
Consider the relation “ is coarser than ” in the set of all coverings of . This is a preorder relation, since it is reflexive and transitive; it is not antisymmetric, for if is a covering, with , then is a covering which is coarser then . Now, is coarser than if there is a such that . It can happen that ; in such a case, is coarser than , is coarser than , but . In the case of a partition, , and implies .
Here is the definition and the basic properties.
454 Lemma preorder_is_preorder: forall r, 455 preorder r -> preorder_r (related r). 456 Lemma opposite_is_preorder1: forall r, 457 preorder r -> preorder (opposite_order r).
The relation “ and ” is an equivalence if is a preorder. Denote it by . Then is compatible with and . This means that if these three relations hold, then we have also . If has a graph , then has a graph, which is . If is a graph, it is a preorder if and only if and . We know that it implies .
458 Lemma equivalence_preorder: forall r, 459 preorder_r r -> 460 equivalence_r (fun x y => r x y & r y x). 461 Lemma compatible_equivalence_preorder: forall r, 462 let s := (fun x y => r x y & r y x) in 463 preorder_r r -> forall x y x' y', r x y -> s x x' -> s y y' -> r x' y'. 464 Definition equivalence_associated_o r:= intersection2 r (opposite_order r). 465 466 Lemma equivalence_preorder1: forall r, 467 preorder r -> 468 is_equivalence (equivalence_associated_o r). 469 Lemma substrate_equivalence_associated_o: forall r, 470 preorder r -> 471 substrate (equivalence_associated_o r) = substrate r. 472 Lemma compatible_equivalence_pre_order: forall r, 473 let s := (fun x y => r x y & r y x) in 474 preorder_r r -> forall x y x' y', r x y -> s x x' -> s y y' -> r x' y'. 475 Lemma compatible_equivalence_preorder1: forall r u v x y, 476 preorder r -> related r x y -> 477 related (equivalence_associated_o r) x u -> 478 related (equivalence_associated_o r) y v-> 479 related r u v. 480 Lemma preorder_prop: forall g, 481 is_graph g -> 482 preorder g = (sub (diagonal (substrate g)) g & sub (compose_graph g g) g). 483 Lemma preorder_prop2: forall g, 484 preorder g -> compose_graph g g = g. 485 Lemma preorder_reflexivity: forall r a, 486 preorder r -> inc a (substrate r) = related r a a.
Let be a preorder on a set , and the equivalence associated to it. Assume that is the graph of , and let be the canonical projection . Given two objects of the form and in the quotient, we can compare and via , this is independent of the representatives and . This relation has a graph, namely , where is the graph of . This set is also , where maps into . This relation is an order on the quotient; it is called the order relation associated with .
487 Definition order_associated (r:Set) := 488 let s := (graph(canon_proj (equivalence_associated_o r))) in 489 compose_graph (compose_graph s r) (opposite_order s). 490 491 Lemma is_graph_order_associated: forall r, 492 is_graph (order_associated r). 493 Lemma related_compose3: forall s r u v, 494 related (compose_graph (compose_graph s r) (opposite_order s)) u v = 495 exists x, exists y, related s x u & related s y v & related r x y. 496 Lemma related_graph_order_associated1: forall r u v, 497 preorder r-> 498 related (order_associated r) u v = 499 ( inc u (quotient (equivalence_associated_o r)) & 500 inc v (quotient (equivalence_associated_o r)) & 501 exists x, exists y, inc x u & inc y v & related r x y). (* 21 *) 502 Lemma related_graph_order_associated2: forall r u v, 503 preorder r-> 504 related (order_associated r) u v = 505 ( inc u (quotient (equivalence_associated_o r)) & 506 inc v (quotient (equivalence_associated_o r)) & 507 forall x y, inc x u -> inc y v -> related r x y). 508 Lemma substrate_order_associated: forall r, 509 preorder r-> substrate (order_associated r) = 510 (quotient (equivalence_associated_o r)). (* 15 *) 511 Lemma order_order_associated: forall r, 512 preorder r-> order (order_associated r). (* 27 *) 513 Lemma graph_order_associated: forall r, 514 preorder r -> 515 order_associated r = image_by_fun ( 516 ext_to_prod(canon_proj (equivalence_associated_o r)) 517 (canon_proj (equivalence_associated_o r))) r. (* 35 *)
For simplicity, we shall write instead of , and for “ and ”. In Coq, we do not want to overwrite the standard notations for comparison for natural numbers. For this reason, we shall use gle, gge, ggt and glt. These are functions with three arguments: an order and two elements to be compared.
518 (* Definitions moved to section 1.1 519 Definition gle (r x y:Set) := related r x y. 520 Definition gge (r x y:Set) := related r y x. 521 Definition glt (r x y:Set) := gle r x y & x <> y. 522 Definition ggt (r x y:Set) := gge r x y & x <> y. 523 *)
For Bourbaki an order on satisfies
(RO) The relation “ and ” implies .
(RO) The relation “ and ” implies .
(RO) The relation implies “ and ”.
(RO) The relation is equivalent to .
Note the absence of quantifiers; in Bourbaki, if is a free variable, is equivalent to . Hence the definition is correct if , and are three distinct letters that do not appear in or . The first part of C58 is: let be an order relation and let , be two distinct letters; the relation is equivalent to “ or ”. Here, Bourbaki explicitly says that and are distinct. The statement is true only if implies , for instance if is an order on and .
524 Definition order_axioms (r s:Set) := 525 (forall x y z, gle r x y -> gle r y z -> gle r x z) & 526 (forall x y, gle r x y -> gle r y x -> x = y) & 527 (forall x y, gle r x y -> (inc x s & inc y s)) & 528 (forall x, gle r x x = inc x s) & 529 is_graph r. 530 531 Lemma axioms_of_order: forall r, 532 order r = (order_axioms r (substrate r)). 533 Lemma lt_leq_trans : forall r x y z, 534 order r -> glt r x y -> gle r y z -> glt r x z. 535 Lemma leq_lt_trans : forall r x y z, 536 order r -> gle r x y -> glt r y z -> glt r x z. 537 Lemma lt_lt_trans: forall r a b c, order r -> 538 glt r a b -> glt r b c -> glt r a c. 539 Lemma le_pr: forall r x y, 540 inc x (substrate r) -> order r -> gle r x y = (glt r x y \/ x = y).
We say that is a morphism or isomorphism for two orders denoted or on and if is a function from to compatible with the orders (this means the obvious: if then and conversely). A morphism is required to be injective, and an isomorphism is required to be bijective. Properties of morphisms will be studied later. A morphism is an isomorphism on its range.
541 Definition order_isomorphism f r r':= 542 (order r) & (order r') & 543 (bijective f) & (substrate r = source f) & (substrate r' = target f) & 544 (forall x y, inc x (source f) -> inc y (source f) -> 545 gle r x y = gle r' (W x f) (W y f)). 546 547 Definition order_morphism f r r':= 548 (order r) & (order r') & 549 (injective f) & (substrate r = source f) & (substrate r' = target f) & 550 (forall x y, inc x (source f) -> inc y (source f) -> 551 gle r x y = gle r' (W x f) (W y f)).
Let be a graph, a set. Define . This is a graph, whose substrate is a subset of . If is reflexive, with substrate and , then the substrate of is . As a consequence if is an order (or preorder) on , then is an order (or preorder) on . It is called the order induced by . By abuse of notations, if the order relation associated to is denoted then the order relation associated to also denoted instead of . The first three lemmas here say that implies , and implies ; moreover if and , then is equivalent to .
552 Definition induced_order (r a:Set):= 553 intersection2 r (coarse a). 554 555 Lemma related_induced_order: forall r a x y, 556 inc x a -> inc y a -> 557 gle (induced_order r a) x y = gle r x y. 558 Lemma related_induced_order1: forall r a x y, 559 gle (induced_order r a) x y -> gle r x y. 560 Lemma related_induced_order2: forall r a x y, 561 glt (induced_order r a) x y -> glt r x y. 562 563 Lemma relation_induced_order :forall r a, 564 is_graph r -> is_graph (induced_order r a). 565 566 Lemma substrate_induced_order1 :forall r a, 567 is_reflexive r -> 568 sub a (substrate r) -> substrate (induced_order r a) = a. 569 Lemma substrate_induced_order :forall r a, 570 order r -> 571 sub a (substrate r) -> substrate (induced_order r a) = a. 572 Lemma reflexive_induced_order: forall r a, 573 sub a (substrate r) -> 574 is_reflexive r -> is_reflexive (induced_order r a). 575 Lemma transitive_induced_order: forall r a, 576 sub a (substrate r) -> 577 is_transitive r -> is_transitive (induced_order r a). 578 Lemma preorder_induced_order: forall r a, 579 sub a (substrate r) -> 580 preorder r -> preorder (induced_order r a). 581 Lemma order_induced_order: forall r a, 582 sub a (substrate r) -> 583 order r -> order (induced_order r a). 584 Lemma sub_graph_coarse_substrate: forall r, 585 is_graph r -> sub r (coarse (substrate r)). 586 Lemma induced_order_substrate: forall r, 587 order r -> (* OK if r is graph *) 588 induced_order r (substrate r) = r. 589 Lemma opposite_induced: forall r x, order r -> 590 induced_order (opposite_order r) x = opposite_order (induced_order r x).
Let be the set of all mappings of subsets of into . Recall that the set of triples is termed set_of_sub_functions. We first show that is a function from to the set of functional graphs included in . This function is in fact an isomorphism of ordered sets, where the first set is endowed with the relation “ extends ” between and (this is the opposite order of extension_order) and the second set with the inclusion order.
591 Definition set_of_graphs(x y :Set):= 592 (Zo(powerset (product x y)) (fun z => functional_graph z)). 593 594 Definition graph_of_function (x y:Set):= 595 BL (fun g => (P g)) (set_of_sub_functions x y) 596 (set_of_graphs x y). 597 598 Lemma sub_graph_of_function: forall x y z, 599 inc z (set_of_sub_functions x y) -> sub (P z) (product x y). 600 Lemma set_of_graphs_pr: forall x y z, 601 inc z (set_of_sub_functions x y) -> inc (P z) (set_of_graphs x y). 602 Lemma axioms_graph_of_function: forall x y, 603 transf_axioms(fun g => (P g)) (set_of_sub_functions x y) 604 (set_of_graphs x y). 605 Lemma fonction_graph_of_function: forall x y, 606 is_function (graph_of_function x y). 607 Lemma W_graph_of_function: forall x y f, 608 inc f (set_of_sub_functions x y) -> W f (graph_of_function x y) = P f. 609 Lemma injective_graph_of_function: forall x y, 610 injective (graph_of_function x y). 611 Lemma surjective_graph_of_function: forall x y, 612 surjective (graph_of_function x y). 613 Lemma isomorphism_graph_of_function: forall x y, 614 order_isomorphism (graph_of_function x y) 615 (opposite_order (extension_order x y)) 616 (inclusion_suborder (set_of_graphs x y)).
¶ If is a set, we consider the mapping , that maps a partition to the graph of the associated equivalence. We know that “ coarser than ” is equivalent to . This mapping is an isomorphism on its image (when the source is endowed with the opposite of the coarse relation, and the target with ). The source is the set of partitions, the target is some subset of .
617 Definition graph_of_partition x := 618 fun_function(fun y => partition_relation_set y x) 619 (set_of_partition_set x)(powerset (coarse x)). 620 621 Lemma axioms_gop: forall x, 622 transf_axioms (fun y => partition_relation_set y x) 623 (set_of_partition_set x) (powerset (coarse x)). 624 Lemma W_gop: forall x y, 625 partition y x -> 626 W y (graph_of_partition x) = partition_relation_set y x. 627 Lemma function_gop: forall x, is_function(graph_of_partition x). 628 Lemma injective_gop: forall x, injective(graph_of_partition x). 629 Lemma isomorphism_gop: forall x, 630 order_morphism (graph_of_partition x) (coarser x) 631 (opposite_order (inclusion_order (coarse x))).
¶ We consider the set of all preorders on ; more precisely the set of all graphs that are preorders, and order them by inclusion. A preorder is finer than if ; this is the same as to say that elements related by are related by .
632 Definition set_of_preorders x := 633 Zo (powerset (coarse x))(fun z => substrate z = x & preorder z). 634 Definition coarser_preorder (x:E) := 635 inclusion_suborder (set_of_preorders x). 636 637 Lemma set_of_preorders_pr: forall x z, 638 inc z (set_of_preorders x) = (substrate z = x & preorder z). 639 640 Lemma order_coarser_preorder: forall x, 641 order (coarser_preorder x). 642 Lemma substrate_coarser_preorder: forall x, 643 substrate (coarser_preorder x) = set_of_preorders x. 644 Lemma related_coarser_preorder: forall x u v, 645 related (coarser_preorder x) u v = 646 (preorder u & preorder v & substrate u = x & substrate v = x & sub u v). 647 Lemma related_coarser_preorder1: forall x u v, 648 related (coarser_preorder x) u v = 649 (preorder u & preorder v & substrate u = x & substrate v = x & 650 forall a b, inc a x -> inc b x -> related u a b -> related v a b).
¶ Consider now a family of sets , a family of orders with graphs . Denote the relation associated to by . On the product we can consider the relation: , between and . This is an order relation; it will be called the product of the order relations and its graph will be called the product of the orders. The graph is transported from to via the canonical bijection.
651 Definition product_order_r(f g:Set): EEP := 652 fun x x' => 653 inc x (productb f) & inc x' (productb f) & 654 forall i, inc i (domain f) -> gle (V i g) (V i x)(V i x'). 655 656 Definition product_order f g:= 657 graph_on (product_order_r f g)(productb f). 658 659 Definition axioms_product_order f g:= 660 fgraph f & fgraph g & domain f = domain g & 661 (forall i, inc i (domain f) -> order (V i g)) & 662 (forall i, inc i (domain f) -> substrate (V i g) = V i f). 663 664 Lemma order_r_product_order: forall f g, 665 axioms_product_order f g -> order_r (product_order_r f g). 666 Lemma order_re_product_order: forall f g, 667 axioms_product_order f g -> order_re (product_order_r f g)(productb f). 668 Lemma order_product_order: forall f g, 669 axioms_product_order f g -> order(product_order f g). 670 Lemma related_product_order: forall f g x x', 671 axioms_product_order f g -> 672 related(product_order f g) x x' = 673 (inc x (productb f) & inc x' (productb f) & 674 forall i, inc i (domain f) -> related (V i g) (V i x)(V i x')). 675 Lemma substrate_product_order: forall f g, 676 axioms_product_order f g -> substrate(product_order f g) = productb f. 677 Lemma product_order_def: forall f g, axioms_product_order f g -> 678 image_by_fun (prod_of_products_canon f f)(product_order f g) 679 = (productb g). (* 36 *)
Since is a product, an order on gives an order on the set of graphs of functions. We can compare two functions and via . This is not an order because we cannot consider the set of all functions. However, this gives a natural order on via sof_value.
The function that associates to a triple of its graph in is an isomorphism.
680 Definition graph_order_r(x y g:Set): EEP := 681 fun z z' => 682 inc z (set_of_gfunctions x y) & inc z' (set_of_gfunctions x y) & 683 forall i, inc i x-> related g (V i z)(V i z'). 684 Definition function_order_r x y r f g := 685 is_function f & is_function g & source f = x & target f = y 686 & source g =x & target g = y & 687 forall i, inc i x -> gle r (W i f) (W i g). 688 Definition graph_order x y g := 689 graph_on(graph_order_r x y g) (set_of_gfunctions x y). 690 Definition function_order x y r := 691 graph_on(fun u v => function_order_r x y r(sof_value x y u)(sof_value x y v)) 692 (set_of_functions x y). 693 Definition cst_graph x y:= L x (fun _ => y). 694 695 Lemma axioms_product_order_x:forall x y g, order g -> substrate g = y -> 696 axioms_product_order (cst_graph x y) (cst_graph x g). 697 Lemma cst_graph_pr: forall x y, 698 productb (cst_graph x y) = set_of_gfunctions x y. 699 Lemma graph_order_r_pr: forall x y g z z', order g -> substrate g = y -> 700 graph_order_r x y g z z' = 701 product_order_r (cst_graph x y) (cst_graph x g) z z'. 702 Lemma graph_order_pr:forall x y g, order g -> substrate g = y -> 703 graph_order x y g = product_order (cst_graph x y) (cst_graph x g). 704 Lemma order_graph_order: forall x y g, order g -> substrate g = y -> 705 order (graph_order x y g). 706 Lemma substrate_graph_order: forall x y g, order g -> substrate g = y -> 707 substrate (graph_order x y g) = set_of_gfunctions x y. 708 Lemma reflexive_function_order: forall x y r u, 709 order r -> substrate r = y -> 710 inc u (set_of_functions x y) -> gle (function_order x y r) u u. 711 Lemma substrate_function_order: forall x y r, 712 order r -> substrate r = y -> 713 substrate (function_order x y r) =set_of_functions x y. 714 Lemma order_function_order: forall x y r, 715 order r -> substrate r = y -> order (function_order x y r). 716 Lemma function_order_pr: forall x y r f f', 717 order r -> substrate r = y -> 718 gle (function_order x y r) f f' = 719 (inc f (set_of_functions x y) & 720 inc f' (set_of_functions x y) & 721 forall i, inc i x -> 722 gle r (W i (sof_value x y f)) (W i (sof_value x y f'))). 723 Lemma isomorphism_function_order: forall x y r, 724 order r -> substrate r = y -> 725 order_isomorphism (BL P (set_of_functions x y)(set_of_gfunctions x y)) 726 (function_order x y r)(graph_order x y r).
¶ We consider now the product of two order relations (it is similar to the product of a family of order that has two elements).
727 Definition product2_order_r f g := 728 fun x x' => 729 inc x (product (substrate f)(substrate g)) & 730 inc x' (product (substrate f)(substrate g)) & 731 related f (P x) (P x') & related g (Q x) (Q x'). 732 733 Definition product2_order f g:= 734 graph_on (product2_order_r f g)(product (substrate f)(substrate g)). 735 736 Lemma preorder_r_product2_order: forall f g, 737 preorder f -> preorder g -> preorder_r (product2_order_r f g). 738 Lemma order_r_product2_order: forall f g, 739 order f -> order g -> order_r (product2_order_r f g). 740 Lemma preorder_product2_order: forall f g, 741 preorder f -> preorder g -> preorder (product2_order f g). 742 Lemma order_product2_order: forall f g, 743 order f -> order g -> order (product2_order f g). 744 Lemma product2_order_pr: forall f g x y, 745 related (product2_order f g) x y = product2_order_r f g x y. 746 Lemma substrate_preorder_product2_order: forall f g, 747 preorder f -> preorder g -> substrate (product2_order f g) = 748 product (substrate f) (substrate g). 749 Lemma substrate_order_product2_order: forall f g, 750 order f -> order g -> substrate (product2_order f g) = 751 product (substrate f) (substrate g).
We say that a function is increasing if implies and decreasing if implies . Bourbaki defines increasing when is a preorder. A function is strictly increasing or strictly decreasing if implies or . A function that is increasing or decreasing is monotone.
752 Definition increasing_map f src r r':= 753 forall x y, inc x src -> inc y src -> gle r x y -> gle r' (f x) (f y). 754 Definition decreasing_map f src r r':= 755 forall x y, inc x src -> inc y src -> gle r x y -> gge r' (f x) (f y). 756 Definition strict_increasing_map f src r r':= 757 forall x y, inc x src -> inc y src -> glt r x y -> glt r' (f x) (f y). 758 Definition strict_decreasing_map f src r r':= 759 forall x y, inc x src -> inc y src -> glt r x y -> ggt r' (f x) (f y). 760 761 Definition increasing_fun f r r':= 762 is_function f & order r & order r' & substrate r = source f 763 & substrate r' = target f & 764 increasing_map (fun w => W w f) (source f) r r'. 765 Definition decreasing_fun f r r':= 766 is_function f & order r & order r' & substrate r = source f 767 & substrate r' = target f & 768 decreasing_map (fun w => W w f) (source f) r r'. 769 Definition monotone_fun f r r':= 770 increasing_fun f r r' \/ decreasing_fun f r r'. 771 Definition strict_increasing_fun f r r':= 772 is_function f & order r & order r' & substrate r = source f 773 & substrate r' = target f & 774 strict_increasing_map (fun w => W w f) (source f) r r'. 775 Definition strict_decreasing_fun f r r':= 776 is_function f & order r & order r' & substrate r = source f 777 & substrate r' = target f & 778 strict_decreasing_map (fun w => W w f) (source f) r r'. 779 Definition strict_monotone_fun f r r':= 780 strict_increasing_fun f r r' \/ strict_decreasing_fun f r r'.
Some consequences when we replace one order by its opposite.
781 Lemma increasing_fun_reva : forall f r r', 782 increasing_fun f r r' -> decreasing_fun f r (opposite_order r'). 783 Lemma increasing_fun_revb : forall f r r', 784 increasing_fun f r r' -> decreasing_fun f (opposite_order r) r'. 785 Lemma decreasing_fun_reva : forall f r r', 786 decreasing_fun f r r' -> increasing_fun f r (opposite_order r'). 787 Lemma decreasing_fun_revb : forall f r r', 788 decreasing_fun f r r' -> increasing_fun f (opposite_order r) r'. 789 Lemma monotone_fun_reva : forall f r r', 790 monotone_fun f r r' -> monotone_fun f r (opposite_order r'). 791 Lemma monotone_fun_revb : forall f r r', 792 monotone_fun f r r' -> monotone_fun f (opposite_order r) r'.
Same for strictly monotone.
793 Lemma opposite_gle: forall r x y, order r -> 794 gle (opposite_order r) x y = gle r y x. 795 Lemma opposite_gge: forall r x y, order r -> 796 gge (opposite_order r) x y = gle r x y. 797 798 Lemma glt_inva: forall r x y, 799 order r -> glt r x y = ggt (opposite_order r) x y. 800 Lemma ggt_inva: forall r x y, 801 order r -> ggt r x y = glt (opposite_order r) x y. 802 Lemma ggt_invb: forall r x y, 803 order r -> ggt r x y = glt r y x. 804 Lemma strict_increasing_fun_reva : forall f r r', 805 strict_increasing_fun f r r' -> strict_decreasing_fun f r (opposite_order r'). 806 Lemma strict_increasing_fun_revb : forall f r r', 807 strict_increasing_fun f r r' -> strict_decreasing_fun f (opposite_order r) r'. 808 Lemma strict_decreasing_fun_reva : forall f r r', 809 strict_decreasing_fun f r r' -> strict_increasing_fun f r (opposite_order r'). 810 Lemma strict_decreasing_fun_revb : forall f r r', 811 strict_decreasing_fun f r r' -> strict_increasing_fun f (opposite_order r) r'. 812 Lemma strict_monotone_fun_reva : forall f r r', 813 strict_monotone_fun f r r' -> strict_monotone_fun f r (opposite_order r'). 814 Lemma strict_monotone_fun_revb : forall f r r', 815 strict_monotone_fun f r r' -> strict_monotone_fun f (opposite_order r) r'.
If is constant, then is increasing and decreasing. Conversely, the identity function is increasing and decreasing on a set ordered by equality. This function is not constant when the set has more then one element. Let be set, the function that maps to its complementary. This is a strictly decreasing function when the powerset is ordered by inclusion.
816 Lemma constant_fun_increasing: forall f r r', 817 order r -> order r' -> substrate r = source f -> 818 substrate r' = target f -> is_constant_function f -> 819 increasing_fun f r r'. 820 Lemma constant_fun_decreasing: forall f r r', 821 order r -> order r' -> substrate r = source f -> 822 substrate r' = target f -> is_constant_function f -> 823 decreasing_fun f r r'. 824 Lemma identity_increasing_decreasing : forall x, 825 let r := diagonal x in 826 (increasing_fun (identity_fun x) r r &decreasing_fun (identity_fun x) r r). 827 Lemma complementary_decreasing: forall E, 828 strict_decreasing_fun(BL (fun X => complement E X)(powerset E)(powerset E)) 829 (inclusion_order E) (inclusion_order E).
Let be the set of upper bounds of (the case of a non-singleton will be studied later). We have if and only if . The function is strictly decreasing.
830 Definition set_of_majorants1 x r:= 831 Zo (substrate r)(fun y => related r x y). 832 Lemma set_of_majorants1_pr: forall x y r, 833 order r -> inc x (substrate r) -> inc y (substrate r) -> 834 (related r x y = sub (set_of_majorants1 y r) (set_of_majorants1 x r)). 835 Lemma set_of_majorants1_decreasing: forall r, (* 15 *) 836 order r -> 837 strict_decreasing_fun(BL (fun x=> (set_of_majorants1 x r)) 838 (substrate r)(powerset (substrate r))) r (inclusion_order (substrate r)).
If a function is injective, monotone implies strictly monotone. If a function is bijective, it is an isomorphism if and only if the function and its inverse are increasing. An isomorphism remains one if the ordering on the source and target are replaced by the opposite ones.
839 Lemma strict_increasing_from_injective: forall f r r', 840 injective f -> increasing_fun f r r' -> strict_increasing_fun f r r'. 841 Lemma strict_decreasing_from_injective: forall f r r', 842 injective f ->decreasing_fun f r r' -> strict_decreasing_fun f r r'. 843 Lemma strict_monotone_from_injective: forall f r r', 844 injective f -> monotone_fun f r r' -> strict_monotone_fun f r r'. 845 Lemma order_isomorphism_increasing: forall f r r', 846 order_isomorphism f r r' -> 847 strict_increasing_fun f r r'. 848 Lemma order_morphism_increasing: forall f r r', 849 order_morphism f r r' -> 850 strict_increasing_fun f r r'. 851 Lemma order_isomorphism_pr: forall f r r', 852 order r -> order r' -> 853 bijective f -> substrate r = source f -> substrate r' = target f -> 854 (order_isomorphism f r r' = 855 (increasing_fun f r r' & increasing_fun (inverse_fun f) r' r)). 856 Lemma order_isomorphism_opposite: forall g r r', 857 order_isomorphism g r r' -> 858 order_isomorphism g (opposite_order r) (opposite_order r').
Assume that we have two ordered sets and , decreasing functions and from to and to . Assume and for all and . Proposition 2 [2, p. 139] says and .
859 Theorem decreasing_composition: forall u v r r', 860 decreasing_fun u r r' -> decreasing_fun v r' r -> 861 (forall x, inc x (substrate r) -> related r (W (W x u) v) x) -> 862 (forall x', inc x' (substrate r') -> related r' (W (W x' v) u) x') -> 863 (compose u (compose v u) = u & compose v (compose u v) = v). (* 21 *)
Bourbaki says: if is a set with a preorder, then is minimal (resp. maximal) in if (resp. ) implies . In the definition given here, we do not say that is an order or a preorder.
864 Definition maximal_element r a:= 865 inc a (substrate r) & forall x, inc x (substrate r) -> gle r a x -> x = a. 866 Definition minimal_element r a:= 867 inc a (substrate r) & forall x, inc x (substrate r) -> gle r x a -> x = a.
¶ Given a correspondence and a pair , we can extend as by imposing ; this is a correspondence, it is a function if is not in the source of . This extension is unique if we merely add to the source, to the target and to the graph. The extension is a surjective function if is surjective.
868 Definition tack_on_f f x y:= 869 corresp (tack_on (source f) x) 870 (tack_on (target f) y) (tack_on (graph f) (J x y)). 871 872 Lemma corresp_tack_on: forall f x y, 873 is_correspondence f -> is_correspondence (tack_on_f f x y). 874 Lemma function_tack_on: forall f x y, 875 is_function f -> ~(inc x (source f)) -> is_function (tack_on_f f x y). 876 Lemma W_tack_on_in: forall f x y u, 877 is_function f -> ~(inc x (source f)) -> inc u (source f) -> 878 W u (tack_on_f f x y) = W u f. 879 Lemma W_tack_on_out: forall f x y, 880 is_function f -> ~(inc x (source f)) -> W x (tack_on_f f x y) = y. 881 882 Lemma surjective_tack_on: forall f x y, 883 surjective f -> ~(inc x (source f)) -> surjective (tack_on_f f x y). 884 Lemma tack_on_f_injective: forall x f g a b, 885 is_function f -> is_function g -> target f = target g -> 886 source f = source g -> ~ (inc x (source f)) -> 887 (tack_on_f f x a = tack_on_f g x b) -> f = g.
Examples. In , the empty set is the least element for inclusion. If we remove it, minimal elements are singletons. On the set of partial functions ordered by extension, maximal elements are total functions (because non-total functions can be extended).
888 Lemma maximal_element_opp: forall r a, 889 order r -> maximal_element r a -> minimal_element (opposite_order r) a. 890 Lemma minimal_element_opp: forall r a, 891 order r -> minimal_element r a -> maximal_element (opposite_order r) a. 892 Lemma maximal_opposite: forall r x, 893 order r -> maximal_element (opposite_order r) x = minimal_element r x. 894 895 Lemma minimal_inclusion: forall E y, (* 14 *) 896 let F:= complement (powerset E) (singleton emptyset) in 897 inc y F -> (minimal_element (inclusion_suborder F) y = is_singleton y). 898 899 Lemma maximal_prolongation: forall E F x, (* 32 *) 900 nonempty F -> inc x (set_of_sub_functions E F) -> 901 maximal_element (opposite_order (extension_order E F)) x = (P (Q x) = E).
We start with the definition of the greatest and least element of an order relation (sometimes called the largest or smallest). Trivial properties follow. If is an order on , then is a greatest element for the order if and if for all we have (the condition could be relaxed in is not empty). A greatest element may not exist, but is unique. It is maximal. A set that has a greatest element has a unique maximal element. The greatest (resp.least) element is sometimes denoted max (resp. min). We give two properties: if has a least element then is a least element, and if is a least element of then . If then provided that the big set has a greatest element that belongs to the small set. If , then has a single element.
902 Definition greatest_element r a:= 903 inc a (substrate r) & forall x, inc x (substrate r) -> gle r x a. 904 Definition least_element r a:= 905 inc a (substrate r) & forall x, inc x (substrate r) -> gle r a x. 906 Definition the_least_element r:= 907 choose (fun x=> least_element r x). 908 Definition the_greatest_element r:= 909 choose (fun x=> greatest_element r x) 910 911 Lemma unique_greatest: forall a b r, 912 order r -> greatest_element r a -> greatest_element r b -> a = b. 913 Lemma unique_least: forall a b r, 914 order r -> least_element r a -> least_element r b -> a = b. 915 916 Lemma the_least_element_pr: forall r, 917 order r -> (exists u, least_element r u) -> 918 least_element r (the_least_element r). 919 920 Lemma the_greatest_element_pr: forall r, 921 order r -> (exists u, greatest_element r u) -> 922 greatest_element r (the_greatest_element r). 923 924 Lemma the_least_element_pr2: forall r x, order r -> 925 least_element r x -> the_least_element r = x. 926 Lemma the_greatest_element_pr2: forall r x, order r -> 927 greatest_element r x -> the_greatest_element r = x. 928 Lemma greatest_induced: forall r s x, order r -> 929 sub s (substrate r) -> inc x s -> 930 greatest_element r x -> 931 the_greatest_element r = the_greatest_element (induced_order r s). 932 Lemma least_induced: forall r s x, order r -> 933 sub s (substrate r) -> inc x s -> 934 least_element r x -> 935 the_least_element r = the_least_element (induced_order r s). 936 937 Lemma least_not_greatest: forall r x , order r -> 938 least_element r x -> greatest_element r x -> 939 is_singleton (substrate r).
More simple properties.
940 Lemma greatest_reverse: forall a r, 941 order r -> greatest_element r a -> least_element (opposite_order r) a. 942 Lemma least_reverse: forall a r, 943 order r -> least_element r a -> greatest_element (opposite_order r) a. 944 Lemma the_least_reverse: forall r, order r -> 945 (exists a, greatest_element r a) -> 946 the_least_element (opposite_order r) = the_greatest_element r. 947 Lemma greatest_maximal: forall a r, 948 order r -> greatest_element r a -> maximal_element r a. 949 Lemma least_minimal: forall a r, 950 order r -> least_element r a -> minimal_element r a. 951 Lemma greatest_unique_maximal: forall a b r, 952 greatest_element r a -> maximal_element r b -> a = b. 953 Lemma least_unique_minimal: forall a b r, 954 least_element r a -> minimal_element r b -> a = b.
Now some examples. If is a subset of , then the upper and lower bounds of are the intersection and union; we anticipate a bit: for the moment being, we just say that the least and greatest elements are the intersection and union, provided they are in . Note that need not be mentioned in the theorems.
955 Lemma least_is_intersection: forall s a, 956 least_element (inclusion_suborder s) a -> 957 nonempty s -> a = intersection s. 958 Lemma greatest_is_union: forall s a, 959 greatest_element (inclusion_suborder s) a -> a = union s. 960 Lemma intersection_is_least: forall s, 961 inc (intersection s) s -> 962 least_element (inclusion_suborder s) (intersection s) . 963 Lemma union_is_greatest: forall s, 964 inc (union s) s -> greatest_element (inclusion_suborder s) (union s).
Some applications. On , the least element is , the greatest is . On the set of partial functions from to , there is no greatest element if has at least two elements (constant functions defined on the whole of are maximal; if there is a greatest element, all constants are equal).
965 Lemma emptyset_is_least: forall E, 966 least_element (inclusion_order E) emptyset. 967 Lemma wholeset_is_greatest: forall E, 968 greatest_element (inclusion_order E) E. 969 Definition empty_function_tg F := BL (fun x => x) emptyset F. 970 Lemma function_empty_function_tg: forall F, 971 is_function (empty_function_tg F). 972 Lemma least_prolongation: forall E F, 973 least_element (opposite_order (extension_order E F)) 974 (corr_value (empty_function_tg F)). 975 Lemma greatest_prolongation: forall E F x, 976 greatest_element (opposite_order (extension_order E F)) x -> 977 nonempty E -> small_set F. (* 17 *)
Bourbaki notices that if is a set, the diagonal of , then is the smallest of equivalences or preorders on (for the inclusion order induced on ). This a consequence of the next lemma. Note: We have defined finer_equivalence and shown that if and are equivalences on a same set, then is finer than if and only if . Thus, on the set of equivalences on , the inclusion order is finer_equivalence and we have already shown that the least element is the diagonal and the greatest one is .
978 Lemma least_equivalence: forall r, 979 is_reflexive r -> sub (diagonal (substrate r)) r.
Proposition 3 [2, p. 140] in Bourbaki says: Let be an ordered set and let be the disjoint union of and a set consisting of a single element. Then there exists a unique ordering on which induces the given ordering on and for which is the greatest element of .
There is no definition of “disjoint union”, but section II.4.8 defines the sum of a family of sets as the union of a family of mutually disjoint sets. Thus, given and , there exists and , two disjoint sets, two bijections and , and is the union of and . Because is a bijection, there is an element such that . The proposition is now: if is the given order, then is an order, its substrate is , namely , and there is a unique order on , extending and with as greatest element. In our implementation we consider two separate lemmas.
980 Definition order_with_greatest r a := 981 union2 r (product (tack_on (substrate r) a) (singleton a)). 982 983 Lemma singleton_pr1: forall a x, nonempty x -> 984 (forall z, inc z x -> z = a) -> x = singleton a. 985 Lemma order_with_greatest_pr: forall r a, (* 44 *) 986 let r':=order_with_greatest r a in 987 order r -> ~ (inc a (substrate r)) -> 988 (order r' & substrate r' = tack_on (substrate r) a & 989 r = intersection2 r' (coarse (substrate r)) & greatest_element r' a). 990 Lemma order_transportation: forall f r, 991 let r':= image_by_fun (ext_to_prod f f) r in 992 bijective f -> order r -> substrate r = source f -> 993 (order r' & substrate r' = target f). (* 42 *) 994 Theorem adjoin_greatest: forall r a E, 995 order r -> substrate r = E -> ~ (inc a E) -> 996 exists_unique (fun r' => order r' & substrate r' = tack_on E a & 997 r = intersection2 r' (coarse E) & greatest_element r' a). (* 39 *)
If is an order on (Bourbaki considers the case of pre-orders) we say that a part of is cofinal (or coinitial) if for all there is a such that (or ) if the order is denoted . Bourbaki says “To say that an ordered set has a greatest element therefore means that has a cofinal subset consisting of a single element”. The lemmas given here talk about an object and its substrate . We do not assume that is an order: we do not even assume that is a graph (what happens is the following: if is the set of pairs in , then is the the graph of the relation associated to , for which and are related if and only if ).
998 Definition cofinal_set r a := 999 sub a (substrate r) & 1000 (forall x, inc x (substrate r) -> exists y, inc y a & gle r x y). 1001 Definition coinitial_set r a := 1002 sub a (substrate r) & 1003 (forall x, inc x (substrate r) -> exists y, inc y a & gle r y x). 1004 Lemma exists_greatest_cofinal: forall r, 1005 (exists x, greatest_element r x) = 1006 (exists a, cofinal_set r a & is_singleton a). 1007 Lemma exists_least_coinitial: forall r, 1008 (exists x, least_element r x) = 1009 (exists a, coinitial_set r a & is_singleton a).
Given an order on a set denoted by and a set , an element is said to be an upper bound for and if implies . A lower bound is an element such that implies . If the set is not empty, we deduce that ; in order to cover the case , we add the condition ; the set of upper bounds of the empty set is thus . Note that Bourbaki assumes that is a preorder (but in most examples, and in the next section, it will be an order).
1010 Definition upper_bound r X x := 1011 inc x (substrate r) & forall y, inc y X -> gle r y x. 1012 Definition lower_bound r X x := 1013 inc x (substrate r) & forall y, inc y X -> gle r x y.
The first properties given here are trivial. If we have an order on and if is a subset of , we can consider the order induced on ; this may have a least element or a greatest element . If these quantities exist, they are in and are an upper or lower bound of for the relation on . Converse holds: if has an upper bound in , it is .
1014 Lemma opposite_upper_bound: forall x X r, order r -> 1015 upper_bound r X x = lower_bound (opposite_order r) X x. 1016 Lemma opposite_lower_bound: forall x X r, order r -> 1017 lower_bound r X x = upper_bound (opposite_order r) X x. 1018 Lemma smaller_lower_bound: forall x y X r, preorder r -> 1019 lower_bound r X x -> gle r y x -> lower_bound r X y. 1020 Lemma greater_upper_bound: forall x y X r, preorder r -> 1021 upper_bound r X x -> gle r x y -> upper_bound r X y. 1022 Lemma sub_lower_bound: forall x X Y r, 1023 lower_bound r X x -> sub Y X-> lower_bound r Y x. 1024 Lemma sub_upper_bound: forall x X Y r, 1025 upper_bound r X x -> sub Y X -> upper_bound r Y x. 1026 Lemma least_element_pr: forall X r, order r -> sub X (substrate r) -> 1027 (exists a, least_element (induced_order r X) a) = 1028 (exists x, lower_bound r X x & inc x X). 1029 Lemma greatest_element_pr: forall X r, order r -> sub X (substrate r) -> 1030 (exists a, greatest_element (induced_order r X) a) = 1031 (exists x, upper_bound r X x & inc x X).
We consider now bounded sets, that are sets that have a bound.
1032 Definition bounded_above r X := exists x, upper_bound r X x. 1033 Definition bounded_below r X := exists x, lower_bound r X x. 1034 Definition bounded_both r X := bounded_above r X & bounded_below r X. 1035 1036 Lemma bounded_above_sub: forall X Y r, 1037 sub Y X ->bounded_above r X -> bounded_above r Y. 1038 Lemma bounded_below_sub: forall X Y r, 1039 sub Y X ->bounded_below r X -> bounded_below r Y. 1040 Lemma bounded_both_sub: forall X Y r, 1041 sub Y X ->bounded_both r X -> bounded_both r Y. 1042 Lemma singleton_bounded:forall x r, 1043 is_singleton x -> order r -> sub x (substrate r) -> bounded_both r x.
The Bourbaki definition is: let be an ordered set and let be a subset of . An element of is said to be greatest lower bound of in if it is the greatest element of the set of lower bounds of in . Let be the set of lower bounds of ; it is a subset of , hence can be ordered with the order induced from . This may have a greatest element . This is in hence is a lower bound of and if is another lower bound we have . The converse is true, hence we have a characterization of the greatest lower bound that does not involve the set . Similarly the least upper bound of is an upper bound such that if is another upper bound, then .
1044 Definition greatest_lower_bound r X x := 1045 greatest_element (induced_order r (Zo (substrate r) 1046 (fun z => lower_bound r X z))) x. 1047 Definition least_upper_bound r X x := 1048 least_element (induced_order r (Zo (substrate r) 1049 (fun z => upper_bound r X z))). 1050 1051 Lemma greatest_lower_bound_pr: forall r X x, 1052 order r -> sub X (substrate r) -> 1053 greatest_lower_bound r X x = (lower_bound r X x 1054 & forall z, lower_bound r X z -> gle r z x). 1055 Lemma least_upper_bound_pr: forall r X x, 1056 order r -> sub X (substrate r) -> 1057 least_upper_bound r X x = (upper_bound r X x 1058 & forall z, upper_bound r X z -> gle r x z).
The greatest lower bound and least upper bound are also called supremum and infimum and denoted by and . As usual, the order is and the substrate is ; in some cases the set is not mentioned. If we often write and . The sup does not always exists, but is unique since there is a unique least element. We give a characterization of the sup and the inf when they exist. The case of two arguments is also provided.
1059 Lemma supremum_unique: forall x y X r, order r -> 1060 least_upper_bound r X x -> least_upper_bound r X y -> x = y. 1061 Lemma infimum_unique: forall x y X r, order r -> 1062 greatest_lower_bound r X x -> greatest_lower_bound r X y -> x = y. 1063 1064 Definition supremum r X := choose (fun x=> least_upper_bound r X x). 1065 Definition infimum r X := choose (fun x=> greatest_lower_bound r X x). 1066 Definition has_supremum r X :=(exists x, least_upper_bound r X x). 1067 Definition has_infimum r X :=(exists x, greatest_lower_bound r X x). 1068 Definition sup r x y := supremum r (doubleton x y). 1069 Definition inf r x y := infimum r (doubleton x y). 1070 1071 Lemma supremum_pr1: forall X r, 1072 order r -> sub X (substrate r) -> has_supremum r X -> 1073 least_upper_bound r X (supremum r X). 1074 Lemma infimum_pr1: forall X r, 1075 order r -> sub X (substrate r) -> has_infimum r X -> 1076 greatest_lower_bound r X (infimum r X). 1077 Lemma inc_supremum_substrate : forall X r, 1078 order r -> sub X (substrate r) -> has_supremum r X -> 1079 inc (supremum r X) (substrate r). 1080 Lemma inc_infimum_substrate : forall X r, 1081 order r -> sub X (substrate r) -> has_infimum r X -> 1082 inc (infimum r X) (substrate r). 1083 Lemma supremum_pr: forall X r, 1084 order r -> sub X (substrate r) -> has_supremum r X -> 1085 (upper_bound r X (supremum r X) & 1086 forall z, upper_bound r X z -> gle r (supremum r X) z). 1087 Lemma infimum_pr: forall X r, 1088 order r -> sub X (substrate r) -> has_infimum r X -> 1089 (lower_bound r X (infimum r X) & 1090 forall z, lower_bound r X z -> gle r z (infimum r X)). 1091 Lemma sup_pr: forall a b r, 1092 order r -> inc a (substrate r) -> inc b (substrate r) 1093 -> has_supremum r (doubleton a b) -> 1094 (gle r a (sup r a b) & gle r b (sup r a b) & 1095 forall z, gle r a z -> gle r b z -> gle r (sup r a b) z). 1096 Lemma inf_pr: forall a b r, 1097 order r -> inc a (substrate r) -> inc b (substrate r) 1098 -> has_infimum r (doubleton a b) -> 1099 (gle r (inf r a b) a & gle r (inf r a b) b& 1100 forall z, gle r z a -> gle r z b -> gle r z (inf r a b)). 1101 Lemma least_upper_bound_doubleton: forall r x y z, 1102 order r -> gle r x z -> gle r y z -> 1103 (forall t, gle r x t -> gle r y t -> gle r z t) -> 1104 least_upper_bound r (doubleton x y) z. 1105 Lemma greatest_lower_bound_doubleton: forall r x y z, 1106 order r -> gle r z x -> gle r z y -> 1107 (forall t, gle r t x -> gle r t y -> gle r t z) -> 1108 greatest_lower_bound r (doubleton x y) z.
We show here the following claim: if a subset of has a greatest element , then is the least upper bound of in .
1109 Lemma greatest_is_sup: forall r X a, 1110 order r -> sub X (substrate r) -> 1111 greatest_element (induced_order r X) a -> least_upper_bound r X a. 1112 Lemma least_is_inf: forall r X a, 1113 order r -> sub X (substrate r) -> 1114 least_element (induced_order r X) a -> greatest_lower_bound r X a.
The roles of inf and sup are exchanged if we replace the order by its opposite.
1115 Lemma inf_sup_opp: forall r X a, 1116 order r -> sub X (substrate r) -> 1117 greatest_lower_bound r X a = least_upper_bound (opposite_order r) X a. 1118 Lemma sup_inf_opp: forall r X a, 1119 order r -> sub X (substrate r) -> 1120 least_upper_bound r X a = greatest_lower_bound (opposite_order r) X a.
Examples. We study the sup and inf of the empty set.
1121 Lemma set_of_lower_bounds_emptyset: forall r , 1122 Zo (substrate r) (fun z => lower_bound r emptyset z) = substrate r. 1123 Lemma set_of_upper_bounds_emptyset: forall r , 1124 Zo (substrate r) (fun z => upper_bound r emptyset z) = substrate r. 1125 Lemma least_upper_bound_emptyset: forall r x, order r -> 1126 least_upper_bound r emptyset x = least_element r x. 1127 Lemma greatest_lower_bound_emptyset: forall r x, order r -> 1128 greatest_lower_bound r emptyset x = greatest_element r x.
If is a subset of , then the upper and lower bounds of are the union and intersection, as claimed before. Is is empty, the intersection is undefined, and the greatest lower bound is the greatest element, namely . Assume and ; then the upper and lower bounds of in are the union and intersection, provided that these elements are in .
1129 Lemma intersection_is_inf: forall s E, sub s (powerset E) -> 1130 greatest_lower_bound (inclusion_order E) s 1131 (Yo (nonempty s) (intersection s) E). (* 14 *) 1132 Lemma union_is_sup: forall s E, sub s (powerset E) -> 1133 least_upper_bound (inclusion_order E) s (union s). 1134 1135 Lemma union_is_sup1: forall s F E, sub F (powerset E) -> 1136 sub s F -> inc (union s) F -> 1137 least_upper_bound (inclusion_suborder F) s (union s). 1138 1139 Lemma intersection_is_inf1: forall s F E, sub F (powerset E) -> 1140 sub s F -> inc (Yo (nonempty s) (intersection s) E) F -> 1141 greatest_lower_bound (inclusion_suborder F) s 1142 (Yo (nonempty s) (intersection s) E).
Third example. If is in , the set of partial functions from to , we denote its domain by . If is subset of , it has a least upper bound if and only if for all and in the family, for all we have . Denote this property by . We use an auxiliary result: if , the condition is equivalent to , and is true. Thus, if and are bounded by , is true. Conversely, we know that if is true on there is a function defined on the union of the such that . This is the least upper bound.
1143 Lemma extension_order_pr : forall E F f g x, 1144 related (opposite_order (extension_order E F)) f g -> 1145 inc x (P (Q f)) -> W x (inv_corr_value f) = W x (inv_corr_value g). 1146 Lemma sup_extension_order1: forall E F T f, 1147 sub T (set_of_sub_functions E F) -> 1148 least_upper_bound (opposite_order (extension_order E F)) T f -> 1149 forall u v x, inc u T -> inc v T -> inc x (P (Q u)) -> inc x (P (Q v)) -> 1150 W x (inv_corr_value u) = W x (inv_corr_value v). 1151 Lemma sup_extension_order2: forall E F T, 1152 sub T (set_of_sub_functions E F) -> 1153 (forall u v x, inc u T -> inc v T -> inc x (P (Q u)) -> inc x (P (Q v)) -> 1154 W x (inv_corr_value u) = W x (inv_corr_value v)) -> 1155 exists x, least_upper_bound (opposite_order (extension_order E F)) T x & 1156 (P (Q x) = unionf T (fun u => (P (Q u)))) & 1157 (range (P x) = unionf T (fun u => (range (P u))))& 1158 (P x) = unionf T (fun u => (P u)). (* 28 *)
If is a function with source and if its target is an ordered set, the supremum of the image is denoted by . The infimum is denoted by . For typographical reasons, for in-text formulas, the notations , are preferred. If is the identity function, one can write or . We give a characterization of the sup and inf of a function.
1159 Definition is_sup_fun r f x := least_upper_bound r (image_of_fun f) x. 1160 Definition is_inf_fun r f x := greatest_lower_bound r (image_of_fun f) x. 1161 1162 Lemma is_sup_fun_pr: forall r f x, order r -> substrate r = target f -> 1163 is_function f -> 1164 is_sup_fun r f x = (inc x (target f) 1165 & (forall a, inc a (source f) -> gle r (W a f) x) 1166 & forall z, inc z (target f) -> (forall a, inc a (source f) 1167 -> gle r (W a f) z) -> gle r x z). 1168 Lemma is_inf_fun_pr: forall r f x, order r -> substrate r = target f -> 1169 is_function f -> 1170 is_inf_fun r f x = (inc x (target f) 1171 & (forall a, inc a (source f) -> gle r x (W a f)) 1172 & forall z, inc z (target f) -> (forall a, inc a (source f) 1173 -> gle r z (W a f)) -> gle r z x).
In general, we consider a family rather than a function (i.e., a functional graph instead of a function).
1174 Definition is_sup_graph r f x := least_upper_bound r (range f) x. 1175 Definition is_inf_graph r f x := greatest_lower_bound r (range f) x. 1176 Definition has_sup_graph r f := has_supremum r (range f). 1177 Definition has_inf_graph r f := has_infimum r (range f). 1178 Definition sup_graph r f := supremum r (range f). 1179 Definition inf_graph r f := infimum r (range f).
Here are the characteristic properties.
1180 Lemma is_sup_graph_pr1: forall r f, 1181 order r -> sub (range f) (substrate r) -> has_sup_graph r f -> 1182 least_upper_bound r (range f) (sup_graph r f). 1183 Lemma is_inf_graph_pr1: forall r f, 1184 order r -> sub (range f) (substrate r) -> has_inf_graph r f -> 1185 greatest_lower_bound r (range f) (inf_graph r f). 1186 1187 Lemma is_sup_graph_pr: forall r f x, order r -> sub (range f) (substrate r) -> 1188 fgraph f -> 1189 is_sup_graph r f x = (inc x (substrate r) 1190 & (forall a, inc a (domain f) -> gle r (V a f) x) 1191 & forall z, inc z (substrate r) -> (forall a, inc a (domain f) 1192 -> gle r (V a f) z) -> gle r x z). 1193 Lemma is_inf_graph_pr: forall r f x, order r -> sub (range f) (substrate r) -> 1194 fgraph f -> 1195 is_inf_graph r f x = (inc x (substrate r) 1196 & (forall a, inc a (domain f) -> gle r x (V a f)) 1197 & forall z, inc z (substrate r) -> (forall a, inc a (domain f) 1198 -> gle r z (V a f)) -> gle r z x).
Assume that is a set that has an infimum and a supremum. If is empty, we know that these elements are the least and greatest elements; otherwise, if we have , hence . This is Proposition 4 [2, p. 142].
1199 Theorem compare_inf_sup1: forall r A, order r -> sub A (substrate r) -> 1200 has_supremum r A -> has_infimum r A -> 1201 A = emptyset -> 1202 (greatest_element r (infimum r A) & least_element r (supremum r A)). 1203 Theorem compare_inf_sup2: forall r A, order r -> sub A (ssetubstrate r) -> 1204 has_supremum r A -> has_infimum r A -> 1205 nonempty A -> gle r (infimum r A) (supremum r A).
Proposition 5 [2, p. 142] says that is increasing and is decreasing (as a function from into , where is ordered by inclusion). Of course, these are only partial functions. As a corollary, consider a family and ; we have if both quantities are defined. Note that the first term is the supremum of the restriction of the family to .
1206 Theorem sup_increasing: forall r A B, order r -> sub A (substrate r) -> 1207 sub B (substrate r) -> sub A B -> 1208 has_supremum r A -> has_supremum r B -> 1209 gle r (supremum r A) (supremum r B). 1210 Theorem inf_decreasing: forall r A B, order r -> sub A (substrate r) -> 1211 sub B (substrate r) -> sub A B -> 1212 has_infimum r A -> has_infimum r B -> 1213 gge r (infimum r A) (infimum r B). 1214 Lemma sup_increasing1: forall r f j, 1215 order r -> fgraph f -> sub (range f) (substrate r) -> sub j (domain f) -> 1216 has_sup_graph r f -> has_sup_graph r (restr f j) -> 1217 gle r (sup_graph r (restr f j)) (sup_graph r f). 1218 Lemma inf_decreasing1: forall r f j, 1219 order r -> fgraph f -> sub (range f) (substrate r) -> sub j (domain f) -> 1220 has_inf_graph r f -> has_inf_graph r (restr f j) -> 1221 gge r (inf_graph r (restr f j)) (inf_graph r f).
Proposition 6 [2, p. 143] says that if and are two functions of type , if for all then , provided that both quantities are defined. In fact, it is stated as: if for all we have , then , and .
1222 Lemma sup_increasing2: forall r f f', 1223 order r -> fgraph f -> fgraph f' -> domain f = domain f' -> 1224 sub (range f) (substrate r) -> sub (range f') (substrate r) -> 1225 has_sup_graph r f -> has_sup_graph r f' -> 1226 (forall x , inc x (domain f) -> gle r (V x f) (V x f')) -> 1227 gle r (sup_graph r f) (sup_graph r f'). 1228 Lemma inf_increasing2: forall r f f', 1229 order r -> fgraph f -> fgraph f' -> domain f = domain f' -> 1230 sub (range f) (substrate r) -> sub (range f') (substrate r) -> 1231 has_inf_graph r f -> has_inf_graph r f' -> 1232 (forall x , inc x (domain f) -> gle r (V x f) (V x f')) -> 1233 gle r (inf_graph r f) (inf_graph r f').
Proposition 7 [2, p. 143] is the following. Consider a family , and let be a covering of . The family is the restriction of to ; we assume that it has a supremum , and we consider the family . This family has a supremum if and only if has one, and the values are the same; the second equality in (1) is true under similar conditions.
The first lemma here says that if is a least upper bound for one family, it is also the least upper bound for the other one. Finally, since the supremum is a least upper bound, we get the result by uniqueness.
1234 Lemma sup_distributive: forall r f c x, (* 45 *) 1235 order r -> fgraph f -> sub (range f) (substrate r) -> 1236 covering c (domain f) -> 1237 (forall l, inc l (domain c) -> has_sup_graph r (restr f (V l c))) -> 1238 is_sup_graph r f x = 1239 is_sup_graph r (L (domain c) (fun l => sup_graph r (restr f (V l c)))) x. 1240 Lemma inf_distributive: forall r f c x, (* 44 *) 1241 order r -> fgraph f -> sub (range f) (substrate r) -> 1242 covering c (domain f) -> 1243 (forall l, inc l (domain c) -> has_inf_graph r (restr f (V l c))) -> 1244 is_inf_graph r f x = 1245 is_inf_graph r (L (domain c) (fun l => inf_graph r (restr f (V l c)))) x. 1246 Lemma sup_distributive1: forall r f c, 1247 order r -> fgraph f -> sub (range f) (substrate r) -> 1248 covering c (domain f) -> 1249 (forall l, inc l (domain c) -> has_sup_graph r (restr f (V l c))) -> 1250 has_sup_graph r f = 1251 has_sup_graph r (L (domain c) (fun l => sup_graph r (restr f (V l c)))) . 1252 Lemma inf_distributive1: forall r f c, 1253 order r -> fgraph f -> sub (range f) (substrate r) -> 1254 covering c (domain f) -> 1255 (forall l, inc l (domain c) -> has_inf_graph r (restr f (V l c))) -> 1256 has_inf_graph r f = 1257 has_inf_graph r (L (domain c) (fun l => inf_graph r (restr f (V l c)))) . 1258 1259 Theorem sup_distributive2: forall r f c, (* 19 *) 1260 order r -> fgraph f -> sub (range f) (substrate r) -> 1261 covering c (domain f) -> 1262 (forall l, inc l (domain c) -> has_sup_graph r (restr f (V l c))) -> 1263 ((has_sup_graph r f = 1264 has_sup_graph r (L (domain c) (fun l => sup_graph r (restr f (V l c))))) & 1265 (has_sup_graph r f -> sup_graph r f = 1266 sup_graph r (L (domain c) (fun l => sup_graph r (restr f (V l c)))))). 1267 1268 Theorem inf_distributive2: forall r f c, (* 19 *) 1269 order r -> fgraph f -> sub (range f) (substrate r) -> 1270 covering c (domain f) -> 1271 (forall l, inc l (domain c) -> has_inf_graph r (restr f (V l c))) -> 1272 ((has_inf_graph r f = 1273 has_inf_graph r (L (domain c) (fun l => inf_graph r (restr f (V l c))))) & 1274 (has_inf_graph r f -> inf_graph r f = 1275 inf_graph r (L (domain c) (fun l => inf_graph r (restr f (V l c)))))).
¶ Corollary. Let be a double family of elements of an ordered set such that for each the family has a least upper bound in . This family is the restriction of the double family to . For the double family to have a least upper bound in it is necessary and sufficient that has a least upper bound, and the bounds are the same. The second equality in (2) holds under similar conditions.
1276 1277 Definition partial_fun f x m := restr f (product x (singleton m)). 1278 1279 Lemma sup_distributive3: forall r f x y, 1280 order r -> fgraph f -> sub (range f) (substrate r) -> 1281 domain f = product x y -> 1282 (forall m, inc m y -> has_sup_graph r (partial_fun f x m)) -> 1283 ((has_sup_graph r f = 1284 has_sup_graph r (L y (fun m => sup_graph r (partial_fun f x m)))) & 1285 (has_sup_graph r f -> sup_graph r f = 1286 sup_graph r (L y (fun m => sup_graph r (partial_fun f x m))))). 1287 Lemma inf_distributive3: forall r f x y, 1288 order r -> fgraph f -> sub (range f) (substrate r) -> 1289 domain f = product x y -> 1290 (forall m, inc m y -> has_inf_graph r (partial_fun f x m)) -> 1291 ((has_inf_graph r f = 1292 has_inf_graph r (L y (fun m => inf_graph r (partial_fun f x m)))) & 1293 (has_inf_graph r f -> inf_graph r f = 1294 inf_graph r (L y (fun m => inf_graph r (partial_fun f x m))))).
Proposition 8 [2, p. 144] says that if we have a family of ordered sets , a subset of , and if , then has a least upper bound of the form if and only if each has one, and there is equality; a similar property holds for the greatest lower bound.
1295 Theorem sup_in_product: forall f g A, (* 60 *) 1296 let Ai:= fun i => (image_by_fun (pr_i f i) A) in 1297 let has_sup := 1298 forall i, inc i (domain f) -> has_supremum (V i g) (Ai i) in 1299 axioms_product_order f g -> sub A (productb f) -> 1300 ((has_sup = has_supremum (product_order f g) A) & 1301 (has_sup -> supremum (product_order f g) A = 1302 L (domain f) (fun i => supremum(V i g) (Ai i)))). 1303 Theorem inf_in_product: forall f g A, (* 60 *) 1304 let Ai:= fun i => (image_by_fun (pr_i f i) A) in 1305 let has_inf := 1306 forall i, inc i (domain f) -> has_infimum (V i g) (Ai i) in 1307 axioms_product_order f g -> sub A (productb f) -> 1308 ((has_inf = has_infimum (product_order f g) A) & 1309 (has_inf -> infimum (product_order f g) A = 1310 L (domain f) (fun i => infimum(V i g) (Ai i)))).
Proposition 9 [2, p. 144] assumes that is an ordered set, is a subset of and is a subset of . It can happen that one of and exists, but not the other; they may be unequal. If the objects exist we have
If exists and is in , it is .
1311 Theorem sup_induced1: forall r A F, order r -> sub F (substrate r) -> sub A F -> 1312 has_supremum r A -> has_supremum (induced_order r F) A -> 1313 gle r (supremum r A) (supremum (induced_order r F) A). 1314 Theorem inf_induced1: forall r A F, order r -> sub F (substrate r) -> sub A F -> 1315 has_infimum r A -> has_infimum (induced_order r F) A -> 1316 gge r (infimum r A) (infimum (induced_order r F) A). 1317 Theorem sup_induced2: forall r A F, order r -> sub F (substrate r) -> sub A F -> 1318 has_supremum r A -> inc (supremum r A) F -> 1319 (has_supremum (induced_order r F) A & 1320 supremum r A = supremum (induced_order r F) A). 1321 Theorem inf_induced2: forall r A F, order r -> sub F (substrate r) -> sub A F -> 1322 has_infimum r A -> inc (infimum r A) F -> 1323 (has_infimum (induced_order r F) A & 1324 infimum r A = infimum (induced_order r F) A).
An ordered set is said left or right directed if every doubleton is bounded (above or below).
1325 Definition right_directed r := 1326 order r & forall x, forall y, inc x (substrate r) -> inc y (substrate r) -> 1327 bounded_above r (doubleton x y). 1328 Definition left_directed r := 1329 order r & forall x, forall y, inc x (substrate r) -> inc y (substrate r) -> 1330 bounded_below r (doubleton x y).
We rewrite the definition as: for all and there is a such that and . A set that has a greatest element is right directed. A product of directed sets is directed. A cofinal set of a directed set is directed for the induced order.
1331 Lemma right_directed_pr: forall r, 1332 right_directed r = (order r & 1333 forall x, forall y, inc x (substrate r) -> inc y (substrate r) -> exists z, 1334 inc z (substrate r) & gle r x z & gle r y z). 1335 Lemma left_directed_pr: forall r, 1336 left_directed r = (order r & 1337 forall x, forall y, inc x (substrate r) -> inc y (substrate r) -> exists z, 1338 inc z (substrate r) & gle r z x & gle r z y). 1339 1340 Lemma greatest_right_directed : forall r, order r -> 1341 (exists a, greatest_element r a ) -> right_directed r . 1342 Lemma least_left_directed : forall r, order r -> 1343 (exists a, least_element r a ) -> left_directed r. 1344 Lemma opposite_right_directed : forall r, is_graph r -> 1345 right_directed r = left_directed(opposite_order r). 1346 Lemma opposite_left_directed : forall r, is_graph r -> 1347 left_directed r = right_directed(opposite_order r). 1348 Lemma product_right_directed: forall f g, (* 14 *) 1349 axioms_product_order f g -> 1350 (forall i, inc i (domain f) -> right_directed (V i g)) 1351 -> right_directed (product_order f g). 1352 Lemma product_left_directed: forall f g, (* 14 *) 1353 axioms_product_order f g -> 1354 (forall i, inc i (domain f) -> left_directed (V i g)) 1355 -> left_directed (product_order f g). 1356 Lemma cofinal_right_directed: forall r A, 1357 right_directed r -> cofinal_set r A -> right_directed (induced_order r A). 1358 Lemma coinitial_left_directed: forall r A, 1359 left_directed r -> coinitial_set r A -> left_directed (induced_order r A).
Proposition 10 [2, p. 145] says that in a right directed set, a maximal element is the greatest element.
1360 Theorem right_directed_maximal: forall r x, 1361 right_directed r -> maximal_element r x -> greatest_element r x. 1362 Theorem left_directed_mimimal: forall r x, 1363 left_directed r -> minimal_element r x -> least_element r x.
A lattice is an ordered set on which each pair has a least upper bound and a greatest lower bound.
1364 Definition lattice r := order r & 1365 forall x, forall y, inc x (substrate r) -> inc y (substrate r) -> 1366 (has_supremum r (doubleton x y) & has_infimum r (doubleton x y)). 1367 1368 Lemma lattice_sup_pr: forall r a b, 1369 lattice r -> inc a (substrate r) -> inc b (substrate r) -> 1370 (gle r a (sup r a b) & gle r b (sup r a b) & 1371 forall z, gle r a -> gle r b z -> gle r (sup r a b) z). 1372 Lemma lattice_inf_pr: forall r a b, 1373 lattice r -> inc a (substrate r) -> inc b (substrate r) -> 1374 (gle r (inf r a b) a & gle r (inf r a b) b& 1375 forall z, gle r z a -> gle r z b -> gle r z (inf r a b)).
The powerset is a lattice. In fact each set has a supremum and an infimum.
1376 Lemma inf_inclusion: forall A x y, sub x A -> sub y A -> 1377 greatest_lower_bound (inclusion_order A) (doubleton x y) (intersection2 x y). 1378 Lemma sup_inclusion: forall A x y, sub x A -> sub y A -> 1379 least_upper_bound (inclusion_order A) (doubleton x y) (union2 x y). 1380 Lemma powerset_lattice: forall A, lattice (inclusion_order A).
The product of lattices is a lattice. This is an easy consequence of Proposition 8, and the fact that is a doubleton if is a doubleton. A lattice is a directed set.
1381 Lemma product_lattice: forall f g, 1382 axioms_product_order f g -> 1383 (forall i, inc i (domain f) -> lattice (V i g)) 1384 -> lattice (product_order f g). (* 29 *) 1385 Lemma lattice_directed: forall r, 1386 lattice r -> (right_directed r & left_directed r).
Other examples. The set of integers, with the order “ divides ” is a lattice. The set of subgroups of a group (ordered by inclusion) is a lattice. The set of topologies on a set is a lattice. The set of real functions on an interval is a lattice. The opposite of a lattice is a lattice.
1387 Lemma lattice_inverse: forall r, lattice r -> lattice (opposite_order r).
Two elements of a preordered set are said comparable if the relation “ or ” is true. A set is said to be totally ordered if is is ordered and if any two elements of are comparable.
1388 Definition total_order r := 1389 order r & forall x y, inc x (substrate r) -> inc y (substrate r) -> 1390 (gle r x y \/ gge r x y).
An order satisfies and . It is total if moreover . We have or or . We have or . A subset of a totally ordered set is totally ordered. A small set is totally ordered. The opposite of a totally ordered set is totally ordered.
1391 Lemma total_order_pr: forall r, 1392 total_order r = 1393 (compose_graph r r = r & 1394 intersection2 r (opposite_order r) = diagonal (substrate r)& 1395 union2 r (opposite_order r) = coarse (substrate r)). 1396 Lemma total_order_pr1 : forall r x y, 1397 total_order r -> inc x (substrate r) -> inc y (substrate r) -> 1398 (glt r x y \/ ggt r x y \/ x = y). 1399 Lemma total_order_pr2 : forall r x y, 1400 total_order r -> inc x (substrate r) -> inc y (substrate r) -> 1401 (glt r x y \/ gle r y x). 1402 1403 Lemma total_order_sub : forall r x, 1404 total_order r -> sub x (substrate r) -> total_order (induced_order r x). 1405 Lemma total_order_conterexample: 1406 ~ (total_order (inclusion_order two_points)). 1407 Lemma total_order_opposite: forall r, 1408 total_order r -> total_order (opposite_order r).
If , then and , hence a totally ordered set is a lattice.
1409 Lemma sup_comparable: forall r x y, gle r x y -> 1410 order r -> least_upper_bound r (doubleton x y) y. 1411 Lemma inf_comparable: forall r x y, gle r x y -> 1412 order r -> greatest_lower_bound r (doubleton x y) x. 1413 Lemma sup_comparable1: forall r x y, order r -> gle r x y -> sup r x y = y. 1414 Lemma inf_comparable1: forall r x y, order r -> gle r x y -> inf r x y = x. 1415 Lemma total_order_lattice: forall r, total_order r -> lattice r. 1416 Lemma total_order_directed: forall r, 1417 total_order r -> (right_directed r & left_directed r).
Proposition 11 [2, p. 147] says that if is strictly monotone and the ordering on the source is total, then is injective. If is strictly increasing, it is a morphism (an isomorphism onto the image). We first show that if is strictly increasing, then it is increasing.
1418 Lemma increasing_fun_from_strict: forall f r r', 1419 strict_increasing_fun f r r' -> increasing_fun f r r'. 1420 Lemma decreasing_fun_from_strict: forall f r r', 1421 strict_decreasing_fun f r r' -> decreasing_fun f r r'. 1422 Theorem total_order_monotone_injective: forall f r r', 1423 total_order r -> strict_monotone_fun f r r' -> injective f. 1424 Theorem total_order_increasing_morphism: forall f r r', 1425 total_order r -> strict_increasing_fun f r r' -> order_morphism f r r'.
Proposition 12 [2, p. 147] says that in a totally ordered set , an element is the least upper bound of a subset if and only if it is an upper bound and, for all , there is a such that and .
1426 Theorem sup_in_total_order:forall r X x, total_order r -> sub X (substrate r)-> 1427 least_upper_bound r X x = (upper_bound r X x & 1428 (forall y, glt r y x -> exists z, inc z X & glt r y z & gle r z x)). 1429 Theorem inf_in_total_order:forall r X x, total_order r -> sub X (substrate r)-> 1430 greatest_lower_bound r X x = (lower_bound r X x & 1431 (forall y, glt r x y -> exists z, inc z X & glt r z y & gle r x z)).
There are many definitions of an interval. The set of all such that is called the closed interval and denoted ; the set of all such that is called the open interval and denoted ; intervals can be semi open. One can drop one of the conditions, for instance the set of all such that is denoted by , this is an unbounded interval.
The letters o, c, u stand for open, close, and unbounded.
1432 Definition interval_oo r a b := Zo(substrate r)(fun z => glt r a z & glt r z b). 1433 Definition interval_oc r a b := Zo(substrate r)(fun z => glt r a z & gle r z b). 1434 Definition interval_ou r a := Zo (substrate r) (fun z => glt r a z). 1435 Definition interval_co r a b := Zo(substrate r)(fun z => gle r a z & glt r z b). 1436 Definition interval_cc r a b := Zo(substrate r)(fun z => gle r a z & gle r z b). 1437 Definition interval_cu r a := Zo (substrate r) (fun z => gle r a z). 1438 Definition interval_uo r b := Zo (substrate r) (fun z => glt r z b). 1439 Definition interval_uc r b := Zo (substrate r) (fun z => gle r z b). 1440 Definition interval_uu r := Zo (substrate r) (fun z => True).
1441 Definition is_closed_interval r x := exists a, exists b, 1442 inc a (substrate r) & inc b (substrate r) & gle r a b & x = interval_cc r a b. 1443 Definition is_open_interval r x := exists a, exists b, 1444 inc a (substrate r) & inc b (substrate r) & gle r a b & x = interval_oo r a b. 1445 Definition is_semi_open_interval r x := exists a, exists b, 1446 inc a (substrate r) & inc b (substrate r) & gle r a b & 1447 (x = interval_oc r a b \/ x = interval_co r a b). 1448 Definition is_bounded_interval r x := is_closed_interval r x \/ 1449 is_open_interval r x \/ is_semi_open_interval r x. 1450 Definition is_left_unbounded_interval r x := 1451 exists b, inc b (substrate r) & (x = interval_uc r b \/ x = interval_uo r b). 1452 Definition is_right_unbounded_interval r x := 1453 exists a, inc a (substrate r) & (x = interval_cu r a \/ x = interval_ou r a). 1454 Definition is_unbounded_interval r x := 1455 is_left_unbounded_interval r x \/ is_right_unbounded_interval r x \/ 1456 x = interval_uu r. 1457 Definition is_interval r x := 1458 is_bounded_interval r x \/ is_unbounded_interval r x.
A non-empty interval has a least and greatest elements, which are and respectively.
1459 Lemma the_least_interval: forall r a b, order r -> 1460 gle r a b -> the_least_element (induced_order r (interval_cc r a b)) = a. 1461 Lemma the_greatest_interval: forall r a b, order r -> 1462 gle r a b -> the_greatest_element (induced_order r (interval_cc r a b)) = b.
A closed interval is never empty; however , and are empty.
1463 Lemma nonempty_closed_interval: forall r x, 1464 order r -> is_closed_interval r x -> nonempty x. 1465 Lemma singleton_interval: forall r a, 1466 order r -> inc a (substrate r) -> is_singleton (interval_cc r a a). 1467 Lemma empty_interval: forall r a, 1468 order r -> inc a (substrate r) -> 1469 (empty (interval_co r a a) & empty (interval_oc r a a)& 1470 empty (interval_oo r a a)).
The only non trivial result here is Proposition 13 [2, p. 148] that says that, in a lattice, the intersection of two intervals is an interval. We start with a short proof.
Let´s say that an interval is of type L if it is left unbounded, of type R if it is right unbounded (the interval is of both types, and for any interval ). Obviously, each interval is the intersection of two intervals of type L and R (if the interval is unbounded, consider intersection with ). The intersection of two intervals is thus of the form . This is of the form .
1471 Definition is_lu_interval r x := 1472 x = interval_uu r \/ is_left_unbounded_interval r x. 1473 Definition is_ru_interval r x := 1474 x= interval_uu r \/ is_right_unbounded_interval r x. 1475 Lemma intersection4: forall A B C D, 1476 intersection2 (intersection2 A B) (intersection2 C D) 1477 = intersection2 (intersection2 A C) (intersection2 B D). 1478 Lemma intersection_i1: forall r x, 1479 is_interval r x -> intersection2 x (interval_uu r) = x. (* 13 *) 1480 Lemma intersection_i2: forall r x, 1481 is_interval r x -> 1482 (exists u, exists v, is_lu_interval r u & is_ru_interval r v & 1483 intersection2 u v = x). (* 17 *) 1484 Lemma intersection_i3: forall r x y, lattice r -> 1485 is_left_unbounded_interval r x -> is_left_unbounded_interval r y -> 1486 is_left_unbounded_interval r (intersection2 x y). (* 18 *) 1487 Theorem intersection_interval: forall r x y, 1488 lattice r -> is_interval r x -> is_interval r y -> 1489 is_interval r (intersection2 x y). (* 47 *)
The total size of the proof of the theorem is 150 lines, including the tactics designed for this theorem. Originally, its size was 841 lines, reduced to 615 by using adequate tactics. Details can be foun in section 1.5.