In mathematical logic, a witness is a specific value to be substituted for variable of an existential statement of the form such that is true.
For example, a theory T of arithmetic is said to be inconsistent if there exists a proof in T of the formula "0 = 1". The formula I(T), which says that T is inconsistent, is thus an existential formula. A witness for the inconsistency of T is a particular proof of "0 = 1" in T.
Boolos, Burgess, and Jeffrey (2002:81) define the notion of a witness with the example, in which S is an n-place relation on natural numbers, R is an (n+1)-place recursive relation, and ↔ indicates logical equivalence (if and only if):
S(x1, ..., xn) ↔ ∃y R(x1, . . ., xn, y)
"A y such that R holds of the xi may be called a 'witness' to the relation S holding of the xi (provided we understand that when the witness is a number rather than a person, a witness only testifies to what is true)."In this particular example, the authors defined s to be (positively) recursively semidecidable, or simply semirecursive.
In predicate calculus, a Henkin witness for a sentence
\existsx\varphi(x)
The notion of witness leads to the more general idea of game semantics. In the case of sentence
\existsx\varphi(x)
\varphi
\forallx\existsy\varphi(x,y)
\existsf\forallx\varphi(x,f(x))