Zulip Chat Archive

Stream: new members

Topic: Need help with tutorial


Leandro Caniglia (Apr 01 2024 at 21:06):

This is level 3 of Advanced Addition World

Objects:
xy: ℕ
Assumptions:
a: x + y = y
Goal:
x = 0

I would like to replace the RHS y of Assumption a with 0 + y, using something like \l zero_add. All my attempts failed. How can I do that?

Ruben Van de Velde (Apr 01 2024 at 21:18):

You should be able to use nth_rewrite instead

Leandro Caniglia (Apr 01 2024 at 21:28):

Ruben Van de Velde said:

You should be able to use nth_rewrite instead

When I try

nth_rewrite 3 [ zero_add] at a

I get

tactic 'rewrite' failed, pattern is a metavariable
  ?n
from equation
  ?n = 0 + ?n
xy: 
a: x + y = y
 x = 0

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

try using zero_add y instead of just zero_add, which will apply to every term

Leandro Caniglia (Apr 01 2024 at 21:35):

Mario Carneiro said:

try using zero_add y instead of just zero_add, which will apply to every term

Thanks! That worked

nth_rewrite 2 [ zero_add y] at a

Last updated: May 02 2025 at 03:31 UTC