swh:1:snp:deb9fd355bffe3d96f042bd4e5113afbb0d7cbb2
Tip revision: 0e369749080b67c4ca4b0693da61afa7d69c118d authored by Pierre-Yves Strub on 15 October 2019, 08:38:08 UTC
Merge branch '1.0' into deploy-derandomize
Merge branch '1.0' into deploy-derandomize
Tip revision: 0e36974
FinType.eca
(* --------------------------------------------------------------------
* Copyright (c) - 2012--2016 - IMDEA Software Institute
* Copyright (c) - 2012--2018 - Inria
* Copyright (c) - 2012--2018 - Ecole Polytechnique
*
* Distributed under the terms of the CeCILL-B-V1 license
* -------------------------------------------------------------------- *)
(* -------------------------------------------------------------------- *)
require import AllCore List.
(* -------------------------------------------------------------------- *)
type t.
op enum : t list.
op card : int = size enum.
axiom enum_spec : forall x, count (pred1 x) enum = 1.
(* -------------------------------------------------------------------- *)
lemma enumP : forall x, mem enum x.
proof.
move=> x; have: 0 < count (pred1 x) enum by rewrite enum_spec.
by move/has_count/hasP; case=> y [h @/pred1 <-].
qed.
lemma enum_uniq : uniq enum.
proof. by apply/count_mem_uniq=> x; rewrite enumP enum_spec. qed.
lemma card_gt0 : 0 < card.
proof.
rewrite /card; have: mem enum witness by rewrite enumP.
by case: enum=> //= x s _; rewrite addzC ltzS size_ge0.
qed.