Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Silly question about decidable equality and inequality

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Silly question about decidable equality and inequality


Chronological Thread 
  • From: Yannick Forster <yannick AT yforster.de>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Silly question about decidable equality and inequality
  • Date: Wed, 24 Jun 2020 09:09:10 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=Pass smtp.pra=yannick AT yforster.de; spf=Pass smtp.mailfrom=yannick AT yforster.de; spf=None smtp.helo=postmaster AT vela.uberspace.de
  • Ironport-phdr: 9a23:PBeqoxRZrNMZW7HzzgM5lvPNKNpsv+yvbD5Q0YIujvd0So/mwa69bRKN2/xhgRfzUJnB7Loc0qyK6v2mADxeqs/Y7DgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrrQjdrNQajIhjJ6o+1xfFv3RFcPlKyG11Il6egwzy7dqq8p559CRQtfMh98peXqj/Yq81U79WAik4Pm4s/MHkugXNQgWJ5nsHT2UZiQFIDBTf7BH7RZj+rC33vfdg1SaAPM32Sbc0WSm+76puVRTlhjsLOyI//WrKjMF7kaBVrw+7pxFn3oDafo+VOvp9cK3Tc9wVSmhOUdpeWSFaHoOxbJECA/YdMetWrYTwoUYFoxukBQmrAePi0j1HiWXw3a080uQuDQLG1xEgEdIJqnTUt8n1O7kIUeuoy6TJzS/Mb/VQ2Tf89IfIcQssoPGCXbJ3a8rR0lUvGB3fjlmKtIPqISqY2+IQuGeU8+RuT/igi3I7qw5vuDivwN8hhpfXio8XyF3K+zh1zYQoKdC4SEB2bsCpHYZNui+aK4d4Td4uTnx1tSsnyLAKpZy2cDQXxZkkyRDSa+GKfYiW7x/lSe2fIi94iWphdb+/nRq+7Eetx+PmWsWp0ltGsDBJnsTIu3wT0RHY99KJReFn/ki73DaCzwDT5f9AIUAzjafbNYAuwroqmZYJrETMBTH5mF/tjK+ObEor5van5/76bbr4vpOcNol0hR/iMqk2nsGyAf40PhUBUmWV4+iwyb/u8VPjTLlXivA6jLHVsJXAKsQaoq65DRVV0oEm6xunDzapytIYnX8GLF1ZexKKlIjoO1/JIPDiFve/n0qjkC1xy//bILLtGo/NIWTbkLf9YbZ97FZRxxY0zdBG/p5bFrUBIO/oVULqr9zZDho5MxSuzOr9CdV90JkeWWOVDaODPqPSqwzA2uV6KO6VIYQRpTzVKv4/5veog2Vqt0UaePyY1J0RaXu7VtphOV6FbGCk1sYIF2ELtQkWXeLtkkaeXCQVa3vkDPF03S0yFI/zVdSLfYuqmrHUhH7mTK0TXXhPDxW3KVmtd4iAXK5dOjyfJsYnjzYJT6O5QoQskx2j5lejmuhXa9HM8yhdjqrNkd185undjxY3rGcmHsqayXqRQnsykm5aHmZqjpA6mlR0zxK46YY9m+ZRTIcB9v1OSBwmOISaw+EoUt0=

I'm not sure that's helpful in your case, but

n <> 0

can also be formulated as

match n with 0 => False | S n => True end

which is irrelevant. The same should work for any equality of the form

n <> M

where M is a closed term. A bit different from Gabriel's idea, but not entirely different: you can maybe replace

n <> m

in general by

negb (eqb n m) = true

Since the latter is an equality on booleans it should also be irrelevant.

Best
Yannick

On 24/06/2020 08:51, Talia Ringer wrote:
Thanks, that is very helpful! Part of the motivation for this was trying to understand why I find it more difficult to reason about { n : nat | n <> 0 } than I do about the inductive positives. It seems like it may be easier to reason about a different refinement of nats. (This is not for personal proving purposes, just academic curiosity.)

On Tue, Jun 23, 2020, 10:31 PM Gabriel Scherer <gabriel.scherer AT gmail.com <mailto:gabriel.scherer AT gmail.com>> wrote:

Pierre-Marie's typical example defines (A -> B) in the guest type
theory as (bool * (A -> B)) in the host theory, with a
type-preserving translation, and (=) in the guest as just (=) in the
host.  For any function you can get another distinct (but observably
equivalent in the guest) function by flipping the boolean. This also
applies if B is False.

On the other hand, you could define a "smaller" type of
inequivalence for a type (as an inductive presentation if you can,
for example) that has better properties. This comes up often in
cases where you need to reason on elements being equal, as the
definition of inequivalence as a function makes it hard to reason about.
For natural numbers for example, one definition of inequivalence
might be something like

Inductive different :=
| Bigger : forall (k : nat), m = n + S k -> different m n
| Smaller : forall (k : nat), m + S k = n -> different m n.

and this one should inherit contractibility from equality.

On Wed, Jun 24, 2020 at 6:12 AM Jason Gross <jasongross9 AT gmail.com
<mailto:jasongross9 AT gmail.com>> wrote:

As I understand it, with funext, you can prove irrelevance for
all proofs of x <> y of any type (because False is an hProp). However, without funext, you can't really prove anything about
equality of most function spaces (just like without K nor
univalence, you can't really prove anything about equality of
most types).  (I think there's actually a deeper relationship
here, probably along the same lines of how univalence implies
funext.  I don't understand it fully myself, but I believe Dan
Licata has a blog post on how knowing about equality in a
universe gives you things about equality of functions between
types in that universe.). In general, I think all you can say is
that if you can prove that `A -> B` is isomorphic to some
non-arrow-type `C` when you assume funext, then you can probably
embed `C` into `A -> B` even without funext.  So you can
lower-bound the number of distinct functions of a given type,
but you can't upper-bound it without funext in general. (Exception: you can upper-bound the number of functions from `A
-> B` when `A` is inhabited and `B` is not; the upper-bound is 0.)

I believe Pierre-Marie Pedrot has some models of type-theory (or
pointers to them) which contradict funext.  I'm not sure whether
or not any of them allow for multiple proofs of `A -> False`,
though I could believe that they might.

-Jason

On Tue, Jun 23, 2020, 22:25 Talia Ringer
<tringer AT cs.washington.edu <mailto:tringer AT cs.washington.edu>>
wrote:

Hi all,

I think this should be obvious, but I'm having trouble
thinking right now. I figure I'll ask in case somebody knows
the answer.

Suppose I have a type with decidable equality, like nat.
Then provably I have that all proofs of n = m for n m : nat
are equal to each other, without assuming UIP as an axiom.
That much I know.

From this, can I say anything about proofs of n <> m for n
m : nat without assuming functional extensionality? For
example, are all proofs of 0 <> 1 equal to each other? If
not, are they provably related in any interesting way?

Talia




Archive powered by MHonArc 2.6.19+.

Top of Page