Zulip Chat Archive

Stream: new members

Topic: Get ℕ that is ∉ finset


Marcus Rossel (Mar 03 2021 at 12:45):

Given f : finset ℕ, how can one obtain an x : ℕ with x ∉ f?
Since f is finite, there must exists such an x, but I'm struggling to obtain one.
My idea would be to get the maximal element m in f and then set x := m + 1. One could then prove that all elements in f have the property of being less than m, and since x does not, it can't be an element in f.
But this seems pretty contrived to me.
Is there an easier way, that I'm overlooking?

Johan Commelin (Mar 03 2021 at 12:46):

Well, you'll have to use that nat is infinite.

Johan Commelin (Mar 03 2021 at 12:48):

That's in data.fintype.basic

Johan Commelin (Mar 03 2021 at 12:48):

docs#finset.not_mem_range_self

Johan Commelin (Mar 03 2021 at 12:49):

together with docs#finset.subset_range_sup_succ

Mario Carneiro (Mar 03 2021 at 12:57):

That should be a theorem about infinite

Mario Carneiro (Mar 03 2021 at 12:59):

And it already exists: docs#infinite.exists_not_mem_finset

Marcus Rossel (Mar 03 2021 at 12:59):

Ah dang it, I was almost done with the lemma :D

Marcus Rossel (Mar 03 2021 at 12:59):

Thanks!

Mario Carneiro (Mar 03 2021 at 13:00):

It's pretty easy to prove by contrapositive, since otherwise f enumerates the type

Marcus Rossel (Mar 03 2021 at 13:01):

Mario Carneiro said:

It's pretty easy to prove by contrapositive, since otherwise f enumerates the type

How would one prove that kind of thing?

Mario Carneiro (Mar 03 2021 at 13:01):

lemma exists_not_mem_finset [infinite α] (s : finset α) :  x, x  s :=
not_forall.1 $ λ h, not_fintype s, h

Mario Carneiro (Mar 03 2021 at 13:02):

not_forall is proving exists by contradiction, not_fintype is the definition of infinite, and the "meat" of the proof is literally the constructor for fintype, hence ⟨s, h⟩

Marcus Rossel (Mar 03 2021 at 13:04):

I have much to learn :D

Ruben Van de Velde (Mar 03 2021 at 13:09):

That's what we call a proof that's not optimized for reading :)

The thing I still missed after the explanation is that fintype is defined as "there's a finset (s) that contains all the values of the type (h)"

Mario Carneiro (Mar 03 2021 at 13:10):

I prefer the term "slick proof" :)

Kevin Buzzard (Mar 03 2021 at 13:21):

The thing I like about slick proofs is that they are perfect for situations where the statement you're proving is mathematically trivial, because they say "yes, our system and our library makes this a triviality just as it should be", and furthermore it doesn't matter if the proof is obfuscated because the result is trivial so you will not learn anything mathematically from the proof anyway, hence it doesn't need to be read


Last updated: Dec 20 2023 at 11:08 UTC