Zulip Chat Archive
Stream: general
Topic: Prove the existence of a structure which satisfy property
Alice Laroche (Aug 16 2021 at 14:14):
I have this code :
import tactic
structure Foo :=
(p₁ : ℕ)
theorem bar : ∃foo : Foo, foo.p₁ = 1:=
begin
have foo : Foo := {
p₁ := 1
},
use foo,
end
How do i resolve the goal ?
Patrick Massot (Aug 16 2021 at 14:17):
Zulip tip: you need to put the closing backticks on their own line.
Patrick Massot (Aug 16 2021 at 14:18):
Then your problem is you used have
instead of let
Patrick Massot (Aug 16 2021 at 14:18):
have
is meant to be used for proposition, so the value is immediately forgotten (because of the proof irrelevance axiom).
Alice Laroche (Aug 16 2021 at 14:19):
Thank you, yeah i understand that but i didn't know the let
alternative.
Filippo A. E. Nuccio (Aug 16 2021 at 14:21):
See also here https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/difference.20.60let.60.20and.20.60have.60
Last updated: Dec 20 2023 at 11:08 UTC