Skip to Content.
Sympa Menu

coq-club - [Coq-Club] help with automating derived UIP_refl proofs

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] help with automating derived UIP_refl proofs


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: [Coq-Club] help with automating derived UIP_refl proofs
  • Date: Sun, 28 Aug 2016 13:38:27 -0400
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f169.google.com
  • Ironport-phdr: 9a23:AddEKx1pRH4wNkOnsmDT+DRfVm0co7zxezQtwd8ZsegfKPad9pjvdHbS+e9qxAeQG96KsrQY0KGP6/uoGTRZp83Q6DZaKN0EfiRGoP1epxYnDs+BBB+zB9/RRAt+Iv5/UkR49WqwK0lfFZW2TVTTpnqv8WxaQU2nZkJLL+j4UrTfk96wn7jrvcaCOkMU33HkOeg6bE3v616A7o9O2coqA51y4yOBmmFPdeVSyDEgDnOotDG42P2N+oV++T9bofMr+p0Ie6z7e6MlUe4QV2x+YCgdrffmvhjbTAaJ+mBUEiBPykIJUED560TRWY65mS/nvKIp0y6DeMbyULocWDK47q4tRgW+2wkdMDts0mbRg9BwhaQThB+guRF538aAYoaTNflzeq7QVdwfTGtFGM1WUnoSUcuHc4ITAr9Zbq5jpI7nqg5L9EPmCA==

I have the following proof of a lemma that derives UIP_refl of a simple inductive (Foo) from UIP_refl of its only field (A):

Variable A : Type.
Hypothesis A_UIP_refl : forall (a : A)(e : a=a), e=eq_refl.

Inductive Foo := foo (a:A).
Definition foo_a (f : Foo) := let '(foo a) := f in a.

Lemma Foo_UIP_refl : forall (f : Foo)(e: f=f), e=eq_refl.
Proof.
intros f e.
destruct f.
change eq_refl with (f_equal foo (eq_refl a)).
rewrite <- (A_UIP_refl a (f_equal foo_a e)).
change (match foo a as b return foo a = b -> Prop with
| foo _ => fun x => x = f_equal foo (f_equal foo_a x)
end e).
case e.
reflexivity.
Qed.

[The proof is based on those at the end of Coq.Logic.Eqdep_dec.]

The question is - can one prove this lemma without using that "change (match ...)" tactic, or any other that requires a Gallina match that embeds a foo constructor pattern ("foo _" here)? Because there is no way to create a Gallina match pattern in Ltac for an arbitrary inductive type, hence the above proof can't be automated via Ltac for other single-constructor-single-field types. Also, there doesn't seem to be any irrefutable-pattern let-in with return clause that can be used in place of the match for single field constructors and that doesn't use a foo constructor pattern.

-- Jonathan





Archive powered by MHonArc 2.6.18.

Top of Page