Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Continuity of coinductive definitions

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Continuity of coinductive definitions


chronological Thread 
  • 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





Archive powered by MhonArc 2.6.16.

Top of Page