leanprover-community / leanprover-community/mathlib4
GCD of sum and difference
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 4.2k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
I have a suggestion for a theorem to add to Mathlib:
gcd(m + n, m - n) = 1 if gcd(m, n) = 1 and m and n are of opposite parity.
Here is an example proof:
https://github.com/michael-roe/number-theory/blob/main/gcd_sum_diff.lean
People will probably have objections to the style of that example proof, so I posting this as an issue rather than submitting a PR.
(E.g. the supplied proof is for is m odd, n even. You might want a proof for m odd n even or m even n odd.)
One of the reasons we might want to have this theorem in Mathlib is it’s one of the building blocks for Fermat’s right angled triangle theorem:
https://en.wikipedia.org/wiki/Fermat%27s_right_triangle_theorem
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked gcd_sum_diff.lean example, then search Mathlib for existing gcd and parity lemmas relevant to the stated theorem. Done means adding a theorem that proves gcd(m + n, m - n) = 1 from coprimality and opposite parity, covering both parity orientations.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100