Skip to content

refactor(Computability): remove h_mono from PolyTimeComputable.comp - #845

Open
BoltonBailey wants to merge 3 commits into
leanprover:mainfrom
BoltonBailey:remove-h-mono
Open

BoltonBailey wants to merge 3 commits into
leanprover:mainfrom
BoltonBailey:remove-h-mono

Conversation

@BoltonBailey

@BoltonBailey BoltonBailey commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

fixes #378.

This removes the h_mono : Monotone hg.timeBound assumption from PolyTimeComputable.comp, by providing a way to convert a (poly)time-computable function into one with a monotone time bound.

This PR supersedes #396, because that one seems abandoned, and it looks like this change is desired by some others.

Co-authored-by: John Jennings JohnEdwardJennings@users.noreply.github.com
Co-authored-by: Aristotle (Harmonic) aristotle-harmonic@harmonic.fun

🤖 Generated with Claude Code

@BoltonBailey
BoltonBailey marked this pull request as draft August 28, 2026 19:55
@BoltonBailey
BoltonBailey marked this pull request as ready for review August 28, 2026 20:20

@crei crei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I'm not a big fan of pulling in all of polynomials just to define polynomial time, but this is a good increment, and we need the machinery in any case.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Looks good to me! It just needs a rebase: the conflict is only the RelatesInSteps import path after #926. Optionally, the polynomial lemmas could use Semiring instead of CommSemiring, and eval_le_eval_of_le could become a @[gcongr] eval_mono.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved whenever you rebase, ideally include the recommended improvements but we can do them in a follow on if not.

BoltonBailey and others added 3 commits September 23, 2026 16:39
…able.comp

Add TimeComputable.withMonotoneBound and PolyTimeComputable.withMonotoneBound,
which replace a time bound with its partialSups (a monotone bound), and use
them in PolyTimeComputable.comp so callers no longer need to supply a
monotonicity proof. Add Polynomial.monotone_eval for canonically ordered
semirings in Cslib/Foundations/Data/Polynomial/Monotone.lean.

Supersedes leanprover#396.

Co-authored-by: John Jennings <JohnEdwardJennings@users.noreply.github.com>
Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

remove h_mono assumption

3 participants