Zulip Chat Archive
Stream: new members
Topic: Proof expansion inside proof
Marcin Tomaszewski (Apr 21 2023 at 13:22):
hi,
assuming we have
lemma zero_add (n : mynat) : 0 + n = n :=
begin
induction n with d hd,
refl,
rw add_succ,
...
end
then in the new proof we use the zero_add for example:
lemma ...
begin
rw zero_add,
...
end
how could we expand / add the zero_add proof inside the new proof to get something like below?
lemma ...
begin
zero_add:
begin
...
end
rw zero_add,
...
end
Ruben Van de Velde (Apr 21 2023 at 13:23):
Please use #backticks
Yaël Dillies (Apr 21 2023 at 13:27):
You can do
lemma ...
begin
have zero_add : ∀ (n : mynat), 0 + n = n,
{
...
},
rw zero_add,
...
end
Marcin Tomaszewski (Apr 21 2023 at 17:43):
thanks
Hagb (Junyu Guo) (Apr 21 2023 at 19:09):
(deleted: Sorry, I accidentally sent the message)
Last updated: Dec 20 2023 at 11:08 UTC