Zulip Chat Archive

Stream: new members

Topic: proving goals with ≠


João Felipe (Dec 18 2023 at 17:21):

How do I prove goals with ?

Patrick Massot (Dec 18 2023 at 17:29):

Did you read https://leanprover-community.github.io/mathematics_in_lean/C03_Logic.html#negation already?

João Felipe (Dec 18 2023 at 17:44):

Yes, just read it. :upside_down:

Patrick Massot (Dec 18 2023 at 17:47):

So you know x ≠ y means x = y implies False. Hence a direct proof starts with intro hxy and then proves a contradiction.

João Felipe (Dec 18 2023 at 17:47):

How would I prove a contradiction then?

Mauricio Collares (Dec 18 2023 at 17:51):

Can you give us an example of a particular goal you'd like to prove?

João Felipe (Dec 18 2023 at 17:53):

1 ≠ 2 * n

João Felipe (Dec 18 2023 at 17:53):

AKA 1 is not even

Riccardo Brasca (Dec 18 2023 at 17:54):

First of all you need to find a pen and paper proof... and "it's obvious" doesn't count

João Felipe (Dec 18 2023 at 17:54):

I already did induction n and proved the zero case with Nat.one_ne_zero

Riccardo Brasca (Dec 18 2023 at 17:57):

I don't think it's necessary to use induction, you can just use cases, meaning that n is either 0 or succ k. You already did the cases 0 and 2 * (succ k) = 2 * k + 1 + 1, so if this is equal to 1 you get that 2*k + 1 = 0 that is absurd

João Felipe (Dec 18 2023 at 17:57):

Yes

Riccardo Brasca (Dec 18 2023 at 17:57):

Of course I am using other results in mathlib, and it depends on what you want to prove by yourself

Riccardo Brasca (Dec 18 2023 at 18:01):

If your question is how to prove False in general, the solution is to find a lemma that already contains (for example 0 ≠ 1) and to apply it.

Riccardo Brasca (Dec 18 2023 at 18:02):

But which lemma to use of course depends on your math proof


Last updated: Dec 20 2023 at 11:08 UTC