Skip to content

Commit a84f351

Browse files
committed
deprecate relations; remove usages outside wellfounded, deprecated sorting
1 parent 21595c3 commit a84f351

File tree

5 files changed

+73
-5
lines changed

5 files changed

+73
-5
lines changed

theories/Classes/RelationPairs.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
(** * Relations over pairs *)
1212

1313

14-
From Stdlib Require Import Relations Morphisms.
14+
From Stdlib Require Import Relation_Definitions (relation).
15+
From Stdlib Require Import Morphisms.
1516
(* NB: This should be system-wide someday, but for that we need to
1617
fix the simpl tactic, since "simpl fst" would be refused for
1718
the moment.
Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1-
From Corelib Require Export Relation_Definitions.
1+
From Corelib Require Export RelationClasses.
2+
From Corelib Require Import Relation_Definitions.
3+
4+
Notation relation := relation (only parsing).
5+
6+
#[deprecated(since="9.1", use=Reflexive)]
7+
Notation reflexive := reflexive (only parsing).
8+
#[deprecated(since="9.1", use=Transitive)]
9+
Notation transitive := transitive (only parsing).
10+
#[deprecated(since="9.1", use=Symmetric)]
11+
Notation symmetric := symmetric (only parsing).
12+
#[deprecated(since="9.1", use=Antisymmetric)]
13+
Notation antisymmetric := antisymmetric (only parsing).
14+
#[deprecated(since="9.1", use=Equivalence)]
15+
Notation equiv := equiv (only parsing).
16+
#[deprecated(since="9.1", use=PreOrder)]
17+
Notation preorder := preorder (only parsing).
18+
#[deprecated(since="9.1", use=Build_PreOrder)]
19+
Notation Build_preorder := Build_preorder (only parsing).
20+
#[deprecated(since="9.1", use=PreOrder_Reflexive)]
21+
Notation preord_refl := preord_refl (only parsing).
22+
#[deprecated(since="9.1", use=PreOrder_Transitive)]
23+
Notation preord_trans := preord_trans (only parsing).
24+
#[deprecated(since="9.1", use=PartialOrder)]
25+
Notation order := order (only parsing).
26+
#[deprecated(since="9.1", note="Use RelationClasses.PartialOrder")]
27+
Notation Build_order := Build_order (only parsing).
28+
#[deprecated(since="9.1", use=partial_order_antisym)]
29+
Notation ord_antisym := ord_antisym (only parsing).
30+
#[deprecated(since="9.1", note="Use RelationClasses.PartialOrder")]
31+
Notation ord_refl := ord_refl (only parsing).
32+
#[deprecated(since="9.1", note="Use RelationClasses.PartialOrder")]
33+
Notation ord_trans := ord_trans (only parsing).
34+
#[deprecated(since="9.1", use=Equivalence)]
35+
Notation equivalence := equivalence (only parsing).
36+
#[deprecated(since="9.1", use=Build_Equivalence)]
37+
Notation Build_equivalence := Build_equivalence (only parsing).
38+
#[deprecated(since="9.1", use=Equivalence_Reflexive)]
39+
Notation equiv_refl := equiv_refl (only parsing).
40+
#[deprecated(since="9.1", use=Equivalence_Transitive)]
41+
Notation equiv_trans := equiv_trans (only parsing).
42+
#[deprecated(since="9.1", use=Equivalence_Symmetric)]
43+
Notation equiv_sym := equiv_sym (only parsing).
44+
#[deprecated(since="9.1", use=RelationClasses.PER)]
45+
Notation PER := PER (only parsing).
46+
#[deprecated(since="9.1", use=RelationClasses.Build_PER)]
47+
Notation Build_PER := Build_PER (only parsing).
48+
#[deprecated(since="9.1", use=RelationClasses.PER_Symmetric)]
49+
Notation per_sym := per_sym (only parsing).
50+
#[deprecated(since="9.1", use=RelationClasses.PER_Transitive)]
51+
Notation per_trans := per_trans (only parsing).
52+
#[deprecated(since="9.1", use=subrelation)]
53+
Notation inclusion := inclusion (only parsing).
54+
#[deprecated(since="9.1", use=relation_equivalence)]
55+
Notation same_relation := same_relation (only parsing).
56+
#[deprecated(since="9.1", note="If you would like the standard library to keep this definition, please open an issue")]
57+
Notation commut := commut (only parsing).

theories/Relations/Relations.v

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@
77
(* * GNU Lesser General Public License Version 2.1 *)
88
(* * (see LICENSE file for the text of the license) *)
99
(************************************************************************)
10-
1110
From Stdlib Require Export Relation_Definitions.
1211
From Stdlib Require Export Relation_Operators.
1312
From Stdlib Require Export Operators_Properties.
13+
From Stdlib Require Export RelationClasses.
14+
15+
Lemma Equivalence_on [A B] (f:A -> B) (r:relation B) :
16+
Equivalence r -> Equivalence (fun x y => r (f x) (f y)).
17+
Proof. intros []; split; red; eauto. Qed.
18+
19+
Lemma Equivalence_eq_on [A B] (f:A -> B) : Equivalence (fun x y => f x = f y).
20+
Proof. apply Equivalence_on; exact _. Qed.
1421

22+
#[deprecated(since="9.1", use=Equivalence_on)]
23+
#[warning="-deprecated"]
1524
Lemma inverse_image_of_equivalence :
1625
forall (A B:Type) (f:A -> B) (r:relation B),
1726
equivalence B r -> equivalence A (fun x y:A => r (f x) (f y)).
@@ -20,6 +29,8 @@ Proof.
2029
intros _ equiv_trans _ x y z H0 H1; apply equiv_trans with (f y); assumption.
2130
Qed.
2231

32+
#[deprecated(since="9.1", use=Equivalence_eq_on)]
33+
#[warning="-deprecated"]
2334
Lemma inverse_image_of_eq :
2435
forall (A B:Type) (f:A -> B), equivalence A (fun x y:A => f x = f y).
2536
Proof.

theories/Sorting/Sorted.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
The two notions are equivalent if the order is transitive.
2121
*)
2222

23-
From Stdlib Require Import List Relations Relations_1.
23+
From Stdlib Require Import List Relation_Definitions Relations_1.
2424

2525
(* Set Universe Polymorphism. *)
2626

theories/Structures/Orders.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
(* * (see LICENSE file for the text of the license) *)
99
(************************************************************************)
1010

11-
From Stdlib Require Export Relations Morphisms Setoid Equalities.
11+
From Stdlib Require Export Morphisms Setoid Equalities.
1212
Set Implicit Arguments.
1313
Unset Strict Implicit.
1414

0 commit comments

Comments
 (0)