Zulip Chat Archive
Stream: Is there code for X?
Topic: Exists.choose for unique existence?
Uni Marx (Sep 12 2025 at 23:10):
Is there some analogue of Exists.choose for unique existence? The normal one works just fine, of course, but it seems "morally" wrong and maybe there is some API i am missing
Kevin Buzzard (Sep 13 2025 at 00:03):
Welcome to type theory, uniqueness doesn't help here.
Aaron Liu (Sep 13 2025 at 00:04):
the problem is if it reduces definitionally then defeq becomes undecidable
Eric Wieser (Sep 13 2025 at 00:04):
Can you give some context? Often the answer if you're having moral qualms is "don't use choose at all", either via a suitable recursor, or by changing your datatype
Aaron Liu (Sep 13 2025 at 00:06):
and if it doesn't reduce definitionally then you might as well use the stronger choice
Terence Tao (Sep 13 2025 at 03:01):
I wrote some API for this at https://github.com/teorth/analysis/blob/main/analysis/Analysis/Tools/ExistsUnique.lean
Uni Marx (Sep 13 2025 at 08:51):
I'm aware it doesn't help much either way, yeah. for context, I want to prove that simple FD representations of abelian groups are 1-dimensional, for which I was using the lemma
theorem existsUnique_smul_id_eq_of_simple [IsAlgClosed k] {V : FDRep k G} [Simple V] (f : V ⟶ V) :
∃! a : k, a • 𝟙 V = f
...but that a is just the trace, of course, and I should just refactor it to be that
Kevin Buzzard (Sep 13 2025 at 08:55):
Are you sure? Isn't this Schur's lemma?
Uni Marx (Sep 13 2025 at 09:00):
it is! it's just worded in a somewhat awkward way in its existing shape (see finrank_hom_simple_simple (how do I link these by the way? I used to know but its been a few years) and it seems convenient
Kevin Buzzard (Sep 13 2025 at 18:59):
So the nxn scalar matrix a has trace na not a. You link with docs#finrank_hom_simple_simple
Uni Marx (Sep 13 2025 at 20:03):
thank you! the trace was wrong of course, but it turns out it was unnecessary either way. see #29622
Last updated: Dec 20 2025 at 21:32 UTC