Library rt.util.powerset
Require Import rt.util.tactics.
Section PowerSet.
(* Based on https://www.ps.uni-saarland.de/formalizations/fset/html/libs.fset.html *)
Definition powerset {T: eqType} (l: seq T) : seq (seq T) :=
let mT := ((size l).-tuple bool) in
(map (fun m : mT ⇒ (mask m l)) (enum {: mT})).
Lemma mem_powerset {T: eqType} (x: seq T) y :
y \in (powerset x) → {subset y ≤ x}.
End PowerSet.
Section PowerSet.
(* Based on https://www.ps.uni-saarland.de/formalizations/fset/html/libs.fset.html *)
Definition powerset {T: eqType} (l: seq T) : seq (seq T) :=
let mT := ((size l).-tuple bool) in
(map (fun m : mT ⇒ (mask m l)) (enum {: mT})).
Lemma mem_powerset {T: eqType} (x: seq T) y :
y \in (powerset x) → {subset y ≤ x}.
End PowerSet.