2

Example:

Require Import Basics.
Require Export Setoid.
Require Export Relation_Definitions.
Set Implicit Arguments.

Lemma simple1 (A B : Prop) (f : A -> B) (x : A) : B.
Proof.
  assert (f2: impl A B) by exact f.
  setoid_rewrite <- f2.
  exact x.
Qed.

Lemma simple2 (A B : Prop) (f : A -> B) (x : A) : B.
Proof.
  setoid_rewrite <- f.
  exact x.
Qed.

simple1 works, but simple2 fails with

Ltac call to "setoid_rewrite (orient) (glob_constr_with_bindings)" failed.
Ltac call to "setoid_rewrite (orient) (glob_constr_with_bindings)" failed.
Cannot find a relation to rewrite.

I'd like to use rewrite_strat/Hint Rewrite's discrimination tree to write my own proof search, using the impl relation to simulate apply. But setoid_rewrite only works with impl if I restate lemmas using impl instead of ->, which is annoying. Is there any way to get setoid_rewrite to accept lemmas of type A -> B and use the impl relation?

fread2281
  • 1,136
  • 1
  • 11
  • 31
  • A possible workaround is to replace all the usual logical implications in the context with the ones based on `impl`, e.g. `repeat match goal with | f : ?A -> ?B, A : Prop, B : Prop |- _ => (change (A -> B) with (impl A B) in f) end.` – Anton Trunov Oct 20 '18 at 17:16
  • Oh, and I forgot to mention that you would need to modify the script above to adopt it to nested arrows like `A -> B -> C`, etc. – Anton Trunov Oct 21 '18 at 07:18

0 Answers0