Proof. We now prove Theorem A1. We first reduce the problem into a decision problem, and then according to the definition of an NPC problem, we prove that the problem belongs to the type of NP problem, and finally, we prove that a known NPC problem can be reduced to the decision problem in polynomial time.
We first reduce the problem of finding the minimum AEs into a series of decision problems. Though many important problems are not decision problems when they appear in the most natural form, they can be reduced to a series of decision problems that are easier to study, for example, the coloring problem of a graph. When coloring the vertices of a graph, we need at least n colors to make any two adjacent vertices have different colors. Then, it can be transformed into another question. Can we color the vertices of the graph with no more than m colors, ? The first m value in the set that makes the problem solvable is the optimal solution of the coloring problem. Similarly, we can also transform the optimization problem of finding the minimum AEs into the following series of decision problems: given the precision of perturbations , and initial perturbations , , whether we can use the perturbations , to make the inequality true, and the first value in the sequence that makes the inequality true is the optimal solution of the optimization problem.
The decision problem is reduced and formalized as follows. For the neural network attribute, , is the mapping from the AEs generated by the AEs generation function to label 1, that is, . is the mapping from the AEs generated by the AEs generation function to , that is, . When , its value is 1. When , its value is 0. When there is an assignment , , is the output of the neural network and determines whether the value of the attribute is true.
Obviously, it is an problem. In the guessing stage, given any perturbations , assuming the is a candidate solution of the decision problem. Furthermore, then in the verification stage, since the process of inputting perturbations and samples to the neural network and then outputting the results can be completed in polynomial time, it is polynomial in the verification stage. Therefore, the solution to the decision problem is an uncertain polynomial algorithm. Furthermore, according to the definition of the problem, the decision problem is an problem.
Finally, we prove that any problem in can be reduced to the decision problem in polynomial time. Due to the transitivity of polynomial simplification, we can prove a known problem: the problem can be transformed into the decision problem in polynomial time and then complete this proof.
Since the problem is an problem, according to the definition of an problem—that is, any problem in the set of problems that can be reduced to an problem in polynomial time—if the problem can be reduced to the aforementioned decision problem of searching for the AEs, according to transitivity, any problem in can be reduced to that decision problem in polynomial time and it can be proven that the decision problem is an -hard problem. We then prove how the problem is Turing reduced to the decision problem.
According to the definition of an problem, given the Ternary satisfiability formula on the variable set , each clause is a disjunction of three terms: , where , and are variables from X or their negative values. The problem is turned into that determining whether there is an assignment to satisfy , that is, whether there is an assignment that makes all clauses valid at the same time.
To simplify, we first assume that the input node , and is a sub-statement constructed when the discrete value is 0 or 1. Then, we will explain how to relax this restriction so that the only restriction on the input nodes is that they are in the range of .
Firstly, we introduce the disjunctive tool, that is, given nodes
and the output node is
. When
,
, otherwise
. The following
Figure A2 shows the situation when
is the variable itself (that is, it is not the negative value of the variable).
The disjunctive tool can be seen as the process of calculating Equation (
A1):
If it has one variable of input which is at least 1, then . If all the variables of input are 0, then . The key of the tool is that the function can ensure that the output remains exactly 1 even if multiple inputs are set to 1.
For processing any negative item
, we introduce a negative tool before inputting the negative item into the disjunctive tool, as shown in
Figure A3a.
The tool that calculates
and then continues to calculate is the aforementioned disjunctive tool. The last step involves a conjunction widget, as shown in
Figure A3b.
Assuming that all nodes are in the range of , we require node Y in the range of . Obviously, this requirement only holds if all nodes are 1.
Lastly, in order to check if all the clauses
are satisfied at the same time, we construct a conjunction gadget(using the negative value tool as input as needed) and combine it with a conjunction gadget, as shown in
Figure A4.
The input variable is mapped to each node according to the definition of clause , that is, . According the above discussion, if the clause is satisfied, then ; otherwise, . Therefore, the node Y is the range of if and only if all the clauses are satisfied at the same time. Thus, an assignment of input satisfies the constraint between the input and the output of neural networks if and only if that assignment also satisfies the original item .
The above construction is based on the assumption that the input node takes values from discrete values , that is, . However, it does not accord with the assumption that is the conjunction of linear constraints. We will then prove how to relax the restriction to make the original proposition true.
Letting
is a very small number. We suppose that each variable
is in the range of
but ensure that any feasible solution satisfies
or
. We add an auxiliary gadget to each input variable
, that is, using the
function node to calculate Equation (
A2) as follows:
Furthermore, the output node of Equation (
A2) is required to be within the range
. This expression can directly indicate that when
or
, it is true for
.
The disjunctive expression in our construction is Equation (
A1). The value of its disjunctive expression changes with the inputs. If all inputs are in
or
, then at least one input is in
and then the end output node of each disjunctive gadget
will no longer use discrete values
but will be in
.
If at least one node of each input clause is in the range , then all nodes will be in and Y will be in . However, if at least one clause does not have a node in the range , Y will be less than (when ). Therefore, keeping the requirements true, if and only if is satisfied, its input and output will be satisfied, and the satisfied assignment can be constructed by making each and each . □