Zulip Chat Archive

Stream: batteries

Topic: String/Lemmas


Kim Morrison (Jun 23 2024 at 23:11):

batteries#857: deal with nonterminal simps in String/Lemmas 

Makes a quick pass to turn nonterminal simps into simp onlys, as this file was breaking during an experiment with Nat simp lemmas.

Kim Morrison (Jun 23 2024 at 23:11):

I have left many -- FIXME nonterminal simp, but `simp?` gives a different result in the file. They don't seem to obstruct my progress, so I wasn't planning on resolving them.

Kim Morrison (Jun 23 2024 at 23:12):

If one of the authors of the file (@Bulhwi Cha, @Mario Carneiro?) might have a look at these, possibly creating an issue for the underlying simp? problem, that would be lovely.

Kim Morrison (Jun 23 2024 at 23:15):

Actually, some of these FIXMEs are obstructing further progress. In particular extract.go₂_add_right_cancel and extract.go₁_add_right_cancel are breaking on my branch, and both having an earlier nonterminal <;> simp which requires restructing the whole proof to avoid.

Help on fixing these would be appreciated.

Mario Carneiro (Jun 24 2024 at 10:02):

@Kim Morrison are you aware of the squeeze_scope tactic?

Kim Morrison (Jun 24 2024 at 10:03):

Yes, and I promise I did try it! Can't remember why I wasn't satisfied, sorry.

Mario Carneiro (Jun 24 2024 at 10:04):

I managed to use it and get something that compiles, although I didn't look at the proofs too hard

Bulhwi Cha (Jun 24 2024 at 10:36):

Kim Morrison said:

Help on fixing these would be appreciated.

I'm a little busy lately, but I'll look into these this week.

Bulhwi Cha (Jun 30 2024 at 06:58):

Kim Morrison said:

In particular extract.go₂_add_right_cancel and extract.go₁_add_right_cancel are breaking on my branch, and both having an earlier nonterminal <;> simp which requires restructing the whole proof to avoid.

I see that Mario Carneiro has already removed the nonterminal simps from these lemmas.

Bulhwi Cha (Jun 30 2024 at 07:09):

Bulhwi Cha said:

I've spent too much time proving String.splitOn_of_valid, which hasn't been reviewed for two months. I want to wait until the overhaul is finished.

This discourages me from working on lemmas about strings again. Still, it'll be easy to replace nonterminal simps with simp onlys using set_option tactic.simp.trace true. I'll try it.

Mario Carneiro (Jun 30 2024 at 07:10):

the easy version of this is to use simp? and accept the "try this" suggestion

Bulhwi Cha (Jun 30 2024 at 07:13):

Bulhwi Cha said:

Still, it'll be easy to replace nonterminal simps with simp onlys using set_option tactic.simp.trace true. I'll try it.

Oh, this isn't working, and neither is simp?.

Bulhwi Cha (Jun 30 2024 at 07:25):

The lemmas that still have nonterminal simps aren't created by me. I'll deal with them after the Lean core team completes the planned overhaul of the library work on strings.

Mario Carneiro (Jun 30 2024 at 07:32):

what do you mean by not working?

Bulhwi Cha (Jun 30 2024 at 07:41):

When I replaced the nonterminal simp in the proof of the theorem prev with the simp only that simp? suggested, the latter part of the proof broke down.

Mario Carneiro (Jun 30 2024 at 07:43):

it appears that the issue is the reference to prev which should be Iterator.prev

Bulhwi Cha (Jun 30 2024 at 07:44):

You're right. I'll look into the other lemmas and see if I can do the same.

Mario Carneiro (Jun 30 2024 at 07:45):

I guess that's a pretty printer bug

Bulhwi Cha (Jun 30 2024 at 07:51):

It seems that simp? mixes up a name with the same one in a different namespace.

Bulhwi Cha (Jun 30 2024 at 07:56):

I've removed all nonterminal simps from the lemmas that had the FIXME comment.

Bulhwi Cha (Jun 30 2024 at 08:21):

@Kim Morrison Is it okay to create a pull request whose base branch is for another person's PR? I've just created batteries#864.

Bulhwi Cha (Jun 30 2024 at 08:38):

@Mario Carneiro said:

I guess that's a pretty printer bug

Did you create a bug report? If not, I'll do it.

Kim Morrison (Jun 30 2024 at 08:47):

Bulhwi Cha said:

Mario Carneiro said:

I guess that's a pretty printer bug

Did you create a bug report? If not, I'll do it.

Thanks!

Bulhwi Cha (Jun 30 2024 at 11:12):

I've opened lean#4591.


Last updated: May 02 2025 at 03:31 UTC