Zulip Chat Archive

Stream: lean4

Topic: expose_names


Darij Grinberg (Nov 23 2025 at 20:59):

I'm doing a semi-automated casebash in which I run cases on 4 disjunctions and then apply their results. I need the case-hypotheses named so I can simp using them. This here works:

cases h11 <;> cases h12 <;> cases h21 <;> cases h22 <;> expose_names <;> simp [h, h_1, h_2, h_3, not_lt_of_gt h, not_lt_of_gt h_1, not_lt_of_gt h_2, not_lt_of_gt h_3] <;> order

but feels brittle because I'm relying on expose_names to produce the specific names h, h_1, h_2, h_3. What is the right way to do this?

Aaron Liu (Nov 23 2025 at 20:59):

you could try a simp_all

Aaron Liu (Nov 23 2025 at 20:59):

you could use rename_i

Darij Grinberg (Nov 23 2025 at 20:59):

I'd rather avoid unrelated hypotheses

Darij Grinberg (Nov 23 2025 at 20:59):

oh!

Darij Grinberg (Nov 23 2025 at 21:00):

rename_i is the answer, thank you!

Kevin Buzzard (Nov 23 2025 at 21:52):

Can you do obtain \<names,I,want\> := h11 etc?

Darij Grinberg (Nov 23 2025 at 21:57):

These are disjunctions, though. Does obtain h | h work? (Not having VS open right now)

Aaron Liu (Nov 23 2025 at 21:57):

It does work probably

Darij Grinberg (Nov 23 2025 at 22:29):

Thanks @Kevin Buzzard ! works nicely and looks much better


Last updated: Dec 20 2025 at 21:32 UTC