Here's some of the law in the area of prosecutorial discretion:
In the ordinary case, “so long as the prosecutor has probable cause to
believe that the accused committed an offense defined by statute, the
decision whether or not to prosecute, and what charge to file or bring
before a grand jury, generally rests entirely in his discretion.”
Bordenkircher v. Hayes, 434 U.S. 357, 364, 98 S. Ct. 663, 668, 54 L.Ed.2d 604 (1978).
Of course, a prosecutor's discretion is “subject to constitutional
constraints.” United States v. Batchelder, 442 U.S. 114, 125, 99 S.
Ct. 2198, 2204–2205, 60 L.Ed.2d 755 (1979). One of these constraints,
imposed by the equal protection component of the Due Process Clause of
the Fifth Amendment, Bolling v. Sharpe, 347 U.S. 497, 500, 74 S. Ct.
693, 694–695, 98 L.Ed. 884 (1954), is that the decision whether to
prosecute may not be based on “an unjustifiable standard such as race,
religion, or other arbitrary classification,” Oyler v. Boles, 368
U.S. 448, 456, 82 S. Ct. 501, 506, 7 L.Ed.2d 446 (1962). A defendant
may demonstrate that the administration of a criminal law is “directed
so exclusively against a particular class of persons ... with a mind
so unequal and oppressive” that the system of prosecution amounts
to “a practical denial” of equal protection of the law. Yick Wo v.
Hopkins, 118 U.S. 356, 373, 6 S. Ct. 1064, 1073, 30 L.Ed. 220 (1886).
In order to dispel the presumption that a prosecutor has not violated
equal protection, a criminal defendant must present “clear evidence to
the contrary.” Chemical Foundation, supra, at 14–15, 47 S. Ct., at
6. We explained in Wayte why courts are “properly hesitant to examine the decision whether to prosecute.” 470 U.S., at 608, 105 S.
Ct., at 1531. Judicial deference to the decisions of these executive
officers rests in part on an assessment of the relative competence of
prosecutors and courts. “Such factors as the strength of the case, the
prosecution's general deterrence value, the Government's enforcement
priorities, and the case's relationship to the Government's overall
enforcement plan are not readily susceptible to the kind of analysis
the courts are competent to undertake.” Id., at 607, 105 S. Ct., at
1530. It also stems from a concern not to unnecessarily impair the performance of a core executive constitutional function. “Examining
the basis of a prosecution delays the criminal proceeding, threatens
to chill law enforcement by subjecting the prosecutor's motives and
decisionmaking to outside inquiry, and may undermine prosecutorial
effectiveness by revealing the Government's enforcement policy.”
Ibid.
United States v. Armstrong, 517 U.S. 456, 464–65 (1996).