Skip to Content.
Sympa Menu

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

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [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: Re: [Coq-Club] help with automating derived UIP_refl proofs
  • Date: Sun, 28 Aug 2016 13:56:57 -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:JZx9yRcV+n7hvTyED2nG9Pg4lGMj4u6mDksu8pMizoh2WeGdxc6zZh7h7PlgxGXEQZ/co6odzbGH6ua8AidZuc3J8ChbNscdD1ld0YRetjdjKfbNMVf8Iv/uYn5yN+V5f3ghwUuGN1NIEt31fVzYry76xzcTHhLiKVg9fbytScbshsi6n9q/54fUK10RwmHsOPUud17v9V6Z9pFPx9AzcuBpklqBi0ALUtwe/XlvK1OXkkS0zeaL17knzR5tvek8/dVLS6TwcvdwZ7VZCDM7LzJ9v5Wz5lHrBDGC7XoEU2gQjgEAQ02ctEm7Dd/NtX7RsfM18y2HN4WiRrctHD+m8q1DSRnyiS5BOSRvo0/NjcklrqVdqQ6hrho354PVfoyTKLIqfKTbfNAXQWdMdslUXi1FRIi7at1cXKI6Ie9Eotyl9BM1phykCFzpXbu3xw==



On 08/28/2016 01:38 PM, Jonathan Leivent wrote:
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.

Oops - sorry - I did find an irrefutable-pattern let-in that works without a constructor pattern (hence for any single constructor):

change ((let (_) as b return foo a = b -> Prop := foo a in
fun x => x = f_equal foo (f_equal foo_a x)) e).

Sometimes, those irrefutable let-ins want the := in between the as and return clauses, sometimes after. Confusing.

OK - now the difficulty becomes how to automate this for constructors with arbitrary numbers of fields...

-- Jonathan




Archive powered by MHonArc 2.6.18.

Top of Page