Zulip Chat Archive

Stream: Is there code for X?

Topic: Set from finset is finite


Marcus Rossel (Jul 04 2021 at 13:22):

Is there a lemma proving roughly that sets constructed from finsets are finite?

example {α β : Type*} (s : finset β) (f : α  β) (h : function.injective f) : { x | f x  s }.finite

Yakov Pechersky (Jul 04 2021 at 13:26):

We don't have finset.comap, hmm.

Yakov Pechersky (Jul 04 2021 at 13:27):

Ah, docs#finset.preimage

Yakov Pechersky (Jul 04 2021 at 13:27):

and docs#set.finite.preimage

Yakov Pechersky (Jul 04 2021 at 13:30):

The proof (term mode!) is pretty much exactly the statement, thanks to projection notation:

import data.set.finite

example {α β : Type*} (s : finset β) (f : α  β) (h : function.injective f) :
  { x | f x  s }.finite :=
s.finite_to_set.preimage (h.inj_on _)

Last updated: Dec 20 2023 at 11:08 UTC