leanprover-community / leanprover-community/mathlib4

GCD of sum and difference

Open
#37,366 6 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.