Let $F$ be an endofunctor on the category $\mathbf{Set}$. How can I construct the free monad over $F$? Can this construction be generalized to other categories than $\mathbf{Set}$?
2026-03-25 11:05:16.1774436716
The free monad over an endofunctor on $\mathcal{Set}$
296 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in CATEGORY-THEORY
- (From Awodey)$\sf C \cong D$ be equivalent categories then $\sf C$ has binary products if and only if $\sf D$ does.
- Continuous functor for a Grothendieck topology
- Showing that initial object is also terminal in preadditive category
- Is $ X \to \mathrm{CH}^i (X) $ covariant or contravariant?
- What concept does a natural transformation between two functors between two monoids viewed as categories correspond to?
- Please explain Mac Lane notation on page 48
- How do you prove that category of representations of $G_m$ is equivalent to the category of finite dimensional graded vector spaces?
- Terminal object for Prin(X,G) (principal $G$-bundles)
- Show that a functor which preserves colimits has a right adjoint
- Show that a certain functor preserves colimits and finite limits by verifying it on the stalks of sheaves
Related Questions in ADJOINT-FUNCTORS
- Show that a functor which preserves colimits has a right adjoint
- How do I apply the Yoneda lemma to this functor?
- Determining Left Adjoint of Forgetful Functor from $\tau_{*}$ to $\tau$
- What is the left adjoint to forgetful functor from Mod(R) to Ab
- Does the left adjoint to the forgetful functor have another left adjoint?
- Is coreflectiveness transitive?
- Group algebra functor preserves colimits
- Intuition for remembering adjunction chirality
- Does the inverse image sheaf functor has a left adjoint?
- Significance of adjoint relationship with Ext instead of Hom
Related Questions in CONSTRUCTIVE-MATHEMATICS
- How do set theories base on Intuitionistic Logic deal with ordinals?
- Constructive Proof- How to Start?
- Does Diaconescu's theorem imply cubical type theory is non-constructive?
- Attempt at constructive proof of compactness of [0,1], does this use LEM? Does a constructive proof exist?
- Constructive proof of existence of maximal ideal
- Is there a theorem that can easily be proved to be non intuitionistic?
- What kinds of variables range over proofs?
- Construct a real $x$ such that ZF does not prove whether $x\in\mathbb{Q}$
- Infinitesimal Approaches To Differential Geometry As Conservative Extension
- Confusion around quantifiers in intuitionistic logic
Related Questions in MONADS
- Description of the 2-monads for (strict) monoidal categories
- free commutative monoid monad
- Permutation monad
- Continuation-passing style and the lambda calculus
- Some simple operators in the Lambda calculus and their interpretation
- A few questions about continuations and the continuation monad
- the List-Permutation (C0)Monad
- What is the string diagram for the Bimonad law
- Computing a factorization of a monad
- Forgetful functor from category of directed graphs is monadic.
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
Let's investigate the specific case of free monads over $\newcommand\catname\mathbf\newcommand\Set{\catname{Set}}\Set\newcommand\Mnd{\catname{Mnd}}\newcommand\into\hookrightarrow\newcommand\id{\mathrm{id}}$, and the relationship to the Haskell free monad.
Free Monads in General:
First the general case of what a free monad is. (There are more general notions, but this corresponds to the Haskell notion.) Note that I am not writing the forgetful functor from monads in $C$, $\Mnd_C$, to the endofunctor category, $[C,C]$, explicitly.
Let $F: C\to C$ be an endofunctor. A monad $(T,\mu_T,\iota_T)$ is a free monad for $F$ if for monads $(S,\mu_S,\iota_S)$ we have a natural isomorphism $$[C,C](F,S) \simeq \Mnd_C(T,S).$$ The functor on the right is corepresentable, so a natural transformation $$\Mnd_C(T,S)\to [C,C](F,S)$$ is determined by an element $\alpha$ of $[C,C](F,T)$ by Yoneda's lemma. The free monad is usually considered to be the pair $(T,\alpha)$.
The Haskell Free Monad:
Let $\newcommand{\Hask}{\catname{Hask}}\Hask$ be the "category" of Haskell types (not quite a category, but it's close enough for our discussion).
Then the definition of the Free monad type in Haskell looks like this
For the non-Haskellers, this translates to if $F:\Hask\to\Hask$ is a functor, the free monad functor $T$ is defined by the equation $T-=-\amalg FT-$.
Then the natural inclusion $A\into TA$ is the identity for the monad, and the multiplication $\mu: T^2A\to TA$ is defined by observing $T^2A=TA\amalg FT^2A$ and defining $\mu$ to satisfy $\mu = \id \amalg F\mu$.
You'll notice we had to solve several equations here, which aren't problems in $\Hask$ because types and functions can be defined recursively, so these equations define valid types and functions.
We should also show that this definition of
Free fgives a free functor forf. The natural transformation fromftoFree fis justFree . fmap return, but I'll leave the verification out for now.Translating to Set:
Now let's translate this to $\Set$. It seems like a reasonable guess that solving the equations for $T$ and $\mu$ are where we might run into problems. I'll have to return to this later though, so I'll post this partial answer.
Now we are working with $F : \Set\to \Set$. For each ordinal $\alpha$ define functors $F_\alpha$, with $F_0=\newcommand\Id{\mathrm{Id}}\Id$, $F_{\alpha+1}=-\sqcup FF_\alpha -$, and $F_\beta = \newcommand\colim{\operatorname{colim}} \colim_{\alpha \in \beta} F_\alpha$ when $\beta$ is a limit ordinal. When $\alpha \le \beta$, there are natural maps $F_\alpha\to F_\beta$, which are constructed at the same time as $F_\beta$, so that the colimit makes sense for limit ordinals. The only map that needs to be constructed explicitly is the map $\iota_\alpha: F_\alpha\to F_{\alpha+1}$. $\iota_0 : F_0\to F_1$ is clear, this is just the inclusion of $X$ in $X\sqcup FX$ for all $X$. If $\alpha=\gamma+1$, then $F_\alpha - = -\sqcup FF_\gamma -$. Then by induction $F\iota_\gamma : FF_\gamma \to FF_\alpha$, so $$\iota_\alpha = \id \sqcup F\iota_\gamma$$ works. On the other hand, if $\alpha$ is a limit ordinal, for $\gamma \in \alpha$, define $j_\gamma : F_\gamma \to F_{\alpha+1}$ by the following formulas. $j_0$ is the inclusion of $F_0=\Id$ into $F_{\alpha+1}$, $$j_{\delta+1} = \id \sqcup F (F_\delta\to F_\alpha),$$ and for limit ordinals $\delta$, $$j_{\delta} = F_\delta \newcommand\toby\xrightarrow\toby{\iota_{\delta}} F_{\delta+1}\toby{j_{\delta+1}} F_{\alpha+1}.$$ It's not hard to show that these $j$s commute with the $\iota$s, and thus induce the desired map $\iota_{\alpha}: F_\alpha\to F_{\alpha+1}$.
This completes our construction of the functors $F_\alpha$. Note that since we have $F\to F_1$, and $\Id\to F_0$, for all $\alpha \ge 1$, we have maps $F\to F_\alpha$ and $\Id \to F_\alpha$. We can think of these as being approximations to a solution to our equation.
We also need an approximation of our multiplication. Let $i_{\alpha,\beta} : F_\alpha\to F_\beta$ be the maps constructed above. Define $\mu_{\alpha,\beta}: F_\alpha F_\beta \to F_{\alpha+\beta}$ recursively. (Side note, ordinal addition is noncommutative, but I don't remember which order is correct. I think I may want $\beta+\alpha$ here actually, but this can be deduced from the definition of $\mu$ that I give.) We have $$\mu_{0,\beta} = \id,$$ $$\mu_{\alpha+1,\beta} = i_{\beta,\alpha+\beta+1} \sqcup F\mu_{\alpha,\beta},$$ and in the limit ordinal case, $$\mu_{\alpha,\beta} = \colim_{\gamma\in\alpha} i_{\gamma+\beta,\alpha+\beta}\circ \mu_{\gamma,\beta}.$$
Then if the sequence $F_\alpha$ stabilizes eventually, we see that we can solve the equations defining the free monad in $\Set$.
There's quite a bit more to add here, but once again, I'll have to leave it at a partial answer for now.