| 1 |
From Coq Require Import ZArith Lia. |
| 2 |
From Coq Require Import Mergesort Orders. |
| 3 |
|
| 4 |
Module Z. |
| 5 |
Module Order <: TotalLeBool. |
| 6 |
Definition t := Z. |
| 7 |
Definition leb := Z.leb. |
| 8 |
Infix "<=?" := leb. |
| 9 |
Local Coercion is_true : bool >-> Sortclass. |
| 10 |
Theorem leb_total : forall a1 a2, a1 <=? a2 \/ a2 <=? a1. |
| 11 |
Proof. intros x y; destruct (Z.le_ge_cases x y); [ left | right ]; unfold is_true, leb; rewrite Z.leb_le; lia. Qed. |
| 12 |
End Order. |
| 13 |
|
| 14 |
Module Sort := Mergesort.Sort Order. |
| 15 |
|
| 16 |
Notation sort := Sort.sort. |
| 17 |
Notation Sorted_sort := Sort.Sorted_sort. |
| 18 |
Notation LocallySorted_sort := Sort.LocallySorted_sort. |
| 19 |
Notation StronglySorted_sort := Sort.StronglySorted_sort. |
| 20 |
Notation Permuted_sort := Sort.Permuted_sort. |
| 21 |
End Z. |