Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Polynomial-time functions admit tagged pairing on a shared input

Proved
CookPvsNP.polyTimeComputable_tagged_pair

by Weiqiang · Nov 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

Let f:A∗→B∗f:A^*\to B^*f:A∗→B∗ and g:A∗→C∗g:A^*\to C^*g:A∗→C∗ be polynomial-time functions on words over finite alphabets. Write u#vu\#vu#v for a tagged copy of uuu, a fresh separator, and a tagged copy of vvv. Then the function

x⟼f(x)#g(x)x\longmapsto f(x)\#g(x)x⟼f(x)#g(x)

is polynomial-time computable on a deterministic one-tape Turing machine. The same input supplies both computations. This closure property is used to implement the answer map in the composition of Levin reductions.

Preamble
import Definitions.Def_CookPvsNP_defs

Formal statement
namespace CookPvsNP

theorem polyTimeComputable_tagged_pair {A B C : Type} [Fintype A] [Fintype B] [Fintype C]
    (f : List A → List B) (g : List A → List C)
    (hf : PolyTimeComputable f) (hg : PolyTimeComputable g) :
    PolyTimeComputable (fun x => (f x).map (some ∘ Sum.inl) ++ none :: (g x).map (some ∘ Sum.inr)) := by sorry

end CookPvsNP
Source
Cook, The P versus NP Problem, Appendix (one-tape Turing machine model), https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf . Standard closure construction for the tagged pairing used in polynomial-time search reductions.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me