Skip to content

Simplify can stop before its own answer is simplified #2133

Closed

Description

@Rafael-SOWNet

Simplify can return an answer that one more Simplify takes further, here to 0:

Input Simplify Simplify of that
R^2 - R^2*(a+b)*(1/a+1/b)/4 - R^2*(a-b)*(1/a-1/b)/4 R ^ 2 + -1/2 * (R ^ 2 + R ^ 2) provided not a = 0 and not b = 0 0 provided …
a*b*c*(1/a+1/b+1/c) - (a*b+b*c+c*a) a * b + b * (-a + c) + -b * c provided … 0
(a*b+b*c+c*a)/3 - (a*b*c)*(1/a+1/b+1/c)/3 ((-a + a) * (b + c) + c * (-b + b)) / 3 provided … 0

In each case the input is written slightly differently from one that reaches 0 in a single pass:

  • With x in place of R^2, the first row gives 0 provided ….
  • The second row with its difference reversed gives 0 provided ….

The third answer contains -a + a itself, and InnerSimplified leaves -a + a as it is.

Separately, the result depends on how a sum is written: 2 - 2*cos(2*x) - 4*sin(x)^2 simplifies to 0, but the same expression written 2 + (-2) * cos(2 * x) + (-4) * sin(x) ^ 2 (which is how the first prints) stays as it is. So (cos(2*x) - 1)^2 + sin(2*x)^2 - 4*sin(x)^2 stops at that second form.

Found while reading Modenov's Problems in Geometry for #2131, whose proofs reduce to identities like these.

Activity

  1. added this to the 2.8 milestone on Oct 27, 2026
  2. Rafael-SOWNet commented on Oct 27, 2026

    @Rafael-SOWNet
    MemberAuthor

    The three rows of the table are answered since #2174, which offers the rational canonical form as a Simplify candidate: 0 provided not a * b = 0 for the first, and 0 provided not a * b * c = 0 for the other two. Still open here is the trigonometric part: 2 - 2*cos(2*x) - 4*sin(x)^2 reaches 0, while the same sum written 2 + (-2) * cos(2 * x) + (-4) * sin(x) ^ 2 stays, so (cos(2*x) - 1)^2 + sin(2*x)^2 - 4*sin(x)^2 stops at that second form.

  3. Rafael-SOWNet commented on Oct 28, 2026

    @Rafael-SOWNet
    MemberAuthor

    (cos(2*x) - 1)^2 + sin(2*x)^2 - 4*sin(x)^2 is 0 since #2179, which decides a rational function of sines and cosines whose angles are rational combinations of the variables. #2174 already answered the three rational rows, so every row of the table above now reaches 0 in one Simplify.

    Still open here is the general point in the title: an answer that one more Simplify takes further. That property is what canoncheck's idempotence check measures.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

  4. Rafael-SOWNet commented on Oct 31, 2026

    @Rafael-SOWNet
    MemberAuthor

    Closing. Every row of the table reaches 0 in one Simplify on master (5d973db): the rational rows since #2174, and the trigonometric one since #2179.

    The general point in the title, an answer that one more Simplify takes further, is idempotence, and canoncheck measures it on every change against canoncheck-baseline.tsv. A new instance turned up in #2306: a cancellation landed Simplify on a candidate one step short of 0 for #557's second expression, and DoubleAngleOverSineTest caught it before merge. A case found this way gets its own issue.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions