forked from leanprover-community/mathlib
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(category_theory): functions to convert is_lawful_functor and is_… (
leanprover-community#1258) * feat(category_theory): functions to convert is_lawful_functor and is_lawful_monad to their corresponding category_theory concepts * Fix typo * feat(category): add mjoin_map_pure, mjoin_pure to the simpset (and use <$> notation)
- Loading branch information
Showing
4 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
import category_theory.monad.limits | ||
import | ||
category_theory.monad.limits | ||
category_theory.monad.types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/- | ||
Copyright (c) 2019 Johannes Hölzl. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Johannes Hölzl | ||
-/ | ||
|
||
import category_theory.monad.basic | ||
import category_theory.types | ||
|
||
/-! | ||
# Convert from `monad` (i.e. Lean's `Type`-based monads) to `category_theory.monad` | ||
This allows us to use these monads in category theory. | ||
-/ | ||
|
||
namespace category_theory | ||
|
||
section | ||
universes u | ||
|
||
variables (m : Type u → Type u) [_root_.monad m] [is_lawful_monad m] | ||
|
||
instance : monad (of_type_functor m) := | ||
{ η := ⟨@pure m _, assume α β f, (is_lawful_applicative.map_comp_pure m f).symm ⟩, | ||
μ := ⟨@mjoin m _, assume α β (f : α → β), funext $ assume a, mjoin_map_map f a ⟩, | ||
assoc' := assume α, funext $ assume a, mjoin_map_mjoin a, | ||
left_unit' := assume α, funext $ assume a, mjoin_pure a, | ||
right_unit' := assume α, funext $ assume a, mjoin_map_pure a } | ||
|
||
end | ||
|
||
end category_theory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters