This PR adds the new operation `MonadAttach.attach` that attaches a proof that a postcondition holds to the return value of a monadic operation. Most non-CPS monads in the standard library support this operation in a nontrivial way. The PR also changes the `filterMapM`, `mapM` and `flatMapM` combinators so that they attach postconditions to the user-provided monadic functions passed to them. This makes it possible to prove termination for some of these for which it wasn't possible before. Additionally, the PR adds many missing lemmas about `filterMap(M)` and `map(M)` that were needed in the course of this PR. |
||
|---|---|---|
| .. | ||
| Array.lean | ||
| Attach.lean | ||
| Basic.lean | ||
| BasicAux.lean | ||
| Coe.lean | ||
| Instances.lean | ||
| Lemmas.lean | ||
| List.lean | ||
| Monadic.lean | ||