I have the following definitions for type precision:
Require Import Coq.Program.Equality.
Inductive type : Set :=
| TInt
| TFun: type -> type -> type
| TStar
.
Reserved Infix "<|" (at level 80).
(* Inductive TPrecision : type -> type -> Prop := *)
Inductive TPrecision : type -> type -> Type := (* see below *)
| PRInt : TInt <| TInt
| PRFun : forall t1 t2 t1' t2',
t1 <| t2 -> t1' <| t2' -> TFun t1 t1' <| TFun t2 t2'
| PRStar : forall t, t <| TStar
where "x '<|' y" := (TPrecision x y).
I want to prove that proofs of "x <| y" are unique:
Lemma TP_unique: forall t1 t2 (P1 P2 : t1 <| t2), P1 = P2.
With the previous definition of TPrecision, resulting in a Type, I can prove the lemma:
Proof.
intros.
dependent induction P1; dependent destruction P2; trivial.
f_equal; auto.
Qed.
However, with the "correct" definition for TPrecision, using Prop, the tactic "dependent induction" does not work, giving the following error:
Cannot infer this placeholder of type
"DependentEliminationPackage (t1 <| t2)" (no type class instance found) in
environment:
t1, t2 : type
P1 : t1 <| t2
How to provide this missing instance? (Or how to prove that lemma another way?) If I use only "induction", instead of "dependent induction", the tactic does not type-check. I also tried stating the lemma with JMeq instead of regular equality, but it didn't work either.