The where
command #
When working in a Lean file with namespaces, parameters, and variables, it can be confusing to
identify what the current "parser context" is. The command #where
identifies and prints
information about the current location, including the active namespace, open namespaces, and
declared variables.
It is a bug for #where
to incorrectly report this information (this was not formerly the case);
please file an issue on GitHub if you observe a failure.
Selects the elements of the given list α
which under the image of p : α → β × γ
have β
component equal to b'
. Returns the γ
components of the selected elements under the image of p
,
and the elements of the original list α
which were not selected.
Equations
- where.select_for_which p b' (a :: rest) = where.select_for_which._match_2 p b' a (where.select_for_which p b' rest)
- where.select_for_which p b' list.nil = (list.nil γ, list.nil α)
- where.select_for_which._match_2 p b' a (cs, others) = where.select_for_which._match_1 b' a cs others (p a)
- where.select_for_which._match_1 b' a cs others (b, c) = ite (b = b') (c :: cs, others) (cs, a :: others)