Cslib.FreeM.Interprets.liftM
theoremverifiedformalizationimported Lean
Cslib.FreeM.Interprets.liftM
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in universe u v w w' w'' in variable {F : Type u → Type v} {ι : Type u} {α : Type w} {β : Type w'} {γ : Type w''} in variable {m : Type u → Type w} [Monad m] {α β : Type u} in theorem Cslib.FreeM.Interprets.liftM (handler : {ι : Type u} → F ι → m ι) : Interprets handler (·.liftM handler : FreeM F α → _)
- Formalizes
- CSLib, `Cslib.FreeM.Interprets.liftM`
- Lean proof
- By Tanner Duve, Eric Wieser, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2025 Tanner Duve. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Cslib.FreeM.Interprets.liftM← Cslib.FreeM.Interprets.liftM (Cslib/Foundations/Control/Monad/Free.lean:296): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none — Lean reports it depends on no axioms
- Built on 29
- Cslib.FreeM.liftM_seqLeftCslib.FreeM.liftM_seqLeft
- Cslib.FreeM.liftM_bindCslib.FreeM.liftM_bind
- Cslib.FreeM.liftM_seqRightCslib.FreeM.liftM_seqRight
- Cslib.FreeM.liftM_liftCslib.FreeM.liftM_lift
- Cslib.FreeM.InterpretsA predicate stating that
interp : FreeM F α → m αis an interpreter for the effect handlerhandler : ∀ {α}, F α → m α. This means that… - Cslib.FreeM.liftM_seqCslib.FreeM.liftM_seq
- Cslib.FreeM.liftM_mapCslib.FreeM.liftM_map
- Cslib.FreeMThe Free monad over a type constructor
F. AFreeM F ais a tree of operations from the type constructorF, with leaves of typea.… - Cslib.FreeM.liftMInterpret a
FreeM Fcomputation into any monadmby providing an interpretation function for the effect signatureF. This function… - Cslib.FreeM.instBindCslib.FreeM.instBind
- Cslib.FreeM.liftLift an operation from the effect signature
Finto theFreeM Fmonad. - Cslib.FreeM.pure_eq_pureCslib.FreeM.pure_eq_pure
- Cslib.FreeM.bind_eq_bindNote that this lemma does not always apply, as it is universe-constrained by
Bind.bind. - Cslib.FreeM.map_eq_mapNote that this lemma does not always apply, as it is universe-constrained by
Functor.map. - Cslib.FreeM.liftBind_eqCslib.FreeM.liftBind_eq
- Cslib.FreeM.pure_bind
.pure afollowed bybindcollapses immediately. - Cslib.FreeM.bind_pureCslib.FreeM.bind_pure
- Cslib.FreeM.bind_pure_compCslib.FreeM.bind_pure_comp
- Cslib.FreeM.map_pureCslib.FreeM.map_pure
- Cslib.FreeM.map_bindCslib.FreeM.map_bind
- Cslib.FreeM.id_mapCslib.FreeM.id_map
- Cslib.FreeM.liftM_pureCslib.FreeM.liftM_pure
- Cslib.FreeM.liftM_lift_bindCslib.FreeM.liftM_lift_bind
- Cslib.FreeM.instPureCslib.FreeM.instPure
- Cslib.FreeM.instFunctorCslib.FreeM.instFunctor
- Cslib.FreeM.instLawfulFunctorCslib.FreeM.instLawfulFunctor
- Cslib.FreeM.instMonadCslib.FreeM.instMonad
- Cslib.FreeM.instLawfulMonadCslib.FreeM.instLawfulMonad
- PFunctor.FreeM.Interprets.liftMPFunctor.FreeM.Interprets.liftM
- Used by 1
- Cslib.FreeM.Interprets.iffThe universal property of the free monad
FreeM. That is,liftM handleris the unique interpreter that extends the effect handler…
- Cslib.FreeM.Interprets.iffThe universal property of the free monad
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in universe u v w w' w'' in variable {F : Type u → Type v} {ι : Type u} {α : Type w} {β : Type w'} {γ : Type w''} in variable {m : Type u → Type w} [Monad m] {α β : Type u} in theorem Cslib.FreeM.Interprets.liftM (handler : {ι : Type u} → F ι → m ι) : Interprets handler (·.liftM handler : FreeM F α → _) where apply_pure _ := rfl apply_lift_bind _ _ := rfl