Zulip Chat Archive
Stream: general
Topic: lemma about finset cardinatlity
Frederick Pu (Mar 02 2025 at 00:28):
Is there a lemma showing that for any finite set A : Set T, there is function f : Fin A.card -> T such that Finset.image f Finset.univ = A
Frederick Pu (Mar 02 2025 at 00:32):
another variation is that if [LinearOrder T] then for any finite set A : Set T there is a function f : Fin A.card -> T such that StrictMono f and Finset.image f Finset.univ = A
Eric Wieser (Mar 02 2025 at 01:43):
Is docs#Finset.orderIsoOfFin helpful?
Frederick Pu (Mar 02 2025 at 03:01):
ig, but i think a lemma of the specific form im talking about could be useful
Frederick Pu (Mar 02 2025 at 03:01):
would it be possible to open an issue for this
Matt Diamond (Mar 02 2025 at 03:58):
I suppose you could do something like this:
import Mathlib
example (A : Set T) (hA : A.Finite) : ∃ (f : Fin (Nat.card A) → T), Set.range f = A :=
by
have := hA.to_subtype
use Subtype.val ∘ (Finite.equivFin A).symm.toFun
simp
but then again, you could just use (Finite.equivFin A).symm directly...
Frederick Pu (Mar 02 2025 at 04:00):
hmm maybe there's a constructive way of making the StrictMono mapping function then
Matt Diamond (Mar 02 2025 at 04:03):
wouldn't Finset.orderIsoOfFin give you that mapping? I'm not sure what you're looking for
Matt Diamond (Mar 02 2025 at 04:04):
you could get StrictMono out of that pretty easily
Frederick Pu (Mar 02 2025 at 04:05):
yeah thanks! that's exactly what I'm looking for
Frederick Pu (Mar 02 2025 at 04:05):
is there a lemma that says orderIsoOfFin is StrictMono?
Matt Diamond (Mar 02 2025 at 04:06):
it's an order iso, so you can use docs#OrderIso.strictMono
Matt Diamond (Mar 02 2025 at 04:10):
yeah thanks! that's exactly what I'm looking for
okay cool... that was what Eric suggested above
Yury G. Kudryashov (Mar 31 2025 at 23:23):
See also docs#Finset.orderEmbOfFin
Last updated: May 02 2025 at 03:31 UTC