coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Stéphane Glondu <steph AT glondu.net>
- To: "Samuel E. Moelius III" <moelius AT cis.udel.edu>
- Cc: coq-club AT pauillac.inria.fr
- Subject: Re: [Coq-Club] proof_irrelevance question
- Date: Sat, 01 Nov 2008 20:27:03 +0100
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
- Openpgp: id=FCE03DAA
Stéphane Glondu wrote:
>> In the following example, is use of proof_irrelevance necessary? Is
>> there some way to avoid its use when the domain of the predicate
>> involved is nat, for example?
>
> In that particular case, there might be. See the "Proof irrelevance for
> le" thread in the archives of this mailing-list.
More specifically, the following works after pasting it after Pierre
Letouzey's code from:
http://pauillac.inria.fr/pipermail/coq-club/2008/004030.html
--8<------------------------------------------------------------
Lemma lt_eq : forall x y (H1 H2: x < y), H1 = H2.
Proof.
intros.
hnf in *.
rewrite (le_eq _ _ H1 H2).
reflexivity.
Qed.
Variable n : nat.
Definition t := sig (fun i => i < n).
Definition f (x : t) : sig (fun i => i < S n).
intros [i Hi].
refine (exist _ (S i) _).
auto with arith.
Defined.
Lemma lem : forall x y, f x = f y -> x = y.
intros [x Hx] [y Hy] Heq.
injection Heq as Heq'.
clear Heq.
revert Hx Hy; rewrite Heq'; intros Hx Hy.
rewrite (lt_eq _ _ Hx Hy).
reflexivity.
Qed.
--8<------------------------------------------------------------
Cheers,
--
Stéphane Glondu
- [Coq-Club] proof_irrelevance question, Samuel E. Moelius III
- Re: [Coq-Club] proof_irrelevance question,
Stéphane Glondu
- Re: [Coq-Club] proof_irrelevance question, Stéphane Glondu
- Re: [Coq-Club] proof_irrelevance question,
Stéphane Glondu
Archive powered by MhonArc 2.6.16.