coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "Luke Palmer" <lrpalmer AT gmail.com>
- To: "Mailing list Coq" <coq-club AT pauillac.inria.fr>
- Subject: [Coq-Club] Problems with coinduction
- Date: Fri, 10 Oct 2008 14:46:52 -0600
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=dfxjYp7N7550zNTR5ULJ4WHJEVyI5K1Ajl9hEkMFhzPC4G1lVM0wP5c5R/NnMD8srM ZLU4aZKmhIEMPCgI1zRJQdpM/GBhrSL2pz1FpARVwPob5IKEZYd+AoFloNQqpeKzr/pI GYzyh1FMIHgWQFm627g2q5wD/tEXLCbogHXZA=
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Hi, I'm having some trouble doing some simple coinduction. Here is a
simplified case that I have the same problem with:
CoInductive Seq : Type :=
| cons : nat -> Seq -> Seq.
CoFixpoint mapSeq (f : nat->nat) (seq:Seq) :=
match seq with
| cons n s' => cons (f n) (mapSeq f s')
end.
CoInductive IncreasingFrom : nat -> Seq -> Prop :=
| increasing_next : forall n n' rest, n <= n' -> IncreasingFrom n' rest
-> IncreasingFrom n (cons n' rest).
Definition monotone f := forall x y, x <= y -> f x <= f y.
Lemma monotone_map : forall f x seq, IncreasingFrom x seq ->
IncreasingFrom (f x) (mapSeq f seq).
intro f.
cofix.
intros.
destruct H.
And here I get stuck. The goal is [IncreasingFrom (f n) (mapSeq f
(cons n' rest))]. I would like to change that to [IncreasingFrom (f
x) (cons (f n') (mapSeq f rest))], but coinductive types have this odd
unfolding rule that I can't figure out how to apply.
Thanks,
Luke
- [Coq-Club] Problems with coinduction, Luke Palmer
- Re: [Coq-Club] Problems with coinduction, Stéphane Glondu
- <Possible follow-ups>
- Re: [Coq-Club] Problems with coinduction, harke
Archive powered by MhonArc 2.6.16.