This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Commit cf9386b
committed
feat(data/list/basic): add lemma map_eq_repeat_iff (#17832)
This small PR adds the following API lemma for lists:
```lean
lemma map_eq_repeat_iff {α β} {l : list α} {f : α → β} {b : β} :
l.map f = repeat b l.length ↔ (∀ x ∈ l, f x = b)
```
See this [Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F/topic/More.20general.20version.20of.20.60list.2Emap_const.60.3F/near/314118320).
(It also fixes a harmless typo in the proof of `last_map`.)1 parent 4f4e7fa commit cf9386b
1 file changed
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | 509 | | |
517 | 510 | | |
518 | 511 | | |
| |||
1791 | 1784 | | |
1792 | 1785 | | |
1793 | 1786 | | |
1794 | | - | |
| 1787 | + | |
1795 | 1788 | | |
1796 | 1789 | | |
1797 | 1790 | | |
1798 | 1791 | | |
1799 | 1792 | | |
1800 | 1793 | | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
1801 | 1811 | | |
1802 | 1812 | | |
1803 | 1813 | | |
| |||
0 commit comments