Functoriality of Finset #
This file defines the functor structure of Finset.
TODO #
Currently, all instances are classical because the functor classes want to run over all types. If instead we could state that a functor is lawful/applicative/traversable... between two given types, then we could provide the instances for types with decidable equality.
Functor #
Because Finset.image requires a DecidableEq instance for the target type, we can only
construct Functor Finset when working classically.
Equations
@[simp]
Pure #
Applicative functor #
Equations
theorem
Finset.image₂_def
[(P : Prop) → Decidable P]
{α β γ : Type u}
(f : α → β → γ)
(s : Finset α)
(t : Finset β)
:
Finset.image₂ in terms of monadic operations. Note that this can't be taken as the definition
because of the lack of universe polymorphism.
Monad #
Alternative functor #
Equations
Traversable functor #
def
Finset.traverse
{α β : Type u}
{F : Type u → Type u}
[Applicative F]
[CommApplicative F]
[DecidableEq β]
(f : α → F β)
(s : Finset α)
:
F (Finset β)
Traverse function for Finset.
Equations
Instances For
@[simp]
@[simp]
@[simp]
theorem
Finset.map_traverse
{α β γ : Type u}
{G : Type u → Type u}
[Applicative G]
[CommApplicative G]
(g : α → G β)
(h : β → γ)
(s : Finset α)
: