Repository navigation
feat(Data/Nat/Totient): totient of a pairwise coprime product - #45343
thinkthoughts wants to merge 2 commits into
Conversation
Add `Nat.totient_prod_primes`: for a finset `s` of primes, `φ (∏ p ∈ s, p) = ∏ p ∈ s, (p - 1)`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AjRwojYPe695zPRdrZ1Uik
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to Zulip and join the Lean community. |
PR summary 3925850029Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
There was a problem hiding this comment.
Welcome!
Could you please add the LLM-generated label? See the contribution guide
Also could you rewrite the description yourself? It should be short and to the point. You can place any extra info below the fold (---)
|
LLM-generated |
Add `Nat.totient_prod_of_pairwise_coprime` and derive the prime case from it. Rename `Nat.totient_prod_primes` to `Nat.totient_prod_of_forall_prime`, as requested in review.
|
-awaiting-author |
|
|
||
| /-- The totient of a product of pairwise coprime factors is the product of their totients. -/ | ||
| theorem totient_prod_of_pairwise_coprime {ι : Type*} {s : Finset ι} {f : ι → ℕ} | ||
| (hs : Set.Pairwise s <| Coprime.onFun f) : φ (∏ i ∈ s, f i) = ∏ i ∈ s, φ (f i) := by |
There was a problem hiding this comment.
Really I feel like we ought to prove this for ArithmeticFunction.IsMultiplicative rather than duplicating the proof for each multiplicative function separately. The totient as an arithmetic function is here: #46097
My PR adds a theorem for Euler's totient function over a product of natural numbers, where any two distinct factors have a greatest common divisor of 1.
It also adds a theorem for products of distinct primes, where each prime contributes its value minus one. The prime-specific result follows from the more general totient-product theorem.
Both results provide reusable statements in Mathlib using existing properties of Euler's totient function.
Validation: The revised PR passed all 12 applicable Mathlib CI checks, including build and lint checks. Two additional checks were skipped. No new imports or axioms introduced.
Research context: This comes from my work on the General Divisor Theorem and Lean prime-gap formalization; specifically consdering Euler's totient function and products of distinct primes.
General Divisor Theorem: https://github.com/thinkthoughts/general-divisor-theorem
Lean prime-gap formalization: https://github.com/thinkthoughts/lean-bgp212
Related (my initial) mathematical work: https://translatepi.ai/main.pdf
AI assistance: I used Claude to develop the Lean proofs, prepare the patch, and perform local compilation and lint checks. I used ChatGPT to review the mathematical specification and help identify a reusable Mathlib contribution. ChatGPT and DeepSeek also assisted with reviewing the sustainably optimized proof, and explaining its mathematical structure.
I read Cantor's diagonal argument in 2003 and have since directed my own work, and reviewed the results; so I'm responsible for the submitted work. And thanks for your help!