feat(library/data/finset): define map for finset

This commit is contained in:
Leonardo de Moura 2015-04-10 17:14:10 -07:00
parent a24c0bf1db
commit 32b07c4561
2 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1,25 @@
/-
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Module: data.finset
Author: Leonardo de Moura
Combinators for finite sets
-/
import data.finset.basic
open list quot subtype decidable perm function
namespace finset
variables {A B : Type}
variable [h : decidable_eq B]
include h
definition map (f : A → B) (s : finset A) : finset B :=
quot.lift_on s
(λ l, to_finset (list.map f (elt_of l)))
(λ l₁ l₂ p, quot.sound (perm_erase_dup_of_perm (perm_map _ p)))
theorem map_empty (f : A → B) : map f ∅ = ∅ :=
rfl
end finset

View file

@ -7,4 +7,4 @@ Author: Leonardo de Moura
Finite sets
-/
import data.finset.basic data.finset.bigop
import data.finset.basic data.finset.comb data.finset.bigop