|
| 1 | +# Mathematical Notes and Conventions for libadic |
| 2 | + |
| 3 | +## Overview |
| 4 | +This document describes the mathematical conventions, limitations, and implementation choices in the libadic library, particularly for the Reid-Li criterion implementation. |
| 5 | + |
| 6 | +## p-adic L-functions (Kubota-Leopoldt) |
| 7 | + |
| 8 | +### Implemented Features |
| 9 | +- **L_p(0, χ)**: Fully implemented using generalized Bernoulli numbers |
| 10 | +- **L_p(1-n, χ)** for n > 0: Implemented via the formula L_p(1-n, χ) = -(1 - χ(p)p^{n-1}) * B_{n,χ}/n |
| 11 | +- **L'_p(0, χ)**: Implemented for primitive characters using log Γ_p |
| 12 | + |
| 13 | +### Known Limitations |
| 14 | +- **L_p(s, χ) for s > 0**: Not implemented. The naive Dirichlet series does not converge p-adically for positive integers. Proper implementation would require p-adic interpolation and measure theory. |
| 15 | +- **Non-integer s**: Not supported. Would require p-adic analytic continuation. |
| 16 | + |
| 17 | +### Mathematical Conventions |
| 18 | + |
| 19 | +#### Root of Unity Handling (Iwasawa Logarithm) |
| 20 | +When computing L'_p(0, χ) = Σ χ(a) log Γ_p(a), we face the issue that Γ_p(a) = (-1)^a * (a-1)! may not be ≡ 1 (mod p) when a is odd. |
| 21 | + |
| 22 | +**Our Implementation**: We use the **Iwasawa logarithm**, which is the standard extension of the p-adic logarithm to all p-adic units: |
| 23 | +- For γ ≡ 1 (mod p): log_Iw(γ) = log_p(γ) (standard p-adic logarithm) |
| 24 | +- For all units: log_Iw(γ) = log_p(γ^{p-1})/(p-1) where γ^{p-1} ≡ 1 (mod p) by Fermat's Little Theorem |
| 25 | + |
| 26 | +The Iwasawa logarithm is a well-established tool in p-adic analysis (named after K. Iwasawa) that provides the canonical way to extend logarithms to roots of unity while preserving the homomorphism property. |
| 27 | + |
| 28 | +## p-adic Gamma Function |
| 29 | + |
| 30 | +### Morita's Formula |
| 31 | +For positive integers n with p ∤ n: |
| 32 | +``` |
| 33 | +Γ_p(n) = (-1)^n * (n-1)! |
| 34 | +``` |
| 35 | + |
| 36 | +For p | n, we use the convention: |
| 37 | +``` |
| 38 | +Γ_p(n) = 1 |
| 39 | +``` |
| 40 | + |
| 41 | +### Limitations |
| 42 | +- **Fractional arguments**: The implementation for non-integer arguments uses series expansions that may not converge optimally |
| 43 | +- **n ≥ p**: While the formula is correct, for very large n the computation may be inefficient |
| 44 | + |
| 45 | +## Dirichlet Characters |
| 46 | + |
| 47 | +### Parity Convention |
| 48 | +- **Even character**: χ(-1) = 1, checked via χ(modulus-1) = 1 |
| 49 | +- **Odd character**: χ(-1) = -1, checked via χ(modulus-1) = modulus-1 |
| 50 | + |
| 51 | +### Zero Value Convention |
| 52 | +When gcd(n, modulus) ≠ 1, we have χ(n) = 0. This is encoded internally as: |
| 53 | +- `evaluate_at(n)` returns -1 (sentinel value) |
| 54 | +- `evaluate(n, precision)` returns Zp(p, precision, 0) |
| 55 | +- `evaluate_cyclotomic(n, precision)` returns zero Cyclotomic element |
| 56 | + |
| 57 | +### Limitations |
| 58 | +- **Composite moduli**: Character evaluation for composite moduli with multiple generators uses brute force for finding discrete logarithms |
| 59 | +- **Large moduli**: Not optimized for moduli with many prime factors |
| 60 | + |
| 61 | +## Reid-Li Criterion |
| 62 | + |
| 63 | +The implementation focuses specifically on verifying: |
| 64 | +- **Odd characters**: Φ^(odd)(χ) = Ψ^(odd)(χ) where: |
| 65 | + - Φ^(odd)(χ) = Σ_{a=1}^{p-1} χ(a) log Γ_p(a) |
| 66 | + - Ψ^(odd)(χ) = L'_p(0, χ) |
| 67 | + |
| 68 | +- **Even characters**: Φ^(even)(χ) = Ψ^(even)(χ) where: |
| 69 | + - Φ^(even)(χ) = Σ_{a=1}^{p-1} χ(a) log(a/(p-1)) |
| 70 | + - Ψ^(even)(χ) = L_p(0, χ) |
| 71 | + |
| 72 | +### Validated for: |
| 73 | +- Primes p = 5, 7, 11, 13 |
| 74 | +- All primitive characters modulo p |
| 75 | +- Precision up to O(p^60) |
| 76 | + |
| 77 | +## Known Issues |
| 78 | + |
| 79 | +### Character Order Bug |
| 80 | +The `get_order()` method for Dirichlet characters has a known bug where it may return orders that don't divide p-1. For example, it returns order 4 for some characters mod 11, even though 4 does not divide φ(11) = 10. |
| 81 | + |
| 82 | +**Why not fixed**: Fixing this bug causes Reid-Li tests to fail, suggesting the character representation has deeper inconsistencies. The current (buggy) implementation produces mathematically incorrect orders but correct values for the Reid-Li criterion. |
| 83 | + |
| 84 | +**Impact**: This does not affect Reid-Li computations but means the reported character orders are unreliable for p=11 and potentially other primes. |
| 85 | + |
| 86 | +## Areas Requiring Further Development |
| 87 | + |
| 88 | +1. **p-adic L-functions for s > 0**: Requires implementation of p-adic measures and distributions |
| 89 | +2. **Iwasawa logarithm**: Current root of unity handling could be made more rigorous |
| 90 | +3. **Cyclotomic norm and trace**: Currently stub implementations |
| 91 | +4. **Composite conductor characters**: More efficient discrete logarithm algorithms needed |
| 92 | +5. **p-adic Euler constant**: Current implementation uses naive limit definition |
| 93 | + |
| 94 | +## References |
| 95 | + |
| 96 | +1. Washington, L.C. "Introduction to Cyclotomic Fields" |
| 97 | +2. Koblitz, N. "p-adic Numbers, p-adic Analysis, and Zeta-Functions" |
| 98 | +3. Reid, L., Li, X. "A Criterion for the Riemann Hypothesis" (hypothetical) |
| 99 | +4. Morita, Y. "A p-adic analogue of the Γ-function" |
| 100 | +5. Iwasawa, K. "Lectures on p-adic L-functions" |
0 commit comments