Zero equivalence
zero_equivalent#
Default context
zero_equivalent(
input_expression: ExpressionLike,
constraint: Optional[ExpressionLike] = None,
) -> strCalling forms
Explicit context: Context.zero_equivalent
zero_equivalent(
input_expression: ExpressionLike,
constraint: Optional[ExpressionLike] = None,
) -> strExpression method: Expression.zero_equivalent
zero_equivalent(constraint: Optional[ExpressionLike] = None) -> strProves whether an expression is zero at every point where the input expression is defined within
the declared region. "true" is an exact theorem replay, "false" has an exact counterexample,
and "unknown" is an honest decline. Floating-point evaluation is never proof evidence.
The optional logical constraint is combined with existing symbol assumptions without changing
them. A "true" result does not mean simplify(expression) may replace the expression by the
literal 0: that stricter transformation also needs the expression to be defined everywhere in
the declared region.
The admitted routes are the principal-branch Gudermannian identity for a real variable on
-pi/2 < x < pi/2, the Riemann zeta reflection relation, and an exact decision for closed
algebraic constants. The zeta relation remains a nonzero-shaped expression under ordinary
simplification because its written factors have exceptional points.
The closed-constant decision covers every constant built from rationals, the imaginary unit,
exp(i*pi*r), sin, cos, tan, cot, sec and csc at rational multiples r*pi, and
certified algebraic roots (polynomial_root), by sums, products, integer powers and principal
rational powers, nested to any depth. Such a constant is reduced in a tower over the cyclotomic
field of order N, the least common multiple of the denominators of its angles, with each
principal radical and each algebraic root adjoined by its defining relation. A radicand whose
value lies exactly on the negative real axis takes the principal root |w|^(1/L)*exp(i*pi/L)
once its realness is proved from the certified roots of its minimal polynomial.
The minimal polynomial of the reduced element over the rationals then decides it: a nonzero
constant term proves the constant nonzero, and otherwise a certified enclosure with exact
rational bounds either excludes zero or lies inside the root-separation bound of that polynomial,
which proves the constant is zero. The presented roots of the cyclotomic polynomials, and of cubics
solved by the triple-angle formula, verify this way. A transcendental argument such as cos(1),
a cyclotomic order above 720, a tower of dimension above 64, or an enclosure that does not decide
within 4096 bits of working precision returns "unknown".
import symi
context = symi.Context()
relation = context.parse("2^(1-z)*cos(pi*z/2)*gamma(z)*zeta(z) - pi^z*zeta(1-z)")
print(context.zero_equivalent(relation))