Repository navigation
A trigonometric identity is decided over the sines and cosines of its base angles - #2179
Merged
Rafael-SOWNet merged 1 commit intoOct 28, 2026
Conversation
… base angles The tangent addition formula, the half-angle formulas, the Weierstrass forms and sum-to-product came back from Simplify unchanged. Each needs an angle opened, doubled or halved and the Pythagorean pair taken, in one order, and the rules take those a step at a time. TrigonometricIdentity decides whether a rational function of the six trigonometric functions is a constant, where its angles are rational combinations of its variables with no constant term. A variable's base angle is the variable over the least common denominator of its coefficients, so every angle is a whole combination of base angles, and every sine and cosine is a polynomial in their sines and cosines: a Chebyshev polynomial for a multiple, the addition theorem for a sum. The expression is then a quotient of polynomials over Q. With each sin(u)^2 written as 1 - cos(u)^2 a polynomial's form is unique, the relations' leading monomials being coprime, so the quotient is the constant k exactly when the numerator's form is k times the denominator's. Both theorems hold for every complex angle. Simplify offers that constant as a candidate, with the expression's own domain as its condition, and not where the rules already reached it, so that a derivation still records the rules' steps. Closes #2142. Part of #2133. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2179 +/- ##
==========================================
- Coverage 86.46% 86.42% -0.04%
==========================================
Files 295 296 +1
Lines 65014 65221 +207
Branches 19099 19165 +66
==========================================
+ Hits 56214 56370 +156
- Misses 4767 4802 +35
- Partials 4033 4049 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Oct 28, 2026
Rafael-SOWNet
deleted the
a-trigonometric-identity-is-decided-over-its-base-angles
branch
October 28, 2026 19:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tangent addition formula, the half-angle formulas, the Weierstrass forms and sum-to-product came back from
Simplifyunchanged. Each needs an angle opened, doubled or halved and the Pythagorean pair taken, in one order, and the rules take those a step at a time.This decides them all in one procedure,
TrigonometricIdentity.TryConstant. It applies to a rational function of the six trigonometric functions whose angles are rational combinations of its variables with no constant term:sin(u)^2written as1 - cos(u)^2a polynomial's form is unique (the relations' leading monomials are coprime, so they are a Gröbner basis);kexactly when the numerator's form isktimes the denominator's.Both theorems hold for every complex angle.
Simplifyoffers the constant as a candidate, with the expression's own domain as its condition, as it does fora - a. It is skipped where the rules already reached the same answer, so that a derivation still records their steps.tan(s + t) - (tan(s) + tan(t))/(1 - tan(s)*tan(t))0 provided not cos(s + t) = 0 and not 1 - tan(s) * tan(t) = 0 and not cos(s) = 0 and not cos(t) = 0sin(a/2)^2 - (1 - cos(a))/20tan(a/2) - sin(a)/(1 + cos(a))0 provided not cos(a / 2) * (cos(a) + 1) = 0sin(a) - 2*tan(a/2)/(1 + tan(a/2)^2)0 provided not 1 + tan(a / 2) ^ 2 = 0 and not cos(a / 2) = 0sin(a) + sin(b) - 2*sin((a + b)/2)*cos((a - b)/2)0(1 - cos(a))/(1 + cos(a))/tan(a/2)^2(1 - cos(a)) / ((cos(a) + 1) * tan(a / 2) ^ 2)1 provided not cos(a) + 1 = 0 and not tan(a / 2) = 0 and not cos(a / 2) = 0(cos(2*x) - 1)^2 + sin(2*x)^2 - 4*sin(x)^2(#2133)2 + (-2) * cos(2 * x) + (-4) * sin(x) ^ 20With this, every identity #2142 lists is proved. The product-to-sum formulas and the cosine power reduction already were, since #2161 and #2177. #2133's trigonometric row reaches
0too. Its other three rows were answered by #2174, so every row of its table is now answered.Declined, by design: an angle with a constant term, a named constant such as
pi, or an irrational coefficient. The decision needs the Pythagorean relation to be the only one, andsin(pi) = 0is another. The rules settle these.Measured
SimplifyHardreads +2.4% andSolveMediumHard+1.8% against the baseline. Counted directly on this machine, master allocates the same on both inputs (161.85 MB and 1.437 MB a call, within 0.03%), so neither figure is this change.Closes #2142. Part of #2133.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura