Suppose I have the following type of record:
Record R (A : Type) (P : A -> Prop) := {val : A; prop : P val}.
To prove that two such records are equal, it is sufficient (by proof irrelevance) to prove that their fields val
are equal:
Goal forall A P (r1 r2 : R A P), val _ _ r1 = val _ _ r2 -> r1 = r2.
destruct r1, r2.
simpl.
intro H.
revert prop0.
rewrite H.
intros.
f_equal.
apply proof_irrelevance.
Qed.
Is a similar goal provable (possibly relying on a safe axiom) in the case of John Major's equality? Here is my failed attempt:
Goal forall A1 A2 P1 P2 (r1 : R A1 P1) (r2 : R A2 P2),
JMeq (val _ _ r1) (val _ _ r2) -> JMeq r1 r2.
destruct r1, r2.
simpl.
intro H.
revert prop0.
Fail rewrite H.