Zulip Chat Archive
Stream: new members
Topic: Exists from forall
VayusElytra (Aug 01 2024 at 19:57):
A stupid question, suppose you have a situation like the following:
lemma SomeLemma (N : Set ℕ) (P : ℕ → Prop) (h : (∀ x ∈ N, P x)) : (∃ x ∈ N, P x) := by
sorry
How can you extract one element of N to prove this theorem?
Nick Attkiss (Aug 01 2024 at 20:06):
I think you need to assume that N is nonempty to prove this, otherwise the forall statement can hold vacuously while the exists statement is false
VayusElytra (Aug 01 2024 at 20:09):
My bad, it definitely needs that extra assumption. To make it more in line with what I am working on:
lemma SomeLemma (N : Set ℕ) (h₁ : N ∈ atTop) (P : ℕ → Prop) (h : (∀ x ∈ N, P x)) : (∃ x ∈ N, P x) := by
sorry
N in atTop should guarantee non-emptiness.
Etienne Marion (Aug 01 2024 at 20:21):
Using docs#Filter.nonempty_of_mem you get N.Nonempty
, which you can destruct into an element in N
. Then you can just apply h
to this element.
VayusElytra (Aug 01 2024 at 21:02):
Thank you, that worked perfectly :)
Last updated: May 02 2025 at 03:31 UTC