feat(library/data/finset): define map for finset
This commit is contained in:
parent
a24c0bf1db
commit
32b07c4561
2 changed files with 26 additions and 1 deletions
25
library/data/finset/comb.lean
Normal file
25
library/data/finset/comb.lean
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue