Markus Himmel
f4ae6fc8aa
fix: add instances to make ac_rfl work out of the box ( #3942 )
...
Previously the `ac_rfl` tactic was only really usable when depending on
mathlib. With these instances, `ac_rfl` can deal with the various
operations defined in Lean.
---------
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-04-24 06:12:36 +00:00
Joe Hendrix
0963f3476c
chore: extend GetElem with getElem! and getElem? ( #3694 )
...
This makes changes to the `GetElem` class so that it does not lead to
unnecessary overhead in container like `RBMap`.
The changes are to:
1. Make `getElem?` and `getElem!` part of the `GetElem` class so they
can be overridden in instances.
2. Introduce a `LawfulGetElem` class that contains correctness theorems
for `getElem?` and `getElem!` using the original definitions.
3. Reorganize definitions (e.g, by moving `GetElem` out of
`Init.Prelude`) so that the `GetElem` changes are feasible.
4. Provide `LawfulGetElem` instances to complement all existing
`GetElem` instances in Lean core.
To reduce the size of the PR, this doesn't do the work of providing new
`GetElem` instances for `RBMap`, `HashMap` etc. That will be done in a
separate PR (#3688 ) that depends on this.
---------
Co-authored-by: Mac Malone <tydeu@hatpress.net>
2024-03-28 01:42:00 +00:00
Kitamado
7abc1fdaac
doc: fix docstring of List.span ( #3707 )
...
see
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/docstring.20of.20.60List.2Espan.60.20is.20wrong
2024-03-18 10:26:47 +00:00
Joachim Breitner
4fdc243179
refactor: simplify some nomatch with nofun ( #3564 )
...
and also don’t wrap `nomatch` with `False.elim`; it is not necessary, as
`nomatch` already inhabits any type.
2024-03-02 20:43:31 +00:00
Scott Morrison
88deb34ddb
chore: upstream omega ( #3367 )
...
Co-authored-by: Joe Hendrix <joe@lean-fro.org>
2024-02-19 00:19:55 +00:00
Scott Morrison
4aa62a6a9c
chore: upstream Std.Data.List.Init.Basic ( #3335 )
2024-02-15 01:50:33 +00:00
Joe Hendrix
8b0dd2e835
chore: upstream Std.Logic ( #3312 )
...
This will collect definitions from Std.Logic
---------
Co-authored-by: David Thrane Christiansen <david@davidchristiansen.dk>
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-02-14 09:40:55 +00:00
Leonardo de Moura
39f716f902
chore: fix regression due to changes in previous commits
...
The example was looping with the new `simp` reduction strategy. Here
is the looping trace.
```
List.reverseAux (List.reverseAux as []) bs
==> rewrite using reverseAux_reverseAux
List.reverseAux [] (List.reverseAux (List.reverseAux as []) bs)
==> unfold reverseAux
List.reverseAux (List.reverseAux as []) bs
==> rewrite using reverseAux_reverseAux
List.reverseAux [] (List.reverseAux (List.reverseAux as []) bs)
==> ...
```
2024-01-09 12:57:15 +01:00
Scott Morrison
c656e71eb8
chore: make List.all and List.any short-circuit ( #2972 )
...
Changes the implementation of `List.all` and `List.any` so they
short-circuit. The implementations are tail-recursive.
This replaces https://github.com/leanprover/std4/pull/392 , which was
going to do this with `@[csimp]`.
2023-12-11 23:48:15 +00:00
Leni Aniva
ab36ed477e
feat: allow trailing comma in tuples, lists, and tactics ( #2643 )
2023-11-17 13:31:41 +01:00
Parth Shastri
642bc5d8f3
fix: replace DecidableEq with BEq/LawfulBEq in List mem theorems ( #2041 )
2023-10-30 14:03:16 +11:00
Bulhwi Cha
c1a58b212a
chore: remove whitespace ( #2244 )
...
Remove a duplicate whitespace character.
2023-05-31 06:00:42 -07:00
Jakob von Raumer
45b49e7f02
fix: typos
2023-05-05 12:07:54 -07:00
Sebastian Ullrich
042d14c470
fix: List.append_eq name
...
Fixes #2157
2023-03-19 10:28:48 +01:00
Gabriel Dahia
b9f0062a58
doc: replace maximum? in minimum? docstring
...
This is my first contribution, if it can be counted as a contribution. Following the [documentation for simple fixes](https://github.com/leanprover/lean4/blob/master/CONTRIBUTING.md#simple-fixes ), I opened the PR directly instead of discussing in the zulip or opening an issue. Hope that's ok.
2023-01-05 14:02:19 -08:00
Mario Carneiro
eb3b0377d7
fix: List.groupBy
2022-12-12 16:55:27 +01:00
Mario Carneiro
f74fee07e6
doc: document Init.Data.List.Basic ( #1828 )
...
* doc: document Init.Data.List.Basic
* Apply suggestions from code review
Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2022-11-18 06:16:50 -08:00
Gabriel Ebner
fc304d95c0
feat: Min/Max typeclasses
2022-10-21 14:36:38 -07:00
Mario Carneiro
d4219c9d70
fix: List.Mem should have two parameters
2022-10-09 05:46:52 -07:00
Ed Ayers
2a6697e077
feat: goal-diffs ( #1610 )
2022-09-24 11:46:11 +02:00
Mario Carneiro
19a50a32ec
chore: remove List.init
2022-09-11 07:21:24 -07:00
Mario Carneiro
2886174dd0
chore: remove map₂, [specialize] zipWith
2022-09-11 07:21:24 -07:00
Mario Carneiro
ce3c0c0e6b
feat: add TR versions of Nat.{fold, any, all, repeat}
2022-08-31 17:52:59 -07:00
Gabriel Ebner
c100f45b77
feat: add simp lemmas and instances for LawfulBEq
2022-07-11 14:19:41 -07:00
Leonardo de Moura
2fcd406f99
chore: remove sorry
2022-07-10 20:04:06 -07:00
Leonardo de Moura
ee0735760a
feat: add instance : GetElem (List α) Nat α fun as i => i < as.length
2022-07-10 17:38:59 -07:00
Leonardo de Moura
220d2e3816
feat: add filterTR and [csimp] theorem
2022-06-24 06:40:38 -07:00
E.W.Ayers
a7c33a963f
doc: docstrings for List.isPrefixOf
2022-06-17 17:47:51 -07:00
François G. Dorais
bc206b2992
fix: LawfulBEq class
...
make arguments implicit and protect `LawfulBEq.rfl`
2022-06-16 15:33:32 -07:00
Leonardo de Moura
041827bed5
chore: unused variables
2022-06-07 17:54:10 -07:00
Sebastian Ullrich
fb2a2b3de2
fix: fixup previous commit
2022-06-07 16:37:45 -07:00
Sebastian Ullrich
ae7b895f7a
refactor: unname some unused variables
2022-06-07 16:37:45 -07:00
Leonardo de Moura
34bbe5d12c
feat: add simp theorem List.of_toArray_eq_toArray (as bs : List α) : (as.toArray = bs.toArray) = (as = bs) := by
2022-05-27 18:26:48 -07:00
Leonardo de Moura
cfb4e306f7
refactor: replace length_dropLast theorem
2022-04-01 16:44:24 -07:00
casavaca
bf4ba1583d
feat: add simp theorem for List, (as.map f).length = as.length
2022-03-19 11:35:21 -07:00
Leonardo de Moura
d8ee03c1bb
feat: add ForIn' instance that is similar to ForIn but provides a proof that the iterated elements are in the collection
2022-03-03 19:05:27 -08:00
Leonardo de Moura
fd519401ff
feat: add Membership instance for List
...
and the theorem `a ∈ as -> sizeOf a < sizeOf as`.
We will use theorems like this one to improve the `decreasing_tactic`.
2022-03-03 18:13:21 -08:00
Leonardo de Moura
0f06fbf648
feat: LawfulBEq must be reflexive
2022-02-28 19:27:51 -08:00
Leonardo de Moura
b8bed6fb5c
feat: add LawfulBEq class
2022-02-25 13:35:08 -08:00
Leonardo de Moura
ba16903205
feat: add helper theorems
2022-02-19 21:25:44 -08:00
Leonardo de Moura
86328bcb9f
feat: tail recursive List.iota and [csimp] theorem
2022-02-16 11:25:46 -08:00
Mario Carneiro
f22f699d62
feat: split replicate / replicateTR with @[csimp]
2021-12-18 10:58:57 -08:00
Leonardo de Moura
b205cfaaf2
chore: missing annotations at List.mapTR
2021-08-27 10:17:49 -07:00
Leonardo de Moura
8ba10521e6
feat: add theorem for tutorial
2021-08-26 12:58:02 -07:00
Leonardo de Moura
00193fb953
feat: add theorems for tutorial
2021-08-26 12:13:15 -07:00
Leonardo de Moura
4dccaa963b
feat: add List.mapTR and csimp lemma
2021-08-22 09:32:19 -07:00
Leonardo de Moura
ec6af1ba26
feat: use simple List.append definition and add csimp theorem
2021-08-21 16:11:54 -07:00
Leonardo de Moura
3b240d9a14
feat: use simple List.length definition and add csimp theorem
2021-08-21 13:11:06 -07:00
Leonardo de Moura
af5ff9ceb2
refactor: move List.takeWhile to Init.Data.List.Basic
...
Motivation: make sure it will be aligned by BinPort
2021-07-31 15:03:33 -07:00
Leonardo de Moura
f4a7ffd8c8
chore: fix codebase and tests
2021-06-29 17:14:52 -07:00