Cslib.Algorithms.Lean.TimeM.ret_map
theoremverifiedformalizationimported Lean
Cslib.Algorithms.Lean.TimeM.ret_map
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in @[simp, grind =] theorem Cslib.Algorithms.Lean.TimeM.ret_map {α β} (f : α → β) (x : TimeM T α) : (f <$> x).ret = f x.ret
- Formalizes
- CSLib, `Cslib.Algorithms.Lean.TimeM.ret_map`
- Lean proof
- By Sorrachai Yingchareonthawornhcai, Eric Wieser, from github.com/leanprover/cslib at
3951377e5a3f(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.33.0.Cslib.Algorithms.Lean.TimeM.ret_map← Cslib.Algorithms.Lean.TimeM.ret_map (Cslib/Algorithms/Lean/TimeM.lean:99): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none — Lean reports it depends on no axioms
- Built on 8
- Cslib.Algorithms.Lean.TimeM.instFunctorCslib.Algorithms.Lean.TimeM.instFunctor
- Cslib.Algorithms.Lean.TimeM.instSeqRightOfAddCslib.Algorithms.Lean.TimeM.instSeqRightOfAdd
- Cslib.Algorithms.Lean.TimeM.instPureOfZeroCslib.Algorithms.Lean.TimeM.instPureOfZero
- Cslib.Algorithms.Lean.TimeM.instSeqOfAddCslib.Algorithms.Lean.TimeM.instSeqOfAdd
- Cslib.Algorithms.Lean.TimeM.instBindOfAddCslib.Algorithms.Lean.TimeM.instBindOfAdd
- Cslib.Algorithms.Lean.TimeMA monad for tracking time complexity of computations.
TimeM T αrepresents a computation that returns a value of typeαand… - Cslib.Algorithms.Lean.TimeM.instMonadOfAddZeroCslib.Algorithms.Lean.TimeM.instMonadOfAddZero
- Cslib.Algorithms.Lean.TimeM.instSeqLeftOfAddCslib.Algorithms.Lean.TimeM.instSeqLeftOfAdd
- Used by 20
- Cslib.Algorithms.Lean.TimeM.mergeSort_timeTime complexity of mergeSort
- Cslib.Algorithms.Lean.TimeM.merge_permCslib.Algorithms.Lean.TimeM.merge_perm
- Cslib.Algorithms.Lean.TimeM.mergeMerges two lists into a single list, counting comparisons as time cost. Returns a
TimeM ℕ (List α)where the time represents the number… - Cslib.Algorithms.Lean.TimeM.mergeSort_time_leCslib.Algorithms.Lean.TimeM.mergeSort_time_le
- Cslib.Algorithms.Lean.TimeM.mergeSort_permCslib.Algorithms.Lean.TimeM.mergeSort_perm
- Cslib.Algorithms.Lean.TimeM.tickCreates a
TimeMcomputation with a time cost. - Cslib.Algorithms.Lean.TimeM.mergeSort_sortedCslib.Algorithms.Lean.TimeM.mergeSort_sorted
- Cslib.Algorithms.Lean.TimeM.merge_timeCslib.Algorithms.Lean.TimeM.merge_time
- Cslib.Algorithms.Lean.TimeM.ret_tickCslib.Algorithms.Lean.TimeM.ret_tick
- Cslib.Algorithms.Lean.TimeM.mergeSort_correctMergeSort is functionally correct.
- Cslib.Algorithms.Lean.TimeM.time_pureCslib.Algorithms.Lean.TimeM.time_pure
- Cslib.Algorithms.Lean.TimeM.mergeSort_same_lengthCslib.Algorithms.Lean.TimeM.mergeSort_same_length
- Cslib.Algorithms.Lean.TimeM.sorted_mergeCslib.Algorithms.Lean.TimeM.sorted_merge
- Cslib.Algorithms.Lean.TimeM.instLawfulMonad
TimeMis lawful so long as addition in the cost is associative and absorbs zero. - Cslib.Algorithms.Lean.TimeM.mergeSortSorts a list using the merge sort algorithm, counting comparisons as time cost. Returns a
TimeM ℕ (List α)where the time represents the… - Cslib.Algorithms.Lean.TimeM.time_tickCslib.Algorithms.Lean.TimeM.time_tick
- Cslib.Algorithms.Lean.TimeM.timeMergeSortRec_leSolve the recurrence
- Cslib.Algorithms.Lean.TimeM.merge_ret_length_eq_sumCslib.Algorithms.Lean.TimeM.merge_ret_length_eq_sum
- Cslib.Algorithms.Lean.TimeM.mem_either_mergeCslib.Algorithms.Lean.TimeM.mem_either_merge
- Cslib.Algorithms.Lean.TimeM.ret_mergeOur merge computes the one already in mathlib.
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in @[simp, grind =] theorem Cslib.Algorithms.Lean.TimeM.ret_map {α β} (f : α → β) (x : TimeM T α) : (f <$> x).ret = f x.ret := rfl