Skip to content

feat(TimeM): relate timed costs to big-O - #1083

Open
cdbattags wants to merge 1 commit into
leanprover:mainfrom
cdbattags:feat/timem-asymptotics
Open

cdbattags wants to merge 1 commit into
leanprover:mainfrom
cdbattags:feat/timem-asymptotics

Conversation

@cdbattags

Copy link
Copy Markdown

Mathlib's Asymptotics.IsBigO and IsTheta compare two functions along a filter. TimeM.time is one scalar, so a size-indexed computation does not fit that API by itself.

This adds TimeM.isBigO and TimeM.isTheta in Cslib/Algorithms/Lean/TimeM/Asymptotics.lean. They coerce (cost n).time to ℝ and ask Mathlib whether that function of n is big-O or big-Theta of g at Filter.atTop. The module is separate from TimeM.lean so existing TimeM clients do not import analysis.

lake build Cslib.Algorithms.Lean.TimeM.Asymptotics succeeded, and lake exe mk_all left the new import in Cslib.lean.

Drafted with Grok 4.7, the 500k-context high-effort setting, in Cursor. I used it to read TimeM and Mathlib's Asymptotics.IsBigO / IsTheta and to write these two definitions. This repository has no LLM-generated label; the disclosure above is the step CONTRIBUTING.md asks for, via the Mathlib policy.

- Lift a size-indexed TimeM cost to Mathlib IsBigO and IsTheta
- Keep the import off TimeM.lean so other clients do not pull analysis
@cdbattags cdbattags changed the title feat(TimeM): relate timed costs to big-O feat(TimeM): relate timed costs to big O Oct 6, 2026
@cdbattags cdbattags changed the title feat(TimeM): relate timed costs to big O feat(TimeM): relate timed costs to big-O Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant