coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Lescanne <Pierre.Lescanne AT laposte.net>
- To: coq-club AT pauillac.inria.fr
- Subject: [Coq-Club] Re: about the exercise 6.46 in Coq Art book (Pierre Lescanne)
- Date: Wed, 21 Nov 2007 11:42:48 +0100
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
May I propose my solution that does not use this rather complex "first_of_htree" function:
Lemma injection : forall (n:nat) (t1 t2 t3 t4: htree nat n),
hnode nat n 0 t1 t2 = hnode nat n 0 t3 t4 -> t1=t3.
Proof.
intros n t1 t2 t3 t4 H.
change (let fst_proj:= fun (m:nat) (t: htree nat m) =>
match t in htree _ x return htree nat (pred x) with | hleaf v => hleaf nat v | hnode k _ t' _ => t' end
in fst_proj (S n) (hnode nat n 0 t1 t2) = fst_proj (S n) (hnode nat n 0 t3 t4)).
rewrite H.
trivial.
Qed.
OK I agree that the trick is to find the right function in the change tactic.
Pierre
- [Coq-Club] Re: about the exercise 6.46 in Coq Art book (Pierre Lescanne), Pierre Lescanne
Archive powered by MhonArc 2.6.16.