Zulip Chat Archive

Stream: lean4

Topic: binders position info


Patrick Massot (Sep 23 2022 at 16:13):

When using docs4#Lean.Environment.find? to retrieve a theorem statement, is there way to know what was left of the colon and what was right of the colon?

Jannis Limperg (Sep 23 2022 at 16:14):

I'm pretty sure this information is not preserved.

Patrick Massot (Sep 23 2022 at 16:30):

Thanks for this answer. I'm a bit sad but I'll work around this.

Mario Carneiro (Sep 23 2022 at 16:31):

why do you need this? It was erased as a relevant distinction

Patrick Massot (Sep 23 2022 at 16:33):

Relevant for what?

Patrick Massot (Sep 23 2022 at 16:34):

I'm returning to working on the game server (aiming in particular for the natural number game in Lean 4).

Eric Wieser (Sep 23 2022 at 16:34):

Why does the game server need to know what was before or after the colon?

Patrick Massot (Sep 23 2022 at 16:35):

In some levels you want people to use intro and in other levels you don't

Eric Wieser (Sep 23 2022 at 17:21):

Is the idea to not have to do the source-replacement trick that I think the lean3 game-maker does?

Patrick Massot (Sep 23 2022 at 17:35):

I don't know what the source-replacement trick, but there won't be anything in common with what game-maker does.

Mario Carneiro (Sep 23 2022 at 18:17):

could you give an example?

Mario Carneiro (Sep 23 2022 at 18:17):

I would expect the decision of whether to use intro or not to depend on the state of the proof

Patrick Massot (Sep 23 2022 at 19:07):

But Lean doesn't remember the state of the proof at the beginning of a theorem, that's my problem.

Mario Carneiro (Sep 23 2022 at 19:55):

you could override by or def to record the information you are interested in

Eric Wieser (Sep 23 2022 at 21:55):

To what extent could something like

example (before_the_colon : P) : Q := by start_the_game_already

work for the server you're building? Couldstart_the_game_alreadystart the server itself, or at least add the goal state to the queue of games to play?


Last updated: Dec 20 2023 at 11:08 UTC