Skip to content

feat(Classes): prove finitely-supported functions belong to FP - #16

Merged
BoltonBailey merged 5 commits into
SamuelSchlesinger:devfrom
BoltonBailey:feat/finset-domain-fp
Jul 25, 2026
Merged

feat(Classes): prove finitely-supported functions belong to FP#16
BoltonBailey merged 5 commits into
SamuelSchlesinger:devfrom
BoltonBailey:feat/finset-domain-fp

Conversation

@BoltonBailey

@BoltonBailey BoltonBailey commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

This PR adds the theorem that functions from List Bool to List Bool which return a nonempty value only on fintely many inputs are in FP.

🤖 Generated with Claude Code

Any function of the form `fun s => if s ∈ S then g s else []` with `S` a
finite set is polynomial-time computable: a work-tape-free lookup machine
hard-wires the finite table into its states, tracking viable prefixes of
`S` while scanning the input and then emitting the fixed output, all in
linear time. This gives the base case for assembling FP functions from
finitely many exceptional values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BoltonBailey
BoltonBailey marked this pull request as draft July 24, 2026 17:39
@BoltonBailey
BoltonBailey marked this pull request as ready for review July 24, 2026 17:57

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM, except can you move some of the generic names in TM under a bit more specific of a namespace?

@BoltonBailey

Copy link
Copy Markdown
Collaborator Author

Ok, I have changed the namespace to TM.FinsetDomain. It also started to seem to me like some of the defs around prefixes of Finsets were not that specific to this Turing machine so I moved them to a Mathlib folder file.

@SamuelSchlesinger

Copy link
Copy Markdown
Owner

Once CI passes we can merge! This was a nice PR: would you like to become a collaborator on the library? Happy to add you if you are interested.

@BoltonBailey

Copy link
Copy Markdown
Collaborator Author

Thanks, sure, happy to collaborate! I will try to clean up my (Fable's) work on PH and add that next. I'm interested in getting to the Sipser–Lautemann theorem

@SamuelSchlesinger

Copy link
Copy Markdown
Owner

Perfect! I'll add you. This seems reasonable, we should already have some of the infrastructure, for instance for amplification, from BPP subseteq P/poly.

@SamuelSchlesinger

Copy link
Copy Markdown
Owner

It takes so long to build, I imagine there are likely things we can do to improve that. I wonder if potentially making a cache and split it into multiple packages would be sensible given how massive this thing is getting...

@BoltonBailey
BoltonBailey merged commit 26f2235 into SamuelSchlesinger:dev Jul 25, 2026
1 check passed
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.

2 participants