Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) (* <O___,, * (see CREDITS file for the list of authors) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************) (****************************************************************************) (* *) (* Naive Set Theory in Coq *) (* *) (* INRIA INRIA *) (* Rocquencourt Sophia-Antipolis *) (* *) (* Coq V6.1 *) (* *) (* Gilles Kahn *) (* Gerard Huet *) (* *) (* *) (* *) (* Acknowledgments: This work was started in July 1993 by F. Prost. Thanks *) (* to the Newton Institute for providing an exceptional work environment *) (* in Summer 1995. Several developments by E. Ledinot were an inspiration. *) (****************************************************************************) Require Export Relations_1. Definition Complement (U:Type) (R:Relation U) : Relation U := fun x y:U => ~ R x y.forall (U : Type) (R : Relation U), Symmetric U R -> Symmetric U (Complement U R)forall (U : Type) (R : Relation U), Symmetric U R -> Symmetric U (Complement U R)intros U R H' x y H'0; red; intro H'1; apply H'0; auto with sets. Qed.forall (U : Type) (R : Relation U), (forall x y : U, R x y -> R y x) -> forall x y : U, ~ R x y -> ~ R y xforall (U : Type) (R : Relation U), Preorder U R -> Equivalence U (fun x y : U => R x y /\ R y x)forall (U : Type) (R : Relation U), Preorder U R -> Equivalence U (fun x y : U => R x y /\ R y x)U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:Transitive U REquivalence U (fun x y : U => R x y /\ R y x)U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:Transitive U RReflexive U (fun x y : U => R x y /\ R y x)U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:Transitive U RTransitive U (fun x y : U => R x y /\ R y x)U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:Transitive U RSymmetric U (fun x y : U => R x y /\ R y x)red in H'0; auto 10 with sets.U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:Transitive U RReflexive U (fun x y : U => R x y /\ R y x)U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:Transitive U RTransitive U (fun x y : U => R x y /\ R y x)U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:forall x y z : U, R x y -> R y z -> R x zforall x y z : U, R x y /\ R y x -> R y z /\ R z y -> R x z /\ R z xU:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:forall x0 y0 z0 : U, R x0 y0 -> R y0 z0 -> R x0 z0x, y, z:UH'3:R x yH'4:R y xR y z /\ R z y -> R x z /\ R z xsplit; apply H'1 with y; auto 10 with sets.U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:forall x0 y0 z0 : U, R x0 y0 -> R y0 z0 -> R x0 z0x, y, z:UH'3:R x yH'4:R y xH'5:R y zH'6:R z yR x z /\ R z xred; intros x y h; elim h; intros H'3 H'4; auto 10 with sets. Qed. Hint Resolve Equiv_from_preorder : core.U:TypeR:Relation UH':Preorder U RH'0:Reflexive U RH'1:Transitive U RSymmetric U (fun x y : U => R x y /\ R y x)forall (U : Type) (R : Relation U), Order U R -> Equivalence U (fun x y : U => R x y /\ R y x)intros U R H'; elim H'; auto 10 with sets. Qed. Hint Resolve Equiv_from_order : core.forall (U : Type) (R : Relation U), Order U R -> Equivalence U (fun x y : U => R x y /\ R y x)forall U : Type, Preorder (Relation U) (contains U)auto 10 with sets. Qed. Hint Resolve contains_is_preorder : core.forall U : Type, Preorder (Relation U) (contains U)forall U : Type, Equivalence (Relation U) (same_relation U)unfold same_relation at 1; auto 10 with sets. Qed. Hint Resolve same_relation_is_equivalence : core.forall U : Type, Equivalence (Relation U) (same_relation U)forall (U : Type) (R R' : Relation U), same_relation U R R' -> Reflexive U R -> Reflexive U R'unfold same_relation; intuition. Qed.forall (U : Type) (R R' : Relation U), same_relation U R R' -> Reflexive U R -> Reflexive U R'forall (U : Type) (R R' : Relation U), same_relation U R R' -> Symmetric U R -> Symmetric U R'compute; intros; elim H; intros; clear H; apply (H3 y x (H0 x y (H2 x y H1))). (*Intuition.*) Qed.forall (U : Type) (R R' : Relation U), same_relation U R R' -> Symmetric U R -> Symmetric U R'forall (U : Type) (R R' : Relation U), same_relation U R R' -> Antisymmetric U R -> Antisymmetric U R'compute; intros; elim H; intros; clear H; apply (H0 x y (H3 x y H1) (H3 y x H2)). (*Intuition.*) Qed.forall (U : Type) (R R' : Relation U), same_relation U R R' -> Antisymmetric U R -> Antisymmetric U R'forall (U : Type) (R R' : Relation U), same_relation U R R' -> Transitive U R -> Transitive U R'forall (U : Type) (R R' : Relation U), same_relation U R R' -> Transitive U R -> Transitive U R'U:TypeR, R':Relation UH':same_relation U R R'H'0:Transitive U Rforall x y z : U, R' x y -> R' y z -> R' x zU:TypeR, R':Relation UH':same_relation U R R'H'0:Transitive U Rcontains U R R' -> contains U R' R -> forall x y z : U, R' x y -> R' y z -> R' x zapply H'0 with y; auto with sets. Qed.U:TypeR, R':Relation UH':same_relation U R R'H'0:Transitive U RH'1:contains U R R'H'2:contains U R' Rx, y, z:UH'3:R' x yH'4:R' y zR x z