Zulip Chat Archive

Stream: general

Topic: Can someone explain to me what this error is saying


Frederick Pu (Apr 02 2024 at 00:50):

Screenshot-2024-04-01-144614.png

Bolton Bailey (Apr 02 2024 at 01:06):

This usually means you have already completed the proof, and you can just delete the tactic that is giving you this error and everything should work.

Frederick Pu (Apr 02 2024 at 01:12):

Bolton Bailey said:

This usually means you have already completed the proof, and you can just delete the tactic that is giving you this error and everything should work.

But when I delete it I get an unsolved goal error.
Screenshot-2024-04-01-211215.png

David Renshaw (Apr 02 2024 at 01:16):

what if you remove the curly braces?

Mario Carneiro (Apr 02 2024 at 01:21):

the issue is that decreasing_by is a state with multiple goals, one per recursive call, so you need all_goals to apply the tactic sequence to every goal, or multiple braces if you want to prove them separately

Mario Carneiro (Apr 02 2024 at 01:23):

Also keep in mind that curly braces are not a no-op in the tactic language; they focus on the first goal and lean/std/mathlib usually uses · tacs for this instead. The no-op grouping device in the tactic language is ( ... )

Mario Carneiro (Apr 02 2024 at 01:27):

I think this is a bug in the decreasing_by parser though; most places which accept tactic sequences also accept a braced group, but usually the initial state only has one goal so it's not observable whether you are using the { ... } tactic combinator or the tacticSeqBracketed syntax. cc: @Joachim Breitner

Frederick Pu (Apr 02 2024 at 01:46):

Mario Carneiro said:

the issue is that decreasing_by is a state with multiple goals, one per recursive call, so you need all_goals to apply the tactic sequence to every goal, or multiple braces if you want to prove them separately

I know it doesnt apply in this case, but what if you have multiple different wf goals that require different tactics to prove?

Mario Carneiro (Apr 02 2024 at 02:13):

the intent is that you would write something like this:

decreasing_by
  · proof for first call
  · proof for second call
    more proof
  · proof for third call

or:

decreasing_by
  all_goals
    proof for every call

Mario Carneiro (Apr 02 2024 at 02:15):

if you like to use braces, you could also format it as

 decreasing_by
  {
    proof for first call
  }
  {
    proof for second call
    more proof
  }
  {
    proof for third call
  }

(but note the lack of surrounding braces), or

 decreasing_by (
  {
    proof for first call
  }
  {
    proof for second call
    more proof
  }
  {
    proof for third call
  }
)

if you really want some outer delimiters

Joachim Breitner (Apr 02 2024 at 20:19):

Which version of lean is that? It looks to me that you are seeing the effect of the old behavior, where the decreasing_by is applied to each goal separately, so for one goal simp_wf works and then the simp call fails, and for another one you need the simp, and now you have to juggle with try or first… precisely the kind of confusion I was hoping to reduce by that refactoring. (The termination_by set_subtrees is a hint that this is an older version of lean.)

Joachim Breitner (Apr 02 2024 at 20:29):

Oh, and to help @Frederick Pu with their problem on their version of Lean; can you try simp_wf ; try simp [ … ]?

Frederick Pu (Apr 09 2024 at 03:03):

Joachim Breitner said:

Oh, and to help Frederick Pu with their problem on their version of Lean; can you try simp_wf ; try simp [ … ]?

Yeah thanks that works although it's not really relevant in this case. Probably be a useful trick when I have multiple wf goals tho


Last updated: May 02 2025 at 03:31 UTC