Zulip Chat Archive

Stream: lean4

Topic: Automatic projections in theorem definition


Pavel Klimov (Nov 18 2025 at 21:43):

How do I force to avoid renaming of projections? Now I don't know how can I write have statement so I could use it in rw tactic. :frown:

structure qwe where
a : Int
b : Int

theorem test (x : qwe): x.1 = x.a := rfl

#check test

It outputs theorem conclusion as x.a = x.a so if in my context something has .1 I cant rewrite it using rw.

Edit: I want to add context. My real case is not so simple. It changes name of projection somewhere inside theorem.

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

structure qwe where
a : Int
b : Int

#check qwe.a.eq_def

Pavel Klimov (Nov 18 2025 at 22:06):

It doesn't answer the question. I want to define theorem which I can apply in rw tactic. The one above doesn't work because it says it can't find pattern. And, indeed there is no pattern with .field_name, there is only pattern with .1.

Robin Arnez (Nov 18 2025 at 22:08):

I think he means to use rw [← qwe.a.eq_def]? Anyways, if you have an actual .1 in your context then probably something went wrong.

Robin Arnez (Nov 18 2025 at 22:09):

Did you try something like simp [qwe.a]?


Last updated: Dec 20 2025 at 21:32 UTC