Zulip Chat Archive
Stream: lean4
Topic: How can I get the equation of a case in my context?
Alex Zani (Mar 28 2025 at 18:54):
So, for instance, I have
induction sizeOf state with
| zero =>
I now would like to use the fact that sizeOf state = 0
. But as far as I can tell, lean doesn't give me access to that. It replaces sizeOf state
with 0
in the goal, but that doesn't let me manipulate instances of sizeOf state
that are in my context.
Aaron Liu (Mar 28 2025 at 19:41):
simp
knows about these lemmas
Aaron Liu (Mar 28 2025 at 19:44):
Do induction h : sizeOf state with
Alex Zani (Mar 28 2025 at 19:46):
Aaron Liu said:
Do
induction h : sizeOf state with
I get unknown identifier h
.
Aaron Liu (Mar 28 2025 at 19:47):
What version of Lean are you on?
Alex Zani (Mar 28 2025 at 19:47):
4.10
Aaron Liu (Mar 28 2025 at 19:49):
Try generalize sizeOf state = x
and then induction x generalizing state with
Alex Zani (Mar 28 2025 at 19:58):
Aaron Liu said:
Try
generalize sizeOf state = x
and theninduction x generalizing state with
x is not in the proof state unfortunately.
Alex Zani (Mar 28 2025 at 20:00):
Neither is sizeOf state = 0
Aaron Liu (Mar 28 2025 at 20:10):
Alex Zani said:
Aaron Liu said:
Try
generalize sizeOf state = x
and theninduction x generalizing state with
x is not in the proof state unfortunately.
generalize
should add x
to the proof state? If it doesn't then that's a bug.
Alex Zani (Mar 28 2025 at 20:12):
It does. But it looks like it's removed in the induction cases.
Aaron Liu (Mar 28 2025 at 20:13):
Oh, that should be generalize h : sizeOf state = x
Alex Zani (Mar 28 2025 at 20:14):
Aaron Liu said:
Oh, that should be
generalize h : sizeOf state = x
Thanks, that worked!
Last updated: May 02 2025 at 03:31 UTC