Repository navigation
One and a squared tangent are found anywhere in a sum - #2176
Merged
Rafael-SOWNet merged 1 commit intoOct 27, 2026
Merged
Conversation
1 + tan(x)^2 = sec(x)^2 and 1 + cot(x)^2 = csc(x)^2 are rules in TrigonometricRules for two siblings, and the sort decides whether the 1 and the square are siblings. Secant sorts before tangent, so 1 + tan(x)^2 - sec(x)^2 became 1 - sec(x)^2 + tan(x)^2 and stayed, while 1 + cot(x)^2 - cosec(x)^2, where cotangent sorts before cosecant, was 0 provided not sin(x) = 0. #2142 has the pair. Both identities are added to PythagoreanIdentity as gathered rules, as that set already finds sin^2 + cos^2 wherever the two terms sit: SoundUnderAssumptions as the sibling rules are, since each side is defined only where cos (sin) is not 0, two-sided, reversible, Collects, and each with its identity. The census moves by two in WritingARule.md, Saturation's remark and the tests that pin them; ReversibleRuleTest's hole-dropping check names the two Pythagorean rules rather than every rule of the set, since these two keep their argument. On 2.6.0 and on this branch, Simplify: 1 + tan(x)^2 - sec(x)^2 unchanged -> 0 provided not cos(x) = 0 a + 1 + tan(y)^2 - sec(y)^2 unchanged -> a provided not cos(y) = 0 Chain against master c90db9f: verdicts identical, 0 moves; performance gate passed on all 19; unit suite 17,164 passed, 0 failed. RuleCheck passes, Confluence and CanonCheck match their baselines, SimpSweep 10,463/10,463. Part of #2142 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2176 +/- ##
==========================================
+ Coverage 86.44% 86.46% +0.01%
==========================================
Files 295 295
Lines 64930 64969 +39
Branches 19092 19092
==========================================
+ Hits 56130 56176 +46
+ Misses 4771 4765 -6
+ Partials 4029 4028 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
deleted the
one-and-a-squared-tangent-are-found-anywhere-in-a-sum
branch
October 28, 2026 10:28
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.
Part of #2142:
1 + tan(x)^2 = sec(x)^2, the second pair in its table.The defect:
1 + tan(x)^2 = sec(x)^2and1 + cot(x)^2 = csc(x)^2are rules inTrigonometricRulesfor two siblings, so the sort decides whether the1and the square meet.1 + tan(x)^2 - sec(x)^2became1 - sec(x)^2 + tan(x)^2and stayed.0 provided not sin(x) = 0.The change: both identities are added to
PythagoreanIdentityas gathered rules. That set already findssin^2 + cos^2wherever the two terms sit in a sum, and #2175 did the same with a coefficient.SoundUnderAssumptions, as the sibling rules are, since each side is defined only wherecos(sin) is not 0.Collects, and carries its identity.The census moves by two in
WritingARule.md, in the remark inSaturation.cs, and in the tests that pin them.ReversibleRuleTest's hole-dropping check now names the two Pythagorean rules instead of every rule of the set, because these two keep their argument.Simplify1 + tan(x)^2 - sec(x)^20 provided not cos(x) = 0a + 1 + tan(y)^2 - sec(y)^2a provided not cos(y) = 0Still open on #2142:
cos(x)^2 - (1 + cos(2x))/2, whose sine twin is answered. Its candidates reach-1/2 + cos(x)^2/2 + sin(x)^2/2, and the two squares there are quotients rather than products, so neither Pythagorean rule matches them.Checked:
TangentSecantIdentityTest: 5 rows.c90db9f13: identical verdicts in all nine families, 0 moves.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura