Zulip Chat Archive

Stream: new members

Topic: Help proving tautology


Mikaël Mayer (Sep 12 2025 at 19:28):

I don't know how to prove this:

theorem beq_refl (T: Type) [BEq T] (x : T) : (x == x) = true := by
  simp

In general, as a new lean user, what do you use to find which tactics can apply on a given proof goal?

Robin Arnez (Sep 12 2025 at 19:34):

It's false, you need the ReflBEq assumption. Take for example Float where nan != nan

Robin Arnez (Sep 12 2025 at 19:35):

theorem beq_refl (T : Type u) [BEq T] [ReflBEq T] (x : T) : (x == x) = true :=
  BEq.refl x

Mikaël Mayer (Sep 12 2025 at 19:35):

Oh, so == is just a syntactic sugar for a non-interpreted operation?

Mikaël Mayer (Sep 12 2025 at 19:35):

Thank you very much for the insight !

Robin Arnez (Sep 12 2025 at 19:35):

Well, it's notation for the operation that's provided through [BEq T] and you can use anything for that

Robin Arnez (Sep 12 2025 at 19:36):

In constrast, x = x is actually mathematical equality

Kenny Lau (Sep 12 2025 at 20:40):

Mikaël Mayer said:

as a new lean user

could I ask for more context?

Kenny Lau (Sep 12 2025 at 20:41):

i'm asking because the code you typed doesn't look like a code i would type, so i'm wondering if you're interested in a different part of the library

Robin Arnez (Sep 12 2025 at 21:10):

Mikaël Mayer schrieb:

In general, as a new lean user, what do you use to find which tactics can apply on a given proof goal?

You can try try? or exact? or apply? or rw?

Alfredo Moreira-Rosa (Sep 12 2025 at 21:22):

also hint to find tactics (will suggest simp, aesop, ring, etc)

Robin Arnez (Sep 13 2025 at 12:16):

Yeah, hint is planned to be replaced by try?

Alfredo Moreira-Rosa (Sep 13 2025 at 16:42):

Robin Arnez said:

Yeah, hint is planned to be replaced by try?

but at the moment they give completely different results. sometimes try? don't find anything while hint does and vice versa. So some kind of unification is needed first ?

Robin Arnez (Sep 13 2025 at 17:21):

Yeah I suppose that will happen eventually

Mikaël Mayer (Sep 15 2025 at 14:45):

as a new lean user

could I ask for more context?
i'm asking because the code you typed doesn't look like a code i would type, so i'm wondering if you're interested in a different part of the library

It was a small reproduction of something I did not know how to prove. I'm working in the Strata open-source project.

You can try try? or exact? or apply? or rw?

Thank that was definitely useful advice ! For me "hint" returns "unknown tactic"

Alfredo Moreira-Rosa (Sep 15 2025 at 20:31):

to have hint available, you need to import Mathlib.Tactic i think


Last updated: Dec 20 2025 at 21:32 UTC