Open eric-wieser opened 2 weeks ago
The simplest workaround here should be to move the relevant part of the type to the RHS of :
. This means the binders have to be reintroduced in the body, but for proofs that can be done with intros
so I'd say it's really not too bad. This strategy also extends to open in
etc.
This strategy also extends to
open in
etc.
Does intros
really replay open in
/ set_option _ in
clauses in binders like it does let
?
It doesn't, you're right about that part
Proposal
Currently, Lean provides
as notation for
This RFC suggests extending this with
as notation for
Rocq already has this notation, as
(y := 2)
. This notation is already claimed byoptParam
s in Lean, but(let y := 2)
seems like a natural alternative.Motivation:
optParam
s is a common trap (https://github.com/trishullab/PutnamBench/issues/166); thelet
syntax could be referenced in the docstring ofoptParam
to help resolve confusionletE
in addition toforallE
means that they can now completely capture any intermediate goal state in a proof, allowing mathlib'sextract_goal
to more faithfully extract the current goal with an identical local context at the start of the proof.Optional extensions that this RFC is neutral on:
let
binders asfun x (let y := 2 * x) (z : Fin y) => z.val
let
binders ashave foo (x : Nat) (let y : Nat := 2) :=
let
binders inExists
and other custom binder typesdef foo (x : Nat) (open scoped Nat) (y : Fin (x)!)
and similar forset_option
Community Feedback
Impact
Add :+1: to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add :+1: to it.