lean4-htt/src/Init/Data/Iterators
Paul Reichert a1b8ffe31b
feat: improve MPL support for loops over iterators, fix MPL spec priorities (#11716)
This PR adds more MPL spec lemmas for all combinations of `for` loops,
`fold(M)` and the `filter(M)/filterMap(M)/map(M)` iterator combinators.
These kinds of loops over these combinators (e.g. `it.mapM`) are first
transformed into loops over their base iterators (`it`), and if the base
iterator is of type `Iter _` or `IterM Id _`, then another spec lemma
exists for proving Hoare triples about it using an invariant and the
underlying list (`it.toList`). The PR also fixes a bug that MPL always
assigns the default priority to spec lemmas if `Std.Tactic.Do.Syntax` is
not imported and a bug that low-priority lemmas are preferred about
high-priority ones.

For context, the MPL bug was related to the fact that the `Attr.spec`
syntax is not built-in. Therefore, Lean falls back to the `Attr.simple`
syntax, which *basically* also works, but which stores the priority at a
different position. The routine to extract the priority does not
consider this and so it falls back to the default priority given an
`Attr.simple` syntax object.
2025-12-17 22:49:42 +00:00
..
Combinators feat: MonadAttach (#11532) 2025-12-16 18:57:00 +00:00
Consumers refactor: move Iter and others from Std.Iterators to Std (#11446) 2025-12-15 08:24:12 +00:00
Internal chore: add deprecations for duplicated theorems (#10967) 2025-10-29 05:26:16 +00:00
Lemmas feat: improve MPL support for loops over iterators, fix MPL spec priorities (#11716) 2025-12-17 22:49:42 +00:00
Producers refactor: move Iter and others from Std.Iterators to Std (#11446) 2025-12-15 08:24:12 +00:00
Basic.lean feat: MPL specs for loops over iterators (#11693) 2025-12-17 09:36:44 +00:00
Combinators.lean feat: List slices (#11019) 2025-11-14 11:33:25 +00:00
Consumers.lean feat: remove Finite conditions from iterator consumers relying on a new fixpoint combinator (#11038) 2025-12-08 16:03:22 +00:00
Internal.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Lemmas.lean feat: List slices (#11019) 2025-11-14 11:33:25 +00:00
PostconditionMonad.lean feat: MonadAttach (#11532) 2025-12-16 18:57:00 +00:00
Producers.lean feat: List slices (#11019) 2025-11-14 11:33:25 +00:00
ToIterator.lean refactor: move Iter and others from Std.Iterators to Std (#11446) 2025-12-15 08:24:12 +00:00