Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Proof irrelevance for equalities - is there a trick without axioms?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Proof irrelevance for equalities - is there a trick without axioms?


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: "Soegtrop, Michael" <michael.soegtrop AT intel.com>, "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Proof irrelevance for equalities - is there a trick without axioms?
  • Date: Wed, 17 Aug 2016 17:56:52 +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-f173.google.com
  • Ironport-phdr: 9a23:RhNrRRTtxtx83i367EHRi3siW9psv+yvbD5Q0YIujvd0So/mwa65YRSN2/xhgRfzUJnB7Loc0qyN4vmmAzVLuM7e+DBaKdoXBkdD0Z1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYnbr+tQt2asc272qiI9oHJZE0Q3XzmMOo0dkz99F2O/olO2M05e/53kkOI6lJzOM1ujVtyIlySmxuuruyRx7VEtxpqhvQ66sRbWr/7dalrBZZRDTAhLnxnrJaz7UqLZUK163AdSmQblAZTS0iAtUmiH8S5jiyv/NF61SaGJ8ruCfgRWD+i5qpvAle8jSYMNzc09CfMjcF/kLhcuDqgoQByx8jfZ4TDcLI0daTEONgeWGBpX8BLViUHDJn2J98ECPNENuJFpaH8oUEPpF2wH1//Kvnoz2pqj2Tx2+UVyeM6CkmS3gU7GNQBqnPPt4TdO6IbUOTzx67Nm2aQJ8hK0CvwvdCbOisqpuuBCPcpKZLc

Note that [refine] is doing a lot of inference for you here.  The resulting proof term is:
match
  H1 as H2 in (_ = c)
  return
    (match c as x return (Eq = x -> Type) with
     | Eq => fun h : Eq = Eq => feq eq_refl = feq h
     | Lt => fun _ : Eq = Lt => IDProp
     | Gt => fun _ : Eq = Gt => IDProp
     end H2)
with
| eq_refl => eq_refl
end


The reason that this works is that [comparison] has decidable equality, and, as shown by UIP_dec, any type with decidable equality satisfies uniqueness of identity proofs (i.e., proof irrelevance for [eq]).  This return clause is basically an inlining and simplification of the composition of the decidable equality of [comparison] with the proof that decidable equality implies UIP.



On Wed, Aug 17, 2016 at 9:23 AM John Wiegley <johnw AT newartisans.com> wrote:
>>>>> "SM" == Soegtrop, Michael <michael.soegtrop AT intel.com> writes:

SM> I am stuck with a proof that two proofs of equality are equal:

SM> Goal forall (T : Type) (feq : Eq=Eq->T) (H1 : Eq=Eq), feq eq_refl = feq
SM> H1. intros.

SM> As far as I know "@eq_refl comparison Eq" is the only possible proof of
SM> Eq=Eq, so shouldn't all proofs of Eq=Eq be equal to "@eq_refl comparison
SM> Eq" ? Is there a way to prove this?

Goal forall (T : Type) (feq : Eq=Eq->T) (H1 : Eq=Eq), feq eq_refl = feq H1.
Proof.
  intros.
  refine (match H1 with
          | eq_refl _ => _ |
          end).
  reflexivity.
Qed.

--
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



Archive powered by MHonArc 2.6.18.

Top of Page