Subject: Ssreflect Users Discussion List
List archive
- From: Florian Steinberg <>
- To:
- Subject: [ssreflect] unpickle in countTypes
- Date: Wed, 7 Mar 2018 15:55:11 +0100
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.
--
Florian Steinberg
Marelle-team
INRIA Sophia-Antipolis
Email:
You can find me on github, bitbucket and researchgate
- [ssreflect] unpickle in countTypes, Florian Steinberg, 03/07/2018
- Re: [ssreflect] unpickle in countTypes, Cyril, 03/07/2018
Archive powered by MHonArc 2.6.18.