CostM.parList
defimported Lean
N-ary parallel composition over a List of independent CostM operands. Returns are paired into a list in the original order; the cost is the sup of all operand costs (or ⊥ for the empty list).
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in universe u in variable {C : Type*} {A B : Type u} in def CostM.parList [SemilatticeSup C] [OrderBot C] (ms : List (CostM C A)) : CostM C (List A)
- Defined in
- EconCSLib, `CostM.parList`
- Lean proof
- By xbei (from the file's git history), from github.com/gametheoryinlean/EconCSLib at
1a88f809b538(Copyright (c) 2025 Sorrachai Yingchareonthawornhcai. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.30.0.CostM.parList← CostM.parList (EconCSLib/Foundation/CostM.lean:286): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 26
- CostM.instCoeHeadCoerce a
CostM C Ato its return value, dropping the cost. Use this in contexts where the expected type isA; pair with.costfor… - CostM.instLawfulMonad
CostM Cis a lawful monad wheneverCis an additive monoid. - CostM.ret_parCostM.ret_par
- CostM.ret_tickCostM.ret_tick
- CostM.cost_parCostM.cost_par
- CostM.cost_tickCostM.cost_tick
- CostMWriter monad over an arbitrary additive monoid
C. ACostM C Ais a return value of typeAtogether with an accumulated cost inC.… - CostM.ret_pureCostM.ret_pure
- CostM.ret_bindCostM.ret_bind
- CostM.ret_mapCostM.ret_map
- CostM.ret_seqLeftCostM.ret_seqLeft
- CostM.ret_seqRightCostM.ret_seqRight
- CostM.ret_seqCostM.ret_seq
- CostM.cost_pureCostM.cost_pure
- CostM.cost_bindCostM.cost_bind
- CostM.cost_mapCostM.cost_map
- CostM.cost_seqLeftCostM.cost_seqLeft
- CostM.cost_seqRightCostM.cost_seqRight
- CostM.cost_seqCostM.cost_seq
- CostM.instPureCostM.instPure
- CostM.instBindCostM.instBind
- CostM.instFunctorCostM.instFunctor
- CostM.instSeqCostM.instSeq
- CostM.instSeqLeftCostM.instSeqLeft
- CostM.instSeqRightCostM.instSeqRight
- CostM.instMonadCostM.instMonad
- CostM.instCoeHeadCoerce a
- Used by 4
- CostM.ret_parListCostM.ret_parList
- CostM.cost_parList_consCostM.cost_parList_cons
- CostM.parList_nilCostM.parList_nil
- CostM.cost_parListCostM.cost_parList
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in universe u in variable {C : Type*} {A B : Type u} in /-- N-ary parallel composition over a `List` of independent `CostM` operands. Returns are paired into a list in the original order; the cost is the sup of all operand costs (or `⊥` for the empty list). -/ def CostM.parList [SemilatticeSup C] [OrderBot C] (ms : List (CostM C A)) : CostM C (List A) := ⟨ms.map (·.ret), ms.foldr (fun m acc => m.cost ⊔ acc) ⊥⟩