Commit ef2bcb8
Add proofs to Data.List.Properties (#2355)
* Add map commutation with other operations
map commutes with most list operations in some way,
and I initially made a section just for these proofs,
but later decided to spread them into each section
for consistency.
* Add congruence to operations that miss it
* Add flip & comm proofs to align[With] & [un]zip[With]
For the case of zipWith, the existing comm proof
can be provided in terms of cong and flip.
For the case of unzip[With], the comm proof has
little use and the flip proof is better named "swap".
* Remove unbound parameter
The alignWith section begins with a
module _ {f g : These A B → C} where
but g is only used by the first function.
* Add properties for take
* Proof of zip[With] and unzip[With] being inverses
* fixup! don't put list parameters in modules
* fixup! typo in changelog entry
* fixup! use equational reasoning in place of trans
* Add interaction with ++ in two more operations
* fixup! foldl-cong: don't take d ≡ e
* prove properties about catMaybes
now that catMaybes is no longer defined in
terms of mapMaybe, properties about mapMaybe
need to be proven for catMaybe as well
* move mapMaybe properties down
see next commit (given that mapMaybe-concatMap
now depends on map-concatMap, it has to be
moved down)
* simplify mapMaybe proofs
since mapMaybe is now defined in terms
of catMaybes and map, we can derive its
proofs from the proofs of those rather
than using induction directly
---------
Co-authored-by: MatthewDaggitt <matthewdaggitt@gmail.com>1 parent 7199c18 commit ef2bcb8
2 files changed
Lines changed: 312 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
330 | 333 | | |
331 | 334 | | |
332 | 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 | + | |
333 | 367 | | |
334 | 368 | | |
335 | 369 | | |
| |||
0 commit comments