Zulip Chat Archive

Stream: lean4

Topic: small "37 goals" message


Kevin Buzzard (Apr 25 2023 at 14:33):

In Lean 3 there was a little message at the top of the tactic state saying the number of goals currently in the infoview, if there was more than one. Can I turn that option on in Lean 4?

Heather Macbeth (Apr 25 2023 at 14:34):

I miss this too.

Heather Macbeth (Apr 25 2023 at 14:39):

While we're on infoview tweaks: I'd love to have options to adjust the infoview by

  1. hiding the autogenerated "case names" for the goals
  2. leaving a fair bit of whitespace between the different goals
  3. hiding the "expected type"

Do these already exist?
Screen-Shot-2023-04-25-at-10.38.15-AM.png

Heather Macbeth (Apr 25 2023 at 14:39):

Maybe even

  1. make the text of the subsequent goals smaller than the text of the current goal.

Ruben Van de Velde (Apr 25 2023 at 14:41):

Sounds like you have the same issue I have with finding the current goal - maybe it would be possible to auto-collapse all but the first goal states

Heather Macbeth (Apr 25 2023 at 14:45):

Not so much me as my poor students :). I'd rather not autocollapse it, because I think that would confuse them further, but I think the tweaks I proposed would make it clearer.

Sebastian Ullrich (Apr 25 2023 at 14:50):

Heather Macbeth said:

  1. hiding the "expected type"

Not that if you collapse any part of the info view, it should stay collapsed for the current session. Is this visually sufficient? Should it persist across sessions? Adjustable in your project's .vscode file?

Heather Macbeth (Apr 25 2023 at 14:54):

Adjustable in your project's .vscode file?

I think that would work, yes -- I'd rather my students never see this at all.

Kevin Buzzard (Apr 25 2023 at 14:55):

But you want them to see the number of goals, right? :-)

Heather Macbeth (Apr 25 2023 at 14:56):

Yes -- it's the "expected type" that I want them to never encounter. I do want them to see all the goals, and I'd love for them to see a count of the number of goals.

Heather Macbeth (Apr 25 2023 at 14:56):

(See the picture I included as an illustration of why "expected type" can be confusing.)

Patrick Massot (Apr 25 2023 at 15:02):

It would be even better to make the active goal clearly designated than being on top.

Heather Macbeth (Apr 25 2023 at 15:03):

Yes, maybe it could even have a lightly coloured background instead of/in addition to

Heather Macbeth said:

  1. make the text of the subsequent goals smaller than the text of the current goal.

Patrick Massot (Apr 25 2023 at 15:06):

Oops, I missed your 4th item. But this shows I had the same wish (although I don't know which display trick would be the most suitable).

Sebastian Ullrich (Apr 25 2023 at 15:10):

For what it's worth, for cases like above where presumably the expected type is the type of the surrounding by block, we probably shouldn't ever show an expected type. As everywhere, there is so much more that could be tweaked and improved, but an option to collapse the item by default would be a sensible start.

Yaël Dillies (Apr 25 2023 at 15:11):

Patrick Massot said:

It would be even better to make the active goal clearly designated than being on top.

"active goals". There can be several active goals, right?

Yaël Dillies (Apr 25 2023 at 15:12):

I guess students don't use much ; (<;> is the Lean 4 equivalent, I think?), but it would still be helpful to display all the goals the next tactic will run on.

Heather Macbeth (Apr 25 2023 at 15:14):

Sorry for hijacking your thread, Kevin. I agree about the importance of the "37 goals" message, too.

Heather Macbeth (Apr 25 2023 at 15:16):

@Sebastian Ullrich I'd be happy to open issues for these, totally understanding that they are lower priority for the devs than work on the core product and these issues would just be a record. But could you give a run-down of which repo each of these ideas (my 1-4 and Kevin's "number of goals") would require changes to? Are they all VS Code-extension only, or do some require changes to core too?

Sebastian Ullrich (Apr 25 2023 at 15:21):

I just opened https://github.com/leanprover/lean4/issues/2202, I believe everything else can be done in the extension, including a setting to collapse the expected type by default

Sebastian Ullrich (Apr 25 2023 at 15:23):

Yaël's refinement may need some coordination between language server and extension, in which case I would default to opening it in the lean4 repo

Sebastian Ullrich (Apr 25 2023 at 15:24):

And yes, right now I don't think anyone is directly looking into working on issues like these in either repo, but recording them is still useful

Patrick Massot (May 13 2023 at 16:36):

I opened https://github.com/leanprover/vscode-lean4/pull/300 which seems to be the easiest vscode-lean4 issue to fix.

Kevin Buzzard (May 13 2023 at 16:53):

I was wishing for this only today, after it had taken a while to dawn on me that an apply in a porting file was creating two goals in lean 4 and only one in lean 3

Patrick Massot (May 13 2023 at 18:31):

There is a failing test but I have no idea what it's telling me.

Wojciech Nawrocki (May 15 2023 at 00:20):

@Patrick Massot I will review. The failing test says nothing, the tests have been broken for ages.

Patrick Massot (May 26 2023 at 13:36):

Thanks to two TGV rides between Paris and Lyon, I found time to work on https://github.com/leanprover/vscode-lean4/pull/302 which tries to implement all suggestions from Heather's VSCode wishlist. However I'm facing some React issues. I added some config options here which are made available here using what I understand to be the standard procedure in this extension. Then they are read for instance here and some of them are used as the initial state of some React state, for instance here. That doesn't work. I think what happens is the config passing mechanism is asynchronous and the react component state is initialized before the config goes through. And then it's too late. Please feel free to fix that or give me hints @Gabriel Ebner @Wojciech Nawrocki @Edward Ayers

Patrick Massot (May 26 2023 at 13:38):

Also I apologize for implementing four different features in the same PR, but writing all four at the same time was much easier for me since the work is mostly threading variables through all layers, so working one layer at a time is easier than one variable at a time. Of course I can try to split the PR if this is really too annoying.

Patrick Massot (May 26 2023 at 13:39):

Once the config vs state issue is resolved we will of course be able to enjoy some bikeshedding about the changes of margins and font-size, and the default keybindings.

Wojciech Nawrocki (May 27 2023 at 09:23):

Thanks! I will try to look at this tonight.


Last updated: Dec 20 2023 at 11:08 UTC