AFTD Auto-Formalizing Theoretical Domains

Cslib.Algorithms.Lean.TimeM

structureimported Lean

A monad for tracking time complexity of computations. TimeM T α represents a computation that returns a value of type α and accumulates a time cost (represented as a type T, typically ℕ).

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
@[ext]
structure Cslib.Algorithms.Lean.TimeM (T : Type*) (α : Type*)
Defined in
CSLib, `Cslib.Algorithms.Lean.TimeM`
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.
Verified
08 Oct 2026
Axioms
none listed
Used by 40

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
/-- A monad for tracking time complexity of computations. `TimeM T α` represents a computation that returns a value of type `α` and accumulates a time cost (represented as a type `T`, typically `ℕ`). -/
@[ext]
structure Cslib.Algorithms.Lean.TimeM (T : Type*) (α : Type*) where
  /-- The return value of the computation -/
  ret : α
  /-- The accumulated time cost of the computation -/
  time : T
See it in the graphDiscuss this resultChallenge it