@enumeratio/adeles
Adèles and idèles over for compute-engine — a port of Mathé Hertogh's Sage adeles package. Three value heads (ProfiniteNumber, Adele, Idele) carry a number known only modulo something, and existing heads (arithmetic, Equal, Numerator, Fibonacci, LucasL) learn to take them rather than growing new ones.
Usage
import { declareAdeles } from "@enumeratio/adeles";
declareAdeles(ce);ProfiniteNumber(3, 12) + ProfiniteNumber(5, 8) // ProfiniteNumber(0, 4)
Equal(ProfiniteNumber(6, 20), ProfiniteNumber(6, 40)) // True
Numerator(ProfiniteNumber(Rational(2, 3), 5)) // ProfiniteNumber(2, 15)./src exports the raw TypeScript entry for a workspace consumer; profinite and idele are re-exported as namespaces over the plain-value arithmetic (Profinite, IdeleFinite) that the heads box and unbox. determinant, inverse and profiniteDecomposition (from matrix.ts) implement strong approximation for and back ProfiniteDecomposition.
Heads
Values. ProfiniteNumber is the coset ; modulus 0 is exact. ProfiniteNumber(list) glues a list of AdicNumeral values back together by CRT. Adele pairs a real with a profinite number; Idele is a unit of the adèle ring, principal everywhere except a named finite set of primes.
Matrices. ProfiniteDecomposition factors as with and upper triangular.
Visualization. ProfinitePlot draws a profinite function as an ArrayPlot, residue classes laid out by factorial digits.
See also
See Adèles and idèles for the worked walkthrough — cosets, equality as "the sets meet", one prime at a time, and profinite Fibonacci.
Builds on @enumeratio/number-theory (Hermite normal form, for the matrix decomposition), @enumeratio/numerals (AdicNumeral, the p-adic values a profinite number's list form glues together), and @enumeratio/residues (CRT, modular inverse).
Pages
- Source:
packages/symbols/arithmetic/adeles - Depends on:
engine,manifest,number-theory,numerals,residues - In development, also:
config