1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936
|
Version 1.2
===========
The library has been tested using Agda version 2.6.0.1.
Highlights
----------
* New function hierarchy.
* New (homo/mono/iso)morphism infrastructure for algebraic and relational structures.
* Fresh lists.
* First proofs of algebraic properties for operations over ℚ.
* Improved reduction behaviour for all decidability proofs.
Bug-fixes
---------
* The record `RawRing` from `Algebra` now includes an equality relation to
make it consistent with the othor `Raw` bundles.
* In `Relation.Binary`:
- `IsStrictTotalOrder` now exports `isDecStrictPartialOrder`
- `IsDecStrictPartialOrder` now re-exports the contents of `IsStrictPartialOrder`.
* Due to bug #3879 in Agda, the pattern synonyms `0F`, `1F`, ... added to
`Data.Fin.Base` in version 1.1 resulted in unavoidable and undesirable behaviour
when case splitting on `ℕ` when `Data.Fin` has been imported. These pattern
synonyms have therefore been moved to the new module `Data.Fin.Patterns`.
Non-backwards compatible changes
--------------------------------
### Standardisation of record hierarchies
* The modules containing the record hierarchies for algebra, binary relations,
and functions are currently inconsistently structured. For example:
- in the binary relation record hierarchy the module `Relation.Binary`
exports all parts of the hierarchy, e.g. `Reflexive`, `IsPreorder` and
`Preorder`.
- in contrast the algebra record hierarchy `Associative` is exported
from `Algebra.FunctionProperties`, `IsSemigroup` from `Algebra.Structures`
and `Semigroup` from `Algebra`.
- the function hiearchy doesn't have a notion of `Injective` and `IsInjective`
at all, and `Injection` is exported from `Function.Injection`.
* Consequently all hierarchies have been re-organised to follow the
same standard pattern:
```agda
X.Core -- Contains: Rel, Op₂, Fun etc.
X.Definitions -- Contains: Reflexive, Associative, Injective etc.
X.Structures -- Contains: IsEquivalence, IsSemigroup, IsInjection etc.
X.Bundles -- Contains: Setoid, Semigroup, Injection etc.
X -- Publicly re-exports all of the above
```
* In `Relation.Binary` this means:
* New module `Relation.Binary.Bundles`
* New module `Relation.Binary.Definitions`
* Fully backwards compatible.
* In `Algebra` this means:
* `Algebra.FunctionProperties.Core` has been deprecated in favour of `Algebra.Core`.
* `Algebra.FunctionProperties` has been deprecated in favour of `Algebra.Definitions`.
* The contents of `Algebra` has been moved to `Algebra.Bundles`.
* `Algebra` now re-exports the contents of `Algebra.Definitions` and `Algebra.Structures`,
not just that of `Algebra.Bundles`.
* **Compatibility:** Modules which previously imported both `Algebra` and
`Algebra.FunctionProperties` and/or `Algebra.Structures` will need small changes.
- If either of `FunctionProperties` or `Structures` are explicitly parameterised by an
equality relation then import `Algebra.Bundles` instead of `Algebra`.
- Otherwise just remove the `FunctionProperties` and `Structures` imports entirely.
### New function hierarchy
* The problems with the current function hierarchy run deeper problems than the other two:
1. The raw functions are wrapped in the equality-preserving
type `_⟶_` from `Function.Equality`. As the rest of the library
rarely uses such wrapped functions, it is very difficult
to write code that interfaces neatly between the `Function` hierarchy
and, for example, the `Algebra` hierarchy.
2. The hierarchy doesn't follow the same pattern as the other record
hierarchies in the standard library, e.g. `Injective`, `IsInjection`
and `Injection`. Coupled with point 1., anecdotally this means that
people find it difficult to understand and use.
3. There is no way of specifying a function has a specific property
(e.g. injectivity) without specifying all the properties required
of the equality relation as well. This is in contrast to the
`Relation.Binary` and `Algebra` hierarchies where it is perfectly
possible to specify that for example an operation is commutative
without providing all the proofs associated with the equality relation.
4. In many fonts the symbol `_⟶_` used for equality preserving functions
is almost indistinguishable from the symbol for ordinary functions `_→_`,
leading to confusion when reading code.
* To address these problems a new standardised function hierarchy has been
created that follows the same structure found in `Relation.Binary` and `Algebra`.
In particular:
- The `Fun1` and `Fun2` from `Function` have been moved to `Function.Core`.
- The rest of the old contents of `Function` have been moved to `Function.Base`.
- Added a new module `Function.Definitions` containing definitions like
`Injective`, `Surjective` which are parameterised by the equality relations
over the domain and codomain.
- Added a new module `Function.Structures` containing definitions like
`IsInjection`, `IsSurjection`, once again parameterised the equality relations.
- New module `Function.Bundles` containing definitions like `Injection`, `Surjection`
which provide essentially the same top-level interface as currently exists,
i.e. parameterised by setoids but hiding the function.
- The module `Function` now re-exports all of the above.
* For the moment the existing modules containing the old hierarchy still exist,
as not all existing functionality has been reimplemented using the new hierarchy.
However it is expected that they will be deprecated at some point in the future
when contents this transfer is complete.
```agda
Function.Equivalence
Function.Equality
Function.Bijection
Function.Injection
Function.Surjection
Function.LeftInverse
```
* **Compatibility:** As most of changes involve adding new modules, the only problem
that occurs is when importing both `Function` and e.g. `Function.Injection`. In this
case the old and new definitions of `Injection` will clash. In the short term this
can be fixed immediately by importing `Function.Base` instead of `Function`.
However in the longer term it is encouraged to migrate away from `Function.Injection`
and to use the new hierarchy instead.
* Finally the propositional bundle for left inverses in `Function.Bundles` has been
renamed in the new hierarchy from `_↞_` to `_↩_`. This is in order to make room for
the new bundle for right inverse `_↪_`.
#### Harmonizing `List.All` and `Vec` in their role as finite maps.
* The function `updateAt` in `Data.List.Relation.Unary.All` is analogous
to `updateAt` in `Data.Vec.Base` and hence the API for the former has
been refactored to match the latter.
* Added a new "points-to" relation `_[_]=_` in `Data.List.Relation.Unary.All`:
```agda
_[_]=_ : All P xs → x ∈ xs → P x → Set _
```
* In `Data.List.Relation.Unary.All.Properties` the proofs `updateAt-cong`
and `updateAt-updates` are now formulated in terms of the new `_[_]=_`
relation rather than the function `lookup`. The old proofs are available with
minor variations under the names `lookup∘updateAt` and `updateAt-cong-relative`.
#### Other
* Version 1.1 in the library added irrelevance to various places in the library.
Unfortunately this exposed the library to several irrelevance-related bugs.
The decision has therefore been taken to roll-back these additions until
irrelevance is more stable. In particular it has been removed from
`_%_`, `_/_`, `_div_`, `_mod_` in `Data.Nat.DivMod` and from `fromℕ≤`, `inject≤`
in `Data.Fin.Base`.
* The proofs `isPreorder` and `preorder` have been moved from the `Setoid`
record to the module `Relation.Binary.Properties.Setoid`.
* The function `normalize` in `Data.Rational.Base` has been reimplemented
in terms of a direct division of the numerator and denominator by their
GCD. Although less elegant than the previous implementation, it's
reduction behaviour is much easier to reason about.
Re-implementations and deprecations
-------------------------------
### `Data.Bin` → `Data.Nat.Binary`
* The current implementation of binary naturals in Agda has proven hard to work with.
Therefore a new, simpler implementation which avoids using `List` has been added
as `Data.Nat.Binary`.
```agda
Data.Nat.Binary
Data.Nat.Binary.Base
Data.Nat.Binary.Induction
Data.Nat.Binary.Properties
```
* The old modules still exist but have been deprecated and may be removed in
some future release of the library.
```agda
Data.Bin
Data.Bin.Properties
```
### `Data.Table` → `Data.Vec.Functional`
* As well as having a non-standard name, the definition of `Table` in `Data.Table`
has proved very difficult to work with due to the wrapping of the type in a record.
It has therefore been renamed and reimplemented without the record wrapper as the
`Vector` type in the new module `Data.Vec.Functional`,
```agda
Data.Vec.Functional
Data.Vec.Functional.Relation.Binary.Pointwise
Data.Vec.Functional.Relation.Unary.All
Data.Vec.Functional.Relation.Unary.Any
```
* The old modules still exist but have been deprecated and may be removed in
some future release of the library.
```agda
Data.Table
Data.Table.Base
Data.Table.Properties
Data.Table.Relation.Equality
```
### `Data.BoundedVec(.Inefficient)` → `Data.Vec.Bounded`
* `Data.BoundedVec` and `Data.BoundedVec.Inefficient` have been deprecated
in favour of `Data.Vec.Bounded` introduced in version 1.1.
```agda
Data.Vec.Bounded
Data.Vec.Bounded.Base
```
* The old modules still exist but have been deprecated and may be removed in
some future release of the library.
```agda
Data.BoundedVec
Data.BoundedVec.Inefficient
```
Other major additions
---------------------
### `Reflects` idiom for decidability proofs
* A version of the `Reflects` idiom, as seen in SSReflect, has been introduced
in `Relation.Nullary`. Some properties of it have been added in the new module
`Relation.Nullary.Reflects`. The definition is as follows
```agda
data Reflects {p} (P : Set p) : Bool → Set p where
ofʸ : ( p : P) → Reflects P true
ofⁿ : (¬p : ¬ P) → Reflects P false
```
* `Dec` has been redefined in terms of `Reflects`.
```agda
record Dec {p} (P : Set p) : Set p where
constructor _because_
field
does : Bool
proof : Reflects P does
open Dec public
```
which is entirely backwards compatible thanks to the introduction of
the pattern synonyms in `Relation.Nullary`:
```agda
pattern yes p = true because ofʸ p
pattern no ¬p = false because ofⁿ ¬p
```
* These changes mean that decision procedures can be defined so as to provide a
boolean result that is independent of the proof that it is the correct decision.
For example, a proof of decidability of `_≤_` on natural numbers:
```agda
_≤?_ : (m n : ℕ) → Dec (m ≤ n)
zero ≤? n = yes z≤n
suc m ≤? zero = no λ ()
suc m ≤? suc n with m ≤? n
... | yes p = yes (s≤s p)
... | no ¬p = no (¬p ∘ ≤-pred)
```
can now be rewritten as:
```agda
_≤?_ : (m n : ℕ) → Dec (m ≤ n)
zero ≤? n = yes z≤n
suc m ≤? zero = no λ ()
does (suc m ≤? suc n) = does (m ≤? n)
proof (suc m ≤? suc n) with m ≤? n
... | yes p = ofʸ (s≤s p)
... | no ¬p = ofⁿ (¬p ∘ ≤-pred)
```
Notice that projecting the `does` field, returns a function whose reduction
behaviour is identically to what we would expect of a boolean test. This has
significant advantages for both performance and reasoning in situations where
only a decision is required and the proof itself is not needed.
* Functions and lemmas about `Dec` have been rewritten to reflect these changes.
- The lemmas `map′` and `map` in `Relation.Nullary.Decidable` produce their
`does` result without any pattern matching, and `isYes` matches only on the
`does` field, and not the `proof` field. For example this means that
`does (map f X?)` is definitionally equal to `does X?`.
- All of the connective lemmas like `_×-dec_` have a `does`
field written in terms of boolean functions like `_∧_`. As well as being
less strict than the previous definitions, this should improve readability
when only the `does` field is involved.
* The function `⌊_⌋` still exists to be used in conjunction with `toWitness`
and similar (e.g. in proof automation), but doesn't require the immediate
evaluation of the `proof` part.
* The rest of the `Relation.Nullary` subtree has been updated to reflect the
changes to `Dec`.
### Other new modules
* Properties for `Semigroup` and `CommutativeSemigroup`. Contains all the
non-trivial 3 element permutations. Useful for equational reasoning.
```agda
Algebra.Properties.Semigroup
Algebra.Properties.CommutativeSemigroup
```
* A map interface for AVL trees.
```agda
Data.AVL.Map
```
* Level polymorphic versions for the bottom and top types. Useful in
getting rid of the need to use `Lift`.
```agda
Data.Unit.Polymorphic
Data.Unit.Polymorphic.Properties
Data.Empty.Polymorphic
```
* Greatest common divisor and least common multiples for integers:
```agda
Data.Integer.GCD
Data.Integer.LCM
```
* Fresh lists.
```agda
Data.List.Fresh
Data.List.Fresh.Properties
Data.List.Fresh.Relation.Unary.All
Data.List.Fresh.Relation.Unary.All.Properties
Data.List.Fresh.Relation.Unary.Any
Data.List.Fresh.Relation.Unary.Any.Properties
Data.List.Fresh.Membership
Data.List.Fresh.Membership.Properties
```
* Kleene lists. Useful when needing to distinguish between empty and non-empty lists.
```agda
Data.List.Kleene
Data.List.Kleene.AsList
Data.List.Kleene.Base
```
* Predicate over lists in which every neighbouring pair of elements is related.
Useful for implementing paths in graphs.
```agda
Data.List.Relation.Unary.Linked
Data.List.Relation.Unary.Linked.Properties
```
* Disjoint sublists.
```agda
Data.List.Relation.Binary.Sublist.Propositional.Disjoint
```
* Rationals whose numerator and denominator are not necessarily normalised (i.e. coprime).
```
Data.Rational.Unnormalised
Data.Rational.Unnormalised.Properties
```
In this formalisation every number has an infinite number of multiple representations
and that evaluation is inefficient as the top and the bottom will inevitably
blow up. However they are significantly easier to reason about then the existing
normalised implementation in `Data.Rational`. The new monomorphism infrastructure
(see below) is used to transfer proofs from these new unnormalised rationals
to the existing normalised implementation.
* Basic constructions for the new funciton hierarchy.
```agda
Function.Construct.Identity
Function.Construct.Composition
```
* New interfaces for using Haskell datatypes:
```
Foreign.Haskell.Coerce
Foreign.Haskell.Either
```
* Properties of setoids.
```agda
Relation.Binary.Properties.Setoid
```
* Reasoning over partial setoids.
```
Relation.Binary.Reasoning.Base.Partial
Relation.Binary.Reasoning.PartialSetoid
```
* Morphisms between algebraic and relational structures. See
`Data.Rational.Properties` for how these can be used to easily transfer
algebraic properties from unnormalised to normalised rationals.
```agda
Algebra.Morphism.Definitions
Algebra.Morphism.Structures
Algebra.Morphism.MagmaMonomorphism
Algebra.Morphism.MonoidMonomorphism
Relation.Binary.Morphism
Relation.Binary.Morphism.Definitions
Relation.Binary.Morphism.Structures
Relation.Binary.Morphism.RelMonomorphism
Relation.Binary.Morphism.OrderMonomorphism
```
Deprecated names
----------------
The following deprecations have occurred as part of a drive to improve
consistency across the library. The deprecated names still exist and
therefore all existing code should still work, however use of the new names
is encouraged. Although not anticipated any time soon, they may eventually
be removed in some future release of the library. Automated warnings are
attached to all deprecated names to discourage their use.
* In `Data.Fin`:
```agda
fromℕ≤ ↦ fromℕ<
fromℕ≤″ ↦ fromℕ<″
```
* In `Data.Fin.Properties`
```agda
fromℕ≤-toℕ ↦ fromℕ<-toℕ
toℕ-fromℕ≤ ↦ toℕ-fromℕ<
fromℕ≤≡fromℕ≤″ ↦ fromℕ<≡fromℕ<″
toℕ-fromℕ≤″ ↦ toℕ-fromℕ<″
isDecEquivalence ↦ ≡-isDecEquivalence
preorder ↦ ≡-preorder
setoid ↦ ≡-setoid
decSetoid ↦ ≡-decSetoid
```
* In `Data.Integer.Properties`:
```agda
[1+m]*n≡n+m*n ↦ suc-*
```
* In `Data.Nat.Coprimality`:
```agda
coprime-gcd ↦ coprime⇒GCD≡1
gcd-coprime ↦ GCD≡1⇒coprime
```
* In `Data.Nat.Properties`:
```agda
+-*-suc ↦ *-suc
n∸m≤n ↦ m∸n≤m
```
(Note that the latter will require the arguments to be reversed)
* In `Data.Unit` the definition `_≤_` is unnecessary as it is isomorphic to `_≡_`
and has therefore been deprecated.
* In `Data.Unit.Properties` the associated proofs have therefore been renamed as follows:
```agda
≤-total ↦ ≡-total
_≤?_ ↦ _≟_
≤-isPreorder ↦ ≡-isPreorder
≤-isPartialOrder ↦ ≡-isPartialOrder
≤-isTotalOrder ↦ ≡-isTotalOrder
≤-isDecTotalOrder ↦ ≡-isDecTotalOrder
≤-poset ↦ ≡-poset
≤-decTotalOrder ↦ ≡-decTotalOrder
```
* In `Relation.Binary.Properties.Poset`:
```agda
invIsPartialOrder ↦ ≥-isPartialOrder
invPoset ↦ ≥-poset
strictPartialOrder ↦ <-strictPartialOrder
```
* In `Relation.Binary.Properties.DecTotalOrder`:
```agda
strictTotalOrder ↦ <-strictTotalOrder
```
Other minor additions
---------------------
* Added new definition to `Algebra.Bundles`:
```agda
record CommutativeSemigroup c ℓ : Set (suc (c ⊔ ℓ))
```
* Added new definition to `Algebra.Structures`:
```agda
record IsCommutativeSemigroup (∙ : Op₂ A) : Set (a ⊔ ℓ)
```
* The function `tail` in `Codata.Stream` has a new, more general type:
```agda
tail : ∀ {i} {j : Size< i} → Stream A i → Stream A j
```
* Added new proofs to `Data.Char.Properties`:
```agda
<-isStrictPartialOrder-≈ : IsStrictPartialOrder _≈_ _<_
<-isStrictTotalOrder-≈ : IsStrictTotalOrder _≈_ _<_
<-strictPartialOrder-≈ : StrictPartialOrder 0ℓ 0ℓ 0ℓ
```
* Added new proofs to `Data.Fin.Properties`:
```agda
∀-cons-⇔ : (P zero × Π[ P ∘ suc ]) ⇔ Π[ P ]
∃-here : P zero → ∃⟨ P ⟩
∃-there : ∃⟨ P ∘ suc ⟩ → ∃⟨ P ⟩
∃-toSum : ∃⟨ P ⟩ → P zero ⊎ ∃⟨ P ∘ suc ⟩
⊎⇔∃ : (P zero ⊎ ∃⟨ P ∘ suc ⟩) ⇔ ∃⟨ P ⟩
```
* Added new proofs to `Data.Fin.Subset.Properties`:
```agda
out⊆ : p ⊆ q → outside ∷ p ⊆ y ∷ q
out⊆-⇔ : p ⊆ q ⇔ outside ∷ p ⊆ y ∷ q
in⊆in : p ⊆ q → inside ∷ p ⊆ inside ∷ q
in⊆in-⇔ : p ⊆ q ⇔ inside ∷ p ⊆ inside ∷ q
∃-Subset-zero : ∃⟨ P ⟩ → P []
∃-Subset-[]-⇔ : P [] ⇔ ∃⟨ P ⟩
∃-Subset-suc : ∃⟨ P ⟩ → ∃⟨ P ∘ (inside ∷_) ⟩ ⊎ ∃⟨ P ∘ (outside ∷_) ⟩
∃-Subset-∷-⇔ : (∃⟨ P ∘ (inside ∷_) ⟩ ⊎ ∃⟨ P ∘ (outside ∷_) ⟩) ⇔ ∃⟨ P ⟩
```
* Added new constants to `Data.Integer.Base`:
```agda
-1ℤ = -[1+ 0 ]
0ℤ = +0
1ℤ = +[1+ 0 ]
```
* Added new proofs to `Data.Integer.Properties`:
```agda
*-suc : m * sucℤ n ≡ m + m * n
+-isCommutativeSemigroup : IsCommutativeSemigroup _+_
*-isCommutativeSemigroup : IsCommutativeSemigroup _*_
+-commutativeSemigroup : CommutativeSemigroup 0ℓ 0ℓ
*-commutativeSemigroup : CommutativeSemigroup 0ℓ 0ℓ
```
* Added new function to `Data.List.Base`:
```agda
_ʳ++_ = flip reverseAcc
```
* Added new proofs to `Data.List.Properties`:
```agda
filter-accept : P x → filter P? (x ∷ xs) ≡ x ∷ (filter P? xs)
filter-reject : ¬ P x → filter P? (x ∷ xs) ≡ filter P? xs
filter-idem : filter P? ∘ filter P? ≗ filter P?
filter-++ : filter P? (xs ++ ys) ≡ filter P? xs ++ filter P? ys
ʳ++-defn : xs ʳ++ ys ≡ reverse xs ++ ys
ʳ++-++ : (xs ++ ys) ʳ++ zs ≡ ys ʳ++ xs ʳ++ zs
ʳ++-ʳ++ : (xs ʳ++ ys) ʳ++ zs ≡ ys ʳ++ xs ++ zs
length-ʳ++ : length (xs ʳ++ ys) ≡ length xs + length ys
map-ʳ++ : map f (xs ʳ++ ys) ≡ map f xs ʳ++ map f ys
foldr-ʳ++ : foldr f b (xs ʳ++ ys) ≡ foldl (flip f) (foldr f b ys) xs
foldl-ʳ++ : foldl f b (xs ʳ++ ys) ≡ foldl f (foldr (flip f) b xs) ys
```
* Added new definitions to `Data.List.Relation.Binary.Lex.Core`:
```agda
[]<[]-⇔ : P ⇔ [] < []
toSum : (x ∷ xs) < (y ∷ ys) → (x ≺ y ⊎ (x ≈ y × xs < ys))
∷<∷-⇔ : (x ≺ y ⊎ (x ≈ y × xs < ys)) ⇔ (x ∷ xs) < (y ∷ ys)
```
* The proof `toAny` in `Data.List.Relation.Binary.Sublist.Heterogeneous` has a new more general type:
```agda
toAny : Sublist R (a ∷ as) bs → Any (R a) bs
```
* Added new relations to `Data.List.Relation.Binary.Sublist.Heterogeneous`:
```agda
Disjoint (τ₁ : xs ⊆ zs) (τ₂ : ys ⊆ zs)
DisjointUnion (τ₁ : xs ⊆ zs) (τ₂ : ys ⊆ zs) (τ : xys ⊆ zs)
```
* Added new relations and definitions to `Data.List.Relation.Binary.Sublist.Setoid`:
```agda
xs ⊇ ys = ys ⊆ xs
xs ⊈ ys = ¬ (xs ⊆ ys)
xs ⊉ ys = ¬ (xs ⊇ ys)
UpperBound (τ₁ : xs ⊆ zs) (τ₂ : ys ⊆ zs)
⊆-disjoint-union : Disjoint τ σ → UpperBound τ σ
```
* Added new proofs to `Data.List.Relation.Binary.Sublist.Setoid.Properties`:
```agda
shrinkDisjointˡ : Disjoint τ₁ τ₂ → Disjoint (⊆-trans σ τ₁) τ₂
shrinkDisjointʳ : Disjoint τ₁ τ₂ → Disjoint τ₁ (⊆-trans σ τ₂)
```
* Added new definitions to `Data.List.Relation.Binary.Sublist.Propositional`:
```agda
separateˡ : (τ₁ : xs ⊆ zs) (τ₂ : ys ⊆ zs) → Separation τ₁ τ₂
```
* Added new proofs to `Data.List.Relation.Binary.Sublist.Propositional.Properties`:
```agda
⊆-trans-idˡ : ⊆-trans ⊆-refl τ ≡ τ
⊆-trans-idʳ : ⊆-trans τ ⊆-refl ≡ τ
⊆-trans-assoc : ⊆-trans τ₁ (⊆-trans τ₂ τ₃) ≡ ⊆-trans (⊆-trans τ₁ τ₂) τ₃
All-resp-⊆ : (All P) Respects _⊇_
Any-resp-⊆ : (Any P) Respects _⊆_
All-resp-⊆-refl : All-resp-⊆ ⊆-refl ≗ id
All-resp-⊆-trans : All-resp-⊆ (⊆-trans τ τ′) ≗ All-resp-⊆ τ ∘ All-resp-⊆ τ′
Any-resp-⊆-refl : Any-resp-⊆ ⊆-refl ≗ id
Any-resp-⊆-trans : Any-resp-⊆ (⊆-trans τ τ′) ≗ Any-resp-⊆ τ′ ∘ Any-resp-⊆ τ
lookup-injective : lookup τ i ≡ lookup τ j → i ≡ j
```
* Added new definition to `Data.List.Relation.Binary.Pointwise`:
```agda
uncons : Pointwise _∼_ (x ∷ xs) (y ∷ ys) → x ∼ y × Pointwise _∼_ xs ys
```
* Added new definitions to `Data.List.Relation.Unary.All`:
```agda
Null = All (λ _ → ⊥)
```
* Added new proofs to `Data.List.Relation.Unary.All.Properties`:
```agda
Null⇒null : Null xs → T (null xs)
null⇒Null : T (null xs) → Null xs
[]=-injective : pxs [ i ]= px → pxs [ i ]= qx → px ≡ qx
[]=lookup : (i : x ∈ xs) → pxs [ i ]= lookup pxs i
[]=⇒lookup : pxs [ i ]= px → lookup pxs i ≡ px
lookup⇒[]= : lookup pxs i ≡ px → pxs [ i ]= px
updateAt-minimal : i ≢∈ j → pxs [ i ]= px → updateAt j f pxs [ i ]= px
updateAt-id-relative : f (lookup pxs i) ≡ lookup pxs i → updateAt i f pxs ≡ pxs
updateAt-compose-relative : f (g (lookup pxs i)) ≡ h (lookup pxs i) → updateAt i f (updateAt i g pxs) ≡ updateAt i h pxs
updateAt-commutes : i ≢∈ j → updateAt i f ∘ updateAt j g ≗ updateAt j g ∘ updateAt i f
```
* The proof `All-swap` in `Data.List.Relation.Unary.All.Properties` has been generalised to work over `_~_ : REL A B ℓ` instead of just `_~_ : REL (List A) B ℓ`.
* Added new definition to `Data.List.Relation.Unary.AllPairs`:
```agda
uncons : AllPairs R (x ∷ xs) → All (R x) xs × AllPairs R xs
```
* Added new proofs to `Data.Nat.Coprimality`:
```agda
coprime⇒gcd≡1 : Coprime m n → gcd m n ≡ 1
gcd≡1⇒coprime : gcd m n ≡ 1 → Coprime m n
coprime-/gcd : Coprime (m / gcd m n) (n / gcd m n)
```
* Added new proof to `Data.Nat.Divisibility`:
```agda
>⇒∤ : m > suc n → m ∤ suc n
```
* Added new proofs to `Data.Nat.DivMod`:
```agda
/-congˡ : m ≡ n → m / o ≡ n / o
/-congʳ : n ≡ o → m / n ≡ m / o
/-mono-≤ : m ≤ n → o ≥ p → m / o ≤ n / p
/-monoˡ-≤ : m ≤ n → m / o ≤ n / o
/-monoʳ-≤ : n ≥ o → m / n ≤ m / o
m≥n⇒m/n>0 : m ≥ n → m / n > 0
```
* Added new proofs to `Data.Nat.GCD`:
```agda
gcd[m,n]≡0⇒m≡0 : gcd m n ≡ 0 → m ≡ 0
gcd[m,n]≡0⇒n≡0 : gcd m n ≡ 0 → n ≡ 0
gcd[m,n]≤n : gcd m (suc n) ≤ suc n
n/gcd[m,n]≢0 : {n≢0 gcd≢0} → n / gcd m n ≢ 0
GCD-* : GCD (m * suc c) (n * suc c) (d * suc c) → GCD m n d
GCD-/ : c ∣ m → c ∣ n → c ∣ d → GCD m n d → GCD (m / c) (n / c) (d / c)
GCD-/gcd : GCD (m / gcd m n) (n / gcd m n) 1
```
* Added new proofs to `Data.Nat.Properties`:
```agda
0≢1+n : 0 ≢ suc n
1+n≢n : suc n ≢ n
even≢odd : 2 * m ≢ suc (2 * n)
0<1+n : 0 < suc n
n<1+n : n < suc n
m<m+n : n > 0 → m < m + n
m<n⇒n≢0 : m < n → n ≢ 0
m<n⇒m≤1+n : m < n → m ≤ suc n
m≤n⇒m<n∨m≡n : m ≤ n → m < n ⊎ m ≡ n
∀[m≤n⇒m≢o]⇒o<n : (∀ {m} → m ≤ n → m ≢ o) → n < o
∀[m<n⇒m≢o]⇒o≤n : (∀ {m} → m < n → m ≢ o) → n ≤ o
+-rawMagma : RawMagma 0ℓ 0ℓ
*-rawMagma : RawMagma 0ℓ 0ℓ
+-0-rawMonoid : RawMonoid 0ℓ 0ℓ
*-1-rawMonoid : RawMonoid 0ℓ 0ℓ
*-cancelˡ-≤ : suc o * m ≤ suc o * n → m ≤ n
1+m≢m∸n : suc m ≢ m ∸ n
∸-monoʳ-< : o < n → n ≤ m → m ∸ n < m ∸ o
∸-cancelʳ-≤ : m ≤ o → o ∸ n ≤ o ∸ m → m ≤ n
∸-cancelʳ-< : o ∸ m < o ∸ n → n < m
∸-cancelˡ-≡ : n ≤ m → o ≤ m → m ∸ n ≡ m ∸ o → n ≡ o
m<n⇒0<n∸m : m < n → 0 < n ∸ m
m>n⇒m∸n≢0 : m > n → m ∸ n ≢ 0
∣-∣-identityˡ : LeftIdentity 0 ∣_-_∣
∣-∣-identityʳ : RightIdentity 0 ∣_-_∣
∣-∣-identity : Identity 0 ∣_-_∣
m≤n+∣n-m∣ : m ≤ n + ∣ n - m ∣
m≤n+∣m-n∣ : m ≤ n + ∣ m - n ∣
m≤∣m-n∣+n : m ≤ ∣ m - n ∣ + n
+-isCommutativeSemigroup : IsCommutativeSemigroup _+_
+-commutativeSemigroup : CommutativeSemigroup 0ℓ 0ℓ
```
* Added new bundles to `Data.String.Properties`:
```agda
<-isStrictPartialOrder-≈ : IsStrictPartialOrder _≈_ _<_
<-isStrictTotalOrder-≈ : IsStrictTotalOrder _≈_ _<_
<-strictPartialOrder-≈ : StrictPartialOrder 0ℓ 0ℓ 0ℓ
```
* Added new functions to `Data.Rational.Base`:
```agda
mkℚ+ : ∀ n d → .{d≢0 : d ≢0} → .(Coprime n d) → ℚ
toℚᵘ : ℚ → ℚᵘ
fromℚᵘ : ℚᵘ → ℚ
```
* Added new proofs to `Data.Rational.Properties`:
```agda
mkℚ-cong : n₁ ≡ n₂ → d₁ ≡ d₂ → mkℚ n₁ d₁ c₁ ≡ mkℚ n₂ d₂ c₂
mkℚ+-cong : n₁ ≡ n₂ → d₁ ≡ d₂ → mkℚ+ n₁ d₁ c₁ ≡ mkℚ+ n₂ d₂ c₂
normalize-coprime : .(c : Coprime n (suc d-1)) → normalize n (suc d-1) ≡ mkℚ (+ n) d-1 c
↥-mkℚ+ : ↥ (mkℚ+ n d c) ≡ + n
↧-mkℚ+ : ↧ (mkℚ+ n d c) ≡ + d
↥-neg : ↥ (- p) ≡ - (↥ p)
↧-neg : ↧ (- p) ≡ ↧ p
↥-normalise : ↥ (normalize i n) * gcd (+ i) (+ n) ≡ + i
↧-normalise : ↧ (normalize i n) * gcd (+ i) (+ n) ≡ + n
↥-/ : ↥ (i / n) * gcd i (+ n) ≡ i
↧-/ : ↧ (i / n) * gcd i (+ n) ≡ + n
↥-+ : ↥ (p + q) * gcd (...) (...) ≡ ↥ p * ↧ q ℤ.+ ↥ q * ↧ p
↧-+ : ↧ (p + q) * gcd (...) (...) ≡ ↧ p * ↧ q
↥p/↧p≡p : ↥ p / ↧ₙ p ≡ p
0/n≡0 : 0ℤ / n ≡ 0ℚ
toℚᵘ-cong : toℚᵘ Preserves _≡_ ⟶ _≃ᵘ_
toℚᵘ-injective : Injective _≡_ _≃ᵘ_ toℚᵘ
fromℚᵘ-toℚᵘ : fromℚᵘ (toℚᵘ p) ≡ p
toℚᵘ-homo-+ : Homomorphic₂ toℚᵘ _+_ ℚᵘ._+_
toℚᵘ-+-isRawMagmaMorphism : IsRawMagmaMorphism +-rawMagma ℚᵘ.+-rawMagma toℚᵘ
toℚᵘ-+-isRawMonoidMorphism : IsRawMonoidMorphism +-rawMonoid ℚᵘ.+-rawMonoid toℚᵘ
+-assoc : Associative _+_
+-comm : Commutative _+_
+-identityˡ : LeftIdentity 0ℚ _+_
+-identityʳ : RightIdentity 0ℚ _+_
+-identity : Identity 0ℚ _+_
+-isMagma : IsMagma _+_
+-isSemigroup : IsSemigroup _+_
+-0-isMonoid : IsMonoid _+_ 0ℚ
+-0-isCommutativeMonoid : IsCommutativeMonoid _+_ 0ℚ
+-rawMagma : RawMagma 0ℓ 0ℓ
+-rawMonoid : RawMonoid 0ℓ 0ℓ
+-magma : Magma 0ℓ 0ℓ
+-semigroup : Semigroup 0ℓ 0ℓ
+-0-monoid : Monoid 0ℓ 0ℓ
+-0-commutativeMonoid : CommutativeMonoid 0ℓ 0ℓ
```
* Added new functions to `Data.Sum.Base`:
```agda
fromInj₁ : (B → A) → A ⊎ B → A
fromInj₂ : (A → B) → A ⊎ B → B
```
* Added new definition to `Data.These.Properties`:
```agda
these-injective : these x a ≡ these y b → x ≡ y × a ≡ b
```
* Added new definition to `Data.Vec.Relation.Binary.Pointwise.Inductive`:
```agda
uncons : Pointwise _∼_ (x ∷ xs) (y ∷ ys) → x ∼ y × Pointwise _∼_ xs ys
```
* Added new definition to `Data.Vec.Relation.Unary.All`:
```agda
uncons : All P (x ∷ xs) → P x × All P xs
```
* Added new functions to `Level`.
```agda
levelOfType : ∀ {a} → Set a → Level
levelOfTerm : ∀ {a} {A : Set a} → A → Level
```
* Added new proofs to `Relation.Binary.PropositionalEquality`:
```agda
isMagma : (_∙_ : Op₂ A) → IsMagma _≡_ _∙_
magma : (_∙_ : Op₂ A) → Magma a a
```
* Added new definition to `Relation.Binary.Structures`:
```agda
record IsPartialEquivalence (_≈_ : Rel A ℓ) : Set (a ⊔ ℓ)
```
* Added new definition to `Relation.Binary.Bundles`:
```agda
record PartialSetoid a ℓ : Set (suc (a ⊔ ℓ))
```
* Added new proofs to `Relation.Binary.Construct.NonStrictToStrict`:
```agda
<⇒≉ : x < y → x ≉ y
≤∧≉⇒< : x ≤ y → x ≉ y → x < y
<⇒≱ : Antisymmetric _≈_ _≤_ → ∀ {x y} → x < y → ¬ (y ≤ x)
≤⇒≯ : Antisymmetric _≈_ _≤_ → ∀ {x y} → x ≤ y → ¬ (y < x)
≰⇒> : Symmetric _≈_ → (_≈_ ⇒ _≤_) → Total _≤_ → ∀ {x y} → ¬ (x ≤ y) → y < x
≮⇒≥ : Symmetric _≈_ → Decidable _≈_ → _≈_ ⇒ _≤_ → Total _≤_ → ∀ {x y} → ¬ (x < y) → y ≤ x
```
* Each of the following modules now re-export relevant proofs and relations from the previous modules in the list.
```
Relation.Binary.Properties.Preorder
Relation.Binary.Properties.Poset
Relation.Binary.Properties.TotalOrder
Relation.Binary.Properties.DecTotalOrder
```
* Added new relations and proofs to `Relation.Binary.Properties.Poset`:
```agda
x ≥ y = y ≤ x
x < y = ¬ (y ≈ x)
<⇒≉ : x < y → x ≉ y
≤∧≉⇒< : x ≤ y → x ≉ y → x < y
<⇒≱ : x < y → ¬ (y ≤ x)
≤⇒≯ : x ≤ y → ¬ (y < x)
```
* Added new proof to `Relation.Binary.Properties.TotalOrder`:
```agda
≰⇒> : ¬ (x ≤ y) → y < x
```
* Added new proof to `Relation.Binary.Properties.DecTotalOrder`:
```agda
≮⇒≥ : ¬ (x < y) → y ≤ x
```
* Added new proof to `Relation.Binary.PropositionalEquality`:
```agda
isDecEquivalence : Decidable _≡_ → IsDecEquivalence _≡_
```
* Added new definitions to `Relation.Nary`:
```agda
apply⊤ₙ : Π[ R ] → (vs : Product⊤ n as) → uncurry⊤ₙ n R vs
applyₙ : Π[ R ] → (vs : Product n as) → uncurry⊤ₙ n R (toProduct⊤ n vs)
iapply⊤ₙ : ∀[ R ] → {vs : Product⊤ n as} → uncurry⊤ₙ n R vs
iapplyₙ : ∀[ R ] → {vs : Product n as} → uncurry⊤ₙ n R (toProduct⊤ n vs)
Decidable : as ⇉ Set r → Set (r ⊔ ⨆ n ls)
⌊_⌋ : Decidable R → as ⇉ Set r
fromWitness : (R : as ⇉ Set r) (R? : Decidable R) → ∀[ ⌊ R? ⌋ ⇒ R ]
toWitness : (R : as ⇉ Set r) (R? : Decidable R) → ∀[ R ⇒ ⌊ R? ⌋ ]
```
* Added new definitions to `Relation.Unary`:
```agda
⌊_⌋ : {P : Pred A ℓ} → Decidable P → Pred A ℓ
```
* Added new definitions to `Relation.Binary.Construct.Closure.Reflexive.Properties`:
```agda
fromSum : a ≡ b ⊎ a ~ b → Refl _~_ a b
toSum : Refl _~_ a b → a ≡ b ⊎ a ~ b
⊎⇔Refl : (a ≡ b ⊎ a ~ b) ⇔ Refl _~_ a b
```
* Added new definitions to `Relation.Nullary.Decidable`:
```agda
dec-true : (p? : Dec P) → P → does p? ≡ true
dec-false : (p? : Dec P) → ¬ P → does p? ≡ false
```
* Added new definition to `Relation.Nullary.Implication`:
```agda
_→-reflects_ : Reflects P bp → Reflects Q bq → Reflects (P → Q) (not bp ∨ bq)
```
* Added new definition to `Relation.Nullary.Negation`:
```agda
¬-reflects : Reflects P b → Reflects (¬ P) (not b)
```
* Added new definition to `Relation.Nullary.Product`:
```agda
_×-reflects_ : Reflects P bp → Reflects Q bq → Reflects (P × Q) (bp ∧ bq)
```
* Added new definition to `Relation.Nullary.Sum`:
```agda
_⊎-reflects_ : Reflects P bp → Reflects Q bq → Reflects (P ⊎ Q) (bp ∨ bq)
```
* The module `Size` now re-exports the built-in function:
```agda
_⊔ˢ_ : Size → Size → Size
```
|