Skip to Content.
Sympa Menu

ssreflect - Re: [ssreflect] unpickle in countTypes

Subject: Ssreflect Users Discussion List

List archive

Re: [ssreflect] unpickle in countTypes


Chronological Thread 
  • From: Cyril <>
  • To: Florian Steinberg <>,
  • Subject: Re: [ssreflect] unpickle in countTypes
  • Date: Wed, 7 Mar 2018 16:00:28 +0100

Isn't that the point of the pickle_inv function?
--
Cyril

On 07/03/2018 15:55, Florian Steinberg wrote:
The unpickle function of countTypes is not required to be injective on its
domain. This confused me a lot in a proof and can easily be fixed by
replacing the unpickling function with the following function, which I think
should be saved as the unpickling function of a countType in the first place:

Definition unpickle' n: option C := if
    match unpickle n with
        | None => None
        | Some c => Some (@pickle C c)
    end == Some n
    then unpickle n else None.

Lemma pickleK' (c:C):
    unpickle' (pickle c) = Some c.
Proof. by rewrite /unpickle' pickleK; case: ifP => //; rewrite eqxx. Qed.

Lemma unpickle_inj:
    forall n c, unpickle' n = some c -> pickle c = n.
Proof.
move => n c.
rewrite /unpickle'.
case (unpickle n) => [s | ] //.
by case: eqP => // - [<-] [<-].
Qed.





Archive powered by MHonArc 2.6.18.

Top of Page