coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Edsko de Vries <devriese AT cs.tcd.ie>
- To: Andrej.Bauer AT andrej.com
- Cc: Coq Mailing List <coq-club AT pauillac.inria.fr>
- Subject: Re: [Coq-Club] Continuity of coinductive definitions
- Date: Mon, 18 Feb 2008 14:32:32 +0000
- List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
Hi,
This is probably way too simplistic, and if so, I apologise :) but why
is 'halts' CoInductive? If you make 'halts' Inductive, then your proof
becomes trivial:
CoInductive sigma : Set :=
| Finished : sigma
| NotYet : sigma -> sigma.
Inductive halts : sigma -> Prop :=
| isFinished : halts Finished
| isNotYet : forall x : sigma, halts x -> halts (NotYet x).
Fixpoint haltsWithin (n : nat) (p : sigma) {struct n} : Prop :=
match n with
| O => False
| S m =>
(match p with Finished => True | NotYet q => haltsWithin m q
end)
end.
Lemma continuity :
forall p : sigma, halts p -> exists n : nat, haltsWithin n p.
Proof.
induction 1 ; intros.
exists (S 0) ; simpl ; auto.
elim IHhalts ; intros n ?.
exists (S n) ; simpl ; auto.
Qed.
(By the way, presumably you know of the Delay monad? Very similar to
your 'sigma' type).
Edsko
- [Coq-Club] Continuity of coinductive definitions, Andrej Bauer
- Re: [Coq-Club] Continuity of coinductive definitions, Adam Chlipala
- Re: [Coq-Club] Continuity of coinductive definitions, Edsko de Vries
- Re: [Coq-Club] Continuity of coinductive definitions, Pierre Casteran
- Re: [Coq-Club] Continuity of coinductive definitions, Andrej Bauer
Archive powered by MhonArc 2.6.16.