coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jason Gross <jasongross9 AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] UIP and decidable equality
- Date: Fri, 09 Sep 2016 18:16:09 +0000
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jasongross9 AT gmail.com; spf=Pass smtp.mailfrom=jasongross9 AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f174.google.com
- Ironport-phdr: 9a23:zuo32BBrDHnKh/Ne46u+UyQJP3N1i/DPJgcQr6AfoPdwSP7+ocbcNUDSrc9gkEXOFd2CrakV0qyI7+u5ADNIoc7Y9itTKNoUD15NoP5VtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blItdazLE4Lfx/66y/q1s8WKJV4Z3XzjPfgrdUr+7V2I8JJH2c06cud54yCKi0MAQ/5Ry2JsKADbtDfHzeD0wqRe9T9Nsekq7c9KXPayVa05SbtFEGZuaDhtt4W4/SXEGACI/z4XVngcuhtOGQnMqh/gDbnrtS6vlONm3y/SEtfxVqt8DTar9KBtRwXvkzxWHzE8+WDTzMd3ifQI81qauxVjztuMM8muP/1kc/aFcA==
The proof sketch that [nat -> bool] has UIP is that UIP respects equivalence, and the types [@eq (nat -> bool) f g] and [forall x : nat, @eq bool (f x) (g x)] are equivalent by strong function extensionality. Since [bool] has UIP, [@eq bool (f x) (g x)] is subsingleton (proof irrelevant), and so, again by function extensionality, [forall x : nat, @eq bool (f x) (g x)] is subsingleton too.
There is no internal proof that this type does not have decidable equality (after all, proof relevant excluded middle is consistent), but you can't actually algorithmically decide their equality without deciding the halting problem (let f be the function that is always false, and g(n) be true if a particular TM has halted after n steps, and false otherwise).Another way of seeing this is that there is an easy way to make a function of type [forall x : nat, @eq bool (f x) (g x)] canonical, because Boolean equality is decidable. But while canonicity plays well with all function types, decidability only plays well with finite domains.
On Fri, Sep 9, 2016, 8:14 AM Jonathan Leivent <jonikelee AT gmail.com> wrote:
On 09/09/2016 03:15 AM, Alan Schmitt wrote:
> ...
> I’m wondering about the converse: are there types for which equality is not
> decidable, but that have canonical equality proofs hence UIP?
Alan,
I have a class of types that have UIP but not eqdec ({a=b}+{a<>b}).
They have instead excluded middle of equality (a=b \/ a<>b), which I
call eqem. I had also played with the proofs in Eqdep_dec, and found
that the requirement on eqdec there could be relaxed to eqem.
For most uses in Coq, eqem is probably not very useful. However, I am
often working in a development that has proof relevance - a single Prop
that has an injection axiom on it. The reasons have to do with getting
better erasability on extractions than I can otherwise get in Coq.
Having this one Prop with injection allows me to get discrimination on
all other inductive Props, which allows me to then get eqem on many of
them, and hence UIP. Unfortunately, having a proof relevance axiom
means I can't use any axioms for proof irrelevance, so I need to prove
useful varieties, such as UIP or "irrelevant sibling" (for given prop P,
prove the existence of Q <-> P where Q is irrelevant - which I can do if
P has eqem).
I have been trying to find various ways to automate proofs of eqdec,
eqem, and UIP. I will look closely at your proof to see if I can use
it, so thanks for posting it! Also, I didn't yet get a change to
examine Dominique Larchey-Wendling's proof of UIP of sigma, but thanks
to Dominique for that as well!
Most recently, I have found a very promising way to automate proofs of
eqdec or eqem for dependent types - potentially more stable and
certainly easier to automate than what I was working on previously at
https://github.com/jonleivent/deptacs. It involves proving eqdec (or
eqem) on a sigma equality over the dependent type first.
I have wondered if it may be the case in Coq - without any axioms - that
every purely inductive non-Prop type has eqdec and hence UIP. By purely
and non-Prop, I mean not having Prop or functional typed fields,
parameters, or indices. Then, in the case of my proof relevance axiom,
this extends to eqem in any purely inductive type, even Props and with
Prop components - hence can potentially get UIP for all of them.
-- Jonathan
- [Coq-Club] UIP and decidable equality, Alan Schmitt, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Jason Gross, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Alan Schmitt, 09/09/2016
- RE: [Coq-Club] UIP and decidable equality, Soegtrop, Michael, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Alan Schmitt, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Jonathan Leivent, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Jason Gross, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Jason Gross, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Jason Gross, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Alan Schmitt, 09/12/2016
- Re: [Coq-Club] UIP and decidable equality, Jason Gross, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Jason Gross, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Jason Gross, 09/09/2016
- Re: [Coq-Club] UIP and decidable equality, Jason Gross, 09/09/2016
Archive powered by MHonArc 2.6.18.