coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Ralf Jung <jung AT mpi-sws.org>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Feature Request: Sealed definitions
- Date: Wed, 24 Feb 2016 14:51:28 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jung AT mpi-sws.org; spf=Pass smtp.mailfrom=jung AT mpi-sws.org; spf=None smtp.helo=postmaster AT hera.mpi-klsb.mpg.de
- Ironport-phdr: 9a23:SQTbNRDCP3Z9YjlI6YzQUyQJP3N1i/DPJgcQr6AfoPdwSP75rsbcNUDSrc9gkEXOFd2CrakU1KyL4+u9AiQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTokb3isMCIKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FppIZ8VvDxeL19RrhFBhwnNXo07Yvlr0rtVwyKs0EVVmtesAdODECR7gz8Ub/0qiq/rfVmni6AMpulHvgPRT2+4vIzG1fTgyAdOmth/Q==
Hi,
> Oh, but you also want the equality lemma.
Right :)
> Then you can do something like:
>
> Definition x : nat := 1.
>
> Definition x_aux : { x':_ & x' = x }.
> exact (existT _ _ eq_refl). Qed.
> Definition x_sealed := projT1 x_aux.
> Definition x_sealed_eq : x_sealed = x := projT2 x_aux.
>
> Which is, I admit, not ideal from a syntactic point of view. However,
> note that the type and definition of x appear only once.
Thanks, this indeed looks nicer than using modules!
Unfortunately, if the type of x is more complicated, this loses all the
information about implicit arguments: If some arguments of "x" were made
implicit by putting them in "{...}", these are all explicit for
x_sealed. So the type has to be repeated, or at least the implicitness
information has to be declared again with Arguments.
Kind regards,
Ralf
- [Coq-Club] Feature Request: Sealed definitions, Ralf Jung, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jeehoon Kang, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Robbert Krebbers, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jacques-Henri Jourdan, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jacques-Henri Jourdan, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Ralf Jung, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jacques-Henri Jourdan, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Arnaud Spiwack, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Robbert Krebbers, 02/25/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Arnaud Spiwack, 02/25/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Robbert Krebbers, 02/25/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jacques-Henri Jourdan, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Ralf Jung, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jacques-Henri Jourdan, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jacques-Henri Jourdan, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jacques-Henri Jourdan, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Robbert Krebbers, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Ralf Jung, 02/24/2016
- Re: [Coq-Club] Feature Request: Sealed definitions, Jeehoon Kang, 02/24/2016
Archive powered by MHonArc 2.6.18.