Zulip Chat Archive

Stream: new members

Topic: not_eq_impl_false


Cypooos (Apr 18 2021 at 15:15):

Hello !

I'm a new member who just started learning Lean with The Natural Number Game.

I want to prove in intuitionistic logic this property (I've started a bit)

example (A : Prop) : ( B : Prop, (((A  B)  A)  A))  (¬¬ A  A) :=
begin
  intros h nnA,
  have choose_B_false := h (false),

end

And now I need to use the definition of not : implie false.
Where can I find such a property ? And for the future, where can I easely find them ?

Should I use axiom ? And how ?

Thanks for the answers ^^

Patrick Massot (Apr 18 2021 at 15:26):

Lean knows about the definition, you don't need to "use it".

Patrick Massot (Apr 18 2021 at 15:27):

If you want to help your eyes, you can type things like: change ¬ A → false at nnA,

Patrick Massot (Apr 18 2021 at 15:27):

Do you know about the apply tactic? And about false.elim?

Cypooos (Apr 18 2021 at 15:28):

I know about the apply one, not the false.elim

Patrick Massot (Apr 18 2021 at 15:29):

Maybe you know the exfalso tactic then?

Patrick Massot (Apr 18 2021 at 15:30):

Anyway, false.elim will take as input a proof of false and output a proof of whatever you want.

Cypooos (Apr 18 2021 at 15:31):

yes but I've never used it.

I know how to solve the puzzle, I just want to write the proof in Lean. Maybe you want me to tell you how ?

Patrick Massot (Apr 18 2021 at 15:31):

Oh sure.

Patrick Massot (Apr 18 2021 at 15:32):

I thought you didn't want spoilers.

Patrick Massot (Apr 18 2021 at 15:32):

Give 30 seconds to launch the web editor from your snippet

Patrick Massot (Apr 18 2021 at 15:32):

example (A : Prop) : ( B : Prop, ((A  B)  A)  A)  (¬¬ A  A) :=
begin
  intros h nnA,
  have choose_B_false := h (false),
  apply choose_B_false,
  intro hnA,
  exact false.elim (nnA hnA),
end

Patrick Massot (Apr 18 2021 at 15:33):

This is using your beginning.

Patrick Massot (Apr 18 2021 at 15:33):

It can be compressed a lot of course.

Patrick Massot (Apr 18 2021 at 15:34):

example (A : Prop) : ( B : Prop, ((A  B)  A)  A)  (¬¬ A  A) :=
λ h nnA, h false (λ hnA, (nnA hnA).elim)

Cypooos (Apr 18 2021 at 15:34):

Yeah I just need to understand it now. What does false.elim ? I've read the doc but I didn't really truly understand it.

Cypooos (Apr 18 2021 at 15:35):

Patrick Massot said:

example (A : Prop) : ( B : Prop, ((A  B)  A)  A)  (¬¬ A  A) :=
λ h nnA, h false (λ hnA, (nnA hnA).elim)

That's dense

Patrick Massot (Apr 18 2021 at 15:35):

If you are interested in pure logic rather than regular maths (as I gather from the fact that you know the words "intuitionistic logic") then we have great resources for you, search for "Logic and proof" and "Theorem proving in Lean" on https://leanprover-community.github.io/learn.html

Cypooos (Apr 18 2021 at 15:36):

Definitely going to look at this !

Thanks !

Patrick Massot (Apr 18 2021 at 15:38):

We don't mind answering beginners questions, but you'll have a far less frustrating experience if you try to follow Theorem proving in Lean instead of trying to get away with explanation from the natural number game.

Cypooos (Apr 18 2021 at 15:40):

I will then. Sorry to bother !

Patrick Massot (Apr 18 2021 at 15:40):

There is no problem at all!


Last updated: Dec 20 2023 at 11:08 UTC