Skip to Content.
Sympa Menu

coq-club - [Coq-Club] How should I deal systematically with evars which are functions?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] How should I deal systematically with evars which are functions?


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: [Coq-Club] How should I deal systematically with evars which are functions?
  • Date: Sat, 24 Oct 2015 21:48:15 -0400
  • Authentication-results: mail2-smtp-roc.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-ob0-f177.google.com
  • Ironport-phdr: 9a23:JEF3mxXZkt0qtVIedCBEcCPEvk3V8LGtZVwlr6E/grcLSJyIuqrYZhCOt8tkgFKBZ4jH8fUM07OQ6PC9HzRQqs/e4TgrS99laVwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8Kum9IIPOlcP/j7n0oM2OJV0Yz2PiMPtbF1afk0b4joEum4xsK6I8mFPig0BjXKBo/15uPk+ZhB3m5829r9ZJ+iVUvO89pYYbCf2pN/dwcbsNBzM/dmsx+cej4RLEVE6E4mYWemQQiBtBRQbfukLURJD05wnzre17kAaAOtbtBeQ2UC+l6ahxTwTz2Q8IMjc49Cfcjckm3/ETmw6ouxEqm92cW4qSLvcrJq4=

Coq 8.4 (pl6) behaves very, very poorly when dealing with functions which are evars.  Is there any systematic to deal with evars which are functions?

In particular, I am trying dealing with something like the following (except much more complicated, where I do many refinements to split up evars and do rewriting under various binders, etc, before trying to instantiate the evar):

Goal exists f : nat -> nat, ((forall x, f x = x) -> (forall y, f y = y)) -> (forall z, f z = z).
Proof.
  clear; eexists; intros H y.
  refine (_ : (fun w => _) y = _); cbv beta in *.
  Fail revert y. (* The command has indeed failed with message:
=> Error: Refiner was given an argument
    "(?16420:forall y : nat, ?3711 = y) y" of type
   "?3711 = y" instead of "?3711 = y". *)
  match goal with |- ?lhs = _ => set (LHS := lhs) in * end.
  revert y; subst LHS.
  refine (H _); clear H.
  intro x.
  Fail reflexivity. (* Toplevel input, characters 0-11:
Error: Impossible to unify "?3711" with "x".
                     *)
  Fail instantiate (1 := x). (* Error: Instance is not well-typed in the environment of ?3711 *)
  Fail instantiate (1 := z). (* Error: Instance is not well-typed in the environment of ?3711 *)
  instantiate (1 := y).
  Fail reflexivity. (* => Error: Impossible to unify "x" with "_UNBOUND_REL_2". *)
  Fail abstract reflexivity. (* => Error: Impossible to unify "x" with "_UNBOUND_REL_1". *)
  Undo.
  instantiate (1 := w).
  Fail reflexivity. (* Error: Impossible to unify "x" with "_UNBOUND_REL_1". *)
  abstract reflexivity. (* success?! *)
Qed.


Is there any way to automatically discover the appropriate name "w"?  The best I can think of is to walk the structure of the term, unifying it bit by bit, and then try [try (instantiate (1 := v); abstract reflexivity)] for each name v that I introduced in binders anywhere in the proof.  This seems fragile and poor, so I am looking for a better way to do it, that works in Coq 8.4.

Thanks,
Jason


  • [Coq-Club] How should I deal systematically with evars which are functions?, Jason Gross, 10/25/2015

Archive powered by MHonArc 2.6.18.

Top of Page