I am a beginner in lean prover and I have struggled a bit with the following example:
I need to proof the following
∃ x, f x
Where f is a function defined earlier in the lean file. This seems simple enough and I can easily provide a proof in english (at least I think this is correct):
- construct an arbitrary y such that f y holds.
- By constructing an arbitrary y for which f y holds, we have proven the goal ∃ x, f x
However, translating this to lean gives me some problems. I tried using the "let" keyword to construct some arbitrary y for which f holds, but I then am unsure how to use this y to proof my goal
∃ x, f x
Is my thinking correct? How do I tackle this problem?
In Lean, the type
Existsis defined as an inductive type as below:So try either writing
refine Exists.intro y _,(if in tactic mode) orlet y := ... in Exists.intro _(if in term mode) and seeing what the_requires.