The first projection of a pair is polynomial-time computable
ProvedPvsNP.isPolyTime_fstLet and be types with canonical bitstring encodings, and encode a pair as the self-delimiting block of the encoding of its first component followed by the encoding of its second component,
where replaces each payload bit by the two bits and terminates the block with . Then the first projection is computable in polynomial time by a two-stack Turing machine with respect to these encodings.
Concretely, the machine has to output given : it reads the input from the left, and as long as it sees the flag bit it copies the following payload bit, stopping at the terminator and discarding the remainder of the input. This is a purely syntactic scan that does not depend on the encodings of and , and it runs in time linear in the length of the input (the stack discipline of the machine model may require one auxiliary reversal, which is again linear).
The statement is the projection half of the elementary toolkit for polynomial-time computability: combined with closure under composition, it shows that a polynomial-time decision procedure for a problem yields a polynomial-time verifier that ignores its witness.
import Definitions.Def_PvsNP_complexity_classes
namespace PvsNP
theorem isPolyTime_fst {α β : Type} [BitstringEncoding α] [BitstringEncoding β] :
IsPolyTime (Prod.fst : α × β → α) := by sorry
end PvsNP