I am trying to show that the various definitions of the reflexive-transitive closure are equivalent. Here is code that works:
Require Import Coq.Relations.Relation_Definitions.
Require Import Coq.Relations.Relation_Operators.
Hint Constructors clos_refl_trans.
Hint Constructors clos_refl_trans_1n.
Lemma clos_refl_trans_1n_right:
forall {A: Type} {R: relation A} (x y: A),
clos_refl_trans A R x y -> clos_refl_trans_1n A R x y.
Proof.
intros A R x y H.
induction H as [ | | x y z _ IH1 _ IH2]; eauto.
induction IH1; eauto.
Qed.
Note the underscores denoting thrown away variables. If I give those variables names, the automation fails:
Lemma clos_refl_trans_1n_right:
forall {A: Type} {R: relation A} (x y: A),
clos_refl_trans A R x y -> clos_refl_trans_1n A R x y.
Proof.
intros A R x y H.
induction H as [ | | x y z H1 IH1 H2 IH2]; eauto.
induction IH1; eauto. (* three subgoals left *)
Fail Qed.
Upon examination, we find that the inner induction hypotheses are weaker in the second example. It looks like the induction tactic is detecting a behind-the-scenes dependency between the problematic assumptions and the object of the inner induction.
Is this documented anywhere? What's the rationale, and how can I predict that it will happen?