coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Adam Chlipala <adam AT chlipala.net>
- To: Gert Smolka <smolka AT ps.uni-saarland.de>
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Inductive family of finite types
- Date: Tue, 28 Jun 2011 11:11:35 -0400
Gert Smolka wrote:
Am 28.06.2011 15:50, schrieb Paolo Herms:
Try dependent destruction k.
You first need to Require Import Program.Equality.
Thanks. This does the job but uses the assumption
JMeq_eq : forall (A : Type) (x y : A), x ~= y -> x = y
Is there a proof without assumptions?
Yes:
Definition out n (k : Fin n) :=
match k in Fin n return match n return Fin n -> Type with
| O => fun _ => Empty_set
| S n' => fun k => {k' | k = FinS _ k'} + {k = FinO _}
end k with
| FinO _ => inright _ (refl_equal _)
| FinS _ _ => inleft _ (exist _ _ (refl_equal _))
end.
Definition Fin1 (k : Fin 1) : k = FinO 0 :=
match out _ k with
| inleft (exist k' _) => match out _ k' with end
| inright pf => pf
end.
- [Coq-Club] Inductive family of finite types, Gert Smolka
- Re: [Coq-Club] Inductive family of finite types, Adam Chlipala
- <Possible follow-ups>
- Re: [Coq-Club] Inductive family of finite types,
Paolo Herms
- Re: [Coq-Club] Inductive family of finite types,
Gert Smolka
- Re: [Coq-Club] Inductive family of finite types, Adam Chlipala
- Re: [Coq-Club] Inductive family of finite types,
Gert Smolka
- Re: [Coq-Club] Inductive family of finite types, Daniel Schepler
- Re: [Coq-Club] Inductive family of finite types,
Gert Smolka
- Re: [Coq-Club] Inductive family of finite types, Adam Chlipala
- Re: [Coq-Club] Inductive family of finite types,
Gert Smolka
- Re: [Coq-Club] Inductive family of finite types, ahrens
Archive powered by MhonArc 2.6.16.